@gaulatti/bleecker 0.1.14 → 0.1.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/alert.js +12 -12
- package/dist/components/avatar.js +2 -2
- package/dist/components/button-group.js +8 -3
- package/dist/components/button.js +7 -7
- package/dist/components/card.js +1 -1
- package/dist/components/chart.d.ts +6 -0
- package/dist/components/chart.js +13 -0
- package/dist/components/checkbox.d.ts +7 -0
- package/dist/components/checkbox.js +10 -0
- package/dist/components/context-menu.d.ts +9 -0
- package/dist/components/context-menu.js +11 -0
- package/dist/components/data-table.d.ts +11 -0
- package/dist/components/data-table.js +31 -0
- package/dist/components/drawer.js +1 -1
- package/dist/components/empty.js +1 -1
- package/dist/components/file-input.d.ts +8 -0
- package/dist/components/file-input.js +11 -0
- package/dist/components/input.d.ts +10 -0
- package/dist/components/input.js +11 -0
- package/dist/components/kbd.js +2 -2
- package/dist/components/label.d.ts +4 -0
- package/dist/components/label.js +7 -0
- package/dist/components/menubar.js +4 -4
- package/dist/components/modal.js +1 -1
- package/dist/components/navigation-menu.js +1 -1
- package/dist/components/panel.d.ts +8 -1
- package/dist/components/panel.js +12 -2
- package/dist/components/popover.js +1 -1
- package/dist/components/select.js +1 -1
- package/dist/components/separator.d.ts +6 -0
- package/dist/components/separator.js +6 -0
- package/dist/components/status-badge.js +4 -4
- package/dist/components/textarea.d.ts +8 -0
- package/dist/components/textarea.js +11 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/dist/layout/app-shell.js +1 -1
- package/dist/layout/panel-layout.d.ts +2 -1
- package/dist/layout/panel-layout.js +10 -2
- package/dist/login-screen.d.ts +1 -0
- package/dist/login-screen.js +10 -0
- package/dist/styles.css +1 -1
- package/package.json +6 -1
- package/src/styles/global.css +30 -12
package/dist/components/alert.js
CHANGED
|
@@ -6,29 +6,29 @@ import { cn } from '../utils/cn.js';
|
|
|
6
6
|
const alertConfig = {
|
|
7
7
|
success: {
|
|
8
8
|
icon: CheckCircle,
|
|
9
|
-
bgColor: 'bg-
|
|
10
|
-
borderColor: '
|
|
11
|
-
textColor: 'text-
|
|
9
|
+
bgColor: 'bg-white/80 dark:bg-deep-sea/80',
|
|
10
|
+
borderColor: 'ring-sea/20 dark:ring-accent-blue/20',
|
|
11
|
+
textColor: 'text-text-primary dark:text-text-primary',
|
|
12
12
|
iconColor: 'text-sea dark:text-accent-blue'
|
|
13
13
|
},
|
|
14
14
|
error: {
|
|
15
15
|
icon: AlertCircle,
|
|
16
|
-
bgColor: 'bg-
|
|
17
|
-
borderColor: '
|
|
18
|
-
textColor: 'text-
|
|
16
|
+
bgColor: 'bg-white/80 dark:bg-deep-sea/80',
|
|
17
|
+
borderColor: 'ring-terracotta/20 dark:ring-terracotta/30',
|
|
18
|
+
textColor: 'text-text-primary dark:text-text-primary',
|
|
19
19
|
iconColor: 'text-terracotta dark:text-terracotta'
|
|
20
20
|
},
|
|
21
21
|
warning: {
|
|
22
22
|
icon: AlertTriangle,
|
|
23
|
-
bgColor: 'bg-
|
|
24
|
-
borderColor: '
|
|
25
|
-
textColor: 'text-
|
|
23
|
+
bgColor: 'bg-white/80 dark:bg-deep-sea/80',
|
|
24
|
+
borderColor: 'ring-sunset/30 dark:ring-sunset/20',
|
|
25
|
+
textColor: 'text-text-primary dark:text-text-primary',
|
|
26
26
|
iconColor: 'text-sunset dark:text-accent-gold'
|
|
27
27
|
},
|
|
28
28
|
info: {
|
|
29
29
|
icon: Info,
|
|
30
|
-
bgColor: 'bg-
|
|
31
|
-
borderColor: '
|
|
30
|
+
bgColor: 'bg-white/80 dark:bg-deep-sea/80',
|
|
31
|
+
borderColor: 'ring-desert/20 dark:ring-desert/20',
|
|
32
32
|
textColor: 'text-text-primary dark:text-text-primary',
|
|
33
33
|
iconColor: 'text-desert dark:text-accent-gold'
|
|
34
34
|
}
|
|
@@ -63,7 +63,7 @@ export function Alert({ className, duration = 5000, message, onClose, type = 'in
|
|
|
63
63
|
if (typeof document === 'undefined') {
|
|
64
64
|
return null;
|
|
65
65
|
}
|
|
66
|
-
return createPortal(_jsx("div", { className: 'pointer-events-none fixed inset-0 z-[9999] flex items-start justify-center px-4 pt-24', children: _jsx("div", { className: cn('pointer-events-auto w-full max-w-md rounded-
|
|
66
|
+
return createPortal(_jsx("div", { className: 'pointer-events-none fixed inset-0 z-[9999] flex items-start justify-center px-4 pt-24', children: _jsx("div", { className: cn('pointer-events-auto w-full max-w-md rounded-[var(--radius-button)] ring-1 ring-inset shadow-[0_8px_32px_rgba(0,0,0,0.08)] backdrop-blur-xl transition-all duration-400 ease-out-expo dark:shadow-[0_8px_32px_rgba(0,0,0,0.3)]', config.bgColor, config.borderColor, isVisible ? 'translate-y-0 scale-100 opacity-100' : 'translate-y-4 scale-95 opacity-0', className), children: _jsxs("div", { className: 'flex items-start gap-3 p-4', children: [_jsx(Icon, { className: cn('mt-0.5 h-5 w-5 flex-shrink-0', config.iconColor) }), _jsx("p", { className: cn('flex-1 text-sm font-medium tracking-refined', config.textColor), children: message }), _jsx("button", { type: 'button', onClick: handleClose, className: cn('hover:bg-black/5 dark:hover:bg-white/10 -mr-1 -mt-0.5 rounded-md p-1 transition-colors duration-200', config.textColor), "aria-label": 'Close alert', children: _jsx(X, { className: 'h-4 w-4' }) })] }) }) }), document.body);
|
|
67
67
|
}
|
|
68
68
|
let alertsState = [];
|
|
69
69
|
let listeners = [];
|
|
@@ -20,7 +20,7 @@ export function Avatar({ alt, className, fallback, size = 'md', src }) {
|
|
|
20
20
|
const [imgError, setImgError] = React.useState(false);
|
|
21
21
|
const showFallback = !src || imgError;
|
|
22
22
|
const initials = fallback ? getInitials(fallback) : null;
|
|
23
|
-
return (_jsxs("span", { className: cn('relative inline-flex flex-shrink-0 items-center justify-center overflow-hidden rounded-full
|
|
23
|
+
return (_jsxs("span", { className: cn('relative inline-flex flex-shrink-0 items-center justify-center overflow-hidden rounded-full ring-1 ring-inset ring-black/10 bg-light-sand dark:ring-white/10 dark:bg-deep-sea', sizeClasses[size], className), children: [!showFallback && _jsx("img", { src: src, alt: alt ?? fallback ?? '', className: 'h-full w-full object-cover', onError: () => setImgError(true) }), showFallback && initials ? _jsx("span", { className: 'select-none font-medium text-text-secondary dark:text-text-primary', children: initials }) : null, showFallback && !initials ? (_jsx("svg", { className: 'h-3/5 w-3/5 text-text-secondary dark:text-text-primary', viewBox: '0 0 24 24', fill: 'currentColor', "aria-hidden": 'true', children: _jsx("path", { d: 'M7.5 6a4.5 4.5 0 1 1 9 0 4.5 4.5 0 0 1-9 0ZM3.751 20.105a8.25 8.25 0 0 1 16.498 0 .75.75 0 0 1-.437.695A18.683 18.683 0 0 1 12 22.5c-2.786 0-5.433-.608-7.812-1.7a.75.75 0 0 1-.437-.695Z' }) })) : null] }));
|
|
24
24
|
}
|
|
25
25
|
export function AvatarGroup({ avatars, className, max = 4, size = 'md' }) {
|
|
26
26
|
const visible = avatars.slice(0, max);
|
|
@@ -32,5 +32,5 @@ export function AvatarGroup({ avatars, className, max = 4, size = 'md' }) {
|
|
|
32
32
|
lg: 'h-12 w-12 text-sm',
|
|
33
33
|
xl: 'h-16 w-16 text-base'
|
|
34
34
|
};
|
|
35
|
-
return (_jsxs("div", { className: cn('flex -space-x-2', className), children: [visible.map((avatar, index) => (_jsx(Avatar, { ...avatar, size: size, className: 'ring-2 ring-white dark:ring-
|
|
35
|
+
return (_jsxs("div", { className: cn('flex -space-x-2', className), children: [visible.map((avatar, index) => (_jsx(Avatar, { ...avatar, size: size, className: 'ring-2 ring-white dark:ring-deep-sea' }, index))), overflow > 0 && (_jsxs("span", { className: cn('inline-flex flex-shrink-0 items-center justify-center rounded-full bg-light-sand font-medium text-text-secondary ring-2 ring-white dark:bg-deep-sea dark:text-text-primary dark:ring-deep-sea shadow-sm', overflowSizeClasses[size]), children: ["+", overflow] }))] }));
|
|
36
36
|
}
|
|
@@ -14,10 +14,15 @@ export function ButtonGroup({ children, className, orientation = 'horizontal' })
|
|
|
14
14
|
'[&>*]:rounded-none', orientation === 'horizontal'
|
|
15
15
|
? [
|
|
16
16
|
'[&>*:not(:last-child)]:border-r-0',
|
|
17
|
-
'[&>*:first-child]:rounded-l-
|
|
18
|
-
'[&>*:last-child]:rounded-r-
|
|
17
|
+
'[&>*:first-child]:rounded-l-[var(--radius-button)]',
|
|
18
|
+
'[&>*:last-child]:rounded-r-[var(--radius-button)]',
|
|
19
19
|
// Ensure vertical borders between buttons are visible
|
|
20
20
|
'[&>*:not(:first-child)]:border-l'
|
|
21
21
|
]
|
|
22
|
-
: [
|
|
22
|
+
: [
|
|
23
|
+
'[&>*:not(:last-child)]:border-b-0',
|
|
24
|
+
'[&>*:first-child]:rounded-t-[var(--radius-button)]',
|
|
25
|
+
'[&>*:last-child]:rounded-b-[var(--radius-button)]',
|
|
26
|
+
'[&>*:not(:first-child)]:border-t'
|
|
27
|
+
], className), children: children }));
|
|
23
28
|
}
|
|
@@ -2,16 +2,16 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { cn } from '../utils/cn.js';
|
|
4
4
|
const variantClasses = {
|
|
5
|
-
primary: 'bg-sea text-white hover:
|
|
6
|
-
secondary: 'bg-white/65 text-text-primary border-sand/20 hover:bg-white dark:bg-sand/
|
|
5
|
+
primary: 'bg-sea text-white hover:opacity-90 border-transparent shadow-sm',
|
|
6
|
+
secondary: 'bg-white/65 text-text-primary border-sand/20 hover:bg-white shadow-[0_2px_8px_rgba(26,55,77,0.04)] dark:bg-sand/10 dark:text-text-primary dark:border-sand/30 dark:hover:bg-sand/20',
|
|
7
7
|
ghost: 'bg-transparent text-text-primary border-transparent hover:bg-sand/10 dark:text-text-primary dark:hover:bg-sand/15',
|
|
8
|
-
destructive: 'bg-terracotta text-white hover:opacity-90 border-transparent'
|
|
8
|
+
destructive: 'bg-terracotta text-white hover:opacity-90 border-transparent shadow-sm'
|
|
9
9
|
};
|
|
10
10
|
const sizeClasses = {
|
|
11
|
-
sm: 'px-3 py-
|
|
12
|
-
md: 'px-4 py-2
|
|
13
|
-
lg: 'px-6 py-
|
|
11
|
+
sm: 'px-3 py-1.5 text-sm',
|
|
12
|
+
md: 'px-4 py-2 text-sm',
|
|
13
|
+
lg: 'px-6 py-2.5 text-base'
|
|
14
14
|
};
|
|
15
15
|
export const Button = React.forwardRef(function Button({ className, size = 'md', type = 'button', variant = 'primary', ...props }, ref) {
|
|
16
|
-
return (_jsx("button", { ref: ref, type: type, className: cn('inline-flex items-center justify-center gap-2 rounded-
|
|
16
|
+
return (_jsx("button", { ref: ref, type: type, className: cn('inline-flex items-center justify-center gap-2 rounded-[var(--radius-button)] border font-[family-name:var(--font-header)] font-medium tracking-ui transition-all duration-200 active:scale-[0.98] outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-white focus-visible:ring-sea disabled:pointer-events-none disabled:opacity-50 dark:focus-visible:ring-offset-deep-sea dark:focus-visible:ring-accent-blue', variantClasses[variant], sizeClasses[size], className), ...props }));
|
|
17
17
|
});
|
package/dist/components/card.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from '../utils/cn.js';
|
|
3
3
|
export function Card({ className, ...props }) {
|
|
4
|
-
return (_jsx("div", { className: cn('
|
|
4
|
+
return (_jsx("div", { className: cn('relative overflow-hidden rounded-[var(--radius-card)] bg-white p-6 shadow-[0_2px_10px_rgba(0,0,0,0.02),0_8px_32px_rgba(26,55,77,0.04)] ring-1 ring-black/[0.04] backdrop-blur-md transition-all duration-300 dark:bg-deep-sea/90 dark:ring-white/[0.08] dark:shadow-[0_8px_32px_rgba(0,0,0,0.4)]', className), ...props }));
|
|
5
5
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Line, LineChart as RechartsLineChart, ResponsiveContainer, Tooltip, XAxis, YAxis } from 'recharts';
|
|
3
|
+
export function Chart({ data, height = 300 }) {
|
|
4
|
+
return (_jsx("div", { className: 'w-full', style: { height }, children: _jsx(ResponsiveContainer, { width: '100%', height: '100%', children: _jsxs(RechartsLineChart, { data: data, margin: { top: 5, right: 20, bottom: 5, left: 0 }, children: [_jsx(XAxis, { dataKey: 'name', stroke: '#1a374d' // color-sea idea
|
|
5
|
+
, fontSize: 12, tickLine: false, axisLine: false }), _jsx(YAxis, { stroke: '#1a374d', fontSize: 12, tickLine: false, axisLine: false, tickFormatter: (value) => `$${value}` }), _jsx(Tooltip, { contentStyle: {
|
|
6
|
+
backgroundColor: 'rgba(255, 255, 255, 0.95)',
|
|
7
|
+
borderRadius: '8px',
|
|
8
|
+
border: '1px solid rgba(0,0,0,0.1)',
|
|
9
|
+
boxShadow: '0 8px 32px rgba(0,0,0,0.08)',
|
|
10
|
+
backdropFilter: 'blur(8px)'
|
|
11
|
+
}, itemStyle: { color: '#1a374d' } }), _jsx(Line, { type: 'monotone', dataKey: 'total', stroke: '#c8825f' // color-terracotta or similar accent
|
|
12
|
+
, strokeWidth: 2, dot: false, activeDot: { r: 6, fill: '#c8825f', stroke: '#fff', strokeWidth: 2 } })] }) }) }));
|
|
13
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type'> {
|
|
3
|
+
containerClassName?: string;
|
|
4
|
+
description?: React.ReactNode;
|
|
5
|
+
label?: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -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
|
+
export const Checkbox = React.forwardRef(function Checkbox({ className, containerClassName, description, id, label, ...props }, ref) {
|
|
5
|
+
const checkbox = (_jsxs("div", { className: 'relative flex h-5 w-5 shrink-0 items-center justify-center', children: [_jsx("input", { ref: ref, id: id, type: 'checkbox', className: cn('peer absolute inset-0 m-0 h-full w-full appearance-none rounded-[5px] border border-sand/60 bg-light-sand shadow-[inset_0_1px_2px_rgba(0,0,0,0.02)] transition-all duration-200 hover:border-sea/40 hover:bg-white checked:border-sea checked:bg-sea checked:shadow-none focus:outline-none focus-visible:ring-2 focus-visible:ring-sea/20 focus-visible:ring-offset-2 focus-visible:ring-offset-white disabled:cursor-not-allowed disabled:opacity-50 dark:border-dark-sand/50 dark:bg-dark-sand/30 dark:checked:border-accent-blue dark:checked:bg-accent-blue dark:focus-visible:ring-offset-deep-sea', className), ...props }), _jsx("svg", { className: 'pointer-events-none relative z-10 h-3.5 w-3.5 scale-50 text-white opacity-0 transition-all duration-200 ease-bouncy peer-checked:scale-100 peer-checked:opacity-100', viewBox: '0 0 14 10', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', children: _jsx("path", { d: 'M1 5L4.5 8.5L13 1', stroke: 'currentColor', strokeWidth: '2', strokeLinecap: 'round', strokeLinejoin: 'round' }) })] }));
|
|
6
|
+
if (!label && !description) {
|
|
7
|
+
return checkbox;
|
|
8
|
+
}
|
|
9
|
+
return (_jsxs("label", { htmlFor: id, className: cn('flex items-start gap-3', containerClassName), children: [checkbox, _jsxs("span", { className: 'min-w-0', children: [label ? _jsx("span", { className: 'block text-sm font-medium text-text-primary dark:text-text-primary', children: label }) : null, description ? _jsx("span", { className: 'mt-0.5 block text-sm text-text-secondary dark:text-text-secondary', children: description }) : null] })] }));
|
|
10
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as ContextMenuPrimitive from '@radix-ui/react-context-menu';
|
|
3
|
+
declare const ContextMenu: React.FC<ContextMenuPrimitive.ContextMenuProps>;
|
|
4
|
+
declare const ContextMenuTrigger: React.ForwardRefExoticComponent<ContextMenuPrimitive.ContextMenuTriggerProps & React.RefAttributes<HTMLSpanElement>>;
|
|
5
|
+
declare const ContextMenuContent: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
declare const ContextMenuItem: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
7
|
+
inset?: boolean;
|
|
8
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
export { ContextMenu, ContextMenuTrigger, ContextMenuContent, ContextMenuItem };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import * as ContextMenuPrimitive from '@radix-ui/react-context-menu';
|
|
4
|
+
import { cn } from '../utils/cn.js';
|
|
5
|
+
const ContextMenu = ContextMenuPrimitive.Root;
|
|
6
|
+
const ContextMenuTrigger = ContextMenuPrimitive.Trigger;
|
|
7
|
+
const ContextMenuContent = React.forwardRef(({ className, ...props }, ref) => (_jsx(ContextMenuPrimitive.Portal, { children: _jsx(ContextMenuPrimitive.Content, { ref: ref, className: cn('z-50 min-w-[8rem] overflow-hidden rounded-md border border-black/10 bg-white/95 backdrop-blur-xl p-1 text-black shadow-[0_8px_32px_rgba(0,0,0,0.08)] animate-in fade-in zoom-in-95 ease-out duration-200', className), ...props }) })));
|
|
8
|
+
ContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;
|
|
9
|
+
const ContextMenuItem = React.forwardRef(({ className, inset, ...props }, ref) => (_jsx(ContextMenuPrimitive.Item, { ref: ref, className: cn('relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-light-sand focus:text-black data-[disabled]:pointer-events-none data-[disabled]:opacity-50 transition-colors duration-150', inset && 'pl-8', className), ...props })));
|
|
10
|
+
ContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;
|
|
11
|
+
export { ContextMenu, ContextMenuTrigger, ContextMenuContent, ContextMenuItem };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ColumnDef } from '@tanstack/react-table';
|
|
2
|
+
interface DataTableProps<TData, TValue> {
|
|
3
|
+
columns: ColumnDef<TData, TValue>[];
|
|
4
|
+
data: TData[];
|
|
5
|
+
/**
|
|
6
|
+
* If provided, displays a search input that filters this specific column.
|
|
7
|
+
*/
|
|
8
|
+
searchKey?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function DataTable<TData, TValue>({ columns, data, searchKey }: DataTableProps<TData, TValue>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { flexRender, getCoreRowModel, getFilteredRowModel, getPaginationRowModel, getSortedRowModel, useReactTable } from '@tanstack/react-table';
|
|
4
|
+
import { Search, ChevronLeft, ChevronRight } from 'lucide-react';
|
|
5
|
+
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from './table.js';
|
|
6
|
+
import { Input } from './input.js';
|
|
7
|
+
import { Button } from './button.js';
|
|
8
|
+
export function DataTable({ columns, data, searchKey }) {
|
|
9
|
+
const [sorting, setSorting] = React.useState([]);
|
|
10
|
+
const [columnFilters, setColumnFilters] = React.useState([]);
|
|
11
|
+
const [rowSelection, setRowSelection] = React.useState({});
|
|
12
|
+
const table = useReactTable({
|
|
13
|
+
data,
|
|
14
|
+
columns,
|
|
15
|
+
getCoreRowModel: getCoreRowModel(),
|
|
16
|
+
getPaginationRowModel: getPaginationRowModel(),
|
|
17
|
+
onSortingChange: setSorting,
|
|
18
|
+
getSortedRowModel: getSortedRowModel(),
|
|
19
|
+
onColumnFiltersChange: setColumnFilters,
|
|
20
|
+
getFilteredRowModel: getFilteredRowModel(),
|
|
21
|
+
onRowSelectionChange: setRowSelection,
|
|
22
|
+
state: {
|
|
23
|
+
sorting,
|
|
24
|
+
columnFilters,
|
|
25
|
+
rowSelection
|
|
26
|
+
}
|
|
27
|
+
});
|
|
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 _jsx(TableHead, { children: header.isPlaceholder ? null : flexRender(header.column.columnDef.header, header.getContext()) }, header.id);
|
|
30
|
+
}) }, headerGroup.id))) }), _jsx(TableBody, { className: 'bg-white', children: table.getRowModel().rows?.length ? (table.getRowModel().rows.map((row) => (_jsx(TableRow, { "data-state": row.getIsSelected() && 'selected', className: 'hover:bg-light-sand/20 transition-colors duration-[200ms]', 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
|
+
}
|
|
@@ -38,5 +38,5 @@ export function Drawer({ children, className, description, isOpen, onClose, titl
|
|
|
38
38
|
};
|
|
39
39
|
if (typeof document === 'undefined' || !isOpen)
|
|
40
40
|
return null;
|
|
41
|
-
return createPortal(_jsxs("div", { className: 'fixed inset-0 z-50', children: [_jsx("div", { className: cn('absolute inset-0 bg-
|
|
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);
|
|
42
42
|
}
|
package/dist/components/empty.js
CHANGED
|
@@ -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 border-dashed border-sand/30 px-6 py-16 text-center dark:border-
|
|
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] }));
|
|
6
6
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type FileInputSize = 'sm' | 'md' | 'lg';
|
|
3
|
+
export interface FileInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type'> {
|
|
4
|
+
error?: boolean;
|
|
5
|
+
inputSize?: FileInputSize;
|
|
6
|
+
}
|
|
7
|
+
export declare const FileInput: React.ForwardRefExoticComponent<FileInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { cn } from '../utils/cn.js';
|
|
4
|
+
const sizeClasses = {
|
|
5
|
+
sm: 'text-sm file:px-3 file:py-2',
|
|
6
|
+
md: 'text-sm file:px-4 file:py-2.5',
|
|
7
|
+
lg: 'text-base file:px-4 file:py-3'
|
|
8
|
+
};
|
|
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 }));
|
|
11
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type InputSize = 'sm' | 'md' | 'lg';
|
|
3
|
+
export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
4
|
+
endIcon?: React.ReactNode;
|
|
5
|
+
error?: boolean;
|
|
6
|
+
inputSize?: InputSize;
|
|
7
|
+
startIcon?: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { cn } from '../utils/cn.js';
|
|
4
|
+
const sizeClasses = {
|
|
5
|
+
sm: 'min-h-9 px-3 py-2 text-sm',
|
|
6
|
+
md: 'min-h-11 px-4 py-2.5 text-sm',
|
|
7
|
+
lg: 'min-h-12 px-4 py-3 text-base'
|
|
8
|
+
};
|
|
9
|
+
export const Input = React.forwardRef(function Input({ className, endIcon, error = false, inputSize = 'md', startIcon, type = 'text', ...props }, ref) {
|
|
10
|
+
return (_jsxs("div", { className: 'relative w-full', children: [startIcon ? (_jsx("div", { className: 'pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3 text-text-secondary dark:text-text-secondary', children: startIcon })) : null, _jsx("input", { ref: ref, type: type, className: cn('w-full rounded-[var(--radius-ui)] border-0 ring-1 ring-inset ring-black/10 bg-light-sand/50 text-text-primary shadow-[inset_0_1px_2px_rgba(0,0,0,0.02)] outline-none transition-all duration-200 placeholder:text-text-secondary/60 hover:bg-white hover:ring-black/20 focus:bg-white focus:ring-2 focus:ring-inset focus:ring-sea disabled:cursor-not-allowed disabled:opacity-50 dark:bg-deep-sea/50 dark:text-text-primary dark:ring-white/10 dark:placeholder:text-text-secondary dark:hover:bg-deep-sea dark:focus:ring-accent-blue', error ? 'ring-terracotta/50 focus:ring-terracotta dark:ring-terracotta/50' : '', startIcon ? 'pl-10' : sizeClasses[inputSize], startIcon && inputSize === 'sm' && 'min-h-9 py-2 pr-3 text-sm', startIcon && inputSize === 'md' && 'min-h-11 py-2.5 pr-4 text-sm', startIcon && inputSize === 'lg' && 'min-h-12 py-3 pr-4 text-base', endIcon ? 'pr-10' : undefined, className), ...props }), endIcon ? (_jsx("div", { className: 'pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3 text-text-secondary dark:text-text-secondary', children: endIcon })) : null] }));
|
|
11
|
+
});
|
package/dist/components/kbd.js
CHANGED
|
@@ -4,7 +4,7 @@ import { cn } from '../utils/cn.js';
|
|
|
4
4
|
/** Renders a keyboard key or key combination as styled <kbd> elements. */
|
|
5
5
|
export function Kbd({ className, keys, children, ...props }) {
|
|
6
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-
|
|
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-[4px] border border-black/[0.08] bg-light-sand/50 px-1.5 font-mono text-[11px] font-medium text-text-secondary shadow-[0_1px_0_0_rgba(0,0,0,0.08)] dark:border-white/10 dark:bg-deep-sea/50 dark:text-text-primary dark:shadow-[0_1px_0_0_rgba(255,255,255,0.1)]', className), children: key })] }, key))) }));
|
|
8
8
|
}
|
|
9
|
-
return (_jsx("kbd", { ...props, className: cn('inline-flex h-5 min-w-5 items-center justify-center rounded border border-
|
|
9
|
+
return (_jsx("kbd", { ...props, className: cn('inline-flex h-5 min-w-5 items-center justify-center rounded-[4px] border border-black/[0.08] bg-light-sand/50 px-1.5 font-mono text-[11px] font-medium text-text-secondary shadow-[0_1px_0_0_rgba(0,0,0,0.08)] dark:border-white/10 dark:bg-deep-sea/50 dark:text-text-primary dark:shadow-[0_1px_0_0_rgba(255,255,255,0.1)]', className), children: children }));
|
|
10
10
|
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
3
|
+
declare const Label: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & React.RefAttributes<HTMLLabelElement>>;
|
|
4
|
+
export { Label };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
4
|
+
import { cn } from '../utils/cn.js';
|
|
5
|
+
const Label = React.forwardRef(({ className, ...props }, ref) => (_jsx(LabelPrimitive.Root, { ref: ref, className: cn('text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 text-text-primary dark:text-text-primary', className), ...props })));
|
|
6
|
+
Label.displayName = LabelPrimitive.Root.displayName;
|
|
7
|
+
export { Label };
|
|
@@ -7,7 +7,7 @@ function MenuItems({ items, radioGroupValue, onClose }) {
|
|
|
7
7
|
const [openSub, setOpenSub] = React.useState(null);
|
|
8
8
|
return (_jsx("div", { className: 'flex flex-col py-1', children: items.map((item, i) => {
|
|
9
9
|
if (item.type === 'separator') {
|
|
10
|
-
return _jsx("div", { className: 'my-1 h-px bg-
|
|
10
|
+
return _jsx("div", { className: 'my-1 h-px bg-black/5 dark:bg-white/10', role: 'separator' }, i);
|
|
11
11
|
}
|
|
12
12
|
if (item.type === 'radioGroup') {
|
|
13
13
|
return (_jsx("div", { role: 'group', children: item.items.map((rItem) => {
|
|
@@ -26,7 +26,7 @@ function MenuItems({ items, radioGroupValue, onClose }) {
|
|
|
26
26
|
}
|
|
27
27
|
if (item.type === 'sub') {
|
|
28
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
|
|
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 z-[100] left-full top-0 ml-1 min-w-[12rem] animate-in fade-in slide-in-from-left-2 duration-200 ease-out-expo rounded-[var(--radius-card)] border-0 ring-1 ring-black/5 bg-white/95 backdrop-blur-xl p-1 shadow-[0_8px_32px_rgba(0,0,0,0.08)] outline-none dark:ring-white/10 dark:bg-deep-sea/95 dark:shadow-[0_8px_32px_rgba(0,0,0,0.3)]', onPointerEnter: () => setOpenSub(i), onPointerLeave: () => setOpenSub(null), children: _jsx(MenuItems, { items: item.items, onClose: onClose }) }))] }, i));
|
|
30
30
|
}
|
|
31
31
|
// type === 'item'
|
|
32
32
|
return (_jsxs("button", { type: 'button', role: 'menuitem', disabled: item.disabled, onClick: () => {
|
|
@@ -49,10 +49,10 @@ export function Menubar({ className, menus }) {
|
|
|
49
49
|
document.addEventListener('pointerdown', handler);
|
|
50
50
|
return () => document.removeEventListener('pointerdown', handler);
|
|
51
51
|
}, [activeIndex]);
|
|
52
|
-
return (_jsx("div", { ref: barRef, role: 'menubar', className: cn('flex items-center gap-1 rounded-
|
|
52
|
+
return (_jsx("div", { ref: barRef, role: 'menubar', className: cn('flex items-center gap-1 rounded-2xl ring-1 ring-black/5 bg-white/80 px-1 py-1 shadow-sm backdrop-blur-md dark:ring-white/10 dark:bg-deep-sea/80', className), children: menus.map((menu, i) => {
|
|
53
53
|
const isOpen = activeIndex === i;
|
|
54
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
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
|
|
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 z-[100] left-0 top-full mt-1 min-w-[14rem] animate-in fade-in slide-in-from-top-2 duration-200 ease-out-expo rounded-[var(--radius-card)] border-0 ring-1 ring-black/5 bg-white/95 backdrop-blur-xl p-1 shadow-[0_8px_32px_rgba(0,0,0,0.08)] outline-none dark:ring-white/10 dark:bg-deep-sea/95 dark:shadow-[0_8px_32px_rgba(0,0,0,0.3)]', children: _jsx(MenuItems, { items: menu.items, onClose: () => setActiveIndex(null) }) }))] }, menu.trigger));
|
|
57
57
|
}) }));
|
|
58
58
|
}
|
package/dist/components/modal.js
CHANGED
|
@@ -21,7 +21,7 @@ export function Modal({ children, className, isOpen, onClose, title }) {
|
|
|
21
21
|
if (typeof document === 'undefined' || !isOpen) {
|
|
22
22
|
return null;
|
|
23
23
|
}
|
|
24
|
-
return createPortal(_jsx("dialog", { ref: dialogRef, className: cn('m-auto w-full max-w-xl rounded-[
|
|
24
|
+
return createPortal(_jsx("dialog", { ref: dialogRef, className: cn('m-auto w-full max-w-xl animate-in fade-in zoom-in-95 duration-200 ease-out-expo rounded-[var(--radius-card)] border-0 bg-white p-0 text-text-primary shadow-[0_16px_64px_rgba(0,0,0,0.08),0_0_0_1px_rgba(0,0,0,0.02)] outline-none backdrop:bg-deep-sea/40 backdrop:backdrop-blur-md dark:bg-deep-sea dark:shadow-[0_16px_64px_rgba(0,0,0,0.4),0_0_0_1px_rgba(255,255,255,0.08)] dark:text-text-primary dark:backdrop:bg-black/70', className), onClick: (event) => {
|
|
25
25
|
if (event.target === dialogRef.current) {
|
|
26
26
|
onClose();
|
|
27
27
|
}
|
|
@@ -31,7 +31,7 @@ export function NavigationMenu({ className, entries, renderLink }) {
|
|
|
31
31
|
const isOpen = activeIndex === i;
|
|
32
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
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-
|
|
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] animate-in fade-in slide-in-from-top-2 duration-200 ease-out-expo rounded-[var(--radius-card)] border-0 ring-1 ring-black/5 bg-white/95 backdrop-blur-xl p-2 shadow-[0_8px_32px_rgba(0,0,0,0.08)] dark:ring-white/10 dark:bg-deep-sea/95 dark:shadow-[0_8px_32px_rgba(0,0,0,0.3)]', children: entry.items.map((item) => (_jsx(React.Fragment, { children: linkRenderer({
|
|
35
35
|
item,
|
|
36
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
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] })),
|
|
@@ -24,5 +24,12 @@ export interface PanelProps {
|
|
|
24
24
|
* Accepts any valid CSS width value, e.g. `'320px'` or `320`.
|
|
25
25
|
*/
|
|
26
26
|
width?: number | string;
|
|
27
|
+
/**
|
|
28
|
+
* The visual style of the panel.
|
|
29
|
+
* `default` provides the standard elevated card look.
|
|
30
|
+
* `monitor` strips borders, radii, and shadows for seamless multi-column interfaces.
|
|
31
|
+
* @default 'default'
|
|
32
|
+
*/
|
|
33
|
+
variant?: 'default' | 'monitor';
|
|
27
34
|
}
|
|
28
|
-
export declare function Panel({ accent, children, className, count, dragHandle, filter, isDragging, title, toolbar, width }: PanelProps): import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
export declare function Panel({ accent, children, className, count, dragHandle, filter, isDragging, title, toolbar, width, variant }: PanelProps): import("react/jsx-runtime").JSX.Element;
|
package/dist/components/panel.js
CHANGED
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from '../utils/cn.js';
|
|
3
|
-
export function Panel({ accent, children, className, count, dragHandle, filter, isDragging, title, toolbar, width }) {
|
|
3
|
+
export function Panel({ accent, children, className, count, dragHandle, filter, isDragging, title, toolbar, width, variant = 'default' }) {
|
|
4
4
|
const widthValue = typeof width === 'number' ? `${width}px` : width;
|
|
5
5
|
const accentStyle = {
|
|
6
6
|
...(accent ? { '--panel-accent': accent } : {}),
|
|
7
7
|
...(widthValue ? { width: widthValue, minWidth: widthValue } : {}),
|
|
8
8
|
borderLeftColor: accent ?? 'var(--color-sea)'
|
|
9
9
|
};
|
|
10
|
-
return (_jsxs("div", { className: cn('flex flex-col h-full
|
|
10
|
+
return (_jsxs("div", { className: cn('group flex flex-col h-full min-h-0 overflow-hidden transition-all duration-300 ease-out-expo', variant === 'monitor'
|
|
11
|
+
? 'border-r border-black/[0.04] dark:border-white/[0.04] border-l-0 border-y-0 rounded-none bg-transparent shadow-none'
|
|
12
|
+
: [
|
|
13
|
+
'rounded-[var(--radius-card)] bg-white dark:bg-deep-sea/90',
|
|
14
|
+
'ring-1 ring-inset ring-black/[0.04] dark:ring-white/[0.08]',
|
|
15
|
+
'shadow-[0_2px_10px_rgba(0,0,0,0.02),0_8px_32px_rgba(26,55,77,0.04)] dark:shadow-[0_8px_32px_rgba(0,0,0,0.4)]',
|
|
16
|
+
'border-l-4',
|
|
17
|
+
isDragging
|
|
18
|
+
? 'rotate-1 scale-105 shadow-[0_16px_64px_rgba(26,55,77,0.12)]'
|
|
19
|
+
: 'hover:shadow-[0_8px_32px_rgba(26,55,77,0.08)] dark:hover:shadow-[0_16px_64px_rgba(0,0,0,0.5)]'
|
|
20
|
+
], className), style: accentStyle, children: [_jsxs("div", { className: cn('flex flex-col relative z-10 bg-white/40 dark:bg-deep-sea/40 backdrop-blur-md', 'border-b border-black/[0.04] dark:border-white/[0.08] select-none'), children: [_jsxs("div", { className: 'flex items-center gap-3 px-5 py-4', children: [dragHandle ? (_jsx("span", { className: 'cursor-grab text-black/40 hover:text-black/80 dark:text-white/40 dark:hover:text-white/80 active:cursor-grabbing transition-colors', children: dragHandle })) : null, _jsx("span", { className: 'h-2 w-2 flex-shrink-0 rounded-full shadow-[0_0_8px_currentColor] opacity-80 group-hover:opacity-100 transition-opacity', style: { backgroundColor: accent ?? 'var(--color-sea)', color: accent ?? 'var(--color-sea)' } }), _jsx("span", { className: 'flex-1 text-xs font-bold uppercase tracking-widest text-[color:var(--panel-accent,var(--color-sea))]', children: title }), count !== undefined ? (_jsx("span", { className: 'rounded-full bg-light-sand/50 dark:bg-white/10 px-2.5 py-0.5 text-xs font-semibold tabular-nums text-text-primary ring-1 ring-inset ring-black/5 dark:ring-white/10', children: count })) : null] }), filter ? _jsx("div", { className: 'px-5 pb-4', children: filter }) : null, toolbar ? (_jsx("div", { className: 'flex items-center justify-center gap-2 border-t border-black/[0.04] dark:border-white/[0.04] bg-light-sand/20 dark:bg-white/5 px-5 py-2.5', children: toolbar })) : null] }), _jsx("div", { className: 'flex-1 overflow-y-auto bg-light-sand/10 dark:bg-transparent scrollbar-thin scrollbar-track-transparent scrollbar-thumb-black/10 hover:scrollbar-thumb-black/20 dark:scrollbar-thumb-white/10 dark:hover:scrollbar-thumb-white/20', children: children })] }));
|
|
11
21
|
}
|
|
@@ -87,7 +87,7 @@ export function Popover({ align = 'center', children, className, content, onOpen
|
|
|
87
87
|
return () => document.removeEventListener('keydown', handleKey);
|
|
88
88
|
}, [isOpen]);
|
|
89
89
|
const panel = isOpen && typeof document !== 'undefined'
|
|
90
|
-
? createPortal(_jsx("div", { ref: panelRef, role: 'dialog', className: cn('absolute z-50 min-w-[14rem] rounded-
|
|
90
|
+
? createPortal(_jsx("div", { ref: panelRef, role: 'dialog', className: cn('absolute z-50 min-w-[14rem] rounded-[var(--radius-card)] border-0 ring-1 ring-black/5 bg-white/95 backdrop-blur-xl p-1 shadow-[0_8px_32px_rgba(0,0,0,0.08)] outline-none dark:ring-white/10 dark:bg-deep-sea/95 dark:shadow-[0_8px_32px_rgba(0,0,0,0.3)]', 'animate-in fade-in-0 zoom-in-95 duration-200 ease-out-expo', className), style: { top: coords.top, left: coords.left }, children: content }), document.body)
|
|
91
91
|
: null;
|
|
92
92
|
return (_jsxs(_Fragment, { children: [_jsx("span", { ref: triggerRef, className: 'inline-flex', onClick: () => setOpen(!isOpen), children: children }), panel] }));
|
|
93
93
|
}
|
|
@@ -42,7 +42,7 @@ export function Select({ className, disabled = false, error = false, onChange, o
|
|
|
42
42
|
setIsOpen(false);
|
|
43
43
|
setSearchTerm('');
|
|
44
44
|
}
|
|
45
|
-
}, className: cn('w-full rounded-[
|
|
45
|
+
}, className: cn('w-full rounded-[var(--radius-ui)] border-0 ring-1 ring-inset ring-black/10 bg-light-sand/50 px-4 py-2.5 text-left text-text-primary outline-none transition-all duration-200 hover:bg-white hover:ring-black/20 focus:bg-white focus:ring-2 focus:ring-inset focus:ring-sea dark:bg-deep-sea/50 dark:text-text-primary dark:ring-white/10 dark:hover:bg-deep-sea dark:focus:ring-accent-blue', disabled ? 'cursor-not-allowed opacity-50 bg-sand/10' : 'cursor-pointer', error ? 'ring-terracotta/50 focus:ring-terracotta dark:ring-terracotta/50' : '', isOpen && 'bg-white ring-2 ring-inset ring-sea dark:bg-deep-sea dark:ring-accent-blue'), children: _jsxs("div", { className: 'flex items-center justify-between gap-3', children: [_jsx("span", { className: selectedOption ? 'text-text-primary dark:text-text-primary' : 'text-text-secondary dark:text-text-secondary', children: selectedOption ? selectedOption.label : placeholder }), _jsx(ChevronDown, { size: 18, className: cn('text-text-secondary transition-transform duration-200 dark:text-text-secondary', isOpen && 'rotate-180') })] }) }), isOpen ? (_jsxs("div", { ref: dropdownRef, className: 'absolute z-50 mt-2 w-full overflow-hidden animate-in fade-in slide-in-from-top-2 duration-200 ease-out-expo rounded-[var(--radius-ui)] border-0 ring-1 ring-black/5 bg-white shadow-[0_8px_32px_rgba(0,0,0,0.08)] dark:bg-deep-sea dark:ring-white/10 dark:shadow-[0_8px_32px_rgba(0,0,0,0.3)]', children: [options.length > 5 ? (_jsx("div", { className: 'border-b border-sand/20 p-2 dark:border-sand/40', children: _jsx("input", { type: 'text', value: searchTerm, onChange: (event) => setSearchTerm(event.target.value), placeholder: 'Search...', className: 'w-full rounded-lg border border-sand/20 bg-sand/5 px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-1 focus:ring-sea dark:border-sand/30 dark:bg-sand/10 dark:text-text-primary dark:placeholder:text-text-secondary dark:focus:ring-accent-blue', onClick: (event) => event.stopPropagation() }) })) : null, _jsx("div", { className: 'max-h-60 overflow-y-auto py-1', children: filteredOptions.length === 0 ? (_jsx("div", { className: 'px-4 py-3 text-center text-sm text-text-secondary dark:text-text-secondary', children: "No options found" })) : (filteredOptions.map((option) => {
|
|
46
46
|
const isSelected = option.value === value;
|
|
47
47
|
return (_jsxs("button", { type: 'button', onClick: () => handleSelect(option.value), className: cn('flex w-full items-center justify-between gap-2 px-4 py-2.5 text-left text-sm transition-colors duration-150', isSelected
|
|
48
48
|
? 'bg-sea/10 font-medium text-sea dark:bg-accent-blue/10 dark:text-accent-blue'
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface SeparatorProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
decorative?: boolean;
|
|
4
|
+
orientation?: 'horizontal' | 'vertical';
|
|
5
|
+
}
|
|
6
|
+
export declare const Separator: React.ForwardRefExoticComponent<SeparatorProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { cn } from '../utils/cn.js';
|
|
4
|
+
export const Separator = React.forwardRef(function Separator({ className, decorative = true, orientation = 'horizontal', ...props }, ref) {
|
|
5
|
+
return (_jsx("div", { ref: ref, role: decorative ? 'presentation' : 'separator', "aria-orientation": orientation, className: cn('shrink-0 bg-black/5 dark:bg-white/10', orientation === 'horizontal' ? 'h-px w-full' : 'h-full w-px', className), ...props }));
|
|
6
|
+
});
|
|
@@ -6,12 +6,12 @@ const variantClasses = {
|
|
|
6
6
|
dot: 'bg-emerald-500 shadow-[0_0_0_2px_rgba(16,185,129,0.2),0_0_8px_rgba(16,185,129,0.4)]'
|
|
7
7
|
},
|
|
8
8
|
offline: {
|
|
9
|
-
badge: 'bg-
|
|
10
|
-
dot: 'bg-
|
|
9
|
+
badge: 'bg-terracotta/10 border-terracotta/20 text-terracotta dark:bg-terracotta/10 dark:border-terracotta/20 dark:text-terracotta',
|
|
10
|
+
dot: 'bg-terracotta shadow-[0_0_0_2px_rgba(166,93,87,0.2),0_0_8px_rgba(166,93,87,0.4)]'
|
|
11
11
|
},
|
|
12
12
|
warning: {
|
|
13
|
-
badge: 'bg-
|
|
14
|
-
dot: 'bg-
|
|
13
|
+
badge: 'bg-desert/10 border-desert/20 text-desert dark:bg-desert/10 dark:border-desert/20 dark:text-desert',
|
|
14
|
+
dot: 'bg-desert shadow-[0_0_0_2px_rgba(193,129,77,0.2),0_0_8px_rgba(193,129,77,0.4)]'
|
|
15
15
|
},
|
|
16
16
|
info: {
|
|
17
17
|
badge: 'bg-sea/10 border-sea/20 text-sea dark:bg-accent-blue/10 dark:border-accent-blue/20 dark:text-accent-blue',
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type TextareaSize = 'sm' | 'md' | 'lg';
|
|
3
|
+
export interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
4
|
+
error?: boolean;
|
|
5
|
+
textareaSize?: TextareaSize;
|
|
6
|
+
}
|
|
7
|
+
export declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { cn } from '../utils/cn.js';
|
|
4
|
+
const sizeClasses = {
|
|
5
|
+
sm: 'min-h-24 px-3 py-2 text-sm',
|
|
6
|
+
md: 'min-h-28 px-4 py-3 text-sm',
|
|
7
|
+
lg: 'min-h-32 px-4 py-3 text-base'
|
|
8
|
+
};
|
|
9
|
+
export const Textarea = React.forwardRef(function Textarea({ className, error = false, textareaSize = 'md', rows = 4, ...props }, ref) {
|
|
10
|
+
return (_jsx("textarea", { ref: ref, rows: rows, className: cn('w-full rounded-[var(--radius-ui)] border-0 ring-1 ring-inset ring-black/10 bg-light-sand/50 text-text-primary shadow-[inset_0_1px_2px_rgba(0,0,0,0.02)] outline-none transition-all duration-200 placeholder:text-text-secondary/60 hover:bg-white hover:ring-black/20 focus:bg-white focus:ring-2 focus:ring-inset focus:ring-sea disabled:cursor-not-allowed disabled:opacity-50 dark:bg-deep-sea/50 dark:text-text-primary dark:ring-white/10 dark:placeholder:text-text-secondary dark:hover:bg-deep-sea dark:focus:ring-accent-blue', 'resize-y', error ? 'ring-terracotta/50 focus:ring-terracotta dark:ring-terracotta/50' : '', sizeClasses[textareaSize], className), ...props }));
|
|
11
|
+
});
|