@designa8/vibedesign-linear-internal-v1-2-176b 0.1.2 → 0.2.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/dist/styles.css CHANGED
@@ -393,6 +393,9 @@
393
393
  .-z-10 {
394
394
  z-index: calc(10 * -1);
395
395
  }
396
+ .z-10 {
397
+ z-index: 10;
398
+ }
396
399
  .col-start-1 {
397
400
  grid-column-start: 1;
398
401
  }
@@ -946,6 +949,9 @@
946
949
  --tw-scale-z: 110%;
947
950
  scale: var(--tw-scale-x) var(--tw-scale-y);
948
951
  }
952
+ .-rotate-1 {
953
+ rotate: calc(1deg * -1);
954
+ }
949
955
  .-rotate-90 {
950
956
  rotate: calc(90deg * -1);
951
957
  }
@@ -1861,6 +1867,11 @@
1861
1867
  }
1862
1868
  }
1863
1869
  }
1870
+ .group-focus-within\/issue\:opacity-100 {
1871
+ &:is(:where(.group\/issue):focus-within *) {
1872
+ opacity: 100%;
1873
+ }
1874
+ }
1864
1875
  .group-hover\:translate-x-0\.5 {
1865
1876
  &:is(:where(.group):hover *) {
1866
1877
  @media (hover: hover) {
@@ -1893,6 +1904,13 @@
1893
1904
  }
1894
1905
  }
1895
1906
  }
1907
+ .group-hover\/issue\:opacity-100 {
1908
+ &:is(:where(.group\/issue):hover *) {
1909
+ @media (hover: hover) {
1910
+ opacity: 100%;
1911
+ }
1912
+ }
1913
+ }
1896
1914
  .peer-focus-visible\:border-2 {
1897
1915
  &:is(:where(.peer):focus-visible ~ *) {
1898
1916
  border-style: var(--tw-border-style);
@@ -2065,6 +2083,20 @@
2065
2083
  }
2066
2084
  }
2067
2085
  }
2086
+ .hover\:border-primary {
2087
+ &:hover {
2088
+ @media (hover: hover) {
2089
+ border-color: var(--color-primary);
2090
+ }
2091
+ }
2092
+ }
2093
+ .hover\:bg-primary-soft {
2094
+ &:hover {
2095
+ @media (hover: hover) {
2096
+ background-color: var(--color-primary-soft);
2097
+ }
2098
+ }
2099
+ }
2068
2100
  .hover\:bg-surface {
2069
2101
  &:hover {
2070
2102
  @media (hover: hover) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@designa8/vibedesign-linear-internal-v1-2-176b",
3
- "version": "0.1.2",
3
+ "version": "0.2.0",
4
4
  "description": "Complete design system \"My Project linear-internal-v1\" generated by Atoms Design.",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",
@@ -244,6 +244,11 @@
244
244
  "kind": "Atom",
245
245
  "description": null
246
246
  },
247
+ {
248
+ "name": "IssueCard",
249
+ "kind": "Molecule",
250
+ "description": null
251
+ },
247
252
  {
248
253
  "name": "Label",
249
254
  "kind": "Atom",
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  import { createPortal } from "react-dom";
3
- import { Icon, type IconName } from "../Icon";
3
+ import type { IconName } from "../Icon";
4
4
  import { MenuItem } from "../MenuItem";
5
5
  import { Divider } from "../Divider";
6
6
 
@@ -94,6 +94,7 @@ export const ICON_REGISTRY = {
94
94
  "user-plus": { viewBox: "0 0 24 24", nodes: [{ tag: "path", d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" }, { tag: "circle", cx: "9", cy: "7", r: "4" }, { tag: "line", x1: "19", x2: "19", y1: "8", y2: "14" }, { tag: "line", x1: "22", x2: "16", y1: "11", y2: "11" }] },
95
95
  "circle": { viewBox: "0 0 24 24", nodes: [{ tag: "circle", cx: "12", cy: "12", r: "10" }] },
96
96
  "trash": { viewBox: "0 0 24 24", nodes: [{ tag: "path", d: "M3 6h18" }, { tag: "path", d: "M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6" }, { tag: "path", d: "M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2" }] },
97
+ "chart-bar": { viewBox: "0 0 24 24", nodes: [{ tag: "path", d: "M3 3v16a2 2 0 0 0 2 2h16" }, { tag: "path", d: "M7 16h8" }, { tag: "path", d: "M7 11h12" }, { tag: "path", d: "M7 6h3" }] },
97
98
  } as const;
98
99
 
99
100
  export type IconName = keyof typeof ICON_REGISTRY;
@@ -0,0 +1,179 @@
1
+ import * as React from "react";
2
+ import { Avatar } from "../Avatar";
3
+ import { Badge } from "../Badge";
4
+ import type { BadgeTone } from "../Badge";
5
+
6
+ export interface IssueCardLabel {
7
+ name: string;
8
+ tone?: BadgeTone;
9
+ }
10
+
11
+ export interface IssueCardAssignee {
12
+ name: string;
13
+ src?: string;
14
+ }
15
+
16
+ export interface IssueCardProps
17
+ extends Omit<React.HTMLAttributes<HTMLDivElement>, "onClick"> {
18
+ /** Issue key, e.g. "ENG-412". Rendered muted with tabular numerals. */
19
+ id: string;
20
+ /** Issue title. Wraps to at most two lines. */
21
+ title: React.ReactNode;
22
+ /** Leading status glyph shown before the title (e.g. a state icon). */
23
+ status?: React.ReactNode;
24
+ /** Priority glyph shown before the issue key. */
25
+ priority?: React.ReactNode;
26
+ /** Up to three labels render as badges; the rest collapse into a "+N" badge. */
27
+ labels?: IssueCardLabel[];
28
+ /** Owner of the issue, rendered as an xs avatar on the right of the footer. */
29
+ assignee?: IssueCardAssignee;
30
+ /** Secondary line, e.g. a due date or an estimate. */
31
+ meta?: React.ReactNode;
32
+ /** Trailing controls (typically an IconButton menu). Revealed on hover or focus. */
33
+ actions?: React.ReactNode;
34
+ /** When set, the whole card becomes a link target. */
35
+ href?: string;
36
+ /** When set, the whole card becomes a button target. */
37
+ onClick?: React.MouseEventHandler<HTMLElement>;
38
+ /** Selected / current card in a board. */
39
+ selected?: boolean;
40
+ /** Lifted appearance used while the card is being dragged. */
41
+ dragging?: boolean;
42
+ }
43
+
44
+ const MAX_LABELS = 3;
45
+
46
+ export const IssueCard = React.forwardRef<HTMLDivElement, IssueCardProps>(
47
+ (
48
+ {
49
+ id,
50
+ title,
51
+ status,
52
+ priority,
53
+ labels,
54
+ assignee,
55
+ meta,
56
+ actions,
57
+ href,
58
+ onClick,
59
+ selected = false,
60
+ dragging = false,
61
+ className,
62
+ ...rest
63
+ },
64
+ ref,
65
+ ) => {
66
+ const interactive = Boolean(href) || Boolean(onClick);
67
+
68
+ const surface = selected
69
+ ? "border-primary bg-primary-soft hover:border-primary hover:bg-primary-soft"
70
+ : "border-hairline bg-canvas hover:border-hairline-strong hover:bg-surface-soft";
71
+
72
+ const rootClass = [
73
+ "group/issue relative flex w-full select-none flex-col gap-xs rounded-lg border p-md text-left transition duration-150 ease-out",
74
+ surface,
75
+ dragging ? "-rotate-1 shadow-lg" : "shadow-card",
76
+ interactive ? "cursor-pointer" : "",
77
+ className,
78
+ ]
79
+ .filter(Boolean)
80
+ .join(" ");
81
+
82
+ const visibleLabels = labels?.slice(0, MAX_LABELS) ?? [];
83
+ const hiddenLabelCount = (labels?.length ?? 0) - visibleLabels.length;
84
+ const hasFooter = Boolean(meta) || Boolean(assignee);
85
+
86
+ const triggerLabel =
87
+ typeof title === "string" ? `${id}: ${title}` : `Issue ${id}`;
88
+
89
+ const triggerClass = [
90
+ "absolute inset-0 rounded-lg",
91
+ "cursor-pointer transition duration-150 ease-out outline-none",
92
+ "focus-visible:ring-2 focus-visible:ring-focus-blue focus-visible:ring-offset-2 focus-visible:ring-offset-canvas",
93
+ ].join(" ");
94
+
95
+ const handleTriggerKeyDown = (event: React.KeyboardEvent<HTMLElement>) => {
96
+ if (!onClick) return;
97
+ if (event.key === "Enter" || event.key === " " || event.key === "Spacebar") {
98
+ event.preventDefault();
99
+ onClick(event as unknown as React.MouseEvent<HTMLElement>);
100
+ }
101
+ };
102
+
103
+ return (
104
+ <div
105
+ ref={ref}
106
+ data-selected={selected || undefined}
107
+ data-dragging={dragging || undefined}
108
+ className={rootClass}
109
+ {...rest}
110
+ >
111
+ <div className="flex items-start justify-between gap-sm">
112
+ <div className="flex min-w-0 items-center gap-xs">
113
+ {priority ? <span className="flex shrink-0 items-center">{priority}</span> : null}
114
+ <span className="truncate text-caption tabular-nums text-muted">{id}</span>
115
+ </div>
116
+
117
+ {actions ? (
118
+ <div className="relative z-10 shrink-0 opacity-0 transition-opacity duration-200 ease-out group-hover/issue:opacity-100 group-focus-within/issue:opacity-100 [@media(hover:none)]:opacity-100">
119
+ {actions}
120
+ </div>
121
+ ) : null}
122
+ </div>
123
+
124
+ <div className="flex items-start gap-xs">
125
+ {status ? (
126
+ <span className="mt-xxs flex shrink-0 items-center">{status}</span>
127
+ ) : null}
128
+ <p className="line-clamp-2 min-w-0 text-body-md text-ink">{title}</p>
129
+ </div>
130
+
131
+ {visibleLabels.length > 0 ? (
132
+ <div className="mt-xxs flex flex-wrap items-center gap-xs">
133
+ {visibleLabels.map((label) => (
134
+ <Badge key={label.name} tone={label.tone} size="sm">
135
+ {label.name}
136
+ </Badge>
137
+ ))}
138
+ {hiddenLabelCount > 0 ? (
139
+ <Badge tone="neutral" size="sm">
140
+ <span className="tabular-nums">+{hiddenLabelCount}</span>
141
+ <span className="sr-only"> more labels</span>
142
+ </Badge>
143
+ ) : null}
144
+ </div>
145
+ ) : null}
146
+
147
+ {hasFooter ? (
148
+ <div className="mt-xxs flex items-center justify-between gap-sm">
149
+ <span className="truncate text-caption text-muted-soft">{meta}</span>
150
+ {assignee ? (
151
+ <Avatar size="xs" name={assignee.name} src={assignee.src} className="shrink-0" />
152
+ ) : null}
153
+ </div>
154
+ ) : null}
155
+
156
+ {href ? (
157
+ <a
158
+ href={href}
159
+ onClick={onClick}
160
+ aria-label={triggerLabel}
161
+ aria-current={selected ? "true" : undefined}
162
+ className={triggerClass}
163
+ />
164
+ ) : onClick ? (
165
+ <a
166
+ role="button"
167
+ tabIndex={0}
168
+ onClick={onClick}
169
+ onKeyDown={handleTriggerKeyDown}
170
+ aria-label={triggerLabel}
171
+ aria-pressed={selected}
172
+ className={triggerClass}
173
+ />
174
+ ) : null}
175
+ </div>
176
+ );
177
+ },
178
+ );
179
+ IssueCard.displayName = "IssueCard";
@@ -0,0 +1,2 @@
1
+ export { IssueCard } from "./IssueCard";
2
+ export type { IssueCardProps, IssueCardLabel, IssueCardAssignee } from "./IssueCard";
@@ -0,0 +1,79 @@
1
+ import * as React from "react";
2
+ import { IssueCard } from "./IssueCard";
3
+ import { Icon } from "../Icon";
4
+ import { IconButton } from "../IconButton";
5
+
6
+ const MenuAction = ({ label }: { label: string }) => (
7
+ <IconButton aria-label={`More actions for ${label}`} size="sm" variant="ghost" icon="ellipsis" />
8
+ );
9
+
10
+ export default function IssueCardPreview() {
11
+ const [selectedId, setSelectedId] = React.useState<string | null>("ENG-412");
12
+
13
+ return (
14
+ <div className="w-full max-w-3xl mx-auto space-y-lg p-lg">
15
+ <div className="space-y-sm">
16
+ <p className="text-caption text-muted">Board cards</p>
17
+ <div className="grid grid-cols-1 gap-sm sm:grid-cols-2">
18
+ <IssueCard
19
+ id="ENG-412"
20
+ title="Paginate the activity log when more than 200 events are loaded"
21
+ status={<Icon name="circle" size={14} className="text-semantic-warning" />}
22
+ priority={<Icon name="chart-bar" size={14} className="text-semantic-error" />}
23
+ labels={[
24
+ { name: "Frontend", tone: "primary" },
25
+ { name: "Perf", tone: "warning" },
26
+ { name: "Backlog", tone: "neutral" },
27
+ { name: "Needs triage", tone: "info" },
28
+ { name: "Q3", tone: "success" },
29
+ ]}
30
+ meta="Due Sep 24"
31
+ assignee={{ name: "Ada Lovelace" }}
32
+ actions={<MenuAction label="ENG-412" />}
33
+ selected={selectedId === "ENG-412"}
34
+ onClick={() => setSelectedId("ENG-412")}
35
+ />
36
+
37
+ <IssueCard
38
+ id="ENG-409"
39
+ title="Keyboard shortcut sheet closes when the second modifier is released"
40
+ status={<Icon name="circle" size={14} className="text-muted-soft" />}
41
+ priority={<Icon name="chart-bar" size={14} className="text-semantic-warning" />}
42
+ labels={[{ name: "Accessibility", tone: "info" }]}
43
+ meta="3 points"
44
+ assignee={{ name: "Grace Hopper" }}
45
+ actions={<MenuAction label="ENG-409" />}
46
+ selected={selectedId === "ENG-409"}
47
+ onClick={() => setSelectedId("ENG-409")}
48
+ />
49
+ </div>
50
+ </div>
51
+
52
+ <div className="space-y-sm">
53
+ <p className="text-caption text-muted">Lifted while dragging, and a link target</p>
54
+ <div className="grid grid-cols-1 gap-sm sm:grid-cols-2">
55
+ <IssueCard
56
+ id="ENG-388"
57
+ title="Rebuild the empty state for saved views so it suggests the first filter"
58
+ status={<Icon name="circle" size={14} className="text-semantic-info" />}
59
+ labels={[
60
+ { name: "Design", tone: "primary" },
61
+ { name: "Empty state", tone: "neutral" },
62
+ ]}
63
+ meta="Estimate 5"
64
+ assignee={{ name: "Lin Qiao" }}
65
+ dragging
66
+ />
67
+
68
+ <IssueCard
69
+ id="ENG-361"
70
+ title="Export board to CSV"
71
+ href="#issue-361"
72
+ priority={<Icon name="chart-bar" size={14} className="text-muted-soft" />}
73
+ actions={<MenuAction label="ENG-361" />}
74
+ />
75
+ </div>
76
+ </div>
77
+ </div>
78
+ );
79
+ }
package/src/index.ts CHANGED
@@ -42,6 +42,7 @@ export * from "./atoms/Icon";
42
42
  export * from "./atoms/IconButton";
43
43
  export * from "./atoms/Image";
44
44
  export * from "./atoms/Input";
45
+ export * from "./atoms/IssueCard";
45
46
  export * from "./atoms/Label";
46
47
  export * from "./atoms/Link";
47
48
  export * from "./atoms/ListItem";