@lindaui/blocks 0.4.2 → 0.5.1
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 +67 -0
- package/dist/ai-cost-card-f403ypsg.js +99 -0
- package/dist/ai-performance-card-cggm09nc.js +191 -0
- package/dist/analytics/ai-cost-card.d.ts +3 -0
- package/dist/analytics/ai-cost-card.d.ts.map +1 -0
- package/dist/analytics/ai-performance-card.d.ts +3 -0
- package/dist/analytics/ai-performance-card.d.ts.map +1 -0
- package/dist/analytics/analytics-card.d.ts +3 -0
- package/dist/analytics/analytics-card.d.ts.map +1 -0
- package/dist/analytics/analytics-skeleton.d.ts +5 -0
- package/dist/analytics/analytics-skeleton.d.ts.map +1 -0
- package/dist/analytics/entity-health-card.d.ts +3 -0
- package/dist/analytics/entity-health-card.d.ts.map +1 -0
- package/dist/analytics/status-distribution-chart.d.ts +3 -0
- package/dist/analytics/status-distribution-chart.d.ts.map +1 -0
- package/dist/analytics/time-range-picker.d.ts +3 -0
- package/dist/analytics/time-range-picker.d.ts.map +1 -0
- package/dist/analytics/top-entities-table.d.ts +3 -0
- package/dist/analytics/top-entities-table.d.ts.map +1 -0
- package/dist/analytics/types.d.ts +104 -0
- package/dist/analytics/types.d.ts.map +1 -0
- package/dist/analytics-card-bcmijpt6.js +38 -0
- package/dist/analytics-skeleton-imve37du.js +164 -0
- package/dist/analytics.d.ts +11 -0
- package/dist/analytics.d.ts.map +1 -0
- package/dist/analytics.js +8 -0
- package/dist/app-shell/drawer-focus.d.ts +8 -0
- package/dist/app-shell/drawer-focus.d.ts.map +1 -0
- package/dist/app-shell/footer.d.ts +39 -0
- package/dist/app-shell/footer.d.ts.map +1 -0
- package/dist/app-shell/logout-dialog.d.ts +6 -0
- package/dist/app-shell/logout-dialog.d.ts.map +1 -0
- package/dist/app-shell/navigation.d.ts +15 -0
- package/dist/app-shell/navigation.d.ts.map +1 -0
- package/dist/app-shell/types.d.ts +55 -0
- package/dist/app-shell/types.d.ts.map +1 -0
- package/dist/app-shell.d.ts +7 -0
- package/dist/app-shell.d.ts.map +1 -0
- package/dist/app-shell.js +254 -0
- package/dist/channel-settings.d.ts +24 -0
- package/dist/channel-settings.d.ts.map +1 -0
- package/dist/channel-settings.js +60 -0
- package/dist/chat-avatar-jdmeyf2o.js +30 -0
- package/dist/chat-layout-fwx3x26g.js +25 -0
- package/dist/chat.d.ts +22 -0
- package/dist/chat.d.ts.map +1 -0
- package/dist/chat.js +66 -0
- package/dist/command-palette.d.ts +22 -0
- package/dist/command-palette.d.ts.map +1 -0
- package/dist/command-palette.js +141 -0
- package/dist/compat-chat/chat-avatar.d.ts +16 -0
- package/dist/compat-chat/chat-avatar.d.ts.map +1 -0
- package/dist/compat-chat/chat-header.d.ts +9 -0
- package/dist/compat-chat/chat-header.d.ts.map +1 -0
- package/dist/compat-chat/chat-layout.d.ts +10 -0
- package/dist/compat-chat/chat-layout.d.ts.map +1 -0
- package/dist/compat-chat/conversation-list-item.d.ts +10 -0
- package/dist/compat-chat/conversation-list-item.d.ts.map +1 -0
- package/dist/compat-chat/conversation-list.d.ts +24 -0
- package/dist/compat-chat/conversation-list.d.ts.map +1 -0
- package/dist/compat-chat/conversation-thread.d.ts +18 -0
- package/dist/compat-chat/conversation-thread.d.ts.map +1 -0
- package/dist/compat-chat/date-divider.d.ts +5 -0
- package/dist/compat-chat/date-divider.d.ts.map +1 -0
- package/dist/compat-chat/empty-chat-view.d.ts +6 -0
- package/dist/compat-chat/empty-chat-view.d.ts.map +1 -0
- package/dist/compat-chat/image-lightbox.d.ts +7 -0
- package/dist/compat-chat/image-lightbox.d.ts.map +1 -0
- package/dist/compat-chat/message-bubble.d.ts +6 -0
- package/dist/compat-chat/message-bubble.d.ts.map +1 -0
- package/dist/compat-chat/message-composer.d.ts +11 -0
- package/dist/compat-chat/message-composer.d.ts.map +1 -0
- package/dist/compat-chat/time-divider.d.ts +5 -0
- package/dist/compat-chat/time-divider.d.ts.map +1 -0
- package/dist/compat-chat/time-grouping.d.ts +5 -0
- package/dist/compat-chat/time-grouping.d.ts.map +1 -0
- package/dist/compat-chat/types.d.ts +35 -0
- package/dist/compat-chat/types.d.ts.map +1 -0
- package/dist/compat-chat/whatsapp-audio-player.d.ts +7 -0
- package/dist/compat-chat/whatsapp-audio-player.d.ts.map +1 -0
- package/dist/compat.d.ts +9 -0
- package/dist/compat.d.ts.map +1 -0
- package/dist/compat.js +4 -0
- package/dist/connected-panel-lhwy25yk.js +132 -0
- package/dist/connection-panel/connected-panel.d.ts +26 -0
- package/dist/connection-panel/connected-panel.d.ts.map +1 -0
- package/dist/connection-panel/disconnected-panel.d.ts +12 -0
- package/dist/connection-panel/disconnected-panel.d.ts.map +1 -0
- package/dist/connection-panel/instructions.d.ts +5 -0
- package/dist/connection-panel/instructions.d.ts.map +1 -0
- package/dist/connection-panel/qr-panel.d.ts +14 -0
- package/dist/connection-panel/qr-panel.d.ts.map +1 -0
- package/dist/connection-panel/use-qr-refresh.d.ts +18 -0
- package/dist/connection-panel/use-qr-refresh.d.ts.map +1 -0
- package/dist/connection-panel.d.ts +39 -0
- package/dist/connection-panel.d.ts.map +1 -0
- package/dist/connection-panel.js +328 -0
- package/dist/conversation-list-ekq2dzca.js +133 -0
- package/dist/conversation-list-item-fy6t5af2.js +55 -0
- package/dist/conversation-thread-c60431oa.js +205 -0
- package/dist/entity-card.d.ts +17 -0
- package/dist/entity-card.d.ts.map +1 -0
- package/dist/entity-card.js +69 -0
- package/dist/entity-health-card-ggnmrtrq.js +192 -0
- package/dist/entity-switcher.d.ts +33 -0
- package/dist/entity-switcher.d.ts.map +1 -0
- package/dist/entity-switcher.js +137 -0
- package/dist/filter-bar.d.ts +41 -0
- package/dist/filter-bar.d.ts.map +1 -0
- package/dist/filter-bar.js +155 -0
- package/dist/footer-f7r5e42b.js +192 -0
- package/dist/image-lightbox-ci3arb6z.js +62 -0
- package/dist/kanban/drop-utils.d.ts +18 -0
- package/dist/kanban/drop-utils.d.ts.map +1 -0
- package/dist/kanban/navigation-buttons.d.ts +9 -0
- package/dist/kanban/navigation-buttons.d.ts.map +1 -0
- package/dist/kanban/scroll-indicators.d.ts +6 -0
- package/dist/kanban/scroll-indicators.d.ts.map +1 -0
- package/dist/kanban/use-keyboard-navigation.d.ts +4 -0
- package/dist/kanban/use-keyboard-navigation.d.ts.map +1 -0
- package/dist/kanban-board.d.ts +31 -0
- package/dist/kanban-board.d.ts.map +1 -0
- package/dist/kanban-board.js +128 -0
- package/dist/kanban-column.d.ts +13 -0
- package/dist/kanban-column.d.ts.map +1 -0
- package/dist/kanban-column.js +58 -0
- package/dist/legacy-kpi-card.d.ts +16 -0
- package/dist/legacy-kpi-card.d.ts.map +1 -0
- package/dist/legacy-kpi-card.js +4 -0
- package/dist/logout-dialog-bbv59tbi.js +93 -0
- package/dist/message-bubble-odjvhroq.js +110 -0
- package/dist/message-composer-m2n6soo7.js +59 -0
- package/dist/navigation-buttons-e77mshh0.js +65 -0
- package/dist/navigation-hotcrqoq.js +115 -0
- package/dist/save-bar.d.ts +15 -0
- package/dist/save-bar.d.ts.map +1 -0
- package/dist/save-bar.js +38 -0
- package/dist/scroll-indicators-gvxapogd.js +39 -0
- package/dist/settings-layout.d.ts +20 -0
- package/dist/settings-layout.d.ts.map +1 -0
- package/dist/settings-layout.js +56 -0
- package/dist/source-selector.d.ts +18 -0
- package/dist/source-selector.d.ts.map +1 -0
- package/dist/source-selector.js +59 -0
- package/dist/status-distribution-chart-oucedzv7.js +87 -0
- package/dist/status-filters.d.ts +12 -0
- package/dist/status-filters.d.ts.map +1 -0
- package/dist/status-filters.js +31 -0
- package/dist/stepper.d.ts +15 -0
- package/dist/stepper.d.ts.map +1 -0
- package/dist/stepper.js +42 -0
- package/dist/time-range-picker-mu38hul4.js +123 -0
- package/dist/top-entities-table-o7xzpq96.js +78 -0
- package/dist/use-keyboard-navigation-he1xmriz.js +52 -0
- package/dist/whatsapp-audio-player-nooty6jb.js +277 -0
- package/llms.txt +98 -4
- package/package.json +191 -46
- package/src/analytics/ai-cost-card.tsx +31 -0
- package/src/analytics/ai-performance-card.tsx +48 -0
- package/src/analytics/analytics-card.tsx +14 -0
- package/src/analytics/analytics-skeleton.tsx +15 -0
- package/src/analytics/entity-health-card.tsx +50 -0
- package/src/analytics/status-distribution-chart.tsx +20 -0
- package/src/analytics/time-range-picker.tsx +43 -0
- package/src/analytics/top-entities-table.tsx +24 -0
- package/src/analytics/types.ts +43 -0
- package/src/analytics.ts +10 -0
- package/src/app-shell/drawer-focus.ts +42 -0
- package/src/app-shell/footer.tsx +160 -0
- package/src/app-shell/logout-dialog.tsx +68 -0
- package/src/app-shell/navigation.tsx +147 -0
- package/src/app-shell/types.ts +57 -0
- package/src/app-shell.tsx +166 -0
- package/src/area-chart.tsx +85 -0
- package/src/audio-player.tsx +74 -0
- package/src/auth-layout.tsx +132 -0
- package/src/auth-provider.tsx +29 -0
- package/src/bar-chart.tsx +78 -0
- package/src/channel-settings.tsx +76 -0
- package/src/chart-card.tsx +45 -0
- package/src/chat-avatar.tsx +57 -0
- package/src/chat-date-divider.tsx +18 -0
- package/src/chat-header.tsx +24 -0
- package/src/chat-layout.tsx +41 -0
- package/src/chat-time-divider.tsx +20 -0
- package/src/chat-types.ts +32 -0
- package/src/chat.ts +21 -0
- package/src/command-palette.tsx +110 -0
- package/src/compat-chat/chat-avatar.tsx +23 -0
- package/src/compat-chat/chat-header.tsx +12 -0
- package/src/compat-chat/chat-layout.tsx +14 -0
- package/src/compat-chat/conversation-list-item.tsx +27 -0
- package/src/compat-chat/conversation-list.tsx +49 -0
- package/src/compat-chat/conversation-thread.tsx +92 -0
- package/src/compat-chat/date-divider.tsx +7 -0
- package/src/compat-chat/empty-chat-view.tsx +9 -0
- package/src/compat-chat/image-lightbox.tsx +22 -0
- package/src/compat-chat/message-bubble.tsx +28 -0
- package/src/compat-chat/message-composer.tsx +26 -0
- package/src/compat-chat/time-divider.tsx +5 -0
- package/src/compat-chat/time-grouping.ts +19 -0
- package/src/compat-chat/types.ts +31 -0
- package/src/compat-chat/whatsapp-audio-player.tsx +100 -0
- package/src/compat.ts +8 -0
- package/src/confirm-dialog.tsx +85 -0
- package/src/connection-panel/connected-panel.tsx +106 -0
- package/src/connection-panel/disconnected-panel.tsx +48 -0
- package/src/connection-panel/instructions.tsx +9 -0
- package/src/connection-panel/qr-panel.tsx +62 -0
- package/src/connection-panel/use-qr-refresh.ts +52 -0
- package/src/connection-panel.tsx +141 -0
- package/src/conversation-list-item.tsx +53 -0
- package/src/conversation-list.tsx +67 -0
- package/src/conversation-thread.tsx +64 -0
- package/src/detail-panel.tsx +123 -0
- package/src/document-panel.tsx +109 -0
- package/src/document-reader.tsx +29 -0
- package/src/empty-chat-view.tsx +25 -0
- package/src/entity-card.tsx +74 -0
- package/src/entity-health-card.tsx +53 -0
- package/src/entity-switcher.tsx +126 -0
- package/src/fetching-indicator.tsx +16 -0
- package/src/field-array-form.tsx +166 -0
- package/src/filter-bar.tsx +203 -0
- package/src/image-viewer.tsx +129 -0
- package/src/kanban/drop-utils.ts +31 -0
- package/src/kanban/navigation-buttons.tsx +80 -0
- package/src/kanban/scroll-indicators.tsx +47 -0
- package/src/kanban/use-keyboard-navigation.ts +43 -0
- package/src/kanban-board.tsx +160 -0
- package/src/kanban-column.tsx +62 -0
- package/src/legacy-kpi-card.tsx +38 -0
- package/src/line-chart.tsx +58 -0
- package/src/list-item.tsx +63 -0
- package/src/list-pane.tsx +143 -0
- package/src/login-form.tsx +128 -0
- package/src/message-bubble.tsx +70 -0
- package/src/message-composer.tsx +52 -0
- package/src/pie-chart.tsx +70 -0
- package/src/radar-chart.tsx +55 -0
- package/src/radial-chart.tsx +103 -0
- package/src/recording-overlay.tsx +159 -0
- package/src/save-bar.tsx +35 -0
- package/src/settings-layout.tsx +79 -0
- package/src/source-selector.tsx +71 -0
- package/src/split-workspace.tsx +74 -0
- package/src/stat-card.tsx +166 -0
- package/src/stats-grid.tsx +23 -0
- package/src/status-filters.tsx +28 -0
- package/src/stepper.tsx +47 -0
- package/src/table-pane.tsx +194 -0
- package/src/time-range-picker.tsx +89 -0
- package/src/workspace-back-button.tsx +32 -0
- package/dist/chat-types.test.d.ts +0 -2
- package/dist/chat-types.test.d.ts.map +0 -1
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
|
+
import { Tooltip } from '@lindaui/ui/compound';
|
|
4
|
+
import { cn } from '@lindaui/ui/cn';
|
|
5
|
+
|
|
6
|
+
function ShellLink({ renderLink, ...props }) {
|
|
7
|
+
return renderLink ? renderLink(props) : /*#__PURE__*/ jsx("a", {
|
|
8
|
+
...props
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
function SidebarNavLink({ item, collapsed, onClick, renderLink }) {
|
|
12
|
+
const Icon = item.icon;
|
|
13
|
+
const link = /*#__PURE__*/ jsxs(ShellLink, {
|
|
14
|
+
"aria-current": item.isActive ? "page" : "false",
|
|
15
|
+
"aria-label": item.label,
|
|
16
|
+
className: cn("relative flex items-center gap-3 rounded-lg px-3 py-2.5", "transition-all duration-200 ease-out", "text-muted hover:scale-[1.02] hover:bg-surface-secondary hover:text-foreground", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2", item.isActive ? "bg-accent/10 font-semibold text-accent hover:bg-accent/15" : "", collapsed ? "justify-center px-2" : ""),
|
|
17
|
+
href: item.href,
|
|
18
|
+
onClick: (event)=>{
|
|
19
|
+
if (item.onAction) {
|
|
20
|
+
event.preventDefault();
|
|
21
|
+
item.onAction();
|
|
22
|
+
}
|
|
23
|
+
onClick?.();
|
|
24
|
+
},
|
|
25
|
+
renderLink: renderLink,
|
|
26
|
+
children: [
|
|
27
|
+
item.isActive ? /*#__PURE__*/ jsx("div", {
|
|
28
|
+
className: "absolute top-1/2 left-0 h-5 w-1 -translate-y-1/2 rounded-r-full bg-accent"
|
|
29
|
+
}) : null,
|
|
30
|
+
/*#__PURE__*/ jsx(Icon, {
|
|
31
|
+
className: cn("flex-shrink-0 transition-transform duration-200", "group-hover:scale-110"),
|
|
32
|
+
size: 18
|
|
33
|
+
}),
|
|
34
|
+
collapsed ? null : /*#__PURE__*/ jsx("span", {
|
|
35
|
+
className: "text-sm",
|
|
36
|
+
children: item.label
|
|
37
|
+
})
|
|
38
|
+
]
|
|
39
|
+
});
|
|
40
|
+
return collapsed ? /*#__PURE__*/ jsxs(Tooltip, {
|
|
41
|
+
children: [
|
|
42
|
+
/*#__PURE__*/ jsx(Tooltip.Trigger, {
|
|
43
|
+
"aria-label": item.label,
|
|
44
|
+
children: link
|
|
45
|
+
}),
|
|
46
|
+
/*#__PURE__*/ jsx(Tooltip.Content, {
|
|
47
|
+
placement: "right",
|
|
48
|
+
children: item.label
|
|
49
|
+
})
|
|
50
|
+
]
|
|
51
|
+
}) : link;
|
|
52
|
+
}
|
|
53
|
+
function BottomNavLink({ item, floating, hasCenterButton, renderLink }) {
|
|
54
|
+
const Icon = item.icon;
|
|
55
|
+
return /*#__PURE__*/ jsx(ShellLink, {
|
|
56
|
+
"aria-current": item.isActive ? "page" : undefined,
|
|
57
|
+
"aria-label": item.label,
|
|
58
|
+
className: floating ? "absolute -top-5 left-1/2 -translate-x-1/2" : cn(hasCenterButton ? "flex flex-col items-center justify-center gap-1 px-4 py-2" : "flex flex-col items-center justify-center gap-1 px-3 py-2", "transition-all duration-200 ease-out", hasCenterButton ? "min-w-[60px]" : "min-w-[52px]", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent", item.isActive ? "text-accent" : "text-muted hover:text-foreground active:scale-95"),
|
|
59
|
+
href: item.href,
|
|
60
|
+
renderLink: renderLink,
|
|
61
|
+
children: floating ? /*#__PURE__*/ jsx("div", {
|
|
62
|
+
className: cn("flex h-14 w-14 items-center justify-center rounded-full", "bg-accent shadow-accent/40 shadow-lg", "ring-4 ring-background", "transition-all duration-200 ease-out", "hover:shadow-accent/50 hover:shadow-xl active:scale-95", item.isActive ? "scale-105" : ""),
|
|
63
|
+
children: /*#__PURE__*/ jsx(Icon, {
|
|
64
|
+
className: "text-white",
|
|
65
|
+
size: 24
|
|
66
|
+
})
|
|
67
|
+
}) : /*#__PURE__*/ jsxs(Fragment, {
|
|
68
|
+
children: [
|
|
69
|
+
/*#__PURE__*/ jsx(Icon, {
|
|
70
|
+
className: "transition-all duration-200",
|
|
71
|
+
size: item.isActive ? 22 : 20
|
|
72
|
+
}),
|
|
73
|
+
/*#__PURE__*/ jsx("span", {
|
|
74
|
+
className: cn("text-[10px] transition-all duration-200", item.isActive ? "font-semibold" : "font-medium"),
|
|
75
|
+
children: item.label
|
|
76
|
+
})
|
|
77
|
+
]
|
|
78
|
+
})
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
function MobileBottomNavigation({ navItems, isVisiting, label, renderLink }) {
|
|
82
|
+
const hasCenterButton = navItems.some((item)=>item.isCenterButton);
|
|
83
|
+
const mobileItems = navItems.filter((item)=>!item.hideOnMobile);
|
|
84
|
+
const centerItem = mobileItems.find((item)=>item.isCenterButton);
|
|
85
|
+
const regularItems = mobileItems.filter((item)=>!item.isCenterButton);
|
|
86
|
+
const link = (item)=>/*#__PURE__*/ jsx(BottomNavLink, {
|
|
87
|
+
hasCenterButton: hasCenterButton,
|
|
88
|
+
item: item,
|
|
89
|
+
renderLink: renderLink
|
|
90
|
+
}, item.key);
|
|
91
|
+
return /*#__PURE__*/ jsx("nav", {
|
|
92
|
+
"aria-label": label,
|
|
93
|
+
className: hasCenterButton ? cn("fixed right-0 bottom-0 left-0 z-50 border-border border-t backdrop-blur backdrop-saturate-200 lg:hidden dark:border-white/10", isVisiting ? "bg-warning-soft/80 dark:bg-warning/20" : "!bg-transparent") : "fixed right-0 bottom-0 left-0 z-50 border-border border-t bg-background backdrop-blur backdrop-saturate-200 lg:hidden dark:border-white/10",
|
|
94
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
95
|
+
className: hasCenterButton ? "relative flex h-16 items-center justify-around px-2" : "flex h-16 items-center justify-around px-2",
|
|
96
|
+
children: hasCenterButton ? /*#__PURE__*/ jsxs(Fragment, {
|
|
97
|
+
children: [
|
|
98
|
+
regularItems.slice(0, 2).map(link),
|
|
99
|
+
centerItem ? /*#__PURE__*/ jsx(BottomNavLink, {
|
|
100
|
+
floating: true,
|
|
101
|
+
hasCenterButton: true,
|
|
102
|
+
item: centerItem,
|
|
103
|
+
renderLink: renderLink
|
|
104
|
+
}) : null,
|
|
105
|
+
/*#__PURE__*/ jsx("div", {
|
|
106
|
+
className: "min-w-[60px]"
|
|
107
|
+
}),
|
|
108
|
+
regularItems.slice(2, 4).map(link)
|
|
109
|
+
]
|
|
110
|
+
}) : mobileItems.map(link)
|
|
111
|
+
})
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export { MobileBottomNavigation as M, ShellLink as S, SidebarNavLink as a };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export interface SaveBarProps {
|
|
3
|
+
dirty: boolean;
|
|
4
|
+
saving: boolean;
|
|
5
|
+
form: string;
|
|
6
|
+
embedded?: boolean;
|
|
7
|
+
labels: {
|
|
8
|
+
pending: ReactNode;
|
|
9
|
+
upToDate: ReactNode;
|
|
10
|
+
submit: ReactNode;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
/** Submit an existing form by id without owning its data or persistence. */
|
|
14
|
+
export declare function SaveBar({ dirty, saving, form, embedded, labels }: SaveBarProps): import("react").JSX.Element;
|
|
15
|
+
//# sourceMappingURL=save-bar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"save-bar.d.ts","sourceRoot":"","sources":["../src/save-bar.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE;QAAE,OAAO,EAAE,SAAS,CAAC;QAAC,QAAQ,EAAE,SAAS,CAAC;QAAC,MAAM,EAAE,SAAS,CAAA;KAAE,CAAC;CACxE;AAED,4EAA4E;AAC5E,wBAAgB,OAAO,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,QAAgB,EAAE,MAAM,EAAE,EAAE,YAAY,+BAoBtF"}
|
package/dist/save-bar.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
|
+
import { Button, Spinner } from '@lindaui/ui/compound';
|
|
4
|
+
|
|
5
|
+
/** Submit an existing form by id without owning its data or persistence. */ function SaveBar({ dirty, saving, form, embedded = false, labels }) {
|
|
6
|
+
return /*#__PURE__*/ jsx("div", {
|
|
7
|
+
className: embedded ? "sticky bottom-0 z-10 border-border border-t bg-surface px-4 py-3 lg:px-6" : "fixed inset-x-0 bottom-24 z-40 border-border border-y bg-surface px-4 py-3 lg:static lg:border-b-0 lg:px-8",
|
|
8
|
+
children: /*#__PURE__*/ jsxs("div", {
|
|
9
|
+
className: "mx-auto flex max-w-4xl items-center justify-between gap-3",
|
|
10
|
+
children: [
|
|
11
|
+
/*#__PURE__*/ jsx("p", {
|
|
12
|
+
"aria-live": "polite",
|
|
13
|
+
className: "text-muted text-sm",
|
|
14
|
+
children: dirty ? labels.pending : labels.upToDate
|
|
15
|
+
}),
|
|
16
|
+
/*#__PURE__*/ jsx(Button, {
|
|
17
|
+
className: "shrink-0 whitespace-nowrap",
|
|
18
|
+
form: form,
|
|
19
|
+
isDisabled: !dirty || saving,
|
|
20
|
+
isPending: saving,
|
|
21
|
+
type: "submit",
|
|
22
|
+
variant: "primary",
|
|
23
|
+
children: ({ isPending })=>/*#__PURE__*/ jsxs(Fragment, {
|
|
24
|
+
children: [
|
|
25
|
+
isPending && /*#__PURE__*/ jsx(Spinner, {
|
|
26
|
+
color: "current",
|
|
27
|
+
size: "sm"
|
|
28
|
+
}),
|
|
29
|
+
labels.submit
|
|
30
|
+
]
|
|
31
|
+
})
|
|
32
|
+
})
|
|
33
|
+
]
|
|
34
|
+
})
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export { SaveBar };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { useState, useEffect } from 'react';
|
|
4
|
+
import { cn } from '@lindaui/ui/cn';
|
|
5
|
+
|
|
6
|
+
function ScrollIndicators({ scrollRef }) {
|
|
7
|
+
const [showLeft, setShowLeft] = useState(false);
|
|
8
|
+
const [showRight, setShowRight] = useState(false);
|
|
9
|
+
useEffect(()=>{
|
|
10
|
+
const element = scrollRef.current;
|
|
11
|
+
if (!element) return;
|
|
12
|
+
const checkScroll = ()=>{
|
|
13
|
+
const { scrollLeft, scrollWidth, clientWidth } = element;
|
|
14
|
+
setShowLeft(scrollLeft > 10);
|
|
15
|
+
setShowRight(scrollLeft < scrollWidth - clientWidth - 10);
|
|
16
|
+
};
|
|
17
|
+
checkScroll();
|
|
18
|
+
element.addEventListener("scroll", checkScroll);
|
|
19
|
+
window.addEventListener("resize", checkScroll);
|
|
20
|
+
return ()=>{
|
|
21
|
+
element.removeEventListener("scroll", checkScroll);
|
|
22
|
+
window.removeEventListener("resize", checkScroll);
|
|
23
|
+
};
|
|
24
|
+
}, [
|
|
25
|
+
scrollRef
|
|
26
|
+
]);
|
|
27
|
+
return /*#__PURE__*/ jsxs(Fragment, {
|
|
28
|
+
children: [
|
|
29
|
+
/*#__PURE__*/ jsx("div", {
|
|
30
|
+
className: cn("pointer-events-none absolute top-0 left-0 z-10 h-full w-12 bg-gradient-to-r from-background to-transparent transition-opacity duration-300", showLeft ? "opacity-100" : "opacity-0")
|
|
31
|
+
}),
|
|
32
|
+
/*#__PURE__*/ jsx("div", {
|
|
33
|
+
className: cn("pointer-events-none absolute top-0 right-0 z-10 h-full w-12 bg-gradient-to-l from-background to-transparent transition-opacity duration-300", showRight ? "opacity-100" : "opacity-0")
|
|
34
|
+
})
|
|
35
|
+
]
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export { ScrollIndicators as S };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export interface SettingsLayoutSection<Id extends string = string> {
|
|
3
|
+
id: Id;
|
|
4
|
+
label: string;
|
|
5
|
+
icon?: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export interface SettingsLayoutProps<Id extends string = string> {
|
|
8
|
+
sections: readonly SettingsLayoutSection<Id>[];
|
|
9
|
+
selected: Id;
|
|
10
|
+
onSelect: (id: Id) => void;
|
|
11
|
+
panels: Record<Id, ReactNode>;
|
|
12
|
+
footer?: ReactNode;
|
|
13
|
+
navigationLabel: string;
|
|
14
|
+
title?: ReactNode;
|
|
15
|
+
compact?: boolean;
|
|
16
|
+
idPrefix?: string;
|
|
17
|
+
}
|
|
18
|
+
/** Responsive section navigation with mounted, hidden panels and a footer slot. */
|
|
19
|
+
export declare function SettingsLayout<Id extends string>({ sections, panels, selected, onSelect, footer, navigationLabel, title, compact, idPrefix, }: SettingsLayoutProps<Id>): import("react").JSX.Element;
|
|
20
|
+
//# sourceMappingURL=settings-layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings-layout.d.ts","sourceRoot":"","sources":["../src/settings-layout.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,qBAAqB,CAAC,EAAE,SAAS,MAAM,GAAG,MAAM;IAC/D,EAAE,EAAE,EAAE,CAAC;IACP,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED,MAAM,WAAW,mBAAmB,CAAC,EAAE,SAAS,MAAM,GAAG,MAAM;IAC7D,QAAQ,EAAE,SAAS,qBAAqB,CAAC,EAAE,CAAC,EAAE,CAAC;IAC/C,QAAQ,EAAE,EAAE,CAAC;IACb,QAAQ,EAAE,CAAC,EAAE,EAAE,EAAE,KAAK,IAAI,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;IAC9B,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,mFAAmF;AACnF,wBAAgB,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,EAChD,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,eAAe,EACf,KAAK,EACL,OAAe,EACf,QAAqB,GACtB,EAAE,mBAAmB,CAAC,EAAE,CAAC,+BA2CzB"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { Button } from '@lindaui/ui/compound';
|
|
4
|
+
import { cn } from '@lindaui/ui/cn';
|
|
5
|
+
|
|
6
|
+
/** Responsive section navigation with mounted, hidden panels and a footer slot. */ function SettingsLayout({ sections, panels, selected, onSelect, footer, navigationLabel, title, compact = false, idPrefix = "settings" }) {
|
|
7
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
8
|
+
className: cn("mx-auto w-full max-w-5xl", compact ? "h-full p-0" : "p-4 pb-28 lg:p-8"),
|
|
9
|
+
children: [
|
|
10
|
+
title ? /*#__PURE__*/ jsx("h1", {
|
|
11
|
+
className: "mb-6 font-semibold text-2xl tracking-tight",
|
|
12
|
+
children: title
|
|
13
|
+
}) : null,
|
|
14
|
+
/*#__PURE__*/ jsxs("div", {
|
|
15
|
+
className: cn("overflow-hidden rounded-2xl border border-border bg-surface lg:grid lg:grid-cols-[220px_minmax(0,1fr)]", compact ? "h-full min-h-0 rounded-none border-0" : "lg:min-h-[620px]"),
|
|
16
|
+
children: [
|
|
17
|
+
/*#__PURE__*/ jsx("nav", {
|
|
18
|
+
"aria-label": navigationLabel,
|
|
19
|
+
className: "min-h-0 min-w-0 overflow-x-auto border-border border-b bg-surface-secondary p-2 lg:overflow-y-auto lg:border-r lg:border-b-0 lg:p-3",
|
|
20
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
21
|
+
className: "flex w-max gap-1 lg:w-full lg:flex-col",
|
|
22
|
+
children: sections.map(({ id, icon, label })=>/*#__PURE__*/ jsxs(Button, {
|
|
23
|
+
"aria-controls": `${idPrefix}-${id}`,
|
|
24
|
+
"aria-pressed": selected === id,
|
|
25
|
+
className: `shrink-0 justify-start gap-2 whitespace-nowrap rounded-lg px-3 text-sm lg:w-full ${selected === id ? "bg-default font-semibold text-foreground" : "text-muted"}`,
|
|
26
|
+
onPress: ()=>onSelect(id),
|
|
27
|
+
variant: "ghost",
|
|
28
|
+
children: [
|
|
29
|
+
icon,
|
|
30
|
+
label
|
|
31
|
+
]
|
|
32
|
+
}, id))
|
|
33
|
+
})
|
|
34
|
+
}),
|
|
35
|
+
/*#__PURE__*/ jsxs("div", {
|
|
36
|
+
className: "flex min-h-0 min-w-0 flex-col",
|
|
37
|
+
children: [
|
|
38
|
+
/*#__PURE__*/ jsx("div", {
|
|
39
|
+
className: "min-h-0 flex-1 overflow-y-auto p-5 lg:p-8",
|
|
40
|
+
children: sections.map(({ id, label })=>/*#__PURE__*/ jsx("section", {
|
|
41
|
+
"aria-label": label,
|
|
42
|
+
hidden: selected !== id,
|
|
43
|
+
id: `${idPrefix}-${id}`,
|
|
44
|
+
children: panels[id]
|
|
45
|
+
}, id))
|
|
46
|
+
}),
|
|
47
|
+
footer
|
|
48
|
+
]
|
|
49
|
+
})
|
|
50
|
+
]
|
|
51
|
+
})
|
|
52
|
+
]
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export { SettingsLayout };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export interface SourceSelectorOption<Source extends string = string> {
|
|
3
|
+
key: Source;
|
|
4
|
+
label: string;
|
|
5
|
+
triggerLabel?: string;
|
|
6
|
+
icon?: ReactNode;
|
|
7
|
+
triggerIcon?: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export interface SourceSelectorProps<Source extends string = string> {
|
|
10
|
+
source: Source;
|
|
11
|
+
options: readonly SourceSelectorOption<Source>[];
|
|
12
|
+
onSourceChange: (source: Source) => void;
|
|
13
|
+
isLoading?: boolean;
|
|
14
|
+
ariaLabel?: string;
|
|
15
|
+
}
|
|
16
|
+
/** Controlled selection; option labels and icons are supplied by the product. */
|
|
17
|
+
export declare function SourceSelector<Source extends string = string>({ source, options, onSourceChange, isLoading, ariaLabel, }: SourceSelectorProps<Source>): import("react").JSX.Element;
|
|
18
|
+
//# sourceMappingURL=source-selector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-selector.d.ts","sourceRoot":"","sources":["../src/source-selector.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,oBAAoB,CAAC,MAAM,SAAS,MAAM,GAAG,MAAM;IAClE,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,WAAW,CAAC,EAAE,SAAS,CAAC;CACzB;AAED,MAAM,WAAW,mBAAmB,CAAC,MAAM,SAAS,MAAM,GAAG,MAAM;IACjE,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,SAAS,oBAAoB,CAAC,MAAM,CAAC,EAAE,CAAC;IACjD,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,iFAAiF;AACjF,wBAAgB,cAAc,CAAC,MAAM,SAAS,MAAM,GAAG,MAAM,EAAE,EAC7D,MAAM,EACN,OAAO,EACP,cAAc,EACd,SAAS,EACT,SAA2B,GAC5B,EAAE,mBAAmB,CAAC,MAAM,CAAC,+BAyC7B"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
3
|
+
import { Dropdown, Button, Spinner, Label } from '@lindaui/ui/compound';
|
|
4
|
+
import { ChevronDown } from 'lucide-react';
|
|
5
|
+
|
|
6
|
+
/** Controlled selection; option labels and icons are supplied by the product. */ function SourceSelector({ source, options, onSourceChange, isLoading, ariaLabel = "Change source" }) {
|
|
7
|
+
const current = options.find((option)=>option.key === source);
|
|
8
|
+
return /*#__PURE__*/ jsxs(Dropdown, {
|
|
9
|
+
children: [
|
|
10
|
+
/*#__PURE__*/ jsx(Button, {
|
|
11
|
+
className: "h-6 min-w-0 gap-1 px-2 text-[10px]",
|
|
12
|
+
isPending: isLoading,
|
|
13
|
+
size: "sm",
|
|
14
|
+
variant: "tertiary",
|
|
15
|
+
children: ({ isPending })=>/*#__PURE__*/ jsxs(Fragment, {
|
|
16
|
+
children: [
|
|
17
|
+
isPending ? /*#__PURE__*/ jsx(Spinner, {
|
|
18
|
+
color: "current",
|
|
19
|
+
size: "sm"
|
|
20
|
+
}) : current?.triggerIcon ?? current?.icon,
|
|
21
|
+
current?.triggerLabel ?? current?.label ?? source,
|
|
22
|
+
/*#__PURE__*/ jsx(ChevronDown, {
|
|
23
|
+
size: 12
|
|
24
|
+
})
|
|
25
|
+
]
|
|
26
|
+
})
|
|
27
|
+
}),
|
|
28
|
+
/*#__PURE__*/ jsx(Dropdown.Popover, {
|
|
29
|
+
className: "rounded-[14px]",
|
|
30
|
+
children: /*#__PURE__*/ jsx(Dropdown.Menu, {
|
|
31
|
+
"aria-label": ariaLabel,
|
|
32
|
+
className: "[&_[data-slot=menu-item]]:rounded-lg",
|
|
33
|
+
onAction: (key)=>{
|
|
34
|
+
const option = options.find((item)=>item.key === key);
|
|
35
|
+
if (option) onSourceChange(option.key);
|
|
36
|
+
},
|
|
37
|
+
selectedKeys: [
|
|
38
|
+
source
|
|
39
|
+
],
|
|
40
|
+
selectionMode: "single",
|
|
41
|
+
children: options.map((option)=>/*#__PURE__*/ jsxs(Dropdown.Item, {
|
|
42
|
+
className: "text-sm",
|
|
43
|
+
id: option.key,
|
|
44
|
+
textValue: option.label,
|
|
45
|
+
children: [
|
|
46
|
+
/*#__PURE__*/ jsx(Dropdown.ItemIndicator, {}),
|
|
47
|
+
option.icon,
|
|
48
|
+
/*#__PURE__*/ jsx(Label, {
|
|
49
|
+
children: option.label
|
|
50
|
+
})
|
|
51
|
+
]
|
|
52
|
+
}, option.key))
|
|
53
|
+
})
|
|
54
|
+
})
|
|
55
|
+
]
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export { SourceSelector };
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { useCallback } from 'react';
|
|
4
|
+
import { ResponsiveContainer, BarChart, CartesianGrid, XAxis, YAxis, Tooltip, Bar, Cell } from 'recharts';
|
|
5
|
+
|
|
6
|
+
function StatusDistributionChart({ data, emptyLabel, valueLabel, height = 220 }) {
|
|
7
|
+
const chartData = [
|
|
8
|
+
...data
|
|
9
|
+
].sort((a, b)=>b.count - a.count);
|
|
10
|
+
const formatTooltip = useCallback((value)=>[
|
|
11
|
+
value,
|
|
12
|
+
valueLabel
|
|
13
|
+
], [
|
|
14
|
+
valueLabel
|
|
15
|
+
]);
|
|
16
|
+
if (!chartData.length) return /*#__PURE__*/ jsx("p", {
|
|
17
|
+
className: "py-8 text-center text-muted text-sm",
|
|
18
|
+
children: emptyLabel
|
|
19
|
+
});
|
|
20
|
+
return /*#__PURE__*/ jsx(ResponsiveContainer, {
|
|
21
|
+
height: height,
|
|
22
|
+
width: "100%",
|
|
23
|
+
children: /*#__PURE__*/ jsxs(BarChart, {
|
|
24
|
+
data: chartData,
|
|
25
|
+
layout: "vertical",
|
|
26
|
+
margin: {
|
|
27
|
+
bottom: 0,
|
|
28
|
+
left: 0,
|
|
29
|
+
right: 16,
|
|
30
|
+
top: 0
|
|
31
|
+
},
|
|
32
|
+
children: [
|
|
33
|
+
/*#__PURE__*/ jsx(CartesianGrid, {
|
|
34
|
+
horizontal: false,
|
|
35
|
+
stroke: "var(--border)",
|
|
36
|
+
strokeDasharray: "3 3"
|
|
37
|
+
}),
|
|
38
|
+
/*#__PURE__*/ jsx(XAxis, {
|
|
39
|
+
axisLine: false,
|
|
40
|
+
tick: {
|
|
41
|
+
fill: "var(--muted)",
|
|
42
|
+
fontSize: 11
|
|
43
|
+
},
|
|
44
|
+
tickLine: false,
|
|
45
|
+
type: "number"
|
|
46
|
+
}),
|
|
47
|
+
/*#__PURE__*/ jsx(YAxis, {
|
|
48
|
+
axisLine: false,
|
|
49
|
+
dataKey: "label",
|
|
50
|
+
tick: {
|
|
51
|
+
fill: "var(--muted)",
|
|
52
|
+
fontSize: 11
|
|
53
|
+
},
|
|
54
|
+
tickLine: false,
|
|
55
|
+
type: "category",
|
|
56
|
+
width: 110
|
|
57
|
+
}),
|
|
58
|
+
/*#__PURE__*/ jsx(Tooltip, {
|
|
59
|
+
contentStyle: {
|
|
60
|
+
backgroundColor: "var(--surface)",
|
|
61
|
+
border: "1px solid var(--border)",
|
|
62
|
+
borderRadius: "8px",
|
|
63
|
+
fontSize: "12px"
|
|
64
|
+
},
|
|
65
|
+
cursor: {
|
|
66
|
+
fill: "var(--surface-secondary)"
|
|
67
|
+
},
|
|
68
|
+
formatter: formatTooltip
|
|
69
|
+
}),
|
|
70
|
+
/*#__PURE__*/ jsx(Bar, {
|
|
71
|
+
dataKey: "count",
|
|
72
|
+
radius: [
|
|
73
|
+
0,
|
|
74
|
+
4,
|
|
75
|
+
4,
|
|
76
|
+
0
|
|
77
|
+
],
|
|
78
|
+
children: chartData.map((entry)=>/*#__PURE__*/ jsx(Cell, {
|
|
79
|
+
fill: entry.color
|
|
80
|
+
}, entry.key))
|
|
81
|
+
})
|
|
82
|
+
]
|
|
83
|
+
})
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export { StatusDistributionChart as S };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type BadgeColor } from "@lindaui/ui/compat";
|
|
2
|
+
export interface StatusFiltersProps {
|
|
3
|
+
availableStatuses: string[];
|
|
4
|
+
colors?: Record<string, BadgeColor>;
|
|
5
|
+
counts?: Record<string, number>;
|
|
6
|
+
labels?: Record<string, string>;
|
|
7
|
+
onStatusToggle: (status: string) => void;
|
|
8
|
+
selectedStatuses: string[];
|
|
9
|
+
}
|
|
10
|
+
/** Controlled status chips; labels, colors and counts belong to the consumer. */
|
|
11
|
+
export declare function StatusFilters({ availableStatuses, selectedStatuses, onStatusToggle, counts, labels, colors }: StatusFiltersProps): import("react").JSX.Element;
|
|
12
|
+
//# sourceMappingURL=status-filters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status-filters.d.ts","sourceRoot":"","sources":["../src/status-filters.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAE5D,MAAM,WAAW,kBAAkB;IACjC,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,gBAAgB,EAAE,MAAM,EAAE,CAAC;CAC5B;AAED,iFAAiF;AACjF,wBAAgB,aAAa,CAAC,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,kBAAkB,+BAahI"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { Badge } from '@lindaui/ui/compat';
|
|
4
|
+
|
|
5
|
+
/** Controlled status chips; labels, colors and counts belong to the consumer. */ function StatusFilters({ availableStatuses, selectedStatuses, onStatusToggle, counts, labels, colors }) {
|
|
6
|
+
const handleToggle = (status)=>()=>onStatusToggle(status);
|
|
7
|
+
return /*#__PURE__*/ jsx("div", {
|
|
8
|
+
className: "flex flex-wrap gap-2",
|
|
9
|
+
children: availableStatuses.map((status)=>{
|
|
10
|
+
const isSelected = selectedStatuses.includes(status);
|
|
11
|
+
const count = counts?.[status] ?? 0;
|
|
12
|
+
return /*#__PURE__*/ jsx("button", {
|
|
13
|
+
"aria-pressed": isSelected,
|
|
14
|
+
className: "cursor-pointer transition-opacity hover:opacity-80",
|
|
15
|
+
onClick: handleToggle(status),
|
|
16
|
+
type: "button",
|
|
17
|
+
children: /*#__PURE__*/ jsxs(Badge, {
|
|
18
|
+
color: colors?.[status] ?? "default",
|
|
19
|
+
size: "sm",
|
|
20
|
+
variant: isSelected ? "solid" : "flat",
|
|
21
|
+
children: [
|
|
22
|
+
labels?.[status] ?? status,
|
|
23
|
+
count > 0 ? ` (${count})` : ""
|
|
24
|
+
]
|
|
25
|
+
})
|
|
26
|
+
}, status);
|
|
27
|
+
})
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export { StatusFilters };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export interface StepperProps {
|
|
3
|
+
/** Presentation only: the app supplies its own step/completion calculation. */
|
|
4
|
+
value: number;
|
|
5
|
+
label: string;
|
|
6
|
+
stepLabel?: ReactNode;
|
|
7
|
+
description?: ReactNode;
|
|
8
|
+
complete?: boolean;
|
|
9
|
+
variant?: "steps" | "compact";
|
|
10
|
+
className?: string;
|
|
11
|
+
formatValue?: (value: number) => ReactNode;
|
|
12
|
+
}
|
|
13
|
+
/** The progress presentation shared by onboarding steps and compact connection wizards. */
|
|
14
|
+
export declare function Stepper({ value, label, stepLabel, description, complete, variant, className, formatValue, }: StepperProps): import("react").JSX.Element;
|
|
15
|
+
//# sourceMappingURL=stepper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stepper.d.ts","sourceRoot":"","sources":["../src/stepper.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,YAAY;IAC3B,+EAA+E;IAC/E,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,SAAS,CAAC;CAC5C;AAED,2FAA2F;AAC3F,wBAAgB,OAAO,CAAC,EACtB,KAAK,EACL,KAAK,EACL,SAAS,EACT,WAAW,EACX,QAAgB,EAChB,OAAiB,EACjB,SAAS,EACT,WAAsD,GACvD,EAAE,YAAY,+BAmBd"}
|
package/dist/stepper.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { ProgressBar } from '@lindaui/ui/compound';
|
|
4
|
+
|
|
5
|
+
/** The progress presentation shared by onboarding steps and compact connection wizards. */ function Stepper({ value, label, stepLabel, description, complete = false, variant = "steps", className, formatValue = (progress)=>`${Math.round(progress)}%` }) {
|
|
6
|
+
const progress = Number.isFinite(value) ? Math.max(0, Math.min(100, value)) : 0;
|
|
7
|
+
const compact = variant === "compact";
|
|
8
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
9
|
+
className: className ?? (compact ? "mx-auto max-w-xs space-y-2" : "mb-6"),
|
|
10
|
+
children: [
|
|
11
|
+
!compact && /*#__PURE__*/ jsxs("div", {
|
|
12
|
+
className: "mb-2 flex items-center justify-between font-bold text-muted text-xs uppercase tracking-widest",
|
|
13
|
+
children: [
|
|
14
|
+
/*#__PURE__*/ jsx("span", {
|
|
15
|
+
children: stepLabel
|
|
16
|
+
}),
|
|
17
|
+
/*#__PURE__*/ jsx("span", {
|
|
18
|
+
children: formatValue(progress)
|
|
19
|
+
})
|
|
20
|
+
]
|
|
21
|
+
}),
|
|
22
|
+
/*#__PURE__*/ jsx(ProgressBar, {
|
|
23
|
+
"aria-label": label,
|
|
24
|
+
color: complete ? "success" : "accent",
|
|
25
|
+
size: "sm",
|
|
26
|
+
value: progress,
|
|
27
|
+
children: /*#__PURE__*/ jsx(ProgressBar.Track, {
|
|
28
|
+
className: compact ? undefined : "rounded-full",
|
|
29
|
+
children: /*#__PURE__*/ jsx(ProgressBar.Fill, {
|
|
30
|
+
className: compact ? undefined : "rounded-full"
|
|
31
|
+
})
|
|
32
|
+
})
|
|
33
|
+
}),
|
|
34
|
+
description && /*#__PURE__*/ jsx("p", {
|
|
35
|
+
className: "text-muted text-xs",
|
|
36
|
+
children: description
|
|
37
|
+
})
|
|
38
|
+
]
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export { Stepper };
|