@gaulatti/bleecker 0.1.6 → 0.1.8

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.
Files changed (62) hide show
  1. package/dist/components/accordion.js +2 -2
  2. package/dist/components/alert-dialog.d.ts +13 -0
  3. package/dist/components/alert-dialog.js +42 -0
  4. package/dist/components/alert.d.ts +12 -0
  5. package/dist/components/alert.js +94 -0
  6. package/dist/components/avatar.d.ts +16 -0
  7. package/dist/components/avatar.js +36 -0
  8. package/dist/components/breadcrumb.d.ts +15 -0
  9. package/dist/components/breadcrumb.js +24 -0
  10. package/dist/components/button-group.d.ts +15 -0
  11. package/dist/components/button-group.js +23 -0
  12. package/dist/components/collection-filters.d.ts +1 -1
  13. package/dist/components/collection-filters.js +1 -1
  14. package/dist/components/date-picker.d.ts +20 -0
  15. package/dist/components/date-picker.js +97 -0
  16. package/dist/components/drawer.d.ts +11 -0
  17. package/dist/components/drawer.js +42 -0
  18. package/dist/components/empty.d.ts +9 -0
  19. package/dist/components/empty.js +6 -0
  20. package/dist/components/field-help-tooltip.d.ts +5 -0
  21. package/dist/components/field-help-tooltip.js +9 -0
  22. package/dist/components/hover-card.d.ts +12 -0
  23. package/dist/components/hover-card.js +9 -0
  24. package/dist/components/kbd.d.ts +7 -0
  25. package/dist/components/kbd.js +10 -0
  26. package/dist/components/menubar.d.ts +43 -0
  27. package/dist/components/menubar.js +58 -0
  28. package/dist/components/navigation-menu.d.ts +16 -0
  29. package/dist/components/navigation-menu.js +41 -0
  30. package/dist/components/otp-input.d.ts +11 -0
  31. package/dist/components/otp-input.js +53 -0
  32. package/dist/components/popover.d.ts +14 -0
  33. package/dist/components/popover.js +93 -0
  34. package/dist/components/progress.d.ts +11 -0
  35. package/dist/components/progress.js +17 -0
  36. package/dist/components/radio-group.d.ts +16 -0
  37. package/dist/components/radio-group.js +14 -0
  38. package/dist/components/scroll-area.d.ts +11 -0
  39. package/dist/components/scroll-area.js +12 -0
  40. package/dist/components/sheet.d.ts +12 -0
  41. package/dist/components/sheet.js +53 -0
  42. package/dist/components/slider.d.ts +11 -0
  43. package/dist/components/slider.js +9 -0
  44. package/dist/components/sonner.d.ts +29 -0
  45. package/dist/components/sonner.js +76 -0
  46. package/dist/components/sortable-table-header.js +4 -3
  47. package/dist/components/switch.d.ts +7 -0
  48. package/dist/components/switch.js +7 -0
  49. package/dist/components/table.d.ts +60 -0
  50. package/dist/components/table.js +92 -0
  51. package/dist/components/toggle-group.d.ts +26 -0
  52. package/dist/components/toggle-group.js +32 -0
  53. package/dist/components/toggle.d.ts +8 -0
  54. package/dist/components/toggle.js +26 -0
  55. package/dist/components/tooltip.d.ts +9 -0
  56. package/dist/components/tooltip.js +24 -0
  57. package/dist/index.d.ts +26 -1
  58. package/dist/index.js +26 -1
  59. package/dist/styles.css +2 -0
  60. package/dist/theme/theme-script.d.ts +1 -1
  61. package/package.json +4 -4
  62. package/src/styles/compiled.css +0 -2
@@ -1,11 +1,11 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { ChevronDown, ChevronRight } from 'lucide-react';
2
+ import { ChevronDown } from 'lucide-react';
3
3
  import React from 'react';
4
4
  import { cn } from '../utils/cn.js';
5
5
  export function Accordion({ className, defaultExpandedId = null, items }) {
6
6
  const [expandedId, setExpandedId] = React.useState(defaultExpandedId);
7
7
  return (_jsx("div", { className: cn('overflow-hidden rounded-xl border border-sand/10 bg-white shadow-sm dark:border-sand/20 dark:bg-sand/10', className), children: _jsx("ul", { className: 'divide-y divide-sand/10 dark:divide-sand/20', children: items.map((item) => {
8
8
  const isExpanded = expandedId === item.id;
9
- return (_jsxs("li", { children: [_jsxs("div", { className: 'flex cursor-pointer items-center justify-between px-4 py-4 transition-colors hover:bg-sand/5 dark:hover:bg-sand/10 sm:px-6', onClick: () => setExpandedId(isExpanded ? null : item.id), children: [_jsxs("div", { className: 'flex min-w-0 items-center gap-3', children: [isExpanded ? (_jsx(ChevronDown, { size: 16, className: 'flex-shrink-0 text-text-secondary' })) : (_jsx(ChevronRight, { size: 16, className: 'flex-shrink-0 text-text-secondary' })), _jsxs("div", { className: 'min-w-0', children: [_jsx("div", { className: 'text-sm font-medium text-text-primary dark:text-text-primary', children: item.title }), item.subtitle ? _jsx("div", { className: 'mt-0.5 text-xs text-text-secondary dark:text-text-secondary', children: item.subtitle }) : null] })] }), item.actions ? (_jsx("div", { className: 'ml-4 flex items-center gap-2', onClick: (event) => event.stopPropagation(), children: item.actions })) : null] }), isExpanded ? _jsx("div", { className: 'bg-sand/5 dark:bg-sand/5', children: item.content }) : null] }, item.id));
9
+ return (_jsxs("li", { children: [_jsxs("div", { className: 'flex cursor-pointer items-center justify-between px-4 py-4 transition-colors hover:bg-sand/5 dark:hover:bg-sand/10 sm:px-6', onClick: () => setExpandedId(isExpanded ? null : item.id), children: [_jsxs("div", { className: 'flex min-w-0 items-center gap-3', children: [_jsx(ChevronDown, { size: 16, className: cn('flex-shrink-0 text-text-secondary transition-transform duration-300 ease-in-out', isExpanded ? 'rotate-0' : '-rotate-90') }), _jsxs("div", { className: 'min-w-0', children: [_jsx("div", { className: 'text-sm font-medium text-text-primary dark:text-text-primary', children: item.title }), item.subtitle ? _jsx("div", { className: 'mt-0.5 text-xs text-text-secondary dark:text-text-secondary', children: item.subtitle }) : null] })] }), item.actions ? (_jsx("div", { className: 'ml-4 flex items-center gap-2', onClick: (event) => event.stopPropagation(), children: item.actions })) : null] }), _jsx("div", { className: cn('grid transition-[grid-template-rows] duration-300 ease-in-out', isExpanded ? 'grid-rows-[1fr]' : 'grid-rows-[0fr]'), children: _jsx("div", { className: 'overflow-hidden', children: _jsx("div", { className: 'bg-sand/5 dark:bg-sand/5', children: item.content }) }) })] }, item.id));
10
10
  }) }) }));
11
11
  }
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ export interface AlertDialogProps {
3
+ cancelLabel?: string;
4
+ className?: string;
5
+ confirmLabel?: string;
6
+ description?: string;
7
+ isOpen: boolean;
8
+ onCancel: () => void;
9
+ onConfirm: () => void;
10
+ title: string;
11
+ variant?: 'default' | 'destructive';
12
+ }
13
+ export declare function AlertDialog({ cancelLabel, className, confirmLabel, description, isOpen, onCancel, onConfirm, title, variant }: AlertDialogProps): React.ReactPortal | null;
@@ -0,0 +1,42 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { AlertTriangle } from 'lucide-react';
3
+ import React from 'react';
4
+ import { createPortal } from 'react-dom';
5
+ import { cn } from '../utils/cn.js';
6
+ export function AlertDialog({ cancelLabel = 'Cancel', className, confirmLabel = 'Continue', description, isOpen, onCancel, onConfirm, title, variant = 'default' }) {
7
+ const dialogRef = React.useRef(null);
8
+ React.useEffect(() => {
9
+ const dialog = dialogRef.current;
10
+ if (!dialog)
11
+ return;
12
+ if (isOpen && !dialog.open) {
13
+ dialog.showModal();
14
+ }
15
+ else if (!isOpen && dialog.open) {
16
+ dialog.close();
17
+ }
18
+ }, [isOpen]);
19
+ // Trap focus & handle keyboard dismissal
20
+ React.useEffect(() => {
21
+ if (!isOpen)
22
+ return;
23
+ const handleKeyDown = (event) => {
24
+ if (event.key === 'Escape') {
25
+ event.preventDefault();
26
+ onCancel();
27
+ }
28
+ };
29
+ document.addEventListener('keydown', handleKeyDown);
30
+ return () => document.removeEventListener('keydown', handleKeyDown);
31
+ }, [isOpen, onCancel]);
32
+ if (typeof document === 'undefined' || !isOpen) {
33
+ return null;
34
+ }
35
+ return createPortal(_jsx("dialog", { ref: dialogRef, className: cn('m-auto w-full max-w-md rounded-[24px] border border-sand/10 bg-white p-0 text-text-primary shadow-xl outline-none backdrop:bg-black/50 backdrop:backdrop-blur-sm dark:border-sand/20 dark:bg-dark-sand dark:text-text-primary dark:backdrop:bg-black/70', className), onClick: (event) => {
36
+ if (event.target === dialogRef.current) {
37
+ onCancel();
38
+ }
39
+ }, onClose: onCancel, children: _jsxs("div", { className: 'p-6', children: [_jsxs("div", { className: 'mb-4 flex items-start gap-4', children: [_jsx("div", { className: cn('flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-full', variant === 'destructive'
40
+ ? 'bg-terracotta/10 text-terracotta dark:bg-terracotta/20'
41
+ : 'bg-desert/10 text-desert dark:bg-desert/20 dark:text-accent-gold'), children: _jsx(AlertTriangle, { size: 20 }) }), _jsxs("div", { className: 'min-w-0 flex-1', children: [_jsx("h3", { className: 'text-lg font-semibold leading-tight text-text-primary dark:text-text-primary', children: title }), description ? _jsx("p", { className: 'mt-1.5 text-sm leading-relaxed text-text-secondary dark:text-text-secondary', children: description }) : null] })] }), _jsxs("div", { className: 'flex justify-end gap-3', children: [_jsx("button", { type: 'button', onClick: onCancel, className: 'inline-flex items-center justify-center rounded-full border border-sand/20 bg-white/65 px-4 py-2 text-sm font-medium tracking-refined text-text-primary transition-all duration-400 hover:-translate-y-0.5 hover:bg-white focus:outline-none focus-visible:ring-2 focus-visible:ring-sea dark:border-sand/50 dark:bg-sand/20 dark:text-text-primary dark:hover:bg-sand/30 dark:focus-visible:ring-accent-blue', children: cancelLabel }), _jsx("button", { type: 'button', onClick: onConfirm, className: cn('inline-flex items-center justify-center rounded-full border-transparent px-4 py-2 text-sm font-medium tracking-refined text-white transition-all duration-400 hover:-translate-y-0.5 focus:outline-none focus-visible:ring-2 focus-visible:ring-sea disabled:pointer-events-none disabled:opacity-50 dark:focus-visible:ring-accent-blue', variant === 'destructive' ? 'bg-terracotta hover:opacity-90' : 'bg-sea hover:bg-desert'), children: confirmLabel })] })] }) }), document.body);
42
+ }
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ export type AlertType = 'success' | 'error' | 'info' | 'warning';
3
+ export interface AlertProps {
4
+ className?: string;
5
+ duration?: number;
6
+ message: string;
7
+ onClose: () => void;
8
+ type?: AlertType;
9
+ }
10
+ export declare function Alert({ className, duration, message, onClose, type }: AlertProps): React.ReactPortal | null;
11
+ export declare function showAlert(message: string, type?: AlertType): void;
12
+ export declare function AlertContainer(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,94 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { AlertCircle, AlertTriangle, CheckCircle, Info, X } from 'lucide-react';
3
+ import React from 'react';
4
+ import { createPortal } from 'react-dom';
5
+ import { cn } from '../utils/cn.js';
6
+ const alertConfig = {
7
+ success: {
8
+ icon: CheckCircle,
9
+ bgColor: 'bg-sea/10 dark:bg-accent-blue/10',
10
+ borderColor: 'border-sea dark:border-accent-blue',
11
+ textColor: 'text-sea dark:text-accent-blue',
12
+ iconColor: 'text-sea dark:text-accent-blue'
13
+ },
14
+ error: {
15
+ icon: AlertCircle,
16
+ bgColor: 'bg-terracotta/10 dark:bg-terracotta/20',
17
+ borderColor: 'border-terracotta dark:border-accent-oxblood',
18
+ textColor: 'text-terracotta dark:text-terracotta',
19
+ iconColor: 'text-terracotta dark:text-terracotta'
20
+ },
21
+ warning: {
22
+ icon: AlertTriangle,
23
+ bgColor: 'bg-sunset/10 dark:bg-sunset/20',
24
+ borderColor: 'border-sunset dark:border-accent-gold',
25
+ textColor: 'text-desert dark:text-accent-gold',
26
+ iconColor: 'text-sunset dark:text-accent-gold'
27
+ },
28
+ info: {
29
+ icon: Info,
30
+ bgColor: 'bg-desert/10 dark:bg-accent-gold/10',
31
+ borderColor: 'border-desert dark:border-accent-gold',
32
+ textColor: 'text-text-primary dark:text-text-primary',
33
+ iconColor: 'text-desert dark:text-accent-gold'
34
+ }
35
+ };
36
+ export function Alert({ className, duration = 5000, message, onClose, type = 'info' }) {
37
+ const [isVisible, setIsVisible] = React.useState(false);
38
+ const config = alertConfig[type];
39
+ const Icon = config.icon;
40
+ React.useEffect(() => {
41
+ if (typeof window === 'undefined') {
42
+ return undefined;
43
+ }
44
+ window.requestAnimationFrame(() => {
45
+ setIsVisible(true);
46
+ });
47
+ if (duration <= 0) {
48
+ return undefined;
49
+ }
50
+ const timer = window.setTimeout(() => {
51
+ handleClose();
52
+ }, duration);
53
+ return () => window.clearTimeout(timer);
54
+ }, [duration]);
55
+ const handleClose = () => {
56
+ setIsVisible(false);
57
+ if (typeof window === 'undefined') {
58
+ onClose();
59
+ return;
60
+ }
61
+ window.setTimeout(onClose, 300);
62
+ };
63
+ if (typeof document === 'undefined') {
64
+ return null;
65
+ }
66
+ return createPortal(_jsx("div", { className: 'pointer-events-none fixed inset-0 z-[9999] flex items-start justify-center px-4 pt-24', children: _jsx("div", { className: cn('pointer-events-auto w-full max-w-md rounded-lg border-l-4 shadow-lg backdrop-blur-xl transition-all duration-400 ease-out dark:shadow-2xl', config.bgColor, config.borderColor, isVisible ? 'translate-y-0 opacity-100' : '-translate-y-4 opacity-0', className), children: _jsxs("div", { className: 'flex items-start gap-3 p-4', children: [_jsx(Icon, { className: cn('mt-0.5 h-5 w-5 flex-shrink-0', config.iconColor) }), _jsx("p", { className: cn('flex-1 text-sm font-medium tracking-refined', config.textColor), children: message }), _jsx("button", { type: 'button', onClick: handleClose, className: cn('hover:bg-black/5 dark:hover:bg-white/10 -mr-1 -mt-0.5 rounded-md p-1 transition-colors duration-200', config.textColor), "aria-label": 'Close alert', children: _jsx(X, { className: 'h-4 w-4' }) })] }) }) }), document.body);
67
+ }
68
+ let alertsState = [];
69
+ let listeners = [];
70
+ function notifyListeners() {
71
+ listeners.forEach((listener) => listener([...alertsState]));
72
+ }
73
+ export function showAlert(message, type = 'info') {
74
+ const id = Math.random().toString(36).substring(2, 9);
75
+ alertsState.push({ id, message, type });
76
+ notifyListeners();
77
+ }
78
+ export function AlertContainer() {
79
+ const [alerts, setAlerts] = React.useState([]);
80
+ React.useEffect(() => {
81
+ const listener = (nextAlerts) => {
82
+ setAlerts(nextAlerts);
83
+ };
84
+ listeners.push(listener);
85
+ return () => {
86
+ listeners = listeners.filter((entry) => entry !== listener);
87
+ };
88
+ }, []);
89
+ const removeAlert = (id) => {
90
+ alertsState = alertsState.filter((alert) => alert.id !== id);
91
+ notifyListeners();
92
+ };
93
+ return (_jsx(_Fragment, { children: alerts.map((alert) => (_jsx(Alert, { message: alert.message, onClose: () => removeAlert(alert.id), type: alert.type }, alert.id))) }));
94
+ }
@@ -0,0 +1,16 @@
1
+ export type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
2
+ export interface AvatarProps {
3
+ alt?: string;
4
+ className?: string;
5
+ fallback?: string;
6
+ size?: AvatarSize;
7
+ src?: string;
8
+ }
9
+ export declare function Avatar({ alt, className, fallback, size, src }: AvatarProps): import("react/jsx-runtime").JSX.Element;
10
+ export interface AvatarGroupProps {
11
+ avatars: AvatarProps[];
12
+ className?: string;
13
+ max?: number;
14
+ size?: AvatarSize;
15
+ }
16
+ export declare function AvatarGroup({ avatars, className, max, size }: AvatarGroupProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,36 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import React from 'react';
3
+ import { cn } from '../utils/cn.js';
4
+ const sizeClasses = {
5
+ xs: 'h-6 w-6 text-[10px]',
6
+ sm: 'h-8 w-8 text-xs',
7
+ md: 'h-10 w-10 text-sm',
8
+ lg: 'h-12 w-12 text-base',
9
+ xl: 'h-16 w-16 text-lg'
10
+ };
11
+ function getInitials(fallback) {
12
+ return fallback
13
+ .trim()
14
+ .split(/\s+/)
15
+ .slice(0, 2)
16
+ .map((word) => word[0]?.toUpperCase() ?? '')
17
+ .join('');
18
+ }
19
+ export function Avatar({ alt, className, fallback, size = 'md', src }) {
20
+ const [imgError, setImgError] = React.useState(false);
21
+ const showFallback = !src || imgError;
22
+ const initials = fallback ? getInitials(fallback) : null;
23
+ return (_jsxs("span", { className: cn('relative inline-flex flex-shrink-0 items-center justify-center overflow-hidden rounded-full border border-sand/20 bg-sand/10 dark:border-sand/40 dark:bg-sand/20', sizeClasses[size], className), children: [!showFallback && _jsx("img", { src: src, alt: alt ?? fallback ?? '', className: 'h-full w-full object-cover', onError: () => setImgError(true) }), showFallback && initials ? _jsx("span", { className: 'select-none font-medium text-text-secondary dark:text-text-primary', children: initials }) : null, showFallback && !initials ? (_jsx("svg", { className: 'h-3/5 w-3/5 text-text-secondary dark:text-text-primary', viewBox: '0 0 24 24', fill: 'currentColor', "aria-hidden": 'true', children: _jsx("path", { d: 'M7.5 6a4.5 4.5 0 1 1 9 0 4.5 4.5 0 0 1-9 0ZM3.751 20.105a8.25 8.25 0 0 1 16.498 0 .75.75 0 0 1-.437.695A18.683 18.683 0 0 1 12 22.5c-2.786 0-5.433-.608-7.812-1.7a.75.75 0 0 1-.437-.695Z' }) })) : null] }));
24
+ }
25
+ export function AvatarGroup({ avatars, className, max = 4, size = 'md' }) {
26
+ const visible = avatars.slice(0, max);
27
+ const overflow = avatars.length - max;
28
+ const overflowSizeClasses = {
29
+ xs: 'h-6 w-6 text-[10px]',
30
+ sm: 'h-8 w-8 text-xs',
31
+ md: 'h-10 w-10 text-xs',
32
+ lg: 'h-12 w-12 text-sm',
33
+ xl: 'h-16 w-16 text-base'
34
+ };
35
+ return (_jsxs("div", { className: cn('flex -space-x-2', className), children: [visible.map((avatar, index) => (_jsx(Avatar, { ...avatar, size: size, className: 'ring-2 ring-white dark:ring-dark-sand' }, index))), overflow > 0 && (_jsxs("span", { className: cn('inline-flex flex-shrink-0 items-center justify-center rounded-full border border-sand/20 bg-sand/10 font-medium text-text-secondary ring-2 ring-white dark:border-sand/40 dark:bg-sand/20 dark:text-text-primary dark:ring-dark-sand', overflowSizeClasses[size]), children: ["+", overflow] }))] }));
36
+ }
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import { type NavItem, type RenderLink } from './nav-menu';
3
+ export interface BreadcrumbItem extends NavItem {
4
+ href: string;
5
+ label: string;
6
+ }
7
+ export interface BreadcrumbProps {
8
+ className?: string;
9
+ /** Collapse items in the middle when there are more than this many items. 0 = never collapse. */
10
+ collapsedAfter?: number;
11
+ items: BreadcrumbItem[];
12
+ renderLink?: RenderLink<BreadcrumbItem>;
13
+ separator?: React.ReactNode;
14
+ }
15
+ export declare function Breadcrumb({ className, collapsedAfter, items, renderLink, separator }: BreadcrumbProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,24 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { ChevronRight, Ellipsis } from 'lucide-react';
3
+ import React from 'react';
4
+ import { cn } from '../utils/cn.js';
5
+ import { renderDefaultLink } from './nav-menu.js';
6
+ export function Breadcrumb({ className, collapsedAfter = 0, items, renderLink, separator }) {
7
+ const [expanded, setExpanded] = React.useState(false);
8
+ const linkRenderer = renderLink ?? (renderDefaultLink);
9
+ const separatorNode = separator ?? _jsx(ChevronRight, { size: 14, className: 'flex-shrink-0 text-text-secondary', "aria-hidden": 'true' });
10
+ const shouldCollapse = collapsedAfter > 0 && !expanded && items.length > collapsedAfter + 1;
11
+ const visibleItems = shouldCollapse ? [items[0], null, ...items.slice(-(collapsedAfter > 0 ? 1 : items.length))] : items;
12
+ return (_jsx("nav", { "aria-label": 'Breadcrumb', className: cn('flex items-center', className), children: _jsx("ol", { className: 'flex flex-wrap items-center gap-1.5', children: visibleItems.map((item, index) => {
13
+ const isLast = index === visibleItems.length - 1;
14
+ if (item === null) {
15
+ // Collapsed placeholder
16
+ return (_jsxs(React.Fragment, { children: [_jsx("li", { className: 'flex items-center', children: _jsx("button", { type: 'button', onClick: () => setExpanded(true), "aria-label": 'Show full path', className: 'inline-flex h-6 w-6 items-center justify-center rounded-md text-text-secondary transition-colors hover:bg-sand/10 hover:text-text-primary dark:hover:bg-sand/20 dark:hover:text-text-primary', children: _jsx(Ellipsis, { size: 14 }) }) }), _jsx("li", { "aria-hidden": 'true', className: 'flex items-center', children: separatorNode })] }, 'ellipsis'));
17
+ }
18
+ return (_jsxs(React.Fragment, { children: [_jsx("li", { className: 'flex items-center', children: isLast ? (_jsx("span", { "aria-current": 'page', className: 'text-sm font-medium text-text-primary dark:text-text-primary', children: item.label })) : (linkRenderer({
19
+ item,
20
+ className: 'text-sm text-text-secondary transition-colors hover:text-text-primary dark:text-text-secondary dark:hover:text-text-primary',
21
+ children: item.label
22
+ })) }), !isLast && (_jsx("li", { "aria-hidden": 'true', className: 'flex items-center', children: separatorNode }))] }, `${item.href}:${item.label}`));
23
+ }) }) }));
24
+ }
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ export interface ButtonGroupProps {
3
+ children: React.ReactNode;
4
+ className?: string;
5
+ orientation?: 'horizontal' | 'vertical';
6
+ }
7
+ /**
8
+ * ButtonGroup joins multiple Button (or button) elements into a connected
9
+ * strip with shared borders and no gap between items.
10
+ *
11
+ * Place regular <Button> or <button> elements as direct children.
12
+ * The group automatically adjusts border-radius so only the outer
13
+ * corners are rounded.
14
+ */
15
+ export declare function ButtonGroup({ children, className, orientation }: ButtonGroupProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,23 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cn } from '../utils/cn.js';
3
+ /**
4
+ * ButtonGroup joins multiple Button (or button) elements into a connected
5
+ * strip with shared borders and no gap between items.
6
+ *
7
+ * Place regular <Button> or <button> elements as direct children.
8
+ * The group automatically adjusts border-radius so only the outer
9
+ * corners are rounded.
10
+ */
11
+ export function ButtonGroup({ children, className, orientation = 'horizontal' }) {
12
+ return (_jsx("div", { role: 'group', className: cn('inline-flex', orientation === 'horizontal' ? 'flex-row' : 'flex-col',
13
+ // Collapse inner borders between siblings and remove intermediate radius
14
+ '[&>*]:rounded-none', orientation === 'horizontal'
15
+ ? [
16
+ '[&>*:not(:last-child)]:border-r-0',
17
+ '[&>*:first-child]:rounded-l-full',
18
+ '[&>*:last-child]:rounded-r-full',
19
+ // Ensure vertical borders between buttons are visible
20
+ '[&>*:not(:first-child)]:border-l'
21
+ ]
22
+ : ['[&>*:not(:last-child)]:border-b-0', '[&>*:first-child]:rounded-t-full', '[&>*:last-child]:rounded-b-full', '[&>*:not(:first-child)]:border-t'], className), children: children }));
23
+ }
@@ -1,4 +1,4 @@
1
- import type { SortState } from './sortable-table-header';
1
+ import type { SortState } from './table';
2
2
  export interface CollectionFilterOption {
3
3
  field: string;
4
4
  label: string;
@@ -16,7 +16,7 @@ export function CollectionFilters({ className, currentFilters, currentSort, filt
16
16
  }
17
17
  onFilterChange(nextFilters);
18
18
  };
19
- return (_jsxs("div", { className: cn('mb-6 space-y-4', className), children: [_jsxs("div", { className: 'flex flex-wrap items-center gap-3', children: [_jsxs("button", { type: 'button', onClick: () => setShowFilters((open) => !open), className: 'inline-flex items-center gap-2 rounded-lg border border-sand/30 bg-white px-4 py-2 text-text-primary transition-colors hover:bg-sand/5 dark:border-sand/50 dark:bg-sand/10 dark:text-text-primary dark:hover:bg-sand/20', children: [_jsx(Filter, { size: 18 }), "Filters", activeFilterCount > 0 ? _jsx("span", { className: 'ml-1 rounded-full bg-sea px-2 py-0.5 text-xs text-white dark:bg-accent-blue', children: activeFilterCount }) : null] }), _jsxs("div", { className: 'flex items-center gap-2', children: [_jsx(Select, { value: currentSort.field, onChange: (value) => onSortChange({ field: value, order: currentSort.order }), options: sortOptions.map((option) => ({ label: option.label, value: option.field })) }), _jsx("button", { type: 'button', onClick: () => onSortChange({ field: currentSort.field, order: currentSort.order === 'asc' ? 'desc' : 'asc' }), className: 'rounded-lg border border-sand/30 bg-white p-2 text-text-primary transition-colors hover:bg-sand/5 dark:border-sand/50 dark:bg-sand/10 dark:text-text-primary dark:hover:bg-sand/20', title: `Sort ${currentSort.order === 'asc' ? 'Descending' : 'Ascending'}`, children: _jsx(ArrowUpDown, { size: 18, className: currentSort.order === 'desc' ? 'rotate-180' : '' }) })] }), activeFilterCount > 0 ? (_jsxs("button", { type: 'button', onClick: () => onFilterChange({}), className: 'inline-flex items-center gap-2 rounded-lg px-3 py-2 text-sm text-terracotta transition-colors hover:bg-sand/5 dark:hover:bg-sand/10', children: [_jsx(X, { size: 16 }), "Clear all"] })) : null] }), showFilters ? (_jsx("div", { className: 'rounded-lg border border-sand/30 bg-white p-4 dark:border-sand/50 dark:bg-sand/10', children: _jsx("div", { className: 'grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3', children: filterOptions.map((option) => (_jsxs("div", { className: 'space-y-2', children: [_jsx("label", { className: 'block text-sm font-medium text-text-primary dark:text-text-primary', children: option.label }), option.type === 'select' && option.options ? (_jsx(Select, { value: currentFilters[option.field] || '', onChange: (value) => handleFilterChange(option.field, value), options: [{ label: 'All', value: '' }, ...option.options] })) : null, option.type === 'boolean' ? (_jsx(Select, { value: currentFilters[option.field] === undefined ? '' : String(currentFilters[option.field]), onChange: (value) => handleFilterChange(option.field, value === '' ? null : value === 'true'), options: [
19
+ return (_jsxs("div", { className: cn('mb-6 space-y-4', className), children: [_jsxs("div", { className: 'flex flex-wrap items-center gap-3', children: [_jsxs("button", { type: 'button', onClick: () => setShowFilters((open) => !open), className: 'inline-flex items-center gap-2 rounded-lg border border-sand/30 bg-white px-4 py-2 text-text-primary transition-colors hover:bg-sand/5 dark:border-sand/50 dark:bg-sand/10 dark:text-text-primary dark:hover:bg-sand/20', children: [_jsx(Filter, { size: 18 }), "Filters", activeFilterCount > 0 ? (_jsx("span", { className: 'ml-1 rounded-full bg-sea px-2 py-0.5 text-xs text-white dark:bg-accent-blue', children: activeFilterCount })) : null] }), _jsxs("div", { className: 'flex items-center gap-2', children: [_jsx(Select, { value: currentSort.field, onChange: (value) => onSortChange({ field: value, order: currentSort.order }), options: sortOptions.map((option) => ({ label: option.label, value: option.field })) }), _jsx("button", { type: 'button', onClick: () => onSortChange({ field: currentSort.field, order: currentSort.order === 'asc' ? 'desc' : 'asc' }), className: 'rounded-lg border border-sand/30 bg-white p-2 text-text-primary transition-colors hover:bg-sand/5 dark:border-sand/50 dark:bg-sand/10 dark:text-text-primary dark:hover:bg-sand/20', title: `Sort ${currentSort.order === 'asc' ? 'Descending' : 'Ascending'}`, children: _jsx(ArrowUpDown, { size: 18, className: currentSort.order === 'desc' ? 'rotate-180' : '' }) })] }), activeFilterCount > 0 ? (_jsxs("button", { type: 'button', onClick: () => onFilterChange({}), className: 'inline-flex items-center gap-2 rounded-lg px-3 py-2 text-sm text-terracotta transition-colors hover:bg-sand/5 dark:hover:bg-sand/10', children: [_jsx(X, { size: 16 }), "Clear all"] })) : null] }), showFilters ? (_jsx("div", { className: 'rounded-lg border border-sand/30 bg-white p-4 dark:border-sand/50 dark:bg-sand/10', children: _jsx("div", { className: 'grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3', children: filterOptions.map((option) => (_jsxs("div", { className: 'space-y-2', children: [_jsx("label", { className: 'block text-sm font-medium text-text-primary dark:text-text-primary', children: option.label }), option.type === 'select' && option.options ? (_jsx(Select, { value: currentFilters[option.field] || '', onChange: (value) => handleFilterChange(option.field, value), options: [{ label: 'All', value: '' }, ...option.options] })) : null, option.type === 'boolean' ? (_jsx(Select, { value: currentFilters[option.field] === undefined ? '' : String(currentFilters[option.field]), onChange: (value) => handleFilterChange(option.field, value === '' ? null : value === 'true'), options: [
20
20
  { label: 'All', value: '' },
21
21
  { label: 'Yes', value: 'true' },
22
22
  { label: 'No', value: 'false' }
@@ -0,0 +1,20 @@
1
+ export interface CalendarProps {
2
+ className?: string;
3
+ disabled?: (date: Date) => boolean;
4
+ maxDate?: Date;
5
+ minDate?: Date;
6
+ onChange?: (date: Date) => void;
7
+ value?: Date | null;
8
+ }
9
+ export declare function Calendar({ className, disabled: isDisabledFn, maxDate, minDate, onChange, value }: CalendarProps): import("react/jsx-runtime").JSX.Element;
10
+ export interface DatePickerProps {
11
+ className?: string;
12
+ disabled?: boolean;
13
+ disabledDates?: (date: Date) => boolean;
14
+ maxDate?: Date;
15
+ minDate?: Date;
16
+ onChange?: (date: Date | null) => void;
17
+ placeholder?: string;
18
+ value?: Date | null;
19
+ }
20
+ export declare function DatePicker({ className, disabled, disabledDates, maxDate, minDate, onChange, placeholder, value }: DatePickerProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,97 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { CalendarDays, ChevronLeft, ChevronRight } from 'lucide-react';
3
+ import React from 'react';
4
+ import { cn } from '../utils/cn.js';
5
+ // ─── Helpers ─────────────────────────────────────────────────────────────────
6
+ function getDaysInMonth(year, month) {
7
+ return new Date(year, month + 1, 0).getDate();
8
+ }
9
+ function getFirstDayOfMonth(year, month) {
10
+ return new Date(year, month, 1).getDay();
11
+ }
12
+ function isSameDay(a, b) {
13
+ return a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
14
+ }
15
+ function isToday(date) {
16
+ return isSameDay(date, new Date());
17
+ }
18
+ const MONTHS = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
19
+ const DAYS = ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'];
20
+ function formatDate(date) {
21
+ return date.toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' });
22
+ }
23
+ export function Calendar({ className, disabled: isDisabledFn, maxDate, minDate, onChange, value }) {
24
+ const today = new Date();
25
+ const [viewYear, setViewYear] = React.useState(value?.getFullYear() ?? today.getFullYear());
26
+ const [viewMonth, setViewMonth] = React.useState(value?.getMonth() ?? today.getMonth());
27
+ const days = getDaysInMonth(viewYear, viewMonth);
28
+ const firstDay = getFirstDayOfMonth(viewYear, viewMonth);
29
+ const prevMonth = () => {
30
+ if (viewMonth === 0) {
31
+ setViewMonth(11);
32
+ setViewYear((y) => y - 1);
33
+ }
34
+ else
35
+ setViewMonth((m) => m - 1);
36
+ };
37
+ const nextMonth = () => {
38
+ if (viewMonth === 11) {
39
+ setViewMonth(0);
40
+ setViewYear((y) => y + 1);
41
+ }
42
+ else
43
+ setViewMonth((m) => m + 1);
44
+ };
45
+ const cells = [...Array(firstDay).fill(null), ...Array.from({ length: days }, (_, i) => new Date(viewYear, viewMonth, i + 1))];
46
+ const isOutOfRange = (date) => {
47
+ if (minDate && date < minDate)
48
+ return true;
49
+ if (maxDate && date > maxDate)
50
+ return true;
51
+ return false;
52
+ };
53
+ return (_jsxs("div", { className: cn('w-full select-none', className), children: [_jsxs("div", { className: 'mb-4 flex items-center justify-between', children: [_jsx("button", { type: 'button', onClick: prevMonth, className: 'rounded-lg p-1.5 text-text-secondary transition-colors hover:bg-sand/10 hover:text-text-primary dark:hover:bg-sand/20 dark:hover:text-text-primary', "aria-label": 'Previous month', children: _jsx(ChevronLeft, { size: 16 }) }), _jsxs("span", { className: 'text-sm font-semibold text-text-primary dark:text-text-primary', children: [MONTHS[viewMonth], " ", viewYear] }), _jsx("button", { type: 'button', onClick: nextMonth, className: 'rounded-lg p-1.5 text-text-secondary transition-colors hover:bg-sand/10 hover:text-text-primary dark:hover:bg-sand/20 dark:hover:text-text-primary', "aria-label": 'Next month', children: _jsx(ChevronRight, { size: 16 }) })] }), _jsx("div", { className: 'mb-1 grid grid-cols-7', children: DAYS.map((d) => (_jsx("div", { className: 'flex h-8 items-center justify-center text-[11px] font-medium uppercase tracking-wider text-text-secondary dark:text-text-secondary', children: d }, d))) }), _jsx("div", { className: 'grid grid-cols-7 gap-y-0.5', children: cells.map((date, index) => {
54
+ if (!date)
55
+ return _jsx("div", {}, `empty-${index}`);
56
+ const selected = value && isSameDay(date, value);
57
+ const todayCell = isToday(date);
58
+ const outOfRange = isOutOfRange(date);
59
+ const disabled = outOfRange || isDisabledFn?.(date);
60
+ return (_jsx("button", { type: 'button', disabled: !!disabled, onClick: () => onChange?.(date), "aria-label": date.toDateString(), "aria-pressed": !!selected, className: cn('flex h-8 w-full items-center justify-center rounded-full text-sm transition-colors duration-150 focus:outline-none focus-visible:ring-2 focus-visible:ring-sea dark:focus-visible:ring-accent-blue', selected
61
+ ? 'bg-sea font-semibold text-white dark:bg-accent-blue'
62
+ : todayCell
63
+ ? 'font-semibold text-sea ring-1 ring-inset ring-sea dark:text-accent-blue dark:ring-accent-blue'
64
+ : 'text-text-primary hover:bg-sand/10 dark:text-text-primary dark:hover:bg-sand/15', disabled && 'pointer-events-none opacity-30'), children: date.getDate() }, date.toISOString()));
65
+ }) })] }));
66
+ }
67
+ export function DatePicker({ className, disabled = false, disabledDates, maxDate, minDate, onChange, placeholder = 'Pick a date', value }) {
68
+ const [open, setOpen] = React.useState(false);
69
+ const containerRef = React.useRef(null);
70
+ React.useEffect(() => {
71
+ if (!open)
72
+ return;
73
+ const handler = (e) => {
74
+ if (!containerRef.current?.contains(e.target))
75
+ setOpen(false);
76
+ };
77
+ document.addEventListener('pointerdown', handler);
78
+ return () => document.removeEventListener('pointerdown', handler);
79
+ }, [open]);
80
+ React.useEffect(() => {
81
+ if (!open)
82
+ return;
83
+ const handler = (e) => {
84
+ if (e.key === 'Escape')
85
+ setOpen(false);
86
+ };
87
+ document.addEventListener('keydown', handler);
88
+ return () => document.removeEventListener('keydown', handler);
89
+ }, [open]);
90
+ return (_jsxs("div", { ref: containerRef, className: cn('relative inline-block', className), children: [_jsxs("button", { type: 'button', disabled: disabled, onClick: () => !disabled && setOpen((v) => !v), "aria-haspopup": 'dialog', "aria-expanded": open, className: cn('flex h-10 min-w-[200px] items-center gap-2 rounded-[18px] border bg-white px-4 text-sm transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-sea dark:bg-dark-sand dark:focus:ring-accent-blue', open ? 'border-sea ring-2 ring-sea/20 dark:border-accent-blue dark:ring-accent-blue/20' : 'border-sand/30 hover:border-sand/50 dark:border-sand/50', value ? 'text-text-primary dark:text-text-primary' : 'text-text-secondary dark:text-text-secondary', disabled && 'cursor-not-allowed opacity-50'), children: [_jsx(CalendarDays, { size: 15, className: 'flex-shrink-0 text-text-secondary' }), _jsx("span", { className: 'flex-1 text-left', children: value ? formatDate(value) : placeholder })] }), open && (_jsxs("div", { role: 'dialog', "aria-label": 'Date picker', className: 'absolute left-0 top-full z-50 mt-1.5 w-72 rounded-2xl border border-sand/10 bg-white p-4 shadow-xl dark:border-sand/20 dark:bg-dark-sand', children: [_jsx(Calendar, { value: value, minDate: minDate, maxDate: maxDate, disabled: disabledDates, onChange: (date) => {
91
+ onChange?.(date);
92
+ setOpen(false);
93
+ } }), value && (_jsx("button", { type: 'button', onClick: () => {
94
+ onChange?.(null);
95
+ setOpen(false);
96
+ }, className: 'mt-3 w-full rounded-lg py-1.5 text-xs text-text-secondary transition-colors hover:bg-sand/10 hover:text-text-primary dark:hover:bg-sand/15 dark:hover:text-text-primary', children: "Clear date" }))] }))] }));
97
+ }
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ export interface DrawerProps {
3
+ children: React.ReactNode;
4
+ className?: string;
5
+ description?: string;
6
+ isOpen: boolean;
7
+ onClose: () => void;
8
+ snapPoints?: string[];
9
+ title?: string;
10
+ }
11
+ export declare function Drawer({ children, className, description, isOpen, onClose, title }: DrawerProps): React.ReactPortal | null;
@@ -0,0 +1,42 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Minus } from 'lucide-react';
3
+ import React from 'react';
4
+ import { createPortal } from 'react-dom';
5
+ import { cn } from '../utils/cn.js';
6
+ export function Drawer({ children, className, description, isOpen, onClose, title }) {
7
+ const [visible, setVisible] = React.useState(false);
8
+ const startYRef = React.useRef(null);
9
+ const panelRef = React.useRef(null);
10
+ React.useEffect(() => {
11
+ if (isOpen) {
12
+ requestAnimationFrame(() => setVisible(true));
13
+ }
14
+ else {
15
+ setVisible(false);
16
+ }
17
+ }, [isOpen]);
18
+ React.useEffect(() => {
19
+ if (!isOpen)
20
+ return;
21
+ const handler = (e) => {
22
+ if (e.key === 'Escape')
23
+ onClose();
24
+ };
25
+ document.addEventListener('keydown', handler);
26
+ return () => document.removeEventListener('keydown', handler);
27
+ }, [isOpen, onClose]);
28
+ const handleTouchStart = (e) => {
29
+ startYRef.current = e.touches[0].clientY;
30
+ };
31
+ const handleTouchEnd = (e) => {
32
+ if (startYRef.current === null)
33
+ return;
34
+ const delta = e.changedTouches[0].clientY - startYRef.current;
35
+ startYRef.current = null;
36
+ if (delta > 60)
37
+ onClose();
38
+ };
39
+ if (typeof document === 'undefined' || !isOpen)
40
+ return null;
41
+ return createPortal(_jsxs("div", { className: 'fixed inset-0 z-50', children: [_jsx("div", { className: cn('absolute inset-0 bg-black/50 backdrop-blur-sm transition-opacity duration-300', visible ? 'opacity-100' : 'opacity-0'), onClick: onClose, "aria-hidden": 'true' }), _jsxs("div", { ref: panelRef, role: 'dialog', "aria-modal": 'true', "aria-label": title, onTouchStart: handleTouchStart, onTouchEnd: handleTouchEnd, className: cn('absolute inset-x-0 bottom-0 flex max-h-[90dvh] flex-col rounded-t-3xl border-t border-sand/10 bg-white shadow-2xl transition-transform duration-300 ease-in-out dark:border-sand/20 dark:bg-dark-sand', visible ? 'translate-y-0' : 'translate-y-full', className), children: [_jsx("div", { className: 'flex items-center justify-center pt-3 pb-1', children: _jsx(Minus, { size: 24, className: 'text-sand/40 dark:text-sand/50', strokeWidth: 3, "aria-hidden": 'true' }) }), (title || description) && (_jsxs("div", { className: 'px-6 pb-4 pt-1', children: [title ? _jsx("h2", { className: 'text-base font-semibold text-text-primary dark:text-text-primary', children: title }) : null, description ? _jsx("p", { className: 'mt-0.5 text-sm text-text-secondary dark:text-text-secondary', children: description }) : null] })), _jsx("div", { className: 'flex-1 overflow-y-auto px-6 pb-6 pt-0', children: children })] })] }), document.body);
42
+ }
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ export interface EmptyProps {
3
+ action?: React.ReactNode;
4
+ className?: string;
5
+ description?: string;
6
+ icon?: React.ReactNode;
7
+ title: string;
8
+ }
9
+ export declare function Empty({ action, className, description, icon, title }: EmptyProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cn } from '../utils/cn.js';
3
+ const DefaultIcon = () => (_jsxs("svg", { xmlns: 'http://www.w3.org/2000/svg', viewBox: '0 0 64 64', fill: 'none', className: 'h-full w-full', "aria-hidden": 'true', children: [_jsx("rect", { x: '8', y: '16', width: '48', height: '36', rx: '6', stroke: 'currentColor', strokeWidth: '2' }), _jsx("path", { d: 'M8 28h48', stroke: 'currentColor', strokeWidth: '2' }), _jsx("path", { d: 'M24 40h16', stroke: 'currentColor', strokeWidth: '2', strokeLinecap: 'round' })] }));
4
+ export function Empty({ action, className, description, icon, title }) {
5
+ return (_jsxs("div", { className: cn('flex flex-col items-center justify-center gap-4 rounded-2xl border border-dashed border-sand/30 px-6 py-16 text-center dark:border-sand/30', className), children: [_jsx("div", { className: 'flex h-14 w-14 items-center justify-center rounded-full bg-sand/10 text-text-secondary dark:bg-sand/15 dark:text-text-primary', children: icon ?? (_jsx("span", { className: 'h-7 w-7 text-text-secondary dark:text-text-primary', children: _jsx(DefaultIcon, {}) })) }), _jsxs("div", { className: 'space-y-1.5', children: [_jsx("h3", { className: 'text-base font-semibold text-text-primary dark:text-text-primary', children: title }), description ? _jsx("p", { className: 'max-w-xs text-sm leading-relaxed text-text-secondary dark:text-text-secondary', children: description }) : null] }), action ? _jsx("div", { className: 'mt-1', children: action }) : null] }));
6
+ }
@@ -0,0 +1,5 @@
1
+ export interface FieldHelpTooltipProps {
2
+ className?: string;
3
+ text: string;
4
+ }
5
+ export declare function FieldHelpTooltip({ className, text }: FieldHelpTooltipProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Info } from 'lucide-react';
3
+ import { cn } from '../utils/cn.js';
4
+ export function FieldHelpTooltip({ className, text }) {
5
+ if (!text.trim()) {
6
+ return null;
7
+ }
8
+ return (_jsxs("span", { className: cn('group relative inline-flex items-center align-middle', className), children: [_jsx("button", { type: 'button', tabIndex: 0, "aria-label": text, title: text, className: 'inline-flex h-4 w-4 items-center justify-center rounded-full text-text-secondary transition-colors hover:text-text-primary focus:outline-none focus:ring-2 focus:ring-sea dark:focus:ring-accent-blue', children: _jsx(Info, { size: 14 }) }), _jsx("span", { className: 'pointer-events-none absolute left-1/2 top-full z-50 mt-2 hidden w-64 -translate-x-1/2 rounded-lg bg-dark-sand px-3 py-2 text-left text-xs font-normal leading-relaxed text-white shadow-xl group-hover:block group-focus-within:block', children: text })] }));
9
+ }
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ export interface HoverCardProps {
3
+ children: React.ReactNode;
4
+ className?: string;
5
+ content: React.ReactNode;
6
+ side?: 'top' | 'bottom';
7
+ }
8
+ /**
9
+ * A card that appears on hover over a trigger element.
10
+ * Pure CSS approach — no portal needed.
11
+ */
12
+ export declare function HoverCard({ children, className, content, side }: HoverCardProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cn } from '../utils/cn.js';
3
+ /**
4
+ * A card that appears on hover over a trigger element.
5
+ * Pure CSS approach — no portal needed.
6
+ */
7
+ export function HoverCard({ children, className, content, side = 'bottom' }) {
8
+ return (_jsxs("span", { className: 'group relative inline-flex', children: [children, _jsx("span", { className: cn('pointer-events-none absolute z-50 w-72 rounded-2xl border border-sand/10 bg-white p-4 shadow-xl opacity-0 transition-all duration-200 group-hover:pointer-events-auto group-hover:opacity-100 dark:border-sand/20 dark:bg-dark-sand', side === 'bottom' ? 'top-full left-1/2 mt-2 -translate-x-1/2 group-hover:translate-y-0' : 'bottom-full left-1/2 mb-2 -translate-x-1/2', className), role: 'tooltip', children: content })] }));
9
+ }
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ export interface KbdProps extends React.HTMLAttributes<HTMLElement> {
3
+ /** One or more keys to display. Pass multiple elements for key combos. */
4
+ keys?: string[];
5
+ }
6
+ /** Renders a keyboard key or key combination as styled <kbd> elements. */
7
+ export declare function Kbd({ className, keys, children, ...props }: KbdProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import React from 'react';
3
+ import { cn } from '../utils/cn.js';
4
+ /** Renders a keyboard key or key combination as styled <kbd> elements. */
5
+ export function Kbd({ className, keys, children, ...props }) {
6
+ if (keys && keys.length > 0) {
7
+ return (_jsx("span", { className: 'inline-flex items-center gap-0.5', "aria-label": keys.join('+'), role: 'group', children: keys.map((key, i) => (_jsxs(React.Fragment, { children: [i > 0 && _jsx("span", { className: 'text-xs text-text-secondary', children: "+" }), _jsx("kbd", { ...props, className: cn('inline-flex h-5 min-w-5 items-center justify-center rounded border border-sand/30 bg-sand/10 px-1.5 font-mono text-[11px] font-medium text-text-secondary shadow-[inset_0_-1px_0] shadow-sand/20 dark:border-sand/40 dark:bg-sand/15 dark:text-text-primary dark:shadow-sand/30', className), children: key })] }, key))) }));
8
+ }
9
+ return (_jsx("kbd", { ...props, className: cn('inline-flex h-5 min-w-5 items-center justify-center rounded border border-sand/30 bg-sand/10 px-1.5 font-mono text-[11px] font-medium text-text-secondary shadow-[inset_0_-1px_0] shadow-sand/20 dark:border-sand/40 dark:bg-sand/15 dark:text-text-primary dark:shadow-sand/30', className), children: children }));
10
+ }