najm-kit 2.1.7 → 2.1.9
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/index.d.ts +29 -3
- package/dist/index.mjs +193 -44
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -471,6 +471,7 @@ interface PageHeaderSlotProps {
|
|
|
471
471
|
children: ReactNode;
|
|
472
472
|
className?: string;
|
|
473
473
|
}
|
|
474
|
+
type NPageHeaderBreakpoint = 'sm' | 'md' | 'lg';
|
|
474
475
|
interface NPageHeaderProps {
|
|
475
476
|
icon: ComponentType<{
|
|
476
477
|
className?: string;
|
|
@@ -478,8 +479,20 @@ interface NPageHeaderProps {
|
|
|
478
479
|
title: string;
|
|
479
480
|
subtitle?: string;
|
|
480
481
|
actions?: ReactNode;
|
|
482
|
+
/**
|
|
483
|
+
* Optional consumer-owned replacement for `actions` on smaller screens.
|
|
484
|
+
* Pass an icon button, dropdown, or any other compact control. When omitted,
|
|
485
|
+
* the regular actions keep rendering at every viewport size.
|
|
486
|
+
*/
|
|
487
|
+
compactActions?: ReactNode;
|
|
481
488
|
filters?: ReactNode;
|
|
482
489
|
top?: ReactNode;
|
|
490
|
+
/** Must match the paired NSidebar breakpoint so its hamburger has reserved space. */
|
|
491
|
+
mobileBreakpoint?: NPageHeaderBreakpoint;
|
|
492
|
+
/** Renders the mobile sidebar trigger inside the header's leading column. */
|
|
493
|
+
onSidebarOpen?: () => void;
|
|
494
|
+
sidebarTriggerLabel?: string;
|
|
495
|
+
sidebarTriggerClassName?: string;
|
|
483
496
|
search?: InputHTMLAttributes<HTMLInputElement> & {
|
|
484
497
|
placeholder?: string;
|
|
485
498
|
ref?: Ref<HTMLInputElement>;
|
|
@@ -495,6 +508,10 @@ declare function NPageHeaderActions({ children, className }: PageHeaderSlotProps
|
|
|
495
508
|
declare namespace NPageHeaderActions {
|
|
496
509
|
var displayName: string;
|
|
497
510
|
}
|
|
511
|
+
declare function NPageHeaderCompactActions({ children, className }: PageHeaderSlotProps): react_jsx_runtime.JSX.Element;
|
|
512
|
+
declare namespace NPageHeaderCompactActions {
|
|
513
|
+
var displayName: string;
|
|
514
|
+
}
|
|
498
515
|
declare function NPageHeaderFilters({ children, className }: PageHeaderSlotProps): react_jsx_runtime.JSX.Element;
|
|
499
516
|
declare namespace NPageHeaderFilters {
|
|
500
517
|
var displayName: string;
|
|
@@ -503,7 +520,7 @@ declare function NPageHeaderTop({ children, className }: PageHeaderSlotProps): r
|
|
|
503
520
|
declare namespace NPageHeaderTop {
|
|
504
521
|
var displayName: string;
|
|
505
522
|
}
|
|
506
|
-
declare function NPageHeader({ icon: Icon, title, subtitle, actions, filters, top, search, children, className, headerClassName, card, bordered }: NPageHeaderProps): react_jsx_runtime.JSX.Element;
|
|
523
|
+
declare function NPageHeader({ icon: Icon, title, subtitle, actions, compactActions, filters, top, mobileBreakpoint, onSidebarOpen, sidebarTriggerLabel, sidebarTriggerClassName, search, children, className, headerClassName, card, bordered, }: NPageHeaderProps): react_jsx_runtime.JSX.Element;
|
|
507
524
|
|
|
508
525
|
type DialogActionMode = "auto" | "dialog" | "content";
|
|
509
526
|
type DialogVariant = "default" | "window";
|
|
@@ -3223,6 +3240,11 @@ interface SidebarProps {
|
|
|
3223
3240
|
className?: string;
|
|
3224
3241
|
classNames?: NAppShellClassNames;
|
|
3225
3242
|
mobileBreakpoint?: 'sm' | 'md' | 'lg';
|
|
3243
|
+
/**
|
|
3244
|
+
* Automatically use the collapsed desktop rail within one Tailwind
|
|
3245
|
+
* breakpoint band. For example, `lg` collapses from 1024px through 1279px.
|
|
3246
|
+
*/
|
|
3247
|
+
autoCollapseAt?: 'sm' | 'md' | 'lg' | 'xl';
|
|
3226
3248
|
mobileOpen?: boolean;
|
|
3227
3249
|
defaultMobileOpen?: boolean;
|
|
3228
3250
|
onMobileOpenChange?: (open: boolean) => void;
|
|
@@ -3232,6 +3254,10 @@ interface SidebarProps {
|
|
|
3232
3254
|
collapseLabel?: string;
|
|
3233
3255
|
expandLabel?: string;
|
|
3234
3256
|
hamburgerClassName?: string;
|
|
3257
|
+
/**
|
|
3258
|
+
* Opts into the legacy fixed standalone trigger. Prefer controlling
|
|
3259
|
+
* `mobileOpen` from an NPageHeader via its `onSidebarOpen` prop.
|
|
3260
|
+
*/
|
|
3235
3261
|
showHamburgerButton?: boolean;
|
|
3236
3262
|
logoIcon?: ComponentType<{
|
|
3237
3263
|
className?: string;
|
|
@@ -3336,7 +3362,7 @@ declare function NSidebarFooter({ children, onSettings, settingsLabel, onLogout,
|
|
|
3336
3362
|
|
|
3337
3363
|
declare function NSidebarMobile({ open, onOpen, onClose, mobileBreakpoint, width, hamburgerLabel, closeLabel, hamburgerClassName, showHamburgerButton, children, bordered, }: NSidebarMobileProps): react_jsx_runtime.JSX.Element;
|
|
3338
3364
|
|
|
3339
|
-
declare function NSidebar({ logo, navItems, activePath, isActive, onNavigate, linkComponent, collapsed: collapsedProp, defaultCollapsed, onCollapsedChange, showCollapseButton, collapseButtonPosition, showSectionLabels, showSectionIcons, showSectionSeparators, bordered, footer, className, classNames, mobileBreakpoint, mobileOpen: mobileOpenProp, defaultMobileOpen, onMobileOpenChange, closeOnNavigate, hamburgerLabel, closeLabel, collapseLabel, expandLabel, hamburgerClassName, showHamburgerButton, logoIcon, logoTitle, logoSubtitle, onLogoClick, onSettings, settingsLabel, onLogout, logoutLabel, widths, }: SidebarProps): react_jsx_runtime.JSX.Element;
|
|
3365
|
+
declare function NSidebar({ logo, navItems, activePath, isActive, onNavigate, linkComponent, collapsed: collapsedProp, defaultCollapsed, onCollapsedChange, showCollapseButton, collapseButtonPosition, showSectionLabels, showSectionIcons, showSectionSeparators, bordered, footer, className, classNames, mobileBreakpoint, autoCollapseAt, mobileOpen: mobileOpenProp, defaultMobileOpen, onMobileOpenChange, closeOnNavigate, hamburgerLabel, closeLabel, collapseLabel, expandLabel, hamburgerClassName, showHamburgerButton, logoIcon, logoTitle, logoSubtitle, onLogoClick, onSettings, settingsLabel, onLogout, logoutLabel, widths, }: SidebarProps): react_jsx_runtime.JSX.Element;
|
|
3340
3366
|
|
|
3341
3367
|
declare function NSidebarItem({ item, activePath, isActive, onNavigate, linkComponent: LinkComponent, collapsed, depth, classNames, }: SidebarItemProps): react_jsx_runtime.JSX.Element;
|
|
3342
3368
|
|
|
@@ -3441,4 +3467,4 @@ interface InspectorSheetProps {
|
|
|
3441
3467
|
}
|
|
3442
3468
|
declare function NInspectorSheet({ open, onClose, title, children }: InspectorSheetProps): react_jsx_runtime.JSX.Element;
|
|
3443
3469
|
|
|
3444
|
-
export { Alert, type AlertLook, type AlertOrientation, type AlertProps, type AlertSize, type AlertTone, type AlertVariant, NCard as AsyncCard, Avatar, AvatarFallback, AvatarGroup, type AvatarGroupProps, AvatarImage, type AvatarProps$1 as AvatarProps, type AvatarShape$1 as AvatarShape, type AvatarSize, AvatarStatus, type AvatarStatusType, Badge, type BadgeColor, type BadgeIcon, type BadgeLook, type BadgeProps, type BadgeShape, type BadgeSize, type BadgeVariant, BaseInput, type BuildDefaultFileColumnsOptions, Button, type ButtonConfig, type ButtonIcon, type ButtonLoaderPosition, type ButtonProps, type ButtonRounded, type ButtonSize, type ButtonVariant, Calendar, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CheckboxGroupInput, type CheckboxGroupInputProps, CheckboxInput, type CheckboxInputProps, Collapsible, CollapsibleContent, CollapsibleTrigger, ColorArrayInput, type ColorArrayInputProps, type ColorFormat, ColorPickerInput, type ColorPickerInputProps, Combobox, ComboboxInput, type ComboboxInputProps, type ComboboxOption, type ComboboxProps, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, type ContextMenuItem, DateInput, type DateInputProps, type DeleteDialogOptions, Dialog, type DialogActionMode, type DialogApi, DialogClose, type DialogConfig, DialogContent, type DialogContentProps, DialogDescription, DialogFooter, DialogHeader, type DialogHeight, DialogOverlay, type DialogPadding, DialogPortal, type DialogRenderContext, type DialogRenderer, type DialogSize, type DialogStore, DialogTitle, DialogTrigger, type DialogVariant, type DialogWidth, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, DynamicArray, type DynamicArrayProps, EmojiInput, type EmojiInputProps, type FileBrowserMode, FileImportButton, FileInput, type FileInputProps, type FileNode, Form, FormControl, FormDescription, FormField, FormInput, type FormInputBackground, type FormInputProps, FormItem, FormLabel, FormMessage, type FormProps, type FormSlotClassNames, type FormVariant, IconButton, type IconButtonProps, type IconButtonSize, type IconButtonVariant, ImageInput, type ImageInputProps, Indicator, type IndicatorHorizontal, type IndicatorOverlay, type IndicatorPosition, type IndicatorProps, type IndicatorResponsivePosition, type IndicatorSize, type IndicatorVertical, Input, type InputIcon, Label, LangInput, type LangInputProps, type LinkComponentType, MultiSelectInput, type MultiSelectInputProps, NAJM_COMPONENT_NAMES, NAlert, type NAppCommandItem, NAppShell, type NAppShellAction, type NAppShellClassNames, type NAppShellProps, type NAppShellUser, NCard as NAsyncCard, type CardClassNames as NAsyncCardClassNames, type CardProps as NAsyncCardProps, NAvatar, type NAvatarClassNames, type NAvatarProps, type AvatarShape as NAvatarShape, NBadge, type NBadgeLook, type NBadgeProps, type NBulkAction, type NBulkActionButton, type NBulkActionSelect, NBulkActionsBar, type NBulkActionsBarProps, NButton, type NButtonProps, NCard, NCardAction, type CardClassNames as NCardClassNames, NCardFooter, type CardProps as NCardProps, NCommandPalette, type NCommandPaletteProps, NConfirmDialog, type NConfirmDialogProps, NContextMenu, type NContextMenuItem, type NContextMenuProps, NDataCardShell, type NDataCardShellActions, type NDataCardShellProps, NDeleteDialog, NDeleteDialogContent, type NDeleteDialogContentProps, type NDeleteDialogProps, NDetailCard, type NDetailCardClassNames, type NDetailCardProps, NDetailItem, type NDetailItemProps, NDetailList, type NDetailListItem, type NDetailListProps, NDialog, type NDialogActionProps, NDialogDescription, type NDialogDescriptionProps, type NDialogDirectProps, NDialogHeader, type NDialogHeaderProps, NDialogPrimaryButton, type NDialogProps, NDialogSecondaryButton, type NEditorTab, NEditorTabs, type NEditorTabsProps, NEmptyState, type NEmptyStateProps, NErrorBoundary, NErrorState, type NErrorStateProps, NFileBrowser, type NFileBrowserCardProps, type NFileBrowserProps, type NFileBrowserRenderThumbProps, NFileTypeIcon, type NFileTypeIconProps, NFilterBar, NFolderIcon, type NFolderIconProps, NForm, NFormSectionHeader, type NFormSectionHeaderProps, NIcon, type NIconProps, type NIconSource, NIndicator, NInspectorSheet, NLoadingState, type NLoadingStateProps, NMultiDialog, type NMultiDialogProps, NNavbar, NPageHeader, NPageHeaderActions, NPageHeaderFilters, type NPageHeaderProps, NPageHeaderTop, NPageLayout, type NPageLayoutProps, NPortalScopeProvider, NProgress, type NProgressProps, NRowActions, NSection, NSectionHeader, type NSectionHeaderActionsProps, type NSectionHeaderContentProps, type NSectionHeaderProps, type NSectionHeaderSubtitleProps, type NSectionHeaderTitleProps, NSectionInfo, type NSectionInfoProps, type NSectionProps, NSectionWithInfo, type NSectionWithInfoItem, type NSectionWithInfoProps, NSheet, type NSheetProps, NSidebar, NSidebarContent, type NSidebarContentProps, NSidebarFooter, type NSidebarFooterProps, NSidebarHeader, type NSidebarHeaderProps, NSidebarItem, NSidebarLogo, type NSidebarLogoProps, NSidebarMobile, type NSidebarMobileProps, NSidebarSection, type NSidebarSectionProps, NSkeleton, NSkeletonCalendar, NSkeletonChart, NSkeletonDonut, NSkeletonEventList, NSkeletonWidget, NSkeletonWidgets, NSlider, type NSliderProps, NSmartPasteDialog, type NSmartPasteDialogProps, NSpinner, type NSpinnerProps, NStatCard, type NStatCardClassNames, type NStatCardProps, NStatCardSkeleton, type NStatCardVariant, Swap as NSwap, type NSwapProps, NTable, NTableCardRoot, type NTableCardRootProps, NTableCards, type NTableClassNames, NTableContent, NTableHeader, NTableLoadingSkeleton, type NTableMenu, type NTableMenuProp, NTablePagination, type NTableProps, NTableRowSkeleton, NTableSkeleton, type NTableState, NTabs, type NTabsClassNames, type NTabsColor, type NTabsItem, type NTabsProps, type NTabsStyles, NUploader, type NUploaderItem, type NUploaderItemStatus, type NUploaderProps, NViewBody, NViewToggle, type NajmAccent, type NajmAppearance, type NajmBorderSide, type NajmComponentName, type NajmComponentRadius, type NajmComponentStyleConfig, type NajmComponentThemeConfig, type NajmDensity, type NajmDesignConfig, NajmDesignProvider, type NajmDesignProviderProps, type NajmLayoutConfig, type NajmMode, type NajmPreset, type NajmRadiusScale, NajmScroll, type NajmScrollProps, type NajmSlotStyle, type NajmThemeConfig, NajmThemeProvider, type NajmThemeProviderProps, type NajmThemeTokens, type NajmTypographyConfig, type NajmVariantStyle, NativeSelect, type NativeSelectOption, type NativeSelectProps, type NavItem, type NavItemGroup, NumberInput, type NumberInputProps, PasswordInput, type PasswordInputProps, PhoneInput, type PhoneInputProps, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PrefixProvider, Progress, type ProgressColor, type ProgressLabelPosition, type ProgressProps, type ProgressSize, type PushDialogOptions, RADIUS_VALUE_MAP, RadioGroup, RadioGroupInput, type RadioGroupInputProps, RadioGroupItem, type RenderSlot, RepeatingFields, type RepeatingFieldsProps, ScrollArea, type ScrollAreaProps, SearchField, SearchField as SearchInput, SegmentedControl, type SegmentedControlOption, type SegmentedControlProps, Select, SelectContent, SelectGroup, SelectInput, type SelectInputProps, SelectItem, type SelectItemType$1 as SelectItemDataType, type SelectItemType, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, type SidebarItemProps, type SidebarProps, type SidebarWidths, SimpleTooltip, type SimpleTooltipProps, NSkeleton as Skeleton, Slider, SliderInput, type SliderInputProps, type SliderOrientation, type SliderProps, type SliderSize, type SliderVariant, type SmartPastePreview, type SpinnerVariant, StarRatingInput, type StarRatingInputProps, StatusPill, type StatusPillProps, type StatusPillTone, type StepConfig, StepIndicator, type StepMeta, StepsHeader, StepsProgress, type StorageMenuAction, type StorageSortOption, type StorageTarget, Swap, type SwapEffect, SwapIndeterminate, SwapOff, SwapOn, type SwapProps, type SwapSize, type SwapState, Switch, type SwitchColor, SwitchInput, type SwitchInputProps, type SwitchSize, TAB_COLORS, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, type TableHeaderColor, TableRow, type TableState, type TableStore, TableStoreContext, Tabs, TabsContent, TabsList, type TabsListProps, type TabsOrientation, type TabsProps, TabsTrigger, type TabsTriggerProps, type TabsVariant, TextAreaInput, type TextAreaInputProps, TextInput, type TextInputProps, Textarea, TimeInput, type TimeInputProps, Toaster, Toggle, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type UseContextMenuResult, type UseNFormOptions, type UseStorageContextMenuOptions, type UseStorageContextMenuResult, type UserMenuAction, VariantProvider, type WizardClassNames, WizardForm, type WizardFormProps, alertVariants, avatarVariants, badgeColorVariants, badgeVariants, buildDefaultFileColumns, buttonVariants, cn, composePreset, createDialogStore, createTableStore, defineNajmDesignConfig, defineNajmThemeConfig, detectFormat, dialogVariants, formatColor, formatFileBytes, formatFileRelative, getIconColorProps, getNextEditorTabValue, indicatorVariants, inputBorderClasses, parseColor, parseNajmDesignConfig, parseNajmThemeConfig, resolvePreset, resolveRadiusValue, resolveSlot, resolveVariantAlias, sidebarBorderClasses, sliderVariants, stringifyNajmDesignConfig, stringifyNajmThemeConfig, surfaceBorderClasses, swapVariants, toPickerHex, toggleVariants, tooltipContentVariants, truncateByCharacters, useClickOutside, useContextMenu, useDebouncedValue, useDelayedLoading, useDialog, useDialogStore, useDynamicPageSize, useFormField, useFormSubmission, useInfiniteScroll, useKeyboard, useLocalStorageState, useNForm, useNPortalScope, useNajmAppearance, useNajmComponentStyle, useNajmDesign, usePrefix, useSelection, useStepNavigation, useStorageContextMenu, useStoreSync, useTable, useTableKeyboard, useTableStore, useVariant, useVariantPreset };
|
|
3470
|
+
export { Alert, type AlertLook, type AlertOrientation, type AlertProps, type AlertSize, type AlertTone, type AlertVariant, NCard as AsyncCard, Avatar, AvatarFallback, AvatarGroup, type AvatarGroupProps, AvatarImage, type AvatarProps$1 as AvatarProps, type AvatarShape$1 as AvatarShape, type AvatarSize, AvatarStatus, type AvatarStatusType, Badge, type BadgeColor, type BadgeIcon, type BadgeLook, type BadgeProps, type BadgeShape, type BadgeSize, type BadgeVariant, BaseInput, type BuildDefaultFileColumnsOptions, Button, type ButtonConfig, type ButtonIcon, type ButtonLoaderPosition, type ButtonProps, type ButtonRounded, type ButtonSize, type ButtonVariant, Calendar, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CheckboxGroupInput, type CheckboxGroupInputProps, CheckboxInput, type CheckboxInputProps, Collapsible, CollapsibleContent, CollapsibleTrigger, ColorArrayInput, type ColorArrayInputProps, type ColorFormat, ColorPickerInput, type ColorPickerInputProps, Combobox, ComboboxInput, type ComboboxInputProps, type ComboboxOption, type ComboboxProps, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, type ContextMenuItem, DateInput, type DateInputProps, type DeleteDialogOptions, Dialog, type DialogActionMode, type DialogApi, DialogClose, type DialogConfig, DialogContent, type DialogContentProps, DialogDescription, DialogFooter, DialogHeader, type DialogHeight, DialogOverlay, type DialogPadding, DialogPortal, type DialogRenderContext, type DialogRenderer, type DialogSize, type DialogStore, DialogTitle, DialogTrigger, type DialogVariant, type DialogWidth, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, DynamicArray, type DynamicArrayProps, EmojiInput, type EmojiInputProps, type FileBrowserMode, FileImportButton, FileInput, type FileInputProps, type FileNode, Form, FormControl, FormDescription, FormField, FormInput, type FormInputBackground, type FormInputProps, FormItem, FormLabel, FormMessage, type FormProps, type FormSlotClassNames, type FormVariant, IconButton, type IconButtonProps, type IconButtonSize, type IconButtonVariant, ImageInput, type ImageInputProps, Indicator, type IndicatorHorizontal, type IndicatorOverlay, type IndicatorPosition, type IndicatorProps, type IndicatorResponsivePosition, type IndicatorSize, type IndicatorVertical, Input, type InputIcon, Label, LangInput, type LangInputProps, type LinkComponentType, MultiSelectInput, type MultiSelectInputProps, NAJM_COMPONENT_NAMES, NAlert, type NAppCommandItem, NAppShell, type NAppShellAction, type NAppShellClassNames, type NAppShellProps, type NAppShellUser, NCard as NAsyncCard, type CardClassNames as NAsyncCardClassNames, type CardProps as NAsyncCardProps, NAvatar, type NAvatarClassNames, type NAvatarProps, type AvatarShape as NAvatarShape, NBadge, type NBadgeLook, type NBadgeProps, type NBulkAction, type NBulkActionButton, type NBulkActionSelect, NBulkActionsBar, type NBulkActionsBarProps, NButton, type NButtonProps, NCard, NCardAction, type CardClassNames as NCardClassNames, NCardFooter, type CardProps as NCardProps, NCommandPalette, type NCommandPaletteProps, NConfirmDialog, type NConfirmDialogProps, NContextMenu, type NContextMenuItem, type NContextMenuProps, NDataCardShell, type NDataCardShellActions, type NDataCardShellProps, NDeleteDialog, NDeleteDialogContent, type NDeleteDialogContentProps, type NDeleteDialogProps, NDetailCard, type NDetailCardClassNames, type NDetailCardProps, NDetailItem, type NDetailItemProps, NDetailList, type NDetailListItem, type NDetailListProps, NDialog, type NDialogActionProps, NDialogDescription, type NDialogDescriptionProps, type NDialogDirectProps, NDialogHeader, type NDialogHeaderProps, NDialogPrimaryButton, type NDialogProps, NDialogSecondaryButton, type NEditorTab, NEditorTabs, type NEditorTabsProps, NEmptyState, type NEmptyStateProps, NErrorBoundary, NErrorState, type NErrorStateProps, NFileBrowser, type NFileBrowserCardProps, type NFileBrowserProps, type NFileBrowserRenderThumbProps, NFileTypeIcon, type NFileTypeIconProps, NFilterBar, NFolderIcon, type NFolderIconProps, NForm, NFormSectionHeader, type NFormSectionHeaderProps, NIcon, type NIconProps, type NIconSource, NIndicator, NInspectorSheet, NLoadingState, type NLoadingStateProps, NMultiDialog, type NMultiDialogProps, NNavbar, NPageHeader, NPageHeaderActions, type NPageHeaderBreakpoint, NPageHeaderCompactActions, NPageHeaderFilters, type NPageHeaderProps, NPageHeaderTop, NPageLayout, type NPageLayoutProps, NPortalScopeProvider, NProgress, type NProgressProps, NRowActions, NSection, NSectionHeader, type NSectionHeaderActionsProps, type NSectionHeaderContentProps, type NSectionHeaderProps, type NSectionHeaderSubtitleProps, type NSectionHeaderTitleProps, NSectionInfo, type NSectionInfoProps, type NSectionProps, NSectionWithInfo, type NSectionWithInfoItem, type NSectionWithInfoProps, NSheet, type NSheetProps, NSidebar, NSidebarContent, type NSidebarContentProps, NSidebarFooter, type NSidebarFooterProps, NSidebarHeader, type NSidebarHeaderProps, NSidebarItem, NSidebarLogo, type NSidebarLogoProps, NSidebarMobile, type NSidebarMobileProps, NSidebarSection, type NSidebarSectionProps, NSkeleton, NSkeletonCalendar, NSkeletonChart, NSkeletonDonut, NSkeletonEventList, NSkeletonWidget, NSkeletonWidgets, NSlider, type NSliderProps, NSmartPasteDialog, type NSmartPasteDialogProps, NSpinner, type NSpinnerProps, NStatCard, type NStatCardClassNames, type NStatCardProps, NStatCardSkeleton, type NStatCardVariant, Swap as NSwap, type NSwapProps, NTable, NTableCardRoot, type NTableCardRootProps, NTableCards, type NTableClassNames, NTableContent, NTableHeader, NTableLoadingSkeleton, type NTableMenu, type NTableMenuProp, NTablePagination, type NTableProps, NTableRowSkeleton, NTableSkeleton, type NTableState, NTabs, type NTabsClassNames, type NTabsColor, type NTabsItem, type NTabsProps, type NTabsStyles, NUploader, type NUploaderItem, type NUploaderItemStatus, type NUploaderProps, NViewBody, NViewToggle, type NajmAccent, type NajmAppearance, type NajmBorderSide, type NajmComponentName, type NajmComponentRadius, type NajmComponentStyleConfig, type NajmComponentThemeConfig, type NajmDensity, type NajmDesignConfig, NajmDesignProvider, type NajmDesignProviderProps, type NajmLayoutConfig, type NajmMode, type NajmPreset, type NajmRadiusScale, NajmScroll, type NajmScrollProps, type NajmSlotStyle, type NajmThemeConfig, NajmThemeProvider, type NajmThemeProviderProps, type NajmThemeTokens, type NajmTypographyConfig, type NajmVariantStyle, NativeSelect, type NativeSelectOption, type NativeSelectProps, type NavItem, type NavItemGroup, NumberInput, type NumberInputProps, PasswordInput, type PasswordInputProps, PhoneInput, type PhoneInputProps, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PrefixProvider, Progress, type ProgressColor, type ProgressLabelPosition, type ProgressProps, type ProgressSize, type PushDialogOptions, RADIUS_VALUE_MAP, RadioGroup, RadioGroupInput, type RadioGroupInputProps, RadioGroupItem, type RenderSlot, RepeatingFields, type RepeatingFieldsProps, ScrollArea, type ScrollAreaProps, SearchField, SearchField as SearchInput, SegmentedControl, type SegmentedControlOption, type SegmentedControlProps, Select, SelectContent, SelectGroup, SelectInput, type SelectInputProps, SelectItem, type SelectItemType$1 as SelectItemDataType, type SelectItemType, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, type SidebarItemProps, type SidebarProps, type SidebarWidths, SimpleTooltip, type SimpleTooltipProps, NSkeleton as Skeleton, Slider, SliderInput, type SliderInputProps, type SliderOrientation, type SliderProps, type SliderSize, type SliderVariant, type SmartPastePreview, type SpinnerVariant, StarRatingInput, type StarRatingInputProps, StatusPill, type StatusPillProps, type StatusPillTone, type StepConfig, StepIndicator, type StepMeta, StepsHeader, StepsProgress, type StorageMenuAction, type StorageSortOption, type StorageTarget, Swap, type SwapEffect, SwapIndeterminate, SwapOff, SwapOn, type SwapProps, type SwapSize, type SwapState, Switch, type SwitchColor, SwitchInput, type SwitchInputProps, type SwitchSize, TAB_COLORS, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, type TableHeaderColor, TableRow, type TableState, type TableStore, TableStoreContext, Tabs, TabsContent, TabsList, type TabsListProps, type TabsOrientation, type TabsProps, TabsTrigger, type TabsTriggerProps, type TabsVariant, TextAreaInput, type TextAreaInputProps, TextInput, type TextInputProps, Textarea, TimeInput, type TimeInputProps, Toaster, Toggle, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type UseContextMenuResult, type UseNFormOptions, type UseStorageContextMenuOptions, type UseStorageContextMenuResult, type UserMenuAction, VariantProvider, type WizardClassNames, WizardForm, type WizardFormProps, alertVariants, avatarVariants, badgeColorVariants, badgeVariants, buildDefaultFileColumns, buttonVariants, cn, composePreset, createDialogStore, createTableStore, defineNajmDesignConfig, defineNajmThemeConfig, detectFormat, dialogVariants, formatColor, formatFileBytes, formatFileRelative, getIconColorProps, getNextEditorTabValue, indicatorVariants, inputBorderClasses, parseColor, parseNajmDesignConfig, parseNajmThemeConfig, resolvePreset, resolveRadiusValue, resolveSlot, resolveVariantAlias, sidebarBorderClasses, sliderVariants, stringifyNajmDesignConfig, stringifyNajmThemeConfig, surfaceBorderClasses, swapVariants, toPickerHex, toggleVariants, tooltipContentVariants, truncateByCharacters, useClickOutside, useContextMenu, useDebouncedValue, useDelayedLoading, useDialog, useDialogStore, useDynamicPageSize, useFormField, useFormSubmission, useInfiniteScroll, useKeyboard, useLocalStorageState, useNForm, useNPortalScope, useNajmAppearance, useNajmComponentStyle, useNajmDesign, usePrefix, useSelection, useStepNavigation, useStorageContextMenu, useStoreSync, useTable, useTableKeyboard, useTableStore, useVariant, useVariantPreset };
|
package/dist/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import React__default, { createContext, useContext, useCallback, useEffect, useS
|
|
|
3
3
|
import { Slot } from '@radix-ui/react-slot';
|
|
4
4
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
5
5
|
import * as LucideIcons from 'lucide-react';
|
|
6
|
-
import { ChevronDown, AlertTriangle, RefreshCw, LoaderCircleIcon, X, XIcon, Search, ChevronRightIcon, CheckIcon, CircleIcon, ChevronDownIcon, ChevronUpIcon, ChevronLeftIcon, SearchIcon, Table as Table$1, FileJson, ChevronRight, CheckSquare, FilePlus, FolderPlus, Trash2, Share2, Move, ClipboardPaste, Copy, Scissors, Pencil, Download, Eye, ArrowUpDown, Loader2, ChevronUp, Folder, EyeOff, ChevronsUpDown, Check, Calendar as Calendar$1, FileUp, UploadCloud, CheckCircle2, AlertCircle, Star, Globe, Clock, Upload, Plus, MoreVertical, Edit, ChevronsLeft, ChevronLeft, ChevronsRight, Merge, PanelLeftOpen, PanelLeftClose,
|
|
6
|
+
import { ChevronDown, AlertTriangle, RefreshCw, LoaderCircleIcon, X, XIcon, Menu, Search, ChevronRightIcon, CheckIcon, CircleIcon, ChevronDownIcon, ChevronUpIcon, ChevronLeftIcon, SearchIcon, Table as Table$1, FileJson, ChevronRight, CheckSquare, FilePlus, FolderPlus, Trash2, Share2, Move, ClipboardPaste, Copy, Scissors, Pencil, Download, Eye, ArrowUpDown, Loader2, ChevronUp, Folder, EyeOff, ChevronsUpDown, Check, Calendar as Calendar$1, FileUp, UploadCloud, CheckCircle2, AlertCircle, Star, Globe, Clock, Upload, Plus, MoreVertical, Edit, ChevronsLeft, ChevronLeft, ChevronsRight, Merge, PanelLeftOpen, PanelLeftClose, LogOut, Image, ArrowUp, ArrowDown, LoaderPinwheelIcon, LoaderIcon, ArrowUpRight, ArrowDownRight, SlidersHorizontal, Columns3, Settings, SearchX, Inbox, List, LayoutGrid, Code, FolderOpen } from 'lucide-react';
|
|
7
7
|
import { cva } from 'class-variance-authority';
|
|
8
8
|
import { clsx } from 'clsx';
|
|
9
9
|
import { twMerge } from 'tailwind-merge';
|
|
@@ -1977,6 +1977,10 @@ function NPageHeaderActions({ children, className }) {
|
|
|
1977
1977
|
return /* @__PURE__ */ jsx("div", { className: cn("flex shrink-0 items-center gap-2 sm:gap-3", className), children });
|
|
1978
1978
|
}
|
|
1979
1979
|
NPageHeaderActions.displayName = "NPageHeaderActions";
|
|
1980
|
+
function NPageHeaderCompactActions({ children, className }) {
|
|
1981
|
+
return /* @__PURE__ */ jsx("div", { className: cn("flex shrink-0 items-center", className), children });
|
|
1982
|
+
}
|
|
1983
|
+
NPageHeaderCompactActions.displayName = "NPageHeaderCompactActions";
|
|
1980
1984
|
function NPageHeaderFilters({ children, className }) {
|
|
1981
1985
|
return /* @__PURE__ */ jsx("div", { className: cn("px-4 py-3 sm:px-5", className), children });
|
|
1982
1986
|
}
|
|
@@ -1992,7 +1996,51 @@ function getSlotElements(children, slot) {
|
|
|
1992
1996
|
const matches = React__default.Children.toArray(children).filter((child) => isPageHeaderSlot(child, slot));
|
|
1993
1997
|
return matches.length > 0 ? matches : void 0;
|
|
1994
1998
|
}
|
|
1995
|
-
|
|
1999
|
+
var responsiveClasses = {
|
|
2000
|
+
sm: {
|
|
2001
|
+
main: "sm:flex sm:justify-between sm:px-5",
|
|
2002
|
+
identity: "sm:col-start-auto sm:row-start-auto sm:justify-self-auto",
|
|
2003
|
+
controls: "sm:col-start-auto sm:row-start-auto sm:justify-self-auto",
|
|
2004
|
+
fullActions: "sm:flex",
|
|
2005
|
+
compactActions: "sm:hidden",
|
|
2006
|
+
sidebarTrigger: "sm:hidden"
|
|
2007
|
+
},
|
|
2008
|
+
md: {
|
|
2009
|
+
main: "md:flex md:justify-between md:px-5",
|
|
2010
|
+
identity: "md:col-start-auto md:row-start-auto md:justify-self-auto",
|
|
2011
|
+
controls: "md:col-start-auto md:row-start-auto md:justify-self-auto",
|
|
2012
|
+
fullActions: "md:flex",
|
|
2013
|
+
compactActions: "md:hidden",
|
|
2014
|
+
sidebarTrigger: "md:hidden"
|
|
2015
|
+
},
|
|
2016
|
+
lg: {
|
|
2017
|
+
main: "lg:flex lg:justify-between lg:px-5",
|
|
2018
|
+
identity: "lg:col-start-auto lg:row-start-auto lg:justify-self-auto",
|
|
2019
|
+
controls: "lg:col-start-auto lg:row-start-auto lg:justify-self-auto",
|
|
2020
|
+
fullActions: "lg:flex",
|
|
2021
|
+
compactActions: "lg:hidden",
|
|
2022
|
+
sidebarTrigger: "lg:hidden"
|
|
2023
|
+
}
|
|
2024
|
+
};
|
|
2025
|
+
function NPageHeader({
|
|
2026
|
+
icon: Icon2,
|
|
2027
|
+
title,
|
|
2028
|
+
subtitle,
|
|
2029
|
+
actions,
|
|
2030
|
+
compactActions,
|
|
2031
|
+
filters,
|
|
2032
|
+
top,
|
|
2033
|
+
mobileBreakpoint = "md",
|
|
2034
|
+
onSidebarOpen,
|
|
2035
|
+
sidebarTriggerLabel = "Open sidebar",
|
|
2036
|
+
sidebarTriggerClassName,
|
|
2037
|
+
search,
|
|
2038
|
+
children,
|
|
2039
|
+
className,
|
|
2040
|
+
headerClassName,
|
|
2041
|
+
card,
|
|
2042
|
+
bordered
|
|
2043
|
+
}) {
|
|
1996
2044
|
const [internalSearch, setInternalSearch] = useState("");
|
|
1997
2045
|
const recipe = useNajmComponentStyle("pageHeader");
|
|
1998
2046
|
const searchValue = search?.value ?? internalSearch;
|
|
@@ -2001,11 +2049,15 @@ function NPageHeader({ icon: Icon2, title, subtitle, actions, filters, top, sear
|
|
|
2001
2049
|
search?.onChange?.(e);
|
|
2002
2050
|
}, [search?.onChange]);
|
|
2003
2051
|
const slottedActions = getSlotElements(children, NPageHeaderActions);
|
|
2052
|
+
const slottedCompactActions = getSlotElements(children, NPageHeaderCompactActions);
|
|
2004
2053
|
const slottedFilters = getSlotElements(children, NPageHeaderFilters);
|
|
2005
2054
|
const slottedTop = getSlotElements(children, NPageHeaderTop);
|
|
2006
2055
|
const resolvedActions = slottedActions ?? actions;
|
|
2056
|
+
const resolvedCompactActions = slottedCompactActions ?? compactActions;
|
|
2007
2057
|
const resolvedFilters = slottedFilters ?? filters;
|
|
2008
2058
|
const resolvedTop = slottedTop ?? top;
|
|
2059
|
+
const hasCompactActions = resolvedCompactActions !== void 0 && resolvedCompactActions !== null && resolvedCompactActions !== false;
|
|
2060
|
+
const breakpointClasses = responsiveClasses[mobileBreakpoint];
|
|
2009
2061
|
const isCard = card ?? recipe?.card ?? bordered === true;
|
|
2010
2062
|
const recipeRadius = resolveRadiusValue(recipe?.radius);
|
|
2011
2063
|
const recipeStyle = recipeRadius || recipe?.borderWidth ? {
|
|
@@ -2025,35 +2077,104 @@ function NPageHeader({ icon: Icon2, title, subtitle, actions, filters, top, sear
|
|
|
2025
2077
|
),
|
|
2026
2078
|
children: [
|
|
2027
2079
|
resolvedTop,
|
|
2028
|
-
/* @__PURE__ */ jsxs(
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
/* @__PURE__ */ jsx(
|
|
2039
|
-
|
|
2040
|
-
"input",
|
|
2080
|
+
/* @__PURE__ */ jsxs(
|
|
2081
|
+
"div",
|
|
2082
|
+
{
|
|
2083
|
+
"data-slot": "page-header-main",
|
|
2084
|
+
className: cn(
|
|
2085
|
+
"relative grid min-h-14 grid-cols-[minmax(2.75rem,1fr)_minmax(0,auto)_minmax(2.75rem,1fr)] items-center gap-2 px-4",
|
|
2086
|
+
breakpointClasses.main,
|
|
2087
|
+
headerClassName
|
|
2088
|
+
),
|
|
2089
|
+
children: [
|
|
2090
|
+
onSidebarOpen && /* @__PURE__ */ jsx(
|
|
2091
|
+
Button,
|
|
2041
2092
|
{
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2093
|
+
type: "button",
|
|
2094
|
+
variant: "ghost",
|
|
2095
|
+
size: "icon",
|
|
2096
|
+
onClick: onSidebarOpen,
|
|
2097
|
+
"aria-label": sidebarTriggerLabel,
|
|
2098
|
+
"data-slot": "page-header-sidebar-trigger",
|
|
2046
2099
|
className: cn(
|
|
2047
|
-
"
|
|
2048
|
-
|
|
2100
|
+
"col-start-1 row-start-1 justify-self-start",
|
|
2101
|
+
breakpointClasses.sidebarTrigger,
|
|
2102
|
+
sidebarTriggerClassName
|
|
2049
2103
|
),
|
|
2050
|
-
|
|
2104
|
+
children: /* @__PURE__ */ jsx(Menu, { className: "h-5 w-5" })
|
|
2105
|
+
}
|
|
2106
|
+
),
|
|
2107
|
+
/* @__PURE__ */ jsxs(
|
|
2108
|
+
"div",
|
|
2109
|
+
{
|
|
2110
|
+
"data-slot": "page-header-identity",
|
|
2111
|
+
className: cn(
|
|
2112
|
+
"col-start-2 row-start-1 flex min-w-0 max-w-full items-center justify-self-center gap-3",
|
|
2113
|
+
breakpointClasses.identity
|
|
2114
|
+
),
|
|
2115
|
+
children: [
|
|
2116
|
+
/* @__PURE__ */ jsx("div", { className: "flex h-8 w-8 shrink-0 rounded-lg bg-primary/10 items-center justify-center", children: /* @__PURE__ */ jsx(Icon2, { className: "h-4 w-4 text-primary" }) }),
|
|
2117
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
2118
|
+
/* @__PURE__ */ jsx("h2", { className: "truncate text-sm font-semibold text-foreground", children: title }),
|
|
2119
|
+
subtitle && /* @__PURE__ */ jsx("p", { className: "truncate text-xs leading-relaxed text-muted-foreground sm:text-sm sm:leading-normal", children: subtitle })
|
|
2120
|
+
] })
|
|
2121
|
+
]
|
|
2122
|
+
}
|
|
2123
|
+
),
|
|
2124
|
+
/* @__PURE__ */ jsxs(
|
|
2125
|
+
"div",
|
|
2126
|
+
{
|
|
2127
|
+
"data-slot": "page-header-controls",
|
|
2128
|
+
className: cn(
|
|
2129
|
+
"col-start-3 row-start-1 flex min-w-0 shrink-0 items-center justify-self-end gap-3",
|
|
2130
|
+
breakpointClasses.controls
|
|
2131
|
+
),
|
|
2132
|
+
children: [
|
|
2133
|
+
hasCompactActions && /* @__PURE__ */ jsx(
|
|
2134
|
+
"div",
|
|
2135
|
+
{
|
|
2136
|
+
"data-slot": "page-header-compact-actions",
|
|
2137
|
+
className: cn("flex items-center", breakpointClasses.compactActions),
|
|
2138
|
+
children: slottedCompactActions ? resolvedCompactActions : /* @__PURE__ */ jsx(NPageHeaderCompactActions, { children: resolvedCompactActions })
|
|
2139
|
+
}
|
|
2140
|
+
),
|
|
2141
|
+
/* @__PURE__ */ jsxs(
|
|
2142
|
+
"div",
|
|
2143
|
+
{
|
|
2144
|
+
"data-slot": "page-header-full-actions",
|
|
2145
|
+
className: cn(
|
|
2146
|
+
"shrink-0 items-center gap-3",
|
|
2147
|
+
hasCompactActions ? "hidden" : "flex",
|
|
2148
|
+
hasCompactActions && breakpointClasses.fullActions
|
|
2149
|
+
),
|
|
2150
|
+
children: [
|
|
2151
|
+
search && /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
2152
|
+
/* @__PURE__ */ jsx(Search, { size: 14, className: "absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none" }),
|
|
2153
|
+
/* @__PURE__ */ jsx(
|
|
2154
|
+
"input",
|
|
2155
|
+
{
|
|
2156
|
+
ref: search.ref,
|
|
2157
|
+
type: "text",
|
|
2158
|
+
value: searchValue,
|
|
2159
|
+
placeholder: search.placeholder ?? "Search...",
|
|
2160
|
+
className: cn(
|
|
2161
|
+
"h-9 w-full max-w-[280px] rounded-lg bg-background pl-9 pr-3 text-sm text-foreground placeholder:text-muted-foreground outline-none border border-border focus:border-primary focus:ring-1 focus:ring-primary/20 transition-colors",
|
|
2162
|
+
search.className
|
|
2163
|
+
),
|
|
2164
|
+
onChange: handleSearchChange
|
|
2165
|
+
}
|
|
2166
|
+
)
|
|
2167
|
+
] }),
|
|
2168
|
+
resolvedActions && (slottedActions ? resolvedActions : /* @__PURE__ */ jsx(NPageHeaderActions, { children: resolvedActions }))
|
|
2169
|
+
]
|
|
2170
|
+
}
|
|
2171
|
+
)
|
|
2172
|
+
]
|
|
2051
2173
|
}
|
|
2052
2174
|
)
|
|
2053
|
-
]
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
] }),
|
|
2175
|
+
]
|
|
2176
|
+
}
|
|
2177
|
+
),
|
|
2057
2178
|
resolvedFilters && (slottedFilters ? resolvedFilters : /* @__PURE__ */ jsx(NPageHeaderFilters, { children: resolvedFilters }))
|
|
2058
2179
|
]
|
|
2059
2180
|
}
|
|
@@ -10902,6 +11023,27 @@ function buildGroups(items) {
|
|
|
10902
11023
|
}
|
|
10903
11024
|
return groups;
|
|
10904
11025
|
}
|
|
11026
|
+
var autoCollapseQueries = {
|
|
11027
|
+
sm: "(min-width: 640px) and (max-width: 767.98px)",
|
|
11028
|
+
md: "(min-width: 768px) and (max-width: 1023.98px)",
|
|
11029
|
+
lg: "(min-width: 1024px) and (max-width: 1279.98px)",
|
|
11030
|
+
xl: "(min-width: 1280px) and (max-width: 1535.98px)"
|
|
11031
|
+
};
|
|
11032
|
+
function useAutoCollapsed(breakpoint) {
|
|
11033
|
+
const [matches, setMatches] = useState(false);
|
|
11034
|
+
useEffect(() => {
|
|
11035
|
+
if (!breakpoint || typeof window === "undefined") {
|
|
11036
|
+
setMatches(false);
|
|
11037
|
+
return;
|
|
11038
|
+
}
|
|
11039
|
+
const mediaQuery = window.matchMedia(autoCollapseQueries[breakpoint]);
|
|
11040
|
+
const update = () => setMatches(mediaQuery.matches);
|
|
11041
|
+
update();
|
|
11042
|
+
mediaQuery.addEventListener?.("change", update);
|
|
11043
|
+
return () => mediaQuery.removeEventListener?.("change", update);
|
|
11044
|
+
}, [breakpoint]);
|
|
11045
|
+
return matches;
|
|
11046
|
+
}
|
|
10905
11047
|
function NSidebar({
|
|
10906
11048
|
logo,
|
|
10907
11049
|
navItems = [],
|
|
@@ -10922,6 +11064,7 @@ function NSidebar({
|
|
|
10922
11064
|
className,
|
|
10923
11065
|
classNames,
|
|
10924
11066
|
mobileBreakpoint = "md",
|
|
11067
|
+
autoCollapseAt,
|
|
10925
11068
|
mobileOpen: mobileOpenProp,
|
|
10926
11069
|
defaultMobileOpen = false,
|
|
10927
11070
|
onMobileOpenChange,
|
|
@@ -10931,7 +11074,7 @@ function NSidebar({
|
|
|
10931
11074
|
collapseLabel = "Collapse",
|
|
10932
11075
|
expandLabel = "Expand",
|
|
10933
11076
|
hamburgerClassName,
|
|
10934
|
-
showHamburgerButton =
|
|
11077
|
+
showHamburgerButton = false,
|
|
10935
11078
|
logoIcon,
|
|
10936
11079
|
logoTitle,
|
|
10937
11080
|
logoSubtitle,
|
|
@@ -10948,6 +11091,8 @@ function NSidebar({
|
|
|
10948
11091
|
const isControlled = mobileOpenProp !== void 0;
|
|
10949
11092
|
const mobileOpen = isControlled ? mobileOpenProp : _mobileOpen;
|
|
10950
11093
|
const collapsed = collapsedProp ?? _collapsed;
|
|
11094
|
+
const autoCollapsed = useAutoCollapsed(autoCollapseAt);
|
|
11095
|
+
const desktopCollapsed = collapsed || autoCollapsed;
|
|
10951
11096
|
const setMobileOpen = (open) => {
|
|
10952
11097
|
if (!isControlled) _setMobileOpen(open);
|
|
10953
11098
|
onMobileOpenChange?.(open);
|
|
@@ -11008,21 +11153,23 @@ function NSidebar({
|
|
|
11008
11153
|
const mobileWidth = widths?.mobile ?? expandedWidth;
|
|
11009
11154
|
const railVar = typeof collapsedWidth === "number" ? `${collapsedWidth}px` : collapsedWidth;
|
|
11010
11155
|
const sidebarEdgeWidth = bordered === false ? "0px" : recipe?.borderWidth ?? "var(--border-width, 1px)";
|
|
11011
|
-
const showEdgeCollapse = showCollapseButton && collapseButtonPosition === "edge";
|
|
11012
|
-
const showRailCollapse = showCollapseButton && collapseButtonPosition === "rail";
|
|
11156
|
+
const showEdgeCollapse = showCollapseButton && collapseButtonPosition === "edge" && !autoCollapsed;
|
|
11157
|
+
const showRailCollapse = showCollapseButton && collapseButtonPosition === "rail" && !autoCollapsed;
|
|
11013
11158
|
const effectiveShowSectionLabels = showSectionLabels ?? recipe?.showSectionLabels ?? true;
|
|
11014
11159
|
const effectiveShowSectionSeparators = showSectionSeparators ?? recipe?.showSectionSeparators ?? false;
|
|
11015
11160
|
const contentSlot = recipe?.slots?.content;
|
|
11016
11161
|
const contentStyle = contentSlot?.paddingTop ? { paddingTop: contentSlot.paddingTop } : void 0;
|
|
11017
|
-
const
|
|
11018
|
-
const
|
|
11162
|
+
const desktopDefaultLogoContent = logoIcon || logoTitle || logoSubtitle ? /* @__PURE__ */ jsx(NSidebarLogo, { icon: logoIcon, title: logoTitle, subtitle: logoSubtitle, onClick: onLogoClick, collapsed: desktopCollapsed }) : null;
|
|
11163
|
+
const mobileDefaultLogoContent = logoIcon || logoTitle || logoSubtitle ? /* @__PURE__ */ jsx(NSidebarLogo, { icon: logoIcon, title: logoTitle, subtitle: logoSubtitle, onClick: onLogoClick, collapsed: false }) : null;
|
|
11164
|
+
const desktopHeaderContent = logo ?? desktopDefaultLogoContent;
|
|
11165
|
+
const mobileHeaderContent = logo ?? mobileDefaultLogoContent;
|
|
11019
11166
|
const contentProps = {
|
|
11020
11167
|
groups,
|
|
11021
11168
|
activePath,
|
|
11022
11169
|
isActive,
|
|
11023
11170
|
onNavigate: handleNavigate,
|
|
11024
11171
|
linkComponent,
|
|
11025
|
-
collapsed,
|
|
11172
|
+
collapsed: desktopCollapsed,
|
|
11026
11173
|
showSectionLabels: effectiveShowSectionLabels,
|
|
11027
11174
|
showSectionIcons,
|
|
11028
11175
|
showSectionSeparators: effectiveShowSectionSeparators,
|
|
@@ -11035,22 +11182,22 @@ function NSidebar({
|
|
|
11035
11182
|
settingsLabel,
|
|
11036
11183
|
onLogout,
|
|
11037
11184
|
logoutLabel,
|
|
11038
|
-
showCollapseButton: showCollapseButton && collapseButtonPosition === "footer",
|
|
11039
|
-
collapsed,
|
|
11185
|
+
showCollapseButton: showCollapseButton && collapseButtonPosition === "footer" && !autoCollapsed,
|
|
11186
|
+
collapsed: desktopCollapsed,
|
|
11040
11187
|
onToggleCollapsed: handleToggleCollapsed,
|
|
11041
11188
|
collapseLabel,
|
|
11042
11189
|
expandLabel,
|
|
11043
11190
|
classNames
|
|
11044
11191
|
};
|
|
11045
11192
|
const sidebarInner = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
11046
|
-
|
|
11193
|
+
desktopHeaderContent && /* @__PURE__ */ jsx(NSidebarHeader, { collapsed: desktopCollapsed, classNames, children: desktopHeaderContent }),
|
|
11047
11194
|
/* @__PURE__ */ jsx(NSidebarContent, { ...contentProps }),
|
|
11048
11195
|
/* @__PURE__ */ jsx(NSidebarFooter, { ...footerProps })
|
|
11049
11196
|
] });
|
|
11050
11197
|
const mobileInner = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
11051
|
-
|
|
11052
|
-
/* @__PURE__ */ jsx(NSidebarContent, { ...contentProps }),
|
|
11053
|
-
/* @__PURE__ */ jsx(NSidebarFooter, { ...footerProps, isMobile: true })
|
|
11198
|
+
mobileHeaderContent && /* @__PURE__ */ jsx(NSidebarHeader, { collapsed: false, classNames, children: mobileHeaderContent }),
|
|
11199
|
+
/* @__PURE__ */ jsx(NSidebarContent, { ...contentProps, collapsed: false }),
|
|
11200
|
+
/* @__PURE__ */ jsx(NSidebarFooter, { ...footerProps, collapsed: false, isMobile: true })
|
|
11054
11201
|
] });
|
|
11055
11202
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
11056
11203
|
/* @__PURE__ */ jsx(
|
|
@@ -11073,15 +11220,17 @@ function NSidebar({
|
|
|
11073
11220
|
"aside",
|
|
11074
11221
|
{
|
|
11075
11222
|
"data-bordered": bordered === false ? "false" : bordered ? "true" : void 0,
|
|
11223
|
+
"data-collapsed": desktopCollapsed ? "true" : "false",
|
|
11224
|
+
"data-auto-collapsed": autoCollapsed ? "true" : void 0,
|
|
11076
11225
|
className: cn(
|
|
11077
|
-
desktopClass,
|
|
11078
11226
|
"relative z-10 flex flex-col h-full bg-sidebar text-sidebar-foreground transition-all duration-200",
|
|
11227
|
+
desktopClass,
|
|
11079
11228
|
sidebarBorderClasses(bordered, "right"),
|
|
11080
11229
|
classNames?.sidebar,
|
|
11081
11230
|
className
|
|
11082
11231
|
),
|
|
11083
11232
|
style: {
|
|
11084
|
-
width:
|
|
11233
|
+
width: desktopCollapsed ? collapsedWidth : expandedWidth,
|
|
11085
11234
|
["--rail"]: railVar,
|
|
11086
11235
|
["--sidebar-edge-width"]: sidebarEdgeWidth,
|
|
11087
11236
|
...bordered !== false && recipe?.borderWidth ? { borderRightWidth: recipe.borderWidth } : {}
|
|
@@ -11092,8 +11241,8 @@ function NSidebar({
|
|
|
11092
11241
|
"button",
|
|
11093
11242
|
{
|
|
11094
11243
|
type: "button",
|
|
11095
|
-
"aria-label":
|
|
11096
|
-
title:
|
|
11244
|
+
"aria-label": desktopCollapsed ? expandLabel : collapseLabel,
|
|
11245
|
+
title: desktopCollapsed ? expandLabel : collapseLabel,
|
|
11097
11246
|
"data-dragging": railDragging ? "true" : void 0,
|
|
11098
11247
|
onPointerDown: handleRailPointerDown,
|
|
11099
11248
|
onClick: handleRailClick,
|
|
@@ -11112,7 +11261,7 @@ function NSidebar({
|
|
|
11112
11261
|
"aria-label": collapsed ? expandLabel : collapseLabel,
|
|
11113
11262
|
title: collapsed ? expandLabel : collapseLabel,
|
|
11114
11263
|
className: "absolute right-0 top-7 z-20 flex size-6 -translate-y-1/2 translate-x-1/2 cursor-pointer items-center justify-center rounded-full border border-sidebar-border bg-sidebar text-sidebar-foreground shadow-sm transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
|
|
11115
|
-
children:
|
|
11264
|
+
children: desktopCollapsed ? /* @__PURE__ */ jsx(ChevronRight, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ jsx(ChevronLeft, { className: "h-3.5 w-3.5" })
|
|
11116
11265
|
}
|
|
11117
11266
|
)
|
|
11118
11267
|
]
|
|
@@ -11386,4 +11535,4 @@ function NInspectorSheet({ open, onClose, title, children }) {
|
|
|
11386
11535
|
] }) });
|
|
11387
11536
|
}
|
|
11388
11537
|
|
|
11389
|
-
export { Alert, NCard as AsyncCard, Avatar, AvatarFallback, AvatarGroup, AvatarImage, AvatarStatus, Badge, BaseInput, Button, Calendar, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CheckboxGroupInput, CheckboxInput, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, ColorArrayInput, ColorPickerInput, Combobox, ComboboxInput, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, DateInput, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, DynamicArray_default as DynamicArray, EmojiInput, FileImportButton, FileInput, Form, FormControl, FormDescription, FormField, FormInput, FormItem, FormLabel, FormMessage, IconButton, ImageInput, Indicator, Input, Label, LangInput, MultiSelectInput, NAJM_COMPONENT_NAMES, NAlert, NAppShell, NCard as NAsyncCard, NAvatar, NBadge, NBulkActionsBar, NButton, NCard, NCardAction, NCardFooter, NCommandPalette, NConfirmDialog, NContextMenu, NDataCardShell, NDeleteDialog, NDeleteDialogContent, NDetailCard, NDetailItem, NDetailList, NDialog, NDialogDescription, NDialogHeader, NDialogPrimaryButton, NDialogSecondaryButton, NEditorTabs, NEmptyState, NErrorBoundary, NErrorState, NFileBrowser, NFileTypeIcon, NFilterBar, NFolderIcon, NForm, NFormSectionHeader, NIcon, NIndicator, NInspectorSheet, NLoadingState, NMultiDialog, NNavbar, NPageHeader, NPageHeaderActions, NPageHeaderFilters, NPageHeaderTop, NPageLayout, NPortalScopeProvider, NProgress, NRowActions, NSection, NSectionHeader, NSectionInfo, NSectionWithInfo, NSheet, NSidebar, NSidebarContent, NSidebarFooter, NSidebarHeader, NSidebarItem, NSidebarLogo, NSidebarMobile, NSidebarSection, NSkeleton, NSkeletonCalendar, NSkeletonChart, NSkeletonDonut, NSkeletonEventList, NSkeletonWidget, NSkeletonWidgets, NSlider, NSmartPasteDialog, NSpinner, NStatCard, NStatCardSkeleton, Swap as NSwap, NTable, NTableCardRoot, NTableCards, NTableContent, NTableHeader, NTableJson, NTableLoadingSkeleton, NTablePagination, NTableRowSkeleton, NTableSkeleton, NTabs, NUploader, NViewBody, NViewToggle, NajmDesignProvider, NajmScroll, NajmThemeProvider, NativeSelect, NumberInput, PasswordInput, PhoneInput, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PrefixProvider, Progress, RADIUS_VALUE_MAP, RadioGroup2 as RadioGroup, RadioGroupInput, RadioGroupItem, RepeatingFields, ScrollArea, SearchField, SearchField as SearchInput, SegmentedControl, Select, SelectContent, SelectGroup, SelectInput, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator3 as Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, SimpleTooltip, NSkeleton as Skeleton, Slider, SliderInput, StarRatingInput, StatusPill, StepIndicator, StepsHeader, StepsProgress, Swap, SwapIndeterminate, SwapOff, SwapOn, Switch, SwitchInput, TAB_COLORS, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, TableStoreContext, Tabs, TabsContent, TabsList, TabsTrigger, TextAreaInput, TextInput, Textarea, TimeInput, Toaster, Toggle, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, VariantProvider, WizardForm, alertVariants, avatarVariants, badgeColorVariants, badgeVariants, buildDefaultFileColumns, buttonVariants, cn, composePreset, createDialogStore, createTableStore, defineNajmDesignConfig, defineNajmThemeConfig, detectFormat, dialogVariants, formatColor, formatFileBytes, formatFileRelative, getIconColorProps, getNextEditorTabValue, indicatorVariants, inputBorderClasses, parseColor, parseNajmDesignConfig, parseNajmThemeConfig, resolvePreset, resolveRadiusValue, resolveSlot, resolveVariantAlias, sidebarBorderClasses, sliderVariants, stringifyNajmDesignConfig, stringifyNajmThemeConfig, surfaceBorderClasses, swapVariants, toPickerHex, toggleVariants, tooltipContentVariants, truncateByCharacters, useClickOutside, useContextMenu, useDebouncedValue, useDelayedLoading, useDialog, useDialogStore, useDynamicPageSize, useFormField, useFormSubmission, useInfiniteScroll, useKeyboard, useLocalStorageState, useNForm, useNPortalScope, useNajmAppearance, useNajmComponentStyle, useNajmDesign, usePrefix, useSelection, useStepNavigation, useStorageContextMenu, useStoreSync, useTable, useTableKeyboard, useTableStore, useVariant, useVariantPreset };
|
|
11538
|
+
export { Alert, NCard as AsyncCard, Avatar, AvatarFallback, AvatarGroup, AvatarImage, AvatarStatus, Badge, BaseInput, Button, Calendar, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CheckboxGroupInput, CheckboxInput, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, ColorArrayInput, ColorPickerInput, Combobox, ComboboxInput, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, DateInput, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, DynamicArray_default as DynamicArray, EmojiInput, FileImportButton, FileInput, Form, FormControl, FormDescription, FormField, FormInput, FormItem, FormLabel, FormMessage, IconButton, ImageInput, Indicator, Input, Label, LangInput, MultiSelectInput, NAJM_COMPONENT_NAMES, NAlert, NAppShell, NCard as NAsyncCard, NAvatar, NBadge, NBulkActionsBar, NButton, NCard, NCardAction, NCardFooter, NCommandPalette, NConfirmDialog, NContextMenu, NDataCardShell, NDeleteDialog, NDeleteDialogContent, NDetailCard, NDetailItem, NDetailList, NDialog, NDialogDescription, NDialogHeader, NDialogPrimaryButton, NDialogSecondaryButton, NEditorTabs, NEmptyState, NErrorBoundary, NErrorState, NFileBrowser, NFileTypeIcon, NFilterBar, NFolderIcon, NForm, NFormSectionHeader, NIcon, NIndicator, NInspectorSheet, NLoadingState, NMultiDialog, NNavbar, NPageHeader, NPageHeaderActions, NPageHeaderCompactActions, NPageHeaderFilters, NPageHeaderTop, NPageLayout, NPortalScopeProvider, NProgress, NRowActions, NSection, NSectionHeader, NSectionInfo, NSectionWithInfo, NSheet, NSidebar, NSidebarContent, NSidebarFooter, NSidebarHeader, NSidebarItem, NSidebarLogo, NSidebarMobile, NSidebarSection, NSkeleton, NSkeletonCalendar, NSkeletonChart, NSkeletonDonut, NSkeletonEventList, NSkeletonWidget, NSkeletonWidgets, NSlider, NSmartPasteDialog, NSpinner, NStatCard, NStatCardSkeleton, Swap as NSwap, NTable, NTableCardRoot, NTableCards, NTableContent, NTableHeader, NTableJson, NTableLoadingSkeleton, NTablePagination, NTableRowSkeleton, NTableSkeleton, NTabs, NUploader, NViewBody, NViewToggle, NajmDesignProvider, NajmScroll, NajmThemeProvider, NativeSelect, NumberInput, PasswordInput, PhoneInput, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PrefixProvider, Progress, RADIUS_VALUE_MAP, RadioGroup2 as RadioGroup, RadioGroupInput, RadioGroupItem, RepeatingFields, ScrollArea, SearchField, SearchField as SearchInput, SegmentedControl, Select, SelectContent, SelectGroup, SelectInput, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator3 as Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, SimpleTooltip, NSkeleton as Skeleton, Slider, SliderInput, StarRatingInput, StatusPill, StepIndicator, StepsHeader, StepsProgress, Swap, SwapIndeterminate, SwapOff, SwapOn, Switch, SwitchInput, TAB_COLORS, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, TableStoreContext, Tabs, TabsContent, TabsList, TabsTrigger, TextAreaInput, TextInput, Textarea, TimeInput, Toaster, Toggle, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, VariantProvider, WizardForm, alertVariants, avatarVariants, badgeColorVariants, badgeVariants, buildDefaultFileColumns, buttonVariants, cn, composePreset, createDialogStore, createTableStore, defineNajmDesignConfig, defineNajmThemeConfig, detectFormat, dialogVariants, formatColor, formatFileBytes, formatFileRelative, getIconColorProps, getNextEditorTabValue, indicatorVariants, inputBorderClasses, parseColor, parseNajmDesignConfig, parseNajmThemeConfig, resolvePreset, resolveRadiusValue, resolveSlot, resolveVariantAlias, sidebarBorderClasses, sliderVariants, stringifyNajmDesignConfig, stringifyNajmThemeConfig, surfaceBorderClasses, swapVariants, toPickerHex, toggleVariants, tooltipContentVariants, truncateByCharacters, useClickOutside, useContextMenu, useDebouncedValue, useDelayedLoading, useDialog, useDialogStore, useDynamicPageSize, useFormField, useFormSubmission, useInfiniteScroll, useKeyboard, useLocalStorageState, useNForm, useNPortalScope, useNajmAppearance, useNajmComponentStyle, useNajmDesign, usePrefix, useSelection, useStepNavigation, useStorageContextMenu, useStoreSync, useTable, useTableKeyboard, useTableStore, useVariant, useVariantPreset };
|