@fayz-ai/plugin-agenda 0.1.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/README.md +51 -0
- package/dist/AgendaContext.d.ts +13 -0
- package/dist/AgendaContext.d.ts.map +1 -0
- package/dist/AgendaPage.d.ts +11 -0
- package/dist/AgendaPage.d.ts.map +1 -0
- package/dist/bridges/create-financial-bridge.d.ts +19 -0
- package/dist/bridges/create-financial-bridge.d.ts.map +1 -0
- package/dist/calendar-styles.d.ts +8 -0
- package/dist/calendar-styles.d.ts.map +1 -0
- package/dist/chunk-3LJKZQK4.js +12 -0
- package/dist/chunk-3LJKZQK4.js.map +1 -0
- package/dist/chunk-SYDBDI3Q.cjs +15 -0
- package/dist/chunk-SYDBDI3Q.cjs.map +1 -0
- package/dist/components/AgendaGeneralSettings.d.ts +3 -0
- package/dist/components/AgendaGeneralSettings.d.ts.map +1 -0
- package/dist/components/AppointmentModal.d.ts +16 -0
- package/dist/components/AppointmentModal.d.ts.map +1 -0
- package/dist/components/AppointmentPopover.d.ts +14 -0
- package/dist/components/AppointmentPopover.d.ts.map +1 -0
- package/dist/components/BookingPaymentPanel.d.ts +18 -0
- package/dist/components/BookingPaymentPanel.d.ts.map +1 -0
- package/dist/components/CalendarSidebar.d.ts +3 -0
- package/dist/components/CalendarSidebar.d.ts.map +1 -0
- package/dist/components/CalendarToolbar.d.ts +13 -0
- package/dist/components/CalendarToolbar.d.ts.map +1 -0
- package/dist/components/EventContextMenu.d.ts +14 -0
- package/dist/components/EventContextMenu.d.ts.map +1 -0
- package/dist/components/FloatingPanel.d.ts +27 -0
- package/dist/components/FloatingPanel.d.ts.map +1 -0
- package/dist/components/MiniCalendar.d.ts +9 -0
- package/dist/components/MiniCalendar.d.ts.map +1 -0
- package/dist/components/PaymentStatusBadge.d.ts +13 -0
- package/dist/components/PaymentStatusBadge.d.ts.map +1 -0
- package/dist/components/SearchCombobox.d.ts +38 -0
- package/dist/components/SearchCombobox.d.ts.map +1 -0
- package/dist/components/StatusBadge.d.ts +5 -0
- package/dist/components/StatusBadge.d.ts.map +1 -0
- package/dist/config.d.ts +151 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/data/index.d.ts +4 -0
- package/dist/data/index.d.ts.map +1 -0
- package/dist/data/mock.d.ts +3 -0
- package/dist/data/mock.d.ts.map +1 -0
- package/dist/data/supabase.d.ts +3 -0
- package/dist/data/supabase.d.ts.map +1 -0
- package/dist/data/types.d.ts +26 -0
- package/dist/data/types.d.ts.map +1 -0
- package/dist/financial-bridge.d.ts +92 -0
- package/dist/financial-bridge.d.ts.map +1 -0
- package/dist/hooks/useAgendaSettings.d.ts +7 -0
- package/dist/hooks/useAgendaSettings.d.ts.map +1 -0
- package/dist/index.cjs +5135 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5120 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/tenant.d.ts +3 -0
- package/dist/lib/tenant.d.ts.map +1 -0
- package/dist/locales/en.d.ts +2 -0
- package/dist/locales/en.d.ts.map +1 -0
- package/dist/locales/index.d.ts +2 -0
- package/dist/locales/index.d.ts.map +1 -0
- package/dist/locales/pt-BR.d.ts +2 -0
- package/dist/locales/pt-BR.d.ts.map +1 -0
- package/dist/registries.d.ts +3 -0
- package/dist/registries.d.ts.map +1 -0
- package/dist/store.d.ts +66 -0
- package/dist/store.d.ts.map +1 -0
- package/dist/tenant-222EHYUC.cjs +16 -0
- package/dist/tenant-222EHYUC.cjs.map +1 -0
- package/dist/tenant-LAUWVUYB.js +3 -0
- package/dist/tenant-LAUWVUYB.js.map +1 -0
- package/dist/types.d.ts +202 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/views/CalendarView.d.ts +3 -0
- package/dist/views/CalendarView.d.ts.map +1 -0
- package/dist/views/ConfirmationsView.d.ts +3 -0
- package/dist/views/ConfirmationsView.d.ts.map +1 -0
- package/package.json +63 -0
- package/src/AgendaContext.tsx +11 -0
- package/src/AgendaPage.tsx +33 -0
- package/src/bridges/create-financial-bridge.ts +298 -0
- package/src/calendar-styles.css +245 -0
- package/src/calendar-styles.ts +285 -0
- package/src/components/AgendaGeneralSettings.tsx +64 -0
- package/src/components/AppointmentModal.tsx +1031 -0
- package/src/components/AppointmentPopover.tsx +221 -0
- package/src/components/BookingPaymentPanel.tsx +394 -0
- package/src/components/CalendarSidebar.tsx +119 -0
- package/src/components/CalendarToolbar.tsx +83 -0
- package/src/components/EventContextMenu.tsx +122 -0
- package/src/components/FloatingPanel.tsx +123 -0
- package/src/components/MiniCalendar.tsx +120 -0
- package/src/components/PaymentStatusBadge.tsx +62 -0
- package/src/components/SearchCombobox.tsx +216 -0
- package/src/components/StatusBadge.tsx +23 -0
- package/src/config.ts +269 -0
- package/src/data/index.ts +3 -0
- package/src/data/mock.ts +324 -0
- package/src/data/supabase.ts +570 -0
- package/src/data/types.ts +37 -0
- package/src/financial-bridge.ts +96 -0
- package/src/hooks/useAgendaSettings.ts +17 -0
- package/src/index.ts +180 -0
- package/src/lib/tenant.ts +3 -0
- package/src/locales/en.ts +207 -0
- package/src/locales/index.ts +7 -0
- package/src/locales/pt-BR.ts +207 -0
- package/src/registries.ts +36 -0
- package/src/store.ts +304 -0
- package/src/types.ts +265 -0
- package/src/views/CalendarView.tsx +904 -0
- package/src/views/ConfirmationsView.tsx +155 -0
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
// ---------------------------------------------------------------------------
|
|
2
|
+
// Bridge factory: adapts FinancialDataProvider → AgendaFinancialBridge
|
|
3
|
+
// Consumer apps call this at plugin wiring time.
|
|
4
|
+
// ---------------------------------------------------------------------------
|
|
5
|
+
|
|
6
|
+
import type { FinancialDataProvider } from '@fayz-ai/plugin-financial'
|
|
7
|
+
import type { AgendaFinancialBridge, BookingPaymentSummary, BookingPaymentDetail, BookingPaymentStatus } from '../financial-bridge'
|
|
8
|
+
import { getSupabaseClientOptional } from '@fayz-ai/core'
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Pure commission math: percentage of a realized order total, rounded to cents.
|
|
12
|
+
* Exported for unit-testing and reuse; the bridge method below wraps the I/O.
|
|
13
|
+
* Returns 0 for a non-positive base or rate so callers can skip empty accruals.
|
|
14
|
+
*/
|
|
15
|
+
export function computeCommissionAmount(total: number, ratePercent: number): number {
|
|
16
|
+
const base = Number(total) || 0
|
|
17
|
+
const rate = Number(ratePercent) || 0
|
|
18
|
+
if (base <= 0 || rate <= 0) return 0
|
|
19
|
+
return Math.round(base * (rate / 100) * 100) / 100
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function computeStatus(movements: Array<{ status: string }>): BookingPaymentStatus {
|
|
23
|
+
if (movements.length === 0) return 'none'
|
|
24
|
+
const allPaid = movements.every((m) => m.status === 'paid')
|
|
25
|
+
if (allPaid) return 'paid'
|
|
26
|
+
const allCancelled = movements.every((m) => m.status === 'cancelled')
|
|
27
|
+
if (allCancelled) return 'cancelled'
|
|
28
|
+
const anyOverdue = movements.some((m) => m.status === 'overdue')
|
|
29
|
+
if (anyOverdue) return 'overdue'
|
|
30
|
+
const anyPaid = movements.some((m) => m.status === 'paid' || m.status === 'partial')
|
|
31
|
+
if (anyPaid) return 'partial'
|
|
32
|
+
return 'pending'
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Create an AgendaFinancialBridge backed by the financial plugin's data provider.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* const financialProvider = createSupabaseFinancialProvider()
|
|
40
|
+
* const agenda = createAgendaPlugin({
|
|
41
|
+
* financialBridge: createFinancialBridge(financialProvider),
|
|
42
|
+
* })
|
|
43
|
+
*/
|
|
44
|
+
export function createFinancialBridge(provider: FinancialDataProvider): AgendaFinancialBridge {
|
|
45
|
+
return {
|
|
46
|
+
async resolvePaymentStatuses(orderIds: string[]): Promise<Map<string, BookingPaymentSummary>> {
|
|
47
|
+
const result = new Map<string, BookingPaymentSummary>()
|
|
48
|
+
if (orderIds.length === 0) return result
|
|
49
|
+
|
|
50
|
+
// Single batch query instead of N individual getInvoiceById calls
|
|
51
|
+
const supabase = getSupabaseClientOptional() as any
|
|
52
|
+
if (!supabase) return result
|
|
53
|
+
|
|
54
|
+
try {
|
|
55
|
+
const [{ data: orders }, { data: movements }] = await Promise.all([
|
|
56
|
+
supabase
|
|
57
|
+
.schema('saas_core')
|
|
58
|
+
.from('orders')
|
|
59
|
+
.select('id, kind, status, total, reference_number, metadata')
|
|
60
|
+
.in('id', orderIds),
|
|
61
|
+
supabase
|
|
62
|
+
.from('financial_movements')
|
|
63
|
+
.select('invoice_id, status, paid_amount')
|
|
64
|
+
.in('invoice_id', orderIds),
|
|
65
|
+
])
|
|
66
|
+
|
|
67
|
+
const movementsByOrderId = new Map<string, Array<{ status: string; paid_amount: number }>>()
|
|
68
|
+
for (const movement of movements ?? []) {
|
|
69
|
+
const invoiceId = movement.invoice_id as string | undefined
|
|
70
|
+
if (!invoiceId) continue
|
|
71
|
+
movementsByOrderId.set(invoiceId, [...(movementsByOrderId.get(invoiceId) ?? []), movement])
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
for (const order of orders ?? []) {
|
|
75
|
+
const orderMovements = movementsByOrderId.get(order.id) ?? []
|
|
76
|
+
const meta = (order.metadata ?? {}) as Record<string, unknown>
|
|
77
|
+
const paidAmount = orderMovements.length > 0
|
|
78
|
+
? orderMovements.reduce((sum, movement) => sum + (Number(movement.paid_amount) || 0), 0)
|
|
79
|
+
: Number(meta.paidAmount) || 0
|
|
80
|
+
|
|
81
|
+
result.set(order.id, {
|
|
82
|
+
invoiceId: order.id,
|
|
83
|
+
referenceNumber: order.reference_number as string | undefined,
|
|
84
|
+
status: orderMovements.length > 0 ? computeStatus(orderMovements) : mapInvoiceStatus(order.status as string),
|
|
85
|
+
totalAmount: Number(order.total) || 0,
|
|
86
|
+
paidAmount,
|
|
87
|
+
})
|
|
88
|
+
}
|
|
89
|
+
} catch { /* non-blocking */ }
|
|
90
|
+
|
|
91
|
+
return result
|
|
92
|
+
},
|
|
93
|
+
|
|
94
|
+
async getPaymentDetail(orderId: string): Promise<BookingPaymentDetail | null> {
|
|
95
|
+
const supabase = getSupabaseClientOptional() as any
|
|
96
|
+
if (!supabase) return null
|
|
97
|
+
|
|
98
|
+
// Single query: get order + movements in parallel
|
|
99
|
+
const [orderRes, movRes] = await Promise.all([
|
|
100
|
+
supabase.schema('saas_core').from('orders').select('id, status, total, reference_number, metadata').eq('id', orderId).single(),
|
|
101
|
+
supabase.from('financial_movements').select('*').eq('invoice_id', orderId).order('due_date'),
|
|
102
|
+
])
|
|
103
|
+
|
|
104
|
+
const order = orderRes.data
|
|
105
|
+
if (!order) return null
|
|
106
|
+
const meta = (order.metadata ?? {}) as Record<string, unknown>
|
|
107
|
+
|
|
108
|
+
// Collect unique payment_method_type_ids to resolve names in one query
|
|
109
|
+
const typeIds = [...new Set((movRes.data ?? []).map((m: any) => m.payment_method_type_id).filter(Boolean))]
|
|
110
|
+
let typeNames: Record<string, string> = {}
|
|
111
|
+
if (typeIds.length > 0) {
|
|
112
|
+
const { data: types } = await supabase.from('payment_method_types').select('id, name').in('id', typeIds)
|
|
113
|
+
typeNames = Object.fromEntries((types ?? []).map((t: any) => [t.id, t.name]))
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
const movements = (movRes.data ?? []).map((m: Record<string, unknown>) => ({
|
|
117
|
+
id: String(m.id),
|
|
118
|
+
amount: Number(m.amount) || 0,
|
|
119
|
+
paidAmount: Number(m.paid_amount) || 0,
|
|
120
|
+
status: String(m.status ?? 'pending'),
|
|
121
|
+
dueDate: String(m.due_date ?? ''),
|
|
122
|
+
installmentNumber: m.installment_number != null ? Number(m.installment_number) : undefined,
|
|
123
|
+
paymentDate: m.payment_date ? String(m.payment_date) : undefined,
|
|
124
|
+
paymentMethodTypeName: m.payment_method_type_id ? typeNames[String(m.payment_method_type_id)] : undefined,
|
|
125
|
+
cardBrand: m.card_brand ? String(m.card_brand) : undefined,
|
|
126
|
+
cardInstallments: m.card_installments ? Number(m.card_installments) : undefined,
|
|
127
|
+
}))
|
|
128
|
+
|
|
129
|
+
return {
|
|
130
|
+
invoiceId: order.id,
|
|
131
|
+
referenceNumber: order.reference_number as string | undefined,
|
|
132
|
+
status: movements.length > 0 ? computeStatus(movements) : mapInvoiceStatus(order.status as string),
|
|
133
|
+
totalAmount: Number(order.total) || 0,
|
|
134
|
+
paidAmount: Number(meta.paidAmount) || 0,
|
|
135
|
+
movements,
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
|
|
139
|
+
async createInvoiceFromOrder(orderId: string, options?: {
|
|
140
|
+
installments?: number
|
|
141
|
+
dueDate?: string
|
|
142
|
+
paymentMethodTypeId?: string
|
|
143
|
+
}): Promise<string> {
|
|
144
|
+
// Promote the existing order to an invoice_receivable atomically via the
|
|
145
|
+
// shared DB function (ref + stage/direction + N installments, idempotent).
|
|
146
|
+
// status='invoiced' is valid for appointment/service_order (CHECK).
|
|
147
|
+
const supabase = getSupabaseClientOptional() as any
|
|
148
|
+
if (!supabase) throw new Error('Supabase not available')
|
|
149
|
+
const { error } = await supabase.rpc('fn_invoice_from_order', {
|
|
150
|
+
p_order_id: orderId,
|
|
151
|
+
p_due_date: options?.dueDate ?? null,
|
|
152
|
+
p_status: 'invoiced',
|
|
153
|
+
p_installments: options?.installments ?? 1,
|
|
154
|
+
p_direction: 'credit',
|
|
155
|
+
})
|
|
156
|
+
if (error) throw new Error(error.message)
|
|
157
|
+
return orderId
|
|
158
|
+
},
|
|
159
|
+
|
|
160
|
+
async payMovement(input) {
|
|
161
|
+
await provider.payMovement({
|
|
162
|
+
movementId: input.movementId,
|
|
163
|
+
amount: input.amount,
|
|
164
|
+
paymentDate: input.paymentDate,
|
|
165
|
+
paymentMethodTypeId: input.paymentMethodTypeId,
|
|
166
|
+
paymentMethodId: input.paymentMethodId,
|
|
167
|
+
bankAccountId: input.bankAccountId,
|
|
168
|
+
cardBrand: input.cardBrand,
|
|
169
|
+
cardInstallments: input.cardInstallments,
|
|
170
|
+
})
|
|
171
|
+
},
|
|
172
|
+
|
|
173
|
+
async createCommissionMovement(orderId, options) {
|
|
174
|
+
const supabase = getSupabaseClientOptional() as any
|
|
175
|
+
if (!supabase) return null
|
|
176
|
+
|
|
177
|
+
// Order carries the assigned professional (assignee_id) and realized total.
|
|
178
|
+
const { data: order } = await supabase
|
|
179
|
+
.schema('saas_core')
|
|
180
|
+
.from('orders')
|
|
181
|
+
.select('id, tenant_id, assignee_id, total')
|
|
182
|
+
.eq('id', orderId)
|
|
183
|
+
.single()
|
|
184
|
+
if (!order || !order.assignee_id) return null // no professional → no commission
|
|
185
|
+
|
|
186
|
+
// Per-professional rate lives on staff_members, surfaced via v_staff (id = person id).
|
|
187
|
+
const { data: staff } = await supabase
|
|
188
|
+
.from('v_staff')
|
|
189
|
+
.select('commission_rate')
|
|
190
|
+
.eq('id', order.assignee_id)
|
|
191
|
+
.single()
|
|
192
|
+
|
|
193
|
+
const rate = Number(staff?.commission_rate) || 0
|
|
194
|
+
const base = Number(order.total) || 0
|
|
195
|
+
const amount = computeCommissionAmount(base, rate)
|
|
196
|
+
if (amount <= 0) return null // nothing configured/realized to accrue
|
|
197
|
+
|
|
198
|
+
// Idempotent: one commission accrual per order. Reuse if already present.
|
|
199
|
+
const { data: existing } = await supabase
|
|
200
|
+
.from('financial_movements')
|
|
201
|
+
.select('id')
|
|
202
|
+
.eq('invoice_id', orderId)
|
|
203
|
+
.eq('movement_kind', 'commission')
|
|
204
|
+
.limit(1)
|
|
205
|
+
if (existing && existing.length > 0) return existing[0].id as string
|
|
206
|
+
|
|
207
|
+
const dueDate = options?.dueDate ?? new Date().toISOString().slice(0, 10)
|
|
208
|
+
|
|
209
|
+
const { data: inserted } = await supabase
|
|
210
|
+
.from('financial_movements')
|
|
211
|
+
.insert({
|
|
212
|
+
tenant_id: order.tenant_id,
|
|
213
|
+
invoice_id: orderId,
|
|
214
|
+
direction: 'debit', // payable to the professional
|
|
215
|
+
movement_kind: 'commission',
|
|
216
|
+
amount,
|
|
217
|
+
paid_amount: 0,
|
|
218
|
+
status: 'pending',
|
|
219
|
+
due_date: dueDate,
|
|
220
|
+
metadata: {
|
|
221
|
+
source: 'agenda',
|
|
222
|
+
kind: 'commission',
|
|
223
|
+
professionalId: order.assignee_id,
|
|
224
|
+
commissionRate: rate,
|
|
225
|
+
baseAmount: base,
|
|
226
|
+
},
|
|
227
|
+
})
|
|
228
|
+
.select('id')
|
|
229
|
+
.single()
|
|
230
|
+
|
|
231
|
+
return (inserted?.id as string | undefined) ?? null
|
|
232
|
+
},
|
|
233
|
+
|
|
234
|
+
async checkout(orderId, input) {
|
|
235
|
+
// 1. Create invoice (single installment, due today)
|
|
236
|
+
const today = new Date().toISOString().slice(0, 10)
|
|
237
|
+
const invoiceId = await this.createInvoiceFromOrder(orderId, { installments: 1, dueDate: today })
|
|
238
|
+
|
|
239
|
+
// 2. Get the created movement
|
|
240
|
+
const detail = await this.getPaymentDetail(invoiceId)
|
|
241
|
+
if (!detail || detail.movements.length === 0) throw new Error('No movement created')
|
|
242
|
+
|
|
243
|
+
const movement = detail.movements[0]
|
|
244
|
+
|
|
245
|
+
// 3. Pay it in full
|
|
246
|
+
await this.payMovement({
|
|
247
|
+
movementId: movement.id,
|
|
248
|
+
amount: movement.amount,
|
|
249
|
+
paymentDate: today,
|
|
250
|
+
paymentMethodTypeId: input.paymentMethodTypeId,
|
|
251
|
+
paymentMethodId: input.paymentMethodId,
|
|
252
|
+
bankAccountId: input.bankAccountId,
|
|
253
|
+
cardBrand: input.cardBrand,
|
|
254
|
+
cardInstallments: input.cardInstallments,
|
|
255
|
+
})
|
|
256
|
+
|
|
257
|
+
// 4. Return updated detail
|
|
258
|
+
return (await this.getPaymentDetail(invoiceId))!
|
|
259
|
+
},
|
|
260
|
+
|
|
261
|
+
async getPaymentMethodTypes() {
|
|
262
|
+
const types = await provider.getPaymentMethodTypes()
|
|
263
|
+
return types.map((t: any) => ({ id: t.id, name: t.name, transactionType: t.transactionType }))
|
|
264
|
+
},
|
|
265
|
+
|
|
266
|
+
async getBankAccounts() {
|
|
267
|
+
const accounts = await provider.getBankAccounts()
|
|
268
|
+
return accounts
|
|
269
|
+
.filter((a: any) => a.isActive)
|
|
270
|
+
.map((a: any) => ({ id: a.id, name: a.name, accountType: a.accountType }))
|
|
271
|
+
},
|
|
272
|
+
|
|
273
|
+
async getPaymentMethods(paymentMethodTypeId: string) {
|
|
274
|
+
const methods = await provider.getPaymentMethods()
|
|
275
|
+
return methods
|
|
276
|
+
.filter((m: any) => m.paymentMethodTypeId === paymentMethodTypeId && m.isActive)
|
|
277
|
+
.map((m: any) => ({ id: m.id, name: m.name }))
|
|
278
|
+
},
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
function mapInvoiceStatus(status: string): BookingPaymentStatus {
|
|
283
|
+
switch (status) {
|
|
284
|
+
case 'paid': return 'paid'
|
|
285
|
+
case 'partial': return 'partial'
|
|
286
|
+
case 'overdue': return 'overdue'
|
|
287
|
+
case 'cancelled': return 'cancelled'
|
|
288
|
+
case 'invoiced': return 'pending'
|
|
289
|
+
case 'pending': return 'pending'
|
|
290
|
+
case 'scheduled': return 'none'
|
|
291
|
+
case 'confirmed': return 'none'
|
|
292
|
+
case 'in_progress': return 'none'
|
|
293
|
+
case 'completed': return 'none'
|
|
294
|
+
case 'no_show': return 'none'
|
|
295
|
+
case 'booked': return 'none'
|
|
296
|
+
default: return 'pending'
|
|
297
|
+
}
|
|
298
|
+
}
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
/* Dark mode content background — uses the content token */
|
|
2
|
+
.dark .agenda-calendar,
|
|
3
|
+
.dark .agenda-calendar .fc,
|
|
4
|
+
.dark .agenda-calendar .fc-view-harness,
|
|
5
|
+
.dark .agenda-calendar .fc-timegrid,
|
|
6
|
+
.dark .agenda-calendar .fc-scrollgrid,
|
|
7
|
+
.dark .agenda-calendar .fc-timegrid-col,
|
|
8
|
+
.dark .agenda-calendar .fc-daygrid-body,
|
|
9
|
+
.dark .agenda-calendar .fc-timegrid-slot-lane {
|
|
10
|
+
background-color: hsl(var(--content));
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/* FullCalendar — Google Calendar inspired theme */
|
|
14
|
+
|
|
15
|
+
.agenda-calendar {
|
|
16
|
+
--fc-border-color: hsl(var(--border));
|
|
17
|
+
--fc-today-bg-color: transparent;
|
|
18
|
+
--fc-now-indicator-color: hsl(var(--destructive));
|
|
19
|
+
--fc-highlight-color: hsl(var(--primary) / 0.06);
|
|
20
|
+
--fc-non-business-color: hsl(var(--muted) / 0.15);
|
|
21
|
+
--fc-neutral-bg-color: transparent;
|
|
22
|
+
--fc-page-bg-color: transparent;
|
|
23
|
+
--fc-event-border-color: transparent;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.agenda-calendar .fc {
|
|
27
|
+
font-family: inherit;
|
|
28
|
+
background: transparent;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.agenda-calendar .fc .fc-view-harness {
|
|
32
|
+
background: transparent;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* ── Column headers ── */
|
|
36
|
+
.agenda-calendar .fc-col-header-cell {
|
|
37
|
+
background: transparent;
|
|
38
|
+
border-bottom: 1px solid var(--fc-border-color);
|
|
39
|
+
border-left: none;
|
|
40
|
+
border-right: none;
|
|
41
|
+
border-top: none;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.agenda-calendar .fc-col-header-cell-cushion {
|
|
45
|
+
padding: 8px 4px;
|
|
46
|
+
font-weight: 400;
|
|
47
|
+
font-size: 0.7rem;
|
|
48
|
+
color: hsl(var(--muted-foreground));
|
|
49
|
+
text-decoration: none;
|
|
50
|
+
text-transform: uppercase;
|
|
51
|
+
letter-spacing: 0.03em;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/* Today's column header */
|
|
55
|
+
.agenda-calendar .fc-day-today .fc-col-header-cell-cushion {
|
|
56
|
+
color: hsl(var(--primary));
|
|
57
|
+
font-weight: 600;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/* Resource header (professional columns) */
|
|
61
|
+
.agenda-calendar .fc .fc-resource-header {
|
|
62
|
+
background: transparent;
|
|
63
|
+
border-bottom: 1px solid var(--fc-border-color);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/* ── Time slots — compact ── */
|
|
67
|
+
.agenda-calendar .fc-timegrid-slot {
|
|
68
|
+
height: 1.5rem;
|
|
69
|
+
border-bottom: 1px solid hsl(var(--border) / 0.4);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.agenda-calendar .fc-timegrid-slot-label {
|
|
73
|
+
vertical-align: top;
|
|
74
|
+
border: none;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.agenda-calendar .fc-timegrid-slot-label-cushion {
|
|
78
|
+
font-size: 0.65rem;
|
|
79
|
+
color: hsl(var(--muted-foreground) / 0.7);
|
|
80
|
+
padding: 1px 8px 0 0;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/* Half-hour lines lighter */
|
|
84
|
+
.agenda-calendar .fc-timegrid-slot-minor {
|
|
85
|
+
border-bottom-style: none;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/* Column dividers */
|
|
89
|
+
.agenda-calendar .fc-timegrid-col {
|
|
90
|
+
border-right: 1px solid hsl(var(--border) / 0.5);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/* ── Events ── */
|
|
94
|
+
.agenda-calendar .fc-event {
|
|
95
|
+
border-radius: 4px;
|
|
96
|
+
border-width: 0;
|
|
97
|
+
border-left: 4px solid;
|
|
98
|
+
cursor: pointer;
|
|
99
|
+
transition: opacity 0.15s, box-shadow 0.15s;
|
|
100
|
+
font-size: 0.7rem;
|
|
101
|
+
line-height: 1.3;
|
|
102
|
+
margin: 0 2px;
|
|
103
|
+
overflow: hidden;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.agenda-calendar .fc-event:not(.fc-bg-event):hover {
|
|
107
|
+
opacity: 0.85;
|
|
108
|
+
box-shadow: 0 2px 6px rgba(0,0,0,0.12);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.agenda-calendar .fc-bg-event {
|
|
112
|
+
pointer-events: none;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/* ── Now indicator ── */
|
|
116
|
+
.agenda-calendar .fc-timegrid-now-indicator-line {
|
|
117
|
+
border-color: hsl(var(--destructive));
|
|
118
|
+
border-width: 2px;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.agenda-calendar .fc-timegrid-now-indicator-arrow {
|
|
122
|
+
border-top-color: hsl(var(--destructive));
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/* ── Month view ── */
|
|
126
|
+
.agenda-calendar .fc-daygrid-day-number {
|
|
127
|
+
font-size: 0.8rem;
|
|
128
|
+
padding: 4px 8px;
|
|
129
|
+
text-decoration: none;
|
|
130
|
+
color: hsl(var(--foreground));
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.agenda-calendar .fc-daygrid-day.fc-day-today .fc-daygrid-day-number {
|
|
134
|
+
background-color: hsl(var(--primary));
|
|
135
|
+
color: hsl(var(--primary-foreground));
|
|
136
|
+
border-radius: 50%;
|
|
137
|
+
width: 1.5rem;
|
|
138
|
+
height: 1.5rem;
|
|
139
|
+
display: flex;
|
|
140
|
+
align-items: center;
|
|
141
|
+
justify-content: center;
|
|
142
|
+
font-size: 0.75rem;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/* ── Selection ── */
|
|
146
|
+
.agenda-calendar .fc-highlight {
|
|
147
|
+
background: hsl(var(--primary) / 0.08);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/* ── Links ── */
|
|
151
|
+
.agenda-calendar .fc a {
|
|
152
|
+
text-decoration: none;
|
|
153
|
+
color: inherit;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/* ── Scrollbar ── */
|
|
157
|
+
.agenda-calendar .fc-scroller {
|
|
158
|
+
scrollbar-width: thin;
|
|
159
|
+
scrollbar-color: hsl(var(--muted-foreground) / 0.12) transparent;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.agenda-calendar .fc-scroller::-webkit-scrollbar {
|
|
163
|
+
width: 6px;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.agenda-calendar .fc-scroller::-webkit-scrollbar-track {
|
|
167
|
+
background: transparent;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.agenda-calendar .fc-scroller::-webkit-scrollbar-thumb {
|
|
171
|
+
background: hsl(var(--muted-foreground) / 0.12);
|
|
172
|
+
border-radius: 3px;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/* ── Clean up borders ── */
|
|
176
|
+
.agenda-calendar .fc .fc-timegrid {
|
|
177
|
+
border: none;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.agenda-calendar .fc-scrollgrid {
|
|
181
|
+
border: none !important;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.agenda-calendar .fc-scrollgrid td:last-child {
|
|
185
|
+
border-right: none;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/* ── Unavailable time background — opaque/disabled feel ── */
|
|
189
|
+
.agenda-calendar .fc-unavailable-bg {
|
|
190
|
+
background: hsl(var(--muted-foreground) / 0.08) !important;
|
|
191
|
+
background-image: repeating-linear-gradient(
|
|
192
|
+
45deg,
|
|
193
|
+
transparent,
|
|
194
|
+
transparent 4px,
|
|
195
|
+
hsl(var(--muted-foreground) / 0.04) 4px,
|
|
196
|
+
hsl(var(--muted-foreground) / 0.04) 8px
|
|
197
|
+
) !important;
|
|
198
|
+
border-radius: 0;
|
|
199
|
+
border-left: none !important;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/* ── Location label on schedule blocks ── */
|
|
203
|
+
.agenda-calendar .fc-location-label {
|
|
204
|
+
background: transparent !important;
|
|
205
|
+
border: none !important;
|
|
206
|
+
border-left-width: 0 !important;
|
|
207
|
+
cursor: default !important;
|
|
208
|
+
pointer-events: none;
|
|
209
|
+
box-shadow: none !important;
|
|
210
|
+
z-index: 1 !important;
|
|
211
|
+
margin: 0 4px !important;
|
|
212
|
+
font-weight: 500 !important;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.agenda-calendar .fc-location-label .fc-event-main {
|
|
216
|
+
padding: 0 !important;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/* Week view day header with date */
|
|
220
|
+
.agenda-calendar .fc-timegrid .fc-col-header-cell {
|
|
221
|
+
padding: 4px 0;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/* ── Alternating resource column backgrounds ── */
|
|
225
|
+
.agenda-calendar .fc-resource-alt {
|
|
226
|
+
background-color: hsl(var(--muted) / 0.4) !important;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.dark .agenda-calendar .fc-resource-alt {
|
|
230
|
+
background-color: hsl(var(--muted-foreground) / 0.08) !important;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/* Resource group header separator — stronger border between professionals */
|
|
234
|
+
.agenda-calendar .fc-resource-group {
|
|
235
|
+
border-left: 2px solid hsl(var(--border));
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/* Also stripe the resource header label for the alt group */
|
|
239
|
+
.agenda-calendar th.fc-resource-alt {
|
|
240
|
+
background-color: hsl(var(--muted) / 0.4) !important;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.dark .agenda-calendar th.fc-resource-alt {
|
|
244
|
+
background-color: hsl(var(--muted-foreground) / 0.06) !important;
|
|
245
|
+
}
|