@yuhuanowo/yunui 0.2.5 → 0.2.7

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
@@ -1,6 +1,6 @@
1
1
  import * as framer_motion from 'framer-motion';
2
2
  import * as React$1 from 'react';
3
- import { ReactNode } from 'react';
3
+ import { ReactNode, RefObject } from 'react';
4
4
  import * as DialogPrimitive from '@radix-ui/react-dialog';
5
5
  import * as TooltipPrimitive from '@radix-ui/react-tooltip';
6
6
  import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
@@ -446,6 +446,53 @@ interface TextareaProps extends React$1.TextareaHTMLAttributes<HTMLTextAreaEleme
446
446
  }
447
447
  /** Multi-line text input with an inline error message. */
448
448
  declare const Textarea: React$1.ForwardRefExoticComponent<TextareaProps & React$1.RefAttributes<HTMLTextAreaElement>>;
449
+ interface PasswordInputProps extends Omit<InputProps, "icon" | "type"> {
450
+ /** Accessible labels for the reveal toggle (English defaults). */
451
+ labels?: {
452
+ show?: string;
453
+ hide?: string;
454
+ };
455
+ }
456
+ /** Password field with a show/hide reveal toggle; same styling + error API as Input. */
457
+ declare const PasswordInput: React$1.ForwardRefExoticComponent<PasswordInputProps & React$1.RefAttributes<HTMLInputElement>>;
458
+ interface NumberInputProps extends Omit<React$1.InputHTMLAttributes<HTMLInputElement>, "onChange" | "value" | "type"> {
459
+ /** Current value (controlled). */
460
+ value?: number;
461
+ /** Called with the next clamped value. */
462
+ onChange?: (value: number) => void;
463
+ min?: number;
464
+ max?: number;
465
+ /** Increment/decrement step. @defaultValue 1 */
466
+ step?: number;
467
+ /** Error message shown below the field; also switches the border to a red error style. */
468
+ error?: string;
469
+ /** Accessible labels for the steppers (English defaults). */
470
+ labels?: {
471
+ increment?: string;
472
+ decrement?: string;
473
+ };
474
+ }
475
+ /** Numeric field with −/+ steppers, min/max clamping, and the Input error API. */
476
+ declare const NumberInput: React$1.ForwardRefExoticComponent<NumberInputProps & React$1.RefAttributes<HTMLInputElement>>;
477
+ /** Inline keyboard-key / shortcut display, e.g. `<Kbd>⌘</Kbd><Kbd>K</Kbd>`. */
478
+ declare function Kbd({ className, ...props }: React$1.HTMLAttributes<HTMLElement>): React$1.JSX.Element;
479
+ interface SearchInputProps extends Omit<React$1.InputHTMLAttributes<HTMLInputElement>, "onChange" | "value" | "type"> {
480
+ /** Current query (controlled). */
481
+ value?: string;
482
+ /** Called with the new query string — also called with `""` when cleared. */
483
+ onChange?: (value: string) => void;
484
+ /** Show a clear (×) button while there's a value. @defaultValue true */
485
+ clearable?: boolean;
486
+ /** Accessible label for the clear button (English default). */
487
+ clearLabel?: string;
488
+ }
489
+ /**
490
+ * Canonical search field: a leading magnifier with the right padding so typed
491
+ * text never sits under the icon, plus an optional clear (×) button. `onChange`
492
+ * receives the string directly (ergonomic for filtering), and the clear button
493
+ * fires `onChange("")`. Use this instead of hand-rolling `<input> + absolute icon`.
494
+ */
495
+ declare const SearchInput: React$1.ForwardRefExoticComponent<SearchInputProps & React$1.RefAttributes<HTMLInputElement>>;
449
496
  interface CardProps extends React$1.HTMLAttributes<HTMLDivElement> {
450
497
  /** Add a hover lift (border + shadow transition). */
451
498
  hover?: boolean;
@@ -458,6 +505,50 @@ interface BadgeProps extends React$1.HTMLAttributes<HTMLSpanElement> {
458
505
  }
459
506
  /** Small inline pill for status/labels, with semantic color variants. */
460
507
  declare function Badge({ className, variant, ...props }: BadgeProps): React$1.JSX.Element;
508
+ interface SeparatorProps extends React$1.HTMLAttributes<HTMLDivElement> {
509
+ orientation?: "horizontal" | "vertical";
510
+ /** Purely decorative — no semantic role announced to assistive tech. */
511
+ decorative?: boolean;
512
+ }
513
+ /** A thin divider line. Horizontal by default; set `orientation="vertical"` inside a flex row. */
514
+ declare function Separator({ className, orientation, decorative, ...props }: SeparatorProps): React$1.JSX.Element;
515
+ interface AlertProps extends Omit<React$1.HTMLAttributes<HTMLDivElement>, "title"> {
516
+ variant?: "info" | "success" | "warning" | "error";
517
+ /** Optional bold title above the body. */
518
+ title?: React$1.ReactNode;
519
+ /** Leading icon. Defaults to a variant-appropriate icon; pass `null` to hide. */
520
+ icon?: React$1.ReactNode;
521
+ }
522
+ /** Inline callout for info / success / warning / error messages. */
523
+ declare function Alert({ className, variant, title, icon, children, ...props }: AlertProps): React$1.JSX.Element;
524
+ interface TagProps extends React$1.HTMLAttributes<HTMLSpanElement> {
525
+ /** Show a remove (×) button and call this when it's pressed. */
526
+ onRemove?: () => void;
527
+ /** Accessible label for the remove button (English default). */
528
+ removeLabel?: string;
529
+ }
530
+ /** A small label, optionally removable. Use `Badge` for non-interactive status text. */
531
+ declare function Tag({ className, children, onRemove, removeLabel, ...props }: TagProps): React$1.JSX.Element;
532
+ interface StatusIndicatorProps extends React$1.HTMLAttributes<HTMLSpanElement> {
533
+ status?: "online" | "offline" | "busy" | "away" | "neutral";
534
+ /** Add a pulsing halo to signal "live". */
535
+ pulse?: boolean;
536
+ }
537
+ /** A small colored status dot with an optional label (e.g. provider online/offline). */
538
+ declare function StatusIndicator({ status, pulse, className, children, ...props }: StatusIndicatorProps): React$1.JSX.Element;
539
+ /** Inline `<code>` styling for code spans in prose or chat. Use `Kbd` for keys. */
540
+ declare function InlineCode({ className, ...props }: React$1.HTMLAttributes<HTMLElement>): React$1.JSX.Element;
541
+ interface Step {
542
+ title: React$1.ReactNode;
543
+ description?: React$1.ReactNode;
544
+ }
545
+ interface StepsProps extends Omit<React$1.HTMLAttributes<HTMLOListElement>, "children"> {
546
+ steps: Step[];
547
+ /** Zero-based index of the active step; earlier steps render as completed. */
548
+ current?: number;
549
+ }
550
+ /** Vertical progress stepper: completed / active / upcoming states with a connector. */
551
+ declare function Steps({ steps, current, className, ...props }: StepsProps): React$1.JSX.Element;
461
552
  /**
462
553
  * Radix Dialog root — controls open state for a modal dialog. Compose with Dialog* parts.
463
554
  *
@@ -530,6 +621,12 @@ declare const Avatar: React$1.ForwardRefExoticComponent<Omit<AvatarPrimitive.Ava
530
621
  declare const AvatarImage: React$1.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarImageProps & React$1.RefAttributes<HTMLImageElement>, "ref"> & React$1.RefAttributes<HTMLImageElement>>;
531
622
  /** Placeholder (e.g. initials) shown when the avatar image is missing or loading. */
532
623
  declare const AvatarFallback: React$1.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarFallbackProps & React$1.RefAttributes<HTMLSpanElement>, "ref"> & React$1.RefAttributes<HTMLSpanElement>>;
624
+ interface AvatarGroupProps extends React$1.HTMLAttributes<HTMLDivElement> {
625
+ /** Cap how many avatars render; the remainder collapse into a "+N" chip. */
626
+ max?: number;
627
+ }
628
+ /** Overlapping row of `Avatar`s with an optional "+N" overflow chip. */
629
+ declare function AvatarGroup({ className, max, children, ...props }: AvatarGroupProps): React$1.JSX.Element;
533
630
  /** Wraps tooltips to share open/close timing; place once near the app root. */
534
631
  declare const TooltipProvider: React$1.FC<TooltipPrimitive.TooltipProviderProps>;
535
632
  /** Radix Tooltip root — pairs a trigger with its content. */
@@ -861,6 +958,7 @@ declare const toast: {
861
958
  *
862
959
  * Used by modals, dialogs, and other overlays to close on Escape key.
863
960
  */
961
+
864
962
  /**
865
963
  * Hook that calls the callback when Escape key is pressed
866
964
  *
@@ -893,6 +991,7 @@ declare function useBodyScrollLock(locked?: boolean): void;
893
991
  * ```
894
992
  */
895
993
  declare function useModalBehavior(isOpen: boolean, onClose: () => void): void;
994
+ declare function useFocusTrap(containerRef: RefObject<HTMLElement | null>, enabled?: boolean): void;
896
995
 
897
996
  /**
898
997
  * Runtime theming for YunUI's token system.
@@ -952,4 +1051,4 @@ declare function readTheme(el?: HTMLElement | null): YunUITheme;
952
1051
  */
953
1052
  declare function useYunUITheme(defaults?: YunUITheme): [YunUITheme, (patch: YunUITheme) => void];
954
1053
 
955
- export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AnimatedNumber, type AnimatedNumberProps, Avatar, AvatarFallback, AvatarImage, Badge, BentoCard, BentoGrid, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Card, Checkbox, type CheckboxProps, Collapsible, CollapsibleContent, type CollapsibleContentProps, type CollapsibleProps, CollapsibleTrigger, type CollapsibleTriggerProps, Column, Combobox, type ComboboxOption, ConfirmModal, type ConfirmModalVariant, CustomSelect, DeleteConfirmModal, 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, EmptyState, Flex, type FlexProps, Grid, type GridCount, type GridProps, IconButton, Input, Label, Marquee, Modal, MotionDiv, MotionSpan, type NavTab, NavTabs, PageLoader, Pagination, type PaginationProps, Popover, PopoverClose, PopoverContent, PopoverTrigger, Progress, RadioGroup, RadioGroupItem, RegenerateConfirmModal, Row, type SegmentedOption, SegmentedSelect, Select, SelectContent, SelectGroup, SelectItem, type SelectOption, SelectTrigger, SelectValue, Sheet, ShinyButton, Skeleton, Slider, type SpacingScale, Spinner, Stack, Switch, type SwitchProps, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, TableBody as Tbody, TableCell as Td, Textarea, TableFooter as Tfoot, TableHead as Th, TableHeader as Thead, ThemeToggle, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TableRow as Tr, YUNUI_PALETTES, type YunUIAccentSource, type YunUIColorScheme, type YunUIPalette, type YunUISolid, type YunUISurface, type YunUITheme, applyTheme, cn, fadeIn, readTheme, staggerContainer, staggerItem, toast, useBodyScrollLock, useEscapeKey, useModalBehavior, useYunUITheme };
1054
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AnimatedNumber, type AnimatedNumberProps, Avatar, AvatarFallback, AvatarGroup, AvatarImage, Badge, BentoCard, BentoGrid, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Card, Checkbox, type CheckboxProps, Collapsible, CollapsibleContent, type CollapsibleContentProps, type CollapsibleProps, CollapsibleTrigger, type CollapsibleTriggerProps, Column, Combobox, type ComboboxOption, ConfirmModal, type ConfirmModalVariant, CustomSelect, DeleteConfirmModal, 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, EmptyState, Flex, type FlexProps, Grid, type GridCount, type GridProps, IconButton, InlineCode, Input, Kbd, Label, Marquee, Modal, MotionDiv, MotionSpan, type NavTab, NavTabs, NumberInput, PageLoader, Pagination, type PaginationProps, PasswordInput, Popover, PopoverClose, PopoverContent, PopoverTrigger, Progress, RadioGroup, RadioGroupItem, RegenerateConfirmModal, Row, SearchInput, type SegmentedOption, SegmentedSelect, Select, SelectContent, SelectGroup, SelectItem, type SelectOption, SelectTrigger, SelectValue, Separator, Sheet, ShinyButton, Skeleton, Slider, type SpacingScale, Spinner, Stack, StatusIndicator, Steps, Switch, type SwitchProps, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tag, TableBody as Tbody, TableCell as Td, Textarea, TableFooter as Tfoot, TableHead as Th, TableHeader as Thead, ThemeToggle, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TableRow as Tr, YUNUI_PALETTES, type YunUIAccentSource, type YunUIColorScheme, type YunUIPalette, type YunUISolid, type YunUISurface, type YunUITheme, applyTheme, cn, fadeIn, readTheme, staggerContainer, staggerItem, toast, useBodyScrollLock, useEscapeKey, useFocusTrap, useModalBehavior, useYunUITheme };
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AnimatedNumber, Avatar, AvatarFallback, AvatarImage, Badge, BentoCard, BentoGrid, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Card, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Column, Combobox, ConfirmModal, CustomSelect, DeleteConfirmModal, 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, EmptyState, Flex, Grid, IconButton, Input, Label, Marquee, Modal, MotionDiv, MotionSpan, NavTabs, PageLoader, Pagination, Popover, PopoverClose, PopoverContent, PopoverTrigger, Progress, RadioGroup, RadioGroupItem, RegenerateConfirmModal, Row, SegmentedSelect, Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue, Sheet, ShinyButton, Skeleton, Slider, Spinner, Stack, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, TableBody as Tbody, TableCell as Td, Textarea, TableFooter as Tfoot, TableHead as Th, TableHeader as Thead, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TableRow as Tr, YUNUI_PALETTES, applyTheme, fadeIn, readTheme, staggerContainer, staggerItem, toast, useBodyScrollLock, useEscapeKey, useModalBehavior, useYunUITheme } from './chunk-THKP6TBK.js';
2
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AnimatedNumber, Avatar, AvatarFallback, AvatarGroup, AvatarImage, Badge, BentoCard, BentoGrid, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Card, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Column, Combobox, ConfirmModal, CustomSelect, DeleteConfirmModal, 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, EmptyState, Flex, Grid, IconButton, InlineCode, Input, Kbd, Label, Marquee, Modal, MotionDiv, MotionSpan, NavTabs, NumberInput, PageLoader, Pagination, PasswordInput, Popover, PopoverClose, PopoverContent, PopoverTrigger, Progress, RadioGroup, RadioGroupItem, RegenerateConfirmModal, Row, SearchInput, SegmentedSelect, Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue, Separator, Sheet, ShinyButton, Skeleton, Slider, Spinner, Stack, StatusIndicator, Steps, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tag, TableBody as Tbody, TableCell as Td, Textarea, TableFooter as Tfoot, TableHead as Th, TableHeader as Thead, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TableRow as Tr, YUNUI_PALETTES, applyTheme, fadeIn, readTheme, staggerContainer, staggerItem, toast, useBodyScrollLock, useEscapeKey, useFocusTrap, useModalBehavior, useYunUITheme } from './chunk-EROX7LXU.js';
3
3
  export { ThemeToggle, cn } from './chunk-TFZKMJGF.js';
4
4
  import './chunk-U2LNRVMI.js';
5
5
  //# sourceMappingURL=index.js.map
package/dist/patterns.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { Button, Card, Badge, Avatar, AvatarImage, AvatarFallback, IconButton, Spinner } from './chunk-THKP6TBK.js';
2
+ import { Button, Card, Badge, Avatar, AvatarImage, AvatarFallback, IconButton, Spinner } from './chunk-EROX7LXU.js';
3
3
  import { copyToClipboard } from './chunk-BO6CDGJS.js';
4
4
  export { Footer } from './chunk-BO6CDGJS.js';
5
5
  import { cn } from './chunk-TFZKMJGF.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuhuanowo/yunui",
3
- "version": "0.2.5",
3
+ "version": "0.2.7",
4
4
  "description": "A versioned React 19 + Tailwind v4 design system — tokens, primitives, patterns, and AI components, in one package.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
package/styles/yunui.css CHANGED
@@ -528,6 +528,24 @@ body {
528
528
  box-shadow: var(--shadow-md);
529
529
  }
530
530
 
531
+ /* Lay a card out as a column so its footer can pin to the bottom. In a grid of
532
+ equal-height cards (align-items: stretch, the default), every footer then lines
533
+ up no matter how much body content each card has — fixes the "footer floats in
534
+ a short card" problem once, here, instead of per call site. */
535
+ .card-col {
536
+ display: flex;
537
+ flex-direction: column;
538
+ height: 100%;
539
+ }
540
+
541
+ /* Footer pinned to the bottom of a `.card-col`, with the standard hairline rule.
542
+ Add your own flex/justify utilities for the footer's inner layout. */
543
+ .card-footer {
544
+ margin-top: auto;
545
+ padding-top: 1rem;
546
+ border-top: 1px solid var(--border-hairline);
547
+ }
548
+
531
549
  .stat-card {
532
550
  background: var(--bg-card);
533
551
  backdrop-filter: blur(12px);