@cosxai/ui 0.3.1 → 0.3.3
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/package.json +1 -1
- package/src/actionbar/ActionBar.tsx +22 -1
package/package.json
CHANGED
|
@@ -276,7 +276,11 @@ export function ActionBar({
|
|
|
276
276
|
}, [expandedKey, setExpandedKey]);
|
|
277
277
|
|
|
278
278
|
// ----- Empty state -----
|
|
279
|
-
|
|
279
|
+
// Bar renders when EITHER any page item is registered OR the
|
|
280
|
+
// status dot is set. Without the statusDot check, an app whose
|
|
281
|
+
// only consumer is `useActionBarStatusDot` (e.g. a system-status-
|
|
282
|
+
// only surface) would never see the bar at all.
|
|
283
|
+
if (items.length === 0 && !statusDot) return null;
|
|
280
284
|
|
|
281
285
|
// ----- Collapsed handle (phone only) -----
|
|
282
286
|
if (isPhone && collapsibleOnPhone && collapsed) {
|
|
@@ -399,6 +403,23 @@ export function ActionBar({
|
|
|
399
403
|
</button>
|
|
400
404
|
) : null}
|
|
401
405
|
|
|
406
|
+
{/* Balancing leading spacer — only present when the right side
|
|
407
|
+
holds ONLY a status dot (no trailing items). With a left
|
|
408
|
+
and right spacer of equal flex weight, the leading items
|
|
409
|
+
centre between the grip and the status dot. Without this,
|
|
410
|
+
a solo leading item (e.g. just "Theme · Light") looks
|
|
411
|
+
left-anchored next to the grip with a visible gap before
|
|
412
|
+
the dot, which reads as unbalanced. When trailing items ARE
|
|
413
|
+
present, they take that role on the right and the leading
|
|
414
|
+
group goes back to its natural left-anchored packing. */}
|
|
415
|
+
{leadingEntries.length > 0 && trailingEntries.length === 0 && statusDot && (
|
|
416
|
+
<span
|
|
417
|
+
aria-hidden
|
|
418
|
+
data-ck-actionbar-spacer="leading"
|
|
419
|
+
style={{ flex: "1 1 auto", minWidth: 0 }}
|
|
420
|
+
/>
|
|
421
|
+
)}
|
|
422
|
+
|
|
402
423
|
{/* Leading entries — flat items + group heads with disclosure regions. */}
|
|
403
424
|
{leadingEntries.map(renderEntry)}
|
|
404
425
|
|