@handled-ai/design-system 0.8.0 → 0.9.0
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 +14 -4
- package/dist/charts/bar-chart-component.d.ts +24 -0
- package/dist/charts/bar-chart-component.js +123 -0
- package/dist/charts/bar-chart-component.js.map +1 -0
- package/dist/charts/chart-tooltip.d.ts +26 -0
- package/dist/charts/chart-tooltip.js +69 -0
- package/dist/charts/chart-tooltip.js.map +1 -0
- package/dist/charts/chart.d.ts +64 -0
- package/dist/charts/chart.js +285 -0
- package/dist/charts/chart.js.map +1 -0
- package/dist/charts/donut-chart.d.ts +21 -0
- package/dist/charts/donut-chart.js +96 -0
- package/dist/charts/donut-chart.js.map +1 -0
- package/dist/charts/index.d.ts +11 -0
- package/dist/charts/index.js +10 -0
- package/dist/charts/index.js.map +1 -0
- package/dist/charts/pipeline-overview.d.ts +76 -0
- package/dist/charts/pipeline-overview.js +372 -0
- package/dist/charts/pipeline-overview.js.map +1 -0
- package/dist/charts/sankey-chart.d.ts +52 -0
- package/dist/charts/sankey-chart.js +219 -0
- package/dist/charts/sankey-chart.js.map +1 -0
- package/dist/charts/top-line-metrics.d.ts +26 -0
- package/dist/charts/top-line-metrics.js +224 -0
- package/dist/charts/top-line-metrics.js.map +1 -0
- package/dist/charts/trend-area-chart.d.ts +21 -0
- package/dist/charts/trend-area-chart.js +150 -0
- package/dist/charts/trend-area-chart.js.map +1 -0
- package/dist/charts/volume-analysis-chart.d.ts +19 -0
- package/dist/charts/volume-analysis-chart.js +121 -0
- package/dist/charts/volume-analysis-chart.js.map +1 -0
- package/dist/components/activity-detail.d.ts +38 -0
- package/dist/components/activity-detail.js +163 -0
- package/dist/components/activity-detail.js.map +1 -0
- package/dist/components/activity-log.d.ts +21 -0
- package/dist/components/activity-log.js +61 -0
- package/dist/components/activity-log.js.map +1 -0
- package/dist/components/agent-popover.d.ts +71 -0
- package/dist/components/agent-popover.js +282 -0
- package/dist/components/agent-popover.js.map +1 -0
- package/dist/components/agent-widget.d.ts +24 -0
- package/dist/components/agent-widget.js +117 -0
- package/dist/components/agent-widget.js.map +1 -0
- package/dist/components/avatar.d.ts +13 -0
- package/dist/components/avatar.js +140 -0
- package/dist/components/avatar.js.map +1 -0
- package/dist/components/badge.d.ts +12 -0
- package/dist/components/badge.js +75 -0
- package/dist/components/badge.js.map +1 -0
- package/dist/components/button.d.ts +13 -0
- package/dist/components/button.js +83 -0
- package/dist/components/button.js.map +1 -0
- package/dist/components/card.d.ts +11 -0
- package/dist/components/card.js +119 -0
- package/dist/components/card.js.map +1 -0
- package/dist/components/contact-list.d.ts +34 -0
- package/dist/components/contact-list.js +84 -0
- package/dist/components/contact-list.js.map +1 -0
- package/dist/components/dashboard-cards.d.ts +10 -0
- package/dist/components/dashboard-cards.js +164 -0
- package/dist/components/dashboard-cards.js.map +1 -0
- package/dist/components/data-table-display.d.ts +19 -0
- package/dist/components/data-table-display.js +109 -0
- package/dist/components/data-table-display.js.map +1 -0
- package/dist/components/data-table-filter.d.ts +18 -0
- package/dist/components/data-table-filter.js +107 -0
- package/dist/components/data-table-filter.js.map +1 -0
- package/dist/components/data-table-quick-views.d.ts +13 -0
- package/dist/components/data-table-quick-views.js +90 -0
- package/dist/components/data-table-quick-views.js.map +1 -0
- package/dist/components/data-table-toolbar.d.ts +18 -0
- package/dist/components/data-table-toolbar.js +45 -0
- package/dist/components/data-table-toolbar.js.map +1 -0
- package/dist/components/data-table.d.ts +39 -0
- package/dist/components/data-table.js +821 -0
- package/dist/components/data-table.js.map +1 -0
- package/dist/components/detail-view.d.ts +44 -0
- package/dist/components/detail-view.js +165 -0
- package/dist/components/detail-view.js.map +1 -0
- package/dist/components/dialog.d.ts +19 -0
- package/dist/components/dialog.js +188 -0
- package/dist/components/dialog.js.map +1 -0
- package/dist/components/dropdown-menu.d.ts +27 -0
- package/dist/components/dropdown-menu.js +279 -0
- package/dist/components/dropdown-menu.js.map +1 -0
- package/dist/components/entity-panel.d.ts +69 -0
- package/dist/components/entity-panel.js +584 -0
- package/dist/components/entity-panel.js.map +1 -0
- package/dist/components/inbox-row.d.ts +27 -0
- package/dist/components/inbox-row.js +139 -0
- package/dist/components/inbox-row.js.map +1 -0
- package/dist/components/inbox-toolbar.d.ts +21 -0
- package/dist/components/inbox-toolbar.js +203 -0
- package/dist/components/inbox-toolbar.js.map +1 -0
- package/dist/components/input.d.ts +5 -0
- package/dist/components/input.js +50 -0
- package/dist/components/input.js.map +1 -0
- package/dist/components/insights-filter-bar.d.ts +21 -0
- package/dist/components/insights-filter-bar.js +99 -0
- package/dist/components/insights-filter-bar.js.map +1 -0
- package/dist/components/item-list-display.d.ts +22 -0
- package/dist/components/item-list-display.js +240 -0
- package/dist/components/item-list-display.js.map +1 -0
- package/dist/components/item-list-filter.d.ts +16 -0
- package/dist/components/item-list-filter.js +87 -0
- package/dist/components/item-list-filter.js.map +1 -0
- package/dist/components/item-list-toolbar.d.ts +25 -0
- package/dist/components/item-list-toolbar.js +79 -0
- package/dist/components/item-list-toolbar.js.map +1 -0
- package/dist/components/item-list.d.ts +20 -0
- package/dist/components/item-list.js +702 -0
- package/dist/components/item-list.js.map +1 -0
- package/dist/components/label.d.ts +6 -0
- package/dist/components/label.js +55 -0
- package/dist/components/label.js.map +1 -0
- package/dist/components/message.d.ts +23 -0
- package/dist/components/message.js +117 -0
- package/dist/components/message.js.map +1 -0
- package/dist/components/metric-card.d.ts +25 -0
- package/dist/components/metric-card.js +107 -0
- package/dist/components/metric-card.js.map +1 -0
- package/dist/components/performance-metrics-table.d.ts +38 -0
- package/dist/components/performance-metrics-table.js +342 -0
- package/dist/components/performance-metrics-table.js.map +1 -0
- package/dist/components/preview-list.d.ts +14 -0
- package/dist/components/preview-list.js +83 -0
- package/dist/components/preview-list.js.map +1 -0
- package/dist/components/progress.d.ts +6 -0
- package/dist/components/progress.js +69 -0
- package/dist/components/progress.js.map +1 -0
- package/dist/components/quick-action-chat-area.d.ts +24 -0
- package/dist/components/quick-action-chat-area.js +178 -0
- package/dist/components/quick-action-chat-area.js.map +1 -0
- package/dist/components/quick-action-modal.d.ts +30 -0
- package/dist/components/quick-action-modal.js +288 -0
- package/dist/components/quick-action-modal.js.map +1 -0
- package/dist/components/quick-action-sidebar-nav.d.ts +51 -0
- package/dist/components/quick-action-sidebar-nav.js +528 -0
- package/dist/components/quick-action-sidebar-nav.js.map +1 -0
- package/dist/components/recommended-actions-section.d.ts +23 -0
- package/dist/components/recommended-actions-section.js +215 -0
- package/dist/components/recommended-actions-section.js.map +1 -0
- package/dist/components/report-card.d.ts +26 -0
- package/dist/components/report-card.js +69 -0
- package/dist/components/report-card.js.map +1 -0
- package/dist/components/score-analysis-modal.d.ts +26 -0
- package/dist/components/score-analysis-modal.js +141 -0
- package/dist/components/score-analysis-modal.js.map +1 -0
- package/dist/components/score-breakdown.d.ts +17 -0
- package/dist/components/score-breakdown.js +162 -0
- package/dist/components/score-breakdown.js.map +1 -0
- package/dist/components/score-feedback.d.ts +40 -0
- package/dist/components/score-feedback.js +209 -0
- package/dist/components/score-feedback.js.map +1 -0
- package/dist/components/score-ring.d.ts +14 -0
- package/dist/components/score-ring.js +79 -0
- package/dist/components/score-ring.js.map +1 -0
- package/dist/components/scroll-area.d.ts +7 -0
- package/dist/components/scroll-area.js +101 -0
- package/dist/components/scroll-area.js.map +1 -0
- package/dist/components/select.d.ts +17 -0
- package/dist/components/select.js +228 -0
- package/dist/components/select.js.map +1 -0
- package/dist/components/separator.d.ts +6 -0
- package/dist/components/separator.js +61 -0
- package/dist/components/separator.js.map +1 -0
- package/dist/components/sheet.d.ts +16 -0
- package/dist/components/sheet.js +168 -0
- package/dist/components/sheet.js.map +1 -0
- package/dist/components/sidebar.d.ts +73 -0
- package/dist/components/sidebar.js +723 -0
- package/dist/components/sidebar.js.map +1 -0
- package/dist/components/signal-feedback-inline.d.ts +51 -0
- package/dist/components/signal-feedback-inline.js +548 -0
- package/dist/components/signal-feedback-inline.js.map +1 -0
- package/dist/components/simple-data-table.d.ts +15 -0
- package/dist/components/simple-data-table.js +91 -0
- package/dist/components/simple-data-table.js.map +1 -0
- package/dist/components/skeleton.d.ts +5 -0
- package/dist/components/skeleton.js +44 -0
- package/dist/components/skeleton.js.map +1 -0
- package/dist/components/status-badge.d.ts +10 -0
- package/dist/components/status-badge.js +82 -0
- package/dist/components/status-badge.js.map +1 -0
- package/dist/components/styled-bar-list.d.ts +20 -0
- package/dist/components/styled-bar-list.js +59 -0
- package/dist/components/styled-bar-list.js.map +1 -0
- package/dist/components/suggested-actions.d.ts +110 -0
- package/dist/components/suggested-actions.js +1538 -0
- package/dist/components/suggested-actions.js.map +1 -0
- package/dist/components/table.d.ts +12 -0
- package/dist/components/table.js +147 -0
- package/dist/components/table.js.map +1 -0
- package/dist/components/tabs.d.ts +14 -0
- package/dist/components/tabs.js +129 -0
- package/dist/components/tabs.js.map +1 -0
- package/dist/components/textarea.d.ts +5 -0
- package/dist/components/textarea.js +47 -0
- package/dist/components/textarea.js.map +1 -0
- package/dist/components/timeline-activity.d.ts +34 -0
- package/dist/components/timeline-activity.js +181 -0
- package/dist/components/timeline-activity.js.map +1 -0
- package/dist/components/tooltip.d.ts +9 -0
- package/dist/components/tooltip.js +93 -0
- package/dist/components/tooltip.js.map +1 -0
- package/dist/components/view-mode-toggle.d.ts +16 -0
- package/dist/components/view-mode-toggle.js +24 -0
- package/dist/components/view-mode-toggle.js.map +1 -0
- package/dist/hooks/use-mobile.d.ts +3 -0
- package/dist/hooks/use-mobile.js +21 -0
- package/dist/hooks/use-mobile.js.map +1 -0
- package/dist/index.d.ts +68 -1878
- package/dist/index.js +69 -10918
- package/dist/index.js.map +1 -1
- package/dist/lib/icons.d.ts +18 -0
- package/dist/lib/icons.js +21 -0
- package/dist/lib/icons.js.map +1 -0
- package/dist/lib/utils.d.ts +5 -0
- package/dist/lib/utils.js +9 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/prototype/index.d.ts +20 -0
- package/dist/prototype/index.js +8 -0
- package/dist/prototype/index.js.map +1 -0
- package/dist/prototype/prototype-accounts-view.d.ts +22 -0
- package/dist/prototype/prototype-accounts-view.js +70 -0
- package/dist/prototype/prototype-accounts-view.js.map +1 -0
- package/dist/prototype/prototype-admin-view.d.ts +21 -0
- package/dist/prototype/prototype-admin-view.js +53 -0
- package/dist/prototype/prototype-admin-view.js.map +1 -0
- package/dist/prototype/prototype-config.d.ts +226 -0
- package/dist/prototype/prototype-config.js +1 -0
- package/dist/prototype/prototype-config.js.map +1 -0
- package/dist/prototype/prototype-inbox-view.d.ts +48 -0
- package/dist/prototype/prototype-inbox-view.js +701 -0
- package/dist/prototype/prototype-inbox-view.js.map +1 -0
- package/dist/prototype/prototype-insights-view.d.ts +23 -0
- package/dist/prototype/prototype-insights-view.js +335 -0
- package/dist/prototype/prototype-insights-view.js.map +1 -0
- package/dist/prototype/prototype-shell.d.ts +40 -0
- package/dist/prototype/prototype-shell.js +190 -0
- package/dist/prototype/prototype-shell.js.map +1 -0
- package/dist/prototype/prototype-work-queue-view.d.ts +8 -0
- package/dist/prototype/prototype-work-queue-view.js +17 -0
- package/dist/prototype/prototype-work-queue-view.js.map +1 -0
- package/dist/three/agent-orb.d.ts +39 -0
- package/dist/three/agent-orb.js +500 -0
- package/dist/three/agent-orb.js.map +1 -0
- package/dist/three/index.d.ts +2 -0
- package/dist/three/index.js +2 -0
- package/dist/three/index.js.map +1 -0
- package/package.json +98 -17
- package/src/charts/bar-chart-component.tsx +150 -0
- package/src/charts/chart-tooltip.tsx +86 -0
- package/src/charts/chart.tsx +371 -0
- package/src/charts/donut-chart.tsx +112 -0
- package/src/charts/index.ts +13 -0
- package/src/charts/pipeline-overview.tsx +476 -0
- package/src/charts/sankey-chart.tsx +290 -0
- package/src/charts/top-line-metrics.tsx +261 -0
- package/src/charts/trend-area-chart.tsx +150 -0
- package/src/charts/volume-analysis-chart.tsx +124 -0
- package/src/components/activity-detail.tsx +233 -0
- package/src/components/activity-log.tsx +89 -0
- package/src/components/agent-popover.tsx +373 -0
- package/src/components/agent-widget.tsx +163 -0
- package/src/components/avatar.tsx +109 -0
- package/src/components/badge.tsx +48 -0
- package/src/components/button.tsx +59 -0
- package/src/components/card.tsx +92 -0
- package/src/components/contact-list.tsx +121 -0
- package/src/components/dashboard-cards.tsx +170 -0
- package/src/components/data-table-display.tsx +139 -0
- package/src/components/data-table-filter.tsx +138 -0
- package/src/components/data-table-quick-views.tsx +103 -0
- package/src/components/data-table-toolbar.tsx +56 -0
- package/src/components/data-table.tsx +915 -0
- package/src/components/detail-view.tsx +237 -0
- package/src/components/dialog.tsx +158 -0
- package/src/components/dropdown-menu.tsx +257 -0
- package/src/components/entity-panel.tsx +767 -0
- package/src/components/inbox-row.tsx +132 -0
- package/src/components/inbox-toolbar.tsx +213 -0
- package/src/components/input.tsx +21 -0
- package/src/components/insights-filter-bar.tsx +132 -0
- package/src/components/item-list-display.tsx +278 -0
- package/src/components/item-list-filter.tsx +118 -0
- package/src/components/item-list-toolbar.tsx +97 -0
- package/src/components/item-list.tsx +843 -0
- package/src/components/label.tsx +24 -0
- package/src/components/message.tsx +83 -0
- package/src/components/metric-card.tsx +178 -0
- package/src/components/performance-metrics-table.tsx +442 -0
- package/src/components/preview-list.tsx +62 -0
- package/src/components/progress.tsx +31 -0
- package/src/components/quick-action-chat-area.tsx +156 -0
- package/src/components/quick-action-modal.tsx +331 -0
- package/src/components/quick-action-sidebar-nav.tsx +592 -0
- package/src/components/recommended-actions-section.tsx +258 -0
- package/src/components/report-card.tsx +106 -0
- package/src/components/score-analysis-modal.tsx +172 -0
- package/src/components/score-breakdown.tsx +179 -0
- package/src/components/score-feedback.tsx +288 -0
- package/src/components/score-ring.tsx +87 -0
- package/src/components/scroll-area.tsx +58 -0
- package/src/components/select.tsx +190 -0
- package/src/components/separator.tsx +28 -0
- package/src/components/sheet.tsx +143 -0
- package/src/components/sidebar.tsx +726 -0
- package/src/components/signal-feedback-inline.tsx +591 -0
- package/src/components/simple-data-table.tsx +124 -0
- package/src/components/skeleton.tsx +15 -0
- package/src/components/status-badge.tsx +63 -0
- package/src/components/styled-bar-list.tsx +70 -0
- package/src/components/suggested-actions.tsx +1985 -0
- package/src/components/table.tsx +116 -0
- package/src/components/tabs.tsx +91 -0
- package/src/components/textarea.tsx +18 -0
- package/src/components/timeline-activity.tsx +234 -0
- package/src/components/tooltip.tsx +57 -0
- package/src/components/view-mode-toggle.tsx +39 -0
- package/src/hooks/use-mobile.ts +21 -0
- package/src/index.ts +77 -0
- package/src/lib/icons.ts +18 -0
- package/src/lib/utils.ts +6 -0
- package/src/prototype/index.ts +11 -0
- package/src/prototype/prototype-accounts-view.tsx +112 -0
- package/src/prototype/prototype-admin-view.tsx +67 -0
- package/src/prototype/prototype-config.ts +243 -0
- package/src/prototype/prototype-inbox-view.tsx +810 -0
- package/src/prototype/prototype-insights-view.tsx +379 -0
- package/src/prototype/prototype-shell.tsx +219 -0
- package/src/prototype/prototype-work-queue-view.tsx +30 -0
- package/src/styles/globals.css +299 -0
- package/src/three/agent-orb.tsx +557 -0
- package/src/three/index.ts +5 -0
- package/src/types/r3f.d.ts +8 -0
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { X } from "lucide-react"
|
|
5
|
+
|
|
6
|
+
import { cn } from "../lib/utils"
|
|
7
|
+
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from "./dialog"
|
|
8
|
+
|
|
9
|
+
type TemplateIcon = React.ComponentType<{ className?: string }>
|
|
10
|
+
|
|
11
|
+
export interface QuickActionTemplate {
|
|
12
|
+
id: string
|
|
13
|
+
label: string
|
|
14
|
+
description: string
|
|
15
|
+
icon: TemplateIcon
|
|
16
|
+
category?: string
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export type QuickActionPriority = "normal" | "high" | "urgent"
|
|
20
|
+
|
|
21
|
+
export interface QuickActionTaskDraft {
|
|
22
|
+
templateId: string | null
|
|
23
|
+
message: string
|
|
24
|
+
priority: QuickActionPriority
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
interface QuickActionModalProps {
|
|
28
|
+
open: boolean
|
|
29
|
+
onOpenChange: (open: boolean) => void
|
|
30
|
+
templates?: QuickActionTemplate[]
|
|
31
|
+
title?: string
|
|
32
|
+
description?: string
|
|
33
|
+
className?: string
|
|
34
|
+
onCreateTask?: (draft: QuickActionTaskDraft) => void
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const DEFAULT_TEMPLATES: QuickActionTemplate[] = [
|
|
38
|
+
{
|
|
39
|
+
id: "call_patient",
|
|
40
|
+
label: "Call Patient",
|
|
41
|
+
icon: ({ className }) => (
|
|
42
|
+
<svg className={className} fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
43
|
+
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z" />
|
|
44
|
+
</svg>
|
|
45
|
+
),
|
|
46
|
+
description: "Schedule or log a call",
|
|
47
|
+
category: "communication",
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
id: "call_provider",
|
|
51
|
+
label: "Call Provider",
|
|
52
|
+
icon: ({ className }) => (
|
|
53
|
+
<svg className={className} fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
54
|
+
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4" />
|
|
55
|
+
</svg>
|
|
56
|
+
),
|
|
57
|
+
description: "Contact referring office",
|
|
58
|
+
category: "communication",
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
id: "call_payer",
|
|
62
|
+
label: "Call Payer",
|
|
63
|
+
icon: ({ className }) => (
|
|
64
|
+
<svg className={className} fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
65
|
+
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z" />
|
|
66
|
+
</svg>
|
|
67
|
+
),
|
|
68
|
+
description: "Verify benefits or status",
|
|
69
|
+
category: "admin",
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
id: "send_fax",
|
|
73
|
+
label: "Send Fax",
|
|
74
|
+
icon: ({ className }) => (
|
|
75
|
+
<svg className={className} fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
76
|
+
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
|
|
77
|
+
</svg>
|
|
78
|
+
),
|
|
79
|
+
description: "Request records or auth",
|
|
80
|
+
category: "communication",
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
id: "verify_benefits",
|
|
84
|
+
label: "Verify Benefits",
|
|
85
|
+
icon: ({ className }) => (
|
|
86
|
+
<svg className={className} fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
87
|
+
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" />
|
|
88
|
+
</svg>
|
|
89
|
+
),
|
|
90
|
+
description: "Check eligibility status",
|
|
91
|
+
category: "admin",
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
id: "create_referral",
|
|
95
|
+
label: "New Referral",
|
|
96
|
+
icon: ({ className }) => (
|
|
97
|
+
<svg className={className} fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
98
|
+
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01" />
|
|
99
|
+
</svg>
|
|
100
|
+
),
|
|
101
|
+
description: "Process incoming referral",
|
|
102
|
+
category: "clinical",
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
id: "manual_task",
|
|
106
|
+
label: "Manual Task",
|
|
107
|
+
icon: ({ className }) => (
|
|
108
|
+
<svg className={className} fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
109
|
+
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" />
|
|
110
|
+
</svg>
|
|
111
|
+
),
|
|
112
|
+
description: "Create a custom to-do",
|
|
113
|
+
category: "admin",
|
|
114
|
+
},
|
|
115
|
+
]
|
|
116
|
+
|
|
117
|
+
export function QuickActionModal({
|
|
118
|
+
open,
|
|
119
|
+
onOpenChange,
|
|
120
|
+
templates = DEFAULT_TEMPLATES,
|
|
121
|
+
title = "Quick Action",
|
|
122
|
+
description = "Choose a template or describe your task below.",
|
|
123
|
+
className,
|
|
124
|
+
onCreateTask,
|
|
125
|
+
}: QuickActionModalProps) {
|
|
126
|
+
const [freeformText, setFreeformText] = React.useState("")
|
|
127
|
+
const [selectedPriority, setSelectedPriority] = React.useState<QuickActionPriority>("normal")
|
|
128
|
+
const inputRef = React.useRef<HTMLInputElement>(null)
|
|
129
|
+
|
|
130
|
+
React.useEffect(() => {
|
|
131
|
+
if (open) {
|
|
132
|
+
setFreeformText("")
|
|
133
|
+
setSelectedPriority("normal")
|
|
134
|
+
setTimeout(() => inputRef.current?.focus(), 100)
|
|
135
|
+
}
|
|
136
|
+
}, [open])
|
|
137
|
+
|
|
138
|
+
const handleTemplateClick = React.useCallback(
|
|
139
|
+
(template: QuickActionTemplate) => {
|
|
140
|
+
onCreateTask?.({
|
|
141
|
+
templateId: template.id,
|
|
142
|
+
message: "",
|
|
143
|
+
priority: "normal",
|
|
144
|
+
})
|
|
145
|
+
onOpenChange(false)
|
|
146
|
+
},
|
|
147
|
+
[onCreateTask, onOpenChange],
|
|
148
|
+
)
|
|
149
|
+
|
|
150
|
+
const handleFreeformSubmit = React.useCallback(
|
|
151
|
+
(e?: React.FormEvent) => {
|
|
152
|
+
e?.preventDefault()
|
|
153
|
+
if (!freeformText.trim()) return
|
|
154
|
+
|
|
155
|
+
onCreateTask?.({
|
|
156
|
+
templateId: null,
|
|
157
|
+
message: freeformText.trim(),
|
|
158
|
+
priority: selectedPriority,
|
|
159
|
+
})
|
|
160
|
+
onOpenChange(false)
|
|
161
|
+
},
|
|
162
|
+
[freeformText, selectedPriority, onCreateTask, onOpenChange],
|
|
163
|
+
)
|
|
164
|
+
|
|
165
|
+
return (
|
|
166
|
+
<Dialog open={open} onOpenChange={onOpenChange}>
|
|
167
|
+
<DialogContent
|
|
168
|
+
showCloseButton={false}
|
|
169
|
+
className={cn(
|
|
170
|
+
"flex max-h-[85vh] flex-col gap-0 overflow-hidden rounded-2xl border border-border bg-card p-0 shadow-2xl sm:max-w-2xl",
|
|
171
|
+
className,
|
|
172
|
+
)}
|
|
173
|
+
>
|
|
174
|
+
<DialogHeader className="sr-only">
|
|
175
|
+
<DialogTitle>{title}</DialogTitle>
|
|
176
|
+
<DialogDescription>{description}</DialogDescription>
|
|
177
|
+
</DialogHeader>
|
|
178
|
+
|
|
179
|
+
<div className="min-h-0 flex-1 overflow-y-auto">
|
|
180
|
+
{/* Header */}
|
|
181
|
+
<div className="relative pt-8 px-6 text-center">
|
|
182
|
+
<button
|
|
183
|
+
type="button"
|
|
184
|
+
onClick={() => onOpenChange(false)}
|
|
185
|
+
className="absolute top-4 right-4 p-2 text-muted-foreground hover:text-foreground transition-colors rounded-full hover:bg-muted/50"
|
|
186
|
+
aria-label="Close"
|
|
187
|
+
>
|
|
188
|
+
<X className="w-5 h-5" />
|
|
189
|
+
</button>
|
|
190
|
+
|
|
191
|
+
<div className="absolute top-6 left-6 flex items-center gap-2">
|
|
192
|
+
<div className="w-5 h-5 rounded flex items-center justify-center bg-muted/80">
|
|
193
|
+
<svg
|
|
194
|
+
className="w-3 h-3 text-muted-foreground"
|
|
195
|
+
fill="none"
|
|
196
|
+
viewBox="0 0 24 24"
|
|
197
|
+
stroke="currentColor"
|
|
198
|
+
>
|
|
199
|
+
<path
|
|
200
|
+
strokeLinecap="round"
|
|
201
|
+
strokeLinejoin="round"
|
|
202
|
+
strokeWidth={2}
|
|
203
|
+
d="M13 10V3L4 14h7v7l9-11h-7z"
|
|
204
|
+
/>
|
|
205
|
+
</svg>
|
|
206
|
+
</div>
|
|
207
|
+
<span className="text-sm font-semibold text-foreground/80">{title}</span>
|
|
208
|
+
</div>
|
|
209
|
+
|
|
210
|
+
<div className="mt-12 mb-8">
|
|
211
|
+
<h3 className="text-2xl font-bold text-foreground tracking-tight">
|
|
212
|
+
Let's knock something off your list
|
|
213
|
+
</h3>
|
|
214
|
+
<p className="mt-2 text-sm text-muted-foreground">{description}</p>
|
|
215
|
+
</div>
|
|
216
|
+
</div>
|
|
217
|
+
|
|
218
|
+
{/* Template Grid */}
|
|
219
|
+
<div className="px-6 pb-6 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3">
|
|
220
|
+
{templates.map((template) => (
|
|
221
|
+
<button
|
|
222
|
+
key={template.id}
|
|
223
|
+
type="button"
|
|
224
|
+
onClick={() => handleTemplateClick(template)}
|
|
225
|
+
className="flex flex-col items-start gap-3 p-5 min-h-[9.5rem] rounded-xl border border-border bg-card hover:border-primary/20 hover:shadow-md hover:translate-y-[-1px] transition-all text-left group relative"
|
|
226
|
+
>
|
|
227
|
+
<div className="p-2 rounded-lg bg-muted/50 group-hover:bg-primary/5 transition-colors">
|
|
228
|
+
<template.icon className="w-5 h-5 text-muted-foreground group-hover:text-primary transition-colors" />
|
|
229
|
+
</div>
|
|
230
|
+
<div className="relative z-10 w-full">
|
|
231
|
+
<span className="block text-sm font-semibold text-foreground mb-1">
|
|
232
|
+
{template.label}
|
|
233
|
+
</span>
|
|
234
|
+
<span className="block text-xs text-muted-foreground leading-tight">
|
|
235
|
+
{template.description}
|
|
236
|
+
</span>
|
|
237
|
+
</div>
|
|
238
|
+
</button>
|
|
239
|
+
))}
|
|
240
|
+
</div>
|
|
241
|
+
</div>
|
|
242
|
+
|
|
243
|
+
{/* Freeform Input */}
|
|
244
|
+
<form
|
|
245
|
+
onSubmit={handleFreeformSubmit}
|
|
246
|
+
className="shrink-0 p-6 bg-muted/5 border-t border-border"
|
|
247
|
+
>
|
|
248
|
+
<div className="relative flex flex-col gap-2 rounded-xl border border-border bg-background p-2 shadow-sm focus-within:ring-2 focus-within:ring-primary/10 focus-within:border-primary/50 transition-all">
|
|
249
|
+
<input
|
|
250
|
+
ref={inputRef}
|
|
251
|
+
type="text"
|
|
252
|
+
value={freeformText}
|
|
253
|
+
onChange={(e) => setFreeformText(e.target.value)}
|
|
254
|
+
onKeyDown={(e) => {
|
|
255
|
+
if (e.key === "Enter" && !e.shiftKey) {
|
|
256
|
+
e.preventDefault()
|
|
257
|
+
handleFreeformSubmit()
|
|
258
|
+
}
|
|
259
|
+
}}
|
|
260
|
+
placeholder="How can I help you today?"
|
|
261
|
+
className="w-full bg-transparent px-4 py-3 text-sm text-foreground placeholder-muted-foreground focus:outline-none"
|
|
262
|
+
/>
|
|
263
|
+
|
|
264
|
+
<div className="flex items-center justify-between pt-2 px-2 pb-2 border-t border-border/50 mt-1">
|
|
265
|
+
<div className="flex items-center gap-2">
|
|
266
|
+
<button
|
|
267
|
+
type="button"
|
|
268
|
+
className="p-1.5 text-muted-foreground hover:text-foreground hover:bg-muted rounded-md transition-colors"
|
|
269
|
+
title="Add attachment"
|
|
270
|
+
>
|
|
271
|
+
<svg
|
|
272
|
+
className="w-4 h-4"
|
|
273
|
+
fill="none"
|
|
274
|
+
stroke="currentColor"
|
|
275
|
+
viewBox="0 0 24 24"
|
|
276
|
+
>
|
|
277
|
+
<path
|
|
278
|
+
strokeLinecap="round"
|
|
279
|
+
strokeLinejoin="round"
|
|
280
|
+
strokeWidth={2}
|
|
281
|
+
d="M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13"
|
|
282
|
+
/>
|
|
283
|
+
</svg>
|
|
284
|
+
</button>
|
|
285
|
+
<div className="h-4 w-px bg-border mx-1" />
|
|
286
|
+
<select
|
|
287
|
+
value={selectedPriority}
|
|
288
|
+
onChange={(e) =>
|
|
289
|
+
setSelectedPriority(e.target.value as QuickActionPriority)
|
|
290
|
+
}
|
|
291
|
+
className="flex items-center gap-1.5 px-2 py-1 text-xs font-medium text-muted-foreground hover:text-foreground hover:bg-muted rounded-md transition-colors bg-transparent cursor-pointer border-none outline-none"
|
|
292
|
+
aria-label="Priority"
|
|
293
|
+
>
|
|
294
|
+
<option value="normal">Normal</option>
|
|
295
|
+
<option value="high">High</option>
|
|
296
|
+
<option value="urgent">Urgent</option>
|
|
297
|
+
</select>
|
|
298
|
+
</div>
|
|
299
|
+
|
|
300
|
+
<div className="flex items-center gap-3">
|
|
301
|
+
<span className="text-[10px] text-muted-foreground font-medium hidden sm:inline-block opacity-70">
|
|
302
|
+
Press <kbd className="font-sans">↵</kbd> to create
|
|
303
|
+
</span>
|
|
304
|
+
<button
|
|
305
|
+
type="submit"
|
|
306
|
+
disabled={!freeformText.trim()}
|
|
307
|
+
className="flex items-center gap-1.5 rounded-lg bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-50 disabled:cursor-not-allowed transition-all shadow-sm"
|
|
308
|
+
>
|
|
309
|
+
Create
|
|
310
|
+
<svg
|
|
311
|
+
className="w-3 h-3"
|
|
312
|
+
fill="none"
|
|
313
|
+
stroke="currentColor"
|
|
314
|
+
viewBox="0 0 24 24"
|
|
315
|
+
>
|
|
316
|
+
<path
|
|
317
|
+
strokeLinecap="round"
|
|
318
|
+
strokeLinejoin="round"
|
|
319
|
+
strokeWidth={2}
|
|
320
|
+
d="M5 10l7-7m0 0l7 7m-7-7v18"
|
|
321
|
+
/>
|
|
322
|
+
</svg>
|
|
323
|
+
</button>
|
|
324
|
+
</div>
|
|
325
|
+
</div>
|
|
326
|
+
</div>
|
|
327
|
+
</form>
|
|
328
|
+
</DialogContent>
|
|
329
|
+
</Dialog>
|
|
330
|
+
)
|
|
331
|
+
}
|