@object-ui/plugin-kanban 3.0.3 → 3.1.1
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/.turbo/turbo-build.log +9 -9
- package/CHANGELOG.md +10 -0
- package/dist/{KanbanEnhanced-BPIKjTDv.js → KanbanEnhanced-CXDSLlGR.js} +338 -324
- package/dist/KanbanImpl-4dgoNPtI.js +350 -0
- package/dist/index-CyNcIIS1.js +1077 -0
- package/dist/index.js +9 -4
- package/dist/index.umd.cjs +4 -4
- package/dist/src/CardTemplates.d.ts +25 -0
- package/dist/src/CardTemplates.d.ts.map +1 -0
- package/dist/src/InlineQuickAdd.d.ts +29 -0
- package/dist/src/InlineQuickAdd.d.ts.map +1 -0
- package/dist/src/KanbanEnhanced.d.ts +12 -1
- package/dist/src/KanbanEnhanced.d.ts.map +1 -1
- package/dist/src/KanbanImpl.d.ts +15 -1
- package/dist/src/KanbanImpl.d.ts.map +1 -1
- package/dist/src/ObjectKanban.d.ts.map +1 -1
- package/dist/src/index.d.ts +22 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/types.d.ts +97 -1
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/useColumnWidths.d.ts +30 -0
- package/dist/src/useColumnWidths.d.ts.map +1 -0
- package/dist/src/useCrossSwimlaneMove.d.ts +46 -0
- package/dist/src/useCrossSwimlaneMove.d.ts.map +1 -0
- package/dist/src/useQuickAddReorder.d.ts +28 -0
- package/dist/src/useQuickAddReorder.d.ts.map +1 -0
- package/package.json +9 -9
- package/src/CardTemplates.tsx +123 -0
- package/src/InlineQuickAdd.tsx +189 -0
- package/src/KanbanEnhanced.tsx +140 -9
- package/src/KanbanImpl.tsx +266 -23
- package/src/ObjectKanban.tsx +39 -24
- package/src/__tests__/KanbanGrouping.test.tsx +164 -0
- package/src/__tests__/KanbanSwimlanes.test.tsx +194 -0
- package/src/__tests__/ObjectKanbanTitle.test.tsx +93 -0
- package/src/__tests__/SwimlanePersistence.test.tsx +159 -0
- package/src/__tests__/performance-benchmark.test.tsx +14 -14
- package/src/__tests__/phase13-features.test.tsx +387 -0
- package/src/index.tsx +49 -6
- package/src/types.ts +106 -1
- package/src/useColumnWidths.ts +125 -0
- package/src/useCrossSwimlaneMove.ts +116 -0
- package/src/useQuickAddReorder.ts +107 -0
- package/dist/KanbanImpl-BfOKAnJS.js +0 -194
- package/dist/index-CWGTi2xn.js +0 -600
|
@@ -13,6 +13,7 @@ export interface KanbanCard {
|
|
|
13
13
|
label: string;
|
|
14
14
|
variant?: "default" | "secondary" | "destructive" | "outline";
|
|
15
15
|
}>;
|
|
16
|
+
coverImage?: string;
|
|
16
17
|
[key: string]: any;
|
|
17
18
|
}
|
|
18
19
|
export interface KanbanColumn {
|
|
@@ -23,6 +24,13 @@ export interface KanbanColumn {
|
|
|
23
24
|
className?: string;
|
|
24
25
|
collapsed?: boolean;
|
|
25
26
|
}
|
|
27
|
+
export interface ConditionalFormattingRule {
|
|
28
|
+
field: string;
|
|
29
|
+
operator: 'equals' | 'not_equals' | 'contains' | 'in';
|
|
30
|
+
value: string | string[];
|
|
31
|
+
backgroundColor?: string;
|
|
32
|
+
borderColor?: string;
|
|
33
|
+
}
|
|
26
34
|
export interface KanbanEnhancedProps {
|
|
27
35
|
columns: KanbanColumn[];
|
|
28
36
|
onCardMove?: (cardId: string, fromColumnId: string, toColumnId: string, newIndex: number) => void;
|
|
@@ -30,7 +38,10 @@ export interface KanbanEnhancedProps {
|
|
|
30
38
|
enableVirtualScrolling?: boolean;
|
|
31
39
|
virtualScrollThreshold?: number;
|
|
32
40
|
className?: string;
|
|
41
|
+
quickAdd?: boolean;
|
|
42
|
+
onQuickAdd?: (columnId: string, title: string) => void;
|
|
43
|
+
conditionalFormatting?: ConditionalFormattingRule[];
|
|
33
44
|
}
|
|
34
|
-
export declare function KanbanEnhanced({ columns, onCardMove, onColumnToggle, enableVirtualScrolling, virtualScrollThreshold, className, }: KanbanEnhancedProps): import("react/jsx-runtime").JSX.Element;
|
|
45
|
+
export declare function KanbanEnhanced({ columns, onCardMove, onColumnToggle, enableVirtualScrolling, virtualScrollThreshold, className, quickAdd, onQuickAdd, conditionalFormatting, }: KanbanEnhancedProps): import("react/jsx-runtime").JSX.Element;
|
|
35
46
|
export default KanbanEnhanced;
|
|
36
47
|
//# sourceMappingURL=KanbanEnhanced.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KanbanEnhanced.d.ts","sourceRoot":"","sources":["../../src/KanbanEnhanced.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AA0BH,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,aAAa,GAAG,SAAS,CAAA;KAAE,CAAC,CAAA;IAChG,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CACnB;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,UAAU,EAAE,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,YAAY,EAAE,CAAA;IACvB,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAA;IACjG,cAAc,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,KAAK,IAAI,CAAA;IAC/D,s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AQ,EAAE,MAAM,KAAK,IAAI,CAAA;IACjG,cAAc,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,KAAK,IAAI,CAAA;IAC/D,sBAAsB,CAAC,EAAE,OAAO,CAAA;IAChC,sBAAsB,CAAC,EAAE,MAAM,CAAA;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACtD,qBAAqB,CAAC,EAAE,yBAAyB,EAAE,CAAA;CACpD;AAuSD,wBAAgB,cAAc,CAAC,EAC7B,OAAO,EACP,UAAU,EACV,cAAc,EACd,sBAA8B,EAC9B,sBAA2B,EAC3B,SAAS,EACT,QAAQ,EACR,UAAU,EACV,qBAAqB,GACtB,EAAE,mBAAmB,2CAqJrB;AAED,eAAe,cAAc,CAAC"}
|
package/dist/src/KanbanImpl.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export interface KanbanCard {
|
|
|
13
13
|
label: string;
|
|
14
14
|
variant?: "default" | "secondary" | "destructive" | "outline";
|
|
15
15
|
}>;
|
|
16
|
+
coverImage?: string;
|
|
16
17
|
[key: string]: any;
|
|
17
18
|
}
|
|
18
19
|
export interface KanbanColumn {
|
|
@@ -22,11 +23,24 @@ export interface KanbanColumn {
|
|
|
22
23
|
limit?: number;
|
|
23
24
|
className?: string;
|
|
24
25
|
}
|
|
26
|
+
export interface ConditionalFormattingRule {
|
|
27
|
+
field: string;
|
|
28
|
+
operator: 'equals' | 'not_equals' | 'contains' | 'in';
|
|
29
|
+
value: string | string[];
|
|
30
|
+
backgroundColor?: string;
|
|
31
|
+
borderColor?: string;
|
|
32
|
+
}
|
|
25
33
|
export interface KanbanBoardProps {
|
|
26
34
|
columns: KanbanColumn[];
|
|
27
35
|
onCardMove?: (cardId: string, fromColumnId: string, toColumnId: string, newIndex: number) => void;
|
|
28
36
|
onCardClick?: (card: KanbanCard) => void;
|
|
29
37
|
className?: string;
|
|
38
|
+
quickAdd?: boolean;
|
|
39
|
+
onQuickAdd?: (columnId: string, title: string) => void;
|
|
40
|
+
coverImageField?: string;
|
|
41
|
+
conditionalFormatting?: ConditionalFormattingRule[];
|
|
42
|
+
/** Field name for swimlane rows (2D grouping) */
|
|
43
|
+
swimlaneField?: string;
|
|
30
44
|
}
|
|
31
|
-
export default function KanbanBoard({ columns, onCardMove, onCardClick, className }: KanbanBoardProps): import("react/jsx-runtime").JSX.Element;
|
|
45
|
+
export default function KanbanBoard({ columns, onCardMove, onCardClick, className, quickAdd, onQuickAdd, coverImageField, conditionalFormatting, swimlaneField }: KanbanBoardProps): import("react/jsx-runtime").JSX.Element;
|
|
32
46
|
//# sourceMappingURL=KanbanImpl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KanbanImpl.d.ts","sourceRoot":"","sources":["../../src/KanbanImpl.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"KanbanImpl.d.ts","sourceRoot":"","sources":["../../src/KanbanImpl.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AA8BH,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,aAAa,GAAG,SAAS,CAAA;KAAE,CAAC,CAAA;IAChG,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CACnB;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,KAAK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;GAMG;AAEH,OAAO,KAAuC,MAAM,OAAO,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"ObjectKanban.d.ts","sourceRoot":"","sources":["../../src/ObjectKanban.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAuC,MAAM,OAAO,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAKnD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,YAAY,CAAC;IACrB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,CAAC;IACnC,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,CAAC;CACrC;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA2NpD,CAAA"}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { ObjectKanban } from './ObjectKanban';
|
|
3
|
-
export type { KanbanSchema, KanbanCard, KanbanColumn } from './types';
|
|
3
|
+
export type { KanbanSchema, KanbanCard, KanbanColumn, CardTemplate, ColumnWidthConfig, InlineFieldDefinition } from './types';
|
|
4
4
|
export { ObjectKanban };
|
|
5
5
|
export type { ObjectKanbanProps } from './ObjectKanban';
|
|
6
|
+
export { InlineQuickAdd } from './InlineQuickAdd';
|
|
7
|
+
export type { InlineQuickAddProps } from './InlineQuickAdd';
|
|
8
|
+
export { CardTemplates } from './CardTemplates';
|
|
9
|
+
export type { CardTemplatesProps } from './CardTemplates';
|
|
10
|
+
export { useColumnWidths } from './useColumnWidths';
|
|
11
|
+
export type { UseColumnWidthsOptions, UseColumnWidthsReturn } from './useColumnWidths';
|
|
12
|
+
export { useCrossSwimlaneMove } from './useCrossSwimlaneMove';
|
|
13
|
+
export type { Swimlane, CrossSwimlaneMoveEvent, UseCrossSwimlaneOptions, UseCrossSwimlaneMoveReturn } from './useCrossSwimlaneMove';
|
|
14
|
+
export { useQuickAddReorder } from './useQuickAddReorder';
|
|
15
|
+
export type { UseQuickAddReorderOptions, UseQuickAddReorderReturn } from './useQuickAddReorder';
|
|
6
16
|
export interface KanbanRendererProps {
|
|
7
17
|
schema: {
|
|
8
18
|
type: string;
|
|
@@ -11,8 +21,19 @@ export interface KanbanRendererProps {
|
|
|
11
21
|
columns?: Array<any>;
|
|
12
22
|
data?: Array<any>;
|
|
13
23
|
groupBy?: string;
|
|
24
|
+
swimlaneField?: string;
|
|
14
25
|
onCardMove?: (cardId: string, fromColumnId: string, toColumnId: string, newIndex: number) => void;
|
|
15
26
|
onCardClick?: (card: any) => void;
|
|
27
|
+
quickAdd?: boolean;
|
|
28
|
+
onQuickAdd?: (columnId: string, title: string) => void;
|
|
29
|
+
coverImageField?: string;
|
|
30
|
+
conditionalFormatting?: Array<{
|
|
31
|
+
field: string;
|
|
32
|
+
operator: 'equals' | 'not_equals' | 'contains' | 'in';
|
|
33
|
+
value: string | string[];
|
|
34
|
+
backgroundColor?: string;
|
|
35
|
+
borderColor?: string;
|
|
36
|
+
}>;
|
|
16
37
|
};
|
|
17
38
|
}
|
|
18
39
|
/**
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAmB,MAAM,OAAO,CAAC;AAIxC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+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B,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;QAClG,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;QAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;QACvD,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,qBAAqB,CAAC,EAAE,KAAK,CAAC;YAC5B,KAAK,EAAE,MAAM,CAAC;YACd,QAAQ,EAAE,QAAQ,GAAG,YAAY,GAAG,UAAU,GAAG,IAAI,CAAC;YACtD,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;YACzB,eAAe,CAAC,EAAE,MAAM,CAAC;YACzB,WAAW,CAAC,EAAE,MAAM,CAAC;SACtB,CAAC,CAAC;KACJ,CAAC;CACH;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAiExD,CAAC;AAqGF,eAAO,MAAM,gBAAgB;;;;CAI5B,CAAC;AA8DF,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,MAAM,EAAE,GAAG,CAAC;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,CAG9E,CAAC"}
|
package/dist/src/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseSchema } from '../../types/src';
|
|
1
|
+
import { BaseSchema, GroupingConfig } from '../../types/src';
|
|
2
2
|
/**
|
|
3
3
|
* Kanban card interface.
|
|
4
4
|
*/
|
|
@@ -36,6 +36,11 @@ export interface KanbanSchema extends BaseSchema {
|
|
|
36
36
|
* Field to group records by (maps to column IDs).
|
|
37
37
|
*/
|
|
38
38
|
groupBy?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Field for swimlane rows (2D grouping). When set, cards are grouped
|
|
41
|
+
* vertically by `groupBy` (columns) and horizontally by `swimlaneField` (rows).
|
|
42
|
+
*/
|
|
43
|
+
swimlaneField?: string;
|
|
39
44
|
/**
|
|
40
45
|
* Field to use as the card title.
|
|
41
46
|
*/
|
|
@@ -61,5 +66,96 @@ export interface KanbanSchema extends BaseSchema {
|
|
|
61
66
|
* Optional CSS class name to apply custom styling.
|
|
62
67
|
*/
|
|
63
68
|
className?: string;
|
|
69
|
+
/**
|
|
70
|
+
* Enable Quick Add button at the bottom of each column.
|
|
71
|
+
* When true, a "+" button appears allowing inline card creation.
|
|
72
|
+
* @default false
|
|
73
|
+
*/
|
|
74
|
+
quickAdd?: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Callback when a new card is created via Quick Add.
|
|
77
|
+
*/
|
|
78
|
+
onQuickAdd?: (columnId: string, title: string) => void;
|
|
79
|
+
/**
|
|
80
|
+
* Field name to use as cover image on cards.
|
|
81
|
+
* The field value should be a URL string or file object with a `url` property.
|
|
82
|
+
*/
|
|
83
|
+
coverImageField?: string;
|
|
84
|
+
/**
|
|
85
|
+
* Allow columns to be collapsed/expanded.
|
|
86
|
+
* @default false
|
|
87
|
+
*/
|
|
88
|
+
allowCollapse?: boolean;
|
|
89
|
+
/**
|
|
90
|
+
* Conditional formatting rules for card coloring.
|
|
91
|
+
*/
|
|
92
|
+
conditionalFormatting?: Array<{
|
|
93
|
+
field: string;
|
|
94
|
+
operator: 'equals' | 'not_equals' | 'contains' | 'in';
|
|
95
|
+
value: string | string[];
|
|
96
|
+
backgroundColor?: string;
|
|
97
|
+
borderColor?: string;
|
|
98
|
+
}>;
|
|
99
|
+
/**
|
|
100
|
+
* Predefined card templates for quick-add.
|
|
101
|
+
* Each template pre-fills the quick-add form with default values.
|
|
102
|
+
*/
|
|
103
|
+
cardTemplates?: CardTemplate[];
|
|
104
|
+
/**
|
|
105
|
+
* Custom column width configuration.
|
|
106
|
+
* Supports per-column overrides with min/max constraints.
|
|
107
|
+
*/
|
|
108
|
+
columnWidths?: ColumnWidthConfig;
|
|
109
|
+
/**
|
|
110
|
+
* Grouping configuration from ListView.
|
|
111
|
+
* When set, the first grouping field is used as swimlaneField fallback.
|
|
112
|
+
*/
|
|
113
|
+
grouping?: GroupingConfig;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* A predefined card template with pre-filled field values.
|
|
117
|
+
*/
|
|
118
|
+
export interface CardTemplate {
|
|
119
|
+
/** Unique template identifier */
|
|
120
|
+
id: string;
|
|
121
|
+
/** Human-readable template name */
|
|
122
|
+
name: string;
|
|
123
|
+
/** Optional Lucide icon name */
|
|
124
|
+
icon?: string;
|
|
125
|
+
/** Pre-filled field values */
|
|
126
|
+
values: Record<string, any>;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Configuration for custom column widths.
|
|
130
|
+
*/
|
|
131
|
+
export interface ColumnWidthConfig {
|
|
132
|
+
/** Default column width in pixels */
|
|
133
|
+
defaultWidth?: number;
|
|
134
|
+
/** Minimum column width in pixels */
|
|
135
|
+
minWidth?: number;
|
|
136
|
+
/** Maximum column width in pixels */
|
|
137
|
+
maxWidth?: number;
|
|
138
|
+
/** Per-column width overrides keyed by column ID */
|
|
139
|
+
overrides?: Record<string, number>;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Field definition for inline quick-add forms.
|
|
143
|
+
*/
|
|
144
|
+
export interface InlineFieldDefinition {
|
|
145
|
+
/** Field name (key in the resulting values object) */
|
|
146
|
+
name: string;
|
|
147
|
+
/** Display label */
|
|
148
|
+
label?: string;
|
|
149
|
+
/** Field type */
|
|
150
|
+
type: 'text' | 'number' | 'select';
|
|
151
|
+
/** Placeholder text */
|
|
152
|
+
placeholder?: string;
|
|
153
|
+
/** Default value */
|
|
154
|
+
defaultValue?: any;
|
|
155
|
+
/** Options for select fields */
|
|
156
|
+
options?: Array<{
|
|
157
|
+
label: string;
|
|
158
|
+
value: string;
|
|
159
|
+
}>;
|
|
64
160
|
}
|
|
65
161
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/src/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEnE;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,aAAa,GAAG,SAAS,CAAA;KAAE,CAAC,CAAC;IACjG,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,YAAa,SAAQ,UAAU;IAC9C,IAAI,EAAE,QAAQ,CAAC;IAEf;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAE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H,MAAM,WAAW,YAAY;IAC3B,iCAAiC;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,gCAAgC;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,8BAA8B;IAC9B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,qCAAqC;IACrC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qCAAqC;IACrC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qCAAqC;IACrC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oDAAoD;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACpC;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,sDAAsD;IACtD,IAAI,EAAE,MAAM,CAAC;IACb,oBAAoB;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iBAAiB;IACjB,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAC;IACnC,uBAAuB;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oBAAoB;IACpB,YAAY,CAAC,EAAE,GAAG,CAAC;IACnB,gCAAgC;IAChC,OAAO,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACnD"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { KanbanColumn, ColumnWidthConfig } from './types';
|
|
2
|
+
export interface UseColumnWidthsOptions {
|
|
3
|
+
/** Columns on the board */
|
|
4
|
+
columns: KanbanColumn[];
|
|
5
|
+
/** Default width in pixels applied to every column */
|
|
6
|
+
defaultWidth?: number;
|
|
7
|
+
/** Minimum allowed column width in pixels */
|
|
8
|
+
minWidth?: number;
|
|
9
|
+
/** Maximum allowed column width in pixels */
|
|
10
|
+
maxWidth?: number;
|
|
11
|
+
/** Optional persistence key suffix (to scope per-board) */
|
|
12
|
+
storageKey?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface UseColumnWidthsReturn {
|
|
15
|
+
/** Get the current width for a column (in px) */
|
|
16
|
+
getColumnWidth: (columnId: string) => number;
|
|
17
|
+
/** Set an override width for a column */
|
|
18
|
+
setColumnWidth: (columnId: string, width: number) => void;
|
|
19
|
+
/** Reset all overrides back to default widths */
|
|
20
|
+
resetWidths: () => void;
|
|
21
|
+
/** The full config (useful for serialization) */
|
|
22
|
+
config: ColumnWidthConfig;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Hook for managing custom per-column widths with localStorage persistence.
|
|
26
|
+
* Supports per-column overrides clamped between minWidth and maxWidth.
|
|
27
|
+
*/
|
|
28
|
+
export declare function useColumnWidths({ columns: _columns, defaultWidth, minWidth, maxWidth, storageKey, }: UseColumnWidthsOptions): UseColumnWidthsReturn;
|
|
29
|
+
export default useColumnWidths;
|
|
30
|
+
//# sourceMappingURL=useColumnWidths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useColumnWidths.d.ts","sourceRoot":"","sources":["../../src/useColumnWidths.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAI9D,MAAM,WAAW,sBAAsB;IACrC,2BAA2B;IAC3B,OAAO,EAAE,YAAY,EAAE,CAAA;IACvB,sDAAsD;IACtD,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,2DAA2D;IAC3D,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,qBAAqB;IACpC,iDAAiD;IACjD,cAAc,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAA;IAC5C,yCAAyC;IACzC,cAAc,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACzD,iDAAiD;IACjD,WAAW,EAAE,MAAM,IAAI,CAAA;IACvB,iDAAiD;IACjD,MAAM,EAAE,iBAAiB,CAAA;CAC1B;AAyBD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,EAC9B,OAAO,EAAE,QAAQ,EACjB,YAAkB,EAClB,QAAc,EACd,QAAc,EACd,UAAU,GACX,EAAE,sBAAsB,GAAG,qBAAqB,CAoDhD;AAED,eAAe,eAAe,CAAA"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ObjectUI
|
|
3
|
+
* Copyright (c) 2024-present ObjectStack Inc.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the MIT license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
8
|
+
export interface Swimlane {
|
|
9
|
+
/** Unique identifier for the swimlane row */
|
|
10
|
+
id: string;
|
|
11
|
+
/** Display label */
|
|
12
|
+
title: string;
|
|
13
|
+
/** Optional list of swimlane IDs this lane accepts cards from. Omit for unrestricted. */
|
|
14
|
+
acceptFrom?: string[];
|
|
15
|
+
}
|
|
16
|
+
export interface CrossSwimlaneMoveEvent {
|
|
17
|
+
cardId: string;
|
|
18
|
+
fromSwimlane: string;
|
|
19
|
+
toSwimlane: string;
|
|
20
|
+
columnId: string;
|
|
21
|
+
}
|
|
22
|
+
export interface UseCrossSwimlaneOptions {
|
|
23
|
+
/** Swimlane definitions */
|
|
24
|
+
swimlanes: Swimlane[];
|
|
25
|
+
/** Callback executed after a successful cross-swimlane move */
|
|
26
|
+
onCardMove?: (event: CrossSwimlaneMoveEvent) => void;
|
|
27
|
+
}
|
|
28
|
+
export interface UseCrossSwimlaneMoveReturn {
|
|
29
|
+
/** Execute a cross-swimlane move. Returns true if the move was allowed. */
|
|
30
|
+
handleCrossSwimlaneMove: (cardId: string, fromSwimlane: string, toSwimlane: string, columnId: string) => boolean;
|
|
31
|
+
/** Whether a card is currently being dragged across swimlanes */
|
|
32
|
+
isDraggingAcrossSwimlanes: boolean;
|
|
33
|
+
/** Start tracking a cross-swimlane drag */
|
|
34
|
+
startCrossSwimlaneDrag: (fromSwimlane: string) => void;
|
|
35
|
+
/** End the cross-swimlane drag */
|
|
36
|
+
endCrossSwimlaneDrag: () => void;
|
|
37
|
+
/** Check whether a card may be moved into the target swimlane */
|
|
38
|
+
canMoveTo: (fromSwimlane: string, toSwimlane: string) => boolean;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Hook for managing cross-swimlane card movements.
|
|
42
|
+
* Validates movement constraints (acceptFrom rules) and tracks drag state.
|
|
43
|
+
*/
|
|
44
|
+
export declare function useCrossSwimlaneMove({ swimlanes, onCardMove, }: UseCrossSwimlaneOptions): UseCrossSwimlaneMoveReturn;
|
|
45
|
+
export default useCrossSwimlaneMove;
|
|
46
|
+
//# sourceMappingURL=useCrossSwimlaneMove.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCrossSwimlaneMove.d.ts","sourceRoot":"","sources":["../../src/useCrossSwimlaneMove.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,MAAM,WAAW,QAAQ;IACvB,6CAA6C;IAC7C,EAAE,EAAE,MAAM,CAAA;IACV,oBAAoB;IACpB,KAAK,EAAE,MAAM,CAAA;IACb,yFAAyF;IACzF,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;CACtB;AAED,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,MAAM,CAAA;IACd,YAAY,EAAE,MAAM,CAAA;IACpB,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,uBAAuB;IACtC,2BAA2B;IAC3B,SAAS,EAAE,QAAQ,EAAE,CAAA;IACrB,+DAA+D;IAC/D,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,sBAAsB,KAAK,IAAI,CAAA;CACrD;AAED,MAAM,WAAW,0BAA0B;IACzC,2EAA2E;IAC3E,uBAAuB,EAAE,CACvB,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,KACb,OAAO,CAAA;IACZ,iEAAiE;IACjE,yBAAyB,EAAE,OAAO,CAAA;IAClC,2CAA2C;IAC3C,sBAAsB,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAA;IACtD,kCAAkC;IAClC,oBAAoB,EAAE,MAAM,IAAI,CAAA;IAChC,iEAAiE;IACjE,SAAS,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,OAAO,CAAA;CACjE;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,SAAS,EACT,UAAU,GACX,EAAE,uBAAuB,GAAG,0BAA0B,CAuDtD;AAED,eAAe,oBAAoB,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { KanbanCard } from './types';
|
|
2
|
+
export interface UseQuickAddReorderOptions {
|
|
3
|
+
/** Initial set of cards in the column */
|
|
4
|
+
cards: KanbanCard[];
|
|
5
|
+
/** Called when the user finishes reordering */
|
|
6
|
+
onReorderComplete?: (reorderedCards: KanbanCard[]) => void;
|
|
7
|
+
}
|
|
8
|
+
export interface UseQuickAddReorderReturn {
|
|
9
|
+
/** Cards in their current (possibly reordered) order */
|
|
10
|
+
reorderedCards: KanbanCard[];
|
|
11
|
+
/** Move a card from one index to another within the list */
|
|
12
|
+
onReorder: (fromIndex: number, toIndex: number) => void;
|
|
13
|
+
/** Whether a card is currently being dragged for reorder */
|
|
14
|
+
isDragging: boolean;
|
|
15
|
+
/** Signal the start of a drag-to-reorder interaction */
|
|
16
|
+
startDrag: () => void;
|
|
17
|
+
/** Signal the end of a drag-to-reorder interaction */
|
|
18
|
+
endDrag: () => void;
|
|
19
|
+
/** Reset reordered state back to the source cards */
|
|
20
|
+
reset: () => void;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Hook for drag-to-reorder of quick-add cards within a single column.
|
|
24
|
+
* Manages local ordering state and exposes drag lifecycle helpers.
|
|
25
|
+
*/
|
|
26
|
+
export declare function useQuickAddReorder({ cards, onReorderComplete, }: UseQuickAddReorderOptions): UseQuickAddReorderReturn;
|
|
27
|
+
export default useQuickAddReorder;
|
|
28
|
+
//# sourceMappingURL=useQuickAddReorder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useQuickAddReorder.d.ts","sourceRoot":"","sources":["../../src/useQuickAddReorder.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAEzC,MAAM,WAAW,yBAAyB;IACxC,yCAAyC;IACzC,KAAK,EAAE,UAAU,EAAE,CAAA;IACnB,+CAA+C;IAC/C,iBAAiB,CAAC,EAAE,CAAC,cAAc,EAAE,UAAU,EAAE,KAAK,IAAI,CAAA;CAC3D;AAED,MAAM,WAAW,wBAAwB;IACvC,wDAAwD;IACxD,cAAc,EAAE,UAAU,EAAE,CAAA;IAC5B,4DAA4D;IAC5D,SAAS,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IACvD,4DAA4D;IAC5D,UAAU,EAAE,OAAO,CAAA;IACnB,wDAAwD;IACxD,SAAS,EAAE,MAAM,IAAI,CAAA;IACrB,sDAAsD;IACtD,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,qDAAqD;IACrD,KAAK,EAAE,MAAM,IAAI,CAAA;CAClB;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,KAAK,EACL,iBAAiB,GAClB,EAAE,yBAAyB,GAAG,wBAAwB,CAuDtD;AAWD,eAAe,kBAAkB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@object-ui/plugin-kanban",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Kanban board plugin for Object UI, powered by dnd-kit",
|
|
@@ -27,25 +27,25 @@
|
|
|
27
27
|
"@dnd-kit/core": "^6.3.1",
|
|
28
28
|
"@dnd-kit/sortable": "^10.0.0",
|
|
29
29
|
"@dnd-kit/utilities": "^3.2.2",
|
|
30
|
-
"@tanstack/react-virtual": "^3.13.
|
|
31
|
-
"lucide-react": "^0.
|
|
32
|
-
"@object-ui/components": "3.
|
|
33
|
-
"@object-ui/core": "3.
|
|
34
|
-
"@object-ui/react": "3.
|
|
35
|
-
"@object-ui/types": "3.
|
|
30
|
+
"@tanstack/react-virtual": "^3.13.19",
|
|
31
|
+
"lucide-react": "^0.576.0",
|
|
32
|
+
"@object-ui/components": "3.1.1",
|
|
33
|
+
"@object-ui/core": "3.1.1",
|
|
34
|
+
"@object-ui/react": "3.1.1",
|
|
35
|
+
"@object-ui/types": "3.1.1"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"react": "^18.0.0 || ^19.0.0",
|
|
39
39
|
"react-dom": "^18.0.0 || ^19.0.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@types/react": "19.2.
|
|
42
|
+
"@types/react": "19.2.14",
|
|
43
43
|
"@types/react-dom": "19.2.3",
|
|
44
44
|
"@vitejs/plugin-react": "^5.1.4",
|
|
45
45
|
"typescript": "^5.9.3",
|
|
46
46
|
"vite": "^7.3.1",
|
|
47
47
|
"vite-plugin-dts": "^4.5.4",
|
|
48
|
-
"@object-ui/data-objectstack": "3.
|
|
48
|
+
"@object-ui/data-objectstack": "3.1.1"
|
|
49
49
|
},
|
|
50
50
|
"scripts": {
|
|
51
51
|
"build": "vite build",
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ObjectUI
|
|
3
|
+
* Copyright (c) 2024-present ObjectStack Inc.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the MIT license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import * as React from "react"
|
|
10
|
+
import { Button } from "@object-ui/components"
|
|
11
|
+
import { ChevronDown, FileText, Plus } from "lucide-react"
|
|
12
|
+
import type { CardTemplate } from "./types"
|
|
13
|
+
|
|
14
|
+
const cn = (...classes: (string | undefined)[]) => classes.filter(Boolean).join(' ')
|
|
15
|
+
|
|
16
|
+
export interface CardTemplatesProps {
|
|
17
|
+
/** Available card templates */
|
|
18
|
+
templates: CardTemplate[]
|
|
19
|
+
/** Called when a template (or "Custom") is selected */
|
|
20
|
+
onSelect: (template: CardTemplate | null) => void
|
|
21
|
+
/** Column the template applies to */
|
|
22
|
+
columnId: string
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* CardTemplates renders a dropdown button that lets users pick a
|
|
27
|
+
* predefined card template or start with a blank ("Custom") card.
|
|
28
|
+
* The selected template pre-fills the quick-add form values.
|
|
29
|
+
*/
|
|
30
|
+
export const CardTemplates: React.FC<CardTemplatesProps> = ({
|
|
31
|
+
templates,
|
|
32
|
+
onSelect,
|
|
33
|
+
columnId,
|
|
34
|
+
}) => {
|
|
35
|
+
const [open, setOpen] = React.useState(false)
|
|
36
|
+
const containerRef = React.useRef<HTMLDivElement>(null)
|
|
37
|
+
|
|
38
|
+
// Close dropdown on outside click
|
|
39
|
+
React.useEffect(() => {
|
|
40
|
+
if (!open) return
|
|
41
|
+
const handler = (e: MouseEvent) => {
|
|
42
|
+
if (containerRef.current && !containerRef.current.contains(e.target as Node)) {
|
|
43
|
+
setOpen(false)
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
document.addEventListener("mousedown", handler)
|
|
47
|
+
return () => document.removeEventListener("mousedown", handler)
|
|
48
|
+
}, [open])
|
|
49
|
+
|
|
50
|
+
// Close on Escape
|
|
51
|
+
const handleKeyDown = React.useCallback(
|
|
52
|
+
(e: React.KeyboardEvent) => {
|
|
53
|
+
if (e.key === "Escape") {
|
|
54
|
+
setOpen(false)
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
[],
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<div ref={containerRef} className="relative" onKeyDown={handleKeyDown}>
|
|
62
|
+
<Button
|
|
63
|
+
variant="ghost"
|
|
64
|
+
size="sm"
|
|
65
|
+
className="w-full mt-2 text-muted-foreground hover:text-foreground gap-1"
|
|
66
|
+
onClick={() => setOpen(prev => !prev)}
|
|
67
|
+
aria-haspopup="listbox"
|
|
68
|
+
aria-expanded={open}
|
|
69
|
+
aria-label={`Add card to ${columnId}`}
|
|
70
|
+
>
|
|
71
|
+
<Plus className="h-4 w-4" />
|
|
72
|
+
Add Card
|
|
73
|
+
<ChevronDown className={cn("h-3 w-3 transition-transform", open ? "rotate-180" : "")} />
|
|
74
|
+
</Button>
|
|
75
|
+
|
|
76
|
+
{open && (
|
|
77
|
+
<div
|
|
78
|
+
className="absolute z-50 mt-1 w-full rounded-md border border-border bg-popover p-1 shadow-md"
|
|
79
|
+
role="listbox"
|
|
80
|
+
aria-label="Card templates"
|
|
81
|
+
>
|
|
82
|
+
{/* Custom blank card option */}
|
|
83
|
+
<button
|
|
84
|
+
type="button"
|
|
85
|
+
className="flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-accent hover:text-accent-foreground transition-colors"
|
|
86
|
+
role="option"
|
|
87
|
+
aria-selected={false}
|
|
88
|
+
onClick={() => {
|
|
89
|
+
onSelect(null)
|
|
90
|
+
setOpen(false)
|
|
91
|
+
}}
|
|
92
|
+
>
|
|
93
|
+
<Plus className="h-4 w-4 text-muted-foreground" />
|
|
94
|
+
<span className="font-mono text-xs">Custom</span>
|
|
95
|
+
</button>
|
|
96
|
+
|
|
97
|
+
{templates.length > 0 && (
|
|
98
|
+
<div className="my-1 h-px bg-border" role="separator" />
|
|
99
|
+
)}
|
|
100
|
+
|
|
101
|
+
{templates.map(template => (
|
|
102
|
+
<button
|
|
103
|
+
key={template.id}
|
|
104
|
+
type="button"
|
|
105
|
+
className="flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-accent hover:text-accent-foreground transition-colors"
|
|
106
|
+
role="option"
|
|
107
|
+
aria-selected={false}
|
|
108
|
+
onClick={() => {
|
|
109
|
+
onSelect(template)
|
|
110
|
+
setOpen(false)
|
|
111
|
+
}}
|
|
112
|
+
>
|
|
113
|
+
<FileText className="h-4 w-4 text-muted-foreground" />
|
|
114
|
+
<span className="font-mono text-xs truncate">{template.name}</span>
|
|
115
|
+
</button>
|
|
116
|
+
))}
|
|
117
|
+
</div>
|
|
118
|
+
)}
|
|
119
|
+
</div>
|
|
120
|
+
)
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export default CardTemplates
|