@lateralus-ai/shipping-ui 2.0.0-dev.20 → 2.0.0-dev.4

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.
Files changed (38) hide show
  1. package/dist/components/Entry.d.ts +7 -27
  2. package/dist/components/Tabs.d.ts +5 -5
  3. package/dist/components/index.d.ts +2 -4
  4. package/dist/index.cjs +25 -25
  5. package/dist/index.d.ts +2 -2
  6. package/dist/index.esm.js +3374 -3584
  7. package/dist/patterns/Search/ResultRow.d.ts +5 -11
  8. package/dist/patterns/Sidebar/sidebar-styles.d.ts +1 -2
  9. package/dist/primitives/Badge.d.ts +4 -7
  10. package/dist/primitives/index.d.ts +1 -1
  11. package/dist/tailwind-theme.d.ts +0 -4
  12. package/dist/{theme-entry-tLBc6zGT.mjs → theme-entry-BUK3MJUJ.mjs} +4 -8
  13. package/dist/theme-entry-ygTpGaNC.js +1 -0
  14. package/dist/theme.cjs +1 -1
  15. package/dist/theme.esm.js +1 -1
  16. package/package.json +128 -128
  17. package/src/components/Entry.tsx +45 -119
  18. package/src/components/Tabs.tsx +27 -33
  19. package/src/components/index.ts +1 -15
  20. package/src/index.ts +0 -11
  21. package/src/patterns/Search/ResultRow.tsx +38 -24
  22. package/src/patterns/Search/SearchModal.tsx +1 -7
  23. package/src/patterns/Sidebar/CollapsibleNavGroup.tsx +1 -1
  24. package/src/patterns/Sidebar/SidebarAction.tsx +17 -26
  25. package/src/patterns/Sidebar/SidebarEntry.tsx +39 -54
  26. package/src/patterns/Sidebar/SidebarLink.tsx +20 -30
  27. package/src/patterns/Sidebar/sidebar-styles.ts +1 -2
  28. package/src/primitives/Badge.tsx +10 -20
  29. package/src/primitives/Button.tsx +11 -16
  30. package/src/primitives/index.ts +1 -1
  31. package/src/stories/canvases/ContentCanvas.tsx +14 -253
  32. package/src/tailwind-theme.ts +182 -186
  33. package/src/utils/cn.ts +1 -28
  34. package/dist/components/PageHeader.d.ts +0 -41
  35. package/dist/components/ScrollableList.d.ts +0 -22
  36. package/dist/theme-entry-Dwr2mV7_.js +0 -1
  37. package/src/components/PageHeader.tsx +0 -132
  38. package/src/components/ScrollableList.tsx +0 -61
@@ -121,8 +121,6 @@ export const Button = ({
121
121
  ...props
122
122
  }: ButtonProps) => {
123
123
  const resolvedIcon = icon ?? startIcon;
124
- const renderedIcon = renderIcon(resolvedIcon);
125
- const hasIcon = renderedIcon != null;
126
124
  const hasDropdown = Boolean(dropdownOptions?.length);
127
125
  const dropdownDisabled = !dropdownOptions?.some((option) => !option.disabled);
128
126
  const mainAppearance = getAppearance(disabled, forcedState);
@@ -137,18 +135,11 @@ export const Button = ({
137
135
  dropdownAppearance,
138
136
  forcedState,
139
137
  );
140
-
141
- /** Label-only: centered text. With start icon: gap between icon and label. */
142
- const content = (
143
- <span
144
- className={cn(
145
- "flex min-h-6 items-center justify-center",
146
- hasIcon && "gap-2",
147
- )}
148
- >
149
- {renderedIcon}
150
- <span>{children}</span>
151
- </span>
138
+ const label = (
139
+ <>
140
+ {renderIcon(resolvedIcon)}
141
+ <span className="px-2">{children}</span>
142
+ </>
152
143
  );
153
144
 
154
145
  if (!hasDropdown) {
@@ -165,7 +156,9 @@ export const Button = ({
165
156
  )}
166
157
  {...props}
167
158
  >
168
- {content}
159
+ <span className="flex min-h-6 items-center [&>*:first-child]:-mr-1 [&>*:last-child]:-mr-1">
160
+ {label}
161
+ </span>
169
162
  </button>
170
163
  );
171
164
  }
@@ -182,7 +175,9 @@ export const Button = ({
182
175
  )}
183
176
  {...props}
184
177
  >
185
- {content}
178
+ <span className="flex min-h-6 items-center [&>*:first-child]:-mr-1 [&>*:last-child]:-mr-1">
179
+ {label}
180
+ </span>
186
181
  </button>
187
182
  );
188
183
 
@@ -14,5 +14,5 @@ export { Tooltip, TooltipProvider, type TooltipProps, type TooltipSide } from ".
14
14
  export { ThinkingDot, type ThinkingDotProps } from "./ThinkingDot";
15
15
  export { Count, type CountProps } from "./Count";
16
16
  export { Switch, type SwitchProps } from "./Switch";
17
- export { Badge, type BadgeProps, type BadgeColor, type BadgeType } from "./Badge";
17
+ export { Badge, type BadgeProps } from "./Badge";
18
18
  export { Callout, type CalloutProps } from "./Callout";
@@ -1,17 +1,14 @@
1
- import { Badge, Button, IconButton, Avatar } from "../../primitives";
1
+ import { Button } from "../../primitives";
2
2
  import {
3
3
  EmptyState,
4
4
  Entry,
5
5
  Header,
6
- PageHeader,
7
- ScrollableList,
8
6
  Tab,
9
7
  Tabs,
10
8
  TabsContent,
11
9
  TabsList,
12
10
  TabsTrigger,
13
11
  } from "../../components";
14
- import { FormsIcon, MoreIcon, ShipIcon, TickIcon } from "../../icons";
15
12
  import { WorkflowsIllustration } from "../../illustrations";
16
13
  import {
17
14
  FigmaContent,
@@ -22,125 +19,6 @@ import {
22
19
  } from "../_layout";
23
20
  import { FIGMA_WIDTHS } from "./figma-widths";
24
21
 
25
- const demoActions = (
26
- <>
27
- <Button hierarchy="secondary">Button</Button>
28
- <IconButton hierarchy="tertiary" size="small" aria-label="More">
29
- <MoreIcon size="small" />
30
- </IconButton>
31
- </>
32
- );
33
-
34
- type DemoRow = {
35
- title: string;
36
- assignee?: string;
37
- unassigned?: boolean;
38
- signatures?: number[];
39
- date: string;
40
- vessel: string;
41
- initials: string;
42
- avatarClassName: string;
43
- };
44
-
45
- const DEMO_ROWS: DemoRow[] = [
46
- {
47
- title: "Cargo Tank Cleaning for Grade Change",
48
- assignee: "Dimitris Konstantinou",
49
- signatures: [1, 2, 3],
50
- date: "23/04/2026",
51
- vessel: "The Coral Explorer",
52
- initials: "MS",
53
- avatarClassName: "bg-purple-500 text-white",
54
- },
55
- {
56
- title: "Hot Work in Engine Room",
57
- assignee: "Dimitris Konstantinou",
58
- signatures: [1, 2, 3],
59
- date: "23/04/2026",
60
- vessel: "Ocean Voyager",
61
- initials: "PO",
62
- avatarClassName: "bg-blue-700 text-white",
63
- },
64
- {
65
- title: "Enclosed Space Entry in Ballast Tank",
66
- assignee: "Yiannis Papadopoulos",
67
- signatures: [1],
68
- date: "23/04/2026",
69
- vessel: "Ocean Voyager",
70
- initials: "PO",
71
- avatarClassName: "bg-blue-700 text-white",
72
- },
73
- {
74
- title: "Working at Height on Deck Crane",
75
- assignee: "Yiannis Papadopoulos",
76
- date: "23/04/2026",
77
- vessel: "Albatross Wind",
78
- initials: "LD",
79
- avatarClassName: "bg-grey-700 text-white",
80
- },
81
- {
82
- title: "Electrical Isolation for Switchboard Maintenance",
83
- assignee: "Dimitris Konstantinou",
84
- signatures: [1, 2, 3],
85
- date: "23/04/2026",
86
- vessel: "The Coral Explorer",
87
- initials: "MS",
88
- avatarClassName: "bg-purple-500 text-white",
89
- },
90
- {
91
- title: "Pilot Ladder Rigging in High Swell",
92
- unassigned: true,
93
- date: "23/04/2026",
94
- vessel: "Albatross Wind",
95
- initials: "",
96
- avatarClassName: "",
97
- },
98
- ];
99
-
100
- function DemoListRow({ row }: { row: DemoRow }) {
101
- return (
102
- <div className="flex h-12 w-full shrink-0 items-center gap-2 rounded-lg p-2">
103
- <FormsIcon size="large" className="shrink-0 text-display-on-light-primary" />
104
- <div className="flex min-w-0 flex-1 items-center gap-8">
105
- <div className="flex min-w-0 flex-1 items-center gap-2">
106
- <p className="shrink-0 truncate text-body text-display-on-light-primary">
107
- {row.title}
108
- </p>
109
- <div className="flex shrink-0 items-start gap-1">
110
- {row.unassigned ? (
111
- <Badge color="red">Unassigned</Badge>
112
- ) : row.assignee ? (
113
- <Badge color="grey">{row.assignee}</Badge>
114
- ) : null}
115
- {row.signatures?.map((n) => (
116
- <Badge key={n} color="orange" type="icon">
117
- {n}
118
- </Badge>
119
- ))}
120
- </div>
121
- </div>
122
- <div className="w-[90px] shrink-0 text-caption-2 text-display-on-light-secondary">
123
- {row.date}
124
- </div>
125
- <div className="w-[150px] shrink-0 truncate text-caption-2 text-display-on-light-secondary">
126
- {row.vessel}
127
- </div>
128
- {row.initials ? (
129
- <Avatar
130
- chief="initials"
131
- size={24}
132
- initials={row.initials}
133
- className={row.avatarClassName}
134
- />
135
- ) : (
136
- <span className="size-6 shrink-0" aria-hidden />
137
- )}
138
- </div>
139
- </div>
140
- );
141
- }
142
-
143
-
144
22
  export const ContentCanvas = () => (
145
23
  <FigmaPage title="Content" width={FIGMA_WIDTHS.content}>
146
24
  <FigmaContent>
@@ -161,130 +39,37 @@ export const ContentCanvas = () => (
161
39
  <TabsTrigger value="reports">Reports</TabsTrigger>
162
40
  <TabsTrigger value="issues">Issues</TabsTrigger>
163
41
  </TabsList>
164
- <TabsContent
165
- value="all"
166
- className="pt-3 text-caption-2 text-display-on-light-secondary"
167
- >
42
+ <TabsContent value="all" className="pt-3 text-caption-2 text-display-on-light-secondary">
168
43
  All content
169
44
  </TabsContent>
170
- <TabsContent
171
- value="reports"
172
- className="pt-3 text-caption-2 text-display-on-light-secondary"
173
- >
45
+ <TabsContent value="reports" className="pt-3 text-caption-2 text-display-on-light-secondary">
174
46
  Reports content
175
47
  </TabsContent>
176
- <TabsContent
177
- value="issues"
178
- className="pt-3 text-caption-2 text-display-on-light-secondary"
179
- >
48
+ <TabsContent value="issues" className="pt-3 text-caption-2 text-display-on-light-secondary">
180
49
  Issues content
181
50
  </TabsContent>
182
51
  </Tabs>
183
52
  </FigmaVariant>
184
- <FigmaVariant label="Pills · soft">
185
- <Tabs defaultValue="active" type="pills" appearance="soft">
53
+ <FigmaVariant label="Pills">
54
+ <Tabs defaultValue="active" type="pills">
186
55
  <TabsList>
187
56
  <TabsTrigger value="active">Active</TabsTrigger>
188
- <TabsTrigger value="completed">
57
+ <TabsTrigger value="completed" count={3}>
189
58
  Completed
190
- <Badge color="blue">3</Badge>
191
59
  </TabsTrigger>
192
60
  </TabsList>
193
- <TabsContent
194
- value="active"
195
- className="pt-3 text-caption-2 text-display-on-light-secondary"
196
- >
61
+ <TabsContent value="active" className="pt-3 text-caption-2 text-display-on-light-secondary">
197
62
  Active content
198
63
  </TabsContent>
199
- <TabsContent
200
- value="completed"
201
- className="pt-3 text-caption-2 text-display-on-light-secondary"
202
- >
64
+ <TabsContent value="completed" className="pt-3 text-caption-2 text-display-on-light-secondary">
203
65
  Completed content
204
66
  </TabsContent>
205
67
  </Tabs>
206
68
  </FigmaVariant>
207
- <FigmaVariant label="Pills · solid">
208
- <Tabs defaultValue="chat" type="pills" appearance="solid">
209
- <TabsList>
210
- <TabsTrigger value="chat">Chat</TabsTrigger>
211
- <TabsTrigger value="questions">
212
- Questions
213
- <Badge color="grey">208</Badge>
214
- </TabsTrigger>
215
- <TabsTrigger value="review">
216
- Review
217
- <Badge color="green" type="icon">
218
- <TickIcon size="xs" />
219
- </Badge>
220
- </TabsTrigger>
221
- <TabsTrigger value="gaps">
222
- Gaps
223
- <Badge color="grey">47</Badge>
224
- </TabsTrigger>
225
- </TabsList>
226
- </Tabs>
227
- </FigmaVariant>
228
69
  </div>
229
70
  </FigmaSection>
230
71
 
231
- <FigmaSection label="PageHeader">
232
- <div className="max-w-[1120px] space-y-8">
233
- <FigmaVariant label="Standard">
234
- <PageHeader
235
- icon={<ShipIcon size="large" />}
236
- title="Title"
237
- actions={demoActions}
238
- />
239
- </FigmaVariant>
240
- <FigmaVariant label="Nested">
241
- <PageHeader
242
- icon={<ShipIcon size="large" />}
243
- title="Title"
244
- crumbs={[{ label: "Parent", href: "#parent" }]}
245
- actions={demoActions}
246
- />
247
- </FigmaVariant>
248
- <FigmaVariant label="Shell (pinned header)">
249
- <div className="h-64 overflow-hidden rounded-control border border-divider-primary">
250
- <PageHeader.Shell className="bg-background-primary p-4">
251
- <PageHeader
252
- icon={<ShipIcon size="large" />}
253
- title="Fleet"
254
- crumbs={[{ label: "Ships", href: "#ships" }]}
255
- actions={demoActions}
256
- />
257
- <PageHeader.Body className="mt-4 space-y-2 text-caption-2 text-display-on-light-secondary">
258
- {Array.from({ length: 20 }, (_, i) => (
259
- <p key={i}>Scrollable body line {i + 1}</p>
260
- ))}
261
- </PageHeader.Body>
262
- </PageHeader.Shell>
263
- </div>
264
- </FigmaVariant>
265
- </div>
266
- </FigmaSection>
267
-
268
- <FigmaSection label="ScrollableList (Table)">
269
- <FigmaVariant label="Column header + scrolling body">
270
- <div className="flex h-[420px] w-full max-w-[960px] flex-col">
271
- <ScrollableList>
272
- <ScrollableList.Header>
273
- <span className="min-w-0 flex-1">Title</span>
274
- <span className="w-[90px] shrink-0">Date</span>
275
- <span className="w-[210px] shrink-0">Vessel</span>
276
- </ScrollableList.Header>
277
- <ScrollableList.Body>
278
- {DEMO_ROWS.map((row) => (
279
- <DemoListRow key={row.title} row={row} />
280
- ))}
281
- </ScrollableList.Body>
282
- </ScrollableList>
283
- </div>
284
- </FigmaVariant>
285
- </FigmaSection>
286
-
287
- <FigmaSection label="Header (legacy)">
72
+ <FigmaSection label="Header">
288
73
  <div className="max-w-xl space-y-4">
289
74
  <Header title="Fleet overview" />
290
75
  <Header
@@ -297,31 +82,9 @@ export const ContentCanvas = () => (
297
82
 
298
83
  <FigmaSection label="Entry">
299
84
  <div className="max-w-xl space-y-2">
300
- <Entry
301
- variant="chat"
302
- title="Hull inspection report"
303
- subtitle="We’ve got a persistent oil leak from the fuel pump."
304
- />
305
- <Entry
306
- variant="chat"
307
- state="active"
308
- title="Ballast Pump Not Starting"
309
- subtitle="The fuel pump won’t start consistently."
310
- trailing={
311
- <span className="text-display-on-light-secondary">···</span>
312
- }
313
- />
314
- <Entry
315
- variant="issue"
316
- title="Excessive Rust on Fuel Pump"
317
- subtitle="Created by Jake Silva on March 28"
318
- count={3}
319
- />
320
- <Entry
321
- variant="report"
322
- title="Engine Room Oil Leak"
323
- subtitle="We’ve spotted a steady oil leak near the fuel pump."
324
- />
85
+ <Entry type="chat" title="Hull inspection report" subtitle="2 hours ago" meta="17" />
86
+ <Entry type="issue" title="Critical valve malfunction" state="selected" meta="High" />
87
+ <Entry type="chat" title="Port state control checklist" subtitle="Yesterday" className="bg-background-hover" />
325
88
  </div>
326
89
  </FigmaSection>
327
90
 
@@ -339,9 +102,7 @@ export const ContentCanvas = () => (
339
102
  <div className="w-80">
340
103
  <EmptyState
341
104
  title="No reports"
342
- illustration={
343
- <WorkflowsIllustration className="mx-auto h-24 w-32" />
344
- }
105
+ illustration={<WorkflowsIllustration className="mx-auto h-24 w-32" />}
345
106
  action={{ children: "Create report", hierarchy: "primary" }}
346
107
  />
347
108
  </div>