@open-mercato/core 0.6.3-develop.3651.1.d3a548a5f1 → 0.6.3-develop.3653.1.b8558737ae
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 +1 -1
- package/dist/generated/entities/customer_settings/index.js +2 -0
- package/dist/generated/entities/customer_settings/index.js.map +2 -2
- package/dist/generated/entity-fields-registry.js +1 -0
- package/dist/generated/entity-fields-registry.js.map +2 -2
- package/dist/modules/customers/api/deals/aggregate/route.js +332 -0
- package/dist/modules/customers/api/deals/aggregate/route.js.map +7 -0
- package/dist/modules/customers/api/deals/bulk-update-owner/route.js +188 -0
- package/dist/modules/customers/api/deals/bulk-update-owner/route.js.map +7 -0
- package/dist/modules/customers/api/deals/bulk-update-stage/route.js +188 -0
- package/dist/modules/customers/api/deals/bulk-update-stage/route.js.map +7 -0
- package/dist/modules/customers/api/deals/route.js +255 -122
- package/dist/modules/customers/api/deals/route.js.map +2 -2
- package/dist/modules/customers/api/settings/stuck-threshold/route.js +169 -0
- package/dist/modules/customers/api/settings/stuck-threshold/route.js.map +7 -0
- package/dist/modules/customers/backend/config/customers/deals/page.js +181 -0
- package/dist/modules/customers/backend/config/customers/deals/page.js.map +7 -0
- package/dist/modules/customers/backend/config/customers/deals/page.meta.js +38 -0
- package/dist/modules/customers/backend/config/customers/deals/page.meta.js.map +7 -0
- package/dist/modules/customers/backend/customers/deals/create/page.js +17 -6
- package/dist/modules/customers/backend/customers/deals/create/page.js.map +2 -2
- package/dist/modules/customers/backend/customers/deals/page.js +2 -0
- package/dist/modules/customers/backend/customers/deals/page.js.map +2 -2
- package/dist/modules/customers/backend/customers/deals/pipeline/components/ActivityComposerDialog.js +217 -0
- package/dist/modules/customers/backend/customers/deals/pipeline/components/ActivityComposerDialog.js.map +7 -0
- package/dist/modules/customers/backend/customers/deals/pipeline/components/AddStageDialog.js +335 -0
- package/dist/modules/customers/backend/customers/deals/pipeline/components/AddStageDialog.js.map +7 -0
- package/dist/modules/customers/backend/customers/deals/pipeline/components/AddStageLane.js +29 -0
- package/dist/modules/customers/backend/customers/deals/pipeline/components/AddStageLane.js.map +7 -0
- package/dist/modules/customers/backend/customers/deals/pipeline/components/BulkActionsBar.js +160 -0
- package/dist/modules/customers/backend/customers/deals/pipeline/components/BulkActionsBar.js.map +7 -0
- package/dist/modules/customers/backend/customers/deals/pipeline/components/ChangeOwnerDialog.js +157 -0
- package/dist/modules/customers/backend/customers/deals/pipeline/components/ChangeOwnerDialog.js.map +7 -0
- package/dist/modules/customers/backend/customers/deals/pipeline/components/ChangeStageDialog.js +114 -0
- package/dist/modules/customers/backend/customers/deals/pipeline/components/ChangeStageDialog.js.map +7 -0
- package/dist/modules/customers/backend/customers/deals/pipeline/components/ChipButton.js +36 -0
- package/dist/modules/customers/backend/customers/deals/pipeline/components/ChipButton.js.map +7 -0
- package/dist/modules/customers/backend/customers/deals/pipeline/components/CloseDateFilterPopover.js +199 -0
- package/dist/modules/customers/backend/customers/deals/pipeline/components/CloseDateFilterPopover.js.map +7 -0
- package/dist/modules/customers/backend/customers/deals/pipeline/components/CurrencyBreakdownTable.js +71 -0
- package/dist/modules/customers/backend/customers/deals/pipeline/components/CurrencyBreakdownTable.js.map +7 -0
- package/dist/modules/customers/backend/customers/deals/pipeline/components/CurrencyFilterPopover.js +233 -0
- package/dist/modules/customers/backend/customers/deals/pipeline/components/CurrencyFilterPopover.js.map +7 -0
- package/dist/modules/customers/backend/customers/deals/pipeline/components/CustomizeViewDialog.js +126 -0
- package/dist/modules/customers/backend/customers/deals/pipeline/components/CustomizeViewDialog.js.map +7 -0
- package/dist/modules/customers/backend/customers/deals/pipeline/components/DashedTileButton.js +31 -0
- package/dist/modules/customers/backend/customers/deals/pipeline/components/DashedTileButton.js.map +7 -0
- package/dist/modules/customers/backend/customers/deals/pipeline/components/DealCard.js +389 -0
- package/dist/modules/customers/backend/customers/deals/pipeline/components/DealCard.js.map +7 -0
- package/dist/modules/customers/backend/customers/deals/pipeline/components/DealCardMenu.js +181 -0
- package/dist/modules/customers/backend/customers/deals/pipeline/components/DealCardMenu.js.map +7 -0
- package/dist/modules/customers/backend/customers/deals/pipeline/components/EntityFilterPopover.js +199 -0
- package/dist/modules/customers/backend/customers/deals/pipeline/components/EntityFilterPopover.js.map +7 -0
- package/dist/modules/customers/backend/customers/deals/pipeline/components/FilterBarRow.js +44 -0
- package/dist/modules/customers/backend/customers/deals/pipeline/components/FilterBarRow.js.map +7 -0
- package/dist/modules/customers/backend/customers/deals/pipeline/components/FilterPopoverShell.js +70 -0
- package/dist/modules/customers/backend/customers/deals/pipeline/components/FilterPopoverShell.js.map +7 -0
- package/dist/modules/customers/backend/customers/deals/pipeline/components/Lane.js +278 -0
- package/dist/modules/customers/backend/customers/deals/pipeline/components/Lane.js.map +7 -0
- package/dist/modules/customers/backend/customers/deals/pipeline/components/LaneCurrencyBreakdown.js +135 -0
- package/dist/modules/customers/backend/customers/deals/pipeline/components/LaneCurrencyBreakdown.js.map +7 -0
- package/dist/modules/customers/backend/customers/deals/pipeline/components/LaneResizeHandle.js +83 -0
- package/dist/modules/customers/backend/customers/deals/pipeline/components/LaneResizeHandle.js.map +7 -0
- package/dist/modules/customers/backend/customers/deals/pipeline/components/PipelineFilterPopover.js +155 -0
- package/dist/modules/customers/backend/customers/deals/pipeline/components/PipelineFilterPopover.js.map +7 -0
- package/dist/modules/customers/backend/customers/deals/pipeline/components/QuickDealDialog.js +318 -0
- package/dist/modules/customers/backend/customers/deals/pipeline/components/QuickDealDialog.js.map +7 -0
- package/dist/modules/customers/backend/customers/deals/pipeline/components/SortByPopover.js +138 -0
- package/dist/modules/customers/backend/customers/deals/pipeline/components/SortByPopover.js.map +7 -0
- package/dist/modules/customers/backend/customers/deals/pipeline/components/StatusFilterPopover.js +126 -0
- package/dist/modules/customers/backend/customers/deals/pipeline/components/StatusFilterPopover.js.map +7 -0
- package/dist/modules/customers/backend/customers/deals/pipeline/components/ViewTabsRow.js +71 -0
- package/dist/modules/customers/backend/customers/deals/pipeline/components/ViewTabsRow.js.map +7 -0
- package/dist/modules/customers/backend/customers/deals/pipeline/components/constants.js +7 -0
- package/dist/modules/customers/backend/customers/deals/pipeline/components/constants.js.map +7 -0
- package/dist/modules/customers/backend/customers/deals/pipeline/page.js +2330 -415
- package/dist/modules/customers/backend/customers/deals/pipeline/page.js.map +3 -3
- package/dist/modules/customers/commands/deals.js +6 -0
- package/dist/modules/customers/commands/deals.js.map +2 -2
- package/dist/modules/customers/commands/pipeline-stages.js +48 -13
- package/dist/modules/customers/commands/pipeline-stages.js.map +3 -3
- package/dist/modules/customers/commands/settings.js +45 -5
- package/dist/modules/customers/commands/settings.js.map +2 -2
- package/dist/modules/customers/data/enrichers.js +130 -1
- package/dist/modules/customers/data/enrichers.js.map +2 -2
- package/dist/modules/customers/data/entities.js +4 -0
- package/dist/modules/customers/data/entities.js.map +2 -2
- package/dist/modules/customers/data/validators.js +29 -2
- package/dist/modules/customers/data/validators.js.map +2 -2
- package/dist/modules/customers/lib/bulkDeals.js +150 -0
- package/dist/modules/customers/lib/bulkDeals.js.map +7 -0
- package/dist/modules/customers/lib/kysely.js +12 -0
- package/dist/modules/customers/lib/kysely.js.map +7 -0
- package/dist/modules/customers/lib/stuckDeals.js +32 -0
- package/dist/modules/customers/lib/stuckDeals.js.map +7 -0
- package/dist/modules/customers/migrations/Migration20260513203311_customers.js +13 -0
- package/dist/modules/customers/migrations/Migration20260513203311_customers.js.map +7 -0
- package/dist/modules/customers/migrations/Migration20260519120000_pipeline_stage_color_tones.js +52 -0
- package/dist/modules/customers/migrations/Migration20260519120000_pipeline_stage_color_tones.js.map +7 -0
- package/dist/modules/customers/workers/deals-bulk-update-owner.js +41 -0
- package/dist/modules/customers/workers/deals-bulk-update-owner.js.map +7 -0
- package/dist/modules/customers/workers/deals-bulk-update-stage.js +41 -0
- package/dist/modules/customers/workers/deals-bulk-update-stage.js.map +7 -0
- package/generated/entities/customer_settings/index.ts +1 -0
- package/generated/entity-fields-registry.ts +1 -0
- package/package.json +7 -7
- package/src/modules/customers/api/deals/aggregate/route.ts +438 -0
- package/src/modules/customers/api/deals/bulk-update-owner/route.ts +216 -0
- package/src/modules/customers/api/deals/bulk-update-stage/route.ts +228 -0
- package/src/modules/customers/api/deals/route.ts +330 -135
- package/src/modules/customers/api/settings/stuck-threshold/route.ts +195 -0
- package/src/modules/customers/backend/config/customers/deals/page.meta.ts +36 -0
- package/src/modules/customers/backend/config/customers/deals/page.tsx +205 -0
- package/src/modules/customers/backend/customers/deals/create/page.tsx +25 -6
- package/src/modules/customers/backend/customers/deals/page.tsx +2 -0
- package/src/modules/customers/backend/customers/deals/pipeline/components/ActivityComposerDialog.tsx +277 -0
- package/src/modules/customers/backend/customers/deals/pipeline/components/AddStageDialog.tsx +425 -0
- package/src/modules/customers/backend/customers/deals/pipeline/components/AddStageLane.tsx +31 -0
- package/src/modules/customers/backend/customers/deals/pipeline/components/BulkActionsBar.tsx +171 -0
- package/src/modules/customers/backend/customers/deals/pipeline/components/ChangeOwnerDialog.tsx +196 -0
- package/src/modules/customers/backend/customers/deals/pipeline/components/ChangeStageDialog.tsx +138 -0
- package/src/modules/customers/backend/customers/deals/pipeline/components/ChipButton.tsx +47 -0
- package/src/modules/customers/backend/customers/deals/pipeline/components/CloseDateFilterPopover.tsx +232 -0
- package/src/modules/customers/backend/customers/deals/pipeline/components/CurrencyBreakdownTable.tsx +110 -0
- package/src/modules/customers/backend/customers/deals/pipeline/components/CurrencyFilterPopover.tsx +310 -0
- package/src/modules/customers/backend/customers/deals/pipeline/components/CustomizeViewDialog.tsx +169 -0
- package/src/modules/customers/backend/customers/deals/pipeline/components/DashedTileButton.tsx +54 -0
- package/src/modules/customers/backend/customers/deals/pipeline/components/DealCard.tsx +562 -0
- package/src/modules/customers/backend/customers/deals/pipeline/components/DealCardMenu.tsx +214 -0
- package/src/modules/customers/backend/customers/deals/pipeline/components/EntityFilterPopover.tsx +257 -0
- package/src/modules/customers/backend/customers/deals/pipeline/components/FilterBarRow.tsx +62 -0
- package/src/modules/customers/backend/customers/deals/pipeline/components/FilterPopoverShell.tsx +101 -0
- package/src/modules/customers/backend/customers/deals/pipeline/components/Lane.tsx +378 -0
- package/src/modules/customers/backend/customers/deals/pipeline/components/LaneCurrencyBreakdown.tsx +192 -0
- package/src/modules/customers/backend/customers/deals/pipeline/components/LaneResizeHandle.tsx +107 -0
- package/src/modules/customers/backend/customers/deals/pipeline/components/PipelineFilterPopover.tsx +196 -0
- package/src/modules/customers/backend/customers/deals/pipeline/components/QuickDealDialog.tsx +408 -0
- package/src/modules/customers/backend/customers/deals/pipeline/components/SortByPopover.tsx +164 -0
- package/src/modules/customers/backend/customers/deals/pipeline/components/StatusFilterPopover.tsx +171 -0
- package/src/modules/customers/backend/customers/deals/pipeline/components/ViewTabsRow.tsx +84 -0
- package/src/modules/customers/backend/customers/deals/pipeline/components/constants.ts +16 -0
- package/src/modules/customers/backend/customers/deals/pipeline/page.tsx +2841 -550
- package/src/modules/customers/commands/deals.ts +19 -0
- package/src/modules/customers/commands/pipeline-stages.ts +68 -13
- package/src/modules/customers/commands/settings.ts +64 -5
- package/src/modules/customers/data/enrichers.ts +209 -2
- package/src/modules/customers/data/entities.ts +4 -1
- package/src/modules/customers/data/validators.ts +36 -2
- package/src/modules/customers/i18n/de.json +244 -0
- package/src/modules/customers/i18n/en.json +244 -0
- package/src/modules/customers/i18n/es.json +244 -0
- package/src/modules/customers/i18n/pl.json +244 -0
- package/src/modules/customers/lib/bulkDeals.ts +231 -0
- package/src/modules/customers/lib/kysely.ts +60 -0
- package/src/modules/customers/lib/stuckDeals.ts +88 -0
- package/src/modules/customers/migrations/.snapshot-open-mercato.json +16 -0
- package/src/modules/customers/migrations/Migration20260513203311_customers.ts +13 -0
- package/src/modules/customers/migrations/Migration20260519120000_pipeline_stage_color_tones.ts +71 -0
- package/src/modules/customers/workers/deals-bulk-update-owner.ts +46 -0
- package/src/modules/customers/workers/deals-bulk-update-stage.ts +46 -0
package/src/modules/customers/backend/customers/deals/pipeline/components/CustomizeViewDialog.tsx
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import Link from 'next/link'
|
|
5
|
+
import { ChevronRight } from 'lucide-react'
|
|
6
|
+
import {
|
|
7
|
+
Dialog,
|
|
8
|
+
DialogContent,
|
|
9
|
+
DialogHeader,
|
|
10
|
+
DialogTitle,
|
|
11
|
+
} from '@open-mercato/ui/primitives/dialog'
|
|
12
|
+
import { Button } from '@open-mercato/ui/primitives/button'
|
|
13
|
+
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
14
|
+
import { translateWithFallback } from '@open-mercato/shared/lib/i18n/translate'
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Action-launcher dialog for the kanban board:
|
|
18
|
+
* - "Configure card fields"
|
|
19
|
+
* - "Manage pipeline stages"
|
|
20
|
+
* - "Reset column widths" (only enabled when at least one lane has been resized)
|
|
21
|
+
* - "Reset to default" (clears filters, restores columns)
|
|
22
|
+
*
|
|
23
|
+
* NOTE: a hardcoded "Saved views" radio group used to live here (Domyślny widok / Mój
|
|
24
|
+
* pipeline / Closing this month / Stuck deals). Selecting an item only updated a local
|
|
25
|
+
* activeViewId — no filters changed, nothing persisted. The reviewer flagged it as
|
|
26
|
+
* misleading, and the perspectives-backed implementation is not in scope for this PR.
|
|
27
|
+
* We removed the section entirely; once a real saved-view system lands, restore it with
|
|
28
|
+
* actual filter application and persistence.
|
|
29
|
+
*/
|
|
30
|
+
type CustomizeViewDialogProps = {
|
|
31
|
+
open: boolean
|
|
32
|
+
/** Number of lanes the user has manually resized — displayed alongside the reset action */
|
|
33
|
+
resizedLanesCount?: number
|
|
34
|
+
onClose: () => void
|
|
35
|
+
onResetToDefault: () => void
|
|
36
|
+
/** Clear all per-stage width overrides so every lane falls back to its default width */
|
|
37
|
+
onResetColumnWidths?: () => void
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function CustomizeViewDialog({
|
|
41
|
+
open,
|
|
42
|
+
resizedLanesCount = 0,
|
|
43
|
+
onClose,
|
|
44
|
+
onResetToDefault,
|
|
45
|
+
onResetColumnWidths,
|
|
46
|
+
}: CustomizeViewDialogProps): React.ReactElement {
|
|
47
|
+
const t = useT()
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<Dialog
|
|
51
|
+
open={open}
|
|
52
|
+
onOpenChange={(next) => {
|
|
53
|
+
if (!next) onClose()
|
|
54
|
+
}}
|
|
55
|
+
>
|
|
56
|
+
<DialogContent className="sm:max-w-md">
|
|
57
|
+
<DialogHeader>
|
|
58
|
+
{/*
|
|
59
|
+
* DS Dialog renders the close affordance (X) automatically; we previously rendered
|
|
60
|
+
* a second manual IconButton X here AND a header-level "Reset to default" button
|
|
61
|
+
* that duplicated the row-level entry below. Both were removed per the SPEC-048
|
|
62
|
+
* UX review (item 12).
|
|
63
|
+
*/}
|
|
64
|
+
<DialogTitle>
|
|
65
|
+
{translateWithFallback(t, 'customers.deals.kanban.customize.title', 'Customize view')}
|
|
66
|
+
</DialogTitle>
|
|
67
|
+
</DialogHeader>
|
|
68
|
+
|
|
69
|
+
<div className="flex flex-col gap-4">
|
|
70
|
+
<section className="flex flex-col gap-1">
|
|
71
|
+
<span className="text-overline font-semibold uppercase tracking-wider text-muted-foreground">
|
|
72
|
+
{translateWithFallback(t, 'customers.deals.kanban.customize.actions', 'Actions')}
|
|
73
|
+
</span>
|
|
74
|
+
<Link
|
|
75
|
+
href="/backend/config/customers/pipeline-stages"
|
|
76
|
+
className="flex items-center justify-between gap-2 rounded-md px-3 py-2 text-left transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"
|
|
77
|
+
onClick={() => onClose()}
|
|
78
|
+
>
|
|
79
|
+
<span className="flex flex-col">
|
|
80
|
+
<span className="text-sm font-medium text-foreground">
|
|
81
|
+
{translateWithFallback(
|
|
82
|
+
t,
|
|
83
|
+
'customers.deals.kanban.customize.manageStages',
|
|
84
|
+
'Manage pipeline stages',
|
|
85
|
+
)}
|
|
86
|
+
</span>
|
|
87
|
+
<span className="text-xs text-muted-foreground">
|
|
88
|
+
{translateWithFallback(
|
|
89
|
+
t,
|
|
90
|
+
'customers.deals.kanban.customize.manageStages.help',
|
|
91
|
+
'Edit names, colors, required fields',
|
|
92
|
+
)}
|
|
93
|
+
</span>
|
|
94
|
+
</span>
|
|
95
|
+
<ChevronRight className="size-4 text-muted-foreground" aria-hidden="true" />
|
|
96
|
+
</Link>
|
|
97
|
+
{onResetColumnWidths ? (
|
|
98
|
+
<Button
|
|
99
|
+
variant="ghost"
|
|
100
|
+
type="button"
|
|
101
|
+
disabled={resizedLanesCount === 0}
|
|
102
|
+
onClick={() => {
|
|
103
|
+
onResetColumnWidths()
|
|
104
|
+
onClose()
|
|
105
|
+
}}
|
|
106
|
+
className="flex items-center justify-between gap-2 rounded-md px-3 py-2 text-left transition-colors hover:bg-muted disabled:cursor-not-allowed disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"
|
|
107
|
+
>
|
|
108
|
+
<span className="flex flex-col">
|
|
109
|
+
<span className="text-sm font-medium text-foreground">
|
|
110
|
+
{translateWithFallback(
|
|
111
|
+
t,
|
|
112
|
+
'customers.deals.kanban.customize.resetWidths',
|
|
113
|
+
'Reset column widths',
|
|
114
|
+
)}
|
|
115
|
+
</span>
|
|
116
|
+
<span className="text-xs text-muted-foreground">
|
|
117
|
+
{resizedLanesCount > 0
|
|
118
|
+
? translateWithFallback(
|
|
119
|
+
t,
|
|
120
|
+
'customers.deals.kanban.customize.resetWidths.helpCount',
|
|
121
|
+
'Restore the default width on {count} resized column(s)',
|
|
122
|
+
{ count: resizedLanesCount },
|
|
123
|
+
)
|
|
124
|
+
: translateWithFallback(
|
|
125
|
+
t,
|
|
126
|
+
'customers.deals.kanban.customize.resetWidths.helpEmpty',
|
|
127
|
+
'No columns have been resized yet',
|
|
128
|
+
)}
|
|
129
|
+
</span>
|
|
130
|
+
</span>
|
|
131
|
+
<ChevronRight className="size-4 text-muted-foreground" aria-hidden="true" />
|
|
132
|
+
</Button>
|
|
133
|
+
) : null}
|
|
134
|
+
<Button
|
|
135
|
+
variant="ghost"
|
|
136
|
+
type="button"
|
|
137
|
+
onClick={() => {
|
|
138
|
+
onResetToDefault()
|
|
139
|
+
onClose()
|
|
140
|
+
}}
|
|
141
|
+
className="flex items-center justify-between gap-2 rounded-md px-3 py-2 text-left transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"
|
|
142
|
+
>
|
|
143
|
+
<span className="flex flex-col">
|
|
144
|
+
<span className="text-sm font-medium text-foreground">
|
|
145
|
+
{translateWithFallback(
|
|
146
|
+
t,
|
|
147
|
+
'customers.deals.kanban.customize.resetDefault',
|
|
148
|
+
'Reset to default',
|
|
149
|
+
)}
|
|
150
|
+
</span>
|
|
151
|
+
<span className="text-xs text-muted-foreground">
|
|
152
|
+
{translateWithFallback(
|
|
153
|
+
t,
|
|
154
|
+
'customers.deals.kanban.customize.resetDefault.help',
|
|
155
|
+
'Clear filters and restore columns',
|
|
156
|
+
)}
|
|
157
|
+
</span>
|
|
158
|
+
</span>
|
|
159
|
+
<ChevronRight className="size-4 text-muted-foreground" aria-hidden="true" />
|
|
160
|
+
</Button>
|
|
161
|
+
</section>
|
|
162
|
+
</div>
|
|
163
|
+
|
|
164
|
+
</DialogContent>
|
|
165
|
+
</Dialog>
|
|
166
|
+
)
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export default CustomizeViewDialog
|
package/src/modules/customers/backend/customers/deals/pipeline/components/DashedTileButton.tsx
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import { Button } from '@open-mercato/ui/primitives/button'
|
|
5
|
+
|
|
6
|
+
export type DashedTileButtonProps = {
|
|
7
|
+
onClick: () => void
|
|
8
|
+
disabled?: boolean
|
|
9
|
+
ariaLabel?: string
|
|
10
|
+
title?: string
|
|
11
|
+
/**
|
|
12
|
+
* Extra utility classes appended after the shared dashed-tile chrome. Use this for
|
|
13
|
+
* width/height/orientation tweaks that vary per consumer (e.g. AddStageLane needs
|
|
14
|
+
* `min-h-[60vh]` + `flex-col`, quick-add needs `h-11`, show-more needs `px-3 py-2.5`).
|
|
15
|
+
*/
|
|
16
|
+
className?: string
|
|
17
|
+
children: React.ReactNode
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Shared chrome for the three dashed-outline CTAs on the kanban board:
|
|
22
|
+
* - quick-add per lane (Lane.tsx)
|
|
23
|
+
* - show-more per lane (Lane.tsx)
|
|
24
|
+
* - new-stage lane (AddStageLane.tsx)
|
|
25
|
+
*
|
|
26
|
+
* Before extraction each consumer hand-rolled the same 8–10 utility classes plus its own
|
|
27
|
+
* focus-ring + dashed-border styling; drift between the three was a Figma compliance risk
|
|
28
|
+
* (and was flagged in the SPEC-048 UX review as item 19). Centralising the styles here
|
|
29
|
+
* keeps the trio in sync.
|
|
30
|
+
*/
|
|
31
|
+
export function DashedTileButton({
|
|
32
|
+
onClick,
|
|
33
|
+
disabled = false,
|
|
34
|
+
ariaLabel,
|
|
35
|
+
title,
|
|
36
|
+
className,
|
|
37
|
+
children,
|
|
38
|
+
}: DashedTileButtonProps): React.ReactElement {
|
|
39
|
+
return (
|
|
40
|
+
<Button
|
|
41
|
+
variant="ghost"
|
|
42
|
+
type="button"
|
|
43
|
+
onClick={onClick}
|
|
44
|
+
disabled={disabled}
|
|
45
|
+
aria-label={ariaLabel}
|
|
46
|
+
title={title}
|
|
47
|
+
className={`group flex items-center justify-center gap-2.5 rounded-lg border border-dashed border-muted-foreground/60 bg-muted/40 text-sm font-semibold leading-normal text-foreground transition-colors hover:bg-muted/70 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 ${className ?? ''}`.trim()}
|
|
48
|
+
>
|
|
49
|
+
{children}
|
|
50
|
+
</Button>
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export default DashedTileButton
|