@gaulatti/bleecker 0.1.35 → 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.
- package/README.md +75 -0
- package/dist/components/accordion.js +3 -2
- package/dist/components/activity-item.js +1 -1
- package/dist/components/alert-dialog.js +24 -11
- package/dist/components/alert.d.ts +2 -1
- package/dist/components/alert.js +11 -10
- package/dist/components/avatar.d.ts +2 -1
- package/dist/components/avatar.js +1 -0
- package/dist/components/bauhaus-background.js +1 -1
- package/dist/components/brand-lockup.js +1 -1
- package/dist/components/breadcrumb.js +3 -2
- package/dist/components/button.d.ts +3 -5
- package/dist/components/button.js +17 -12
- package/dist/components/card.d.ts +5 -1
- package/dist/components/card.js +3 -2
- package/dist/components/checkbox.js +1 -1
- package/dist/components/collection-filters.d.ts +2 -1
- package/dist/components/collection-filters.js +40 -7
- package/dist/components/command-spotlight.js +10 -5
- package/dist/components/context-menu.js +2 -2
- package/dist/components/dashboard-section.js +1 -1
- package/dist/components/data-list.js +1 -1
- package/dist/components/data-table-column-toggle.js +8 -20
- package/dist/components/data-table.js +2 -1
- package/dist/components/date-picker.d.ts +3 -1
- package/dist/components/date-picker.js +11 -29
- package/dist/components/date-range-picker.d.ts +3 -3
- package/dist/components/date-range-picker.js +24 -9
- package/dist/components/dialog-close-button.js +2 -2
- package/dist/components/donut-chart.js +1 -1
- package/dist/components/drawer.js +8 -22
- package/dist/components/dropdown-menu.js +7 -7
- package/dist/components/empty.js +1 -1
- package/dist/components/error-state.js +1 -1
- package/dist/components/feed-item.js +1 -1
- package/dist/components/field-help-tooltip.js +1 -1
- package/dist/components/field.d.ts +17 -0
- package/dist/components/field.js +16 -0
- package/dist/components/file-input.js +1 -1
- package/dist/components/filter-chip.js +2 -2
- package/dist/components/header-select.d.ts +13 -2
- package/dist/components/header-select.js +7 -3
- package/dist/components/hero-carousel.js +3 -2
- package/dist/components/hover-card.js +1 -1
- package/dist/components/icon-badge.d.ts +5 -2
- package/dist/components/icon-badge.js +2 -2
- package/dist/components/icon-button.d.ts +4 -0
- package/dist/components/icon-button.js +3 -2
- package/dist/components/input.d.ts +2 -3
- package/dist/components/input.js +5 -5
- package/dist/components/label.js +1 -1
- package/dist/components/loading-overlay.js +1 -1
- package/dist/components/loading-spinner.d.ts +3 -1
- package/dist/components/media-library.js +5 -3
- package/dist/components/menubar.js +17 -7
- package/dist/components/metric.d.ts +2 -2
- package/dist/components/metric.js +1 -0
- package/dist/components/modal.js +53 -13
- package/dist/components/navigation-menu.js +15 -5
- package/dist/components/notification-badge.js +1 -1
- package/dist/components/otp-input.js +2 -1
- package/dist/components/page-header.js +1 -1
- package/dist/components/pagination.js +3 -3
- package/dist/components/panel.js +1 -1
- package/dist/components/popover.d.ts +3 -2
- package/dist/components/popover.js +4 -91
- package/dist/components/progress.d.ts +4 -2
- package/dist/components/progress.js +3 -3
- package/dist/components/radio-group.d.ts +3 -1
- package/dist/components/radio-group.js +2 -2
- package/dist/components/sankey-chart.js +1 -0
- package/dist/components/search-input.js +1 -1
- package/dist/components/section-header.js +1 -1
- package/dist/components/select.d.ts +12 -1
- package/dist/components/select.js +13 -64
- package/dist/components/sheet.js +8 -24
- package/dist/components/sidebar.js +4 -3
- package/dist/components/slider.js +2 -2
- package/dist/components/sonner.js +3 -2
- package/dist/components/stat-card.js +1 -1
- package/dist/components/status-badge.d.ts +2 -1
- package/dist/components/status-badge.js +5 -6
- package/dist/components/stepper.js +2 -2
- package/dist/components/sunburst-chart.js +1 -0
- package/dist/components/switch.js +1 -1
- package/dist/components/table.js +10 -8
- package/dist/components/tabs.d.ts +6 -1
- package/dist/components/tabs.js +30 -7
- package/dist/components/textarea.d.ts +2 -3
- package/dist/components/textarea.js +2 -2
- package/dist/components/theme-toggle.js +1 -0
- package/dist/components/timeline.js +1 -1
- package/dist/components/toggle-group.js +2 -1
- package/dist/components/toggle.d.ts +4 -2
- package/dist/components/toggle.js +1 -1
- package/dist/components/tooltip.d.ts +2 -1
- package/dist/components/tooltip.js +3 -21
- package/dist/core/contracts.d.ts +48 -0
- package/dist/core/contracts.js +23 -0
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.js +2 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/layout/admin-shell.js +1 -1
- package/dist/layout/app-shell.js +1 -1
- package/dist/layout/footer.js +4 -4
- package/dist/layout/header.js +2 -1
- package/dist/styles.css +1 -1
- package/dist/theme/theme-provider.js +1 -0
- package/dist/theme/theme-script.d.ts +1 -2
- package/dist/theme/theme-script.js +1 -3
- package/dist/theme/types.d.ts +2 -1
- package/dist/tokens/index.d.ts +1 -0
- package/dist/tokens/index.js +1 -0
- package/dist/tokens/source.d.ts +221 -0
- package/dist/tokens/source.js +140 -0
- package/dist/utils/hooks.d.ts +14 -0
- package/dist/utils/hooks.js +101 -0
- package/package.json +41 -7
- package/src/styles/global.css +82 -175
- package/src/styles/tokens.generated.css +171 -0
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { IconBadgeSize, IconBadgeVariant } from '../core';
|
|
3
|
+
export type { IconBadgeSize, IconBadgeVariant } from '../core';
|
|
2
4
|
export interface IconBadgeProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
-
size?:
|
|
5
|
+
size?: IconBadgeSize;
|
|
6
|
+
variant?: IconBadgeVariant;
|
|
4
7
|
}
|
|
5
|
-
export declare function IconBadge({ children, className, size, ...props }: IconBadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function IconBadge({ children, className, size, variant, ...props }: IconBadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -4,6 +4,6 @@ const sizeClassNames = {
|
|
|
4
4
|
md: 'h-14 w-14',
|
|
5
5
|
lg: 'h-16 w-16'
|
|
6
6
|
};
|
|
7
|
-
export function IconBadge({ children, className, size = 'lg', ...props }) {
|
|
8
|
-
return (_jsx("div", { className: cn('flex items-center justify-center bg-
|
|
7
|
+
export function IconBadge({ children, className, size = 'lg', variant = 'primary', ...props }) {
|
|
8
|
+
return (_jsx("div", { className: cn('flex items-center justify-center rounded-[10px] border', sizeClassNames[size], variant === 'primary' && 'border-deep-sea bg-deep-sea text-white dark:border-accent-blue dark:bg-accent-blue dark:text-deep-sea', variant === 'subtle' && 'border-sea/10 bg-sea/[0.06] text-sea dark:border-accent-blue/15 dark:bg-accent-blue/10 dark:text-accent-blue', variant === 'outlined' && 'border-sand/40 bg-white text-text-primary dark:border-white/15 dark:bg-deep-sea dark:text-text-primary', className), ...props, children: children }));
|
|
9
9
|
}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { IconButtonSize, IconButtonVariant } from '../core';
|
|
3
|
+
export type { IconButtonSize, IconButtonVariant } from '../core';
|
|
2
4
|
export interface IconButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
5
|
+
size?: IconButtonSize;
|
|
6
|
+
variant?: IconButtonVariant;
|
|
3
7
|
}
|
|
4
8
|
export declare const IconButton: React.ForwardRefExoticComponent<IconButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { cn } from '../utils/cn.js';
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
const sizes = { sm: 'h-8 w-8', md: 'h-10 w-10', lg: 'h-11 w-11' };
|
|
5
|
+
export const IconButton = React.forwardRef(function IconButton({ className, size = 'md', type = 'button', variant = 'default', ...props }, ref) {
|
|
6
|
+
return (_jsx("button", { ref: ref, type: type, className: cn('inline-flex shrink-0 translate-y-0 scale-100 items-center justify-center rounded-[var(--radius-button)] border text-text-primary transition-[background-color,border-color,color,box-shadow,transform,opacity] duration-[var(--motion-control)] ease-premium active:translate-y-px active:scale-[0.97] active:shadow-none focus:outline-none focus-visible:ring-2 focus-visible:ring-sea/30 focus-visible:ring-offset-2 focus-visible:ring-offset-white disabled:pointer-events-none disabled:transform-none disabled:opacity-45 dark:text-text-primary dark:focus-visible:ring-accent-blue/40 dark:focus-visible:ring-offset-deep-sea', sizes[size], variant === 'default' && 'border-sand/35 bg-white shadow-[0_1px_2px_rgba(26,55,77,0.025)] hover:border-sand/65 hover:bg-light-sand/45 hover:shadow-[0_3px_9px_-6px_rgba(26,55,77,0.28)] dark:border-white/15 dark:bg-deep-sea dark:hover:bg-white/[0.06]', variant === 'subtle' && 'border-transparent bg-light-sand/75 hover:bg-sand/25 dark:bg-white/[0.07] dark:hover:bg-white/[0.11]', variant === 'ghost' && 'border-transparent bg-transparent hover:bg-sand/12 dark:hover:bg-white/[0.06]', className), ...props }));
|
|
6
7
|
});
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
type
|
|
2
|
+
import type { ControlSize } from '../core';
|
|
3
3
|
export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
4
4
|
endIcon?: React.ReactNode;
|
|
5
5
|
error?: boolean;
|
|
6
|
-
inputSize?:
|
|
6
|
+
inputSize?: ControlSize;
|
|
7
7
|
startIcon?: React.ReactNode;
|
|
8
8
|
}
|
|
9
9
|
export declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
10
|
-
export {};
|
package/dist/components/input.js
CHANGED
|
@@ -2,10 +2,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { cn } from '../utils/cn.js';
|
|
4
4
|
const sizeClasses = {
|
|
5
|
-
sm: '
|
|
6
|
-
md: '
|
|
7
|
-
lg: '
|
|
5
|
+
sm: 'h-9 px-3 text-[13px]',
|
|
6
|
+
md: 'h-10 px-3.5 text-sm',
|
|
7
|
+
lg: 'h-11 px-4 text-[15px]'
|
|
8
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
|
|
9
|
+
export const Input = React.forwardRef(function Input({ 'aria-invalid': ariaInvalid, 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, "aria-invalid": ariaInvalid ?? (error || undefined), className: cn('w-full rounded-[var(--radius-ui)] border border-sand/40 bg-white text-text-primary shadow-[0_1px_2px_rgba(26,55,77,0.025)] outline-none transition-[background-color,border-color,box-shadow,opacity] duration-[var(--motion-control)] ease-premium placeholder:text-text-secondary/55 hover:border-sand/70 hover:shadow-[0_3px_10px_-8px_rgba(26,55,77,0.25)] focus:border-sea/70 focus:ring-2 focus:ring-sea/10 disabled:cursor-not-allowed disabled:bg-light-sand/65 disabled:opacity-60 dark:border-white/15 dark:bg-deep-sea dark:text-text-primary dark:placeholder:text-text-secondary dark:hover:border-white/25 dark:focus:border-accent-blue dark:focus:ring-accent-blue/12 [&::-webkit-search-cancel-button]:appearance-none', error ? 'border-terracotta focus:border-terracotta focus:ring-terracotta/15 dark:border-terracotta' : '', startIcon ? 'pl-10' : sizeClasses[inputSize], startIcon && inputSize === 'sm' && 'h-9 pr-3 text-[13px]', startIcon && inputSize === 'md' && 'h-10 pr-3.5 text-sm', startIcon && inputSize === 'lg' && 'h-11 pr-4 text-[15px]', 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
11
|
});
|
package/dist/components/label.js
CHANGED
|
@@ -2,6 +2,6 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
4
4
|
import { cn } from '../utils/cn.js';
|
|
5
|
-
const Label = React.forwardRef(({ className, ...props }, ref) => (_jsx(LabelPrimitive.Root, { ref: ref, className: cn('text-
|
|
5
|
+
const Label = React.forwardRef(({ className, ...props }, ref) => (_jsx(LabelPrimitive.Root, { ref: ref, className: cn('text-[13px] font-medium leading-none tracking-ui text-text-primary peer-disabled:cursor-not-allowed peer-disabled:opacity-60 dark:text-text-primary', className), ...props })));
|
|
6
6
|
Label.displayName = LabelPrimitive.Root.displayName;
|
|
7
7
|
export { Label };
|
|
@@ -5,5 +5,5 @@ import { LoadingSpinner } from './loading-spinner.js';
|
|
|
5
5
|
export function LoadingOverlay({ visible, label = 'Loading...', className, overlayClassName }) {
|
|
6
6
|
if (!visible || typeof document === 'undefined')
|
|
7
7
|
return null;
|
|
8
|
-
return createPortal(_jsx("div", { className: cn('fixed inset-0 z-50 flex items-center justify-center bg-background/
|
|
8
|
+
return createPortal(_jsx("div", { className: cn('fixed inset-0 z-50 flex items-center justify-center bg-background/72 backdrop-blur-[2px]', overlayClassName), children: _jsxs("div", { className: cn('flex flex-col items-center gap-3 rounded-[var(--radius-card)] border border-sand/25 bg-card px-7 py-6 shadow-[var(--shadow-overlay)] dark:border-white/10', className), children: [_jsx(LoadingSpinner, { size: 'lg' }), label && _jsx("p", { className: 'text-sm font-medium text-text-primary dark:text-text-primary', children: label })] }) }), document.body);
|
|
9
9
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import type { LoadingSize } from '../core';
|
|
2
|
+
export type { LoadingSize } from '../core';
|
|
1
3
|
export interface LoadingSpinnerProps {
|
|
2
4
|
className?: string;
|
|
3
|
-
size?:
|
|
5
|
+
size?: LoadingSize;
|
|
4
6
|
}
|
|
5
7
|
export declare function LoadingSpinner({ className, size }: LoadingSpinnerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
'use client';
|
|
1
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Copy,
|
|
3
|
+
import { Copy, Trash2 } from 'lucide-react';
|
|
3
4
|
import React from 'react';
|
|
4
5
|
import { IconButton } from './icon-button.js';
|
|
5
6
|
import { Modal } from './modal.js';
|
|
7
|
+
import { SearchInput } from './search-input.js';
|
|
6
8
|
import { cn } from '../utils/cn.js';
|
|
7
9
|
export function MediaLibrary({ actions, className, emptyMessage = 'No media found.', filterSlot, items, onCopy, onDelete, onSearchTermChange, searchPlaceholder = 'Search media...', searchTerm, title }) {
|
|
8
10
|
const [selectedMedia, setSelectedMedia] = React.useState(null);
|
|
@@ -15,8 +17,8 @@ export function MediaLibrary({ actions, className, emptyMessage = 'No media foun
|
|
|
15
17
|
void navigator.clipboard.writeText(text);
|
|
16
18
|
}
|
|
17
19
|
};
|
|
18
|
-
return (_jsxs("div", { className: cn('
|
|
20
|
+
return (_jsxs("div", { className: cn('px-5 py-6 md:px-8 md:py-9', className), children: [_jsxs("div", { className: 'mb-8 flex flex-col gap-5 md:flex-row md:items-end md:justify-between', children: [_jsxs("div", { children: [_jsx("p", { className: 'mb-2 text-[10px] font-semibold uppercase tracking-[0.11em] text-desert', children: "Media collection" }), _jsx("h1", { className: 'text-[2rem] font-semibold leading-tight tracking-refined text-text-primary dark:text-text-primary', children: title })] }), actions] }), _jsxs("div", { className: 'mb-7 flex flex-col gap-3 md:flex-row', children: [_jsx("div", { className: 'flex-1', children: _jsx(SearchInput, { placeholder: searchPlaceholder, value: searchTerm, onChange: (event) => onSearchTermChange(event.target.value), onClear: () => onSearchTermChange('') }) }), filterSlot ? _jsx("div", { className: 'md:w-64', children: filterSlot }) : null] }), _jsx("div", { className: 'grid grid-cols-2 gap-4 md:grid-cols-4 lg:grid-cols-5', children: items.map((media) => (_jsxs("div", { className: 'group relative aspect-square overflow-hidden rounded-[var(--radius-ui)] border border-sand/30 bg-white shadow-[var(--shadow-surface)] transition-[border-color,box-shadow] duration-[var(--motion-surface)] ease-premium hover:border-sand/55 hover:shadow-[var(--shadow-raised)] focus-within:ring-2 focus-within:ring-sea/25 dark:border-white/10 dark:bg-deep-sea dark:hover:border-white/20', children: [_jsx("button", { type: 'button', className: 'absolute inset-0 z-10 cursor-pointer outline-none', onClick: () => setSelectedMedia(media), "aria-label": `Open ${media.filename}` }), media.thumbnailUrl || media.url ? (_jsx("img", { src: media.thumbnailUrl || media.url, alt: media.alt || media.filename, className: 'h-full w-full object-cover' })) : (_jsx("div", { className: 'font-secondary flex h-full w-full items-center justify-center bg-light-sand/60 text-xs text-text-secondary dark:bg-white/[0.04]', children: "No preview" })), _jsxs("div", { className: 'pointer-events-none absolute inset-x-0 bottom-0 flex translate-y-1 flex-col justify-end bg-deep-sea/82 p-3 opacity-0 backdrop-blur-[2px] transition-[opacity,transform] duration-[var(--motion-surface)] ease-premium group-hover:translate-y-0 group-hover:opacity-100 group-focus-within:translate-y-0 group-focus-within:opacity-100', children: [_jsx("p", { className: 'mb-2 truncate text-[12px] font-medium text-white', children: media.filename }), onDelete ? (_jsx(IconButton, { onClick: (event) => {
|
|
19
21
|
event.stopPropagation();
|
|
20
22
|
onDelete(media.id);
|
|
21
|
-
}, className: '
|
|
23
|
+
}, variant: 'subtle', className: 'pointer-events-auto relative z-20 self-end text-terracotta hover:text-terracotta', title: 'Delete', "aria-label": 'Delete media item', children: _jsx(Trash2, { size: 16 }) })) : null] })] }, media.id))) }), items.length === 0 ? _jsx("div", { className: 'font-secondary rounded-[var(--radius-card)] border border-sand/25 bg-light-sand/25 px-8 py-14 text-center text-sm text-text-secondary dark:border-white/10 dark:bg-white/[0.025]', children: emptyMessage }) : null, _jsx(Modal, { isOpen: !!selectedMedia, onClose: () => setSelectedMedia(null), title: selectedMedia?.filename || 'Media Preview', className: 'max-w-4xl', children: selectedMedia ? (_jsxs("div", { className: 'space-y-6', children: [_jsx("div", { className: 'flex items-center justify-center overflow-hidden rounded-[var(--radius-ui)] border border-sand/20 bg-light-sand/35 dark:border-white/[0.07] dark:bg-black/20', children: selectedMedia.url ? (_jsx("img", { src: selectedMedia.url, alt: selectedMedia.alt || selectedMedia.filename, className: 'max-h-[60vh] w-auto object-contain' })) : null }), _jsxs("div", { className: 'space-y-5', children: [_jsxs("div", { className: 'flex items-center gap-2', children: [_jsx("h3", { className: 'flex-1 text-xl font-semibold tracking-refined text-text-primary dark:text-text-primary', children: selectedMedia.filename }), _jsx(IconButton, { onClick: () => handleCopy(selectedMedia.filename), variant: 'ghost', title: 'Copy filename', "aria-label": 'Copy filename', children: _jsx(Copy, { size: 18 }) })] }), selectedMedia.alt ? (_jsxs("div", { children: [_jsx("p", { className: 'text-[10px] font-semibold uppercase tracking-[0.09em] text-text-secondary', children: "Alt text" }), _jsx("p", { className: 'font-secondary mt-1 text-sm leading-6 text-text-primary dark:text-text-primary', children: selectedMedia.alt })] })) : null, _jsxs("div", { className: 'grid grid-cols-1 gap-6 border-t border-sand/20 pt-5 md:grid-cols-2 dark:border-white/[0.07]', children: [selectedMedia.url ? (_jsxs("div", { children: [_jsx("p", { className: 'mb-1.5 text-[10px] font-semibold uppercase tracking-[0.09em] text-text-secondary', children: "URL" }), _jsxs("div", { className: 'flex items-center gap-2', children: [_jsx("a", { href: selectedMedia.url, target: '_blank', rel: 'noreferrer noopener', className: 'flex-1 break-all text-sm 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: selectedMedia.url }), _jsx(IconButton, { onClick: () => handleCopy(selectedMedia.url || ''), variant: 'ghost', size: 'sm', title: 'Copy URL', "aria-label": 'Copy URL', children: _jsx(Copy, { size: 14 }) })] })] })) : null, selectedMedia.createdAt ? (_jsxs("div", { children: [_jsx("p", { className: 'mb-1.5 text-[10px] font-semibold uppercase tracking-[0.09em] text-text-secondary', children: "Created" }), _jsx("p", { className: 'font-secondary text-sm text-text-primary dark:text-text-primary', children: new Date(selectedMedia.createdAt).toLocaleDateString() })] })) : null] })] })] })) : null })] }));
|
|
22
24
|
}
|
|
@@ -1,7 +1,17 @@
|
|
|
1
|
+
'use client';
|
|
1
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
3
|
import { Check, ChevronRight } from 'lucide-react';
|
|
3
4
|
import React from 'react';
|
|
4
5
|
import { cn } from '../utils/cn.js';
|
|
6
|
+
import { usePresence } from '../utils/hooks.js';
|
|
7
|
+
function FloatingMenuSurface({ className, open, ...props }) {
|
|
8
|
+
const { present, visible } = usePresence(open, 150);
|
|
9
|
+
if (!present)
|
|
10
|
+
return null;
|
|
11
|
+
return (_jsx("div", { className: cn('origin-top-left rounded-[var(--radius-ui)] border border-sand/35 bg-white p-1.5 shadow-[var(--shadow-overlay)] outline-none transition-[opacity,transform] dark:border-white/15 dark:bg-deep-sea', visible
|
|
12
|
+
? 'translate-y-0 scale-100 opacity-100 duration-[var(--motion-surface)] ease-premium'
|
|
13
|
+
: '-translate-y-1 scale-[0.992] opacity-0 duration-[var(--motion-exit)] ease-in', className), ...props }));
|
|
14
|
+
}
|
|
5
15
|
// ─── MenuItem renderer ───────────────────────────────────────────────────────
|
|
6
16
|
function MenuItems({ items, radioGroupValue, onClose }) {
|
|
7
17
|
const [openSub, setOpenSub] = React.useState(null);
|
|
@@ -15,24 +25,24 @@ function MenuItems({ items, radioGroupValue, onClose }) {
|
|
|
15
25
|
return (_jsxs("button", { type: 'button', role: 'menuitemradio', "aria-checked": isChecked, disabled: rItem.disabled, onClick: () => {
|
|
16
26
|
item.onValueChange(rItem.value);
|
|
17
27
|
onClose();
|
|
18
|
-
}, className: 'flex w-full items-center gap-2 rounded-
|
|
28
|
+
}, className: 'flex w-full items-center gap-2 rounded-[var(--radius-ui)] px-3 py-1.5 text-sm text-text-primary transition-colors duration-[var(--motion-control)] ease-premium hover:bg-sand/10 disabled:opacity-50 dark:text-text-primary dark:hover:bg-sand/15', children: [_jsx("span", { className: 'flex h-4 w-4 items-center justify-center', children: isChecked ? _jsx("span", { className: 'h-2 w-2 rounded-full bg-sea dark:bg-accent-blue' }) : null }), rItem.label, rItem.shortcut ? _jsx("span", { className: 'ml-auto text-xs text-text-secondary', children: rItem.shortcut }) : null] }, rItem.value));
|
|
19
29
|
}) }, i));
|
|
20
30
|
}
|
|
21
31
|
if (item.type === 'checkbox') {
|
|
22
32
|
return (_jsxs("button", { type: 'button', role: 'menuitemcheckbox', "aria-checked": item.checked, disabled: item.disabled, onClick: () => {
|
|
23
33
|
item.onCheckedChange(!item.checked);
|
|
24
34
|
onClose();
|
|
25
|
-
}, className: 'flex w-full items-center gap-2 rounded-
|
|
35
|
+
}, className: 'flex w-full items-center gap-2 rounded-[var(--radius-ui)] px-3 py-1.5 text-sm text-text-primary transition-colors duration-[var(--motion-control)] ease-premium hover:bg-sand/10 disabled:opacity-50 dark:text-text-primary dark:hover:bg-sand/15', children: [_jsx("span", { className: 'flex h-4 w-4 items-center justify-center', children: item.checked ? _jsx(Check, { size: 12, className: 'text-sea dark:text-accent-blue' }) : null }), item.label, item.shortcut ? _jsx("span", { className: 'ml-auto text-xs text-text-secondary', children: item.shortcut }) : null] }, i));
|
|
26
36
|
}
|
|
27
37
|
if (item.type === 'sub') {
|
|
28
38
|
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-
|
|
39
|
+
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-[var(--radius-ui)] px-3 py-1.5 text-sm text-text-primary transition-colors duration-[var(--motion-control)] ease-premium 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' })] }), _jsx(FloatingMenuSurface, { open: isSubOpen, className: 'absolute left-full top-0 z-[100] ml-1 min-w-[12rem]', onPointerEnter: () => setOpenSub(i), onPointerLeave: () => setOpenSub(null), children: _jsx(MenuItems, { items: item.items, onClose: onClose }) })] }, i));
|
|
30
40
|
}
|
|
31
41
|
// type === 'item'
|
|
32
42
|
return (_jsxs("button", { type: 'button', role: 'menuitem', disabled: item.disabled, onClick: () => {
|
|
33
43
|
item.onSelect();
|
|
34
44
|
onClose();
|
|
35
|
-
}, className: 'flex w-full items-center gap-2 rounded-
|
|
45
|
+
}, className: 'flex w-full items-center gap-2 rounded-[var(--radius-ui)] px-3 py-1.5 text-sm text-text-primary transition-colors duration-[var(--motion-control)] ease-premium hover:bg-sand/10 disabled:opacity-50 dark:text-text-primary dark:hover:bg-sand/15', children: [item.icon ? _jsx("span", { className: 'flex-shrink-0 text-text-secondary', children: item.icon }) : _jsx("span", { className: 'w-4' }), _jsx("span", { className: 'flex-1', children: item.label }), item.shortcut ? _jsx("span", { className: 'ml-auto text-xs text-text-secondary', children: item.shortcut }) : null] }, i));
|
|
36
46
|
}) }));
|
|
37
47
|
}
|
|
38
48
|
// ─── Menubar ─────────────────────────────────────────────────────────────────
|
|
@@ -49,10 +59,10 @@ export function Menubar({ className, menus }) {
|
|
|
49
59
|
document.addEventListener('pointerdown', handler);
|
|
50
60
|
return () => document.removeEventListener('pointerdown', handler);
|
|
51
61
|
}, [activeIndex]);
|
|
52
|
-
return (_jsx("div", { ref: barRef, role: 'menubar', className: cn('flex items-center gap-
|
|
62
|
+
return (_jsx("div", { ref: barRef, role: 'menubar', className: cn('flex items-center gap-0.5 rounded-[var(--radius-ui)] border border-sand/30 bg-white px-1 py-1 shadow-[var(--shadow-surface)] dark:border-white/10 dark:bg-deep-sea', className), children: menus.map((menu, i) => {
|
|
53
63
|
const isOpen = activeIndex === i;
|
|
54
|
-
return (_jsxs("div", { className: 'relative', children: [_jsx("button", { type: 'button', role: 'menuitem', "aria-haspopup": 'menu', "aria-expanded": isOpen, onClick: () => setActiveIndex(isOpen ? null : i), className: cn('rounded-
|
|
64
|
+
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-[var(--radius-ui)] px-3 py-1.5 text-sm font-medium transition-colors duration-[var(--motion-control)] ease-premium focus:outline-none focus-visible:ring-2 focus-visible:ring-sea dark:focus-visible:ring-accent-blue', isOpen
|
|
55
65
|
? '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 }),
|
|
66
|
+
: '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 }), _jsx(FloatingMenuSurface, { open: isOpen, role: 'menu', className: 'absolute left-0 top-full z-[100] mt-1 min-w-[14rem]', children: _jsx(MenuItems, { items: menu.items, onClose: () => setActiveIndex(null) }) })] }, menu.trigger));
|
|
57
67
|
}) }));
|
|
58
68
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
type MetricFormat
|
|
2
|
+
import type { MetricFormat } from '../core';
|
|
3
|
+
export type { MetricFormat } from '../core';
|
|
3
4
|
export interface MetricProps {
|
|
4
5
|
value: number | undefined | null;
|
|
5
6
|
format?: MetricFormat;
|
|
@@ -10,4 +11,3 @@ export interface MetricProps {
|
|
|
10
11
|
decimals?: number;
|
|
11
12
|
}
|
|
12
13
|
export declare function Metric({ value, format, currency, className, prefix, suffix, decimals }: MetricProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
export {};
|
package/dist/components/modal.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
'use client';
|
|
1
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
3
|
import React from 'react';
|
|
3
4
|
import { createPortal } from 'react-dom';
|
|
@@ -5,25 +6,64 @@ import { DialogCloseButton } from './dialog-close-button.js';
|
|
|
5
6
|
import { cn } from '../utils/cn.js';
|
|
6
7
|
export function Modal({ children, className, isOpen, onClose, title }) {
|
|
7
8
|
const dialogRef = React.useRef(null);
|
|
9
|
+
const closeTimerRef = React.useRef(null);
|
|
10
|
+
const openTimerRef = React.useRef(null);
|
|
11
|
+
const titleId = React.useId();
|
|
12
|
+
const [isPresent, setIsPresent] = React.useState(isOpen);
|
|
13
|
+
const [motionState, setMotionState] = React.useState(isOpen ? 'opening' : 'closing');
|
|
8
14
|
React.useEffect(() => {
|
|
9
|
-
|
|
10
|
-
|
|
15
|
+
if (isOpen) {
|
|
16
|
+
if (closeTimerRef.current)
|
|
17
|
+
clearTimeout(closeTimerRef.current);
|
|
18
|
+
setIsPresent(true);
|
|
19
|
+
setMotionState('opening');
|
|
11
20
|
return;
|
|
12
21
|
}
|
|
13
|
-
if (
|
|
14
|
-
|
|
15
|
-
|
|
22
|
+
if (isPresent) {
|
|
23
|
+
setMotionState('closing');
|
|
24
|
+
closeTimerRef.current = setTimeout(() => {
|
|
25
|
+
dialogRef.current?.close();
|
|
26
|
+
setIsPresent(false);
|
|
27
|
+
}, 150);
|
|
16
28
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
29
|
+
}, [isOpen, isPresent]);
|
|
30
|
+
React.useLayoutEffect(() => {
|
|
31
|
+
const dialog = dialogRef.current;
|
|
32
|
+
if (!isPresent || !isOpen || !dialog)
|
|
33
|
+
return;
|
|
34
|
+
if (!dialog.open)
|
|
35
|
+
dialog.showModal();
|
|
36
|
+
openTimerRef.current = setTimeout(() => setMotionState('open'), 20);
|
|
37
|
+
return () => {
|
|
38
|
+
if (openTimerRef.current)
|
|
39
|
+
clearTimeout(openTimerRef.current);
|
|
40
|
+
};
|
|
41
|
+
}, [isOpen, isPresent]);
|
|
42
|
+
React.useEffect(() => {
|
|
43
|
+
return () => {
|
|
44
|
+
if (closeTimerRef.current)
|
|
45
|
+
clearTimeout(closeTimerRef.current);
|
|
46
|
+
if (openTimerRef.current)
|
|
47
|
+
clearTimeout(openTimerRef.current);
|
|
48
|
+
dialogRef.current?.close();
|
|
49
|
+
};
|
|
50
|
+
}, []);
|
|
51
|
+
const requestClose = () => {
|
|
52
|
+
if (motionState !== 'closing')
|
|
53
|
+
onClose();
|
|
54
|
+
};
|
|
55
|
+
if (typeof document === 'undefined' || !isPresent) {
|
|
22
56
|
return null;
|
|
23
57
|
}
|
|
24
|
-
return createPortal(_jsx("dialog", { ref: dialogRef, className: cn('m-auto w-full max-w-xl
|
|
58
|
+
return createPortal(_jsx("dialog", { ref: dialogRef, "aria-labelledby": titleId, "data-state": motionState, className: cn('modal-motion m-auto w-full max-w-xl rounded-[var(--radius-dialog)] border border-sand/30 bg-white p-0 text-text-primary shadow-[var(--shadow-overlay)] outline-none backdrop:bg-deep-sea/38 backdrop:backdrop-blur-[2px] dark:border-white/12 dark:bg-deep-sea dark:text-text-primary dark:backdrop:bg-black/65', className), onClick: (event) => {
|
|
25
59
|
if (event.target === dialogRef.current) {
|
|
26
|
-
|
|
60
|
+
requestClose();
|
|
27
61
|
}
|
|
28
|
-
},
|
|
62
|
+
}, onCancel: (event) => {
|
|
63
|
+
event.preventDefault();
|
|
64
|
+
requestClose();
|
|
65
|
+
}, onClose: () => {
|
|
66
|
+
if (isOpen)
|
|
67
|
+
onClose();
|
|
68
|
+
}, children: _jsxs("div", { children: [_jsxs("div", { className: 'flex items-center justify-between gap-4 border-b border-sand/20 px-6 py-5 dark:border-white/[0.08] md:px-7', children: [_jsx("h2", { id: titleId, className: 'text-xl font-semibold tracking-refined text-text-primary dark:text-text-primary', children: title }), _jsx(DialogCloseButton, { onClick: requestClose, "aria-label": 'Close' })] }), _jsx("div", { className: 'px-6 py-6 md:px-7 md:py-7', children: children })] }) }), document.body);
|
|
29
69
|
}
|
|
@@ -1,11 +1,21 @@
|
|
|
1
|
+
'use client';
|
|
1
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
3
|
import { ChevronDown } from 'lucide-react';
|
|
3
4
|
import React from 'react';
|
|
4
5
|
import { cn } from '../utils/cn.js';
|
|
6
|
+
import { usePresence } from '../utils/hooks.js';
|
|
5
7
|
import { renderDefaultLink } from './nav-menu.js';
|
|
6
8
|
function isGroup(entry) {
|
|
7
9
|
return 'items' in entry;
|
|
8
10
|
}
|
|
11
|
+
function NavigationMenuSurface({ children, open }) {
|
|
12
|
+
const { present, visible } = usePresence(open, 150);
|
|
13
|
+
if (!present)
|
|
14
|
+
return null;
|
|
15
|
+
return (_jsx("div", { className: cn('absolute left-0 top-full z-50 mt-1 min-w-[16rem] origin-top-left rounded-[var(--radius-ui)] border border-sand/35 bg-white p-1.5 shadow-[var(--shadow-overlay)] transition-[opacity,transform] dark:border-white/15 dark:bg-deep-sea', visible
|
|
16
|
+
? 'translate-y-0 scale-100 opacity-100 duration-[var(--motion-surface)] ease-premium'
|
|
17
|
+
: '-translate-y-1 scale-[0.992] opacity-0 duration-[var(--motion-exit)] ease-in'), children: children }));
|
|
18
|
+
}
|
|
9
19
|
export function NavigationMenu({ className, entries, renderLink }) {
|
|
10
20
|
const [activeIndex, setActiveIndex] = React.useState(null);
|
|
11
21
|
const linkRenderer = (renderLink ?? renderDefaultLink);
|
|
@@ -24,18 +34,18 @@ export function NavigationMenu({ className, entries, renderLink }) {
|
|
|
24
34
|
if (!isGroup(entry)) {
|
|
25
35
|
return (_jsx(React.Fragment, { children: linkRenderer({
|
|
26
36
|
item: entry,
|
|
27
|
-
className: 'px-3 py-2 text-sm font-medium text-text-secondary transition-colors duration-
|
|
37
|
+
className: 'rounded-[var(--radius-ui)] px-3 py-2 text-sm font-medium text-text-secondary transition-colors duration-[var(--motion-control)] ease-premium hover:bg-sand/10 hover:text-text-primary dark:text-text-secondary dark:hover:bg-sand/15 dark:hover:text-text-primary',
|
|
28
38
|
children: entry.label
|
|
29
39
|
}) }, entry.href));
|
|
30
40
|
}
|
|
31
41
|
const isOpen = activeIndex === i;
|
|
32
|
-
return (_jsxs("div", { className: 'relative', children: [_jsxs("button", { type: 'button', onClick: () => setActiveIndex(isOpen ? null : i), "aria-expanded": isOpen, className: cn('flex items-center gap-1 rounded-
|
|
42
|
+
return (_jsxs("div", { className: 'relative', children: [_jsxs("button", { type: 'button', onClick: () => setActiveIndex(isOpen ? null : i), "aria-expanded": isOpen, className: cn('flex translate-y-0 items-center gap-1 rounded-[var(--radius-button)] px-3 py-2 text-[13px] font-medium tracking-ui transition-[background-color,color,transform] duration-[var(--motion-control)] ease-premium active:translate-y-px focus:outline-none focus-visible:ring-2 focus-visible:ring-sea/30 dark:focus-visible:ring-accent-blue/40', isOpen
|
|
33
43
|
? '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-
|
|
44
|
+
: '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-[var(--motion-surface)] ease-premium', isOpen ? 'rotate-180' : 'rotate-0') })] }), _jsx(NavigationMenuSurface, { open: isOpen, children: entry.items.map((item) => (_jsx(React.Fragment, { children: linkRenderer({
|
|
35
45
|
item,
|
|
36
|
-
className: 'flex flex-col rounded-
|
|
46
|
+
className: 'flex flex-col rounded-[var(--radius-ui)] px-3 py-2.5 transition-colors duration-[var(--motion-control)] ease-premium hover:bg-sand/10 dark:hover:bg-sand/15',
|
|
37
47
|
children: (_jsxs(_Fragment, { children: [_jsx("span", { className: 'text-sm font-medium text-text-primary dark:text-text-primary', children: item.label }), item.description ? (_jsx("span", { className: 'mt-0.5 text-xs leading-relaxed text-text-secondary dark:text-text-secondary', children: item.description })) : null] })),
|
|
38
48
|
onClick: () => setActiveIndex(null)
|
|
39
|
-
}) }, item.href))) })
|
|
49
|
+
}) }, item.href))) })] }, entry.trigger));
|
|
40
50
|
}) }));
|
|
41
51
|
}
|
|
@@ -5,5 +5,5 @@ import { IconButton } from './icon-button.js';
|
|
|
5
5
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger } from './dropdown-menu.js';
|
|
6
6
|
export function NotificationBadge({ count = 0, items = [], onMarkAllRead, className }) {
|
|
7
7
|
const hasUnread = count > 0 || items.some((item) => item.unread);
|
|
8
|
-
return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs("div", { className: cn('relative', className), children: [_jsx(IconButton, { "aria-label": 'Notifications', children: _jsx(Bell, { size: 18 }) }), count > 0 && (_jsx("span", { className: 'absolute right-0 top-0 flex h-4 min-w-4 items-center justify-center rounded-full bg-terracotta px-1 text-[10px] font-
|
|
8
|
+
return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs("div", { className: cn('relative', className), children: [_jsx(IconButton, { "aria-label": 'Notifications', children: _jsx(Bell, { size: 18 }) }), count > 0 && (_jsx("span", { className: 'absolute right-0 top-0 flex h-4 min-w-4 items-center justify-center rounded-full bg-terracotta px-1 text-[10px] font-semibold text-white', children: count > 99 ? '99+' : count }))] }) }), _jsxs(DropdownMenuContent, { align: 'end', className: 'w-80', children: [_jsxs("div", { className: 'flex items-center justify-between px-2 py-1.5', children: [_jsx(DropdownMenuLabel, { className: 'uppercase', children: "Notifications" }), hasUnread && onMarkAllRead && (_jsx("button", { type: 'button', onClick: onMarkAllRead, className: 'text-xs 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: "Mark all read" }))] }), _jsx(DropdownMenuSeparator, {}), items.length === 0 ? (_jsx("div", { className: 'px-2 py-6 text-center text-sm text-text-secondary dark:text-text-secondary', children: "No notifications" })) : (items.map((item) => (_jsx(DropdownMenuItem, { onClick: item.onClick, className: 'flex flex-col items-start gap-0.5 py-2', children: _jsxs("div", { className: 'flex w-full items-start gap-2', children: [item.unread && _jsx("span", { className: 'mt-1.5 h-2 w-2 shrink-0 rounded-full bg-sea dark:bg-accent-blue' }), _jsxs("div", { className: 'flex-1', children: [_jsx("p", { className: cn('text-sm', item.unread && 'font-semibold'), children: item.title }), item.description && _jsx("p", { className: 'text-xs text-text-secondary dark:text-text-secondary', children: item.description }), item.timestamp && _jsx("p", { className: 'mt-1 text-xs text-text-secondary dark:text-text-secondary', children: item.timestamp })] })] }) }, item.id))))] })] }));
|
|
9
9
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
'use client';
|
|
1
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
3
|
import React from 'react';
|
|
3
4
|
import { cn } from '../utils/cn.js';
|
|
@@ -48,6 +49,6 @@ export function OtpInput({ className, disabled = false, length = 6, onChange, se
|
|
|
48
49
|
const digit = digits[i]?.trim() ?? '';
|
|
49
50
|
return (_jsx("input", { ref: (el) => {
|
|
50
51
|
inputRefs.current[i] = el;
|
|
51
|
-
}, type: secure ? 'password' : 'text', inputMode: 'numeric', maxLength: 1, value: digit, disabled: disabled, "aria-label": `Digit ${i + 1}`, onChange: (e) => handleChange(i, e.target.value), onKeyDown: (e) => handleKeyDown(i, e), onPaste: handlePaste, onFocus: (e) => e.target.select(), className: cn('h-12 w-10 rounded-
|
|
52
|
+
}, type: secure ? 'password' : 'text', inputMode: 'numeric', maxLength: 1, value: digit, disabled: disabled, "aria-label": `Digit ${i + 1}`, onChange: (e) => handleChange(i, e.target.value), onKeyDown: (e) => handleKeyDown(i, e), onPaste: handlePaste, onFocus: (e) => e.target.select(), className: cn('h-12 w-10 rounded-[var(--radius-ui)] border bg-white text-center text-lg font-semibold tracking-[0.08em] text-text-primary caret-sea shadow-[0_1px_2px_rgba(26,55,77,0.025)] outline-none transition-[border-color,box-shadow] duration-[var(--motion-control)] ease-premium dark:bg-deep-sea dark:text-text-primary dark:caret-accent-blue', digit ? 'border-sea/60 dark:border-accent-blue/65' : 'border-sand/40 dark:border-white/15', 'focus:border-sea focus:ring-2 focus:ring-sea/12 dark:focus:border-accent-blue dark:focus:ring-accent-blue/15', disabled && 'cursor-not-allowed opacity-50') }, i));
|
|
52
53
|
}) }));
|
|
53
54
|
}
|
|
@@ -4,5 +4,5 @@ import { cn } from '../utils/cn.js';
|
|
|
4
4
|
import { Button } from './button.js';
|
|
5
5
|
export function PageHeader({ title, description, breadcrumbs, actions, backHref, onBack, className }) {
|
|
6
6
|
const showBack = Boolean(backHref || onBack);
|
|
7
|
-
return (_jsxs("
|
|
7
|
+
return (_jsxs("header", { className: cn('space-y-5', className), children: [breadcrumbs && _jsx("div", { className: 'text-sm text-text-secondary dark:text-text-secondary', children: breadcrumbs }), _jsxs("div", { className: 'flex flex-col gap-7 sm:flex-row sm:items-start sm:justify-between', children: [_jsxs("div", { className: 'flex items-start gap-4', children: [showBack && (_jsx(Button, { variant: 'ghost', size: 'sm', className: 'mt-0.5 h-8 w-8 p-0', onClick: onBack, as: backHref ? 'a' : 'button', href: backHref, children: _jsx(ChevronLeft, { size: 18 }) })), _jsxs("div", { children: [_jsx("h1", { className: 'text-[2rem] font-semibold leading-[1.15] tracking-refined text-text-primary dark:text-text-primary', children: title }), description && _jsx("p", { className: 'font-secondary mt-2.5 max-w-2xl text-sm leading-6 text-text-secondary dark:text-text-secondary', children: description })] })] }), actions && _jsx("div", { className: 'flex flex-wrap items-center gap-3', children: actions })] })] }));
|
|
8
8
|
}
|
|
@@ -17,7 +17,7 @@ export function Pagination({ className, currentPage, hasNextPage, hasPrevPage, o
|
|
|
17
17
|
}
|
|
18
18
|
return currentPage - 3 + index;
|
|
19
19
|
});
|
|
20
|
-
return (_jsxs("
|
|
21
|
-
? 'bg-sea text-white dark:bg-accent-blue'
|
|
22
|
-
: 'border
|
|
20
|
+
return (_jsxs("nav", { "aria-label": 'Pagination', className: cn('mt-8 flex items-center justify-center gap-1.5', className), children: [_jsx("button", { type: 'button', onClick: () => onPageChange(currentPage - 1), disabled: !hasPrevPage, className: 'flex h-9 w-9 scale-100 items-center justify-center rounded-[var(--radius-button)] border border-sand/30 bg-white transition-[background-color,border-color,color,transform,opacity] duration-[var(--motion-control)] ease-premium hover:border-sand/60 hover:bg-light-sand/50 active:scale-[0.96] disabled:cursor-not-allowed disabled:transform-none disabled:opacity-40 dark:border-white/15 dark:bg-deep-sea dark:hover:bg-white/[0.06]', title: 'Previous page', children: _jsx(ChevronLeft, { size: 20 }) }), _jsx("div", { className: 'flex items-center gap-1', children: visiblePages.map((pageNumber) => (_jsx("button", { type: 'button', onClick: () => onPageChange(pageNumber), className: cn('flex h-9 min-w-9 scale-100 items-center justify-center rounded-[var(--radius-button)] border px-2.5 text-[13px] font-medium tabular-nums transition-[background-color,border-color,color,transform] duration-[var(--motion-control)] ease-premium active:scale-[0.96]', pageNumber === currentPage
|
|
21
|
+
? 'border-sea bg-sea text-white dark:border-accent-blue dark:bg-accent-blue dark:text-deep-sea'
|
|
22
|
+
: 'border-transparent bg-white text-text-secondary hover:border-sand/30 hover:bg-light-sand/50 hover:text-text-primary dark:bg-deep-sea dark:text-text-secondary dark:hover:border-white/15 dark:hover:bg-white/[0.06]'), children: pageNumber }, pageNumber))) }), _jsx("button", { type: 'button', onClick: () => onPageChange(currentPage + 1), disabled: !hasNextPage, className: 'flex h-9 w-9 scale-100 items-center justify-center rounded-[var(--radius-button)] border border-sand/30 bg-white transition-[background-color,border-color,color,transform,opacity] duration-[var(--motion-control)] ease-premium hover:border-sand/60 hover:bg-light-sand/50 active:scale-[0.96] disabled:cursor-not-allowed disabled:transform-none disabled:opacity-40 dark:border-white/15 dark:bg-deep-sea dark:hover:bg-white/[0.06]', title: 'Next page', children: _jsx(ChevronRight, { size: 20 }) })] }));
|
|
23
23
|
}
|
package/dist/components/panel.js
CHANGED
|
@@ -7,5 +7,5 @@ export function Panel({ accent, children, className, count, dragHandle, filter,
|
|
|
7
7
|
...(widthValue ? { width: widthValue, minWidth: widthValue } : {}),
|
|
8
8
|
borderLeftColor: accent ?? 'var(--color-sea)'
|
|
9
9
|
};
|
|
10
|
-
return (_jsxs("div", { className: cn('group flex
|
|
10
|
+
return (_jsxs("div", { className: cn('group flex h-full min-h-0 flex-col overflow-hidden transition-[border-color] duration-200', 'border-l-2 border-r border-r-sand/20 border-y-0 rounded-none bg-transparent shadow-none dark:border-r-white/[0.06]', className), style: accentStyle, children: [_jsxs("div", { className: cn('relative z-10 flex flex-col bg-white dark:bg-deep-sea', 'select-none border-b border-black/[0.06] dark:border-white/[0.08]'), children: [_jsxs("div", { className: 'flex min-h-14 items-center gap-3 px-5 py-3.5', children: [dragHandle ? (_jsx("span", { className: 'cursor-grab text-black/40 transition-colors duration-[var(--motion-control)] ease-premium hover:text-black/80 active:cursor-grabbing dark:text-white/40 dark:hover:text-white/80', children: dragHandle })) : null, _jsx("span", { className: 'h-1.5 w-1.5 flex-shrink-0 rounded-full opacity-80', style: { backgroundColor: accent ?? 'var(--color-sea)', color: accent ?? 'var(--color-sea)' } }), _jsx("span", { className: 'flex-1 text-[11px] font-semibold uppercase tracking-[0.1em] text-[color:var(--panel-accent,var(--color-sea))]', children: title }), count !== undefined ? (_jsx("span", { className: 'rounded-[5px] border border-sand/30 bg-light-sand/40 px-2 py-0.5 text-[11px] font-semibold tabular-nums text-text-primary dark:border-white/10 dark:bg-white/5', 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-sand/20 bg-light-sand/20 px-5 py-3 dark:border-white/[0.06] dark:bg-white/[0.03]', children: toolbar })) : null] }), _jsx("div", { className: 'flex-1 min-h-0 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
11
|
}
|
|
@@ -6,9 +6,10 @@ export interface PopoverProps {
|
|
|
6
6
|
children: React.ReactNode;
|
|
7
7
|
className?: string;
|
|
8
8
|
content: React.ReactNode;
|
|
9
|
-
|
|
9
|
+
defaultOpen?: boolean;
|
|
10
10
|
open?: boolean;
|
|
11
11
|
onOpenChange?: (open: boolean) => void;
|
|
12
12
|
side?: PopoverSide;
|
|
13
|
+
sideOffset?: number;
|
|
13
14
|
}
|
|
14
|
-
export declare function Popover({ align, children, className, content, onOpenChange, open
|
|
15
|
+
export declare function Popover({ align, children, className, content, defaultOpen, onOpenChange, open, side, sideOffset }: PopoverProps): import("react/jsx-runtime").JSX.Element;
|