@astryxdesign/cli 0.7.11 → 0.7.12-canary.0085c0f
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/api/build/blocks/blocks.d.mts +41 -0
- package/api/build/blocks/blocks.mjs +118 -68
- package/api/build/kit/rank.mjs +21 -4
- package/api/build/kit/words.d.mts +1 -0
- package/api/build/kit/words.mjs +1 -1
- package/api/component/__fixtures__/resolutions/modules.txt +5 -5
- package/api/docs/_adapter.d.mts +22 -0
- package/api/docs/_adapter.mjs +81 -3
- package/api/docs/docs.doc.mjs +5 -5
- package/api/docs/docs.type.d.mts +21 -0
- package/api/docs/docs.type.mjs +11 -0
- package/api/docs/list/list.d.mts +5 -1
- package/api/docs/list/list.mjs +72 -6
- package/api/docs/node/node.mjs +2 -40
- package/api/doctor/doctor.d.mts +4 -4
- package/api/doctor/doctor.mjs +248 -78
- package/api/icon/_adapter.d.mts +3 -2
- package/api/icon/_adapter.mjs +8 -2
- package/api/icon/_authoring.d.mts +1 -0
- package/api/icon/_authoring.mjs +594 -67
- package/api/icon/_default-look.d.mts +155 -0
- package/api/icon/_default-look.mjs +474 -0
- package/api/icon/_records.d.mts +1 -1
- package/api/icon/_records.mjs +1 -0
- package/api/icon/add/add.mjs +269 -43
- package/api/icon/icon.type.d.mts +46 -2
- package/api/icon/icon.type.mjs +12 -2
- package/api/icon/iconAdd.doc.mjs +2 -2
- package/api/icon/iconNewDefinition.doc.mjs +3 -2
- package/api/icon/iconNewSet.doc.mjs +4 -4
- package/api/icon/map/map.mjs +11 -4
- package/api/icon/search/search.mjs +10 -9
- package/api/index.d.mts +1 -0
- package/api/index.mjs +1 -0
- package/api/integration/add-helpers.d.mts +15 -1
- package/api/integration/add-helpers.mjs +5 -2
- package/api/integration/authoring-checks.d.mts +0 -2
- package/api/integration/authoring-checks.mjs +1 -6
- package/api/logger.mjs +2 -1
- package/api/render/_adapter.mjs +9 -0
- package/api/render/render.doc.mjs +3 -3
- package/api/render/render.type.d.mts +1 -1
- package/api/render/render.type.mjs +1 -1
- package/api/search/ORDERING.md +3 -0
- package/api/search/_adapter.d.mts +32 -3
- package/api/search/_adapter.mjs +50 -22
- package/api/search/_fit-order.d.mts +47 -0
- package/api/search/_fit-order.mjs +257 -0
- package/api/search/_main-searcher.mjs +15 -5
- package/api/search/exportSearchIndex.doc.d.mts +10 -0
- package/api/search/exportSearchIndex.doc.mjs +58 -0
- package/api/search/rankSearchIndex.doc.d.mts +10 -0
- package/api/search/rankSearchIndex.doc.mjs +79 -0
- package/api/search/search-index.d.mts +44 -0
- package/api/search/search-index.mjs +270 -0
- package/api/search/search.type.d.mts +28 -0
- package/api/search/search.type.mjs +17 -0
- package/api/swizzle/_adapter.d.mts +1 -0
- package/api/swizzle/_adapter.mjs +4 -1
- package/api/swizzle/_moduleGraph.d.mts +178 -0
- package/api/swizzle/_moduleGraph.mjs +903 -0
- package/api/swizzle/copy/copy.d.mts +2 -43
- package/api/swizzle/copy/copy.mjs +287 -315
- package/api/swizzle/swizzle.d.mts +0 -2
- package/api/swizzle/swizzle.doc.mjs +13 -4
- package/api/swizzle/swizzle.mjs +3 -7
- package/api/swizzle/swizzle.type.d.mts +7 -1
- package/api/swizzle/swizzle.type.mjs +4 -2
- package/api/template/skeleton/skeleton.mjs +1 -1
- package/api/template/template.mjs +1 -0
- package/assets/codemods/transforms/v0.1.0/drop-xds-prefix-imports.mjs +1 -1
- package/assets/codemods/transforms/v0.1.0/index.mjs +1 -1
- package/assets/discover/official-packages.json +40 -0
- package/assets/docs/browser-support.doc.mjs +2 -2
- package/assets/docs/styling-overview.doc.mjs +6 -2
- package/assets/docs/tree/icon-sets.doc.mjs +13 -7
- package/assets/docs/tree/render-pages.doc.mjs +3 -3
- package/assets/docs/tree/tailwind.doc.mjs +41 -1
- package/assets/docs/tree/type-scale.doc.mjs +19 -2
- package/assets/templates/blocks/components/Calendar/useCalendarConstraintsHookUsage.doc.mjs +14 -0
- package/assets/templates/blocks/components/Calendar/useCalendarConstraintsHookUsage.tsx +146 -0
- package/assets/templates/blocks/components/Calendar/useCalendarNavigationHookUsage.doc.mjs +14 -0
- package/assets/templates/blocks/components/Calendar/useCalendarNavigationHookUsage.tsx +173 -0
- package/assets/templates/blocks/components/Hooks/useInputStatusIconHookUsage.tsx +1 -0
- package/assets/templates/blocks/components/Hooks/useInteractiveRoleHookUsage.doc.mjs +14 -0
- package/assets/templates/blocks/components/Hooks/useInteractiveRoleHookUsage.tsx +56 -0
- package/assets/templates/blocks/components/Hooks/useStreamingTextHookUsage.doc.mjs +2 -2
- package/assets/templates/blocks/components/Hooks/useStreamingTextHookUsage.tsx +66 -10
- package/assets/templates/blocks/components/Link/useLinkifyHookUsage.doc.mjs +14 -0
- package/assets/templates/blocks/components/Link/useLinkifyHookUsage.tsx +39 -0
- package/assets/templates/blocks/components/PowerSearch/usePowerSearchConfigHookUsage.doc.mjs +14 -0
- package/assets/templates/blocks/components/PowerSearch/usePowerSearchConfigHookUsage.tsx +83 -0
- package/assets/templates/blocks/components/Table/RowsVirtualizationHookUsage.doc.mjs +14 -0
- package/assets/templates/blocks/components/Table/RowsVirtualizationHookUsage.tsx +41 -0
- package/assets/templates/blocks/components/Table/TableRowIndexTable.doc.mjs +1 -1
- package/assets/templates/blocks/components/Table/TableRowIndexTable.tsx +2 -2
- package/assets/templates/blocks/components/Table/useTableColumnSettingsStateHookUsage.doc.mjs +14 -0
- package/assets/templates/blocks/components/Table/useTableColumnSettingsStateHookUsage.tsx +97 -0
- package/assets/templates/pages/course-detail/page.tsx +699 -0
- package/assets/templates/pages/course-detail/template.doc.mjs +37 -0
- package/assets/templates/pages/file-explorer/page.tsx +103 -79
- package/assets/templates/pages/table-filter/page.tsx +15 -23
- package/assets/templates/pages/table-grouped/page.tsx +190 -262
- package/assets/templates/pages/table-grouped/template.doc.mjs +0 -2
- package/assets/templates/pages/table-inbox/page.tsx +3 -6
- package/assets/templates/pages/theme-showcase/page.tsx +724 -792
- package/assets/templates/pages/theme-showcase/template.doc.mjs +4 -5
- package/assets/templates/themes/butter/butterTheme.ts +2 -2
- package/assets/templates/themes/gothic/gothicTheme.ts +16 -0
- package/assets/templates/themes/matcha/matchaTheme.ts +1 -1
- package/assets/templates/themes/neutral/neutralTheme.ts +6 -0
- package/assets/templates/themes/stone/stoneTheme.ts +1 -1
- package/assets/templates/themes/y2k/y2kPaletteRefs.generated.ts +1 -1
- package/assets/templates/themes/y2k/y2kTheme.ts +2 -2
- package/authoring/doctypes/template/type.ts +1 -0
- package/clients/cli/commands/docs.doc.mjs +5 -1
- package/clients/cli/commands/docs.mjs +30 -2
- package/clients/cli/commands/experimental/icon.mjs +56 -14
- package/clients/cli/commands/experimental-icon-add.doc.mjs +1 -1
- package/clients/cli/commands/experimental-icon-new-definition.doc.mjs +2 -1
- package/clients/cli/commands/experimental-icon-new-set.doc.mjs +2 -2
- package/clients/cli/commands/experimental-render.doc.mjs +1 -1
- package/clients/cli/commands/swizzle.doc.mjs +12 -3
- package/clients/cli/commands/swizzle.mjs +33 -9
- package/clients/cli/commands/template.mjs +204 -181
- package/clients/cli/lib/resolve-theme.mjs +16 -7
- package/foundation/discovery/component-discovery.mjs +1 -1
- package/foundation/discovery/component-loader.d.mts +1 -1
- package/foundation/discovery/doc-types.mjs +9 -2
- package/foundation/discovery/hook-discovery.mjs +31 -8
- package/foundation/discovery/icon-ranking.d.mts +27 -3
- package/foundation/discovery/icon-ranking.mjs +125 -8
- package/foundation/discovery/icon-set-checks.mjs +44 -35
- package/foundation/discovery/icon-set-discovery.d.mts +13 -0
- package/foundation/discovery/icon-set-discovery.mjs +25 -0
- package/foundation/discovery/icon-set-writer.d.mts +258 -20
- package/foundation/discovery/icon-set-writer.mjs +785 -87
- package/foundation/discovery/module-exports.d.mts +3 -2
- package/foundation/discovery/module-exports.mjs +167 -37
- package/foundation/discovery/template-adapter.mjs +2 -2
- package/foundation/doc-compiler/import.d.mts +5 -1
- package/foundation/doc-compiler/import.mjs +40 -6
- package/foundation/fs/import-url.d.mts +20 -0
- package/foundation/fs/import-url.mjs +22 -0
- package/foundation/fs/module-loader.d.mts +24 -3
- package/foundation/fs/module-loader.mjs +69 -47
- package/foundation/fs/paths.d.mts +2 -1
- package/foundation/fs/paths.mjs +3 -4
- package/foundation/render/charts.d.mts +59 -0
- package/foundation/render/charts.mjs +216 -0
- package/foundation/render/embedded-imports.d.mts +7 -7
- package/foundation/render/embedded-imports.mjs +63 -54
- package/foundation/render/page-host.d.mts +4 -0
- package/foundation/render/page-host.mjs +45 -0
- package/foundation/render/page-worker.mjs +350 -57
- package/foundation/render/render-page.d.mts +11 -6
- package/foundation/render/render-page.mjs +164 -54
- package/foundation/render/ts-paths.d.mts +63 -0
- package/foundation/render/ts-paths.mjs +138 -0
- package/foundation/response/error-codes.doc.mjs +3 -3
- package/foundation/response/error-codes.mjs +3 -2
- package/foundation/text/levenshtein.d.mts +6 -1
- package/foundation/text/levenshtein.mjs +25 -9
- package/foundation/text/shell-arg.d.mts +14 -0
- package/foundation/text/shell-arg.mjs +17 -0
- package/foundation/text/suggest-order.d.mts +8 -1
- package/foundation/text/suggest-order.mjs +72 -6
- package/foundation/xle/registry-core.mjs +1 -1
- package/package.json +7 -6
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
'use client';
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import {useState, useMemo} from 'react';
|
|
6
6
|
import {useResizable, ResizeHandle} from '@astryxdesign/core/Resizable';
|
|
7
7
|
import type {ResizableProps} from '@astryxdesign/core/Resizable';
|
|
8
8
|
import {
|
|
@@ -37,17 +37,13 @@ import {Divider} from '@astryxdesign/core/Divider';
|
|
|
37
37
|
import {MetadataList, MetadataListItem} from '@astryxdesign/core/MetadataList';
|
|
38
38
|
import {
|
|
39
39
|
Table,
|
|
40
|
-
TableBody,
|
|
41
|
-
TableRow,
|
|
42
|
-
TableCell,
|
|
43
40
|
proportional,
|
|
44
41
|
pixel,
|
|
45
|
-
|
|
42
|
+
useTableGroupedRows,
|
|
46
43
|
} from '@astryxdesign/core/Table';
|
|
47
|
-
import type {TableColumn} from '@astryxdesign/core/Table';
|
|
44
|
+
import type {TableColumn, TablePlugin} from '@astryxdesign/core/Table';
|
|
45
|
+
import {rtlStyles} from '@astryxdesign/core/utils';
|
|
48
46
|
import {
|
|
49
|
-
ChevronRightIcon,
|
|
50
|
-
ChevronDownIcon,
|
|
51
47
|
PencilIcon,
|
|
52
48
|
DocumentDuplicateIcon,
|
|
53
49
|
ArrowRightIcon,
|
|
@@ -59,16 +55,6 @@ import {
|
|
|
59
55
|
import {XMarkIcon} from '@heroicons/react/24/outline';
|
|
60
56
|
import {ChartBarIcon} from '@heroicons/react/24/solid';
|
|
61
57
|
|
|
62
|
-
// Plain inline styles using Astryx design-token CSS variables (declared at
|
|
63
|
-
// :root by `@astryxdesign/core/astryx.css`). No StyleX compiler required.
|
|
64
|
-
// The group-header background + cursor live on the colSpan TableCell (which
|
|
65
|
-
// reliably forwards `style`) so they fill the full row width.
|
|
66
|
-
const groupHeaderCell: React.CSSProperties = {
|
|
67
|
-
cursor: 'pointer',
|
|
68
|
-
backgroundColor: 'var(--color-background-muted)',
|
|
69
|
-
padding: 'var(--spacing-3) var(--spacing-4)',
|
|
70
|
-
};
|
|
71
|
-
|
|
72
58
|
// Types
|
|
73
59
|
type TaskStatus = 'in_progress' | 'todo' | 'backlog' | 'done';
|
|
74
60
|
type TaskPriority = 'urgent' | 'high' | 'medium' | 'low' | 'none';
|
|
@@ -114,7 +100,7 @@ const PRIORITY_COLOR: Record<
|
|
|
114
100
|
const allTasks: TaskRow[] = [
|
|
115
101
|
{
|
|
116
102
|
id: '1',
|
|
117
|
-
taskId: '
|
|
103
|
+
taskId: 'TASK-1001',
|
|
118
104
|
title: 'Update user interface',
|
|
119
105
|
subtitle: 'Update payment gateway integration',
|
|
120
106
|
status: 'in_progress',
|
|
@@ -129,7 +115,7 @@ const allTasks: TaskRow[] = [
|
|
|
129
115
|
},
|
|
130
116
|
{
|
|
131
117
|
id: '2',
|
|
132
|
-
taskId: '
|
|
118
|
+
taskId: 'TASK-1002',
|
|
133
119
|
title: 'Use Projects to organize work for features or releases',
|
|
134
120
|
subtitle: '',
|
|
135
121
|
status: 'in_progress',
|
|
@@ -144,7 +130,7 @@ const allTasks: TaskRow[] = [
|
|
|
144
130
|
},
|
|
145
131
|
{
|
|
146
132
|
id: '3',
|
|
147
|
-
taskId: '
|
|
133
|
+
taskId: 'TASK-1003',
|
|
148
134
|
title: 'Use Cycles to focus work over n-weeks',
|
|
149
135
|
subtitle: '',
|
|
150
136
|
status: 'in_progress',
|
|
@@ -159,7 +145,7 @@ const allTasks: TaskRow[] = [
|
|
|
159
145
|
},
|
|
160
146
|
{
|
|
161
147
|
id: '4',
|
|
162
|
-
taskId: '
|
|
148
|
+
taskId: 'TASK-1004',
|
|
163
149
|
title: 'Testing code',
|
|
164
150
|
subtitle: 'Update payment gateway integration',
|
|
165
151
|
status: 'todo',
|
|
@@ -174,7 +160,7 @@ const allTasks: TaskRow[] = [
|
|
|
174
160
|
},
|
|
175
161
|
{
|
|
176
162
|
id: '5',
|
|
177
|
-
taskId: '
|
|
163
|
+
taskId: 'TASK-1005',
|
|
178
164
|
title: 'Update backend code',
|
|
179
165
|
subtitle: 'Update payment gateway integration',
|
|
180
166
|
status: 'todo',
|
|
@@ -189,7 +175,7 @@ const allTasks: TaskRow[] = [
|
|
|
189
175
|
},
|
|
190
176
|
{
|
|
191
177
|
id: '6',
|
|
192
|
-
taskId: '
|
|
178
|
+
taskId: 'TASK-1006',
|
|
193
179
|
title: 'Update front end code',
|
|
194
180
|
subtitle: 'Update payment gateway integration',
|
|
195
181
|
status: 'todo',
|
|
@@ -204,7 +190,7 @@ const allTasks: TaskRow[] = [
|
|
|
204
190
|
},
|
|
205
191
|
{
|
|
206
192
|
id: '7',
|
|
207
|
-
taskId: '
|
|
193
|
+
taskId: 'TASK-1007',
|
|
208
194
|
title: 'Update payment gateway integration',
|
|
209
195
|
subtitle: '',
|
|
210
196
|
status: 'todo',
|
|
@@ -219,7 +205,7 @@ const allTasks: TaskRow[] = [
|
|
|
219
205
|
},
|
|
220
206
|
{
|
|
221
207
|
id: '8',
|
|
222
|
-
taskId: '
|
|
208
|
+
taskId: 'TASK-1008',
|
|
223
209
|
title: 'Update payment gateway backend code',
|
|
224
210
|
subtitle: '',
|
|
225
211
|
status: 'todo',
|
|
@@ -234,7 +220,7 @@ const allTasks: TaskRow[] = [
|
|
|
234
220
|
},
|
|
235
221
|
{
|
|
236
222
|
id: '9',
|
|
237
|
-
taskId: '
|
|
223
|
+
taskId: 'TASK-1009',
|
|
238
224
|
title: 'Invite your teammates',
|
|
239
225
|
subtitle: '',
|
|
240
226
|
status: 'todo',
|
|
@@ -249,7 +235,7 @@ const allTasks: TaskRow[] = [
|
|
|
249
235
|
},
|
|
250
236
|
{
|
|
251
237
|
id: '10',
|
|
252
|
-
taskId: '
|
|
238
|
+
taskId: 'TASK-1010',
|
|
253
239
|
title: 'Next steps',
|
|
254
240
|
subtitle: '',
|
|
255
241
|
status: 'todo',
|
|
@@ -264,7 +250,7 @@ const allTasks: TaskRow[] = [
|
|
|
264
250
|
},
|
|
265
251
|
{
|
|
266
252
|
id: '11',
|
|
267
|
-
taskId: '
|
|
253
|
+
taskId: 'TASK-1011',
|
|
268
254
|
title: 'Welcome to Linear',
|
|
269
255
|
subtitle: '',
|
|
270
256
|
status: 'backlog',
|
|
@@ -279,7 +265,7 @@ const allTasks: TaskRow[] = [
|
|
|
279
265
|
},
|
|
280
266
|
{
|
|
281
267
|
id: '12',
|
|
282
|
-
taskId: '
|
|
268
|
+
taskId: 'TASK-1012',
|
|
283
269
|
title: 'Connect GitHub or GitLab',
|
|
284
270
|
subtitle: '',
|
|
285
271
|
status: 'backlog',
|
|
@@ -294,7 +280,7 @@ const allTasks: TaskRow[] = [
|
|
|
294
280
|
},
|
|
295
281
|
{
|
|
296
282
|
id: '13',
|
|
297
|
-
taskId: '
|
|
283
|
+
taskId: 'TASK-1013',
|
|
298
284
|
title: 'Customize settings',
|
|
299
285
|
subtitle: '',
|
|
300
286
|
status: 'backlog',
|
|
@@ -309,7 +295,7 @@ const allTasks: TaskRow[] = [
|
|
|
309
295
|
},
|
|
310
296
|
{
|
|
311
297
|
id: '14',
|
|
312
|
-
taskId: '
|
|
298
|
+
taskId: 'TASK-1014',
|
|
313
299
|
title: 'Try 3 ways to navigate: Command menu, keyboard or mouse',
|
|
314
300
|
subtitle: '',
|
|
315
301
|
status: 'done',
|
|
@@ -324,7 +310,7 @@ const allTasks: TaskRow[] = [
|
|
|
324
310
|
},
|
|
325
311
|
{
|
|
326
312
|
id: '15',
|
|
327
|
-
taskId: '
|
|
313
|
+
taskId: 'TASK-1015',
|
|
328
314
|
title: 'Connect to Slack',
|
|
329
315
|
subtitle: '',
|
|
330
316
|
status: 'done',
|
|
@@ -339,7 +325,7 @@ const allTasks: TaskRow[] = [
|
|
|
339
325
|
},
|
|
340
326
|
{
|
|
341
327
|
id: '16',
|
|
342
|
-
taskId: '
|
|
328
|
+
taskId: 'TASK-1016',
|
|
343
329
|
title: 'Migrate database schema to v2',
|
|
344
330
|
subtitle: 'Payment gateway integration',
|
|
345
331
|
status: 'in_progress',
|
|
@@ -354,7 +340,7 @@ const allTasks: TaskRow[] = [
|
|
|
354
340
|
},
|
|
355
341
|
{
|
|
356
342
|
id: '17',
|
|
357
|
-
taskId: '
|
|
343
|
+
taskId: 'TASK-1017',
|
|
358
344
|
title: 'Write integration tests for checkout flow',
|
|
359
345
|
subtitle: '',
|
|
360
346
|
status: 'in_progress',
|
|
@@ -369,7 +355,7 @@ const allTasks: TaskRow[] = [
|
|
|
369
355
|
},
|
|
370
356
|
{
|
|
371
357
|
id: '18',
|
|
372
|
-
taskId: '
|
|
358
|
+
taskId: 'TASK-1018',
|
|
373
359
|
title: 'Set up CI/CD pipeline for staging',
|
|
374
360
|
subtitle: '',
|
|
375
361
|
status: 'in_progress',
|
|
@@ -384,7 +370,7 @@ const allTasks: TaskRow[] = [
|
|
|
384
370
|
},
|
|
385
371
|
{
|
|
386
372
|
id: '19',
|
|
387
|
-
taskId: '
|
|
373
|
+
taskId: 'TASK-1019',
|
|
388
374
|
title: 'Add rate limiting to public API endpoints',
|
|
389
375
|
subtitle: '',
|
|
390
376
|
status: 'todo',
|
|
@@ -399,7 +385,7 @@ const allTasks: TaskRow[] = [
|
|
|
399
385
|
},
|
|
400
386
|
{
|
|
401
387
|
id: '20',
|
|
402
|
-
taskId: '
|
|
388
|
+
taskId: 'TASK-1020',
|
|
403
389
|
title: 'Refactor auth middleware to support OAuth2',
|
|
404
390
|
subtitle: '',
|
|
405
391
|
status: 'todo',
|
|
@@ -414,7 +400,7 @@ const allTasks: TaskRow[] = [
|
|
|
414
400
|
},
|
|
415
401
|
{
|
|
416
402
|
id: '21',
|
|
417
|
-
taskId: '
|
|
403
|
+
taskId: 'TASK-1021',
|
|
418
404
|
title: 'Design error pages for 404 and 500',
|
|
419
405
|
subtitle: '',
|
|
420
406
|
status: 'todo',
|
|
@@ -429,7 +415,7 @@ const allTasks: TaskRow[] = [
|
|
|
429
415
|
},
|
|
430
416
|
{
|
|
431
417
|
id: '22',
|
|
432
|
-
taskId: '
|
|
418
|
+
taskId: 'TASK-1022',
|
|
433
419
|
title: 'Audit third-party dependencies for vulnerabilities',
|
|
434
420
|
subtitle: '',
|
|
435
421
|
status: 'todo',
|
|
@@ -444,7 +430,7 @@ const allTasks: TaskRow[] = [
|
|
|
444
430
|
},
|
|
445
431
|
{
|
|
446
432
|
id: '23',
|
|
447
|
-
taskId: '
|
|
433
|
+
taskId: 'TASK-1023',
|
|
448
434
|
title: 'Implement webhook retry logic with exponential backoff',
|
|
449
435
|
subtitle: 'Payment gateway integration',
|
|
450
436
|
status: 'todo',
|
|
@@ -459,7 +445,7 @@ const allTasks: TaskRow[] = [
|
|
|
459
445
|
},
|
|
460
446
|
{
|
|
461
447
|
id: '24',
|
|
462
|
-
taskId: '
|
|
448
|
+
taskId: 'TASK-1024',
|
|
463
449
|
title: 'Add dark mode support to dashboard',
|
|
464
450
|
subtitle: '',
|
|
465
451
|
status: 'backlog',
|
|
@@ -474,7 +460,7 @@ const allTasks: TaskRow[] = [
|
|
|
474
460
|
},
|
|
475
461
|
{
|
|
476
462
|
id: '25',
|
|
477
|
-
taskId: '
|
|
463
|
+
taskId: 'TASK-1025',
|
|
478
464
|
title: 'Create onboarding flow for new team members',
|
|
479
465
|
subtitle: '',
|
|
480
466
|
status: 'backlog',
|
|
@@ -489,7 +475,7 @@ const allTasks: TaskRow[] = [
|
|
|
489
475
|
},
|
|
490
476
|
{
|
|
491
477
|
id: '26',
|
|
492
|
-
taskId: '
|
|
478
|
+
taskId: 'TASK-1026',
|
|
493
479
|
title: 'Set up error tracking with Sentry',
|
|
494
480
|
subtitle: '',
|
|
495
481
|
status: 'backlog',
|
|
@@ -504,7 +490,7 @@ const allTasks: TaskRow[] = [
|
|
|
504
490
|
},
|
|
505
491
|
{
|
|
506
492
|
id: '27',
|
|
507
|
-
taskId: '
|
|
493
|
+
taskId: 'TASK-1027',
|
|
508
494
|
title: 'Improve search performance with indexing',
|
|
509
495
|
subtitle: '',
|
|
510
496
|
status: 'backlog',
|
|
@@ -519,7 +505,7 @@ const allTasks: TaskRow[] = [
|
|
|
519
505
|
},
|
|
520
506
|
{
|
|
521
507
|
id: '28',
|
|
522
|
-
taskId: '
|
|
508
|
+
taskId: 'TASK-1028',
|
|
523
509
|
title: 'Write API documentation for v2 endpoints',
|
|
524
510
|
subtitle: '',
|
|
525
511
|
status: 'done',
|
|
@@ -534,7 +520,7 @@ const allTasks: TaskRow[] = [
|
|
|
534
520
|
},
|
|
535
521
|
{
|
|
536
522
|
id: '29',
|
|
537
|
-
taskId: '
|
|
523
|
+
taskId: 'TASK-1029',
|
|
538
524
|
title: 'Set up staging environment',
|
|
539
525
|
subtitle: '',
|
|
540
526
|
status: 'done',
|
|
@@ -549,7 +535,7 @@ const allTasks: TaskRow[] = [
|
|
|
549
535
|
},
|
|
550
536
|
{
|
|
551
537
|
id: '30',
|
|
552
|
-
taskId: '
|
|
538
|
+
taskId: 'TASK-1030',
|
|
553
539
|
title: 'Fix flaky end-to-end tests in CI',
|
|
554
540
|
subtitle: '',
|
|
555
541
|
status: 'done',
|
|
@@ -571,8 +557,6 @@ const STATUS_LABEL: Record<TaskStatus, string> = {
|
|
|
571
557
|
done: 'Done',
|
|
572
558
|
};
|
|
573
559
|
|
|
574
|
-
const GROUP_ORDER: TaskStatus[] = ['in_progress', 'todo', 'backlog', 'done'];
|
|
575
|
-
|
|
576
560
|
type GroupByField = 'status' | 'priority' | 'project' | 'assignee' | 'none';
|
|
577
561
|
|
|
578
562
|
const GROUP_BY_OPTIONS: {value: GroupByField; label: string}[] = [
|
|
@@ -583,26 +567,6 @@ const GROUP_BY_OPTIONS: {value: GroupByField; label: string}[] = [
|
|
|
583
567
|
{value: 'assignee', label: 'Assignee'},
|
|
584
568
|
];
|
|
585
569
|
|
|
586
|
-
function groupTasks(
|
|
587
|
-
tasks: TaskRow[],
|
|
588
|
-
groupBy: GroupByField,
|
|
589
|
-
): Map<string, TaskRow[]> {
|
|
590
|
-
if (groupBy === 'none') {
|
|
591
|
-
return new Map([['All', tasks]]);
|
|
592
|
-
}
|
|
593
|
-
const map = new Map<string, TaskRow[]>();
|
|
594
|
-
for (const task of tasks) {
|
|
595
|
-
const key = String(task[groupBy]) || '—';
|
|
596
|
-
let group = map.get(key);
|
|
597
|
-
if (!group) {
|
|
598
|
-
group = [];
|
|
599
|
-
map.set(key, group);
|
|
600
|
-
}
|
|
601
|
-
group.push(task);
|
|
602
|
-
}
|
|
603
|
-
return map;
|
|
604
|
-
}
|
|
605
|
-
|
|
606
570
|
function getGroupLabel(groupBy: GroupByField, key: string): string {
|
|
607
571
|
if (groupBy === 'status') {
|
|
608
572
|
return STATUS_LABEL[key as TaskStatus] ?? key;
|
|
@@ -625,36 +589,137 @@ const columns: TableColumn<TaskRow>[] = [
|
|
|
625
589
|
key: 'status',
|
|
626
590
|
header: '',
|
|
627
591
|
width: pixel(44),
|
|
592
|
+
renderCell: task => (
|
|
593
|
+
<Center axis="horizontal">
|
|
594
|
+
<StatusDot
|
|
595
|
+
variant={STATUS_DOT_VARIANT[task.status]}
|
|
596
|
+
label={STATUS_LABEL[task.status]}
|
|
597
|
+
/>
|
|
598
|
+
</Center>
|
|
599
|
+
),
|
|
628
600
|
},
|
|
629
601
|
{
|
|
630
602
|
key: 'title',
|
|
631
603
|
header: 'Issue',
|
|
632
604
|
width: proportional(1),
|
|
605
|
+
renderCell: task => (
|
|
606
|
+
<HStack gap={3} vAlign="center">
|
|
607
|
+
<Icon
|
|
608
|
+
icon={ChartBarIcon}
|
|
609
|
+
size="sm"
|
|
610
|
+
color={PRIORITY_COLOR[task.priority]}
|
|
611
|
+
/>
|
|
612
|
+
<Text type="supporting" color="secondary">
|
|
613
|
+
{task.taskId}
|
|
614
|
+
</Text>
|
|
615
|
+
<Text type="body" maxLines={1}>
|
|
616
|
+
{task.title}
|
|
617
|
+
</Text>
|
|
618
|
+
{task.subtitle && (
|
|
619
|
+
<Text type="body" color="secondary" maxLines={1}>
|
|
620
|
+
› {task.subtitle}
|
|
621
|
+
</Text>
|
|
622
|
+
)}
|
|
623
|
+
</HStack>
|
|
624
|
+
),
|
|
633
625
|
},
|
|
634
626
|
{
|
|
635
627
|
key: 'project',
|
|
636
628
|
header: 'Project',
|
|
637
629
|
width: pixel(180),
|
|
630
|
+
renderCell: task =>
|
|
631
|
+
task.project ? (
|
|
632
|
+
<Text type="body" maxLines={1}>
|
|
633
|
+
{task.project}
|
|
634
|
+
</Text>
|
|
635
|
+
) : (
|
|
636
|
+
<Text type="supporting" color="secondary">
|
|
637
|
+
—
|
|
638
|
+
</Text>
|
|
639
|
+
),
|
|
638
640
|
},
|
|
639
641
|
{
|
|
640
642
|
key: 'created',
|
|
641
643
|
header: 'Created',
|
|
642
|
-
width: pixel(
|
|
644
|
+
width: pixel(88),
|
|
645
|
+
renderCell: task => (
|
|
646
|
+
<Text type="supporting" color="secondary">
|
|
647
|
+
{task.created}
|
|
648
|
+
</Text>
|
|
649
|
+
),
|
|
643
650
|
},
|
|
644
651
|
{
|
|
645
652
|
key: 'updated',
|
|
646
653
|
header: 'Updated',
|
|
647
|
-
width: pixel(
|
|
654
|
+
width: pixel(88),
|
|
655
|
+
renderCell: task => (
|
|
656
|
+
<Text type="supporting" color="secondary">
|
|
657
|
+
{task.updated}
|
|
658
|
+
</Text>
|
|
659
|
+
),
|
|
648
660
|
},
|
|
649
661
|
{
|
|
650
662
|
key: 'assignee',
|
|
651
663
|
header: 'Assignee',
|
|
652
|
-
width: pixel(
|
|
664
|
+
width: pixel(88),
|
|
665
|
+
renderCell: task => <Avatar name={task.assignee} size="sm" />,
|
|
653
666
|
},
|
|
654
667
|
{
|
|
655
668
|
key: 'actions',
|
|
656
669
|
header: '',
|
|
657
670
|
width: pixel(56),
|
|
671
|
+
renderCell: () => (
|
|
672
|
+
<DropdownMenu
|
|
673
|
+
button={{
|
|
674
|
+
label: 'Actions',
|
|
675
|
+
variant: 'ghost',
|
|
676
|
+
size: 'sm',
|
|
677
|
+
icon: <Icon icon={EllipsisHorizontalIcon} size="sm" />,
|
|
678
|
+
isIconOnly: true,
|
|
679
|
+
}}
|
|
680
|
+
hasChevron={false}
|
|
681
|
+
items={[
|
|
682
|
+
{
|
|
683
|
+
label: 'Edit issue',
|
|
684
|
+
icon: PencilIcon,
|
|
685
|
+
onClick: () => {},
|
|
686
|
+
},
|
|
687
|
+
{
|
|
688
|
+
label: 'Assign to...',
|
|
689
|
+
icon: UserIcon,
|
|
690
|
+
onClick: () => {},
|
|
691
|
+
},
|
|
692
|
+
{
|
|
693
|
+
label: 'Add label',
|
|
694
|
+
icon: TagIcon,
|
|
695
|
+
onClick: () => {},
|
|
696
|
+
},
|
|
697
|
+
{
|
|
698
|
+
label: 'Duplicate',
|
|
699
|
+
icon: DocumentDuplicateIcon,
|
|
700
|
+
onClick: () => {},
|
|
701
|
+
},
|
|
702
|
+
{
|
|
703
|
+
label: 'Move to project',
|
|
704
|
+
icon: (
|
|
705
|
+
<Icon
|
|
706
|
+
icon={ArrowRightIcon}
|
|
707
|
+
size="sm"
|
|
708
|
+
color="secondary"
|
|
709
|
+
xstyle={rtlStyles.mirror}
|
|
710
|
+
/>
|
|
711
|
+
),
|
|
712
|
+
onClick: () => {},
|
|
713
|
+
},
|
|
714
|
+
{type: 'divider' as const},
|
|
715
|
+
{
|
|
716
|
+
label: 'Delete issue',
|
|
717
|
+
icon: TrashIcon,
|
|
718
|
+
onClick: () => {},
|
|
719
|
+
},
|
|
720
|
+
]}
|
|
721
|
+
/>
|
|
722
|
+
),
|
|
658
723
|
},
|
|
659
724
|
];
|
|
660
725
|
|
|
@@ -840,8 +905,8 @@ export default function DataTableTemplate() {
|
|
|
840
905
|
ReadonlyArray<PowerSearchFilter>
|
|
841
906
|
>([]);
|
|
842
907
|
const [groupBy, setGroupBy] = useState<GroupByField>('status');
|
|
843
|
-
const [
|
|
844
|
-
() => new Set(
|
|
908
|
+
const [collapsedGroups, setCollapsedGroups] = useState<Set<string>>(
|
|
909
|
+
() => new Set(),
|
|
845
910
|
);
|
|
846
911
|
|
|
847
912
|
const filtered = useMemo(() => {
|
|
@@ -861,19 +926,8 @@ export default function DataTableTemplate() {
|
|
|
861
926
|
return data;
|
|
862
927
|
}, [search, priorityFilter]);
|
|
863
928
|
|
|
864
|
-
const grouped = useMemo(
|
|
865
|
-
() => groupTasks(filtered, groupBy),
|
|
866
|
-
[filtered, groupBy],
|
|
867
|
-
);
|
|
868
|
-
|
|
869
|
-
const groupKeys = useMemo(() => Array.from(grouped.keys()), [grouped]);
|
|
870
|
-
|
|
871
|
-
React.useEffect(() => {
|
|
872
|
-
setExpandedGroups(new Set(groupKeys));
|
|
873
|
-
}, [groupKeys]);
|
|
874
|
-
|
|
875
929
|
const toggleGroup = (key: string) => {
|
|
876
|
-
|
|
930
|
+
setCollapsedGroups(prev => {
|
|
877
931
|
const next = new Set(prev);
|
|
878
932
|
if (next.has(key)) {
|
|
879
933
|
next.delete(key);
|
|
@@ -884,15 +938,48 @@ export default function DataTableTemplate() {
|
|
|
884
938
|
});
|
|
885
939
|
};
|
|
886
940
|
|
|
941
|
+
// Grouping by "None" shows the rows as one plain list, with no headers.
|
|
942
|
+
const grouped = useTableGroupedRows<TaskRow>({
|
|
943
|
+
data: filtered,
|
|
944
|
+
// Groups are keyed by their visible label, which also names each
|
|
945
|
+
// group's toggle button.
|
|
946
|
+
groupBy: task =>
|
|
947
|
+
groupBy === 'none'
|
|
948
|
+
? ''
|
|
949
|
+
: getGroupLabel(groupBy, String(task[groupBy]) || '—'),
|
|
950
|
+
collapsedGroups,
|
|
951
|
+
onToggleGroup: toggleGroup,
|
|
952
|
+
getRowKey: task => task.id,
|
|
953
|
+
renderGroupHeader: (key, count) => (
|
|
954
|
+
<HStack gap={2} vAlign="center">
|
|
955
|
+
<Text type="body" weight="bold">
|
|
956
|
+
{key}
|
|
957
|
+
</Text>
|
|
958
|
+
<Badge variant="neutral" label={String(count)} />
|
|
959
|
+
</HStack>
|
|
960
|
+
),
|
|
961
|
+
});
|
|
962
|
+
|
|
963
|
+
// Clicking an issue row opens its details. Group header rows keep their
|
|
964
|
+
// own toggle.
|
|
965
|
+
const openTaskPlugin: TablePlugin<TaskRow> = {
|
|
966
|
+
transformBodyRow(props, task) {
|
|
967
|
+
if (task.id === '') {
|
|
968
|
+
return props;
|
|
969
|
+
}
|
|
970
|
+
return {
|
|
971
|
+
...props,
|
|
972
|
+
htmlProps: {...props.htmlProps, onClick: () => setSelectedTask(task)},
|
|
973
|
+
};
|
|
974
|
+
},
|
|
975
|
+
};
|
|
976
|
+
|
|
887
977
|
const detailPanel = useResizable({
|
|
888
978
|
defaultSize: 360,
|
|
889
979
|
minSize: 280,
|
|
890
980
|
maxSize: 500,
|
|
891
981
|
});
|
|
892
982
|
|
|
893
|
-
const COL_COUNT = columns.length;
|
|
894
|
-
const resolvedWidths = resolveColumnWidths(columns);
|
|
895
|
-
|
|
896
983
|
return (
|
|
897
984
|
<>
|
|
898
985
|
<Layout
|
|
@@ -931,7 +1018,10 @@ export default function DataTableTemplate() {
|
|
|
931
1018
|
<RadioList
|
|
932
1019
|
label="Group by"
|
|
933
1020
|
value={groupBy}
|
|
934
|
-
onChange={v =>
|
|
1021
|
+
onChange={v => {
|
|
1022
|
+
setGroupBy(v as GroupByField);
|
|
1023
|
+
setCollapsedGroups(new Set());
|
|
1024
|
+
}}>
|
|
935
1025
|
{GROUP_BY_OPTIONS.map(opt => (
|
|
936
1026
|
<RadioListItem
|
|
937
1027
|
key={opt.value}
|
|
@@ -951,181 +1041,19 @@ export default function DataTableTemplate() {
|
|
|
951
1041
|
content={
|
|
952
1042
|
<LayoutContent role="main" padding={0}>
|
|
953
1043
|
<Table
|
|
1044
|
+
data={groupBy === 'none' ? filtered : grouped.data}
|
|
954
1045
|
columns={columns}
|
|
1046
|
+
idKey={groupBy === 'none' ? 'id' : grouped.idKey}
|
|
955
1047
|
density="balanced"
|
|
956
1048
|
dividers="rows"
|
|
957
1049
|
textOverflow="truncate"
|
|
958
|
-
hasHover
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
))}
|
|
966
|
-
</colgroup>
|
|
967
|
-
<TableBody>
|
|
968
|
-
{groupKeys.map(key => {
|
|
969
|
-
const tasks = grouped.get(key);
|
|
970
|
-
if (!tasks || tasks.length === 0) {
|
|
971
|
-
return null;
|
|
972
|
-
}
|
|
973
|
-
const isExpanded = expandedGroups.has(key);
|
|
974
|
-
|
|
975
|
-
return (
|
|
976
|
-
<React.Fragment key={key}>
|
|
977
|
-
{groupBy !== 'none' && (
|
|
978
|
-
<TableRow
|
|
979
|
-
role="button"
|
|
980
|
-
tabIndex={0}
|
|
981
|
-
onClick={() => toggleGroup(key)}
|
|
982
|
-
onKeyDown={e => {
|
|
983
|
-
if (e.key === 'Enter' || e.key === ' ') {
|
|
984
|
-
e.preventDefault();
|
|
985
|
-
toggleGroup(key);
|
|
986
|
-
}
|
|
987
|
-
}}>
|
|
988
|
-
<TableCell
|
|
989
|
-
colSpan={COL_COUNT}
|
|
990
|
-
style={groupHeaderCell}>
|
|
991
|
-
<HStack gap={2} vAlign="center">
|
|
992
|
-
<Icon
|
|
993
|
-
icon={
|
|
994
|
-
isExpanded
|
|
995
|
-
? ChevronDownIcon
|
|
996
|
-
: ChevronRightIcon
|
|
997
|
-
}
|
|
998
|
-
size="sm"
|
|
999
|
-
color="secondary"
|
|
1000
|
-
/>
|
|
1001
|
-
<Text type="body" weight="bold">
|
|
1002
|
-
{getGroupLabel(groupBy, key)}
|
|
1003
|
-
</Text>
|
|
1004
|
-
<Badge
|
|
1005
|
-
variant="neutral"
|
|
1006
|
-
label={String(tasks.length)}
|
|
1007
|
-
/>
|
|
1008
|
-
</HStack>
|
|
1009
|
-
</TableCell>
|
|
1010
|
-
</TableRow>
|
|
1011
|
-
)}
|
|
1012
|
-
{(groupBy === 'none' || isExpanded) &&
|
|
1013
|
-
tasks.map(task => (
|
|
1014
|
-
<TableRow
|
|
1015
|
-
key={task.id}
|
|
1016
|
-
onClick={() => setSelectedTask(task)}>
|
|
1017
|
-
<TableCell>
|
|
1018
|
-
<Center axis="horizontal">
|
|
1019
|
-
<StatusDot
|
|
1020
|
-
variant={STATUS_DOT_VARIANT[task.status]}
|
|
1021
|
-
label={STATUS_LABEL[task.status]}
|
|
1022
|
-
/>
|
|
1023
|
-
</Center>
|
|
1024
|
-
</TableCell>
|
|
1025
|
-
<TableCell>
|
|
1026
|
-
<HStack gap={3} vAlign="center">
|
|
1027
|
-
<Icon
|
|
1028
|
-
icon={ChartBarIcon}
|
|
1029
|
-
size="sm"
|
|
1030
|
-
color={PRIORITY_COLOR[task.priority]}
|
|
1031
|
-
/>
|
|
1032
|
-
<Text type="supporting" color="secondary">
|
|
1033
|
-
{task.taskId}
|
|
1034
|
-
</Text>
|
|
1035
|
-
<Text type="body" maxLines={1}>
|
|
1036
|
-
{task.title}
|
|
1037
|
-
</Text>
|
|
1038
|
-
{task.subtitle && (
|
|
1039
|
-
<Text
|
|
1040
|
-
type="body"
|
|
1041
|
-
color="secondary"
|
|
1042
|
-
maxLines={1}>
|
|
1043
|
-
› {task.subtitle}
|
|
1044
|
-
</Text>
|
|
1045
|
-
)}
|
|
1046
|
-
</HStack>
|
|
1047
|
-
</TableCell>
|
|
1048
|
-
<TableCell>
|
|
1049
|
-
{task.project ? (
|
|
1050
|
-
<Text type="body" maxLines={1}>
|
|
1051
|
-
{task.project}
|
|
1052
|
-
</Text>
|
|
1053
|
-
) : (
|
|
1054
|
-
<Text type="supporting" color="secondary">
|
|
1055
|
-
—
|
|
1056
|
-
</Text>
|
|
1057
|
-
)}
|
|
1058
|
-
</TableCell>
|
|
1059
|
-
<TableCell>
|
|
1060
|
-
<Text type="supporting" color="secondary">
|
|
1061
|
-
{task.created}
|
|
1062
|
-
</Text>
|
|
1063
|
-
</TableCell>
|
|
1064
|
-
<TableCell>
|
|
1065
|
-
<Text type="supporting" color="secondary">
|
|
1066
|
-
{task.updated}
|
|
1067
|
-
</Text>
|
|
1068
|
-
</TableCell>
|
|
1069
|
-
<TableCell>
|
|
1070
|
-
<Avatar name={task.assignee} size="sm" />
|
|
1071
|
-
</TableCell>
|
|
1072
|
-
<TableCell>
|
|
1073
|
-
<DropdownMenu
|
|
1074
|
-
button={{
|
|
1075
|
-
label: 'Actions',
|
|
1076
|
-
variant: 'ghost',
|
|
1077
|
-
size: 'sm',
|
|
1078
|
-
icon: (
|
|
1079
|
-
<Icon
|
|
1080
|
-
icon={EllipsisHorizontalIcon}
|
|
1081
|
-
size="sm"
|
|
1082
|
-
/>
|
|
1083
|
-
),
|
|
1084
|
-
isIconOnly: true,
|
|
1085
|
-
}}
|
|
1086
|
-
hasChevron={false}
|
|
1087
|
-
items={[
|
|
1088
|
-
{
|
|
1089
|
-
label: 'Edit issue',
|
|
1090
|
-
icon: PencilIcon,
|
|
1091
|
-
onClick: () => {},
|
|
1092
|
-
},
|
|
1093
|
-
{
|
|
1094
|
-
label: 'Assign to...',
|
|
1095
|
-
icon: UserIcon,
|
|
1096
|
-
onClick: () => {},
|
|
1097
|
-
},
|
|
1098
|
-
{
|
|
1099
|
-
label: 'Add label',
|
|
1100
|
-
icon: TagIcon,
|
|
1101
|
-
onClick: () => {},
|
|
1102
|
-
},
|
|
1103
|
-
{
|
|
1104
|
-
label: 'Duplicate',
|
|
1105
|
-
icon: DocumentDuplicateIcon,
|
|
1106
|
-
onClick: () => {},
|
|
1107
|
-
},
|
|
1108
|
-
{
|
|
1109
|
-
label: 'Move to project',
|
|
1110
|
-
icon: ArrowRightIcon,
|
|
1111
|
-
onClick: () => {},
|
|
1112
|
-
},
|
|
1113
|
-
{type: 'divider' as const},
|
|
1114
|
-
{
|
|
1115
|
-
label: 'Delete issue',
|
|
1116
|
-
icon: TrashIcon,
|
|
1117
|
-
onClick: () => {},
|
|
1118
|
-
},
|
|
1119
|
-
]}
|
|
1120
|
-
/>
|
|
1121
|
-
</TableCell>
|
|
1122
|
-
</TableRow>
|
|
1123
|
-
))}
|
|
1124
|
-
</React.Fragment>
|
|
1125
|
-
);
|
|
1126
|
-
})}
|
|
1127
|
-
</TableBody>
|
|
1128
|
-
</Table>
|
|
1050
|
+
hasHover
|
|
1051
|
+
plugins={
|
|
1052
|
+
groupBy === 'none'
|
|
1053
|
+
? {openTask: openTaskPlugin}
|
|
1054
|
+
: {grouped: grouped.plugin, openTask: openTaskPlugin}
|
|
1055
|
+
}
|
|
1056
|
+
/>
|
|
1129
1057
|
</LayoutContent>
|
|
1130
1058
|
}
|
|
1131
1059
|
end={
|