@heybejs/ui 0.0.0-stage → 1.0.2
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 +32 -2
- package/dist/hooks/mergeProps.d.ts +1 -0
- package/dist/hooks/mergeProps.js +19 -0
- package/dist/hooks/useDismiss.d.ts +6 -0
- package/dist/hooks/useDismiss.js +34 -0
- package/dist/hooks/useListKeyboard.d.ts +9 -0
- package/dist/hooks/useListKeyboard.js +56 -0
- package/dist/hooks/useMergeRefs.d.ts +2 -0
- package/dist/hooks/useMergeRefs.js +18 -0
- package/dist/hooks/usePosition.d.ts +13 -0
- package/dist/hooks/usePosition.js +76 -0
- package/dist/hooks/useTooltipDelay.d.ts +5 -0
- package/dist/hooks/useTooltipDelay.js +28 -0
- package/dist/hooks/useTopLayer.d.ts +2 -0
- package/dist/hooks/useTopLayer.js +12 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.js +25 -0
- package/dist/primitives/Combobox.d.ts +18 -0
- package/dist/primitives/Combobox.js +98 -0
- package/dist/primitives/Dialog.d.ts +10 -0
- package/dist/primitives/Dialog.js +48 -0
- package/dist/primitives/Menu.d.ts +22 -0
- package/dist/primitives/Menu.js +97 -0
- package/dist/primitives/Popover.d.ts +13 -0
- package/dist/primitives/Popover.js +47 -0
- package/dist/primitives/RadioGroup.d.ts +14 -0
- package/dist/primitives/RadioGroup.js +38 -0
- package/dist/primitives/Switch.d.ts +10 -0
- package/dist/primitives/Switch.js +6 -0
- package/dist/primitives/Tabs.d.ts +16 -0
- package/dist/primitives/Tabs.js +44 -0
- package/dist/primitives/Tooltip.d.ts +6 -0
- package/dist/primitives/Tooltip.js +59 -0
- package/dist/primitives/index.d.ts +8 -0
- package/dist/primitives/index.js +8 -0
- package/dist/state/useControlledState.d.ts +1 -0
- package/dist/state/useControlledState.js +12 -0
- package/dist/state/useListState.d.ts +12 -0
- package/dist/state/useListState.js +30 -0
- package/dist/state/useOverlayState.d.ts +10 -0
- package/dist/state/useOverlayState.js +8 -0
- package/dist/style.css +2 -0
- package/dist/styled/Badge.d.ts +12 -0
- package/dist/styled/Badge.js +10 -0
- package/dist/styled/Button.d.ts +7 -0
- package/dist/styled/Button.js +21 -0
- package/dist/styled/Checkbox.d.ts +5 -0
- package/dist/styled/Checkbox.js +7 -0
- package/dist/styled/CodeArea.d.ts +32 -0
- package/dist/styled/CodeArea.js +291 -0
- package/dist/styled/Combobox.d.ts +4 -0
- package/dist/styled/Combobox.js +18 -0
- package/dist/styled/Confirm.d.ts +15 -0
- package/dist/styled/Confirm.js +29 -0
- package/dist/styled/CopyButton.d.ts +5 -0
- package/dist/styled/CopyButton.js +26 -0
- package/dist/styled/Dialog.d.ts +6 -0
- package/dist/styled/Dialog.js +27 -0
- package/dist/styled/Disclosure.d.ts +10 -0
- package/dist/styled/Disclosure.js +13 -0
- package/dist/styled/EmptyState.d.ts +6 -0
- package/dist/styled/EmptyState.js +4 -0
- package/dist/styled/FieldShell.d.ts +13 -0
- package/dist/styled/FieldShell.js +7 -0
- package/dist/styled/FileField.d.ts +9 -0
- package/dist/styled/FileField.js +32 -0
- package/dist/styled/Menu.d.ts +4 -0
- package/dist/styled/Menu.js +19 -0
- package/dist/styled/NumberField.d.ts +3 -0
- package/dist/styled/NumberField.js +10 -0
- package/dist/styled/Popover.d.ts +3 -0
- package/dist/styled/Popover.js +10 -0
- package/dist/styled/RadioGroup.d.ts +4 -0
- package/dist/styled/RadioGroup.js +9 -0
- package/dist/styled/Section.d.ts +5 -0
- package/dist/styled/Section.js +6 -0
- package/dist/styled/Select.d.ts +3 -0
- package/dist/styled/Select.js +8 -0
- package/dist/styled/Switch.d.ts +4 -0
- package/dist/styled/Switch.js +8 -0
- package/dist/styled/Table.d.ts +19 -0
- package/dist/styled/Table.js +15 -0
- package/dist/styled/Tabs.d.ts +11 -0
- package/dist/styled/Tabs.js +5 -0
- package/dist/styled/TextField.d.ts +3 -0
- package/dist/styled/TextField.js +7 -0
- package/dist/styled/Toasts.d.ts +10 -0
- package/dist/styled/Toasts.js +29 -0
- package/dist/styled/Tooltip.d.ts +3 -0
- package/dist/styled/Tooltip.js +10 -0
- package/dist/styled/field.d.ts +16 -0
- package/dist/styled/field.js +19 -0
- package/dist/styled/glass.d.ts +1 -0
- package/dist/styled/glass.js +1 -0
- package/dist/styled/tv.d.ts +1 -0
- package/dist/styled/tv.js +2 -0
- package/dist/test-clock.d.ts +1 -0
- package/dist/test-clock.js +2 -0
- package/package.json +68 -3
- package/src/theme.css +173 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { RadioGroup as RadioGroupPrimitive } from "../primitives/RadioGroup.js";
|
|
3
|
+
import { useFieldIds } from "./field.js";
|
|
4
|
+
import { FieldMessages } from "./FieldShell.js";
|
|
5
|
+
export function RadioGroup({ label, error, hint, ...rest }) {
|
|
6
|
+
const { errorId, hintId, aria } = useFieldIds({ error, hint });
|
|
7
|
+
const horizontal = rest.orientation === "horizontal";
|
|
8
|
+
return (_jsxs("div", { className: "flex flex-col gap-1", children: [_jsx("span", { className: "text-sm font-medium text-text", children: label }), _jsx(RadioGroupPrimitive, { ...rest, label: label, "aria-describedby": aria["aria-describedby"], "aria-invalid": aria["aria-invalid"], className: `flex gap-2 ${horizontal ? "flex-row flex-wrap" : "flex-col"} [&>button]:flex [&>button]:items-center [&>button]:gap-2 [&>button]:text-left [&>button]:text-sm [&>button]:text-text [&>button]:before:size-4 [&>button]:before:rounded-full [&>button]:before:border [&>button]:before:border-control [&>button]:before:bg-surface aria-[invalid=true]:[&>button]:before:border-danger [&>button]:before:content-[''] [&>button[data-checked]]:before:border-[5px] [&>button[data-checked]]:before:border-accent [&>button]:focus-visible:outline-2 [&>button]:focus-visible:outline-offset-2 [&>button]:focus-visible:outline-focus [&>button]:disabled:opacity-50` }), _jsx(FieldMessages, { errorId: errorId, hintId: hintId, error: error, hint: hint })] }));
|
|
9
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useId } from "react";
|
|
3
|
+
export function Section({ title, children, }) {
|
|
4
|
+
const id = useId();
|
|
5
|
+
return (_jsxs("section", { "aria-labelledby": id, className: "flex flex-col gap-3", children: [_jsx("h3", { id: id, className: "text-sm font-semibold text-text", children: title }), children] }));
|
|
6
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ChevronDown } from "lucide-react";
|
|
3
|
+
import { inputClass, useFieldIds } from "./field.js";
|
|
4
|
+
import { FieldShell } from "./FieldShell.js";
|
|
5
|
+
export function Select({ label, error, hint, children, ...rest }) {
|
|
6
|
+
const ids = useFieldIds({ error, hint });
|
|
7
|
+
return (_jsx(FieldShell, { ...ids, label: label, error: error, hint: hint, children: _jsxs("div", { className: "relative", children: [_jsx("select", { ...rest, ...ids.aria, className: `${inputClass} appearance-none pr-8`, children: children }), _jsx(ChevronDown, { size: 15, strokeWidth: 1.75, "aria-hidden": true, className: "pointer-events-none absolute right-2.5 top-1/2 -translate-y-1/2 text-muted" })] }) }));
|
|
8
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { Switch as SwitchPrimitive } from "../primitives/Switch.js";
|
|
3
|
+
import { type FieldProps } from "./field.js";
|
|
4
|
+
export declare function Switch({ label, error, hint, ...rest }: FieldProps & Omit<ComponentProps<typeof SwitchPrimitive>, "className">): import("react").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Switch as SwitchPrimitive } from "../primitives/Switch.js";
|
|
3
|
+
import { useFieldIds } from "./field.js";
|
|
4
|
+
import { FieldMessages } from "./FieldShell.js";
|
|
5
|
+
export function Switch({ label, error, hint, ...rest }) {
|
|
6
|
+
const { errorId, hintId, aria } = useFieldIds({ error, hint });
|
|
7
|
+
return (_jsxs("div", { className: "flex flex-col gap-1", children: [_jsxs("label", { className: "flex items-center gap-2", children: [_jsx(SwitchPrimitive, { ...rest, label: label, "aria-describedby": aria["aria-describedby"], "aria-invalid": aria["aria-invalid"], className: "relative h-5 w-9 shrink-0 rounded-full bg-control transition-colors duration-[var(--hb-duration)] motion-reduce:transition-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus aria-[invalid=true]:outline-2 aria-[invalid=true]:outline-danger disabled:opacity-50 data-[checked]:bg-accent [&>span]:absolute [&>span]:top-0.5 [&>span]:left-0.5 [&>span]:size-4 [&>span]:rounded-full [&>span]:bg-thumb [&>span]:transition-transform [&>span]:duration-[var(--hb-duration)] motion-reduce:[&>span]:transition-none data-[checked]:[&>span]:translate-x-4" }), _jsx("span", { className: "text-sm text-text", children: label })] }), _jsx(FieldMessages, { errorId: errorId, hintId: hintId, error: error, hint: hint })] }));
|
|
8
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export type SortDirection = "asc" | "desc";
|
|
3
|
+
export declare function Table({ caption, stickyHeader, children, }: {
|
|
4
|
+
caption?: string;
|
|
5
|
+
stickyHeader?: boolean;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
}): import("react").JSX.Element;
|
|
8
|
+
export declare function Th({ children, sort, onSort, align, }: {
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
align?: "left" | "right";
|
|
11
|
+
sort?: SortDirection | null;
|
|
12
|
+
onSort?: () => void;
|
|
13
|
+
}): import("react").JSX.Element;
|
|
14
|
+
export declare function Td({ children, wrap, fill, align, }: {
|
|
15
|
+
children?: ReactNode;
|
|
16
|
+
wrap?: boolean;
|
|
17
|
+
fill?: boolean;
|
|
18
|
+
align?: "left" | "right";
|
|
19
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ArrowDown, ArrowUp, ChevronsUpDown } from "lucide-react";
|
|
3
|
+
export function Table({ caption, stickyHeader, children, }) {
|
|
4
|
+
return (_jsx("div", { className: `overflow-auto${stickyHeader ? " max-h-[calc(100dvh-12rem)]" : ""}`, children: _jsxs("table", { "data-sticky-header": stickyHeader || undefined, className: `w-full border-collapse text-left text-sm${stickyHeader ? " [&_th]:sticky [&_th]:top-0 [&_th]:z-10 [&_th]:bg-surface" : ""}`, children: [caption && _jsx("caption", { className: "sr-only", children: caption }), children] }) }));
|
|
5
|
+
}
|
|
6
|
+
const sortIcon = { asc: ArrowUp, desc: ArrowDown };
|
|
7
|
+
export function Th({ children, sort, onSort, align, }) {
|
|
8
|
+
const ariaSort = sort === "asc" ? "ascending" : sort === "desc" ? "descending" : "none";
|
|
9
|
+
const Icon = sort ? sortIcon[sort] : ChevronsUpDown;
|
|
10
|
+
return (_jsx("th", { scope: "col", "aria-sort": onSort ? ariaSort : undefined, className: `border-b border-line px-3 py-2 text-xs font-medium text-muted${align === "right" ? " text-right" : ""}`, children: onSort ? (_jsxs("button", { type: "button", onClick: onSort, className: "inline-flex items-center gap-1 rounded font-medium hover:text-text focus-visible:outline-2 focus-visible:outline-focus", children: [children, _jsx(Icon, { size: 13, strokeWidth: 1.75, "aria-hidden": true, className: sort ? "text-text" : "text-faint" })] })) : (children) }));
|
|
11
|
+
}
|
|
12
|
+
export function Td({ children, wrap, fill, align, }) {
|
|
13
|
+
const truncate = !wrap && typeof children === "string";
|
|
14
|
+
return (_jsx("td", { title: truncate ? children : undefined, className: `border-b border-line px-3 py-2 text-text${align === "right" ? " text-right" : ""}${fill ? " w-full max-w-0" : wrap ? "" : " max-w-xs whitespace-nowrap"}${truncate ? " truncate" : ""}`, children: children }));
|
|
15
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Tabs as TabsPrimitive } from "../primitives/Tabs.js";
|
|
3
|
+
export function Tabs(props) {
|
|
4
|
+
return (_jsx(TabsPrimitive, { ...props, className: "flex gap-1 border-b border-line [&_[role=tab]]:-mb-px [&_[role=tab]]:border-b-2 [&_[role=tab]]:border-transparent [&_[role=tab]]:px-3 [&_[role=tab]]:py-2 [&_[role=tab]]:text-sm [&_[role=tab]]:text-muted [&_[role=tab]]:transition-colors [&_[role=tab]]:duration-[var(--hb-duration)] motion-reduce:[&_[role=tab]]:transition-none [&_[role=tab]:disabled]:cursor-not-allowed [&_[role=tab]:disabled]:opacity-50 [&_[role=tab]:hover:not(:disabled)]:text-text [&_[role=tab]:focus-visible]:outline-2 [&_[role=tab]:focus-visible]:outline-focus [&_[role=tab][data-selected]]:border-accent [&_[role=tab][data-selected]]:font-medium [&_[role=tab][data-selected]]:text-text" }));
|
|
5
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { inputClass, useFieldIds } from "./field.js";
|
|
3
|
+
import { FieldShell } from "./FieldShell.js";
|
|
4
|
+
export function TextField({ label, error, hint, className, ...rest }) {
|
|
5
|
+
const ids = useFieldIds({ error, hint });
|
|
6
|
+
return (_jsx(FieldShell, { ...ids, label: label, error: error, hint: hint, children: _jsx("input", { type: "text", ...rest, ...ids.aria, className: `${inputClass} ${className ?? ""}` }) }));
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
interface Toasts {
|
|
3
|
+
success(msg: string): void;
|
|
4
|
+
error(msg: string): void;
|
|
5
|
+
}
|
|
6
|
+
export declare function ToastProvider({ children }: {
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
}): import("react").JSX.Element;
|
|
9
|
+
export declare function useToast(): Toasts;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { CircleAlert, CircleCheck } from "lucide-react";
|
|
3
|
+
import { createContext, useCallback, useContext, useMemo, useRef, useState, } from "react";
|
|
4
|
+
import { glass } from "./glass.js";
|
|
5
|
+
const ToastContext = createContext(null);
|
|
6
|
+
function renderToast(t) {
|
|
7
|
+
const Icon = t.kind === "error" ? CircleAlert : CircleCheck;
|
|
8
|
+
return (_jsxs("div", { role: t.kind === "error" ? "alert" : undefined, className: `${glass} flex items-center gap-2 rounded-base px-3 py-2 text-sm text-text`, children: [_jsx(Icon, { size: 15, strokeWidth: 1.75, className: t.kind === "error" ? "text-danger-text" : "text-accent-text" }), t.message] }, t.id));
|
|
9
|
+
}
|
|
10
|
+
export function ToastProvider({ children }) {
|
|
11
|
+
const [toasts, setToasts] = useState([]);
|
|
12
|
+
const nextId = useRef(1);
|
|
13
|
+
const push = useCallback((kind, message) => {
|
|
14
|
+
const id = nextId.current++;
|
|
15
|
+
setToasts((all) => [...all, { id, kind, message }]);
|
|
16
|
+
setTimeout(() => setToasts((all) => all.filter((t) => t.id !== id)), 4000);
|
|
17
|
+
}, []);
|
|
18
|
+
const api = useMemo(() => ({
|
|
19
|
+
success: (msg) => push("success", msg),
|
|
20
|
+
error: (msg) => push("error", msg),
|
|
21
|
+
}), [push]);
|
|
22
|
+
return (_jsxs(ToastContext.Provider, { value: api, children: [children, _jsx("div", { role: "status", "aria-live": "polite", className: "fixed right-4 bottom-4 z-50 flex flex-col gap-2", children: toasts.map(renderToast) })] }));
|
|
23
|
+
}
|
|
24
|
+
export function useToast() {
|
|
25
|
+
const toasts = useContext(ToastContext);
|
|
26
|
+
if (!toasts)
|
|
27
|
+
throw new Error("ToastProvider is missing");
|
|
28
|
+
return toasts;
|
|
29
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Tooltip as TooltipPrimitive } from "../primitives/Tooltip.js";
|
|
3
|
+
import { glass } from "./glass.js";
|
|
4
|
+
import { tv } from "./tv.js";
|
|
5
|
+
const tooltip = tv({
|
|
6
|
+
base: `${glass} z-50 rounded-control px-2 py-1 text-xs text-text`,
|
|
7
|
+
});
|
|
8
|
+
export function Tooltip({ className, ...rest }) {
|
|
9
|
+
return _jsx(TooltipPrimitive, { ...rest, className: tooltip({ className }) });
|
|
10
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface FieldProps {
|
|
2
|
+
label: string;
|
|
3
|
+
error?: string;
|
|
4
|
+
hint?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function useFieldIds({ error, hint, }: Pick<FieldProps, "error" | "hint">): {
|
|
7
|
+
id: string;
|
|
8
|
+
errorId: string;
|
|
9
|
+
hintId: string;
|
|
10
|
+
aria: {
|
|
11
|
+
id: string;
|
|
12
|
+
"aria-invalid": true | undefined;
|
|
13
|
+
"aria-describedby": string | undefined;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export declare const inputClass = "h-9 w-full rounded-control border border-field-line bg-field px-2.5 text-sm text-text placeholder:text-faint focus-visible:outline-2 focus-visible:outline-offset-0 focus-visible:outline-focus aria-[invalid=true]:border-danger disabled:opacity-50";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useId } from "react";
|
|
2
|
+
export function useFieldIds({ error, hint, }) {
|
|
3
|
+
const id = useId();
|
|
4
|
+
const errorId = `${id}-error`;
|
|
5
|
+
const hintId = `${id}-hint`;
|
|
6
|
+
const describedBy = [hint ? hintId : "", error ? errorId : ""].filter(Boolean).join(" ") ||
|
|
7
|
+
undefined;
|
|
8
|
+
return {
|
|
9
|
+
id,
|
|
10
|
+
errorId,
|
|
11
|
+
hintId,
|
|
12
|
+
aria: {
|
|
13
|
+
id,
|
|
14
|
+
"aria-invalid": error ? true : undefined,
|
|
15
|
+
"aria-describedby": describedBy,
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export const inputClass = "h-9 w-full rounded-control border border-field-line bg-field px-2.5 text-sm text-text placeholder:text-faint focus-visible:outline-2 focus-visible:outline-offset-0 focus-visible:outline-focus aria-[invalid=true]:border-danger disabled:opacity-50";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const glass = "border border-line bg-glass-strong backdrop-blur-(--hb-glass-blur) backdrop-saturate-150 shadow-overlay";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const glass = "border border-line bg-glass-strong backdrop-blur-(--hb-glass-blur) backdrop-saturate-150 shadow-overlay";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const tv: import("tailwind-variants").TV<import("tailwind-variants").TVConfig>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const nextTestDay: () => Date;
|
package/package.json
CHANGED
|
@@ -1,6 +1,71 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@heybejs/ui",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "1.0.2",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"default": "./dist/index.js"
|
|
10
|
+
},
|
|
11
|
+
"./style.css": "./dist/style.css",
|
|
12
|
+
"./theme.css": "./src/theme.css",
|
|
13
|
+
"./primitives": {
|
|
14
|
+
"types": "./dist/primitives/index.d.ts",
|
|
15
|
+
"default": "./dist/primitives/index.js"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"dist",
|
|
20
|
+
"src/theme.css"
|
|
21
|
+
],
|
|
22
|
+
"sideEffects": [
|
|
23
|
+
"*.css"
|
|
24
|
+
],
|
|
25
|
+
"author": "emresandikci",
|
|
26
|
+
"repository": {
|
|
27
|
+
"type": "git",
|
|
28
|
+
"url": "git+https://github.com/emresandikci/heybe.git",
|
|
29
|
+
"directory": "packages/ui"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@codemirror/autocomplete": "^6.20.4",
|
|
33
|
+
"@codemirror/commands": "^6.11.1",
|
|
34
|
+
"@codemirror/lang-html": "^6.4.12",
|
|
35
|
+
"@codemirror/lang-javascript": "^6.2.5",
|
|
36
|
+
"@codemirror/lang-json": "^6.0.2",
|
|
37
|
+
"@codemirror/lang-sql": "^6.10.0",
|
|
38
|
+
"@codemirror/language": "^6.13.1",
|
|
39
|
+
"@codemirror/state": "^6.7.6",
|
|
40
|
+
"@codemirror/view": "^6.43.15",
|
|
41
|
+
"@lezer/highlight": "^1.2.5",
|
|
42
|
+
"lucide-react": "^1.74.0",
|
|
43
|
+
"tailwind-merge": "^3.0.0",
|
|
44
|
+
"tailwind-variants": "^4.0.2"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"react": "^19.0.0",
|
|
48
|
+
"react-dom": "^19.0.0"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@happy-dom/global-registrator": "^21.0.4",
|
|
52
|
+
"@tailwindcss/cli": "^4.3.0",
|
|
53
|
+
"@testing-library/dom": "^10.4.2",
|
|
54
|
+
"@testing-library/react": "^16.3.3",
|
|
55
|
+
"@testing-library/user-event": "^14.6.9",
|
|
56
|
+
"@types/bun": "^1.4.4",
|
|
57
|
+
"@types/react": "^19.3.0",
|
|
58
|
+
"@types/react-dom": "^19.3.0",
|
|
59
|
+
"happy-dom": "^21.0.4",
|
|
60
|
+
"react": "^19.3.0",
|
|
61
|
+
"react-dom": "^19.3.0",
|
|
62
|
+
"tailwindcss": "^4.3.0",
|
|
63
|
+
"typescript": "^7.0.2",
|
|
64
|
+
"@heybejs/configs": "0.0.0"
|
|
65
|
+
},
|
|
66
|
+
"scripts": {
|
|
67
|
+
"build": "rm -rf dist && tsc -p tsconfig.build.json && tailwindcss -i src/style.css -o dist/style.css --minify",
|
|
68
|
+
"release": "semantic-release -e semantic-release-monorepo",
|
|
69
|
+
"test": "bun test src"
|
|
70
|
+
}
|
|
6
71
|
}
|
package/src/theme.css
ADDED
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
@source ".";
|
|
2
|
+
|
|
3
|
+
@custom-variant dark (&:where([data-theme=dark], [data-theme=dark] *));
|
|
4
|
+
|
|
5
|
+
:root {
|
|
6
|
+
--hb-bg: #eef0f4;
|
|
7
|
+
--hb-surface: #ffffff;
|
|
8
|
+
--hb-surface-raised: #ffffff;
|
|
9
|
+
--hb-glass: rgba(255, 255, 255, 0.55);
|
|
10
|
+
--hb-glass-strong: rgba(255, 255, 255, 0.72);
|
|
11
|
+
--hb-glass-blur: 20px;
|
|
12
|
+
--hb-line: rgba(15, 15, 30, 0.08);
|
|
13
|
+
--hb-line-strong: rgba(15, 15, 30, 0.13);
|
|
14
|
+
--hb-field-line: #84848f;
|
|
15
|
+
--hb-field-bg: #f5f6f8;
|
|
16
|
+
--hb-text: #15151a;
|
|
17
|
+
--hb-text-muted: #61616c;
|
|
18
|
+
--hb-text-faint: #6c6c77;
|
|
19
|
+
--hb-control: #85858f;
|
|
20
|
+
--hb-thumb: #ffffff;
|
|
21
|
+
--hb-hover: rgba(15, 15, 30, 0.05);
|
|
22
|
+
--hb-accent: #1b7b9b;
|
|
23
|
+
--hb-accent-hover: #166a86;
|
|
24
|
+
--hb-accent-fg: #ffffff;
|
|
25
|
+
--hb-accent-text: #1b7b9b;
|
|
26
|
+
--hb-accent-soft: color-mix(in srgb, #1b7b9b 18%, transparent);
|
|
27
|
+
--hb-danger: #d6393f;
|
|
28
|
+
--hb-danger-hover: #bf2f35;
|
|
29
|
+
--hb-danger-fg: #ffffff;
|
|
30
|
+
--hb-danger-text: #a82a30;
|
|
31
|
+
--hb-success: #1a8f4f;
|
|
32
|
+
--hb-success-text: #14683a;
|
|
33
|
+
--hb-warning-bg: #fdf3dc;
|
|
34
|
+
--hb-warning-line: #e6c978;
|
|
35
|
+
--hb-warning-text: #70440a;
|
|
36
|
+
--hb-focus: #1b7b9b;
|
|
37
|
+
--hb-radius: 7px;
|
|
38
|
+
--hb-radius-control: 8px;
|
|
39
|
+
--hb-shadow-overlay: 0 16px 40px rgba(20, 24, 40, 0.14);
|
|
40
|
+
--hb-scrim: rgba(0, 0, 0, 0.4);
|
|
41
|
+
--hb-font: "Inter Variable", Inter, ui-sans-serif, system-ui, sans-serif;
|
|
42
|
+
--hb-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
43
|
+
--hb-duration: 150ms;
|
|
44
|
+
--accent: var(--hb-accent);
|
|
45
|
+
--cm-keyword: #7c3aed;
|
|
46
|
+
--cm-string: #047857;
|
|
47
|
+
--cm-number: #b45309;
|
|
48
|
+
--cm-name: #1d4ed8;
|
|
49
|
+
--cm-tag: #be123c;
|
|
50
|
+
--cm-comment: #64748b;
|
|
51
|
+
--cm-variable: #0e7490;
|
|
52
|
+
--cm-function: #a21caf;
|
|
53
|
+
--cm-operator: #c2410c;
|
|
54
|
+
--cm-punctuation: #475569;
|
|
55
|
+
--cm-focus: #2563eb;
|
|
56
|
+
--cm-selection: #bfdbfe;
|
|
57
|
+
--cm-tooltip: #ffffff;
|
|
58
|
+
color-scheme: light;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
:root[data-theme="dark"] {
|
|
62
|
+
--hb-bg: #0b0b0e;
|
|
63
|
+
--hb-surface: #121216;
|
|
64
|
+
--hb-surface-raised: #1a1a20;
|
|
65
|
+
--hb-glass: rgba(255, 255, 255, 0.04);
|
|
66
|
+
--hb-glass-strong: rgba(22, 22, 28, 0.86);
|
|
67
|
+
--hb-line: rgba(255, 255, 255, 0.07);
|
|
68
|
+
--hb-line-strong: rgba(255, 255, 255, 0.12);
|
|
69
|
+
--hb-field-line: #6e6e79;
|
|
70
|
+
--hb-field-bg: #1d1d23;
|
|
71
|
+
--hb-text: #ececf1;
|
|
72
|
+
--hb-text-muted: #9a9aa6;
|
|
73
|
+
--hb-text-faint: #83838e;
|
|
74
|
+
--hb-control: #70707b;
|
|
75
|
+
--hb-hover: rgba(255, 255, 255, 0.06);
|
|
76
|
+
--hb-accent-text: #3aa6c9;
|
|
77
|
+
--hb-danger-text: #f87171;
|
|
78
|
+
--hb-success: #3fb97a;
|
|
79
|
+
--hb-success-text: #4ade80;
|
|
80
|
+
--hb-warning-bg: #261f12;
|
|
81
|
+
--hb-warning-line: #4f4020;
|
|
82
|
+
--hb-warning-text: #f0c36b;
|
|
83
|
+
--hb-shadow-overlay: 0 16px 40px rgba(0, 0, 0, 0.45);
|
|
84
|
+
--hb-scrim: rgba(0, 0, 0, 0.7);
|
|
85
|
+
--cm-keyword: #c4b5fd;
|
|
86
|
+
--cm-string: #6ee7b7;
|
|
87
|
+
--cm-number: #fcd34d;
|
|
88
|
+
--cm-name: #93c5fd;
|
|
89
|
+
--cm-tag: #fda4af;
|
|
90
|
+
--cm-comment: #94a3b8;
|
|
91
|
+
--cm-variable: #67e8f9;
|
|
92
|
+
--cm-function: #f0abfc;
|
|
93
|
+
--cm-operator: #fdba74;
|
|
94
|
+
--cm-punctuation: #cbd5e1;
|
|
95
|
+
--cm-focus: #60a5fa;
|
|
96
|
+
--cm-selection: #1e3a8a;
|
|
97
|
+
--cm-tooltip: #1e293b;
|
|
98
|
+
color-scheme: dark;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
@theme inline {
|
|
102
|
+
--text-xs: 12.5px;
|
|
103
|
+
--text-xs--line-height: 1.4;
|
|
104
|
+
--color-bg: var(--hb-bg);
|
|
105
|
+
--color-surface: var(--hb-surface);
|
|
106
|
+
--color-raised: var(--hb-surface-raised);
|
|
107
|
+
--color-glass: var(--hb-glass);
|
|
108
|
+
--color-glass-strong: var(--hb-glass-strong);
|
|
109
|
+
--color-line: var(--hb-line);
|
|
110
|
+
--color-line-strong: var(--hb-line-strong);
|
|
111
|
+
--color-field-line: var(--hb-field-line);
|
|
112
|
+
--color-field: var(--hb-field-bg);
|
|
113
|
+
--color-text: var(--hb-text);
|
|
114
|
+
--color-muted: var(--hb-text-muted);
|
|
115
|
+
--color-faint: var(--hb-text-faint);
|
|
116
|
+
--color-control: var(--hb-control);
|
|
117
|
+
--color-thumb: var(--hb-thumb);
|
|
118
|
+
--color-hover: var(--hb-hover);
|
|
119
|
+
--color-accent: var(--hb-accent);
|
|
120
|
+
--color-accent-text: var(--hb-accent-text);
|
|
121
|
+
--color-accent-hover: var(--hb-accent-hover);
|
|
122
|
+
--color-accent-fg: var(--hb-accent-fg);
|
|
123
|
+
--color-accent-soft: var(--hb-accent-soft);
|
|
124
|
+
--color-danger: var(--hb-danger);
|
|
125
|
+
--color-danger-hover: var(--hb-danger-hover);
|
|
126
|
+
--color-danger-fg: var(--hb-danger-fg);
|
|
127
|
+
--color-danger-text: var(--hb-danger-text);
|
|
128
|
+
--color-success: var(--hb-success);
|
|
129
|
+
--color-success-text: var(--hb-success-text);
|
|
130
|
+
--color-warning-bg: var(--hb-warning-bg);
|
|
131
|
+
--color-warning-line: var(--hb-warning-line);
|
|
132
|
+
--color-warning-text: var(--hb-warning-text);
|
|
133
|
+
--color-focus: var(--hb-focus);
|
|
134
|
+
--radius-base: var(--hb-radius);
|
|
135
|
+
--radius-control: var(--hb-radius-control);
|
|
136
|
+
--shadow-overlay: var(--hb-shadow-overlay);
|
|
137
|
+
--color-scrim: var(--hb-scrim);
|
|
138
|
+
--font-sans: var(--hb-font);
|
|
139
|
+
--font-mono: var(--hb-font-mono);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
@supports not (backdrop-filter: blur(1px)) {
|
|
143
|
+
:root,
|
|
144
|
+
:root[data-theme="dark"] {
|
|
145
|
+
--hb-glass: var(--hb-surface-raised);
|
|
146
|
+
--hb-glass-strong: var(--hb-surface-raised);
|
|
147
|
+
--hb-glass-blur: 0px;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
@media (prefers-reduced-transparency: reduce) {
|
|
152
|
+
:root,
|
|
153
|
+
:root[data-theme="dark"] {
|
|
154
|
+
--hb-glass: var(--hb-surface-raised);
|
|
155
|
+
--hb-glass-strong: var(--hb-surface-raised);
|
|
156
|
+
--hb-glass-blur: 0px;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
@media (forced-colors: active) {
|
|
161
|
+
:root,
|
|
162
|
+
:root[data-theme="dark"] {
|
|
163
|
+
--hb-glass: Canvas;
|
|
164
|
+
--hb-glass-strong: Canvas;
|
|
165
|
+
--hb-glass-blur: 0px;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
@media (prefers-reduced-motion: reduce) {
|
|
170
|
+
:root {
|
|
171
|
+
--hb-duration: 0ms;
|
|
172
|
+
}
|
|
173
|
+
}
|