@lateralus-ai/shipping-ui 2.0.0-dev.6 → 2.0.0-dev.8
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/dist/components/Entry.d.ts +3 -0
- package/dist/index.cjs +1 -1
- package/dist/index.esm.js +999 -994
- package/package.json +1 -1
- package/src/components/Entry.tsx +27 -7
- package/src/components/Tabs.tsx +1 -1
package/package.json
CHANGED
package/src/components/Entry.tsx
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
type KeyboardEvent,
|
|
3
|
+
type ReactNode,
|
|
4
|
+
} from "react";
|
|
2
5
|
import { ChatIcon, IssuesIcon, ReportIcon, StatusIcon } from "../icons";
|
|
3
6
|
import { cn } from "../utils/cn";
|
|
4
7
|
|
|
@@ -37,6 +40,9 @@ const variantIcons: Record<EntryVariant, ReactNode> = {
|
|
|
37
40
|
/**
|
|
38
41
|
* List entry row — Figma `Entry` (389:10001).
|
|
39
42
|
* Shared by search results and activity lists.
|
|
43
|
+
*
|
|
44
|
+
* Renders a `div` (not `<button>`) so trailing controls can be real buttons
|
|
45
|
+
* without nested-button issues. Whole-row click uses `onClick` + keyboard.
|
|
40
46
|
*/
|
|
41
47
|
export const Entry = ({
|
|
42
48
|
variant,
|
|
@@ -53,18 +59,30 @@ export const Entry = ({
|
|
|
53
59
|
}: EntryProps) => {
|
|
54
60
|
const resolvedVariant: EntryVariant = variant ?? type ?? "chat";
|
|
55
61
|
const isInteractive = typeof onClick === "function";
|
|
56
|
-
|
|
62
|
+
|
|
63
|
+
const handleKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {
|
|
64
|
+
if (!onClick) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
68
|
+
event.preventDefault();
|
|
69
|
+
onClick();
|
|
70
|
+
}
|
|
71
|
+
};
|
|
57
72
|
|
|
58
73
|
return (
|
|
59
|
-
<
|
|
60
|
-
{
|
|
74
|
+
<div
|
|
75
|
+
role={isInteractive ? "button" : undefined}
|
|
76
|
+
tabIndex={isInteractive ? 0 : undefined}
|
|
61
77
|
data-variant={resolvedVariant}
|
|
62
78
|
data-state={state}
|
|
63
79
|
onClick={onClick}
|
|
80
|
+
onKeyDown={handleKeyDown}
|
|
64
81
|
className={cn(
|
|
65
82
|
"group flex w-full items-center gap-4 rounded-control p-2 text-left transition-colors",
|
|
66
83
|
"hover:bg-[rgba(38,36,32,0.04)]",
|
|
67
84
|
state === "active" && "bg-[rgba(38,36,32,0.04)]",
|
|
85
|
+
isInteractive && "cursor-pointer",
|
|
68
86
|
className,
|
|
69
87
|
)}
|
|
70
88
|
>
|
|
@@ -96,14 +114,16 @@ export const Entry = ({
|
|
|
96
114
|
|
|
97
115
|
{(subtitle != null && subtitle !== false) || trailing ? (
|
|
98
116
|
<span className="flex min-h-6 w-full items-center gap-4">
|
|
99
|
-
{subtitle != null && subtitle !== false
|
|
117
|
+
{subtitle != null && subtitle !== false ? (
|
|
100
118
|
<span className="min-w-0 flex-1 truncate text-caption-2 text-display-on-light-secondary">
|
|
101
119
|
{subtitle}
|
|
102
120
|
</span>
|
|
121
|
+
) : (
|
|
122
|
+
<span className="min-w-0 flex-1" />
|
|
103
123
|
)}
|
|
104
124
|
{trailing != null && (
|
|
105
125
|
<span
|
|
106
|
-
className="shrink-0"
|
|
126
|
+
className="inline-flex size-5 shrink-0 items-center justify-center"
|
|
107
127
|
onClick={(event) => event.stopPropagation()}
|
|
108
128
|
onKeyDown={(event) => event.stopPropagation()}
|
|
109
129
|
>
|
|
@@ -113,6 +133,6 @@ export const Entry = ({
|
|
|
113
133
|
</span>
|
|
114
134
|
) : null}
|
|
115
135
|
</span>
|
|
116
|
-
</
|
|
136
|
+
</div>
|
|
117
137
|
);
|
|
118
138
|
};
|
package/src/components/Tabs.tsx
CHANGED
|
@@ -103,7 +103,7 @@ export const TabsTrigger = forwardRef<
|
|
|
103
103
|
(type === "pills" ? (
|
|
104
104
|
<span
|
|
105
105
|
className={cn(
|
|
106
|
-
"inline-flex
|
|
106
|
+
"inline-flex shrink-0 items-center justify-center rounded-full px-1.5 py-0.5 text-footnote-em leading-none",
|
|
107
107
|
"bg-accent-bg-light text-display-on-light-secondary",
|
|
108
108
|
"group-data-[state=active]:text-display-on-light-tertiary",
|
|
109
109
|
)}
|