@gaulatti/bleecker 0.1.41 → 0.1.44
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/LICENSE +21 -0
- package/README.md +116 -1
- package/dist/components/alert-dialog.js +7 -42
- package/dist/components/alert.js +0 -7
- package/dist/components/breadcrumb.js +1 -1
- package/dist/components/button.js +2 -2
- package/dist/components/chart-theme.d.ts +1 -1
- package/dist/components/command-spotlight.d.ts +2 -1
- package/dist/components/command-spotlight.js +35 -62
- package/dist/components/context-menu.d.ts +1 -1
- package/dist/components/context-menu.js +8 -2
- package/dist/components/dashboard-grid.d.ts +1 -1
- package/dist/components/dashboard-section.d.ts +1 -1
- package/dist/components/data-list.d.ts +1 -1
- package/dist/components/data-table-filters.d.ts +1 -1
- package/dist/components/data-table-toolbar.d.ts +1 -1
- package/dist/components/data-table.js +1 -1
- package/dist/components/drawer.js +2 -2
- package/dist/components/dropdown-menu.d.ts +1 -1
- package/dist/components/dropdown-menu.js +13 -3
- package/dist/components/error-state.d.ts +1 -1
- package/dist/components/eyebrow.d.ts +1 -1
- package/dist/components/feed-item.js +4 -11
- package/dist/components/icon-badge.d.ts +1 -1
- package/dist/components/icon-button.js +1 -1
- package/dist/components/input.js +1 -1
- package/dist/components/label.d.ts +1 -1
- package/dist/components/label.js +1 -1
- package/dist/components/loading-overlay.d.ts +1 -1
- package/dist/components/media-library.js +2 -4
- package/dist/components/metric.d.ts +1 -1
- package/dist/components/metric.js +1 -1
- package/dist/components/modal.js +7 -57
- package/dist/components/page-header.d.ts +1 -1
- package/dist/components/popover.js +3 -1
- package/dist/components/progress.js +2 -1
- package/dist/components/sankey-chart.js +1 -1
- package/dist/components/search-input.d.ts +1 -1
- package/dist/components/search-input.js +1 -1
- package/dist/components/select.js +4 -2
- package/dist/components/sheet.js +2 -2
- package/dist/components/sidebar.d.ts +1 -1
- package/dist/components/sidebar.js +1 -1
- package/dist/components/skeleton.d.ts +1 -1
- package/dist/components/stat-card.d.ts +1 -1
- package/dist/components/sunburst-chart.js +1 -1
- package/dist/components/table.js +3 -16
- package/dist/components/textarea.js +1 -1
- package/dist/components/timeline.d.ts +1 -1
- package/dist/components/tooltip.js +3 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/layout/admin-shell.d.ts +1 -1
- package/dist/layout/auth-shell.d.ts +8 -1
- package/dist/layout/auth-shell.js +8 -1
- package/dist/layout/panel-layout.js +0 -4
- package/dist/styles.css +1 -1
- package/dist/theme/theme-provider.d.ts +2 -2
- package/dist/theme/theme-provider.js +16 -20
- package/dist/theme/theme-script.d.ts +1 -1
- package/dist/theme/theme-script.js +1 -1
- package/dist/theme/types.d.ts +11 -0
- package/dist/utils/attention-color.js +4 -4
- package/dist/utils/avatar-initial.d.ts +1 -0
- package/dist/utils/avatar-initial.js +3 -0
- package/dist/utils/clamp-percent.d.ts +1 -0
- package/dist/utils/clamp-percent.js +3 -0
- package/dist/utils/format.js +17 -14
- package/dist/utils/hooks.d.ts +14 -3
- package/dist/utils/hooks.js +209 -43
- package/dist/utils/source-label.d.ts +1 -0
- package/dist/utils/source-label.js +9 -0
- package/package.json +14 -5
|
@@ -4,7 +4,7 @@ import { Minus } from 'lucide-react';
|
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { createPortal } from 'react-dom';
|
|
6
6
|
import { cn } from '../utils/cn.js';
|
|
7
|
-
import { useModalLayer, usePresence } from '../utils/hooks.js';
|
|
7
|
+
import { ModalLayerScope, useModalLayer, usePresence } from '../utils/hooks.js';
|
|
8
8
|
export function Drawer({ children, className, description, isOpen, onClose, title }) {
|
|
9
9
|
const { present, visible } = usePresence(isOpen, 180);
|
|
10
10
|
const startYRef = React.useRef(null);
|
|
@@ -24,5 +24,5 @@ export function Drawer({ children, className, description, isOpen, onClose, titl
|
|
|
24
24
|
};
|
|
25
25
|
if (typeof document === 'undefined' || !present)
|
|
26
26
|
return null;
|
|
27
|
-
return createPortal(_jsxs("div", { className: 'fixed inset-0 z-50', children: [_jsx("div", { className: cn('absolute inset-0 bg-deep-sea/38 backdrop-blur-[2px] transition-opacity ease-premium dark:bg-black/65', visible ? 'duration-[var(--motion-overlay)]' : 'duration-[180ms] ease-in', visible ? 'opacity-100' : 'opacity-0'), onClick: onClose, "aria-hidden": 'true' }), _jsxs("div", { ref: panelRef, role: 'dialog', "aria-modal": 'true', "aria-label": title ? undefined : 'Dialog', "aria-labelledby": title ? titleId : undefined, "aria-describedby": description ? descriptionId : undefined, tabIndex: -1, onTouchStart: handleTouchStart, onTouchEnd: handleTouchEnd, className: cn('absolute inset-x-0 bottom-0 flex max-h-[90dvh] flex-col rounded-t-[var(--radius-dialog)] border-t border-sand/30 bg-white shadow-[var(--shadow-overlay)] transition-transform dark:border-white/12 dark:bg-deep-sea', visible ? 'duration-[var(--motion-overlay)] ease-premium' : 'duration-[180ms] ease-in', visible ? 'translate-y-0' : 'translate-y-full', className), children: [_jsx("div", { className: 'flex items-center justify-center pt-3 pb-1', children: _jsx(Minus, { size: 24, className: 'text-sand/40 dark:text-sand/50', strokeWidth: 3, "aria-hidden": 'true' }) }), (title || description) && (_jsxs("div", { className: 'px-6 pb-4 pt-1', children: [title ? _jsx("h2", { id: titleId, className: 'text-lg font-medium text-text-primary dark:text-text-primary', children: title }) : null, description ? _jsx("p", { id: descriptionId, className: 'font-secondary mt-2 text-sm leading-relaxed text-text-secondary dark:text-text-secondary', children: description }) : null] })), _jsx("div", { className: 'flex-1 overflow-y-auto px-6 pb-6 pt-0', children: children })] })] }), document.body);
|
|
27
|
+
return createPortal(_jsx(ModalLayerScope, { layerRef: panelRef, children: _jsxs("div", { "data-bleecker-modal-overlay": true, className: cn('fixed inset-0 z-50', !isOpen && 'pointer-events-none'), "aria-hidden": !isOpen || undefined, children: [_jsx("div", { className: cn('absolute inset-0 bg-deep-sea/38 backdrop-blur-[2px] transition-opacity ease-premium dark:bg-black/65', visible ? 'duration-[var(--motion-overlay)]' : 'duration-[180ms] ease-in', visible ? 'opacity-100' : 'opacity-0'), onClick: onClose, "aria-hidden": 'true' }), _jsxs("div", { ref: panelRef, role: 'dialog', "aria-modal": 'true', "aria-label": title ? undefined : 'Dialog', "aria-labelledby": title ? titleId : undefined, "aria-describedby": description ? descriptionId : undefined, tabIndex: -1, onTouchStart: handleTouchStart, onTouchEnd: handleTouchEnd, className: cn('absolute inset-x-0 bottom-0 flex max-h-[90dvh] flex-col rounded-t-[var(--radius-dialog)] border-t border-sand/30 bg-white shadow-[var(--shadow-overlay)] transition-transform dark:border-white/12 dark:bg-deep-sea', visible ? 'duration-[var(--motion-overlay)] ease-premium' : 'duration-[180ms] ease-in', visible ? 'translate-y-0' : 'translate-y-full', className), children: [_jsx("div", { className: 'flex items-center justify-center pt-3 pb-1', children: _jsx(Minus, { size: 24, className: 'text-sand/40 dark:text-sand/50', strokeWidth: 3, "aria-hidden": 'true' }) }), (title || description) && (_jsxs("div", { className: 'px-6 pb-4 pt-1', children: [title ? _jsx("h2", { id: titleId, className: 'text-lg font-medium text-text-primary dark:text-text-primary', children: title }) : null, description ? _jsx("p", { id: descriptionId, className: 'font-secondary mt-2 text-sm leading-relaxed text-text-secondary dark:text-text-secondary', children: description }) : null] })), _jsx("div", { className: 'flex-1 overflow-y-auto px-6 pb-6 pt-0', children: children })] })] }) }), document.body);
|
|
28
28
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
3
3
|
declare const DropdownMenu: React.FC<DropdownMenuPrimitive.DropdownMenuProps>;
|
|
4
4
|
declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import React from 'react';
|
|
3
3
|
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
4
4
|
import { Check, ChevronRight, Circle } from 'lucide-react';
|
|
5
5
|
import { cn } from '../utils/cn.js';
|
|
6
|
+
import { useModalBranch } from '../utils/hooks.js';
|
|
7
|
+
import { useComposedRefs } from '@radix-ui/react-compose-refs';
|
|
6
8
|
const DropdownMenu = DropdownMenuPrimitive.Root;
|
|
7
9
|
const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
8
10
|
const DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
@@ -11,9 +13,17 @@ const DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
|
11
13
|
const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
12
14
|
const DropdownMenuSubTrigger = React.forwardRef(({ className, inset, children, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.SubTrigger, { ref: ref, className: cn('flex cursor-default select-none items-center rounded-[var(--radius-ui)] px-2 py-1.5 text-sm text-text-primary outline-none transition-colors duration-[var(--motion-control)] ease-premium focus:bg-sand/10 data-[state=open]:bg-sand/10 dark:text-text-primary dark:focus:bg-sand/15', inset && 'pl-8', className), ...props, children: [children, _jsx(ChevronRight, { size: 16, className: 'ml-auto' })] })));
|
|
13
15
|
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
14
|
-
const DropdownMenuSubContent = React.forwardRef(({ className, ...props }, ref) =>
|
|
16
|
+
const DropdownMenuSubContent = React.forwardRef(({ className, ...props }, ref) => {
|
|
17
|
+
const branchRef = useModalBranch();
|
|
18
|
+
const composedRef = useComposedRefs(ref, branchRef);
|
|
19
|
+
return (_jsx(DropdownMenuPrimitive.SubContent, { ref: composedRef, className: cn('z-50 min-w-[9rem] overflow-hidden rounded-[var(--radius-ui)] border border-sand/35 bg-card p-1.5 shadow-[var(--shadow-overlay)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-[0.99] data-[state=open]:zoom-in-[0.99] data-[state=open]:duration-[var(--motion-surface)] data-[state=closed]:duration-[var(--motion-exit)] data-[state=open]:ease-premium data-[state=closed]:ease-in dark:border-white/15 dark:bg-deep-sea', className), ...props }));
|
|
20
|
+
});
|
|
15
21
|
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
16
|
-
const DropdownMenuContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) =>
|
|
22
|
+
const DropdownMenuContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => {
|
|
23
|
+
const branchRef = useModalBranch();
|
|
24
|
+
const composedRef = useComposedRefs(ref, branchRef);
|
|
25
|
+
return (_jsx(DropdownMenuPrimitive.Portal, { children: _jsx(DropdownMenuPrimitive.Content, { ref: composedRef, sideOffset: sideOffset, className: cn('z-50 min-w-[11rem] overflow-hidden rounded-[var(--radius-ui)] border border-sand/35 bg-card p-1.5 shadow-[var(--shadow-overlay)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-[0.99] data-[state=open]:zoom-in-[0.99] data-[state=open]:duration-[var(--motion-surface)] data-[state=closed]:duration-[var(--motion-exit)] data-[state=open]:ease-premium data-[state=closed]:ease-in dark:border-white/15 dark:bg-deep-sea', className), ...props }) }));
|
|
26
|
+
});
|
|
17
27
|
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
18
28
|
const DropdownMenuItem = React.forwardRef(({ className, inset, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Item, { ref: ref, className: cn('relative flex cursor-pointer select-none items-center rounded-[var(--radius-ui)] px-2 py-1.5 text-sm text-text-primary outline-none transition-colors duration-[var(--motion-control)] ease-premium focus:bg-sand/10 focus:text-text-primary data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:text-text-primary dark:focus:bg-sand/15', inset && 'pl-8', className), ...props })));
|
|
19
29
|
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
@@ -2,7 +2,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { ExternalLink } from 'lucide-react';
|
|
3
3
|
import { Avatar } from './avatar.js';
|
|
4
4
|
import { Tooltip } from './tooltip.js';
|
|
5
|
+
import { avatarInitial } from '../utils/avatar-initial.js';
|
|
5
6
|
import { cn } from '../utils/cn.js';
|
|
7
|
+
import { describeSource } from '../utils/source-label.js';
|
|
6
8
|
function formatPostedAt(postedAt) {
|
|
7
9
|
const dateValue = postedAt instanceof Date ? postedAt : new Date(postedAt);
|
|
8
10
|
if (Number.isNaN(dateValue.getTime())) {
|
|
@@ -33,23 +35,14 @@ function formatIsoTimestamp(postedAt) {
|
|
|
33
35
|
function normalizeCategory(category) {
|
|
34
36
|
return category.trim().toLowerCase();
|
|
35
37
|
}
|
|
36
|
-
function normalizeSourceLabel(sourceUrl) {
|
|
37
|
-
try {
|
|
38
|
-
const parsed = new URL(sourceUrl);
|
|
39
|
-
return parsed.hostname;
|
|
40
|
-
}
|
|
41
|
-
catch {
|
|
42
|
-
return 'Source article';
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
38
|
function formatRelevance(relevance) {
|
|
46
39
|
return String(Math.round(relevance));
|
|
47
40
|
}
|
|
48
41
|
export function FeedItem({ author, avatarSrc, categories = [], className, content, init, language, postedAt, relevance, sourceUrl }) {
|
|
49
|
-
const fallback =
|
|
42
|
+
const fallback = avatarInitial(author, init);
|
|
50
43
|
const postedAtLabel = formatPostedAt(postedAt);
|
|
51
44
|
const postedAtIsoLabel = formatIsoTimestamp(postedAt);
|
|
52
|
-
const sourceLabel =
|
|
45
|
+
const sourceLabel = describeSource(sourceUrl);
|
|
53
46
|
const safeCategories = categories
|
|
54
47
|
.map(normalizeCategory)
|
|
55
48
|
.filter((value) => value.length > 0);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type
|
|
2
|
+
import { type IconBadgeSize, type IconBadgeVariant } from '../core';
|
|
3
3
|
export type { IconBadgeSize, IconBadgeVariant } from '../core';
|
|
4
4
|
export interface IconBadgeProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
5
|
size?: IconBadgeSize;
|
|
@@ -3,5 +3,5 @@ import React from 'react';
|
|
|
3
3
|
import { cn } from '../utils/cn.js';
|
|
4
4
|
const sizes = { sm: 'h-8 w-8', md: 'h-10 w-10', lg: 'h-11 w-11' };
|
|
5
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
|
|
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 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 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 }));
|
|
7
7
|
});
|
package/dist/components/input.js
CHANGED
|
@@ -7,5 +7,5 @@ const sizeClasses = {
|
|
|
7
7
|
lg: 'h-11 px-4 text-[15px]'
|
|
8
8
|
};
|
|
9
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
|
|
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 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
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
3
3
|
declare const Label: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & React.RefAttributes<HTMLLabelElement>>;
|
|
4
4
|
export { Label };
|
package/dist/components/label.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import React from 'react';
|
|
3
3
|
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
4
4
|
import { cn } from '../utils/cn.js';
|
|
5
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 })));
|
|
@@ -13,12 +13,10 @@ export function MediaLibrary({ actions, className, emptyMessage = 'No media foun
|
|
|
13
13
|
onCopy(text);
|
|
14
14
|
return;
|
|
15
15
|
}
|
|
16
|
-
|
|
17
|
-
void navigator.clipboard.writeText(text);
|
|
18
|
-
}
|
|
16
|
+
void navigator.clipboard.writeText(text);
|
|
19
17
|
};
|
|
20
18
|
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) => {
|
|
21
19
|
event.stopPropagation();
|
|
22
20
|
onDelete(media.id);
|
|
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
|
|
21
|
+
}, 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 })] }));
|
|
24
22
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
3
|
+
import React from 'react';
|
|
4
4
|
import { cn } from '../utils/cn.js';
|
|
5
5
|
import { formatNumber, formatCurrency, formatPercent, formatCompactNumber } from '../utils/format.js';
|
|
6
6
|
export function Metric({ value, format = 'number', currency = 'USD', className, prefix, suffix, decimals }) {
|
package/dist/components/modal.js
CHANGED
|
@@ -4,66 +4,16 @@ import React from 'react';
|
|
|
4
4
|
import { createPortal } from 'react-dom';
|
|
5
5
|
import { DialogCloseButton } from './dialog-close-button.js';
|
|
6
6
|
import { cn } from '../utils/cn.js';
|
|
7
|
+
import { ModalLayerScope, useModalLayer, usePresence } from '../utils/hooks.js';
|
|
7
8
|
export function Modal({ children, className, isOpen, onClose, title }) {
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const openTimerRef = React.useRef(null);
|
|
9
|
+
const { present: isPresent, visible } = usePresence(isOpen, 150);
|
|
10
|
+
const dialogRef = useModalLayer(isOpen, onClose);
|
|
11
11
|
const titleId = React.useId();
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
if (isOpen) {
|
|
16
|
-
if (closeTimerRef.current)
|
|
17
|
-
clearTimeout(closeTimerRef.current);
|
|
18
|
-
setIsPresent(true);
|
|
19
|
-
setMotionState('opening');
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
if (isPresent) {
|
|
23
|
-
setMotionState('closing');
|
|
24
|
-
closeTimerRef.current = setTimeout(() => {
|
|
25
|
-
dialogRef.current?.close();
|
|
26
|
-
setIsPresent(false);
|
|
27
|
-
}, 150);
|
|
28
|
-
}
|
|
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
|
-
};
|
|
12
|
+
const motionState = visible ? 'open' : 'closing';
|
|
13
|
+
const requestClose = () => { if (isOpen)
|
|
14
|
+
onClose(); };
|
|
55
15
|
if (typeof document === 'undefined' || !isPresent) {
|
|
56
16
|
return null;
|
|
57
17
|
}
|
|
58
|
-
return createPortal(_jsx("
|
|
59
|
-
if (event.target === dialogRef.current) {
|
|
60
|
-
requestClose();
|
|
61
|
-
}
|
|
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);
|
|
18
|
+
return createPortal(_jsx(ModalLayerScope, { layerRef: dialogRef, children: _jsxs("div", { "data-bleecker-modal-overlay": true, className: cn('fixed inset-0 z-50 flex p-4', !isOpen && 'pointer-events-none'), "aria-hidden": !isOpen || undefined, children: [_jsx("div", { "aria-hidden": 'true', onClick: requestClose, className: cn('absolute inset-0 bg-deep-sea/38 backdrop-blur-[2px] transition-opacity dark:bg-black/65', visible ? 'opacity-100 duration-[var(--motion-control)]' : 'opacity-0 duration-[var(--motion-exit)]') }), _jsx("div", { ref: dialogRef, role: 'dialog', "aria-modal": 'true', "aria-labelledby": titleId, tabIndex: -1, "data-state": motionState, className: cn('modal-motion relative m-auto max-h-[calc(100dvh-2rem)] w-full max-w-xl overflow-auto rounded-[var(--radius-dialog)] border border-sand/30 bg-white p-0 text-text-primary shadow-[var(--shadow-overlay)] outline-none dark:border-white/12 dark:bg-deep-sea dark:text-text-primary', className), 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);
|
|
69
19
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
3
3
|
import { cn } from '../utils/cn.js';
|
|
4
|
+
import { useModalBranch } from '../utils/hooks.js';
|
|
4
5
|
export function Popover({ align = 'center', children, className, content, defaultOpen, onOpenChange, open, side = 'bottom', sideOffset = 4 }) {
|
|
5
|
-
|
|
6
|
+
const branchRef = useModalBranch();
|
|
7
|
+
return (_jsxs(PopoverPrimitive.Root, { defaultOpen: defaultOpen, onOpenChange: onOpenChange, open: open, children: [_jsx(PopoverPrimitive.Trigger, { asChild: true, children: children }), _jsx(PopoverPrimitive.Portal, { children: _jsx(PopoverPrimitive.Content, { ref: branchRef, align: align, side: side, sideOffset: sideOffset, collisionPadding: 12, className: cn('z-50 min-w-56 rounded-[var(--radius-ui)] border border-sand/35 bg-white p-2 text-text-primary shadow-[var(--shadow-overlay)] outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0 data-[state=open]:zoom-in-[0.99] data-[state=closed]:zoom-out-[0.99] data-[state=open]:duration-[var(--motion-surface)] data-[state=closed]:duration-[var(--motion-exit)] data-[state=open]:ease-premium data-[state=closed]:ease-in dark:border-white/15 dark:bg-deep-sea dark:text-text-primary', className), children: content }) })] }));
|
|
6
8
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { clampPercent } from '../utils/clamp-percent.js';
|
|
2
3
|
import { cn } from '../utils/cn.js';
|
|
3
4
|
const sizeClasses = {
|
|
4
5
|
sm: 'h-1.5',
|
|
@@ -12,6 +13,6 @@ const variantFill = {
|
|
|
12
13
|
destructive: 'bg-terracotta'
|
|
13
14
|
};
|
|
14
15
|
export function Progress({ className, max = 100, showLabel = false, size = 'md', value = 0, variant = 'default', ...props }) {
|
|
15
|
-
const pct =
|
|
16
|
+
const pct = clampPercent(value, max);
|
|
16
17
|
return (_jsxs("div", { className: cn('flex items-center gap-3', className), ...props, children: [_jsx("div", { role: 'progressbar', "aria-valuenow": value, "aria-valuemin": 0, "aria-valuemax": max, className: cn('flex-1 overflow-hidden rounded-full bg-sand/15 dark:bg-sand/20', sizeClasses[size]), children: _jsx("div", { className: cn('h-full rounded-full transition-[width] duration-[var(--motion-overlay)] ease-premium', variantFill[variant]), style: { width: `${pct}%` } }) }), showLabel && (_jsxs("span", { className: 'min-w-[2.5rem] text-right text-xs font-medium tabular-nums text-text-secondary dark:text-text-primary', children: [Math.round(pct), "%"] }))] }));
|
|
17
18
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
3
|
+
import React from 'react';
|
|
4
4
|
import { ResponsiveContainer, Sankey as RechartsSankey, Tooltip } from 'recharts';
|
|
5
5
|
import { cn } from '../utils/cn.js';
|
|
6
6
|
import { chartTheme } from './chart-theme.js';
|
|
@@ -3,6 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
4
4
|
import { Check, ChevronDown, ChevronUp } from 'lucide-react';
|
|
5
5
|
import { cn } from '../utils/cn.js';
|
|
6
|
+
import { useModalBranch } from '../utils/hooks.js';
|
|
6
7
|
const EMPTY_OPTION_VALUE = '__bleecker_empty_option__';
|
|
7
8
|
const triggerSizeClasses = {
|
|
8
9
|
sm: 'h-9 gap-2 px-3 text-[13px]',
|
|
@@ -11,6 +12,7 @@ const triggerSizeClasses = {
|
|
|
11
12
|
};
|
|
12
13
|
export function Select({ 'aria-label': ariaLabel, 'aria-describedby': ariaDescribedBy, autoFocus, className, contentClassName, disabled = false, error = false, id, name, onChange, options, placeholder = 'Select…', required, size = 'md', startIcon, value }) {
|
|
13
14
|
const hasEmptyOption = options.some((option) => option.value === '');
|
|
14
|
-
const internalValue = value === '' && hasEmptyOption ? EMPTY_OPTION_VALUE : value
|
|
15
|
-
|
|
15
|
+
const internalValue = value === '' && hasEmptyOption ? EMPTY_OPTION_VALUE : value;
|
|
16
|
+
const branchRef = useModalBranch();
|
|
17
|
+
return (_jsxs(SelectPrimitive.Root, { disabled: disabled, name: name, required: required, value: internalValue, onValueChange: (nextValue) => onChange(nextValue === EMPTY_OPTION_VALUE ? '' : nextValue), children: [_jsxs(SelectPrimitive.Trigger, { id: id, autoFocus: autoFocus, "aria-label": ariaLabel ?? placeholder, "aria-describedby": ariaDescribedBy, "aria-invalid": error || undefined, className: cn('flex w-full items-center rounded-[var(--radius-ui)] border border-sand/40 bg-white text-left 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 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 data-[state=open]:border-sea/70 data-[state=open]:ring-2 data-[state=open]:ring-sea/10 data-[disabled]:cursor-not-allowed data-[disabled]:bg-light-sand/65 data-[disabled]:opacity-60 dark:border-white/15 dark:bg-deep-sea dark:text-text-primary dark:hover:border-white/25 dark:focus:border-accent-blue dark:focus:ring-accent-blue/12 dark:data-[state=open]:border-accent-blue dark:data-[state=open]:ring-accent-blue/12', triggerSizeClasses[size], error && 'border-terracotta focus:border-terracotta focus:ring-terracotta/15 dark:border-terracotta', className), children: [startIcon ? _jsx("span", { className: 'flex shrink-0 items-center text-sea dark:text-accent-blue', "aria-hidden": 'true', children: startIcon }) : null, _jsx("span", { className: 'min-w-0 flex-1 truncate', children: _jsx(SelectPrimitive.Value, { placeholder: placeholder }) }), _jsx(SelectPrimitive.Icon, { asChild: true, children: _jsx(ChevronDown, { size: 17, className: 'shrink-0 text-text-secondary', "aria-hidden": 'true' }) })] }), _jsx(SelectPrimitive.Portal, { children: _jsxs(SelectPrimitive.Content, { ref: branchRef, position: 'popper', side: 'bottom', align: 'start', sideOffset: 4, collisionPadding: 8, sticky: 'always', updatePositionStrategy: 'always', className: cn('z-50 w-[var(--radix-select-trigger-width)] overflow-hidden rounded-[var(--radius-ui)] border border-sand/40 bg-white shadow-[var(--shadow-overlay)] outline-none data-[side=bottom]:origin-top data-[side=top]:origin-bottom data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0 data-[state=open]:zoom-in-[0.99] data-[state=closed]:zoom-out-[0.99] data-[state=open]:duration-[var(--motion-surface)] data-[state=closed]:duration-[var(--motion-exit)] data-[state=open]:ease-premium data-[state=closed]:ease-in dark:border-white/15 dark:bg-deep-sea', contentClassName), children: [_jsx(SelectPrimitive.ScrollUpButton, { className: 'flex h-7 items-center justify-center border-b border-sand/15 bg-white text-text-secondary dark:border-white/10 dark:bg-deep-sea', children: _jsx(ChevronUp, { size: 15, "aria-hidden": 'true' }) }), _jsx(SelectPrimitive.Viewport, { className: 'max-h-[min(18rem,var(--radix-select-content-available-height))] p-1', children: options.map((option) => (_jsxs(SelectPrimitive.Item, { value: option.value === '' ? EMPTY_OPTION_VALUE : option.value, disabled: option.disabled, className: cn('relative flex cursor-default select-none items-center rounded-[5px] pl-3 pr-9 text-text-primary outline-none transition-[background-color,color,opacity] duration-[var(--motion-control)] ease-premium data-[disabled]:pointer-events-none data-[highlighted]:bg-light-sand data-[disabled]:opacity-40 data-[state=checked]:font-medium data-[state=checked]:text-sea dark:text-text-primary dark:data-[highlighted]:bg-white/[0.07] dark:data-[state=checked]:text-accent-blue', size === 'sm' ? 'min-h-8 py-1.5 text-[13px]' : size === 'lg' ? 'min-h-10 py-2 text-[15px]' : 'min-h-9 py-1.5 text-sm'), children: [_jsx(SelectPrimitive.ItemText, { children: option.label }), _jsx(SelectPrimitive.ItemIndicator, { className: 'absolute right-3 inline-flex items-center', children: _jsx(Check, { size: 15, "aria-hidden": 'true' }) })] }, option.value))) }), _jsx(SelectPrimitive.ScrollDownButton, { className: 'flex h-7 items-center justify-center border-t border-sand/15 bg-white text-text-secondary dark:border-white/10 dark:bg-deep-sea', children: _jsx(ChevronDown, { size: 15, "aria-hidden": 'true' }) })] }) })] }));
|
|
16
18
|
}
|
package/dist/components/sheet.js
CHANGED
|
@@ -4,7 +4,7 @@ import React from 'react';
|
|
|
4
4
|
import { createPortal } from 'react-dom';
|
|
5
5
|
import { DialogCloseButton } from './dialog-close-button.js';
|
|
6
6
|
import { cn } from '../utils/cn.js';
|
|
7
|
-
import { useModalLayer, usePresence } from '../utils/hooks.js';
|
|
7
|
+
import { ModalLayerScope, useModalLayer, usePresence } from '../utils/hooks.js';
|
|
8
8
|
const sideStyles = {
|
|
9
9
|
right: {
|
|
10
10
|
panel: 'inset-y-0 right-0 h-full w-full max-w-sm',
|
|
@@ -35,5 +35,5 @@ export function Sheet({ children, className, description, isOpen, onClose, scrol
|
|
|
35
35
|
const panelRef = useModalLayer(isOpen, onClose);
|
|
36
36
|
if (typeof document === 'undefined' || !present)
|
|
37
37
|
return null;
|
|
38
|
-
return createPortal(_jsxs("div", { className: 'fixed inset-0 z-50 flex', children: [_jsx("div", { className: cn('absolute inset-0 bg-deep-sea/38 backdrop-blur-[2px] transition-opacity dark:bg-black/65', visible ? 'opacity-100 duration-[var(--motion-overlay)] ease-premium' : 'opacity-0 duration-[180ms] ease-in'), onClick: onClose, "aria-hidden": 'true' }), _jsx("div", { ref: panelRef, role: 'dialog', "aria-modal": 'true', "aria-label": title ? undefined : 'Dialog', "aria-labelledby": title ? titleId : undefined, "aria-describedby": description ? descriptionId : undefined, tabIndex: -1, className: cn('absolute flex flex-col overflow-hidden border border-sand/30 bg-white text-text-primary shadow-[var(--shadow-overlay)] outline-none transition-transform dark:border-white/12 dark:bg-deep-sea dark:text-text-primary', panel, visible ? `${enter} duration-[var(--motion-overlay)] ease-premium` : `${leave} duration-[180ms] ease-in`, (side === 'left' || side === 'right') && 'rounded-none', side === 'top' && 'rounded-b-[var(--radius-dialog)]', side === 'bottom' && 'rounded-t-[var(--radius-dialog)]', className), children: _jsxs("div", { className: 'flex h-full min-h-0 flex-1 flex-col overflow-hidden p-6 md:p-8', children: [title || description ? (_jsxs("div", { className: 'mb-5 flex shrink-0 items-start justify-between gap-4', children: [_jsxs("div", { className: 'min-w-0 flex-1', children: [title ? _jsx("h2", { id: titleId, className: 'text-2xl font-medium text-text-primary dark:text-text-primary', children: title }) : null, description ? _jsx("p", { id: descriptionId, className: 'font-secondary mt-2 text-sm leading-relaxed text-text-secondary dark:text-text-secondary', children: description }) : null] }), _jsx(DialogCloseButton, { onClick: onClose, "aria-label": 'Close' })] })) : (_jsx("div", { className: 'mb-5 flex shrink-0 justify-end', children: _jsx(DialogCloseButton, { onClick: onClose, "aria-label": 'Close' }) })), _jsx("div", { className: cn(scrollContent ? 'min-h-0 flex-1 overflow-y-auto' : 'flex min-h-0 flex-1 flex-col overflow-hidden'), children: children })] }) })] }), document.body);
|
|
38
|
+
return createPortal(_jsx(ModalLayerScope, { layerRef: panelRef, children: _jsxs("div", { "data-bleecker-modal-overlay": true, className: cn('fixed inset-0 z-50 flex', !isOpen && 'pointer-events-none'), "aria-hidden": !isOpen || undefined, children: [_jsx("div", { className: cn('absolute inset-0 bg-deep-sea/38 backdrop-blur-[2px] transition-opacity dark:bg-black/65', visible ? 'opacity-100 duration-[var(--motion-overlay)] ease-premium' : 'opacity-0 duration-[180ms] ease-in'), onClick: onClose, "aria-hidden": 'true' }), _jsx("div", { ref: panelRef, role: 'dialog', "aria-modal": 'true', "aria-label": title ? undefined : 'Dialog', "aria-labelledby": title ? titleId : undefined, "aria-describedby": description ? descriptionId : undefined, tabIndex: -1, className: cn('absolute flex flex-col overflow-hidden border border-sand/30 bg-white text-text-primary shadow-[var(--shadow-overlay)] outline-none transition-transform dark:border-white/12 dark:bg-deep-sea dark:text-text-primary', panel, visible ? `${enter} duration-[var(--motion-overlay)] ease-premium` : `${leave} duration-[180ms] ease-in`, (side === 'left' || side === 'right') && 'rounded-none', side === 'top' && 'rounded-b-[var(--radius-dialog)]', side === 'bottom' && 'rounded-t-[var(--radius-dialog)]', className), children: _jsxs("div", { className: 'flex h-full min-h-0 flex-1 flex-col overflow-hidden p-6 md:p-8', children: [title || description ? (_jsxs("div", { className: 'mb-5 flex shrink-0 items-start justify-between gap-4', children: [_jsxs("div", { className: 'min-w-0 flex-1', children: [title ? _jsx("h2", { id: titleId, className: 'text-2xl font-medium text-text-primary dark:text-text-primary', children: title }) : null, description ? _jsx("p", { id: descriptionId, className: 'font-secondary mt-2 text-sm leading-relaxed text-text-secondary dark:text-text-secondary', children: description }) : null] }), _jsx(DialogCloseButton, { onClick: onClose, "aria-label": 'Close' })] })) : (_jsx("div", { className: 'mb-5 flex shrink-0 justify-end', children: _jsx(DialogCloseButton, { onClick: onClose, "aria-label": 'Close' }) })), _jsx("div", { className: cn(scrollContent ? 'min-h-0 flex-1 overflow-y-auto' : 'flex min-h-0 flex-1 flex-col overflow-hidden'), children: children })] }) })] }) }), document.body);
|
|
39
39
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
3
|
+
import React from 'react';
|
|
4
4
|
import { ChevronRight } from 'lucide-react';
|
|
5
5
|
import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
|
|
6
6
|
import { cn } from '../utils/cn.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
3
|
+
import React from 'react';
|
|
4
4
|
import { ResponsiveContainer, SunburstChart as RechartsSunburstChart } from 'recharts';
|
|
5
5
|
import { cn } from '../utils/cn.js';
|
|
6
6
|
import { chartTheme } from './chart-theme.js';
|
package/dist/components/table.js
CHANGED
|
@@ -29,20 +29,10 @@ export const TableFooter = React.forwardRef(function TableFooter({ className, ..
|
|
|
29
29
|
});
|
|
30
30
|
// ─── TableRow ─────────────────────────────────────────────────────────────────
|
|
31
31
|
let hoveredRow = null;
|
|
32
|
-
export const TableRow = React.forwardRef(function TableRow({ className, onMouseEnter,
|
|
33
|
-
const rowRef = React.useRef(null);
|
|
34
|
-
const mergedRef = React.useCallback((el) => {
|
|
35
|
-
rowRef.current = el;
|
|
36
|
-
if (typeof ref === 'function')
|
|
37
|
-
ref(el);
|
|
38
|
-
else if (ref)
|
|
39
|
-
ref.current = el;
|
|
40
|
-
}, [ref]);
|
|
32
|
+
export const TableRow = React.forwardRef(function TableRow({ className, onMouseEnter, ...props }, ref) {
|
|
41
33
|
const handleMouseEnter = React.useCallback((e) => {
|
|
42
34
|
onMouseEnter?.(e);
|
|
43
|
-
const el =
|
|
44
|
-
if (!el)
|
|
45
|
-
return;
|
|
35
|
+
const el = e.currentTarget;
|
|
46
36
|
const prev = hoveredRow;
|
|
47
37
|
hoveredRow = el;
|
|
48
38
|
if (prev && prev !== el) {
|
|
@@ -52,10 +42,7 @@ export const TableRow = React.forwardRef(function TableRow({ className, onMouseE
|
|
|
52
42
|
});
|
|
53
43
|
}
|
|
54
44
|
}, [onMouseEnter]);
|
|
55
|
-
|
|
56
|
-
onMouseLeave?.(e);
|
|
57
|
-
}, [onMouseLeave]);
|
|
58
|
-
return (_jsx("tr", { ref: mergedRef, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, className: cn('border-b border-sand/20 data-[selected=true]:bg-sea/[0.045] dark:border-white/[0.07] dark:data-[selected=true]:bg-accent-blue/[0.08]', 'transition-colors duration-[var(--motion-surface)] ease-premium hover:bg-light-sand/45 dark:hover:bg-white/[0.035]', className), ...props }));
|
|
45
|
+
return (_jsx("tr", { ref: ref, onMouseEnter: handleMouseEnter, className: cn('border-b border-sand/20 data-[selected=true]:bg-sea/[0.045] dark:border-white/[0.07] dark:data-[selected=true]:bg-accent-blue/[0.08]', 'transition-colors duration-[var(--motion-surface)] ease-premium hover:bg-light-sand/45 dark:hover:bg-white/[0.035]', className), ...props }));
|
|
59
46
|
});
|
|
60
47
|
// ─── TableHead (<th>) ─────────────────────────────────────────────────────────
|
|
61
48
|
export const TableHead = React.forwardRef(function TableHead({ className, ...props }, ref) {
|
|
@@ -7,5 +7,5 @@ const sizeClasses = {
|
|
|
7
7
|
lg: 'min-h-32 px-4 py-3 text-base'
|
|
8
8
|
};
|
|
9
9
|
export const Textarea = React.forwardRef(function Textarea({ 'aria-invalid': ariaInvalid, className, error = false, textareaSize = 'md', rows = 4, ...props }, ref) {
|
|
10
|
-
return (_jsx("textarea", { ref: ref, rows: rows, "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
|
|
10
|
+
return (_jsx("textarea", { ref: ref, rows: rows, "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 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', 'resize-y', error ? 'border-terracotta focus:border-terracotta focus:ring-terracotta/15 dark:border-terracotta' : '', sizeClasses[textareaSize], className), ...props }));
|
|
11
11
|
});
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
3
3
|
import { cn } from '../utils/cn.js';
|
|
4
|
+
import { useModalBranch } from '../utils/hooks.js';
|
|
4
5
|
export function Tooltip({ children, className, content, delayDuration = 400, side = 'top' }) {
|
|
5
|
-
|
|
6
|
+
const branchRef = useModalBranch();
|
|
7
|
+
return (_jsx(TooltipPrimitive.Provider, { delayDuration: delayDuration, skipDelayDuration: 150, children: _jsxs(TooltipPrimitive.Root, { children: [_jsx(TooltipPrimitive.Trigger, { asChild: true, children: children }), _jsx(TooltipPrimitive.Portal, { children: _jsxs(TooltipPrimitive.Content, { ref: branchRef, side: side, sideOffset: 7, collisionPadding: 10, className: cn('z-[180] max-w-56 rounded-md bg-deep-sea px-3 py-2 text-xs leading-relaxed text-white shadow-[var(--shadow-overlay)] data-[state=delayed-open]:animate-in data-[state=closed]:animate-out data-[state=delayed-open]:fade-in-0 data-[state=closed]:fade-out-0 data-[state=delayed-open]:zoom-in-[0.98] data-[state=closed]:zoom-out-[0.98] data-[state=delayed-open]:duration-[var(--motion-surface)] data-[state=closed]:duration-[var(--motion-exit)] data-[state=delayed-open]:ease-premium data-[state=closed]:ease-in dark:bg-sand dark:text-text-primary', className), children: [content, _jsx(TooltipPrimitive.Arrow, { className: 'fill-deep-sea dark:fill-sand' })] }) })] }) }));
|
|
6
8
|
}
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './core.js';
|
|
2
|
-
export * from './tokens.js';
|
|
1
|
+
export * from './core/index.js';
|
|
2
|
+
export * from './tokens/index.js';
|
|
3
3
|
export * from './components/brand-lockup.js';
|
|
4
4
|
export * from './components/bauhaus-background.js';
|
|
5
5
|
export * from './components/activity-item.js';
|
|
@@ -10,5 +10,12 @@ export interface AuthShellProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
10
10
|
layout?: AuthShellLayout;
|
|
11
11
|
side?: AuthShellSide;
|
|
12
12
|
}
|
|
13
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* A page-level shell for sign-in, recovery, invitation, and other access flows.
|
|
15
|
+
*
|
|
16
|
+
* This is the required outer layout for every React-DOM product login, including
|
|
17
|
+
* its loading, unavailable, and error states. Products customize it only through
|
|
18
|
+
* `layout`, `side`, `brand`, `aside`, `asideLabel`, `footer`, `className` and their
|
|
19
|
+
* own children, and never duplicate its page structure. See docs/auth-shell-standard.md.
|
|
20
|
+
*/
|
|
14
21
|
export declare function AuthShell({ aside, asideLabel, brand, children, className, footer, layout, side, ...props }: AuthShellProps): import("react/jsx-runtime").JSX.Element;
|