@gaulatti/bleecker 0.1.7 → 0.1.9

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 (59) 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/avatar.d.ts +16 -0
  5. package/dist/components/avatar.js +36 -0
  6. package/dist/components/breadcrumb.d.ts +15 -0
  7. package/dist/components/breadcrumb.js +24 -0
  8. package/dist/components/button-group.d.ts +15 -0
  9. package/dist/components/button-group.js +23 -0
  10. package/dist/components/collection-filters.d.ts +1 -1
  11. package/dist/components/collection-filters.js +1 -1
  12. package/dist/components/command-spotlight.d.ts +30 -0
  13. package/dist/components/command-spotlight.js +214 -0
  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/hover-card.d.ts +12 -0
  21. package/dist/components/hover-card.js +9 -0
  22. package/dist/components/kbd.d.ts +7 -0
  23. package/dist/components/kbd.js +10 -0
  24. package/dist/components/menubar.d.ts +43 -0
  25. package/dist/components/menubar.js +58 -0
  26. package/dist/components/navigation-menu.d.ts +16 -0
  27. package/dist/components/navigation-menu.js +41 -0
  28. package/dist/components/otp-input.d.ts +11 -0
  29. package/dist/components/otp-input.js +53 -0
  30. package/dist/components/popover.d.ts +14 -0
  31. package/dist/components/popover.js +93 -0
  32. package/dist/components/progress.d.ts +11 -0
  33. package/dist/components/progress.js +17 -0
  34. package/dist/components/radio-group.d.ts +16 -0
  35. package/dist/components/radio-group.js +14 -0
  36. package/dist/components/scroll-area.d.ts +11 -0
  37. package/dist/components/scroll-area.js +12 -0
  38. package/dist/components/sheet.d.ts +12 -0
  39. package/dist/components/sheet.js +53 -0
  40. package/dist/components/slider.d.ts +11 -0
  41. package/dist/components/slider.js +9 -0
  42. package/dist/components/sonner.d.ts +29 -0
  43. package/dist/components/sonner.js +76 -0
  44. package/dist/components/sortable-table-header.js +4 -3
  45. package/dist/components/switch.d.ts +7 -0
  46. package/dist/components/switch.js +7 -0
  47. package/dist/components/table.d.ts +60 -0
  48. package/dist/components/table.js +92 -0
  49. package/dist/components/toggle-group.d.ts +26 -0
  50. package/dist/components/toggle-group.js +32 -0
  51. package/dist/components/toggle.d.ts +8 -0
  52. package/dist/components/toggle.js +26 -0
  53. package/dist/components/tooltip.d.ts +9 -0
  54. package/dist/components/tooltip.js +24 -0
  55. package/dist/index.d.ts +25 -1
  56. package/dist/index.js +25 -1
  57. package/dist/styles.css +1 -1
  58. package/dist/theme/theme-script.d.ts +1 -1
  59. package/package.json +1 -1
@@ -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,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
+ }
@@ -0,0 +1,43 @@
1
+ import React from 'react';
2
+ export interface MenubarItemBase {
3
+ label: string;
4
+ disabled?: boolean;
5
+ shortcut?: string;
6
+ }
7
+ export interface MenubarActionItem extends MenubarItemBase {
8
+ type: 'item';
9
+ onSelect: () => void;
10
+ icon?: React.ReactNode;
11
+ }
12
+ export interface MenubarCheckboxItem extends MenubarItemBase {
13
+ type: 'checkbox';
14
+ checked: boolean;
15
+ onCheckedChange: (checked: boolean) => void;
16
+ }
17
+ export interface MenubarRadioItem extends MenubarItemBase {
18
+ type: 'radio';
19
+ value: string;
20
+ }
21
+ export interface MenubarRadioGroup {
22
+ type: 'radioGroup';
23
+ value: string;
24
+ onValueChange: (value: string) => void;
25
+ items: MenubarRadioItem[];
26
+ }
27
+ export interface MenubarSeparator {
28
+ type: 'separator';
29
+ }
30
+ export interface MenubarSubMenu extends MenubarItemBase {
31
+ type: 'sub';
32
+ items: MenubarMenuItem[];
33
+ }
34
+ export type MenubarMenuItem = MenubarActionItem | MenubarCheckboxItem | MenubarRadioGroup | MenubarSeparator | MenubarSubMenu;
35
+ export interface MenubarMenu {
36
+ trigger: string;
37
+ items: MenubarMenuItem[];
38
+ }
39
+ export interface MenubarProps {
40
+ className?: string;
41
+ menus: MenubarMenu[];
42
+ }
43
+ export declare function Menubar({ className, menus }: MenubarProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,58 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Check, ChevronRight } from 'lucide-react';
3
+ import React from 'react';
4
+ import { cn } from '../utils/cn.js';
5
+ // ─── MenuItem renderer ───────────────────────────────────────────────────────
6
+ function MenuItems({ items, radioGroupValue, onClose }) {
7
+ const [openSub, setOpenSub] = React.useState(null);
8
+ return (_jsx("div", { className: 'flex flex-col py-1', children: items.map((item, i) => {
9
+ if (item.type === 'separator') {
10
+ return _jsx("div", { className: 'my-1 h-px bg-sand/15 dark:bg-sand/25', role: 'separator' }, i);
11
+ }
12
+ if (item.type === 'radioGroup') {
13
+ return (_jsx("div", { role: 'group', children: item.items.map((rItem) => {
14
+ const isChecked = item.value === rItem.value;
15
+ return (_jsxs("button", { type: 'button', role: 'menuitemradio', "aria-checked": isChecked, disabled: rItem.disabled, onClick: () => {
16
+ item.onValueChange(rItem.value);
17
+ onClose();
18
+ }, className: 'flex w-full items-center gap-2 rounded-lg px-3 py-1.5 text-sm text-text-primary transition-colors hover:bg-sand/10 disabled:opacity-50 dark:text-text-primary dark:hover:bg-sand/15', children: [_jsx("span", { className: 'flex h-4 w-4 items-center justify-center', children: isChecked ? _jsx("span", { className: 'h-2 w-2 rounded-full bg-sea dark:bg-accent-blue' }) : null }), rItem.label, rItem.shortcut ? _jsx("span", { className: 'ml-auto text-xs text-text-secondary', children: rItem.shortcut }) : null] }, rItem.value));
19
+ }) }, i));
20
+ }
21
+ if (item.type === 'checkbox') {
22
+ return (_jsxs("button", { type: 'button', role: 'menuitemcheckbox', "aria-checked": item.checked, disabled: item.disabled, onClick: () => {
23
+ item.onCheckedChange(!item.checked);
24
+ onClose();
25
+ }, className: 'flex w-full items-center gap-2 rounded-lg px-3 py-1.5 text-sm text-text-primary transition-colors hover:bg-sand/10 disabled:opacity-50 dark:text-text-primary dark:hover:bg-sand/15', children: [_jsx("span", { className: 'flex h-4 w-4 items-center justify-center', children: item.checked ? _jsx(Check, { size: 12, className: 'text-sea dark:text-accent-blue' }) : null }), item.label, item.shortcut ? _jsx("span", { className: 'ml-auto text-xs text-text-secondary', children: item.shortcut }) : null] }, i));
26
+ }
27
+ if (item.type === 'sub') {
28
+ const isSubOpen = openSub === i;
29
+ return (_jsxs("div", { className: 'relative', children: [_jsxs("button", { type: 'button', role: 'menuitem', "aria-haspopup": 'menu', "aria-expanded": isSubOpen, disabled: item.disabled, onPointerEnter: () => setOpenSub(i), onPointerLeave: () => setOpenSub(null), className: 'flex w-full items-center rounded-lg px-3 py-1.5 text-sm text-text-primary transition-colors hover:bg-sand/10 disabled:opacity-50 dark:text-text-primary dark:hover:bg-sand/15', children: [_jsx("span", { className: 'flex-1', children: item.label }), _jsx(ChevronRight, { size: 14, className: 'text-text-secondary' })] }), isSubOpen && (_jsx("div", { className: 'absolute left-full top-0 z-10 min-w-[12rem] rounded-xl border border-sand/10 bg-white shadow-xl dark:border-sand/20 dark:bg-dark-sand', onPointerEnter: () => setOpenSub(i), onPointerLeave: () => setOpenSub(null), children: _jsx(MenuItems, { items: item.items, onClose: onClose }) }))] }, i));
30
+ }
31
+ // type === 'item'
32
+ return (_jsxs("button", { type: 'button', role: 'menuitem', disabled: item.disabled, onClick: () => {
33
+ item.onSelect();
34
+ onClose();
35
+ }, className: 'flex w-full items-center gap-2 rounded-lg px-3 py-1.5 text-sm text-text-primary transition-colors hover:bg-sand/10 disabled:opacity-50 dark:text-text-primary dark:hover:bg-sand/15', children: [item.icon ? _jsx("span", { className: 'flex-shrink-0 text-text-secondary', children: item.icon }) : _jsx("span", { className: 'w-4' }), _jsx("span", { className: 'flex-1', children: item.label }), item.shortcut ? _jsx("span", { className: 'ml-auto text-xs text-text-secondary', children: item.shortcut }) : null] }, i));
36
+ }) }));
37
+ }
38
+ // ─── Menubar ─────────────────────────────────────────────────────────────────
39
+ export function Menubar({ className, menus }) {
40
+ const [activeIndex, setActiveIndex] = React.useState(null);
41
+ const barRef = React.useRef(null);
42
+ React.useEffect(() => {
43
+ if (activeIndex === null)
44
+ return;
45
+ const handler = (e) => {
46
+ if (!barRef.current?.contains(e.target))
47
+ setActiveIndex(null);
48
+ };
49
+ document.addEventListener('pointerdown', handler);
50
+ return () => document.removeEventListener('pointerdown', handler);
51
+ }, [activeIndex]);
52
+ return (_jsx("div", { ref: barRef, role: 'menubar', className: cn('flex items-center gap-1 rounded-xl border border-sand/10 bg-white/80 px-1 py-1 shadow-sm backdrop-blur-md dark:border-sand/20 dark:bg-dark-sand/80', className), children: menus.map((menu, i) => {
53
+ const isOpen = activeIndex === i;
54
+ return (_jsxs("div", { className: 'relative', children: [_jsx("button", { type: 'button', role: 'menuitem', "aria-haspopup": 'menu', "aria-expanded": isOpen, onClick: () => setActiveIndex(isOpen ? null : i), className: cn('rounded-lg px-3 py-1.5 text-sm font-medium transition-colors duration-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-sea dark:focus-visible:ring-accent-blue', isOpen
55
+ ? 'bg-sea text-white dark:bg-accent-blue'
56
+ : 'text-text-secondary hover:bg-sand/10 hover:text-text-primary dark:text-text-secondary dark:hover:bg-sand/15 dark:hover:text-text-primary'), children: menu.trigger }), isOpen && (_jsx("div", { role: 'menu', className: 'absolute left-0 top-full z-50 mt-1 min-w-[14rem] rounded-xl border border-sand/10 bg-white p-1 shadow-xl dark:border-sand/20 dark:bg-dark-sand', children: _jsx(MenuItems, { items: menu.items, onClose: () => setActiveIndex(null) }) }))] }, menu.trigger));
57
+ }) }));
58
+ }
@@ -0,0 +1,16 @@
1
+ import { type NavItem, type RenderLink } from './nav-menu';
2
+ export interface NavigationMenuLink extends NavItem {
3
+ description?: string;
4
+ }
5
+ export interface NavigationMenuGroup {
6
+ trigger: string;
7
+ href?: string;
8
+ items: NavigationMenuLink[];
9
+ }
10
+ export type NavigationMenuEntry = NavigationMenuLink | NavigationMenuGroup;
11
+ export interface NavigationMenuProps<TLink extends NavigationMenuLink = NavigationMenuLink> {
12
+ className?: string;
13
+ entries: NavigationMenuEntry[];
14
+ renderLink?: RenderLink<TLink>;
15
+ }
16
+ export declare function NavigationMenu<TLink extends NavigationMenuLink>({ className, entries, renderLink }: NavigationMenuProps<TLink>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,41 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { ChevronDown } from 'lucide-react';
3
+ import React from 'react';
4
+ import { cn } from '../utils/cn.js';
5
+ import { renderDefaultLink } from './nav-menu.js';
6
+ function isGroup(entry) {
7
+ return 'items' in entry;
8
+ }
9
+ export function NavigationMenu({ className, entries, renderLink }) {
10
+ const [activeIndex, setActiveIndex] = React.useState(null);
11
+ const linkRenderer = (renderLink ?? renderDefaultLink);
12
+ const containerRef = React.useRef(null);
13
+ React.useEffect(() => {
14
+ if (activeIndex === null)
15
+ return;
16
+ const handler = (e) => {
17
+ if (!containerRef.current?.contains(e.target))
18
+ setActiveIndex(null);
19
+ };
20
+ document.addEventListener('pointerdown', handler);
21
+ return () => document.removeEventListener('pointerdown', handler);
22
+ }, [activeIndex]);
23
+ return (_jsx("div", { ref: containerRef, className: cn('relative flex items-center gap-1', className), children: entries.map((entry, i) => {
24
+ if (!isGroup(entry)) {
25
+ return (_jsx(React.Fragment, { children: linkRenderer({
26
+ item: entry,
27
+ className: 'px-3 py-2 text-sm font-medium text-text-secondary transition-colors duration-200 hover:text-text-primary rounded-lg hover:bg-sand/10 dark:text-text-secondary dark:hover:text-text-primary dark:hover:bg-sand/15',
28
+ children: entry.label
29
+ }) }, entry.href));
30
+ }
31
+ const isOpen = activeIndex === i;
32
+ return (_jsxs("div", { className: 'relative', children: [_jsxs("button", { type: 'button', onClick: () => setActiveIndex(isOpen ? null : i), "aria-expanded": isOpen, className: cn('flex items-center gap-1 rounded-lg px-3 py-2 text-sm font-medium transition-colors duration-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-sea dark:focus-visible:ring-accent-blue', isOpen
33
+ ? 'bg-sand/10 text-text-primary dark:bg-sand/15 dark:text-text-primary'
34
+ : 'text-text-secondary hover:bg-sand/10 hover:text-text-primary dark:text-text-secondary dark:hover:bg-sand/15 dark:hover:text-text-primary'), children: [entry.trigger, _jsx(ChevronDown, { size: 14, className: cn('transition-transform duration-200', isOpen ? 'rotate-180' : 'rotate-0') })] }), isOpen && (_jsx("div", { className: 'absolute left-0 top-full z-50 mt-1.5 min-w-[16rem] rounded-2xl border border-sand/10 bg-white p-2 shadow-xl dark:border-sand/20 dark:bg-dark-sand', children: entry.items.map((item) => (_jsx(React.Fragment, { children: linkRenderer({
35
+ item,
36
+ className: 'flex flex-col rounded-lg px-3 py-2.5 hover:bg-sand/10 dark:hover:bg-sand/15 transition-colors duration-200',
37
+ children: (_jsxs(_Fragment, { children: [_jsx("span", { className: 'text-sm font-medium text-text-primary dark:text-text-primary', children: item.label }), item.description ? (_jsx("span", { className: 'mt-0.5 text-xs leading-relaxed text-text-secondary dark:text-text-secondary', children: item.description })) : null] })),
38
+ onClick: () => setActiveIndex(null)
39
+ }) }, item.href))) }))] }, entry.trigger));
40
+ }) }));
41
+ }
@@ -0,0 +1,11 @@
1
+ export interface OtpInputProps {
2
+ className?: string;
3
+ disabled?: boolean;
4
+ /** Number of digits (default 6) */
5
+ length?: number;
6
+ onChange?: (value: string) => void;
7
+ /** Whether to mask input like a password */
8
+ secure?: boolean;
9
+ value?: string;
10
+ }
11
+ export declare function OtpInput({ className, disabled, length, onChange, secure, value }: OtpInputProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,53 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import React from 'react';
3
+ import { cn } from '../utils/cn.js';
4
+ export function OtpInput({ className, disabled = false, length = 6, onChange, secure = false, value = '' }) {
5
+ const inputRefs = React.useRef([]);
6
+ const digits = value.padEnd(length, '').slice(0, length).split('');
7
+ const notify = (newDigits) => {
8
+ onChange?.(newDigits.join('').replace(/\s/g, ''));
9
+ };
10
+ const handleChange = (index, char) => {
11
+ const next = [...digits];
12
+ // Accept only one digit at a time; handle paste below
13
+ const clean = char.replace(/\D/g, '').slice(-1);
14
+ next[index] = clean;
15
+ notify(next);
16
+ if (clean && index < length - 1) {
17
+ inputRefs.current[index + 1]?.focus();
18
+ }
19
+ };
20
+ const handleKeyDown = (index, event) => {
21
+ if (event.key === 'Backspace') {
22
+ event.preventDefault();
23
+ const next = [...digits];
24
+ if (next[index]) {
25
+ next[index] = ' ';
26
+ notify(next);
27
+ }
28
+ else if (index > 0) {
29
+ next[index - 1] = ' ';
30
+ notify(next);
31
+ inputRefs.current[index - 1]?.focus();
32
+ }
33
+ }
34
+ if (event.key === 'ArrowLeft' && index > 0)
35
+ inputRefs.current[index - 1]?.focus();
36
+ if (event.key === 'ArrowRight' && index < length - 1)
37
+ inputRefs.current[index + 1]?.focus();
38
+ };
39
+ const handlePaste = (event) => {
40
+ event.preventDefault();
41
+ const pasted = event.clipboardData.getData('text').replace(/\D/g, '').slice(0, length);
42
+ const next = pasted.padEnd(length, ' ').split('');
43
+ notify(next);
44
+ const focusIndex = Math.min(pasted.length, length - 1);
45
+ inputRefs.current[focusIndex]?.focus();
46
+ };
47
+ return (_jsx("div", { className: cn('flex items-center gap-2', className), role: 'group', "aria-label": 'One-time password input', children: Array.from({ length }, (_, i) => {
48
+ const digit = digits[i]?.trim() ?? '';
49
+ return (_jsx("input", { ref: (el) => {
50
+ inputRefs.current[i] = el;
51
+ }, type: secure ? 'password' : 'text', inputMode: 'numeric', maxLength: 1, value: digit, disabled: disabled, "aria-label": `Digit ${i + 1}`, onChange: (e) => handleChange(i, e.target.value), onKeyDown: (e) => handleKeyDown(i, e), onPaste: handlePaste, onFocus: (e) => e.target.select(), className: cn('h-12 w-10 rounded-xl border bg-white text-center text-lg font-semibold tracking-widest text-text-primary caret-sea transition-all duration-200 outline-none dark:bg-dark-sand dark:text-text-primary dark:caret-accent-blue', digit ? 'border-sea dark:border-accent-blue' : 'border-sand/30 dark:border-sand/50', 'focus:border-sea focus:ring-2 focus:ring-sea/30 dark:focus:border-accent-blue dark:focus:ring-accent-blue/30', disabled && 'cursor-not-allowed opacity-50') }, i));
52
+ }) }));
53
+ }
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ export type PopoverSide = 'top' | 'bottom' | 'left' | 'right';
3
+ export type PopoverAlign = 'start' | 'center' | 'end';
4
+ export interface PopoverProps {
5
+ align?: PopoverAlign;
6
+ children: React.ReactNode;
7
+ className?: string;
8
+ content: React.ReactNode;
9
+ /** Controlled open state */
10
+ open?: boolean;
11
+ onOpenChange?: (open: boolean) => void;
12
+ side?: PopoverSide;
13
+ }
14
+ export declare function Popover({ align, children, className, content, onOpenChange, open: controlledOpen, side }: PopoverProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,93 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import React from 'react';
3
+ import { createPortal } from 'react-dom';
4
+ import { cn } from '../utils/cn.js';
5
+ export function Popover({ align = 'center', children, className, content, onOpenChange, open: controlledOpen, side = 'bottom' }) {
6
+ const [internalOpen, setInternalOpen] = React.useState(false);
7
+ const isOpen = controlledOpen !== undefined ? controlledOpen : internalOpen;
8
+ const setOpen = (v) => {
9
+ setInternalOpen(v);
10
+ onOpenChange?.(v);
11
+ };
12
+ const triggerRef = React.useRef(null);
13
+ const panelRef = React.useRef(null);
14
+ const [coords, setCoords] = React.useState({ top: 0, left: 0 });
15
+ const reposition = React.useCallback(() => {
16
+ if (!triggerRef.current)
17
+ return;
18
+ const rect = triggerRef.current.getBoundingClientRect();
19
+ const scroll = { x: window.scrollX, y: window.scrollY };
20
+ let top = 0;
21
+ let left = 0;
22
+ const panelW = panelRef.current?.offsetWidth ?? 220;
23
+ const panelH = panelRef.current?.offsetHeight ?? 100;
24
+ const gap = 8;
25
+ if (side === 'bottom')
26
+ top = rect.bottom + scroll.y + gap;
27
+ if (side === 'top')
28
+ top = rect.top + scroll.y - panelH - gap;
29
+ if (side === 'left') {
30
+ top = rect.top + scroll.y;
31
+ left = rect.left + scroll.x - panelW - gap;
32
+ }
33
+ if (side === 'right') {
34
+ top = rect.top + scroll.y;
35
+ left = rect.right + scroll.x + gap;
36
+ }
37
+ if (side === 'bottom' || side === 'top') {
38
+ if (align === 'start')
39
+ left = rect.left + scroll.x;
40
+ else if (align === 'end')
41
+ left = rect.right + scroll.x - panelW;
42
+ else
43
+ left = rect.left + scroll.x + rect.width / 2 - panelW / 2;
44
+ }
45
+ if (side === 'left' || side === 'right') {
46
+ if (align === 'start')
47
+ top = rect.top + scroll.y;
48
+ else if (align === 'end')
49
+ top = rect.bottom + scroll.y - panelH;
50
+ else
51
+ top = rect.top + scroll.y + rect.height / 2 - panelH / 2;
52
+ }
53
+ setCoords({ top, left });
54
+ }, [side, align]);
55
+ React.useEffect(() => {
56
+ if (!isOpen)
57
+ return;
58
+ reposition();
59
+ window.addEventListener('resize', reposition);
60
+ window.addEventListener('scroll', reposition, true);
61
+ return () => {
62
+ window.removeEventListener('resize', reposition);
63
+ window.removeEventListener('scroll', reposition, true);
64
+ };
65
+ }, [isOpen, reposition]);
66
+ // Close on outside click
67
+ React.useEffect(() => {
68
+ if (!isOpen)
69
+ return;
70
+ const handlePointerDown = (e) => {
71
+ if (!triggerRef.current?.contains(e.target) && !panelRef.current?.contains(e.target)) {
72
+ setOpen(false);
73
+ }
74
+ };
75
+ document.addEventListener('pointerdown', handlePointerDown);
76
+ return () => document.removeEventListener('pointerdown', handlePointerDown);
77
+ }, [isOpen]);
78
+ // Close on Escape
79
+ React.useEffect(() => {
80
+ if (!isOpen)
81
+ return;
82
+ const handleKey = (e) => {
83
+ if (e.key === 'Escape')
84
+ setOpen(false);
85
+ };
86
+ document.addEventListener('keydown', handleKey);
87
+ return () => document.removeEventListener('keydown', handleKey);
88
+ }, [isOpen]);
89
+ const panel = isOpen && typeof document !== 'undefined'
90
+ ? createPortal(_jsx("div", { ref: panelRef, role: 'dialog', className: cn('absolute z-50 min-w-[14rem] rounded-2xl border border-sand/10 bg-white p-1 shadow-xl outline-none dark:border-sand/20 dark:bg-dark-sand', 'animate-in fade-in-0 zoom-in-95', className), style: { top: coords.top, left: coords.left }, children: content }), document.body)
91
+ : null;
92
+ return (_jsxs(_Fragment, { children: [_jsx("span", { ref: triggerRef, className: 'inline-flex', onClick: () => setOpen(!isOpen), children: children }), panel] }));
93
+ }
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ export interface ProgressProps extends React.HTMLAttributes<HTMLDivElement> {
3
+ /** 0–100 */
4
+ value?: number;
5
+ max?: number;
6
+ /** Show the numeric label inside/next to the bar */
7
+ showLabel?: boolean;
8
+ size?: 'sm' | 'md' | 'lg';
9
+ variant?: 'default' | 'success' | 'warning' | 'destructive';
10
+ }
11
+ export declare function Progress({ className, max, showLabel, size, value, variant, ...props }: ProgressProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cn } from '../utils/cn.js';
3
+ const sizeClasses = {
4
+ sm: 'h-1.5',
5
+ md: 'h-2.5',
6
+ lg: 'h-4'
7
+ };
8
+ const variantFill = {
9
+ default: 'bg-sea dark:bg-accent-blue',
10
+ success: 'bg-sea dark:bg-accent-blue',
11
+ warning: 'bg-sunset dark:bg-accent-gold',
12
+ destructive: 'bg-terracotta'
13
+ };
14
+ export function Progress({ className, max = 100, showLabel = false, size = 'md', value = 0, variant = 'default', ...props }) {
15
+ const pct = Math.min(100, Math.max(0, (value / max) * 100));
16
+ return (_jsxs("div", { className: cn('flex items-center gap-3', className), ...props, children: [_jsx("div", { role: 'progressbar', "aria-valuenow": value, "aria-valuemin": 0, "aria-valuemax": max, className: cn('flex-1 overflow-hidden rounded-full bg-sand/15 dark:bg-sand/20', sizeClasses[size]), children: _jsx("div", { className: cn('h-full rounded-full transition-[width] duration-500 ease-out', variantFill[variant]), style: { width: `${pct}%` } }) }), showLabel && (_jsxs("span", { className: 'min-w-[2.5rem] text-right text-xs font-medium tabular-nums text-text-secondary dark:text-text-primary', children: [Math.round(pct), "%"] }))] }));
17
+ }
@@ -0,0 +1,16 @@
1
+ export interface RadioOption {
2
+ description?: string;
3
+ disabled?: boolean;
4
+ label: string;
5
+ value: string;
6
+ }
7
+ export interface RadioGroupProps {
8
+ className?: string;
9
+ disabled?: boolean;
10
+ name?: string;
11
+ onChange?: (value: string) => void;
12
+ options: RadioOption[];
13
+ orientation?: 'vertical' | 'horizontal';
14
+ value?: string;
15
+ }
16
+ export declare function RadioGroup({ className, disabled, name, onChange, options, orientation, value }: RadioGroupProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,14 @@
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
+ export function RadioGroup({ className, disabled, name, onChange, options, orientation = 'vertical', value }) {
5
+ const groupName = name ?? React.useId();
6
+ return (_jsx("div", { role: 'radiogroup', className: cn('flex', orientation === 'horizontal' ? 'flex-row flex-wrap gap-4' : 'flex-col gap-3', className), children: options.map((option) => {
7
+ const isChecked = option.value === value;
8
+ const isDisabled = disabled || option.disabled;
9
+ const id = `${groupName}-${option.value}`;
10
+ return (_jsxs("label", { htmlFor: id, className: cn('group flex cursor-pointer select-none items-start gap-3', isDisabled && 'cursor-not-allowed opacity-50'), children: [_jsxs("span", { className: 'relative mt-0.5 flex-shrink-0', children: [_jsx("input", { id: id, type: 'radio', name: groupName, value: option.value, checked: isChecked, disabled: isDisabled, onChange: () => onChange?.(option.value), className: 'sr-only' }), _jsx("span", { className: cn('flex h-4.5 w-4.5 items-center justify-center rounded-full border-2 transition-colors duration-200', isChecked
11
+ ? 'border-sea dark:border-accent-blue'
12
+ : 'border-sand/40 group-hover:border-sea/60 dark:border-sand/60 dark:group-hover:border-accent-blue/60'), children: _jsx("span", { className: cn('h-2 w-2 rounded-full bg-sea transition-transform duration-200 dark:bg-accent-blue', isChecked ? 'scale-100' : 'scale-0') }) })] }), _jsxs("span", { children: [_jsx("span", { className: 'block text-sm font-medium text-text-primary dark:text-text-primary', children: option.label }), option.description ? (_jsx("span", { className: 'block text-xs leading-relaxed text-text-secondary dark:text-text-secondary', children: option.description })) : null] })] }, option.value));
13
+ }) }));
14
+ }
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ export interface ScrollAreaProps extends React.HTMLAttributes<HTMLDivElement> {
3
+ /** max-height applied to the viewport only. Use any valid CSS value. */
4
+ maxHeight?: string;
5
+ orientation?: 'vertical' | 'horizontal' | 'both';
6
+ }
7
+ /**
8
+ * A thin wrapper that applies custom-styled scrollbars while keeping the
9
+ * inner content naturally sized. Use `maxHeight` to constrain height.
10
+ */
11
+ export declare function ScrollArea({ children, className, maxHeight, orientation, style, ...props }: ScrollAreaProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cn } from '../utils/cn.js';
3
+ /**
4
+ * A thin wrapper that applies custom-styled scrollbars while keeping the
5
+ * inner content naturally sized. Use `maxHeight` to constrain height.
6
+ */
7
+ export function ScrollArea({ children, className, maxHeight, orientation = 'vertical', style, ...props }) {
8
+ const overflowClass = orientation === 'both' ? 'overflow-auto' : orientation === 'horizontal' ? 'overflow-x-auto overflow-y-hidden' : 'overflow-y-auto overflow-x-hidden';
9
+ return (_jsx("div", { ...props, className: cn(overflowClass,
10
+ // Custom scrollbar styling via Tailwind arbitrary variants
11
+ '[&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-track]:rounded-full [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-sand/30 [&::-webkit-scrollbar-thumb:hover]:bg-sand/50 dark:[&::-webkit-scrollbar-thumb]:bg-sand/40 dark:[&::-webkit-scrollbar-thumb:hover]:bg-sand/60', className), style: { maxHeight, ...style }, children: children }));
12
+ }
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ export type SheetSide = 'left' | 'right' | 'top' | 'bottom';
3
+ export interface SheetProps {
4
+ children: React.ReactNode;
5
+ className?: string;
6
+ isOpen: boolean;
7
+ onClose: () => void;
8
+ side?: SheetSide;
9
+ title?: string;
10
+ description?: string;
11
+ }
12
+ export declare function Sheet({ children, className, description, isOpen, onClose, side, title }: SheetProps): React.ReactPortal | null;
@@ -0,0 +1,53 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { X } from 'lucide-react';
3
+ import React from 'react';
4
+ import { createPortal } from 'react-dom';
5
+ import { cn } from '../utils/cn.js';
6
+ const sideStyles = {
7
+ right: {
8
+ panel: 'inset-y-0 right-0 h-full w-full max-w-sm',
9
+ enter: 'translate-x-0',
10
+ leave: 'translate-x-full'
11
+ },
12
+ left: {
13
+ panel: 'inset-y-0 left-0 h-full w-full max-w-sm',
14
+ enter: 'translate-x-0',
15
+ leave: '-translate-x-full'
16
+ },
17
+ top: {
18
+ panel: 'inset-x-0 top-0 w-full',
19
+ enter: 'translate-y-0',
20
+ leave: '-translate-y-full'
21
+ },
22
+ bottom: {
23
+ panel: 'inset-x-0 bottom-0 w-full',
24
+ enter: 'translate-y-0',
25
+ leave: 'translate-y-full'
26
+ }
27
+ };
28
+ export function Sheet({ children, className, description, isOpen, onClose, side = 'right', title }) {
29
+ const [visible, setVisible] = React.useState(false);
30
+ const { panel, enter, leave } = sideStyles[side];
31
+ React.useEffect(() => {
32
+ if (isOpen) {
33
+ requestAnimationFrame(() => setVisible(true));
34
+ }
35
+ else {
36
+ setVisible(false);
37
+ }
38
+ }, [isOpen]);
39
+ // Close on Escape
40
+ React.useEffect(() => {
41
+ if (!isOpen)
42
+ return;
43
+ const handler = (e) => {
44
+ if (e.key === 'Escape')
45
+ onClose();
46
+ };
47
+ document.addEventListener('keydown', handler);
48
+ return () => document.removeEventListener('keydown', handler);
49
+ }, [isOpen, onClose]);
50
+ if (typeof document === 'undefined' || !isOpen)
51
+ return null;
52
+ return createPortal(_jsxs("div", { className: 'fixed inset-0 z-50 flex', 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", { role: 'dialog', "aria-modal": 'true', "aria-label": title, className: cn('absolute flex flex-col border border-sand/10 bg-white shadow-2xl transition-transform duration-300 ease-in-out dark:border-sand/20 dark:bg-dark-sand', panel, visible ? enter : leave, (side === 'left' || side === 'right') && 'rounded-none', side === 'top' && 'rounded-b-2xl', side === 'bottom' && 'rounded-t-2xl', className), children: [_jsxs("div", { className: 'flex items-center justify-between border-b border-sand/10 px-6 py-4 dark:border-sand/20', children: [_jsxs("div", { 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("button", { type: 'button', onClick: onClose, className: 'inline-flex items-center justify-center rounded-full p-2 text-text-secondary transition-colors duration-200 hover:bg-sand/10 hover:text-text-primary dark:text-text-secondary dark:hover:bg-sand/20 dark:hover:text-text-primary', "aria-label": 'Close', children: _jsx(X, { size: 18 }) })] }), _jsx("div", { className: 'flex-1 overflow-y-auto p-6', children: children })] })] }), document.body);
53
+ }
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ export interface SliderProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type' | 'onChange'> {
3
+ label?: string;
4
+ max?: number;
5
+ min?: number;
6
+ onChange?: (value: number) => void;
7
+ showValue?: boolean;
8
+ step?: number;
9
+ value?: number;
10
+ }
11
+ export declare const Slider: React.ForwardRefExoticComponent<SliderProps & React.RefAttributes<HTMLInputElement>>;