@designa8/vibedesign-linear-internal-v1-b737 0.2.0 → 0.4.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
@@ -100,6 +100,7 @@
100
100
  --text-overline: 11px;
101
101
  --text-overline--font-weight: 500;
102
102
  --text-overline--line-height: 1.3;
103
+ --tracking-overline: 1.2px;
103
104
  --text-overline--letter-spacing: 1.2px;
104
105
  --text-label: 13px;
105
106
  --text-label--font-weight: 500;
@@ -303,6 +304,9 @@
303
304
  .relative {
304
305
  position: relative;
305
306
  }
307
+ .static {
308
+ position: static;
309
+ }
306
310
  .sticky {
307
311
  position: sticky;
308
312
  }
@@ -612,6 +616,10 @@
612
616
  width: calc(var(--spacing) * 16);
613
617
  height: calc(var(--spacing) * 16);
614
618
  }
619
+ .size-full {
620
+ width: 100%;
621
+ height: 100%;
622
+ }
615
623
  .h-1 {
616
624
  height: var(--spacing);
617
625
  }
@@ -678,6 +686,12 @@
678
686
  .h-64 {
679
687
  height: calc(var(--spacing) * 64);
680
688
  }
689
+ .h-80 {
690
+ height: calc(var(--spacing) * 80);
691
+ }
692
+ .h-96 {
693
+ height: calc(var(--spacing) * 96);
694
+ }
681
695
  .h-base {
682
696
  height: var(--spacing-base);
683
697
  }
@@ -696,6 +710,9 @@
696
710
  .max-h-72 {
697
711
  max-height: calc(var(--spacing) * 72);
698
712
  }
713
+ .max-h-80 {
714
+ max-height: calc(var(--spacing) * 80);
715
+ }
699
716
  .max-h-96 {
700
717
  max-height: calc(var(--spacing) * 96);
701
718
  }
@@ -738,6 +755,9 @@
738
755
  .min-h-64 {
739
756
  min-height: calc(var(--spacing) * 64);
740
757
  }
758
+ .min-h-full {
759
+ min-height: 100%;
760
+ }
741
761
  .w-1 {
742
762
  width: var(--spacing);
743
763
  }
@@ -810,6 +830,9 @@
810
830
  .w-48 {
811
831
  width: calc(var(--spacing) * 48);
812
832
  }
833
+ .w-56 {
834
+ width: calc(var(--spacing) * 56);
835
+ }
813
836
  .w-64 {
814
837
  width: calc(var(--spacing) * 64);
815
838
  }
@@ -843,6 +866,9 @@
843
866
  .max-w-5xl {
844
867
  max-width: var(--container-5xl);
845
868
  }
869
+ .max-w-40 {
870
+ max-width: calc(var(--spacing) * 40);
871
+ }
846
872
  .max-w-48 {
847
873
  max-width: calc(var(--spacing) * 48);
848
874
  }
@@ -852,6 +878,9 @@
852
878
  .max-w-md {
853
879
  max-width: var(--spacing-md);
854
880
  }
881
+ .max-w-prose {
882
+ max-width: 65ch;
883
+ }
855
884
  .max-w-sm {
856
885
  max-width: var(--spacing-sm);
857
886
  }
@@ -973,6 +1002,9 @@
973
1002
  .-rotate-90 {
974
1003
  rotate: calc(90deg * -1);
975
1004
  }
1005
+ .rotate-0 {
1006
+ rotate: 0deg;
1007
+ }
976
1008
  .rotate-45 {
977
1009
  rotate: 45deg;
978
1010
  }
@@ -1594,6 +1626,9 @@
1594
1626
  .pr-xs {
1595
1627
  padding-right: var(--spacing-xs);
1596
1628
  }
1629
+ .pr-xxs {
1630
+ padding-right: var(--spacing-xxs);
1631
+ }
1597
1632
  .pb-base {
1598
1633
  padding-bottom: var(--spacing-base);
1599
1634
  }
@@ -1630,6 +1665,9 @@
1630
1665
  .pl-xs {
1631
1666
  padding-left: var(--spacing-xs);
1632
1667
  }
1668
+ .pl-xxs {
1669
+ padding-left: var(--spacing-xxs);
1670
+ }
1633
1671
  .text-center {
1634
1672
  text-align: center;
1635
1673
  }
@@ -1642,6 +1680,9 @@
1642
1680
  .align-middle {
1643
1681
  vertical-align: middle;
1644
1682
  }
1683
+ .font-mono {
1684
+ font-family: var(--font-mono);
1685
+ }
1645
1686
  .text-body-lg {
1646
1687
  font-size: var(--text-body-lg);
1647
1688
  line-height: var(--tw-leading, var(--text-body-lg--line-height));
@@ -1708,9 +1749,16 @@
1708
1749
  letter-spacing: var(--tw-tracking, var(--text-overline--letter-spacing));
1709
1750
  font-weight: var(--tw-font-weight, var(--text-overline--font-weight));
1710
1751
  }
1752
+ .tracking-overline {
1753
+ --tw-tracking: var(--tracking-overline);
1754
+ letter-spacing: var(--tracking-overline);
1755
+ }
1711
1756
  .whitespace-nowrap {
1712
1757
  white-space: nowrap;
1713
1758
  }
1759
+ .whitespace-pre {
1760
+ white-space: pre;
1761
+ }
1714
1762
  .text-body {
1715
1763
  color: var(--color-body);
1716
1764
  }
@@ -1753,6 +1801,9 @@
1753
1801
  .uppercase {
1754
1802
  text-transform: uppercase;
1755
1803
  }
1804
+ .italic {
1805
+ font-style: italic;
1806
+ }
1756
1807
  .tabular-nums {
1757
1808
  --tw-numeric-spacing: tabular-nums;
1758
1809
  font-variant-numeric: var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);
@@ -2877,6 +2928,10 @@
2877
2928
  inherits: false;
2878
2929
  initial-value: solid;
2879
2930
  }
2931
+ @property --tw-tracking {
2932
+ syntax: "*";
2933
+ inherits: false;
2934
+ }
2880
2935
  @property --tw-ordinal {
2881
2936
  syntax: "*";
2882
2937
  inherits: false;
@@ -3052,6 +3107,7 @@
3052
3107
  --tw-space-y-reverse: 0;
3053
3108
  --tw-divide-y-reverse: 0;
3054
3109
  --tw-border-style: solid;
3110
+ --tw-tracking: initial;
3055
3111
  --tw-ordinal: initial;
3056
3112
  --tw-slashed-zero: initial;
3057
3113
  --tw-numeric-figure: initial;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@designa8/vibedesign-linear-internal-v1-b737",
3
- "version": "0.2.0",
3
+ "version": "0.4.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",
@@ -64,6 +64,11 @@
64
64
  "kind": "Molecule",
65
65
  "description": null
66
66
  },
67
+ {
68
+ "name": "AttachmentChip",
69
+ "kind": "Atom",
70
+ "description": null
71
+ },
67
72
  {
68
73
  "name": "Avatar",
69
74
  "kind": "Atom",
@@ -129,6 +134,11 @@
129
134
  "kind": "Atom",
130
135
  "description": null
131
136
  },
137
+ {
138
+ "name": "CodeEditor",
139
+ "kind": "Organism",
140
+ "description": null
141
+ },
132
142
  {
133
143
  "name": "Combobox",
134
144
  "kind": "Molecule",
@@ -0,0 +1,126 @@
1
+ import * as React from "react";
2
+ import { Icon } from "../Icon";
3
+ import type { IconName } from "../Icon";
4
+ import { IconButton } from "../IconButton";
5
+ import { Spinner } from "../Spinner";
6
+
7
+ export type AttachmentChipSize = "sm" | "md";
8
+
9
+ export interface AttachmentChipProps extends React.ComponentPropsWithoutRef<"span"> {
10
+ /** File name shown (and truncated) in the chip. */
11
+ label: string;
12
+ /** Thumbnail image for the attachment. Falls back to `icon` when omitted. */
13
+ imageSrc?: string;
14
+ /** Alt text for the thumbnail. Defaults to `label`. */
15
+ imageAlt?: string;
16
+ /** Glyph shown in the thumbnail when there is no image. */
17
+ icon?: IconName;
18
+ /** 0–99 while the file is uploading. Omit once the upload finishes. */
19
+ uploadProgress?: number;
20
+ /** Renders a trailing ghost remove button and fires when it is clicked. */
21
+ onRemove?: () => void;
22
+ size?: AttachmentChipSize;
23
+ }
24
+
25
+ function cn(...parts: Array<string | false | null | undefined>) {
26
+ return parts.filter(Boolean).join(" ");
27
+ }
28
+
29
+ /** Heights line up with Button's `md` (h-8) and `sm` (h-7) so chips sit level in a composer row. */
30
+ const heights: Record<AttachmentChipSize, string> = {
31
+ md: "h-8 pl-xs pr-xxs text-body-sm",
32
+ sm: "h-7 pl-xxs pr-xxs text-caption",
33
+ };
34
+
35
+ const thumbs: Record<AttachmentChipSize, string> = {
36
+ md: "size-6",
37
+ sm: "size-5",
38
+ };
39
+
40
+ const glyphSize: Record<AttachmentChipSize, number> = { md: 14, sm: 12 };
41
+
42
+ const radius: Record<AttachmentChipSize, string> = { md: "rounded-md", sm: "rounded-md" };
43
+
44
+ export const AttachmentChip = React.forwardRef<HTMLSpanElement, AttachmentChipProps>(
45
+ (
46
+ {
47
+ label,
48
+ imageSrc,
49
+ imageAlt,
50
+ icon = "file",
51
+ uploadProgress,
52
+ onRemove,
53
+ size = "md",
54
+ className,
55
+ ...rest
56
+ },
57
+ ref,
58
+ ) => {
59
+ const uploading = typeof uploadProgress === "number";
60
+ const percent = uploading
61
+ ? Math.max(0, Math.min(99, Math.round(uploadProgress as number)))
62
+ : undefined;
63
+
64
+ return (
65
+ <span
66
+ ref={ref}
67
+ aria-busy={uploading || undefined}
68
+ className={cn(
69
+ "inline-flex max-w-full items-center gap-xs border border-hairline bg-canvas text-ink shadow-sm",
70
+ radius[size],
71
+ heights[size],
72
+ className,
73
+ )}
74
+ {...rest}
75
+ >
76
+ <span
77
+ className={cn(
78
+ "relative flex shrink-0 items-center justify-center overflow-hidden rounded-xs bg-surface-soft text-muted",
79
+ thumbs[size],
80
+ )}
81
+ >
82
+ {imageSrc ? (
83
+ <img
84
+ src={imageSrc}
85
+ alt={imageAlt ?? label}
86
+ loading="lazy"
87
+ className="size-full object-cover"
88
+ />
89
+ ) : (
90
+ <Icon name={icon} size={glyphSize[size]} />
91
+ )}
92
+
93
+ {/* Upload scrim stays mounted so finishing an upload fades out instead of popping.
94
+ `inverse-ink` keeps the ring light in both themes — the scrim is always dark. */}
95
+ <span
96
+ aria-hidden="true"
97
+ data-state={uploading ? "open" : "closed"}
98
+ className="pointer-events-none absolute inset-0 flex items-center justify-center bg-scrim/40 text-inverse-ink opacity-0 transition-opacity duration-200 ease-out data-[state=open]:opacity-100"
99
+ >
100
+ {uploading ? <Spinner variant="ring" size="sm" tone="current" /> : null}
101
+ </span>
102
+ </span>
103
+
104
+ <span className="min-w-0 max-w-40 truncate">{label}</span>
105
+
106
+ {uploading ? (
107
+ <span className="sr-only" aria-live="polite">
108
+ {`Uploading ${percent}%`}
109
+ </span>
110
+ ) : null}
111
+
112
+ {onRemove ? (
113
+ <IconButton
114
+ icon="x"
115
+ variant="ghost"
116
+ size="sm"
117
+ aria-label={`Remove ${label}`}
118
+ onClick={onRemove}
119
+ />
120
+ ) : null}
121
+ </span>
122
+ );
123
+ },
124
+ );
125
+
126
+ AttachmentChip.displayName = "AttachmentChip";
@@ -0,0 +1,2 @@
1
+ export { AttachmentChip } from "./AttachmentChip";
2
+ export type { AttachmentChipProps, AttachmentChipSize } from "./AttachmentChip";
@@ -0,0 +1,144 @@
1
+ import * as React from "react";
2
+ import { AttachmentChip } from "./AttachmentChip";
3
+ import type { AttachmentChipSize } from "./AttachmentChip";
4
+ import { Button } from "../Button";
5
+
6
+ interface DemoAttachment {
7
+ id: string;
8
+ label: string;
9
+ imageSrc?: string;
10
+ icon?: "file";
11
+ size?: AttachmentChipSize;
12
+ }
13
+
14
+ const initial: DemoAttachment[] = [
15
+ { id: "a1", label: "brand-guidelines-v2.pdf", imageSrc: "https://picsum.photos/seed/a8chip/64/64" },
16
+ { id: "a2", label: "Q3-revenue-forecast.xlsx" },
17
+ { id: "a3", label: "hero-mockup-final.png", imageSrc: "https://picsum.photos/seed/a8thumb/64/64", size: "sm" },
18
+ ];
19
+
20
+ function Section({
21
+ title,
22
+ hint,
23
+ children,
24
+ }: {
25
+ title: string;
26
+ hint?: string;
27
+ children: React.ReactNode;
28
+ }) {
29
+ return (
30
+ <section className="w-full space-y-xs">
31
+ <h2 className="text-caption font-weight-label uppercase tracking-overline text-muted">{title}</h2>
32
+ {hint ? <p className="w-full max-w-prose text-body-sm text-muted">{hint}</p> : null}
33
+ <div className="w-full">{children}</div>
34
+ </section>
35
+ );
36
+ }
37
+
38
+ export default function Preview() {
39
+ const [attachments, setAttachments] = React.useState<DemoAttachment[]>(initial);
40
+ const [progress, setProgress] = React.useState<number | undefined>(14);
41
+
42
+ React.useEffect(() => {
43
+ if (progress === undefined) return;
44
+ const id = window.setInterval(() => {
45
+ setProgress((current) => {
46
+ if (current === undefined) return current;
47
+ const next = current + 11;
48
+ return next >= 99 ? undefined : next;
49
+ });
50
+ }, 900);
51
+ return () => window.clearInterval(id);
52
+ }, [progress === undefined]);
53
+
54
+ const remove = (id: string) =>
55
+ setAttachments((current) => current.filter((item) => item.id !== id));
56
+
57
+ return (
58
+ <div className="w-full max-w-3xl mx-auto space-y-xl p-lg">
59
+ <Section title="In a prompt composer" hint="Click the × to remove an attachment.">
60
+ <div className="w-full rounded-lg border border-hairline bg-surface p-md">
61
+ <div className="flex w-full flex-wrap items-center gap-xs">
62
+ {attachments.map((item) => (
63
+ <AttachmentChip
64
+ key={item.id}
65
+ label={item.label}
66
+ imageSrc={item.imageSrc}
67
+ icon={item.icon}
68
+ size={item.size}
69
+ onRemove={() => remove(item.id)}
70
+ />
71
+ ))}
72
+ {attachments.length === 0 ? (
73
+ <span className="text-body-sm text-muted">
74
+ No attachments — send a new prompt above.
75
+ </span>
76
+ ) : null}
77
+ </div>
78
+ </div>
79
+ <div className="pt-sm">
80
+ <Button
81
+ variant="ghost"
82
+ size="sm"
83
+ onClick={() => setAttachments(initial)}
84
+ disabled={attachments.length === initial.length}
85
+ >
86
+ Reset attachments
87
+ </Button>
88
+ </div>
89
+ </Section>
90
+
91
+ <Section
92
+ title="Uploading"
93
+ hint="The thumbnail dims, a progress ring spins, and the chip is aria-busy until the upload finishes."
94
+ >
95
+ <div className="flex w-full flex-wrap items-center gap-sm">
96
+ <AttachmentChip
97
+ label="meeting-transcript.docx"
98
+ uploadProgress={progress}
99
+ onRemove={() => setProgress(undefined)}
100
+ />
101
+ <AttachmentChip
102
+ label="whiteboard.png"
103
+ imageSrc="https://picsum.photos/seed/a8upload/64/64"
104
+ size="sm"
105
+ uploadProgress={progress}
106
+ />
107
+ <Button variant="secondary" size="sm" onClick={() => setProgress(8)}>
108
+ Restart upload
109
+ </Button>
110
+ </div>
111
+ </Section>
112
+
113
+ <Section
114
+ title="Sizes"
115
+ hint="sm sits at 28px and md at 32px, so chips line up with the Button sizes in a composer bar."
116
+ >
117
+ <div className="flex w-full flex-wrap items-center gap-sm">
118
+ <AttachmentChip label="readme.md" size="sm" />
119
+ <AttachmentChip label="readme.md" size="md" />
120
+ <AttachmentChip
121
+ label="brand-guidelines-v2.pdf"
122
+ imageSrc="https://picsum.photos/seed/a8size/64/64"
123
+ size="sm"
124
+ />
125
+ <AttachmentChip
126
+ label="brand-guidelines-v2.pdf"
127
+ imageSrc="https://picsum.photos/seed/a8size2/64/64"
128
+ size="md"
129
+ />
130
+ </div>
131
+ </Section>
132
+
133
+ <Section
134
+ title="Glyph thumb, no remove"
135
+ hint="Omit onRemove when the attachment is fixed, e.g. a read-only transcript view."
136
+ >
137
+ <div className="flex w-full flex-wrap items-center gap-sm">
138
+ <AttachmentChip label="prompt-context.json" />
139
+ <AttachmentChip label="long-file-name-that-truncates-in-the-chip.tar.gz" size="sm" />
140
+ </div>
141
+ </Section>
142
+ </div>
143
+ );
144
+ }