@designa8/vibedesign-v6 1.10.4 → 1.10.5
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 +1 -1
- package/dist/index.cjs +199 -197
- package/dist/index.js +199 -197
- package/package.json +1 -1
- package/src/atoms/AppSidebarMobile/AppSidebarMobile.tsx +206 -199
package/README.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -2988,6 +2988,7 @@ AppSidebar.displayName = "AppSidebar";
|
|
|
2988
2988
|
|
|
2989
2989
|
// virtual-pkg:src/atoms/AppSidebarMobile/AppSidebarMobile.tsx
|
|
2990
2990
|
var import_react11 = __toESM(require("react"));
|
|
2991
|
+
var import_react_dom = __toESM(require("react-dom"));
|
|
2991
2992
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
2992
2993
|
var LogoIcon2 = () => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("svg", { width: "28", height: "28", viewBox: "0 0 48 48", fill: "none", "aria-hidden": "true", children: [
|
|
2993
2994
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("path", { d: "M12 36C12 36 8 28 16 22C20 19 26 20 26 20C26 20 22 26 18 30C16 32 12 36 12 36Z", style: { fill: "var(--color-logo-orange)" } }),
|
|
@@ -3081,216 +3082,217 @@ var AppSidebarMobile = import_react11.default.forwardRef(
|
|
|
3081
3082
|
}
|
|
3082
3083
|
}, [open]);
|
|
3083
3084
|
const showFooterRow = !!(userInitials || onInboxClick || onDarkModeToggle);
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
"
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
},
|
|
3108
|
-
children: [
|
|
3109
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
3110
|
-
"div",
|
|
3111
|
-
{
|
|
3112
|
-
"aria-hidden": "true",
|
|
3113
|
-
onClick: () => setOpen(false),
|
|
3114
|
-
style: {
|
|
3115
|
-
position: "absolute",
|
|
3116
|
-
inset: 0,
|
|
3117
|
-
backgroundColor: "var(--color-scrim)",
|
|
3118
|
-
opacity: visible ? 0.5 : 0,
|
|
3119
|
-
transition: "opacity 0.25s ease"
|
|
3120
|
-
}
|
|
3085
|
+
const overlayContent = mounted ? /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
3086
|
+
"div",
|
|
3087
|
+
{
|
|
3088
|
+
role: "dialog",
|
|
3089
|
+
"aria-modal": "true",
|
|
3090
|
+
"aria-label": "Navigation menu",
|
|
3091
|
+
style: {
|
|
3092
|
+
position: "fixed",
|
|
3093
|
+
inset: 0,
|
|
3094
|
+
zIndex: 9999
|
|
3095
|
+
},
|
|
3096
|
+
children: [
|
|
3097
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
3098
|
+
"div",
|
|
3099
|
+
{
|
|
3100
|
+
"aria-hidden": "true",
|
|
3101
|
+
onClick: () => setOpen(false),
|
|
3102
|
+
style: {
|
|
3103
|
+
position: "absolute",
|
|
3104
|
+
inset: 0,
|
|
3105
|
+
backgroundColor: "var(--color-scrim)",
|
|
3106
|
+
opacity: visible ? 0.5 : 0,
|
|
3107
|
+
transition: "opacity 0.25s ease"
|
|
3121
3108
|
}
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3109
|
+
}
|
|
3110
|
+
),
|
|
3111
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
3112
|
+
"div",
|
|
3113
|
+
{
|
|
3114
|
+
style: {
|
|
3115
|
+
position: "absolute",
|
|
3116
|
+
top: 0,
|
|
3117
|
+
left: 0,
|
|
3118
|
+
bottom: 0,
|
|
3119
|
+
width: "min(280px, 85vw)",
|
|
3120
|
+
display: "flex",
|
|
3121
|
+
flexDirection: "column",
|
|
3122
|
+
backgroundColor: "var(--color-canvas)",
|
|
3123
|
+
borderRight: "1px solid var(--color-hairline)",
|
|
3124
|
+
boxShadow: "var(--shadow-lg)",
|
|
3125
|
+
transform: visible ? "translateX(0)" : "translateX(-100%)",
|
|
3126
|
+
transition: "transform 0.28s cubic-bezier(0.32,0,0.15,1)",
|
|
3127
|
+
overflowY: "auto",
|
|
3128
|
+
overflowX: "hidden"
|
|
3129
|
+
},
|
|
3130
|
+
children: [
|
|
3131
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
3132
|
+
"div",
|
|
3133
|
+
{
|
|
3134
|
+
className: "flex items-center justify-between px-md pt-md pb-sm flex-shrink-0",
|
|
3135
|
+
style: { backgroundColor: "var(--color-canvas)" },
|
|
3136
|
+
children: [
|
|
3137
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex items-center gap-sm", children: [
|
|
3138
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(LogoIcon2, {}),
|
|
3139
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "text-body-sm font-weight-heading-sm text-ink truncate", children: brandName })
|
|
3140
|
+
] }),
|
|
3141
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
3142
|
+
Button,
|
|
3143
|
+
{
|
|
3144
|
+
variant: "ghost",
|
|
3145
|
+
size: "sm",
|
|
3146
|
+
"aria-label": "Close navigation",
|
|
3147
|
+
onClick: () => setOpen(false),
|
|
3148
|
+
className: "!p-xs !rounded-md",
|
|
3149
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(CloseIcon, {})
|
|
3150
|
+
}
|
|
3151
|
+
)
|
|
3152
|
+
]
|
|
3153
|
+
}
|
|
3154
|
+
),
|
|
3155
|
+
workspaceName && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
3156
|
+
"div",
|
|
3157
|
+
{
|
|
3158
|
+
className: "px-sm pb-sm",
|
|
3159
|
+
style: { backgroundColor: "var(--color-canvas)" },
|
|
3160
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
3161
|
+
WorkspaceMenu,
|
|
3162
|
+
{
|
|
3163
|
+
workspaceName,
|
|
3164
|
+
initials: workspaceName.charAt(0).toUpperCase()
|
|
3165
|
+
}
|
|
3166
|
+
)
|
|
3167
|
+
}
|
|
3168
|
+
),
|
|
3169
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
3170
|
+
"div",
|
|
3171
|
+
{
|
|
3172
|
+
className: "flex-1 overflow-y-auto px-sm pb-sm",
|
|
3173
|
+
style: { backgroundColor: "var(--color-canvas)" },
|
|
3174
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("ul", { className: "space-y-xxs", role: "list", children: entries.map((entry) => {
|
|
3175
|
+
const isActive = activeId === entry.id;
|
|
3176
|
+
const hasSubItems = !!entry.subItems?.length;
|
|
3177
|
+
const isExpanded = expandedIds.has(entry.id);
|
|
3178
|
+
const mappedSubItems = hasSubItems ? entry.subItems.map((sub) => ({
|
|
3179
|
+
id: sub.id,
|
|
3180
|
+
label: sub.label,
|
|
3181
|
+
onDelete: sub.onDelete,
|
|
3182
|
+
onClick: onSubSelect ? (_id) => {
|
|
3183
|
+
onSubSelect(_id);
|
|
3184
|
+
setOpen(false);
|
|
3185
|
+
} : void 0
|
|
3186
|
+
})) : void 0;
|
|
3187
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
3188
|
+
NavItem,
|
|
3189
|
+
{
|
|
3190
|
+
icon: entry.icon,
|
|
3191
|
+
label: entry.label,
|
|
3192
|
+
active: isActive,
|
|
3193
|
+
subItems: mappedSubItems,
|
|
3194
|
+
expanded: hasSubItems ? isExpanded : void 0,
|
|
3195
|
+
onExpandToggle: hasSubItems ? () => toggleExpanded(entry.id) : void 0,
|
|
3196
|
+
onClick: (e) => {
|
|
3197
|
+
onSelect?.(entry.id);
|
|
3198
|
+
if (!hasSubItems) setOpen(false);
|
|
3199
|
+
else e.preventDefault();
|
|
3200
|
+
}
|
|
3201
|
+
},
|
|
3202
|
+
entry.id
|
|
3203
|
+
);
|
|
3204
|
+
}) })
|
|
3205
|
+
}
|
|
3206
|
+
),
|
|
3207
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
3208
|
+
"div",
|
|
3209
|
+
{
|
|
3210
|
+
className: "flex-shrink-0 px-sm pb-lg space-y-sm",
|
|
3211
|
+
style: { backgroundColor: "var(--color-canvas)" },
|
|
3212
|
+
children: [
|
|
3213
|
+
showShareCard && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "rounded-xl border border-hairline bg-surface px-md py-sm flex items-center justify-between gap-md", children: [
|
|
3214
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex flex-col gap-xxs min-w-0", children: [
|
|
3215
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "text-body-sm font-weight-heading-sm text-ink", children: "Share & earn" }),
|
|
3216
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "text-caption text-muted", children: "100 credits per paid referral" })
|
|
3152
3217
|
] }),
|
|
3153
3218
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
3154
|
-
|
|
3219
|
+
"span",
|
|
3155
3220
|
{
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
onClick: () => setOpen(false),
|
|
3160
|
-
className: "!p-xs !rounded-md",
|
|
3161
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(CloseIcon, {})
|
|
3221
|
+
className: "flex-shrink-0 flex items-center justify-center rounded-full bg-surface-strong",
|
|
3222
|
+
style: { width: "36px", height: "36px" },
|
|
3223
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(GiftIcon2, {})
|
|
3162
3224
|
}
|
|
3163
3225
|
)
|
|
3164
|
-
]
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
{
|
|
3170
|
-
className: "px-sm pb-sm",
|
|
3171
|
-
style: { backgroundColor: "var(--color-canvas)" },
|
|
3172
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
3173
|
-
WorkspaceMenu,
|
|
3174
|
-
{
|
|
3175
|
-
workspaceName,
|
|
3176
|
-
initials: workspaceName.charAt(0).toUpperCase()
|
|
3177
|
-
}
|
|
3178
|
-
)
|
|
3179
|
-
}
|
|
3180
|
-
),
|
|
3181
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
3182
|
-
"div",
|
|
3183
|
-
{
|
|
3184
|
-
className: "flex-1 overflow-y-auto px-sm pb-sm",
|
|
3185
|
-
style: { backgroundColor: "var(--color-canvas)" },
|
|
3186
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("ul", { className: "space-y-xxs", role: "list", children: entries.map((entry) => {
|
|
3187
|
-
const isActive = activeId === entry.id;
|
|
3188
|
-
const hasSubItems = !!entry.subItems?.length;
|
|
3189
|
-
const isExpanded = expandedIds.has(entry.id);
|
|
3190
|
-
const mappedSubItems = hasSubItems ? entry.subItems.map((sub) => ({
|
|
3191
|
-
id: sub.id,
|
|
3192
|
-
label: sub.label,
|
|
3193
|
-
onDelete: sub.onDelete,
|
|
3194
|
-
onClick: onSubSelect ? (_id) => {
|
|
3195
|
-
onSubSelect(_id);
|
|
3196
|
-
setOpen(false);
|
|
3197
|
-
} : void 0
|
|
3198
|
-
})) : void 0;
|
|
3199
|
-
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
3200
|
-
NavItem,
|
|
3226
|
+
] }),
|
|
3227
|
+
showUpgradeCard && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(UpgradeCard, { eyebrow: "", title: "Upgrade to Pro", subtitle: "Unlock more features" }),
|
|
3228
|
+
showFooterRow && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex items-center justify-between pt-xs", children: [
|
|
3229
|
+
userInitials && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
3230
|
+
"span",
|
|
3201
3231
|
{
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
else e.preventDefault();
|
|
3212
|
-
}
|
|
3213
|
-
},
|
|
3214
|
-
entry.id
|
|
3215
|
-
);
|
|
3216
|
-
}) })
|
|
3217
|
-
}
|
|
3218
|
-
),
|
|
3219
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
3220
|
-
"div",
|
|
3221
|
-
{
|
|
3222
|
-
className: "flex-shrink-0 px-sm pb-lg space-y-sm",
|
|
3223
|
-
style: { backgroundColor: "var(--color-canvas)" },
|
|
3224
|
-
children: [
|
|
3225
|
-
showShareCard && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "rounded-xl border border-hairline bg-surface px-md py-sm flex items-center justify-between gap-md", children: [
|
|
3226
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex flex-col gap-xxs min-w-0", children: [
|
|
3227
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "text-body-sm font-weight-heading-sm text-ink", children: "Share & earn" }),
|
|
3228
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "text-caption text-muted", children: "100 credits per paid referral" })
|
|
3229
|
-
] }),
|
|
3230
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
3231
|
-
"span",
|
|
3232
|
+
className: "flex items-center justify-center rounded-full bg-primary text-on-primary text-body-sm font-weight-heading-sm cursor-pointer hover:bg-primary-hover transition-colors duration-150",
|
|
3233
|
+
style: { width: "36px", height: "36px" },
|
|
3234
|
+
"aria-label": "User profile",
|
|
3235
|
+
children: userInitials
|
|
3236
|
+
}
|
|
3237
|
+
),
|
|
3238
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex items-center gap-xs ml-auto", children: [
|
|
3239
|
+
onDarkModeToggle && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
3240
|
+
Button,
|
|
3232
3241
|
{
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3242
|
+
variant: "ghost",
|
|
3243
|
+
size: "sm",
|
|
3244
|
+
"aria-label": darkMode ? "Switch to light mode" : "Switch to dark mode",
|
|
3245
|
+
onClick: onDarkModeToggle,
|
|
3246
|
+
className: "!p-xs !rounded-sm",
|
|
3247
|
+
children: darkMode ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SunIcon3, {}) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(MoonIcon3, {})
|
|
3236
3248
|
}
|
|
3237
|
-
)
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
showFooterRow && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex items-center justify-between pt-xs", children: [
|
|
3241
|
-
userInitials && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
3242
|
-
"span",
|
|
3249
|
+
),
|
|
3250
|
+
onInboxClick && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
3251
|
+
Button,
|
|
3243
3252
|
{
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
"aria-label": "
|
|
3247
|
-
|
|
3253
|
+
variant: "ghost",
|
|
3254
|
+
size: "sm",
|
|
3255
|
+
"aria-label": "Inbox",
|
|
3256
|
+
onClick: onInboxClick,
|
|
3257
|
+
className: "!p-xs !rounded-sm relative",
|
|
3258
|
+
children: [
|
|
3259
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(InboxIcon2, {}),
|
|
3260
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
3261
|
+
"span",
|
|
3262
|
+
{
|
|
3263
|
+
className: "absolute rounded-full bg-semantic-error",
|
|
3264
|
+
"aria-label": "New notifications",
|
|
3265
|
+
style: { width: "8px", height: "8px", top: "4px", right: "4px" }
|
|
3266
|
+
}
|
|
3267
|
+
)
|
|
3268
|
+
]
|
|
3248
3269
|
}
|
|
3249
|
-
)
|
|
3250
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex items-center gap-xs ml-auto", children: [
|
|
3251
|
-
onDarkModeToggle && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
3252
|
-
Button,
|
|
3253
|
-
{
|
|
3254
|
-
variant: "ghost",
|
|
3255
|
-
size: "sm",
|
|
3256
|
-
"aria-label": darkMode ? "Switch to light mode" : "Switch to dark mode",
|
|
3257
|
-
onClick: onDarkModeToggle,
|
|
3258
|
-
className: "!p-xs !rounded-sm",
|
|
3259
|
-
children: darkMode ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SunIcon3, {}) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(MoonIcon3, {})
|
|
3260
|
-
}
|
|
3261
|
-
),
|
|
3262
|
-
onInboxClick && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
3263
|
-
Button,
|
|
3264
|
-
{
|
|
3265
|
-
variant: "ghost",
|
|
3266
|
-
size: "sm",
|
|
3267
|
-
"aria-label": "Inbox",
|
|
3268
|
-
onClick: onInboxClick,
|
|
3269
|
-
className: "!p-xs !rounded-sm relative",
|
|
3270
|
-
children: [
|
|
3271
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(InboxIcon2, {}),
|
|
3272
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
3273
|
-
"span",
|
|
3274
|
-
{
|
|
3275
|
-
className: "absolute rounded-full bg-semantic-error",
|
|
3276
|
-
"aria-label": "New notifications",
|
|
3277
|
-
style: { width: "8px", height: "8px", top: "4px", right: "4px" }
|
|
3278
|
-
}
|
|
3279
|
-
)
|
|
3280
|
-
]
|
|
3281
|
-
}
|
|
3282
|
-
)
|
|
3283
|
-
] })
|
|
3270
|
+
)
|
|
3284
3271
|
] })
|
|
3285
|
-
]
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3272
|
+
] })
|
|
3273
|
+
]
|
|
3274
|
+
}
|
|
3275
|
+
)
|
|
3276
|
+
]
|
|
3277
|
+
}
|
|
3278
|
+
)
|
|
3279
|
+
]
|
|
3280
|
+
}
|
|
3281
|
+
) : null;
|
|
3282
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
|
|
3283
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { ref, className, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
3284
|
+
Button,
|
|
3285
|
+
{
|
|
3286
|
+
variant: "ghost",
|
|
3287
|
+
size: "sm",
|
|
3288
|
+
"aria-label": "Open navigation",
|
|
3289
|
+
"aria-expanded": open,
|
|
3290
|
+
onClick: () => setOpen(true),
|
|
3291
|
+
className: "!p-xs !rounded-md",
|
|
3292
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(HamburgerIcon, {})
|
|
3292
3293
|
}
|
|
3293
|
-
)
|
|
3294
|
+
) }),
|
|
3295
|
+
typeof window !== "undefined" ? import_react_dom.default.createPortal(overlayContent, document.body) : overlayContent
|
|
3294
3296
|
] });
|
|
3295
3297
|
}
|
|
3296
3298
|
);
|
package/dist/index.js
CHANGED
|
@@ -2937,6 +2937,7 @@ AppSidebar.displayName = "AppSidebar";
|
|
|
2937
2937
|
|
|
2938
2938
|
// virtual-pkg:src/atoms/AppSidebarMobile/AppSidebarMobile.tsx
|
|
2939
2939
|
import React11 from "react";
|
|
2940
|
+
import ReactDOM from "react-dom";
|
|
2940
2941
|
import { Fragment as Fragment2, jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2941
2942
|
var LogoIcon2 = () => /* @__PURE__ */ jsxs11("svg", { width: "28", height: "28", viewBox: "0 0 48 48", fill: "none", "aria-hidden": "true", children: [
|
|
2942
2943
|
/* @__PURE__ */ jsx11("path", { d: "M12 36C12 36 8 28 16 22C20 19 26 20 26 20C26 20 22 26 18 30C16 32 12 36 12 36Z", style: { fill: "var(--color-logo-orange)" } }),
|
|
@@ -3030,216 +3031,217 @@ var AppSidebarMobile = React11.forwardRef(
|
|
|
3030
3031
|
}
|
|
3031
3032
|
}, [open]);
|
|
3032
3033
|
const showFooterRow = !!(userInitials || onInboxClick || onDarkModeToggle);
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
"
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
},
|
|
3057
|
-
children: [
|
|
3058
|
-
/* @__PURE__ */ jsx11(
|
|
3059
|
-
"div",
|
|
3060
|
-
{
|
|
3061
|
-
"aria-hidden": "true",
|
|
3062
|
-
onClick: () => setOpen(false),
|
|
3063
|
-
style: {
|
|
3064
|
-
position: "absolute",
|
|
3065
|
-
inset: 0,
|
|
3066
|
-
backgroundColor: "var(--color-scrim)",
|
|
3067
|
-
opacity: visible ? 0.5 : 0,
|
|
3068
|
-
transition: "opacity 0.25s ease"
|
|
3069
|
-
}
|
|
3034
|
+
const overlayContent = mounted ? /* @__PURE__ */ jsxs11(
|
|
3035
|
+
"div",
|
|
3036
|
+
{
|
|
3037
|
+
role: "dialog",
|
|
3038
|
+
"aria-modal": "true",
|
|
3039
|
+
"aria-label": "Navigation menu",
|
|
3040
|
+
style: {
|
|
3041
|
+
position: "fixed",
|
|
3042
|
+
inset: 0,
|
|
3043
|
+
zIndex: 9999
|
|
3044
|
+
},
|
|
3045
|
+
children: [
|
|
3046
|
+
/* @__PURE__ */ jsx11(
|
|
3047
|
+
"div",
|
|
3048
|
+
{
|
|
3049
|
+
"aria-hidden": "true",
|
|
3050
|
+
onClick: () => setOpen(false),
|
|
3051
|
+
style: {
|
|
3052
|
+
position: "absolute",
|
|
3053
|
+
inset: 0,
|
|
3054
|
+
backgroundColor: "var(--color-scrim)",
|
|
3055
|
+
opacity: visible ? 0.5 : 0,
|
|
3056
|
+
transition: "opacity 0.25s ease"
|
|
3070
3057
|
}
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3058
|
+
}
|
|
3059
|
+
),
|
|
3060
|
+
/* @__PURE__ */ jsxs11(
|
|
3061
|
+
"div",
|
|
3062
|
+
{
|
|
3063
|
+
style: {
|
|
3064
|
+
position: "absolute",
|
|
3065
|
+
top: 0,
|
|
3066
|
+
left: 0,
|
|
3067
|
+
bottom: 0,
|
|
3068
|
+
width: "min(280px, 85vw)",
|
|
3069
|
+
display: "flex",
|
|
3070
|
+
flexDirection: "column",
|
|
3071
|
+
backgroundColor: "var(--color-canvas)",
|
|
3072
|
+
borderRight: "1px solid var(--color-hairline)",
|
|
3073
|
+
boxShadow: "var(--shadow-lg)",
|
|
3074
|
+
transform: visible ? "translateX(0)" : "translateX(-100%)",
|
|
3075
|
+
transition: "transform 0.28s cubic-bezier(0.32,0,0.15,1)",
|
|
3076
|
+
overflowY: "auto",
|
|
3077
|
+
overflowX: "hidden"
|
|
3078
|
+
},
|
|
3079
|
+
children: [
|
|
3080
|
+
/* @__PURE__ */ jsxs11(
|
|
3081
|
+
"div",
|
|
3082
|
+
{
|
|
3083
|
+
className: "flex items-center justify-between px-md pt-md pb-sm flex-shrink-0",
|
|
3084
|
+
style: { backgroundColor: "var(--color-canvas)" },
|
|
3085
|
+
children: [
|
|
3086
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-sm", children: [
|
|
3087
|
+
/* @__PURE__ */ jsx11(LogoIcon2, {}),
|
|
3088
|
+
/* @__PURE__ */ jsx11("span", { className: "text-body-sm font-weight-heading-sm text-ink truncate", children: brandName })
|
|
3089
|
+
] }),
|
|
3090
|
+
/* @__PURE__ */ jsx11(
|
|
3091
|
+
Button,
|
|
3092
|
+
{
|
|
3093
|
+
variant: "ghost",
|
|
3094
|
+
size: "sm",
|
|
3095
|
+
"aria-label": "Close navigation",
|
|
3096
|
+
onClick: () => setOpen(false),
|
|
3097
|
+
className: "!p-xs !rounded-md",
|
|
3098
|
+
children: /* @__PURE__ */ jsx11(CloseIcon, {})
|
|
3099
|
+
}
|
|
3100
|
+
)
|
|
3101
|
+
]
|
|
3102
|
+
}
|
|
3103
|
+
),
|
|
3104
|
+
workspaceName && /* @__PURE__ */ jsx11(
|
|
3105
|
+
"div",
|
|
3106
|
+
{
|
|
3107
|
+
className: "px-sm pb-sm",
|
|
3108
|
+
style: { backgroundColor: "var(--color-canvas)" },
|
|
3109
|
+
children: /* @__PURE__ */ jsx11(
|
|
3110
|
+
WorkspaceMenu,
|
|
3111
|
+
{
|
|
3112
|
+
workspaceName,
|
|
3113
|
+
initials: workspaceName.charAt(0).toUpperCase()
|
|
3114
|
+
}
|
|
3115
|
+
)
|
|
3116
|
+
}
|
|
3117
|
+
),
|
|
3118
|
+
/* @__PURE__ */ jsx11(
|
|
3119
|
+
"div",
|
|
3120
|
+
{
|
|
3121
|
+
className: "flex-1 overflow-y-auto px-sm pb-sm",
|
|
3122
|
+
style: { backgroundColor: "var(--color-canvas)" },
|
|
3123
|
+
children: /* @__PURE__ */ jsx11("ul", { className: "space-y-xxs", role: "list", children: entries.map((entry) => {
|
|
3124
|
+
const isActive = activeId === entry.id;
|
|
3125
|
+
const hasSubItems = !!entry.subItems?.length;
|
|
3126
|
+
const isExpanded = expandedIds.has(entry.id);
|
|
3127
|
+
const mappedSubItems = hasSubItems ? entry.subItems.map((sub) => ({
|
|
3128
|
+
id: sub.id,
|
|
3129
|
+
label: sub.label,
|
|
3130
|
+
onDelete: sub.onDelete,
|
|
3131
|
+
onClick: onSubSelect ? (_id) => {
|
|
3132
|
+
onSubSelect(_id);
|
|
3133
|
+
setOpen(false);
|
|
3134
|
+
} : void 0
|
|
3135
|
+
})) : void 0;
|
|
3136
|
+
return /* @__PURE__ */ jsx11(
|
|
3137
|
+
NavItem,
|
|
3138
|
+
{
|
|
3139
|
+
icon: entry.icon,
|
|
3140
|
+
label: entry.label,
|
|
3141
|
+
active: isActive,
|
|
3142
|
+
subItems: mappedSubItems,
|
|
3143
|
+
expanded: hasSubItems ? isExpanded : void 0,
|
|
3144
|
+
onExpandToggle: hasSubItems ? () => toggleExpanded(entry.id) : void 0,
|
|
3145
|
+
onClick: (e) => {
|
|
3146
|
+
onSelect?.(entry.id);
|
|
3147
|
+
if (!hasSubItems) setOpen(false);
|
|
3148
|
+
else e.preventDefault();
|
|
3149
|
+
}
|
|
3150
|
+
},
|
|
3151
|
+
entry.id
|
|
3152
|
+
);
|
|
3153
|
+
}) })
|
|
3154
|
+
}
|
|
3155
|
+
),
|
|
3156
|
+
/* @__PURE__ */ jsxs11(
|
|
3157
|
+
"div",
|
|
3158
|
+
{
|
|
3159
|
+
className: "flex-shrink-0 px-sm pb-lg space-y-sm",
|
|
3160
|
+
style: { backgroundColor: "var(--color-canvas)" },
|
|
3161
|
+
children: [
|
|
3162
|
+
showShareCard && /* @__PURE__ */ jsxs11("div", { className: "rounded-xl border border-hairline bg-surface px-md py-sm flex items-center justify-between gap-md", children: [
|
|
3163
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex flex-col gap-xxs min-w-0", children: [
|
|
3164
|
+
/* @__PURE__ */ jsx11("span", { className: "text-body-sm font-weight-heading-sm text-ink", children: "Share & earn" }),
|
|
3165
|
+
/* @__PURE__ */ jsx11("span", { className: "text-caption text-muted", children: "100 credits per paid referral" })
|
|
3101
3166
|
] }),
|
|
3102
3167
|
/* @__PURE__ */ jsx11(
|
|
3103
|
-
|
|
3168
|
+
"span",
|
|
3104
3169
|
{
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
onClick: () => setOpen(false),
|
|
3109
|
-
className: "!p-xs !rounded-md",
|
|
3110
|
-
children: /* @__PURE__ */ jsx11(CloseIcon, {})
|
|
3170
|
+
className: "flex-shrink-0 flex items-center justify-center rounded-full bg-surface-strong",
|
|
3171
|
+
style: { width: "36px", height: "36px" },
|
|
3172
|
+
children: /* @__PURE__ */ jsx11(GiftIcon2, {})
|
|
3111
3173
|
}
|
|
3112
3174
|
)
|
|
3113
|
-
]
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
{
|
|
3119
|
-
className: "px-sm pb-sm",
|
|
3120
|
-
style: { backgroundColor: "var(--color-canvas)" },
|
|
3121
|
-
children: /* @__PURE__ */ jsx11(
|
|
3122
|
-
WorkspaceMenu,
|
|
3123
|
-
{
|
|
3124
|
-
workspaceName,
|
|
3125
|
-
initials: workspaceName.charAt(0).toUpperCase()
|
|
3126
|
-
}
|
|
3127
|
-
)
|
|
3128
|
-
}
|
|
3129
|
-
),
|
|
3130
|
-
/* @__PURE__ */ jsx11(
|
|
3131
|
-
"div",
|
|
3132
|
-
{
|
|
3133
|
-
className: "flex-1 overflow-y-auto px-sm pb-sm",
|
|
3134
|
-
style: { backgroundColor: "var(--color-canvas)" },
|
|
3135
|
-
children: /* @__PURE__ */ jsx11("ul", { className: "space-y-xxs", role: "list", children: entries.map((entry) => {
|
|
3136
|
-
const isActive = activeId === entry.id;
|
|
3137
|
-
const hasSubItems = !!entry.subItems?.length;
|
|
3138
|
-
const isExpanded = expandedIds.has(entry.id);
|
|
3139
|
-
const mappedSubItems = hasSubItems ? entry.subItems.map((sub) => ({
|
|
3140
|
-
id: sub.id,
|
|
3141
|
-
label: sub.label,
|
|
3142
|
-
onDelete: sub.onDelete,
|
|
3143
|
-
onClick: onSubSelect ? (_id) => {
|
|
3144
|
-
onSubSelect(_id);
|
|
3145
|
-
setOpen(false);
|
|
3146
|
-
} : void 0
|
|
3147
|
-
})) : void 0;
|
|
3148
|
-
return /* @__PURE__ */ jsx11(
|
|
3149
|
-
NavItem,
|
|
3175
|
+
] }),
|
|
3176
|
+
showUpgradeCard && /* @__PURE__ */ jsx11(UpgradeCard, { eyebrow: "", title: "Upgrade to Pro", subtitle: "Unlock more features" }),
|
|
3177
|
+
showFooterRow && /* @__PURE__ */ jsxs11("div", { className: "flex items-center justify-between pt-xs", children: [
|
|
3178
|
+
userInitials && /* @__PURE__ */ jsx11(
|
|
3179
|
+
"span",
|
|
3150
3180
|
{
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
else e.preventDefault();
|
|
3161
|
-
}
|
|
3162
|
-
},
|
|
3163
|
-
entry.id
|
|
3164
|
-
);
|
|
3165
|
-
}) })
|
|
3166
|
-
}
|
|
3167
|
-
),
|
|
3168
|
-
/* @__PURE__ */ jsxs11(
|
|
3169
|
-
"div",
|
|
3170
|
-
{
|
|
3171
|
-
className: "flex-shrink-0 px-sm pb-lg space-y-sm",
|
|
3172
|
-
style: { backgroundColor: "var(--color-canvas)" },
|
|
3173
|
-
children: [
|
|
3174
|
-
showShareCard && /* @__PURE__ */ jsxs11("div", { className: "rounded-xl border border-hairline bg-surface px-md py-sm flex items-center justify-between gap-md", children: [
|
|
3175
|
-
/* @__PURE__ */ jsxs11("div", { className: "flex flex-col gap-xxs min-w-0", children: [
|
|
3176
|
-
/* @__PURE__ */ jsx11("span", { className: "text-body-sm font-weight-heading-sm text-ink", children: "Share & earn" }),
|
|
3177
|
-
/* @__PURE__ */ jsx11("span", { className: "text-caption text-muted", children: "100 credits per paid referral" })
|
|
3178
|
-
] }),
|
|
3179
|
-
/* @__PURE__ */ jsx11(
|
|
3180
|
-
"span",
|
|
3181
|
+
className: "flex items-center justify-center rounded-full bg-primary text-on-primary text-body-sm font-weight-heading-sm cursor-pointer hover:bg-primary-hover transition-colors duration-150",
|
|
3182
|
+
style: { width: "36px", height: "36px" },
|
|
3183
|
+
"aria-label": "User profile",
|
|
3184
|
+
children: userInitials
|
|
3185
|
+
}
|
|
3186
|
+
),
|
|
3187
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-xs ml-auto", children: [
|
|
3188
|
+
onDarkModeToggle && /* @__PURE__ */ jsx11(
|
|
3189
|
+
Button,
|
|
3181
3190
|
{
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3191
|
+
variant: "ghost",
|
|
3192
|
+
size: "sm",
|
|
3193
|
+
"aria-label": darkMode ? "Switch to light mode" : "Switch to dark mode",
|
|
3194
|
+
onClick: onDarkModeToggle,
|
|
3195
|
+
className: "!p-xs !rounded-sm",
|
|
3196
|
+
children: darkMode ? /* @__PURE__ */ jsx11(SunIcon3, {}) : /* @__PURE__ */ jsx11(MoonIcon3, {})
|
|
3185
3197
|
}
|
|
3186
|
-
)
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
showFooterRow && /* @__PURE__ */ jsxs11("div", { className: "flex items-center justify-between pt-xs", children: [
|
|
3190
|
-
userInitials && /* @__PURE__ */ jsx11(
|
|
3191
|
-
"span",
|
|
3198
|
+
),
|
|
3199
|
+
onInboxClick && /* @__PURE__ */ jsxs11(
|
|
3200
|
+
Button,
|
|
3192
3201
|
{
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
"aria-label": "
|
|
3196
|
-
|
|
3202
|
+
variant: "ghost",
|
|
3203
|
+
size: "sm",
|
|
3204
|
+
"aria-label": "Inbox",
|
|
3205
|
+
onClick: onInboxClick,
|
|
3206
|
+
className: "!p-xs !rounded-sm relative",
|
|
3207
|
+
children: [
|
|
3208
|
+
/* @__PURE__ */ jsx11(InboxIcon2, {}),
|
|
3209
|
+
/* @__PURE__ */ jsx11(
|
|
3210
|
+
"span",
|
|
3211
|
+
{
|
|
3212
|
+
className: "absolute rounded-full bg-semantic-error",
|
|
3213
|
+
"aria-label": "New notifications",
|
|
3214
|
+
style: { width: "8px", height: "8px", top: "4px", right: "4px" }
|
|
3215
|
+
}
|
|
3216
|
+
)
|
|
3217
|
+
]
|
|
3197
3218
|
}
|
|
3198
|
-
)
|
|
3199
|
-
/* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-xs ml-auto", children: [
|
|
3200
|
-
onDarkModeToggle && /* @__PURE__ */ jsx11(
|
|
3201
|
-
Button,
|
|
3202
|
-
{
|
|
3203
|
-
variant: "ghost",
|
|
3204
|
-
size: "sm",
|
|
3205
|
-
"aria-label": darkMode ? "Switch to light mode" : "Switch to dark mode",
|
|
3206
|
-
onClick: onDarkModeToggle,
|
|
3207
|
-
className: "!p-xs !rounded-sm",
|
|
3208
|
-
children: darkMode ? /* @__PURE__ */ jsx11(SunIcon3, {}) : /* @__PURE__ */ jsx11(MoonIcon3, {})
|
|
3209
|
-
}
|
|
3210
|
-
),
|
|
3211
|
-
onInboxClick && /* @__PURE__ */ jsxs11(
|
|
3212
|
-
Button,
|
|
3213
|
-
{
|
|
3214
|
-
variant: "ghost",
|
|
3215
|
-
size: "sm",
|
|
3216
|
-
"aria-label": "Inbox",
|
|
3217
|
-
onClick: onInboxClick,
|
|
3218
|
-
className: "!p-xs !rounded-sm relative",
|
|
3219
|
-
children: [
|
|
3220
|
-
/* @__PURE__ */ jsx11(InboxIcon2, {}),
|
|
3221
|
-
/* @__PURE__ */ jsx11(
|
|
3222
|
-
"span",
|
|
3223
|
-
{
|
|
3224
|
-
className: "absolute rounded-full bg-semantic-error",
|
|
3225
|
-
"aria-label": "New notifications",
|
|
3226
|
-
style: { width: "8px", height: "8px", top: "4px", right: "4px" }
|
|
3227
|
-
}
|
|
3228
|
-
)
|
|
3229
|
-
]
|
|
3230
|
-
}
|
|
3231
|
-
)
|
|
3232
|
-
] })
|
|
3219
|
+
)
|
|
3233
3220
|
] })
|
|
3234
|
-
]
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3221
|
+
] })
|
|
3222
|
+
]
|
|
3223
|
+
}
|
|
3224
|
+
)
|
|
3225
|
+
]
|
|
3226
|
+
}
|
|
3227
|
+
)
|
|
3228
|
+
]
|
|
3229
|
+
}
|
|
3230
|
+
) : null;
|
|
3231
|
+
return /* @__PURE__ */ jsxs11(Fragment2, { children: [
|
|
3232
|
+
/* @__PURE__ */ jsx11("div", { ref, className, children: /* @__PURE__ */ jsx11(
|
|
3233
|
+
Button,
|
|
3234
|
+
{
|
|
3235
|
+
variant: "ghost",
|
|
3236
|
+
size: "sm",
|
|
3237
|
+
"aria-label": "Open navigation",
|
|
3238
|
+
"aria-expanded": open,
|
|
3239
|
+
onClick: () => setOpen(true),
|
|
3240
|
+
className: "!p-xs !rounded-md",
|
|
3241
|
+
children: /* @__PURE__ */ jsx11(HamburgerIcon, {})
|
|
3241
3242
|
}
|
|
3242
|
-
)
|
|
3243
|
+
) }),
|
|
3244
|
+
typeof window !== "undefined" ? ReactDOM.createPortal(overlayContent, document.body) : overlayContent
|
|
3243
3245
|
] });
|
|
3244
3246
|
}
|
|
3245
3247
|
);
|
package/package.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import ReactDOM from "react-dom";
|
|
2
3
|
import { Button } from "../Button";
|
|
3
4
|
import { NavItem } from "../NavItem";
|
|
4
5
|
import { WorkspaceMenu } from "../WorkspaceMenu";
|
|
@@ -174,6 +175,202 @@ export const AppSidebarMobile = React.forwardRef<HTMLDivElement, AppSidebarMobil
|
|
|
174
175
|
/* ── Whether the footer row should be rendered at all ── */
|
|
175
176
|
const showFooterRow = !!(userInitials || onInboxClick || onDarkModeToggle);
|
|
176
177
|
|
|
178
|
+
/* ── Overlay JSX — lifted out so it can be portalled ── */
|
|
179
|
+
const overlayContent = mounted ? (
|
|
180
|
+
<div
|
|
181
|
+
role="dialog"
|
|
182
|
+
aria-modal="true"
|
|
183
|
+
aria-label="Navigation menu"
|
|
184
|
+
style={{
|
|
185
|
+
position: "fixed",
|
|
186
|
+
inset: 0,
|
|
187
|
+
zIndex: 9999,
|
|
188
|
+
}}
|
|
189
|
+
>
|
|
190
|
+
{/* Scrim */}
|
|
191
|
+
<div
|
|
192
|
+
aria-hidden="true"
|
|
193
|
+
onClick={() => setOpen(false)}
|
|
194
|
+
style={{
|
|
195
|
+
position: "absolute",
|
|
196
|
+
inset: 0,
|
|
197
|
+
backgroundColor: "var(--color-scrim)",
|
|
198
|
+
opacity: visible ? 0.5 : 0,
|
|
199
|
+
transition: "opacity 0.25s ease",
|
|
200
|
+
}}
|
|
201
|
+
/>
|
|
202
|
+
|
|
203
|
+
{/* Drawer panel */}
|
|
204
|
+
<div
|
|
205
|
+
style={{
|
|
206
|
+
position: "absolute",
|
|
207
|
+
top: 0,
|
|
208
|
+
left: 0,
|
|
209
|
+
bottom: 0,
|
|
210
|
+
width: "min(280px, 85vw)",
|
|
211
|
+
display: "flex",
|
|
212
|
+
flexDirection: "column",
|
|
213
|
+
backgroundColor: "var(--color-canvas)",
|
|
214
|
+
borderRight: "1px solid var(--color-hairline)",
|
|
215
|
+
boxShadow: "var(--shadow-lg)",
|
|
216
|
+
transform: visible ? "translateX(0)" : "translateX(-100%)",
|
|
217
|
+
transition: "transform 0.28s cubic-bezier(0.32,0,0.15,1)",
|
|
218
|
+
overflowY: "auto",
|
|
219
|
+
overflowX: "hidden",
|
|
220
|
+
}}
|
|
221
|
+
>
|
|
222
|
+
{/* Header */}
|
|
223
|
+
<div
|
|
224
|
+
className="flex items-center justify-between px-md pt-md pb-sm flex-shrink-0"
|
|
225
|
+
style={{ backgroundColor: "var(--color-canvas)" }}
|
|
226
|
+
>
|
|
227
|
+
<div className="flex items-center gap-sm">
|
|
228
|
+
<LogoIcon />
|
|
229
|
+
<span className="text-body-sm font-weight-heading-sm text-ink truncate">{brandName}</span>
|
|
230
|
+
</div>
|
|
231
|
+
<Button
|
|
232
|
+
variant="ghost"
|
|
233
|
+
size="sm"
|
|
234
|
+
aria-label="Close navigation"
|
|
235
|
+
onClick={() => setOpen(false)}
|
|
236
|
+
className="!p-xs !rounded-md"
|
|
237
|
+
>
|
|
238
|
+
<CloseIcon />
|
|
239
|
+
</Button>
|
|
240
|
+
</div>
|
|
241
|
+
|
|
242
|
+
{/* Workspace switcher */}
|
|
243
|
+
{workspaceName && (
|
|
244
|
+
<div
|
|
245
|
+
className="px-sm pb-sm"
|
|
246
|
+
style={{ backgroundColor: "var(--color-canvas)" }}
|
|
247
|
+
>
|
|
248
|
+
<WorkspaceMenu
|
|
249
|
+
workspaceName={workspaceName}
|
|
250
|
+
initials={workspaceName.charAt(0).toUpperCase()}
|
|
251
|
+
/>
|
|
252
|
+
</div>
|
|
253
|
+
)}
|
|
254
|
+
|
|
255
|
+
{/* Nav entries */}
|
|
256
|
+
<div
|
|
257
|
+
className="flex-1 overflow-y-auto px-sm pb-sm"
|
|
258
|
+
style={{ backgroundColor: "var(--color-canvas)" }}
|
|
259
|
+
>
|
|
260
|
+
<ul className="space-y-xxs" role="list">
|
|
261
|
+
{entries.map((entry) => {
|
|
262
|
+
const isActive = activeId === entry.id;
|
|
263
|
+
const hasSubItems = !!(entry.subItems?.length);
|
|
264
|
+
const isExpanded = expandedIds.has(entry.id);
|
|
265
|
+
|
|
266
|
+
const mappedSubItems: NavItemSubItem[] | undefined = hasSubItems
|
|
267
|
+
? entry.subItems!.map((sub) => ({
|
|
268
|
+
id: sub.id,
|
|
269
|
+
label: sub.label,
|
|
270
|
+
onDelete: sub.onDelete,
|
|
271
|
+
onClick: onSubSelect
|
|
272
|
+
? (_id: string) => { onSubSelect(_id); setOpen(false); }
|
|
273
|
+
: undefined,
|
|
274
|
+
}))
|
|
275
|
+
: undefined;
|
|
276
|
+
|
|
277
|
+
return (
|
|
278
|
+
<NavItem
|
|
279
|
+
key={entry.id}
|
|
280
|
+
icon={entry.icon}
|
|
281
|
+
label={entry.label}
|
|
282
|
+
active={isActive}
|
|
283
|
+
subItems={mappedSubItems}
|
|
284
|
+
expanded={hasSubItems ? isExpanded : undefined}
|
|
285
|
+
onExpandToggle={hasSubItems ? () => toggleExpanded(entry.id) : undefined}
|
|
286
|
+
onClick={(e) => {
|
|
287
|
+
onSelect?.(entry.id);
|
|
288
|
+
if (!hasSubItems) setOpen(false);
|
|
289
|
+
else e.preventDefault();
|
|
290
|
+
}}
|
|
291
|
+
/>
|
|
292
|
+
);
|
|
293
|
+
})}
|
|
294
|
+
</ul>
|
|
295
|
+
</div>
|
|
296
|
+
|
|
297
|
+
{/* Footer */}
|
|
298
|
+
<div
|
|
299
|
+
className="flex-shrink-0 px-sm pb-lg space-y-sm"
|
|
300
|
+
style={{ backgroundColor: "var(--color-canvas)" }}
|
|
301
|
+
>
|
|
302
|
+
{showShareCard && (
|
|
303
|
+
<div className="rounded-xl border border-hairline bg-surface px-md py-sm flex items-center justify-between gap-md">
|
|
304
|
+
<div className="flex flex-col gap-xxs min-w-0">
|
|
305
|
+
<span className="text-body-sm font-weight-heading-sm text-ink">Share & earn</span>
|
|
306
|
+
<span className="text-caption text-muted">100 credits per paid referral</span>
|
|
307
|
+
</div>
|
|
308
|
+
<span
|
|
309
|
+
className="flex-shrink-0 flex items-center justify-center rounded-full bg-surface-strong"
|
|
310
|
+
style={{ width: "36px", height: "36px" }}
|
|
311
|
+
>
|
|
312
|
+
<GiftIcon />
|
|
313
|
+
</span>
|
|
314
|
+
</div>
|
|
315
|
+
)}
|
|
316
|
+
|
|
317
|
+
{showUpgradeCard && (
|
|
318
|
+
<UpgradeCard eyebrow="" title="Upgrade to Pro" subtitle="Unlock more features" />
|
|
319
|
+
)}
|
|
320
|
+
|
|
321
|
+
{showFooterRow && (
|
|
322
|
+
<div className="flex items-center justify-between pt-xs">
|
|
323
|
+
{/* User avatar */}
|
|
324
|
+
{userInitials && (
|
|
325
|
+
<span
|
|
326
|
+
className="flex items-center justify-center rounded-full bg-primary text-on-primary text-body-sm font-weight-heading-sm cursor-pointer hover:bg-primary-hover transition-colors duration-150"
|
|
327
|
+
style={{ width: "36px", height: "36px" }}
|
|
328
|
+
aria-label="User profile"
|
|
329
|
+
>
|
|
330
|
+
{userInitials}
|
|
331
|
+
</span>
|
|
332
|
+
)}
|
|
333
|
+
|
|
334
|
+
{/* Right-side icon group */}
|
|
335
|
+
<div className="flex items-center gap-xs ml-auto">
|
|
336
|
+
{/* Dark mode toggle — only rendered when callback is provided */}
|
|
337
|
+
{onDarkModeToggle && (
|
|
338
|
+
<Button
|
|
339
|
+
variant="ghost"
|
|
340
|
+
size="sm"
|
|
341
|
+
aria-label={darkMode ? "Switch to light mode" : "Switch to dark mode"}
|
|
342
|
+
onClick={onDarkModeToggle}
|
|
343
|
+
className="!p-xs !rounded-sm"
|
|
344
|
+
>
|
|
345
|
+
{darkMode ? <SunIcon /> : <MoonIcon />}
|
|
346
|
+
</Button>
|
|
347
|
+
)}
|
|
348
|
+
|
|
349
|
+
{/* Inbox button */}
|
|
350
|
+
{onInboxClick && (
|
|
351
|
+
<Button
|
|
352
|
+
variant="ghost"
|
|
353
|
+
size="sm"
|
|
354
|
+
aria-label="Inbox"
|
|
355
|
+
onClick={onInboxClick}
|
|
356
|
+
className="!p-xs !rounded-sm relative"
|
|
357
|
+
>
|
|
358
|
+
<InboxIcon />
|
|
359
|
+
<span
|
|
360
|
+
className="absolute rounded-full bg-semantic-error"
|
|
361
|
+
aria-label="New notifications"
|
|
362
|
+
style={{ width: "8px", height: "8px", top: "4px", right: "4px" }}
|
|
363
|
+
/>
|
|
364
|
+
</Button>
|
|
365
|
+
)}
|
|
366
|
+
</div>
|
|
367
|
+
</div>
|
|
368
|
+
)}
|
|
369
|
+
</div>
|
|
370
|
+
</div>
|
|
371
|
+
</div>
|
|
372
|
+
) : null;
|
|
373
|
+
|
|
177
374
|
return (
|
|
178
375
|
<>
|
|
179
376
|
{/* ── Trigger ── */}
|
|
@@ -190,205 +387,15 @@ export const AppSidebarMobile = React.forwardRef<HTMLDivElement, AppSidebarMobil
|
|
|
190
387
|
</Button>
|
|
191
388
|
</div>
|
|
192
389
|
|
|
193
|
-
{/*
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
aria-label="Navigation menu"
|
|
203
|
-
style={{
|
|
204
|
-
position: "fixed",
|
|
205
|
-
inset: 0,
|
|
206
|
-
zIndex: 9999,
|
|
207
|
-
}}
|
|
208
|
-
>
|
|
209
|
-
{/* Scrim */}
|
|
210
|
-
<div
|
|
211
|
-
aria-hidden="true"
|
|
212
|
-
onClick={() => setOpen(false)}
|
|
213
|
-
style={{
|
|
214
|
-
position: "absolute",
|
|
215
|
-
inset: 0,
|
|
216
|
-
backgroundColor: "var(--color-scrim)",
|
|
217
|
-
opacity: visible ? 0.5 : 0,
|
|
218
|
-
transition: "opacity 0.25s ease",
|
|
219
|
-
}}
|
|
220
|
-
/>
|
|
221
|
-
|
|
222
|
-
{/* Drawer panel */}
|
|
223
|
-
<div
|
|
224
|
-
style={{
|
|
225
|
-
position: "absolute",
|
|
226
|
-
top: 0,
|
|
227
|
-
left: 0,
|
|
228
|
-
bottom: 0,
|
|
229
|
-
width: "min(280px, 85vw)",
|
|
230
|
-
display: "flex",
|
|
231
|
-
flexDirection: "column",
|
|
232
|
-
backgroundColor: "var(--color-canvas)",
|
|
233
|
-
borderRight: "1px solid var(--color-hairline)",
|
|
234
|
-
boxShadow: "var(--shadow-lg)",
|
|
235
|
-
transform: visible ? "translateX(0)" : "translateX(-100%)",
|
|
236
|
-
transition: "transform 0.28s cubic-bezier(0.32,0,0.15,1)",
|
|
237
|
-
overflowY: "auto",
|
|
238
|
-
overflowX: "hidden",
|
|
239
|
-
}}
|
|
240
|
-
>
|
|
241
|
-
{/* Header */}
|
|
242
|
-
<div
|
|
243
|
-
className="flex items-center justify-between px-md pt-md pb-sm flex-shrink-0"
|
|
244
|
-
style={{ backgroundColor: "var(--color-canvas)" }}
|
|
245
|
-
>
|
|
246
|
-
<div className="flex items-center gap-sm">
|
|
247
|
-
<LogoIcon />
|
|
248
|
-
<span className="text-body-sm font-weight-heading-sm text-ink truncate">{brandName}</span>
|
|
249
|
-
</div>
|
|
250
|
-
<Button
|
|
251
|
-
variant="ghost"
|
|
252
|
-
size="sm"
|
|
253
|
-
aria-label="Close navigation"
|
|
254
|
-
onClick={() => setOpen(false)}
|
|
255
|
-
className="!p-xs !rounded-md"
|
|
256
|
-
>
|
|
257
|
-
<CloseIcon />
|
|
258
|
-
</Button>
|
|
259
|
-
</div>
|
|
260
|
-
|
|
261
|
-
{/* Workspace switcher */}
|
|
262
|
-
{workspaceName && (
|
|
263
|
-
<div
|
|
264
|
-
className="px-sm pb-sm"
|
|
265
|
-
style={{ backgroundColor: "var(--color-canvas)" }}
|
|
266
|
-
>
|
|
267
|
-
<WorkspaceMenu
|
|
268
|
-
workspaceName={workspaceName}
|
|
269
|
-
initials={workspaceName.charAt(0).toUpperCase()}
|
|
270
|
-
/>
|
|
271
|
-
</div>
|
|
272
|
-
)}
|
|
273
|
-
|
|
274
|
-
{/* Nav entries */}
|
|
275
|
-
<div
|
|
276
|
-
className="flex-1 overflow-y-auto px-sm pb-sm"
|
|
277
|
-
style={{ backgroundColor: "var(--color-canvas)" }}
|
|
278
|
-
>
|
|
279
|
-
<ul className="space-y-xxs" role="list">
|
|
280
|
-
{entries.map((entry) => {
|
|
281
|
-
const isActive = activeId === entry.id;
|
|
282
|
-
const hasSubItems = !!(entry.subItems?.length);
|
|
283
|
-
const isExpanded = expandedIds.has(entry.id);
|
|
284
|
-
|
|
285
|
-
const mappedSubItems: NavItemSubItem[] | undefined = hasSubItems
|
|
286
|
-
? entry.subItems!.map((sub) => ({
|
|
287
|
-
id: sub.id,
|
|
288
|
-
label: sub.label,
|
|
289
|
-
onDelete: sub.onDelete,
|
|
290
|
-
onClick: onSubSelect
|
|
291
|
-
? (_id: string) => { onSubSelect(_id); setOpen(false); }
|
|
292
|
-
: undefined,
|
|
293
|
-
}))
|
|
294
|
-
: undefined;
|
|
295
|
-
|
|
296
|
-
return (
|
|
297
|
-
<NavItem
|
|
298
|
-
key={entry.id}
|
|
299
|
-
icon={entry.icon}
|
|
300
|
-
label={entry.label}
|
|
301
|
-
active={isActive}
|
|
302
|
-
subItems={mappedSubItems}
|
|
303
|
-
expanded={hasSubItems ? isExpanded : undefined}
|
|
304
|
-
onExpandToggle={hasSubItems ? () => toggleExpanded(entry.id) : undefined}
|
|
305
|
-
onClick={(e) => {
|
|
306
|
-
onSelect?.(entry.id);
|
|
307
|
-
if (!hasSubItems) setOpen(false);
|
|
308
|
-
else e.preventDefault();
|
|
309
|
-
}}
|
|
310
|
-
/>
|
|
311
|
-
);
|
|
312
|
-
})}
|
|
313
|
-
</ul>
|
|
314
|
-
</div>
|
|
315
|
-
|
|
316
|
-
{/* Footer */}
|
|
317
|
-
<div
|
|
318
|
-
className="flex-shrink-0 px-sm pb-lg space-y-sm"
|
|
319
|
-
style={{ backgroundColor: "var(--color-canvas)" }}
|
|
320
|
-
>
|
|
321
|
-
{showShareCard && (
|
|
322
|
-
<div className="rounded-xl border border-hairline bg-surface px-md py-sm flex items-center justify-between gap-md">
|
|
323
|
-
<div className="flex flex-col gap-xxs min-w-0">
|
|
324
|
-
<span className="text-body-sm font-weight-heading-sm text-ink">Share & earn</span>
|
|
325
|
-
<span className="text-caption text-muted">100 credits per paid referral</span>
|
|
326
|
-
</div>
|
|
327
|
-
<span
|
|
328
|
-
className="flex-shrink-0 flex items-center justify-center rounded-full bg-surface-strong"
|
|
329
|
-
style={{ width: "36px", height: "36px" }}
|
|
330
|
-
>
|
|
331
|
-
<GiftIcon />
|
|
332
|
-
</span>
|
|
333
|
-
</div>
|
|
334
|
-
)}
|
|
335
|
-
|
|
336
|
-
{showUpgradeCard && (
|
|
337
|
-
<UpgradeCard eyebrow="" title="Upgrade to Pro" subtitle="Unlock more features" />
|
|
338
|
-
)}
|
|
339
|
-
|
|
340
|
-
{showFooterRow && (
|
|
341
|
-
<div className="flex items-center justify-between pt-xs">
|
|
342
|
-
{/* User avatar */}
|
|
343
|
-
{userInitials && (
|
|
344
|
-
<span
|
|
345
|
-
className="flex items-center justify-center rounded-full bg-primary text-on-primary text-body-sm font-weight-heading-sm cursor-pointer hover:bg-primary-hover transition-colors duration-150"
|
|
346
|
-
style={{ width: "36px", height: "36px" }}
|
|
347
|
-
aria-label="User profile"
|
|
348
|
-
>
|
|
349
|
-
{userInitials}
|
|
350
|
-
</span>
|
|
351
|
-
)}
|
|
352
|
-
|
|
353
|
-
{/* Right-side icon group */}
|
|
354
|
-
<div className="flex items-center gap-xs ml-auto">
|
|
355
|
-
{/* Dark mode toggle — only rendered when callback is provided */}
|
|
356
|
-
{onDarkModeToggle && (
|
|
357
|
-
<Button
|
|
358
|
-
variant="ghost"
|
|
359
|
-
size="sm"
|
|
360
|
-
aria-label={darkMode ? "Switch to light mode" : "Switch to dark mode"}
|
|
361
|
-
onClick={onDarkModeToggle}
|
|
362
|
-
className="!p-xs !rounded-sm"
|
|
363
|
-
>
|
|
364
|
-
{darkMode ? <SunIcon /> : <MoonIcon />}
|
|
365
|
-
</Button>
|
|
366
|
-
)}
|
|
367
|
-
|
|
368
|
-
{/* Inbox button */}
|
|
369
|
-
{onInboxClick && (
|
|
370
|
-
<Button
|
|
371
|
-
variant="ghost"
|
|
372
|
-
size="sm"
|
|
373
|
-
aria-label="Inbox"
|
|
374
|
-
onClick={onInboxClick}
|
|
375
|
-
className="!p-xs !rounded-sm relative"
|
|
376
|
-
>
|
|
377
|
-
<InboxIcon />
|
|
378
|
-
<span
|
|
379
|
-
className="absolute rounded-full bg-semantic-error"
|
|
380
|
-
aria-label="New notifications"
|
|
381
|
-
style={{ width: "8px", height: "8px", top: "4px", right: "4px" }}
|
|
382
|
-
/>
|
|
383
|
-
</Button>
|
|
384
|
-
)}
|
|
385
|
-
</div>
|
|
386
|
-
</div>
|
|
387
|
-
)}
|
|
388
|
-
</div>
|
|
389
|
-
</div>
|
|
390
|
-
</div>
|
|
391
|
-
)}
|
|
390
|
+
{/*
|
|
391
|
+
── Overlay — rendered via ReactDOM.createPortal into document.body.
|
|
392
|
+
This ensures the fixed-position overlay always escapes any ancestor
|
|
393
|
+
stacking context created by `position: relative` + `z-index` on a
|
|
394
|
+
parent element. The typeof window guard makes it safe in SSR.
|
|
395
|
+
*/}
|
|
396
|
+
{typeof window !== "undefined"
|
|
397
|
+
? ReactDOM.createPortal(overlayContent, document.body)
|
|
398
|
+
: overlayContent}
|
|
392
399
|
</>
|
|
393
400
|
);
|
|
394
401
|
},
|