@gaulatti/bleecker 0.1.34 → 0.1.36

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 (122) hide show
  1. package/README.md +75 -0
  2. package/dist/components/accordion.js +3 -2
  3. package/dist/components/activity-item.js +1 -1
  4. package/dist/components/alert-dialog.js +24 -11
  5. package/dist/components/alert.d.ts +2 -1
  6. package/dist/components/alert.js +11 -10
  7. package/dist/components/avatar.d.ts +2 -1
  8. package/dist/components/avatar.js +1 -0
  9. package/dist/components/bauhaus-background.js +1 -1
  10. package/dist/components/brand-lockup.js +1 -1
  11. package/dist/components/breadcrumb.js +3 -2
  12. package/dist/components/button.d.ts +3 -5
  13. package/dist/components/button.js +17 -12
  14. package/dist/components/card.d.ts +5 -1
  15. package/dist/components/card.js +3 -2
  16. package/dist/components/checkbox.js +1 -1
  17. package/dist/components/collection-filters.d.ts +2 -1
  18. package/dist/components/collection-filters.js +40 -7
  19. package/dist/components/command-spotlight.js +10 -5
  20. package/dist/components/context-menu.js +2 -2
  21. package/dist/components/dashboard-section.js +1 -1
  22. package/dist/components/data-list.js +1 -1
  23. package/dist/components/data-table-column-toggle.js +8 -20
  24. package/dist/components/data-table.js +2 -1
  25. package/dist/components/date-picker.d.ts +3 -1
  26. package/dist/components/date-picker.js +11 -29
  27. package/dist/components/date-range-picker.d.ts +3 -3
  28. package/dist/components/date-range-picker.js +24 -9
  29. package/dist/components/dialog-close-button.js +2 -2
  30. package/dist/components/donut-chart.js +1 -1
  31. package/dist/components/drawer.js +8 -22
  32. package/dist/components/dropdown-menu.js +7 -7
  33. package/dist/components/empty.js +1 -1
  34. package/dist/components/error-state.js +1 -1
  35. package/dist/components/feed-item.js +1 -1
  36. package/dist/components/field-help-tooltip.js +1 -1
  37. package/dist/components/field.d.ts +17 -0
  38. package/dist/components/field.js +16 -0
  39. package/dist/components/file-input.js +1 -1
  40. package/dist/components/filter-chip.js +2 -2
  41. package/dist/components/header-select.d.ts +13 -2
  42. package/dist/components/header-select.js +7 -3
  43. package/dist/components/hero-carousel.js +3 -2
  44. package/dist/components/hover-card.js +1 -1
  45. package/dist/components/icon-badge.d.ts +5 -2
  46. package/dist/components/icon-badge.js +2 -2
  47. package/dist/components/icon-button.d.ts +4 -0
  48. package/dist/components/icon-button.js +3 -2
  49. package/dist/components/input.d.ts +2 -3
  50. package/dist/components/input.js +5 -5
  51. package/dist/components/label.js +1 -1
  52. package/dist/components/loading-overlay.js +1 -1
  53. package/dist/components/loading-spinner.d.ts +3 -1
  54. package/dist/components/media-library.js +5 -3
  55. package/dist/components/menubar.js +17 -7
  56. package/dist/components/metric.d.ts +2 -2
  57. package/dist/components/metric.js +1 -0
  58. package/dist/components/modal.js +53 -13
  59. package/dist/components/navigation-menu.js +15 -5
  60. package/dist/components/notification-badge.js +1 -1
  61. package/dist/components/otp-input.js +2 -1
  62. package/dist/components/page-header.js +1 -1
  63. package/dist/components/pagination.js +3 -3
  64. package/dist/components/panel.js +1 -1
  65. package/dist/components/popover.d.ts +3 -2
  66. package/dist/components/popover.js +4 -91
  67. package/dist/components/progress.d.ts +4 -2
  68. package/dist/components/progress.js +3 -3
  69. package/dist/components/radio-group.d.ts +3 -1
  70. package/dist/components/radio-group.js +2 -2
  71. package/dist/components/sankey-chart.js +1 -0
  72. package/dist/components/scatter-chart.js +1 -1
  73. package/dist/components/search-input.js +1 -1
  74. package/dist/components/section-header.js +1 -1
  75. package/dist/components/select.d.ts +12 -1
  76. package/dist/components/select.js +13 -64
  77. package/dist/components/sheet.js +8 -24
  78. package/dist/components/sidebar.js +4 -3
  79. package/dist/components/slider.js +2 -2
  80. package/dist/components/sonner.js +3 -2
  81. package/dist/components/stat-card.js +1 -1
  82. package/dist/components/status-badge.d.ts +2 -1
  83. package/dist/components/status-badge.js +5 -6
  84. package/dist/components/stepper.js +2 -2
  85. package/dist/components/sunburst-chart.js +1 -0
  86. package/dist/components/switch.js +1 -1
  87. package/dist/components/table.js +10 -8
  88. package/dist/components/tabs.d.ts +6 -1
  89. package/dist/components/tabs.js +30 -7
  90. package/dist/components/textarea.d.ts +2 -3
  91. package/dist/components/textarea.js +2 -2
  92. package/dist/components/theme-toggle.js +1 -0
  93. package/dist/components/timeline.js +1 -1
  94. package/dist/components/toggle-group.js +2 -1
  95. package/dist/components/toggle.d.ts +4 -2
  96. package/dist/components/toggle.js +1 -1
  97. package/dist/components/tooltip.d.ts +2 -1
  98. package/dist/components/tooltip.js +3 -21
  99. package/dist/core/contracts.d.ts +48 -0
  100. package/dist/core/contracts.js +23 -0
  101. package/dist/core/index.d.ts +2 -0
  102. package/dist/core/index.js +2 -0
  103. package/dist/index.d.ts +3 -0
  104. package/dist/index.js +3 -0
  105. package/dist/layout/admin-shell.js +1 -1
  106. package/dist/layout/app-shell.js +1 -1
  107. package/dist/layout/footer.js +4 -4
  108. package/dist/layout/header.js +2 -1
  109. package/dist/styles.css +1 -1
  110. package/dist/theme/theme-provider.js +1 -0
  111. package/dist/theme/theme-script.d.ts +1 -2
  112. package/dist/theme/theme-script.js +1 -3
  113. package/dist/theme/types.d.ts +2 -1
  114. package/dist/tokens/index.d.ts +1 -0
  115. package/dist/tokens/index.js +1 -0
  116. package/dist/tokens/source.d.ts +221 -0
  117. package/dist/tokens/source.js +140 -0
  118. package/dist/utils/hooks.d.ts +14 -0
  119. package/dist/utils/hooks.js +101 -0
  120. package/package.json +41 -7
  121. package/src/styles/global.css +82 -175
  122. package/src/styles/tokens.generated.css +171 -0
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { cn } from '../utils/cn.js';
3
3
  export function DataList({ items, className, striped = false }) {
4
- return (_jsx("dl", { className: cn('divide-y divide-border', className), children: items.map((item, index) => (_jsxs("div", { className: cn('flex flex-col gap-1 py-3 sm:flex-row sm:items-start sm:justify-between sm:gap-4', striped && index % 2 === 0 && 'bg-muted/30 px-3'), children: [_jsx("dt", { className: 'text-sm font-medium text-text-secondary dark:text-text-secondary', children: item.label }), _jsxs("dd", { className: 'text-right text-sm font-semibold text-text-primary dark:text-text-primary sm:text-right', children: [item.value, item.description && (_jsx("p", { className: 'mt-0.5 text-xs font-normal text-text-secondary dark:text-text-secondary', children: item.description }))] })] }, item.id))) }));
4
+ return (_jsx("dl", { className: cn('divide-y divide-border', className), children: items.map((item, index) => (_jsxs("div", { className: cn('flex flex-col gap-1.5 py-3.5 sm:grid sm:grid-cols-[minmax(0,0.8fr)_minmax(0,1.2fr)] sm:items-start sm:gap-6', striped && index % 2 === 0 && 'rounded-[6px] bg-light-sand/40 px-3 dark:bg-white/[0.03]'), children: [_jsx("dt", { className: 'text-[13px] font-medium text-text-secondary dark:text-text-secondary', children: item.label }), _jsxs("dd", { className: 'text-sm font-medium text-text-primary dark:text-text-primary sm:text-right', children: [item.value, item.description && (_jsx("p", { className: 'font-secondary mt-1 text-xs font-normal leading-5 text-text-secondary dark:text-text-secondary', children: item.description }))] })] }, item.id))) }));
5
5
  }
@@ -1,27 +1,15 @@
1
+ 'use client';
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import * as React from 'react';
3
3
  import { Settings2 } from 'lucide-react';
4
4
  import { cn } from '../utils/cn.js';
5
5
  import { Button } from './button.js';
6
6
  import { Checkbox } from './checkbox.js';
7
+ import { Popover } from './popover.js';
7
8
  export function DataTableColumnToggle({ table, className, label = 'Columns' }) {
8
- const [open, setOpen] = React.useState(false);
9
- const containerRef = React.useRef(null);
10
- React.useEffect(() => {
11
- if (!open)
12
- return undefined;
13
- const handleClickOutside = (event) => {
14
- if (containerRef.current && !containerRef.current.contains(event.target)) {
15
- setOpen(false);
16
- }
17
- };
18
- document.addEventListener('mousedown', handleClickOutside);
19
- return () => document.removeEventListener('mousedown', handleClickOutside);
20
- }, [open]);
21
- return (_jsxs("div", { ref: containerRef, className: cn('relative', className), children: [_jsxs(Button, { variant: 'secondary', size: 'sm', onClick: () => setOpen((prev) => !prev), children: [_jsx(Settings2, { size: 14 }), label] }), open && (_jsxs("div", { className: 'absolute right-0 top-full z-50 mt-2 w-48 rounded-[var(--radius-card)] border border-border bg-card p-2 shadow-lg', children: [_jsx("p", { className: 'px-2 py-1.5 text-xs font-semibold uppercase tracking-wider text-text-secondary', children: "Toggle columns" }), _jsx("div", { className: 'max-h-60 overflow-y-auto', children: table
22
- .getAllColumns()
23
- .filter((column) => typeof column.accessorFn !== 'undefined' && column.getCanHide())
24
- .map((column) => {
25
- return (_jsxs("label", { className: 'flex cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 text-sm text-text-primary hover:bg-sand/10 dark:text-text-primary dark:hover:bg-sand/15', children: [_jsx(Checkbox, { checked: column.getIsVisible(), onChange: (event) => column.toggleVisibility(event.target.checked) }), _jsx("span", { className: 'truncate', children: typeof column.columnDef.header === 'string' ? column.columnDef.header : column.id })] }, column.id));
26
- }) })] }))] }));
9
+ const columns = table
10
+ .getAllColumns()
11
+ .filter((column) => typeof column.accessorFn !== 'undefined' && column.getCanHide());
12
+ return (_jsx("div", { className: cn('inline-block', className), children: _jsx(Popover, { align: 'end', className: 'w-52 p-1.5', content: _jsxs("div", { children: [_jsx("p", { className: 'px-2 py-2 text-[10px] font-semibold uppercase tracking-[0.09em] text-text-secondary', children: "Visible columns" }), _jsx("div", { className: 'max-h-60 overflow-y-auto', children: columns.map((column) => {
13
+ return (_jsxs("label", { className: 'flex min-h-9 cursor-pointer items-center gap-2.5 rounded-[5px] px-2 py-1.5 text-[13px] text-text-primary transition-colors duration-[var(--motion-control)] ease-premium hover:bg-light-sand dark:text-text-primary dark:hover:bg-white/[0.07]', children: [_jsx(Checkbox, { checked: column.getIsVisible(), onChange: (event) => column.toggleVisibility(event.target.checked) }), _jsx("span", { className: 'truncate', children: typeof column.columnDef.header === 'string' ? column.columnDef.header : column.id })] }, column.id));
14
+ }) })] }), children: _jsxs(Button, { variant: 'secondary', size: 'sm', children: [_jsx(Settings2, { size: 14 }), label] }) }) }));
27
15
  }
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
3
  import * as React from 'react';
3
4
  import { flexRender, getCoreRowModel, getFilteredRowModel, getPaginationRowModel, getSortedRowModel, useReactTable } from '@tanstack/react-table';
@@ -25,7 +26,7 @@ export function DataTable({ columns, data, searchKey }) {
25
26
  rowSelection
26
27
  }
27
28
  });
28
- return (_jsxs("div", { className: 'w-full space-y-4', children: [searchKey && (_jsx("div", { className: 'flex items-center', children: _jsx("div", { className: 'w-full max-w-sm', children: _jsx(Input, { placeholder: `Search ${searchKey}...`, value: table.getColumn(searchKey)?.getFilterValue() ?? '', onChange: (event) => table.getColumn(searchKey)?.setFilterValue(event.target.value), startIcon: _jsx(Search, { className: 'w-4 h-4' }), className: 'bg-white' }) }) })), _jsx("div", { className: 'rounded-md border border-black/10 overflow-hidden shadow-[0_2px_10px_rgba(0,0,0,0.02),0_8px_32px_rgba(26,55,77,0.04)] bg-white', children: _jsxs(Table, { children: [_jsx(TableHeader, { className: 'bg-light-sand/50', children: table.getHeaderGroups().map((headerGroup) => (_jsx(TableRow, { children: headerGroup.headers.map((header) => {
29
+ return (_jsxs("div", { className: 'w-full space-y-4', children: [searchKey && (_jsx("div", { className: 'flex items-center', children: _jsx("div", { className: 'w-full max-w-sm', children: _jsx(Input, { placeholder: `Search ${searchKey}...`, value: table.getColumn(searchKey)?.getFilterValue() ?? '', onChange: (event) => table.getColumn(searchKey)?.setFilterValue(event.target.value), startIcon: _jsx(Search, { className: 'w-4 h-4' }), className: 'bg-white' }) }) })), _jsx("div", { className: 'overflow-hidden rounded-[var(--radius-card)] border border-sand/25 bg-white shadow-[var(--shadow-surface)] dark:border-white/10 dark:bg-deep-sea', children: _jsxs(Table, { children: [_jsx(TableHeader, { className: 'bg-light-sand/50', children: table.getHeaderGroups().map((headerGroup) => (_jsx(TableRow, { children: headerGroup.headers.map((header) => {
29
30
  return _jsx(TableHead, { children: header.isPlaceholder ? null : flexRender(header.column.columnDef.header, header.getContext()) }, header.id);
30
31
  }) }, headerGroup.id))) }), _jsx(TableBody, { className: 'bg-white', children: table.getRowModel().rows?.length ? (table.getRowModel().rows.map((row) => (_jsx(TableRow, { "data-state": row.getIsSelected() && 'selected', children: row.getVisibleCells().map((cell) => (_jsx(TableCell, { children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id))) }, row.id)))) : (_jsx(TableRow, { children: _jsx(TableCell, { colSpan: columns.length, className: 'h-24 text-center text-text-secondary', children: "No results." }) })) })] }) }), _jsxs("div", { className: 'flex items-center justify-between px-2', children: [_jsx("div", { className: 'flex-1 text-sm text-text-secondary', children: table.getFilteredSelectedRowModel().rows.length > 0 && (_jsxs(_Fragment, { children: [table.getFilteredSelectedRowModel().rows.length, " of ", table.getFilteredRowModel().rows.length, " row(s) selected."] })) }), _jsxs("div", { className: 'flex items-center space-x-2', children: [_jsx(Button, { variant: 'secondary', size: 'sm', onClick: () => table.previousPage(), disabled: !table.getCanPreviousPage(), className: 'h-8 w-8 p-0', children: _jsx(ChevronLeft, { className: 'h-4 w-4' }) }), _jsx(Button, { variant: 'secondary', size: 'sm', onClick: () => table.nextPage(), disabled: !table.getCanNextPage(), className: 'h-8 w-8 p-0', children: _jsx(ChevronRight, { className: 'h-4 w-4' }) })] })] })] }));
31
32
  }
@@ -8,6 +8,7 @@ export interface CalendarProps {
8
8
  }
9
9
  export declare function Calendar({ className, disabled: isDisabledFn, maxDate, minDate, onChange, value }: CalendarProps): import("react/jsx-runtime").JSX.Element;
10
10
  export interface DatePickerProps {
11
+ 'aria-label'?: string;
11
12
  className?: string;
12
13
  disabled?: boolean;
13
14
  disabledDates?: (date: Date) => boolean;
@@ -15,6 +16,7 @@ export interface DatePickerProps {
15
16
  minDate?: Date;
16
17
  onChange?: (date: Date | null) => void;
17
18
  placeholder?: string;
19
+ triggerClassName?: string;
18
20
  value?: Date | null;
19
21
  }
20
- export declare function DatePicker({ className, disabled, disabledDates, maxDate, minDate, onChange, placeholder, value }: DatePickerProps): import("react/jsx-runtime").JSX.Element;
22
+ export declare function DatePicker({ 'aria-label': ariaLabel, className, disabled, disabledDates, maxDate, minDate, onChange, placeholder, triggerClassName, value }: DatePickerProps): import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,10 @@
1
+ 'use client';
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { CalendarDays, ChevronLeft, ChevronRight } from 'lucide-react';
3
4
  import React from 'react';
4
5
  import { cn } from '../utils/cn.js';
6
+ import { IconButton } from './icon-button.js';
7
+ import { Popover } from './popover.js';
5
8
  // ─── Helpers ─────────────────────────────────────────────────────────────────
6
9
  function getDaysInMonth(year, month) {
7
10
  return new Date(year, month + 1, 0).getDate();
@@ -50,48 +53,27 @@ export function Calendar({ className, disabled: isDisabledFn, maxDate, minDate,
50
53
  return true;
51
54
  return false;
52
55
  };
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) => {
56
+ return (_jsxs("div", { className: cn('w-full select-none', className), children: [_jsxs("div", { className: 'mb-4 flex items-center justify-between', children: [_jsx(IconButton, { onClick: prevMonth, size: 'sm', variant: 'ghost', "aria-label": 'Previous month', children: _jsx(ChevronLeft, { size: 16 }) }), _jsxs("span", { className: 'text-[13px] font-semibold tracking-ui text-text-primary dark:text-text-primary', children: [MONTHS[viewMonth], " ", viewYear] }), _jsx(IconButton, { onClick: nextMonth, size: 'sm', variant: 'ghost', "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-[10px] font-semibold uppercase tracking-[0.08em] 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
57
  if (!date)
55
58
  return _jsx("div", {}, `empty-${index}`);
56
59
  const selected = value && isSameDay(date, value);
57
60
  const todayCell = isToday(date);
58
61
  const outOfRange = isOutOfRange(date);
59
62
  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'
63
+ return (_jsx("button", { type: 'button', disabled: !!disabled, onClick: () => onChange?.(date), "aria-label": date.toDateString(), "aria-pressed": !!selected, className: cn('flex h-8 w-full scale-100 items-center justify-center rounded-[6px] text-[13px] tabular-nums transition-[background-color,color,transform] duration-[var(--motion-control)] ease-premium active:scale-[0.94] focus:outline-none focus-visible:ring-2 focus-visible:ring-sea/30 dark:focus-visible:ring-accent-blue/40', selected
64
+ ? 'bg-sea font-semibold text-white shadow-[0_1px_2px_rgba(21,48,66,0.12)] dark:bg-accent-blue dark:text-deep-sea'
62
65
  : 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()));
66
+ ? 'font-semibold text-sea ring-1 ring-inset ring-sea/45 dark:text-accent-blue dark:ring-accent-blue/50'
67
+ : 'text-text-primary hover:bg-light-sand dark:text-text-primary dark:hover:bg-white/[0.07]', disabled && 'pointer-events-none opacity-30'), children: date.getDate() }, date.toISOString()));
65
68
  }) })] }));
66
69
  }
67
- export function DatePicker({ className, disabled = false, disabledDates, maxDate, minDate, onChange, placeholder = 'Pick a date', value }) {
70
+ export function DatePicker({ 'aria-label': ariaLabel, className, disabled = false, disabledDates, maxDate, minDate, onChange, placeholder = 'Pick a date', triggerClassName, value }) {
68
71
  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) => {
72
+ return (_jsx("div", { className: cn('inline-block', className), children: _jsx(Popover, { align: 'start', open: open, onOpenChange: setOpen, className: 'w-72 p-4', content: _jsxs("div", { role: 'dialog', "aria-label": ariaLabel ?? placeholder, children: [_jsx(Calendar, { value: value, minDate: minDate, maxDate: maxDate, disabled: disabledDates, onChange: (date) => {
91
73
  onChange?.(date);
92
74
  setOpen(false);
93
75
  } }), value && (_jsx("button", { type: 'button', onClick: () => {
94
76
  onChange?.(null);
95
77
  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" }))] }))] }));
78
+ }, className: 'mt-3 w-full border-t border-sand/20 pt-3 text-[12px] font-medium text-text-secondary transition-colors duration-[var(--motion-control)] ease-premium hover:text-text-primary dark:border-white/[0.08]', children: "Clear date" }))] }), children: _jsxs("button", { type: 'button', disabled: disabled, "aria-label": ariaLabel, className: cn('flex h-10 min-w-[200px] items-center gap-2.5 rounded-[var(--radius-ui)] border border-sand/40 bg-white px-3.5 text-sm shadow-[0_1px_2px_rgba(26,55,77,0.025)] outline-none transition-[border-color,box-shadow,opacity] duration-[var(--motion-control)] ease-premium hover:border-sand/70 hover:shadow-[0_3px_10px_-8px_rgba(26,55,77,0.25)] focus-visible:border-sea/70 focus-visible:ring-2 focus-visible:ring-sea/10 data-[state=open]:border-sea/70 data-[state=open]:ring-2 data-[state=open]:ring-sea/10 dark:border-white/15 dark:bg-deep-sea dark:data-[state=open]:border-accent-blue dark:data-[state=open]:ring-accent-blue/12', value ? 'text-text-primary dark:text-text-primary' : 'text-text-secondary dark:text-text-secondary', disabled && 'cursor-not-allowed opacity-50', triggerClassName), children: [_jsx(CalendarDays, { size: 15, className: 'shrink-0 text-sea dark:text-accent-blue' }), _jsx("span", { className: 'min-w-0 flex-1 truncate text-left', children: value ? formatDate(value) : placeholder })] }) }) }));
97
79
  }
@@ -3,13 +3,13 @@ export interface DateRange {
3
3
  to?: string;
4
4
  }
5
5
  export interface DateRangePickerProps {
6
- value: DateRange;
7
- onChange: (range: DateRange) => void;
8
6
  className?: string;
7
+ onChange: (range: DateRange) => void;
9
8
  placeholder?: string;
10
9
  presets?: {
11
10
  label: string;
12
11
  days: number;
13
12
  }[];
13
+ value: DateRange;
14
14
  }
15
- export declare function DateRangePicker({ value, onChange, className, placeholder, presets }: DateRangePickerProps): import("react/jsx-runtime").JSX.Element;
15
+ export declare function DateRangePicker({ className, onChange, placeholder, presets, value }: DateRangePickerProps): import("react/jsx-runtime").JSX.Element;
@@ -1,17 +1,32 @@
1
+ 'use client';
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Calendar as CalendarIcon, X } from 'lucide-react';
3
- import { cn } from '../utils/cn.js';
3
+ import { X } from 'lucide-react';
4
4
  import { Button } from './button.js';
5
- export function DateRangePicker({ value, onChange, className, placeholder = 'Pick a date range', presets }) {
6
- const hasValue = value.from || value.to;
5
+ import { DatePicker } from './date-picker.js';
6
+ import { cn } from '../utils/cn.js';
7
+ function parseDate(value) {
8
+ if (!value)
9
+ return null;
10
+ const [year, month, day] = value.split('-').map(Number);
11
+ return new Date(year, month - 1, day);
12
+ }
13
+ function serializeDate(value) {
14
+ if (!value)
15
+ return undefined;
16
+ const year = value.getFullYear();
17
+ const month = String(value.getMonth() + 1).padStart(2, '0');
18
+ const day = String(value.getDate()).padStart(2, '0');
19
+ return `${year}-${month}-${day}`;
20
+ }
21
+ export function DateRangePicker({ className, onChange, placeholder = 'Date range', presets, value }) {
22
+ const fromDate = parseDate(value.from);
23
+ const toDate = parseDate(value.to);
24
+ const hasValue = Boolean(fromDate || toDate);
7
25
  const applyPreset = (days) => {
8
26
  const to = new Date();
9
27
  const from = new Date();
10
28
  from.setDate(to.getDate() - days);
11
- onChange({
12
- from: from.toISOString().split('T')[0],
13
- to: to.toISOString().split('T')[0]
14
- });
29
+ onChange({ from: serializeDate(from), to: serializeDate(to) });
15
30
  };
16
- return (_jsxs("div", { className: cn('flex flex-wrap items-center gap-2', className), children: [_jsxs("div", { className: 'relative flex items-center rounded-[var(--radius-ui)] bg-light-sand/50 ring-1 ring-inset ring-black/10 transition-all hover:bg-white focus-within:bg-white focus-within:ring-2 focus-within:ring-sea dark:bg-deep-sea/50 dark:ring-white/10 dark:focus-within:ring-accent-blue', children: [_jsx(CalendarIcon, { size: 16, className: 'ml-3 text-text-secondary dark:text-text-secondary' }), _jsx("input", { type: 'date', value: value.from ?? '', max: value.to, onChange: (e) => onChange({ ...value, from: e.target.value || undefined }), className: 'h-9 border-none bg-transparent px-2 text-sm text-text-primary outline-none dark:text-text-primary' }), _jsx("span", { className: 'text-sm text-text-secondary dark:text-text-secondary', children: "-" }), _jsx("input", { type: 'date', value: value.to ?? '', min: value.from, onChange: (e) => onChange({ ...value, to: e.target.value || undefined }), className: 'h-9 border-none bg-transparent px-2 text-sm text-text-primary outline-none dark:text-text-primary' }), hasValue && (_jsx("button", { type: 'button', onClick: () => onChange({}), className: 'mr-2 rounded-md p-1 text-text-secondary hover:bg-sand/10 hover:text-text-primary dark:hover:bg-sand/15', children: _jsx(X, { size: 14 }) }))] }), presets && (_jsx("div", { className: 'flex flex-wrap items-center gap-1', children: presets.map((preset) => (_jsx(Button, { variant: 'ghost', size: 'sm', onClick: () => applyPreset(preset.days), children: preset.label }, preset.label))) }))] }));
31
+ return (_jsxs("div", { className: cn('flex flex-wrap items-end gap-3', className), role: 'group', "aria-label": placeholder, children: [_jsxs("div", { className: 'relative grid min-w-[360px] flex-1 grid-cols-[1fr_auto_1fr] items-end gap-2 rounded-[var(--radius-card)] border border-sand/30 bg-white p-3 shadow-[var(--shadow-surface)] dark:border-white/10 dark:bg-deep-sea', children: [_jsxs("div", { className: 'space-y-1.5', children: [_jsx("span", { className: 'block text-[10px] font-semibold uppercase tracking-[0.09em] text-text-secondary', children: "From" }), _jsx(DatePicker, { "aria-label": 'Start date', value: fromDate, maxDate: toDate ?? undefined, onChange: (date) => onChange({ ...value, from: serializeDate(date) }), placeholder: 'Start date', triggerClassName: 'min-w-0 w-full border-transparent bg-light-sand/45 shadow-none hover:border-sand/35' })] }), _jsx("span", { className: 'mb-5 h-px w-3 bg-sand/55 dark:bg-white/20', "aria-hidden": 'true' }), _jsxs("div", { className: 'space-y-1.5', children: [_jsx("span", { className: 'block text-[10px] font-semibold uppercase tracking-[0.09em] text-text-secondary', children: "To" }), _jsx(DatePicker, { "aria-label": 'End date', value: toDate, minDate: fromDate ?? undefined, onChange: (date) => onChange({ ...value, to: serializeDate(date) }), placeholder: 'End date', triggerClassName: 'min-w-0 w-full border-transparent bg-light-sand/45 shadow-none hover:border-sand/35' })] })] }), hasValue ? (_jsxs(Button, { variant: 'ghost', size: 'sm', onClick: () => onChange({}), "aria-label": 'Clear date range', children: [_jsx(X, { size: 14, "aria-hidden": 'true' }), "Clear"] })) : null, presets?.length ? (_jsx("div", { className: 'flex h-10 items-center gap-1 rounded-[var(--radius-ui)] border border-sand/25 bg-white p-1 dark:border-white/10 dark:bg-deep-sea', children: presets.map((preset) => (_jsx(Button, { variant: 'ghost', size: 'xs', onClick: () => applyPreset(preset.days), children: preset.label }, preset.label))) })) : null] }));
17
32
  }
@@ -2,6 +2,6 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { X } from 'lucide-react';
3
3
  import React from 'react';
4
4
  import { cn } from '../utils/cn.js';
5
- export const DialogCloseButton = React.forwardRef(function DialogCloseButton({ className, iconSize = 20, type = 'button', ...props }, ref) {
6
- return (_jsx("button", { ref: ref, type: type, className: cn('inline-flex items-center justify-center rounded-full border-2 border-sea bg-white p-3 text-text-primary shadow-sm transition-all duration-400 hover:-translate-y-0.5 hover:bg-light-sand focus:outline-none focus-visible:ring-2 focus-visible:ring-sea focus-visible:ring-offset-2 focus-visible:ring-offset-white dark:border-accent-blue dark:bg-dark-sand dark:text-text-primary dark:hover:bg-sand/20 dark:focus-visible:ring-accent-blue dark:focus-visible:ring-offset-dark-sand', className), ...props, children: _jsx(X, { size: iconSize }) }));
5
+ export const DialogCloseButton = React.forwardRef(function DialogCloseButton({ className, iconSize = 18, type = 'button', ...props }, ref) {
6
+ return (_jsx("button", { ref: ref, type: type, className: cn('inline-flex h-9 w-9 translate-y-0 scale-100 items-center justify-center rounded-[var(--radius-button)] border border-sand/30 bg-white text-text-secondary transition-[background-color,border-color,color,box-shadow,transform] duration-[var(--motion-control)] ease-premium hover:border-sand/60 hover:bg-light-sand/50 hover:text-text-primary hover:shadow-[0_3px_9px_-6px_rgba(26,55,77,0.28)] active:translate-y-px active:scale-[0.97] active:shadow-none focus:outline-none focus-visible:ring-2 focus-visible:ring-sea focus-visible:ring-offset-2 focus-visible:ring-offset-white dark:border-white/15 dark:bg-deep-sea dark:text-text-secondary dark:hover:bg-sand/10 dark:hover:text-text-primary dark:focus-visible:ring-accent-blue dark:focus-visible:ring-offset-deep-sea', className), ...props, children: _jsx(X, { size: iconSize }) }));
7
7
  });
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { PieChart } from './pie-chart.js';
3
3
  export function DonutChart({ data, height = 300, showLegend = true, centerLabel, centerValue }) {
4
- return (_jsxs("div", { className: 'relative w-full', style: { height }, children: [_jsx(PieChart, { data: data, height: height, showLegend: showLegend, innerRadius: '60%' }), (centerLabel || centerValue) && (_jsxs("div", { className: 'pointer-events-none absolute inset-0 flex flex-col items-center justify-center pb-6', children: [centerValue && _jsx("span", { className: 'text-2xl font-bold text-text-primary dark:text-text-primary', children: centerValue }), centerLabel && _jsx("span", { className: 'text-xs text-text-secondary dark:text-text-secondary', children: centerLabel })] }))] }));
4
+ return (_jsxs("div", { className: 'relative w-full', style: { height }, children: [_jsx(PieChart, { data: data, height: height, showLegend: showLegend, innerRadius: '60%' }), (centerLabel || centerValue) && (_jsxs("div", { className: 'pointer-events-none absolute inset-0 flex flex-col items-center justify-center pb-6', children: [centerValue && _jsx("span", { className: 'text-2xl font-semibold tracking-refined text-text-primary dark:text-text-primary', children: centerValue }), centerLabel && _jsx("span", { className: 'text-xs text-text-secondary dark:text-text-secondary', children: centerLabel })] }))] }));
5
5
  }
@@ -1,30 +1,16 @@
1
+ 'use client';
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { Minus } from 'lucide-react';
3
4
  import React from 'react';
4
5
  import { createPortal } from 'react-dom';
5
6
  import { cn } from '../utils/cn.js';
7
+ import { useModalLayer, usePresence } from '../utils/hooks.js';
6
8
  export function Drawer({ children, className, description, isOpen, onClose, title }) {
7
- const [visible, setVisible] = React.useState(false);
9
+ const { present, visible } = usePresence(isOpen, 180);
8
10
  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]);
11
+ const panelRef = useModalLayer(isOpen, onClose);
12
+ const titleId = React.useId();
13
+ const descriptionId = React.useId();
28
14
  const handleTouchStart = (e) => {
29
15
  startYRef.current = e.touches[0].clientY;
30
16
  };
@@ -36,7 +22,7 @@ export function Drawer({ children, className, description, isOpen, onClose, titl
36
22
  if (delta > 60)
37
23
  onClose();
38
24
  };
39
- if (typeof document === 'undefined' || !isOpen)
25
+ if (typeof document === 'undefined' || !present)
40
26
  return null;
41
- return createPortal(_jsxs("div", { className: 'fixed inset-0 z-50', children: [_jsx("div", { className: cn('absolute inset-0 bg-deep-sea/40 backdrop-blur-md transition-opacity duration-300 dark:bg-black/70', 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-[32px] border-t border-black/[0.04] bg-white shadow-[0_-8px_40px_rgba(0,0,0,0.08)] transition-transform duration-400 ease-out-expo dark:border-white/10 dark:bg-deep-sea dark:shadow-[0_-8px_40px_rgba(0,0,0,0.4)]', 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);
27
+ return createPortal(_jsxs("div", { className: 'fixed inset-0 z-50', children: [_jsx("div", { className: cn('absolute inset-0 bg-deep-sea/38 backdrop-blur-[2px] transition-opacity ease-premium dark:bg-black/65', visible ? 'duration-[var(--motion-overlay)]' : 'duration-[180ms] ease-in', visible ? 'opacity-100' : 'opacity-0'), onClick: onClose, "aria-hidden": 'true' }), _jsxs("div", { ref: panelRef, role: 'dialog', "aria-modal": 'true', "aria-label": title ? undefined : 'Dialog', "aria-labelledby": title ? titleId : undefined, "aria-describedby": description ? descriptionId : undefined, tabIndex: -1, onTouchStart: handleTouchStart, onTouchEnd: handleTouchEnd, className: cn('absolute inset-x-0 bottom-0 flex max-h-[90dvh] flex-col rounded-t-[var(--radius-dialog)] border-t border-sand/30 bg-white shadow-[var(--shadow-overlay)] transition-transform dark:border-white/12 dark:bg-deep-sea', visible ? 'duration-[var(--motion-overlay)] ease-premium' : 'duration-[180ms] ease-in', 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", { id: titleId, className: 'text-lg font-medium text-text-primary dark:text-text-primary', children: title }) : null, description ? _jsx("p", { id: descriptionId, className: 'font-secondary mt-2 text-sm leading-relaxed 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
28
  }
@@ -9,19 +9,19 @@ const DropdownMenuGroup = DropdownMenuPrimitive.Group;
9
9
  const DropdownMenuPortal = DropdownMenuPrimitive.Portal;
10
10
  const DropdownMenuSub = DropdownMenuPrimitive.Sub;
11
11
  const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
12
- const DropdownMenuSubTrigger = React.forwardRef(({ className, inset, children, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.SubTrigger, { ref: ref, className: cn('flex cursor-default select-none items-center rounded-[var(--radius-ui)] px-2 py-1.5 text-sm text-text-primary outline-none focus:bg-sand/10 data-[state=open]:bg-sand/10 dark:text-text-primary dark:focus:bg-sand/15', inset && 'pl-8', className), ...props, children: [children, _jsx(ChevronRight, { size: 16, className: 'ml-auto' })] })));
12
+ const DropdownMenuSubTrigger = React.forwardRef(({ className, inset, children, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.SubTrigger, { ref: ref, className: cn('flex cursor-default select-none items-center rounded-[var(--radius-ui)] px-2 py-1.5 text-sm text-text-primary outline-none transition-colors duration-[var(--motion-control)] ease-premium focus:bg-sand/10 data-[state=open]:bg-sand/10 dark:text-text-primary dark:focus:bg-sand/15', inset && 'pl-8', className), ...props, children: [children, _jsx(ChevronRight, { size: 16, className: 'ml-auto' })] })));
13
13
  DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
14
- const DropdownMenuSubContent = React.forwardRef(({ className, ...props }, ref) => (_jsx(DropdownMenuPrimitive.SubContent, { ref: ref, className: cn('z-50 min-w-[8rem] overflow-hidden rounded-[var(--radius-card)] border border-border bg-card p-1 shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 dark:bg-deep-sea', className), ...props })));
14
+ const DropdownMenuSubContent = React.forwardRef(({ className, ...props }, ref) => (_jsx(DropdownMenuPrimitive.SubContent, { ref: ref, className: cn('z-50 min-w-[9rem] overflow-hidden rounded-[var(--radius-ui)] border border-sand/35 bg-card p-1.5 shadow-[var(--shadow-overlay)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-[0.99] data-[state=open]:zoom-in-[0.99] data-[state=open]:duration-[var(--motion-surface)] data-[state=closed]:duration-[var(--motion-exit)] data-[state=open]:ease-premium data-[state=closed]:ease-in dark:border-white/15 dark:bg-deep-sea', className), ...props })));
15
15
  DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
16
- const DropdownMenuContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Portal, { children: _jsx(DropdownMenuPrimitive.Content, { ref: ref, sideOffset: sideOffset, className: cn('z-50 min-w-[10rem] overflow-hidden rounded-[var(--radius-card)] border border-border bg-card p-1.5 shadow-[0_8px_32px_rgba(0,0,0,0.08)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 dark:border-white/10 dark:bg-deep-sea dark:shadow-[0_8px_32px_rgba(0,0,0,0.3)]', className), ...props }) })));
16
+ const DropdownMenuContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Portal, { children: _jsx(DropdownMenuPrimitive.Content, { ref: ref, sideOffset: sideOffset, className: cn('z-50 min-w-[11rem] overflow-hidden rounded-[var(--radius-ui)] border border-sand/35 bg-card p-1.5 shadow-[var(--shadow-overlay)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-[0.99] data-[state=open]:zoom-in-[0.99] data-[state=open]:duration-[var(--motion-surface)] data-[state=closed]:duration-[var(--motion-exit)] data-[state=open]:ease-premium data-[state=closed]:ease-in dark:border-white/15 dark:bg-deep-sea', className), ...props }) })));
17
17
  DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
18
- const DropdownMenuItem = React.forwardRef(({ className, inset, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Item, { ref: ref, className: cn('relative flex cursor-pointer select-none items-center rounded-[var(--radius-ui)] px-2 py-1.5 text-sm text-text-primary outline-none transition-colors focus:bg-sand/10 focus:text-text-primary data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:text-text-primary dark:focus:bg-sand/15', inset && 'pl-8', className), ...props })));
18
+ const DropdownMenuItem = React.forwardRef(({ className, inset, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Item, { ref: ref, className: cn('relative flex cursor-pointer select-none items-center rounded-[var(--radius-ui)] px-2 py-1.5 text-sm text-text-primary outline-none transition-colors duration-[var(--motion-control)] ease-premium focus:bg-sand/10 focus:text-text-primary data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:text-text-primary dark:focus:bg-sand/15', inset && 'pl-8', className), ...props })));
19
19
  DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
20
- const DropdownMenuCheckboxItem = React.forwardRef(({ className, children, checked, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.CheckboxItem, { ref: ref, className: cn('relative flex cursor-pointer select-none items-center rounded-[var(--radius-ui)] py-1.5 pl-8 pr-2 text-sm text-text-primary outline-none transition-colors focus:bg-sand/10 focus:text-text-primary data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:text-text-primary dark:focus:bg-sand/15', className), checked: checked, ...props, children: [_jsx("span", { className: 'absolute left-2 flex h-3.5 w-3.5 items-center justify-center', children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(Check, { size: 16 }) }) }), children] })));
20
+ const DropdownMenuCheckboxItem = React.forwardRef(({ className, children, checked, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.CheckboxItem, { ref: ref, className: cn('relative flex cursor-pointer select-none items-center rounded-[var(--radius-ui)] py-1.5 pl-8 pr-2 text-sm text-text-primary outline-none transition-colors duration-[var(--motion-control)] ease-premium focus:bg-sand/10 focus:text-text-primary data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:text-text-primary dark:focus:bg-sand/15', className), checked: checked, ...props, children: [_jsx("span", { className: 'absolute left-2 flex h-3.5 w-3.5 items-center justify-center', children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(Check, { size: 16 }) }) }), children] })));
21
21
  DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
22
- const DropdownMenuRadioItem = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.RadioItem, { ref: ref, className: cn('relative flex cursor-pointer select-none items-center rounded-[var(--radius-ui)] py-1.5 pl-8 pr-2 text-sm text-text-primary outline-none transition-colors focus:bg-sand/10 focus:text-text-primary data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:text-text-primary dark:focus:bg-sand/15', className), ...props, children: [_jsx("span", { className: 'absolute left-2 flex h-3.5 w-3.5 items-center justify-center', children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(Circle, { size: 8, fill: 'currentColor' }) }) }), children] })));
22
+ const DropdownMenuRadioItem = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.RadioItem, { ref: ref, className: cn('relative flex cursor-pointer select-none items-center rounded-[var(--radius-ui)] py-1.5 pl-8 pr-2 text-sm text-text-primary outline-none transition-colors duration-[var(--motion-control)] ease-premium focus:bg-sand/10 focus:text-text-primary data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:text-text-primary dark:focus:bg-sand/15', className), ...props, children: [_jsx("span", { className: 'absolute left-2 flex h-3.5 w-3.5 items-center justify-center', children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(Circle, { size: 8, fill: 'currentColor' }) }) }), children] })));
23
23
  DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
24
- const DropdownMenuLabel = React.forwardRef(({ className, inset, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Label, { ref: ref, className: cn('px-2 py-1.5 text-xs font-semibold uppercase tracking-wider text-text-secondary', inset && 'pl-8', className), ...props })));
24
+ const DropdownMenuLabel = React.forwardRef(({ className, inset, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Label, { ref: ref, className: cn('px-2 py-1.5 text-[10px] font-semibold uppercase tracking-[0.09em] text-text-secondary', inset && 'pl-8', className), ...props })));
25
25
  DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
26
26
  const DropdownMenuSeparator = React.forwardRef(({ className, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Separator, { ref: ref, className: cn('-mx-1.5 my-1 h-px bg-border', className), ...props })));
27
27
  DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
@@ -2,5 +2,5 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { cn } from '../utils/cn.js';
3
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
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-2 border-dashed border-black/5 bg-light-sand/30 px-6 py-16 text-center dark:border-white/10 dark:bg-deep-sea/30', className), children: [_jsx("div", { className: 'flex h-16 w-16 items-center justify-center rounded-2xl bg-white text-text-secondary shadow-[0_2px_8px_rgba(0,0,0,0.04)] ring-1 ring-black/5 dark:bg-deep-sea dark:text-text-primary dark:ring-white/10', children: icon ?? (_jsx("span", { className: 'h-8 w-8 text-sea dark:text-accent-blue', 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] }));
5
+ return (_jsxs("div", { className: cn('flex flex-col items-center justify-center gap-5 rounded-[var(--radius-card)] border border-sand/30 bg-light-sand/25 px-8 py-16 text-center dark:border-white/10 dark:bg-white/[0.025]', className), children: [_jsx("div", { className: 'flex h-14 w-14 items-center justify-center rounded-[10px] border border-sand/25 bg-white text-text-secondary shadow-[var(--shadow-surface)] dark:border-white/10 dark:bg-deep-sea dark:text-text-primary', children: icon ?? (_jsx("span", { className: 'h-8 w-8 text-sea dark:text-accent-blue', 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
6
  }
@@ -3,5 +3,5 @@ import { AlertCircle, RefreshCw } from 'lucide-react';
3
3
  import { cn } from '../utils/cn.js';
4
4
  import { Button } from './button.js';
5
5
  export function ErrorState({ title = 'Something went wrong', description = 'We couldn\'t load this data. Please try again.', onRetry, retryLabel = 'Try again', className, icon }) {
6
- return (_jsxs("div", { className: cn('flex flex-col items-center justify-center gap-4 rounded-2xl border border-dashed border-terracotta/30 bg-terracotta/5 px-6 py-12 text-center dark:bg-terracotta/10', className), children: [_jsx("div", { className: 'flex h-14 w-14 items-center justify-center rounded-full bg-terracotta/10 text-terracotta dark:bg-terracotta/20', children: icon ?? _jsx(AlertCircle, { size: 28 }) }), _jsxs("div", { className: 'space-y-1', 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 text-text-secondary dark:text-text-secondary', children: description })] }), onRetry && (_jsxs(Button, { variant: 'secondary', size: 'sm', onClick: onRetry, children: [_jsx(RefreshCw, { size: 14 }), retryLabel] }))] }));
6
+ return (_jsxs("div", { className: cn('flex flex-col items-center justify-center gap-5 rounded-[var(--radius-card)] border border-terracotta/25 bg-terracotta/[0.035] px-8 py-14 text-center dark:bg-terracotta/[0.07]', className), children: [_jsx("div", { className: 'flex h-12 w-12 items-center justify-center rounded-[10px] border border-terracotta/15 bg-terracotta/[0.07] text-terracotta dark:bg-terracotta/15', children: icon ?? _jsx(AlertCircle, { size: 28 }) }), _jsxs("div", { className: 'space-y-1', 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 text-text-secondary dark:text-text-secondary', children: description })] }), onRetry && (_jsxs(Button, { variant: 'secondary', size: 'sm', onClick: onRetry, children: [_jsx(RefreshCw, { size: 14 }), retryLabel] }))] }));
7
7
  }
@@ -53,5 +53,5 @@ export function FeedItem({ author, avatarSrc, categories = [], className, conten
53
53
  const safeCategories = categories
54
54
  .map(normalizeCategory)
55
55
  .filter((value) => value.length > 0);
56
- return (_jsxs("div", { className: cn('flex gap-2.5 border-b border-black/[0.04] p-3 text-left transition-colors hover:bg-black/[0.02] dark:border-white/[0.04] dark:hover:bg-white/[0.02]', className), children: [_jsx(Avatar, { fallback: fallback, size: 'sm', src: avatarSrc, className: 'h-8 w-8 ring-1 ring-black/5 dark:ring-white/10' }), _jsxs("div", { className: 'min-w-0 flex-1', children: [_jsxs("div", { className: 'mb-1 flex items-center gap-2', children: [_jsxs("div", { className: 'min-w-0 flex items-center gap-2', children: [_jsx("span", { className: 'truncate text-xs font-semibold text-text-primary', children: author }), _jsx(Tooltip, { content: postedAtIsoLabel, children: _jsxs("span", { className: 'whitespace-nowrap text-xs text-text-secondary', children: ["\u00B7 ", postedAtLabel] }) })] }), _jsx("span", { className: 'ml-auto rounded-full bg-sea/10 px-2 py-0.5 text-xs font-medium tabular-nums text-sea', children: formatRelevance(relevance) })] }), _jsx("p", { className: 'break-words text-xs leading-relaxed text-text-primary', children: content }), _jsxs("div", { className: 'mt-2 flex flex-wrap items-center gap-1.5', children: [_jsx("span", { className: 'rounded-full bg-sand/30 px-2 py-0.5 text-xs font-medium uppercase text-text-secondary dark:bg-white/10', children: language || 'n/a' }), safeCategories.map((category) => (_jsx("span", { className: 'rounded-full bg-light-sand px-2 py-0.5 text-xs font-medium text-text-secondary ring-1 ring-black/5 dark:bg-white/5 dark:ring-white/10', children: category }, category)))] }), _jsx("div", { className: 'mt-2', children: _jsxs("a", { className: 'inline-flex items-center gap-1 text-xs font-medium text-sea hover:underline', href: sourceUrl, rel: 'noreferrer noopener', target: '_blank', children: [_jsx("span", { children: sourceLabel }), _jsx(ExternalLink, { size: 12 })] }) })] })] }));
56
+ return (_jsxs("div", { className: cn('flex gap-3.5 border-b border-sand/20 px-4 py-4 text-left transition-colors duration-[var(--motion-surface)] ease-premium hover:bg-light-sand/35 dark:border-white/[0.07] dark:hover:bg-white/[0.03]', className), children: [_jsx(Avatar, { fallback: fallback, size: 'sm', src: avatarSrc, className: 'h-8 w-8 ring-1 ring-black/5 dark:ring-white/10' }), _jsxs("div", { className: 'min-w-0 flex-1', children: [_jsxs("div", { className: 'mb-1.5 flex items-center gap-2', children: [_jsxs("div", { className: 'min-w-0 flex items-center gap-2', children: [_jsx("span", { className: 'truncate text-[13px] font-semibold text-text-primary', children: author }), _jsx(Tooltip, { content: postedAtIsoLabel, children: _jsxs("span", { className: 'font-secondary whitespace-nowrap text-[11px] text-text-secondary', children: ["\u00B7 ", postedAtLabel] }) })] }), _jsx("span", { className: 'ml-auto rounded-[5px] border border-sea/10 bg-sea/[0.06] px-2 py-0.5 text-[11px] font-semibold tabular-nums text-sea', children: formatRelevance(relevance) })] }), _jsx("p", { className: 'break-words text-[13px] leading-5 text-text-primary', children: content }), _jsxs("div", { className: 'mt-2 flex flex-wrap items-center gap-1.5', children: [_jsx("span", { className: 'rounded-[5px] bg-sand/25 px-2 py-0.5 text-[11px] font-medium uppercase text-text-secondary dark:bg-white/[0.07]', children: language || 'n/a' }), safeCategories.map((category) => (_jsx("span", { className: 'rounded-[5px] border border-sand/20 bg-light-sand/60 px-2 py-0.5 text-[11px] font-medium text-text-secondary dark:border-white/[0.07] dark:bg-white/[0.04]', children: category }, category)))] }), _jsx("div", { className: 'mt-2.5', children: _jsxs("a", { className: 'inline-flex items-center gap-1 text-xs font-medium text-sea transition-colors duration-[var(--motion-control)] ease-premium hover:text-deep-sea hover:underline', href: sourceUrl, rel: 'noreferrer noopener', target: '_blank', children: [_jsx("span", { children: sourceLabel }), _jsx(ExternalLink, { size: 12 })] }) })] })] }));
57
57
  }
@@ -6,5 +6,5 @@ export function FieldHelpTooltip({ className, text }) {
6
6
  if (!text.trim()) {
7
7
  return null;
8
8
  }
9
- return (_jsx(Tooltip, { content: text, side: 'bottom', className: cn('align-middle', className), children: _jsx("button", { type: 'button', tabIndex: 0, "aria-label": 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 }) }) }));
9
+ return (_jsx(Tooltip, { content: text, side: 'bottom', className: cn('align-middle', className), children: _jsx("button", { type: 'button', tabIndex: 0, "aria-label": text, className: 'inline-flex h-4 w-4 scale-100 items-center justify-center rounded-full text-text-secondary transition-[color,transform] duration-[var(--motion-control)] ease-premium hover:text-text-primary active:scale-[0.9] focus:outline-none focus:ring-2 focus:ring-sea dark:focus:ring-accent-blue', children: _jsx(Info, { size: 14 }) }) }));
10
10
  }
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ type FieldControlProps = {
3
+ 'aria-describedby'?: string;
4
+ 'aria-invalid'?: boolean | 'false' | 'true';
5
+ id?: string;
6
+ };
7
+ export interface FieldProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
8
+ children: React.ReactElement<FieldControlProps>;
9
+ description?: React.ReactNode;
10
+ error?: React.ReactNode;
11
+ label: React.ReactNode;
12
+ optional?: boolean;
13
+ required?: boolean;
14
+ }
15
+ /** A consistent, accessible label/control/help/error composition. */
16
+ export declare function Field({ children, className, description, error, label, optional, required, ...props }: FieldProps): import("react/jsx-runtime").JSX.Element;
17
+ export {};
@@ -0,0 +1,16 @@
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
+ /** A consistent, accessible label/control/help/error composition. */
5
+ export function Field({ children, className, description, error, label, optional, required, ...props }) {
6
+ const generatedId = React.useId();
7
+ const controlId = children.props.id ?? `${generatedId}-control`;
8
+ const descriptionId = description ? `${generatedId}-description` : undefined;
9
+ const errorId = error ? `${generatedId}-error` : undefined;
10
+ const describedBy = [children.props['aria-describedby'], descriptionId, errorId].filter(Boolean).join(' ') || undefined;
11
+ return (_jsxs("div", { className: cn('space-y-2.5', className), ...props, children: [_jsxs("div", { className: 'flex items-baseline justify-between gap-4', children: [_jsxs("label", { htmlFor: controlId, className: 'text-[13px] font-medium tracking-ui text-text-primary dark:text-text-primary', children: [label, required ? _jsx("span", { className: 'ml-1 text-terracotta', "aria-hidden": 'true', children: "*" }) : null] }), optional ? _jsx("span", { className: 'font-secondary text-[11px] text-text-secondary', children: "Optional" }) : null] }), React.cloneElement(children, {
12
+ id: controlId,
13
+ 'aria-describedby': describedBy,
14
+ 'aria-invalid': error ? true : children.props['aria-invalid']
15
+ }), description ? _jsx("p", { id: descriptionId, className: 'font-secondary text-xs leading-5 text-text-secondary', children: description }) : null, error ? _jsx("p", { id: errorId, className: 'text-xs leading-5 text-terracotta', children: error }) : null] }));
16
+ }
@@ -7,5 +7,5 @@ const sizeClasses = {
7
7
  lg: 'text-base file:px-4 file:py-3'
8
8
  };
9
9
  export const FileInput = React.forwardRef(function FileInput({ className, error = false, inputSize = 'md', ...props }, ref) {
10
- return (_jsx("input", { ref: ref, type: 'file', className: cn('block w-full rounded-[18px] border bg-white p-2 text-text-primary shadow-sm outline-none transition-all duration-200 file:mr-4 file:rounded-full file:border-0 file:font-[family-name:var(--font-header)] file:font-medium file:tracking-refined file:transition-all file:duration-300', 'file:bg-sea/10 file:text-sea hover:file:bg-sea/20 dark:bg-dark-sand dark:text-text-primary dark:file:bg-accent-blue/10 dark:file:text-accent-blue dark:hover:file:bg-accent-blue/20', error ? 'border-terracotta dark:border-terracotta' : 'border-sand/30 dark:border-sand/50', 'focus:ring-2 focus:ring-sea disabled:cursor-not-allowed disabled:opacity-50 dark:focus:ring-accent-blue', sizeClasses[inputSize], className), ...props }));
10
+ return (_jsx("input", { ref: ref, type: 'file', className: cn('block w-full rounded-[var(--radius-ui)] border bg-white p-2 text-text-primary outline-none transition-[border-color,box-shadow,opacity] duration-[var(--motion-control)] ease-premium file:mr-4 file:rounded-md file:border-0 file:font-medium file:tracking-refined file:transition-colors file:duration-[var(--motion-control)] file:ease-premium', 'file:bg-sea/10 file:text-sea hover:file:bg-sea/20 dark:bg-dark-sand dark:text-text-primary dark:file:bg-accent-blue/10 dark:file:text-accent-blue dark:hover:file:bg-accent-blue/20', error ? 'border-terracotta dark:border-terracotta' : 'border-sand/30 dark:border-sand/50', 'focus:ring-2 focus:ring-sea disabled:cursor-not-allowed disabled:opacity-50 dark:focus:ring-accent-blue', sizeClasses[inputSize], className), ...props }));
11
11
  });
@@ -2,10 +2,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { X } from 'lucide-react';
3
3
  import { cn } from '../utils/cn.js';
4
4
  export function FilterChip({ label, value, onRemove, className }) {
5
- return (_jsxs("span", { className: cn('inline-flex items-center gap-1.5 rounded-full border border-border bg-muted px-2.5 py-1 text-xs font-medium text-text-primary dark:text-text-primary', className), children: [_jsx("span", { className: 'text-text-secondary dark:text-text-secondary', children: label }), value && _jsx("span", { className: 'font-semibold', children: value }), onRemove && (_jsx("button", { type: 'button', onClick: onRemove, className: 'rounded-full p-0.5 text-text-secondary transition-colors hover:bg-sand/20 hover:text-text-primary dark:hover:bg-sand/20', children: _jsx(X, { size: 12 }) }))] }));
5
+ return (_jsxs("span", { className: cn('inline-flex min-h-7 items-center gap-1.5 rounded-[6px] border border-sand/35 bg-white px-2.5 py-1 text-[12px] font-medium text-text-primary dark:border-white/12 dark:bg-deep-sea dark:text-text-primary', className), children: [_jsx("span", { className: 'text-text-secondary dark:text-text-secondary', children: label }), value && _jsx("span", { className: 'font-semibold', children: value }), onRemove && (_jsx("button", { type: 'button', onClick: onRemove, className: 'scale-100 rounded-[4px] p-0.5 text-text-secondary transition-[background-color,color,transform] duration-[var(--motion-control)] ease-premium hover:bg-sand/20 hover:text-terracotta active:scale-[0.9] dark:hover:bg-white/[0.07]', "aria-label": `Remove ${label} filter`, children: _jsx(X, { size: 12 }) }))] }));
6
6
  }
7
7
  export function FilterGroup({ filters, className, onClearAll }) {
8
8
  if (filters.length === 0)
9
9
  return null;
10
- return (_jsxs("div", { className: cn('flex flex-wrap items-center gap-2', className), children: [filters.map((filter, index) => (_jsx(FilterChip, { ...filter }, `${filter.label}-${index}`))), onClearAll && (_jsx("button", { type: 'button', onClick: onClearAll, className: 'text-xs font-medium text-sea hover:underline dark:text-accent-blue', children: "Clear all" }))] }));
10
+ return (_jsxs("div", { className: cn('flex flex-wrap items-center gap-2', className), children: [filters.map((filter, index) => (_jsx(FilterChip, { ...filter }, `${filter.label}-${index}`))), onClearAll && (_jsx("button", { type: 'button', onClick: onClearAll, className: 'text-xs font-medium text-sea transition-colors duration-[var(--motion-control)] ease-premium hover:text-deep-sea hover:underline dark:text-accent-blue dark:hover:text-text-primary', children: "Clear all" }))] }));
11
11
  }
@@ -1,13 +1,24 @@
1
1
  import React from 'react';
2
2
  export interface HeaderSelectOption {
3
+ disabled?: boolean;
3
4
  label: string;
4
5
  value: string;
5
6
  }
6
- export interface HeaderSelectProps extends Omit<React.SelectHTMLAttributes<HTMLSelectElement>, 'onChange'> {
7
+ export interface HeaderSelectProps {
8
+ 'aria-describedby'?: string;
9
+ 'aria-label'?: string;
10
+ autoFocus?: boolean;
11
+ className?: string;
12
+ disabled?: boolean;
7
13
  icon?: React.ReactNode;
14
+ id?: string;
15
+ name?: string;
8
16
  onChange: (value: string) => void;
9
17
  options: HeaderSelectOption[];
10
18
  placeholder?: string;
19
+ required?: boolean;
20
+ value?: string;
11
21
  wrapperClassName?: string;
12
22
  }
13
- export declare function HeaderSelect({ className, disabled, icon, onChange, options, placeholder, value, wrapperClassName, ...props }: HeaderSelectProps): import("react/jsx-runtime").JSX.Element;
23
+ /** A compact header treatment backed by the library's accessible Select menu. */
24
+ export declare function HeaderSelect({ 'aria-describedby': ariaDescribedBy, 'aria-label': ariaLabel, autoFocus, className, disabled, icon, id, name, onChange, options, placeholder, required, value, wrapperClassName }: HeaderSelectProps): import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,9 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ 'use client';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { Select } from './select.js';
2
4
  import { cn } from '../utils/cn.js';
3
- export function HeaderSelect({ className, disabled, icon, onChange, options, placeholder = 'Select option', value, wrapperClassName, ...props }) {
4
- return (_jsxs("div", { className: cn('inline-flex items-center gap-1.5 rounded-full border border-sand/20 bg-white/35 px-3 py-1.5 shadow-sm backdrop-blur-md dark:border-sand/70 dark:bg-sand/25', disabled && 'opacity-50', wrapperClassName), children: [icon, _jsxs("select", { value: value, disabled: disabled, onChange: (event) => onChange(event.target.value), className: cn('max-w-[140px] cursor-pointer bg-transparent text-sm text-text-primary focus:outline-none dark:text-text-primary', className), ...props, children: [_jsx("option", { value: '', children: placeholder }), options.map((option) => (_jsx("option", { value: option.value, children: option.label }, option.value)))] })] }));
5
+ /** A compact header treatment backed by the library's accessible Select menu. */
6
+ export function HeaderSelect({ 'aria-describedby': ariaDescribedBy, 'aria-label': ariaLabel, autoFocus, className, disabled, icon, id, name, onChange, options, placeholder = 'Select option', required, value = '', wrapperClassName }) {
7
+ const menuOptions = options.some((option) => option.value === '') ? options : [{ label: placeholder, value: '' }, ...options];
8
+ return (_jsx("div", { className: cn('inline-block min-w-0', wrapperClassName), children: _jsx(Select, { "aria-describedby": ariaDescribedBy, "aria-label": ariaLabel ?? placeholder, autoFocus: autoFocus, className: cn('w-auto min-w-[9rem] max-w-[13rem] border-sand/35', className), contentClassName: 'min-w-[11rem]', disabled: disabled, id: id, name: name, onChange: onChange, options: menuOptions, placeholder: placeholder, required: required, size: 'sm', startIcon: icon, value: value }) }));
5
9
  }
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { ChevronLeft, ChevronRight } from 'lucide-react';
3
4
  import React from 'react';
@@ -73,6 +74,6 @@ export function HeroCarousel({ autoAdvanceMs = 5000, className, defaultBackgroun
73
74
  item,
74
75
  ariaLabel: getAriaLabel(item),
75
76
  className: 'group flex h-full items-center pb-8 pt-16',
76
- children: (_jsx("div", { className: 'mx-auto max-w-3xl px-4 text-center', children: _jsxs("div", { className: 'text-shadow-lg relative z-10 px-2 sm:px-6', children: [_jsxs("div", { className: 'flex flex-col items-center opacity-75', children: [_jsx("span", { className: 'text-sm font-light uppercase tracking-widest light:text-white', children: getKicker(item) }), _jsx("div", { className: 'mb-6 mt-4 h-px w-12 bg-white/30' })] }), item.kind === 'project' && item.tags?.length ? (_jsx("div", { className: 'mb-4 space-x-2', children: item.tags.map((tag) => (_jsx("span", { className: 'inline-block rounded-full border border-white/10 bg-white/15 px-3 py-1 text-sm backdrop-blur-sm light:text-white', children: tag }, `${item.id ?? item.href}:${tag}`))) })) : null, _jsx("h1", { className: 'mb-4 text-3xl font-bold text-balance transition-colors drop-shadow-[0_0_14px_rgba(0,0,0,0.5)] group-hover:text-white/90 light:text-white sm:text-4xl lg:text-5xl', children: item.title }), _jsx("p", { className: 'mb-6 text-base text-gray-100 transition-colors drop-shadow-[0_0_10px_rgba(0,0,0,0.45)] group-hover:text-gray-200 sm:text-lg', children: item.description }), _jsx("div", { className: 'inline-block rounded-full border px-6 py-2 font-medium transition-colors backdrop-blur-sm light:border-white/20 light:bg-white/90 light:text-gray-900 light:group-hover:bg-white dark:border-sand/35 dark:bg-sand/90 dark:text-text-primary dark:group-hover:bg-dark-sand/90', children: getCtaLabel(item) })] }) }))
77
- }) })] }, item.id ?? `${item.title}:${item.href}`))), showNavigation ? (_jsxs("div", { className: 'absolute bottom-8 left-4 right-4 flex items-center justify-between', children: [_jsx(IconButton, { className: 'border-0 bg-black/20 p-2 text-white/75 shadow-none backdrop-blur-sm hover:translate-y-0 hover:scale-100 hover:bg-black/30 hover:text-white dark:bg-black/20 dark:hover:bg-black/30', "data-carousel-prev": true, "aria-label": 'Previous slide', onClick: () => setCurrentSlide((previous) => (previous - 1 + items.length) % items.length), type: 'button', children: _jsx(ChevronLeft, { size: 20 }) }), showIndicators ? (_jsx("div", { className: 'flex gap-2 rounded-full bg-black/20 p-2 backdrop-blur-sm', children: items.map((item, index) => (_jsxs("button", { className: cn('relative flex h-10 w-10 touch-manipulation items-center justify-center', index === currentSlide && 'active'), "data-dot": index, "aria-label": `Go to slide ${index + 1}`, onClick: () => setCurrentSlide(index), type: 'button', children: [_jsx("span", { className: 'dot-indicator block h-2 w-2 rounded-full bg-white/50 transition-colors' }), _jsxs("span", { className: 'sr-only', children: ["Slide ", index + 1] })] }, `dot:${item.id ?? `${item.title}:${item.href}`}`))) })) : null, _jsx(IconButton, { className: 'border-0 bg-black/20 p-2 text-white/75 shadow-none backdrop-blur-sm hover:translate-y-0 hover:scale-100 hover:bg-black/30 hover:text-white dark:bg-black/20 dark:hover:bg-black/30', "data-carousel-next": true, "aria-label": 'Next slide', onClick: () => setCurrentSlide((previous) => (previous + 1) % items.length), type: 'button', children: _jsx(ChevronRight, { size: 20 }) })] })) : null] }) }));
77
+ children: (_jsx("div", { className: 'mx-auto max-w-3xl px-4 text-center', children: _jsxs("div", { className: 'text-shadow-lg relative z-10 px-2 sm:px-6', children: [_jsxs("div", { className: 'flex flex-col items-center opacity-75', children: [_jsx("span", { className: 'text-sm font-light uppercase tracking-widest light:text-white', children: getKicker(item) }), _jsx("div", { className: 'mb-6 mt-4 h-px w-12 bg-white/30' })] }), item.kind === 'project' && item.tags?.length ? (_jsx("div", { className: 'mb-4 space-x-2', children: item.tags.map((tag) => (_jsx("span", { className: 'inline-block rounded-[6px] border border-white/15 bg-black/15 px-2.5 py-1 text-[12px] font-medium backdrop-blur-[2px] light:text-white', children: tag }, `${item.id ?? item.href}:${tag}`))) })) : null, _jsx("h1", { className: 'mb-4 text-3xl font-semibold text-balance transition-colors duration-[var(--motion-surface)] ease-premium drop-shadow-[0_2px_8px_rgba(0,0,0,0.35)] group-hover:text-white/90 light:text-white sm:text-4xl lg:text-5xl', children: item.title }), _jsx("p", { className: 'mb-6 text-base text-gray-100 transition-colors duration-[var(--motion-surface)] ease-premium drop-shadow-[0_0_10px_rgba(0,0,0,0.45)] group-hover:text-gray-200 sm:text-lg', children: item.description }), _jsx("div", { className: 'inline-block rounded-[var(--radius-button)] border px-5 py-2.5 text-sm font-medium transition-colors duration-[var(--motion-surface)] ease-premium backdrop-blur-[2px] light:border-white/25 light:bg-white/92 light:text-gray-900 light:group-hover:bg-white dark:border-sand/35 dark:bg-sand/90 dark:text-text-primary dark:group-hover:bg-dark-sand/90', children: getCtaLabel(item) })] }) }))
78
+ }) })] }, item.id ?? `${item.title}:${item.href}`))), showNavigation ? (_jsxs("div", { className: 'absolute bottom-8 left-4 right-4 flex items-center justify-between', children: [_jsx(IconButton, { className: 'border-white/15 bg-black/20 text-white/80 shadow-none backdrop-blur-[2px] hover:border-white/25 hover:bg-black/30 hover:text-white dark:bg-black/20 dark:hover:bg-black/30', "data-carousel-prev": true, "aria-label": 'Previous slide', onClick: () => setCurrentSlide((previous) => (previous - 1 + items.length) % items.length), type: 'button', children: _jsx(ChevronLeft, { size: 20 }) }), showIndicators ? (_jsx("div", { className: 'flex gap-1 rounded-[var(--radius-ui)] border border-white/10 bg-black/20 p-1 backdrop-blur-[2px]', children: items.map((item, index) => (_jsxs("button", { className: cn('relative flex h-10 w-10 touch-manipulation items-center justify-center', index === currentSlide && 'active'), "data-dot": index, "aria-label": `Go to slide ${index + 1}`, onClick: () => setCurrentSlide(index), type: 'button', children: [_jsx("span", { className: 'dot-indicator block h-2 w-2 rounded-full bg-white/50 transition-[background-color,transform] duration-[var(--motion-control)] ease-premium' }), _jsxs("span", { className: 'sr-only', children: ["Slide ", index + 1] })] }, `dot:${item.id ?? `${item.title}:${item.href}`}`))) })) : null, _jsx(IconButton, { className: 'border-white/15 bg-black/20 text-white/80 shadow-none backdrop-blur-[2px] hover:border-white/25 hover:bg-black/30 hover:text-white dark:bg-black/20 dark:hover:bg-black/30', "data-carousel-next": true, "aria-label": 'Next slide', onClick: () => setCurrentSlide((previous) => (previous + 1) % items.length), type: 'button', children: _jsx(ChevronRight, { size: 20 }) })] })) : null] }) }));
78
79
  }
@@ -5,5 +5,5 @@ import { cn } from '../utils/cn.js';
5
5
  * Pure CSS approach — no portal needed.
6
6
  */
7
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 })] }));
8
+ return (_jsxs("span", { className: 'group relative inline-flex', children: [children, _jsx("span", { className: cn('pointer-events-none absolute z-50 w-72 rounded-[var(--radius-card)] border border-sand/30 bg-white p-4 opacity-0 shadow-[var(--shadow-overlay)] transition-[opacity,transform] duration-[var(--motion-surface)] ease-premium group-hover:pointer-events-auto group-hover:opacity-100 dark:border-white/12 dark:bg-deep-sea', side === 'bottom' ? 'left-1/2 top-full mt-2 -translate-x-1/2 translate-y-1 group-hover:translate-y-0' : 'bottom-full left-1/2 mb-2 -translate-x-1/2 -translate-y-1 group-hover:translate-y-0', className), role: 'tooltip', children: content })] }));
9
9
  }