@spunto/design-system 0.63.1 → 0.64.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/package.json
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
// machine), then how it was set up.
|
|
15
15
|
|
|
16
16
|
import { createContext, useContext, useState, type ReactNode } from "react"
|
|
17
|
-
import { CheckIcon, ChevronRightIcon, CopyIcon, ExternalLinkIcon, GitBranchIcon, Loader2Icon, XCircleIcon } from "lucide-react"
|
|
17
|
+
import { CheckIcon, ChevronRightIcon, CopyIcon, ExternalLinkIcon, GitBranchIcon, Loader2Icon, SlidersHorizontalIcon, XCircleIcon } from "lucide-react"
|
|
18
18
|
|
|
19
19
|
import { cn, formatRelativeTime } from "../../utils"
|
|
20
20
|
import { TaskCommandLog } from "./command-log"
|
|
@@ -46,6 +46,11 @@ export interface TaskDetailsProps {
|
|
|
46
46
|
* the pull requests, and where each stands. One block per app, absent when it has nothing.
|
|
47
47
|
*/
|
|
48
48
|
appTiles?: TaskAppTile[] | null
|
|
49
|
+
/**
|
|
50
|
+
* Where a reader changes what a `customizable` block shows — the app's card in the org's
|
|
51
|
+
* integrations. Absent (or null for a tile) = no link.
|
|
52
|
+
*/
|
|
53
|
+
appTileSettingsHref?: (tile: TaskAppTile) => string | null
|
|
49
54
|
attachmentUrl?: AttachmentUrl
|
|
50
55
|
/** The Machine block's content — typically a `TaskMachine`. */
|
|
51
56
|
machine?: ReactNode
|
|
@@ -131,6 +136,21 @@ function Block({
|
|
|
131
136
|
)
|
|
132
137
|
}
|
|
133
138
|
|
|
139
|
+
/** « Customize » under a block whose app lets each reader choose what it shows (RFC 0053 § 6). */
|
|
140
|
+
function CustomizeLink({ tile, href }: { tile: TaskAppTile; href?: (tile: TaskAppTile) => string | null }) {
|
|
141
|
+
const to = tile.customizable && href ? href(tile) : null
|
|
142
|
+
if (!to) return null
|
|
143
|
+
return (
|
|
144
|
+
<a
|
|
145
|
+
href={to}
|
|
146
|
+
className="mt-3 inline-flex items-center gap-1 text-[10px] text-muted-foreground transition-colors hover:text-foreground"
|
|
147
|
+
>
|
|
148
|
+
<SlidersHorizontalIcon className="h-3 w-3" />
|
|
149
|
+
Customize
|
|
150
|
+
</a>
|
|
151
|
+
)
|
|
152
|
+
}
|
|
153
|
+
|
|
134
154
|
export function TaskDetails({
|
|
135
155
|
task,
|
|
136
156
|
variant = "sidebar",
|
|
@@ -138,6 +158,7 @@ export function TaskDetails({
|
|
|
138
158
|
pullRequests,
|
|
139
159
|
shared,
|
|
140
160
|
appTiles,
|
|
161
|
+
appTileSettingsHref,
|
|
141
162
|
attachmentUrl,
|
|
142
163
|
machine,
|
|
143
164
|
commands = [],
|
|
@@ -232,6 +253,7 @@ export function TaskDetails({
|
|
|
232
253
|
{appTiles?.filter((tile) => tile.session).map((tile) => (
|
|
233
254
|
<Block key={tile.appId} variant={variant} title={tile.title} hint={tile.appName === tile.title ? undefined : tile.appName}>
|
|
234
255
|
<TaskAppTileContent tile={tile} />
|
|
256
|
+
<CustomizeLink tile={tile} href={appTileSettingsHref} />
|
|
235
257
|
</Block>
|
|
236
258
|
))}
|
|
237
259
|
|
|
@@ -246,6 +268,7 @@ export function TaskDetails({
|
|
|
246
268
|
{appTiles?.filter((tile) => !tile.session).map((tile) => (
|
|
247
269
|
<Block key={tile.appId} variant={variant} title={tile.title} hint={tile.appName === tile.title ? undefined : tile.appName}>
|
|
248
270
|
<TaskAppTileContent tile={tile} />
|
|
271
|
+
<CustomizeLink tile={tile} href={appTileSettingsHref} />
|
|
249
272
|
</Block>
|
|
250
273
|
))}
|
|
251
274
|
|
|
@@ -313,6 +313,8 @@ export interface TaskAppTile {
|
|
|
313
313
|
title: string
|
|
314
314
|
/** From the app running the task's session: drawn right under Session rather than with the others. */
|
|
315
315
|
session?: boolean
|
|
316
|
+
/** The app lets each reader choose what this block shows (RFC 0053 § 6): `TaskDetails` links to where. */
|
|
317
|
+
customizable?: boolean
|
|
316
318
|
meters?: TaskAppTileMeter[]
|
|
317
319
|
facts?: TaskAppTileFact[]
|
|
318
320
|
items?: TaskAppTileItem[]
|