@cosborn2/ui 0.1.0-beta.0
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 +163 -0
- package/dist/_escape-layer.d.ts +7 -0
- package/dist/_escape-layer.js +63 -0
- package/dist/_portal-theme.d.ts +3 -0
- package/dist/_portal-theme.js +35 -0
- package/dist/_settings-navigation.d.ts +25 -0
- package/dist/_settings-navigation.js +10 -0
- package/dist/actions-menu.d.ts +29 -0
- package/dist/actions-menu.js +55 -0
- package/dist/button.d.ts +9 -0
- package/dist/button.js +9 -0
- package/dist/color-picker.d.ts +16 -0
- package/dist/color-picker.js +7 -0
- package/dist/confirm-dialog.d.ts +17 -0
- package/dist/confirm-dialog.js +16 -0
- package/dist/data-table.d.ts +24 -0
- package/dist/data-table.js +28 -0
- package/dist/expandable-pill.d.ts +12 -0
- package/dist/expandable-pill.js +47 -0
- package/dist/ghost-text-button.d.ts +3 -0
- package/dist/ghost-text-button.js +4 -0
- package/dist/glass-popover-surface.d.ts +9 -0
- package/dist/glass-popover-surface.js +4 -0
- package/dist/header-shell.d.ts +21 -0
- package/dist/header-shell.js +22 -0
- package/dist/icon-button.d.ts +7 -0
- package/dist/icon-button.js +4 -0
- package/dist/input.d.ts +7 -0
- package/dist/input.js +8 -0
- package/dist/modal.d.ts +26 -0
- package/dist/modal.js +55 -0
- package/dist/notice.d.ts +10 -0
- package/dist/notice.js +5 -0
- package/dist/pagination.d.ts +30 -0
- package/dist/pagination.js +19 -0
- package/dist/pill.d.ts +12 -0
- package/dist/pill.js +12 -0
- package/dist/segmented-control.d.ts +18 -0
- package/dist/segmented-control.js +8 -0
- package/dist/select.d.ts +8 -0
- package/dist/select.js +9 -0
- package/dist/settings-rail.d.ts +11 -0
- package/dist/settings-rail.js +7 -0
- package/dist/settings.d.ts +56 -0
- package/dist/settings.js +25 -0
- package/dist/skeleton.d.ts +3 -0
- package/dist/skeleton.js +4 -0
- package/dist/styles/actions-menu.css +13 -0
- package/dist/styles/all.css +25 -0
- package/dist/styles/button.css +18 -0
- package/dist/styles/color-picker.css +11 -0
- package/dist/styles/confirm-dialog.css +8 -0
- package/dist/styles/data-table.css +15 -0
- package/dist/styles/expandable-pill.css +10 -0
- package/dist/styles/ghost-text-button.css +7 -0
- package/dist/styles/glass-popover-surface.css +5 -0
- package/dist/styles/header-shell.css +4 -0
- package/dist/styles/icon-button.css +11 -0
- package/dist/styles/input.css +11 -0
- package/dist/styles/modal.css +19 -0
- package/dist/styles/notice.css +14 -0
- package/dist/styles/pagination.css +18 -0
- package/dist/styles/pill.css +3 -0
- package/dist/styles/segmented-control.css +11 -0
- package/dist/styles/select.css +12 -0
- package/dist/styles/settings-rail.css +1 -0
- package/dist/styles/settings.css +434 -0
- package/dist/styles/skeleton.css +5 -0
- package/dist/styles/surface.css +6 -0
- package/dist/styles/switch.css +14 -0
- package/dist/styles/theme-toggle.css +9 -0
- package/dist/styles/theme.css +80 -0
- package/dist/styles/toast.css +22 -0
- package/dist/surface.d.ts +5 -0
- package/dist/surface.js +4 -0
- package/dist/switch.d.ts +8 -0
- package/dist/switch.js +10 -0
- package/dist/theme-toggle.d.ts +10 -0
- package/dist/theme-toggle.js +12 -0
- package/dist/toast.d.ts +38 -0
- package/dist/toast.js +17 -0
- package/dist/tokens.json +84 -0
- package/package.json +186 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef, type ReactElement, type Ref } from "react";
|
|
2
|
+
export type GlassPopoverSurfaceProps = (({
|
|
3
|
+
as?: "div";
|
|
4
|
+
} & ComponentPropsWithoutRef<"div">) | ({
|
|
5
|
+
as: "button";
|
|
6
|
+
} & ComponentPropsWithoutRef<"button">)) & {
|
|
7
|
+
ref?: Ref<HTMLDivElement | HTMLButtonElement>;
|
|
8
|
+
};
|
|
9
|
+
export declare function GlassPopoverSurface({ as, className, ...props }: GlassPopoverSurfaceProps): ReactElement;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type ComponentPropsWithRef, type CSSProperties, type ReactElement, type ReactNode } from "react";
|
|
2
|
+
export declare const HEADER_PAD_Y = 6;
|
|
3
|
+
export declare const HEADER_PAD_X = 16;
|
|
4
|
+
interface HeaderShellLayoutProps {
|
|
5
|
+
left: ReactNode;
|
|
6
|
+
right?: ReactNode;
|
|
7
|
+
width?: "content" | "full";
|
|
8
|
+
minWidth?: CSSProperties["minWidth"];
|
|
9
|
+
maxWidth?: number | string;
|
|
10
|
+
sideMargin?: number;
|
|
11
|
+
top?: number | string;
|
|
12
|
+
zIndex?: number;
|
|
13
|
+
gap?: number;
|
|
14
|
+
}
|
|
15
|
+
export type HeaderShellProps = HeaderShellLayoutProps & (({
|
|
16
|
+
as?: "div";
|
|
17
|
+
} & Omit<ComponentPropsWithRef<"div">, "children">) | ({
|
|
18
|
+
as: "header";
|
|
19
|
+
} & Omit<ComponentPropsWithRef<"header">, "children">));
|
|
20
|
+
export declare function HeaderShell({ as: Element, left, right, className, width, minWidth, maxWidth, sideMargin, top, zIndex, gap, style, ...props }: HeaderShellProps): ReactElement;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { createElement } from "react";
|
|
2
|
+
export const HEADER_PAD_Y = 6;
|
|
3
|
+
export const HEADER_PAD_X = 16;
|
|
4
|
+
export function HeaderShell({ as: Element = "div", left, right, className, width = "content", minWidth, maxWidth = "calc(100vw - 28px)", sideMargin = 24, top = "var(--bnh-header-top, 18px)", zIndex = 30, gap = 10, style, ...props }) {
|
|
5
|
+
const maxW = typeof maxWidth === "number" ? `${maxWidth}px` : maxWidth;
|
|
6
|
+
return createElement(Element, {
|
|
7
|
+
...props,
|
|
8
|
+
className: ["bnh-header-shell", className].filter(Boolean).join(" "),
|
|
9
|
+
style: {
|
|
10
|
+
position: "fixed",
|
|
11
|
+
top,
|
|
12
|
+
marginTop: "var(--bnh-header-offset, 0px)",
|
|
13
|
+
zIndex,
|
|
14
|
+
gap,
|
|
15
|
+
padding: `${HEADER_PAD_Y}px ${HEADER_PAD_X}px`,
|
|
16
|
+
...(width === "full"
|
|
17
|
+
? { width: `min(calc(100vw - ${sideMargin * 2}px), ${maxW})` }
|
|
18
|
+
: { width: "max-content", minWidth, maxWidth }),
|
|
19
|
+
...style,
|
|
20
|
+
},
|
|
21
|
+
}, left, right);
|
|
22
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef } from "react";
|
|
2
|
+
export interface IconButtonProps extends ComponentPropsWithRef<"button"> {
|
|
3
|
+
tone?: "neutral" | "danger";
|
|
4
|
+
/** Reveal on parent .group or [data-bnh-group] hover/focus; visible on touch. */
|
|
5
|
+
revealOnHover?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function IconButton({ className, tone, revealOnHover, type, ...props }: IconButtonProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
export function IconButton({ className, tone = "neutral", revealOnHover = false, type = "button", ...props }) {
|
|
3
|
+
return _jsx("button", { type: type, className: ["bnh-icon-button", `bnh-icon-button--${tone}`, revealOnHover && "bnh-icon-button--reveal", className].filter(Boolean).join(" "), ...props });
|
|
4
|
+
}
|
package/dist/input.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type ComponentPropsWithRef } from "react";
|
|
2
|
+
export interface InputProps extends ComponentPropsWithRef<"input"> {
|
|
3
|
+
label?: string;
|
|
4
|
+
error?: string;
|
|
5
|
+
wrapperClassName?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function Input({ className, wrapperClassName, label, error, id, "aria-describedby": describedBy, "aria-invalid": invalid, ...props }: InputProps): import("react").JSX.Element;
|
package/dist/input.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useId } from "react";
|
|
3
|
+
export function Input({ className, wrapperClassName, label, error, id, "aria-describedby": describedBy, "aria-invalid": invalid, ...props }) {
|
|
4
|
+
const generatedId = useId();
|
|
5
|
+
const inputId = id ?? generatedId;
|
|
6
|
+
const errorId = `${inputId}-error`;
|
|
7
|
+
return (_jsxs("div", { className: ["bnh-input-field", wrapperClassName].filter(Boolean).join(" "), children: [label && _jsx("label", { htmlFor: inputId, className: "bnh-input-label", children: label }), _jsx("input", { ...props, id: inputId, "aria-invalid": invalid ?? (error ? true : undefined), "aria-describedby": [describedBy, error ? errorId : undefined].filter(Boolean).join(" ") || undefined, className: ["bnh-input", error && "bnh-input--error", className].filter(Boolean).join(" ") }), error && _jsx("p", { id: errorId, className: "bnh-input-error", children: error })] }));
|
|
8
|
+
}
|
package/dist/modal.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type CSSProperties, type ReactElement, type ReactNode } from "react";
|
|
2
|
+
export interface ModalProps {
|
|
3
|
+
open: boolean;
|
|
4
|
+
onOpenChange: (open: boolean) => void;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
title?: ReactNode;
|
|
7
|
+
subtitle?: ReactNode;
|
|
8
|
+
ariaLabel?: string;
|
|
9
|
+
trigger?: ReactElement;
|
|
10
|
+
headerActions?: ReactNode;
|
|
11
|
+
footer?: ReactNode;
|
|
12
|
+
persistent?: boolean;
|
|
13
|
+
width?: CSSProperties["maxWidth"];
|
|
14
|
+
zIndex?: number;
|
|
15
|
+
className?: string;
|
|
16
|
+
bodyClassName?: string;
|
|
17
|
+
/** Explicit theme override. Otherwise inherits tokens from the rendering location. */
|
|
18
|
+
theme?: "light" | "dark";
|
|
19
|
+
portalContainer?: HTMLElement | null;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Accessible client dialog. The trigger renders during SSR; portal content mounts
|
|
23
|
+
* after hydration. Server-rendered children can be passed through this boundary.
|
|
24
|
+
* Import modal.css and theme.css in the consuming application's CSS entry.
|
|
25
|
+
*/
|
|
26
|
+
export declare function Modal({ open, onOpenChange, children, title, subtitle, ariaLabel, trigger, headerActions, footer, persistent, width, zIndex, className, bodyClassName, theme, portalContainer, }: ModalProps): import("react").JSX.Element;
|
package/dist/modal.js
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as Dialog from "@radix-ui/react-dialog";
|
|
4
|
+
import { X } from "lucide-react";
|
|
5
|
+
import { useCallback, useId, useLayoutEffect, useRef } from "react";
|
|
6
|
+
import { useEscapeLayer } from "./_escape-layer.js";
|
|
7
|
+
import { usePortalTheme } from "./_portal-theme.js";
|
|
8
|
+
/**
|
|
9
|
+
* Accessible client dialog. The trigger renders during SSR; portal content mounts
|
|
10
|
+
* after hydration. Server-rendered children can be passed through this boundary.
|
|
11
|
+
* Import modal.css and theme.css in the consuming application's CSS entry.
|
|
12
|
+
*/
|
|
13
|
+
export function Modal({ open, onOpenChange, children, title, subtitle, ariaLabel, trigger, headerActions, footer, persistent = false, width = 640, zIndex = 100, className, bodyClassName, theme, portalContainer, }) {
|
|
14
|
+
const returnFocus = useRef(null);
|
|
15
|
+
const content = useRef(null);
|
|
16
|
+
const descriptionId = useId();
|
|
17
|
+
const dismiss = useCallback(() => { if (!persistent)
|
|
18
|
+
onOpenChange(false); }, [onOpenChange, persistent]);
|
|
19
|
+
const { origin, setOrigin, onEscapeKeyDown, isTopLayer } = useEscapeLayer(open, dismiss, portalContainer);
|
|
20
|
+
const inheritedTokens = usePortalTheme(origin, open, theme, portalContainer);
|
|
21
|
+
useLayoutEffect(() => {
|
|
22
|
+
if (!open)
|
|
23
|
+
return;
|
|
24
|
+
const active = origin.current?.ownerDocument.activeElement;
|
|
25
|
+
returnFocus.current = active && "focus" in active ? active : null;
|
|
26
|
+
}, [open]);
|
|
27
|
+
const style = {
|
|
28
|
+
...inheritedTokens,
|
|
29
|
+
"--bnh-modal-width": typeof width === "number" ? `${width}px` : width,
|
|
30
|
+
"--bnh-modal-z": zIndex,
|
|
31
|
+
};
|
|
32
|
+
return (_jsxs(Dialog.Root, { open: open, onOpenChange: (next) => { if (next || !persistent)
|
|
33
|
+
onOpenChange(next); }, children: [_jsx("span", { ref: setOrigin, hidden: true, "data-bnh-theme": theme }), trigger && _jsx(Dialog.Trigger, { asChild: true, children: trigger }), _jsxs(Dialog.Portal, { container: portalContainer ?? undefined, children: [_jsx(Dialog.Overlay, { className: "bnh-modal-backdrop", style: style }), _jsxs(Dialog.Content, { ref: content, className: ["bnh-modal", className].filter(Boolean).join(" "), style: style, "aria-modal": "true", "aria-describedby": subtitle ? descriptionId : undefined, onEscapeKeyDown: onEscapeKeyDown, onKeyDown: (event) => {
|
|
34
|
+
// First-commit fallback before Radix has installed any listener.
|
|
35
|
+
// Settled Radix widgets already preventDefault when consuming Escape.
|
|
36
|
+
if (event.key === "Escape")
|
|
37
|
+
onEscapeKeyDown(event);
|
|
38
|
+
}, onInteractOutside: (event) => {
|
|
39
|
+
if (persistent || !isTopLayer(event.detail.originalEvent))
|
|
40
|
+
event.preventDefault();
|
|
41
|
+
}, onOpenAutoFocus: (event) => {
|
|
42
|
+
const active = event.target.ownerDocument.activeElement;
|
|
43
|
+
if (!returnFocus.current && active && "focus" in active)
|
|
44
|
+
returnFocus.current = active;
|
|
45
|
+
}, onCloseAutoFocus: (event) => {
|
|
46
|
+
const active = returnFocus.current?.ownerDocument.activeElement;
|
|
47
|
+
const orphaned = !active || active === active.ownerDocument.body || !!content.current?.contains(active);
|
|
48
|
+
// A closing dialog must not steal focus from a newly opened dialog
|
|
49
|
+
// or another destination the consumer deliberately focused.
|
|
50
|
+
event.preventDefault();
|
|
51
|
+
if (orphaned && returnFocus.current?.isConnected) {
|
|
52
|
+
returnFocus.current.focus();
|
|
53
|
+
}
|
|
54
|
+
}, children: [!persistent && _jsx(Dialog.Close, { className: "bnh-modal-close", type: "button", "aria-label": "Close", children: _jsx(X, { size: 16, "aria-hidden": "true" }) }), headerActions && _jsx("div", { className: "bnh-modal-actions", children: headerActions }), title ? (_jsxs("div", { className: "bnh-modal-heading", children: [_jsx(Dialog.Title, { className: "bnh-modal-title", children: title }), subtitle && _jsx(Dialog.Description, { id: descriptionId, className: "bnh-modal-subtitle", children: subtitle })] })) : _jsx(Dialog.Title, { className: "bnh-modal-visually-hidden", children: ariaLabel ?? "Dialog" }), !title && subtitle && _jsx(Dialog.Description, { id: descriptionId, className: "bnh-modal-subtitle", children: subtitle }), _jsx("div", { className: ["bnh-modal-body", bodyClassName].filter(Boolean).join(" "), children: children }), footer && _jsx("div", { className: "bnh-modal-footer", children: footer })] })] })] }));
|
|
55
|
+
}
|
package/dist/notice.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef, ReactNode } from "react";
|
|
2
|
+
export interface NoticeProps extends ComponentPropsWithRef<"div"> {
|
|
3
|
+
tone?: "neutral" | "success" | "danger";
|
|
4
|
+
heading?: ReactNode;
|
|
5
|
+
/** Decorative icon; the notice text should convey the same meaning. */
|
|
6
|
+
icon?: ReactNode;
|
|
7
|
+
actions?: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
/** Static feedback by default. Set role="alert" or role="status" to announce updates. */
|
|
10
|
+
export declare function Notice({ tone, heading, icon, actions, children, className, ...props }: NoticeProps): import("react").JSX.Element;
|
package/dist/notice.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/** Static feedback by default. Set role="alert" or role="status" to announce updates. */
|
|
3
|
+
export function Notice({ tone = "neutral", heading, icon, actions, children, className, ...props }) {
|
|
4
|
+
return (_jsxs("div", { ...props, className: ["bnh-notice", `bnh-notice--${tone}`, className].filter(Boolean).join(" "), children: [icon != null && _jsx("span", { className: "bnh-notice-icon", "aria-hidden": "true", children: icon }), _jsxs("div", { className: "bnh-notice-content", children: [heading != null && _jsx("div", { className: "bnh-notice-heading", children: heading }), children != null && _jsx("div", { className: "bnh-notice-message", children: children })] }), actions != null && _jsx("div", { className: "bnh-notice-actions", children: actions })] }));
|
|
5
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef } from "react";
|
|
2
|
+
/** Default rows per page; override with pageSize when needed. */
|
|
3
|
+
export declare const PAGE_SIZE = 20;
|
|
4
|
+
interface PaginationBaseProps extends Omit<ComponentPropsWithRef<"nav">, "children"> {
|
|
5
|
+
/** Zero-based page index. */
|
|
6
|
+
page: number;
|
|
7
|
+
/** Total rows matching the current filters, across all pages. */
|
|
8
|
+
total: number;
|
|
9
|
+
/** Singular noun for the summary, e.g. "user". */
|
|
10
|
+
itemLabel: string;
|
|
11
|
+
pageSize?: number;
|
|
12
|
+
/** Irregular plural when appending "s" is incorrect. */
|
|
13
|
+
itemLabelPlural?: string;
|
|
14
|
+
controlsClassName?: string;
|
|
15
|
+
}
|
|
16
|
+
export type PaginationProps = PaginationBaseProps & ({
|
|
17
|
+
/** Requires importing Pagination within a Client Component. */
|
|
18
|
+
onPageChange: (page: number) => void;
|
|
19
|
+
getPageHref?: never;
|
|
20
|
+
} | {
|
|
21
|
+
/** Creates ordinary links on the server; receives a zero-based page index. */
|
|
22
|
+
getPageHref: (page: number) => string;
|
|
23
|
+
onPageChange?: never;
|
|
24
|
+
} | {
|
|
25
|
+
onPageChange?: never;
|
|
26
|
+
getPageHref?: never;
|
|
27
|
+
});
|
|
28
|
+
/** Server-compatible navigation links, or controlled buttons inside a client boundary. */
|
|
29
|
+
export declare function Pagination({ page, total, itemLabel, onPageChange, getPageHref, pageSize, itemLabelPlural, className, controlsClassName, "aria-label": ariaLabel, ...props }: PaginationProps): import("react").JSX.Element;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
3
|
+
import { Button, buttonClassName } from "./button.js";
|
|
4
|
+
/** Default rows per page; override with pageSize when needed. */
|
|
5
|
+
export const PAGE_SIZE = 20;
|
|
6
|
+
/** Server-compatible navigation links, or controlled buttons inside a client boundary. */
|
|
7
|
+
export function Pagination({ page, total, itemLabel, onPageChange, getPageHref, pageSize = PAGE_SIZE, itemLabelPlural, className, controlsClassName, "aria-label": ariaLabel = "Pagination", ...props }) {
|
|
8
|
+
const offset = page * pageSize;
|
|
9
|
+
const showingStart = total === 0 ? 0 : offset + 1;
|
|
10
|
+
const showingEnd = Math.min(offset + pageSize, total);
|
|
11
|
+
const label = total === 1 ? itemLabel : (itemLabelPlural ?? `${itemLabel}s`);
|
|
12
|
+
function control(targetPage, disabled, children, rel) {
|
|
13
|
+
if (getPageHref && !disabled) {
|
|
14
|
+
return _jsx("a", { className: buttonClassName({ variant: "secondary", size: "sm" }), href: getPageHref(targetPage), rel: rel, children: children });
|
|
15
|
+
}
|
|
16
|
+
return (_jsx(Button, { type: "button", variant: "secondary", size: "sm", disabled: disabled || !onPageChange, ...(onPageChange && !disabled ? { onClick: () => onPageChange(targetPage) } : {}), children: children }));
|
|
17
|
+
}
|
|
18
|
+
return (_jsxs("nav", { ...props, "aria-label": ariaLabel, className: ["bnh-pagination", className].filter(Boolean).join(" "), children: [_jsxs("span", { className: "bnh-pagination__summary", children: ["Showing ", showingStart, "-", showingEnd, " of ", total, " ", label] }), _jsxs("div", { className: ["bnh-pagination__controls", controlsClassName].filter(Boolean).join(" "), children: [control(Math.max(0, page - 1), page <= 0, _jsxs(_Fragment, { children: [_jsx(ChevronLeft, { "aria-hidden": "true", className: "bnh-pagination__icon" }), "Previous"] }), "prev"), control(page + 1, offset + pageSize >= total, _jsxs(_Fragment, { children: ["Next", _jsx(ChevronRight, { "aria-hidden": "true", className: "bnh-pagination__icon" })] }), "next")] })] }));
|
|
19
|
+
}
|
package/dist/pill.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CSSProperties, HTMLAttributes } from "react";
|
|
2
|
+
export declare const PILL_HEIGHT = 26;
|
|
3
|
+
export interface PillProps extends HTMLAttributes<HTMLElement> {
|
|
4
|
+
tint?: string;
|
|
5
|
+
background?: string;
|
|
6
|
+
borderColor?: string;
|
|
7
|
+
height?: number;
|
|
8
|
+
as?: "span" | "div";
|
|
9
|
+
style?: CSSProperties;
|
|
10
|
+
}
|
|
11
|
+
/** A static status surface. Use ExpandablePill for a disclosure. */
|
|
12
|
+
export declare function Pill({ tint, background, borderColor, height, as: Tag, style, className, ...props }: PillProps): import("react").JSX.Element;
|
package/dist/pill.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
export const PILL_HEIGHT = 26;
|
|
3
|
+
/** A static status surface. Use ExpandablePill for a disclosure. */
|
|
4
|
+
export function Pill({ tint, background, borderColor, height = PILL_HEIGHT, as: Tag = "span", style, className, ...props }) {
|
|
5
|
+
return (_jsx(Tag, { className: ["bnh-pill", className].filter(Boolean).join(" "), style: {
|
|
6
|
+
height,
|
|
7
|
+
whiteSpace: "nowrap",
|
|
8
|
+
background: background ?? (tint ? `color-mix(in oklch, ${tint} 8%, transparent)` : undefined),
|
|
9
|
+
border: `1px solid ${borderColor ?? (tint ? `color-mix(in oklch, ${tint} 30%, transparent)` : "var(--bnh-border)")}`,
|
|
10
|
+
...style,
|
|
11
|
+
}, ...props }));
|
|
12
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export interface SegmentedControlItem<T extends string = string> {
|
|
3
|
+
id: T;
|
|
4
|
+
label: string;
|
|
5
|
+
accent?: string;
|
|
6
|
+
count?: number;
|
|
7
|
+
icon?: ReactNode;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
title?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface SegmentedControlProps<T extends string = string> {
|
|
12
|
+
items: SegmentedControlItem<T>[];
|
|
13
|
+
value: T;
|
|
14
|
+
onChange: (id: T) => void;
|
|
15
|
+
"aria-label"?: string;
|
|
16
|
+
className?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function SegmentedControl<T extends string>({ items, value, onChange, "aria-label": ariaLabel, className }: SegmentedControlProps<T>): import("react").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
export function SegmentedControl({ items, value, onChange, "aria-label": ariaLabel, className }) {
|
|
4
|
+
return (_jsx("div", { role: "group", "aria-label": ariaLabel, className: ["bnh-segmented-control", className].filter(Boolean).join(" "), children: items.map((item) => {
|
|
5
|
+
const active = item.id === value;
|
|
6
|
+
return (_jsxs("button", { type: "button", onClick: () => onChange(item.id), disabled: item.disabled, title: item.title, "aria-pressed": active, className: "bnh-segmented-control-item", style: { "--bnh-segment-accent": item.accent ?? "var(--bnh-text-dim)" }, children: [item.icon, item.accent && _jsx("span", { "aria-hidden": "true", className: "bnh-segmented-control-dot", style: { background: item.accent } }), item.label, item.count !== undefined && _jsx("span", { className: "bnh-segmented-control-count", children: item.count })] }, item.id));
|
|
7
|
+
}) }));
|
|
8
|
+
}
|
package/dist/select.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ComponentPropsWithRef } from "react";
|
|
2
|
+
export interface SelectProps extends Omit<ComponentPropsWithRef<"select">, "size"> {
|
|
3
|
+
label?: string;
|
|
4
|
+
error?: string;
|
|
5
|
+
wrapperClassName?: string;
|
|
6
|
+
size?: "md" | "sm";
|
|
7
|
+
}
|
|
8
|
+
export declare function Select({ className, wrapperClassName, label, error, id, size, "aria-describedby": describedBy, "aria-invalid": invalid, ...props }: SelectProps): import("react").JSX.Element;
|
package/dist/select.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useId } from "react";
|
|
3
|
+
export function Select({ className, wrapperClassName, label, error, id, size = "md", "aria-describedby": describedBy, "aria-invalid": invalid, ...props }) {
|
|
4
|
+
const generatedId = useId();
|
|
5
|
+
const selectId = id ?? generatedId;
|
|
6
|
+
const errorId = `${selectId}-error`;
|
|
7
|
+
return (_jsxs("div", { className: ["bnh-select-field", wrapperClassName].filter(Boolean).join(" "), children: [label && _jsx("label", { htmlFor: selectId, className: "bnh-select-label", children: label }), _jsx("select", { ...props, id: selectId, "aria-invalid": invalid ?? (error ? true : undefined), "aria-describedby": [describedBy, error ? errorId : undefined].filter(Boolean).join(" ") || undefined, className: ["bnh-select", `bnh-select--${size}`, error && "bnh-select--error", className]
|
|
8
|
+
.filter(Boolean).join(" ") }), error && _jsx("p", { id: errorId, className: "bnh-select-error", children: error })] }));
|
|
9
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type RailSection } from "./_settings-navigation.js";
|
|
2
|
+
export type { RailItem, RailSection } from "./_settings-navigation.js";
|
|
3
|
+
export interface SettingsRailProps {
|
|
4
|
+
sections: readonly RailSection[];
|
|
5
|
+
active: string;
|
|
6
|
+
onChange: (id: string) => void;
|
|
7
|
+
label?: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
/** Controlled navigation for sections switched by client state. */
|
|
11
|
+
export declare function SettingsRail({ sections, active, onChange, label, className }: SettingsRailProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { SettingsNavigationFrame, SettingsNavigationGroup, SettingsNavigationItemContent, } from "./_settings-navigation.js";
|
|
4
|
+
/** Controlled navigation for sections switched by client state. */
|
|
5
|
+
export function SettingsRail({ sections, active, onChange, label, className }) {
|
|
6
|
+
return (_jsx(SettingsNavigationFrame, { label: label, className: className, children: sections.map((section) => (_jsx(SettingsNavigationGroup, { group: section.group, children: section.items.map((item) => (_jsx("button", { type: "button", "aria-current": active === item.id ? "true" : undefined, "aria-controls": item.controls, onClick: () => onChange(item.id), className: `bnh-settings-rail-item${active === item.id ? " is-active" : ""}`, children: _jsx(SettingsNavigationItemContent, { item: item }) }, item.id))) }, section.group))) }));
|
|
7
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from "react";
|
|
2
|
+
import { type RailItem, type RailSection } from "./_settings-navigation.js";
|
|
3
|
+
export type { RailItem, RailSection } from "./_settings-navigation.js";
|
|
4
|
+
export interface SettingsLayoutProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
backdrop?: ReactNode;
|
|
6
|
+
header?: ReactNode;
|
|
7
|
+
navigation?: ReactNode;
|
|
8
|
+
bodyClassName?: string;
|
|
9
|
+
contentClassName?: string;
|
|
10
|
+
}
|
|
11
|
+
/** Static settings frame. Slots may contain server or interactive components. */
|
|
12
|
+
export declare function SettingsLayout({ backdrop, header, navigation, children, className, bodyClassName, contentClassName, ...props }: SettingsLayoutProps): import("react").JSX.Element;
|
|
13
|
+
export interface SettingsPageHeaderProps extends Omit<HTMLAttributes<HTMLElement>, "title"> {
|
|
14
|
+
title: ReactNode;
|
|
15
|
+
eyebrow?: ReactNode;
|
|
16
|
+
description?: ReactNode;
|
|
17
|
+
animate?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare function SettingsPageHeader({ title, eyebrow, description, animate, className, ...props }: SettingsPageHeaderProps): import("react").JSX.Element;
|
|
20
|
+
export interface SettingsCardProps extends HTMLAttributes<HTMLElement> {
|
|
21
|
+
danger?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export declare function SettingsCard({ children, danger, className, ...props }: SettingsCardProps): import("react").JSX.Element;
|
|
24
|
+
export interface SettingsCardHeaderProps extends Omit<HTMLAttributes<HTMLElement>, "title"> {
|
|
25
|
+
title: ReactNode;
|
|
26
|
+
subtitle?: ReactNode;
|
|
27
|
+
danger?: boolean;
|
|
28
|
+
action?: ReactNode;
|
|
29
|
+
}
|
|
30
|
+
export declare function SettingsCardHeader({ title, subtitle, danger, action, className, ...props }: SettingsCardHeaderProps): import("react").JSX.Element;
|
|
31
|
+
export interface SettingsRowProps extends HTMLAttributes<HTMLDivElement> {
|
|
32
|
+
label: ReactNode;
|
|
33
|
+
hint?: ReactNode;
|
|
34
|
+
vertical?: boolean;
|
|
35
|
+
first?: boolean;
|
|
36
|
+
}
|
|
37
|
+
export declare function SettingsRow({ label, hint, children, vertical, first, className, ...props }: SettingsRowProps): import("react").JSX.Element;
|
|
38
|
+
export interface SettingsSectionProps extends Omit<HTMLAttributes<HTMLElement>, "title"> {
|
|
39
|
+
title: ReactNode;
|
|
40
|
+
subtitle?: ReactNode;
|
|
41
|
+
accent?: "purple" | "rose";
|
|
42
|
+
headerAction?: ReactNode;
|
|
43
|
+
index?: number;
|
|
44
|
+
}
|
|
45
|
+
export declare function SettingsSection({ title, subtitle, accent, headerAction, index, children, className, style, ...props }: SettingsSectionProps): import("react").JSX.Element;
|
|
46
|
+
export interface SettingsNavigationItem extends RailItem {
|
|
47
|
+
href: string;
|
|
48
|
+
}
|
|
49
|
+
export interface SettingsNavigationProps {
|
|
50
|
+
sections: readonly RailSection<SettingsNavigationItem>[];
|
|
51
|
+
active?: string;
|
|
52
|
+
label?: string;
|
|
53
|
+
className?: string;
|
|
54
|
+
}
|
|
55
|
+
/** Link navigation works without client JavaScript or a router dependency. */
|
|
56
|
+
export declare function SettingsNavigation({ sections, active, label, className }: SettingsNavigationProps): import("react").JSX.Element;
|
package/dist/settings.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { SettingsNavigationFrame, SettingsNavigationGroup, SettingsNavigationItemContent, } from "./_settings-navigation.js";
|
|
3
|
+
/** Static settings frame. Slots may contain server or interactive components. */
|
|
4
|
+
export function SettingsLayout({ backdrop, header, navigation, children, className, bodyClassName, contentClassName, ...props }) {
|
|
5
|
+
return (_jsxs("div", { className: ["bnh-settings-page", className].filter(Boolean).join(" "), ...props, children: [backdrop, _jsxs("div", { className: "bnh-settings-shell", children: [header, _jsxs("div", { className: ["bnh-settings-body", bodyClassName].filter(Boolean).join(" "), children: [navigation, _jsx("main", { className: "bnh-settings-main", children: _jsx("div", { className: ["bnh-settings-content", contentClassName].filter(Boolean).join(" "), children: children }) })] })] })] }));
|
|
6
|
+
}
|
|
7
|
+
export function SettingsPageHeader({ title, eyebrow, description, animate = false, className, ...props }) {
|
|
8
|
+
return (_jsxs("header", { className: ["bnh-settings-page-header", animate && "bnh-settings-enter", className].filter(Boolean).join(" "), ...props, children: [eyebrow != null && _jsx("div", { className: "bnh-settings-eyebrow", children: eyebrow }), _jsx("h1", { className: "bnh-settings-title", children: title }), description != null && _jsx("p", { className: "bnh-settings-description", children: description })] }));
|
|
9
|
+
}
|
|
10
|
+
export function SettingsCard({ children, danger = false, className, ...props }) {
|
|
11
|
+
return _jsx("section", { className: ["bnh-settings-card", danger && "bnh-settings-card--danger", className].filter(Boolean).join(" "), ...props, children: children });
|
|
12
|
+
}
|
|
13
|
+
export function SettingsCardHeader({ title, subtitle, danger = false, action, className, ...props }) {
|
|
14
|
+
return (_jsxs("header", { className: ["bnh-settings-card-header", subtitle != null && "bnh-settings-card-header--description", danger && "bnh-settings-card-header--danger", className].filter(Boolean).join(" "), ...props, children: [_jsxs("div", { className: "bnh-settings-card-heading", children: [_jsx("h3", { className: "bnh-settings-card-title", children: title }), subtitle != null && _jsx("p", { className: "bnh-settings-card-subtitle", children: subtitle })] }), action] }));
|
|
15
|
+
}
|
|
16
|
+
export function SettingsRow({ label, hint, children, vertical = false, first = false, className, ...props }) {
|
|
17
|
+
return (_jsxs("div", { className: ["bnh-settings-row", vertical && "is-vertical", first && "is-first", className].filter(Boolean).join(" "), ...props, children: [_jsxs("div", { className: "bnh-settings-row-label", children: [_jsx("div", { className: "bnh-settings-row-title", children: label }), hint != null && _jsx("div", { className: "bnh-settings-row-hint", children: hint })] }), _jsx("div", { className: "bnh-settings-row-control", children: children })] }));
|
|
18
|
+
}
|
|
19
|
+
export function SettingsSection({ title, subtitle, accent, headerAction, index = 0, children, className, style, ...props }) {
|
|
20
|
+
return (_jsxs("section", { className: ["bnh-settings-section", "bnh-settings-enter", accent && `bnh-settings-section--${accent}`, className].filter(Boolean).join(" "), style: { ...(index > 0 ? { animationDelay: `${index * 80}ms` } : {}), ...style }, ...props, children: [_jsxs("div", { className: `bnh-settings-section-header${subtitle != null ? " bnh-settings-section-header--description" : ""}`, children: [_jsx("h2", { className: "bnh-settings-section-title", children: title }), headerAction] }), subtitle != null && _jsx("p", { className: "bnh-settings-section-subtitle", children: subtitle }), children] }));
|
|
21
|
+
}
|
|
22
|
+
/** Link navigation works without client JavaScript or a router dependency. */
|
|
23
|
+
export function SettingsNavigation({ sections, active, label, className }) {
|
|
24
|
+
return (_jsx(SettingsNavigationFrame, { label: label, className: className, children: sections.map((section) => (_jsx(SettingsNavigationGroup, { group: section.group, children: section.items.map((item) => (_jsx("a", { href: item.href, "aria-current": active === item.id ? "page" : undefined, className: `bnh-settings-rail-item${active === item.id ? " is-active" : ""}`, children: _jsx(SettingsNavigationItemContent, { item: item }) }, item.id))) }, section.group))) }));
|
|
25
|
+
}
|
package/dist/skeleton.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
@layer components {
|
|
2
|
+
.bnh-actions-menu-trigger { box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 32px; height: 32px; padding: 0; border: 0; border-radius: var(--bnh-radius-md); background: transparent; color: var(--bnh-text-dim); font: inherit; cursor: pointer; }
|
|
3
|
+
.bnh-actions-menu-trigger:hover, .bnh-actions-menu-trigger[data-state="open"] { background: var(--bnh-hover); }
|
|
4
|
+
.bnh-actions-menu-trigger:focus-visible { outline: 2px solid var(--bnh-accent); outline-offset: 2px; }
|
|
5
|
+
.bnh-actions-menu-trigger:disabled { opacity: .4; cursor: not-allowed; }
|
|
6
|
+
.bnh-actions-menu { box-sizing: border-box; z-index: var(--bnh-actions-menu-z, calc(var(--bnh-modal-z, 100) + 10)); min-width: min(160px, var(--radix-dropdown-menu-content-available-width)); max-width: min(320px, var(--radix-dropdown-menu-content-available-width)); max-height: var(--radix-dropdown-menu-content-available-height); overflow: auto; overscroll-behavior: contain; padding: 4px; border: 1px solid var(--bnh-border); border-radius: var(--bnh-radius-md); background: var(--bnh-bg-2); color: var(--bnh-text); font-family: var(--bnh-font-sans); box-shadow: 0 8px 24px rgb(0 0 0 / .2); outline: none; }
|
|
7
|
+
.bnh-actions-menu-item { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 7px 8px; border-radius: var(--bnh-radius-sm); font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; cursor: pointer; user-select: none; outline: none; }
|
|
8
|
+
.bnh-actions-menu-item[data-highlighted] { background: var(--bnh-hover); }
|
|
9
|
+
.bnh-actions-menu-item--danger { color: var(--bnh-red); }
|
|
10
|
+
.bnh-actions-menu-item[data-disabled] { opacity: .4; cursor: not-allowed; }
|
|
11
|
+
.bnh-actions-menu-icon { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; flex-shrink: 0; }
|
|
12
|
+
.bnh-actions-menu-icon > svg { width: 16px; height: 16px; }
|
|
13
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
@import "./theme.css";
|
|
2
|
+
@import "./actions-menu.css";
|
|
3
|
+
@import "./button.css";
|
|
4
|
+
@import "./color-picker.css";
|
|
5
|
+
@import "./confirm-dialog.css";
|
|
6
|
+
@import "./data-table.css";
|
|
7
|
+
@import "./expandable-pill.css";
|
|
8
|
+
@import "./ghost-text-button.css";
|
|
9
|
+
@import "./glass-popover-surface.css";
|
|
10
|
+
@import "./header-shell.css";
|
|
11
|
+
@import "./icon-button.css";
|
|
12
|
+
@import "./input.css";
|
|
13
|
+
@import "./modal.css";
|
|
14
|
+
@import "./notice.css";
|
|
15
|
+
@import "./pagination.css";
|
|
16
|
+
@import "./pill.css";
|
|
17
|
+
@import "./segmented-control.css";
|
|
18
|
+
@import "./select.css";
|
|
19
|
+
@import "./settings-rail.css";
|
|
20
|
+
@import "./settings.css";
|
|
21
|
+
@import "./skeleton.css";
|
|
22
|
+
@import "./surface.css";
|
|
23
|
+
@import "./switch.css";
|
|
24
|
+
@import "./theme-toggle.css";
|
|
25
|
+
@import "./toast.css";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
@layer components {
|
|
2
|
+
.bnh-button { box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; border: 0 solid transparent; border-radius: var(--bnh-radius-md); font-family: var(--bnh-font-sans, inherit); font-weight: 500; line-height: 1.5; text-decoration: none; cursor: pointer; transition: background-color 150ms, color 150ms, opacity 150ms, transform 150ms; }
|
|
3
|
+
.bnh-button:focus-visible { outline: 2px solid var(--bnh-accent); outline-offset: 2px; }
|
|
4
|
+
.bnh-button:disabled { pointer-events: none; opacity: .4; }
|
|
5
|
+
.bnh-button--primary { background: var(--bnh-primary); color: var(--bnh-bg); }
|
|
6
|
+
.bnh-button--primary:hover { background: var(--bnh-primary-hover); }
|
|
7
|
+
.bnh-button--primary:active, .bnh-button--secondary:active { transform: scale(.98); }
|
|
8
|
+
.bnh-button--secondary { background: var(--bnh-surface-3); color: var(--bnh-text); border: 1px solid var(--bnh-border); }
|
|
9
|
+
.bnh-button--secondary:hover { background: var(--bnh-hover); }
|
|
10
|
+
.bnh-button--ghost { background: transparent; color: var(--bnh-text-dim); }
|
|
11
|
+
.bnh-button--ghost:hover { color: var(--bnh-text); background: var(--bnh-hover); }
|
|
12
|
+
.bnh-button--danger { color: var(--bnh-red); background: color-mix(in oklch, var(--bnh-red) 10%, transparent); border: 1px solid color-mix(in oklch, var(--bnh-red) 20%, transparent); }
|
|
13
|
+
.bnh-button--danger:hover { background: color-mix(in oklch, var(--bnh-red) 20%, transparent); }
|
|
14
|
+
.bnh-button--sm { height: 32px; padding: 0 12px; font-size: 14px; gap: 6px; }
|
|
15
|
+
.bnh-button--md { height: 40px; padding: 0 16px; font-size: 14px; gap: 8px; }
|
|
16
|
+
.bnh-button--lg { height: 48px; padding: 0 24px; font-size: 16px; gap: 10px; }
|
|
17
|
+
@media (prefers-reduced-motion: reduce) { .bnh-button { transition: none; } .bnh-button:active { transform: none; } }
|
|
18
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
@layer components {
|
|
2
|
+
.bnh-color-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
|
|
3
|
+
.bnh-color-picker > button { box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; font: inherit; cursor: pointer; transition: transform 150ms, box-shadow 150ms; }
|
|
4
|
+
.bnh-color-picker > button:hover { transform: scale(1.05); }
|
|
5
|
+
.bnh-color-picker > button[aria-pressed="true"] { transform: scale(1.1); box-shadow: 0 0 0 2px var(--bnh-bg), 0 0 0 4px currentColor; }
|
|
6
|
+
.bnh-color-picker > .bnh-color-picker-none { border: 2px solid var(--bnh-border); background: transparent; color: var(--bnh-text-mute); }
|
|
7
|
+
.bnh-color-picker > .bnh-color-picker-none[aria-pressed="true"] { border-color: var(--bnh-primary); box-shadow: 0 0 0 2px color-mix(in oklch, var(--bnh-primary) 30%, transparent); }
|
|
8
|
+
.bnh-color-picker > button:focus-visible { outline: 2px solid var(--bnh-text); outline-offset: 5px; }
|
|
9
|
+
.bnh-color-picker > button:disabled { cursor: not-allowed; opacity: .4; transform: none; }
|
|
10
|
+
@media (prefers-reduced-motion: reduce) { .bnh-color-picker > button { transition: none; } }
|
|
11
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
@import "./modal.css";
|
|
2
|
+
@import "./button.css";
|
|
3
|
+
@import "./input.css";
|
|
4
|
+
@layer components {
|
|
5
|
+
.bnh-confirm-actions { display: flex; justify-content: flex-end; gap: 12px; }
|
|
6
|
+
.bnh-confirm-message { margin: 0; font-size: 14px; line-height: 1.5; color: var(--bnh-text-dim); }
|
|
7
|
+
.bnh-confirm-input { margin-top: 16px; }
|
|
8
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
@import "./skeleton.css";
|
|
2
|
+
|
|
3
|
+
@layer components {
|
|
4
|
+
.bnh-data-table { box-sizing: border-box; overflow-x: auto; border: 1px solid var(--bnh-border); border-radius: var(--bnh-radius-xl); background: var(--bnh-bg-2); color: var(--bnh-text); font-family: var(--bnh-font-sans, inherit); line-height: 1.5; }
|
|
5
|
+
.bnh-data-table__table { width: 100%; min-width: 720px; border-collapse: collapse; border-spacing: 0; }
|
|
6
|
+
.bnh-data-table__table thead tr, .bnh-data-table__table tbody tr:not(:last-child) { border-bottom: 1px solid var(--bnh-border); }
|
|
7
|
+
.bnh-data-table__table th { padding: 12px 16px; text-align: left; font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .05em; color: var(--bnh-text-dim); }
|
|
8
|
+
.bnh-data-table__table td { padding: 12px 16px; font-size: 14px; }
|
|
9
|
+
.bnh-data-table__table .bnh-data-table__empty { padding: 48px 16px; text-align: center; color: var(--bnh-text-dim); }
|
|
10
|
+
.bnh-data-table__caption { padding: 12px 16px; text-align: left; font-size: 14px; font-weight: 500; }
|
|
11
|
+
.bnh-data-table__skeleton { height: 16px; width: 75%; }
|
|
12
|
+
.bnh-data-table__row--interactive { cursor: pointer; }
|
|
13
|
+
.bnh-data-table__row--interactive:hover { background: var(--bnh-hover); }
|
|
14
|
+
.bnh-data-table__row--interactive:focus-visible { outline: 2px solid var(--bnh-accent); outline-offset: -2px; }
|
|
15
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
@import "./pill.css";
|
|
2
|
+
|
|
3
|
+
@layer components {
|
|
4
|
+
.bnh-expandable-pill { display: inline-flex; flex-shrink: 0; }
|
|
5
|
+
.bnh-expandable-pill-trigger { cursor: pointer; }
|
|
6
|
+
.bnh-expandable-pill-trigger:focus-visible { outline: 2px solid var(--bnh-accent); outline-offset: 2px; }
|
|
7
|
+
.bnh-expandable-pill-trigger:disabled { cursor: not-allowed; opacity: .4; }
|
|
8
|
+
.bnh-expandable-pill-panel { position: absolute; z-index: 1; transition: opacity .16s, transform .2s, visibility .2s; }
|
|
9
|
+
@media (prefers-reduced-motion: reduce) { .bnh-expandable-pill-panel { transition: none; } }
|
|
10
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
@layer components {
|
|
2
|
+
.bnh-ghost-text-button { box-sizing: border-box; cursor: pointer; border-radius: 6px; border: 0; background: transparent; padding: 6px; font-family: var(--bnh-font-sans, inherit); font-size: 13px; line-height: 1.5; color: var(--bnh-text-mute); transition: color 150ms; }
|
|
3
|
+
.bnh-ghost-text-button:hover { color: var(--bnh-text); }
|
|
4
|
+
.bnh-ghost-text-button:focus-visible { outline: 2px solid var(--bnh-accent); outline-offset: 2px; }
|
|
5
|
+
.bnh-ghost-text-button:disabled { opacity: .4; cursor: not-allowed; }
|
|
6
|
+
@media (prefers-reduced-motion: reduce) { .bnh-ghost-text-button { transition: none; } }
|
|
7
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
@layer components {
|
|
2
|
+
.bnh-glass-popover { box-sizing: border-box; overflow: hidden; background: var(--bnh-popover-background, radial-gradient(ellipse 110% 65% at 50% -10%, color-mix(in oklch, var(--bnh-accent) 16%, transparent) 0%, transparent 70%), linear-gradient(135deg, color-mix(in oklch, white 8%, transparent), transparent 48%), color-mix(in oklch, var(--bnh-bg) 48%, transparent)); -webkit-backdrop-filter: blur(var(--bnh-popover-backdrop-blur, 56px)) saturate(1.7) contrast(.92); backdrop-filter: blur(var(--bnh-popover-backdrop-blur, 56px)) saturate(1.7) contrast(.92); border: 1px solid var(--bnh-border-2); box-shadow: var(--bnh-popover-shadow, 0 1px 0 rgb(255 255 255 / 6%) inset, 0 -1px 0 rgb(0 0 0 / 20%) inset, 0 24px 70px rgb(0 0 0 / 50%), 0 6px 20px rgb(0 0 0 / 35%)); }
|
|
3
|
+
button.bnh-glass-popover { font-family: var(--bnh-font-sans, inherit); color: var(--bnh-text); cursor: pointer; }
|
|
4
|
+
button.bnh-glass-popover:focus-visible { outline: 2px solid var(--bnh-accent); outline-offset: 2px; }
|
|
5
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
@layer components {
|
|
2
|
+
.bnh-header-shell { box-sizing: border-box; left: 50%; transform: translateX(-50%); display: flex; align-items: center; border-radius: 999px; color: var(--bnh-text); font-family: var(--bnh-font-sans, inherit); background: var(--bnh-surface); -webkit-backdrop-filter: blur(24px) saturate(1.4); backdrop-filter: blur(24px) saturate(1.4); border: 1px solid var(--bnh-border-2); box-shadow: var(--bnh-glass-shadow, 0 1px 0 rgb(255 255 255 / 6%) inset, 0 -1px 0 rgb(0 0 0 / 15%) inset, 0 20px 60px rgb(0 0 0 / 35%), 0 4px 16px rgb(0 0 0 / 25%)); transition: width .22s cubic-bezier(.4, 0, .2, 1), min-width .22s cubic-bezier(.4, 0, .2, 1), top .3s cubic-bezier(.2, .8, .2, 1); }
|
|
3
|
+
@media (prefers-reduced-motion: reduce) { .bnh-header-shell { transition: none; } }
|
|
4
|
+
}
|