@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,22 @@
|
|
|
1
|
+
@layer components {
|
|
2
|
+
.bnh-toast-announcer { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
|
|
3
|
+
.bnh-toast-viewport { box-sizing: border-box; position: fixed; left: 50%; bottom: var(--bnh-toast-bottom, 24px); transform: translateX(-50%); z-index: var(--bnh-toast-z, 400); display: flex; flex-direction: column; align-items: center; gap: 8px; width: min(448px, calc(100% - 16px)); max-height: calc(100dvh - var(--bnh-toast-bottom, 24px) - 12px); overflow-y: auto; overscroll-behavior: contain; padding: 4px; pointer-events: auto; }
|
|
4
|
+
.bnh-toast-viewport:empty { padding: 0; pointer-events: none; }
|
|
5
|
+
.bnh-toast { --bnh-toast-color: var(--bnh-accent); box-sizing: border-box; pointer-events: auto; flex-shrink: 0; display: flex; align-items: center; gap: 10px; width: fit-content; min-width: min(240px, 100%); max-width: 100%; padding: 8px 8px 8px 10px; border: 1px solid color-mix(in oklch, var(--bnh-toast-color) 20%, var(--bnh-border-2)); border-radius: 999px; color: var(--bnh-text); background: color-mix(in oklch, var(--bnh-bg) 72%, transparent); -webkit-backdrop-filter: blur(28px) saturate(1.5); backdrop-filter: blur(28px) saturate(1.5); box-shadow: var(--bnh-glass-shadow), 0 0 0 1px color-mix(in oklch, var(--bnh-toast-color) 10%, transparent); font-family: var(--bnh-font-sans, inherit); line-height: 1.5; animation: bnh-toast-in .22s cubic-bezier(.4, 0, .2, 1) both; }
|
|
6
|
+
.bnh-toast--success { --bnh-toast-color: var(--bnh-green); }
|
|
7
|
+
.bnh-toast--error { --bnh-toast-color: var(--bnh-red); }
|
|
8
|
+
.bnh-toast__indicator { position: relative; display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; flex-shrink: 0; color: var(--bnh-toast-color); }
|
|
9
|
+
.bnh-toast__ring { position: absolute; inset: 0; }
|
|
10
|
+
.bnh-toast__ring-track { fill: color-mix(in oklch, var(--bnh-toast-color) 14%, transparent); stroke: color-mix(in oklch, var(--bnh-toast-color) 22%, transparent); stroke-width: 1.5; }
|
|
11
|
+
.bnh-toast__ring-progress { fill: none; stroke: var(--bnh-toast-color); stroke-width: 1.6; stroke-linecap: round; transition: stroke-dashoffset .1s linear; }
|
|
12
|
+
.bnh-toast__icon { position: relative; }
|
|
13
|
+
.bnh-toast__message { flex: 1; min-width: 0; padding: 2px 0; font-size: 13px; font-weight: 500; letter-spacing: -.005em; overflow-wrap: anywhere; }
|
|
14
|
+
.bnh-toast__action { box-sizing: border-box; flex-shrink: 0; max-width: 45%; padding: 5px 11px; border: 0; border-radius: 999px; color: var(--bnh-text); background: color-mix(in oklch, var(--bnh-toast-color) 22%, transparent); font-family: inherit; font-size: 12px; font-weight: 600; line-height: 1.5; letter-spacing: -.005em; overflow-wrap: anywhere; cursor: pointer; transition: background .12s; }
|
|
15
|
+
.bnh-toast__action:hover { background: color-mix(in oklch, var(--bnh-toast-color) 34%, transparent); }
|
|
16
|
+
.bnh-toast__action:disabled { pointer-events: none; opacity: .4; }
|
|
17
|
+
.bnh-toast__dismiss { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 999px; color: var(--bnh-text-dim); background: transparent; cursor: pointer; }
|
|
18
|
+
.bnh-toast__dismiss:hover { color: var(--bnh-text); background: var(--bnh-surface); }
|
|
19
|
+
.bnh-toast__action:focus-visible, .bnh-toast__dismiss:focus-visible { outline: 2px solid var(--bnh-accent); outline-offset: 2px; }
|
|
20
|
+
@keyframes bnh-toast-in { from { opacity: 0; translate: 0 8px; } to { opacity: 1; translate: 0 0; } }
|
|
21
|
+
@media (prefers-reduced-motion: reduce) { .bnh-toast { animation: none; } .bnh-toast__ring-progress, .bnh-toast__action { transition: none; } }
|
|
22
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef } from "react";
|
|
2
|
+
export interface SurfaceProps extends ComponentPropsWithRef<"div"> {
|
|
3
|
+
variant?: "raised" | "glass" | "frosted";
|
|
4
|
+
}
|
|
5
|
+
export declare function Surface({ variant, className, ...props }: SurfaceProps): import("react").JSX.Element;
|
package/dist/surface.js
ADDED
package/dist/switch.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ComponentPropsWithRef, type ReactNode } from "react";
|
|
2
|
+
export interface SwitchProps extends Omit<ComponentPropsWithRef<"input">, "type" | "size"> {
|
|
3
|
+
label?: ReactNode;
|
|
4
|
+
description?: ReactNode;
|
|
5
|
+
wrapperClassName?: string;
|
|
6
|
+
}
|
|
7
|
+
/** Native checkbox semantics and form submission, styled as a switch. */
|
|
8
|
+
export declare function Switch({ label, description, wrapperClassName, className, id, "aria-describedby": describedBy, "aria-labelledby": labelledBy, ...props }: SwitchProps): import("react").JSX.Element;
|
package/dist/switch.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useId } from "react";
|
|
3
|
+
/** Native checkbox semantics and form submission, styled as a switch. */
|
|
4
|
+
export function Switch({ label, description, wrapperClassName, className, id, "aria-describedby": describedBy, "aria-labelledby": labelledBy, ...props }) {
|
|
5
|
+
const generatedId = useId();
|
|
6
|
+
const inputId = id ?? generatedId;
|
|
7
|
+
const descriptionId = `${inputId}-description`;
|
|
8
|
+
const labelId = `${inputId}-label`;
|
|
9
|
+
return (_jsxs("label", { htmlFor: inputId, className: ["bnh-switch", wrapperClassName].filter(Boolean).join(" "), children: [_jsx("input", { ...props, type: "checkbox", role: "switch", id: inputId, "aria-labelledby": labelledBy ?? (label && !props["aria-label"] ? labelId : undefined), "aria-describedby": [describedBy, description ? descriptionId : undefined].filter(Boolean).join(" ") || undefined, className: ["bnh-switch-input", className].filter(Boolean).join(" ") }), _jsx("span", { "aria-hidden": "true", className: "bnh-switch-track" }), (label || description) && (_jsxs("span", { className: "bnh-switch-copy", children: [label && _jsx("span", { id: labelId, className: "bnh-switch-label", children: label }), description && _jsx("span", { id: descriptionId, className: "bnh-switch-description", children: description })] }))] }));
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef } from "react";
|
|
2
|
+
export type ThemePreference = "system" | "light" | "dark";
|
|
3
|
+
export interface ThemeToggleProps extends Omit<ComponentPropsWithRef<"div">, "onChange"> {
|
|
4
|
+
value: ThemePreference;
|
|
5
|
+
onChange: (value: ThemePreference) => void;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
labels?: Partial<Record<ThemePreference, string>>;
|
|
8
|
+
}
|
|
9
|
+
/** A controlled preference selector. The application applies and persists the theme. */
|
|
10
|
+
export declare function ThemeToggle({ value, onChange, disabled, labels, className, "aria-label": ariaLabel, ...props }: ThemeToggleProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Monitor, Moon, Sun } from "lucide-react";
|
|
4
|
+
const modes = [
|
|
5
|
+
{ value: "system", label: "System theme", Icon: Monitor },
|
|
6
|
+
{ value: "light", label: "Light theme", Icon: Sun },
|
|
7
|
+
{ value: "dark", label: "Dark theme", Icon: Moon },
|
|
8
|
+
];
|
|
9
|
+
/** A controlled preference selector. The application applies and persists the theme. */
|
|
10
|
+
export function ThemeToggle({ value, onChange, disabled, labels, className, "aria-label": ariaLabel = "Theme", ...props }) {
|
|
11
|
+
return (_jsx("div", { ...props, role: "group", "aria-label": ariaLabel, className: ["bnh-theme-toggle", className].filter(Boolean).join(" "), children: modes.map(({ value: mode, label, Icon }) => (_jsx("button", { type: "button", disabled: disabled, "aria-pressed": value === mode, "aria-label": labels?.[mode] ?? label, title: labels?.[mode] ?? label, onClick: () => onChange(mode), children: _jsx(Icon, { "aria-hidden": "true", size: 14 }) }, mode))) }));
|
|
12
|
+
}
|
package/dist/toast.d.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef, ReactNode } from "react";
|
|
2
|
+
export type ToastVariant = "success" | "error" | "info";
|
|
3
|
+
export interface ToastAction {
|
|
4
|
+
label: string;
|
|
5
|
+
onClick: () => void;
|
|
6
|
+
ariaLabel?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface ToastProps extends Omit<ComponentPropsWithRef<"div">, "children" | "role" | "aria-live" | "aria-atomic"> {
|
|
10
|
+
message: ReactNode;
|
|
11
|
+
variant?: ToastVariant;
|
|
12
|
+
action?: ToastAction;
|
|
13
|
+
onDismiss?: () => void;
|
|
14
|
+
dismissLabel?: string;
|
|
15
|
+
/** Fraction of time remaining, from 0 to 1. Omit for persistent notifications. */
|
|
16
|
+
progress?: number;
|
|
17
|
+
/** Errors are assertive by default; other messages are polite. */
|
|
18
|
+
announce?: "polite" | "assertive" | "off";
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Controlled presentation: the host owns notification state, timers, and actions.
|
|
22
|
+
* Import inside a Client Component when supplying event handlers. Only the
|
|
23
|
+
* message is a live region, so progress updates and controls are not announced.
|
|
24
|
+
*/
|
|
25
|
+
export declare function Toast({ message, variant, action, onDismiss, dismissLabel, progress, announce, className, ...props }: ToastProps): import("react").JSX.Element;
|
|
26
|
+
export interface ToastViewportProps extends ComponentPropsWithRef<"div"> {
|
|
27
|
+
/**
|
|
28
|
+
* Keep this object present from the first render so live regions exist before
|
|
29
|
+
* notifications arrive. Supply keyed message-only children and use announce="off"
|
|
30
|
+
* on the visual toasts. Timers, actions, and removal controls stay outside them.
|
|
31
|
+
*/
|
|
32
|
+
announcements?: {
|
|
33
|
+
polite?: ReactNode;
|
|
34
|
+
assertive?: ReactNode;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/** A presentation-only stack; style or CSS variables can customize its position. */
|
|
38
|
+
export declare function ToastViewport({ announcements, className, "aria-label": label, ...props }: ToastViewportProps): import("react").JSX.Element;
|
package/dist/toast.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Check, CircleAlert, Sparkles, X } from "lucide-react";
|
|
3
|
+
const icons = { success: Check, error: CircleAlert, info: Sparkles };
|
|
4
|
+
/**
|
|
5
|
+
* Controlled presentation: the host owns notification state, timers, and actions.
|
|
6
|
+
* Import inside a Client Component when supplying event handlers. Only the
|
|
7
|
+
* message is a live region, so progress updates and controls are not announced.
|
|
8
|
+
*/
|
|
9
|
+
export function Toast({ message, variant = "info", action, onDismiss, dismissLabel = "Dismiss notification", progress, announce = variant === "error" ? "assertive" : "polite", className, ...props }) {
|
|
10
|
+
const Icon = icons[variant];
|
|
11
|
+
const remaining = progress == null || !Number.isFinite(progress) ? undefined : Math.max(0, Math.min(1, progress));
|
|
12
|
+
return (_jsxs("div", { ...props, className: ["bnh-toast", `bnh-toast--${variant}`, className].filter(Boolean).join(" "), children: [_jsxs("span", { className: "bnh-toast__indicator", "aria-hidden": "true", children: [_jsxs("svg", { className: "bnh-toast__ring", width: "28", height: "28", viewBox: "0 0 28 28", focusable: "false", children: [_jsx("circle", { className: "bnh-toast__ring-track", cx: "14", cy: "14", r: "11" }), remaining !== undefined && (_jsx("circle", { className: "bnh-toast__ring-progress", cx: "14", cy: "14", r: "11", pathLength: "1", strokeDasharray: "1", strokeDashoffset: 1 - remaining, transform: "rotate(-90 14 14)" }))] }), _jsx(Icon, { size: 13, "aria-hidden": "true", className: "bnh-toast__icon" })] }), _jsx("div", { className: "bnh-toast__message", role: announce === "off" ? undefined : announce === "assertive" ? "alert" : "status", "aria-live": announce, "aria-atomic": "true", children: message }), action && (_jsx("button", { type: "button", className: "bnh-toast__action", "aria-label": action.ariaLabel, disabled: action.disabled, onClick: action.onClick, children: action.label })), onDismiss && (_jsx("button", { type: "button", className: "bnh-toast__dismiss", onClick: onDismiss, "aria-label": dismissLabel, title: dismissLabel, children: _jsx(X, { size: 13, "aria-hidden": "true" }) }))] }));
|
|
13
|
+
}
|
|
14
|
+
/** A presentation-only stack; style or CSS variables can customize its position. */
|
|
15
|
+
export function ToastViewport({ announcements, className, "aria-label": label = "Notifications", ...props }) {
|
|
16
|
+
return _jsxs(_Fragment, { children: [announcements && _jsxs(_Fragment, { children: [_jsx("div", { className: "bnh-toast-announcer", role: "status", "aria-live": "polite", "aria-atomic": "false", "aria-relevant": "additions text", children: announcements.polite }), _jsx("div", { className: "bnh-toast-announcer", role: "alert", "aria-live": "assertive", "aria-atomic": "false", "aria-relevant": "additions text", children: announcements.assertive })] }), _jsx("div", { role: "region", "aria-label": label, ...props, className: ["bnh-toast-viewport", className].filter(Boolean).join(" ") })] });
|
|
17
|
+
}
|
package/dist/tokens.json
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
{
|
|
2
|
+
"shared": {
|
|
3
|
+
"font-sans": "ui-sans-serif, system-ui, sans-serif",
|
|
4
|
+
"font-display": "Georgia, serif",
|
|
5
|
+
"font-mono": "ui-monospace, SFMono-Regular, monospace",
|
|
6
|
+
"header-top": "18px",
|
|
7
|
+
"header-offset": "0px",
|
|
8
|
+
"page-offset": "0px"
|
|
9
|
+
},
|
|
10
|
+
"dark": {
|
|
11
|
+
"bg": "oklch(0.245 0.015 275)",
|
|
12
|
+
"bg-2": "oklch(0.29 0.017 275)",
|
|
13
|
+
"surface-3": "oklch(0.325 0.018 275)",
|
|
14
|
+
"input": "oklch(0.35 0.018 275)",
|
|
15
|
+
"hover": "oklch(0.38 0.018 275)",
|
|
16
|
+
"surface": "rgba(255, 255, 255, 0.06)",
|
|
17
|
+
"surface-2": "rgba(255, 255, 255, 0.09)",
|
|
18
|
+
"border": "rgba(255, 255, 255, 0.08)",
|
|
19
|
+
"border-2": "rgba(255, 255, 255, 0.13)",
|
|
20
|
+
"border-strong": "oklch(0.48 0.015 275)",
|
|
21
|
+
"text": "oklch(0.97 0.005 270)",
|
|
22
|
+
"text-dim": "oklch(0.72 0.01 270)",
|
|
23
|
+
"text-mute": "oklch(0.55 0.01 270)",
|
|
24
|
+
"accent": "#a78bfa",
|
|
25
|
+
"input-focus": "color-mix(in oklch, var(--bnh-accent) 55%, transparent)",
|
|
26
|
+
"input-focus-ring": "color-mix(in oklch, var(--bnh-accent) 20%, transparent)",
|
|
27
|
+
"green": "#22c55e",
|
|
28
|
+
"amber": "#f59e0b",
|
|
29
|
+
"violet": "#a78bfa",
|
|
30
|
+
"blue": "#60a5fa",
|
|
31
|
+
"red": "#fb7185",
|
|
32
|
+
"orange": "#fb923c",
|
|
33
|
+
"link": "#94a3b8",
|
|
34
|
+
"primary": "#e8d5b5",
|
|
35
|
+
"primary-hover": "#f0e4ce",
|
|
36
|
+
"radius-sm": "6px",
|
|
37
|
+
"radius-md": "10px",
|
|
38
|
+
"radius-lg": "16px",
|
|
39
|
+
"radius-xl": "24px",
|
|
40
|
+
"modal-backdrop-blur": "20px",
|
|
41
|
+
"popover-backdrop-blur": "56px",
|
|
42
|
+
"glass-shadow": "0 1px 0 rgba(255,255,255,.06) inset, 0 -1px 0 rgba(0,0,0,.15) inset, 0 20px 60px rgba(0,0,0,.35), 0 4px 16px rgba(0,0,0,.25)",
|
|
43
|
+
"popover-shadow": "0 1px 0 rgba(255,255,255,.06) inset, 0 -1px 0 rgba(0,0,0,.2) inset, 0 24px 70px rgba(0,0,0,.5), 0 6px 20px rgba(0,0,0,.35)",
|
|
44
|
+
"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)",
|
|
45
|
+
"frosted-background": "radial-gradient(ellipse 110% 65% at 50% -10%, color-mix(in oklch, var(--bnh-accent) 14%, transparent), transparent 70%), color-mix(in oklch, var(--bnh-bg) 70%, transparent)"
|
|
46
|
+
},
|
|
47
|
+
"light": {
|
|
48
|
+
"bg": "oklch(0.924 0.009 85)",
|
|
49
|
+
"bg-2": "oklch(0.978 0.004 85)",
|
|
50
|
+
"surface-3": "#fffefa",
|
|
51
|
+
"input": "oklch(0.93 0.007 85)",
|
|
52
|
+
"hover": "oklch(0.9 0.008 85)",
|
|
53
|
+
"surface": "rgba(255, 254, 250, 0.55)",
|
|
54
|
+
"surface-2": "rgba(255, 254, 250, 0.92)",
|
|
55
|
+
"border": "rgba(62, 52, 36, 0.11)",
|
|
56
|
+
"border-2": "rgba(62, 52, 36, 0.17)",
|
|
57
|
+
"border-strong": "#aca69c",
|
|
58
|
+
"text": "oklch(0.24 0.012 70)",
|
|
59
|
+
"text-dim": "oklch(0.45 0.014 70)",
|
|
60
|
+
"text-mute": "oklch(0.6 0.012 75)",
|
|
61
|
+
"accent": "#7c3aed",
|
|
62
|
+
"input-focus": "color-mix(in oklch, var(--bnh-accent) 55%, transparent)",
|
|
63
|
+
"input-focus-ring": "color-mix(in oklch, var(--bnh-accent) 20%, transparent)",
|
|
64
|
+
"green": "#16a34a",
|
|
65
|
+
"amber": "#d97706",
|
|
66
|
+
"violet": "#7c3aed",
|
|
67
|
+
"blue": "#2563eb",
|
|
68
|
+
"red": "#e11d48",
|
|
69
|
+
"orange": "#ea580c",
|
|
70
|
+
"link": "#64748b",
|
|
71
|
+
"primary": "#7c6540",
|
|
72
|
+
"primary-hover": "#6b5636",
|
|
73
|
+
"radius-sm": "6px",
|
|
74
|
+
"radius-md": "10px",
|
|
75
|
+
"radius-lg": "16px",
|
|
76
|
+
"radius-xl": "24px",
|
|
77
|
+
"modal-backdrop-blur": "20px",
|
|
78
|
+
"popover-backdrop-blur": "56px",
|
|
79
|
+
"glass-shadow": "0 1px 0 rgba(255,255,255,.9) inset, 0 -1px 0 rgba(0,0,0,.04) inset, 0 12px 40px rgba(30,20,60,.1), 0 2px 8px rgba(30,20,60,.06)",
|
|
80
|
+
"popover-shadow": "0 1px 0 rgba(255,255,255,.9) inset, 0 -1px 0 rgba(0,0,0,.05) inset, 0 16px 50px rgba(30,20,60,.15), 0 3px 10px rgba(30,20,60,.08)",
|
|
81
|
+
"popover-background": "radial-gradient(ellipse 110% 65% at 50% -10%, color-mix(in oklch, var(--bnh-accent) 10%, transparent) 0%, transparent 70%), linear-gradient(135deg, color-mix(in oklch, white 42%, transparent), transparent 52%), color-mix(in oklch, var(--bnh-bg-2) 58%, transparent)",
|
|
82
|
+
"frosted-background": "radial-gradient(ellipse 110% 65% at 50% -10%, color-mix(in oklch, var(--bnh-accent) 9%, transparent), transparent 70%), color-mix(in oklch, var(--bnh-bg-2) 75%, transparent)"
|
|
83
|
+
}
|
|
84
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@cosborn2/ui",
|
|
3
|
+
"version": "0.1.0-beta.0",
|
|
4
|
+
"description": "Lightweight React components and settings layouts with granular CSS and server-compatible primitives.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"access": "public"
|
|
9
|
+
},
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/COsborn2/ui.git"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist",
|
|
16
|
+
"README.md",
|
|
17
|
+
"LICENSE"
|
|
18
|
+
],
|
|
19
|
+
"sideEffects": [
|
|
20
|
+
"**/*.css"
|
|
21
|
+
],
|
|
22
|
+
"exports": {
|
|
23
|
+
"./button": {
|
|
24
|
+
"types": "./dist/button.d.ts",
|
|
25
|
+
"import": "./dist/button.js"
|
|
26
|
+
},
|
|
27
|
+
"./input": {
|
|
28
|
+
"types": "./dist/input.d.ts",
|
|
29
|
+
"import": "./dist/input.js"
|
|
30
|
+
},
|
|
31
|
+
"./select": {
|
|
32
|
+
"types": "./dist/select.d.ts",
|
|
33
|
+
"import": "./dist/select.js"
|
|
34
|
+
},
|
|
35
|
+
"./skeleton": {
|
|
36
|
+
"types": "./dist/skeleton.d.ts",
|
|
37
|
+
"import": "./dist/skeleton.js"
|
|
38
|
+
},
|
|
39
|
+
"./icon-button": {
|
|
40
|
+
"types": "./dist/icon-button.d.ts",
|
|
41
|
+
"import": "./dist/icon-button.js"
|
|
42
|
+
},
|
|
43
|
+
"./ghost-text-button": {
|
|
44
|
+
"types": "./dist/ghost-text-button.d.ts",
|
|
45
|
+
"import": "./dist/ghost-text-button.js"
|
|
46
|
+
},
|
|
47
|
+
"./glass-popover-surface": {
|
|
48
|
+
"types": "./dist/glass-popover-surface.d.ts",
|
|
49
|
+
"import": "./dist/glass-popover-surface.js"
|
|
50
|
+
},
|
|
51
|
+
"./header-shell": {
|
|
52
|
+
"types": "./dist/header-shell.d.ts",
|
|
53
|
+
"import": "./dist/header-shell.js"
|
|
54
|
+
},
|
|
55
|
+
"./pill": {
|
|
56
|
+
"types": "./dist/pill.d.ts",
|
|
57
|
+
"import": "./dist/pill.js"
|
|
58
|
+
},
|
|
59
|
+
"./expandable-pill": {
|
|
60
|
+
"types": "./dist/expandable-pill.d.ts",
|
|
61
|
+
"import": "./dist/expandable-pill.js"
|
|
62
|
+
},
|
|
63
|
+
"./segmented-control": {
|
|
64
|
+
"types": "./dist/segmented-control.d.ts",
|
|
65
|
+
"import": "./dist/segmented-control.js"
|
|
66
|
+
},
|
|
67
|
+
"./switch": {
|
|
68
|
+
"types": "./dist/switch.d.ts",
|
|
69
|
+
"import": "./dist/switch.js"
|
|
70
|
+
},
|
|
71
|
+
"./settings": {
|
|
72
|
+
"types": "./dist/settings.d.ts",
|
|
73
|
+
"import": "./dist/settings.js"
|
|
74
|
+
},
|
|
75
|
+
"./settings-rail": {
|
|
76
|
+
"types": "./dist/settings-rail.d.ts",
|
|
77
|
+
"import": "./dist/settings-rail.js"
|
|
78
|
+
},
|
|
79
|
+
"./modal": {
|
|
80
|
+
"types": "./dist/modal.d.ts",
|
|
81
|
+
"import": "./dist/modal.js"
|
|
82
|
+
},
|
|
83
|
+
"./confirm-dialog": {
|
|
84
|
+
"types": "./dist/confirm-dialog.d.ts",
|
|
85
|
+
"import": "./dist/confirm-dialog.js"
|
|
86
|
+
},
|
|
87
|
+
"./button.css": "./dist/styles/button.css",
|
|
88
|
+
"./input.css": "./dist/styles/input.css",
|
|
89
|
+
"./select.css": "./dist/styles/select.css",
|
|
90
|
+
"./skeleton.css": "./dist/styles/skeleton.css",
|
|
91
|
+
"./icon-button.css": "./dist/styles/icon-button.css",
|
|
92
|
+
"./ghost-text-button.css": "./dist/styles/ghost-text-button.css",
|
|
93
|
+
"./glass-popover-surface.css": "./dist/styles/glass-popover-surface.css",
|
|
94
|
+
"./header-shell.css": "./dist/styles/header-shell.css",
|
|
95
|
+
"./pill.css": "./dist/styles/pill.css",
|
|
96
|
+
"./expandable-pill.css": "./dist/styles/expandable-pill.css",
|
|
97
|
+
"./segmented-control.css": "./dist/styles/segmented-control.css",
|
|
98
|
+
"./switch.css": "./dist/styles/switch.css",
|
|
99
|
+
"./settings.css": "./dist/styles/settings.css",
|
|
100
|
+
"./settings-rail.css": "./dist/styles/settings-rail.css",
|
|
101
|
+
"./modal.css": "./dist/styles/modal.css",
|
|
102
|
+
"./confirm-dialog.css": "./dist/styles/confirm-dialog.css",
|
|
103
|
+
"./theme.css": "./dist/styles/theme.css",
|
|
104
|
+
"./all.css": "./dist/styles/all.css",
|
|
105
|
+
"./tokens.json": "./dist/tokens.json",
|
|
106
|
+
"./package.json": "./package.json",
|
|
107
|
+
"./surface": {
|
|
108
|
+
"types": "./dist/surface.d.ts",
|
|
109
|
+
"import": "./dist/surface.js"
|
|
110
|
+
},
|
|
111
|
+
"./surface.css": "./dist/styles/surface.css",
|
|
112
|
+
"./data-table": {
|
|
113
|
+
"types": "./dist/data-table.d.ts",
|
|
114
|
+
"import": "./dist/data-table.js"
|
|
115
|
+
},
|
|
116
|
+
"./data-table.css": "./dist/styles/data-table.css",
|
|
117
|
+
"./pagination": {
|
|
118
|
+
"types": "./dist/pagination.d.ts",
|
|
119
|
+
"import": "./dist/pagination.js"
|
|
120
|
+
},
|
|
121
|
+
"./pagination.css": "./dist/styles/pagination.css",
|
|
122
|
+
"./theme-toggle": {
|
|
123
|
+
"types": "./dist/theme-toggle.d.ts",
|
|
124
|
+
"import": "./dist/theme-toggle.js"
|
|
125
|
+
},
|
|
126
|
+
"./theme-toggle.css": "./dist/styles/theme-toggle.css",
|
|
127
|
+
"./color-picker": {
|
|
128
|
+
"types": "./dist/color-picker.d.ts",
|
|
129
|
+
"import": "./dist/color-picker.js"
|
|
130
|
+
},
|
|
131
|
+
"./color-picker.css": "./dist/styles/color-picker.css",
|
|
132
|
+
"./notice": {
|
|
133
|
+
"types": "./dist/notice.d.ts",
|
|
134
|
+
"import": "./dist/notice.js"
|
|
135
|
+
},
|
|
136
|
+
"./notice.css": "./dist/styles/notice.css",
|
|
137
|
+
"./actions-menu": {
|
|
138
|
+
"types": "./dist/actions-menu.d.ts",
|
|
139
|
+
"import": "./dist/actions-menu.js"
|
|
140
|
+
},
|
|
141
|
+
"./actions-menu.css": "./dist/styles/actions-menu.css",
|
|
142
|
+
"./toast": {
|
|
143
|
+
"types": "./dist/toast.d.ts",
|
|
144
|
+
"import": "./dist/toast.js"
|
|
145
|
+
},
|
|
146
|
+
"./toast.css": "./dist/styles/toast.css"
|
|
147
|
+
},
|
|
148
|
+
"scripts": {
|
|
149
|
+
"build": "tsc -p tsconfig.json && bun scripts/build-css.ts",
|
|
150
|
+
"dev": "bun scripts/watch.ts",
|
|
151
|
+
"lint": "eslint . && bun run typecheck",
|
|
152
|
+
"test": "bun test tests/*.test.ts*",
|
|
153
|
+
"test:package": "bun scripts/verify-package.ts",
|
|
154
|
+
"test:browser": "bun scripts/verify-browser.ts",
|
|
155
|
+
"prepack": "bun run build",
|
|
156
|
+
"prepublishOnly": "bun scripts/check-release.ts",
|
|
157
|
+
"typecheck": "tsc --noEmit -p tsconfig.json && tsc -p tsconfig.tools.json"
|
|
158
|
+
},
|
|
159
|
+
"peerDependencies": {
|
|
160
|
+
"react": "^19.0.0",
|
|
161
|
+
"react-dom": "^19.0.0"
|
|
162
|
+
},
|
|
163
|
+
"dependencies": {
|
|
164
|
+
"@radix-ui/react-dialog": "1.1.20",
|
|
165
|
+
"lucide-react": "0.577.0",
|
|
166
|
+
"@radix-ui/react-dropdown-menu": "2.1.21"
|
|
167
|
+
},
|
|
168
|
+
"devDependencies": {
|
|
169
|
+
"react": "19.3.0",
|
|
170
|
+
"react-dom": "19.3.0",
|
|
171
|
+
"@types/react": "^19.3.0",
|
|
172
|
+
"@types/react-dom": "^19.3.0",
|
|
173
|
+
"@types/node": "^26.3.0",
|
|
174
|
+
"@types/bun": "^1.4.0",
|
|
175
|
+
"typescript": "^6.0.3",
|
|
176
|
+
"esbuild": "^0.25.0",
|
|
177
|
+
"lightningcss": "^1.30.0",
|
|
178
|
+
"@playwright/test": "^1.55.0",
|
|
179
|
+
"next": "16.3.5",
|
|
180
|
+
"@tailwindcss/postcss": "4.3.3",
|
|
181
|
+
"tailwindcss": "4.3.3",
|
|
182
|
+
"eslint": "^9.39.4",
|
|
183
|
+
"typescript-eslint": "^8.70.1"
|
|
184
|
+
},
|
|
185
|
+
"packageManager": "bun@1.3.10"
|
|
186
|
+
}
|