@uipath/apollo-wind 2.64.0 → 2.65.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/dist/components/ui/index.cjs +80 -69
- package/dist/components/ui/index.d.ts +1 -0
- package/dist/components/ui/index.js +1 -0
- package/dist/components/ui/sidebar/index.cjs +113 -0
- package/dist/components/ui/sidebar/index.d.ts +10 -0
- package/dist/components/ui/sidebar/index.js +7 -0
- package/dist/components/ui/sidebar/sidebar-context.cjs +151 -0
- package/dist/components/ui/sidebar/sidebar-context.d.ts +39 -0
- package/dist/components/ui/sidebar/sidebar-context.js +108 -0
- package/dist/components/ui/sidebar/sidebar-group.cjs +87 -0
- package/dist/components/ui/sidebar/sidebar-group.d.ts +10 -0
- package/dist/components/ui/sidebar/sidebar-group.js +44 -0
- package/dist/components/ui/sidebar/sidebar-layout.cjs +92 -0
- package/dist/components/ui/sidebar/sidebar-layout.d.ts +7 -0
- package/dist/components/ui/sidebar/sidebar-layout.js +46 -0
- package/dist/components/ui/sidebar/sidebar-menu-sub.cjs +79 -0
- package/dist/components/ui/sidebar/sidebar-menu-sub.d.ts +11 -0
- package/dist/components/ui/sidebar/sidebar-menu-sub.js +39 -0
- package/dist/components/ui/sidebar/sidebar-menu.cjs +185 -0
- package/dist/components/ui/sidebar/sidebar-menu.d.ts +26 -0
- package/dist/components/ui/sidebar/sidebar-menu.js +133 -0
- package/dist/components/ui/sidebar/sidebar.cjs +220 -0
- package/dist/components/ui/sidebar/sidebar.d.ts +22 -0
- package/dist/components/ui/sidebar/sidebar.js +177 -0
- package/dist/index.cjs +94 -18
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -1
- package/dist/styles.css +626 -0
- package/package.json +1 -1
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare const SIDEBAR_WIDTH_MOBILE = "18rem";
|
|
3
|
+
type SidebarContextProps = {
|
|
4
|
+
state: 'expanded' | 'collapsed';
|
|
5
|
+
open: boolean;
|
|
6
|
+
setOpen: (open: boolean) => void;
|
|
7
|
+
openMobile: boolean;
|
|
8
|
+
setOpenMobile: (open: boolean) => void;
|
|
9
|
+
isMobile: boolean;
|
|
10
|
+
toggleSidebar: () => void;
|
|
11
|
+
};
|
|
12
|
+
declare function useSidebar(): SidebarContextProps;
|
|
13
|
+
/**
|
|
14
|
+
* Wraps the sidebar and the content next to it. By default the wrapper fills at
|
|
15
|
+
* least the viewport height (`min-h-svh`), which suits a full-page app layout.
|
|
16
|
+
* When embedding a `collapsible="none"` sidebar in a dialog, card or split pane,
|
|
17
|
+
* pass `className="min-h-0"` (plus a height such as `h-full`) so it sizes to its
|
|
18
|
+
* container instead.
|
|
19
|
+
*/
|
|
20
|
+
export interface SidebarProviderProps extends React.ComponentProps<'div'> {
|
|
21
|
+
/** Initial open state when uncontrolled. */
|
|
22
|
+
defaultOpen?: boolean;
|
|
23
|
+
/** Controlled open state. */
|
|
24
|
+
open?: boolean;
|
|
25
|
+
/** Called when the open state changes. Use it to persist the state. */
|
|
26
|
+
onOpenChange?: (open: boolean) => void;
|
|
27
|
+
/** Toggle the sidebar with Cmd/Ctrl+B. Off by default. */
|
|
28
|
+
keyboardShortcut?: boolean;
|
|
29
|
+
}
|
|
30
|
+
declare const SidebarProvider: React.ForwardRefExoticComponent<Omit<SidebarProviderProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
31
|
+
/**
|
|
32
|
+
* Capture-phase click handler for `aria-disabled` items. `aria-disabled` only
|
|
33
|
+
* announces the state and the disabled styles only block pointer input, so this
|
|
34
|
+
* also stops Enter on a focused link. Running in the capture phase matters for
|
|
35
|
+
* `asChild`: Radix Slot runs the child's own `onClick` before the slot's, and a
|
|
36
|
+
* capture handler that stops propagation keeps both from firing.
|
|
37
|
+
*/
|
|
38
|
+
declare function guardDisabledClick<E extends HTMLElement>(ariaDisabled: React.AriaAttributes['aria-disabled'], onClickCapture: React.MouseEventHandler<E> | undefined): React.MouseEventHandler<E>;
|
|
39
|
+
export { guardDisabledClick, SidebarProvider, useSidebar };
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { createContext, forwardRef, useCallback, useContext, useEffect, useMemo, useState } from "react";
|
|
4
|
+
import { TooltipProvider } from "../tooltip.js";
|
|
5
|
+
import { cn } from "../../../lib/index.js";
|
|
6
|
+
const SIDEBAR_WIDTH = '16rem';
|
|
7
|
+
const SIDEBAR_WIDTH_MOBILE = '18rem';
|
|
8
|
+
const SIDEBAR_WIDTH_ICON = '3rem';
|
|
9
|
+
const SIDEBAR_KEYBOARD_SHORTCUT = 'b';
|
|
10
|
+
const MOBILE_BREAKPOINT = 768;
|
|
11
|
+
function useIsMobile() {
|
|
12
|
+
const [isMobile, setIsMobile] = useState(false);
|
|
13
|
+
useEffect(()=>{
|
|
14
|
+
if ("u" < typeof window || !window.matchMedia) return;
|
|
15
|
+
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
|
|
16
|
+
const onChange = ()=>setIsMobile(mql.matches);
|
|
17
|
+
onChange();
|
|
18
|
+
mql.addEventListener('change', onChange);
|
|
19
|
+
return ()=>mql.removeEventListener('change', onChange);
|
|
20
|
+
}, []);
|
|
21
|
+
return isMobile;
|
|
22
|
+
}
|
|
23
|
+
const SidebarContext = /*#__PURE__*/ createContext(null);
|
|
24
|
+
function useSidebar() {
|
|
25
|
+
const context = useContext(SidebarContext);
|
|
26
|
+
if (!context) throw new Error('useSidebar must be used within a SidebarProvider.');
|
|
27
|
+
return context;
|
|
28
|
+
}
|
|
29
|
+
const SidebarProvider = /*#__PURE__*/ forwardRef(({ defaultOpen = true, open: openProp, onOpenChange: setOpenProp, keyboardShortcut = false, className, style, children, ...props }, ref)=>{
|
|
30
|
+
const isMobile = useIsMobile();
|
|
31
|
+
const [openMobile, setOpenMobile] = useState(false);
|
|
32
|
+
const [_open, _setOpen] = useState(defaultOpen);
|
|
33
|
+
const open = openProp ?? _open;
|
|
34
|
+
const setOpen = useCallback((value)=>{
|
|
35
|
+
const openState = 'function' == typeof value ? value(open) : value;
|
|
36
|
+
if (void 0 === openProp) _setOpen(openState);
|
|
37
|
+
setOpenProp?.(openState);
|
|
38
|
+
}, [
|
|
39
|
+
setOpenProp,
|
|
40
|
+
openProp,
|
|
41
|
+
open
|
|
42
|
+
]);
|
|
43
|
+
const toggleSidebar = useCallback(()=>isMobile ? setOpenMobile((value)=>!value) : setOpen((value)=>!value), [
|
|
44
|
+
isMobile,
|
|
45
|
+
setOpen
|
|
46
|
+
]);
|
|
47
|
+
useEffect(()=>{
|
|
48
|
+
if (!keyboardShortcut) return;
|
|
49
|
+
const handleKeyDown = (event)=>{
|
|
50
|
+
if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
|
|
51
|
+
event.preventDefault();
|
|
52
|
+
toggleSidebar();
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
window.addEventListener('keydown', handleKeyDown);
|
|
56
|
+
return ()=>window.removeEventListener('keydown', handleKeyDown);
|
|
57
|
+
}, [
|
|
58
|
+
keyboardShortcut,
|
|
59
|
+
toggleSidebar
|
|
60
|
+
]);
|
|
61
|
+
const state = open ? 'expanded' : 'collapsed';
|
|
62
|
+
const contextValue = useMemo(()=>({
|
|
63
|
+
state,
|
|
64
|
+
open,
|
|
65
|
+
setOpen,
|
|
66
|
+
isMobile,
|
|
67
|
+
openMobile,
|
|
68
|
+
setOpenMobile,
|
|
69
|
+
toggleSidebar
|
|
70
|
+
}), [
|
|
71
|
+
state,
|
|
72
|
+
open,
|
|
73
|
+
setOpen,
|
|
74
|
+
isMobile,
|
|
75
|
+
openMobile,
|
|
76
|
+
toggleSidebar
|
|
77
|
+
]);
|
|
78
|
+
return /*#__PURE__*/ jsx(SidebarContext.Provider, {
|
|
79
|
+
value: contextValue,
|
|
80
|
+
children: /*#__PURE__*/ jsx(TooltipProvider, {
|
|
81
|
+
delayDuration: 0,
|
|
82
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
83
|
+
ref: ref,
|
|
84
|
+
"data-slot": "sidebar-wrapper",
|
|
85
|
+
style: {
|
|
86
|
+
'--sidebar-width': SIDEBAR_WIDTH,
|
|
87
|
+
'--sidebar-width-icon': SIDEBAR_WIDTH_ICON,
|
|
88
|
+
...style
|
|
89
|
+
},
|
|
90
|
+
className: cn('group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-surface', className),
|
|
91
|
+
...props,
|
|
92
|
+
children: children
|
|
93
|
+
})
|
|
94
|
+
})
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
SidebarProvider.displayName = 'SidebarProvider';
|
|
98
|
+
function guardDisabledClick(ariaDisabled, onClickCapture) {
|
|
99
|
+
return (event)=>{
|
|
100
|
+
if (true === ariaDisabled || 'true' === ariaDisabled) {
|
|
101
|
+
event.preventDefault();
|
|
102
|
+
event.stopPropagation();
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
onClickCapture?.(event);
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
export { SIDEBAR_WIDTH_MOBILE, SidebarProvider, guardDisabledClick, useSidebar };
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
SidebarGroupAction: ()=>SidebarGroupAction,
|
|
28
|
+
SidebarGroupContent: ()=>SidebarGroupContent,
|
|
29
|
+
SidebarGroupLabel: ()=>SidebarGroupLabel,
|
|
30
|
+
SidebarGroup: ()=>SidebarGroup
|
|
31
|
+
});
|
|
32
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
33
|
+
const react_slot_namespaceObject = require("@radix-ui/react-slot");
|
|
34
|
+
const external_react_namespaceObject = require("react");
|
|
35
|
+
const index_cjs_namespaceObject = require("../../../lib/index.cjs");
|
|
36
|
+
const SidebarGroup = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
37
|
+
ref: ref,
|
|
38
|
+
"data-slot": "sidebar-group",
|
|
39
|
+
"data-sidebar": "group",
|
|
40
|
+
className: (0, index_cjs_namespaceObject.cn)('relative flex w-full min-w-0 flex-col p-2', className),
|
|
41
|
+
...props
|
|
42
|
+
}));
|
|
43
|
+
SidebarGroup.displayName = 'SidebarGroup';
|
|
44
|
+
const SidebarGroupLabel = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, asChild = false, ...props }, ref)=>{
|
|
45
|
+
const Comp = asChild ? react_slot_namespaceObject.Slot : 'div';
|
|
46
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Comp, {
|
|
47
|
+
ref: ref,
|
|
48
|
+
"data-slot": "sidebar-group-label",
|
|
49
|
+
"data-sidebar": "group-label",
|
|
50
|
+
className: (0, index_cjs_namespaceObject.cn)('flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-foreground-muted ring-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0', 'group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0', className),
|
|
51
|
+
...props
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
SidebarGroupLabel.displayName = 'SidebarGroupLabel';
|
|
55
|
+
const SidebarGroupAction = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, asChild = false, ...props }, ref)=>{
|
|
56
|
+
const Comp = asChild ? react_slot_namespaceObject.Slot : 'button';
|
|
57
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Comp, {
|
|
58
|
+
ref: ref,
|
|
59
|
+
type: asChild ? void 0 : 'button',
|
|
60
|
+
"data-slot": "sidebar-group-action",
|
|
61
|
+
"data-sidebar": "group-action",
|
|
62
|
+
className: (0, index_cjs_namespaceObject.cn)('absolute top-3.5 right-3 flex aspect-square w-5 cursor-pointer items-center justify-center rounded-md p-0 text-foreground-muted ring-ring outline-hidden transition-transform hover:bg-background-hover hover:text-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0', 'after:absolute after:-inset-2 md:after:hidden', 'group-data-[collapsible=icon]:hidden', className),
|
|
63
|
+
...props
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
SidebarGroupAction.displayName = 'SidebarGroupAction';
|
|
67
|
+
const SidebarGroupContent = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
68
|
+
ref: ref,
|
|
69
|
+
"data-slot": "sidebar-group-content",
|
|
70
|
+
"data-sidebar": "group-content",
|
|
71
|
+
className: (0, index_cjs_namespaceObject.cn)('w-full text-sm', className),
|
|
72
|
+
...props
|
|
73
|
+
}));
|
|
74
|
+
SidebarGroupContent.displayName = 'SidebarGroupContent';
|
|
75
|
+
exports.SidebarGroup = __webpack_exports__.SidebarGroup;
|
|
76
|
+
exports.SidebarGroupAction = __webpack_exports__.SidebarGroupAction;
|
|
77
|
+
exports.SidebarGroupContent = __webpack_exports__.SidebarGroupContent;
|
|
78
|
+
exports.SidebarGroupLabel = __webpack_exports__.SidebarGroupLabel;
|
|
79
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
80
|
+
"SidebarGroup",
|
|
81
|
+
"SidebarGroupAction",
|
|
82
|
+
"SidebarGroupContent",
|
|
83
|
+
"SidebarGroupLabel"
|
|
84
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
85
|
+
Object.defineProperty(exports, '__esModule', {
|
|
86
|
+
value: true
|
|
87
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare const SidebarGroup: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
3
|
+
declare const SidebarGroupLabel: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & {
|
|
4
|
+
asChild?: boolean;
|
|
5
|
+
}, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
declare const SidebarGroupAction: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLButtonElement> & React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
7
|
+
asChild?: boolean;
|
|
8
|
+
}, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
9
|
+
declare const SidebarGroupContent: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
export { SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
import { cn } from "../../../lib/index.js";
|
|
5
|
+
const SidebarGroup = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx("div", {
|
|
6
|
+
ref: ref,
|
|
7
|
+
"data-slot": "sidebar-group",
|
|
8
|
+
"data-sidebar": "group",
|
|
9
|
+
className: cn('relative flex w-full min-w-0 flex-col p-2', className),
|
|
10
|
+
...props
|
|
11
|
+
}));
|
|
12
|
+
SidebarGroup.displayName = 'SidebarGroup';
|
|
13
|
+
const SidebarGroupLabel = /*#__PURE__*/ forwardRef(({ className, asChild = false, ...props }, ref)=>{
|
|
14
|
+
const Comp = asChild ? Slot : 'div';
|
|
15
|
+
return /*#__PURE__*/ jsx(Comp, {
|
|
16
|
+
ref: ref,
|
|
17
|
+
"data-slot": "sidebar-group-label",
|
|
18
|
+
"data-sidebar": "group-label",
|
|
19
|
+
className: cn('flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-foreground-muted ring-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0', 'group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0', className),
|
|
20
|
+
...props
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
SidebarGroupLabel.displayName = 'SidebarGroupLabel';
|
|
24
|
+
const SidebarGroupAction = /*#__PURE__*/ forwardRef(({ className, asChild = false, ...props }, ref)=>{
|
|
25
|
+
const Comp = asChild ? Slot : 'button';
|
|
26
|
+
return /*#__PURE__*/ jsx(Comp, {
|
|
27
|
+
ref: ref,
|
|
28
|
+
type: asChild ? void 0 : 'button',
|
|
29
|
+
"data-slot": "sidebar-group-action",
|
|
30
|
+
"data-sidebar": "group-action",
|
|
31
|
+
className: cn('absolute top-3.5 right-3 flex aspect-square w-5 cursor-pointer items-center justify-center rounded-md p-0 text-foreground-muted ring-ring outline-hidden transition-transform hover:bg-background-hover hover:text-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0', 'after:absolute after:-inset-2 md:after:hidden', 'group-data-[collapsible=icon]:hidden', className),
|
|
32
|
+
...props
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
SidebarGroupAction.displayName = 'SidebarGroupAction';
|
|
36
|
+
const SidebarGroupContent = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx("div", {
|
|
37
|
+
ref: ref,
|
|
38
|
+
"data-slot": "sidebar-group-content",
|
|
39
|
+
"data-sidebar": "group-content",
|
|
40
|
+
className: cn('w-full text-sm', className),
|
|
41
|
+
...props
|
|
42
|
+
}));
|
|
43
|
+
SidebarGroupContent.displayName = 'SidebarGroupContent';
|
|
44
|
+
export { SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel };
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
SidebarInput: ()=>SidebarInput,
|
|
28
|
+
SidebarContent: ()=>SidebarContent,
|
|
29
|
+
SidebarSeparator: ()=>SidebarSeparator,
|
|
30
|
+
SidebarHeader: ()=>SidebarHeader,
|
|
31
|
+
SidebarFooter: ()=>SidebarFooter
|
|
32
|
+
});
|
|
33
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
34
|
+
const external_react_namespaceObject = require("react");
|
|
35
|
+
const external_input_cjs_namespaceObject = require("../input.cjs");
|
|
36
|
+
const external_separator_cjs_namespaceObject = require("../separator.cjs");
|
|
37
|
+
const index_cjs_namespaceObject = require("../../../lib/index.cjs");
|
|
38
|
+
const SidebarInput = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_cjs_namespaceObject.Input, {
|
|
39
|
+
ref: ref,
|
|
40
|
+
"data-slot": "sidebar-input",
|
|
41
|
+
"data-sidebar": "input",
|
|
42
|
+
className: (0, index_cjs_namespaceObject.cn)('h-8 w-full bg-background shadow-none', className),
|
|
43
|
+
...props
|
|
44
|
+
}));
|
|
45
|
+
SidebarInput.displayName = 'SidebarInput';
|
|
46
|
+
const SidebarHeader = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
47
|
+
ref: ref,
|
|
48
|
+
"data-slot": "sidebar-header",
|
|
49
|
+
"data-sidebar": "header",
|
|
50
|
+
className: (0, index_cjs_namespaceObject.cn)('flex flex-col gap-2 p-2', className),
|
|
51
|
+
...props
|
|
52
|
+
}));
|
|
53
|
+
SidebarHeader.displayName = 'SidebarHeader';
|
|
54
|
+
const SidebarFooter = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
55
|
+
ref: ref,
|
|
56
|
+
"data-slot": "sidebar-footer",
|
|
57
|
+
"data-sidebar": "footer",
|
|
58
|
+
className: (0, index_cjs_namespaceObject.cn)('flex flex-col gap-2 p-2', className),
|
|
59
|
+
...props
|
|
60
|
+
}));
|
|
61
|
+
SidebarFooter.displayName = 'SidebarFooter';
|
|
62
|
+
const SidebarSeparator = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_separator_cjs_namespaceObject.Separator, {
|
|
63
|
+
ref: ref,
|
|
64
|
+
"data-slot": "sidebar-separator",
|
|
65
|
+
"data-sidebar": "separator",
|
|
66
|
+
className: (0, index_cjs_namespaceObject.cn)('mx-2 w-auto bg-border-subtle', className),
|
|
67
|
+
...props
|
|
68
|
+
}));
|
|
69
|
+
SidebarSeparator.displayName = 'SidebarSeparator';
|
|
70
|
+
const SidebarContent = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
71
|
+
ref: ref,
|
|
72
|
+
"data-slot": "sidebar-content",
|
|
73
|
+
"data-sidebar": "content",
|
|
74
|
+
className: (0, index_cjs_namespaceObject.cn)('flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden', className),
|
|
75
|
+
...props
|
|
76
|
+
}));
|
|
77
|
+
SidebarContent.displayName = 'SidebarContent';
|
|
78
|
+
exports.SidebarContent = __webpack_exports__.SidebarContent;
|
|
79
|
+
exports.SidebarFooter = __webpack_exports__.SidebarFooter;
|
|
80
|
+
exports.SidebarHeader = __webpack_exports__.SidebarHeader;
|
|
81
|
+
exports.SidebarInput = __webpack_exports__.SidebarInput;
|
|
82
|
+
exports.SidebarSeparator = __webpack_exports__.SidebarSeparator;
|
|
83
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
84
|
+
"SidebarContent",
|
|
85
|
+
"SidebarFooter",
|
|
86
|
+
"SidebarHeader",
|
|
87
|
+
"SidebarInput",
|
|
88
|
+
"SidebarSeparator"
|
|
89
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
90
|
+
Object.defineProperty(exports, '__esModule', {
|
|
91
|
+
value: true
|
|
92
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare const SidebarInput: React.ForwardRefExoticComponent<Omit<import("../input").InputProps & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
3
|
+
declare const SidebarHeader: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
declare const SidebarFooter: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
declare const SidebarSeparator: React.ForwardRefExoticComponent<Omit<Omit<import("@radix-ui/react-separator").SeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
declare const SidebarContent: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
export { SidebarContent, SidebarFooter, SidebarHeader, SidebarInput, SidebarSeparator };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { Input } from "../input.js";
|
|
4
|
+
import { Separator } from "../separator.js";
|
|
5
|
+
import { cn } from "../../../lib/index.js";
|
|
6
|
+
const SidebarInput = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(Input, {
|
|
7
|
+
ref: ref,
|
|
8
|
+
"data-slot": "sidebar-input",
|
|
9
|
+
"data-sidebar": "input",
|
|
10
|
+
className: cn('h-8 w-full bg-background shadow-none', className),
|
|
11
|
+
...props
|
|
12
|
+
}));
|
|
13
|
+
SidebarInput.displayName = 'SidebarInput';
|
|
14
|
+
const SidebarHeader = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx("div", {
|
|
15
|
+
ref: ref,
|
|
16
|
+
"data-slot": "sidebar-header",
|
|
17
|
+
"data-sidebar": "header",
|
|
18
|
+
className: cn('flex flex-col gap-2 p-2', className),
|
|
19
|
+
...props
|
|
20
|
+
}));
|
|
21
|
+
SidebarHeader.displayName = 'SidebarHeader';
|
|
22
|
+
const SidebarFooter = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx("div", {
|
|
23
|
+
ref: ref,
|
|
24
|
+
"data-slot": "sidebar-footer",
|
|
25
|
+
"data-sidebar": "footer",
|
|
26
|
+
className: cn('flex flex-col gap-2 p-2', className),
|
|
27
|
+
...props
|
|
28
|
+
}));
|
|
29
|
+
SidebarFooter.displayName = 'SidebarFooter';
|
|
30
|
+
const SidebarSeparator = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(Separator, {
|
|
31
|
+
ref: ref,
|
|
32
|
+
"data-slot": "sidebar-separator",
|
|
33
|
+
"data-sidebar": "separator",
|
|
34
|
+
className: cn('mx-2 w-auto bg-border-subtle', className),
|
|
35
|
+
...props
|
|
36
|
+
}));
|
|
37
|
+
SidebarSeparator.displayName = 'SidebarSeparator';
|
|
38
|
+
const SidebarContent = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx("div", {
|
|
39
|
+
ref: ref,
|
|
40
|
+
"data-slot": "sidebar-content",
|
|
41
|
+
"data-sidebar": "content",
|
|
42
|
+
className: cn('flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden', className),
|
|
43
|
+
...props
|
|
44
|
+
}));
|
|
45
|
+
SidebarContent.displayName = 'SidebarContent';
|
|
46
|
+
export { SidebarContent, SidebarFooter, SidebarHeader, SidebarInput, SidebarSeparator };
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __webpack_require__ = {};
|
|
4
|
+
(()=>{
|
|
5
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
6
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: definition[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
})();
|
|
12
|
+
(()=>{
|
|
13
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
14
|
+
})();
|
|
15
|
+
(()=>{
|
|
16
|
+
__webpack_require__.r = (exports1)=>{
|
|
17
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
18
|
+
value: 'Module'
|
|
19
|
+
});
|
|
20
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
21
|
+
value: true
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
})();
|
|
25
|
+
var __webpack_exports__ = {};
|
|
26
|
+
__webpack_require__.r(__webpack_exports__);
|
|
27
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
28
|
+
SidebarMenuSub: ()=>SidebarMenuSub,
|
|
29
|
+
SidebarMenuSubButton: ()=>SidebarMenuSubButton,
|
|
30
|
+
SidebarMenuSubItem: ()=>SidebarMenuSubItem
|
|
31
|
+
});
|
|
32
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
33
|
+
const react_slot_namespaceObject = require("@radix-ui/react-slot");
|
|
34
|
+
const external_react_namespaceObject = require("react");
|
|
35
|
+
const index_cjs_namespaceObject = require("../../../lib/index.cjs");
|
|
36
|
+
const external_sidebar_context_cjs_namespaceObject = require("./sidebar-context.cjs");
|
|
37
|
+
const SidebarMenuSub = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("ul", {
|
|
38
|
+
ref: ref,
|
|
39
|
+
"data-slot": "sidebar-menu-sub",
|
|
40
|
+
"data-sidebar": "menu-sub",
|
|
41
|
+
className: (0, index_cjs_namespaceObject.cn)('mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-border-subtle px-2.5 py-0.5', 'group-data-[collapsible=icon]:hidden', className),
|
|
42
|
+
...props
|
|
43
|
+
}));
|
|
44
|
+
SidebarMenuSub.displayName = 'SidebarMenuSub';
|
|
45
|
+
const SidebarMenuSubItem = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("li", {
|
|
46
|
+
ref: ref,
|
|
47
|
+
"data-slot": "sidebar-menu-sub-item",
|
|
48
|
+
"data-sidebar": "menu-sub-item",
|
|
49
|
+
className: (0, index_cjs_namespaceObject.cn)('group/menu-sub-item relative', className),
|
|
50
|
+
...props
|
|
51
|
+
}));
|
|
52
|
+
SidebarMenuSubItem.displayName = 'SidebarMenuSubItem';
|
|
53
|
+
const SidebarMenuSubButton = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ asChild = false, size = 'md', isActive = false, className, onClick, onClickCapture, ...props }, ref)=>{
|
|
54
|
+
const Comp = asChild ? react_slot_namespaceObject.Slot : 'a';
|
|
55
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Comp, {
|
|
56
|
+
ref: ref,
|
|
57
|
+
"data-slot": "sidebar-menu-sub-button",
|
|
58
|
+
"data-sidebar": "menu-sub-button",
|
|
59
|
+
"data-size": size,
|
|
60
|
+
"data-active": isActive,
|
|
61
|
+
"aria-current": isActive ? 'true' : void 0,
|
|
62
|
+
className: (0, index_cjs_namespaceObject.cn)('flex h-7 min-w-0 -translate-x-px cursor-pointer items-center gap-2 overflow-hidden rounded-md px-2 text-foreground ring-ring outline-hidden hover:bg-background-hover focus-visible:ring-2 active:bg-background-hover disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-foreground-muted', 'data-[active=true]:bg-surface-selected data-[active=true]:hover:bg-surface-selected data-[active=true]:text-foreground', 'sm' === size && 'text-xs', 'md' === size && 'text-sm', 'group-data-[collapsible=icon]:hidden', className),
|
|
63
|
+
...props,
|
|
64
|
+
onClick: onClick,
|
|
65
|
+
onClickCapture: (0, external_sidebar_context_cjs_namespaceObject.guardDisabledClick)(props['aria-disabled'], onClickCapture)
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
SidebarMenuSubButton.displayName = 'SidebarMenuSubButton';
|
|
69
|
+
exports.SidebarMenuSub = __webpack_exports__.SidebarMenuSub;
|
|
70
|
+
exports.SidebarMenuSubButton = __webpack_exports__.SidebarMenuSubButton;
|
|
71
|
+
exports.SidebarMenuSubItem = __webpack_exports__.SidebarMenuSubItem;
|
|
72
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
73
|
+
"SidebarMenuSub",
|
|
74
|
+
"SidebarMenuSubButton",
|
|
75
|
+
"SidebarMenuSubItem"
|
|
76
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
77
|
+
Object.defineProperty(exports, '__esModule', {
|
|
78
|
+
value: true
|
|
79
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare const SidebarMenuSub: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "ref"> & React.RefAttributes<HTMLUListElement>>;
|
|
3
|
+
declare const SidebarMenuSubItem: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & React.RefAttributes<HTMLLIElement>>;
|
|
4
|
+
export interface SidebarMenuSubButtonProps extends React.ComponentProps<'a'> {
|
|
5
|
+
asChild?: boolean;
|
|
6
|
+
size?: 'sm' | 'md';
|
|
7
|
+
/** Marks the item as the current selection. Sets `data-active` and `aria-current="true"` (pass `aria-current="page"` for route links). */
|
|
8
|
+
isActive?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare const SidebarMenuSubButton: React.ForwardRefExoticComponent<Omit<SidebarMenuSubButtonProps, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
|
|
11
|
+
export { SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
4
|
+
import { forwardRef } from "react";
|
|
5
|
+
import { cn } from "../../../lib/index.js";
|
|
6
|
+
import { guardDisabledClick } from "./sidebar-context.js";
|
|
7
|
+
const SidebarMenuSub = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx("ul", {
|
|
8
|
+
ref: ref,
|
|
9
|
+
"data-slot": "sidebar-menu-sub",
|
|
10
|
+
"data-sidebar": "menu-sub",
|
|
11
|
+
className: cn('mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-border-subtle px-2.5 py-0.5', 'group-data-[collapsible=icon]:hidden', className),
|
|
12
|
+
...props
|
|
13
|
+
}));
|
|
14
|
+
SidebarMenuSub.displayName = 'SidebarMenuSub';
|
|
15
|
+
const SidebarMenuSubItem = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx("li", {
|
|
16
|
+
ref: ref,
|
|
17
|
+
"data-slot": "sidebar-menu-sub-item",
|
|
18
|
+
"data-sidebar": "menu-sub-item",
|
|
19
|
+
className: cn('group/menu-sub-item relative', className),
|
|
20
|
+
...props
|
|
21
|
+
}));
|
|
22
|
+
SidebarMenuSubItem.displayName = 'SidebarMenuSubItem';
|
|
23
|
+
const SidebarMenuSubButton = /*#__PURE__*/ forwardRef(({ asChild = false, size = 'md', isActive = false, className, onClick, onClickCapture, ...props }, ref)=>{
|
|
24
|
+
const Comp = asChild ? Slot : 'a';
|
|
25
|
+
return /*#__PURE__*/ jsx(Comp, {
|
|
26
|
+
ref: ref,
|
|
27
|
+
"data-slot": "sidebar-menu-sub-button",
|
|
28
|
+
"data-sidebar": "menu-sub-button",
|
|
29
|
+
"data-size": size,
|
|
30
|
+
"data-active": isActive,
|
|
31
|
+
"aria-current": isActive ? 'true' : void 0,
|
|
32
|
+
className: cn('flex h-7 min-w-0 -translate-x-px cursor-pointer items-center gap-2 overflow-hidden rounded-md px-2 text-foreground ring-ring outline-hidden hover:bg-background-hover focus-visible:ring-2 active:bg-background-hover disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-foreground-muted', 'data-[active=true]:bg-surface-selected data-[active=true]:hover:bg-surface-selected data-[active=true]:text-foreground', 'sm' === size && 'text-xs', 'md' === size && 'text-sm', 'group-data-[collapsible=icon]:hidden', className),
|
|
33
|
+
...props,
|
|
34
|
+
onClick: onClick,
|
|
35
|
+
onClickCapture: guardDisabledClick(props['aria-disabled'], onClickCapture)
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
SidebarMenuSubButton.displayName = 'SidebarMenuSubButton';
|
|
39
|
+
export { SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem };
|