@nsaa/core 0.1.0-alpha.0 → 0.1.0-alpha.1

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
@@ -6,9 +6,11 @@ import { ClassValue } from "clsx";
6
6
  import { VariantProps } from "class-variance-authority";
7
7
  import * as React from "react";
8
8
  import { ComponentProps, ComponentPropsWithRef, ReactNode } from "react";
9
+ import { AlertDialog as AlertDialog$1 } from "@base-ui/react/alert-dialog";
10
+ import { Button as Button$1 } from "@base-ui/react/button";
9
11
  import { Avatar as Avatar$1 } from "@base-ui/react/avatar";
10
12
  import { useRender } from "@base-ui/react/use-render";
11
- import { Button as Button$1 } from "@base-ui/react/button";
13
+ import { DayButton, DayPicker, Locale } from "react-day-picker";
12
14
  import { Checkbox as Checkbox$1 } from "@base-ui/react/checkbox";
13
15
  import { Collapsible as Collapsible$1 } from "@base-ui/react/collapsible";
14
16
  import { Combobox as Combobox$1 } from "@base-ui/react/combobox";
@@ -50,18 +52,6 @@ declare function Alert({ className, variant, announce, ...props }: React.Compone
50
52
  declare function AlertTitle({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
51
53
  declare function AlertDescription({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
52
54
  declare function AlertAction({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
53
- declare function Avatar({ className, size, ...props }: Avatar$1.Root.Props & {
54
- size?: "default" | "sm" | "lg";
55
- }): React.JSX.Element;
56
- declare function AvatarImage({ className, ...props }: Avatar$1.Image.Props): React.JSX.Element;
57
- declare function AvatarFallback({ className, ...props }: Avatar$1.Fallback.Props): React.JSX.Element;
58
- declare function AvatarBadge({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
59
- declare function AvatarGroup({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
60
- declare function AvatarGroupCount({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
61
- declare const badgeVariants: (props?: ({
62
- variant?: "default" | "destructive" | "link" | "secondary" | "outline" | "ghost" | null | undefined;
63
- } & import("class-variance-authority/types").ClassProp) | undefined) => string;
64
- declare function Badge({ className, variant, render, ...props }: useRender.ComponentProps<"span"> & VariantProps<typeof badgeVariants>): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
65
55
  declare const buttonVariants: (props?: ({
66
56
  variant?: "default" | "destructive" | "link" | "secondary" | "outline" | "ghost" | null | undefined;
67
57
  size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
@@ -83,6 +73,38 @@ declare function Button({ className, variant, size, loading, loadingLabel, loadi
83
73
  */
84
74
  loadingPlacement?: LoadingPlacement | undefined;
85
75
  }): import("react").JSX.Element;
76
+ declare function AlertDialog({ onOpenChange, ...props }: AlertDialog$1.Root.Props): React.JSX.Element;
77
+ declare function AlertDialogTrigger({ ...props }: AlertDialog$1.Trigger.Props): React.JSX.Element;
78
+ declare function AlertDialogPortal({ ...props }: AlertDialog$1.Portal.Props): React.JSX.Element;
79
+ declare function AlertDialogOverlay({ className, ...props }: AlertDialog$1.Backdrop.Props): React.JSX.Element;
80
+ declare function AlertDialogContent({ className, size, ...props }: AlertDialog$1.Popup.Props & {
81
+ size?: "default" | "sm";
82
+ }): React.JSX.Element;
83
+ declare function AlertDialogHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
84
+ declare function AlertDialogFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
85
+ declare function AlertDialogMedia({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
86
+ declare function AlertDialogTitle({ className, ...props }: React.ComponentProps<typeof AlertDialog$1.Title>): React.JSX.Element;
87
+ declare function AlertDialogDescription({ className, ...props }: React.ComponentProps<typeof AlertDialog$1.Description>): React.JSX.Element;
88
+ declare function AlertDialogAction({ className, ...props }: React.ComponentProps<typeof Button>): React.JSX.Element;
89
+ declare function AlertDialogCancel({ className, variant, size, ...props }: AlertDialog$1.Close.Props & Pick<React.ComponentProps<typeof Button>, "variant" | "size">): React.JSX.Element;
90
+ declare function Avatar({ className, size, ...props }: Avatar$1.Root.Props & {
91
+ size?: "default" | "sm" | "lg";
92
+ }): React.JSX.Element;
93
+ declare function AvatarImage({ className, ...props }: Avatar$1.Image.Props): React.JSX.Element;
94
+ declare function AvatarFallback({ className, ...props }: Avatar$1.Fallback.Props): React.JSX.Element;
95
+ declare function AvatarBadge({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
96
+ declare function AvatarGroup({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
97
+ declare function AvatarGroupCount({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
98
+ declare const badgeVariants: (props?: ({
99
+ variant?: "default" | "destructive" | "link" | "secondary" | "outline" | "ghost" | null | undefined;
100
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
101
+ declare function Badge({ className, variant, render, ...props }: useRender.ComponentProps<"span"> & VariantProps<typeof badgeVariants>): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
102
+ declare function Calendar({ className, classNames, showOutsideDays, captionLayout, buttonVariant, locale, formatters, components, ...props }: React.ComponentProps<typeof DayPicker> & {
103
+ buttonVariant?: React.ComponentProps<typeof Button>["variant"];
104
+ }): React.JSX.Element;
105
+ declare function CalendarDayButton({ className, day, modifiers, locale, onClick, "aria-label": label, ...props }: React.ComponentProps<typeof DayButton> & {
106
+ locale?: Partial<Locale>;
107
+ }): React.JSX.Element;
86
108
  declare function Card({ className, size, ...props }: React.ComponentProps<"div"> & {
87
109
  size?: "default" | "sm";
88
110
  }): React.JSX.Element;
@@ -310,6 +332,20 @@ type NativeSelectProps = Omit<React.ComponentProps<"select">, "size"> & {
310
332
  declare function NativeSelect({ className, size, ...props }: NativeSelectProps): React.JSX.Element;
311
333
  declare function NativeSelectOption({ className, ...props }: React.ComponentProps<"option">): React.JSX.Element;
312
334
  declare function NativeSelectOptGroup({ className, ...props }: React.ComponentProps<"optgroup">): React.JSX.Element;
335
+ declare function Pagination({ className, ...props }: React.ComponentProps<"nav">): React.JSX.Element;
336
+ declare function PaginationContent({ className, ...props }: React.ComponentProps<"ul">): React.JSX.Element;
337
+ declare function PaginationItem({ ...props }: React.ComponentProps<"li">): React.JSX.Element;
338
+ type PaginationLinkProps = {
339
+ isActive?: boolean;
340
+ } & Pick<React.ComponentProps<typeof Button>, "size"> & React.ComponentProps<"a">;
341
+ declare function PaginationLink({ className, isActive, size, ...props }: PaginationLinkProps): React.JSX.Element;
342
+ declare function PaginationPrevious({ className, text, ...props }: React.ComponentProps<typeof PaginationLink> & {
343
+ text?: string;
344
+ }): React.JSX.Element;
345
+ declare function PaginationNext({ className, text, ...props }: React.ComponentProps<typeof PaginationLink> & {
346
+ text?: string;
347
+ }): React.JSX.Element;
348
+ declare function PaginationEllipsis({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
313
349
  declare function Popover({ ...props }: Popover$1.Root.Props): React.JSX.Element;
314
350
  declare function PopoverTrigger({ ...props }: Popover$1.Trigger.Props): React.JSX.Element;
315
351
  declare function PopoverContent({ className, align, alignOffset, side, sideOffset, ...props }: Popover$1.Popup.Props & Pick<Popover$1.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset">): React.JSX.Element;
@@ -373,6 +409,10 @@ export declare const SOUND_MAP: {
373
409
  readonly open: "navigation.open";
374
410
  readonly close: "navigation.close";
375
411
  };
412
+ readonly "alert-dialog": {
413
+ readonly open: "navigation.open";
414
+ readonly close: "navigation.close";
415
+ };
376
416
  readonly drawer: {
377
417
  readonly open: "navigation.open";
378
418
  readonly close: "navigation.close";
@@ -381,6 +421,9 @@ export declare const SOUND_MAP: {
381
421
  readonly select: {
382
422
  readonly choose: "selection.select";
383
423
  };
424
+ readonly calendar: {
425
+ readonly select: "selection.select";
426
+ };
384
427
  readonly combobox: {
385
428
  readonly choose: "selection.select";
386
429
  readonly clear: "input.press";
@@ -629,4 +672,4 @@ declare function TooltipProvider({ delay, ...props }: Tooltip$1.Provider.Props):
629
672
  declare function Tooltip({ ...props }: Tooltip$1.Root.Props): import("react").JSX.Element;
630
673
  declare function TooltipTrigger({ ...props }: Tooltip$1.Trigger.Props): import("react").JSX.Element;
631
674
  declare function TooltipContent({ className, side, sideOffset, align, alignOffset, children, ...props }: Tooltip$1.Popup.Props & Pick<Tooltip$1.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset">): import("react").JSX.Element;
632
- export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertAction, AlertDescription, AlertTitle, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, Button, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, ComboboxChip, ComboboxChips, ComboboxChipsInput, ComboboxCollection, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxLabel, ComboboxList, ComboboxSeparator, ComboboxTrigger, ComboboxValue, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DirectionProvider, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerSwipeHandle, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, type EmptyIllustrationOptions, EmptyMedia, EmptyTitle, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, type IconSwapProps, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Kbd, KbdGroup, Label, type LoaderComponent, type LoaderProviderProps, NativeSelect, NativeSelectOptGroup, NativeSelectOption, Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, RadioGroup, RadioGroupItem, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Skeleton, SkeletonContent, Slider, type SoundComponent, type SoundCue, type SoundPlayer, SoundProvider, type SoundProviderProps, Spinner, type SpinnerProps, type SpinnerVariant, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toast, ToastAction, ToastClose, ToastContent, ToastDescription, ToastPortal, ToastProvider, ToastTitle, ToastViewport, Toaster, type ToggleGroupItemProps, type ToggleGroupMultipleProps, type ToggleGroupProps, type ToggleGroupSingleProps, type ToggleGroupSize, type ToggleGroupVariant, type ToolbarButtonProps, type ToolbarGroupProps, type ToolbarInputProps, type ToolbarLinkProps, type ToolbarProps, type ToolbarSize, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, buttonVariants, createToastManager, registerLoader, registerLoaders, tabsListVariants, toast, useComboboxAnchor, useEmptyIllustration, useSound, useToastManager };
675
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertAction, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, Button, Calendar, CalendarDayButton, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, ComboboxChip, ComboboxChips, ComboboxChipsInput, ComboboxCollection, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxLabel, ComboboxList, ComboboxSeparator, ComboboxTrigger, ComboboxValue, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DirectionProvider, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerSwipeHandle, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, type EmptyIllustrationOptions, EmptyMedia, EmptyTitle, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, type IconSwapProps, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Kbd, KbdGroup, Label, type LoaderComponent, type LoaderProviderProps, NativeSelect, NativeSelectOptGroup, NativeSelectOption, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, RadioGroup, RadioGroupItem, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Skeleton, SkeletonContent, Slider, type SoundComponent, type SoundCue, type SoundPlayer, SoundProvider, type SoundProviderProps, Spinner, type SpinnerProps, type SpinnerVariant, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toast, ToastAction, ToastClose, ToastContent, ToastDescription, ToastPortal, ToastProvider, ToastTitle, ToastViewport, Toaster, type ToggleGroupItemProps, type ToggleGroupMultipleProps, type ToggleGroupProps, type ToggleGroupSingleProps, type ToggleGroupSize, type ToggleGroupVariant, type ToolbarButtonProps, type ToolbarGroupProps, type ToolbarInputProps, type ToolbarLinkProps, type ToolbarProps, type ToolbarSize, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, buttonVariants, createToastManager, registerLoader, registerLoaders, tabsListVariants, toast, useComboboxAnchor, useEmptyIllustration, useSound, useToastManager };
package/dist/index.js CHANGED
@@ -8,10 +8,12 @@ import { cva } from "class-variance-authority";
8
8
  import * as React from "react";
9
9
  import { Children, Fragment as Fragment$1, createContext, createElement, isValidElement, useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
10
10
  import { AnimatePresence, animate, motion, useReducedMotion, useReducedMotionConfig } from "motion/react";
11
+ import { AlertDialog as AlertDialog$1 } from "@base-ui/react/alert-dialog";
12
+ import { Button as Button$1 } from "@base-ui/react/button";
11
13
  import { Avatar as Avatar$1 } from "@base-ui/react/avatar";
12
14
  import { mergeProps } from "@base-ui/react/merge-props";
13
15
  import { useRender } from "@base-ui/react/use-render";
14
- import { Button as Button$1 } from "@base-ui/react/button";
16
+ import { DayPicker, getDefaultClassNames } from "react-day-picker";
15
17
  import { Checkbox as Checkbox$1 } from "@base-ui/react/checkbox";
16
18
  import { Collapsible as Collapsible$1 } from "@base-ui/react/collapsible";
17
19
  import { Combobox as Combobox$1 } from "@base-ui/react/combobox";
@@ -284,12 +286,17 @@ const SOUND_MAP = {
284
286
  open: "navigation.open",
285
287
  close: "navigation.close"
286
288
  },
289
+ "alert-dialog": {
290
+ open: "navigation.open",
291
+ close: "navigation.close"
292
+ },
287
293
  drawer: {
288
294
  open: "navigation.open",
289
295
  close: "navigation.close",
290
296
  snap: "movement.snap"
291
297
  },
292
298
  select: { choose: "selection.select" },
299
+ calendar: { select: "selection.select" },
293
300
  combobox: {
294
301
  choose: "selection.select",
295
302
  clear: "input.press",
@@ -367,73 +374,6 @@ function AlertAction({ className, ...props }) {
367
374
  ...props
368
375
  });
369
376
  }
370
- // src/avatar/avatar.tsx
371
- function Avatar({ className, size = "default", ...props }) {
372
- return /* @__PURE__ */ jsx(Avatar$1.Root, {
373
- "data-slot": "avatar",
374
- "data-size": size,
375
- className: cn("group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten", className),
376
- ...props
377
- });
378
- }
379
- function AvatarImage({ className, ...props }) {
380
- return /* @__PURE__ */ jsx(Avatar$1.Image, {
381
- "data-slot": "avatar-image",
382
- className: cn("aspect-square size-full rounded-full object-cover", className),
383
- ...props
384
- });
385
- }
386
- function AvatarFallback({ className, ...props }) {
387
- return /* @__PURE__ */ jsx(Avatar$1.Fallback, {
388
- "data-slot": "avatar-fallback",
389
- className: cn("flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs", className),
390
- ...props
391
- });
392
- }
393
- function AvatarBadge({ className, ...props }) {
394
- return /* @__PURE__ */ jsx("span", {
395
- "data-slot": "avatar-badge",
396
- className: cn("absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full bg-primary text-primary-foreground bg-blend-color ring-2 ring-background select-none", "group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden", "group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2", "group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2", className),
397
- ...props
398
- });
399
- }
400
- function AvatarGroup({ className, ...props }) {
401
- return /* @__PURE__ */ jsx("div", {
402
- "data-slot": "avatar-group",
403
- className: cn("group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2 *:data-[slot=avatar]:ring-background", className),
404
- ...props
405
- });
406
- }
407
- function AvatarGroupCount({ className, ...props }) {
408
- return /* @__PURE__ */ jsx("div", {
409
- "data-slot": "avatar-group-count",
410
- className: cn("relative flex size-8 shrink-0 items-center justify-center rounded-full bg-muted text-sm text-muted-foreground ring-2 ring-background group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6 [&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3", className),
411
- ...props
412
- });
413
- }
414
- // src/badge/badge.tsx
415
- const badgeVariants = cva("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!", {
416
- variants: { variant: {
417
- default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80",
418
- secondary: "bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",
419
- destructive: "bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:text-destructive-hover-foreground",
420
- outline: "border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",
421
- ghost: "hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",
422
- link: "text-primary underline-offset-4 hover:underline"
423
- } },
424
- defaultVariants: { variant: "default" }
425
- });
426
- function Badge({ className, variant = "default", render, ...props }) {
427
- return useRender({
428
- defaultTagName: "span",
429
- props: mergeProps({ className: cn(badgeVariants({ variant }), className) }, props),
430
- render,
431
- state: {
432
- slot: "badge",
433
- variant
434
- }
435
- });
436
- }
437
377
  // src/lib/control-defaults.tsx
438
378
  const ControlDefaultsContext = createContext({});
439
379
  function useControlDefaults() {
@@ -442,9 +382,10 @@ function useControlDefaults() {
442
382
  // src/lib/use-press.ts
443
383
  /**
444
384
  * Parts of a larger shape, or high-frequency toggles: their buttons don't scale on their own
445
- * (legacy `pressScale={false}`). A Toggle Group outside a Toolbar counts too (#128, alpha-4).
385
+ * (legacy `pressScale={false}`). A Toggle Group outside a Toolbar counts too (#128, alpha-4), and
386
+ * Pagination and the Calendar's day grid (#136).
446
387
  */
447
- const SEGMENT = "[data-slot=\"input-group\"], [data-slot=\"button-group\"], [data-slot=\"toolbar\"], [data-slot=\"toggle-group\"]";
388
+ const SEGMENT = "[data-slot=\"input-group\"], [data-slot=\"button-group\"], [data-slot=\"toolbar\"], [data-slot=\"toggle-group\"], [data-slot=\"pagination-link\"], [data-slot=\"calendar\"]";
448
389
  /**
449
390
  * Pointer-only press: scale to `scale.press` on pointer-down and back on release, on `spring.snap`,
450
391
  * interruptible from the live value. Never on hover, on keyboard activation, when disabled, under
@@ -756,6 +697,287 @@ function Button({ className, variant = "default", size = "default", loading = fa
756
697
  children: placement ? loadingContent(children, size ?? "default", loadingLabel, placement) : children
757
698
  });
758
699
  }
700
+ // src/alert-dialog/alert-dialog.tsx
701
+ function AlertDialog({ onOpenChange, ...props }) {
702
+ const cue = useCue("alert-dialog");
703
+ return /* @__PURE__ */ jsx(AlertDialog$1.Root, {
704
+ "data-slot": "alert-dialog",
705
+ onOpenChange: (open, details) => {
706
+ onOpenChange?.(open, details);
707
+ if (!details.isCanceled) cue(open ? "open" : "close");
708
+ },
709
+ ...props
710
+ });
711
+ }
712
+ function AlertDialogTrigger({ ...props }) {
713
+ return /* @__PURE__ */ jsx(AlertDialog$1.Trigger, {
714
+ "data-slot": "alert-dialog-trigger",
715
+ ...props
716
+ });
717
+ }
718
+ function AlertDialogPortal({ ...props }) {
719
+ return /* @__PURE__ */ jsx(AlertDialog$1.Portal, {
720
+ "data-slot": "alert-dialog-portal",
721
+ ...props
722
+ });
723
+ }
724
+ function AlertDialogOverlay({ className, ...props }) {
725
+ return /* @__PURE__ */ jsx(AlertDialog$1.Backdrop, {
726
+ "data-slot": "alert-dialog-overlay",
727
+ className: cn("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0", className),
728
+ ...props
729
+ });
730
+ }
731
+ function AlertDialogContent({ className, size = "default", ...props }) {
732
+ return /* @__PURE__ */ jsxs(AlertDialogPortal, { children: [/* @__PURE__ */ jsx(AlertDialogOverlay, {}), /* @__PURE__ */ jsx(AlertDialog$1.Popup, {
733
+ "data-slot": "alert-dialog-content",
734
+ "data-size": size,
735
+ className: cn("group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className),
736
+ ...props
737
+ })] });
738
+ }
739
+ function AlertDialogHeader({ className, ...props }) {
740
+ return /* @__PURE__ */ jsx("div", {
741
+ "data-slot": "alert-dialog-header",
742
+ className: cn("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]", className),
743
+ ...props
744
+ });
745
+ }
746
+ function AlertDialogFooter({ className, ...props }) {
747
+ return /* @__PURE__ */ jsx("div", {
748
+ "data-slot": "alert-dialog-footer",
749
+ className: cn("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end", className),
750
+ ...props
751
+ });
752
+ }
753
+ function AlertDialogMedia({ className, ...props }) {
754
+ return /* @__PURE__ */ jsx("div", {
755
+ "data-slot": "alert-dialog-media",
756
+ className: cn("mb-2 inline-flex size-10 items-center justify-center rounded-md bg-muted sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-6", className),
757
+ ...props
758
+ });
759
+ }
760
+ function AlertDialogTitle({ className, ...props }) {
761
+ return /* @__PURE__ */ jsx(AlertDialog$1.Title, {
762
+ "data-slot": "alert-dialog-title",
763
+ className: cn("cn-font-heading text-base font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2", className),
764
+ ...props
765
+ });
766
+ }
767
+ function AlertDialogDescription({ className, ...props }) {
768
+ return /* @__PURE__ */ jsx(AlertDialog$1.Description, {
769
+ "data-slot": "alert-dialog-description",
770
+ className: cn("text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground", className),
771
+ ...props
772
+ });
773
+ }
774
+ function AlertDialogAction({ className, ...props }) {
775
+ return /* @__PURE__ */ jsx(Button, {
776
+ "data-slot": "alert-dialog-action",
777
+ className: cn(className),
778
+ ...props
779
+ });
780
+ }
781
+ function AlertDialogCancel({ className, variant = "outline", size = "default", ...props }) {
782
+ return /* @__PURE__ */ jsx(AlertDialog$1.Close, {
783
+ "data-slot": "alert-dialog-cancel",
784
+ className: cn(className),
785
+ render: /* @__PURE__ */ jsx(Button, {
786
+ variant,
787
+ size
788
+ }),
789
+ ...props
790
+ });
791
+ }
792
+ // src/avatar/avatar.tsx
793
+ function Avatar({ className, size = "default", ...props }) {
794
+ return /* @__PURE__ */ jsx(Avatar$1.Root, {
795
+ "data-slot": "avatar",
796
+ "data-size": size,
797
+ className: cn("group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten", className),
798
+ ...props
799
+ });
800
+ }
801
+ function AvatarImage({ className, ...props }) {
802
+ return /* @__PURE__ */ jsx(Avatar$1.Image, {
803
+ "data-slot": "avatar-image",
804
+ className: cn("aspect-square size-full rounded-full object-cover", className),
805
+ ...props
806
+ });
807
+ }
808
+ function AvatarFallback({ className, ...props }) {
809
+ return /* @__PURE__ */ jsx(Avatar$1.Fallback, {
810
+ "data-slot": "avatar-fallback",
811
+ className: cn("flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs", className),
812
+ ...props
813
+ });
814
+ }
815
+ function AvatarBadge({ className, ...props }) {
816
+ return /* @__PURE__ */ jsx("span", {
817
+ "data-slot": "avatar-badge",
818
+ className: cn("absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full bg-primary text-primary-foreground bg-blend-color ring-2 ring-background select-none", "group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden", "group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2", "group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2", className),
819
+ ...props
820
+ });
821
+ }
822
+ function AvatarGroup({ className, ...props }) {
823
+ return /* @__PURE__ */ jsx("div", {
824
+ "data-slot": "avatar-group",
825
+ className: cn("group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2 *:data-[slot=avatar]:ring-background", className),
826
+ ...props
827
+ });
828
+ }
829
+ function AvatarGroupCount({ className, ...props }) {
830
+ return /* @__PURE__ */ jsx("div", {
831
+ "data-slot": "avatar-group-count",
832
+ className: cn("relative flex size-8 shrink-0 items-center justify-center rounded-full bg-muted text-sm text-muted-foreground ring-2 ring-background group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6 [&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3", className),
833
+ ...props
834
+ });
835
+ }
836
+ // src/badge/badge.tsx
837
+ const badgeVariants = cva("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!", {
838
+ variants: { variant: {
839
+ default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80",
840
+ secondary: "bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",
841
+ destructive: "bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:text-destructive-hover-foreground",
842
+ outline: "border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",
843
+ ghost: "hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",
844
+ link: "text-primary underline-offset-4 hover:underline"
845
+ } },
846
+ defaultVariants: { variant: "default" }
847
+ });
848
+ function Badge({ className, variant = "default", render, ...props }) {
849
+ return useRender({
850
+ defaultTagName: "span",
851
+ props: mergeProps({ className: cn(badgeVariants({ variant }), className) }, props),
852
+ render,
853
+ state: {
854
+ slot: "badge",
855
+ variant
856
+ }
857
+ });
858
+ }
859
+ // src/calendar/calendar.tsx
860
+ /** Lucide's chevrons, in place of shadcn's icon placeholder. */
861
+ function ChevronIcon({ className, orientation }) {
862
+ return /* @__PURE__ */ jsx("svg", {
863
+ xmlns: "http://www.w3.org/2000/svg",
864
+ viewBox: "0 0 24 24",
865
+ fill: "none",
866
+ stroke: "currentColor",
867
+ strokeWidth: "2",
868
+ strokeLinecap: "round",
869
+ strokeLinejoin: "round",
870
+ "aria-hidden": "true",
871
+ className,
872
+ children: /* @__PURE__ */ jsx("path", { d: orientation === "left" ? "m15 18-6-6 6-6" : orientation === "right" ? "m9 18 6-6-6-6" : "m6 9 6 6 6-6" })
873
+ });
874
+ }
875
+ function Calendar({ className, classNames, showOutsideDays = true, captionLayout = "label", buttonVariant = "ghost", locale, formatters, components, ...props }) {
876
+ const defaultClassNames = getDefaultClassNames();
877
+ return /* @__PURE__ */ jsx(DayPicker, {
878
+ showOutsideDays,
879
+ className: cn("group/calendar bg-background p-2 [--cell-radius:var(--radius-md)] [--cell-size:--spacing(7)] in-data-[slot=card-content]:bg-transparent in-data-[slot=popover-content]:bg-transparent", String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`, String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`, className),
880
+ captionLayout,
881
+ locale,
882
+ formatters: {
883
+ formatMonthDropdown: (date) => date.toLocaleString(locale?.code, { month: "short" }),
884
+ ...formatters
885
+ },
886
+ classNames: {
887
+ root: cn("w-fit", defaultClassNames.root),
888
+ months: cn("relative flex flex-col gap-4 md:flex-row", defaultClassNames.months),
889
+ month: cn("flex w-full flex-col gap-4", defaultClassNames.month),
890
+ nav: cn("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1", defaultClassNames.nav),
891
+ button_previous: cn(buttonVariants({ variant: buttonVariant }), "size-(--cell-size) p-0 select-none aria-disabled:opacity-50", defaultClassNames.button_previous),
892
+ button_next: cn(buttonVariants({ variant: buttonVariant }), "size-(--cell-size) p-0 select-none aria-disabled:opacity-50", defaultClassNames.button_next),
893
+ month_caption: cn("flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)", defaultClassNames.month_caption),
894
+ dropdowns: cn("flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium", defaultClassNames.dropdowns),
895
+ dropdown_root: cn("cn-calendar-dropdown-root relative rounded-(--cell-radius)", defaultClassNames.dropdown_root),
896
+ dropdown: cn("absolute inset-0 bg-popover opacity-0", defaultClassNames.dropdown),
897
+ caption_label: cn("font-medium select-none", captionLayout === "label" ? "cn-calendar-caption text-sm" : "cn-calendar-caption-label flex items-center gap-1 rounded-(--cell-radius) text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground", defaultClassNames.caption_label),
898
+ month_grid: cn("w-full border-collapse", defaultClassNames.month_grid),
899
+ weekdays: cn("flex", defaultClassNames.weekdays),
900
+ weekday: cn("flex-1 rounded-(--cell-radius) text-[0.8rem] font-normal text-muted-foreground select-none", defaultClassNames.weekday),
901
+ week: cn("mt-2 flex w-full", defaultClassNames.week),
902
+ week_number_header: cn("w-(--cell-size) select-none", defaultClassNames.week_number_header),
903
+ week_number: cn("text-[0.8rem] text-muted-foreground select-none", defaultClassNames.week_number),
904
+ day: cn("group/day relative aspect-square h-full w-full rounded-(--cell-radius) p-0 text-center select-none [&:last-child[data-selected=true]_button]:rounded-r-(--cell-radius)", props.showWeekNumber ? "[&:nth-child(2)[data-selected=true]_button]:rounded-l-(--cell-radius)" : "[&:first-child[data-selected=true]_button]:rounded-l-(--cell-radius)", defaultClassNames.day),
905
+ range_start: cn("relative isolate z-0 rounded-l-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:right-0 after:w-4 after:bg-muted", defaultClassNames.range_start),
906
+ range_middle: cn("rounded-none", defaultClassNames.range_middle),
907
+ range_end: cn("relative isolate z-0 rounded-r-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:left-0 after:w-4 after:bg-muted", defaultClassNames.range_end),
908
+ today: cn("rounded-(--cell-radius) bg-muted text-foreground data-[selected=true]:rounded-none", defaultClassNames.today),
909
+ outside: cn("text-muted-foreground aria-selected:text-muted-foreground", defaultClassNames.outside),
910
+ disabled: cn("text-muted-foreground opacity-50", defaultClassNames.disabled),
911
+ hidden: cn("invisible", defaultClassNames.hidden),
912
+ ...classNames
913
+ },
914
+ components: {
915
+ Root: ({ className, rootRef, ...props }) => {
916
+ return /* @__PURE__ */ jsx("div", {
917
+ "data-slot": "calendar",
918
+ ref: rootRef,
919
+ className: cn(className),
920
+ ...props
921
+ });
922
+ },
923
+ Chevron: ({ className, orientation }) => {
924
+ if (orientation === "left") return /* @__PURE__ */ jsx(ChevronIcon, {
925
+ orientation: "left",
926
+ className: cn("cn-rtl-flip size-4", className)
927
+ });
928
+ if (orientation === "right") return /* @__PURE__ */ jsx(ChevronIcon, {
929
+ orientation: "right",
930
+ className: cn("cn-rtl-flip size-4", className)
931
+ });
932
+ return /* @__PURE__ */ jsx(ChevronIcon, {
933
+ orientation: "down",
934
+ className: cn("size-4", className)
935
+ });
936
+ },
937
+ DayButton: ({ ...props }) => /* @__PURE__ */ jsx(CalendarDayButton, {
938
+ locale,
939
+ ...props
940
+ }),
941
+ WeekNumber: ({ children, ...props }) => {
942
+ return /* @__PURE__ */ jsx("td", {
943
+ ...props,
944
+ children: /* @__PURE__ */ jsx("div", {
945
+ className: "flex size-(--cell-size) items-center justify-center text-center",
946
+ children
947
+ })
948
+ });
949
+ },
950
+ ...components
951
+ },
952
+ ...props
953
+ });
954
+ }
955
+ function CalendarDayButton({ className, day, modifiers, locale, onClick, "aria-label": label, ...props }) {
956
+ const defaultClassNames = getDefaultClassNames();
957
+ const cue = useCue("calendar");
958
+ const ref = React.useRef(null);
959
+ React.useEffect(() => {
960
+ if (modifiers.focused) ref.current?.focus();
961
+ }, [modifiers.focused]);
962
+ return /* @__PURE__ */ jsx(Button, {
963
+ variant: "ghost",
964
+ size: "icon",
965
+ "data-day": day.date.toLocaleDateString(locale?.code),
966
+ "data-selected-single": modifiers.selected && !modifiers.range_start && !modifiers.range_end && !modifiers.range_middle,
967
+ "data-range-start": modifiers.range_start,
968
+ "data-range-end": modifiers.range_end,
969
+ "data-range-middle": modifiers.range_middle,
970
+ ref,
971
+ "aria-label": label?.replace(/\b(\d{1,2})(?:st|nd|rd|th)\b/, "$1"),
972
+ "aria-current": modifiers.today ? "date" : void 0,
973
+ onClick: (event) => {
974
+ onClick?.(event);
975
+ if (!modifiers.disabled) cue("select");
976
+ },
977
+ className: cn("relative isolate z-10 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 border-0 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-ring/50 data-[range-end=true]:rounded-(--cell-radius) data-[range-end=true]:rounded-r-(--cell-radius) data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-muted data-[range-middle=true]:text-foreground data-[range-start=true]:rounded-(--cell-radius) data-[range-start=true]:rounded-l-(--cell-radius) data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground dark:hover:text-foreground [&>span]:text-xs [&>span]:opacity-70", defaultClassNames.day, className),
978
+ ...props
979
+ });
980
+ }
759
981
  // src/card/card.tsx
760
982
  function Card({ className, size = "default", ...props }) {
761
983
  return /* @__PURE__ */ jsx("div", {
@@ -2219,6 +2441,134 @@ function NativeSelectOptGroup({ className, ...props }) {
2219
2441
  ...props
2220
2442
  });
2221
2443
  }
2444
+ // src/pagination/pagination.tsx
2445
+ function Pagination({ className, ...props }) {
2446
+ return /* @__PURE__ */ jsx("nav", {
2447
+ role: "navigation",
2448
+ "aria-label": "pagination",
2449
+ "data-slot": "pagination",
2450
+ className: cn("mx-auto flex w-full justify-center", className),
2451
+ ...props
2452
+ });
2453
+ }
2454
+ function PaginationContent({ className, ...props }) {
2455
+ return /* @__PURE__ */ jsx("ul", {
2456
+ "data-slot": "pagination-content",
2457
+ className: cn("flex items-center gap-0.5", className),
2458
+ ...props
2459
+ });
2460
+ }
2461
+ function PaginationItem({ ...props }) {
2462
+ return /* @__PURE__ */ jsx("li", {
2463
+ "data-slot": "pagination-item",
2464
+ ...props
2465
+ });
2466
+ }
2467
+ function PaginationLink({ className, isActive, size = "icon", ...props }) {
2468
+ return /* @__PURE__ */ jsx(ControlDefaultsContext.Provider, {
2469
+ value: SILENT,
2470
+ children: /* @__PURE__ */ jsx(Button, {
2471
+ variant: isActive ? "outline" : "ghost",
2472
+ size,
2473
+ className: cn(className),
2474
+ nativeButton: false,
2475
+ render: /* @__PURE__ */ jsx("a", {
2476
+ role: "link",
2477
+ "aria-current": isActive ? "page" : void 0,
2478
+ "data-slot": "pagination-link",
2479
+ "data-active": isActive,
2480
+ ...props
2481
+ })
2482
+ })
2483
+ });
2484
+ }
2485
+ const SILENT = { sound: false };
2486
+ function PaginationPrevious({ className, text = "Previous", ...props }) {
2487
+ return /* @__PURE__ */ jsxs(PaginationLink, {
2488
+ "aria-label": "Go to previous page",
2489
+ size: "default",
2490
+ className: cn("pl-1.5!", className),
2491
+ ...props,
2492
+ children: [/* @__PURE__ */ jsx("svg", {
2493
+ xmlns: "http://www.w3.org/2000/svg",
2494
+ viewBox: "0 0 24 24",
2495
+ fill: "none",
2496
+ stroke: "currentColor",
2497
+ strokeWidth: "2",
2498
+ strokeLinecap: "round",
2499
+ strokeLinejoin: "round",
2500
+ "aria-hidden": "true",
2501
+ "data-icon": "inline-start",
2502
+ className: "cn-rtl-flip",
2503
+ children: /* @__PURE__ */ jsx("path", { d: "m15 18-6-6 6-6" })
2504
+ }), /* @__PURE__ */ jsx("span", {
2505
+ className: "hidden sm:block",
2506
+ children: text
2507
+ })]
2508
+ });
2509
+ }
2510
+ function PaginationNext({ className, text = "Next", ...props }) {
2511
+ return /* @__PURE__ */ jsxs(PaginationLink, {
2512
+ "aria-label": "Go to next page",
2513
+ size: "default",
2514
+ className: cn("pr-1.5!", className),
2515
+ ...props,
2516
+ children: [/* @__PURE__ */ jsx("span", {
2517
+ className: "hidden sm:block",
2518
+ children: text
2519
+ }), /* @__PURE__ */ jsx("svg", {
2520
+ xmlns: "http://www.w3.org/2000/svg",
2521
+ viewBox: "0 0 24 24",
2522
+ fill: "none",
2523
+ stroke: "currentColor",
2524
+ strokeWidth: "2",
2525
+ strokeLinecap: "round",
2526
+ strokeLinejoin: "round",
2527
+ "aria-hidden": "true",
2528
+ "data-icon": "inline-end",
2529
+ className: "cn-rtl-flip",
2530
+ children: /* @__PURE__ */ jsx("path", { d: "m9 18 6-6-6-6" })
2531
+ })]
2532
+ });
2533
+ }
2534
+ function PaginationEllipsis({ className, ...props }) {
2535
+ return /* @__PURE__ */ jsxs("span", {
2536
+ "aria-hidden": true,
2537
+ "data-slot": "pagination-ellipsis",
2538
+ className: cn("flex size-8 items-center justify-center [&_svg:not([class*='size-'])]:size-4", className),
2539
+ ...props,
2540
+ children: [/* @__PURE__ */ jsxs("svg", {
2541
+ xmlns: "http://www.w3.org/2000/svg",
2542
+ viewBox: "0 0 24 24",
2543
+ fill: "none",
2544
+ stroke: "currentColor",
2545
+ strokeWidth: "2",
2546
+ strokeLinecap: "round",
2547
+ strokeLinejoin: "round",
2548
+ "aria-hidden": "true",
2549
+ children: [
2550
+ /* @__PURE__ */ jsx("circle", {
2551
+ cx: "12",
2552
+ cy: "12",
2553
+ r: "1"
2554
+ }),
2555
+ /* @__PURE__ */ jsx("circle", {
2556
+ cx: "19",
2557
+ cy: "12",
2558
+ r: "1"
2559
+ }),
2560
+ /* @__PURE__ */ jsx("circle", {
2561
+ cx: "5",
2562
+ cy: "12",
2563
+ r: "1"
2564
+ })
2565
+ ]
2566
+ }), /* @__PURE__ */ jsx("span", {
2567
+ className: "sr-only",
2568
+ children: "More pages"
2569
+ })]
2570
+ });
2571
+ }
2222
2572
  // src/popover/popover.tsx
2223
2573
  function Popover({ ...props }) {
2224
2574
  return /* @__PURE__ */ jsx(Popover$1.Root, {
@@ -3525,4 +3875,4 @@ const Toolbar = Object.assign(ToolbarRoot, {
3525
3875
  });
3526
3876
  // src/index.ts
3527
3877
  trackInputModality();
3528
- export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertAction, AlertDescription, AlertTitle, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, Button, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, ComboboxChip, ComboboxChips, ComboboxChipsInput, ComboboxCollection, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxLabel, ComboboxList, ComboboxSeparator, ComboboxTrigger, ComboboxValue, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DirectionProvider, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerSwipeHandle, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, IconSwap, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Kbd, KbdGroup, Label, LoaderProvider, NativeSelect, NativeSelectOptGroup, NativeSelectOption, Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, RadioGroup, RadioGroupItem, SOUND_MAP, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Skeleton, SkeletonContent, Slider, SoundProvider, Spinner, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toast, ToastAction, ToastClose, ToastContent, ToastDescription, ToastPortal, ToastProvider, ToastTitle, ToastViewport, Toaster, ToggleGroup, Toolbar, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, buttonVariants, cn, createToastManager, registerLoader, registerLoaders, tabsListVariants, toast, useComboboxAnchor, useEmptyIllustration, useSound, useToastManager };
3878
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertAction, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, Button, Calendar, CalendarDayButton, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, ComboboxChip, ComboboxChips, ComboboxChipsInput, ComboboxCollection, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxLabel, ComboboxList, ComboboxSeparator, ComboboxTrigger, ComboboxValue, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DirectionProvider, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerSwipeHandle, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, IconSwap, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Kbd, KbdGroup, Label, LoaderProvider, NativeSelect, NativeSelectOptGroup, NativeSelectOption, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, RadioGroup, RadioGroupItem, SOUND_MAP, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Skeleton, SkeletonContent, Slider, SoundProvider, Spinner, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toast, ToastAction, ToastClose, ToastContent, ToastDescription, ToastPortal, ToastProvider, ToastTitle, ToastViewport, Toaster, ToggleGroup, Toolbar, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, buttonVariants, cn, createToastManager, registerLoader, registerLoaders, tabsListVariants, toast, useComboboxAnchor, useEmptyIllustration, useSound, useToastManager };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nsaa/core",
3
- "version": "0.1.0-alpha.0",
3
+ "version": "0.1.0-alpha.1",
4
4
  "description": "Nsaa core components: accessible, token-driven, animated to the Nsaa feel spec.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -42,10 +42,11 @@
42
42
  "cmdk": "1.1.1",
43
43
  "input-otp": "1.5.0",
44
44
  "motion": "^14.7.1",
45
+ "react-day-picker": "9.14.0",
45
46
  "tailwind-merge": "^3.7.0",
46
47
  "tailwind-variants": "^3.3.1",
47
48
  "uisfx": "0.4.0",
48
- "@nsaa/tokens": "^0.1.0-alpha.0"
49
+ "@nsaa/tokens": "^0.1.0-alpha.1"
49
50
  },
50
51
  "devDependencies": {
51
52
  "@testing-library/jest-dom": "^7.0.1",
package/src/feel.css CHANGED
@@ -61,9 +61,11 @@
61
61
  }
62
62
 
63
63
  /* ---------------------------------------------------------------- modal recipe (Phase 1)
64
- Overlay opacity; content from the centre; base in, fast out. Dialog and CommandDialog. */
64
+ Overlay opacity; content from the centre; base in, fast out. Dialog, CommandDialog, Alert Dialog. */
65
65
  [data-slot="dialog-overlay"],
66
- [data-slot="dialog-content"] {
66
+ [data-slot="dialog-content"],
67
+ [data-slot="alert-dialog-overlay"],
68
+ [data-slot="alert-dialog-content"] {
67
69
  transition-property: opacity, scale;
68
70
  transition-duration: calc(var(--nsaa-duration-base) * var(--nsaa-time-scale));
69
71
  transition-timing-function: var(--nsaa-ease-out);
@@ -78,7 +80,8 @@
78
80
  }
79
81
  }
80
82
 
81
- [data-slot="dialog-content"] {
83
+ [data-slot="dialog-content"],
84
+ [data-slot="alert-dialog-content"] {
82
85
  transform-origin: center;
83
86
 
84
87
  &[data-starting-style],
@@ -474,6 +477,7 @@
474
477
  [data-slot="popover-content"],
475
478
  [data-slot="dropdown-menu-content"],
476
479
  [data-slot="dialog-content"],
480
+ [data-slot="alert-dialog-content"],
477
481
  [data-slot="drawer-popup"]
478
482
  ) {
479
483
  --nsaa-il-surface: var(--popover);
@@ -526,7 +530,9 @@
526
530
  [data-slot="context-menu-sub-content"],
527
531
  [data-slot="tooltip-content"],
528
532
  [data-slot="dialog-overlay"],
529
- [data-slot="dialog-content"]
533
+ [data-slot="dialog-content"],
534
+ [data-slot="alert-dialog-overlay"],
535
+ [data-slot="alert-dialog-content"]
530
536
  ) {
531
537
  transition-property: opacity;
532
538
  transition-duration: calc(var(--nsaa-reduced-fade) * var(--nsaa-time-scale));
@@ -688,7 +694,9 @@
688
694
  [data-slot="context-menu-sub-content"],
689
695
  [data-slot="tooltip-content"],
690
696
  [data-slot="dialog-overlay"],
691
- [data-slot="dialog-content"]
697
+ [data-slot="dialog-content"],
698
+ [data-slot="alert-dialog-overlay"],
699
+ [data-slot="alert-dialog-content"]
692
700
  ) {
693
701
  transition-property: opacity;
694
702
  transition-duration: calc(var(--nsaa-reduced-fade) * var(--nsaa-time-scale));
@@ -851,7 +859,9 @@
851
859
  [data-slot="context-menu-sub-content"],
852
860
  [data-slot="tooltip-content"],
853
861
  [data-slot="dialog-overlay"],
854
- [data-slot="dialog-content"]
862
+ [data-slot="dialog-content"],
863
+ [data-slot="alert-dialog-overlay"],
864
+ [data-slot="alert-dialog-content"]
855
865
  )[data-instant],
856
866
  :root[data-nsaa-input="keyboard"]
857
867
  :is(
@@ -865,6 +875,8 @@
865
875
  [data-slot="tooltip-content"],
866
876
  [data-slot="dialog-overlay"],
867
877
  [data-slot="dialog-content"],
878
+ [data-slot="alert-dialog-overlay"],
879
+ [data-slot="alert-dialog-content"],
868
880
  [data-slot="drawer-popup"],
869
881
  [data-slot="drawer-overlay"],
870
882
  [data-slot="accordion-content"],
package/src/styles.css CHANGED
@@ -57,7 +57,8 @@
57
57
  }
58
58
 
59
59
  /* shadcn style hooks: `cn-rtl-flip` marks icons the shadcn CLI mirrors for right-to-left (the submenu
60
- chevrons); `cn-input-otp` is styled by base-nova's style sheet, not by the item's classes. */
60
+ chevrons); `cn-input-otp` and two `cn-calendar-*` classes are styled by base-nova's style sheet, not
61
+ by the item's classes. */
61
62
  @layer components {
62
63
  .cn-rtl-flip:where(:dir(rtl)) {
63
64
  rotate: 180deg;
@@ -67,6 +68,23 @@
67
68
  .cn-input-otp {
68
69
  gap: calc(var(--spacing) * 2);
69
70
  }
71
+
72
+ /* Calendar with captionLayout="dropdown" (#136): style-nova.css draws the month and year
73
+ dropdowns' border and focus ring, and pads the caption label; the item's classes don't. */
74
+ .cn-calendar-dropdown-root {
75
+ border: 1px solid var(--input);
76
+
77
+ &:has(:focus) {
78
+ border-color: var(--ring);
79
+ box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 50%, transparent);
80
+ }
81
+ }
82
+
83
+ .cn-calendar-caption-label {
84
+ height: calc(var(--spacing) * 6);
85
+ padding-right: calc(var(--spacing) * 1);
86
+ padding-left: calc(var(--spacing) * 1.5);
87
+ }
70
88
  }
71
89
 
72
90
  /* Hover only where hovering is real (fine pointers), never on disabled, busy or read-only controls. */