@ikatec/nebula-react 1.9.0-beta.3 → 1.9.0-beta.5
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/ikatec-nebula-react-1.9.0-beta.5.tgz +0 -0
- package/dist/index.d.mts +52 -2
- package/dist/index.d.ts +52 -2
- package/dist/index.js +281 -3
- package/dist/index.mjs +270 -5
- package/package.json +1 -1
- package/dist/ikatec-nebula-react-1.9.0-beta.3.tgz +0 -0
|
Binary file
|
package/dist/index.d.mts
CHANGED
|
@@ -482,10 +482,11 @@ declare const DropdownMenuShortcut: {
|
|
|
482
482
|
|
|
483
483
|
type FileMetadata = {
|
|
484
484
|
name: string;
|
|
485
|
-
size
|
|
485
|
+
size?: number;
|
|
486
486
|
type: string;
|
|
487
487
|
url: string;
|
|
488
488
|
id: string;
|
|
489
|
+
description?: string;
|
|
489
490
|
};
|
|
490
491
|
type FileWithPreview = {
|
|
491
492
|
file: File | FileMetadata;
|
|
@@ -1088,6 +1089,53 @@ interface LinkProps extends React__default.AnchorHTMLAttributes<HTMLAnchorElemen
|
|
|
1088
1089
|
}
|
|
1089
1090
|
declare const Link: React__default.ForwardRefExoticComponent<LinkProps & React__default.RefAttributes<HTMLAnchorElement>>;
|
|
1090
1091
|
|
|
1092
|
+
declare enum SidebarStateEnum {
|
|
1093
|
+
expanded = "expanded",
|
|
1094
|
+
rail = "rail",
|
|
1095
|
+
collapsed = "collapsed"
|
|
1096
|
+
}
|
|
1097
|
+
type SidebarState = keyof typeof SidebarStateEnum;
|
|
1098
|
+
type SidebarContextType = {
|
|
1099
|
+
state: SidebarState;
|
|
1100
|
+
setState: (s: SidebarState) => void;
|
|
1101
|
+
isMobile: boolean;
|
|
1102
|
+
};
|
|
1103
|
+
declare function useSidebar(): SidebarContextType;
|
|
1104
|
+
interface SidebarProps {
|
|
1105
|
+
children: React$1.ReactNode;
|
|
1106
|
+
defaultState?: SidebarState;
|
|
1107
|
+
open?: boolean;
|
|
1108
|
+
onOpenChange?: (open: boolean) => void;
|
|
1109
|
+
}
|
|
1110
|
+
declare function Sidebar({ children, defaultState, open, onOpenChange, }: SidebarProps): react_jsx_runtime.JSX.Element;
|
|
1111
|
+
declare function SidebarHeader({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
1112
|
+
declare function SidebarContent({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
1113
|
+
declare function SidebarTitle({ className, children, ...props }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element | null;
|
|
1114
|
+
declare function SidebarFooter({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
1115
|
+
declare const SidebarTrigger: React$1.ForwardRefExoticComponent<Omit<ButtonProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & {
|
|
1116
|
+
asChild?: boolean;
|
|
1117
|
+
} & React$1.RefAttributes<HTMLButtonElement>>;
|
|
1118
|
+
declare function SidebarGroup({ children, className, }: {
|
|
1119
|
+
children: React$1.ReactNode;
|
|
1120
|
+
className?: string;
|
|
1121
|
+
}): react_jsx_runtime.JSX.Element;
|
|
1122
|
+
declare function SidebarGroupLabel({ children }: {
|
|
1123
|
+
children: React$1.ReactNode;
|
|
1124
|
+
}): react_jsx_runtime.JSX.Element | null;
|
|
1125
|
+
declare function SidebarSeparator(): react_jsx_runtime.JSX.Element;
|
|
1126
|
+
type SidebarMenuItemProps = {
|
|
1127
|
+
icon?: React$1.ReactNode;
|
|
1128
|
+
action?: React$1.ReactNode;
|
|
1129
|
+
label: string;
|
|
1130
|
+
active?: boolean;
|
|
1131
|
+
disabled?: boolean;
|
|
1132
|
+
counter?: number;
|
|
1133
|
+
collapsible?: boolean;
|
|
1134
|
+
defaultOpen?: boolean;
|
|
1135
|
+
children?: React$1.ReactNode;
|
|
1136
|
+
};
|
|
1137
|
+
declare function SidebarMenuItem({ icon, action, label, active, disabled, counter, collapsible, defaultOpen, children, }: SidebarMenuItemProps): react_jsx_runtime.JSX.Element;
|
|
1138
|
+
|
|
1091
1139
|
/**
|
|
1092
1140
|
* Context type to use the NebulaI18nProvider.
|
|
1093
1141
|
*/
|
|
@@ -1158,4 +1206,6 @@ declare function useClickOutside<T extends HTMLElement>(refs: PossibleRefs<T>, o
|
|
|
1158
1206
|
|
|
1159
1207
|
declare function useKeyPress(key: string, callback: VoidFunction): void;
|
|
1160
1208
|
|
|
1161
|
-
|
|
1209
|
+
declare const useIsMobile: (breakpoint?: number) => boolean;
|
|
1210
|
+
|
|
1211
|
+
export { Accordion, AccordionContent, AccordionDescription, AccordionItem, type AccordionProps, AccordionTitle, AccordionTrigger, ActionBar, ActionBarButton, ActionBarClose, ActionBarContent, ActionBarDivider, ActionBarPortal, ActionBarTrigger, Alert, AlertButton, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, type AlertProps, AlertTitle, StyledAsync as Async, StyledAsyncCreatable as AsyncCreatable, Avatar, AvatarFallback, AvatarHoverAction, AvatarImage, AvatarSizeEnum, AvatarStick, AvatarVariantEnum, Badge, type BadgeProps, BannerAlert, type BannerAlertProps, BannerType, BannerVariant, Box, type BoxProps, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, type ButtonProps, Calendar, type CalendarProps, Caption, type CaptionProps, Checkbox, type CheckboxProps, StyledCreatable as Creatable, Cropper, CropperCropArea, CropperDescription, CropperImage, type CropperProps, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, Drawer, DrawerBody, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, type FileMetadata, FileUpload, type FileUploadActions, FileUploadError, type FileUploadOptions, type FileUploadProps, type FileUploadState, type FileWithPreview, Heading, type HeadingProps, InputDatePickerSingle, type InputDatePickerSingleProps, InputDateRangePicker, type InputDateRangePickerProps, InputDateTimePickerSingle, type InputDateTimePickerSingleProps, InputPhone, InputText, type InputTextProps, InputTime, type InputTimeProps, KanbanBoard, type KanbanBoardCard, type KanbanBoardColumn, type KanbanBoardProps, KanbanCard, type KanbanCardDropEvent, KanbanColumn, KanbanColumnDragHandle, type KanbanColumnDropEvent, KanbanColumnFooter, KanbanColumnHeader, KanbanColumnTitle, type KanbanOrderingMode, type KanbanRenderCardContext, type KanbanRenderColumnBodyContext, type KanbanRenderColumnContext, Label, Link, type LinkProps, NebulaI18nProvider, type NebulaI18nProviderProps, Pagination, type PaginationProps, Paragraph, type ParagraphProps, Popover, PopoverContent, type PopoverContentProps, PopoverTrigger, ProfileImage, type ProfileImageProps, RadioGroup, RadioGroupItem, StyledSelect as Select, type CreateStyledSelectProps as SelectProps, Separator, type SeparatorProps, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupLabel, SidebarHeader, SidebarMenuItem, type SidebarProps, SidebarSeparator, SidebarStateEnum, SidebarTitle, SidebarTrigger, Skeleton, type SkeletonProps, Slider, Space, SpaceDirectionEnum, type SpaceProps, SpaceSizeEnum, Stepper, StepperDescription, StepperIndicator, StepperItem, StepperSeparator, StepperTitle, StepperTrigger, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tag, type TagProps, TextArea, type TextAreaProps, TipCard, TipCardContent, TipCardFooter, TipCardHeader, TipCardItem, TipCardMedia, TipCardMediaType, TipCardProvider, Toaster, Toggle, ToggleGroup, ToggleGroupItem, ToggleGroupTypeEnum, ToggleSizeEnum, Tooltip, type TooltipProps, alertVariants, badgeSizeEnum, badgeVariantEnum, buttonSizeEnum, buttonVariantEnum, buttonVariantsConfig, dateIsAvailable, formatBytes, getNebulaLanguage, localeByi18nKey, messages, separatorVariants, setNebulaLanguage, tagVariantsEnum, tailwind, toast, toggleVariants, useClickOutside, useFileUpload, useIsMobile, useKeyPress, useNebulaI18n, useSidebar, useTipCard };
|
package/dist/index.d.ts
CHANGED
|
@@ -482,10 +482,11 @@ declare const DropdownMenuShortcut: {
|
|
|
482
482
|
|
|
483
483
|
type FileMetadata = {
|
|
484
484
|
name: string;
|
|
485
|
-
size
|
|
485
|
+
size?: number;
|
|
486
486
|
type: string;
|
|
487
487
|
url: string;
|
|
488
488
|
id: string;
|
|
489
|
+
description?: string;
|
|
489
490
|
};
|
|
490
491
|
type FileWithPreview = {
|
|
491
492
|
file: File | FileMetadata;
|
|
@@ -1088,6 +1089,53 @@ interface LinkProps extends React__default.AnchorHTMLAttributes<HTMLAnchorElemen
|
|
|
1088
1089
|
}
|
|
1089
1090
|
declare const Link: React__default.ForwardRefExoticComponent<LinkProps & React__default.RefAttributes<HTMLAnchorElement>>;
|
|
1090
1091
|
|
|
1092
|
+
declare enum SidebarStateEnum {
|
|
1093
|
+
expanded = "expanded",
|
|
1094
|
+
rail = "rail",
|
|
1095
|
+
collapsed = "collapsed"
|
|
1096
|
+
}
|
|
1097
|
+
type SidebarState = keyof typeof SidebarStateEnum;
|
|
1098
|
+
type SidebarContextType = {
|
|
1099
|
+
state: SidebarState;
|
|
1100
|
+
setState: (s: SidebarState) => void;
|
|
1101
|
+
isMobile: boolean;
|
|
1102
|
+
};
|
|
1103
|
+
declare function useSidebar(): SidebarContextType;
|
|
1104
|
+
interface SidebarProps {
|
|
1105
|
+
children: React$1.ReactNode;
|
|
1106
|
+
defaultState?: SidebarState;
|
|
1107
|
+
open?: boolean;
|
|
1108
|
+
onOpenChange?: (open: boolean) => void;
|
|
1109
|
+
}
|
|
1110
|
+
declare function Sidebar({ children, defaultState, open, onOpenChange, }: SidebarProps): react_jsx_runtime.JSX.Element;
|
|
1111
|
+
declare function SidebarHeader({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
1112
|
+
declare function SidebarContent({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
1113
|
+
declare function SidebarTitle({ className, children, ...props }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element | null;
|
|
1114
|
+
declare function SidebarFooter({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
1115
|
+
declare const SidebarTrigger: React$1.ForwardRefExoticComponent<Omit<ButtonProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & {
|
|
1116
|
+
asChild?: boolean;
|
|
1117
|
+
} & React$1.RefAttributes<HTMLButtonElement>>;
|
|
1118
|
+
declare function SidebarGroup({ children, className, }: {
|
|
1119
|
+
children: React$1.ReactNode;
|
|
1120
|
+
className?: string;
|
|
1121
|
+
}): react_jsx_runtime.JSX.Element;
|
|
1122
|
+
declare function SidebarGroupLabel({ children }: {
|
|
1123
|
+
children: React$1.ReactNode;
|
|
1124
|
+
}): react_jsx_runtime.JSX.Element | null;
|
|
1125
|
+
declare function SidebarSeparator(): react_jsx_runtime.JSX.Element;
|
|
1126
|
+
type SidebarMenuItemProps = {
|
|
1127
|
+
icon?: React$1.ReactNode;
|
|
1128
|
+
action?: React$1.ReactNode;
|
|
1129
|
+
label: string;
|
|
1130
|
+
active?: boolean;
|
|
1131
|
+
disabled?: boolean;
|
|
1132
|
+
counter?: number;
|
|
1133
|
+
collapsible?: boolean;
|
|
1134
|
+
defaultOpen?: boolean;
|
|
1135
|
+
children?: React$1.ReactNode;
|
|
1136
|
+
};
|
|
1137
|
+
declare function SidebarMenuItem({ icon, action, label, active, disabled, counter, collapsible, defaultOpen, children, }: SidebarMenuItemProps): react_jsx_runtime.JSX.Element;
|
|
1138
|
+
|
|
1091
1139
|
/**
|
|
1092
1140
|
* Context type to use the NebulaI18nProvider.
|
|
1093
1141
|
*/
|
|
@@ -1158,4 +1206,6 @@ declare function useClickOutside<T extends HTMLElement>(refs: PossibleRefs<T>, o
|
|
|
1158
1206
|
|
|
1159
1207
|
declare function useKeyPress(key: string, callback: VoidFunction): void;
|
|
1160
1208
|
|
|
1161
|
-
|
|
1209
|
+
declare const useIsMobile: (breakpoint?: number) => boolean;
|
|
1210
|
+
|
|
1211
|
+
export { Accordion, AccordionContent, AccordionDescription, AccordionItem, type AccordionProps, AccordionTitle, AccordionTrigger, ActionBar, ActionBarButton, ActionBarClose, ActionBarContent, ActionBarDivider, ActionBarPortal, ActionBarTrigger, Alert, AlertButton, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, type AlertProps, AlertTitle, StyledAsync as Async, StyledAsyncCreatable as AsyncCreatable, Avatar, AvatarFallback, AvatarHoverAction, AvatarImage, AvatarSizeEnum, AvatarStick, AvatarVariantEnum, Badge, type BadgeProps, BannerAlert, type BannerAlertProps, BannerType, BannerVariant, Box, type BoxProps, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, type ButtonProps, Calendar, type CalendarProps, Caption, type CaptionProps, Checkbox, type CheckboxProps, StyledCreatable as Creatable, Cropper, CropperCropArea, CropperDescription, CropperImage, type CropperProps, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, Drawer, DrawerBody, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, type FileMetadata, FileUpload, type FileUploadActions, FileUploadError, type FileUploadOptions, type FileUploadProps, type FileUploadState, type FileWithPreview, Heading, type HeadingProps, InputDatePickerSingle, type InputDatePickerSingleProps, InputDateRangePicker, type InputDateRangePickerProps, InputDateTimePickerSingle, type InputDateTimePickerSingleProps, InputPhone, InputText, type InputTextProps, InputTime, type InputTimeProps, KanbanBoard, type KanbanBoardCard, type KanbanBoardColumn, type KanbanBoardProps, KanbanCard, type KanbanCardDropEvent, KanbanColumn, KanbanColumnDragHandle, type KanbanColumnDropEvent, KanbanColumnFooter, KanbanColumnHeader, KanbanColumnTitle, type KanbanOrderingMode, type KanbanRenderCardContext, type KanbanRenderColumnBodyContext, type KanbanRenderColumnContext, Label, Link, type LinkProps, NebulaI18nProvider, type NebulaI18nProviderProps, Pagination, type PaginationProps, Paragraph, type ParagraphProps, Popover, PopoverContent, type PopoverContentProps, PopoverTrigger, ProfileImage, type ProfileImageProps, RadioGroup, RadioGroupItem, StyledSelect as Select, type CreateStyledSelectProps as SelectProps, Separator, type SeparatorProps, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupLabel, SidebarHeader, SidebarMenuItem, type SidebarProps, SidebarSeparator, SidebarStateEnum, SidebarTitle, SidebarTrigger, Skeleton, type SkeletonProps, Slider, Space, SpaceDirectionEnum, type SpaceProps, SpaceSizeEnum, Stepper, StepperDescription, StepperIndicator, StepperItem, StepperSeparator, StepperTitle, StepperTrigger, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tag, type TagProps, TextArea, type TextAreaProps, TipCard, TipCardContent, TipCardFooter, TipCardHeader, TipCardItem, TipCardMedia, TipCardMediaType, TipCardProvider, Toaster, Toggle, ToggleGroup, ToggleGroupItem, ToggleGroupTypeEnum, ToggleSizeEnum, Tooltip, type TooltipProps, alertVariants, badgeSizeEnum, badgeVariantEnum, buttonSizeEnum, buttonVariantEnum, buttonVariantsConfig, dateIsAvailable, formatBytes, getNebulaLanguage, localeByi18nKey, messages, separatorVariants, setNebulaLanguage, tagVariantsEnum, tailwind, toast, toggleVariants, useClickOutside, useFileUpload, useIsMobile, useKeyPress, useNebulaI18n, useSidebar, useTipCard };
|
package/dist/index.js
CHANGED
|
@@ -4387,7 +4387,7 @@ var useFileUpload = (options = {}) => {
|
|
|
4387
4387
|
};
|
|
4388
4388
|
}
|
|
4389
4389
|
} else {
|
|
4390
|
-
if (file.size > maxSize) {
|
|
4390
|
+
if (file.size != null && file.size > maxSize) {
|
|
4391
4391
|
return { error: "MAXIMUM_FILE_SIZE_EXCEEDED" /* MAXIMUM_FILE_SIZE_EXCEEDED */, file };
|
|
4392
4392
|
}
|
|
4393
4393
|
}
|
|
@@ -4469,7 +4469,7 @@ var useFileUpload = (options = {}) => {
|
|
|
4469
4469
|
return;
|
|
4470
4470
|
}
|
|
4471
4471
|
}
|
|
4472
|
-
if (file.size > maxSize) {
|
|
4472
|
+
if (file.size != null && file.size > maxSize) {
|
|
4473
4473
|
onError?.([
|
|
4474
4474
|
{ file, error: "MAXIMUM_FILE_SIZE_EXCEEDED" /* MAXIMUM_FILE_SIZE_EXCEEDED */ }
|
|
4475
4475
|
]);
|
|
@@ -4770,7 +4770,7 @@ function FileUpload({
|
|
|
4770
4770
|
) }),
|
|
4771
4771
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nebula-ds flex min-w-0 flex-col gap-1", children: [
|
|
4772
4772
|
/* @__PURE__ */ jsxRuntime.jsx(Heading, { level: "5", className: "nebula-ds text-xs", children: file.file.name }),
|
|
4773
|
-
/* @__PURE__ */ jsxRuntime.jsx(Paragraph, { size: "sm", children: formatBytes(file.file.size) })
|
|
4773
|
+
"description" in file.file && file.file.description ? /* @__PURE__ */ jsxRuntime.jsx(Paragraph, { size: "sm", children: file.file.description }) : file.file.size != null && file.file.size > 0 && /* @__PURE__ */ jsxRuntime.jsx(Paragraph, { size: "sm", children: formatBytes(file.file.size) })
|
|
4774
4774
|
] })
|
|
4775
4775
|
] }),
|
|
4776
4776
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -8835,6 +8835,271 @@ var Tooltip = React25__namespace.forwardRef(
|
|
|
8835
8835
|
}
|
|
8836
8836
|
);
|
|
8837
8837
|
Tooltip.displayName = "Tooltip";
|
|
8838
|
+
var useIsMobile = (breakpoint = 768) => {
|
|
8839
|
+
const [isMobile, setIsMobile] = React25.useState(false);
|
|
8840
|
+
React25.useEffect(() => {
|
|
8841
|
+
const mediaQuery = window.matchMedia(`(max-width: ${breakpoint}px)`);
|
|
8842
|
+
const handleMediaQueryChange = (event) => setIsMobile(event.matches);
|
|
8843
|
+
setIsMobile(mediaQuery.matches);
|
|
8844
|
+
mediaQuery.addEventListener("change", handleMediaQueryChange);
|
|
8845
|
+
return () => {
|
|
8846
|
+
mediaQuery.removeEventListener("change", handleMediaQueryChange);
|
|
8847
|
+
};
|
|
8848
|
+
}, [breakpoint]);
|
|
8849
|
+
return isMobile;
|
|
8850
|
+
};
|
|
8851
|
+
var SidebarStateEnum = /* @__PURE__ */ ((SidebarStateEnum2) => {
|
|
8852
|
+
SidebarStateEnum2["expanded"] = "expanded";
|
|
8853
|
+
SidebarStateEnum2["rail"] = "rail";
|
|
8854
|
+
SidebarStateEnum2["collapsed"] = "collapsed";
|
|
8855
|
+
return SidebarStateEnum2;
|
|
8856
|
+
})(SidebarStateEnum || {});
|
|
8857
|
+
var SidebarContext = React25__namespace.createContext(null);
|
|
8858
|
+
function useSidebar() {
|
|
8859
|
+
const ctx = React25__namespace.useContext(SidebarContext);
|
|
8860
|
+
if (!ctx) throw new Error("Sidebar must be used inside Sidebar");
|
|
8861
|
+
return ctx;
|
|
8862
|
+
}
|
|
8863
|
+
function Sidebar({
|
|
8864
|
+
children,
|
|
8865
|
+
defaultState = "expanded",
|
|
8866
|
+
open,
|
|
8867
|
+
onOpenChange
|
|
8868
|
+
}) {
|
|
8869
|
+
const isMobile = useIsMobile();
|
|
8870
|
+
const isControlled = open !== void 0;
|
|
8871
|
+
const [internalState, setInternalState] = React25__namespace.useState(defaultState);
|
|
8872
|
+
const state = isControlled ? open ? "expanded" : "collapsed" : internalState;
|
|
8873
|
+
const setState = React25__namespace.useCallback(
|
|
8874
|
+
(next) => {
|
|
8875
|
+
if (!isControlled) {
|
|
8876
|
+
setInternalState(next);
|
|
8877
|
+
}
|
|
8878
|
+
if (onOpenChange) {
|
|
8879
|
+
onOpenChange(next !== "collapsed");
|
|
8880
|
+
}
|
|
8881
|
+
},
|
|
8882
|
+
[isControlled, onOpenChange]
|
|
8883
|
+
);
|
|
8884
|
+
const contextValue = React25__namespace.useMemo(
|
|
8885
|
+
() => ({ state, setState, isMobile }),
|
|
8886
|
+
[state, isMobile, setState]
|
|
8887
|
+
);
|
|
8888
|
+
if (isMobile) {
|
|
8889
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8890
|
+
Drawer,
|
|
8891
|
+
{
|
|
8892
|
+
open: state !== "collapsed",
|
|
8893
|
+
onOpenChange: (o) => setState(o ? "expanded" : "collapsed"),
|
|
8894
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(DrawerContent, { className: "nebula-ds w-[var(--sidebar-width)] p-0 shadow-xl", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nebula-ds flex h-full flex-col bg-sidebar-background", children }) })
|
|
8895
|
+
}
|
|
8896
|
+
) });
|
|
8897
|
+
}
|
|
8898
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8899
|
+
"aside",
|
|
8900
|
+
{
|
|
8901
|
+
"data-state": state,
|
|
8902
|
+
className: cn(
|
|
8903
|
+
"relative hidden md:flex flex-col border-r border-sidebar-border bg-sidebar-background transition-all duration-300 ease-in-out",
|
|
8904
|
+
state === "expanded" && "w-[var(--sidebar-width)]",
|
|
8905
|
+
state === "rail" && "w-[var(--sidebar-rail-width)]",
|
|
8906
|
+
state === "collapsed" && "w-0 overflow-hidden"
|
|
8907
|
+
),
|
|
8908
|
+
children
|
|
8909
|
+
}
|
|
8910
|
+
) });
|
|
8911
|
+
}
|
|
8912
|
+
function SidebarHeader({
|
|
8913
|
+
className,
|
|
8914
|
+
...props
|
|
8915
|
+
}) {
|
|
8916
|
+
const { state } = useSidebar();
|
|
8917
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8918
|
+
"div",
|
|
8919
|
+
{
|
|
8920
|
+
"data-state": state,
|
|
8921
|
+
className: cn(
|
|
8922
|
+
"sticky top-0 z-20 flex h-14 items-center border-b border-sidebar-border bg-sidebar-background transition-all duration-300",
|
|
8923
|
+
state === "expanded" && "justify-between px-4",
|
|
8924
|
+
state === "rail" && "justify-center px-2",
|
|
8925
|
+
className
|
|
8926
|
+
),
|
|
8927
|
+
...props
|
|
8928
|
+
}
|
|
8929
|
+
);
|
|
8930
|
+
}
|
|
8931
|
+
function SidebarContent({
|
|
8932
|
+
className,
|
|
8933
|
+
...props
|
|
8934
|
+
}) {
|
|
8935
|
+
const { state } = useSidebar();
|
|
8936
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8937
|
+
"div",
|
|
8938
|
+
{
|
|
8939
|
+
className: cn(
|
|
8940
|
+
"flex-1 overflow-y-auto py-3 space-y-4",
|
|
8941
|
+
state === "rail" && "flex flex-col items-center",
|
|
8942
|
+
className
|
|
8943
|
+
),
|
|
8944
|
+
...props
|
|
8945
|
+
}
|
|
8946
|
+
);
|
|
8947
|
+
}
|
|
8948
|
+
function SidebarTitle({
|
|
8949
|
+
className,
|
|
8950
|
+
children,
|
|
8951
|
+
...props
|
|
8952
|
+
}) {
|
|
8953
|
+
const { state } = useSidebar();
|
|
8954
|
+
if (state === "rail") return null;
|
|
8955
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8956
|
+
"div",
|
|
8957
|
+
{
|
|
8958
|
+
"data-state": state,
|
|
8959
|
+
className: cn(
|
|
8960
|
+
"font-semibold text-sidebar-text whitespace-nowrap transition-all duration-300",
|
|
8961
|
+
className
|
|
8962
|
+
),
|
|
8963
|
+
...props,
|
|
8964
|
+
children
|
|
8965
|
+
}
|
|
8966
|
+
);
|
|
8967
|
+
}
|
|
8968
|
+
function SidebarFooter({
|
|
8969
|
+
className,
|
|
8970
|
+
...props
|
|
8971
|
+
}) {
|
|
8972
|
+
const { state } = useSidebar();
|
|
8973
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8974
|
+
"div",
|
|
8975
|
+
{
|
|
8976
|
+
className: cn(
|
|
8977
|
+
"sticky bottom-0 bg-sidebar-background p-3",
|
|
8978
|
+
state === "rail" && "flex justify-center p-2",
|
|
8979
|
+
className
|
|
8980
|
+
),
|
|
8981
|
+
...props
|
|
8982
|
+
}
|
|
8983
|
+
);
|
|
8984
|
+
}
|
|
8985
|
+
var SidebarTrigger = React25__namespace.forwardRef(({ asChild = false, className, onClick, children, ...props }, ref) => {
|
|
8986
|
+
const { state, setState, isMobile } = useSidebar();
|
|
8987
|
+
const Comp = asChild ? reactSlot.Slot : Button;
|
|
8988
|
+
function handleToggle(e) {
|
|
8989
|
+
if (isMobile) {
|
|
8990
|
+
setState(state === "collapsed" ? "expanded" : "collapsed");
|
|
8991
|
+
} else {
|
|
8992
|
+
setState(state === "expanded" ? "rail" : "expanded");
|
|
8993
|
+
}
|
|
8994
|
+
onClick?.(e);
|
|
8995
|
+
}
|
|
8996
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8997
|
+
Comp,
|
|
8998
|
+
{
|
|
8999
|
+
ref,
|
|
9000
|
+
onClick: handleToggle,
|
|
9001
|
+
"aria-label": "Toggle sidebar",
|
|
9002
|
+
className: cn(
|
|
9003
|
+
!asChild && "size-9",
|
|
9004
|
+
state === "rail" && "mx-auto",
|
|
9005
|
+
className
|
|
9006
|
+
),
|
|
9007
|
+
...!asChild && { variant: "ghost", icon: true },
|
|
9008
|
+
...props,
|
|
9009
|
+
children: children ?? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PanelLeft, { className: "nebula-ds size-5" })
|
|
9010
|
+
}
|
|
9011
|
+
);
|
|
9012
|
+
});
|
|
9013
|
+
SidebarTrigger.displayName = "SidebarTrigger";
|
|
9014
|
+
function SidebarGroup({
|
|
9015
|
+
children,
|
|
9016
|
+
className
|
|
9017
|
+
}) {
|
|
9018
|
+
const { state } = useSidebar();
|
|
9019
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9020
|
+
"div",
|
|
9021
|
+
{
|
|
9022
|
+
className: cn(
|
|
9023
|
+
"flex flex-col space-y-1 px-2",
|
|
9024
|
+
state === "rail" && "items-center",
|
|
9025
|
+
className
|
|
9026
|
+
),
|
|
9027
|
+
children
|
|
9028
|
+
}
|
|
9029
|
+
);
|
|
9030
|
+
}
|
|
9031
|
+
function SidebarGroupLabel({ children }) {
|
|
9032
|
+
const { state } = useSidebar();
|
|
9033
|
+
if (state === "rail") return null;
|
|
9034
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nebula-ds px-3 py-1 text-xs font-medium tracking-wide text-sidebar-label", children });
|
|
9035
|
+
}
|
|
9036
|
+
function SidebarSeparator() {
|
|
9037
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Separator, { orientation: "horizontal" });
|
|
9038
|
+
}
|
|
9039
|
+
var SidebarLevelContext = React25__namespace.createContext(0);
|
|
9040
|
+
function SidebarMenuItem({
|
|
9041
|
+
icon,
|
|
9042
|
+
action,
|
|
9043
|
+
label,
|
|
9044
|
+
active,
|
|
9045
|
+
disabled,
|
|
9046
|
+
counter,
|
|
9047
|
+
collapsible,
|
|
9048
|
+
defaultOpen = false,
|
|
9049
|
+
children
|
|
9050
|
+
}) {
|
|
9051
|
+
const { state } = useSidebar();
|
|
9052
|
+
const [open, setOpen] = React25__namespace.useState(defaultOpen);
|
|
9053
|
+
const level = React25__namespace.useContext(SidebarLevelContext);
|
|
9054
|
+
const isRail = state === "rail";
|
|
9055
|
+
const paddingLeft = level > 0 ? "pl-11" : "";
|
|
9056
|
+
const content2 = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
9057
|
+
Button,
|
|
9058
|
+
{
|
|
9059
|
+
variant: "ghost",
|
|
9060
|
+
disabled,
|
|
9061
|
+
"aria-expanded": collapsible ? open : void 0,
|
|
9062
|
+
onClick: () => collapsible && setOpen((p) => !p),
|
|
9063
|
+
className: cn(
|
|
9064
|
+
"group font-medium relative flex items-center rounded-lg py-2 text-sm transition-colors",
|
|
9065
|
+
active && "font-semibold",
|
|
9066
|
+
isRail ? "justify-center w-10 h-10 mx-auto px-0 rounded-full" : cn("w-full pr-3", paddingLeft)
|
|
9067
|
+
),
|
|
9068
|
+
children: [
|
|
9069
|
+
icon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
9070
|
+
"span",
|
|
9071
|
+
{
|
|
9072
|
+
className: cn(
|
|
9073
|
+
"flex items-center justify-center size-4 shrink-0",
|
|
9074
|
+
!isRail && "mr-3"
|
|
9075
|
+
),
|
|
9076
|
+
children: icon
|
|
9077
|
+
}
|
|
9078
|
+
),
|
|
9079
|
+
!isRail && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
9080
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "nebula-ds flex-1 truncate text-left", children: label }),
|
|
9081
|
+
(action || counter !== void 0 || collapsible) && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "nebula-ds flex items-center gap-2 shrink-0", children: [
|
|
9082
|
+
action,
|
|
9083
|
+
counter !== void 0 && counter > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nebula-ds text-xs font-medium bg-muted px-2 py-0.5 rounded-md", children: counter }),
|
|
9084
|
+
collapsible && /* @__PURE__ */ jsxRuntime.jsx(
|
|
9085
|
+
lucideReact.ChevronDown,
|
|
9086
|
+
{
|
|
9087
|
+
className: cn(
|
|
9088
|
+
"size-4 transition-transform",
|
|
9089
|
+
open && "rotate-180"
|
|
9090
|
+
)
|
|
9091
|
+
}
|
|
9092
|
+
)
|
|
9093
|
+
] })
|
|
9094
|
+
] })
|
|
9095
|
+
]
|
|
9096
|
+
}
|
|
9097
|
+
);
|
|
9098
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn(isRail && "flex justify-center"), children: [
|
|
9099
|
+
isRail ? /* @__PURE__ */ jsxRuntime.jsx(Tooltip, { content: label, side: "right", children: content2 }) : content2,
|
|
9100
|
+
collapsible && open && !isRail && /* @__PURE__ */ jsxRuntime.jsx(SidebarLevelContext.Provider, { value: level + 1, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nebula-ds mt-1 space-y-1", children }) })
|
|
9101
|
+
] });
|
|
9102
|
+
}
|
|
8838
9103
|
|
|
8839
9104
|
// src/tailwind.ts
|
|
8840
9105
|
function content({ base = "./" } = {}) {
|
|
@@ -8965,6 +9230,17 @@ exports.RadioGroup = RadioGroup2;
|
|
|
8965
9230
|
exports.RadioGroupItem = RadioGroupItem;
|
|
8966
9231
|
exports.Select = StyledSelect;
|
|
8967
9232
|
exports.Separator = Separator;
|
|
9233
|
+
exports.Sidebar = Sidebar;
|
|
9234
|
+
exports.SidebarContent = SidebarContent;
|
|
9235
|
+
exports.SidebarFooter = SidebarFooter;
|
|
9236
|
+
exports.SidebarGroup = SidebarGroup;
|
|
9237
|
+
exports.SidebarGroupLabel = SidebarGroupLabel;
|
|
9238
|
+
exports.SidebarHeader = SidebarHeader;
|
|
9239
|
+
exports.SidebarMenuItem = SidebarMenuItem;
|
|
9240
|
+
exports.SidebarSeparator = SidebarSeparator;
|
|
9241
|
+
exports.SidebarStateEnum = SidebarStateEnum;
|
|
9242
|
+
exports.SidebarTitle = SidebarTitle;
|
|
9243
|
+
exports.SidebarTrigger = SidebarTrigger;
|
|
8968
9244
|
exports.Skeleton = Skeleton;
|
|
8969
9245
|
exports.Slider = Slider;
|
|
8970
9246
|
exports.Space = Space;
|
|
@@ -9026,6 +9302,8 @@ exports.toast = toast;
|
|
|
9026
9302
|
exports.toggleVariants = toggleVariants;
|
|
9027
9303
|
exports.useClickOutside = useClickOutside;
|
|
9028
9304
|
exports.useFileUpload = useFileUpload;
|
|
9305
|
+
exports.useIsMobile = useIsMobile;
|
|
9029
9306
|
exports.useKeyPress = useKeyPress;
|
|
9030
9307
|
exports.useNebulaI18n = useNebulaI18n;
|
|
9308
|
+
exports.useSidebar = useSidebar;
|
|
9031
9309
|
exports.useTipCard = useTipCard;
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
2
|
-
import { Minus, Check, X, ChevronRight, Circle, CircleX, Eye, EyeOff, ClockIcon, ChevronLeftIcon, ChevronRightIcon, ChevronDown, XIcon, MoreHorizontal, ChevronDownIcon, MinusIcon, PlusIcon, ImageUpIcon, CalendarIcon, ChevronsLeft, ChevronLeft, ChevronsRight, UserIcon, LoaderCircleIcon, CheckIcon, FileTextIcon, FileAudioIcon, FileVideoIcon, PhoneIcon, InfoIcon, TriangleAlertIcon, CircleCheckBigIcon, Info, CircleCheckBig } from 'lucide-react';
|
|
2
|
+
import { Minus, Check, X, ChevronRight, Circle, CircleX, Eye, EyeOff, ClockIcon, ChevronLeftIcon, ChevronRightIcon, PanelLeft, ChevronDown, XIcon, MoreHorizontal, ChevronDownIcon, MinusIcon, PlusIcon, ImageUpIcon, CalendarIcon, ChevronsLeft, ChevronLeft, ChevronsRight, UserIcon, LoaderCircleIcon, CheckIcon, FileTextIcon, FileAudioIcon, FileVideoIcon, PhoneIcon, InfoIcon, TriangleAlertIcon, CircleCheckBigIcon, Info, CircleCheckBig } from 'lucide-react';
|
|
3
3
|
import { extendTailwindMerge } from 'tailwind-merge';
|
|
4
4
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
5
5
|
import * as React25 from 'react';
|
|
@@ -4344,7 +4344,7 @@ var useFileUpload = (options = {}) => {
|
|
|
4344
4344
|
};
|
|
4345
4345
|
}
|
|
4346
4346
|
} else {
|
|
4347
|
-
if (file.size > maxSize) {
|
|
4347
|
+
if (file.size != null && file.size > maxSize) {
|
|
4348
4348
|
return { error: "MAXIMUM_FILE_SIZE_EXCEEDED" /* MAXIMUM_FILE_SIZE_EXCEEDED */, file };
|
|
4349
4349
|
}
|
|
4350
4350
|
}
|
|
@@ -4426,7 +4426,7 @@ var useFileUpload = (options = {}) => {
|
|
|
4426
4426
|
return;
|
|
4427
4427
|
}
|
|
4428
4428
|
}
|
|
4429
|
-
if (file.size > maxSize) {
|
|
4429
|
+
if (file.size != null && file.size > maxSize) {
|
|
4430
4430
|
onError?.([
|
|
4431
4431
|
{ file, error: "MAXIMUM_FILE_SIZE_EXCEEDED" /* MAXIMUM_FILE_SIZE_EXCEEDED */ }
|
|
4432
4432
|
]);
|
|
@@ -4727,7 +4727,7 @@ function FileUpload({
|
|
|
4727
4727
|
) }),
|
|
4728
4728
|
/* @__PURE__ */ jsxs("div", { className: "nebula-ds flex min-w-0 flex-col gap-1", children: [
|
|
4729
4729
|
/* @__PURE__ */ jsx(Heading, { level: "5", className: "nebula-ds text-xs", children: file.file.name }),
|
|
4730
|
-
/* @__PURE__ */ jsx(Paragraph, { size: "sm", children: formatBytes(file.file.size) })
|
|
4730
|
+
"description" in file.file && file.file.description ? /* @__PURE__ */ jsx(Paragraph, { size: "sm", children: file.file.description }) : file.file.size != null && file.file.size > 0 && /* @__PURE__ */ jsx(Paragraph, { size: "sm", children: formatBytes(file.file.size) })
|
|
4731
4731
|
] })
|
|
4732
4732
|
] }),
|
|
4733
4733
|
/* @__PURE__ */ jsx(
|
|
@@ -8792,6 +8792,271 @@ var Tooltip = React25.forwardRef(
|
|
|
8792
8792
|
}
|
|
8793
8793
|
);
|
|
8794
8794
|
Tooltip.displayName = "Tooltip";
|
|
8795
|
+
var useIsMobile = (breakpoint = 768) => {
|
|
8796
|
+
const [isMobile, setIsMobile] = useState(false);
|
|
8797
|
+
useEffect(() => {
|
|
8798
|
+
const mediaQuery = window.matchMedia(`(max-width: ${breakpoint}px)`);
|
|
8799
|
+
const handleMediaQueryChange = (event) => setIsMobile(event.matches);
|
|
8800
|
+
setIsMobile(mediaQuery.matches);
|
|
8801
|
+
mediaQuery.addEventListener("change", handleMediaQueryChange);
|
|
8802
|
+
return () => {
|
|
8803
|
+
mediaQuery.removeEventListener("change", handleMediaQueryChange);
|
|
8804
|
+
};
|
|
8805
|
+
}, [breakpoint]);
|
|
8806
|
+
return isMobile;
|
|
8807
|
+
};
|
|
8808
|
+
var SidebarStateEnum = /* @__PURE__ */ ((SidebarStateEnum2) => {
|
|
8809
|
+
SidebarStateEnum2["expanded"] = "expanded";
|
|
8810
|
+
SidebarStateEnum2["rail"] = "rail";
|
|
8811
|
+
SidebarStateEnum2["collapsed"] = "collapsed";
|
|
8812
|
+
return SidebarStateEnum2;
|
|
8813
|
+
})(SidebarStateEnum || {});
|
|
8814
|
+
var SidebarContext = React25.createContext(null);
|
|
8815
|
+
function useSidebar() {
|
|
8816
|
+
const ctx = React25.useContext(SidebarContext);
|
|
8817
|
+
if (!ctx) throw new Error("Sidebar must be used inside Sidebar");
|
|
8818
|
+
return ctx;
|
|
8819
|
+
}
|
|
8820
|
+
function Sidebar({
|
|
8821
|
+
children,
|
|
8822
|
+
defaultState = "expanded",
|
|
8823
|
+
open,
|
|
8824
|
+
onOpenChange
|
|
8825
|
+
}) {
|
|
8826
|
+
const isMobile = useIsMobile();
|
|
8827
|
+
const isControlled = open !== void 0;
|
|
8828
|
+
const [internalState, setInternalState] = React25.useState(defaultState);
|
|
8829
|
+
const state = isControlled ? open ? "expanded" : "collapsed" : internalState;
|
|
8830
|
+
const setState = React25.useCallback(
|
|
8831
|
+
(next) => {
|
|
8832
|
+
if (!isControlled) {
|
|
8833
|
+
setInternalState(next);
|
|
8834
|
+
}
|
|
8835
|
+
if (onOpenChange) {
|
|
8836
|
+
onOpenChange(next !== "collapsed");
|
|
8837
|
+
}
|
|
8838
|
+
},
|
|
8839
|
+
[isControlled, onOpenChange]
|
|
8840
|
+
);
|
|
8841
|
+
const contextValue = React25.useMemo(
|
|
8842
|
+
() => ({ state, setState, isMobile }),
|
|
8843
|
+
[state, isMobile, setState]
|
|
8844
|
+
);
|
|
8845
|
+
if (isMobile) {
|
|
8846
|
+
return /* @__PURE__ */ jsx(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(
|
|
8847
|
+
Drawer,
|
|
8848
|
+
{
|
|
8849
|
+
open: state !== "collapsed",
|
|
8850
|
+
onOpenChange: (o) => setState(o ? "expanded" : "collapsed"),
|
|
8851
|
+
children: /* @__PURE__ */ jsx(DrawerContent, { className: "nebula-ds w-[var(--sidebar-width)] p-0 shadow-xl", children: /* @__PURE__ */ jsx("div", { className: "nebula-ds flex h-full flex-col bg-sidebar-background", children }) })
|
|
8852
|
+
}
|
|
8853
|
+
) });
|
|
8854
|
+
}
|
|
8855
|
+
return /* @__PURE__ */ jsx(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(
|
|
8856
|
+
"aside",
|
|
8857
|
+
{
|
|
8858
|
+
"data-state": state,
|
|
8859
|
+
className: cn(
|
|
8860
|
+
"relative hidden md:flex flex-col border-r border-sidebar-border bg-sidebar-background transition-all duration-300 ease-in-out",
|
|
8861
|
+
state === "expanded" && "w-[var(--sidebar-width)]",
|
|
8862
|
+
state === "rail" && "w-[var(--sidebar-rail-width)]",
|
|
8863
|
+
state === "collapsed" && "w-0 overflow-hidden"
|
|
8864
|
+
),
|
|
8865
|
+
children
|
|
8866
|
+
}
|
|
8867
|
+
) });
|
|
8868
|
+
}
|
|
8869
|
+
function SidebarHeader({
|
|
8870
|
+
className,
|
|
8871
|
+
...props
|
|
8872
|
+
}) {
|
|
8873
|
+
const { state } = useSidebar();
|
|
8874
|
+
return /* @__PURE__ */ jsx(
|
|
8875
|
+
"div",
|
|
8876
|
+
{
|
|
8877
|
+
"data-state": state,
|
|
8878
|
+
className: cn(
|
|
8879
|
+
"sticky top-0 z-20 flex h-14 items-center border-b border-sidebar-border bg-sidebar-background transition-all duration-300",
|
|
8880
|
+
state === "expanded" && "justify-between px-4",
|
|
8881
|
+
state === "rail" && "justify-center px-2",
|
|
8882
|
+
className
|
|
8883
|
+
),
|
|
8884
|
+
...props
|
|
8885
|
+
}
|
|
8886
|
+
);
|
|
8887
|
+
}
|
|
8888
|
+
function SidebarContent({
|
|
8889
|
+
className,
|
|
8890
|
+
...props
|
|
8891
|
+
}) {
|
|
8892
|
+
const { state } = useSidebar();
|
|
8893
|
+
return /* @__PURE__ */ jsx(
|
|
8894
|
+
"div",
|
|
8895
|
+
{
|
|
8896
|
+
className: cn(
|
|
8897
|
+
"flex-1 overflow-y-auto py-3 space-y-4",
|
|
8898
|
+
state === "rail" && "flex flex-col items-center",
|
|
8899
|
+
className
|
|
8900
|
+
),
|
|
8901
|
+
...props
|
|
8902
|
+
}
|
|
8903
|
+
);
|
|
8904
|
+
}
|
|
8905
|
+
function SidebarTitle({
|
|
8906
|
+
className,
|
|
8907
|
+
children,
|
|
8908
|
+
...props
|
|
8909
|
+
}) {
|
|
8910
|
+
const { state } = useSidebar();
|
|
8911
|
+
if (state === "rail") return null;
|
|
8912
|
+
return /* @__PURE__ */ jsx(
|
|
8913
|
+
"div",
|
|
8914
|
+
{
|
|
8915
|
+
"data-state": state,
|
|
8916
|
+
className: cn(
|
|
8917
|
+
"font-semibold text-sidebar-text whitespace-nowrap transition-all duration-300",
|
|
8918
|
+
className
|
|
8919
|
+
),
|
|
8920
|
+
...props,
|
|
8921
|
+
children
|
|
8922
|
+
}
|
|
8923
|
+
);
|
|
8924
|
+
}
|
|
8925
|
+
function SidebarFooter({
|
|
8926
|
+
className,
|
|
8927
|
+
...props
|
|
8928
|
+
}) {
|
|
8929
|
+
const { state } = useSidebar();
|
|
8930
|
+
return /* @__PURE__ */ jsx(
|
|
8931
|
+
"div",
|
|
8932
|
+
{
|
|
8933
|
+
className: cn(
|
|
8934
|
+
"sticky bottom-0 bg-sidebar-background p-3",
|
|
8935
|
+
state === "rail" && "flex justify-center p-2",
|
|
8936
|
+
className
|
|
8937
|
+
),
|
|
8938
|
+
...props
|
|
8939
|
+
}
|
|
8940
|
+
);
|
|
8941
|
+
}
|
|
8942
|
+
var SidebarTrigger = React25.forwardRef(({ asChild = false, className, onClick, children, ...props }, ref) => {
|
|
8943
|
+
const { state, setState, isMobile } = useSidebar();
|
|
8944
|
+
const Comp = asChild ? Slot : Button;
|
|
8945
|
+
function handleToggle(e) {
|
|
8946
|
+
if (isMobile) {
|
|
8947
|
+
setState(state === "collapsed" ? "expanded" : "collapsed");
|
|
8948
|
+
} else {
|
|
8949
|
+
setState(state === "expanded" ? "rail" : "expanded");
|
|
8950
|
+
}
|
|
8951
|
+
onClick?.(e);
|
|
8952
|
+
}
|
|
8953
|
+
return /* @__PURE__ */ jsx(
|
|
8954
|
+
Comp,
|
|
8955
|
+
{
|
|
8956
|
+
ref,
|
|
8957
|
+
onClick: handleToggle,
|
|
8958
|
+
"aria-label": "Toggle sidebar",
|
|
8959
|
+
className: cn(
|
|
8960
|
+
!asChild && "size-9",
|
|
8961
|
+
state === "rail" && "mx-auto",
|
|
8962
|
+
className
|
|
8963
|
+
),
|
|
8964
|
+
...!asChild && { variant: "ghost", icon: true },
|
|
8965
|
+
...props,
|
|
8966
|
+
children: children ?? /* @__PURE__ */ jsx(PanelLeft, { className: "nebula-ds size-5" })
|
|
8967
|
+
}
|
|
8968
|
+
);
|
|
8969
|
+
});
|
|
8970
|
+
SidebarTrigger.displayName = "SidebarTrigger";
|
|
8971
|
+
function SidebarGroup({
|
|
8972
|
+
children,
|
|
8973
|
+
className
|
|
8974
|
+
}) {
|
|
8975
|
+
const { state } = useSidebar();
|
|
8976
|
+
return /* @__PURE__ */ jsx(
|
|
8977
|
+
"div",
|
|
8978
|
+
{
|
|
8979
|
+
className: cn(
|
|
8980
|
+
"flex flex-col space-y-1 px-2",
|
|
8981
|
+
state === "rail" && "items-center",
|
|
8982
|
+
className
|
|
8983
|
+
),
|
|
8984
|
+
children
|
|
8985
|
+
}
|
|
8986
|
+
);
|
|
8987
|
+
}
|
|
8988
|
+
function SidebarGroupLabel({ children }) {
|
|
8989
|
+
const { state } = useSidebar();
|
|
8990
|
+
if (state === "rail") return null;
|
|
8991
|
+
return /* @__PURE__ */ jsx("div", { className: "nebula-ds px-3 py-1 text-xs font-medium tracking-wide text-sidebar-label", children });
|
|
8992
|
+
}
|
|
8993
|
+
function SidebarSeparator() {
|
|
8994
|
+
return /* @__PURE__ */ jsx(Separator, { orientation: "horizontal" });
|
|
8995
|
+
}
|
|
8996
|
+
var SidebarLevelContext = React25.createContext(0);
|
|
8997
|
+
function SidebarMenuItem({
|
|
8998
|
+
icon,
|
|
8999
|
+
action,
|
|
9000
|
+
label,
|
|
9001
|
+
active,
|
|
9002
|
+
disabled,
|
|
9003
|
+
counter,
|
|
9004
|
+
collapsible,
|
|
9005
|
+
defaultOpen = false,
|
|
9006
|
+
children
|
|
9007
|
+
}) {
|
|
9008
|
+
const { state } = useSidebar();
|
|
9009
|
+
const [open, setOpen] = React25.useState(defaultOpen);
|
|
9010
|
+
const level = React25.useContext(SidebarLevelContext);
|
|
9011
|
+
const isRail = state === "rail";
|
|
9012
|
+
const paddingLeft = level > 0 ? "pl-11" : "";
|
|
9013
|
+
const content2 = /* @__PURE__ */ jsxs(
|
|
9014
|
+
Button,
|
|
9015
|
+
{
|
|
9016
|
+
variant: "ghost",
|
|
9017
|
+
disabled,
|
|
9018
|
+
"aria-expanded": collapsible ? open : void 0,
|
|
9019
|
+
onClick: () => collapsible && setOpen((p) => !p),
|
|
9020
|
+
className: cn(
|
|
9021
|
+
"group font-medium relative flex items-center rounded-lg py-2 text-sm transition-colors",
|
|
9022
|
+
active && "font-semibold",
|
|
9023
|
+
isRail ? "justify-center w-10 h-10 mx-auto px-0 rounded-full" : cn("w-full pr-3", paddingLeft)
|
|
9024
|
+
),
|
|
9025
|
+
children: [
|
|
9026
|
+
icon && /* @__PURE__ */ jsx(
|
|
9027
|
+
"span",
|
|
9028
|
+
{
|
|
9029
|
+
className: cn(
|
|
9030
|
+
"flex items-center justify-center size-4 shrink-0",
|
|
9031
|
+
!isRail && "mr-3"
|
|
9032
|
+
),
|
|
9033
|
+
children: icon
|
|
9034
|
+
}
|
|
9035
|
+
),
|
|
9036
|
+
!isRail && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
9037
|
+
/* @__PURE__ */ jsx("span", { className: "nebula-ds flex-1 truncate text-left", children: label }),
|
|
9038
|
+
(action || counter !== void 0 || collapsible) && /* @__PURE__ */ jsxs("span", { className: "nebula-ds flex items-center gap-2 shrink-0", children: [
|
|
9039
|
+
action,
|
|
9040
|
+
counter !== void 0 && counter > 0 && /* @__PURE__ */ jsx("span", { className: "nebula-ds text-xs font-medium bg-muted px-2 py-0.5 rounded-md", children: counter }),
|
|
9041
|
+
collapsible && /* @__PURE__ */ jsx(
|
|
9042
|
+
ChevronDown,
|
|
9043
|
+
{
|
|
9044
|
+
className: cn(
|
|
9045
|
+
"size-4 transition-transform",
|
|
9046
|
+
open && "rotate-180"
|
|
9047
|
+
)
|
|
9048
|
+
}
|
|
9049
|
+
)
|
|
9050
|
+
] })
|
|
9051
|
+
] })
|
|
9052
|
+
]
|
|
9053
|
+
}
|
|
9054
|
+
);
|
|
9055
|
+
return /* @__PURE__ */ jsxs("div", { className: cn(isRail && "flex justify-center"), children: [
|
|
9056
|
+
isRail ? /* @__PURE__ */ jsx(Tooltip, { content: label, side: "right", children: content2 }) : content2,
|
|
9057
|
+
collapsible && open && !isRail && /* @__PURE__ */ jsx(SidebarLevelContext.Provider, { value: level + 1, children: /* @__PURE__ */ jsx("div", { className: "nebula-ds mt-1 space-y-1", children }) })
|
|
9058
|
+
] });
|
|
9059
|
+
}
|
|
8795
9060
|
|
|
8796
9061
|
// src/tailwind.ts
|
|
8797
9062
|
function content({ base = "./" } = {}) {
|
|
@@ -8803,4 +9068,4 @@ var tailwind = {
|
|
|
8803
9068
|
// plugin: () => require("tailwindcss")("node_modules/@nebulareact/dist/tailwind.config.js"),
|
|
8804
9069
|
};
|
|
8805
9070
|
|
|
8806
|
-
export { Accordion, AccordionContent, AccordionDescription, AccordionItem, AccordionTitle, AccordionTrigger, ActionBar, ActionBarButton, ActionBarClose, ActionBarContent, ActionBarDivider, ActionBarPortal, ActionBarTrigger, Alert, AlertButton, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, AlertTitle, StyledAsync as Async, StyledAsyncCreatable as AsyncCreatable, Avatar, AvatarFallback, AvatarHoverAction, AvatarImage, AvatarSizeEnum, AvatarStick, AvatarVariantEnum, Badge, BannerAlert, BannerType, BannerVariant, Box, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Calendar, Caption, Checkbox, StyledCreatable as Creatable, Cropper2 as Cropper, CropperCropArea2 as CropperCropArea, CropperDescription2 as CropperDescription, CropperImage2 as CropperImage, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, Drawer, DrawerBody, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, FileUpload, FileUploadError, Heading, InputDatePickerSingle, InputDateRangePicker, InputDateTimePickerSingle, InputPhone, InputText, InputTime, KanbanBoard, KanbanCard, KanbanColumn, KanbanColumnDragHandle, KanbanColumnFooter, KanbanColumnHeader, KanbanColumnTitle, Label2 as Label, Link, NebulaI18nProvider, Pagination, Paragraph, Popover, PopoverContent, PopoverTrigger, ProfileImage, RadioGroup2 as RadioGroup, RadioGroupItem, StyledSelect as Select, Separator, Skeleton, Slider, Space, SpaceDirectionEnum, SpaceSizeEnum, Stepper, StepperDescription, StepperIndicator, StepperItem, StepperSeparator, StepperTitle, StepperTrigger, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tag, TextArea, TipCard, TipCardContent2 as TipCardContent, TipCardFooter, TipCardHeader, TipCardItem, TipCardMedia, TipCardMediaType, TipCardProvider, Toaster, Toggle, ToggleGroup, ToggleGroupItem, ToggleGroupTypeEnum, ToggleSizeEnum, Tooltip, alertVariants, badgeSizeEnum, badgeVariantEnum, buttonSizeEnum, buttonVariantEnum, buttonVariantsConfig, dateIsAvailable, formatBytes, getNebulaLanguage, localeByi18nKey, messages19 as messages, separatorVariants, setNebulaLanguage, tagVariantsEnum, tailwind, toast, toggleVariants, useClickOutside, useFileUpload, useKeyPress, useNebulaI18n, useTipCard };
|
|
9071
|
+
export { Accordion, AccordionContent, AccordionDescription, AccordionItem, AccordionTitle, AccordionTrigger, ActionBar, ActionBarButton, ActionBarClose, ActionBarContent, ActionBarDivider, ActionBarPortal, ActionBarTrigger, Alert, AlertButton, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, AlertTitle, StyledAsync as Async, StyledAsyncCreatable as AsyncCreatable, Avatar, AvatarFallback, AvatarHoverAction, AvatarImage, AvatarSizeEnum, AvatarStick, AvatarVariantEnum, Badge, BannerAlert, BannerType, BannerVariant, Box, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Calendar, Caption, Checkbox, StyledCreatable as Creatable, Cropper2 as Cropper, CropperCropArea2 as CropperCropArea, CropperDescription2 as CropperDescription, CropperImage2 as CropperImage, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, Drawer, DrawerBody, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, FileUpload, FileUploadError, Heading, InputDatePickerSingle, InputDateRangePicker, InputDateTimePickerSingle, InputPhone, InputText, InputTime, KanbanBoard, KanbanCard, KanbanColumn, KanbanColumnDragHandle, KanbanColumnFooter, KanbanColumnHeader, KanbanColumnTitle, Label2 as Label, Link, NebulaI18nProvider, Pagination, Paragraph, Popover, PopoverContent, PopoverTrigger, ProfileImage, RadioGroup2 as RadioGroup, RadioGroupItem, StyledSelect as Select, Separator, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupLabel, SidebarHeader, SidebarMenuItem, SidebarSeparator, SidebarStateEnum, SidebarTitle, SidebarTrigger, Skeleton, Slider, Space, SpaceDirectionEnum, SpaceSizeEnum, Stepper, StepperDescription, StepperIndicator, StepperItem, StepperSeparator, StepperTitle, StepperTrigger, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tag, TextArea, TipCard, TipCardContent2 as TipCardContent, TipCardFooter, TipCardHeader, TipCardItem, TipCardMedia, TipCardMediaType, TipCardProvider, Toaster, Toggle, ToggleGroup, ToggleGroupItem, ToggleGroupTypeEnum, ToggleSizeEnum, Tooltip, alertVariants, badgeSizeEnum, badgeVariantEnum, buttonSizeEnum, buttonVariantEnum, buttonVariantsConfig, dateIsAvailable, formatBytes, getNebulaLanguage, localeByi18nKey, messages19 as messages, separatorVariants, setNebulaLanguage, tagVariantsEnum, tailwind, toast, toggleVariants, useClickOutside, useFileUpload, useIsMobile, useKeyPress, useNebulaI18n, useSidebar, useTipCard };
|
package/package.json
CHANGED
|
Binary file
|