@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,104 @@
|
|
|
1
|
+
import {
|
|
2
|
+
FOCUSABLE_ATTRIBUTE,
|
|
3
|
+
TYPEABLE_SELECTOR,
|
|
4
|
+
isJSDOM
|
|
5
|
+
} from "./_chunk-t7j3rbpv.js";
|
|
6
|
+
import {
|
|
7
|
+
isElement,
|
|
8
|
+
isHTMLElement,
|
|
9
|
+
isShadowRoot
|
|
10
|
+
} from "./_chunk-sx6vkz01.js";
|
|
11
|
+
|
|
12
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/internals/shadowDom.js
|
|
13
|
+
function activeElement(doc) {
|
|
14
|
+
let element = doc.activeElement;
|
|
15
|
+
while (element?.shadowRoot?.activeElement != null) {
|
|
16
|
+
element = element.shadowRoot.activeElement;
|
|
17
|
+
}
|
|
18
|
+
return element;
|
|
19
|
+
}
|
|
20
|
+
function contains(parent, child) {
|
|
21
|
+
if (!parent || !child) {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
const rootNode = child.getRootNode?.();
|
|
25
|
+
if (parent.contains(child)) {
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
if (rootNode && isShadowRoot(rootNode)) {
|
|
29
|
+
let next = child;
|
|
30
|
+
while (next) {
|
|
31
|
+
if (parent === next) {
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
next = next.parentNode || next.host;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
function getTarget(event) {
|
|
40
|
+
if ("composedPath" in event) {
|
|
41
|
+
return event.composedPath()[0];
|
|
42
|
+
}
|
|
43
|
+
return event.target;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/floating-ui-react/utils/element.js
|
|
47
|
+
function isTargetInsideEnabledTrigger(target, triggerElements) {
|
|
48
|
+
if (!isElement(target)) {
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
const targetElement = target;
|
|
52
|
+
if (triggerElements.hasElement(targetElement)) {
|
|
53
|
+
return !targetElement.hasAttribute("data-trigger-disabled");
|
|
54
|
+
}
|
|
55
|
+
for (const [, trigger] of triggerElements.entries()) {
|
|
56
|
+
if (contains(trigger, targetElement)) {
|
|
57
|
+
return !trigger.hasAttribute("data-trigger-disabled");
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
function isEventTargetWithin(event, node) {
|
|
63
|
+
if (node == null) {
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
if ("composedPath" in event) {
|
|
67
|
+
return event.composedPath().includes(node);
|
|
68
|
+
}
|
|
69
|
+
const eventAgain = event;
|
|
70
|
+
return eventAgain.target != null && node.contains(eventAgain.target);
|
|
71
|
+
}
|
|
72
|
+
function isRootElement(element) {
|
|
73
|
+
return element.matches("html,body");
|
|
74
|
+
}
|
|
75
|
+
function isTypeableElement(element) {
|
|
76
|
+
return isHTMLElement(element) && element.matches(TYPEABLE_SELECTOR);
|
|
77
|
+
}
|
|
78
|
+
function isInteractiveElement(element) {
|
|
79
|
+
return element?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${TYPEABLE_SELECTOR}`) != null;
|
|
80
|
+
}
|
|
81
|
+
function isTypeableCombobox(element) {
|
|
82
|
+
if (!element) {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
return element.getAttribute("role") === "combobox" && isTypeableElement(element);
|
|
86
|
+
}
|
|
87
|
+
function matchesFocusVisible(element) {
|
|
88
|
+
if (!element || isJSDOM) {
|
|
89
|
+
return true;
|
|
90
|
+
}
|
|
91
|
+
try {
|
|
92
|
+
return element.matches(":focus-visible");
|
|
93
|
+
} catch (_e) {
|
|
94
|
+
return true;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
function getFloatingFocusElement(floatingElement) {
|
|
98
|
+
if (!floatingElement) {
|
|
99
|
+
return null;
|
|
100
|
+
}
|
|
101
|
+
return floatingElement.hasAttribute(FOCUSABLE_ATTRIBUTE) ? floatingElement : floatingElement.querySelector(`[${FOCUSABLE_ATTRIBUTE}]`) || floatingElement;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export { activeElement, contains, getTarget, isTargetInsideEnabledTrigger, isEventTargetWithin, isRootElement, isTypeableElement, isInteractiveElement, isTypeableCombobox, matchesFocusVisible, getFloatingFocusElement };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// node_modules/.deno/@base-ui+utils@0.2.8/node_modules/@base-ui/utils/esm/useIsoLayoutEffect.js
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
"use client";
|
|
4
|
+
var noop = () => {};
|
|
5
|
+
var useIsoLayoutEffect = typeof document !== "undefined" ? React.useLayoutEffect : noop;
|
|
6
|
+
|
|
7
|
+
export { useIsoLayoutEffect };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useCompositeListItem
|
|
3
|
+
} from "./_chunk-ek863ta9.js";
|
|
4
|
+
import {
|
|
5
|
+
useCompositeRootContext
|
|
6
|
+
} from "./_chunk-6xevjepc.js";
|
|
7
|
+
import {
|
|
8
|
+
useMergedRefs
|
|
9
|
+
} from "./_chunk-1s41sngz.js";
|
|
10
|
+
|
|
11
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/internals/composite/item/useCompositeItem.js
|
|
12
|
+
import * as React from "react";
|
|
13
|
+
"use client";
|
|
14
|
+
function useCompositeItem(params = {}) {
|
|
15
|
+
const {
|
|
16
|
+
highlightItemOnHover,
|
|
17
|
+
highlightedIndex,
|
|
18
|
+
onHighlightedIndexChange
|
|
19
|
+
} = useCompositeRootContext();
|
|
20
|
+
const {
|
|
21
|
+
ref,
|
|
22
|
+
index
|
|
23
|
+
} = useCompositeListItem(params);
|
|
24
|
+
const isHighlighted = highlightedIndex === index;
|
|
25
|
+
const itemRef = React.useRef(null);
|
|
26
|
+
const mergedRef = useMergedRefs(ref, itemRef);
|
|
27
|
+
const compositeProps = React.useMemo(() => ({
|
|
28
|
+
tabIndex: isHighlighted ? 0 : -1,
|
|
29
|
+
onFocus() {
|
|
30
|
+
onHighlightedIndexChange(index);
|
|
31
|
+
},
|
|
32
|
+
onMouseMove() {
|
|
33
|
+
const item = itemRef.current;
|
|
34
|
+
if (!highlightItemOnHover || !item) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
const disabled = item.hasAttribute("disabled") || item.ariaDisabled === "true";
|
|
38
|
+
if (!isHighlighted && !disabled) {
|
|
39
|
+
item.focus();
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}), [isHighlighted, onHighlightedIndexChange, index, highlightItemOnHover]);
|
|
43
|
+
return {
|
|
44
|
+
compositeProps,
|
|
45
|
+
compositeRef: mergedRef,
|
|
46
|
+
index
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export { useCompositeItem };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/checkbox-group/CheckboxGroupContext.js
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
"use client";
|
|
4
|
+
var CheckboxGroupContext = /* @__PURE__ */ React.createContext(undefined);
|
|
5
|
+
if (true)
|
|
6
|
+
CheckboxGroupContext.displayName = "CheckboxGroupContext";
|
|
7
|
+
function useCheckboxGroupContext(optional = true) {
|
|
8
|
+
const context = React.useContext(CheckboxGroupContext);
|
|
9
|
+
if (context === undefined && !optional) {
|
|
10
|
+
throw new Error("Base UI: CheckboxGroupContext is missing. CheckboxGroup parts must be placed within <CheckboxGroup>.");
|
|
11
|
+
}
|
|
12
|
+
return context;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { useCheckboxGroupContext };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/fieldset/root/FieldsetRootContext.js
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
"use client";
|
|
4
|
+
var FieldsetRootContext = /* @__PURE__ */ React.createContext({
|
|
5
|
+
legendId: undefined,
|
|
6
|
+
setLegendId: () => {},
|
|
7
|
+
disabled: undefined
|
|
8
|
+
});
|
|
9
|
+
if (true)
|
|
10
|
+
FieldsetRootContext.displayName = "FieldsetRootContext";
|
|
11
|
+
function useFieldsetRootContext(optional = false) {
|
|
12
|
+
const context = React.useContext(FieldsetRootContext);
|
|
13
|
+
if (!context && !optional) {
|
|
14
|
+
throw new Error("Base UI: FieldsetRootContext is missing. Fieldset parts must be placed within <Fieldset.Root>.");
|
|
15
|
+
}
|
|
16
|
+
return context;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export { useFieldsetRootContext };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useStableCallback
|
|
3
|
+
} from "./_chunk-mznt6ktj.js";
|
|
4
|
+
import {
|
|
5
|
+
useIsoLayoutEffect
|
|
6
|
+
} from "./_chunk-b40erthe.js";
|
|
7
|
+
|
|
8
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/internals/useValueChanged.js
|
|
9
|
+
import * as React from "react";
|
|
10
|
+
"use client";
|
|
11
|
+
function useValueChanged(value, onChange) {
|
|
12
|
+
const valueRef = React.useRef(value);
|
|
13
|
+
const onChangeCallback = useStableCallback(onChange);
|
|
14
|
+
useIsoLayoutEffect(() => {
|
|
15
|
+
if (valueRef.current === value) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
onChangeCallback(valueRef.current);
|
|
19
|
+
}, [value, onChangeCallback]);
|
|
20
|
+
useIsoLayoutEffect(() => {
|
|
21
|
+
valueRef.current = value;
|
|
22
|
+
}, [value]);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export { useValueChanged };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useIsoLayoutEffect
|
|
3
|
+
} from "./_chunk-b40erthe.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/useValueAsRef.js
|
|
9
|
+
"use client";
|
|
10
|
+
function useValueAsRef(value) {
|
|
11
|
+
const latest = useRefWithInit(createLatestRef, value).current;
|
|
12
|
+
latest.next = value;
|
|
13
|
+
useIsoLayoutEffect(latest.effect);
|
|
14
|
+
return latest;
|
|
15
|
+
}
|
|
16
|
+
function createLatestRef(value) {
|
|
17
|
+
const latest = {
|
|
18
|
+
current: value,
|
|
19
|
+
next: value,
|
|
20
|
+
effect: () => {
|
|
21
|
+
latest.current = latest.next;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
return latest;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export { useValueAsRef };
|
|
File without changes
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useCompositeListContext
|
|
3
|
+
} from "./_chunk-20rtfsz9.js";
|
|
4
|
+
import {
|
|
5
|
+
useIsoLayoutEffect
|
|
6
|
+
} from "./_chunk-b40erthe.js";
|
|
7
|
+
|
|
8
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/internals/composite/list/useCompositeListItem.js
|
|
9
|
+
import * as React from "react";
|
|
10
|
+
"use client";
|
|
11
|
+
var IndexGuessBehavior = /* @__PURE__ */ function(IndexGuessBehavior2) {
|
|
12
|
+
IndexGuessBehavior2[IndexGuessBehavior2["None"] = 0] = "None";
|
|
13
|
+
IndexGuessBehavior2[IndexGuessBehavior2["GuessFromOrder"] = 1] = "GuessFromOrder";
|
|
14
|
+
return IndexGuessBehavior2;
|
|
15
|
+
}({});
|
|
16
|
+
function useCompositeListItem(params = {}) {
|
|
17
|
+
const {
|
|
18
|
+
label,
|
|
19
|
+
metadata,
|
|
20
|
+
textRef,
|
|
21
|
+
indexGuessBehavior,
|
|
22
|
+
index: externalIndex
|
|
23
|
+
} = params;
|
|
24
|
+
const {
|
|
25
|
+
register,
|
|
26
|
+
unregister,
|
|
27
|
+
subscribeMapChange,
|
|
28
|
+
elementsRef,
|
|
29
|
+
labelsRef,
|
|
30
|
+
nextIndexRef
|
|
31
|
+
} = useCompositeListContext();
|
|
32
|
+
const indexRef = React.useRef(-1);
|
|
33
|
+
const [index, setIndex] = React.useState(externalIndex ?? (indexGuessBehavior === IndexGuessBehavior.GuessFromOrder ? () => {
|
|
34
|
+
if (indexRef.current === -1) {
|
|
35
|
+
const newIndex = nextIndexRef.current;
|
|
36
|
+
nextIndexRef.current += 1;
|
|
37
|
+
indexRef.current = newIndex;
|
|
38
|
+
}
|
|
39
|
+
return indexRef.current;
|
|
40
|
+
} : -1));
|
|
41
|
+
const componentRef = React.useRef(null);
|
|
42
|
+
const ref = React.useCallback((node) => {
|
|
43
|
+
componentRef.current = node;
|
|
44
|
+
if (index !== -1 && node !== null) {
|
|
45
|
+
elementsRef.current[index] = node;
|
|
46
|
+
if (labelsRef) {
|
|
47
|
+
const isLabelDefined = label !== undefined;
|
|
48
|
+
labelsRef.current[index] = isLabelDefined ? label : textRef?.current?.textContent ?? node.textContent;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}, [index, elementsRef, labelsRef, label, textRef]);
|
|
52
|
+
useIsoLayoutEffect(() => {
|
|
53
|
+
if (externalIndex != null) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
const node = componentRef.current;
|
|
57
|
+
if (node) {
|
|
58
|
+
register(node, metadata);
|
|
59
|
+
return () => {
|
|
60
|
+
unregister(node);
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
return;
|
|
64
|
+
}, [externalIndex, register, unregister, metadata]);
|
|
65
|
+
useIsoLayoutEffect(() => {
|
|
66
|
+
if (externalIndex != null) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
return subscribeMapChange((map) => {
|
|
70
|
+
const i = componentRef.current ? map.get(componentRef.current)?.index : null;
|
|
71
|
+
if (i != null) {
|
|
72
|
+
setIndex(i);
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
}, [externalIndex, subscribeMapChange, setIndex]);
|
|
76
|
+
return React.useMemo(() => ({
|
|
77
|
+
ref,
|
|
78
|
+
index
|
|
79
|
+
}), [index, ref]);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export { IndexGuessBehavior, useCompositeListItem };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// node_modules/.deno/@base-ui+utils@0.2.8/node_modules/@base-ui/utils/esm/useOnFirstRender.js
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
"use client";
|
|
4
|
+
function useOnFirstRender(fn) {
|
|
5
|
+
const ref = React.useRef(true);
|
|
6
|
+
if (ref.current) {
|
|
7
|
+
ref.current = false;
|
|
8
|
+
fn();
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export { useOnFirstRender };
|
|
File without changes
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {
|
|
2
|
+
FloatingRootStore,
|
|
3
|
+
PopupTriggerMap
|
|
4
|
+
} from "./_chunk-2tyt8f8r.js";
|
|
5
|
+
|
|
6
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/floating-ui-react/utils/getEmptyRootContext.js
|
|
7
|
+
function getEmptyRootContext() {
|
|
8
|
+
return new FloatingRootStore({
|
|
9
|
+
open: false,
|
|
10
|
+
transitionStatus: undefined,
|
|
11
|
+
floatingElement: null,
|
|
12
|
+
referenceElement: null,
|
|
13
|
+
triggerElements: new PopupTriggerMap,
|
|
14
|
+
floatingId: "",
|
|
15
|
+
syncOnly: false,
|
|
16
|
+
nested: false,
|
|
17
|
+
onOpenChange: undefined
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export { getEmptyRootContext };
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useRegisteredLabelId
|
|
3
|
+
} from "./_chunk-w68yxg9d.js";
|
|
4
|
+
import {
|
|
5
|
+
useLabelableContext
|
|
6
|
+
} from "./_chunk-kfz96xv1.js";
|
|
7
|
+
import {
|
|
8
|
+
ownerDocument
|
|
9
|
+
} from "./_chunk-xb7ph1ka.js";
|
|
10
|
+
import {
|
|
11
|
+
getTarget
|
|
12
|
+
} from "./_chunk-atnkefgd.js";
|
|
13
|
+
import {
|
|
14
|
+
isHTMLElement
|
|
15
|
+
} from "./_chunk-sx6vkz01.js";
|
|
16
|
+
import {
|
|
17
|
+
useStableCallback
|
|
18
|
+
} from "./_chunk-mznt6ktj.js";
|
|
19
|
+
|
|
20
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/internals/labelable-provider/useLabel.js
|
|
21
|
+
"use client";
|
|
22
|
+
function useLabel(params = {}) {
|
|
23
|
+
const {
|
|
24
|
+
id: idProp,
|
|
25
|
+
fallbackControlId,
|
|
26
|
+
native = false,
|
|
27
|
+
setLabelId: setLabelIdProp,
|
|
28
|
+
focusControl: focusControlProp
|
|
29
|
+
} = params;
|
|
30
|
+
const {
|
|
31
|
+
controlId: contextControlId,
|
|
32
|
+
setLabelId: setContextLabelId
|
|
33
|
+
} = useLabelableContext();
|
|
34
|
+
const syncLabelId = useStableCallback((nextLabelId) => {
|
|
35
|
+
setContextLabelId(nextLabelId);
|
|
36
|
+
setLabelIdProp?.(nextLabelId);
|
|
37
|
+
});
|
|
38
|
+
const id = useRegisteredLabelId(idProp, syncLabelId);
|
|
39
|
+
const resolvedControlId = contextControlId ?? fallbackControlId;
|
|
40
|
+
function focusControl(event) {
|
|
41
|
+
if (focusControlProp) {
|
|
42
|
+
focusControlProp(event, resolvedControlId);
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
if (!resolvedControlId) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
const controlElement = ownerDocument(event.currentTarget).getElementById(resolvedControlId);
|
|
49
|
+
if (isHTMLElement(controlElement)) {
|
|
50
|
+
focusElementWithVisible(controlElement);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function handleInteraction(event) {
|
|
54
|
+
const target = getTarget(event.nativeEvent);
|
|
55
|
+
if (target?.closest("button,input,select,textarea")) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
if (!event.defaultPrevented && event.detail > 1) {
|
|
59
|
+
event.preventDefault();
|
|
60
|
+
}
|
|
61
|
+
if (native) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
focusControl(event);
|
|
65
|
+
}
|
|
66
|
+
return native ? {
|
|
67
|
+
id,
|
|
68
|
+
htmlFor: resolvedControlId ?? undefined,
|
|
69
|
+
onMouseDown: handleInteraction
|
|
70
|
+
} : {
|
|
71
|
+
id,
|
|
72
|
+
onClick: handleInteraction,
|
|
73
|
+
onPointerDown(event) {
|
|
74
|
+
event.preventDefault();
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
function focusElementWithVisible(element) {
|
|
79
|
+
element.focus({
|
|
80
|
+
focusVisible: true
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export { useLabel, focusElementWithVisible };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// node_modules/.deno/@base-ui+utils@0.2.8/node_modules/@base-ui/utils/esm/usePreviousValue.js
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
"use client";
|
|
4
|
+
function usePreviousValue(value) {
|
|
5
|
+
const [state, setState] = React.useState({
|
|
6
|
+
current: value,
|
|
7
|
+
previous: null
|
|
8
|
+
});
|
|
9
|
+
if (value !== state.current) {
|
|
10
|
+
setState({
|
|
11
|
+
current: value,
|
|
12
|
+
previous: state.current
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
return state.previous;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export { usePreviousValue };
|