najm-kit 2.1.19 → 2.1.21

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 CHANGED
@@ -146,6 +146,13 @@ declare function composePreset(mode: NajmMode, accent: NajmAccent): NajmThemeTok
146
146
  declare function resolvePreset(preset: NajmPreset): NajmThemeTokens;
147
147
 
148
148
  type NajmDensity = "compact" | "default" | "comfortable";
149
+ /** Tailwind's mobile-first viewport breakpoints, plus the default value. */
150
+ type NajmResponsiveBreakpoint = "base" | "sm" | "md" | "lg" | "xl" | "2xl";
151
+ /**
152
+ * A scalar value for every viewport, or mobile-first breakpoint overrides.
153
+ * For example: `{ base: 164, lg: 200, xl: 240 }`.
154
+ */
155
+ type NajmResponsiveValue<T> = T | Partial<Record<NajmResponsiveBreakpoint, T>>;
149
156
  type NajmComponentRadius = "inherit" | "none" | "xs" | "sm" | "md" | "lg" | "xl" | "full" | string;
150
157
  interface NajmSlotStyle {
151
158
  className?: string;
@@ -167,10 +174,12 @@ interface NajmComponentStyleConfig {
167
174
  showSectionLabels?: boolean;
168
175
  /** Sidebar-only: render separator lines between nav item sections. */
169
176
  showSectionSeparators?: boolean;
170
- /** Sidebar-only: expanded width in px (default 240). */
171
- expandedWidth?: number;
172
- /** Sidebar-only: collapsed width in px (default 64). */
173
- collapsedWidth?: number;
177
+ /** Sidebar-only: expanded width in px (default 240). Supports responsive overrides. */
178
+ expandedWidth?: NajmResponsiveValue<number>;
179
+ /** Sidebar-only: collapsed width in px (default 64). Supports responsive overrides. */
180
+ collapsedWidth?: NajmResponsiveValue<number>;
181
+ /** Sidebar-only: mobile drawer width in px. Defaults to the expanded width. */
182
+ mobileWidth?: NajmResponsiveValue<number>;
174
183
  defaultVariant?: string;
175
184
  defaultSize?: string;
176
185
  density?: NajmDensity;
@@ -335,8 +344,8 @@ declare const NIcon: React__default.FC<NIconProps>;
335
344
 
336
345
  declare const buttonVariants: (props?: {
337
346
  variant?: "secondary" | "tertiary" | "destructive" | "default" | "link" | "outline" | "ghost" | "success" | "warning" | "info" | "soft" | "subtle" | "plain";
338
- size?: "default" | "icon" | "xs" | "sm" | "md" | "lg" | "xl" | "2xs" | "2xl" | "icon-xs" | "icon-sm" | "icon-lg" | "icon-xl";
339
- rounded?: "none" | "default" | "sm" | "md" | "lg" | "xl" | "full" | "2xl";
347
+ size?: "default" | "icon" | "sm" | "md" | "lg" | "xl" | "2xl" | "xs" | "2xs" | "icon-xs" | "icon-sm" | "icon-lg" | "icon-xl";
348
+ rounded?: "none" | "default" | "sm" | "md" | "lg" | "xl" | "2xl" | "full";
340
349
  fullWidth?: boolean;
341
350
  } & class_variance_authority_types.ClassProp) => string;
342
351
  type ButtonVariantProps = VariantProps<typeof buttonVariants>;
@@ -1044,7 +1053,7 @@ type AvatarSize = "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
1044
1053
  type AvatarShape$1 = "circle" | "rounded" | "square";
1045
1054
  type AvatarStatusType = "online" | "offline" | "busy" | "away";
1046
1055
  declare const avatarVariants: (props?: {
1047
- size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
1056
+ size?: "sm" | "md" | "lg" | "xl" | "2xl" | "xs";
1048
1057
  shape?: "square" | "circle" | "rounded";
1049
1058
  ring?: boolean;
1050
1059
  } & class_variance_authority_types.ClassProp) => string;
@@ -1317,15 +1326,33 @@ declare function NCardAction({ children }: {
1317
1326
  declare namespace NCardAction {
1318
1327
  var displayName: string;
1319
1328
  }
1320
- declare function NCardFooter({ children, className }: {
1329
+ declare function NCardFooter({ children }: {
1321
1330
  children: React__default.ReactNode;
1322
1331
  className?: string;
1323
1332
  }): react_jsx_runtime.JSX.Element;
1324
1333
  declare namespace NCardFooter {
1325
1334
  var displayName: string;
1326
1335
  }
1336
+ type NCardMediaVariant = "image" | "avatar" | "hero";
1337
+ type NCardMediaPlacement = "auto" | "side" | "header" | "top";
1338
+ type NCardMediaSize = "sm" | "md" | "lg" | "xl" | number;
1339
+ type NCardMediaAspect = "square" | "4/3" | "3/2" | "16/9";
1340
+ interface NCardMediaProps extends React__default.HTMLAttributes<HTMLDivElement> {
1341
+ variant?: NCardMediaVariant;
1342
+ /** `auto` uses side-to-top for images, side-to-header for avatars, and top for heroes. */
1343
+ placement?: NCardMediaPlacement;
1344
+ /** Side-media size. Presets are 72, 96, 112, and 128 pixels. */
1345
+ size?: NCardMediaSize;
1346
+ /** Hero aspect ratio. */
1347
+ aspect?: NCardMediaAspect;
1348
+ }
1349
+ declare function NCardMedia({ children }: NCardMediaProps): react_jsx_runtime.JSX.Element;
1350
+ declare namespace NCardMedia {
1351
+ var displayName: string;
1352
+ }
1327
1353
  interface CardClassNames {
1328
1354
  root?: string;
1355
+ media?: string;
1329
1356
  header?: string;
1330
1357
  icon?: string;
1331
1358
  title?: string;
@@ -1336,8 +1363,8 @@ interface CardClassNames {
1336
1363
  interface CardProps {
1337
1364
  children?: React__default.ReactNode;
1338
1365
  onClick?: () => void;
1339
- title?: string;
1340
- description?: string;
1366
+ title?: React__default.ReactNode;
1367
+ description?: React__default.ReactNode;
1341
1368
  icon?: NIconSource;
1342
1369
  iconColor?: string;
1343
1370
  loading?: boolean;
@@ -1353,12 +1380,36 @@ interface CardProps {
1353
1380
  noPadding?: boolean;
1354
1381
  separator?: boolean;
1355
1382
  bordered?: boolean;
1383
+ /** Remove the visual surface when NDataCardShell or another parent already owns it. */
1384
+ embedded?: boolean;
1356
1385
  className?: string;
1357
1386
  classNames?: CardClassNames;
1358
1387
  }
1359
- declare function NCard({ children, title, description, icon, iconColor, loading, error, empty, noData, loadingText, errorText, emptyText, noDataText, skeleton, onRetry, noPadding, separator, bordered, className, classNames, onClick, }: CardProps): react_jsx_runtime.JSX.Element;
1388
+ declare function NCard({ children, title, description, icon, iconColor, loading, error, empty, noData, loadingText, errorText, emptyText, noDataText, skeleton, onRetry, noPadding, separator, bordered, embedded, className, classNames, onClick, }: CardProps): react_jsx_runtime.JSX.Element;
1360
1389
 
1361
1390
  declare function truncateByCharacters(text: string, maxCharacters: number, suffix?: string): string;
1391
+ type NCardDensity = "default" | "compact" | "responsive";
1392
+ type NCardSectionSurface = "soft" | "plain" | "responsive";
1393
+ interface NCardInfoProps extends Omit<React__default.HTMLAttributes<HTMLDivElement>, "children"> {
1394
+ icon?: LucideIcon;
1395
+ label?: React__default.ReactNode;
1396
+ value: React__default.ReactNode;
1397
+ density?: NCardDensity;
1398
+ maxChars?: number;
1399
+ iconClassName?: string;
1400
+ labelClassName?: string;
1401
+ valueClassName?: string;
1402
+ }
1403
+ declare function NCardInfo({ icon: Icon, label, value, density, maxChars, iconClassName, labelClassName, valueClassName, className, ...props }: NCardInfoProps): react_jsx_runtime.JSX.Element;
1404
+ interface NCardSectionProps extends Omit<React__default.HTMLAttributes<HTMLDivElement>, "title"> {
1405
+ icon?: LucideIcon;
1406
+ title?: React__default.ReactNode;
1407
+ density?: NCardDensity;
1408
+ surface?: NCardSectionSurface;
1409
+ iconClassName?: string;
1410
+ titleClassName?: string;
1411
+ }
1412
+ declare function NCardSection({ icon: Icon, title, density, surface, iconClassName, titleClassName, children, className, ...props }: NCardSectionProps): react_jsx_runtime.JSX.Element;
1362
1413
  interface NSectionInfoProps {
1363
1414
  icon?: LucideIcon;
1364
1415
  label: string;
@@ -3210,10 +3261,11 @@ interface NAppShellClassNames {
3210
3261
  content?: string;
3211
3262
  overlay?: string;
3212
3263
  }
3264
+ type SidebarWidth = NajmResponsiveValue<number | string>;
3213
3265
  interface SidebarWidths {
3214
- expanded?: number | string;
3215
- collapsed?: number | string;
3216
- mobile?: number | string;
3266
+ expanded?: SidebarWidth;
3267
+ collapsed?: SidebarWidth;
3268
+ mobile?: SidebarWidth;
3217
3269
  }
3218
3270
  interface SidebarProps {
3219
3271
  logo?: ReactNode;
@@ -3508,4 +3560,4 @@ interface NGridItemProps extends Omit<React$1.AllHTMLAttributes<HTMLDivElement>,
3508
3560
  declare function NGrid({ as: Comp, children, cols, smCols, mdCols, lgCols, xlCols, gap, className, style, ...props }: NGridProps): react_jsx_runtime.JSX.Element;
3509
3561
  declare function NGridItem({ children, span, smSpan, mdSpan, lgSpan, xlSpan, className, ...props }: NGridItemProps): react_jsx_runtime.JSX.Element;
3510
3562
 
3511
- 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, NGrid, type NGridCols, NGridItem, type NGridItemProps, type NGridProps, type NGridSpan, 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 };
3563
+ 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, type NCardDensity, NCardFooter, NCardInfo, type NCardInfoProps, NCardMedia, type NCardMediaAspect, type NCardMediaPlacement, type NCardMediaProps, type NCardMediaSize, type NCardMediaVariant, type CardProps as NCardProps, NCardSection, type NCardSectionProps, type NCardSectionSurface, 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, NGrid, type NGridCols, NGridItem, type NGridItemProps, type NGridProps, type NGridSpan, 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, type NajmResponsiveBreakpoint, type NajmResponsiveValue, 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 SidebarWidth, 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, 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';
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, Filter, 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';
@@ -610,6 +610,7 @@ var COMPONENT_KEYS = /* @__PURE__ */ new Set([
610
610
  "showSectionSeparators",
611
611
  "expandedWidth",
612
612
  "collapsedWidth",
613
+ "mobileWidth",
613
614
  "defaultVariant",
614
615
  "defaultSize",
615
616
  "density",
@@ -626,6 +627,7 @@ var VARIANT_KEYS = /* @__PURE__ */ new Set(["use", "className", "tokens"]);
626
627
  var COMPONENT_NAME_SET = new Set(NAJM_COMPONENT_NAMES);
627
628
  var DENSITIES = /* @__PURE__ */ new Set(["compact", "default", "comfortable"]);
628
629
  var SCALES = /* @__PURE__ */ new Set(["compact", "default", "comfortable"]);
630
+ var RESPONSIVE_BREAKPOINTS = /* @__PURE__ */ new Set(["base", "sm", "md", "lg", "xl", "2xl"]);
629
631
  function isRecord2(value) {
630
632
  return typeof value === "object" && value !== null && !Array.isArray(value);
631
633
  }
@@ -647,12 +649,20 @@ function optionalBoolean(value, path) {
647
649
  }
648
650
  return value;
649
651
  }
650
- function optionalNumber(value, path) {
652
+ function optionalResponsiveNumber(value, path) {
651
653
  if (value === void 0) return void 0;
652
- if (typeof value !== "number") {
653
- throw new TypeError(`${path} must be a number`);
654
+ if (typeof value === "number") return value;
655
+ if (!isRecord2(value)) throw new TypeError(`${path} must be a number or breakpoint object`);
656
+ const unknown = Object.keys(value).find((key) => !RESPONSIVE_BREAKPOINTS.has(key));
657
+ if (unknown) throw new TypeError(`Unknown ${path} breakpoint: ${unknown}`);
658
+ const parsed = {};
659
+ for (const [breakpoint, width] of Object.entries(value)) {
660
+ if (typeof width !== "number") {
661
+ throw new TypeError(`${path}.${breakpoint} must be a number`);
662
+ }
663
+ parsed[breakpoint] = width;
654
664
  }
655
- return value;
665
+ return parsed;
656
666
  }
657
667
  function optionalEnum2(value, values, path) {
658
668
  if (value === void 0) return void 0;
@@ -714,8 +724,9 @@ function parseComponentStyle(value, path) {
714
724
  const card = optionalBoolean(value.card, `${path}.card`);
715
725
  const showSectionLabels = optionalBoolean(value.showSectionLabels, `${path}.showSectionLabels`);
716
726
  const showSectionSeparators = optionalBoolean(value.showSectionSeparators, `${path}.showSectionSeparators`);
717
- const expandedWidth = optionalNumber(value.expandedWidth, `${path}.expandedWidth`);
718
- const collapsedWidth = optionalNumber(value.collapsedWidth, `${path}.collapsedWidth`);
727
+ const expandedWidth = optionalResponsiveNumber(value.expandedWidth, `${path}.expandedWidth`);
728
+ const collapsedWidth = optionalResponsiveNumber(value.collapsedWidth, `${path}.collapsedWidth`);
729
+ const mobileWidth = optionalResponsiveNumber(value.mobileWidth, `${path}.mobileWidth`);
719
730
  const defaultVariant = optionalString2(value.defaultVariant, `${path}.defaultVariant`);
720
731
  const defaultSize = optionalString2(value.defaultSize, `${path}.defaultSize`);
721
732
  const density = optionalEnum2(value.density, DENSITIES, `${path}.density`);
@@ -729,6 +740,7 @@ function parseComponentStyle(value, path) {
729
740
  if (showSectionSeparators !== void 0) cfg.showSectionSeparators = showSectionSeparators;
730
741
  if (expandedWidth !== void 0) cfg.expandedWidth = expandedWidth;
731
742
  if (collapsedWidth !== void 0) cfg.collapsedWidth = collapsedWidth;
743
+ if (mobileWidth !== void 0) cfg.mobileWidth = mobileWidth;
732
744
  if (defaultVariant !== void 0) cfg.defaultVariant = defaultVariant;
733
745
  if (defaultSize !== void 0) cfg.defaultSize = defaultSize;
734
746
  if (density !== void 0) cfg.density = density;
@@ -1987,7 +1999,7 @@ var IconButton = React.forwardRef(
1987
1999
  );
1988
2000
  IconButton.displayName = "IconButton";
1989
2001
  function NPageHeaderActions({ children, className }) {
1990
- return /* @__PURE__ */ jsx("div", { className: cn("flex shrink-0 items-center gap-2 sm:gap-3", className), children });
2002
+ return /* @__PURE__ */ jsx("div", { className: cn("flex shrink-0 items-center gap-0 lg:gap-1 xl:gap-2 2xl:gap-2", className), children });
1991
2003
  }
1992
2004
  NPageHeaderActions.displayName = "NPageHeaderActions";
1993
2005
  function NPageHeaderCompactActions({ children, className }) {
@@ -5037,10 +5049,49 @@ function NCardAction({ children }) {
5037
5049
  return /* @__PURE__ */ jsx(Fragment, { children });
5038
5050
  }
5039
5051
  NCardAction.displayName = "NCardAction";
5040
- function NCardFooter({ children, className }) {
5052
+ function NCardFooter({ children }) {
5041
5053
  return /* @__PURE__ */ jsx(Fragment, { children });
5042
5054
  }
5043
5055
  NCardFooter.displayName = "NCardFooter";
5056
+ function NCardMedia({ children }) {
5057
+ return /* @__PURE__ */ jsx(Fragment, { children });
5058
+ }
5059
+ NCardMedia.displayName = "NCardMedia";
5060
+ var CARD_MEDIA_SIZE = {
5061
+ sm: 72,
5062
+ md: 96,
5063
+ lg: 112,
5064
+ xl: 128
5065
+ };
5066
+ var CARD_MEDIA_ASPECT = {
5067
+ square: "aspect-square",
5068
+ "4/3": "aspect-[4/3]",
5069
+ "3/2": "aspect-[3/2]",
5070
+ "16/9": "aspect-video"
5071
+ };
5072
+ function resolveMediaLayout(variant, placement) {
5073
+ if (placement !== "auto") return placement;
5074
+ if (variant === "hero") return "top";
5075
+ return variant === "avatar" ? "responsive-avatar" : "responsive-image";
5076
+ }
5077
+ function getMediaHtmlProps(props) {
5078
+ const htmlProps = { ...props };
5079
+ delete htmlProps.children;
5080
+ delete htmlProps.variant;
5081
+ delete htmlProps.placement;
5082
+ delete htmlProps.size;
5083
+ delete htmlProps.aspect;
5084
+ return htmlProps;
5085
+ }
5086
+ function mediaRootClasses(layout) {
5087
+ if (layout === "top") return "flex flex-col gap-0 overflow-hidden p-0";
5088
+ if (layout === "side") return "grid grid-cols-[auto_minmax(0,1fr)] gap-3 p-3";
5089
+ if (layout === "header") return "grid grid-cols-[auto_minmax(0,1fr)] gap-3 p-3";
5090
+ if (layout === "responsive-avatar") {
5091
+ return "grid grid-cols-[auto_minmax(0,1fr)] gap-3 p-3 sm:p-4";
5092
+ }
5093
+ return "grid grid-cols-[auto_minmax(0,1fr)] gap-3 p-3 sm:flex sm:flex-col sm:p-4";
5094
+ }
5044
5095
  function NCard({
5045
5096
  children,
5046
5097
  title,
@@ -5060,6 +5111,7 @@ function NCard({
5060
5111
  noPadding = false,
5061
5112
  separator = false,
5062
5113
  bordered,
5114
+ embedded = false,
5063
5115
  className,
5064
5116
  classNames,
5065
5117
  onClick
@@ -5068,61 +5120,183 @@ function NCard({
5068
5120
  const resolvedEmptyText = emptyText ?? noDataText ?? "No data available";
5069
5121
  const recipe = useNajmComponentStyle("card");
5070
5122
  const recipeRadius = resolveRadiusValue(recipe?.radius);
5071
- const recipeStyle = recipeRadius || recipe?.borderWidth ? {
5123
+ const recipeStyle = !embedded && (recipeRadius || recipe?.borderWidth) ? {
5072
5124
  ...recipeRadius ? { borderRadius: recipeRadius } : {},
5073
5125
  ...recipe?.borderWidth ? { borderWidth: recipe.borderWidth } : {}
5074
5126
  } : void 0;
5075
5127
  let actionSlot = null;
5076
5128
  let footerSlot = null;
5129
+ let footerClassName;
5130
+ let mediaSlot = null;
5077
5131
  const mainChildren = [];
5078
5132
  React__default.Children.forEach(children, (child) => {
5079
- if (React__default.isValidElement(child)) {
5080
- if (child.type === NCardAction) {
5081
- actionSlot = child;
5082
- } else if (child.type === NCardFooter) {
5083
- footerSlot = child;
5084
- } else {
5085
- mainChildren.push(child);
5086
- }
5133
+ if (!React__default.isValidElement(child)) {
5134
+ mainChildren.push(child);
5135
+ return;
5136
+ }
5137
+ if (child.type === NCardAction) {
5138
+ actionSlot = child.props.children;
5139
+ } else if (child.type === NCardFooter) {
5140
+ const footer = child.props;
5141
+ footerSlot = footer.children;
5142
+ footerClassName = footer.className;
5143
+ } else if (child.type === NCardMedia) {
5144
+ mediaSlot = child;
5087
5145
  } else {
5088
5146
  mainChildren.push(child);
5089
5147
  }
5090
5148
  });
5091
- const hasHeader = !!(title || description || actionSlot);
5149
+ const mediaVariant = mediaSlot?.props.variant ?? "image";
5150
+ const mediaPlacement = mediaSlot?.props.placement ?? "auto";
5151
+ const mediaLayout = mediaSlot ? resolveMediaLayout(mediaVariant, mediaPlacement) : null;
5152
+ const mediaSize = mediaSlot?.props.size ?? "md";
5153
+ const resolvedMediaSize = typeof mediaSize === "number" ? mediaSize : CARD_MEDIA_SIZE[mediaSize];
5154
+ const mediaAspect = mediaSlot?.props.aspect ?? "4/3";
5155
+ const mediaHtmlProps = mediaSlot ? getMediaHtmlProps(mediaSlot.props) : {};
5156
+ const hasHeader = Boolean(title || description || actionSlot);
5092
5157
  const iconSize = description ? "h-6 w-6 lg:h-8 lg:w-8" : "h-4 w-4 lg:h-5 lg:w-5";
5158
+ const mediaStyle = mediaSlot ? {
5159
+ ...mediaSlot.props.style,
5160
+ "--n-card-media-size": `${resolvedMediaSize}px`
5161
+ } : void 0;
5162
+ const sideBody = mediaLayout === "side";
5163
+ const headerBody = mediaLayout === "header";
5164
+ const responsiveAvatarBody = mediaLayout === "responsive-avatar";
5165
+ const responsiveImageBody = mediaLayout === "responsive-image";
5166
+ const topBody = mediaLayout === "top";
5167
+ const compactSideBody = sideBody || responsiveAvatarBody || responsiveImageBody;
5093
5168
  return /* @__PURE__ */ jsxs(
5094
5169
  Card,
5095
5170
  {
5096
- "data-bordered": bordered === false ? "false" : bordered ? "true" : void 0,
5171
+ "data-bordered": embedded || bordered === false ? "false" : bordered ? "true" : void 0,
5172
+ "data-embedded": embedded ? "true" : void 0,
5173
+ "data-media-layout": mediaLayout ?? void 0,
5174
+ "data-media-variant": mediaSlot ? mediaVariant : void 0,
5097
5175
  onClick,
5098
5176
  style: recipeStyle,
5099
5177
  className: cn(
5100
- "flex flex-col",
5101
- !noPadding && "p-2 lg:p-3 xl:p-4 2xl:p-5 gap-3",
5102
- surfaceBorderClasses(bordered),
5178
+ mediaLayout ? mediaRootClasses(mediaLayout) : "flex flex-col",
5179
+ !mediaLayout && !noPadding && "p-2 lg:p-3 xl:p-4 2xl:p-5 gap-3",
5180
+ mediaLayout && noPadding && "p-0",
5181
+ embedded && "rounded-none bg-transparent shadow-none",
5182
+ surfaceBorderClasses(embedded ? false : bordered),
5103
5183
  classNames?.root,
5104
5184
  className
5105
5185
  ),
5106
5186
  children: [
5107
- hasHeader && /* @__PURE__ */ jsxs(CardHeader, { className: cn("flex flex-row items-center justify-between space-y-0 p-0", classNames?.header), children: [
5108
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 min-w-0", children: [
5109
- icon && /* @__PURE__ */ jsx(NIcon, { icon, className: cn(iconSize, "shrink-0 text-muted-foreground", iconColor, classNames?.icon) }),
5110
- /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
5111
- title && /* @__PURE__ */ jsx(CardTitle, { className: cn("text-sm lg:text-base leading-snug", classNames?.title), children: title }),
5112
- description && /* @__PURE__ */ jsx(CardDescription, { className: cn("text-xs mt-0.5", classNames?.description), children: description })
5113
- ] })
5114
- ] }),
5115
- actionSlot && /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2 shrink-0 ml-2", children: actionSlot })
5116
- ] }),
5117
- hasHeader && separator && /* @__PURE__ */ jsx("div", { className: "border-t border-border" }),
5118
- /* @__PURE__ */ jsx(CardContent, { className: cn("flex flex-col flex-1 m-0 p-0", classNames?.content), children: loading && skeleton ? skeleton : loading ? /* @__PURE__ */ jsx(NLoadingState, { label: loadingText }) : error ? /* @__PURE__ */ jsx(
5119
- NErrorState,
5187
+ mediaSlot ? /* @__PURE__ */ jsx(
5188
+ "div",
5189
+ {
5190
+ ...mediaHtmlProps,
5191
+ "data-slot": "card-media",
5192
+ "data-placement": mediaPlacement,
5193
+ "data-variant": mediaVariant,
5194
+ "data-size": mediaSize,
5195
+ style: mediaStyle,
5196
+ className: cn(
5197
+ mediaVariant !== "avatar" && "relative overflow-hidden bg-muted",
5198
+ mediaVariant === "image" && "col-start-1 row-start-1 size-[var(--n-card-media-size)] self-start rounded-lg",
5199
+ mediaVariant === "image" && responsiveImageBody && "sm:h-40 sm:w-full sm:shrink-0",
5200
+ mediaVariant === "avatar" && "col-start-1 row-start-1 flex w-[var(--n-card-media-size)] items-start justify-center",
5201
+ mediaVariant === "avatar" && (headerBody || responsiveAvatarBody || topBody) && "sm:justify-start",
5202
+ mediaVariant === "hero" && cn("w-full", CARD_MEDIA_ASPECT[mediaAspect]),
5203
+ mediaLayout === "top" && mediaVariant === "image" && "h-40 w-full rounded-none",
5204
+ classNames?.media,
5205
+ mediaSlot.props.className
5206
+ ),
5207
+ children: mediaSlot.props.children
5208
+ }
5209
+ ) : null,
5210
+ /* @__PURE__ */ jsxs(
5211
+ "div",
5120
5212
  {
5121
- message: typeof error === "string" ? error : errorText ?? "Something went wrong",
5122
- onRetry
5213
+ "data-slot": "card-body",
5214
+ className: cn(
5215
+ compactSideBody ? "col-start-2 row-start-1 flex min-w-0 flex-col gap-2 self-start" : "contents",
5216
+ (responsiveAvatarBody || responsiveImageBody) && "sm:contents"
5217
+ ),
5218
+ children: [
5219
+ hasHeader ? /* @__PURE__ */ jsxs(
5220
+ CardHeader,
5221
+ {
5222
+ className: cn(
5223
+ "flex min-w-0 flex-row items-center justify-between space-y-0 p-0",
5224
+ mediaLayout && "col-start-2 row-start-1",
5225
+ responsiveImageBody && "sm:col-auto sm:row-auto",
5226
+ topBody && "p-4 pb-0",
5227
+ classNames?.header
5228
+ ),
5229
+ children: [
5230
+ /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [
5231
+ icon ? /* @__PURE__ */ jsx(
5232
+ NIcon,
5233
+ {
5234
+ icon,
5235
+ className: cn(iconSize, "shrink-0 text-muted-foreground", iconColor, classNames?.icon)
5236
+ }
5237
+ ) : null,
5238
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
5239
+ title ? /* @__PURE__ */ jsx(CardTitle, { className: cn("truncate text-sm leading-snug lg:text-base", classNames?.title), children: title }) : null,
5240
+ description ? /* @__PURE__ */ jsx(CardDescription, { className: cn("mt-0.5 text-xs", classNames?.description), children: description }) : null
5241
+ ] })
5242
+ ] }),
5243
+ actionSlot ? /* @__PURE__ */ jsx("div", { className: "ml-2 flex shrink-0 items-center gap-2", children: actionSlot }) : null
5244
+ ]
5245
+ }
5246
+ ) : null,
5247
+ hasHeader && separator ? /* @__PURE__ */ jsx(
5248
+ "div",
5249
+ {
5250
+ className: cn(
5251
+ "border-t border-border",
5252
+ sideBody && "col-start-2",
5253
+ headerBody && "col-span-full",
5254
+ responsiveAvatarBody && "col-start-2 sm:col-span-full",
5255
+ responsiveImageBody && "col-start-2 sm:col-auto",
5256
+ topBody && "mx-4"
5257
+ )
5258
+ }
5259
+ ) : null,
5260
+ /* @__PURE__ */ jsx(
5261
+ CardContent,
5262
+ {
5263
+ className: cn(
5264
+ "m-0 flex min-w-0 flex-1 flex-col gap-2 p-0",
5265
+ sideBody && "col-start-2",
5266
+ headerBody && "col-span-full",
5267
+ responsiveAvatarBody && "col-start-2 sm:col-span-full",
5268
+ responsiveImageBody && "col-start-2 sm:col-auto",
5269
+ topBody && "p-4",
5270
+ classNames?.content
5271
+ ),
5272
+ children: loading && skeleton ? skeleton : loading ? /* @__PURE__ */ jsx(NLoadingState, { label: loadingText }) : error ? /* @__PURE__ */ jsx(
5273
+ NErrorState,
5274
+ {
5275
+ message: typeof error === "string" ? error : errorText ?? "Something went wrong",
5276
+ onRetry
5277
+ }
5278
+ ) : isEmpty ? /* @__PURE__ */ jsx(NEmptyState, { title: resolvedEmptyText }) : mainChildren
5279
+ }
5280
+ ),
5281
+ footerSlot ? /* @__PURE__ */ jsx(
5282
+ CardFooter,
5283
+ {
5284
+ className: cn(
5285
+ "mt-auto p-0 pt-3",
5286
+ sideBody && "col-start-2",
5287
+ headerBody && "col-span-full",
5288
+ responsiveAvatarBody && "col-start-2 sm:col-span-full",
5289
+ responsiveImageBody && "col-start-2 sm:col-auto",
5290
+ topBody && "border-t border-border p-4",
5291
+ classNames?.footer,
5292
+ footerClassName
5293
+ ),
5294
+ children: footerSlot
5295
+ }
5296
+ ) : null
5297
+ ]
5123
5298
  }
5124
- ) : isEmpty ? /* @__PURE__ */ jsx(NEmptyState, { title: resolvedEmptyText }) : mainChildren }),
5125
- footerSlot && /* @__PURE__ */ jsx(CardFooter, { className: cn("p-0 pt-3 border-t border-border mt-auto", classNames?.footer), children: footerSlot })
5299
+ )
5126
5300
  ]
5127
5301
  }
5128
5302
  );
@@ -5132,6 +5306,115 @@ function truncateByCharacters(text, maxCharacters, suffix = "...") {
5132
5306
  const str = String(text);
5133
5307
  return str.length <= maxCharacters ? str : str.slice(0, maxCharacters) + suffix;
5134
5308
  }
5309
+ var CardDensityContext = React__default.createContext("default");
5310
+ function NCardInfo({
5311
+ icon: Icon2,
5312
+ label,
5313
+ value,
5314
+ density,
5315
+ maxChars = 30,
5316
+ iconClassName,
5317
+ labelClassName,
5318
+ valueClassName,
5319
+ className,
5320
+ ...props
5321
+ }) {
5322
+ const inheritedDensity = React__default.useContext(CardDensityContext);
5323
+ const resolvedDensity = density ?? inheritedDensity;
5324
+ const isTruncated = typeof value === "string" && value.length > maxChars;
5325
+ const displayValue = isTruncated ? truncateByCharacters(value, maxChars) : value;
5326
+ const valueNode = /* @__PURE__ */ jsx(
5327
+ "span",
5328
+ {
5329
+ "data-slot": "card-info-value",
5330
+ className: cn("min-w-0 truncate text-foreground", isTruncated && "cursor-help", valueClassName),
5331
+ children: displayValue
5332
+ }
5333
+ );
5334
+ return /* @__PURE__ */ jsxs(
5335
+ "div",
5336
+ {
5337
+ "data-slot": "card-info",
5338
+ "data-density": resolvedDensity,
5339
+ className: cn(
5340
+ "flex min-w-0 items-center",
5341
+ resolvedDensity === "default" && "gap-2 text-sm",
5342
+ resolvedDensity === "compact" && "gap-1.5 text-xs",
5343
+ resolvedDensity === "responsive" && "gap-1.5 text-xs sm:gap-2 sm:text-sm",
5344
+ className
5345
+ ),
5346
+ ...props,
5347
+ children: [
5348
+ Icon2 ? /* @__PURE__ */ jsx(
5349
+ Icon2,
5350
+ {
5351
+ "aria-hidden": "true",
5352
+ "data-slot": "card-info-icon",
5353
+ className: cn(
5354
+ "shrink-0 text-muted-foreground",
5355
+ resolvedDensity === "default" && "size-4",
5356
+ resolvedDensity === "compact" && "size-3.5",
5357
+ resolvedDensity === "responsive" && "size-3.5 sm:size-4",
5358
+ iconClassName
5359
+ )
5360
+ }
5361
+ ) : null,
5362
+ label ? /* @__PURE__ */ jsxs(
5363
+ "span",
5364
+ {
5365
+ "data-slot": "card-info-label",
5366
+ className: cn("shrink-0 text-muted-foreground", labelClassName),
5367
+ children: [
5368
+ label,
5369
+ ":"
5370
+ ]
5371
+ }
5372
+ ) : null,
5373
+ isTruncated ? /* @__PURE__ */ jsxs(Tooltip, { children: [
5374
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: valueNode }),
5375
+ /* @__PURE__ */ jsx(TooltipContent, { children: /* @__PURE__ */ jsx("p", { className: "max-w-xs", children: value }) })
5376
+ ] }) : valueNode
5377
+ ]
5378
+ }
5379
+ );
5380
+ }
5381
+ function NCardSection({
5382
+ icon: Icon2,
5383
+ title,
5384
+ density = "responsive",
5385
+ surface = "responsive",
5386
+ iconClassName,
5387
+ titleClassName,
5388
+ children,
5389
+ className,
5390
+ ...props
5391
+ }) {
5392
+ return /* @__PURE__ */ jsx(CardDensityContext.Provider, { value: density, children: /* @__PURE__ */ jsxs(
5393
+ "div",
5394
+ {
5395
+ "data-slot": "card-section",
5396
+ "data-density": density,
5397
+ "data-surface": surface,
5398
+ className: cn(
5399
+ density === "default" && "space-y-2",
5400
+ density === "compact" && "space-y-1",
5401
+ density === "responsive" && "space-y-1 sm:space-y-2",
5402
+ surface === "soft" && "rounded-lg bg-muted/50 p-3",
5403
+ surface === "plain" && "bg-transparent p-0",
5404
+ surface === "responsive" && "bg-transparent p-0 sm:rounded-lg sm:bg-muted/50 sm:p-3",
5405
+ className
5406
+ ),
5407
+ ...props,
5408
+ children: [
5409
+ Icon2 || title ? /* @__PURE__ */ jsxs("div", { className: "mb-2 flex items-center gap-2", children: [
5410
+ Icon2 ? /* @__PURE__ */ jsx(Icon2, { "aria-hidden": "true", className: cn("size-4 text-muted-foreground", iconClassName) }) : null,
5411
+ title ? /* @__PURE__ */ jsx("div", { className: cn("text-sm font-medium text-foreground", titleClassName), children: title }) : null
5412
+ ] }) : null,
5413
+ children
5414
+ ]
5415
+ }
5416
+ ) });
5417
+ }
5135
5418
  function NSectionInfo({
5136
5419
  icon: Icon2,
5137
5420
  label = "",
@@ -5311,13 +5594,13 @@ function DefaultCard({
5311
5594
  "div",
5312
5595
  {
5313
5596
  className: cn(
5314
- "flex h-8 w-8 lg:h-9 lg:w-9 shrink-0 items-center justify-center rounded-xl bg-primary/10 text-primary transition-colors group-hover:bg-primary/20",
5597
+ "flex h-8 w-8 lg:h-9 lg:w-9 2xl:h-10 2xl:w-10 shrink-0 items-center justify-center rounded-xl bg-primary/10 text-primary transition-colors group-hover:bg-primary/20",
5315
5598
  classNames?.icon
5316
5599
  ),
5317
5600
  children: /* @__PURE__ */ jsx(NIcon, { icon, className: "w-4 h-4 lg:w-5 lg:h-5 2xl:w-6 2xl:h-6" })
5318
5601
  }
5319
5602
  ),
5320
- /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
5603
+ /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-0 2xl:gap-1", children: [
5321
5604
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2", children: [
5322
5605
  label && /* @__PURE__ */ jsx("p", { className: cn("truncate text-xs text-muted-foreground", classNames?.label), children: label }),
5323
5606
  change && /* @__PURE__ */ jsxs(
@@ -9695,12 +9978,12 @@ function SearchFilter({ placeholder }) {
9695
9978
  const value = table.getState().globalFilter ?? "";
9696
9979
  return /* @__PURE__ */ jsx(TextInput, { icon: Search, value, onChange: (v) => table.setGlobalFilter(v), placeholder: placeholder ?? "Search\u2026", bordered });
9697
9980
  }
9698
- function TextFilter({ name, placeholder }) {
9981
+ function TextFilter({ name, placeholder, icon }) {
9699
9982
  const table = useTableStore.use.table();
9700
9983
  const bordered = useTableStore.use.bordered();
9701
9984
  const column = table?.getColumn?.(name);
9702
9985
  if (!column) return null;
9703
- return /* @__PURE__ */ jsx(TextInput, { value: column.getFilterValue() ?? "", onChange: (value) => column.setFilterValue(value), placeholder, bordered });
9986
+ return /* @__PURE__ */ jsx(TextInput, { icon, value: column.getFilterValue() ?? "", onChange: (value) => column.setFilterValue(value), placeholder, bordered });
9704
9987
  }
9705
9988
  function SelectFilter({ name, options, placeholder, inputType }) {
9706
9989
  const table = useTableStore.use.table();
@@ -9714,7 +9997,7 @@ function SelectFilter({ name, options, placeholder, inputType }) {
9714
9997
  function defaultWrapperClass(filter) {
9715
9998
  return filter.type === "search" ? "flex-1 min-w-[160px] max-w-sm" : "w-full sm:w-40 xl:w-56 shrink-0";
9716
9999
  }
9717
- function RenderFilter({ filter }) {
10000
+ function RenderFilter({ filter, mobilePrimary = false }) {
9718
10001
  const table = useTableStore.use.table();
9719
10002
  const bordered = useTableStore.use.bordered();
9720
10003
  if (filter.type === "search") {
@@ -9737,6 +10020,7 @@ function RenderFilter({ filter }) {
9737
10020
  return /* @__PURE__ */ jsx(
9738
10021
  TextInput,
9739
10022
  {
10023
+ icon: mobilePrimary ? Search : void 0,
9740
10024
  value: filter.value ?? "",
9741
10025
  onChange: filter.onChange,
9742
10026
  placeholder: filter.placeholder,
@@ -9779,7 +10063,7 @@ function RenderFilter({ filter }) {
9779
10063
  );
9780
10064
  }
9781
10065
  if (filter.type === "text") {
9782
- return /* @__PURE__ */ jsx(TextFilter, { name: filter.name, placeholder: filter.placeholder });
10066
+ return /* @__PURE__ */ jsx(TextFilter, { name: filter.name, placeholder: filter.placeholder, icon: mobilePrimary ? Search : void 0 });
9783
10067
  }
9784
10068
  if (!table) return null;
9785
10069
  return /* @__PURE__ */ jsx(SelectFilter, { name: filter.name, options: filter.options || [], placeholder: filter.placeholder, inputType: filter.type });
@@ -9787,7 +10071,7 @@ function RenderFilter({ filter }) {
9787
10071
  function TableFilters() {
9788
10072
  const filters = useTableStore.use.filters();
9789
10073
  if (!filters?.length) return null;
9790
- return /* @__PURE__ */ jsx("div", { className: "flex flex-wrap items-center gap-2 flex-1 min-w-0", children: filters.map((filter) => /* @__PURE__ */ jsx(
10074
+ return /* @__PURE__ */ jsx("div", { "data-ntable-desktop-filters": true, className: "hidden flex-1 min-w-0 flex-wrap items-center gap-2 md:flex", children: filters.map((filter) => /* @__PURE__ */ jsx(
9791
10075
  "div",
9792
10076
  {
9793
10077
  className: cn(defaultWrapperClass(filter), filter.className),
@@ -9796,7 +10080,7 @@ function TableFilters() {
9796
10080
  filter.name
9797
10081
  )) });
9798
10082
  }
9799
- function TableAddButton() {
10083
+ function TableAddButton({ mobile = false }) {
9800
10084
  const onAddClick = useTableStore.use.onAddClick();
9801
10085
  const showAddButton = useTableStore.use.showAddButton();
9802
10086
  const addButtonText = useTableStore.use.addButtonText();
@@ -9804,7 +10088,7 @@ function TableAddButton() {
9804
10088
  const headerTextColor = useTableStore.use.headerTextColor();
9805
10089
  const bordered = useTableStore.use.bordered();
9806
10090
  if (!showAddButton) return null;
9807
- const btnStyle = {
10091
+ const btnStyle = mobile ? { color: resolveTableColor(headerColor, DEFAULT_TABLE_HEADER_COLOR) } : {
9808
10092
  backgroundColor: resolveTableColor(headerColor, DEFAULT_TABLE_HEADER_COLOR),
9809
10093
  color: resolveTableColor(headerTextColor, DEFAULT_TABLE_HEADER_TEXT_COLOR)
9810
10094
  };
@@ -9817,12 +10101,53 @@ function TableAddButton() {
9817
10101
  style: btnStyle,
9818
10102
  "aria-label": addButtonText || "Create",
9819
10103
  title: addButtonText || "Create",
9820
- "data-bordered": bordered ? "true" : void 0,
9821
- className: `h-10 w-10 shrink-0 cursor-pointer flex items-center justify-center rounded-lg transition-opacity hover:opacity-90 ${borderedCls}`,
10104
+ "data-bordered": bordered === false ? "false" : "true",
10105
+ className: cn(
10106
+ "h-10 w-10 shrink-0 cursor-pointer items-center justify-center rounded-lg transition-colors hover:opacity-90",
10107
+ mobile ? cn("flex bg-card md:hidden", bordered === false ? "shadow-sm" : "border border-input hover:border-primary/70") : `hidden md:flex ${borderedCls}`
10108
+ ),
9822
10109
  children: /* @__PURE__ */ jsx(Plus, { className: "h-5 w-5" })
9823
10110
  }
9824
10111
  );
9825
10112
  }
10113
+ function MobileFiltersMenu({ filters }) {
10114
+ const bordered = useTableStore.use.bordered();
10115
+ if (!filters.length) return null;
10116
+ return /* @__PURE__ */ jsxs(Popover, { children: [
10117
+ /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
10118
+ "button",
10119
+ {
10120
+ type: "button",
10121
+ "aria-label": "Filters",
10122
+ title: "Filters",
10123
+ "data-bordered": bordered === false ? "false" : "true",
10124
+ className: cn(
10125
+ "flex h-10 w-10 shrink-0 cursor-pointer items-center justify-center rounded-lg bg-card text-primary transition-colors hover:border-primary/70",
10126
+ bordered === false ? "shadow-sm" : "border border-input"
10127
+ ),
10128
+ children: /* @__PURE__ */ jsx(Filter, { className: "h-5 w-5" })
10129
+ }
10130
+ ) }),
10131
+ /* @__PURE__ */ jsx(
10132
+ PopoverContent,
10133
+ {
10134
+ align: "end",
10135
+ "aria-label": "Table filters",
10136
+ className: "w-[min(20rem,calc(100vw-2rem))] space-y-3 bg-card p-3",
10137
+ children: filters.map((filter) => /* @__PURE__ */ jsx("div", { className: "w-full", children: /* @__PURE__ */ jsx(RenderFilter, { filter }) }, filter.name))
10138
+ }
10139
+ )
10140
+ ] });
10141
+ }
10142
+ function TableMobileToolbar() {
10143
+ const filters = useTableStore.use.filters();
10144
+ const firstFilter = filters?.[0];
10145
+ return /* @__PURE__ */ jsxs("div", { "data-ntable-mobile-toolbar": true, className: "flex w-full min-w-0 items-center gap-2 md:hidden", children: [
10146
+ firstFilter && /* @__PURE__ */ jsx("div", { "data-ntable-mobile-primary-filter": true, className: "min-w-0 flex-1", children: /* @__PURE__ */ jsx(RenderFilter, { filter: firstFilter, mobilePrimary: true }) }),
10147
+ /* @__PURE__ */ jsx(MobileFiltersMenu, { filters: filters?.slice(1) ?? [] }),
10148
+ /* @__PURE__ */ jsx(TableAddButton, { mobile: true })
10149
+ ] });
10150
+ }
9826
10151
  function TableSettingsMenu() {
9827
10152
  const showViewToggle = useTableStore.use.showViewToggle();
9828
10153
  const showColumnVisibility = useTableStore.use.showColumnVisibility();
@@ -9912,7 +10237,7 @@ function NTableHeader() {
9912
10237
  headerSlot && /* @__PURE__ */ jsx("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: headerSlot }),
9913
10238
  hasControls && /* @__PURE__ */ jsxs("div", { className: "flex gap-2 shrink-0", children: [
9914
10239
  /* @__PURE__ */ jsx("span", { className: "hidden md:contents", children: /* @__PURE__ */ jsx(TableSettingsMenu, {}) }),
9915
- /* @__PURE__ */ jsx("span", { className: "hidden md:contents", children: /* @__PURE__ */ jsx(TableAddButton, {}) })
10240
+ /* @__PURE__ */ jsx(TableAddButton, {})
9916
10241
  ] })
9917
10242
  ] });
9918
10243
  }
@@ -9923,11 +10248,12 @@ function NTableHeader() {
9923
10248
  const justify = hasControls || headerSlot || hasToolbar ? "justify-between" : "justify-start";
9924
10249
  return /* @__PURE__ */ jsxs("div", { "data-ntable-header": true, className: cn("flex shrink-0 items-center gap-3 flex-wrap lg:flex-nowrap", justify, classNames?.header), children: [
9925
10250
  /* @__PURE__ */ jsx(TableFilters, {}),
10251
+ /* @__PURE__ */ jsx(TableMobileToolbar, {}),
9926
10252
  headerSlot && /* @__PURE__ */ jsx("div", { className: "ml-auto flex shrink-0 items-center gap-2", children: headerSlot }),
9927
10253
  /* @__PURE__ */ jsx(TableToolbarSlot, {}),
9928
10254
  hasControls && /* @__PURE__ */ jsxs("div", { className: "flex gap-2 shrink-0", children: [
9929
10255
  /* @__PURE__ */ jsx("span", { className: "hidden md:contents", children: /* @__PURE__ */ jsx(TableSettingsMenu, {}) }),
9930
- /* @__PURE__ */ jsx("span", { className: "hidden md:contents", children: /* @__PURE__ */ jsx(TableAddButton, {}) })
10256
+ /* @__PURE__ */ jsx(TableAddButton, {})
9931
10257
  ] })
9932
10258
  ] });
9933
10259
  }
@@ -10107,24 +10433,6 @@ function DefaultTableFilteredEmptyState() {
10107
10433
  }
10108
10434
  );
10109
10435
  }
10110
- function TableMobileAddButton() {
10111
- const onAddClick = useTableStore.use.onAddClick();
10112
- const showAddButton = useTableStore.use.showAddButton();
10113
- const addButtonText = useTableStore.use.addButtonText();
10114
- if (!showAddButton || !onAddClick) return null;
10115
- return /* @__PURE__ */ jsx("div", { className: "flex shrink-0 px-2 md:hidden", children: /* @__PURE__ */ jsxs(
10116
- "button",
10117
- {
10118
- type: "button",
10119
- onClick: onAddClick,
10120
- className: "flex w-full items-center justify-center gap-2 rounded-lg bg-primary px-4 py-2.5 text-sm font-medium text-primary-foreground transition-opacity hover:opacity-90",
10121
- children: [
10122
- /* @__PURE__ */ jsx(Plus, { className: "h-4 w-4" }),
10123
- addButtonText || "Add"
10124
- ]
10125
- }
10126
- ) });
10127
- }
10128
10436
  function TableLayout(props) {
10129
10437
  const containerRef = useRef(null);
10130
10438
  const classNames = useTableStore.use.classNames?.();
@@ -10174,8 +10482,7 @@ function TableLayout(props) {
10174
10482
  showEmpty && /* @__PURE__ */ jsx(TableStateSlot, { children: props.renderEmpty ? props.renderEmpty() : /* @__PURE__ */ jsx(DefaultTableEmptyState, { title: noDataText }) }),
10175
10483
  /* @__PURE__ */ jsx(NTableContent, { effectiveMode }),
10176
10484
  /* @__PURE__ */ jsx(NTableCards, { effectiveMode }),
10177
- /* @__PURE__ */ jsx(NTableJson, {}),
10178
- /* @__PURE__ */ jsx(TableMobileAddButton, {})
10485
+ /* @__PURE__ */ jsx(NTableJson, {})
10179
10486
  ] }) }),
10180
10487
  /* @__PURE__ */ jsx("div", { "data-ntable-pagination": true, className: "min-w-0 shrink-0 bg-background text-foreground", children: /* @__PURE__ */ jsx(NTablePagination, {}) })
10181
10488
  ] });
@@ -11071,6 +11378,42 @@ var autoCollapseQueries = {
11071
11378
  lg: "(min-width: 1024px) and (max-width: 1279.98px)",
11072
11379
  xl: "(min-width: 1280px) and (max-width: 1535.98px)"
11073
11380
  };
11381
+ var responsiveBreakpointQueries = {
11382
+ sm: "(min-width: 640px)",
11383
+ md: "(min-width: 768px)",
11384
+ lg: "(min-width: 1024px)",
11385
+ xl: "(min-width: 1280px)",
11386
+ "2xl": "(min-width: 1536px)"
11387
+ };
11388
+ function useSidebarResponsiveBreakpoint() {
11389
+ const [breakpoint, setBreakpoint] = useState("base");
11390
+ useEffect(() => {
11391
+ if (typeof window === "undefined" || typeof window.matchMedia !== "function") return;
11392
+ const mediaQueries = Object.entries(responsiveBreakpointQueries).map(([name, query]) => ({
11393
+ name,
11394
+ mediaQuery: window.matchMedia(query)
11395
+ }));
11396
+ const update = () => {
11397
+ const active = [...mediaQueries].reverse().find(({ mediaQuery }) => mediaQuery.matches);
11398
+ setBreakpoint(active?.name ?? "base");
11399
+ };
11400
+ update();
11401
+ mediaQueries.forEach(({ mediaQuery }) => mediaQuery.addEventListener?.("change", update));
11402
+ return () => mediaQueries.forEach(({ mediaQuery }) => mediaQuery.removeEventListener?.("change", update));
11403
+ }, []);
11404
+ return breakpoint;
11405
+ }
11406
+ function resolveSidebarWidth(value, breakpoint, fallback) {
11407
+ if (value === void 0) return fallback;
11408
+ if (typeof value === "number" || typeof value === "string") return value;
11409
+ const breakpoints = ["base", "sm", "md", "lg", "xl", "2xl"];
11410
+ const activeIndex = breakpoints.indexOf(breakpoint);
11411
+ for (let index = activeIndex; index >= 0; index -= 1) {
11412
+ const width = value[breakpoints[index]];
11413
+ if (width !== void 0) return width;
11414
+ }
11415
+ return fallback;
11416
+ }
11074
11417
  function useAutoCollapsed(breakpoint) {
11075
11418
  const [matches, setMatches] = useState(false);
11076
11419
  useEffect(() => {
@@ -11190,9 +11533,22 @@ function NSidebar({
11190
11533
  }, [onNavigate, closeOnNavigate]);
11191
11534
  const groups = useMemo(() => buildGroups(navItems), [navItems]);
11192
11535
  const desktopClass = mobileBreakpoint === "sm" ? "hidden sm:flex" : mobileBreakpoint === "lg" ? "hidden lg:flex" : "hidden md:flex";
11193
- const expandedWidth = widths?.expanded ?? recipe?.expandedWidth ?? 240;
11194
- const collapsedWidth = widths?.collapsed ?? recipe?.collapsedWidth ?? 64;
11195
- const mobileWidth = widths?.mobile ?? expandedWidth;
11536
+ const responsiveBreakpoint = useSidebarResponsiveBreakpoint();
11537
+ const expandedWidth = resolveSidebarWidth(
11538
+ widths?.expanded ?? recipe?.expandedWidth,
11539
+ responsiveBreakpoint,
11540
+ 240
11541
+ );
11542
+ const collapsedWidth = resolveSidebarWidth(
11543
+ widths?.collapsed ?? recipe?.collapsedWidth,
11544
+ responsiveBreakpoint,
11545
+ 64
11546
+ );
11547
+ const mobileWidth = resolveSidebarWidth(
11548
+ widths?.mobile ?? recipe?.mobileWidth,
11549
+ responsiveBreakpoint,
11550
+ expandedWidth
11551
+ );
11196
11552
  const railVar = typeof collapsedWidth === "number" ? `${collapsedWidth}px` : collapsedWidth;
11197
11553
  const sidebarEdgeWidth = bordered === false ? "0px" : recipe?.borderWidth ?? "var(--border-width, 1px)";
11198
11554
  const showEdgeCollapse = showCollapseButton && collapseButtonPosition === "edge" && !autoCollapsed;
@@ -11639,4 +11995,4 @@ function NGridItem({
11639
11995
  return /* @__PURE__ */ jsx("div", { className: itemClassName, ...props, children });
11640
11996
  }
11641
11997
 
11642
- 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, NGrid, NGridItem, 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 };
11998
+ 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, NCardInfo, NCardMedia, NCardSection, NCommandPalette, NConfirmDialog, NContextMenu, NDataCardShell, NDeleteDialog, NDeleteDialogContent, NDetailCard, NDetailItem, NDetailList, NDialog, NDialogDescription, NDialogHeader, NDialogPrimaryButton, NDialogSecondaryButton, NEditorTabs, NEmptyState, NErrorBoundary, NErrorState, NFileBrowser, NFileTypeIcon, NFilterBar, NFolderIcon, NForm, NFormSectionHeader, NGrid, NGridItem, 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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "najm-kit",
3
- "version": "2.1.19",
3
+ "version": "2.1.21",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "description": "Reusable React UI component package for Najm framework",