devnonla-ui 0.5.0 → 0.5.1
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/package.json +1 -1
- package/src/button/Button.tsx +1 -1
- package/src/chat/AgentChatbox.tsx +2 -2
- package/src/chat/AgentPanel.tsx +2 -2
- package/src/chat/message-ui/ChatInput.tsx +19 -4
- package/src/chat/tool-ui/ChatToolCall.tsx +1 -1
- package/src/colorpicker/ColorPicker.tsx +1 -1
- package/src/datepicker/DatePicker.tsx +2 -2
- package/src/dropdown/ContextMenu.tsx +1 -1
- package/src/dropdown/Dropdown.tsx +1 -1
- package/src/input/Input.tsx +2 -2
- package/src/menu/Menu.tsx +1 -1
- package/src/pagination/Pagination.tsx +2 -2
- package/src/segmented/Segmented.tsx +53 -4
- package/src/select/Select.tsx +5 -3
- package/src/splitter/Splitter.tsx +6 -12
- package/src/styles.css +19 -2
- package/src/tag/Tag.tsx +1 -1
- package/src/timepicker/TimePicker.tsx +5 -5
package/package.json
CHANGED
package/src/button/Button.tsx
CHANGED
|
@@ -88,7 +88,7 @@ function tokenAppearance(color: "default" | "primary" | "danger" | "link", varia
|
|
|
88
88
|
}
|
|
89
89
|
if (color === "link" || variant === "link") return "text-link border-transparent hover:text-link/80";
|
|
90
90
|
if (variant === "filled") return "bg-muted text-foreground border-transparent hover:bg-muted/80";
|
|
91
|
-
if (variant === "text") return "bg-transparent text-foreground border-transparent hover:bg-
|
|
91
|
+
if (variant === "text") return "bg-transparent text-foreground border-transparent hover:bg-ink-hover hover:text-foreground";
|
|
92
92
|
if (variant === "dashed") return "bg-transparent text-foreground border-dashed border-glass-border hover:bg-glass-bar backdrop-blur-xl";
|
|
93
93
|
return "nonla-btn-glass text-foreground";
|
|
94
94
|
}
|
|
@@ -90,7 +90,7 @@ export function AgentChatbox({
|
|
|
90
90
|
return (
|
|
91
91
|
<div className={cn("nonla-agent-chatbox relative flex h-full min-h-0 flex-col overflow-hidden bg-chat", className)}>
|
|
92
92
|
<OverlayScroll visibility={scrollbar} scrollRef={scrollRef} onScroll={onScroll} className="flex-1 min-h-0 min-w-0" innerClassName={messages.length === 0 ? "flex flex-col" : undefined}>
|
|
93
|
-
<div data-chat-scroll-content className={`max-w-
|
|
93
|
+
<div data-chat-scroll-content className={`max-w-200 mx-auto min-w-0 w-full ${messages.length === 0 ? "flex flex-1 flex-col pb-16" : "pt-4 pb-20"}`}>
|
|
94
94
|
{messages.length === 0 ? (
|
|
95
95
|
(emptyState ?? (
|
|
96
96
|
<ChatWelcome name={welcomeName} description={description} avatar={avatar} starters={starters} onStarter={sendMessage} disabled={generating} />
|
|
@@ -103,7 +103,7 @@ export function AgentChatbox({
|
|
|
103
103
|
|
|
104
104
|
<div className="relative shrink-0">
|
|
105
105
|
{accessory}
|
|
106
|
-
<div className="mx-auto w-full max-w-
|
|
106
|
+
<div className="mx-auto w-full max-w-200">
|
|
107
107
|
<ChatInput generating={generating} placeholder={placeholder} onSend={sendMessage} onCancel={cancel} toolbar={toolbar} enableTypeToFocus />
|
|
108
108
|
</div>
|
|
109
109
|
</div>
|
package/src/chat/AgentPanel.tsx
CHANGED
|
@@ -97,7 +97,7 @@ export function AgentPanel({
|
|
|
97
97
|
return (
|
|
98
98
|
<div className={cn("nonla-agent-panel relative flex h-full min-h-0 flex-col overflow-hidden bg-chat", className)}>
|
|
99
99
|
<OverlayScroll visibility={scrollbar} scrollRef={scrollRef} onScroll={onScroll} className="flex-1 min-h-0 min-w-0" innerClassName={messages.length === 0 ? "flex flex-col" : undefined}>
|
|
100
|
-
<div data-chat-scroll-content className={`max-w-
|
|
100
|
+
<div data-chat-scroll-content className={`max-w-200 mx-auto min-w-0 w-full ${messages.length === 0 ? "flex flex-1 flex-col pb-24" : "pt-4 pb-28"}`}>
|
|
101
101
|
{messages.length === 0 ? (
|
|
102
102
|
(emptyState ?? (
|
|
103
103
|
<ChatWelcome name={welcomeName} description={description} avatar={avatar} starters={starters} onStarter={sendMessage} disabled={generating} />
|
|
@@ -110,7 +110,7 @@ export function AgentPanel({
|
|
|
110
110
|
|
|
111
111
|
<div className="relative shrink-0">
|
|
112
112
|
{accessory}
|
|
113
|
-
<div className="mx-auto w-full max-w-
|
|
113
|
+
<div className="mx-auto w-full max-w-200">
|
|
114
114
|
<ChatInput generating={generating} placeholder={placeholder} onSend={sendMessage} onCancel={cancel} onClear={handleNewChat} toolbar={toolbar} focusSignal={String(epoch)} enableTypeToFocus />
|
|
115
115
|
</div>
|
|
116
116
|
</div>
|
|
@@ -23,10 +23,15 @@ export type ChatInputProps = {
|
|
|
23
23
|
|
|
24
24
|
function resize(el: HTMLTextAreaElement | null, maxRows = 10) {
|
|
25
25
|
if (!el) return;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
// Collapse first — `height: auto` can keep a stretched/flex height so scrollHeight
|
|
27
|
+
// stays inflated until a later text change remeasures.
|
|
28
|
+
el.style.height = "0px";
|
|
29
|
+
const styles = getComputedStyle(el);
|
|
30
|
+
const line = Number.parseFloat(styles.lineHeight) || 22;
|
|
31
|
+
const padY = (Number.parseFloat(styles.paddingTop) || 0) + (Number.parseFloat(styles.paddingBottom) || 0);
|
|
32
|
+
const min = line + padY;
|
|
33
|
+
const max = line * maxRows + padY;
|
|
34
|
+
el.style.height = `${Math.min(Math.max(el.scrollHeight, min), max)}px`;
|
|
30
35
|
}
|
|
31
36
|
|
|
32
37
|
function isEditableTarget(el: EventTarget | null): boolean {
|
|
@@ -46,6 +51,16 @@ export function ChatInput({ generating = false, placeholder = "Message…", disa
|
|
|
46
51
|
resize(textareaRef.current);
|
|
47
52
|
}, [text]);
|
|
48
53
|
|
|
54
|
+
// Remeasure when the composer width settles (first paint / panel resize).
|
|
55
|
+
useEffect(() => {
|
|
56
|
+
const el = textareaRef.current;
|
|
57
|
+
const parent = el?.parentElement;
|
|
58
|
+
if (!el || !parent) return;
|
|
59
|
+
const ro = new ResizeObserver(() => resize(el));
|
|
60
|
+
ro.observe(parent);
|
|
61
|
+
return () => ro.disconnect();
|
|
62
|
+
}, []);
|
|
63
|
+
|
|
49
64
|
useEffect(() => {
|
|
50
65
|
const onSignal = focusSignal !== undefined;
|
|
51
66
|
if (!autoFocus && !onSignal) return;
|
|
@@ -28,7 +28,7 @@ export function ChatToolCall({ toolName = "Tool", label, toolInput, toolOutput,
|
|
|
28
28
|
const [open, setOpen] = useState(defaultOpen);
|
|
29
29
|
const displayLabel = label ?? formatToolName(toolName);
|
|
30
30
|
|
|
31
|
-
const identityIcon = icon ?? <FluentIcon name="
|
|
31
|
+
const identityIcon = icon ?? <FluentIcon name="code-block-24" size={13} className="shrink-0" />;
|
|
32
32
|
|
|
33
33
|
const header = (
|
|
34
34
|
<>
|
|
@@ -606,7 +606,7 @@ export function ColorPicker({
|
|
|
606
606
|
<button
|
|
607
607
|
type="button"
|
|
608
608
|
aria-label="Clear"
|
|
609
|
-
className="inline-flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-md text-muted-foreground hover:bg-
|
|
609
|
+
className="inline-flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-md text-muted-foreground hover:bg-ink-hover hover:text-foreground"
|
|
610
610
|
onClick={() => clear()}
|
|
611
611
|
>
|
|
612
612
|
<ClearIcon />
|
|
@@ -269,7 +269,7 @@ const DatePickerRoot = forwardRef<HTMLButtonElement, DatePickerProps>(function D
|
|
|
269
269
|
role="button"
|
|
270
270
|
tabIndex={-1}
|
|
271
271
|
aria-label="Clear"
|
|
272
|
-
className="inline-flex size-4 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground opacity-0 transition-opacity hover:bg-
|
|
272
|
+
className="inline-flex size-4 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground opacity-0 transition-opacity hover:bg-ink-hover hover:text-foreground group-hover/datepicker:opacity-100"
|
|
273
273
|
onClick={clear}
|
|
274
274
|
onPointerDown={(e) => e.preventDefault()}
|
|
275
275
|
>
|
|
@@ -408,7 +408,7 @@ const RangePicker = forwardRef<HTMLButtonElement, RangePickerProps>(function Ran
|
|
|
408
408
|
role="button"
|
|
409
409
|
tabIndex={-1}
|
|
410
410
|
aria-label="Clear"
|
|
411
|
-
className="inline-flex size-4 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground opacity-0 transition-opacity hover:bg-
|
|
411
|
+
className="inline-flex size-4 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground opacity-0 transition-opacity hover:bg-ink-hover hover:text-foreground group-hover/datepicker:opacity-100"
|
|
412
412
|
onClick={clear}
|
|
413
413
|
onPointerDown={(e) => e.preventDefault()}
|
|
414
414
|
>
|
|
@@ -59,7 +59,7 @@ function MenuItems({
|
|
|
59
59
|
if (item.children?.length) {
|
|
60
60
|
return (
|
|
61
61
|
<ContextMenuPrimitive.Sub key={key}>
|
|
62
|
-
<ContextMenuPrimitive.SubTrigger disabled={item.disabled} className={cn(menuItemClass, "data-[state=open]:bg-
|
|
62
|
+
<ContextMenuPrimitive.SubTrigger disabled={item.disabled} className={cn(menuItemClass, "data-[state=open]:bg-ink-active", item.danger && "text-destructive", item.className)} style={item.style}>
|
|
63
63
|
{item.icon ? <span className={menuIconClass}>{item.icon}</span> : null}
|
|
64
64
|
<span className="min-w-0 flex-1">{item.label}</span>
|
|
65
65
|
<ChevronRight />
|
|
@@ -76,7 +76,7 @@ function MenuItems({ items, onClick, portal }: { items: (MenuItemType | null | u
|
|
|
76
76
|
if (item.children?.length) {
|
|
77
77
|
return (
|
|
78
78
|
<DropdownMenu.Sub key={key}>
|
|
79
|
-
<DropdownMenu.SubTrigger disabled={item.disabled} className={cn(menuItemClass, "data-[state=open]:bg-
|
|
79
|
+
<DropdownMenu.SubTrigger disabled={item.disabled} className={cn(menuItemClass, "data-[state=open]:bg-ink-active", item.danger && "text-destructive", item.className)} style={item.style}>
|
|
80
80
|
{item.icon ? <span className={menuIconClass}>{item.icon}</span> : null}
|
|
81
81
|
<span className="min-w-0 flex-1">{item.label}</span>
|
|
82
82
|
<ChevronRight />
|
package/src/input/Input.tsx
CHANGED
|
@@ -299,7 +299,7 @@ const InputNumber = forwardRef<HTMLInputElement, InputNumberProps>(function Inpu
|
|
|
299
299
|
tabIndex={-1}
|
|
300
300
|
aria-label="Increase"
|
|
301
301
|
disabled={atMax}
|
|
302
|
-
className={cn("flex flex-1 items-center justify-center text-muted-foreground", "hover:bg-
|
|
302
|
+
className={cn("flex flex-1 items-center justify-center text-muted-foreground", "hover:bg-ink-hover hover:text-foreground active:bg-ink-active", "disabled:opacity-30 disabled:pointer-events-none", "border-b border-border/60")}
|
|
303
303
|
onMouseDown={(e) => e.preventDefault()}
|
|
304
304
|
onClick={() => stepBy(1)}
|
|
305
305
|
>
|
|
@@ -310,7 +310,7 @@ const InputNumber = forwardRef<HTMLInputElement, InputNumberProps>(function Inpu
|
|
|
310
310
|
tabIndex={-1}
|
|
311
311
|
aria-label="Decrease"
|
|
312
312
|
disabled={atMin}
|
|
313
|
-
className={cn("flex flex-1 items-center justify-center text-muted-foreground", "hover:bg-
|
|
313
|
+
className={cn("flex flex-1 items-center justify-center text-muted-foreground", "hover:bg-ink-hover hover:text-foreground active:bg-ink-active", "disabled:opacity-30 disabled:pointer-events-none")}
|
|
314
314
|
onMouseDown={(e) => e.preventDefault()}
|
|
315
315
|
onClick={() => stepBy(-1)}
|
|
316
316
|
>
|
package/src/menu/Menu.tsx
CHANGED
|
@@ -65,7 +65,7 @@ export type MenuItemProps = {
|
|
|
65
65
|
|
|
66
66
|
export function MenuItem({ icon, label, extra, selected, action, onClick, className }: MenuItemProps) {
|
|
67
67
|
return (
|
|
68
|
-
<div className={cn("group relative flex min-h-8 items-center rounded-md", selected ? "bg-ink-active" : "hover:bg-
|
|
68
|
+
<div className={cn("group relative flex min-h-8 items-center rounded-md", selected ? "bg-ink-active" : "hover:bg-ink-hover", className)}>
|
|
69
69
|
<button
|
|
70
70
|
type="button"
|
|
71
71
|
aria-current={selected ? "true" : undefined}
|
|
@@ -114,7 +114,7 @@ function ItemBtn({
|
|
|
114
114
|
className={cn(
|
|
115
115
|
"group inline-flex min-w-0 cursor-pointer items-center justify-center px-1.5 tabular-nums select-none",
|
|
116
116
|
"transition-colors disabled:cursor-not-allowed disabled:opacity-40",
|
|
117
|
-
active ? "bg-brand font-medium text-(--nonla-solid-fg)" : "text-muted-foreground hover:bg-
|
|
117
|
+
active ? "bg-brand font-medium text-(--nonla-solid-fg)" : "text-muted-foreground hover:bg-ink-hover hover:text-foreground",
|
|
118
118
|
className,
|
|
119
119
|
)}
|
|
120
120
|
style={{
|
|
@@ -245,7 +245,7 @@ function GoButton({
|
|
|
245
245
|
"inline-flex cursor-pointer items-center justify-center px-2 text-foreground",
|
|
246
246
|
controlFieldSurface,
|
|
247
247
|
controlFieldTransition,
|
|
248
|
-
"hover:bg-
|
|
248
|
+
"hover:bg-ink-hover disabled:cursor-not-allowed disabled:opacity-45",
|
|
249
249
|
)}
|
|
250
250
|
style={{
|
|
251
251
|
height: controlHeightVar(size),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ReactNode, useLayoutEffect, useRef, useState } from "react";
|
|
2
2
|
import { cn } from "../lib/cn";
|
|
3
3
|
import { type ControlSize, controlHeightVar, controlRadiusVar, getSizeTokens, useControlSize } from "../lib/sizes";
|
|
4
4
|
|
|
@@ -20,6 +20,8 @@ function norm<V extends string | number>(opt: SegmentedOption<V>): { label: Reac
|
|
|
20
20
|
return opt;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
type Thumb = { left: number; top: number; width: number; height: number };
|
|
24
|
+
|
|
23
25
|
export function Segmented<V extends string | number = string | number>({ options, value, defaultValue, onChange, size, block, disabled, className }: SegmentedProps<V>) {
|
|
24
26
|
const items = options.map((o) => norm(o));
|
|
25
27
|
const current = value ?? defaultValue ?? items[0]?.value;
|
|
@@ -28,26 +30,73 @@ export function Segmented<V extends string | number = string | number>({ options
|
|
|
28
30
|
const itemPadX = Math.max(tok.paddingInline - 4, 6);
|
|
29
31
|
const radius = controlRadiusVar(resolvedSize);
|
|
30
32
|
|
|
33
|
+
const rootRef = useRef<HTMLDivElement>(null);
|
|
34
|
+
const itemRefs = useRef(new Map<string, HTMLButtonElement>());
|
|
35
|
+
const [thumb, setThumb] = useState<Thumb | null>(null);
|
|
36
|
+
|
|
37
|
+
const itemsKey = items.map((i) => String(i.value)).join("");
|
|
38
|
+
|
|
39
|
+
useLayoutEffect(() => {
|
|
40
|
+
const root = rootRef.current;
|
|
41
|
+
if (!root) return;
|
|
42
|
+
|
|
43
|
+
const measure = () => {
|
|
44
|
+
const el = itemRefs.current.get(String(current));
|
|
45
|
+
if (!el) {
|
|
46
|
+
setThumb(null);
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
setThumb({ left: el.offsetLeft, top: el.offsetTop, width: el.offsetWidth, height: el.offsetHeight });
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
measure();
|
|
53
|
+
const ro = new ResizeObserver(measure);
|
|
54
|
+
ro.observe(root);
|
|
55
|
+
return () => ro.disconnect();
|
|
56
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
57
|
+
}, [current, resolvedSize, block, itemsKey]);
|
|
58
|
+
|
|
31
59
|
return (
|
|
32
60
|
<div
|
|
33
|
-
|
|
61
|
+
ref={rootRef}
|
|
62
|
+
className={cn(
|
|
63
|
+
"relative inline-flex w-fit max-w-full shrink-0 items-center gap-0.5 rounded-lg border border-solid border-glass-border bg-glass-bar p-0.5 shadow-[inset_0_1px_0_var(--glass-highlight)] backdrop-blur-xl",
|
|
64
|
+
block && "flex w-full",
|
|
65
|
+
className,
|
|
66
|
+
)}
|
|
34
67
|
role="tablist"
|
|
35
68
|
style={{ borderRadius: radius }}
|
|
36
69
|
data-size={resolvedSize}
|
|
37
70
|
>
|
|
71
|
+
{thumb ? (
|
|
72
|
+
<span
|
|
73
|
+
aria-hidden
|
|
74
|
+
className="nonla-segmented-thumb pointer-events-none absolute border border-solid border-glass-border bg-glass shadow-[inset_0_1px_0_var(--glass-highlight),0_1px_3px_color-mix(in_srgb,black_10%,transparent)]"
|
|
75
|
+
style={{
|
|
76
|
+
width: thumb.width,
|
|
77
|
+
height: thumb.height,
|
|
78
|
+
transform: `translate(${thumb.left}px, ${thumb.top}px)`,
|
|
79
|
+
borderRadius: `max(4px, calc(${radius} - 2px))`,
|
|
80
|
+
}}
|
|
81
|
+
/>
|
|
82
|
+
) : null}
|
|
38
83
|
{items.map((item) => {
|
|
39
84
|
const active = item.value === current;
|
|
40
85
|
return (
|
|
41
86
|
<button
|
|
42
87
|
key={String(item.value)}
|
|
88
|
+
ref={(el) => {
|
|
89
|
+
if (el) itemRefs.current.set(String(item.value), el);
|
|
90
|
+
else itemRefs.current.delete(String(item.value));
|
|
91
|
+
}}
|
|
43
92
|
type="button"
|
|
44
93
|
role="tab"
|
|
45
94
|
aria-selected={active}
|
|
46
95
|
disabled={disabled || item.disabled}
|
|
47
96
|
className={cn(
|
|
48
|
-
"inline-flex cursor-pointer items-center justify-center gap-1.5 whitespace-nowrap border-
|
|
97
|
+
"relative z-10 inline-flex cursor-pointer items-center justify-center gap-1.5 whitespace-nowrap border border-solid border-transparent transition-colors focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-45",
|
|
49
98
|
block ? "min-w-0 flex-1" : "shrink-0",
|
|
50
|
-
active ? "
|
|
99
|
+
active ? "text-foreground" : "bg-transparent text-foreground hover:bg-ink-hover",
|
|
51
100
|
)}
|
|
52
101
|
style={{
|
|
53
102
|
height: `max(22px, calc(${controlHeightVar(resolvedSize)} - 4px))`,
|
package/src/select/Select.tsx
CHANGED
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
useState,
|
|
13
13
|
} from "react";
|
|
14
14
|
import { usePopupContainer } from "../app/context";
|
|
15
|
+
import { menuItemClass } from "../dropdown/menuClasses";
|
|
15
16
|
import { cn } from "../lib/cn";
|
|
16
17
|
import { type ControlSize, controlFieldFocusBorder, controlFieldStyle, controlFieldSurface, controlFieldTransition, controlStatusClass, useControlSize } from "../lib/sizes";
|
|
17
18
|
import { glassOverlayClass } from "../lib/surface";
|
|
@@ -233,7 +234,7 @@ export const Select = forwardRef<HTMLButtonElement, SelectProps>(function Select
|
|
|
233
234
|
role="button"
|
|
234
235
|
tabIndex={-1}
|
|
235
236
|
aria-label="Clear"
|
|
236
|
-
className="inline-flex size-4 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground opacity-0 transition-opacity hover:bg-
|
|
237
|
+
className="inline-flex size-4 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground opacity-0 transition-opacity hover:bg-ink-hover hover:text-foreground group-hover/select:opacity-100"
|
|
237
238
|
onPointerDown={(e) => e.preventDefault()}
|
|
238
239
|
onClick={(e) => {
|
|
239
240
|
e.preventDefault();
|
|
@@ -293,11 +294,12 @@ export const Select = forwardRef<HTMLButtonElement, SelectProps>(function Select
|
|
|
293
294
|
tabIndex={-1}
|
|
294
295
|
aria-selected={opt.value === selected}
|
|
295
296
|
data-active={i === active ? "true" : undefined}
|
|
297
|
+
data-highlighted={!opt.disabled && i === active && opt.value !== selected ? "" : undefined}
|
|
296
298
|
className={cn(
|
|
297
|
-
|
|
299
|
+
menuItemClass,
|
|
300
|
+
"cursor-pointer",
|
|
298
301
|
opt.disabled && "pointer-events-none opacity-40",
|
|
299
302
|
!opt.disabled && opt.value === selected && "nonla-glass-chip-on text-foreground",
|
|
300
|
-
!opt.disabled && i === active && opt.value !== selected && "nonla-glass-chip",
|
|
301
303
|
)}
|
|
302
304
|
onMouseEnter={() => setActive(i)}
|
|
303
305
|
onMouseDown={(e) => e.preventDefault()}
|
|
@@ -290,9 +290,12 @@ function SplitterRoot({
|
|
|
290
290
|
>
|
|
291
291
|
<span
|
|
292
292
|
className={cn(
|
|
293
|
-
"pointer-events-none absolute rounded-full transition-
|
|
294
|
-
isVertical
|
|
293
|
+
"pointer-events-none absolute rounded-full transition-all",
|
|
294
|
+
isVertical
|
|
295
|
+
? "inset-x-0 top-1/2 h-px -translate-y-1/2 group-hover:h-[3px] group-focus-visible:h-[3px]"
|
|
296
|
+
: "inset-y-0 left-1/2 w-px -translate-x-1/2 group-hover:w-[3px] group-focus-visible:w-[3px]",
|
|
295
297
|
dragging ? "bg-brand" : "bg-border group-hover:bg-brand group-focus-visible:bg-brand",
|
|
298
|
+
dragging && (isVertical ? "h-[3px]" : "w-[3px]"),
|
|
296
299
|
)}
|
|
297
300
|
/>
|
|
298
301
|
{draggerIcon ? (
|
|
@@ -304,16 +307,7 @@ function SplitterRoot({
|
|
|
304
307
|
>
|
|
305
308
|
{draggerIcon}
|
|
306
309
|
</span>
|
|
307
|
-
) :
|
|
308
|
-
<span
|
|
309
|
-
className={cn(
|
|
310
|
-
"pointer-events-none absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 rounded-sm bg-card shadow-button-outline transition-opacity",
|
|
311
|
-
"opacity-0 group-hover:opacity-100 group-focus-visible:opacity-100",
|
|
312
|
-
dragging && "opacity-100",
|
|
313
|
-
isVertical ? "h-1 w-8" : "h-8 w-1",
|
|
314
|
-
)}
|
|
315
|
-
/>
|
|
316
|
-
)}
|
|
310
|
+
) : null}
|
|
317
311
|
</div>
|
|
318
312
|
</div>
|
|
319
313
|
) : null}
|
package/src/styles.css
CHANGED
|
@@ -650,13 +650,17 @@
|
|
|
650
650
|
}
|
|
651
651
|
|
|
652
652
|
/* Nested glass chip — hover is frost only; selected tints with brand */
|
|
653
|
-
.nonla-glass-chip
|
|
654
|
-
.nonla-menu-item[data-highlighted] {
|
|
653
|
+
.nonla-glass-chip {
|
|
655
654
|
background: var(--glass-bar);
|
|
656
655
|
border-color: var(--glass-border);
|
|
657
656
|
-webkit-backdrop-filter: blur(24px);
|
|
658
657
|
backdrop-filter: blur(24px);
|
|
659
658
|
}
|
|
659
|
+
/* Menu item hover — pure ink tint; panel's warm frost shows through, no milky gray */
|
|
660
|
+
.nonla-menu-item[data-highlighted] {
|
|
661
|
+
background: var(--ink-hover);
|
|
662
|
+
border-color: var(--glass-border);
|
|
663
|
+
}
|
|
660
664
|
.nonla-glass-chip-on {
|
|
661
665
|
background: var(--glass-bar);
|
|
662
666
|
border-color: color-mix(in oklab, var(--brand) 38%, var(--glass-border));
|
|
@@ -664,6 +668,16 @@
|
|
|
664
668
|
-webkit-backdrop-filter: blur(24px);
|
|
665
669
|
backdrop-filter: blur(24px);
|
|
666
670
|
}
|
|
671
|
+
/* Segmented sliding thumb — glass pill glides between items */
|
|
672
|
+
.nonla-segmented-thumb {
|
|
673
|
+
top: 0;
|
|
674
|
+
left: 0;
|
|
675
|
+
transition:
|
|
676
|
+
transform 380ms cubic-bezier(0.3, 1.25, 0.5, 1),
|
|
677
|
+
width 380ms cubic-bezier(0.3, 1.25, 0.5, 1),
|
|
678
|
+
height 380ms cubic-bezier(0.3, 1.25, 0.5, 1);
|
|
679
|
+
}
|
|
680
|
+
|
|
667
681
|
@media (prefers-reduced-motion: reduce) {
|
|
668
682
|
.nonla-btn-glass {
|
|
669
683
|
transition: box-shadow var(--nonla-dur-fast) var(--nonla-ease-out);
|
|
@@ -671,6 +685,9 @@
|
|
|
671
685
|
.nonla-btn-glass:active:not(:disabled):not([aria-disabled]) {
|
|
672
686
|
transform: none;
|
|
673
687
|
}
|
|
688
|
+
.nonla-segmented-thumb {
|
|
689
|
+
transition: none;
|
|
690
|
+
}
|
|
674
691
|
}
|
|
675
692
|
|
|
676
693
|
.nonla-overlay {
|
package/src/tag/Tag.tsx
CHANGED
|
@@ -97,7 +97,7 @@ export function Tag({
|
|
|
97
97
|
{closable ? (
|
|
98
98
|
<button
|
|
99
99
|
type="button"
|
|
100
|
-
className="-mr-0.5 inline-flex size-3.5 shrink-0 items-center justify-center rounded-full text-current/55 transition-colors hover:bg-
|
|
100
|
+
className="-mr-0.5 inline-flex size-3.5 shrink-0 items-center justify-center rounded-full text-current/55 transition-colors hover:bg-ink-hover hover:text-current"
|
|
101
101
|
aria-label="Remove"
|
|
102
102
|
onClick={onClose}
|
|
103
103
|
>
|
|
@@ -245,7 +245,7 @@ function StepperButton({
|
|
|
245
245
|
aria-label={label}
|
|
246
246
|
className={cn(
|
|
247
247
|
"flex h-10 items-center justify-center rounded-md text-muted-foreground transition-colors",
|
|
248
|
-
"hover:bg-
|
|
248
|
+
"hover:bg-ink-hover hover:text-foreground active:bg-ink-active",
|
|
249
249
|
)}
|
|
250
250
|
style={{ width: size }}
|
|
251
251
|
onPointerDown={onPointerDown}
|
|
@@ -298,7 +298,7 @@ function PickGrid({
|
|
|
298
298
|
tabIndex={-1}
|
|
299
299
|
className={cn(
|
|
300
300
|
"flex h-11 items-center justify-center rounded-md tabular-nums text-[13.5px] font-normal transition-colors",
|
|
301
|
-
selected ? "bg-
|
|
301
|
+
selected ? "bg-ink-active text-foreground" : "text-foreground hover:bg-ink-hover",
|
|
302
302
|
)}
|
|
303
303
|
onClick={() => onSelect(opt.value)}
|
|
304
304
|
>
|
|
@@ -372,7 +372,7 @@ function StepperBoard({
|
|
|
372
372
|
className={cn(
|
|
373
373
|
"flex cursor-pointer items-center justify-center rounded-md font-semibold leading-none tracking-tight transition-colors",
|
|
374
374
|
col.wide ? "text-[23px]" : "tabular-nums",
|
|
375
|
-
col.active ? "bg-
|
|
375
|
+
col.active ? "bg-ink-hover text-foreground" : "text-foreground hover:bg-ink-hover",
|
|
376
376
|
)}
|
|
377
377
|
style={{ width: size, height: size, fontSize: col.wide ? undefined : fontSize }}
|
|
378
378
|
onClick={col.onPick}
|
|
@@ -640,7 +640,7 @@ export const TimePicker = forwardRef<HTMLInputElement, TimePickerProps>(function
|
|
|
640
640
|
type="button"
|
|
641
641
|
tabIndex={-1}
|
|
642
642
|
aria-label="Clear"
|
|
643
|
-
className="inline-flex size-4 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground opacity-0 transition-opacity hover:bg-
|
|
643
|
+
className="inline-flex size-4 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground opacity-0 transition-opacity hover:bg-ink-hover hover:text-foreground group-hover/timepicker:opacity-100 group-focus-within/timepicker:opacity-100"
|
|
644
644
|
onMouseDown={(e) => e.preventDefault()}
|
|
645
645
|
onClick={clear}
|
|
646
646
|
>
|
|
@@ -682,7 +682,7 @@ export const TimePicker = forwardRef<HTMLInputElement, TimePickerProps>(function
|
|
|
682
682
|
type="button"
|
|
683
683
|
tabIndex={-1}
|
|
684
684
|
aria-label="Back"
|
|
685
|
-
className="absolute top-2 left-1.5 z-10 flex size-7 items-center justify-center rounded-md text-muted-foreground hover:bg-
|
|
685
|
+
className="absolute top-2 left-1.5 z-10 flex size-7 items-center justify-center rounded-md text-muted-foreground hover:bg-ink-hover hover:text-foreground"
|
|
686
686
|
onClick={() => setPicking(null)}
|
|
687
687
|
>
|
|
688
688
|
<Chevron dir="left" />
|