@stevederico/skateboard-ui 3.0.2 → 3.6.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/App.jsx +13 -13
- package/CHANGELOG.md +64 -0
- package/README.md +59 -65
- package/components/AuthOverlay.jsx +4 -4
- package/components/ProtectedRoute.jsx +1 -1
- package/components/ThemeToggle.jsx +1 -1
- package/components/UpgradeSheet.jsx +2 -2
- package/{core → components/core}/DynamicIcon.jsx +1 -1
- package/{layout → components/layout}/Header.jsx +4 -4
- package/{layout → components/layout}/Layout.jsx +1 -1
- package/{layout → components/layout}/Sidebar.jsx +2 -2
- package/{layout → components/layout}/TabBar.jsx +1 -1
- package/{views → components/views}/LandingView.jsx +5 -5
- package/{views → components/views}/NotFound.jsx +2 -2
- package/{views → components/views}/PaymentView.jsx +1 -1
- package/{views → components/views}/SettingsView.jsx +6 -6
- package/{views → components/views}/SignInView.jsx +6 -6
- package/{views → components/views}/SignOutView.jsx +1 -1
- package/{views → components/views}/SignUpView.jsx +6 -6
- package/{views → components/views}/TextView.jsx +3 -3
- package/hooks/useAuthGate.js +1 -1
- package/index.js +1 -1
- package/package.json +32 -50
- package/shadcn/lib/base-ui/LICENSE +21 -0
- package/shadcn/lib/base-ui/_chunk-01rqe37g.js +70 -0
- package/shadcn/lib/base-ui/_chunk-0h5sskyw.js +347 -0
- package/shadcn/lib/base-ui/_chunk-0xhx4g7r.js +57 -0
- package/shadcn/lib/base-ui/_chunk-1e6khrvm.js +218 -0
- package/shadcn/lib/base-ui/_chunk-1s41sngz.js +302 -0
- package/shadcn/lib/base-ui/_chunk-20rtfsz9.js +23 -0
- package/shadcn/lib/base-ui/_chunk-2tyt8f8r.js +6034 -0
- package/shadcn/lib/base-ui/_chunk-3f31ka8n.js +11 -0
- package/shadcn/lib/base-ui/_chunk-3h6zpchb.js +89 -0
- package/shadcn/lib/base-ui/_chunk-4s0k3h7t.js +114 -0
- package/shadcn/lib/base-ui/_chunk-502wngfc.js +598 -0
- package/shadcn/lib/base-ui/_chunk-536jvgeq.js +68 -0
- package/shadcn/lib/base-ui/_chunk-611pz5sm.js +10 -0
- package/shadcn/lib/base-ui/_chunk-65zw5gs2.js +15 -0
- package/shadcn/lib/base-ui/_chunk-6b17g8t7.js +34 -0
- package/shadcn/lib/base-ui/_chunk-6xevjepc.js +15 -0
- package/shadcn/lib/base-ui/_chunk-71zm6zgv.js +16 -0
- package/shadcn/lib/base-ui/_chunk-7fmjymvh.js +32 -0
- package/shadcn/lib/base-ui/_chunk-7jjzay8b.js +176 -0
- package/shadcn/lib/base-ui/_chunk-7v1t86x1.js +43 -0
- package/shadcn/lib/base-ui/_chunk-85vrgzwr.js +227 -0
- package/shadcn/lib/base-ui/_chunk-8jz3hb7q.js +9 -0
- package/shadcn/lib/base-ui/_chunk-8kh3xk78.js +35 -0
- package/shadcn/lib/base-ui/_chunk-97tas84n.js +67 -0
- package/shadcn/lib/base-ui/_chunk-9nyxkvte.js +13 -0
- package/shadcn/lib/base-ui/_chunk-a8fwg9d0.js +52 -0
- package/shadcn/lib/base-ui/_chunk-agc6ew3g.js +29 -0
- package/shadcn/lib/base-ui/_chunk-aqwsk46c.js +64 -0
- package/shadcn/lib/base-ui/_chunk-atd5kq5q.js +803 -0
- package/shadcn/lib/base-ui/_chunk-atnkefgd.js +104 -0
- package/shadcn/lib/base-ui/_chunk-b40erthe.js +7 -0
- package/shadcn/lib/base-ui/_chunk-b5jsqt97.js +50 -0
- package/shadcn/lib/base-ui/_chunk-bk7n9s9e.js +15 -0
- package/shadcn/lib/base-ui/_chunk-c3572b5x.js +19 -0
- package/shadcn/lib/base-ui/_chunk-cwr896nf.js +25 -0
- package/shadcn/lib/base-ui/_chunk-drfb9kp2.js +27 -0
- package/shadcn/lib/base-ui/_chunk-ds8fnpjj.js +0 -0
- package/shadcn/lib/base-ui/_chunk-ek863ta9.js +82 -0
- package/shadcn/lib/base-ui/_chunk-f09cp81f.js +12 -0
- package/shadcn/lib/base-ui/_chunk-f5d01bp9.js +0 -0
- package/shadcn/lib/base-ui/_chunk-f9tgee1q.js +21 -0
- package/shadcn/lib/base-ui/_chunk-fch5cba8.js +84 -0
- package/shadcn/lib/base-ui/_chunk-gfce3j3z.js +18 -0
- package/shadcn/lib/base-ui/_chunk-ha06w2pp.js +2391 -0
- package/shadcn/lib/base-ui/_chunk-hzgetm70.js +23 -0
- package/shadcn/lib/base-ui/_chunk-j0eqdjta.js +39 -0
- package/shadcn/lib/base-ui/_chunk-k1e5fvcj.js +48 -0
- package/shadcn/lib/base-ui/_chunk-k4mc2kan.js +81 -0
- package/shadcn/lib/base-ui/_chunk-kfz96xv1.js +128 -0
- package/shadcn/lib/base-ui/_chunk-m45547cc.js +15 -0
- package/shadcn/lib/base-ui/_chunk-mbn76q14.js +184 -0
- package/shadcn/lib/base-ui/_chunk-mvv30fkv.js +9 -0
- package/shadcn/lib/base-ui/_chunk-mznt6ktj.js +33 -0
- package/shadcn/lib/base-ui/_chunk-n7dnqnbw.js +7 -0
- package/shadcn/lib/base-ui/_chunk-nya71ccw.js +546 -0
- package/shadcn/lib/base-ui/_chunk-p6qynd6r.js +146 -0
- package/shadcn/lib/base-ui/_chunk-q3nee19r.js +323 -0
- package/shadcn/lib/base-ui/_chunk-q7yw9mz4.js +385 -0
- package/shadcn/lib/base-ui/_chunk-qce0xt57.js +107 -0
- package/shadcn/lib/base-ui/_chunk-qgzhcjsj.js +14 -0
- package/shadcn/lib/base-ui/_chunk-qt6r015s.js +38 -0
- package/shadcn/lib/base-ui/_chunk-r0vsdknk.js +4 -0
- package/shadcn/lib/base-ui/_chunk-sx6vkz01.js +150 -0
- package/shadcn/lib/base-ui/_chunk-szcr6mhk.js +6 -0
- package/shadcn/lib/base-ui/_chunk-t7j3rbpv.js +67 -0
- package/shadcn/lib/base-ui/_chunk-tmfmrzwe.js +39 -0
- package/shadcn/lib/base-ui/_chunk-v92ycsfj.js +9 -0
- package/shadcn/lib/base-ui/_chunk-vdc01ss3.js +6 -0
- package/shadcn/lib/base-ui/_chunk-vjbnhhg1.js +26 -0
- package/shadcn/lib/base-ui/_chunk-w68yxg9d.js +21 -0
- package/shadcn/lib/base-ui/_chunk-wana68v3.js +477 -0
- package/shadcn/lib/base-ui/_chunk-wtw745qd.js +12 -0
- package/shadcn/lib/base-ui/_chunk-xb7ph1ka.js +6 -0
- package/shadcn/lib/base-ui/_chunk-xfagb0fq.js +28 -0
- package/shadcn/lib/base-ui/_chunk-xxhqanfd.js +16 -0
- package/shadcn/lib/base-ui/_chunk-y887e46p.js +15 -0
- package/shadcn/lib/base-ui/_chunk-ymj1dpqg.js +14 -0
- package/shadcn/lib/base-ui/accordion.js +650 -0
- package/shadcn/lib/base-ui/alert-dialog.js +138 -0
- package/shadcn/lib/base-ui/avatar.js +235 -0
- package/shadcn/lib/base-ui/button.js +52 -0
- package/shadcn/lib/base-ui/checkbox.js +454 -0
- package/shadcn/lib/base-ui/collapsible.js +283 -0
- package/shadcn/lib/base-ui/context-menu.js +324 -0
- package/shadcn/lib/base-ui/dialog.js +71 -0
- package/shadcn/lib/base-ui/input.js +1028 -0
- package/shadcn/lib/base-ui/menu.js +61 -0
- package/shadcn/lib/base-ui/menubar.js +157 -0
- package/shadcn/lib/base-ui/merge-props.js +15 -0
- package/shadcn/lib/base-ui/navigation-menu.js +1854 -0
- package/shadcn/lib/base-ui/popover.js +1090 -0
- package/shadcn/lib/base-ui/preview-card.js +709 -0
- package/shadcn/lib/base-ui/progress.js +278 -0
- package/shadcn/lib/base-ui/radio-group.js +247 -0
- package/shadcn/lib/base-ui/radio.js +382 -0
- package/shadcn/lib/base-ui/scroll-area.js +1061 -0
- package/shadcn/lib/base-ui/select.js +2438 -0
- package/shadcn/lib/base-ui/separator.js +11 -0
- package/shadcn/lib/base-ui/slider.js +1595 -0
- package/shadcn/lib/base-ui/switch.js +333 -0
- package/shadcn/lib/base-ui/tabs.js +892 -0
- package/shadcn/lib/base-ui/toggle-group.js +152 -0
- package/shadcn/lib/base-ui/toggle.js +133 -0
- package/shadcn/lib/base-ui/tooltip.js +791 -0
- package/shadcn/lib/base-ui/use-render.js +15 -0
- package/shadcn/lib/tailwind-merge.js +3312 -0
- package/shadcn/lib/utils.js +1 -1
- package/shadcn/ui/accordion.jsx +1 -1
- package/shadcn/ui/alert-dialog.jsx +1 -1
- package/shadcn/ui/avatar.jsx +1 -1
- package/shadcn/ui/badge.jsx +2 -2
- package/shadcn/ui/breadcrumb.jsx +2 -2
- package/shadcn/ui/button-group.jsx +2 -2
- package/shadcn/ui/button.jsx +1 -1
- package/shadcn/ui/calendar.jsx +1 -1
- package/shadcn/ui/checkbox.jsx +1 -1
- package/shadcn/ui/collapsible.jsx +1 -1
- package/shadcn/ui/command.jsx +1 -1
- package/shadcn/ui/context-menu.jsx +1 -1
- package/shadcn/ui/dialog.jsx +1 -1
- package/shadcn/ui/drawer.jsx +176 -74
- package/shadcn/ui/dropdown-menu.jsx +1 -1
- package/shadcn/ui/hover-card.jsx +1 -1
- package/shadcn/ui/input.jsx +1 -1
- package/shadcn/ui/item.jsx +2 -2
- package/shadcn/ui/menubar.jsx +2 -2
- package/shadcn/ui/navigation-menu.jsx +1 -1
- package/shadcn/ui/popover.jsx +1 -1
- package/shadcn/ui/progress.jsx +1 -1
- package/shadcn/ui/radio-group.jsx +2 -2
- package/shadcn/ui/scroll-area.jsx +1 -1
- package/shadcn/ui/select.jsx +1 -1
- package/shadcn/ui/separator.jsx +1 -1
- package/shadcn/ui/sheet.jsx +1 -1
- package/shadcn/ui/sidebar.jsx +3 -3
- package/shadcn/ui/slider.jsx +1 -1
- package/shadcn/ui/switch.jsx +1 -1
- package/shadcn/ui/tabs.jsx +1 -1
- package/shadcn/ui/toggle-group.jsx +2 -2
- package/shadcn/ui/toggle.jsx +1 -1
- package/shadcn/ui/tooltip.jsx +1 -1
- package/styles.css +31 -0
- package/MIGRATION.md +0 -230
- package/shadcn/ui/carousel.jsx +0 -195
- package/shadcn/ui/chart.jsx +0 -312
- package/shadcn/ui/resizable.jsx +0 -47
- /package/{core → components/core}/Calendar.jsx +0 -0
- /package/{core → components/core}/Command.jsx +0 -0
- /package/{core → components/core}/Context.jsx +0 -0
- /package/{core → components/core}/ThemeProvider.jsx +0 -0
- /package/{core → components/core}/Utilities.js +0 -0
|
@@ -0,0 +1,598 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useDirection
|
|
3
|
+
} from "./_chunk-wtw745qd.js";
|
|
4
|
+
import {
|
|
5
|
+
popupStateMapping
|
|
6
|
+
} from "./_chunk-536jvgeq.js";
|
|
7
|
+
import {
|
|
8
|
+
DISABLED_TRANSITIONS_STYLE,
|
|
9
|
+
autoUpdate,
|
|
10
|
+
flip,
|
|
11
|
+
hide,
|
|
12
|
+
limitShift,
|
|
13
|
+
offset,
|
|
14
|
+
shift,
|
|
15
|
+
size,
|
|
16
|
+
useFloating
|
|
17
|
+
} from "./_chunk-2tyt8f8r.js";
|
|
18
|
+
import {
|
|
19
|
+
ownerDocument
|
|
20
|
+
} from "./_chunk-xb7ph1ka.js";
|
|
21
|
+
import {
|
|
22
|
+
useValueAsRef
|
|
23
|
+
} from "./_chunk-drfb9kp2.js";
|
|
24
|
+
import {
|
|
25
|
+
clamp,
|
|
26
|
+
evaluate,
|
|
27
|
+
getAlignment,
|
|
28
|
+
getAlignmentAxis,
|
|
29
|
+
getAxisLength,
|
|
30
|
+
getPaddingObject,
|
|
31
|
+
getSide,
|
|
32
|
+
getSideAxis
|
|
33
|
+
} from "./_chunk-nya71ccw.js";
|
|
34
|
+
import {
|
|
35
|
+
getWindow
|
|
36
|
+
} from "./_chunk-sx6vkz01.js";
|
|
37
|
+
import {
|
|
38
|
+
useStableCallback
|
|
39
|
+
} from "./_chunk-mznt6ktj.js";
|
|
40
|
+
import {
|
|
41
|
+
useIsoLayoutEffect
|
|
42
|
+
} from "./_chunk-b40erthe.js";
|
|
43
|
+
import {
|
|
44
|
+
EMPTY_OBJECT,
|
|
45
|
+
useRenderElement
|
|
46
|
+
} from "./_chunk-1s41sngz.js";
|
|
47
|
+
|
|
48
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/utils/getDisabledMountTransitionStyles.js
|
|
49
|
+
function getDisabledMountTransitionStyles(transitionStatus) {
|
|
50
|
+
return transitionStatus === "starting" ? DISABLED_TRANSITIONS_STYLE : EMPTY_OBJECT;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/utils/adaptiveOriginMiddleware.js
|
|
54
|
+
var DEFAULT_SIDES = {
|
|
55
|
+
sideX: "left",
|
|
56
|
+
sideY: "top"
|
|
57
|
+
};
|
|
58
|
+
var adaptiveOrigin = {
|
|
59
|
+
name: "adaptiveOrigin",
|
|
60
|
+
async fn(state) {
|
|
61
|
+
const {
|
|
62
|
+
x: rawX,
|
|
63
|
+
y: rawY,
|
|
64
|
+
rects: {
|
|
65
|
+
floating: floatRect
|
|
66
|
+
},
|
|
67
|
+
elements: {
|
|
68
|
+
floating
|
|
69
|
+
},
|
|
70
|
+
platform,
|
|
71
|
+
strategy,
|
|
72
|
+
placement
|
|
73
|
+
} = state;
|
|
74
|
+
const win = getWindow(floating);
|
|
75
|
+
const styles = win.getComputedStyle(floating);
|
|
76
|
+
const hasTransition = styles.transitionDuration !== "0s" && styles.transitionDuration !== "";
|
|
77
|
+
if (!hasTransition) {
|
|
78
|
+
return {
|
|
79
|
+
x: rawX,
|
|
80
|
+
y: rawY,
|
|
81
|
+
data: DEFAULT_SIDES
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
const offsetParent = await platform.getOffsetParent?.(floating);
|
|
85
|
+
let offsetDimensions = {
|
|
86
|
+
width: 0,
|
|
87
|
+
height: 0
|
|
88
|
+
};
|
|
89
|
+
if (strategy === "fixed" && win?.visualViewport) {
|
|
90
|
+
offsetDimensions = {
|
|
91
|
+
width: win.visualViewport.width,
|
|
92
|
+
height: win.visualViewport.height
|
|
93
|
+
};
|
|
94
|
+
} else if (offsetParent === win) {
|
|
95
|
+
const doc = ownerDocument(floating);
|
|
96
|
+
offsetDimensions = {
|
|
97
|
+
width: doc.documentElement.clientWidth,
|
|
98
|
+
height: doc.documentElement.clientHeight
|
|
99
|
+
};
|
|
100
|
+
} else if (await platform.isElement?.(offsetParent)) {
|
|
101
|
+
offsetDimensions = await platform.getDimensions(offsetParent);
|
|
102
|
+
}
|
|
103
|
+
const currentSide = getSide(placement);
|
|
104
|
+
let x = rawX;
|
|
105
|
+
let y = rawY;
|
|
106
|
+
if (currentSide === "left") {
|
|
107
|
+
x = offsetDimensions.width - (rawX + floatRect.width);
|
|
108
|
+
}
|
|
109
|
+
if (currentSide === "top") {
|
|
110
|
+
y = offsetDimensions.height - (rawY + floatRect.height);
|
|
111
|
+
}
|
|
112
|
+
const sideX = currentSide === "left" ? "right" : DEFAULT_SIDES.sideX;
|
|
113
|
+
const sideY = currentSide === "top" ? "bottom" : DEFAULT_SIDES.sideY;
|
|
114
|
+
return {
|
|
115
|
+
x,
|
|
116
|
+
y,
|
|
117
|
+
data: {
|
|
118
|
+
sideX,
|
|
119
|
+
sideY
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/utils/useAnchorPositioning.js
|
|
126
|
+
import * as React from "react";
|
|
127
|
+
|
|
128
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/floating-ui-react/middleware/arrow.js
|
|
129
|
+
var baseArrow = (options) => ({
|
|
130
|
+
name: "arrow",
|
|
131
|
+
options,
|
|
132
|
+
async fn(state) {
|
|
133
|
+
const {
|
|
134
|
+
x,
|
|
135
|
+
y,
|
|
136
|
+
placement,
|
|
137
|
+
rects,
|
|
138
|
+
platform,
|
|
139
|
+
elements,
|
|
140
|
+
middlewareData
|
|
141
|
+
} = state;
|
|
142
|
+
const {
|
|
143
|
+
element,
|
|
144
|
+
padding = 0,
|
|
145
|
+
offsetParent = "real"
|
|
146
|
+
} = evaluate(options, state) || {};
|
|
147
|
+
if (element == null) {
|
|
148
|
+
return {};
|
|
149
|
+
}
|
|
150
|
+
const paddingObject = getPaddingObject(padding);
|
|
151
|
+
const coords = {
|
|
152
|
+
x,
|
|
153
|
+
y
|
|
154
|
+
};
|
|
155
|
+
const axis = getAlignmentAxis(placement);
|
|
156
|
+
const length = getAxisLength(axis);
|
|
157
|
+
const arrowDimensions = await platform.getDimensions(element);
|
|
158
|
+
const isYAxis = axis === "y";
|
|
159
|
+
const minProp = isYAxis ? "top" : "left";
|
|
160
|
+
const maxProp = isYAxis ? "bottom" : "right";
|
|
161
|
+
const clientProp = isYAxis ? "clientHeight" : "clientWidth";
|
|
162
|
+
const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
|
|
163
|
+
const startDiff = coords[axis] - rects.reference[axis];
|
|
164
|
+
const arrowOffsetParent = offsetParent === "real" ? await platform.getOffsetParent?.(element) : elements.floating;
|
|
165
|
+
let clientSize = elements.floating[clientProp] || rects.floating[length];
|
|
166
|
+
if (!clientSize || !await platform.isElement?.(arrowOffsetParent)) {
|
|
167
|
+
clientSize = elements.floating[clientProp] || rects.floating[length];
|
|
168
|
+
}
|
|
169
|
+
const centerToReference = endDiff / 2 - startDiff / 2;
|
|
170
|
+
const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
|
|
171
|
+
const minPadding = Math.min(paddingObject[minProp], largestPossiblePadding);
|
|
172
|
+
const maxPadding = Math.min(paddingObject[maxProp], largestPossiblePadding);
|
|
173
|
+
const min = minPadding;
|
|
174
|
+
const max = clientSize - arrowDimensions[length] - maxPadding;
|
|
175
|
+
const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
|
|
176
|
+
const offset2 = clamp(min, center, max);
|
|
177
|
+
const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset2 && rects.reference[length] / 2 - (center < min ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
|
|
178
|
+
const alignmentOffset = shouldAddOffset ? center < min ? center - min : center - max : 0;
|
|
179
|
+
return {
|
|
180
|
+
[axis]: coords[axis] + alignmentOffset,
|
|
181
|
+
data: {
|
|
182
|
+
[axis]: offset2,
|
|
183
|
+
centerOffset: center - offset2 - alignmentOffset,
|
|
184
|
+
...shouldAddOffset && {
|
|
185
|
+
alignmentOffset
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
reset: shouldAddOffset
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
var arrow = (options, deps) => ({
|
|
193
|
+
...baseArrow(options),
|
|
194
|
+
options: [options, deps]
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/utils/hideMiddleware.js
|
|
198
|
+
var hide2 = {
|
|
199
|
+
name: "hide",
|
|
200
|
+
async fn(state) {
|
|
201
|
+
const {
|
|
202
|
+
width,
|
|
203
|
+
height,
|
|
204
|
+
x,
|
|
205
|
+
y
|
|
206
|
+
} = state.rects.reference;
|
|
207
|
+
const anchorHidden = width === 0 && height === 0 && x === 0 && y === 0;
|
|
208
|
+
const nativeHideResult = await hide().fn(state);
|
|
209
|
+
return {
|
|
210
|
+
data: {
|
|
211
|
+
referenceHidden: nativeHideResult.data?.referenceHidden || anchorHidden
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/utils/useAnchorPositioning.js
|
|
218
|
+
"use client";
|
|
219
|
+
function getLogicalSide(sideParam, renderedSide, isRtl) {
|
|
220
|
+
const isLogicalSideParam = sideParam === "inline-start" || sideParam === "inline-end";
|
|
221
|
+
const logicalRight = isRtl ? "inline-start" : "inline-end";
|
|
222
|
+
const logicalLeft = isRtl ? "inline-end" : "inline-start";
|
|
223
|
+
return {
|
|
224
|
+
top: "top",
|
|
225
|
+
right: isLogicalSideParam ? logicalRight : "right",
|
|
226
|
+
bottom: "bottom",
|
|
227
|
+
left: isLogicalSideParam ? logicalLeft : "left"
|
|
228
|
+
}[renderedSide];
|
|
229
|
+
}
|
|
230
|
+
function getOffsetData(state, sideParam, isRtl) {
|
|
231
|
+
const {
|
|
232
|
+
rects,
|
|
233
|
+
placement
|
|
234
|
+
} = state;
|
|
235
|
+
const data = {
|
|
236
|
+
side: getLogicalSide(sideParam, getSide(placement), isRtl),
|
|
237
|
+
align: getAlignment(placement) || "center",
|
|
238
|
+
anchor: {
|
|
239
|
+
width: rects.reference.width,
|
|
240
|
+
height: rects.reference.height
|
|
241
|
+
},
|
|
242
|
+
positioner: {
|
|
243
|
+
width: rects.floating.width,
|
|
244
|
+
height: rects.floating.height
|
|
245
|
+
}
|
|
246
|
+
};
|
|
247
|
+
return data;
|
|
248
|
+
}
|
|
249
|
+
function useAnchorPositioning(params) {
|
|
250
|
+
const {
|
|
251
|
+
anchor,
|
|
252
|
+
positionMethod = "absolute",
|
|
253
|
+
side: sideParam = "bottom",
|
|
254
|
+
sideOffset = 0,
|
|
255
|
+
align = "center",
|
|
256
|
+
alignOffset = 0,
|
|
257
|
+
collisionBoundary,
|
|
258
|
+
collisionPadding: collisionPaddingParam = 5,
|
|
259
|
+
sticky = false,
|
|
260
|
+
arrowPadding = 5,
|
|
261
|
+
disableAnchorTracking = false,
|
|
262
|
+
keepMounted = false,
|
|
263
|
+
floatingRootContext,
|
|
264
|
+
mounted,
|
|
265
|
+
collisionAvoidance,
|
|
266
|
+
shiftCrossAxis = false,
|
|
267
|
+
nodeId,
|
|
268
|
+
adaptiveOrigin: adaptiveOrigin2,
|
|
269
|
+
lazyFlip = false,
|
|
270
|
+
externalTree
|
|
271
|
+
} = params;
|
|
272
|
+
const [mountSide, setMountSide] = React.useState(null);
|
|
273
|
+
if (!mounted && mountSide !== null) {
|
|
274
|
+
setMountSide(null);
|
|
275
|
+
}
|
|
276
|
+
const collisionAvoidanceSide = collisionAvoidance.side || "flip";
|
|
277
|
+
const collisionAvoidanceAlign = collisionAvoidance.align || "flip";
|
|
278
|
+
const collisionAvoidanceFallbackAxisSide = collisionAvoidance.fallbackAxisSide || "end";
|
|
279
|
+
const anchorFn = typeof anchor === "function" ? anchor : undefined;
|
|
280
|
+
const anchorFnCallback = useStableCallback(anchorFn);
|
|
281
|
+
const anchorDep = anchorFn ? anchorFnCallback : anchor;
|
|
282
|
+
const anchorValueRef = useValueAsRef(anchor);
|
|
283
|
+
const mountedRef = useValueAsRef(mounted);
|
|
284
|
+
const direction = useDirection();
|
|
285
|
+
const isRtl = direction === "rtl";
|
|
286
|
+
const side = mountSide || {
|
|
287
|
+
top: "top",
|
|
288
|
+
right: "right",
|
|
289
|
+
bottom: "bottom",
|
|
290
|
+
left: "left",
|
|
291
|
+
"inline-end": isRtl ? "left" : "right",
|
|
292
|
+
"inline-start": isRtl ? "right" : "left"
|
|
293
|
+
}[sideParam];
|
|
294
|
+
const placement = align === "center" ? side : `${side}-${align}`;
|
|
295
|
+
let collisionPadding = collisionPaddingParam;
|
|
296
|
+
const bias = 1;
|
|
297
|
+
const biasTop = sideParam === "bottom" ? bias : 0;
|
|
298
|
+
const biasBottom = sideParam === "top" ? bias : 0;
|
|
299
|
+
const biasLeft = sideParam === "right" ? bias : 0;
|
|
300
|
+
const biasRight = sideParam === "left" ? bias : 0;
|
|
301
|
+
if (typeof collisionPadding === "number") {
|
|
302
|
+
collisionPadding = {
|
|
303
|
+
top: collisionPadding + biasTop,
|
|
304
|
+
right: collisionPadding + biasRight,
|
|
305
|
+
bottom: collisionPadding + biasBottom,
|
|
306
|
+
left: collisionPadding + biasLeft
|
|
307
|
+
};
|
|
308
|
+
} else if (collisionPadding) {
|
|
309
|
+
collisionPadding = {
|
|
310
|
+
top: (collisionPadding.top || 0) + biasTop,
|
|
311
|
+
right: (collisionPadding.right || 0) + biasRight,
|
|
312
|
+
bottom: (collisionPadding.bottom || 0) + biasBottom,
|
|
313
|
+
left: (collisionPadding.left || 0) + biasLeft
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
const commonCollisionProps = {
|
|
317
|
+
boundary: collisionBoundary === "clipping-ancestors" ? "clippingAncestors" : collisionBoundary,
|
|
318
|
+
padding: collisionPadding
|
|
319
|
+
};
|
|
320
|
+
const arrowRef = React.useRef(null);
|
|
321
|
+
const sideOffsetRef = useValueAsRef(sideOffset);
|
|
322
|
+
const alignOffsetRef = useValueAsRef(alignOffset);
|
|
323
|
+
const sideOffsetDep = typeof sideOffset !== "function" ? sideOffset : 0;
|
|
324
|
+
const alignOffsetDep = typeof alignOffset !== "function" ? alignOffset : 0;
|
|
325
|
+
const middleware = [offset((state) => {
|
|
326
|
+
const data = getOffsetData(state, sideParam, isRtl);
|
|
327
|
+
const sideAxis = typeof sideOffsetRef.current === "function" ? sideOffsetRef.current(data) : sideOffsetRef.current;
|
|
328
|
+
const alignAxis = typeof alignOffsetRef.current === "function" ? alignOffsetRef.current(data) : alignOffsetRef.current;
|
|
329
|
+
return {
|
|
330
|
+
mainAxis: sideAxis,
|
|
331
|
+
crossAxis: alignAxis,
|
|
332
|
+
alignmentAxis: alignAxis
|
|
333
|
+
};
|
|
334
|
+
}, [sideOffsetDep, alignOffsetDep, isRtl, sideParam])];
|
|
335
|
+
const shiftDisabled = collisionAvoidanceAlign === "none" && collisionAvoidanceSide !== "shift";
|
|
336
|
+
const crossAxisShiftEnabled = !shiftDisabled && (sticky || shiftCrossAxis || collisionAvoidanceSide === "shift");
|
|
337
|
+
const flipMiddleware = collisionAvoidanceSide === "none" ? null : flip({
|
|
338
|
+
...commonCollisionProps,
|
|
339
|
+
padding: {
|
|
340
|
+
top: collisionPadding.top + bias,
|
|
341
|
+
right: collisionPadding.right + bias,
|
|
342
|
+
bottom: collisionPadding.bottom + bias,
|
|
343
|
+
left: collisionPadding.left + bias
|
|
344
|
+
},
|
|
345
|
+
mainAxis: !shiftCrossAxis && collisionAvoidanceSide === "flip",
|
|
346
|
+
crossAxis: collisionAvoidanceAlign === "flip" ? "alignment" : false,
|
|
347
|
+
fallbackAxisSideDirection: collisionAvoidanceFallbackAxisSide
|
|
348
|
+
});
|
|
349
|
+
const shiftMiddleware = shiftDisabled ? null : shift((data) => {
|
|
350
|
+
const html = ownerDocument(data.elements.floating).documentElement;
|
|
351
|
+
return {
|
|
352
|
+
...commonCollisionProps,
|
|
353
|
+
rootBoundary: shiftCrossAxis ? {
|
|
354
|
+
x: 0,
|
|
355
|
+
y: 0,
|
|
356
|
+
width: html.clientWidth,
|
|
357
|
+
height: html.clientHeight
|
|
358
|
+
} : undefined,
|
|
359
|
+
mainAxis: collisionAvoidanceAlign !== "none",
|
|
360
|
+
crossAxis: crossAxisShiftEnabled,
|
|
361
|
+
limiter: sticky || shiftCrossAxis ? undefined : limitShift((limitData) => {
|
|
362
|
+
if (!arrowRef.current) {
|
|
363
|
+
return {};
|
|
364
|
+
}
|
|
365
|
+
const {
|
|
366
|
+
width,
|
|
367
|
+
height
|
|
368
|
+
} = arrowRef.current.getBoundingClientRect();
|
|
369
|
+
const sideAxis = getSideAxis(getSide(limitData.placement));
|
|
370
|
+
const arrowSize = sideAxis === "y" ? width : height;
|
|
371
|
+
const offsetAmount = sideAxis === "y" ? collisionPadding.left + collisionPadding.right : collisionPadding.top + collisionPadding.bottom;
|
|
372
|
+
return {
|
|
373
|
+
offset: arrowSize / 2 + offsetAmount / 2
|
|
374
|
+
};
|
|
375
|
+
})
|
|
376
|
+
};
|
|
377
|
+
}, [commonCollisionProps, sticky, shiftCrossAxis, collisionPadding, collisionAvoidanceAlign]);
|
|
378
|
+
if (collisionAvoidanceSide === "shift" || collisionAvoidanceAlign === "shift" || align === "center") {
|
|
379
|
+
middleware.push(shiftMiddleware, flipMiddleware);
|
|
380
|
+
} else {
|
|
381
|
+
middleware.push(flipMiddleware, shiftMiddleware);
|
|
382
|
+
}
|
|
383
|
+
middleware.push(size({
|
|
384
|
+
...commonCollisionProps,
|
|
385
|
+
apply({
|
|
386
|
+
elements: {
|
|
387
|
+
floating
|
|
388
|
+
},
|
|
389
|
+
availableWidth,
|
|
390
|
+
availableHeight,
|
|
391
|
+
rects
|
|
392
|
+
}) {
|
|
393
|
+
if (!mountedRef.current) {
|
|
394
|
+
return;
|
|
395
|
+
}
|
|
396
|
+
const floatingStyle = floating.style;
|
|
397
|
+
floatingStyle.setProperty("--available-width", `${availableWidth}px`);
|
|
398
|
+
floatingStyle.setProperty("--available-height", `${availableHeight}px`);
|
|
399
|
+
const dpr = getWindow(floating).devicePixelRatio || 1;
|
|
400
|
+
const {
|
|
401
|
+
x: x2,
|
|
402
|
+
y: y2,
|
|
403
|
+
width,
|
|
404
|
+
height
|
|
405
|
+
} = rects.reference;
|
|
406
|
+
const anchorWidth = (Math.round((x2 + width) * dpr) - Math.round(x2 * dpr)) / dpr;
|
|
407
|
+
const anchorHeight = (Math.round((y2 + height) * dpr) - Math.round(y2 * dpr)) / dpr;
|
|
408
|
+
floatingStyle.setProperty("--anchor-width", `${anchorWidth}px`);
|
|
409
|
+
floatingStyle.setProperty("--anchor-height", `${anchorHeight}px`);
|
|
410
|
+
}
|
|
411
|
+
}), arrow(() => ({
|
|
412
|
+
element: arrowRef.current || ownerDocument(arrowRef.current).createElement("div"),
|
|
413
|
+
padding: arrowPadding,
|
|
414
|
+
offsetParent: "floating"
|
|
415
|
+
}), [arrowPadding]), {
|
|
416
|
+
name: "transformOrigin",
|
|
417
|
+
fn(state) {
|
|
418
|
+
const {
|
|
419
|
+
elements: elements2,
|
|
420
|
+
middlewareData: middlewareData2,
|
|
421
|
+
placement: renderedPlacement2,
|
|
422
|
+
rects,
|
|
423
|
+
y: y2
|
|
424
|
+
} = state;
|
|
425
|
+
const currentRenderedSide = getSide(renderedPlacement2);
|
|
426
|
+
const currentRenderedAxis = getSideAxis(currentRenderedSide);
|
|
427
|
+
const arrowEl = arrowRef.current;
|
|
428
|
+
const arrowX = middlewareData2.arrow?.x || 0;
|
|
429
|
+
const arrowY = middlewareData2.arrow?.y || 0;
|
|
430
|
+
const arrowWidth = arrowEl?.clientWidth || 0;
|
|
431
|
+
const arrowHeight = arrowEl?.clientHeight || 0;
|
|
432
|
+
const transformX = arrowX + arrowWidth / 2;
|
|
433
|
+
const transformY = arrowY + arrowHeight / 2;
|
|
434
|
+
const shiftY = Math.abs(middlewareData2.shift?.y || 0);
|
|
435
|
+
const halfAnchorHeight = rects.reference.height / 2;
|
|
436
|
+
const sideOffsetValue = typeof sideOffset === "function" ? sideOffset(getOffsetData(state, sideParam, isRtl)) : sideOffset;
|
|
437
|
+
const isOverlappingAnchor = shiftY > sideOffsetValue;
|
|
438
|
+
const adjacentTransformOrigin = {
|
|
439
|
+
top: `${transformX}px calc(100% + ${sideOffsetValue}px)`,
|
|
440
|
+
bottom: `${transformX}px ${-sideOffsetValue}px`,
|
|
441
|
+
left: `calc(100% + ${sideOffsetValue}px) ${transformY}px`,
|
|
442
|
+
right: `${-sideOffsetValue}px ${transformY}px`
|
|
443
|
+
}[currentRenderedSide];
|
|
444
|
+
const overlapTransformOrigin = `${transformX}px ${rects.reference.y + halfAnchorHeight - y2}px`;
|
|
445
|
+
elements2.floating.style.setProperty("--transform-origin", crossAxisShiftEnabled && currentRenderedAxis === "y" && isOverlappingAnchor ? overlapTransformOrigin : adjacentTransformOrigin);
|
|
446
|
+
return {};
|
|
447
|
+
}
|
|
448
|
+
}, hide2, adaptiveOrigin2);
|
|
449
|
+
useIsoLayoutEffect(() => {
|
|
450
|
+
if (!mounted && floatingRootContext) {
|
|
451
|
+
floatingRootContext.update({
|
|
452
|
+
referenceElement: null,
|
|
453
|
+
floatingElement: null,
|
|
454
|
+
domReferenceElement: null,
|
|
455
|
+
positionReference: null
|
|
456
|
+
});
|
|
457
|
+
}
|
|
458
|
+
}, [mounted, floatingRootContext]);
|
|
459
|
+
const autoUpdateOptions = React.useMemo(() => ({
|
|
460
|
+
elementResize: !disableAnchorTracking && typeof ResizeObserver !== "undefined",
|
|
461
|
+
layoutShift: !disableAnchorTracking && typeof IntersectionObserver !== "undefined"
|
|
462
|
+
}), [disableAnchorTracking]);
|
|
463
|
+
const {
|
|
464
|
+
refs,
|
|
465
|
+
elements,
|
|
466
|
+
x,
|
|
467
|
+
y,
|
|
468
|
+
middlewareData,
|
|
469
|
+
update,
|
|
470
|
+
placement: renderedPlacement,
|
|
471
|
+
context,
|
|
472
|
+
isPositioned,
|
|
473
|
+
floatingStyles: originalFloatingStyles
|
|
474
|
+
} = useFloating({
|
|
475
|
+
rootContext: floatingRootContext,
|
|
476
|
+
open: keepMounted ? mounted : undefined,
|
|
477
|
+
placement,
|
|
478
|
+
middleware,
|
|
479
|
+
strategy: positionMethod,
|
|
480
|
+
whileElementsMounted: keepMounted ? undefined : (...args) => autoUpdate(...args, autoUpdateOptions),
|
|
481
|
+
nodeId,
|
|
482
|
+
externalTree
|
|
483
|
+
});
|
|
484
|
+
const {
|
|
485
|
+
sideX,
|
|
486
|
+
sideY
|
|
487
|
+
} = middlewareData.adaptiveOrigin || DEFAULT_SIDES;
|
|
488
|
+
const resolvedPosition = isPositioned ? positionMethod : "fixed";
|
|
489
|
+
const floatingStyles = React.useMemo(() => {
|
|
490
|
+
const base = adaptiveOrigin2 ? {
|
|
491
|
+
position: resolvedPosition,
|
|
492
|
+
[sideX]: x,
|
|
493
|
+
[sideY]: y
|
|
494
|
+
} : {
|
|
495
|
+
position: resolvedPosition,
|
|
496
|
+
...originalFloatingStyles
|
|
497
|
+
};
|
|
498
|
+
if (!isPositioned) {
|
|
499
|
+
base.opacity = 0;
|
|
500
|
+
}
|
|
501
|
+
return base;
|
|
502
|
+
}, [adaptiveOrigin2, resolvedPosition, sideX, x, sideY, y, originalFloatingStyles, isPositioned]);
|
|
503
|
+
const registeredPositionReferenceRef = React.useRef(null);
|
|
504
|
+
useIsoLayoutEffect(() => {
|
|
505
|
+
if (!mounted) {
|
|
506
|
+
return;
|
|
507
|
+
}
|
|
508
|
+
const anchorValue = anchorValueRef.current;
|
|
509
|
+
const resolvedAnchor = typeof anchorValue === "function" ? anchorValue() : anchorValue;
|
|
510
|
+
const unwrappedElement = (isRef(resolvedAnchor) ? resolvedAnchor.current : resolvedAnchor) || null;
|
|
511
|
+
const finalAnchor = unwrappedElement || null;
|
|
512
|
+
if (finalAnchor !== registeredPositionReferenceRef.current) {
|
|
513
|
+
refs.setPositionReference(finalAnchor);
|
|
514
|
+
registeredPositionReferenceRef.current = finalAnchor;
|
|
515
|
+
}
|
|
516
|
+
}, [mounted, refs, anchorDep, anchorValueRef]);
|
|
517
|
+
React.useEffect(() => {
|
|
518
|
+
if (!mounted) {
|
|
519
|
+
return;
|
|
520
|
+
}
|
|
521
|
+
const anchorValue = anchorValueRef.current;
|
|
522
|
+
if (typeof anchorValue === "function") {
|
|
523
|
+
return;
|
|
524
|
+
}
|
|
525
|
+
if (isRef(anchorValue) && anchorValue.current !== registeredPositionReferenceRef.current) {
|
|
526
|
+
refs.setPositionReference(anchorValue.current);
|
|
527
|
+
registeredPositionReferenceRef.current = anchorValue.current;
|
|
528
|
+
}
|
|
529
|
+
}, [mounted, refs, anchorDep, anchorValueRef]);
|
|
530
|
+
React.useEffect(() => {
|
|
531
|
+
if (keepMounted && mounted && elements.domReference && elements.floating) {
|
|
532
|
+
return autoUpdate(elements.domReference, elements.floating, update, autoUpdateOptions);
|
|
533
|
+
}
|
|
534
|
+
return;
|
|
535
|
+
}, [keepMounted, mounted, elements, update, autoUpdateOptions]);
|
|
536
|
+
const renderedSide = getSide(renderedPlacement);
|
|
537
|
+
const logicalRenderedSide = getLogicalSide(sideParam, renderedSide, isRtl);
|
|
538
|
+
const renderedAlign = getAlignment(renderedPlacement) || "center";
|
|
539
|
+
const anchorHidden = Boolean(middlewareData.hide?.referenceHidden);
|
|
540
|
+
useIsoLayoutEffect(() => {
|
|
541
|
+
if (lazyFlip && mounted && isPositioned) {
|
|
542
|
+
setMountSide(renderedSide);
|
|
543
|
+
}
|
|
544
|
+
}, [lazyFlip, mounted, isPositioned, renderedSide]);
|
|
545
|
+
const arrowStyles = React.useMemo(() => ({
|
|
546
|
+
position: "absolute",
|
|
547
|
+
top: middlewareData.arrow?.y,
|
|
548
|
+
left: middlewareData.arrow?.x
|
|
549
|
+
}), [middlewareData.arrow]);
|
|
550
|
+
const arrowUncentered = middlewareData.arrow?.centerOffset !== 0;
|
|
551
|
+
return React.useMemo(() => ({
|
|
552
|
+
positionerStyles: floatingStyles,
|
|
553
|
+
arrowStyles,
|
|
554
|
+
arrowRef,
|
|
555
|
+
arrowUncentered,
|
|
556
|
+
side: logicalRenderedSide,
|
|
557
|
+
align: renderedAlign,
|
|
558
|
+
physicalSide: renderedSide,
|
|
559
|
+
anchorHidden,
|
|
560
|
+
refs,
|
|
561
|
+
context,
|
|
562
|
+
isPositioned,
|
|
563
|
+
update
|
|
564
|
+
}), [floatingStyles, arrowStyles, arrowRef, arrowUncentered, logicalRenderedSide, renderedAlign, renderedSide, anchorHidden, refs, context, isPositioned, update]);
|
|
565
|
+
}
|
|
566
|
+
function isRef(param) {
|
|
567
|
+
return param != null && "current" in param;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/utils/usePositioner.js
|
|
571
|
+
"use client";
|
|
572
|
+
function usePositioner(componentProps, state, {
|
|
573
|
+
styles,
|
|
574
|
+
transitionStatus,
|
|
575
|
+
props,
|
|
576
|
+
refs,
|
|
577
|
+
hidden,
|
|
578
|
+
inert = false
|
|
579
|
+
}) {
|
|
580
|
+
const style = {
|
|
581
|
+
...styles
|
|
582
|
+
};
|
|
583
|
+
if (inert) {
|
|
584
|
+
style.pointerEvents = "none";
|
|
585
|
+
}
|
|
586
|
+
return useRenderElement("div", componentProps, {
|
|
587
|
+
state,
|
|
588
|
+
ref: refs,
|
|
589
|
+
props: [{
|
|
590
|
+
role: "presentation",
|
|
591
|
+
hidden,
|
|
592
|
+
style
|
|
593
|
+
}, getDisabledMountTransitionStyles(transitionStatus), props],
|
|
594
|
+
stateAttributesMapping: popupStateMapping
|
|
595
|
+
});
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
export { getDisabledMountTransitionStyles, adaptiveOrigin, useAnchorPositioning, usePositioner };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import {
|
|
2
|
+
TransitionStatusDataAttributes
|
|
3
|
+
} from "./_chunk-mbn76q14.js";
|
|
4
|
+
|
|
5
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/utils/popupStateMapping.js
|
|
6
|
+
var CommonPopupDataAttributes = function(CommonPopupDataAttributes2) {
|
|
7
|
+
CommonPopupDataAttributes2["open"] = "data-open";
|
|
8
|
+
CommonPopupDataAttributes2["closed"] = "data-closed";
|
|
9
|
+
CommonPopupDataAttributes2[CommonPopupDataAttributes2["startingStyle"] = TransitionStatusDataAttributes.startingStyle] = "startingStyle";
|
|
10
|
+
CommonPopupDataAttributes2[CommonPopupDataAttributes2["endingStyle"] = TransitionStatusDataAttributes.endingStyle] = "endingStyle";
|
|
11
|
+
CommonPopupDataAttributes2["anchorHidden"] = "data-anchor-hidden";
|
|
12
|
+
CommonPopupDataAttributes2["side"] = "data-side";
|
|
13
|
+
CommonPopupDataAttributes2["align"] = "data-align";
|
|
14
|
+
return CommonPopupDataAttributes2;
|
|
15
|
+
}({});
|
|
16
|
+
var CommonTriggerDataAttributes = /* @__PURE__ */ function(CommonTriggerDataAttributes2) {
|
|
17
|
+
CommonTriggerDataAttributes2["popupOpen"] = "data-popup-open";
|
|
18
|
+
CommonTriggerDataAttributes2["pressed"] = "data-pressed";
|
|
19
|
+
return CommonTriggerDataAttributes2;
|
|
20
|
+
}({});
|
|
21
|
+
var TRIGGER_HOOK = {
|
|
22
|
+
[CommonTriggerDataAttributes.popupOpen]: ""
|
|
23
|
+
};
|
|
24
|
+
var PRESSABLE_TRIGGER_HOOK = {
|
|
25
|
+
[CommonTriggerDataAttributes.popupOpen]: "",
|
|
26
|
+
[CommonTriggerDataAttributes.pressed]: ""
|
|
27
|
+
};
|
|
28
|
+
var POPUP_OPEN_HOOK = {
|
|
29
|
+
[CommonPopupDataAttributes.open]: ""
|
|
30
|
+
};
|
|
31
|
+
var POPUP_CLOSED_HOOK = {
|
|
32
|
+
[CommonPopupDataAttributes.closed]: ""
|
|
33
|
+
};
|
|
34
|
+
var ANCHOR_HIDDEN_HOOK = {
|
|
35
|
+
[CommonPopupDataAttributes.anchorHidden]: ""
|
|
36
|
+
};
|
|
37
|
+
var triggerOpenStateMapping = {
|
|
38
|
+
open(value) {
|
|
39
|
+
if (value) {
|
|
40
|
+
return TRIGGER_HOOK;
|
|
41
|
+
}
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
var pressableTriggerOpenStateMapping = {
|
|
46
|
+
open(value) {
|
|
47
|
+
if (value) {
|
|
48
|
+
return PRESSABLE_TRIGGER_HOOK;
|
|
49
|
+
}
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
var popupStateMapping = {
|
|
54
|
+
open(value) {
|
|
55
|
+
if (value) {
|
|
56
|
+
return POPUP_OPEN_HOOK;
|
|
57
|
+
}
|
|
58
|
+
return POPUP_CLOSED_HOOK;
|
|
59
|
+
},
|
|
60
|
+
anchorHidden(value) {
|
|
61
|
+
if (value) {
|
|
62
|
+
return ANCHOR_HIDDEN_HOOK;
|
|
63
|
+
}
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export { CommonPopupDataAttributes, CommonTriggerDataAttributes, triggerOpenStateMapping, pressableTriggerOpenStateMapping, popupStateMapping };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/utils/resolveAriaLabelledBy.js
|
|
2
|
+
"use client";
|
|
3
|
+
function getDefaultLabelId(id) {
|
|
4
|
+
return id == null ? undefined : `${id}-label`;
|
|
5
|
+
}
|
|
6
|
+
function resolveAriaLabelledBy(fieldLabelId, localLabelId) {
|
|
7
|
+
return fieldLabelId ?? localLabelId;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { getDefaultLabelId, resolveAriaLabelledBy };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/menubar/MenubarContext.js
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
"use client";
|
|
4
|
+
var MenubarContext = /* @__PURE__ */ React.createContext(null);
|
|
5
|
+
if (true)
|
|
6
|
+
MenubarContext.displayName = "MenubarContext";
|
|
7
|
+
function useMenubarContext(optional) {
|
|
8
|
+
const context = React.useContext(MenubarContext);
|
|
9
|
+
if (context === null && !optional) {
|
|
10
|
+
throw new Error("Base UI: MenubarContext is missing. Menubar parts must be placed within <Menubar>.");
|
|
11
|
+
}
|
|
12
|
+
return context;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { MenubarContext, useMenubarContext };
|