@okjt/dashboard 0.3.0 → 0.5.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/dist/AdminFloatingToolbar.js +11 -4
- package/dist/AdminInput.js +25 -53
- package/dist/AdminPageHero.js +69 -4
- package/dist/AdminPageLayout.js +24 -2
- package/dist/AdminSidePanel.js +87 -39
- package/dist/AdminSummaryCards.js +64 -1
- package/dist/AdminTutorial.js +47 -10
- package/dist/AuthContext.js +95 -56
- package/dist/AuthLayout.js +2 -2
- package/dist/BoldToolbar.js +272 -0
- package/dist/CollaborationContext.js +1 -1
- package/dist/ConfirmPasswordPage.js +41 -0
- package/dist/DashboardHeader.js +1 -1
- package/dist/DashboardIcon.js +15 -0
- package/dist/DashboardProvider.js +10 -1
- package/dist/EmptyState.js +42 -11
- package/dist/ForgotPasswordPage.js +39 -0
- package/dist/GoogleButton.js +1 -1
- package/dist/GoogleCallbackPage.js +3 -3
- package/dist/NotificationsBell.js +11 -23
- package/dist/ResetPasswordPage.js +61 -0
- package/dist/SignInPage.js +125 -42
- package/dist/TwoFactorForm.js +18 -3
- package/dist/UnsavedChangesStatus.js +3 -1
- package/dist/index.js +77 -51
- package/dist/useUnsavedChangesGuard.js +65 -3
- package/package.json +2 -2
|
@@ -7,7 +7,13 @@ import AdminToolbarSearch from "./AdminToolbarSearch.js";
|
|
|
7
7
|
import AdminToolbarFilters, { countActiveFilters } from "./AdminToolbarFilters.js";
|
|
8
8
|
import { useSearch } from "./SearchContext.js";
|
|
9
9
|
import { Button, useVisibleActions } from "@okjt/ui";
|
|
10
|
-
|
|
10
|
+
import BoldToolbar from "./BoldToolbar.js";
|
|
11
|
+
import { useComponentDefaults } from "./DashboardProvider.js";
|
|
12
|
+
function AdminFloatingToolbar(ownProps) {
|
|
13
|
+
const { variant = "plain", ...props } = useComponentDefaults("FloatingToolbar", ownProps);
|
|
14
|
+
return variant === "bold" ? /* @__PURE__ */ jsx(BoldToolbar, { ...props }) : /* @__PURE__ */ jsx(PlainToolbar, { ...props });
|
|
15
|
+
}
|
|
16
|
+
function PlainToolbar({
|
|
11
17
|
actions = [],
|
|
12
18
|
children = null,
|
|
13
19
|
search = null,
|
|
@@ -40,10 +46,11 @@ function AdminFloatingToolbar({
|
|
|
40
46
|
children: /* @__PURE__ */ jsxs(
|
|
41
47
|
"div",
|
|
42
48
|
{
|
|
43
|
-
className: "admin-floating-toolbar flex flex-wrap items-center justify-center gap-1 sm:gap-2 p-1.5 sm:p-2 rounded-2xl border
|
|
49
|
+
className: "admin-floating-toolbar flex flex-wrap items-center justify-center gap-1 sm:gap-2 p-1.5 sm:p-2 rounded-2xl border shadow-2xl backdrop-blur-md",
|
|
44
50
|
style: {
|
|
45
|
-
background: "rgba(255, 249, 245, 0.92)",
|
|
46
|
-
|
|
51
|
+
background: "var(--okjt-toolbar-bg, rgba(255, 249, 245, 0.92))",
|
|
52
|
+
borderColor: "var(--okjt-toolbar-border, rgba(255, 255, 255, 0.4))",
|
|
53
|
+
boxShadow: "0 12px 40px color-mix(in srgb, var(--okjt-shadow, var(--color-body)) 18%, transparent)"
|
|
47
54
|
},
|
|
48
55
|
children: [
|
|
49
56
|
searchProps && /* @__PURE__ */ jsx(AdminToolbarSearch, { ...searchProps }),
|
package/dist/AdminInput.js
CHANGED
|
@@ -1,64 +1,36 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useId } from "react";
|
|
3
|
-
const baseInputClasses = "w-full px-4 py-2 rounded-lg border border-tone-200 focus:outline-none focus:ring-2 focus:ring-accent/20 focus:border-accent transition-colors";
|
|
4
|
-
function
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"input",
|
|
2
|
+
import { forwardRef, useId } from "react";
|
|
3
|
+
const baseInputClasses = "w-full px-4 py-2 rounded-lg border border-tone-200 bg-[var(--okjt-field-bg,transparent)] text-[color:var(--okjt-field-text,inherit)] focus:outline-none focus:ring-2 focus:ring-accent/20 focus:border-accent transition-colors";
|
|
4
|
+
function makeField(Tag, extraClasses, displayName) {
|
|
5
|
+
const Field = forwardRef(function Field2({ label, error, bare = false, className = "", id, children, ...props }, ref) {
|
|
6
|
+
const generatedId = useId();
|
|
7
|
+
const inputId = id || generatedId;
|
|
8
|
+
const errorId = `${inputId}-error`;
|
|
9
|
+
const control = /* @__PURE__ */ jsx(
|
|
10
|
+
Tag,
|
|
12
11
|
{
|
|
12
|
+
ref,
|
|
13
13
|
id: inputId,
|
|
14
14
|
"aria-invalid": error ? true : void 0,
|
|
15
|
-
"aria-describedby": error ? errorId : void 0,
|
|
16
|
-
className: `${baseInputClasses} ${error ? "border-red-400" : ""} ${className}`,
|
|
17
|
-
...props
|
|
18
|
-
}
|
|
19
|
-
),
|
|
20
|
-
error && /* @__PURE__ */ jsx("p", { id: errorId, className: "text-red-500 text-xs mt-1", children: error })
|
|
21
|
-
] });
|
|
22
|
-
}
|
|
23
|
-
function AdminTextarea({ label, error, className = "", id, ...props }) {
|
|
24
|
-
const generatedId = useId();
|
|
25
|
-
const inputId = id || generatedId;
|
|
26
|
-
const errorId = `${inputId}-error`;
|
|
27
|
-
return /* @__PURE__ */ jsxs("div", { children: [
|
|
28
|
-
label && /* @__PURE__ */ jsx("label", { htmlFor: inputId, className: "block text-sm font-medium text-tone-600 mb-1", children: label }),
|
|
29
|
-
/* @__PURE__ */ jsx(
|
|
30
|
-
"textarea",
|
|
31
|
-
{
|
|
32
|
-
id: inputId,
|
|
33
|
-
"aria-invalid": error ? true : void 0,
|
|
34
|
-
"aria-describedby": error ? errorId : void 0,
|
|
35
|
-
className: `${baseInputClasses} resize-none ${error ? "border-red-400" : ""} ${className}`,
|
|
36
|
-
...props
|
|
37
|
-
}
|
|
38
|
-
),
|
|
39
|
-
error && /* @__PURE__ */ jsx("p", { id: errorId, className: "text-red-500 text-xs mt-1", children: error })
|
|
40
|
-
] });
|
|
41
|
-
}
|
|
42
|
-
function AdminSelect({ label, error, children, className = "", id, ...props }) {
|
|
43
|
-
const generatedId = useId();
|
|
44
|
-
const inputId = id || generatedId;
|
|
45
|
-
const errorId = `${inputId}-error`;
|
|
46
|
-
return /* @__PURE__ */ jsxs("div", { children: [
|
|
47
|
-
label && /* @__PURE__ */ jsx("label", { htmlFor: inputId, className: "block text-sm font-medium text-tone-600 mb-1", children: label }),
|
|
48
|
-
/* @__PURE__ */ jsx(
|
|
49
|
-
"select",
|
|
50
|
-
{
|
|
51
|
-
id: inputId,
|
|
52
|
-
"aria-invalid": error ? true : void 0,
|
|
53
|
-
"aria-describedby": error ? errorId : void 0,
|
|
54
|
-
className: `${baseInputClasses} ${error ? "border-red-400" : ""} ${className}`,
|
|
15
|
+
"aria-describedby": error && !bare ? errorId : void 0,
|
|
16
|
+
className: `${baseInputClasses}${extraClasses ? ` ${extraClasses}` : ""} ${error ? "border-red-400" : ""} ${className}`,
|
|
55
17
|
...props,
|
|
56
18
|
children
|
|
57
19
|
}
|
|
58
|
-
)
|
|
59
|
-
|
|
60
|
-
|
|
20
|
+
);
|
|
21
|
+
if (bare) return control;
|
|
22
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
23
|
+
label && /* @__PURE__ */ jsx("label", { htmlFor: inputId, className: "block text-sm font-medium text-tone-600 mb-1", children: label }),
|
|
24
|
+
control,
|
|
25
|
+
error && /* @__PURE__ */ jsx("p", { id: errorId, className: "text-red-500 text-xs mt-1", children: error })
|
|
26
|
+
] });
|
|
27
|
+
});
|
|
28
|
+
Field.displayName = displayName;
|
|
29
|
+
return Field;
|
|
61
30
|
}
|
|
31
|
+
const AdminInput = makeField("input", "", "AdminInput");
|
|
32
|
+
const AdminTextarea = makeField("textarea", "resize-none", "AdminTextarea");
|
|
33
|
+
const AdminSelect = makeField("select", "", "AdminSelect");
|
|
62
34
|
export {
|
|
63
35
|
AdminInput,
|
|
64
36
|
AdminSelect,
|
package/dist/AdminPageHero.js
CHANGED
|
@@ -2,10 +2,11 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useEffect, useRef, useState } from "react";
|
|
3
3
|
import { createPortal } from "react-dom";
|
|
4
4
|
import { Link } from "react-router-dom";
|
|
5
|
-
import { ChevronRight } from "lucide-react";
|
|
6
|
-
import { motion } from "framer-motion";
|
|
5
|
+
import { ArrowUp, ChevronRight } from "lucide-react";
|
|
6
|
+
import { AnimatePresence, motion } from "framer-motion";
|
|
7
|
+
import DashboardIcon from "./DashboardIcon.js";
|
|
7
8
|
import { useAdminChrome } from "./AdminChromeContext.js";
|
|
8
|
-
import { useDashboard } from "./DashboardProvider.js";
|
|
9
|
+
import { useComponentDefaults, useDashboard } from "./DashboardProvider.js";
|
|
9
10
|
const HEADER_OFFSET = 64;
|
|
10
11
|
function useVisibleBelowHeader(ref) {
|
|
11
12
|
const [visible, setVisible] = useState(true);
|
|
@@ -21,7 +22,11 @@ function useVisibleBelowHeader(ref) {
|
|
|
21
22
|
}, [ref]);
|
|
22
23
|
return visible;
|
|
23
24
|
}
|
|
24
|
-
function AdminPageHero(
|
|
25
|
+
function AdminPageHero(ownProps) {
|
|
26
|
+
const { variant = "plain", ...props } = useComponentDefaults("PageHero", ownProps);
|
|
27
|
+
return variant === "bold" ? /* @__PURE__ */ jsx(BoldPageHero, { ...props }) : /* @__PURE__ */ jsx(PlainPageHero, { ...props });
|
|
28
|
+
}
|
|
29
|
+
function PlainPageHero({ title, description, breadcrumb, icon }) {
|
|
25
30
|
const { home } = useDashboard();
|
|
26
31
|
const crumbs = Array.isArray(breadcrumb) ? breadcrumb : [home, { label: breadcrumb || title }];
|
|
27
32
|
const heroRef = useRef(null);
|
|
@@ -96,6 +101,66 @@ function AdminPageHero({ title, description, breadcrumb, icon }) {
|
|
|
96
101
|
] }) })
|
|
97
102
|
] });
|
|
98
103
|
}
|
|
104
|
+
const SmallUpArrow = ({ className = "" }) => /* @__PURE__ */ jsx(ArrowUp, { className: `${className} inline h-3 w-3` });
|
|
105
|
+
function BoldBreadcrumb({ items }) {
|
|
106
|
+
if (!items?.length) return null;
|
|
107
|
+
return /* @__PURE__ */ jsx("nav", { className: "flex items-center gap-2 mb-3 text-sm", children: items.map((item, index) => /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
108
|
+
index > 0 && /* @__PURE__ */ jsx(DashboardIcon, { icon: "crumb", fallback: ChevronRight, className: "text-faint/70 text-xs" }),
|
|
109
|
+
item.href || item.path ? /* @__PURE__ */ jsx(Link, { to: item.href || item.path, className: "text-soft hover:text-ink transition", children: item.label }) : /* @__PURE__ */ jsx("span", { className: "text-body", children: item.label })
|
|
110
|
+
] }, index)) });
|
|
111
|
+
}
|
|
112
|
+
function BoldPageHero({ title, subtitle, description, breadcrumbs = [], breadcrumb, actions = null }) {
|
|
113
|
+
const crumbs = breadcrumbs.length ? breadcrumbs : Array.isArray(breadcrumb) ? breadcrumb : [];
|
|
114
|
+
const heroRef = useRef(null);
|
|
115
|
+
const visible = useVisibleBelowHeader(heroRef);
|
|
116
|
+
const { titleSlot } = useAdminChrome();
|
|
117
|
+
const parent = crumbs.length > 1 ? crumbs[crumbs.length - 2] : null;
|
|
118
|
+
const parentTo = parent?.href || parent?.path;
|
|
119
|
+
const compactTitle = titleSlot && createPortal(
|
|
120
|
+
/* @__PURE__ */ jsx(AnimatePresence, { initial: false, children: !visible && /* @__PURE__ */ jsxs(
|
|
121
|
+
motion.div,
|
|
122
|
+
{
|
|
123
|
+
initial: { opacity: 0, y: -6 },
|
|
124
|
+
animate: { opacity: 1, y: 0 },
|
|
125
|
+
exit: { opacity: 0, y: -6 },
|
|
126
|
+
transition: { duration: 0.15 },
|
|
127
|
+
className: "flex items-center gap-3 min-w-0",
|
|
128
|
+
children: [
|
|
129
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 leading-tight", children: [
|
|
130
|
+
parent && /* @__PURE__ */ jsx("p", { className: "hidden sm:block text-[11px] text-soft truncate", children: parentTo ? /* @__PURE__ */ jsx(Link, { to: parentTo, className: "hover:text-ink transition", children: parent.label }) : parent.label }),
|
|
131
|
+
/* @__PURE__ */ jsx("p", { className: "text-ink font-semibold truncate", children: title })
|
|
132
|
+
] }),
|
|
133
|
+
/* @__PURE__ */ jsxs(
|
|
134
|
+
"button",
|
|
135
|
+
{
|
|
136
|
+
type: "button",
|
|
137
|
+
onClick: () => window.scrollTo({ top: 0, behavior: "smooth" }),
|
|
138
|
+
className: "hidden md:inline text-xs text-soft hover:text-ink whitespace-nowrap transition",
|
|
139
|
+
title: "Back to top",
|
|
140
|
+
children: [
|
|
141
|
+
/* @__PURE__ */ jsx(DashboardIcon, { icon: "arrow-up", fallback: SmallUpArrow, className: "mr-1" }),
|
|
142
|
+
"Top"
|
|
143
|
+
]
|
|
144
|
+
}
|
|
145
|
+
)
|
|
146
|
+
]
|
|
147
|
+
},
|
|
148
|
+
"compact-title"
|
|
149
|
+
) }),
|
|
150
|
+
titleSlot
|
|
151
|
+
);
|
|
152
|
+
return /* @__PURE__ */ jsxs("div", { className: "mb-6", ref: heroRef, children: [
|
|
153
|
+
compactTitle,
|
|
154
|
+
/* @__PURE__ */ jsx(BoldBreadcrumb, { items: crumbs }),
|
|
155
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-4 flex-wrap", children: [
|
|
156
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
157
|
+
/* @__PURE__ */ jsx("h1", { className: "text-2xl md:text-3xl font-bold text-ink", children: title }),
|
|
158
|
+
(subtitle || description) && /* @__PURE__ */ jsx("p", { className: "text-soft mt-1 text-sm md:text-base", children: subtitle || description })
|
|
159
|
+
] }),
|
|
160
|
+
actions && /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2 flex-wrap", children: actions })
|
|
161
|
+
] })
|
|
162
|
+
] });
|
|
163
|
+
}
|
|
99
164
|
export {
|
|
100
165
|
AdminPageHero as default
|
|
101
166
|
};
|
package/dist/AdminPageLayout.js
CHANGED
|
@@ -2,8 +2,12 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { motion } from "framer-motion";
|
|
3
3
|
import AdminFloatingToolbar from "./AdminFloatingToolbar.js";
|
|
4
4
|
import { SidePanelAside, SidePanelMobileBar } from "./AdminSidePanel.js";
|
|
5
|
-
import { useDashboard } from "./DashboardProvider.js";
|
|
6
|
-
function AdminPageLayout({
|
|
5
|
+
import { useComponentDefaults, useDashboard } from "./DashboardProvider.js";
|
|
6
|
+
function AdminPageLayout(ownProps) {
|
|
7
|
+
const { variant = "plain", ...props } = useComponentDefaults("PageLayout", ownProps);
|
|
8
|
+
return variant === "bold" ? /* @__PURE__ */ jsx(BoldPageLayout, { ...props }) : /* @__PURE__ */ jsx(PlainPageLayout, { ...props });
|
|
9
|
+
}
|
|
10
|
+
function PlainPageLayout({
|
|
7
11
|
hero,
|
|
8
12
|
summary,
|
|
9
13
|
children,
|
|
@@ -49,6 +53,24 @@ function AdminPageLayout({
|
|
|
49
53
|
showToolbar && /* @__PURE__ */ jsx(AdminFloatingToolbar, { actions, search, filters, children: toolbarContent })
|
|
50
54
|
] });
|
|
51
55
|
}
|
|
56
|
+
function BoldPageLayout({ hero, summary = null, toolbar = null, panel: pagePanel, fill = false, onClick, className = "", bodyClassName = "", children }) {
|
|
57
|
+
const defaultPanel = useDashboard().useDefaultPanel();
|
|
58
|
+
const panel = pagePanel === false ? null : pagePanel || defaultPanel;
|
|
59
|
+
const classes = `fit:h-[calc(100dvh-12rem)] fit:flex fit:flex-col ${className}`.trim();
|
|
60
|
+
const body = fill ? "fit:h-full fit:flex fit:flex-col" : "fit:h-full fit:overflow-y-auto fit:overscroll-contain fit:-mx-1 fit:px-1 fit:pb-2";
|
|
61
|
+
return /* @__PURE__ */ jsxs("div", { onClick, className: classes, "data-layout": fill ? "fill" : "fit", children: [
|
|
62
|
+
/* @__PURE__ */ jsxs("div", { className: "fit:shrink-0", children: [
|
|
63
|
+
hero,
|
|
64
|
+
summary && /* @__PURE__ */ jsx("div", { className: "mb-6", children: summary })
|
|
65
|
+
] }),
|
|
66
|
+
toolbar && /* @__PURE__ */ jsx(AdminFloatingToolbar, { variant: "bold", ...toolbar }),
|
|
67
|
+
panel && !panel.desktopOnly && panel.mobile !== false && /* @__PURE__ */ jsx(SidePanelMobileBar, { panel }),
|
|
68
|
+
/* @__PURE__ */ jsxs("div", { className: `fit:flex-1 fit:min-h-0 ${panel ? "lg:flex lg:gap-5" : ""}`, children: [
|
|
69
|
+
/* @__PURE__ */ jsx("div", { "data-scroll-region": fill ? void 0 : true, className: `min-w-0 ${panel ? "lg:flex-1" : ""} ${body} ${bodyClassName}`, children }),
|
|
70
|
+
panel && /* @__PURE__ */ jsx(SidePanelAside, { panel }, panel.id || panel.title)
|
|
71
|
+
] })
|
|
72
|
+
] });
|
|
73
|
+
}
|
|
52
74
|
export {
|
|
53
75
|
AdminPageLayout as default
|
|
54
76
|
};
|
package/dist/AdminSidePanel.js
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useDashboard, useComponentDefaults } from "./DashboardProvider.js";
|
|
3
|
+
import DashboardIcon, { toIcon } from "./DashboardIcon.js";
|
|
2
4
|
import { useEffect, useRef, useState } from "react";
|
|
3
5
|
import { AnimatePresence, Reorder, motion, useDragControls } from "framer-motion";
|
|
4
6
|
import { Check, CheckSquare, ChevronUp, GripVertical, ListChecks, PanelRightClose, PanelRightOpen, X } from "lucide-react";
|
|
5
7
|
import { Button, Overlay, buttonClass, usePermissions, useVisibleActions } from "@okjt/ui";
|
|
8
|
+
const useLook = () => useComponentDefaults("SidePanel", {}).variant || "plain";
|
|
9
|
+
const Named = ({ name, fallback: Fallback, className }) => /* @__PURE__ */ jsx(DashboardIcon, { icon: name, fallback: Fallback, className });
|
|
6
10
|
function Badge({ item }) {
|
|
11
|
+
if (useLook() === "bold") return /* @__PURE__ */ jsx(BoldBadge, { item });
|
|
7
12
|
if (item.badge > 0) {
|
|
8
13
|
return /* @__PURE__ */ jsx("span", { className: "ml-auto shrink-0 min-w-[1.25rem] h-5 px-1.5 rounded-full bg-accent/15 text-accent-dark text-[11px] font-semibold flex items-center justify-center", children: item.badge > 99 ? "99+" : item.badge });
|
|
9
14
|
}
|
|
@@ -15,7 +20,17 @@ function Badge({ item }) {
|
|
|
15
20
|
}
|
|
16
21
|
return null;
|
|
17
22
|
}
|
|
23
|
+
function BoldBadge({ item }) {
|
|
24
|
+
if (item.badge > 0) {
|
|
25
|
+
return /* @__PURE__ */ jsx("span", { className: "ml-auto flex h-5 min-w-[1.25rem] shrink-0 items-center justify-center rounded-full bg-accent/15 px-1.5 text-[11px] font-semibold text-accent-dark", children: item.badge > 99 ? "99+" : item.badge });
|
|
26
|
+
}
|
|
27
|
+
if (item.dot) return /* @__PURE__ */ jsx("span", { className: "ml-auto h-2 w-2 shrink-0 rounded-full bg-amber-400", "aria-label": "Unsaved changes" });
|
|
28
|
+
if (item.count != null) return /* @__PURE__ */ jsx("span", { className: "ml-auto shrink-0 text-xs tabular-nums text-tone-400", children: item.count });
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
18
31
|
function SidePanelNav({ panel, onPicked, selection, manage = {} }) {
|
|
32
|
+
const { iconFor } = useDashboard();
|
|
33
|
+
const look = useLook();
|
|
19
34
|
const { items = [], activeId, onChange, navVariant = "list" } = panel;
|
|
20
35
|
if (!items.length) return null;
|
|
21
36
|
const pick = (id) => {
|
|
@@ -24,7 +39,7 @@ function SidePanelNav({ panel, onPicked, selection, manage = {} }) {
|
|
|
24
39
|
};
|
|
25
40
|
if (navVariant === "grid") {
|
|
26
41
|
return /* @__PURE__ */ jsx("div", { className: `grid gap-1 ${items.length <= 5 ? "grid-cols-5" : "grid-cols-4"}`, role: "tablist", "aria-label": panel.title, children: items.map((item) => {
|
|
27
|
-
const Icon = item.icon;
|
|
42
|
+
const Icon = toIcon(item.icon, iconFor);
|
|
28
43
|
const active = item.id === activeId;
|
|
29
44
|
return /* @__PURE__ */ jsxs(
|
|
30
45
|
"button",
|
|
@@ -53,7 +68,7 @@ function SidePanelNav({ panel, onPicked, selection, manage = {} }) {
|
|
|
53
68
|
const selecting = !!selection?.selecting;
|
|
54
69
|
const canReorder = !!manage.canReorder && !selecting && movable.length > 1;
|
|
55
70
|
const row = ({ item, groupStart }, leading) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
56
|
-
groupStart && /* @__PURE__ */ jsx("p", { className:
|
|
71
|
+
groupStart && /* @__PURE__ */ jsx("p", { className: `${look === "bold" ? "px-2.5 pb-1 text-xs font-semibold capitalize text-tone-400" : "px-2 pb-1 text-[10px] font-bold uppercase tracking-[0.16em] text-tone-400"} ${groupStart === "later" ? "pt-3" : ""}`, children: item.group }),
|
|
57
72
|
/* @__PURE__ */ jsx(
|
|
58
73
|
ItemRow,
|
|
59
74
|
{
|
|
@@ -72,7 +87,28 @@ function SidePanelNav({ panel, onPicked, selection, manage = {} }) {
|
|
|
72
87
|
] });
|
|
73
88
|
}
|
|
74
89
|
function ItemRow({ item, active, leading, selecting, checked, onClick }) {
|
|
75
|
-
const
|
|
90
|
+
const { iconFor } = useDashboard();
|
|
91
|
+
const look = useLook();
|
|
92
|
+
const Icon = toIcon(item.icon, iconFor);
|
|
93
|
+
if (look === "bold" && !selecting && !leading) {
|
|
94
|
+
return /* @__PURE__ */ jsxs(
|
|
95
|
+
"button",
|
|
96
|
+
{
|
|
97
|
+
type: "button",
|
|
98
|
+
"aria-current": active ? "true" : void 0,
|
|
99
|
+
onClick,
|
|
100
|
+
className: `flex w-full items-center gap-3 rounded-xl border px-2 py-2 text-left text-sm transition ${active ? "border-accent-strong/20 bg-accent/10 text-ink" : "border-transparent text-contrast/70 hover:bg-contrast/5 hover:text-ink"}`,
|
|
101
|
+
children: [
|
|
102
|
+
Icon && /* @__PURE__ */ jsx("span", { className: `flex h-8 w-8 shrink-0 items-center justify-center rounded-lg ${active ? "bg-contrast/10" : "bg-tone-50"}`, children: /* @__PURE__ */ jsx(Icon, { className: `text-xs ${active ? "text-accent-dark" : "text-contrast/45"}`, "aria-hidden": "true" }) }),
|
|
103
|
+
/* @__PURE__ */ jsxs("span", { className: "min-w-0 flex-1", children: [
|
|
104
|
+
/* @__PURE__ */ jsx("span", { className: `block truncate font-medium ${item.muted && !active ? "text-tone-400" : ""}`, children: item.label }),
|
|
105
|
+
item.description && /* @__PURE__ */ jsx("span", { className: "block truncate text-xs text-tone-400", children: item.description })
|
|
106
|
+
] }),
|
|
107
|
+
/* @__PURE__ */ jsx(Badge, { item })
|
|
108
|
+
]
|
|
109
|
+
}
|
|
110
|
+
);
|
|
111
|
+
}
|
|
76
112
|
return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
77
113
|
leading,
|
|
78
114
|
/* @__PURE__ */ jsxs(
|
|
@@ -233,12 +269,14 @@ function BulkBar({ selection, actions }) {
|
|
|
233
269
|
] });
|
|
234
270
|
}
|
|
235
271
|
function PanelHeader({ panel, children }) {
|
|
236
|
-
const
|
|
272
|
+
const { iconFor } = useDashboard();
|
|
273
|
+
const Icon = toIcon(panel.icon, iconFor);
|
|
274
|
+
const bold = useLook() === "bold";
|
|
237
275
|
return /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2.5", children: [
|
|
238
|
-
Icon && /* @__PURE__ */ jsx(Icon, { className: "w-5 h-5 text-accent mt-0.5 shrink-0", "aria-hidden": "true" }),
|
|
276
|
+
Icon && /* @__PURE__ */ jsx(Icon, { className: bold ? "mt-1 shrink-0 text-accent-dark" : "w-5 h-5 text-accent mt-0.5 shrink-0", "aria-hidden": "true" }),
|
|
239
277
|
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
240
|
-
/* @__PURE__ */ jsx("h2", { className: "text-base font-medium text-tone-800 leading-tight", children: panel.title }),
|
|
241
|
-
panel.subtitle && /* @__PURE__ */ jsx("p", { className: "text-xs text-tone-500 mt-0.5", children: panel.subtitle })
|
|
278
|
+
/* @__PURE__ */ jsx("h2", { className: bold ? "text-base font-semibold leading-tight text-ink" : "text-base font-medium text-tone-800 leading-tight", children: panel.title }),
|
|
279
|
+
panel.subtitle && /* @__PURE__ */ jsx("p", { className: bold ? "mt-0.5 text-xs text-tone-500" : "text-xs text-tone-500 mt-0.5", children: panel.subtitle })
|
|
242
280
|
] }),
|
|
243
281
|
children
|
|
244
282
|
] });
|
|
@@ -253,13 +291,15 @@ function readCollapsed(panel) {
|
|
|
253
291
|
return !!panel.defaultCollapsed;
|
|
254
292
|
}
|
|
255
293
|
function SidePanelRail({ panel, onExpand }) {
|
|
256
|
-
const
|
|
294
|
+
const { iconFor } = useDashboard();
|
|
295
|
+
const Icon = toIcon(panel.icon, iconFor);
|
|
296
|
+
const bold = useLook() === "bold";
|
|
257
297
|
return /* @__PURE__ */ jsxs(
|
|
258
298
|
"aside",
|
|
259
299
|
{
|
|
260
300
|
"aria-label": panel.title,
|
|
261
301
|
"data-side-panel": "collapsed",
|
|
262
|
-
className: "hidden lg:flex flex-col items-center gap-1.5 w-12 shrink-0 py-2 lg:sticky lg:top-20 self-start lg:max-h-[calc(100dvh-6.5rem)] overflow-y-auto scrollbar-hide bg-surface rounded-2xl shadow-sm border border-tone-100",
|
|
302
|
+
className: bold ? "hidden lg:flex w-12 shrink-0 flex-col items-center gap-1.5 self-start overflow-y-auto rounded-2xl border border-tone-100 bg-surface py-2 lg:sticky lg:top-20 lg:max-h-[calc(100dvh-6.5rem)]" : "hidden lg:flex flex-col items-center gap-1.5 w-12 shrink-0 py-2 lg:sticky lg:top-20 self-start lg:max-h-[calc(100dvh-6.5rem)] overflow-y-auto scrollbar-hide bg-surface rounded-2xl shadow-sm border border-tone-100",
|
|
263
303
|
children: [
|
|
264
304
|
/* @__PURE__ */ jsx(
|
|
265
305
|
"button",
|
|
@@ -268,13 +308,13 @@ function SidePanelRail({ panel, onExpand }) {
|
|
|
268
308
|
onClick: onExpand,
|
|
269
309
|
"aria-label": `Show ${panel.title}`,
|
|
270
310
|
title: `Show ${panel.title}`,
|
|
271
|
-
className: "p-2 rounded-lg text-tone-500 hover:bg-tone-100 hover:text-accent",
|
|
272
|
-
children: /* @__PURE__ */ jsx(
|
|
311
|
+
className: bold ? "rounded-lg p-2 text-tone-500 hover:bg-contrast/5 hover:text-ink" : "p-2 rounded-lg text-tone-500 hover:bg-tone-100 hover:text-accent",
|
|
312
|
+
children: /* @__PURE__ */ jsx(Named, { name: "panel-expand", fallback: PanelRightOpen, className: bold ? "" : "w-4 h-4" })
|
|
273
313
|
}
|
|
274
314
|
),
|
|
275
|
-
Icon && !panel.items?.length && /* @__PURE__ */ jsx(Icon, { className: "w-4 h-4 text-accent my-1", "aria-hidden": "true" }),
|
|
315
|
+
Icon && !panel.items?.length && /* @__PURE__ */ jsx(Icon, { className: bold ? "my-1 text-accent-dark" : "w-4 h-4 text-accent my-1", "aria-hidden": "true" }),
|
|
276
316
|
panel.items?.map((item) => {
|
|
277
|
-
const ItemIcon = item.icon;
|
|
317
|
+
const ItemIcon = toIcon(item.icon, iconFor);
|
|
278
318
|
const active = item.id === panel.activeId;
|
|
279
319
|
return /* @__PURE__ */ jsxs(
|
|
280
320
|
"button",
|
|
@@ -284,10 +324,10 @@ function SidePanelRail({ panel, onExpand }) {
|
|
|
284
324
|
"aria-label": item.label,
|
|
285
325
|
title: item.label,
|
|
286
326
|
"aria-current": active ? "true" : void 0,
|
|
287
|
-
className: `relative p-2 rounded-lg ${active ? "bg-accent/10 text-accent" : "text-tone-500 hover:bg-tone-100"}`,
|
|
327
|
+
className: bold ? `relative rounded-lg p-2 text-xs ${active ? "bg-accent/10 text-accent-dark" : "text-tone-500 hover:bg-contrast/5"}` : `relative p-2 rounded-lg ${active ? "bg-accent/10 text-accent" : "text-tone-500 hover:bg-tone-100"}`,
|
|
288
328
|
children: [
|
|
289
|
-
ItemIcon ? /* @__PURE__ */ jsx(ItemIcon, { className: "w-4 h-4" }) : item.label.slice(0, 2),
|
|
290
|
-
(item.badge > 0 || item.dot) && /* @__PURE__ */ jsx("span", { className:
|
|
329
|
+
ItemIcon ? /* @__PURE__ */ jsx(ItemIcon, { className: bold ? "" : "w-4 h-4" }) : item.label.slice(0, 2),
|
|
330
|
+
(item.badge > 0 || item.dot) && /* @__PURE__ */ jsx("span", { className: `absolute top-1 right-1 w-1.5 h-1.5 rounded-full ${bold ? "bg-accent-strong" : "bg-accent"}` })
|
|
291
331
|
]
|
|
292
332
|
},
|
|
293
333
|
item.id
|
|
@@ -299,6 +339,7 @@ function SidePanelRail({ panel, onExpand }) {
|
|
|
299
339
|
);
|
|
300
340
|
}
|
|
301
341
|
function SidePanelAside({ panel }) {
|
|
342
|
+
const look = useLook();
|
|
302
343
|
const [collapsed, setCollapsed] = useState(() => readCollapsed(panel));
|
|
303
344
|
const manage = usePanelManage(panel);
|
|
304
345
|
const selection = useSelection(panel);
|
|
@@ -309,16 +350,17 @@ function SidePanelAside({ panel }) {
|
|
|
309
350
|
} catch {
|
|
310
351
|
}
|
|
311
352
|
};
|
|
353
|
+
const bold = look === "bold";
|
|
312
354
|
if (collapsed) return /* @__PURE__ */ jsx(SidePanelRail, { panel, onExpand: () => toggle(false) });
|
|
313
355
|
const hasListNav = panel.items?.length > 0 && panel.navVariant !== "grid";
|
|
314
356
|
return /* @__PURE__ */ jsxs(
|
|
315
357
|
"aside",
|
|
316
358
|
{
|
|
317
359
|
"aria-label": panel.title,
|
|
318
|
-
"data-side-panel": true,
|
|
319
|
-
className: "hidden lg:flex flex-col w-80 xl:w-[22rem] shrink-0 lg:sticky lg:top-20 lg:max-h-[calc(100dvh-6.5rem)] fit:max-h-full self-start fit:self-stretch bg-surface rounded-2xl shadow-sm border border-tone-100 overflow-hidden",
|
|
360
|
+
"data-side-panel": bold ? "expanded" : true,
|
|
361
|
+
className: bold ? "hidden lg:flex w-72 2xl:w-80 shrink-0 flex-col self-start overflow-hidden rounded-2xl border border-tone-100 bg-surface lg:sticky lg:top-20 lg:max-h-[calc(100dvh-6.5rem)] fit:max-h-full fit:self-stretch" : "hidden lg:flex flex-col w-80 xl:w-[22rem] shrink-0 lg:sticky lg:top-20 lg:max-h-[calc(100dvh-6.5rem)] fit:max-h-full self-start fit:self-stretch bg-surface rounded-2xl shadow-sm border border-tone-100 overflow-hidden",
|
|
320
362
|
children: [
|
|
321
|
-
/* @__PURE__ */ jsxs("div", { className: "shrink-0 p-4 pb-3 space-y-3 border-b border-tone-100", children: [
|
|
363
|
+
/* @__PURE__ */ jsxs("div", { className: bold ? "shrink-0 border-b border-tone-100 p-4 pb-3" : "shrink-0 p-4 pb-3 space-y-3 border-b border-tone-100", children: [
|
|
322
364
|
/* @__PURE__ */ jsxs(PanelHeader, { panel, children: [
|
|
323
365
|
manage.bulkActions.length > 0 && /* @__PURE__ */ jsx(SelectToggle, { selection }),
|
|
324
366
|
/* @__PURE__ */ jsx(
|
|
@@ -328,32 +370,34 @@ function SidePanelAside({ panel }) {
|
|
|
328
370
|
onClick: () => toggle(true),
|
|
329
371
|
"aria-label": `Hide ${panel.title}`,
|
|
330
372
|
title: "Collapse panel",
|
|
331
|
-
className: "p-1.5 -m-1 rounded-lg text-tone-400 hover:bg-tone-100 hover:text-tone-600",
|
|
332
|
-
children: /* @__PURE__ */ jsx(
|
|
373
|
+
className: bold ? "-m-1 rounded-lg p-1.5 text-tone-400 hover:bg-contrast/5 hover:text-ink" : "p-1.5 -m-1 rounded-lg text-tone-400 hover:bg-tone-100 hover:text-tone-600",
|
|
374
|
+
children: /* @__PURE__ */ jsx(Named, { name: "panel-collapse", fallback: PanelRightClose, className: bold ? "" : "w-4 h-4" })
|
|
333
375
|
}
|
|
334
376
|
)
|
|
335
377
|
] }),
|
|
336
378
|
panel.navVariant === "grid" && /* @__PURE__ */ jsx(SidePanelNav, { panel })
|
|
337
379
|
] }),
|
|
338
|
-
(hasListNav || panel.content) && /* @__PURE__ */ jsxs("div", { className: "flex-1 min-h-0 overflow-y-auto overscroll-contain p-3 space-y-4", children: [
|
|
380
|
+
(hasListNav || panel.content) && /* @__PURE__ */ jsxs("div", { className: bold ? "min-h-0 flex-1 space-y-4 overflow-y-auto overscroll-contain p-3" : "flex-1 min-h-0 overflow-y-auto overscroll-contain p-3 space-y-4", children: [
|
|
339
381
|
hasListNav && /* @__PURE__ */ jsx(SidePanelNav, { panel, manage, selection }),
|
|
340
382
|
panel.content && /* @__PURE__ */ jsx("div", { className: "px-1", children: panel.content })
|
|
341
383
|
] }),
|
|
342
384
|
selection.selecting && /* @__PURE__ */ jsx(BulkBar, { selection, actions: manage.bulkActions }),
|
|
343
|
-
panel.footer && !selection.selecting && /* @__PURE__ */ jsx("div", { className: "shrink-0 p-4 pt-3 border-t border-tone-100 bg-accent/[0.03]", children: panel.footer })
|
|
385
|
+
panel.footer && !selection.selecting && /* @__PURE__ */ jsx("div", { className: bold ? "shrink-0 border-t border-tone-100 p-4 pt-3 text-sm text-tone-500" : "shrink-0 p-4 pt-3 border-t border-tone-100 bg-accent/[0.03]", children: panel.footer })
|
|
344
386
|
]
|
|
345
387
|
}
|
|
346
388
|
);
|
|
347
389
|
}
|
|
348
390
|
function ChipRow({ panel, onPicked, className = "-mx-4 px-4" }) {
|
|
391
|
+
const { iconFor } = useDashboard();
|
|
392
|
+
const bold = useLook() === "bold";
|
|
349
393
|
const rowRef = useRef(null);
|
|
350
394
|
const { items = [], activeId, onChange } = panel;
|
|
351
395
|
useEffect(() => {
|
|
352
396
|
const el = rowRef.current?.querySelector('[aria-current="true"]');
|
|
353
397
|
el?.scrollIntoView?.({ block: "nearest", inline: "center", behavior: "smooth" });
|
|
354
398
|
}, [activeId]);
|
|
355
|
-
return /* @__PURE__ */ jsx("div", { ref: rowRef, className: `flex gap-2 overflow-x-auto scrollbar-hide py-0.5 snap-x ${className}`, "aria-label": panel.title, role: "navigation", children: items.map((item) => {
|
|
356
|
-
const Icon = item.icon;
|
|
399
|
+
return /* @__PURE__ */ jsx("div", { ref: rowRef, className: bold ? `flex snap-x gap-2 overflow-x-auto py-0.5 ${className}` : `flex gap-2 overflow-x-auto scrollbar-hide py-0.5 snap-x ${className}`, "aria-label": panel.title, role: "navigation", children: items.map((item) => {
|
|
400
|
+
const Icon = toIcon(item.icon, iconFor);
|
|
357
401
|
const active = item.id === activeId;
|
|
358
402
|
return /* @__PURE__ */ jsxs(
|
|
359
403
|
"button",
|
|
@@ -364,12 +408,12 @@ function ChipRow({ panel, onPicked, className = "-mx-4 px-4" }) {
|
|
|
364
408
|
onChange?.(item.id);
|
|
365
409
|
onPicked?.(item.id);
|
|
366
410
|
},
|
|
367
|
-
className: `${buttonClass({ variant: active ? "secondary" : "primary", size: "sm" })} snap-start shrink-0 !rounded-full relative`,
|
|
411
|
+
className: bold ? `inline-flex shrink-0 snap-start items-center gap-2 rounded-full border px-3 py-1.5 text-sm font-medium transition ${active ? "border-accent-strong/40 bg-accent/15 text-ink" : "border-contrast/10 bg-contrast/5 text-contrast/70 hover:text-ink"}` : `${buttonClass({ variant: active ? "secondary" : "primary", size: "sm" })} snap-start shrink-0 !rounded-full relative`,
|
|
368
412
|
children: [
|
|
369
|
-
Icon && /* @__PURE__ */ jsx(Icon, { "aria-hidden": "true" }),
|
|
413
|
+
Icon && /* @__PURE__ */ jsx(Icon, { className: bold ? "text-xs" : void 0, "aria-hidden": "true" }),
|
|
370
414
|
/* @__PURE__ */ jsx("span", { className: `max-w-[14rem] truncate ${item.muted && !active ? "opacity-60" : ""}`, children: item.label }),
|
|
371
|
-
item.count != null && /* @__PURE__ */ jsx("span", { className: `tabular-nums ${active ? "opacity-80" : "opacity-60"}`, children: item.count }),
|
|
372
|
-
(item.badge > 0 || item.dot) && /* @__PURE__ */ jsx("span", { className: `w-1.5 h-1.5 rounded-full ${active ? "bg-white" : "bg-accent"}`, "aria-hidden": "true" })
|
|
415
|
+
item.count != null && /* @__PURE__ */ jsx("span", { className: `tabular-nums ${active && !bold ? "opacity-80" : "opacity-60"}`, children: item.count }),
|
|
416
|
+
(item.badge > 0 || item.dot) && /* @__PURE__ */ jsx("span", { className: `w-1.5 h-1.5 rounded-full ${bold ? "bg-accent-strong" : active ? "bg-white" : "bg-accent"}`, "aria-hidden": "true" })
|
|
373
417
|
]
|
|
374
418
|
},
|
|
375
419
|
item.id
|
|
@@ -379,7 +423,8 @@ function ChipRow({ panel, onPicked, className = "-mx-4 px-4" }) {
|
|
|
379
423
|
function BottomSheet({ panel, manage, onClose }) {
|
|
380
424
|
const dragControls = useDragControls();
|
|
381
425
|
const selection = useSelection(panel);
|
|
382
|
-
|
|
426
|
+
const bold = useLook() === "bold";
|
|
427
|
+
return /* @__PURE__ */ jsx(Overlay, { onClose, className: "flex items-end justify-center", backdropClassName: bold ? "bg-black/50" : "bg-black/25", zIndex: 60, children: /* @__PURE__ */ jsxs(
|
|
383
428
|
motion.div,
|
|
384
429
|
{
|
|
385
430
|
role: "dialog",
|
|
@@ -397,19 +442,19 @@ function BottomSheet({ panel, manage, onClose }) {
|
|
|
397
442
|
onDragEnd: (_, info) => {
|
|
398
443
|
if (info.offset.y > 90 || info.velocity.y > 500) onClose();
|
|
399
444
|
},
|
|
400
|
-
className: "w-full max-h-[78dvh] bg-surface rounded-t-3xl shadow-2xl flex flex-col pb-[env(safe-area-inset-bottom)]",
|
|
445
|
+
className: bold ? "flex max-h-[78dvh] w-full flex-col rounded-t-3xl border-t border-contrast/10 bg-surface pb-[env(safe-area-inset-bottom)] shadow-2xl" : "w-full max-h-[78dvh] bg-surface rounded-t-3xl shadow-2xl flex flex-col pb-[env(safe-area-inset-bottom)]",
|
|
401
446
|
onClick: (e) => e.stopPropagation(),
|
|
402
447
|
children: [
|
|
403
448
|
/* @__PURE__ */ jsxs(
|
|
404
449
|
"div",
|
|
405
450
|
{
|
|
406
|
-
className:
|
|
451
|
+
className: `shrink-0 pt-2 pb-3 px-4 space-y-3 border-b ${bold ? "border-tone-100" : "border-tone-100"} cursor-grab active:cursor-grabbing touch-none`,
|
|
407
452
|
onPointerDown: (e) => dragControls.start(e),
|
|
408
453
|
children: [
|
|
409
|
-
/* @__PURE__ */ jsx("div", { className:
|
|
454
|
+
/* @__PURE__ */ jsx("div", { className: `mx-auto w-10 h-1.5 rounded-full ${bold ? "bg-contrast/15" : "bg-tone-200"}`, "aria-hidden": "true" }),
|
|
410
455
|
/* @__PURE__ */ jsxs(PanelHeader, { panel, children: [
|
|
411
456
|
manage && manage.bulkActions.length > 0 && /* @__PURE__ */ jsx(SelectToggle, { selection }),
|
|
412
|
-
/* @__PURE__ */ jsx("button", { type: "button", onClick: onClose, "aria-label": "Close panel", className: "p-1.5 -m-1 rounded-lg text-tone-500 hover:bg-tone-100", children: /* @__PURE__ */ jsx(
|
|
457
|
+
/* @__PURE__ */ jsx("button", { type: "button", onClick: onClose, "aria-label": "Close panel", className: bold ? "-m-1 rounded-lg p-1.5 text-tone-600 hover:bg-contrast/5" : "p-1.5 -m-1 rounded-lg text-tone-500 hover:bg-tone-100", children: /* @__PURE__ */ jsx(Named, { name: "close", fallback: X, className: bold ? "" : "w-5 h-5" }) })
|
|
413
458
|
] }),
|
|
414
459
|
!manage && panel.items?.length > 0 && /* @__PURE__ */ jsx(ChipRow, { panel })
|
|
415
460
|
]
|
|
@@ -425,13 +470,16 @@ function BottomSheet({ panel, manage, onClose }) {
|
|
|
425
470
|
) });
|
|
426
471
|
}
|
|
427
472
|
function SidePanelMobileBar({ panel }) {
|
|
473
|
+
const { iconFor } = useDashboard();
|
|
428
474
|
const [sheet, setSheet] = useState(null);
|
|
429
475
|
const manage = usePanelManage(panel);
|
|
430
476
|
const hasContent = !!panel.content;
|
|
431
477
|
const hasItems = panel.items?.length > 0;
|
|
432
478
|
const manageable = manage.canReorder || manage.bulkActions.length > 0;
|
|
433
|
-
const Icon = panel.icon;
|
|
434
|
-
|
|
479
|
+
const Icon = toIcon(panel.icon, iconFor);
|
|
480
|
+
const bold = useLook() === "bold";
|
|
481
|
+
if (!hasContent && !hasItems) return null;
|
|
482
|
+
return /* @__PURE__ */ jsxs("div", { className: bold ? "sticky top-16 z-20 -mx-4 mb-4 border-b border-contrast/[0.06] bg-paper/95 px-4 py-2 backdrop-blur lg:hidden" : "lg:hidden sticky top-16 z-20 -mx-4 sm:-mx-6 px-4 sm:px-6 py-2 bg-paper/95 backdrop-blur border-b border-accent/10", children: [
|
|
435
483
|
hasItems && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
436
484
|
/* @__PURE__ */ jsx(
|
|
437
485
|
ChipRow,
|
|
@@ -458,14 +506,14 @@ function SidePanelMobileBar({ panel }) {
|
|
|
458
506
|
{
|
|
459
507
|
type: "button",
|
|
460
508
|
onClick: () => setSheet("content"),
|
|
461
|
-
className: `${buttonClass({ variant: "primary", size: "sm", fullWidth: true })} !justify-between`,
|
|
509
|
+
className: bold ? "flex w-full items-center justify-between gap-2 rounded-xl border border-contrast/10 bg-contrast/5 px-3 py-2 text-sm font-medium text-ink" : `${buttonClass({ variant: "primary", size: "sm", fullWidth: true })} !justify-between`,
|
|
462
510
|
"aria-haspopup": "dialog",
|
|
463
511
|
children: [
|
|
464
512
|
/* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2 min-w-0", children: [
|
|
465
|
-
Icon && /* @__PURE__ */ jsx(Icon, { "aria-hidden": "true" }),
|
|
513
|
+
Icon && /* @__PURE__ */ jsx(Icon, { className: bold ? "text-accent-dark" : void 0, "aria-hidden": "true" }),
|
|
466
514
|
/* @__PURE__ */ jsx("span", { className: "truncate", children: panel.sheetLabel || panel.title })
|
|
467
515
|
] }),
|
|
468
|
-
/* @__PURE__ */ jsx(
|
|
516
|
+
/* @__PURE__ */ jsx(Named, { name: "chevron-up", fallback: ChevronUp, className: bold ? "text-xs text-tone-500" : void 0 })
|
|
469
517
|
]
|
|
470
518
|
}
|
|
471
519
|
),
|