@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,34 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getWindow
|
|
3
|
+
} from "./_chunk-sx6vkz01.js";
|
|
4
|
+
|
|
5
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/utils/getPseudoElementBounds.js
|
|
6
|
+
function getPseudoElementBounds(element) {
|
|
7
|
+
const elementRect = element.getBoundingClientRect();
|
|
8
|
+
if (true) {
|
|
9
|
+
return elementRect;
|
|
10
|
+
}
|
|
11
|
+
const win = getWindow(element);
|
|
12
|
+
const beforeStyles = win.getComputedStyle(element, "::before");
|
|
13
|
+
const afterStyles = win.getComputedStyle(element, "::after");
|
|
14
|
+
const hasPseudoElements = beforeStyles.content !== "none" || afterStyles.content !== "none";
|
|
15
|
+
if (!hasPseudoElements) {
|
|
16
|
+
return elementRect;
|
|
17
|
+
}
|
|
18
|
+
const beforeWidth = parseFloat(beforeStyles.width) || 0;
|
|
19
|
+
const beforeHeight = parseFloat(beforeStyles.height) || 0;
|
|
20
|
+
const afterWidth = parseFloat(afterStyles.width) || 0;
|
|
21
|
+
const afterHeight = parseFloat(afterStyles.height) || 0;
|
|
22
|
+
const totalWidth = Math.max(elementRect.width, beforeWidth, afterWidth);
|
|
23
|
+
const totalHeight = Math.max(elementRect.height, beforeHeight, afterHeight);
|
|
24
|
+
const widthDiff = totalWidth - elementRect.width;
|
|
25
|
+
const heightDiff = totalHeight - elementRect.height;
|
|
26
|
+
return {
|
|
27
|
+
left: elementRect.left - widthDiff / 2,
|
|
28
|
+
right: elementRect.right + widthDiff / 2,
|
|
29
|
+
top: elementRect.top - heightDiff / 2,
|
|
30
|
+
bottom: elementRect.bottom + heightDiff / 2
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export { getPseudoElementBounds };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/internals/composite/root/CompositeRootContext.js
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
"use client";
|
|
4
|
+
var CompositeRootContext = /* @__PURE__ */ React.createContext(undefined);
|
|
5
|
+
if (true)
|
|
6
|
+
CompositeRootContext.displayName = "CompositeRootContext";
|
|
7
|
+
function useCompositeRootContext(optional = false) {
|
|
8
|
+
const context = React.useContext(CompositeRootContext);
|
|
9
|
+
if (context === undefined && !optional) {
|
|
10
|
+
throw new Error("Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>.");
|
|
11
|
+
}
|
|
12
|
+
return context;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { CompositeRootContext, useCompositeRootContext };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// node_modules/.deno/@base-ui+utils@0.2.8/node_modules/@base-ui/utils/esm/error.js
|
|
2
|
+
var set;
|
|
3
|
+
if (true) {
|
|
4
|
+
set = new Set;
|
|
5
|
+
}
|
|
6
|
+
function error(...messages) {
|
|
7
|
+
if (true) {
|
|
8
|
+
const messageKey = messages.join(" ");
|
|
9
|
+
if (!set.has(messageKey)) {
|
|
10
|
+
set.add(messageKey);
|
|
11
|
+
console.error(`Base UI: ${messageKey}`);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export { error };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useRenderElement
|
|
3
|
+
} from "./_chunk-1s41sngz.js";
|
|
4
|
+
|
|
5
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/separator/Separator.js
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
"use client";
|
|
8
|
+
var Separator = /* @__PURE__ */ React.forwardRef(function SeparatorComponent(componentProps, forwardedRef) {
|
|
9
|
+
const {
|
|
10
|
+
className,
|
|
11
|
+
render,
|
|
12
|
+
orientation = "horizontal",
|
|
13
|
+
style,
|
|
14
|
+
...elementProps
|
|
15
|
+
} = componentProps;
|
|
16
|
+
const state = {
|
|
17
|
+
orientation
|
|
18
|
+
};
|
|
19
|
+
const element = useRenderElement("div", componentProps, {
|
|
20
|
+
state,
|
|
21
|
+
ref: forwardedRef,
|
|
22
|
+
props: [{
|
|
23
|
+
role: "separator",
|
|
24
|
+
"aria-orientation": orientation
|
|
25
|
+
}, elementProps]
|
|
26
|
+
});
|
|
27
|
+
return element;
|
|
28
|
+
});
|
|
29
|
+
if (true)
|
|
30
|
+
Separator.displayName = "Separator";
|
|
31
|
+
|
|
32
|
+
export { Separator };
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getEmptyRootContext
|
|
3
|
+
} from "./_chunk-f9tgee1q.js";
|
|
4
|
+
import {
|
|
5
|
+
createSelector
|
|
6
|
+
} from "./_chunk-2tyt8f8r.js";
|
|
7
|
+
import {
|
|
8
|
+
useOpenChangeComplete,
|
|
9
|
+
useTransitionStatus
|
|
10
|
+
} from "./_chunk-mbn76q14.js";
|
|
11
|
+
import {
|
|
12
|
+
useStableCallback
|
|
13
|
+
} from "./_chunk-mznt6ktj.js";
|
|
14
|
+
import {
|
|
15
|
+
useIsoLayoutEffect
|
|
16
|
+
} from "./_chunk-b40erthe.js";
|
|
17
|
+
import {
|
|
18
|
+
EMPTY_OBJECT
|
|
19
|
+
} from "./_chunk-1s41sngz.js";
|
|
20
|
+
|
|
21
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/utils/popups/popupStoreUtils.js
|
|
22
|
+
import * as React from "react";
|
|
23
|
+
"use client";
|
|
24
|
+
function useTriggerRegistration(id, store) {
|
|
25
|
+
const registeredElementIdRef = React.useRef(null);
|
|
26
|
+
const registeredElementRef = React.useRef(null);
|
|
27
|
+
return React.useCallback((element) => {
|
|
28
|
+
if (id === undefined) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
if (registeredElementIdRef.current !== null) {
|
|
32
|
+
const registeredId = registeredElementIdRef.current;
|
|
33
|
+
const registeredElement = registeredElementRef.current;
|
|
34
|
+
const currentElement = store.context.triggerElements.getById(registeredId);
|
|
35
|
+
if (registeredElement && currentElement === registeredElement) {
|
|
36
|
+
store.context.triggerElements.delete(registeredId);
|
|
37
|
+
}
|
|
38
|
+
registeredElementIdRef.current = null;
|
|
39
|
+
registeredElementRef.current = null;
|
|
40
|
+
}
|
|
41
|
+
if (element !== null) {
|
|
42
|
+
registeredElementIdRef.current = id;
|
|
43
|
+
registeredElementRef.current = element;
|
|
44
|
+
store.context.triggerElements.add(id, element);
|
|
45
|
+
}
|
|
46
|
+
}, [store, id]);
|
|
47
|
+
}
|
|
48
|
+
function useTriggerDataForwarding(triggerId, triggerElementRef, store, stateUpdates) {
|
|
49
|
+
const isMountedByThisTrigger = store.useState("isMountedByTrigger", triggerId);
|
|
50
|
+
const baseRegisterTrigger = useTriggerRegistration(triggerId, store);
|
|
51
|
+
const registerTrigger = useStableCallback((element) => {
|
|
52
|
+
baseRegisterTrigger(element);
|
|
53
|
+
if (!element || !store.select("open")) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
const activeTriggerId = store.select("activeTriggerId");
|
|
57
|
+
if (activeTriggerId === triggerId) {
|
|
58
|
+
store.update({
|
|
59
|
+
activeTriggerElement: element,
|
|
60
|
+
...stateUpdates
|
|
61
|
+
});
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
if (activeTriggerId == null) {
|
|
65
|
+
store.update({
|
|
66
|
+
activeTriggerId: triggerId,
|
|
67
|
+
activeTriggerElement: element,
|
|
68
|
+
...stateUpdates
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
useIsoLayoutEffect(() => {
|
|
73
|
+
if (isMountedByThisTrigger) {
|
|
74
|
+
store.update({
|
|
75
|
+
activeTriggerElement: triggerElementRef.current,
|
|
76
|
+
...stateUpdates
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}, [isMountedByThisTrigger, store, triggerElementRef, ...Object.values(stateUpdates)]);
|
|
80
|
+
return {
|
|
81
|
+
registerTrigger,
|
|
82
|
+
isMountedByThisTrigger
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
function useImplicitActiveTrigger(store) {
|
|
86
|
+
const open = store.useState("open");
|
|
87
|
+
useIsoLayoutEffect(() => {
|
|
88
|
+
if (open && !store.select("activeTriggerId") && store.context.triggerElements.size === 1) {
|
|
89
|
+
const iteratorResult = store.context.triggerElements.entries().next();
|
|
90
|
+
if (!iteratorResult.done) {
|
|
91
|
+
const [implicitTriggerId, implicitTriggerElement] = iteratorResult.value;
|
|
92
|
+
store.update({
|
|
93
|
+
activeTriggerId: implicitTriggerId,
|
|
94
|
+
activeTriggerElement: implicitTriggerElement
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}, [open, store]);
|
|
99
|
+
}
|
|
100
|
+
function useOpenStateTransitions(open, store, onUnmount) {
|
|
101
|
+
const {
|
|
102
|
+
mounted,
|
|
103
|
+
setMounted,
|
|
104
|
+
transitionStatus
|
|
105
|
+
} = useTransitionStatus(open);
|
|
106
|
+
store.useSyncedValues({
|
|
107
|
+
mounted,
|
|
108
|
+
transitionStatus
|
|
109
|
+
});
|
|
110
|
+
const forceUnmount = useStableCallback(() => {
|
|
111
|
+
setMounted(false);
|
|
112
|
+
store.update({
|
|
113
|
+
activeTriggerId: null,
|
|
114
|
+
activeTriggerElement: null,
|
|
115
|
+
mounted: false
|
|
116
|
+
});
|
|
117
|
+
onUnmount?.();
|
|
118
|
+
store.context.onOpenChangeComplete?.(false);
|
|
119
|
+
});
|
|
120
|
+
const preventUnmountingOnClose = store.useState("preventUnmountingOnClose");
|
|
121
|
+
useOpenChangeComplete({
|
|
122
|
+
enabled: !preventUnmountingOnClose,
|
|
123
|
+
open,
|
|
124
|
+
ref: store.context.popupRef,
|
|
125
|
+
onComplete() {
|
|
126
|
+
if (!open) {
|
|
127
|
+
forceUnmount();
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
return {
|
|
132
|
+
forceUnmount,
|
|
133
|
+
transitionStatus
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/utils/popups/store.js
|
|
138
|
+
function createInitialPopupStoreState() {
|
|
139
|
+
return {
|
|
140
|
+
open: false,
|
|
141
|
+
openProp: undefined,
|
|
142
|
+
mounted: false,
|
|
143
|
+
transitionStatus: undefined,
|
|
144
|
+
floatingRootContext: getEmptyRootContext(),
|
|
145
|
+
preventUnmountingOnClose: false,
|
|
146
|
+
payload: undefined,
|
|
147
|
+
activeTriggerId: null,
|
|
148
|
+
activeTriggerElement: null,
|
|
149
|
+
triggerIdProp: undefined,
|
|
150
|
+
popupElement: null,
|
|
151
|
+
positionerElement: null,
|
|
152
|
+
activeTriggerProps: EMPTY_OBJECT,
|
|
153
|
+
inactiveTriggerProps: EMPTY_OBJECT,
|
|
154
|
+
popupProps: EMPTY_OBJECT
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
var activeTriggerIdSelector = createSelector((state) => state.triggerIdProp ?? state.activeTriggerId);
|
|
158
|
+
var popupStoreSelectors = {
|
|
159
|
+
open: createSelector((state) => state.openProp ?? state.open),
|
|
160
|
+
mounted: createSelector((state) => state.mounted),
|
|
161
|
+
transitionStatus: createSelector((state) => state.transitionStatus),
|
|
162
|
+
floatingRootContext: createSelector((state) => state.floatingRootContext),
|
|
163
|
+
preventUnmountingOnClose: createSelector((state) => state.preventUnmountingOnClose),
|
|
164
|
+
payload: createSelector((state) => state.payload),
|
|
165
|
+
activeTriggerId: activeTriggerIdSelector,
|
|
166
|
+
activeTriggerElement: createSelector((state) => state.mounted ? state.activeTriggerElement : null),
|
|
167
|
+
isTriggerActive: createSelector((state, triggerId) => triggerId !== undefined && activeTriggerIdSelector(state) === triggerId),
|
|
168
|
+
isOpenedByTrigger: createSelector((state, triggerId) => triggerId !== undefined && activeTriggerIdSelector(state) === triggerId && state.open),
|
|
169
|
+
isMountedByTrigger: createSelector((state, triggerId) => triggerId !== undefined && activeTriggerIdSelector(state) === triggerId && state.mounted),
|
|
170
|
+
triggerProps: createSelector((state, isActive) => isActive ? state.activeTriggerProps : state.inactiveTriggerProps),
|
|
171
|
+
popupProps: createSelector((state) => state.popupProps),
|
|
172
|
+
popupElement: createSelector((state) => state.popupElement),
|
|
173
|
+
positionerElement: createSelector((state) => state.positionerElement)
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
export { useTriggerRegistration, useTriggerDataForwarding, useImplicitActiveTrigger, useOpenStateTransitions, createInitialPopupStoreState, popupStoreSelectors };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useOnMount
|
|
3
|
+
} from "./_chunk-8jz3hb7q.js";
|
|
4
|
+
import {
|
|
5
|
+
useRefWithInit
|
|
6
|
+
} from "./_chunk-1s41sngz.js";
|
|
7
|
+
|
|
8
|
+
// node_modules/.deno/@base-ui+utils@0.2.8/node_modules/@base-ui/utils/esm/useTimeout.js
|
|
9
|
+
"use client";
|
|
10
|
+
var EMPTY = 0;
|
|
11
|
+
|
|
12
|
+
class Timeout {
|
|
13
|
+
static create() {
|
|
14
|
+
return new Timeout;
|
|
15
|
+
}
|
|
16
|
+
currentId = EMPTY;
|
|
17
|
+
start(delay, fn) {
|
|
18
|
+
this.clear();
|
|
19
|
+
this.currentId = setTimeout(() => {
|
|
20
|
+
this.currentId = EMPTY;
|
|
21
|
+
fn();
|
|
22
|
+
}, delay);
|
|
23
|
+
}
|
|
24
|
+
isStarted() {
|
|
25
|
+
return this.currentId !== EMPTY;
|
|
26
|
+
}
|
|
27
|
+
clear = () => {
|
|
28
|
+
if (this.currentId !== EMPTY) {
|
|
29
|
+
clearTimeout(this.currentId);
|
|
30
|
+
this.currentId = EMPTY;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
disposeEffect = () => {
|
|
34
|
+
return this.clear;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function useTimeout() {
|
|
38
|
+
const timeout = useRefWithInit(Timeout.create).current;
|
|
39
|
+
useOnMount(timeout.disposeEffect);
|
|
40
|
+
return timeout;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export { Timeout, useTimeout };
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import {
|
|
2
|
+
error
|
|
3
|
+
} from "./_chunk-71zm6zgv.js";
|
|
4
|
+
import {
|
|
5
|
+
useCompositeRootContext
|
|
6
|
+
} from "./_chunk-6xevjepc.js";
|
|
7
|
+
import {
|
|
8
|
+
isHTMLElement
|
|
9
|
+
} from "./_chunk-sx6vkz01.js";
|
|
10
|
+
import {
|
|
11
|
+
SafeReact
|
|
12
|
+
} from "./_chunk-n7dnqnbw.js";
|
|
13
|
+
import {
|
|
14
|
+
useStableCallback
|
|
15
|
+
} from "./_chunk-mznt6ktj.js";
|
|
16
|
+
import {
|
|
17
|
+
useIsoLayoutEffect
|
|
18
|
+
} from "./_chunk-b40erthe.js";
|
|
19
|
+
import {
|
|
20
|
+
makeEventPreventable,
|
|
21
|
+
mergeProps
|
|
22
|
+
} from "./_chunk-1e6khrvm.js";
|
|
23
|
+
|
|
24
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/internals/use-button/useButton.js
|
|
25
|
+
import * as React2 from "react";
|
|
26
|
+
|
|
27
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/utils/useFocusableWhenDisabled.js
|
|
28
|
+
import * as React from "react";
|
|
29
|
+
"use client";
|
|
30
|
+
function useFocusableWhenDisabled(parameters) {
|
|
31
|
+
const {
|
|
32
|
+
focusableWhenDisabled,
|
|
33
|
+
disabled,
|
|
34
|
+
composite = false,
|
|
35
|
+
tabIndex: tabIndexProp = 0,
|
|
36
|
+
isNativeButton
|
|
37
|
+
} = parameters;
|
|
38
|
+
const isFocusableComposite = composite && focusableWhenDisabled !== false;
|
|
39
|
+
const isNonFocusableComposite = composite && focusableWhenDisabled === false;
|
|
40
|
+
const props = React.useMemo(() => {
|
|
41
|
+
const additionalProps = {
|
|
42
|
+
onKeyDown(event) {
|
|
43
|
+
if (disabled && focusableWhenDisabled && event.key !== "Tab") {
|
|
44
|
+
event.preventDefault();
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
if (!composite) {
|
|
49
|
+
additionalProps.tabIndex = tabIndexProp;
|
|
50
|
+
if (!isNativeButton && disabled) {
|
|
51
|
+
additionalProps.tabIndex = focusableWhenDisabled ? tabIndexProp : -1;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
if (isNativeButton && (focusableWhenDisabled || isFocusableComposite) || !isNativeButton && disabled) {
|
|
55
|
+
additionalProps["aria-disabled"] = disabled;
|
|
56
|
+
}
|
|
57
|
+
if (isNativeButton && (!focusableWhenDisabled || isNonFocusableComposite)) {
|
|
58
|
+
additionalProps.disabled = disabled;
|
|
59
|
+
}
|
|
60
|
+
return additionalProps;
|
|
61
|
+
}, [composite, disabled, focusableWhenDisabled, isFocusableComposite, isNonFocusableComposite, isNativeButton, tabIndexProp]);
|
|
62
|
+
return {
|
|
63
|
+
props
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/internals/use-button/useButton.js
|
|
68
|
+
"use client";
|
|
69
|
+
function useButton(parameters = {}) {
|
|
70
|
+
const {
|
|
71
|
+
disabled = false,
|
|
72
|
+
focusableWhenDisabled,
|
|
73
|
+
tabIndex = 0,
|
|
74
|
+
native: isNativeButton = true,
|
|
75
|
+
composite: compositeProp
|
|
76
|
+
} = parameters;
|
|
77
|
+
const elementRef = React2.useRef(null);
|
|
78
|
+
const compositeRootContext = useCompositeRootContext(true);
|
|
79
|
+
const isCompositeItem = compositeProp ?? compositeRootContext !== undefined;
|
|
80
|
+
const {
|
|
81
|
+
props: focusableWhenDisabledProps
|
|
82
|
+
} = useFocusableWhenDisabled({
|
|
83
|
+
focusableWhenDisabled,
|
|
84
|
+
disabled,
|
|
85
|
+
composite: isCompositeItem,
|
|
86
|
+
tabIndex,
|
|
87
|
+
isNativeButton
|
|
88
|
+
});
|
|
89
|
+
if (true) {
|
|
90
|
+
React2.useEffect(() => {
|
|
91
|
+
if (!elementRef.current) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
const isButtonTag = isButtonElement(elementRef.current);
|
|
95
|
+
if (isNativeButton) {
|
|
96
|
+
if (!isButtonTag) {
|
|
97
|
+
const ownerStackMessage = SafeReact.captureOwnerStack?.() || "";
|
|
98
|
+
const message = "A component that acts as a button expected a native <button> because the " + "`nativeButton` prop is true. Rendering a non-<button> removes native button " + "semantics, which can impact forms and accessibility. Use a real <button> in the " + "`render` prop, or set `nativeButton` to `false`.";
|
|
99
|
+
error(`${message}${ownerStackMessage}`);
|
|
100
|
+
}
|
|
101
|
+
} else if (isButtonTag) {
|
|
102
|
+
const ownerStackMessage = SafeReact.captureOwnerStack?.() || "";
|
|
103
|
+
const message = "A component that acts as a button expected a non-<button> because the `nativeButton` " + "prop is false. Rendering a <button> keeps native behavior while Base UI applies " + "non-native attributes and handlers, which can add unintended extra attributes (such " + "as `role` or `aria-disabled`). Use a non-<button> in the `render` prop, or set " + "`nativeButton` to `true`.";
|
|
104
|
+
error(`${message}${ownerStackMessage}`);
|
|
105
|
+
}
|
|
106
|
+
}, [isNativeButton]);
|
|
107
|
+
}
|
|
108
|
+
const updateDisabled = React2.useCallback(() => {
|
|
109
|
+
const element = elementRef.current;
|
|
110
|
+
if (!isButtonElement(element)) {
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
if (isCompositeItem && disabled && focusableWhenDisabledProps.disabled === undefined && element.disabled) {
|
|
114
|
+
element.disabled = false;
|
|
115
|
+
}
|
|
116
|
+
}, [disabled, focusableWhenDisabledProps.disabled, isCompositeItem]);
|
|
117
|
+
useIsoLayoutEffect(updateDisabled, [updateDisabled]);
|
|
118
|
+
const getButtonProps = React2.useCallback((externalProps = {}) => {
|
|
119
|
+
const {
|
|
120
|
+
onClick: externalOnClick,
|
|
121
|
+
onMouseDown: externalOnMouseDown,
|
|
122
|
+
onKeyUp: externalOnKeyUp,
|
|
123
|
+
onKeyDown: externalOnKeyDown,
|
|
124
|
+
onPointerDown: externalOnPointerDown,
|
|
125
|
+
...otherExternalProps
|
|
126
|
+
} = externalProps;
|
|
127
|
+
const type = isNativeButton ? "button" : undefined;
|
|
128
|
+
return mergeProps({
|
|
129
|
+
type,
|
|
130
|
+
onClick(event) {
|
|
131
|
+
if (disabled) {
|
|
132
|
+
event.preventDefault();
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
externalOnClick?.(event);
|
|
136
|
+
},
|
|
137
|
+
onMouseDown(event) {
|
|
138
|
+
if (!disabled) {
|
|
139
|
+
externalOnMouseDown?.(event);
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
onKeyDown(event) {
|
|
143
|
+
if (disabled) {
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
makeEventPreventable(event);
|
|
147
|
+
externalOnKeyDown?.(event);
|
|
148
|
+
if (event.baseUIHandlerPrevented) {
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
const isCurrentTarget = event.target === event.currentTarget;
|
|
152
|
+
const currentTarget = event.currentTarget;
|
|
153
|
+
const isButton = isButtonElement(currentTarget);
|
|
154
|
+
const isLink = !isNativeButton && isValidLinkElement(currentTarget);
|
|
155
|
+
const shouldClick = isCurrentTarget && (isNativeButton ? isButton : !isLink);
|
|
156
|
+
const isEnterKey = event.key === "Enter";
|
|
157
|
+
const isSpaceKey = event.key === " ";
|
|
158
|
+
const role = currentTarget.getAttribute("role");
|
|
159
|
+
const isTextNavigationRole = role?.startsWith("menuitem") || role === "option" || role === "gridcell";
|
|
160
|
+
if (isCurrentTarget && isCompositeItem && isSpaceKey) {
|
|
161
|
+
if (event.defaultPrevented && isTextNavigationRole) {
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
event.preventDefault();
|
|
165
|
+
if (isLink || isNativeButton && isButton) {
|
|
166
|
+
currentTarget.click();
|
|
167
|
+
event.preventBaseUIHandler();
|
|
168
|
+
} else if (shouldClick) {
|
|
169
|
+
externalOnClick?.(event);
|
|
170
|
+
event.preventBaseUIHandler();
|
|
171
|
+
}
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
if (shouldClick) {
|
|
175
|
+
if (!isNativeButton && (isSpaceKey || isEnterKey)) {
|
|
176
|
+
event.preventDefault();
|
|
177
|
+
}
|
|
178
|
+
if (!isNativeButton && isEnterKey) {
|
|
179
|
+
externalOnClick?.(event);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
onKeyUp(event) {
|
|
184
|
+
if (disabled) {
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
makeEventPreventable(event);
|
|
188
|
+
externalOnKeyUp?.(event);
|
|
189
|
+
if (event.target === event.currentTarget && isNativeButton && isCompositeItem && isButtonElement(event.currentTarget) && event.key === " ") {
|
|
190
|
+
event.preventDefault();
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
if (event.baseUIHandlerPrevented) {
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
if (event.target === event.currentTarget && !isNativeButton && !isCompositeItem && event.key === " ") {
|
|
197
|
+
externalOnClick?.(event);
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
onPointerDown(event) {
|
|
201
|
+
if (disabled) {
|
|
202
|
+
event.preventDefault();
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
externalOnPointerDown?.(event);
|
|
206
|
+
}
|
|
207
|
+
}, !isNativeButton ? {
|
|
208
|
+
role: "button"
|
|
209
|
+
} : undefined, focusableWhenDisabledProps, otherExternalProps);
|
|
210
|
+
}, [disabled, focusableWhenDisabledProps, isCompositeItem, isNativeButton]);
|
|
211
|
+
const buttonRef = useStableCallback((element) => {
|
|
212
|
+
elementRef.current = element;
|
|
213
|
+
updateDisabled();
|
|
214
|
+
});
|
|
215
|
+
return {
|
|
216
|
+
getButtonProps,
|
|
217
|
+
buttonRef
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
function isButtonElement(elem) {
|
|
221
|
+
return isHTMLElement(elem) && elem.tagName === "BUTTON";
|
|
222
|
+
}
|
|
223
|
+
function isValidLinkElement(elem) {
|
|
224
|
+
return Boolean(elem?.tagName === "A" && elem?.href);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
export { useButton };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SafeReact
|
|
3
|
+
} from "./_chunk-n7dnqnbw.js";
|
|
4
|
+
|
|
5
|
+
// node_modules/.deno/@base-ui+utils@0.2.8/node_modules/@base-ui/utils/esm/useId.js
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
"use client";
|
|
8
|
+
var globalId = 0;
|
|
9
|
+
function useGlobalId(idOverride, prefix = "mui") {
|
|
10
|
+
const [defaultId, setDefaultId] = React.useState(idOverride);
|
|
11
|
+
const id = idOverride || defaultId;
|
|
12
|
+
React.useEffect(() => {
|
|
13
|
+
if (defaultId == null) {
|
|
14
|
+
globalId += 1;
|
|
15
|
+
setDefaultId(`${prefix}-${globalId}`);
|
|
16
|
+
}
|
|
17
|
+
}, [defaultId, prefix]);
|
|
18
|
+
return id;
|
|
19
|
+
}
|
|
20
|
+
var maybeReactUseId = SafeReact.useId;
|
|
21
|
+
function useId(idOverride, prefix) {
|
|
22
|
+
if (maybeReactUseId !== undefined) {
|
|
23
|
+
const reactId = maybeReactUseId();
|
|
24
|
+
return idOverride ?? (prefix ? `${prefix}-${reactId}` : reactId);
|
|
25
|
+
}
|
|
26
|
+
return useGlobalId(idOverride, prefix);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/internals/useBaseUiId.js
|
|
30
|
+
"use client";
|
|
31
|
+
function useBaseUiId(idOverride) {
|
|
32
|
+
return useId(idOverride, "base-ui");
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export { useId, useBaseUiId };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useFieldRootContext
|
|
3
|
+
} from "./_chunk-kfz96xv1.js";
|
|
4
|
+
import {
|
|
5
|
+
useIsoLayoutEffect
|
|
6
|
+
} from "./_chunk-b40erthe.js";
|
|
7
|
+
import {
|
|
8
|
+
NOOP
|
|
9
|
+
} from "./_chunk-1s41sngz.js";
|
|
10
|
+
|
|
11
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/internals/field-register-control/useRegisterFieldControl.js
|
|
12
|
+
import * as React from "react";
|
|
13
|
+
"use client";
|
|
14
|
+
function useRegisterFieldControl(controlRef, params) {
|
|
15
|
+
const {
|
|
16
|
+
enabled = true,
|
|
17
|
+
getValue,
|
|
18
|
+
id,
|
|
19
|
+
value
|
|
20
|
+
} = params;
|
|
21
|
+
const {
|
|
22
|
+
registerFieldControl
|
|
23
|
+
} = useFieldRootContext();
|
|
24
|
+
const sourceRef = React.useRef(null);
|
|
25
|
+
if (!sourceRef.current) {
|
|
26
|
+
sourceRef.current = Symbol();
|
|
27
|
+
}
|
|
28
|
+
useIsoLayoutEffect(() => {
|
|
29
|
+
const source = sourceRef.current;
|
|
30
|
+
if (!source || !enabled) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
registerFieldControl(source, {
|
|
34
|
+
controlRef,
|
|
35
|
+
getValue,
|
|
36
|
+
id,
|
|
37
|
+
value
|
|
38
|
+
});
|
|
39
|
+
return () => {
|
|
40
|
+
registerFieldControl(source, undefined);
|
|
41
|
+
};
|
|
42
|
+
}, [controlRef, enabled, getValue, id, registerFieldControl, value]);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/internals/form-context/FormContext.js
|
|
46
|
+
import * as React2 from "react";
|
|
47
|
+
"use client";
|
|
48
|
+
var FormContext = /* @__PURE__ */ React2.createContext({
|
|
49
|
+
formRef: {
|
|
50
|
+
current: {
|
|
51
|
+
fields: new Map
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
errors: {},
|
|
55
|
+
clearErrors: NOOP,
|
|
56
|
+
validationMode: "onSubmit",
|
|
57
|
+
submitAttemptedRef: {
|
|
58
|
+
current: false
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
if (true)
|
|
62
|
+
FormContext.displayName = "FormContext";
|
|
63
|
+
function useFormContext() {
|
|
64
|
+
return React2.useContext(FormContext);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export { useRegisterFieldControl, useFormContext };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isReactVersionAtLeast
|
|
3
|
+
} from "./_chunk-1s41sngz.js";
|
|
4
|
+
|
|
5
|
+
// node_modules/.deno/@base-ui+utils@0.2.8/node_modules/@base-ui/utils/esm/inertValue.js
|
|
6
|
+
function inertValue(value) {
|
|
7
|
+
if (isReactVersionAtLeast(19)) {
|
|
8
|
+
return value;
|
|
9
|
+
}
|
|
10
|
+
return value ? "true" : undefined;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { inertValue };
|