devnonla-ui 0.16.1 → 0.17.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.
@@ -1,87 +0,0 @@
1
- import type { ButtonHTMLAttributes, ReactNode } from "react";
2
- import { cn } from "../lib/cn";
3
- import { Tooltip } from "../tooltip/Tooltip";
4
-
5
- export function DesktopBarButton({
6
- label,
7
- active,
8
- onClick,
9
- children,
10
- }: {
11
- label: string;
12
- active?: boolean;
13
- onClick?: () => void;
14
- children: ReactNode;
15
- }) {
16
- return (
17
- <Tooltip title={label} placement="bottom">
18
- <button
19
- type="button"
20
- aria-label={label}
21
- aria-current={active ? "true" : undefined}
22
- onClick={onClick}
23
- className={cn(
24
- "inline-flex size-8 items-center justify-center rounded-full border-0 bg-transparent cursor-pointer",
25
- active ? "bg-ink-active text-foreground" : "text-foreground/65 hover:bg-ink-hover hover:text-foreground",
26
- )}
27
- >
28
- {children}
29
- </button>
30
- </Tooltip>
31
- );
32
- }
33
-
34
- export function DesktopBarItem({
35
- label,
36
- active,
37
- onClick,
38
- className,
39
- children,
40
- ...rest
41
- }: {
42
- label?: ReactNode;
43
- active?: boolean;
44
- onClick?: () => void;
45
- className?: string;
46
- children?: ReactNode;
47
- } & ButtonHTMLAttributes<HTMLButtonElement>) {
48
- return (
49
- <button
50
- type="button"
51
- aria-current={active ? "true" : undefined}
52
- onClick={onClick}
53
- className={cn(
54
- "inline-flex h-7 items-center rounded-md border-0 bg-transparent px-2.5 text-sm font-medium leading-5 cursor-pointer",
55
- active ? "bg-ink-active text-foreground" : "text-foreground/85 hover:bg-ink-hover hover:text-foreground",
56
- className,
57
- )}
58
- {...rest}
59
- >
60
- {children ?? label}
61
- </button>
62
- );
63
- }
64
-
65
- export function DesktopBarDivider({ className }: { className?: string }) {
66
- return <span className={cn("mx-2 h-4 w-px bg-border", className)} aria-hidden />;
67
- }
68
-
69
- export type DesktopHeaderProps = {
70
- left?: ReactNode;
71
- right?: ReactNode;
72
- className?: string;
73
- };
74
-
75
- export function DesktopHeader({ left, right, className }: DesktopHeaderProps) {
76
- return (
77
- <header
78
- className={cn(
79
- "nonla-header-layer fixed inset-x-0 top-0 z-(--nonla-z-header,40) flex h-[42px] items-center justify-between gap-3 border-0 bg-background px-3",
80
- className,
81
- )}
82
- >
83
- <div className="flex min-w-0 items-center">{left}</div>
84
- <div className="flex min-w-0 shrink-0 items-center">{right}</div>
85
- </header>
86
- );
87
- }
@@ -1,25 +0,0 @@
1
- import { forwardRef, type ReactNode } from "react";
2
- import { Icon } from "../icon/Icon";
3
-
4
- const iconButtonClass =
5
- "group w-[96px] flex flex-col items-center gap-0.5 py-2 px-0 rounded-md border-none cursor-pointer select-none outline-none bg-transparent focus-visible:outline-2 focus-visible:outline-brand motion-safe:transition-transform motion-safe:hover:-translate-y-0.5 motion-safe:active:scale-[0.98]";
6
-
7
- const labelClass = "text-xs leading-[18px] font-semibold text-center line-clamp-2 w-full";
8
-
9
- export const DesktopIcon = forwardRef<
10
- HTMLButtonElement,
11
- {
12
- label: string;
13
- media?: ReactNode;
14
- active?: boolean;
15
- onCard?: boolean;
16
- onClick?: () => void;
17
- }
18
- >(function DesktopIcon({ label, media, active = false, onCard = false, onClick }, ref) {
19
- return (
20
- <button ref={ref} type="button" title={label} aria-label={label} aria-current={active ? "true" : undefined} dir="ltr" onClick={onClick} className={iconButtonClass}>
21
- {media ?? <Icon name="stars" size={32} />}
22
- <span className={`${labelClass} ${onCard ? "text-foreground" : "text-white [text-shadow:0_1px_2px_rgba(0,0,0,0.85)]"}`}>{label}</span>
23
- </button>
24
- );
25
- });
@@ -1,6 +0,0 @@
1
- import type { ReactNode } from "react";
2
- import { cn } from "../lib/cn";
3
-
4
- export function DesktopStage({ children, className }: { children?: ReactNode; className?: string }) {
5
- return <div className={cn("relative h-dvh w-screen overflow-hidden bg-background", className)}>{children}</div>;
6
- }