@designa8/vibedesign-v6 1.10.1 → 1.10.2
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 +52 -26
- package/dist/index.js +52 -26
- package/package.json +1 -1
- package/src/atoms/AppSidebarMobile/AppSidebarMobile.tsx +68 -23
- package/src/atoms/AppSidebarMobile/preview.tsx +30 -3
package/README.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -2988,6 +2988,18 @@ var InboxIcon2 = () => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("svg", { v
|
|
|
2988
2988
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("polyline", { points: "22 12 16 12 14 15 10 15 8 12 2 12" }),
|
|
2989
2989
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("path", { d: "M5.45 5.11L2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z" })
|
|
2990
2990
|
] });
|
|
2991
|
+
var SunIcon2 = () => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round", style: { width: "18px", height: "18px" }, "aria-hidden": "true", children: [
|
|
2992
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("circle", { cx: "12", cy: "12", r: "5" }),
|
|
2993
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("line", { x1: "12", y1: "1", x2: "12", y2: "3" }),
|
|
2994
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("line", { x1: "12", y1: "21", x2: "12", y2: "23" }),
|
|
2995
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("line", { x1: "4.22", y1: "4.22", x2: "5.64", y2: "5.64" }),
|
|
2996
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("line", { x1: "18.36", y1: "18.36", x2: "19.78", y2: "19.78" }),
|
|
2997
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("line", { x1: "1", y1: "12", x2: "3", y2: "12" }),
|
|
2998
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("line", { x1: "21", y1: "12", x2: "23", y2: "12" }),
|
|
2999
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("line", { x1: "4.22", y1: "19.78", x2: "5.64", y2: "18.36" }),
|
|
3000
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("line", { x1: "18.36", y1: "5.64", x2: "19.78", y2: "4.22" })
|
|
3001
|
+
] });
|
|
3002
|
+
var MoonIcon2 = () => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round", style: { width: "18px", height: "18px" }, "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" }) });
|
|
2991
3003
|
var AppSidebarMobile = import_react11.default.forwardRef(
|
|
2992
3004
|
({
|
|
2993
3005
|
brandName = "Atoms",
|
|
@@ -3001,6 +3013,8 @@ var AppSidebarMobile = import_react11.default.forwardRef(
|
|
|
3001
3013
|
showUpgradeCard = false,
|
|
3002
3014
|
userInitials,
|
|
3003
3015
|
onInboxClick,
|
|
3016
|
+
darkMode = false,
|
|
3017
|
+
onDarkModeToggle,
|
|
3004
3018
|
open: openProp,
|
|
3005
3019
|
onOpenChange,
|
|
3006
3020
|
className
|
|
@@ -3040,6 +3054,7 @@ var AppSidebarMobile = import_react11.default.forwardRef(
|
|
|
3040
3054
|
return () => clearTimeout(t);
|
|
3041
3055
|
}
|
|
3042
3056
|
}, [open]);
|
|
3057
|
+
const showFooterRow = !!(userInitials || onInboxClick || onDarkModeToggle);
|
|
3043
3058
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
|
|
3044
3059
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { ref, className, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
3045
3060
|
Button,
|
|
@@ -3090,8 +3105,6 @@ var AppSidebarMobile = import_react11.default.forwardRef(
|
|
|
3090
3105
|
width: "min(280px, 85vw)",
|
|
3091
3106
|
display: "flex",
|
|
3092
3107
|
flexDirection: "column",
|
|
3093
|
-
/* Solid opaque fill — CSS var resolves from the project tokens;
|
|
3094
|
-
the inline style wins over any inherited transparency. */
|
|
3095
3108
|
backgroundColor: "var(--color-canvas)",
|
|
3096
3109
|
borderRight: "1px solid var(--color-hairline)",
|
|
3097
3110
|
boxShadow: "var(--shadow-lg)",
|
|
@@ -3198,7 +3211,7 @@ var AppSidebarMobile = import_react11.default.forwardRef(
|
|
|
3198
3211
|
)
|
|
3199
3212
|
] }),
|
|
3200
3213
|
showUpgradeCard && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(UpgradeCard, { eyebrow: "", title: "Upgrade to Pro", subtitle: "Unlock more features" }),
|
|
3201
|
-
|
|
3214
|
+
showFooterRow && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex items-center justify-between pt-xs", children: [
|
|
3202
3215
|
userInitials && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
3203
3216
|
"span",
|
|
3204
3217
|
{
|
|
@@ -3208,27 +3221,40 @@ var AppSidebarMobile = import_react11.default.forwardRef(
|
|
|
3208
3221
|
children: userInitials
|
|
3209
3222
|
}
|
|
3210
3223
|
),
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3224
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex items-center gap-xs ml-auto", children: [
|
|
3225
|
+
onDarkModeToggle && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
3226
|
+
Button,
|
|
3227
|
+
{
|
|
3228
|
+
variant: "ghost",
|
|
3229
|
+
size: "sm",
|
|
3230
|
+
"aria-label": darkMode ? "Switch to light mode" : "Switch to dark mode",
|
|
3231
|
+
onClick: onDarkModeToggle,
|
|
3232
|
+
className: "!p-xs !rounded-sm",
|
|
3233
|
+
children: darkMode ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SunIcon2, {}) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(MoonIcon2, {})
|
|
3234
|
+
}
|
|
3235
|
+
),
|
|
3236
|
+
onInboxClick && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
3237
|
+
Button,
|
|
3238
|
+
{
|
|
3239
|
+
variant: "ghost",
|
|
3240
|
+
size: "sm",
|
|
3241
|
+
"aria-label": "Inbox",
|
|
3242
|
+
onClick: onInboxClick,
|
|
3243
|
+
className: "!p-xs !rounded-sm relative",
|
|
3244
|
+
children: [
|
|
3245
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(InboxIcon2, {}),
|
|
3246
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
3247
|
+
"span",
|
|
3248
|
+
{
|
|
3249
|
+
className: "absolute rounded-full bg-semantic-error",
|
|
3250
|
+
"aria-label": "New notifications",
|
|
3251
|
+
style: { width: "8px", height: "8px", top: "4px", right: "4px" }
|
|
3252
|
+
}
|
|
3253
|
+
)
|
|
3254
|
+
]
|
|
3255
|
+
}
|
|
3256
|
+
)
|
|
3257
|
+
] })
|
|
3232
3258
|
] })
|
|
3233
3259
|
]
|
|
3234
3260
|
}
|
|
@@ -4082,7 +4108,7 @@ var InspectIcon = () => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("svg", {
|
|
|
4082
4108
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { d: "M12 8v4l3 3" }),
|
|
4083
4109
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("circle", { cx: "12", cy: "12", r: "1", fill: "currentColor", stroke: "none" })
|
|
4084
4110
|
] });
|
|
4085
|
-
var
|
|
4111
|
+
var MoonIcon3 = () => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("svg", { width: "15", height: "15", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" }) });
|
|
4086
4112
|
var FullscreenIcon = () => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("svg", { width: "15", height: "15", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
|
|
4087
4113
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("polyline", { points: "15 3 21 3 21 9" }),
|
|
4088
4114
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("polyline", { points: "9 21 3 21 3 15" }),
|
|
@@ -4199,7 +4225,7 @@ var PreviewToolbar = import_react18.default.forwardRef(
|
|
|
4199
4225
|
onClick: onDarkToggle,
|
|
4200
4226
|
className: "gap-xs rounded-xl",
|
|
4201
4227
|
children: [
|
|
4202
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
4228
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(MoonIcon3, {}),
|
|
4203
4229
|
"Dark"
|
|
4204
4230
|
]
|
|
4205
4231
|
}
|
package/dist/index.js
CHANGED
|
@@ -2937,6 +2937,18 @@ var InboxIcon2 = () => /* @__PURE__ */ jsxs11("svg", { viewBox: "0 0 24 24", fil
|
|
|
2937
2937
|
/* @__PURE__ */ jsx11("polyline", { points: "22 12 16 12 14 15 10 15 8 12 2 12" }),
|
|
2938
2938
|
/* @__PURE__ */ jsx11("path", { d: "M5.45 5.11L2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z" })
|
|
2939
2939
|
] });
|
|
2940
|
+
var SunIcon2 = () => /* @__PURE__ */ jsxs11("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round", style: { width: "18px", height: "18px" }, "aria-hidden": "true", children: [
|
|
2941
|
+
/* @__PURE__ */ jsx11("circle", { cx: "12", cy: "12", r: "5" }),
|
|
2942
|
+
/* @__PURE__ */ jsx11("line", { x1: "12", y1: "1", x2: "12", y2: "3" }),
|
|
2943
|
+
/* @__PURE__ */ jsx11("line", { x1: "12", y1: "21", x2: "12", y2: "23" }),
|
|
2944
|
+
/* @__PURE__ */ jsx11("line", { x1: "4.22", y1: "4.22", x2: "5.64", y2: "5.64" }),
|
|
2945
|
+
/* @__PURE__ */ jsx11("line", { x1: "18.36", y1: "18.36", x2: "19.78", y2: "19.78" }),
|
|
2946
|
+
/* @__PURE__ */ jsx11("line", { x1: "1", y1: "12", x2: "3", y2: "12" }),
|
|
2947
|
+
/* @__PURE__ */ jsx11("line", { x1: "21", y1: "12", x2: "23", y2: "12" }),
|
|
2948
|
+
/* @__PURE__ */ jsx11("line", { x1: "4.22", y1: "19.78", x2: "5.64", y2: "18.36" }),
|
|
2949
|
+
/* @__PURE__ */ jsx11("line", { x1: "18.36", y1: "5.64", x2: "19.78", y2: "4.22" })
|
|
2950
|
+
] });
|
|
2951
|
+
var MoonIcon2 = () => /* @__PURE__ */ jsx11("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round", style: { width: "18px", height: "18px" }, "aria-hidden": "true", children: /* @__PURE__ */ jsx11("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" }) });
|
|
2940
2952
|
var AppSidebarMobile = React11.forwardRef(
|
|
2941
2953
|
({
|
|
2942
2954
|
brandName = "Atoms",
|
|
@@ -2950,6 +2962,8 @@ var AppSidebarMobile = React11.forwardRef(
|
|
|
2950
2962
|
showUpgradeCard = false,
|
|
2951
2963
|
userInitials,
|
|
2952
2964
|
onInboxClick,
|
|
2965
|
+
darkMode = false,
|
|
2966
|
+
onDarkModeToggle,
|
|
2953
2967
|
open: openProp,
|
|
2954
2968
|
onOpenChange,
|
|
2955
2969
|
className
|
|
@@ -2989,6 +3003,7 @@ var AppSidebarMobile = React11.forwardRef(
|
|
|
2989
3003
|
return () => clearTimeout(t);
|
|
2990
3004
|
}
|
|
2991
3005
|
}, [open]);
|
|
3006
|
+
const showFooterRow = !!(userInitials || onInboxClick || onDarkModeToggle);
|
|
2992
3007
|
return /* @__PURE__ */ jsxs11(Fragment2, { children: [
|
|
2993
3008
|
/* @__PURE__ */ jsx11("div", { ref, className, children: /* @__PURE__ */ jsx11(
|
|
2994
3009
|
Button,
|
|
@@ -3039,8 +3054,6 @@ var AppSidebarMobile = React11.forwardRef(
|
|
|
3039
3054
|
width: "min(280px, 85vw)",
|
|
3040
3055
|
display: "flex",
|
|
3041
3056
|
flexDirection: "column",
|
|
3042
|
-
/* Solid opaque fill — CSS var resolves from the project tokens;
|
|
3043
|
-
the inline style wins over any inherited transparency. */
|
|
3044
3057
|
backgroundColor: "var(--color-canvas)",
|
|
3045
3058
|
borderRight: "1px solid var(--color-hairline)",
|
|
3046
3059
|
boxShadow: "var(--shadow-lg)",
|
|
@@ -3147,7 +3160,7 @@ var AppSidebarMobile = React11.forwardRef(
|
|
|
3147
3160
|
)
|
|
3148
3161
|
] }),
|
|
3149
3162
|
showUpgradeCard && /* @__PURE__ */ jsx11(UpgradeCard, { eyebrow: "", title: "Upgrade to Pro", subtitle: "Unlock more features" }),
|
|
3150
|
-
|
|
3163
|
+
showFooterRow && /* @__PURE__ */ jsxs11("div", { className: "flex items-center justify-between pt-xs", children: [
|
|
3151
3164
|
userInitials && /* @__PURE__ */ jsx11(
|
|
3152
3165
|
"span",
|
|
3153
3166
|
{
|
|
@@ -3157,27 +3170,40 @@ var AppSidebarMobile = React11.forwardRef(
|
|
|
3157
3170
|
children: userInitials
|
|
3158
3171
|
}
|
|
3159
3172
|
),
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
/* @__PURE__ */ jsx11(
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3173
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-xs ml-auto", children: [
|
|
3174
|
+
onDarkModeToggle && /* @__PURE__ */ jsx11(
|
|
3175
|
+
Button,
|
|
3176
|
+
{
|
|
3177
|
+
variant: "ghost",
|
|
3178
|
+
size: "sm",
|
|
3179
|
+
"aria-label": darkMode ? "Switch to light mode" : "Switch to dark mode",
|
|
3180
|
+
onClick: onDarkModeToggle,
|
|
3181
|
+
className: "!p-xs !rounded-sm",
|
|
3182
|
+
children: darkMode ? /* @__PURE__ */ jsx11(SunIcon2, {}) : /* @__PURE__ */ jsx11(MoonIcon2, {})
|
|
3183
|
+
}
|
|
3184
|
+
),
|
|
3185
|
+
onInboxClick && /* @__PURE__ */ jsxs11(
|
|
3186
|
+
Button,
|
|
3187
|
+
{
|
|
3188
|
+
variant: "ghost",
|
|
3189
|
+
size: "sm",
|
|
3190
|
+
"aria-label": "Inbox",
|
|
3191
|
+
onClick: onInboxClick,
|
|
3192
|
+
className: "!p-xs !rounded-sm relative",
|
|
3193
|
+
children: [
|
|
3194
|
+
/* @__PURE__ */ jsx11(InboxIcon2, {}),
|
|
3195
|
+
/* @__PURE__ */ jsx11(
|
|
3196
|
+
"span",
|
|
3197
|
+
{
|
|
3198
|
+
className: "absolute rounded-full bg-semantic-error",
|
|
3199
|
+
"aria-label": "New notifications",
|
|
3200
|
+
style: { width: "8px", height: "8px", top: "4px", right: "4px" }
|
|
3201
|
+
}
|
|
3202
|
+
)
|
|
3203
|
+
]
|
|
3204
|
+
}
|
|
3205
|
+
)
|
|
3206
|
+
] })
|
|
3181
3207
|
] })
|
|
3182
3208
|
]
|
|
3183
3209
|
}
|
|
@@ -4031,7 +4057,7 @@ var InspectIcon = () => /* @__PURE__ */ jsxs18("svg", { width: "15", height: "15
|
|
|
4031
4057
|
/* @__PURE__ */ jsx18("path", { d: "M12 8v4l3 3" }),
|
|
4032
4058
|
/* @__PURE__ */ jsx18("circle", { cx: "12", cy: "12", r: "1", fill: "currentColor", stroke: "none" })
|
|
4033
4059
|
] });
|
|
4034
|
-
var
|
|
4060
|
+
var MoonIcon3 = () => /* @__PURE__ */ jsx18("svg", { width: "15", height: "15", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ jsx18("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" }) });
|
|
4035
4061
|
var FullscreenIcon = () => /* @__PURE__ */ jsxs18("svg", { width: "15", height: "15", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
|
|
4036
4062
|
/* @__PURE__ */ jsx18("polyline", { points: "15 3 21 3 21 9" }),
|
|
4037
4063
|
/* @__PURE__ */ jsx18("polyline", { points: "9 21 3 21 3 15" }),
|
|
@@ -4148,7 +4174,7 @@ var PreviewToolbar = React18.forwardRef(
|
|
|
4148
4174
|
onClick: onDarkToggle,
|
|
4149
4175
|
className: "gap-xs rounded-xl",
|
|
4150
4176
|
children: [
|
|
4151
|
-
/* @__PURE__ */ jsx18(
|
|
4177
|
+
/* @__PURE__ */ jsx18(MoonIcon3, {}),
|
|
4152
4178
|
"Dark"
|
|
4153
4179
|
]
|
|
4154
4180
|
}
|
package/package.json
CHANGED
|
@@ -47,6 +47,28 @@ const InboxIcon = () => (
|
|
|
47
47
|
</svg>
|
|
48
48
|
);
|
|
49
49
|
|
|
50
|
+
/** Sun icon — shown when darkMode is true (click to switch to light) */
|
|
51
|
+
const SunIcon = () => (
|
|
52
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.75" strokeLinecap="round" strokeLinejoin="round" style={{ width: "18px", height: "18px" }} aria-hidden="true">
|
|
53
|
+
<circle cx="12" cy="12" r="5" />
|
|
54
|
+
<line x1="12" y1="1" x2="12" y2="3" />
|
|
55
|
+
<line x1="12" y1="21" x2="12" y2="23" />
|
|
56
|
+
<line x1="4.22" y1="4.22" x2="5.64" y2="5.64" />
|
|
57
|
+
<line x1="18.36" y1="18.36" x2="19.78" y2="19.78" />
|
|
58
|
+
<line x1="1" y1="12" x2="3" y2="12" />
|
|
59
|
+
<line x1="21" y1="12" x2="23" y2="12" />
|
|
60
|
+
<line x1="4.22" y1="19.78" x2="5.64" y2="18.36" />
|
|
61
|
+
<line x1="18.36" y1="5.64" x2="19.78" y2="4.22" />
|
|
62
|
+
</svg>
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
/** Moon icon — shown when darkMode is false (click to switch to dark) */
|
|
66
|
+
const MoonIcon = () => (
|
|
67
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.75" strokeLinecap="round" strokeLinejoin="round" style={{ width: "18px", height: "18px" }} aria-hidden="true">
|
|
68
|
+
<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" />
|
|
69
|
+
</svg>
|
|
70
|
+
);
|
|
71
|
+
|
|
50
72
|
/* ─── Types ─────────────────────────────────────────────────────────────── */
|
|
51
73
|
|
|
52
74
|
export interface MobileNavSubItem {
|
|
@@ -74,6 +96,10 @@ export interface AppSidebarMobileProps {
|
|
|
74
96
|
showUpgradeCard?: boolean;
|
|
75
97
|
userInitials?: string;
|
|
76
98
|
onInboxClick?: () => void;
|
|
99
|
+
/** Whether dark mode is currently active. Used to pick sun vs moon icon. */
|
|
100
|
+
darkMode?: boolean;
|
|
101
|
+
/** When provided, renders a dark-mode toggle button in the footer. */
|
|
102
|
+
onDarkModeToggle?: () => void;
|
|
77
103
|
open?: boolean;
|
|
78
104
|
onOpenChange?: (open: boolean) => void;
|
|
79
105
|
className?: string;
|
|
@@ -95,6 +121,8 @@ export const AppSidebarMobile = React.forwardRef<HTMLDivElement, AppSidebarMobil
|
|
|
95
121
|
showUpgradeCard = false,
|
|
96
122
|
userInitials,
|
|
97
123
|
onInboxClick,
|
|
124
|
+
darkMode = false,
|
|
125
|
+
onDarkModeToggle,
|
|
98
126
|
open: openProp,
|
|
99
127
|
onOpenChange,
|
|
100
128
|
className,
|
|
@@ -143,6 +171,9 @@ export const AppSidebarMobile = React.forwardRef<HTMLDivElement, AppSidebarMobil
|
|
|
143
171
|
}
|
|
144
172
|
}, [open]);
|
|
145
173
|
|
|
174
|
+
/* ── Whether the footer row should be rendered at all ── */
|
|
175
|
+
const showFooterRow = !!(userInitials || onInboxClick || onDarkModeToggle);
|
|
176
|
+
|
|
146
177
|
return (
|
|
147
178
|
<>
|
|
148
179
|
{/* ── Trigger ── */}
|
|
@@ -188,10 +219,7 @@ export const AppSidebarMobile = React.forwardRef<HTMLDivElement, AppSidebarMobil
|
|
|
188
219
|
}}
|
|
189
220
|
/>
|
|
190
221
|
|
|
191
|
-
{/* Drawer panel
|
|
192
|
-
KEY FIX: background-color is set BOTH as a Tailwind class AND
|
|
193
|
-
as an inline style with a CSS var + html fallback so it is
|
|
194
|
-
always fully opaque — never transparent. */}
|
|
222
|
+
{/* Drawer panel */}
|
|
195
223
|
<div
|
|
196
224
|
style={{
|
|
197
225
|
position: "absolute",
|
|
@@ -201,8 +229,6 @@ export const AppSidebarMobile = React.forwardRef<HTMLDivElement, AppSidebarMobil
|
|
|
201
229
|
width: "min(280px, 85vw)",
|
|
202
230
|
display: "flex",
|
|
203
231
|
flexDirection: "column",
|
|
204
|
-
/* Solid opaque fill — CSS var resolves from the project tokens;
|
|
205
|
-
the inline style wins over any inherited transparency. */
|
|
206
232
|
backgroundColor: "var(--color-canvas)",
|
|
207
233
|
borderRight: "1px solid var(--color-hairline)",
|
|
208
234
|
boxShadow: "var(--shadow-lg)",
|
|
@@ -311,8 +337,9 @@ export const AppSidebarMobile = React.forwardRef<HTMLDivElement, AppSidebarMobil
|
|
|
311
337
|
<UpgradeCard eyebrow="" title="Upgrade to Pro" subtitle="Unlock more features" />
|
|
312
338
|
)}
|
|
313
339
|
|
|
314
|
-
{
|
|
340
|
+
{showFooterRow && (
|
|
315
341
|
<div className="flex items-center justify-between pt-xs">
|
|
342
|
+
{/* User avatar */}
|
|
316
343
|
{userInitials && (
|
|
317
344
|
<span
|
|
318
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"
|
|
@@ -322,22 +349,40 @@ export const AppSidebarMobile = React.forwardRef<HTMLDivElement, AppSidebarMobil
|
|
|
322
349
|
{userInitials}
|
|
323
350
|
</span>
|
|
324
351
|
)}
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
className="
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
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>
|
|
341
386
|
</div>
|
|
342
387
|
)}
|
|
343
388
|
</div>
|
|
@@ -30,14 +30,15 @@ const ENTRIES = [
|
|
|
30
30
|
|
|
31
31
|
export default function Preview() {
|
|
32
32
|
const [activeId, setActiveId] = React.useState("home");
|
|
33
|
+
const [isDark, setIsDark] = React.useState(false);
|
|
33
34
|
|
|
34
35
|
return (
|
|
35
36
|
<div className="w-full max-w-3xl mx-auto p-lg space-y-lg">
|
|
36
|
-
{/*
|
|
37
|
+
{/* Basic usage — no dark mode toggle */}
|
|
37
38
|
<div className="rounded-xl bg-surface border border-hairline p-lg flex items-center justify-between gap-md">
|
|
38
39
|
<div>
|
|
39
|
-
<p className="text-body-sm font-weight-heading-sm text-ink mb-xs">
|
|
40
|
-
<p className="text-caption text-muted">Tap the hamburger
|
|
40
|
+
<p className="text-body-sm font-weight-heading-sm text-ink mb-xs">Default (no toggle)</p>
|
|
41
|
+
<p className="text-caption text-muted">Tap the hamburger to open the drawer. No dark-mode button shown.</p>
|
|
41
42
|
</div>
|
|
42
43
|
<AppSidebarMobile
|
|
43
44
|
brandName="Atoms"
|
|
@@ -52,6 +53,30 @@ export default function Preview() {
|
|
|
52
53
|
/>
|
|
53
54
|
</div>
|
|
54
55
|
|
|
56
|
+
{/* With dark mode toggle */}
|
|
57
|
+
<div className="rounded-xl bg-surface border border-hairline p-lg flex items-center justify-between gap-md">
|
|
58
|
+
<div>
|
|
59
|
+
<p className="text-body-sm font-weight-heading-sm text-ink mb-xs">With dark-mode toggle</p>
|
|
60
|
+
<p className="text-caption text-muted">
|
|
61
|
+
Opens the drawer and shows a sun/moon icon button in the footer row.
|
|
62
|
+
Currently: <strong>{isDark ? "dark" : "light"}</strong>
|
|
63
|
+
</p>
|
|
64
|
+
</div>
|
|
65
|
+
<AppSidebarMobile
|
|
66
|
+
brandName="Atoms"
|
|
67
|
+
entries={ENTRIES}
|
|
68
|
+
activeId={activeId}
|
|
69
|
+
onSelect={setActiveId}
|
|
70
|
+
workspaceName="Hello Designer"
|
|
71
|
+
showShareCard
|
|
72
|
+
showUpgradeCard
|
|
73
|
+
userInitials="N"
|
|
74
|
+
onInboxClick={() => {}}
|
|
75
|
+
darkMode={isDark}
|
|
76
|
+
onDarkModeToggle={() => setIsDark((d) => !d)}
|
|
77
|
+
/>
|
|
78
|
+
</div>
|
|
79
|
+
|
|
55
80
|
{/* Simulated mobile frame */}
|
|
56
81
|
<div
|
|
57
82
|
className="mx-auto rounded-xl overflow-hidden border border-hairline bg-surface-soft"
|
|
@@ -69,6 +94,8 @@ export default function Preview() {
|
|
|
69
94
|
showUpgradeCard
|
|
70
95
|
userInitials="N"
|
|
71
96
|
onInboxClick={() => {}}
|
|
97
|
+
darkMode={isDark}
|
|
98
|
+
onDarkModeToggle={() => setIsDark((d) => !d)}
|
|
72
99
|
/>
|
|
73
100
|
<span className="text-body-sm font-weight-heading-sm text-ink">Atoms</span>
|
|
74
101
|
<span
|