@reeverdev/ui 0.3.2 → 0.3.4
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/adapters/react-hook-form/index.cjs +2 -0
- package/dist/adapters/react-hook-form/index.cjs.map +1 -0
- package/dist/adapters/react-hook-form/index.d.cts +229 -0
- package/dist/adapters/react-hook-form/index.d.ts +229 -0
- package/dist/adapters/react-hook-form/index.js +2 -0
- package/dist/adapters/react-hook-form/index.js.map +1 -0
- package/dist/index.cjs +6 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +651 -11
- package/dist/index.d.ts +651 -11
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +24 -4
package/dist/index.d.cts
CHANGED
|
@@ -1651,8 +1651,6 @@ interface CurrencyInputProps extends Omit<React$1.InputHTMLAttributes<HTMLInputE
|
|
|
1651
1651
|
/** Border radius */
|
|
1652
1652
|
radius?: "none" | "sm" | "md" | "lg" | "full";
|
|
1653
1653
|
}
|
|
1654
|
-
declare const formatCurrency: (value: number, decimals: number, thousandSeparator: string, decimalSeparator: string) => string;
|
|
1655
|
-
declare const parseFormattedValue: (value: string, thousandSeparator: string, decimalSeparator: string) => number | undefined;
|
|
1656
1654
|
declare const CurrencyInput: React$1.ForwardRefExoticComponent<CurrencyInputProps & React$1.RefAttributes<HTMLInputElement>>;
|
|
1657
1655
|
|
|
1658
1656
|
declare const maskedInputVariants: (props?: ({
|
|
@@ -3071,11 +3069,7 @@ interface DatePickerProps extends Omit<React$1.InputHTMLAttributes<HTMLInputElem
|
|
|
3071
3069
|
*/
|
|
3072
3070
|
fullWidth?: boolean;
|
|
3073
3071
|
}
|
|
3074
|
-
declare const formatDate: (date: Date | null, format: DateFormat) => string;
|
|
3075
|
-
declare const parseDate: (value: string, format: DateFormat) => Date | null;
|
|
3076
3072
|
declare const DatePicker: React$1.ForwardRefExoticComponent<DatePickerProps & React$1.RefAttributes<HTMLInputElement>>;
|
|
3077
|
-
declare const DateInput: React$1.ForwardRefExoticComponent<DatePickerProps & React$1.RefAttributes<HTMLInputElement>>;
|
|
3078
|
-
declare const DateField: React$1.ForwardRefExoticComponent<DatePickerProps & React$1.RefAttributes<HTMLInputElement>>;
|
|
3079
3073
|
|
|
3080
3074
|
declare const buttonGroupVariants: (props?: ({
|
|
3081
3075
|
variant?: "default" | "attached" | null | undefined;
|
|
@@ -3282,10 +3276,6 @@ declare const ColorSwatchPicker: React$1.ForwardRefExoticComponent<ColorSwatchPi
|
|
|
3282
3276
|
declare const colorAreaVariants: (props?: ({
|
|
3283
3277
|
size?: "sm" | "md" | "lg" | "full" | null | undefined;
|
|
3284
3278
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
3285
|
-
declare const hsvToRgb: (h: number, s: number, v: number) => [number, number, number];
|
|
3286
|
-
declare const rgbToHsv: (r: number, g: number, b: number) => [number, number, number];
|
|
3287
|
-
declare const hexToRgb: (hex: string) => [number, number, number] | null;
|
|
3288
|
-
declare const rgbToHex: (r: number, g: number, b: number) => string;
|
|
3289
3279
|
interface ColorAreaValue {
|
|
3290
3280
|
hue: number;
|
|
3291
3281
|
saturation: number;
|
|
@@ -7303,4 +7293,654 @@ declare function getPasswordStrengthColor(strength: number): string;
|
|
|
7303
7293
|
*/
|
|
7304
7294
|
declare function getPasswordStrengthLabel(strength: number): string;
|
|
7305
7295
|
|
|
7306
|
-
export { Accordion, AccordionItem, type AccordionItemProps, type AccordionProps, ActionBar, ActionBarButton, type ActionBarProps, ActionGroup, type ActionGroupItem, type ActionGroupProps, ActionSheet, type ActionSheetItem, type ActionSheetProps, Alert, AlertDescription, type AlertRadius, AlertTitle, type AlertType, type AlertVariant, type AllowDropInfo, AreaChart, type AreaChartProps, AspectRatio, AudioPlayer, type AudioPlayerProps, type AudioTrack, Autocomplete, type AutocompleteOption, type AutocompleteProps, Avatar, AvatarFallback, AvatarGroup, type AvatarGroupItem, type AvatarGroupProps, AvatarImage, BackTop, type BackTopProps, Badge, type BadgeProps, Banner, type BannerProps, BarChart, type BarChartProps, Blockquote, type BlockquoteProps, BottomNavigation, type BottomNavigationItem, type BottomNavigationProps, Bounce, type BounceProps, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, COUNTRIES, Calendar, type CalendarEvent, type CalendarProps, type CalendarView, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, type CarouselApi, CarouselContent, CarouselItem, type CarouselItemProps, CarouselNext, CarouselPrevious, type CarouselProps, type ChartDataPoint, type CheckInfo, Checkbox, Checkmark, type CheckmarkProps, type CheckmarkSize, type CheckmarkVariant, Chip, type ChipProps, CircularProgress, CloseButton, type CloseButtonProps, Code, CodeBlock, type CodeBlockProps, type CodeBlockTabItem, Collapse, type CollapseProps, Collapsible, CollapsibleContent, CollapsibleTrigger, type Color, ColorArea, type ColorAreaProps, type ColorAreaValue, ColorPicker, type ColorPickerProps, ColorSlider, type ColorSliderChannel, type ColorSliderProps, ColorSwatch, ColorSwatchPicker, type ColorSwatchPickerProps, type ColorSwatchProps, ColorWheel, type ColorWheelProps, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, type CommandItemProps, CommandList, CommandSeparator, CommandShortcut, Confetti, type ConfettiOptions, type ConfettiProps, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuPortal, ContextMenuSection, type ContextMenuSectionProps, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, ContextualHelp, type ContextualHelpProps, CopyButton, type CopyButtonProps, Counter, type CounterProps, type Country, CurrencyInput, type CurrencyInputProps, DEFAULT_COLORS, DataTable, type DataTableProps, DateField, type DateFormat, DateInput, DatePicker, type DatePickerProps, DateRangePicker, type DateRangePickerProps, type DragInfo, type DraggableConfig, Drawer, type DrawerBackdrop, DrawerBody, DrawerClose, type DrawerCollapsible, DrawerContent, DrawerDescription, DrawerFooter, DrawerGroup, DrawerGroupLabel, DrawerHeader, DrawerInset, DrawerMenu, DrawerMenuButton, DrawerMenuItem, type DrawerMode, type DrawerPlacement, type DrawerProps, DrawerProvider, DrawerSeparator, DrawerSidebar, type DrawerSidebarProps, type DrawerSize, DrawerTitle, DrawerToggle, DrawerTrigger, type DrawerVariant, type DropInfo, Dropdown, DropdownContent, type DropdownContentProps, DropdownGroup, type DropdownGroupProps, DropdownItem, type DropdownItemProps, DropdownLabel, type DropdownProps, DropdownSection, type DropdownSectionProps, DropdownSeparator, type DropdownSeparatorProps, DropdownShortcut, DropdownSub, DropdownSubContent, type DropdownSubContentProps, type DropdownSubProps, DropdownSubTrigger, type DropdownSubTriggerProps, DropdownTrigger, type DropdownTriggerProps, EMOJIS, EMOJI_CATEGORIES, EmojiPicker, type EmojiPickerProps, EmptyState, Expand, type ExpandInfo, type ExpandProps, FAB, type FABAction, Fade, type FadeProps, FieldContext, type FieldContextValue, type FieldState, type FileRejection, FileUpload, type FileUploadProps, type FlatCheckInfo, type FlatSelectInfo, Flip, type FlipDirection, type FlipProps, FloatingActionButton, type FloatingActionButtonProps, Form, FormContext, type FormContextValue, FormControl, type FormControlProps, FormDescription, type FormDescriptionProps, FormField, type FormFieldProps, FormItem, type FormItemProps, FormLabel, type FormLabelProps, FormMessage, type FormMessageProps, type FormProps, type FormState, FullCalendar, type FullCalendarProps, Glow, type GlowProps, GridList, type GridListItem, type GridListProps, H1, type H1Props, H2, type H2Props, H3, type H3Props, H4, type H4Props, HeatmapCalendar, type HeatmapCalendarProps, type HeatmapValue, HoverCard, HoverCardContent, HoverCardTrigger, Image, ImageComparison, type ImageComparisonProps, ImageCropper, type ImageCropperProps, ImageViewer, type ImageViewerProps, ImageViewerTrigger, type ImageViewerTriggerProps, InfiniteScroll, type InfiniteScrollProps, InlineCode, type InlineCodeProps, Input, InputOTP, InputOTPGroup, type InputOTPProps, InputOTPSeparator, InputOTPSlot, type InputOTPSlotProps, type InputProps, KanbanBoard, type KanbanBoardProps, type KanbanCard, type KanbanColumn, Kbd, type KbdProps, Label, type Language, Large, type LargeProps, Lead, type LeadProps, LineChart, type LineChartProps, Link, type LinkProps, List, type ListDataItem, ListItemComponent as ListItem, type ListItemComponentProps, ListItemText, type ListItemTextProps, type ListProps, Loading, type LoadingProps, MASK_PRESETS, type MaskChar, type MaskDefinition, type MaskPreset, MaskedInput, type MaskedInputProps, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSection, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, Modal, type ModalBackdrop, ModalBody, ModalClose, ModalContent, ModalDescription, ModalFooter, ModalHeader, ModalOverlay, type ModalPlacement, ModalPortal, type ModalProps, ModalRoot, type ModalScrollBehavior, ModalTitle, ModalTrigger, Muted, type MutedProps, Navbar, NavbarBrand, NavbarContent, NavbarItem, NavbarLink, type NavbarProps, NavigationMenu, NavigationMenuContent, type NavigationMenuContentProps, NavigationMenuIndicator, type NavigationMenuIndicatorProps, NavigationMenuItem, type NavigationMenuItemProps, NavigationMenuLink, type NavigationMenuLinkProps, NavigationMenuList, type NavigationMenuListProps, type NavigationMenuProps, NavigationMenuTrigger, type NavigationMenuTriggerProps, NavigationMenuViewport, NumberField, type NumberFieldProps, NumberInput, type NumberInputProps, PDFViewer, type PDFViewerProps, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, type PaginationState, Paragraph, type ParagraphProps, Parallax, type ParallaxProps, PasswordInput, type PasswordInputProps, type PasswordRequirement, PhoneInput, type PhoneInputProps, PieChart, type PieChartProps, Pop, type PopProps, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress, PullToRefresh, type PullToRefreshProps, Pulse, type PulseProps, type PulseSpeed, QRCode, type QRCodeProps, type QRCodeRef, Radio, RadioContent, type RadioContentProps, RadioControl, type RadioControlProps, RadioDescription, type RadioDescriptionProps, RadioGroup, type RadioGroupProps, RadioIndicator, type RadioIndicatorProps, RadioLabel, type RadioLabelProps, type RadioProps, type Radius, RangeSlider, type RangeSliderProps, Rating, type RatingProps, ReeverUIContext, type ReeverUIContextValue, ReeverUIProvider, type ReeverUIProviderProps, ResizableHandle, type ResizableHandleProps, ResizablePanel, ResizablePanelGroup, type ResizablePanelGroupProps, Ripple, type RippleProps, Rotate, type RotateProps, Scale, type ScaleOrigin, type ScaleProps, ScrollArea, type ScrollAreaProps, ScrollProgress, type ScrollProgressPosition, type ScrollProgressProps, ScrollReveal, type ScrollRevealDirection, type ScrollRevealProps, Select, SelectField, type SelectFieldProps, type SelectInfo, type SelectOption, type SelectProps, Separator, type SeparatorProps, Shake, type ShakeIntensity, type ShakeProps, Shimmer, type ShimmerDirection, type ShimmerProps, Skeleton, Slide, type SlideDirection, type SlideProps, Slider, Small, type SmallProps, Snippet, type SortDirection, type SortState, Sparkles, type SparklesProps, Spinner, type SpotlightItem, SpotlightSearch, type SpotlightSearchProps, StatCard, Step, type StepProps, Steps, type StepsProps, type SwipeAction, SwipeActions, type SwipeActionsProps, Switch, type SwitchColor, type SwitchProps, type SwitchSize, TabbedCodeBlock, type TabbedCodeBlockProps, Table, TableBody, TableCaption, TableCell, type TableColumn, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, type Tag, TagInput, type TagInputProps, TextBadge, type TextBadgeProps, TextField, type TextFieldProps, TextReveal, type TextRevealDirection, type TextRevealProps, Textarea, TextareaField, type TextareaFieldProps, type TextareaProps, ThemeProvider, type ThemeProviderProps, ThemeToggle, type ThemeToggleProps, TimeInput, type TimeInputProps, TimePicker, type TimePickerProps, Timeline, TimelineContent, TimelineItem, TimelineOpposite, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, type TooltipProps, type TransitionProps, Tree, type TreeNode, type TreeProps, Typewriter, type TypewriterProps, UL, type ULProps, type UploadedFile, User, type ValidationRule, VideoPlayer, type VideoPlayerProps, type VideoSource, type ViewerImage, Wiggle, type WiggleProps, WordRotate, type WordRotateProps, actionBarVariants, actionGroupVariants, actionSheetItemVariants, alertVariants, applyMask, autocompleteInputVariants, avatarGroupVariants, backTopVariants, badgeIndicatorVariants, bannerVariants, bottomNavigationVariants, buttonGroupVariants, buttonVariants, calculatePasswordStrength, cardVariants, carouselVariants, chartContainerVariants, chipVariants, circularProgressVariants, closeButtonVariants, cn, codeVariants, colorAreaVariants, colorSliderVariants, colorSwatchPickerVariants, colorSwatchVariants, colorWheelVariants, contextualHelpTriggerVariants, copyButtonVariants, currencyInputVariants, datePickerVariants, defaultPasswordRequirements, drawerMenuButtonVariants, emojiPickerVariants, emptyStateVariants, fabVariants, fileUploadVariants, formatCurrency, formatDate, formatFileSize, formatPhoneNumber, fullCalendarVariants, getFileIcon, getMaskPlaceholder, getPasswordStrengthColor, getPasswordStrengthLabel, gridListItemVariants, gridListVariants, hexToRgb, hsvToRgb, imageCropperVariants, imageVariants, infiniteScrollLoaderVariants, infiniteScrollVariants, inputOTPVariants, kbdVariants, listItemVariants, listVariants, loadingVariants, maskedInputVariants, modalContentVariants, navbarVariants, navigationMenuLinkStyle, navigationMenuTriggerStyle, parseDate, parseFormattedValue, phoneInputVariants, pullToRefreshVariants, qrCodeVariants, rangeSliderVariants, ratingVariants, rgbToHex, rgbToHsv, selectVariants, skeletonVariants, snippetVariants, spinnerVariants, statCardVariants, stepVariants, stepsVariants, swipeActionVariants, swipeActionsVariants, colorMap as switchColors, tagVariants, textBadgeVariants, themeToggleVariants, timeInputVariants, timelineItemVariants, timelineVariants, toggleVariants, treeItemVariants, treeVariants, unmask, useAnimatedValue, useAsync, useAsyncRetry, useBodyScrollLock, useBooleanToggle, useBreakpoint, useBreakpoints, useButtonGroup, useCarousel, useClickOutside, useClickOutsideMultiple, useConfetti, useCopy, useCopyToClipboard, useCountdown, useCounter, useCycle, useDebounce, useDebouncedCallback, useDebouncedCallbackWithControls, useDelayedValue, useDisclosure, useDisclosureOpen, useDistance, useDocumentIsVisible, useDocumentVisibility, useDocumentVisibilityCallback, useDrawer, useElementSize, useEventListener, useEventListenerRef, useFetch, useFieldContext, useFocusTrap, useFocusTrapRef, useFormContext, useFullscreen, useFullscreenRef, useGeolocation, useHotkeys, useHotkeysMap, useHover, useHoverDelay, useHoverProps, useHoverRef, useIdle, useIdleCallback, useIncrementCounter, useIntersectionObserver, useIntersectionObserverRef, useInterval, useIntervalControls, useIsDesktop, useIsMobile, useIsTablet, useKeyPress, useKeyPressed, useKeyboardShortcut, useLazyLoad, useList, useLocalStorage, useLongPress, useMap, useMediaPermission, useMediaQuery, useMouse, useMouseElement, useMouseElementRef, useMutation, useMutationObserver, useMutationObserverRef, useNotificationPermission, useOnlineStatus, useOnlineStatusCallback, usePermission, usePrefersColorScheme, usePrefersReducedMotion, usePrevious, usePreviousDistinct, usePreviousWithInitial, useQueue, useRafLoop, useRecord, useReeverUI, useResizeObserver, useResizeObserverRef, useScrollLock, useScrollPosition, useSelection, useSessionStorage, useSet, useSpeechRecognition, useSpeechSynthesis, useSpotlight, useSpringValue, useStack, useThrottle, useThrottledCallback, useTimeout, useTimeoutControls, useTimeoutFlag, useTimer, useToggle, useWindowHeight, useWindowScroll, useWindowSize, useWindowWidth, userVariants, validateFile, validators };
|
|
7296
|
+
/**
|
|
7297
|
+
* Color Utilities
|
|
7298
|
+
*
|
|
7299
|
+
* Utility functions for color manipulation, conversion, and contrast calculation.
|
|
7300
|
+
*
|
|
7301
|
+
* @example
|
|
7302
|
+
* ```tsx
|
|
7303
|
+
* import { hexToRgb, rgbToHsl, getContrastRatio, isLightColor } from "@reeverdev/ui";
|
|
7304
|
+
*
|
|
7305
|
+
* const rgb = hexToRgb("#3b82f6"); // { r: 59, g: 130, b: 246 }
|
|
7306
|
+
* const hsl = rgbToHsl(59, 130, 246); // { h: 217, s: 91, l: 60 }
|
|
7307
|
+
* const contrast = getContrastRatio("#000000", "#ffffff"); // 21
|
|
7308
|
+
* const isLight = isLightColor("#f5f5f5"); // true
|
|
7309
|
+
* ```
|
|
7310
|
+
*/
|
|
7311
|
+
interface RGB {
|
|
7312
|
+
r: number;
|
|
7313
|
+
g: number;
|
|
7314
|
+
b: number;
|
|
7315
|
+
}
|
|
7316
|
+
interface RGBA extends RGB {
|
|
7317
|
+
a: number;
|
|
7318
|
+
}
|
|
7319
|
+
interface HSL {
|
|
7320
|
+
h: number;
|
|
7321
|
+
s: number;
|
|
7322
|
+
l: number;
|
|
7323
|
+
}
|
|
7324
|
+
interface HSLA extends HSL {
|
|
7325
|
+
a: number;
|
|
7326
|
+
}
|
|
7327
|
+
/**
|
|
7328
|
+
* Convert hex color to RGB
|
|
7329
|
+
* @param hex - Hex color string (e.g., "#3b82f6" or "3b82f6")
|
|
7330
|
+
* @returns RGB object or null if invalid
|
|
7331
|
+
*/
|
|
7332
|
+
declare function hexToRgb(hex: string): RGB | null;
|
|
7333
|
+
/**
|
|
7334
|
+
* Convert hex color to RGBA
|
|
7335
|
+
* @param hex - Hex color string with optional alpha (e.g., "#3b82f680")
|
|
7336
|
+
* @returns RGBA object or null if invalid
|
|
7337
|
+
*/
|
|
7338
|
+
declare function hexToRgba(hex: string): RGBA | null;
|
|
7339
|
+
/**
|
|
7340
|
+
* Convert RGB to hex color
|
|
7341
|
+
* @param r - Red (0-255)
|
|
7342
|
+
* @param g - Green (0-255)
|
|
7343
|
+
* @param b - Blue (0-255)
|
|
7344
|
+
* @returns Hex color string
|
|
7345
|
+
*/
|
|
7346
|
+
declare function rgbToHex(r: number, g: number, b: number): string;
|
|
7347
|
+
/**
|
|
7348
|
+
* Convert RGBA to hex color with alpha
|
|
7349
|
+
* @param r - Red (0-255)
|
|
7350
|
+
* @param g - Green (0-255)
|
|
7351
|
+
* @param b - Blue (0-255)
|
|
7352
|
+
* @param a - Alpha (0-1)
|
|
7353
|
+
* @returns Hex color string with alpha
|
|
7354
|
+
*/
|
|
7355
|
+
declare function rgbaToHex(r: number, g: number, b: number, a: number): string;
|
|
7356
|
+
/**
|
|
7357
|
+
* Convert RGB to HSL
|
|
7358
|
+
* @param r - Red (0-255)
|
|
7359
|
+
* @param g - Green (0-255)
|
|
7360
|
+
* @param b - Blue (0-255)
|
|
7361
|
+
* @returns HSL object (h: 0-360, s: 0-100, l: 0-100)
|
|
7362
|
+
*/
|
|
7363
|
+
declare function rgbToHsl(r: number, g: number, b: number): HSL;
|
|
7364
|
+
/**
|
|
7365
|
+
* Convert HSL to RGB
|
|
7366
|
+
* @param h - Hue (0-360)
|
|
7367
|
+
* @param s - Saturation (0-100)
|
|
7368
|
+
* @param l - Lightness (0-100)
|
|
7369
|
+
* @returns RGB object
|
|
7370
|
+
*/
|
|
7371
|
+
declare function hslToRgb(h: number, s: number, l: number): RGB;
|
|
7372
|
+
/**
|
|
7373
|
+
* Convert hex to HSL
|
|
7374
|
+
* @param hex - Hex color string
|
|
7375
|
+
* @returns HSL object or null if invalid
|
|
7376
|
+
*/
|
|
7377
|
+
declare function hexToHsl(hex: string): HSL | null;
|
|
7378
|
+
/**
|
|
7379
|
+
* Convert HSL to hex
|
|
7380
|
+
* @param h - Hue (0-360)
|
|
7381
|
+
* @param s - Saturation (0-100)
|
|
7382
|
+
* @param l - Lightness (0-100)
|
|
7383
|
+
* @returns Hex color string
|
|
7384
|
+
*/
|
|
7385
|
+
declare function hslToHex(h: number, s: number, l: number): string;
|
|
7386
|
+
/**
|
|
7387
|
+
* Calculate relative luminance of a color
|
|
7388
|
+
* @param r - Red (0-255)
|
|
7389
|
+
* @param g - Green (0-255)
|
|
7390
|
+
* @param b - Blue (0-255)
|
|
7391
|
+
* @returns Relative luminance (0-1)
|
|
7392
|
+
*/
|
|
7393
|
+
declare function getLuminance(r: number, g: number, b: number): number;
|
|
7394
|
+
/**
|
|
7395
|
+
* Calculate contrast ratio between two colors (WCAG 2.1)
|
|
7396
|
+
* @param color1 - First hex color
|
|
7397
|
+
* @param color2 - Second hex color
|
|
7398
|
+
* @returns Contrast ratio (1-21)
|
|
7399
|
+
*/
|
|
7400
|
+
declare function getContrastRatio(color1: string, color2: string): number;
|
|
7401
|
+
/**
|
|
7402
|
+
* Check if contrast meets WCAG AA standard (4.5:1 for normal text)
|
|
7403
|
+
* @param color1 - First hex color
|
|
7404
|
+
* @param color2 - Second hex color
|
|
7405
|
+
* @param largeText - Whether text is large (14pt bold or 18pt regular)
|
|
7406
|
+
* @returns Whether contrast is sufficient
|
|
7407
|
+
*/
|
|
7408
|
+
declare function meetsContrastAA(color1: string, color2: string, largeText?: boolean): boolean;
|
|
7409
|
+
/**
|
|
7410
|
+
* Check if contrast meets WCAG AAA standard (7:1 for normal text)
|
|
7411
|
+
* @param color1 - First hex color
|
|
7412
|
+
* @param color2 - Second hex color
|
|
7413
|
+
* @param largeText - Whether text is large (14pt bold or 18pt regular)
|
|
7414
|
+
* @returns Whether contrast is sufficient
|
|
7415
|
+
*/
|
|
7416
|
+
declare function meetsContrastAAA(color1: string, color2: string, largeText?: boolean): boolean;
|
|
7417
|
+
/**
|
|
7418
|
+
* Check if a color is light (lightness > 50%)
|
|
7419
|
+
* @param hex - Hex color string
|
|
7420
|
+
* @returns Whether the color is light
|
|
7421
|
+
*/
|
|
7422
|
+
declare function isLightColor(hex: string): boolean;
|
|
7423
|
+
/**
|
|
7424
|
+
* Check if a color is dark (lightness <= 50%)
|
|
7425
|
+
* @param hex - Hex color string
|
|
7426
|
+
* @returns Whether the color is dark
|
|
7427
|
+
*/
|
|
7428
|
+
declare function isDarkColor(hex: string): boolean;
|
|
7429
|
+
/**
|
|
7430
|
+
* Get appropriate text color (black or white) for a background
|
|
7431
|
+
* @param backgroundColor - Hex color string of background
|
|
7432
|
+
* @returns "#000000" or "#ffffff"
|
|
7433
|
+
*/
|
|
7434
|
+
declare function getTextColor(backgroundColor: string): string;
|
|
7435
|
+
/**
|
|
7436
|
+
* Lighten a color by a percentage
|
|
7437
|
+
* @param hex - Hex color string
|
|
7438
|
+
* @param amount - Percentage to lighten (0-100)
|
|
7439
|
+
* @returns Lightened hex color
|
|
7440
|
+
*/
|
|
7441
|
+
declare function lighten(hex: string, amount: number): string;
|
|
7442
|
+
/**
|
|
7443
|
+
* Darken a color by a percentage
|
|
7444
|
+
* @param hex - Hex color string
|
|
7445
|
+
* @param amount - Percentage to darken (0-100)
|
|
7446
|
+
* @returns Darkened hex color
|
|
7447
|
+
*/
|
|
7448
|
+
declare function darken(hex: string, amount: number): string;
|
|
7449
|
+
/**
|
|
7450
|
+
* Saturate a color by a percentage
|
|
7451
|
+
* @param hex - Hex color string
|
|
7452
|
+
* @param amount - Percentage to saturate (0-100)
|
|
7453
|
+
* @returns Saturated hex color
|
|
7454
|
+
*/
|
|
7455
|
+
declare function saturate(hex: string, amount: number): string;
|
|
7456
|
+
/**
|
|
7457
|
+
* Desaturate a color by a percentage
|
|
7458
|
+
* @param hex - Hex color string
|
|
7459
|
+
* @param amount - Percentage to desaturate (0-100)
|
|
7460
|
+
* @returns Desaturated hex color
|
|
7461
|
+
*/
|
|
7462
|
+
declare function desaturate(hex: string, amount: number): string;
|
|
7463
|
+
/**
|
|
7464
|
+
* Adjust the opacity of a color
|
|
7465
|
+
* @param hex - Hex color string
|
|
7466
|
+
* @param alpha - Alpha value (0-1)
|
|
7467
|
+
* @returns RGBA string
|
|
7468
|
+
*/
|
|
7469
|
+
declare function alpha(hex: string, alphaValue: number): string;
|
|
7470
|
+
/**
|
|
7471
|
+
* Mix two colors together
|
|
7472
|
+
* @param color1 - First hex color
|
|
7473
|
+
* @param color2 - Second hex color
|
|
7474
|
+
* @param weight - Weight of first color (0-1, default 0.5)
|
|
7475
|
+
* @returns Mixed hex color
|
|
7476
|
+
*/
|
|
7477
|
+
declare function mix(color1: string, color2: string, weight?: number): string;
|
|
7478
|
+
/**
|
|
7479
|
+
* Get the complement of a color
|
|
7480
|
+
* @param hex - Hex color string
|
|
7481
|
+
* @returns Complementary hex color
|
|
7482
|
+
*/
|
|
7483
|
+
declare function complement(hex: string): string;
|
|
7484
|
+
/**
|
|
7485
|
+
* Invert a color
|
|
7486
|
+
* @param hex - Hex color string
|
|
7487
|
+
* @returns Inverted hex color
|
|
7488
|
+
*/
|
|
7489
|
+
declare function invert(hex: string): string;
|
|
7490
|
+
/**
|
|
7491
|
+
* Parse any color string to RGB
|
|
7492
|
+
* Supports: hex, rgb(), rgba(), hsl(), hsla()
|
|
7493
|
+
* @param color - Color string
|
|
7494
|
+
* @returns RGB object or null
|
|
7495
|
+
*/
|
|
7496
|
+
declare function parseColor(color: string): RGB | null;
|
|
7497
|
+
|
|
7498
|
+
/**
|
|
7499
|
+
* Date Utilities
|
|
7500
|
+
*
|
|
7501
|
+
* Utility functions for date formatting, parsing, and manipulation.
|
|
7502
|
+
* These are lightweight utilities - for complex date operations, use date-fns.
|
|
7503
|
+
*
|
|
7504
|
+
* @example
|
|
7505
|
+
* ```tsx
|
|
7506
|
+
* import { formatDate, formatRelative, isToday, addDays } from "@reeverdev/ui";
|
|
7507
|
+
*
|
|
7508
|
+
* formatDate(new Date(), "MMMM d, yyyy"); // "January 3, 2026"
|
|
7509
|
+
* formatRelative(new Date(Date.now() - 3600000)); // "1 hour ago"
|
|
7510
|
+
* isToday(new Date()); // true
|
|
7511
|
+
* addDays(new Date(), 7); // Date 7 days from now
|
|
7512
|
+
* ```
|
|
7513
|
+
*/
|
|
7514
|
+
type DateInput = Date | string | number;
|
|
7515
|
+
interface FormatOptions {
|
|
7516
|
+
locale?: string;
|
|
7517
|
+
}
|
|
7518
|
+
interface RelativeTimeOptions {
|
|
7519
|
+
locale?: string;
|
|
7520
|
+
addSuffix?: boolean;
|
|
7521
|
+
style?: "long" | "short" | "narrow";
|
|
7522
|
+
}
|
|
7523
|
+
/**
|
|
7524
|
+
* Parse a date input to Date object
|
|
7525
|
+
* @param date - Date, string, or timestamp
|
|
7526
|
+
* @returns Date object
|
|
7527
|
+
*/
|
|
7528
|
+
declare function parseDate(date: DateInput): Date;
|
|
7529
|
+
/**
|
|
7530
|
+
* Check if a date is valid
|
|
7531
|
+
* @param date - Date to check
|
|
7532
|
+
* @returns Whether the date is valid
|
|
7533
|
+
*/
|
|
7534
|
+
declare function isValidDate(date: DateInput): boolean;
|
|
7535
|
+
/**
|
|
7536
|
+
* Format a date using a format string
|
|
7537
|
+
* Supported tokens:
|
|
7538
|
+
* - yyyy: 4-digit year
|
|
7539
|
+
* - yy: 2-digit year
|
|
7540
|
+
* - MMMM: Full month name
|
|
7541
|
+
* - MMM: Short month name
|
|
7542
|
+
* - MM: 2-digit month
|
|
7543
|
+
* - M: Month
|
|
7544
|
+
* - dd: 2-digit day
|
|
7545
|
+
* - d: Day
|
|
7546
|
+
* - EEEE: Full day name
|
|
7547
|
+
* - EEE: Short day name
|
|
7548
|
+
* - HH: 2-digit hour (24h)
|
|
7549
|
+
* - H: Hour (24h)
|
|
7550
|
+
* - hh: 2-digit hour (12h)
|
|
7551
|
+
* - h: Hour (12h)
|
|
7552
|
+
* - mm: 2-digit minute
|
|
7553
|
+
* - m: Minute
|
|
7554
|
+
* - ss: 2-digit second
|
|
7555
|
+
* - s: Second
|
|
7556
|
+
* - a: AM/PM
|
|
7557
|
+
*
|
|
7558
|
+
* @param date - Date to format
|
|
7559
|
+
* @param format - Format string (default: "yyyy-MM-dd")
|
|
7560
|
+
* @returns Formatted date string
|
|
7561
|
+
*/
|
|
7562
|
+
declare function formatDate(date: DateInput, format?: string): string;
|
|
7563
|
+
/**
|
|
7564
|
+
* Format a date as ISO string (yyyy-MM-dd)
|
|
7565
|
+
* @param date - Date to format
|
|
7566
|
+
* @returns ISO date string
|
|
7567
|
+
*/
|
|
7568
|
+
declare function formatISO(date: DateInput): string;
|
|
7569
|
+
/**
|
|
7570
|
+
* Format a date and time as ISO string
|
|
7571
|
+
* @param date - Date to format
|
|
7572
|
+
* @returns ISO datetime string
|
|
7573
|
+
*/
|
|
7574
|
+
declare function formatISODateTime(date: DateInput): string;
|
|
7575
|
+
/**
|
|
7576
|
+
* Format time only
|
|
7577
|
+
* @param date - Date to format
|
|
7578
|
+
* @param use24Hour - Use 24-hour format (default: false)
|
|
7579
|
+
* @returns Time string
|
|
7580
|
+
*/
|
|
7581
|
+
declare function formatTime(date: DateInput, use24Hour?: boolean): string;
|
|
7582
|
+
/**
|
|
7583
|
+
* Format a date as relative time (e.g., "2 hours ago", "in 3 days")
|
|
7584
|
+
* @param date - Date to format
|
|
7585
|
+
* @param options - Formatting options
|
|
7586
|
+
* @returns Relative time string
|
|
7587
|
+
*/
|
|
7588
|
+
declare function formatRelative(date: DateInput, options?: RelativeTimeOptions): string;
|
|
7589
|
+
/**
|
|
7590
|
+
* Get a human-readable time difference
|
|
7591
|
+
* @param date - Date to compare
|
|
7592
|
+
* @param baseDate - Base date (default: now)
|
|
7593
|
+
* @returns Human-readable string
|
|
7594
|
+
*/
|
|
7595
|
+
declare function timeAgo(date: DateInput, baseDate?: DateInput): string;
|
|
7596
|
+
/**
|
|
7597
|
+
* Check if a date is today
|
|
7598
|
+
* @param date - Date to check
|
|
7599
|
+
* @returns Whether the date is today
|
|
7600
|
+
*/
|
|
7601
|
+
declare function isToday(date: DateInput): boolean;
|
|
7602
|
+
/**
|
|
7603
|
+
* Check if a date is yesterday
|
|
7604
|
+
* @param date - Date to check
|
|
7605
|
+
* @returns Whether the date is yesterday
|
|
7606
|
+
*/
|
|
7607
|
+
declare function isYesterday(date: DateInput): boolean;
|
|
7608
|
+
/**
|
|
7609
|
+
* Check if a date is tomorrow
|
|
7610
|
+
* @param date - Date to check
|
|
7611
|
+
* @returns Whether the date is tomorrow
|
|
7612
|
+
*/
|
|
7613
|
+
declare function isTomorrow(date: DateInput): boolean;
|
|
7614
|
+
/**
|
|
7615
|
+
* Check if a date is in the past
|
|
7616
|
+
* @param date - Date to check
|
|
7617
|
+
* @returns Whether the date is in the past
|
|
7618
|
+
*/
|
|
7619
|
+
declare function isPast(date: DateInput): boolean;
|
|
7620
|
+
/**
|
|
7621
|
+
* Check if a date is in the future
|
|
7622
|
+
* @param date - Date to check
|
|
7623
|
+
* @returns Whether the date is in the future
|
|
7624
|
+
*/
|
|
7625
|
+
declare function isFuture(date: DateInput): boolean;
|
|
7626
|
+
/**
|
|
7627
|
+
* Check if two dates are the same day
|
|
7628
|
+
* @param date1 - First date
|
|
7629
|
+
* @param date2 - Second date
|
|
7630
|
+
* @returns Whether the dates are the same day
|
|
7631
|
+
*/
|
|
7632
|
+
declare function isSameDay(date1: DateInput, date2: DateInput): boolean;
|
|
7633
|
+
/**
|
|
7634
|
+
* Check if two dates are in the same month
|
|
7635
|
+
* @param date1 - First date
|
|
7636
|
+
* @param date2 - Second date
|
|
7637
|
+
* @returns Whether the dates are in the same month
|
|
7638
|
+
*/
|
|
7639
|
+
declare function isSameMonth(date1: DateInput, date2: DateInput): boolean;
|
|
7640
|
+
/**
|
|
7641
|
+
* Check if two dates are in the same year
|
|
7642
|
+
* @param date1 - First date
|
|
7643
|
+
* @param date2 - Second date
|
|
7644
|
+
* @returns Whether the dates are in the same year
|
|
7645
|
+
*/
|
|
7646
|
+
declare function isSameYear(date1: DateInput, date2: DateInput): boolean;
|
|
7647
|
+
/**
|
|
7648
|
+
* Add days to a date
|
|
7649
|
+
* @param date - Date to modify
|
|
7650
|
+
* @param days - Number of days to add
|
|
7651
|
+
* @returns New date
|
|
7652
|
+
*/
|
|
7653
|
+
declare function addDays(date: DateInput, days: number): Date;
|
|
7654
|
+
/**
|
|
7655
|
+
* Add months to a date
|
|
7656
|
+
* @param date - Date to modify
|
|
7657
|
+
* @param months - Number of months to add
|
|
7658
|
+
* @returns New date
|
|
7659
|
+
*/
|
|
7660
|
+
declare function addMonths(date: DateInput, months: number): Date;
|
|
7661
|
+
/**
|
|
7662
|
+
* Add years to a date
|
|
7663
|
+
* @param date - Date to modify
|
|
7664
|
+
* @param years - Number of years to add
|
|
7665
|
+
* @returns New date
|
|
7666
|
+
*/
|
|
7667
|
+
declare function addYears(date: DateInput, years: number): Date;
|
|
7668
|
+
/**
|
|
7669
|
+
* Add hours to a date
|
|
7670
|
+
* @param date - Date to modify
|
|
7671
|
+
* @param hours - Number of hours to add
|
|
7672
|
+
* @returns New date
|
|
7673
|
+
*/
|
|
7674
|
+
declare function addHours(date: DateInput, hours: number): Date;
|
|
7675
|
+
/**
|
|
7676
|
+
* Add minutes to a date
|
|
7677
|
+
* @param date - Date to modify
|
|
7678
|
+
* @param minutes - Number of minutes to add
|
|
7679
|
+
* @returns New date
|
|
7680
|
+
*/
|
|
7681
|
+
declare function addMinutes(date: DateInput, minutes: number): Date;
|
|
7682
|
+
/**
|
|
7683
|
+
* Get the start of a day (00:00:00)
|
|
7684
|
+
* @param date - Date to modify
|
|
7685
|
+
* @returns Start of day
|
|
7686
|
+
*/
|
|
7687
|
+
declare function startOfDay(date: DateInput): Date;
|
|
7688
|
+
/**
|
|
7689
|
+
* Get the end of a day (23:59:59.999)
|
|
7690
|
+
* @param date - Date to modify
|
|
7691
|
+
* @returns End of day
|
|
7692
|
+
*/
|
|
7693
|
+
declare function endOfDay(date: DateInput): Date;
|
|
7694
|
+
/**
|
|
7695
|
+
* Get the start of a month
|
|
7696
|
+
* @param date - Date to modify
|
|
7697
|
+
* @returns Start of month
|
|
7698
|
+
*/
|
|
7699
|
+
declare function startOfMonth(date: DateInput): Date;
|
|
7700
|
+
/**
|
|
7701
|
+
* Get the end of a month
|
|
7702
|
+
* @param date - Date to modify
|
|
7703
|
+
* @returns End of month
|
|
7704
|
+
*/
|
|
7705
|
+
declare function endOfMonth(date: DateInput): Date;
|
|
7706
|
+
/**
|
|
7707
|
+
* Get the difference between two dates in days
|
|
7708
|
+
* @param date1 - First date
|
|
7709
|
+
* @param date2 - Second date
|
|
7710
|
+
* @returns Difference in days
|
|
7711
|
+
*/
|
|
7712
|
+
declare function differenceInDays(date1: DateInput, date2: DateInput): number;
|
|
7713
|
+
/**
|
|
7714
|
+
* Get the difference between two dates in hours
|
|
7715
|
+
* @param date1 - First date
|
|
7716
|
+
* @param date2 - Second date
|
|
7717
|
+
* @returns Difference in hours
|
|
7718
|
+
*/
|
|
7719
|
+
declare function differenceInHours(date1: DateInput, date2: DateInput): number;
|
|
7720
|
+
/**
|
|
7721
|
+
* Get the difference between two dates in minutes
|
|
7722
|
+
* @param date1 - First date
|
|
7723
|
+
* @param date2 - Second date
|
|
7724
|
+
* @returns Difference in minutes
|
|
7725
|
+
*/
|
|
7726
|
+
declare function differenceInMinutes(date1: DateInput, date2: DateInput): number;
|
|
7727
|
+
|
|
7728
|
+
/**
|
|
7729
|
+
* Format Utilities
|
|
7730
|
+
*
|
|
7731
|
+
* Utility functions for formatting numbers, currencies, percentages, and strings.
|
|
7732
|
+
*
|
|
7733
|
+
* @example
|
|
7734
|
+
* ```tsx
|
|
7735
|
+
* import {
|
|
7736
|
+
* formatNumber,
|
|
7737
|
+
* formatCurrency,
|
|
7738
|
+
* formatPercent,
|
|
7739
|
+
* formatBytes,
|
|
7740
|
+
* formatCompact,
|
|
7741
|
+
* truncate,
|
|
7742
|
+
* slugify,
|
|
7743
|
+
* } from "@reeverdev/ui";
|
|
7744
|
+
*
|
|
7745
|
+
* formatNumber(1234567.89); // "1,234,567.89"
|
|
7746
|
+
* formatCurrency(99.99, "USD"); // "$99.99"
|
|
7747
|
+
* formatPercent(0.156); // "15.6%"
|
|
7748
|
+
* formatBytes(1536000); // "1.46 MB"
|
|
7749
|
+
* formatCompact(1500000); // "1.5M"
|
|
7750
|
+
* truncate("Hello World", 8); // "Hello..."
|
|
7751
|
+
* slugify("Hello World!"); // "hello-world"
|
|
7752
|
+
* ```
|
|
7753
|
+
*/
|
|
7754
|
+
interface NumberFormatOptions {
|
|
7755
|
+
locale?: string;
|
|
7756
|
+
minimumFractionDigits?: number;
|
|
7757
|
+
maximumFractionDigits?: number;
|
|
7758
|
+
useGrouping?: boolean;
|
|
7759
|
+
}
|
|
7760
|
+
interface CurrencyFormatOptions extends NumberFormatOptions {
|
|
7761
|
+
currency?: string;
|
|
7762
|
+
display?: "symbol" | "code" | "name" | "narrowSymbol";
|
|
7763
|
+
}
|
|
7764
|
+
interface PercentFormatOptions extends NumberFormatOptions {
|
|
7765
|
+
signDisplay?: "auto" | "never" | "always" | "exceptZero";
|
|
7766
|
+
}
|
|
7767
|
+
interface ByteFormatOptions {
|
|
7768
|
+
locale?: string;
|
|
7769
|
+
decimals?: number;
|
|
7770
|
+
binary?: boolean;
|
|
7771
|
+
}
|
|
7772
|
+
interface CompactFormatOptions {
|
|
7773
|
+
locale?: string;
|
|
7774
|
+
maximumFractionDigits?: number;
|
|
7775
|
+
}
|
|
7776
|
+
/**
|
|
7777
|
+
* Format a number with thousand separators
|
|
7778
|
+
* @param value - Number to format
|
|
7779
|
+
* @param options - Formatting options
|
|
7780
|
+
* @returns Formatted number string
|
|
7781
|
+
*/
|
|
7782
|
+
declare function formatNumber(value: number, options?: NumberFormatOptions): string;
|
|
7783
|
+
/**
|
|
7784
|
+
* Format a number as currency
|
|
7785
|
+
* @param value - Number to format
|
|
7786
|
+
* @param currency - Currency code (e.g., "USD", "EUR", "TRY")
|
|
7787
|
+
* @param options - Formatting options
|
|
7788
|
+
* @returns Formatted currency string
|
|
7789
|
+
*/
|
|
7790
|
+
declare function formatCurrency(value: number, currency?: string, options?: CurrencyFormatOptions): string;
|
|
7791
|
+
/**
|
|
7792
|
+
* Format a number as percentage
|
|
7793
|
+
* @param value - Number to format (0-1 or 0-100)
|
|
7794
|
+
* @param options - Formatting options
|
|
7795
|
+
* @returns Formatted percentage string
|
|
7796
|
+
*/
|
|
7797
|
+
declare function formatPercent(value: number, options?: PercentFormatOptions): string;
|
|
7798
|
+
/**
|
|
7799
|
+
* Format bytes to human-readable string
|
|
7800
|
+
* @param bytes - Number of bytes
|
|
7801
|
+
* @param options - Formatting options
|
|
7802
|
+
* @returns Formatted string (e.g., "1.5 MB")
|
|
7803
|
+
*/
|
|
7804
|
+
declare function formatBytes(bytes: number, options?: ByteFormatOptions): string;
|
|
7805
|
+
/**
|
|
7806
|
+
* Format a number in compact notation (e.g., 1K, 1M, 1B)
|
|
7807
|
+
* @param value - Number to format
|
|
7808
|
+
* @param options - Formatting options
|
|
7809
|
+
* @returns Compact number string
|
|
7810
|
+
*/
|
|
7811
|
+
declare function formatCompact(value: number, options?: CompactFormatOptions): string;
|
|
7812
|
+
/**
|
|
7813
|
+
* Format a number with ordinal suffix (1st, 2nd, 3rd, etc.)
|
|
7814
|
+
* @param value - Number to format
|
|
7815
|
+
* @returns Number with ordinal suffix
|
|
7816
|
+
*/
|
|
7817
|
+
declare function formatOrdinal(value: number): string;
|
|
7818
|
+
/**
|
|
7819
|
+
* Format a phone number
|
|
7820
|
+
* @param value - Phone number string (digits only)
|
|
7821
|
+
* @param format - Format pattern (default: US format)
|
|
7822
|
+
* @returns Formatted phone number
|
|
7823
|
+
*/
|
|
7824
|
+
declare function formatPhone(value: string, format?: string): string;
|
|
7825
|
+
/**
|
|
7826
|
+
* Format a credit card number with spaces
|
|
7827
|
+
* @param value - Credit card number (digits only)
|
|
7828
|
+
* @returns Formatted credit card number
|
|
7829
|
+
*/
|
|
7830
|
+
declare function formatCreditCard(value: string): string;
|
|
7831
|
+
/**
|
|
7832
|
+
* Truncate a string to a maximum length
|
|
7833
|
+
* @param str - String to truncate
|
|
7834
|
+
* @param maxLength - Maximum length
|
|
7835
|
+
* @param suffix - Suffix to add (default: "...")
|
|
7836
|
+
* @returns Truncated string
|
|
7837
|
+
*/
|
|
7838
|
+
declare function truncate(str: string, maxLength: number, suffix?: string): string;
|
|
7839
|
+
/**
|
|
7840
|
+
* Truncate a string in the middle
|
|
7841
|
+
* @param str - String to truncate
|
|
7842
|
+
* @param maxLength - Maximum length
|
|
7843
|
+
* @param separator - Separator (default: "...")
|
|
7844
|
+
* @returns Truncated string
|
|
7845
|
+
*/
|
|
7846
|
+
declare function truncateMiddle(str: string, maxLength: number, separator?: string): string;
|
|
7847
|
+
/**
|
|
7848
|
+
* Convert a string to slug format
|
|
7849
|
+
* @param str - String to convert
|
|
7850
|
+
* @returns Slugified string
|
|
7851
|
+
*/
|
|
7852
|
+
declare function slugify(str: string): string;
|
|
7853
|
+
/**
|
|
7854
|
+
* Convert a string to camelCase
|
|
7855
|
+
* @param str - String to convert
|
|
7856
|
+
* @returns camelCase string
|
|
7857
|
+
*/
|
|
7858
|
+
declare function camelCase(str: string): string;
|
|
7859
|
+
/**
|
|
7860
|
+
* Convert a string to PascalCase
|
|
7861
|
+
* @param str - String to convert
|
|
7862
|
+
* @returns PascalCase string
|
|
7863
|
+
*/
|
|
7864
|
+
declare function pascalCase(str: string): string;
|
|
7865
|
+
/**
|
|
7866
|
+
* Convert a string to kebab-case
|
|
7867
|
+
* @param str - String to convert
|
|
7868
|
+
* @returns kebab-case string
|
|
7869
|
+
*/
|
|
7870
|
+
declare function kebabCase(str: string): string;
|
|
7871
|
+
/**
|
|
7872
|
+
* Convert a string to snake_case
|
|
7873
|
+
* @param str - String to convert
|
|
7874
|
+
* @returns snake_case string
|
|
7875
|
+
*/
|
|
7876
|
+
declare function snakeCase(str: string): string;
|
|
7877
|
+
/**
|
|
7878
|
+
* Convert a string to Title Case
|
|
7879
|
+
* @param str - String to convert
|
|
7880
|
+
* @returns Title Case string
|
|
7881
|
+
*/
|
|
7882
|
+
declare function titleCase(str: string): string;
|
|
7883
|
+
/**
|
|
7884
|
+
* Convert a string to sentence case
|
|
7885
|
+
* @param str - String to convert
|
|
7886
|
+
* @returns Sentence case string
|
|
7887
|
+
*/
|
|
7888
|
+
declare function sentenceCase(str: string): string;
|
|
7889
|
+
/**
|
|
7890
|
+
* Capitalize the first letter of a string
|
|
7891
|
+
* @param str - String to capitalize
|
|
7892
|
+
* @returns Capitalized string
|
|
7893
|
+
*/
|
|
7894
|
+
declare function capitalize(str: string): string;
|
|
7895
|
+
/**
|
|
7896
|
+
* Get initials from a name
|
|
7897
|
+
* @param name - Full name
|
|
7898
|
+
* @param maxInitials - Maximum number of initials (default: 2)
|
|
7899
|
+
* @returns Initials
|
|
7900
|
+
*/
|
|
7901
|
+
declare function getInitials(name: string, maxInitials?: number): string;
|
|
7902
|
+
/**
|
|
7903
|
+
* Pluralize a word based on count
|
|
7904
|
+
* @param count - Number
|
|
7905
|
+
* @param singular - Singular form
|
|
7906
|
+
* @param plural - Plural form (default: singular + "s")
|
|
7907
|
+
* @returns Appropriate form
|
|
7908
|
+
*/
|
|
7909
|
+
declare function pluralize(count: number, singular: string, plural?: string): string;
|
|
7910
|
+
/**
|
|
7911
|
+
* Format a list with Oxford comma
|
|
7912
|
+
* @param items - Array of strings
|
|
7913
|
+
* @param conjunction - Conjunction word (default: "and")
|
|
7914
|
+
* @returns Formatted list string
|
|
7915
|
+
*/
|
|
7916
|
+
declare function formatList(items: string[], conjunction?: string): string;
|
|
7917
|
+
/**
|
|
7918
|
+
* Mask a string (e.g., for sensitive data)
|
|
7919
|
+
* @param str - String to mask
|
|
7920
|
+
* @param visibleStart - Number of visible characters at start
|
|
7921
|
+
* @param visibleEnd - Number of visible characters at end
|
|
7922
|
+
* @param maskChar - Mask character (default: "*")
|
|
7923
|
+
* @returns Masked string
|
|
7924
|
+
*/
|
|
7925
|
+
declare function mask(str: string, visibleStart?: number, visibleEnd?: number, maskChar?: string): string;
|
|
7926
|
+
/**
|
|
7927
|
+
* Mask an email address
|
|
7928
|
+
* @param email - Email address
|
|
7929
|
+
* @returns Masked email
|
|
7930
|
+
*/
|
|
7931
|
+
declare function maskEmail(email: string): string;
|
|
7932
|
+
/**
|
|
7933
|
+
* Mask a phone number
|
|
7934
|
+
* @param phone - Phone number
|
|
7935
|
+
* @param visibleEnd - Number of visible digits at end (default: 4)
|
|
7936
|
+
* @returns Masked phone number
|
|
7937
|
+
*/
|
|
7938
|
+
declare function maskPhone(phone: string, visibleEnd?: number): string;
|
|
7939
|
+
/**
|
|
7940
|
+
* Mask a credit card number
|
|
7941
|
+
* @param cardNumber - Credit card number
|
|
7942
|
+
* @returns Masked card number (e.g., "**** **** **** 1234")
|
|
7943
|
+
*/
|
|
7944
|
+
declare function maskCreditCard(cardNumber: string): string;
|
|
7945
|
+
|
|
7946
|
+
export { Accordion, AccordionItem, type AccordionItemProps, type AccordionProps, ActionBar, ActionBarButton, type ActionBarProps, ActionGroup, type ActionGroupItem, type ActionGroupProps, ActionSheet, type ActionSheetItem, type ActionSheetProps, Alert, AlertDescription, type AlertRadius, AlertTitle, type AlertType, type AlertVariant, type AllowDropInfo, AreaChart, type AreaChartProps, AspectRatio, AudioPlayer, type AudioPlayerProps, type AudioTrack, Autocomplete, type AutocompleteOption, type AutocompleteProps, Avatar, AvatarFallback, AvatarGroup, type AvatarGroupItem, type AvatarGroupProps, AvatarImage, BackTop, type BackTopProps, Badge, type BadgeProps, Banner, type BannerProps, BarChart, type BarChartProps, Blockquote, type BlockquoteProps, BottomNavigation, type BottomNavigationItem, type BottomNavigationProps, Bounce, type BounceProps, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, type ByteFormatOptions, COUNTRIES, Calendar, type CalendarEvent, type CalendarProps, type CalendarView, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, type CarouselApi, CarouselContent, CarouselItem, type CarouselItemProps, CarouselNext, CarouselPrevious, type CarouselProps, type ChartDataPoint, type CheckInfo, Checkbox, Checkmark, type CheckmarkProps, type CheckmarkSize, type CheckmarkVariant, Chip, type ChipProps, CircularProgress, CloseButton, type CloseButtonProps, Code, CodeBlock, type CodeBlockProps, type CodeBlockTabItem, Collapse, type CollapseProps, Collapsible, CollapsibleContent, CollapsibleTrigger, type Color, ColorArea, type ColorAreaProps, type ColorAreaValue, ColorPicker, type ColorPickerProps, ColorSlider, type ColorSliderChannel, type ColorSliderProps, ColorSwatch, ColorSwatchPicker, type ColorSwatchPickerProps, type ColorSwatchProps, ColorWheel, type ColorWheelProps, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, type CommandItemProps, CommandList, CommandSeparator, CommandShortcut, type CompactFormatOptions, Confetti, type ConfettiOptions, type ConfettiProps, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuPortal, ContextMenuSection, type ContextMenuSectionProps, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, ContextualHelp, type ContextualHelpProps, CopyButton, type CopyButtonProps, Counter, type CounterProps, type Country, type CurrencyFormatOptions, CurrencyInput, type CurrencyInputProps, DEFAULT_COLORS, DataTable, type DataTableProps, type DateFormat, type DateInput, DatePicker, type DatePickerProps, DateRangePicker, type DateRangePickerProps, type DragInfo, type DraggableConfig, Drawer, type DrawerBackdrop, DrawerBody, DrawerClose, type DrawerCollapsible, DrawerContent, DrawerDescription, DrawerFooter, DrawerGroup, DrawerGroupLabel, DrawerHeader, DrawerInset, DrawerMenu, DrawerMenuButton, DrawerMenuItem, type DrawerMode, type DrawerPlacement, type DrawerProps, DrawerProvider, DrawerSeparator, DrawerSidebar, type DrawerSidebarProps, type DrawerSize, DrawerTitle, DrawerToggle, DrawerTrigger, type DrawerVariant, type DropInfo, Dropdown, DropdownContent, type DropdownContentProps, DropdownGroup, type DropdownGroupProps, DropdownItem, type DropdownItemProps, DropdownLabel, type DropdownProps, DropdownSection, type DropdownSectionProps, DropdownSeparator, type DropdownSeparatorProps, DropdownShortcut, DropdownSub, DropdownSubContent, type DropdownSubContentProps, type DropdownSubProps, DropdownSubTrigger, type DropdownSubTriggerProps, DropdownTrigger, type DropdownTriggerProps, EMOJIS, EMOJI_CATEGORIES, EmojiPicker, type EmojiPickerProps, EmptyState, Expand, type ExpandInfo, type ExpandProps, FAB, type FABAction, Fade, type FadeProps, FieldContext, type FieldContextValue, type FieldState, type FileRejection, FileUpload, type FileUploadProps, type FlatCheckInfo, type FlatSelectInfo, Flip, type FlipDirection, type FlipProps, FloatingActionButton, type FloatingActionButtonProps, Form, FormContext, type FormContextValue, FormControl, type FormControlProps, FormDescription, type FormDescriptionProps, FormField, type FormFieldProps, FormItem, type FormItemProps, FormLabel, type FormLabelProps, FormMessage, type FormMessageProps, type FormProps, type FormState, type FormatOptions, FullCalendar, type FullCalendarProps, Glow, type GlowProps, GridList, type GridListItem, type GridListProps, H1, type H1Props, H2, type H2Props, H3, type H3Props, H4, type H4Props, type HSL, type HSLA, HeatmapCalendar, type HeatmapCalendarProps, type HeatmapValue, HoverCard, HoverCardContent, HoverCardTrigger, Image, ImageComparison, type ImageComparisonProps, ImageCropper, type ImageCropperProps, ImageViewer, type ImageViewerProps, ImageViewerTrigger, type ImageViewerTriggerProps, InfiniteScroll, type InfiniteScrollProps, InlineCode, type InlineCodeProps, Input, InputOTP, InputOTPGroup, type InputOTPProps, InputOTPSeparator, InputOTPSlot, type InputOTPSlotProps, type InputProps, KanbanBoard, type KanbanBoardProps, type KanbanCard, type KanbanColumn, Kbd, type KbdProps, Label, type Language, Large, type LargeProps, Lead, type LeadProps, LineChart, type LineChartProps, Link, type LinkProps, List, type ListDataItem, ListItemComponent as ListItem, type ListItemComponentProps, ListItemText, type ListItemTextProps, type ListProps, Loading, type LoadingProps, MASK_PRESETS, type MaskChar, type MaskDefinition, type MaskPreset, MaskedInput, type MaskedInputProps, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSection, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, Modal, type ModalBackdrop, ModalBody, ModalClose, ModalContent, ModalDescription, ModalFooter, ModalHeader, ModalOverlay, type ModalPlacement, ModalPortal, type ModalProps, ModalRoot, type ModalScrollBehavior, ModalTitle, ModalTrigger, Muted, type MutedProps, Navbar, NavbarBrand, NavbarContent, NavbarItem, NavbarLink, type NavbarProps, NavigationMenu, NavigationMenuContent, type NavigationMenuContentProps, NavigationMenuIndicator, type NavigationMenuIndicatorProps, NavigationMenuItem, type NavigationMenuItemProps, NavigationMenuLink, type NavigationMenuLinkProps, NavigationMenuList, type NavigationMenuListProps, type NavigationMenuProps, NavigationMenuTrigger, type NavigationMenuTriggerProps, NavigationMenuViewport, NumberField, type NumberFieldProps, type NumberFormatOptions, NumberInput, type NumberInputProps, PDFViewer, type PDFViewerProps, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, type PaginationState, Paragraph, type ParagraphProps, Parallax, type ParallaxProps, PasswordInput, type PasswordInputProps, type PasswordRequirement, type PercentFormatOptions, PhoneInput, type PhoneInputProps, PieChart, type PieChartProps, Pop, type PopProps, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress, PullToRefresh, type PullToRefreshProps, Pulse, type PulseProps, type PulseSpeed, QRCode, type QRCodeProps, type QRCodeRef, type RGB, type RGBA, Radio, RadioContent, type RadioContentProps, RadioControl, type RadioControlProps, RadioDescription, type RadioDescriptionProps, RadioGroup, type RadioGroupProps, RadioIndicator, type RadioIndicatorProps, RadioLabel, type RadioLabelProps, type RadioProps, type Radius, RangeSlider, type RangeSliderProps, Rating, type RatingProps, ReeverUIContext, type ReeverUIContextValue, ReeverUIProvider, type ReeverUIProviderProps, type RelativeTimeOptions, ResizableHandle, type ResizableHandleProps, ResizablePanel, ResizablePanelGroup, type ResizablePanelGroupProps, Ripple, type RippleProps, Rotate, type RotateProps, Scale, type ScaleOrigin, type ScaleProps, ScrollArea, type ScrollAreaProps, ScrollProgress, type ScrollProgressPosition, type ScrollProgressProps, ScrollReveal, type ScrollRevealDirection, type ScrollRevealProps, Select, SelectField, type SelectFieldProps, type SelectInfo, type SelectOption, type SelectProps, Separator, type SeparatorProps, Shake, type ShakeIntensity, type ShakeProps, Shimmer, type ShimmerDirection, type ShimmerProps, Skeleton, Slide, type SlideDirection, type SlideProps, Slider, Small, type SmallProps, Snippet, type SortDirection, type SortState, Sparkles, type SparklesProps, Spinner, type SpotlightItem, SpotlightSearch, type SpotlightSearchProps, StatCard, Step, type StepProps, Steps, type StepsProps, type SwipeAction, SwipeActions, type SwipeActionsProps, Switch, type SwitchColor, type SwitchProps, type SwitchSize, TabbedCodeBlock, type TabbedCodeBlockProps, Table, TableBody, TableCaption, TableCell, type TableColumn, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, type Tag, TagInput, type TagInputProps, TextBadge, type TextBadgeProps, TextField, type TextFieldProps, TextReveal, type TextRevealDirection, type TextRevealProps, Textarea, TextareaField, type TextareaFieldProps, type TextareaProps, ThemeProvider, type ThemeProviderProps, ThemeToggle, type ThemeToggleProps, TimeInput, type TimeInputProps, TimePicker, type TimePickerProps, Timeline, TimelineContent, TimelineItem, TimelineOpposite, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, type TooltipProps, type TransitionProps, Tree, type TreeNode, type TreeProps, Typewriter, type TypewriterProps, UL, type ULProps, type UploadedFile, User, type ValidationRule, VideoPlayer, type VideoPlayerProps, type VideoSource, type ViewerImage, Wiggle, type WiggleProps, WordRotate, type WordRotateProps, actionBarVariants, actionGroupVariants, actionSheetItemVariants, addDays, addHours, addMinutes, addMonths, addYears, alertVariants, alpha, applyMask, autocompleteInputVariants, avatarGroupVariants, backTopVariants, badgeIndicatorVariants, bannerVariants, bottomNavigationVariants, buttonGroupVariants, buttonVariants, calculatePasswordStrength, camelCase, capitalize, cardVariants, carouselVariants, chartContainerVariants, chipVariants, circularProgressVariants, closeButtonVariants, cn, codeVariants, colorAreaVariants, colorSliderVariants, colorSwatchPickerVariants, colorSwatchVariants, colorWheelVariants, complement, contextualHelpTriggerVariants, copyButtonVariants, currencyInputVariants, darken, datePickerVariants, defaultPasswordRequirements, desaturate, differenceInDays, differenceInHours, differenceInMinutes, drawerMenuButtonVariants, emojiPickerVariants, emptyStateVariants, endOfDay, endOfMonth, fabVariants, fileUploadVariants, formatBytes, formatCompact, formatCreditCard, formatCurrency, formatDate, formatFileSize, formatISO, formatISODateTime, formatList, formatNumber, formatOrdinal, formatPercent, formatPhone, formatPhoneNumber, formatRelative, formatTime, fullCalendarVariants, getContrastRatio, getFileIcon, getInitials, getLuminance, getMaskPlaceholder, getPasswordStrengthColor, getPasswordStrengthLabel, getTextColor, gridListItemVariants, gridListVariants, hexToHsl, hexToRgb, hexToRgba, hslToHex, hslToRgb, imageCropperVariants, imageVariants, infiniteScrollLoaderVariants, infiniteScrollVariants, inputOTPVariants, invert, isDarkColor, isFuture, isLightColor, isPast, isSameDay, isSameMonth, isSameYear, isToday, isTomorrow, isValidDate, isYesterday, kbdVariants, kebabCase, lighten, listItemVariants, listVariants, loadingVariants, mask, maskCreditCard, maskEmail, maskPhone, maskedInputVariants, meetsContrastAA, meetsContrastAAA, mix, modalContentVariants, navbarVariants, navigationMenuLinkStyle, navigationMenuTriggerStyle, parseColor, parseDate, pascalCase, phoneInputVariants, pluralize, pullToRefreshVariants, qrCodeVariants, rangeSliderVariants, ratingVariants, rgbToHex, rgbToHsl, rgbaToHex, saturate, selectVariants, sentenceCase, skeletonVariants, slugify, snakeCase, snippetVariants, spinnerVariants, startOfDay, startOfMonth, statCardVariants, stepVariants, stepsVariants, swipeActionVariants, swipeActionsVariants, colorMap as switchColors, tagVariants, textBadgeVariants, themeToggleVariants, timeAgo, timeInputVariants, timelineItemVariants, timelineVariants, titleCase, toggleVariants, treeItemVariants, treeVariants, truncate, truncateMiddle, unmask, useAnimatedValue, useAsync, useAsyncRetry, useBodyScrollLock, useBooleanToggle, useBreakpoint, useBreakpoints, useButtonGroup, useCarousel, useClickOutside, useClickOutsideMultiple, useConfetti, useCopy, useCopyToClipboard, useCountdown, useCounter, useCycle, useDebounce, useDebouncedCallback, useDebouncedCallbackWithControls, useDelayedValue, useDisclosure, useDisclosureOpen, useDistance, useDocumentIsVisible, useDocumentVisibility, useDocumentVisibilityCallback, useDrawer, useElementSize, useEventListener, useEventListenerRef, useFetch, useFieldContext, useFocusTrap, useFocusTrapRef, useFormContext, useFullscreen, useFullscreenRef, useGeolocation, useHotkeys, useHotkeysMap, useHover, useHoverDelay, useHoverProps, useHoverRef, useIdle, useIdleCallback, useIncrementCounter, useIntersectionObserver, useIntersectionObserverRef, useInterval, useIntervalControls, useIsDesktop, useIsMobile, useIsTablet, useKeyPress, useKeyPressed, useKeyboardShortcut, useLazyLoad, useList, useLocalStorage, useLongPress, useMap, useMediaPermission, useMediaQuery, useMouse, useMouseElement, useMouseElementRef, useMutation, useMutationObserver, useMutationObserverRef, useNotificationPermission, useOnlineStatus, useOnlineStatusCallback, usePermission, usePrefersColorScheme, usePrefersReducedMotion, usePrevious, usePreviousDistinct, usePreviousWithInitial, useQueue, useRafLoop, useRecord, useReeverUI, useResizeObserver, useResizeObserverRef, useScrollLock, useScrollPosition, useSelection, useSessionStorage, useSet, useSpeechRecognition, useSpeechSynthesis, useSpotlight, useSpringValue, useStack, useThrottle, useThrottledCallback, useTimeout, useTimeoutControls, useTimeoutFlag, useTimer, useToggle, useWindowHeight, useWindowScroll, useWindowSize, useWindowWidth, userVariants, validateFile, validators };
|