@adminlte/react 0.1.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/CHANGELOG.md +161 -0
- package/README.md +454 -0
- package/dist/context/accessibility.js +141 -0
- package/dist/context/body-class-sync.js +22 -0
- package/dist/context/color-mode-context.js +61 -0
- package/dist/context/command-palette-context.js +28 -0
- package/dist/context/html-dir.js +17 -0
- package/dist/context/link-context.js +18 -0
- package/dist/context/lte-behaviors.js +52 -0
- package/dist/context/sidebar-context.js +87 -0
- package/dist/css/adminlte.css +17259 -0
- package/dist/form/button.js +21 -0
- package/dist/form/input-color.js +30 -0
- package/dist/form/input-file.js +29 -0
- package/dist/form/input-flatpickr.js +45 -0
- package/dist/form/input-switch.js +26 -0
- package/dist/form/input-tom-select.js +59 -0
- package/dist/form/input.js +23 -0
- package/dist/form/select.js +25 -0
- package/dist/form/textarea.js +22 -0
- package/dist/hooks/use-card-widget.js +44 -0
- package/dist/hooks/use-direct-chat.js +16 -0
- package/dist/hooks/use-fullscreen.js +44 -0
- package/dist/hooks/use-push-menu.js +54 -0
- package/dist/hooks/use-sortable.js +26 -0
- package/dist/hooks/use-treeview-animation.js +27 -0
- package/dist/index.d.ts +1010 -0
- package/dist/index.js +145 -0
- package/dist/layout/app-content.js +18 -0
- package/dist/layout/auth-layout.js +25 -0
- package/dist/layout/color-mode-toggle.js +67 -0
- package/dist/layout/dashboard-layout.js +101 -0
- package/dist/layout/footer.js +19 -0
- package/dist/layout/sidebar-brand.js +16 -0
- package/dist/layout/sidebar-nav-item.js +46 -0
- package/dist/layout/sidebar-nav.js +43 -0
- package/dist/layout/sidebar-overlay.js +18 -0
- package/dist/layout/sidebar.js +48 -0
- package/dist/layout/topbar.js +128 -0
- package/dist/lib/class-name.js +6 -0
- package/dist/lib/flatten-menu.js +23 -0
- package/dist/tool/datatable.js +45 -0
- package/dist/tool/editor.js +72 -0
- package/dist/tool/modal.js +28 -0
- package/dist/types/direct-chat.js +0 -0
- package/dist/types/layout.js +0 -0
- package/dist/types/menu.js +0 -0
- package/dist/types/theme.js +0 -0
- package/dist/widget/accordion.js +35 -0
- package/dist/widget/alert.js +18 -0
- package/dist/widget/apex-chart.js +40 -0
- package/dist/widget/avatar.js +72 -0
- package/dist/widget/badge.js +20 -0
- package/dist/widget/breadcrumb.js +26 -0
- package/dist/widget/callout.js +11 -0
- package/dist/widget/card.js +84 -0
- package/dist/widget/carousel.js +56 -0
- package/dist/widget/command-palette.js +137 -0
- package/dist/widget/description-block.js +19 -0
- package/dist/widget/direct-chat.js +96 -0
- package/dist/widget/dropdown.js +63 -0
- package/dist/widget/info-box.js +24 -0
- package/dist/widget/list-group.js +47 -0
- package/dist/widget/nav-messages.js +48 -0
- package/dist/widget/nav-notifications.js +40 -0
- package/dist/widget/nav-tasks.js +60 -0
- package/dist/widget/offcanvas.js +61 -0
- package/dist/widget/pagination.js +93 -0
- package/dist/widget/profile-card.js +32 -0
- package/dist/widget/progress-group.js +23 -0
- package/dist/widget/progress.js +25 -0
- package/dist/widget/ratings.js +20 -0
- package/dist/widget/small-box.js +34 -0
- package/dist/widget/sparkline-chart.js +43 -0
- package/dist/widget/spinner.js +26 -0
- package/dist/widget/stepper.js +57 -0
- package/dist/widget/table.js +50 -0
- package/dist/widget/tabs.js +46 -0
- package/dist/widget/timeline.js +15 -0
- package/dist/widget/toast.js +41 -0
- package/dist/widget/tooltip.js +30 -0
- package/dist/widget/world-map.js +42 -0
- package/package.json +116 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../lib/class-name.js";
|
|
3
|
+
function Carousel({
|
|
4
|
+
id,
|
|
5
|
+
slides,
|
|
6
|
+
controls = true,
|
|
7
|
+
indicators = true,
|
|
8
|
+
ride,
|
|
9
|
+
fade,
|
|
10
|
+
interval,
|
|
11
|
+
className
|
|
12
|
+
}) {
|
|
13
|
+
return /* @__PURE__ */ jsxs(
|
|
14
|
+
"div",
|
|
15
|
+
{
|
|
16
|
+
id,
|
|
17
|
+
className: cn("carousel slide", fade && "carousel-fade", className),
|
|
18
|
+
"data-bs-ride": ride === true ? "true" : ride || void 0,
|
|
19
|
+
"data-bs-interval": interval,
|
|
20
|
+
children: [
|
|
21
|
+
indicators && /* @__PURE__ */ jsx("div", { className: "carousel-indicators", children: slides.map((_, idx) => /* @__PURE__ */ jsx(
|
|
22
|
+
"button",
|
|
23
|
+
{
|
|
24
|
+
type: "button",
|
|
25
|
+
"data-bs-target": `#${id}`,
|
|
26
|
+
"data-bs-slide-to": idx,
|
|
27
|
+
className: idx === 0 ? "active" : void 0,
|
|
28
|
+
"aria-current": idx === 0 ? "true" : void 0,
|
|
29
|
+
"aria-label": `Slide ${idx + 1}`
|
|
30
|
+
},
|
|
31
|
+
idx
|
|
32
|
+
)) }),
|
|
33
|
+
/* @__PURE__ */ jsx("div", { className: "carousel-inner", children: slides.map((slide, idx) => /* @__PURE__ */ jsxs("div", { className: cn("carousel-item", idx === 0 && "active"), children: [
|
|
34
|
+
slide.content ?? /* @__PURE__ */ jsx("img", { src: slide.src, alt: slide.alt ?? "", className: "d-block w-100" }),
|
|
35
|
+
slide.caption && /* @__PURE__ */ jsxs("div", { className: "carousel-caption d-none d-md-block", children: [
|
|
36
|
+
slide.caption.title && /* @__PURE__ */ jsx("h5", { children: slide.caption.title }),
|
|
37
|
+
slide.caption.text && /* @__PURE__ */ jsx("p", { children: slide.caption.text })
|
|
38
|
+
] })
|
|
39
|
+
] }, idx)) }),
|
|
40
|
+
controls && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
41
|
+
/* @__PURE__ */ jsxs("button", { className: "carousel-control-prev", type: "button", "data-bs-target": `#${id}`, "data-bs-slide": "prev", children: [
|
|
42
|
+
/* @__PURE__ */ jsx("span", { className: "carousel-control-prev-icon", "aria-hidden": "true" }),
|
|
43
|
+
/* @__PURE__ */ jsx("span", { className: "visually-hidden", children: "Previous" })
|
|
44
|
+
] }),
|
|
45
|
+
/* @__PURE__ */ jsxs("button", { className: "carousel-control-next", type: "button", "data-bs-target": `#${id}`, "data-bs-slide": "next", children: [
|
|
46
|
+
/* @__PURE__ */ jsx("span", { className: "carousel-control-next-icon", "aria-hidden": "true" }),
|
|
47
|
+
/* @__PURE__ */ jsx("span", { className: "visually-hidden", children: "Next" })
|
|
48
|
+
] })
|
|
49
|
+
] })
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
export {
|
|
55
|
+
Carousel
|
|
56
|
+
};
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useMemo, useRef, useState } from "react";
|
|
4
|
+
import { useRouter } from "next/navigation";
|
|
5
|
+
import { useCommandPalette } from "../context/command-palette-context.js";
|
|
6
|
+
const overlayStyle = {
|
|
7
|
+
position: "fixed",
|
|
8
|
+
inset: 0,
|
|
9
|
+
zIndex: 1080,
|
|
10
|
+
display: "flex",
|
|
11
|
+
alignItems: "flex-start",
|
|
12
|
+
justifyContent: "center",
|
|
13
|
+
paddingTop: "12vh",
|
|
14
|
+
background: "rgba(0, 0, 0, 0.5)"
|
|
15
|
+
};
|
|
16
|
+
const panelStyle = {
|
|
17
|
+
width: "min(640px, 92vw)",
|
|
18
|
+
maxHeight: "70vh",
|
|
19
|
+
overflow: "hidden",
|
|
20
|
+
display: "flex",
|
|
21
|
+
flexDirection: "column"
|
|
22
|
+
};
|
|
23
|
+
const listStyle = {
|
|
24
|
+
overflowY: "auto"
|
|
25
|
+
};
|
|
26
|
+
function CommandPalette({ items, placeholder = "Search pages\u2026" }) {
|
|
27
|
+
const ctx = useCommandPalette();
|
|
28
|
+
const router = useRouter();
|
|
29
|
+
const inputRef = useRef(null);
|
|
30
|
+
const [query, setQuery] = useState("");
|
|
31
|
+
const [active, setActive] = useState(0);
|
|
32
|
+
const isOpen = ctx?.isOpen ?? false;
|
|
33
|
+
const results = useMemo(() => {
|
|
34
|
+
const q = query.trim().toLowerCase();
|
|
35
|
+
if (!q) return items;
|
|
36
|
+
return items.filter(
|
|
37
|
+
(i) => i.label.toLowerCase().includes(q) || (i.section?.toLowerCase().includes(q) ?? false)
|
|
38
|
+
);
|
|
39
|
+
}, [query, items]);
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
if (!isOpen) return;
|
|
42
|
+
setQuery("");
|
|
43
|
+
setActive(0);
|
|
44
|
+
const t = setTimeout(() => inputRef.current?.focus(), 20);
|
|
45
|
+
return () => clearTimeout(t);
|
|
46
|
+
}, [isOpen]);
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
setActive(0);
|
|
49
|
+
}, [query]);
|
|
50
|
+
if (!isOpen || !ctx) return null;
|
|
51
|
+
const go = (item) => {
|
|
52
|
+
const target = item ?? results[active];
|
|
53
|
+
if (!target) return;
|
|
54
|
+
ctx.close();
|
|
55
|
+
router.push(target.href);
|
|
56
|
+
};
|
|
57
|
+
const onKeyDown = (e) => {
|
|
58
|
+
if (e.key === "ArrowDown") {
|
|
59
|
+
e.preventDefault();
|
|
60
|
+
setActive((a) => Math.min(a + 1, results.length - 1));
|
|
61
|
+
} else if (e.key === "ArrowUp") {
|
|
62
|
+
e.preventDefault();
|
|
63
|
+
setActive((a) => Math.max(a - 1, 0));
|
|
64
|
+
} else if (e.key === "Enter") {
|
|
65
|
+
e.preventDefault();
|
|
66
|
+
go();
|
|
67
|
+
} else if (e.key === "Escape") {
|
|
68
|
+
e.preventDefault();
|
|
69
|
+
ctx.close();
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
return /* @__PURE__ */ jsx(
|
|
73
|
+
"div",
|
|
74
|
+
{
|
|
75
|
+
style: overlayStyle,
|
|
76
|
+
onMouseDown: (e) => {
|
|
77
|
+
if (e.target === e.currentTarget) ctx.close();
|
|
78
|
+
},
|
|
79
|
+
children: /* @__PURE__ */ jsxs("div", { className: "card shadow-lg", style: panelStyle, role: "dialog", "aria-modal": "true", "aria-label": "Command palette", children: [
|
|
80
|
+
/* @__PURE__ */ jsxs("div", { className: "input-group input-group-lg border-bottom", children: [
|
|
81
|
+
/* @__PURE__ */ jsx("span", { className: "input-group-text bg-body border-0", children: /* @__PURE__ */ jsx("i", { className: "bi bi-search" }) }),
|
|
82
|
+
/* @__PURE__ */ jsx(
|
|
83
|
+
"input",
|
|
84
|
+
{
|
|
85
|
+
ref: inputRef,
|
|
86
|
+
value: query,
|
|
87
|
+
onChange: (e) => setQuery(e.target.value),
|
|
88
|
+
onKeyDown,
|
|
89
|
+
className: "form-control border-0 shadow-none",
|
|
90
|
+
placeholder,
|
|
91
|
+
"aria-label": "Search"
|
|
92
|
+
}
|
|
93
|
+
)
|
|
94
|
+
] }),
|
|
95
|
+
/* @__PURE__ */ jsxs("div", { className: "list-group list-group-flush", style: listStyle, children: [
|
|
96
|
+
results.length === 0 && /* @__PURE__ */ jsxs("div", { className: "text-secondary text-center py-4 small", children: [
|
|
97
|
+
"No results for \u201C",
|
|
98
|
+
query,
|
|
99
|
+
"\u201D"
|
|
100
|
+
] }),
|
|
101
|
+
results.map((item, idx) => /* @__PURE__ */ jsxs(
|
|
102
|
+
"button",
|
|
103
|
+
{
|
|
104
|
+
type: "button",
|
|
105
|
+
className: `list-group-item list-group-item-action d-flex align-items-center gap-2 ${idx === active ? "active" : ""}`,
|
|
106
|
+
onMouseEnter: () => setActive(idx),
|
|
107
|
+
onClick: () => go(item),
|
|
108
|
+
children: [
|
|
109
|
+
/* @__PURE__ */ jsx("i", { className: `bi ${item.icon || "bi-arrow-return-right"}` }),
|
|
110
|
+
/* @__PURE__ */ jsx("span", { className: "flex-grow-1 text-start", children: item.label }),
|
|
111
|
+
item.section && /* @__PURE__ */ jsx("span", { className: `badge fw-normal ${idx === active ? "text-bg-light" : "text-bg-secondary"}`, children: item.section })
|
|
112
|
+
]
|
|
113
|
+
},
|
|
114
|
+
item.href
|
|
115
|
+
))
|
|
116
|
+
] }),
|
|
117
|
+
/* @__PURE__ */ jsxs("div", { className: "card-footer d-flex justify-content-between align-items-center text-secondary small py-2", children: [
|
|
118
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
119
|
+
/* @__PURE__ */ jsx("kbd", { children: "\u2191" }),
|
|
120
|
+
" ",
|
|
121
|
+
/* @__PURE__ */ jsx("kbd", { children: "\u2193" }),
|
|
122
|
+
" navigate"
|
|
123
|
+
] }),
|
|
124
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
125
|
+
/* @__PURE__ */ jsx("kbd", { children: "\u21B5" }),
|
|
126
|
+
" open \xB7 ",
|
|
127
|
+
/* @__PURE__ */ jsx("kbd", { children: "esc" }),
|
|
128
|
+
" close"
|
|
129
|
+
] })
|
|
130
|
+
] })
|
|
131
|
+
] })
|
|
132
|
+
}
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
export {
|
|
136
|
+
CommandPalette
|
|
137
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
function DescriptionBlock({
|
|
3
|
+
title,
|
|
4
|
+
text,
|
|
5
|
+
items,
|
|
6
|
+
className
|
|
7
|
+
}) {
|
|
8
|
+
return /* @__PURE__ */ jsxs("div", { className: `description-block ${className || ""}`, children: [
|
|
9
|
+
/* @__PURE__ */ jsx("h5", { className: "description-header", children: title }),
|
|
10
|
+
text && /* @__PURE__ */ jsx("p", { className: "description-text", children: text }),
|
|
11
|
+
items && Object.entries(items).length > 0 && /* @__PURE__ */ jsx("dl", { className: "dl-horizontal", children: Object.entries(items).map(([label, value]) => /* @__PURE__ */ jsxs("div", { children: [
|
|
12
|
+
/* @__PURE__ */ jsx("dt", { children: label }),
|
|
13
|
+
/* @__PURE__ */ jsx("dd", { children: value })
|
|
14
|
+
] }, label)) })
|
|
15
|
+
] });
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
DescriptionBlock
|
|
19
|
+
};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
function DirectChat({
|
|
5
|
+
badge = 0,
|
|
6
|
+
contacts = [],
|
|
7
|
+
messages = [],
|
|
8
|
+
collapsible = true,
|
|
9
|
+
removable = true,
|
|
10
|
+
onRemove,
|
|
11
|
+
className
|
|
12
|
+
}) {
|
|
13
|
+
const [isCollapsed, setIsCollapsed] = useState(false);
|
|
14
|
+
const [isContactsOpen, setIsContactsOpen] = useState(false);
|
|
15
|
+
const [isRemoved, setIsRemoved] = useState(false);
|
|
16
|
+
if (isRemoved) return null;
|
|
17
|
+
const handleCollapse = () => setIsCollapsed(!isCollapsed);
|
|
18
|
+
const handleToggleContacts = () => setIsContactsOpen(!isContactsOpen);
|
|
19
|
+
const handleRemove = () => {
|
|
20
|
+
setIsRemoved(true);
|
|
21
|
+
onRemove?.();
|
|
22
|
+
};
|
|
23
|
+
return /* @__PURE__ */ jsxs("div", { className: `card direct-chat direct-chat-primary mb-4 ${isContactsOpen ? "direct-chat-contacts-open" : ""} ${className || ""}`.trim(), children: [
|
|
24
|
+
/* @__PURE__ */ jsxs("div", { className: "card-header", children: [
|
|
25
|
+
/* @__PURE__ */ jsx("h3", { className: "card-title", children: "Direct Chat" }),
|
|
26
|
+
/* @__PURE__ */ jsxs("div", { className: "card-tools", children: [
|
|
27
|
+
badge > 0 && /* @__PURE__ */ jsx("span", { title: `${badge} New Messages`, className: "badge text-bg-primary", children: badge }),
|
|
28
|
+
collapsible && /* @__PURE__ */ jsxs(
|
|
29
|
+
"button",
|
|
30
|
+
{
|
|
31
|
+
type: "button",
|
|
32
|
+
className: "btn btn-tool",
|
|
33
|
+
onClick: handleCollapse,
|
|
34
|
+
title: isCollapsed ? "Expand" : "Collapse",
|
|
35
|
+
children: [
|
|
36
|
+
/* @__PURE__ */ jsx("i", { "data-lte-icon": "expand", className: `bi ${isCollapsed ? "bi-plus-lg" : "bi-dash-lg"}` }),
|
|
37
|
+
/* @__PURE__ */ jsx("i", { "data-lte-icon": "collapse", className: `bi ${isCollapsed ? "d-none bi-plus-lg" : "d-none bi-dash-lg"}` })
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
),
|
|
41
|
+
/* @__PURE__ */ jsx(
|
|
42
|
+
"button",
|
|
43
|
+
{
|
|
44
|
+
type: "button",
|
|
45
|
+
className: "btn btn-tool",
|
|
46
|
+
title: "Contacts",
|
|
47
|
+
"data-lte-toggle": "chat-pane",
|
|
48
|
+
onClick: handleToggleContacts,
|
|
49
|
+
children: /* @__PURE__ */ jsx("i", { className: "bi bi-chat-text-fill" })
|
|
50
|
+
}
|
|
51
|
+
),
|
|
52
|
+
removable && /* @__PURE__ */ jsx("button", { type: "button", className: "btn btn-tool", onClick: handleRemove, title: "Remove", children: /* @__PURE__ */ jsx("i", { className: "bi bi-x-lg" }) })
|
|
53
|
+
] })
|
|
54
|
+
] }),
|
|
55
|
+
!isCollapsed && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
56
|
+
/* @__PURE__ */ jsxs("div", { className: "card-body", children: [
|
|
57
|
+
/* @__PURE__ */ jsx("div", { className: "direct-chat-messages", children: messages.map((msg, idx) => /* @__PURE__ */ jsxs("div", { className: `direct-chat-msg ${msg.isOwn ? "end" : ""}`, children: [
|
|
58
|
+
/* @__PURE__ */ jsx("div", { className: "direct-chat-infos clearfix", children: msg.isOwn ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
59
|
+
/* @__PURE__ */ jsx("span", { className: "direct-chat-name float-end", children: msg.from }),
|
|
60
|
+
/* @__PURE__ */ jsx("span", { className: "direct-chat-timestamp float-start", children: msg.timestamp })
|
|
61
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
62
|
+
/* @__PURE__ */ jsx("span", { className: "direct-chat-name float-start", children: msg.from }),
|
|
63
|
+
/* @__PURE__ */ jsx("span", { className: "direct-chat-timestamp float-end", children: msg.timestamp })
|
|
64
|
+
] }) }),
|
|
65
|
+
/* @__PURE__ */ jsx("img", { className: "direct-chat-img", src: msg.image, alt: msg.from }),
|
|
66
|
+
/* @__PURE__ */ jsx("div", { className: "direct-chat-text", children: msg.text })
|
|
67
|
+
] }, idx)) }),
|
|
68
|
+
contacts.length > 0 && /* @__PURE__ */ jsx("div", { className: "direct-chat-contacts", children: /* @__PURE__ */ jsx("ul", { className: "contacts-list", children: contacts.map((contact, idx) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs("a", { href: "#", children: [
|
|
69
|
+
/* @__PURE__ */ jsx("img", { className: "contacts-list-img", src: contact.image, alt: contact.name }),
|
|
70
|
+
/* @__PURE__ */ jsxs("div", { className: "contacts-list-info", children: [
|
|
71
|
+
/* @__PURE__ */ jsxs("span", { className: "contacts-list-name", children: [
|
|
72
|
+
contact.name,
|
|
73
|
+
/* @__PURE__ */ jsx("small", { className: "contacts-list-date float-end", children: contact.date })
|
|
74
|
+
] }),
|
|
75
|
+
/* @__PURE__ */ jsx("span", { className: "contacts-list-msg", children: contact.preview })
|
|
76
|
+
] })
|
|
77
|
+
] }) }, idx)) }) })
|
|
78
|
+
] }),
|
|
79
|
+
/* @__PURE__ */ jsx("div", { className: "card-footer", children: /* @__PURE__ */ jsx("form", { action: "#", method: "post", children: /* @__PURE__ */ jsxs("div", { className: "input-group", children: [
|
|
80
|
+
/* @__PURE__ */ jsx(
|
|
81
|
+
"input",
|
|
82
|
+
{
|
|
83
|
+
type: "text",
|
|
84
|
+
name: "message",
|
|
85
|
+
placeholder: "Type Message ...",
|
|
86
|
+
className: "form-control"
|
|
87
|
+
}
|
|
88
|
+
),
|
|
89
|
+
/* @__PURE__ */ jsx("span", { className: "input-group-append", children: /* @__PURE__ */ jsx("button", { type: "button", className: "btn btn-primary", children: "Send" }) })
|
|
90
|
+
] }) }) })
|
|
91
|
+
] })
|
|
92
|
+
] });
|
|
93
|
+
}
|
|
94
|
+
export {
|
|
95
|
+
DirectChat
|
|
96
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../lib/class-name.js";
|
|
3
|
+
function Dropdown({
|
|
4
|
+
label,
|
|
5
|
+
items,
|
|
6
|
+
theme = "primary",
|
|
7
|
+
size,
|
|
8
|
+
variant = "solid",
|
|
9
|
+
align = "start",
|
|
10
|
+
direction = "down",
|
|
11
|
+
split,
|
|
12
|
+
className
|
|
13
|
+
}) {
|
|
14
|
+
const btnTheme = variant === "outline" ? `btn-outline-${theme}` : `btn-${theme}`;
|
|
15
|
+
const btnSize = size ? `btn-${size}` : "";
|
|
16
|
+
const dirClass = direction === "down" ? "dropdown" : `drop${direction}`;
|
|
17
|
+
const menu = /* @__PURE__ */ jsx("ul", { className: cn("dropdown-menu", align === "end" && "dropdown-menu-end"), children: items.map((item, idx) => {
|
|
18
|
+
if (item.divider) {
|
|
19
|
+
return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx("hr", { className: "dropdown-divider" }) }, idx);
|
|
20
|
+
}
|
|
21
|
+
if (item.header) {
|
|
22
|
+
return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx("h6", { className: "dropdown-header", children: item.label }) }, idx);
|
|
23
|
+
}
|
|
24
|
+
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
25
|
+
item.icon && /* @__PURE__ */ jsx("i", { className: cn("bi", item.icon, "me-2"), "aria-hidden": "true" }),
|
|
26
|
+
item.label
|
|
27
|
+
] });
|
|
28
|
+
const itemClass = cn("dropdown-item", item.active && "active", item.disabled && "disabled");
|
|
29
|
+
return /* @__PURE__ */ jsx("li", { children: item.href ? /* @__PURE__ */ jsx("a", { className: itemClass, href: item.href, "aria-disabled": item.disabled, children: content }) : /* @__PURE__ */ jsx("button", { type: "button", className: itemClass, onClick: item.onClick, disabled: item.disabled, children: content }) }, idx);
|
|
30
|
+
}) });
|
|
31
|
+
if (split) {
|
|
32
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("btn-group", dirClass !== "dropdown" && dirClass, className), children: [
|
|
33
|
+
/* @__PURE__ */ jsx("button", { type: "button", className: cn("btn", btnTheme, btnSize), children: label }),
|
|
34
|
+
/* @__PURE__ */ jsx(
|
|
35
|
+
"button",
|
|
36
|
+
{
|
|
37
|
+
type: "button",
|
|
38
|
+
className: cn("btn", btnTheme, btnSize, "dropdown-toggle dropdown-toggle-split"),
|
|
39
|
+
"data-bs-toggle": "dropdown",
|
|
40
|
+
"aria-expanded": "false",
|
|
41
|
+
children: /* @__PURE__ */ jsx("span", { className: "visually-hidden", children: "Toggle dropdown" })
|
|
42
|
+
}
|
|
43
|
+
),
|
|
44
|
+
menu
|
|
45
|
+
] });
|
|
46
|
+
}
|
|
47
|
+
return /* @__PURE__ */ jsxs("div", { className: cn(dirClass, className), children: [
|
|
48
|
+
/* @__PURE__ */ jsx(
|
|
49
|
+
"button",
|
|
50
|
+
{
|
|
51
|
+
type: "button",
|
|
52
|
+
className: cn("btn", btnTheme, btnSize, "dropdown-toggle"),
|
|
53
|
+
"data-bs-toggle": "dropdown",
|
|
54
|
+
"aria-expanded": "false",
|
|
55
|
+
children: label
|
|
56
|
+
}
|
|
57
|
+
),
|
|
58
|
+
menu
|
|
59
|
+
] });
|
|
60
|
+
}
|
|
61
|
+
export {
|
|
62
|
+
Dropdown
|
|
63
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
function InfoBox({
|
|
3
|
+
title,
|
|
4
|
+
text,
|
|
5
|
+
icon,
|
|
6
|
+
theme = "info",
|
|
7
|
+
progress,
|
|
8
|
+
progressText
|
|
9
|
+
}) {
|
|
10
|
+
return /* @__PURE__ */ jsxs("div", { className: "info-box", children: [
|
|
11
|
+
icon && /* @__PURE__ */ jsx("span", { className: `info-box-icon text-bg-${theme}`, children: /* @__PURE__ */ jsx("i", { className: `bi ${icon}` }) }),
|
|
12
|
+
/* @__PURE__ */ jsxs("div", { className: "info-box-content", children: [
|
|
13
|
+
text && /* @__PURE__ */ jsx("span", { className: "info-box-text", children: text }),
|
|
14
|
+
title && /* @__PURE__ */ jsx("span", { className: "info-box-number", children: title }),
|
|
15
|
+
progress !== void 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
16
|
+
/* @__PURE__ */ jsx("div", { className: "progress", children: /* @__PURE__ */ jsx("div", { className: `progress-bar bg-${theme}`, style: { width: `${progress}%` } }) }),
|
|
17
|
+
progressText && /* @__PURE__ */ jsx("span", { className: "progress-description", children: progressText })
|
|
18
|
+
] })
|
|
19
|
+
] })
|
|
20
|
+
] });
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
InfoBox
|
|
24
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../lib/class-name.js";
|
|
3
|
+
function ListGroup({ flush, horizontal, className, children }) {
|
|
4
|
+
return /* @__PURE__ */ jsx(
|
|
5
|
+
"div",
|
|
6
|
+
{
|
|
7
|
+
className: cn(
|
|
8
|
+
"list-group",
|
|
9
|
+
flush && "list-group-flush",
|
|
10
|
+
horizontal && "list-group-horizontal",
|
|
11
|
+
className
|
|
12
|
+
),
|
|
13
|
+
children
|
|
14
|
+
}
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
function ListGroupItem({
|
|
18
|
+
active,
|
|
19
|
+
disabled,
|
|
20
|
+
action,
|
|
21
|
+
theme,
|
|
22
|
+
href,
|
|
23
|
+
onClick,
|
|
24
|
+
className,
|
|
25
|
+
children
|
|
26
|
+
}) {
|
|
27
|
+
const isAction = action || !!href || !!onClick;
|
|
28
|
+
const classes = cn(
|
|
29
|
+
"list-group-item",
|
|
30
|
+
isAction && "list-group-item-action",
|
|
31
|
+
active && "active",
|
|
32
|
+
disabled && "disabled",
|
|
33
|
+
theme && `list-group-item-${theme}`,
|
|
34
|
+
className
|
|
35
|
+
);
|
|
36
|
+
if (href) {
|
|
37
|
+
return /* @__PURE__ */ jsx("a", { href, className: classes, "aria-current": active ? "true" : void 0, "aria-disabled": disabled, children });
|
|
38
|
+
}
|
|
39
|
+
if (onClick) {
|
|
40
|
+
return /* @__PURE__ */ jsx("button", { type: "button", className: classes, onClick, disabled, children });
|
|
41
|
+
}
|
|
42
|
+
return /* @__PURE__ */ jsx("div", { className: classes, "aria-current": active ? "true" : void 0, children });
|
|
43
|
+
}
|
|
44
|
+
export {
|
|
45
|
+
ListGroup,
|
|
46
|
+
ListGroupItem
|
|
47
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
function NavMessages({
|
|
4
|
+
messages,
|
|
5
|
+
badgeColor = "danger",
|
|
6
|
+
count,
|
|
7
|
+
seeAllUrl = "#",
|
|
8
|
+
seeAllText = "See All Messages"
|
|
9
|
+
}) {
|
|
10
|
+
const badgeCount = count ?? messages.length;
|
|
11
|
+
return /* @__PURE__ */ jsxs("li", { className: "nav-item dropdown", children: [
|
|
12
|
+
/* @__PURE__ */ jsxs("a", { className: "nav-link", "data-bs-toggle": "dropdown", href: "#", children: [
|
|
13
|
+
/* @__PURE__ */ jsx("i", { className: "bi bi-chat-text" }),
|
|
14
|
+
messages.length > 0 && /* @__PURE__ */ jsx("span", { className: `navbar-badge badge text-bg-${badgeColor}`, children: badgeCount })
|
|
15
|
+
] }),
|
|
16
|
+
/* @__PURE__ */ jsxs("div", { className: "dropdown-menu dropdown-menu-lg dropdown-menu-end", children: [
|
|
17
|
+
messages.map((msg, idx) => /* @__PURE__ */ jsxs("div", { children: [
|
|
18
|
+
/* @__PURE__ */ jsx("a", { href: msg.url || "#", className: "dropdown-item", children: /* @__PURE__ */ jsxs("div", { className: "d-flex", children: [
|
|
19
|
+
msg.image && /* @__PURE__ */ jsx("div", { className: "flex-shrink-0", children: /* @__PURE__ */ jsx(
|
|
20
|
+
"img",
|
|
21
|
+
{
|
|
22
|
+
src: msg.image,
|
|
23
|
+
alt: msg.from,
|
|
24
|
+
className: "img-size-50 rounded-circle me-3"
|
|
25
|
+
}
|
|
26
|
+
) }),
|
|
27
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-grow-1", children: [
|
|
28
|
+
/* @__PURE__ */ jsxs("h3", { className: "dropdown-item-title", children: [
|
|
29
|
+
msg.from,
|
|
30
|
+
msg.star && /* @__PURE__ */ jsx("span", { className: `float-end fs-7 text-${msg.star}`, children: /* @__PURE__ */ jsx("i", { className: "bi bi-star-fill" }) })
|
|
31
|
+
] }),
|
|
32
|
+
/* @__PURE__ */ jsx("p", { className: "fs-7", children: msg.text }),
|
|
33
|
+
msg.time && /* @__PURE__ */ jsxs("p", { className: "fs-7 text-secondary", children: [
|
|
34
|
+
/* @__PURE__ */ jsx("i", { className: "bi bi-clock-fill me-1" }),
|
|
35
|
+
" ",
|
|
36
|
+
msg.time
|
|
37
|
+
] })
|
|
38
|
+
] })
|
|
39
|
+
] }) }),
|
|
40
|
+
/* @__PURE__ */ jsx("div", { className: "dropdown-divider" })
|
|
41
|
+
] }, idx)),
|
|
42
|
+
/* @__PURE__ */ jsx("a", { href: seeAllUrl, className: "dropdown-item dropdown-footer", children: seeAllText })
|
|
43
|
+
] })
|
|
44
|
+
] });
|
|
45
|
+
}
|
|
46
|
+
export {
|
|
47
|
+
NavMessages
|
|
48
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
function NavNotifications({
|
|
4
|
+
notifications,
|
|
5
|
+
badgeColor = "danger",
|
|
6
|
+
count,
|
|
7
|
+
seeAllUrl,
|
|
8
|
+
seeAllText = "See All Notifications"
|
|
9
|
+
}) {
|
|
10
|
+
const badgeCount = count ?? notifications.length;
|
|
11
|
+
return /* @__PURE__ */ jsxs("li", { className: "nav-item dropdown", children: [
|
|
12
|
+
/* @__PURE__ */ jsxs("a", { className: "nav-link", href: "#", "data-bs-toggle": "dropdown", children: [
|
|
13
|
+
/* @__PURE__ */ jsx("i", { className: "bi bi-bell-fill" }),
|
|
14
|
+
notifications.length > 0 && /* @__PURE__ */ jsx("span", { className: `navbar-badge badge text-bg-${badgeColor}`, children: badgeCount })
|
|
15
|
+
] }),
|
|
16
|
+
/* @__PURE__ */ jsxs("div", { className: "dropdown-menu dropdown-menu-lg dropdown-menu-end", children: [
|
|
17
|
+
/* @__PURE__ */ jsxs("span", { className: "dropdown-item dropdown-header", children: [
|
|
18
|
+
badgeCount,
|
|
19
|
+
" Notifications"
|
|
20
|
+
] }),
|
|
21
|
+
/* @__PURE__ */ jsx("div", { className: "dropdown-divider" }),
|
|
22
|
+
notifications.map((notif, idx) => /* @__PURE__ */ jsxs("div", { children: [
|
|
23
|
+
notif.url ? /* @__PURE__ */ jsxs("a", { href: notif.url, className: "dropdown-item", children: [
|
|
24
|
+
notif.icon && /* @__PURE__ */ jsx("i", { className: `bi ${notif.icon} me-2` }),
|
|
25
|
+
/* @__PURE__ */ jsx("span", { children: notif.text }),
|
|
26
|
+
notif.time && /* @__PURE__ */ jsx("span", { className: "float-end text-secondary fs-7", children: notif.time })
|
|
27
|
+
] }) : /* @__PURE__ */ jsxs("div", { className: "dropdown-item", children: [
|
|
28
|
+
notif.icon && /* @__PURE__ */ jsx("i", { className: `bi ${notif.icon} me-2` }),
|
|
29
|
+
/* @__PURE__ */ jsx("span", { children: notif.text }),
|
|
30
|
+
notif.time && /* @__PURE__ */ jsx("span", { className: "float-end text-secondary fs-7", children: notif.time })
|
|
31
|
+
] }),
|
|
32
|
+
/* @__PURE__ */ jsx("div", { className: "dropdown-divider" })
|
|
33
|
+
] }, idx)),
|
|
34
|
+
seeAllUrl && /* @__PURE__ */ jsx("a", { href: seeAllUrl, className: "dropdown-item dropdown-footer", children: seeAllText })
|
|
35
|
+
] })
|
|
36
|
+
] });
|
|
37
|
+
}
|
|
38
|
+
export {
|
|
39
|
+
NavNotifications
|
|
40
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
function NavTasks({
|
|
4
|
+
tasks,
|
|
5
|
+
badgeColor = "warning",
|
|
6
|
+
seeAllUrl,
|
|
7
|
+
seeAllText = "See All Tasks"
|
|
8
|
+
}) {
|
|
9
|
+
return /* @__PURE__ */ jsxs("li", { className: "nav-item dropdown", children: [
|
|
10
|
+
/* @__PURE__ */ jsxs("a", { className: "nav-link", href: "#", "data-bs-toggle": "dropdown", children: [
|
|
11
|
+
/* @__PURE__ */ jsx("i", { className: "bi bi-flag-fill" }),
|
|
12
|
+
tasks.length > 0 && /* @__PURE__ */ jsx("span", { className: `navbar-badge badge text-bg-${badgeColor}`, children: tasks.length })
|
|
13
|
+
] }),
|
|
14
|
+
/* @__PURE__ */ jsxs("div", { className: "dropdown-menu dropdown-menu-lg dropdown-menu-end", children: [
|
|
15
|
+
/* @__PURE__ */ jsxs("span", { className: "dropdown-item dropdown-header", children: [
|
|
16
|
+
tasks.length,
|
|
17
|
+
" Tasks"
|
|
18
|
+
] }),
|
|
19
|
+
/* @__PURE__ */ jsx("div", { className: "dropdown-divider" }),
|
|
20
|
+
tasks.map((task, idx) => /* @__PURE__ */ jsxs("div", { children: [
|
|
21
|
+
task.url ? /* @__PURE__ */ jsxs("a", { href: task.url, className: "dropdown-item", children: [
|
|
22
|
+
/* @__PURE__ */ jsxs("div", { className: "d-flex align-items-center", children: [
|
|
23
|
+
/* @__PURE__ */ jsx("span", { className: "flex-grow-1", children: task.text }),
|
|
24
|
+
/* @__PURE__ */ jsxs("span", { className: "fs-7", children: [
|
|
25
|
+
task.progress,
|
|
26
|
+
"%"
|
|
27
|
+
] })
|
|
28
|
+
] }),
|
|
29
|
+
/* @__PURE__ */ jsx("div", { className: "progress", children: /* @__PURE__ */ jsx(
|
|
30
|
+
"div",
|
|
31
|
+
{
|
|
32
|
+
className: `progress-bar bg-${task.color || "primary"}`,
|
|
33
|
+
style: { width: `${task.progress}%` }
|
|
34
|
+
}
|
|
35
|
+
) })
|
|
36
|
+
] }) : /* @__PURE__ */ jsxs("div", { className: "dropdown-item", children: [
|
|
37
|
+
/* @__PURE__ */ jsxs("div", { className: "d-flex align-items-center", children: [
|
|
38
|
+
/* @__PURE__ */ jsx("span", { className: "flex-grow-1", children: task.text }),
|
|
39
|
+
/* @__PURE__ */ jsxs("span", { className: "fs-7", children: [
|
|
40
|
+
task.progress,
|
|
41
|
+
"%"
|
|
42
|
+
] })
|
|
43
|
+
] }),
|
|
44
|
+
/* @__PURE__ */ jsx("div", { className: "progress", children: /* @__PURE__ */ jsx(
|
|
45
|
+
"div",
|
|
46
|
+
{
|
|
47
|
+
className: `progress-bar bg-${task.color || "primary"}`,
|
|
48
|
+
style: { width: `${task.progress}%` }
|
|
49
|
+
}
|
|
50
|
+
) })
|
|
51
|
+
] }),
|
|
52
|
+
/* @__PURE__ */ jsx("div", { className: "dropdown-divider" })
|
|
53
|
+
] }, idx)),
|
|
54
|
+
seeAllUrl && /* @__PURE__ */ jsx("a", { href: seeAllUrl, className: "dropdown-item dropdown-footer", children: seeAllText })
|
|
55
|
+
] })
|
|
56
|
+
] });
|
|
57
|
+
}
|
|
58
|
+
export {
|
|
59
|
+
NavTasks
|
|
60
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../lib/class-name.js";
|
|
3
|
+
function Offcanvas({
|
|
4
|
+
id,
|
|
5
|
+
title,
|
|
6
|
+
placement = "start",
|
|
7
|
+
scroll,
|
|
8
|
+
backdrop = true,
|
|
9
|
+
footer,
|
|
10
|
+
className,
|
|
11
|
+
children
|
|
12
|
+
}) {
|
|
13
|
+
return /* @__PURE__ */ jsxs(
|
|
14
|
+
"div",
|
|
15
|
+
{
|
|
16
|
+
className: cn(`offcanvas offcanvas-${placement}`, className),
|
|
17
|
+
tabIndex: -1,
|
|
18
|
+
id,
|
|
19
|
+
"aria-labelledby": `${id}-label`,
|
|
20
|
+
"data-bs-scroll": scroll ? "true" : void 0,
|
|
21
|
+
"data-bs-backdrop": backdrop ? void 0 : "false",
|
|
22
|
+
children: [
|
|
23
|
+
/* @__PURE__ */ jsxs("div", { className: "offcanvas-header", children: [
|
|
24
|
+
title && /* @__PURE__ */ jsx("h5", { className: "offcanvas-title", id: `${id}-label`, children: title }),
|
|
25
|
+
/* @__PURE__ */ jsx("button", { type: "button", className: "btn-close", "data-bs-dismiss": "offcanvas", "aria-label": "Close" })
|
|
26
|
+
] }),
|
|
27
|
+
/* @__PURE__ */ jsx("div", { className: "offcanvas-body", children }),
|
|
28
|
+
footer && /* @__PURE__ */ jsx("div", { className: "offcanvas-header border-top", children: footer })
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
function OffcanvasTrigger({
|
|
34
|
+
target,
|
|
35
|
+
theme = "primary",
|
|
36
|
+
variant = "solid",
|
|
37
|
+
size,
|
|
38
|
+
className,
|
|
39
|
+
children
|
|
40
|
+
}) {
|
|
41
|
+
return /* @__PURE__ */ jsx(
|
|
42
|
+
"button",
|
|
43
|
+
{
|
|
44
|
+
type: "button",
|
|
45
|
+
className: cn(
|
|
46
|
+
"btn",
|
|
47
|
+
variant === "outline" ? `btn-outline-${theme}` : `btn-${theme}`,
|
|
48
|
+
size && `btn-${size}`,
|
|
49
|
+
className
|
|
50
|
+
),
|
|
51
|
+
"data-bs-toggle": "offcanvas",
|
|
52
|
+
"data-bs-target": `#${target}`,
|
|
53
|
+
"aria-controls": target,
|
|
54
|
+
children
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
export {
|
|
59
|
+
Offcanvas,
|
|
60
|
+
OffcanvasTrigger
|
|
61
|
+
};
|