@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,178 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
"use client";
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __defProps = Object.defineProperties;
|
|
6
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
10
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
+
var __spreadValues = (a, b) => {
|
|
12
|
+
for (var prop in b || (b = {}))
|
|
13
|
+
if (__hasOwnProp.call(b, prop))
|
|
14
|
+
__defNormalProp(a, prop, b[prop]);
|
|
15
|
+
if (__getOwnPropSymbols)
|
|
16
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
17
|
+
if (__propIsEnum.call(b, prop))
|
|
18
|
+
__defNormalProp(a, prop, b[prop]);
|
|
19
|
+
}
|
|
20
|
+
return a;
|
|
21
|
+
};
|
|
22
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
23
|
+
var __objRest = (source, exclude) => {
|
|
24
|
+
var target = {};
|
|
25
|
+
for (var prop in source)
|
|
26
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
27
|
+
target[prop] = source[prop];
|
|
28
|
+
if (source != null && __getOwnPropSymbols)
|
|
29
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
30
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
31
|
+
target[prop] = source[prop];
|
|
32
|
+
}
|
|
33
|
+
return target;
|
|
34
|
+
};
|
|
35
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
36
|
+
import * as React from "react";
|
|
37
|
+
import { ArrowUp, Paperclip } from "lucide-react";
|
|
38
|
+
import { cn } from "../lib/utils.js";
|
|
39
|
+
import { Button } from "./button.js";
|
|
40
|
+
function QuickActionChatArea(_a) {
|
|
41
|
+
var _b = _a, {
|
|
42
|
+
className,
|
|
43
|
+
placeholder = "How can I help you today?",
|
|
44
|
+
submitLabel = "Create Task",
|
|
45
|
+
value,
|
|
46
|
+
defaultValue = "",
|
|
47
|
+
onValueChange,
|
|
48
|
+
priority,
|
|
49
|
+
defaultPriority = "normal",
|
|
50
|
+
onPriorityChange,
|
|
51
|
+
onSubmit,
|
|
52
|
+
allowEmptySubmit = false,
|
|
53
|
+
clearOnSubmit = true,
|
|
54
|
+
showEnterHint = true
|
|
55
|
+
} = _b, props = __objRest(_b, [
|
|
56
|
+
"className",
|
|
57
|
+
"placeholder",
|
|
58
|
+
"submitLabel",
|
|
59
|
+
"value",
|
|
60
|
+
"defaultValue",
|
|
61
|
+
"onValueChange",
|
|
62
|
+
"priority",
|
|
63
|
+
"defaultPriority",
|
|
64
|
+
"onPriorityChange",
|
|
65
|
+
"onSubmit",
|
|
66
|
+
"allowEmptySubmit",
|
|
67
|
+
"clearOnSubmit",
|
|
68
|
+
"showEnterHint"
|
|
69
|
+
]);
|
|
70
|
+
const [internalValue, setInternalValue] = React.useState(defaultValue);
|
|
71
|
+
const [internalPriority, setInternalPriority] = React.useState(defaultPriority);
|
|
72
|
+
const composerValue = value != null ? value : internalValue;
|
|
73
|
+
const selectedPriority = priority != null ? priority : internalPriority;
|
|
74
|
+
const setComposerValue = React.useCallback(
|
|
75
|
+
(nextValue) => {
|
|
76
|
+
if (value === void 0) {
|
|
77
|
+
setInternalValue(nextValue);
|
|
78
|
+
}
|
|
79
|
+
onValueChange == null ? void 0 : onValueChange(nextValue);
|
|
80
|
+
},
|
|
81
|
+
[onValueChange, value]
|
|
82
|
+
);
|
|
83
|
+
const setPriorityValue = React.useCallback(
|
|
84
|
+
(nextPriority) => {
|
|
85
|
+
if (priority === void 0) {
|
|
86
|
+
setInternalPriority(nextPriority);
|
|
87
|
+
}
|
|
88
|
+
onPriorityChange == null ? void 0 : onPriorityChange(nextPriority);
|
|
89
|
+
},
|
|
90
|
+
[onPriorityChange, priority]
|
|
91
|
+
);
|
|
92
|
+
const canSubmit = allowEmptySubmit || composerValue.trim().length > 0;
|
|
93
|
+
const handleSubmit = React.useCallback(() => {
|
|
94
|
+
if (!canSubmit) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
onSubmit({
|
|
98
|
+
message: composerValue,
|
|
99
|
+
priority: selectedPriority
|
|
100
|
+
});
|
|
101
|
+
if (clearOnSubmit) {
|
|
102
|
+
setComposerValue("");
|
|
103
|
+
}
|
|
104
|
+
}, [canSubmit, clearOnSubmit, composerValue, onSubmit, selectedPriority, setComposerValue]);
|
|
105
|
+
return /* @__PURE__ */ jsx(
|
|
106
|
+
"div",
|
|
107
|
+
__spreadProps(__spreadValues({
|
|
108
|
+
className: cn("border-t border-border bg-background p-4", className)
|
|
109
|
+
}, props), {
|
|
110
|
+
children: /* @__PURE__ */ jsxs("div", { className: "mx-auto w-full max-w-2xl overflow-hidden rounded-md border border-border bg-background shadow-sm transition-all focus-within:border-[#1B4332] focus-within:ring-2 focus-within:ring-[#1B4332]/20", children: [
|
|
111
|
+
/* @__PURE__ */ jsx(
|
|
112
|
+
"textarea",
|
|
113
|
+
{
|
|
114
|
+
value: composerValue,
|
|
115
|
+
onChange: (event) => setComposerValue(event.target.value),
|
|
116
|
+
placeholder,
|
|
117
|
+
className: "min-h-[80px] w-full resize-none p-4 text-foreground outline-none placeholder:text-muted-foreground",
|
|
118
|
+
onKeyDown: (event) => {
|
|
119
|
+
if (event.key === "Enter" && !event.shiftKey) {
|
|
120
|
+
event.preventDefault();
|
|
121
|
+
handleSubmit();
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
),
|
|
126
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between border-t border-border bg-muted px-3 py-2", children: [
|
|
127
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
128
|
+
/* @__PURE__ */ jsx(
|
|
129
|
+
"button",
|
|
130
|
+
{
|
|
131
|
+
type: "button",
|
|
132
|
+
className: "rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",
|
|
133
|
+
title: "Attach file",
|
|
134
|
+
"aria-label": "Attach file",
|
|
135
|
+
children: /* @__PURE__ */ jsx(Paperclip, { className: "h-4 w-4" })
|
|
136
|
+
}
|
|
137
|
+
),
|
|
138
|
+
/* @__PURE__ */ jsx("div", { className: "mx-1 h-4 w-px bg-muted" }),
|
|
139
|
+
/* @__PURE__ */ jsxs(
|
|
140
|
+
"select",
|
|
141
|
+
{
|
|
142
|
+
value: selectedPriority,
|
|
143
|
+
onChange: (event) => setPriorityValue(event.target.value),
|
|
144
|
+
className: "cursor-pointer rounded-md bg-transparent px-2 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted",
|
|
145
|
+
"aria-label": "Task priority",
|
|
146
|
+
children: [
|
|
147
|
+
/* @__PURE__ */ jsx("option", { value: "normal", children: "Normal" }),
|
|
148
|
+
/* @__PURE__ */ jsx("option", { value: "high", children: "High" }),
|
|
149
|
+
/* @__PURE__ */ jsx("option", { value: "urgent", children: "Urgent" })
|
|
150
|
+
]
|
|
151
|
+
}
|
|
152
|
+
)
|
|
153
|
+
] }),
|
|
154
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
155
|
+
showEnterHint ? /* @__PURE__ */ jsx("span", { className: "hidden text-xs text-muted-foreground sm:inline", children: "Press \u23CE to create" }) : null,
|
|
156
|
+
/* @__PURE__ */ jsxs(
|
|
157
|
+
Button,
|
|
158
|
+
{
|
|
159
|
+
size: "sm",
|
|
160
|
+
onClick: handleSubmit,
|
|
161
|
+
disabled: !canSubmit,
|
|
162
|
+
className: "gap-2 rounded-md bg-[#1B4332] text-white hover:bg-[#235742] disabled:cursor-not-allowed disabled:opacity-50",
|
|
163
|
+
children: [
|
|
164
|
+
submitLabel,
|
|
165
|
+
/* @__PURE__ */ jsx(ArrowUp, { className: "h-4 w-4" })
|
|
166
|
+
]
|
|
167
|
+
}
|
|
168
|
+
)
|
|
169
|
+
] })
|
|
170
|
+
] })
|
|
171
|
+
] })
|
|
172
|
+
})
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
export {
|
|
176
|
+
QuickActionChatArea
|
|
177
|
+
};
|
|
178
|
+
//# sourceMappingURL=quick-action-chat-area.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/quick-action-chat-area.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { ArrowUp, Paperclip } from \"lucide-react\"\n\nimport { cn } from \"../lib/utils\"\nimport { Button } from \"./button\"\n\nexport type QuickActionPriority = \"normal\" | \"high\" | \"urgent\"\n\nexport interface QuickActionSubmitPayload {\n message: string\n priority: QuickActionPriority\n}\n\ninterface QuickActionChatAreaProps\n extends Omit<React.ComponentProps<\"div\">, \"onSubmit\"> {\n placeholder?: string\n submitLabel?: string\n value?: string\n defaultValue?: string\n onValueChange?: (value: string) => void\n priority?: QuickActionPriority\n defaultPriority?: QuickActionPriority\n onPriorityChange?: (priority: QuickActionPriority) => void\n onSubmit: (payload: QuickActionSubmitPayload) => void\n allowEmptySubmit?: boolean\n clearOnSubmit?: boolean\n showEnterHint?: boolean\n}\n\nexport function QuickActionChatArea({\n className,\n placeholder = \"How can I help you today?\",\n submitLabel = \"Create Task\",\n value,\n defaultValue = \"\",\n onValueChange,\n priority,\n defaultPriority = \"normal\",\n onPriorityChange,\n onSubmit,\n allowEmptySubmit = false,\n clearOnSubmit = true,\n showEnterHint = true,\n ...props\n}: QuickActionChatAreaProps) {\n const [internalValue, setInternalValue] = React.useState(defaultValue)\n const [internalPriority, setInternalPriority] =\n React.useState<QuickActionPriority>(defaultPriority)\n\n const composerValue = value ?? internalValue\n const selectedPriority = priority ?? internalPriority\n\n const setComposerValue = React.useCallback(\n (nextValue: string) => {\n if (value === undefined) {\n setInternalValue(nextValue)\n }\n\n onValueChange?.(nextValue)\n },\n [onValueChange, value]\n )\n\n const setPriorityValue = React.useCallback(\n (nextPriority: QuickActionPriority) => {\n if (priority === undefined) {\n setInternalPriority(nextPriority)\n }\n\n onPriorityChange?.(nextPriority)\n },\n [onPriorityChange, priority]\n )\n\n const canSubmit = allowEmptySubmit || composerValue.trim().length > 0\n\n const handleSubmit = React.useCallback(() => {\n if (!canSubmit) {\n return\n }\n\n onSubmit({\n message: composerValue,\n priority: selectedPriority,\n })\n\n if (clearOnSubmit) {\n setComposerValue(\"\")\n }\n }, [canSubmit, clearOnSubmit, composerValue, onSubmit, selectedPriority, setComposerValue])\n\n return (\n <div\n className={cn(\"border-t border-border bg-background p-4\", className)}\n {...props}\n >\n <div className=\"mx-auto w-full max-w-2xl overflow-hidden rounded-md border border-border bg-background shadow-sm transition-all focus-within:border-[#1B4332] focus-within:ring-2 focus-within:ring-[#1B4332]/20\">\n <textarea\n value={composerValue}\n onChange={(event) => setComposerValue(event.target.value)}\n placeholder={placeholder}\n className=\"min-h-[80px] w-full resize-none p-4 text-foreground outline-none placeholder:text-muted-foreground\"\n onKeyDown={(event) => {\n if (event.key === \"Enter\" && !event.shiftKey) {\n event.preventDefault()\n handleSubmit()\n }\n }}\n />\n <div className=\"flex items-center justify-between border-t border-border bg-muted px-3 py-2\">\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n className=\"rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground\"\n title=\"Attach file\"\n aria-label=\"Attach file\"\n >\n <Paperclip className=\"h-4 w-4\" />\n </button>\n <div className=\"mx-1 h-4 w-px bg-muted\" />\n <select\n value={selectedPriority}\n onChange={(event) =>\n setPriorityValue(event.target.value as QuickActionPriority)\n }\n className=\"cursor-pointer rounded-md bg-transparent px-2 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted\"\n aria-label=\"Task priority\"\n >\n <option value=\"normal\">Normal</option>\n <option value=\"high\">High</option>\n <option value=\"urgent\">Urgent</option>\n </select>\n </div>\n <div className=\"flex items-center gap-3\">\n {showEnterHint ? (\n <span className=\"hidden text-xs text-muted-foreground sm:inline\">\n Press ⏎ to create\n </span>\n ) : null}\n <Button\n size=\"sm\"\n onClick={handleSubmit}\n disabled={!canSubmit}\n className=\"gap-2 rounded-md bg-[#1B4332] text-white hover:bg-[#235742] disabled:cursor-not-allowed disabled:opacity-50\"\n >\n {submitLabel}\n <ArrowUp className=\"h-4 w-4\" />\n </Button>\n </div>\n </div>\n </div>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmGQ,cAuBI,YAvBJ;AAjGR,YAAY,WAAW;AACvB,SAAS,SAAS,iBAAiB;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AAU,CAAC;AAAA,gBACX,WAAU;AAAA,gBAET;AAAA;AAAA,kBACD,oBAAC,WAAQ,WAAU,WAAU;AAAA;AAAA;AAAA,YAC/B;AAAA,aACF;AAAA,WACF;AAAA,SACF;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
type TemplateIcon = React.ComponentType<{
|
|
4
|
+
className?: string;
|
|
5
|
+
}>;
|
|
6
|
+
interface QuickActionTemplate {
|
|
7
|
+
id: string;
|
|
8
|
+
label: string;
|
|
9
|
+
description: string;
|
|
10
|
+
icon: TemplateIcon;
|
|
11
|
+
category?: string;
|
|
12
|
+
}
|
|
13
|
+
type QuickActionPriority = "normal" | "high" | "urgent";
|
|
14
|
+
interface QuickActionTaskDraft {
|
|
15
|
+
templateId: string | null;
|
|
16
|
+
message: string;
|
|
17
|
+
priority: QuickActionPriority;
|
|
18
|
+
}
|
|
19
|
+
interface QuickActionModalProps {
|
|
20
|
+
open: boolean;
|
|
21
|
+
onOpenChange: (open: boolean) => void;
|
|
22
|
+
templates?: QuickActionTemplate[];
|
|
23
|
+
title?: string;
|
|
24
|
+
description?: string;
|
|
25
|
+
className?: string;
|
|
26
|
+
onCreateTask?: (draft: QuickActionTaskDraft) => void;
|
|
27
|
+
}
|
|
28
|
+
declare function QuickActionModal({ open, onOpenChange, templates, title, description, className, onCreateTask, }: QuickActionModalProps): React.JSX.Element;
|
|
29
|
+
|
|
30
|
+
export { QuickActionModal, type QuickActionPriority, type QuickActionTaskDraft, type QuickActionTemplate };
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
"use client";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { X } from "lucide-react";
|
|
7
|
+
import { cn } from "../lib/utils.js";
|
|
8
|
+
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from "./dialog.js";
|
|
9
|
+
const DEFAULT_TEMPLATES = [
|
|
10
|
+
{
|
|
11
|
+
id: "call_patient",
|
|
12
|
+
label: "Call Patient",
|
|
13
|
+
icon: ({ className }) => /* @__PURE__ */ jsx("svg", { className, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("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" }) }),
|
|
14
|
+
description: "Schedule or log a call",
|
|
15
|
+
category: "communication"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
id: "call_provider",
|
|
19
|
+
label: "Call Provider",
|
|
20
|
+
icon: ({ className }) => /* @__PURE__ */ jsx("svg", { className, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("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" }) }),
|
|
21
|
+
description: "Contact referring office",
|
|
22
|
+
category: "communication"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
id: "call_payer",
|
|
26
|
+
label: "Call Payer",
|
|
27
|
+
icon: ({ className }) => /* @__PURE__ */ jsx("svg", { className, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("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" }) }),
|
|
28
|
+
description: "Verify benefits or status",
|
|
29
|
+
category: "admin"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
id: "send_fax",
|
|
33
|
+
label: "Send Fax",
|
|
34
|
+
icon: ({ className }) => /* @__PURE__ */ jsx("svg", { className, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("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" }) }),
|
|
35
|
+
description: "Request records or auth",
|
|
36
|
+
category: "communication"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
id: "verify_benefits",
|
|
40
|
+
label: "Verify Benefits",
|
|
41
|
+
icon: ({ className }) => /* @__PURE__ */ jsx("svg", { className, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" }) }),
|
|
42
|
+
description: "Check eligibility status",
|
|
43
|
+
category: "admin"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
id: "create_referral",
|
|
47
|
+
label: "New Referral",
|
|
48
|
+
icon: ({ className }) => /* @__PURE__ */ jsx("svg", { className, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("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" }) }),
|
|
49
|
+
description: "Process incoming referral",
|
|
50
|
+
category: "clinical"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
id: "manual_task",
|
|
54
|
+
label: "Manual Task",
|
|
55
|
+
icon: ({ className }) => /* @__PURE__ */ jsx("svg", { className, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" }) }),
|
|
56
|
+
description: "Create a custom to-do",
|
|
57
|
+
category: "admin"
|
|
58
|
+
}
|
|
59
|
+
];
|
|
60
|
+
function QuickActionModal({
|
|
61
|
+
open,
|
|
62
|
+
onOpenChange,
|
|
63
|
+
templates = DEFAULT_TEMPLATES,
|
|
64
|
+
title = "Quick Action",
|
|
65
|
+
description = "Choose a template or describe your task below.",
|
|
66
|
+
className,
|
|
67
|
+
onCreateTask
|
|
68
|
+
}) {
|
|
69
|
+
const [freeformText, setFreeformText] = React.useState("");
|
|
70
|
+
const [selectedPriority, setSelectedPriority] = React.useState("normal");
|
|
71
|
+
const inputRef = React.useRef(null);
|
|
72
|
+
React.useEffect(() => {
|
|
73
|
+
if (open) {
|
|
74
|
+
setFreeformText("");
|
|
75
|
+
setSelectedPriority("normal");
|
|
76
|
+
setTimeout(() => {
|
|
77
|
+
var _a;
|
|
78
|
+
return (_a = inputRef.current) == null ? void 0 : _a.focus();
|
|
79
|
+
}, 100);
|
|
80
|
+
}
|
|
81
|
+
}, [open]);
|
|
82
|
+
const handleTemplateClick = React.useCallback(
|
|
83
|
+
(template) => {
|
|
84
|
+
onCreateTask == null ? void 0 : onCreateTask({
|
|
85
|
+
templateId: template.id,
|
|
86
|
+
message: "",
|
|
87
|
+
priority: "normal"
|
|
88
|
+
});
|
|
89
|
+
onOpenChange(false);
|
|
90
|
+
},
|
|
91
|
+
[onCreateTask, onOpenChange]
|
|
92
|
+
);
|
|
93
|
+
const handleFreeformSubmit = React.useCallback(
|
|
94
|
+
(e) => {
|
|
95
|
+
e == null ? void 0 : e.preventDefault();
|
|
96
|
+
if (!freeformText.trim()) return;
|
|
97
|
+
onCreateTask == null ? void 0 : onCreateTask({
|
|
98
|
+
templateId: null,
|
|
99
|
+
message: freeformText.trim(),
|
|
100
|
+
priority: selectedPriority
|
|
101
|
+
});
|
|
102
|
+
onOpenChange(false);
|
|
103
|
+
},
|
|
104
|
+
[freeformText, selectedPriority, onCreateTask, onOpenChange]
|
|
105
|
+
);
|
|
106
|
+
return /* @__PURE__ */ jsx(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs(
|
|
107
|
+
DialogContent,
|
|
108
|
+
{
|
|
109
|
+
showCloseButton: false,
|
|
110
|
+
className: cn(
|
|
111
|
+
"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",
|
|
112
|
+
className
|
|
113
|
+
),
|
|
114
|
+
children: [
|
|
115
|
+
/* @__PURE__ */ jsxs(DialogHeader, { className: "sr-only", children: [
|
|
116
|
+
/* @__PURE__ */ jsx(DialogTitle, { children: title }),
|
|
117
|
+
/* @__PURE__ */ jsx(DialogDescription, { children: description })
|
|
118
|
+
] }),
|
|
119
|
+
/* @__PURE__ */ jsxs("div", { className: "min-h-0 flex-1 overflow-y-auto", children: [
|
|
120
|
+
/* @__PURE__ */ jsxs("div", { className: "relative pt-8 px-6 text-center", children: [
|
|
121
|
+
/* @__PURE__ */ jsx(
|
|
122
|
+
"button",
|
|
123
|
+
{
|
|
124
|
+
type: "button",
|
|
125
|
+
onClick: () => onOpenChange(false),
|
|
126
|
+
className: "absolute top-4 right-4 p-2 text-muted-foreground hover:text-foreground transition-colors rounded-full hover:bg-muted/50",
|
|
127
|
+
"aria-label": "Close",
|
|
128
|
+
children: /* @__PURE__ */ jsx(X, { className: "w-5 h-5" })
|
|
129
|
+
}
|
|
130
|
+
),
|
|
131
|
+
/* @__PURE__ */ jsxs("div", { className: "absolute top-6 left-6 flex items-center gap-2", children: [
|
|
132
|
+
/* @__PURE__ */ jsx("div", { className: "w-5 h-5 rounded flex items-center justify-center bg-muted/80", children: /* @__PURE__ */ jsx(
|
|
133
|
+
"svg",
|
|
134
|
+
{
|
|
135
|
+
className: "w-3 h-3 text-muted-foreground",
|
|
136
|
+
fill: "none",
|
|
137
|
+
viewBox: "0 0 24 24",
|
|
138
|
+
stroke: "currentColor",
|
|
139
|
+
children: /* @__PURE__ */ jsx(
|
|
140
|
+
"path",
|
|
141
|
+
{
|
|
142
|
+
strokeLinecap: "round",
|
|
143
|
+
strokeLinejoin: "round",
|
|
144
|
+
strokeWidth: 2,
|
|
145
|
+
d: "M13 10V3L4 14h7v7l9-11h-7z"
|
|
146
|
+
}
|
|
147
|
+
)
|
|
148
|
+
}
|
|
149
|
+
) }),
|
|
150
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-semibold text-foreground/80", children: title })
|
|
151
|
+
] }),
|
|
152
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-12 mb-8", children: [
|
|
153
|
+
/* @__PURE__ */ jsx("h3", { className: "text-2xl font-bold text-foreground tracking-tight", children: "Let's knock something off your list" }),
|
|
154
|
+
/* @__PURE__ */ jsx("p", { className: "mt-2 text-sm text-muted-foreground", children: description })
|
|
155
|
+
] })
|
|
156
|
+
] }),
|
|
157
|
+
/* @__PURE__ */ jsx("div", { className: "px-6 pb-6 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3", children: templates.map((template) => /* @__PURE__ */ jsxs(
|
|
158
|
+
"button",
|
|
159
|
+
{
|
|
160
|
+
type: "button",
|
|
161
|
+
onClick: () => handleTemplateClick(template),
|
|
162
|
+
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",
|
|
163
|
+
children: [
|
|
164
|
+
/* @__PURE__ */ jsx("div", { className: "p-2 rounded-lg bg-muted/50 group-hover:bg-primary/5 transition-colors", children: /* @__PURE__ */ jsx(template.icon, { className: "w-5 h-5 text-muted-foreground group-hover:text-primary transition-colors" }) }),
|
|
165
|
+
/* @__PURE__ */ jsxs("div", { className: "relative z-10 w-full", children: [
|
|
166
|
+
/* @__PURE__ */ jsx("span", { className: "block text-sm font-semibold text-foreground mb-1", children: template.label }),
|
|
167
|
+
/* @__PURE__ */ jsx("span", { className: "block text-xs text-muted-foreground leading-tight", children: template.description })
|
|
168
|
+
] })
|
|
169
|
+
]
|
|
170
|
+
},
|
|
171
|
+
template.id
|
|
172
|
+
)) })
|
|
173
|
+
] }),
|
|
174
|
+
/* @__PURE__ */ jsx(
|
|
175
|
+
"form",
|
|
176
|
+
{
|
|
177
|
+
onSubmit: handleFreeformSubmit,
|
|
178
|
+
className: "shrink-0 p-6 bg-muted/5 border-t border-border",
|
|
179
|
+
children: /* @__PURE__ */ jsxs("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", children: [
|
|
180
|
+
/* @__PURE__ */ jsx(
|
|
181
|
+
"input",
|
|
182
|
+
{
|
|
183
|
+
ref: inputRef,
|
|
184
|
+
type: "text",
|
|
185
|
+
value: freeformText,
|
|
186
|
+
onChange: (e) => setFreeformText(e.target.value),
|
|
187
|
+
onKeyDown: (e) => {
|
|
188
|
+
if (e.key === "Enter" && !e.shiftKey) {
|
|
189
|
+
e.preventDefault();
|
|
190
|
+
handleFreeformSubmit();
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
placeholder: "How can I help you today?",
|
|
194
|
+
className: "w-full bg-transparent px-4 py-3 text-sm text-foreground placeholder-muted-foreground focus:outline-none"
|
|
195
|
+
}
|
|
196
|
+
),
|
|
197
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between pt-2 px-2 pb-2 border-t border-border/50 mt-1", children: [
|
|
198
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
199
|
+
/* @__PURE__ */ jsx(
|
|
200
|
+
"button",
|
|
201
|
+
{
|
|
202
|
+
type: "button",
|
|
203
|
+
className: "p-1.5 text-muted-foreground hover:text-foreground hover:bg-muted rounded-md transition-colors",
|
|
204
|
+
title: "Add attachment",
|
|
205
|
+
children: /* @__PURE__ */ jsx(
|
|
206
|
+
"svg",
|
|
207
|
+
{
|
|
208
|
+
className: "w-4 h-4",
|
|
209
|
+
fill: "none",
|
|
210
|
+
stroke: "currentColor",
|
|
211
|
+
viewBox: "0 0 24 24",
|
|
212
|
+
children: /* @__PURE__ */ jsx(
|
|
213
|
+
"path",
|
|
214
|
+
{
|
|
215
|
+
strokeLinecap: "round",
|
|
216
|
+
strokeLinejoin: "round",
|
|
217
|
+
strokeWidth: 2,
|
|
218
|
+
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"
|
|
219
|
+
}
|
|
220
|
+
)
|
|
221
|
+
}
|
|
222
|
+
)
|
|
223
|
+
}
|
|
224
|
+
),
|
|
225
|
+
/* @__PURE__ */ jsx("div", { className: "h-4 w-px bg-border mx-1" }),
|
|
226
|
+
/* @__PURE__ */ jsxs(
|
|
227
|
+
"select",
|
|
228
|
+
{
|
|
229
|
+
value: selectedPriority,
|
|
230
|
+
onChange: (e) => setSelectedPriority(e.target.value),
|
|
231
|
+
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",
|
|
232
|
+
"aria-label": "Priority",
|
|
233
|
+
children: [
|
|
234
|
+
/* @__PURE__ */ jsx("option", { value: "normal", children: "Normal" }),
|
|
235
|
+
/* @__PURE__ */ jsx("option", { value: "high", children: "High" }),
|
|
236
|
+
/* @__PURE__ */ jsx("option", { value: "urgent", children: "Urgent" })
|
|
237
|
+
]
|
|
238
|
+
}
|
|
239
|
+
)
|
|
240
|
+
] }),
|
|
241
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
242
|
+
/* @__PURE__ */ jsxs("span", { className: "text-[10px] text-muted-foreground font-medium hidden sm:inline-block opacity-70", children: [
|
|
243
|
+
"Press ",
|
|
244
|
+
/* @__PURE__ */ jsx("kbd", { className: "font-sans", children: "\u21B5" }),
|
|
245
|
+
" to create"
|
|
246
|
+
] }),
|
|
247
|
+
/* @__PURE__ */ jsxs(
|
|
248
|
+
"button",
|
|
249
|
+
{
|
|
250
|
+
type: "submit",
|
|
251
|
+
disabled: !freeformText.trim(),
|
|
252
|
+
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",
|
|
253
|
+
children: [
|
|
254
|
+
"Create",
|
|
255
|
+
/* @__PURE__ */ jsx(
|
|
256
|
+
"svg",
|
|
257
|
+
{
|
|
258
|
+
className: "w-3 h-3",
|
|
259
|
+
fill: "none",
|
|
260
|
+
stroke: "currentColor",
|
|
261
|
+
viewBox: "0 0 24 24",
|
|
262
|
+
children: /* @__PURE__ */ jsx(
|
|
263
|
+
"path",
|
|
264
|
+
{
|
|
265
|
+
strokeLinecap: "round",
|
|
266
|
+
strokeLinejoin: "round",
|
|
267
|
+
strokeWidth: 2,
|
|
268
|
+
d: "M5 10l7-7m0 0l7 7m-7-7v18"
|
|
269
|
+
}
|
|
270
|
+
)
|
|
271
|
+
}
|
|
272
|
+
)
|
|
273
|
+
]
|
|
274
|
+
}
|
|
275
|
+
)
|
|
276
|
+
] })
|
|
277
|
+
] })
|
|
278
|
+
] })
|
|
279
|
+
}
|
|
280
|
+
)
|
|
281
|
+
]
|
|
282
|
+
}
|
|
283
|
+
) });
|
|
284
|
+
}
|
|
285
|
+
export {
|
|
286
|
+
QuickActionModal
|
|
287
|
+
};
|
|
288
|
+
//# sourceMappingURL=quick-action-modal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/quick-action-modal.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { X } from \"lucide-react\"\n\nimport { cn } from \"../lib/utils\"\nimport { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from \"./dialog\"\n\ntype TemplateIcon = React.ComponentType<{ className?: string }>\n\nexport interface QuickActionTemplate {\n id: string\n label: string\n description: string\n icon: TemplateIcon\n category?: string\n}\n\nexport type QuickActionPriority = \"normal\" | \"high\" | \"urgent\"\n\nexport interface QuickActionTaskDraft {\n templateId: string | null\n message: string\n priority: QuickActionPriority\n}\n\ninterface QuickActionModalProps {\n open: boolean\n onOpenChange: (open: boolean) => void\n templates?: QuickActionTemplate[]\n title?: string\n description?: string\n className?: string\n onCreateTask?: (draft: QuickActionTaskDraft) => void\n}\n\nconst DEFAULT_TEMPLATES: QuickActionTemplate[] = [\n {\n id: \"call_patient\",\n label: \"Call Patient\",\n icon: ({ className }) => (\n <svg className={className} fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <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\" />\n </svg>\n ),\n description: \"Schedule or log a call\",\n category: \"communication\",\n },\n {\n id: \"call_provider\",\n label: \"Call Provider\",\n icon: ({ className }) => (\n <svg className={className} fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <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\" />\n </svg>\n ),\n description: \"Contact referring office\",\n category: \"communication\",\n },\n {\n id: \"call_payer\",\n label: \"Call Payer\",\n icon: ({ className }) => (\n <svg className={className} fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <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\" />\n </svg>\n ),\n description: \"Verify benefits or status\",\n category: \"admin\",\n },\n {\n id: \"send_fax\",\n label: \"Send Fax\",\n icon: ({ className }) => (\n <svg className={className} fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <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\" />\n </svg>\n ),\n description: \"Request records or auth\",\n category: \"communication\",\n },\n {\n id: \"verify_benefits\",\n label: \"Verify Benefits\",\n icon: ({ className }) => (\n <svg className={className} fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z\" />\n </svg>\n ),\n description: \"Check eligibility status\",\n category: \"admin\",\n },\n {\n id: \"create_referral\",\n label: \"New Referral\",\n icon: ({ className }) => (\n <svg className={className} fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <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\" />\n </svg>\n ),\n description: \"Process incoming referral\",\n category: \"clinical\",\n },\n {\n id: \"manual_task\",\n label: \"Manual Task\",\n icon: ({ className }) => (\n <svg className={className} fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z\" />\n </svg>\n ),\n description: \"Create a custom to-do\",\n category: \"admin\",\n },\n]\n\nexport function QuickActionModal({\n open,\n onOpenChange,\n templates = DEFAULT_TEMPLATES,\n title = \"Quick Action\",\n description = \"Choose a template or describe your task below.\",\n className,\n onCreateTask,\n}: QuickActionModalProps) {\n const [freeformText, setFreeformText] = React.useState(\"\")\n const [selectedPriority, setSelectedPriority] = React.useState<QuickActionPriority>(\"normal\")\n const inputRef = React.useRef<HTMLInputElement>(null)\n\n React.useEffect(() => {\n if (open) {\n setFreeformText(\"\")\n setSelectedPriority(\"normal\")\n setTimeout(() => inputRef.current?.focus(), 100)\n }\n }, [open])\n\n const handleTemplateClick = React.useCallback(\n (template: QuickActionTemplate) => {\n onCreateTask?.({\n templateId: template.id,\n message: \"\",\n priority: \"normal\",\n })\n onOpenChange(false)\n },\n [onCreateTask, onOpenChange],\n )\n\n const handleFreeformSubmit = React.useCallback(\n (e?: React.FormEvent) => {\n e?.preventDefault()\n if (!freeformText.trim()) return\n\n onCreateTask?.({\n templateId: null,\n message: freeformText.trim(),\n priority: selectedPriority,\n })\n onOpenChange(false)\n },\n [freeformText, selectedPriority, onCreateTask, onOpenChange],\n )\n\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent\n showCloseButton={false}\n className={cn(\n \"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\",\n className,\n )}\n >\n <DialogHeader className=\"sr-only\">\n <DialogTitle>{title}</DialogTitle>\n <DialogDescription>{description}</DialogDescription>\n </DialogHeader>\n\n <div className=\"min-h-0 flex-1 overflow-y-auto\">\n {/* Header */}\n <div className=\"relative pt-8 px-6 text-center\">\n <button\n type=\"button\"\n onClick={() => onOpenChange(false)}\n className=\"absolute top-4 right-4 p-2 text-muted-foreground hover:text-foreground transition-colors rounded-full hover:bg-muted/50\"\n aria-label=\"Close\"\n >\n <X className=\"w-5 h-5\" />\n </button>\n\n <div className=\"absolute top-6 left-6 flex items-center gap-2\">\n <div className=\"w-5 h-5 rounded flex items-center justify-center bg-muted/80\">\n <svg\n className=\"w-3 h-3 text-muted-foreground\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M13 10V3L4 14h7v7l9-11h-7z\"\n />\n </svg>\n </div>\n <span className=\"text-sm font-semibold text-foreground/80\">{title}</span>\n </div>\n\n <div className=\"mt-12 mb-8\">\n <h3 className=\"text-2xl font-bold text-foreground tracking-tight\">\n Let's knock something off your list\n </h3>\n <p className=\"mt-2 text-sm text-muted-foreground\">{description}</p>\n </div>\n </div>\n\n {/* Template Grid */}\n <div className=\"px-6 pb-6 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3\">\n {templates.map((template) => (\n <button\n key={template.id}\n type=\"button\"\n onClick={() => handleTemplateClick(template)}\n 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\"\n >\n <div className=\"p-2 rounded-lg bg-muted/50 group-hover:bg-primary/5 transition-colors\">\n <template.icon className=\"w-5 h-5 text-muted-foreground group-hover:text-primary transition-colors\" />\n </div>\n <div className=\"relative z-10 w-full\">\n <span className=\"block text-sm font-semibold text-foreground mb-1\">\n {template.label}\n </span>\n <span className=\"block text-xs text-muted-foreground leading-tight\">\n {template.description}\n </span>\n </div>\n </button>\n ))}\n </div>\n </div>\n\n {/* Freeform Input */}\n <form\n onSubmit={handleFreeformSubmit}\n className=\"shrink-0 p-6 bg-muted/5 border-t border-border\"\n >\n <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\">\n <input\n ref={inputRef}\n type=\"text\"\n value={freeformText}\n onChange={(e) => setFreeformText(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === \"Enter\" && !e.shiftKey) {\n e.preventDefault()\n handleFreeformSubmit()\n }\n }}\n placeholder=\"How can I help you today?\"\n className=\"w-full bg-transparent px-4 py-3 text-sm text-foreground placeholder-muted-foreground focus:outline-none\"\n />\n\n <div className=\"flex items-center justify-between pt-2 px-2 pb-2 border-t border-border/50 mt-1\">\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n className=\"p-1.5 text-muted-foreground hover:text-foreground hover:bg-muted rounded-md transition-colors\"\n title=\"Add attachment\"\n >\n <svg\n className=\"w-4 h-4\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n 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\"\n />\n </svg>\n </button>\n <div className=\"h-4 w-px bg-border mx-1\" />\n <select\n value={selectedPriority}\n onChange={(e) =>\n setSelectedPriority(e.target.value as QuickActionPriority)\n }\n 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\"\n aria-label=\"Priority\"\n >\n <option value=\"normal\">Normal</option>\n <option value=\"high\">High</option>\n <option value=\"urgent\">Urgent</option>\n </select>\n </div>\n\n <div className=\"flex items-center gap-3\">\n <span className=\"text-[10px] text-muted-foreground font-medium hidden sm:inline-block opacity-70\">\n Press <kbd className=\"font-sans\">↵</kbd> to create\n </span>\n <button\n type=\"submit\"\n disabled={!freeformText.trim()}\n 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\"\n >\n Create\n <svg\n className=\"w-3 h-3\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M5 10l7-7m0 0l7 7m-7-7v18\"\n />\n </svg>\n </button>\n </div>\n </div>\n </div>\n </form>\n </DialogContent>\n </Dialog>\n )\n}\n"],"mappings":";AA0CQ,cAmIA,YAnIA;AAxCR,YAAY,WAAW;AACvB,SAAS,SAAS;AAElB,SAAS,UAAU;AACnB,SAAS,QAAQ,eAAe,mBAAmB,cAAc,mBAAmB;AA8BpF,MAAM,oBAA2C;AAAA,EAC/C;AAAA,IACE,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,MAAM,CAAC,EAAE,UAAU,MACjB,oBAAC,SAAI,WAAsB,MAAK,QAAO,QAAO,gBAAe,SAAQ,aACnE,8BAAC,UAAK,eAAc,SAAQ,gBAAe,SAAQ,aAAa,GAAG,GAAE,yNAAwN,GAC/R;AAAA,IAEF,aAAa;AAAA,IACb,UAAU;AAAA,EACZ;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,MAAM,CAAC,EAAE,UAAU,MACjB,oBAAC,SAAI,WAAsB,MAAK,QAAO,QAAO,gBAAe,SAAQ,aACnE,8BAAC,UAAK,eAAc,SAAQ,gBAAe,SAAQ,aAAa,GAAG,GAAE,6IAA4I,GACnN;AAAA,IAEF,a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AAAA,wBACzB,oBAAC,YAAO,OAAM,UAAS,oBAAM;AAAA;AAAA;AAAA,kBAC/B;AAAA,mBACF;AAAA,gBAEA,qBAAC,SAAI,WAAU,2BACb;AAAA,uCAAC,UAAK,WAAU,mFAAkF;AAAA;AAAA,oBAC1F,oBAAC,SAAI,WAAU,aAAY,oBAAC;AAAA,oBAAM;AAAA,qBAC1C;AAAA,kBACA;AAAA,oBAAC;AAAA;AAAA,sBACC,MAAK;AAAA,sBACL,UAAU,CAAC,aAAa,KAAK;AAAA,sBAC7B,WAAU;AAAA,sBACX;AAAA;AAAA,wBAEC;AAAA,0BAAC;AAAA;AAAA,4BACC,WAAU;AAAA,4BACV,MAAK;AAAA,4BACL,QAAO;AAAA,4BACP,SAAQ;AAAA,4BAER;AAAA,8BAAC;AAAA;AAAA,gCACC,eAAc;AAAA,gCACd,gBAAe;AAAA,gCACf,aAAa;AAAA,gCACb,GAAE;AAAA;AAAA,4BACJ;AAAA;AAAA,wBACF;AAAA;AAAA;AAAA,kBACF;AAAA,mBACF;AAAA,iBACF;AAAA,eACF;AAAA;AAAA,QACF;AAAA;AAAA;AAAA,EACF,GACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { QuickActionTaskDraft, QuickActionTemplate } from './quick-action-modal.js';
|
|
3
|
+
|
|
4
|
+
interface SidebarNavItem {
|
|
5
|
+
id: string;
|
|
6
|
+
label: string;
|
|
7
|
+
icon: React.ComponentType<{
|
|
8
|
+
className?: string;
|
|
9
|
+
}>;
|
|
10
|
+
children?: SidebarNavItem[];
|
|
11
|
+
}
|
|
12
|
+
interface SidebarNavSection {
|
|
13
|
+
title?: string;
|
|
14
|
+
items: SidebarNavItem[];
|
|
15
|
+
moreItems?: SidebarNavItem[];
|
|
16
|
+
}
|
|
17
|
+
interface SidebarUserProfile {
|
|
18
|
+
name: string;
|
|
19
|
+
email: string;
|
|
20
|
+
initials?: string;
|
|
21
|
+
}
|
|
22
|
+
interface UserMenuItem {
|
|
23
|
+
id: string;
|
|
24
|
+
label: string;
|
|
25
|
+
icon: React.ComponentType<{
|
|
26
|
+
className?: string;
|
|
27
|
+
}>;
|
|
28
|
+
destructive?: boolean;
|
|
29
|
+
}
|
|
30
|
+
type ActiveVariant = "default" | "gradient";
|
|
31
|
+
interface QuickActionSidebarNavProps extends React.ComponentProps<"aside"> {
|
|
32
|
+
brandLabel?: string;
|
|
33
|
+
brandSubtitle?: string;
|
|
34
|
+
brandImage?: string;
|
|
35
|
+
hideQuickAction?: boolean;
|
|
36
|
+
navSections?: SidebarNavSection[];
|
|
37
|
+
activeItemId?: string;
|
|
38
|
+
activeVariant?: ActiveVariant;
|
|
39
|
+
onNavigate?: (itemId: string) => void;
|
|
40
|
+
user?: SidebarUserProfile;
|
|
41
|
+
userMenuItems?: UserMenuItem[];
|
|
42
|
+
onUserMenuAction?: (itemId: string) => void;
|
|
43
|
+
onCreateTask?: (draft: QuickActionTaskDraft) => void;
|
|
44
|
+
defaultCollapsed?: boolean;
|
|
45
|
+
quickActionTemplates?: QuickActionTemplate[];
|
|
46
|
+
quickActionTitle?: string;
|
|
47
|
+
quickActionDescription?: string;
|
|
48
|
+
}
|
|
49
|
+
declare function QuickActionSidebarNav({ className, brandLabel, brandSubtitle, brandImage, hideQuickAction, navSections, activeItemId, activeVariant, onNavigate, user, userMenuItems, onUserMenuAction, onCreateTask, defaultCollapsed, quickActionTemplates, quickActionTitle, quickActionDescription, ...props }: QuickActionSidebarNavProps): React.JSX.Element;
|
|
50
|
+
|
|
51
|
+
export { type ActiveVariant, QuickActionSidebarNav, type SidebarNavItem, type SidebarNavSection, type SidebarUserProfile, type UserMenuItem };
|