@burdenoff/planmagnet-fe-sdk 2026.703.2 → 2026.703.3
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/index.d.ts +230 -113
- package/dist/index.js +165 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { HTMLAttributes, ReactNode, ComponentType, DragEvent } from 'react';
|
|
3
3
|
import { ApolloClient } from '@apollo/client/core';
|
|
4
4
|
import * as graphql from 'graphql';
|
|
5
5
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
@@ -7,6 +7,32 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
7
7
|
import { LucideProps } from 'lucide-react';
|
|
8
8
|
import { ClassValue } from 'clsx';
|
|
9
9
|
|
|
10
|
+
declare const badgeVariants: (props?: ({
|
|
11
|
+
variant?: "default" | "muted" | "secondary" | "accent" | "destructive" | null | undefined;
|
|
12
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
13
|
+
interface BadgeProps extends HTMLAttributes<HTMLSpanElement>, VariantProps<typeof badgeVariants> {
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Badge — a small owned pill primitive used for task status/priority/type.
|
|
17
|
+
* Semantic-token only.
|
|
18
|
+
*/
|
|
19
|
+
declare function Badge({ className, variant, ...props }: BadgeProps): react.JSX.Element;
|
|
20
|
+
|
|
21
|
+
declare const SIZES: {
|
|
22
|
+
readonly sm: "h-5 w-5 text-[9px]";
|
|
23
|
+
readonly md: "h-6 w-6 text-[10px]";
|
|
24
|
+
readonly lg: "h-8 w-8 text-xs";
|
|
25
|
+
};
|
|
26
|
+
interface AvatarProps {
|
|
27
|
+
/** Assignee actor id (used for the deterministic tint + fallback initials). */
|
|
28
|
+
id?: string | null;
|
|
29
|
+
/** Resolved display name, if the host has a directory. */
|
|
30
|
+
name?: string | null;
|
|
31
|
+
size?: keyof typeof SIZES;
|
|
32
|
+
className?: string;
|
|
33
|
+
}
|
|
34
|
+
declare function Avatar({ id, name, size, className }: AvatarProps): react.JSX.Element;
|
|
35
|
+
|
|
10
36
|
/**
|
|
11
37
|
* Domain types for the PlanMagnet task SDK.
|
|
12
38
|
*
|
|
@@ -155,6 +181,58 @@ interface ProjectList {
|
|
|
155
181
|
pageInfo: TaskPageInfo;
|
|
156
182
|
totalCount: number;
|
|
157
183
|
}
|
|
184
|
+
/**
|
|
185
|
+
* A link between a work item and an external entity owned by another product
|
|
186
|
+
* (`WorkItemLink`). HealthyBowl pins a task to a Field/Crop/Animal/Pest record
|
|
187
|
+
* via `sourceProduct: "healthybowl"` + `entityType`/`entityId`, snapshotting a
|
|
188
|
+
* label + deep-link so a deleted record degrades gracefully. The OUTPUT type is
|
|
189
|
+
* bare `WorkItemLink`; server-side all ids except `id` are `String`.
|
|
190
|
+
*/
|
|
191
|
+
interface WorkItemLink {
|
|
192
|
+
id: string;
|
|
193
|
+
workspaceId: string;
|
|
194
|
+
workItemId: string;
|
|
195
|
+
sourceProduct: string;
|
|
196
|
+
entityType: string;
|
|
197
|
+
entityId: string;
|
|
198
|
+
relationType: WorkItemLinkRelation;
|
|
199
|
+
displayNameSnapshot?: string | null;
|
|
200
|
+
deepLinkSnapshot?: string | null;
|
|
201
|
+
metadata?: unknown;
|
|
202
|
+
createdBy: string;
|
|
203
|
+
onBehalfOf?: string | null;
|
|
204
|
+
createdAt: string;
|
|
205
|
+
updatedAt: string;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Input for `planmagnetLinkWorkItem` (PlanmagnetCreateWorkItemLinkInput).
|
|
209
|
+
* Required: workItemId, sourceProduct, entityType, entityId. `relationType` is
|
|
210
|
+
* optional (server defaults to RELATED_TO).
|
|
211
|
+
*/
|
|
212
|
+
interface CreateWorkItemLinkInput {
|
|
213
|
+
workItemId: string;
|
|
214
|
+
sourceProduct: string;
|
|
215
|
+
entityType: string;
|
|
216
|
+
entityId: string;
|
|
217
|
+
relationType?: WorkItemLinkRelation;
|
|
218
|
+
displayNameSnapshot?: string;
|
|
219
|
+
deepLinkSnapshot?: string;
|
|
220
|
+
metadata?: unknown;
|
|
221
|
+
}
|
|
222
|
+
/** Filter for `planmagnetWorkItemLinks` (PlanmagnetWorkItemLinkFilter). */
|
|
223
|
+
interface ListWorkItemLinksInput {
|
|
224
|
+
workItemId?: string;
|
|
225
|
+
sourceProduct?: string;
|
|
226
|
+
entityType?: string;
|
|
227
|
+
entityId?: string;
|
|
228
|
+
relationType?: WorkItemLinkRelation;
|
|
229
|
+
}
|
|
230
|
+
/** Shape returned by the ListWorkItemLinks query (PlanmagnetWorkItemLinkList). */
|
|
231
|
+
interface WorkItemLinkList {
|
|
232
|
+
items: WorkItemLink[];
|
|
233
|
+
pageInfo: TaskPageInfo;
|
|
234
|
+
totalCount: number;
|
|
235
|
+
}
|
|
158
236
|
/** Board column definition. */
|
|
159
237
|
interface BoardColumn {
|
|
160
238
|
status: TaskStatus;
|
|
@@ -179,6 +257,106 @@ declare const TASK_STATUSES: TaskStatus[];
|
|
|
179
257
|
*/
|
|
180
258
|
declare function enumLabel(value: string): string;
|
|
181
259
|
|
|
260
|
+
/**
|
|
261
|
+
* Optional host hook to render an icon for a linked entity type (e.g. a leaf
|
|
262
|
+
* for FIELD, a cow for ANIMAL). The SDK is farm-free, so it renders a generic
|
|
263
|
+
* link glyph unless the host supplies one.
|
|
264
|
+
*/
|
|
265
|
+
type RenderLinkIcon = (entityType: string) => ReactNode;
|
|
266
|
+
interface LinkChipProps {
|
|
267
|
+
link: WorkItemLink;
|
|
268
|
+
renderIcon?: RenderLinkIcon;
|
|
269
|
+
className?: string;
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* LinkChip — a compact chip for a WorkItemLink (the task's linked farm record).
|
|
273
|
+
* Shows the snapshotted label (falls back to the entity type), tinted with the
|
|
274
|
+
* primary token so it reads as the mockup's green linked-record chip in the
|
|
275
|
+
* forest theme. Deep-links via `deepLinkSnapshot` when present; the click is
|
|
276
|
+
* stopped from bubbling so it doesn't also open the task.
|
|
277
|
+
*/
|
|
278
|
+
declare function LinkChip({ link, renderIcon, className }: LinkChipProps): react.JSX.Element;
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* Linear-style task indicators — status, priority, type.
|
|
282
|
+
*
|
|
283
|
+
* A hard rule of the codebase is "semantic tokens only, never raw colors". The
|
|
284
|
+
* default token palette only exposes a handful of hues (primary / secondary /
|
|
285
|
+
* muted / accent / destructive), which is not enough to give each of the six
|
|
286
|
+
* statuses its own distinct color like a raw-palette design would.
|
|
287
|
+
*
|
|
288
|
+
* So — exactly like Linear — status is differentiated primarily by icon SHAPE
|
|
289
|
+
* (dashed → empty → dotted → filled → check), with a subtle muted→primary tone
|
|
290
|
+
* progression, and priority by a filled-BAR count. This reads as a polished PM
|
|
291
|
+
* tool while staying 100% within the semantic-token contract.
|
|
292
|
+
*/
|
|
293
|
+
interface StatusMeta {
|
|
294
|
+
icon: ComponentType<LucideProps>;
|
|
295
|
+
/** Icon tone (semantic token). */
|
|
296
|
+
tone: string;
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Per-status icon + tone. Shape carries the meaning; tone progresses from muted
|
|
300
|
+
* (not started) toward primary (in flight / done). Overridable by hosts only
|
|
301
|
+
* via the column labels, never by raw color.
|
|
302
|
+
*/
|
|
303
|
+
declare const STATUS_META: Record<TaskStatus, StatusMeta>;
|
|
304
|
+
interface StatusIconProps {
|
|
305
|
+
status: TaskStatus;
|
|
306
|
+
className?: string;
|
|
307
|
+
}
|
|
308
|
+
/** A single status glyph — shape-differentiated, token-toned. */
|
|
309
|
+
declare function StatusIcon({ status, className }: StatusIconProps): react.JSX.Element;
|
|
310
|
+
interface StatusPillProps {
|
|
311
|
+
status: TaskStatus;
|
|
312
|
+
className?: string;
|
|
313
|
+
}
|
|
314
|
+
/** Status as a compact bordered pill (icon + label) — used in the list view. */
|
|
315
|
+
declare function StatusPill({ status, className }: StatusPillProps): react.JSX.Element;
|
|
316
|
+
interface PriorityMeta {
|
|
317
|
+
/** Number of filled bars (0–3). */
|
|
318
|
+
level: number;
|
|
319
|
+
/** Fill tone (semantic token) applied to the filled bars + label. */
|
|
320
|
+
tone: string;
|
|
321
|
+
}
|
|
322
|
+
declare const PRIORITY_META: Record<TaskPriority, PriorityMeta>;
|
|
323
|
+
interface PriorityIndicatorProps {
|
|
324
|
+
priority: TaskPriority;
|
|
325
|
+
/** Show the text label next to the bars. */
|
|
326
|
+
showLabel?: boolean;
|
|
327
|
+
className?: string;
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* Linear-style priority signal — three bars, filled by level. NONE renders all
|
|
331
|
+
* bars faint (its own recognizable "no priority" look).
|
|
332
|
+
*/
|
|
333
|
+
declare function PriorityIndicator({ priority, showLabel, className, }: PriorityIndicatorProps): react.JSX.Element;
|
|
334
|
+
interface TypeBadgeProps {
|
|
335
|
+
type: TaskType;
|
|
336
|
+
className?: string;
|
|
337
|
+
}
|
|
338
|
+
/** Work-item type as a subtle badge. */
|
|
339
|
+
declare function TypeBadge({ type, className }: TypeBadgeProps): react.JSX.Element;
|
|
340
|
+
|
|
341
|
+
interface ModalProps {
|
|
342
|
+
open: boolean;
|
|
343
|
+
onClose: () => void;
|
|
344
|
+
children: ReactNode;
|
|
345
|
+
ariaLabel?: string;
|
|
346
|
+
className?: string;
|
|
347
|
+
}
|
|
348
|
+
/** Centered modal card overlay (owned, semantic-token only). */
|
|
349
|
+
declare function Modal(props: ModalProps): react.JSX.Element;
|
|
350
|
+
interface DrawerProps {
|
|
351
|
+
open: boolean;
|
|
352
|
+
onClose: () => void;
|
|
353
|
+
children: ReactNode;
|
|
354
|
+
ariaLabel?: string;
|
|
355
|
+
className?: string;
|
|
356
|
+
}
|
|
357
|
+
/** Right-anchored slide-over drawer overlay (owned, semantic-token only). */
|
|
358
|
+
declare function Drawer(props: DrawerProps): react.JSX.Element;
|
|
359
|
+
|
|
182
360
|
/**
|
|
183
361
|
* Optional host hook: resolve an assignee id to a display name (the SDK has no
|
|
184
362
|
* user directory). When omitted the avatar falls back to id-initials.
|
|
@@ -198,6 +376,10 @@ interface TaskCardProps {
|
|
|
198
376
|
/** True while this card is the one being dragged. */
|
|
199
377
|
dragging?: boolean;
|
|
200
378
|
resolveAssignee?: ResolveAssignee;
|
|
379
|
+
/** Linked farm records for this task (rendered as chips). */
|
|
380
|
+
links?: WorkItemLink[];
|
|
381
|
+
/** Optional host hook to render an icon per linked-entity type. */
|
|
382
|
+
renderLinkIcon?: RenderLinkIcon;
|
|
201
383
|
className?: string;
|
|
202
384
|
}
|
|
203
385
|
/**
|
|
@@ -205,7 +387,7 @@ interface TaskCardProps {
|
|
|
205
387
|
* only real fields (no invented assignee names or entity links). Semantic
|
|
206
388
|
* tokens only.
|
|
207
389
|
*/
|
|
208
|
-
declare function TaskCard({ task, hidden, onClick, draggable, onDragStart, onDragEnd, dragging, resolveAssignee, className, }: TaskCardProps): react.JSX.Element;
|
|
390
|
+
declare function TaskCard({ task, hidden, onClick, draggable, onDragStart, onDragEnd, dragging, resolveAssignee, links, renderLinkIcon, className, }: TaskCardProps): react.JSX.Element;
|
|
209
391
|
|
|
210
392
|
interface TaskBoardCoreProps {
|
|
211
393
|
/** Scope the board to one project (client-side filter for Phase 1). */
|
|
@@ -239,6 +421,14 @@ interface TaskBoardCoreProps {
|
|
|
239
421
|
resolveAssignee?: ResolveAssignee;
|
|
240
422
|
/** Called when a task card is clicked. */
|
|
241
423
|
onTaskClick?: (task: Task) => void;
|
|
424
|
+
/**
|
|
425
|
+
* When set, the board fetches WorkItemLinks for this `sourceProduct` (e.g.
|
|
426
|
+
* "healthybowl") and renders a linked-record chip on each card. Omitted → no
|
|
427
|
+
* link fetch (SDK stays farm-free).
|
|
428
|
+
*/
|
|
429
|
+
linkSourceProduct?: string;
|
|
430
|
+
/** Optional host hook to render an icon per linked-entity type. */
|
|
431
|
+
renderLinkIcon?: RenderLinkIcon;
|
|
242
432
|
/** Extra classes on the root container. */
|
|
243
433
|
className?: string;
|
|
244
434
|
/**
|
|
@@ -257,7 +447,7 @@ interface TaskBoardCoreProps {
|
|
|
257
447
|
* (optimistic cache update + `UPDATE_WORK_ITEM`; reverts on error). Filtering
|
|
258
448
|
* is controlled by the parent toolbar. Farm-free, semantic-token only.
|
|
259
449
|
*/
|
|
260
|
-
declare function TaskBoardCore({ projectId, columns, readonly, hideHeader, priority, type, search, assigneeId, hiddenFields, resolveAssignee, onTaskClick, className, workspaceId: workspaceIdProp, }: TaskBoardCoreProps): react.JSX.Element;
|
|
450
|
+
declare function TaskBoardCore({ projectId, columns, readonly, hideHeader, priority, type, search, assigneeId, hiddenFields, resolveAssignee, linkSourceProduct, renderLinkIcon, onTaskClick, className, workspaceId: workspaceIdProp, }: TaskBoardCoreProps): react.JSX.Element;
|
|
261
451
|
|
|
262
452
|
interface TaskBoardProps extends TaskBoardCoreProps {
|
|
263
453
|
/** Workspace API gateway URL (URL mode). */
|
|
@@ -394,7 +584,7 @@ interface CreateTaskProps extends CreateTaskCoreProps {
|
|
|
394
584
|
declare function CreateTask({ apiGatewayUrl, authToken, workspaceToken, workspaceId, tenantId, organizationId, trustedOrigins, onAuthError, workspaceClient, ...coreProps }: CreateTaskProps): react.JSX.Element;
|
|
395
585
|
|
|
396
586
|
/** Columns available in the compact list. */
|
|
397
|
-
type TaskListColumn = "key" | "title" | "type" | "status" | "priority" | "assignee" | "dueDate" | "storyPoints" | "labels";
|
|
587
|
+
type TaskListColumn = "key" | "title" | "type" | "status" | "priority" | "assignee" | "dueDate" | "storyPoints" | "linkedRecord" | "labels";
|
|
398
588
|
/** Sort keys for the list. */
|
|
399
589
|
type TaskListSort = "priority" | "status" | "title" | "type" | "dueDate" | "storyPoints";
|
|
400
590
|
interface TaskListCoreProps {
|
|
@@ -422,6 +612,13 @@ interface TaskListCoreProps {
|
|
|
422
612
|
onSelect?: (id: string) => void;
|
|
423
613
|
/** Optional host hook to resolve an assignee id → display name. */
|
|
424
614
|
resolveAssignee?: ResolveAssignee;
|
|
615
|
+
/**
|
|
616
|
+
* When set, fetch WorkItemLinks for this `sourceProduct` and populate the
|
|
617
|
+
* "linkedRecord" column. Omitted → no link fetch.
|
|
618
|
+
*/
|
|
619
|
+
linkSourceProduct?: string;
|
|
620
|
+
/** Optional host hook to render an icon per linked-entity type. */
|
|
621
|
+
renderLinkIcon?: RenderLinkIcon;
|
|
425
622
|
/** Max items to fetch (pagination.first). Defaults to 200. */
|
|
426
623
|
limit?: number;
|
|
427
624
|
/** Extra classes on the root container. */
|
|
@@ -437,7 +634,7 @@ interface TaskListCoreProps {
|
|
|
437
634
|
* headers. Filters map to the server-side filter; sort is client-side.
|
|
438
635
|
* BYO-Apollo, semantic-token only, farm-free.
|
|
439
636
|
*/
|
|
440
|
-
declare function TaskListCore({ projectId, status, type, priority, assigneeId, search, columns, sortBy, sortDir, hideHeader, onSelect, resolveAssignee, limit, className, workspaceId: workspaceIdProp, }: TaskListCoreProps): react.JSX.Element;
|
|
637
|
+
declare function TaskListCore({ projectId, status, type, priority, assigneeId, search, columns, sortBy, sortDir, hideHeader, onSelect, resolveAssignee, linkSourceProduct, renderLinkIcon, limit, className, workspaceId: workspaceIdProp, }: TaskListCoreProps): react.JSX.Element;
|
|
441
638
|
|
|
442
639
|
interface TaskListProps extends TaskListCoreProps {
|
|
443
640
|
/** Workspace API gateway URL (URL mode). */
|
|
@@ -639,6 +836,14 @@ interface TasksPageCoreProps {
|
|
|
639
836
|
defaultView?: TaskView;
|
|
640
837
|
/** Optional host hook to resolve an assignee id → display name. */
|
|
641
838
|
resolveAssignee?: ResolveAssignee;
|
|
839
|
+
/**
|
|
840
|
+
* When set, the board + list fetch WorkItemLinks for this `sourceProduct`
|
|
841
|
+
* (e.g. "healthybowl") and render linked-record chips / a "Linked Record"
|
|
842
|
+
* column. Omitted → no link fetch (SDK stays farm-free).
|
|
843
|
+
*/
|
|
844
|
+
linkSourceProduct?: string;
|
|
845
|
+
/** Optional host hook to render an icon per linked-entity type. */
|
|
846
|
+
renderLinkIcon?: RenderLinkIcon;
|
|
642
847
|
/**
|
|
643
848
|
* Header/title slot rendered ABOVE the toolbar. Pass a string for the default
|
|
644
849
|
* heading, or any node to fully own the title area. Omit for no title (e.g.
|
|
@@ -663,7 +868,7 @@ interface TasksPageCoreProps {
|
|
|
663
868
|
* BYO-Apollo: reads the ambient `<ApolloProvider>` and takes `workspaceId` from
|
|
664
869
|
* a prop or the PlanMagnetProvider context. Semantic tokens only, farm-free.
|
|
665
870
|
*/
|
|
666
|
-
declare function TasksPageCore({ workspaceId: workspaceIdProp, projectId, boardProjectId, columns, readonly, hiddenFields, views, defaultView, resolveAssignee, header, onTaskSaved, createSurface, detailSurface, className, }: TasksPageCoreProps): react.JSX.Element;
|
|
871
|
+
declare function TasksPageCore({ workspaceId: workspaceIdProp, projectId, boardProjectId, columns, readonly, hiddenFields, views, defaultView, resolveAssignee, linkSourceProduct, renderLinkIcon, header, onTaskSaved, createSurface, detailSurface, className, }: TasksPageCoreProps): react.JSX.Element;
|
|
667
872
|
|
|
668
873
|
interface TasksPageProps extends TasksPageCoreProps {
|
|
669
874
|
/** Workspace API gateway URL (URL mode). */
|
|
@@ -767,6 +972,20 @@ declare function usePlanMagnetContext(): PlanMagnetContextValue;
|
|
|
767
972
|
*/
|
|
768
973
|
declare function usePlanMagnetContextSafe(): PlanMagnetContextValue | null;
|
|
769
974
|
|
|
975
|
+
interface UseWorkItemLinksResult {
|
|
976
|
+
/** Links grouped by the work item they belong to. */
|
|
977
|
+
linksByItem: Map<string, WorkItemLink[]>;
|
|
978
|
+
loading: boolean;
|
|
979
|
+
}
|
|
980
|
+
/**
|
|
981
|
+
* useWorkItemLinks — batch-fetch WorkItemLinks for a workspace (scoped to one
|
|
982
|
+
* `sourceProduct`, e.g. "healthybowl") in ONE query and group them by
|
|
983
|
+
* `workItemId`. WorkItem has no `links` field, so the board/list join links to
|
|
984
|
+
* items client-side. Skips entirely when no `sourceProduct` is provided, so the
|
|
985
|
+
* SDK stays farm-free and link-fetching is opt-in per host.
|
|
986
|
+
*/
|
|
987
|
+
declare function useWorkItemLinks(workspaceId: string | undefined, sourceProduct: string | undefined, limit?: number): UseWorkItemLinksResult;
|
|
988
|
+
|
|
770
989
|
interface PlanMagnetClientConfig {
|
|
771
990
|
/** Workspace API gateway base URL (e.g. https://graphqlworkspaces.burdenoff.com). */
|
|
772
991
|
apiGatewayUrl: string;
|
|
@@ -840,6 +1059,10 @@ declare const GET_PROJECTS: graphql.DocumentNode;
|
|
|
840
1059
|
declare const CREATE_WORK_ITEM: graphql.DocumentNode;
|
|
841
1060
|
declare const UPDATE_WORK_ITEM: graphql.DocumentNode;
|
|
842
1061
|
declare const MOVE_WORK_ITEM: graphql.DocumentNode;
|
|
1062
|
+
declare const WORK_ITEM_LINK_FIELDS: graphql.DocumentNode;
|
|
1063
|
+
declare const LIST_WORK_ITEM_LINKS: graphql.DocumentNode;
|
|
1064
|
+
declare const CREATE_WORK_ITEM_LINK: graphql.DocumentNode;
|
|
1065
|
+
declare const DELETE_WORK_ITEM_LINK: graphql.DocumentNode;
|
|
843
1066
|
|
|
844
1067
|
/**
|
|
845
1068
|
* Configuration module for the PlanMagnet SDK.
|
|
@@ -907,112 +1130,6 @@ declare function validateTrustedOrigin(trustedOrigins?: string[]): void;
|
|
|
907
1130
|
*/
|
|
908
1131
|
declare function getGraphQLEndpoint(baseUrl?: string): string;
|
|
909
1132
|
|
|
910
|
-
declare const badgeVariants: (props?: ({
|
|
911
|
-
variant?: "default" | "muted" | "secondary" | "accent" | "destructive" | null | undefined;
|
|
912
|
-
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
913
|
-
interface BadgeProps extends HTMLAttributes<HTMLSpanElement>, VariantProps<typeof badgeVariants> {
|
|
914
|
-
}
|
|
915
|
-
/**
|
|
916
|
-
* Badge — a small owned pill primitive used for task status/priority/type.
|
|
917
|
-
* Semantic-token only.
|
|
918
|
-
*/
|
|
919
|
-
declare function Badge({ className, variant, ...props }: BadgeProps): react.JSX.Element;
|
|
920
|
-
|
|
921
|
-
declare const SIZES: {
|
|
922
|
-
readonly sm: "h-5 w-5 text-[9px]";
|
|
923
|
-
readonly md: "h-6 w-6 text-[10px]";
|
|
924
|
-
readonly lg: "h-8 w-8 text-xs";
|
|
925
|
-
};
|
|
926
|
-
interface AvatarProps {
|
|
927
|
-
/** Assignee actor id (used for the deterministic tint + fallback initials). */
|
|
928
|
-
id?: string | null;
|
|
929
|
-
/** Resolved display name, if the host has a directory. */
|
|
930
|
-
name?: string | null;
|
|
931
|
-
size?: keyof typeof SIZES;
|
|
932
|
-
className?: string;
|
|
933
|
-
}
|
|
934
|
-
declare function Avatar({ id, name, size, className }: AvatarProps): react.JSX.Element;
|
|
935
|
-
|
|
936
|
-
/**
|
|
937
|
-
* Linear-style task indicators — status, priority, type.
|
|
938
|
-
*
|
|
939
|
-
* A hard rule of the codebase is "semantic tokens only, never raw colors". The
|
|
940
|
-
* default token palette only exposes a handful of hues (primary / secondary /
|
|
941
|
-
* muted / accent / destructive), which is not enough to give each of the six
|
|
942
|
-
* statuses its own distinct color like a raw-palette design would.
|
|
943
|
-
*
|
|
944
|
-
* So — exactly like Linear — status is differentiated primarily by icon SHAPE
|
|
945
|
-
* (dashed → empty → dotted → filled → check), with a subtle muted→primary tone
|
|
946
|
-
* progression, and priority by a filled-BAR count. This reads as a polished PM
|
|
947
|
-
* tool while staying 100% within the semantic-token contract.
|
|
948
|
-
*/
|
|
949
|
-
interface StatusMeta {
|
|
950
|
-
icon: ComponentType<LucideProps>;
|
|
951
|
-
/** Icon tone (semantic token). */
|
|
952
|
-
tone: string;
|
|
953
|
-
}
|
|
954
|
-
/**
|
|
955
|
-
* Per-status icon + tone. Shape carries the meaning; tone progresses from muted
|
|
956
|
-
* (not started) toward primary (in flight / done). Overridable by hosts only
|
|
957
|
-
* via the column labels, never by raw color.
|
|
958
|
-
*/
|
|
959
|
-
declare const STATUS_META: Record<TaskStatus, StatusMeta>;
|
|
960
|
-
interface StatusIconProps {
|
|
961
|
-
status: TaskStatus;
|
|
962
|
-
className?: string;
|
|
963
|
-
}
|
|
964
|
-
/** A single status glyph — shape-differentiated, token-toned. */
|
|
965
|
-
declare function StatusIcon({ status, className }: StatusIconProps): react.JSX.Element;
|
|
966
|
-
interface StatusPillProps {
|
|
967
|
-
status: TaskStatus;
|
|
968
|
-
className?: string;
|
|
969
|
-
}
|
|
970
|
-
/** Status as a compact bordered pill (icon + label) — used in the list view. */
|
|
971
|
-
declare function StatusPill({ status, className }: StatusPillProps): react.JSX.Element;
|
|
972
|
-
interface PriorityMeta {
|
|
973
|
-
/** Number of filled bars (0–3). */
|
|
974
|
-
level: number;
|
|
975
|
-
/** Fill tone (semantic token) applied to the filled bars + label. */
|
|
976
|
-
tone: string;
|
|
977
|
-
}
|
|
978
|
-
declare const PRIORITY_META: Record<TaskPriority, PriorityMeta>;
|
|
979
|
-
interface PriorityIndicatorProps {
|
|
980
|
-
priority: TaskPriority;
|
|
981
|
-
/** Show the text label next to the bars. */
|
|
982
|
-
showLabel?: boolean;
|
|
983
|
-
className?: string;
|
|
984
|
-
}
|
|
985
|
-
/**
|
|
986
|
-
* Linear-style priority signal — three bars, filled by level. NONE renders all
|
|
987
|
-
* bars faint (its own recognizable "no priority" look).
|
|
988
|
-
*/
|
|
989
|
-
declare function PriorityIndicator({ priority, showLabel, className, }: PriorityIndicatorProps): react.JSX.Element;
|
|
990
|
-
interface TypeBadgeProps {
|
|
991
|
-
type: TaskType;
|
|
992
|
-
className?: string;
|
|
993
|
-
}
|
|
994
|
-
/** Work-item type as a subtle badge. */
|
|
995
|
-
declare function TypeBadge({ type, className }: TypeBadgeProps): react.JSX.Element;
|
|
996
|
-
|
|
997
|
-
interface ModalProps {
|
|
998
|
-
open: boolean;
|
|
999
|
-
onClose: () => void;
|
|
1000
|
-
children: ReactNode;
|
|
1001
|
-
ariaLabel?: string;
|
|
1002
|
-
className?: string;
|
|
1003
|
-
}
|
|
1004
|
-
/** Centered modal card overlay (owned, semantic-token only). */
|
|
1005
|
-
declare function Modal(props: ModalProps): react.JSX.Element;
|
|
1006
|
-
interface DrawerProps {
|
|
1007
|
-
open: boolean;
|
|
1008
|
-
onClose: () => void;
|
|
1009
|
-
children: ReactNode;
|
|
1010
|
-
ariaLabel?: string;
|
|
1011
|
-
className?: string;
|
|
1012
|
-
}
|
|
1013
|
-
/** Right-anchored slide-over drawer overlay (owned, semantic-token only). */
|
|
1014
|
-
declare function Drawer(props: DrawerProps): react.JSX.Element;
|
|
1015
|
-
|
|
1016
1133
|
declare function cn(...inputs: ClassValue[]): string;
|
|
1017
1134
|
|
|
1018
|
-
export { Avatar, type AvatarProps, Badge, type BadgeProps, type BoardColumn, CREATE_WORK_ITEM, CreateTask, CreateTaskCore, type CreateTaskCoreProps, type CreateTaskField, type CreateTaskInput, type CreateTaskProps, DEFAULT_BOARD_COLUMNS, Drawer, type DrawerProps, GET_PROJECTS, GET_WORK_ITEM, LIST_WORK_ITEMS, type ListTasksInput, MOVE_WORK_ITEM, Modal, type ModalProps, PRIORITY_META, PROJECT_SUMMARY_FIELDS, type PlanMagnetClientConfig, type PlanMagnetConfig, PlanMagnetProvider, type PlanMagnetProviderProps, PriorityIndicator, type PriorityIndicatorProps, type Project, type ProjectList, type ResolveAssignee, STATUS_META, StatusIcon, type StatusIconProps, StatusPill, type StatusPillProps, TASK_PRIORITIES, TASK_STATUSES, TASK_TYPES, type Task, TaskBoard, TaskBoardCore, type TaskBoardCoreProps, type TaskBoardProps, TaskCard, type TaskCardProps, TaskDetail, TaskDetailCore, type TaskDetailCoreProps, type TaskDetailField, type TaskDetailProps, TaskList, type TaskListColumn, TaskListCore, type TaskListCoreProps, type TaskListProps, type TaskListSort, type TaskPageInfo, type TaskPaginationInput, type TaskPriority, type TaskSavedResult, type TaskStatus, TaskTimelineCore, type TaskTimelineCoreProps, TaskToolbar, type TaskToolbarProps, type TaskType, type TaskView, TasksPage, TasksPageCore, type TasksPageCoreProps, type TasksPageField, type TasksPageProps, type TasksPageSaved, TypeBadge, type TypeBadgeProps, UPDATE_WORK_ITEM, type UpdateTaskInput, WORK_ITEM_FIELDS, WORK_ITEM_SUMMARY_FIELDS, type WorkItemDetail, type WorkItemLinkRelation, type WorkItemList, badgeVariants, cn, config, createPlanMagnetClient, enumLabel, getGraphQLEndpoint, getPlanMagnetClient, getPlanMagnetClientSafe, getPlanMagnetConfig, isPlanMagnetClientReady, resetPlanMagnetClient, resetPlanMagnetConfig, setPlanMagnetClient, setPlanMagnetConfig, usePlanMagnetContext, usePlanMagnetContextSafe, validateTrustedOrigin, waitForPlanMagnetClient };
|
|
1135
|
+
export { Avatar, type AvatarProps, Badge, type BadgeProps, type BoardColumn, CREATE_WORK_ITEM, CREATE_WORK_ITEM_LINK, CreateTask, CreateTaskCore, type CreateTaskCoreProps, type CreateTaskField, type CreateTaskInput, type CreateTaskProps, type CreateWorkItemLinkInput, DEFAULT_BOARD_COLUMNS, DELETE_WORK_ITEM_LINK, Drawer, type DrawerProps, GET_PROJECTS, GET_WORK_ITEM, LIST_WORK_ITEMS, LIST_WORK_ITEM_LINKS, LinkChip, type LinkChipProps, type ListTasksInput, type ListWorkItemLinksInput, MOVE_WORK_ITEM, Modal, type ModalProps, PRIORITY_META, PROJECT_SUMMARY_FIELDS, type PlanMagnetClientConfig, type PlanMagnetConfig, PlanMagnetProvider, type PlanMagnetProviderProps, PriorityIndicator, type PriorityIndicatorProps, type Project, type ProjectList, type RenderLinkIcon, type ResolveAssignee, STATUS_META, StatusIcon, type StatusIconProps, StatusPill, type StatusPillProps, TASK_PRIORITIES, TASK_STATUSES, TASK_TYPES, type Task, TaskBoard, TaskBoardCore, type TaskBoardCoreProps, type TaskBoardProps, TaskCard, type TaskCardProps, TaskDetail, TaskDetailCore, type TaskDetailCoreProps, type TaskDetailField, type TaskDetailProps, TaskList, type TaskListColumn, TaskListCore, type TaskListCoreProps, type TaskListProps, type TaskListSort, type TaskPageInfo, type TaskPaginationInput, type TaskPriority, type TaskSavedResult, type TaskStatus, TaskTimelineCore, type TaskTimelineCoreProps, TaskToolbar, type TaskToolbarProps, type TaskType, type TaskView, TasksPage, TasksPageCore, type TasksPageCoreProps, type TasksPageField, type TasksPageProps, type TasksPageSaved, TypeBadge, type TypeBadgeProps, UPDATE_WORK_ITEM, type UpdateTaskInput, type UseWorkItemLinksResult, WORK_ITEM_FIELDS, WORK_ITEM_LINK_FIELDS, WORK_ITEM_SUMMARY_FIELDS, type WorkItemDetail, type WorkItemLink, type WorkItemLinkList, type WorkItemLinkRelation, type WorkItemList, badgeVariants, cn, config, createPlanMagnetClient, enumLabel, getGraphQLEndpoint, getPlanMagnetClient, getPlanMagnetClientSafe, getPlanMagnetConfig, isPlanMagnetClientReady, resetPlanMagnetClient, resetPlanMagnetConfig, setPlanMagnetClient, setPlanMagnetConfig, usePlanMagnetContext, usePlanMagnetContextSafe, useWorkItemLinks, validateTrustedOrigin, waitForPlanMagnetClient };
|