feat(ui): add flat surfaces and compact profile/site controls
This commit is contained in:
@@ -29,6 +29,8 @@ export interface SelectProps<T extends string> {
|
||||
menuWidth?: number | "anchor";
|
||||
disabled?: boolean;
|
||||
variant?: SelectVariant;
|
||||
/** Split site/workspace selectors can align with adjacent circular actions. */
|
||||
shape?: "default" | "pill";
|
||||
className?: string;
|
||||
triggerClassName?: string;
|
||||
menuClassName?: string;
|
||||
@@ -47,6 +49,7 @@ export function Select<T extends string>({
|
||||
menuWidth = "anchor",
|
||||
disabled = false,
|
||||
variant = "integrated",
|
||||
shape = "default",
|
||||
className,
|
||||
triggerClassName,
|
||||
menuClassName,
|
||||
@@ -88,7 +91,7 @@ export function Select<T extends string>({
|
||||
};
|
||||
if (resolvedVariant === "split") {
|
||||
return (
|
||||
<div className={cn("nodedc-select", triggerClassName)} data-disabled={disabled ? "true" : undefined}>
|
||||
<div className={cn("nodedc-select", triggerClassName)} data-shape={shape === "pill" ? "pill" : undefined} data-disabled={disabled ? "true" : undefined}>
|
||||
<div ref={setAnchorRef} className="nodedc-select__control">
|
||||
<div className="nodedc-select__value">
|
||||
{selected?.icon ? <span className="nodedc-select__value-icon">{selected.icon}</span> : null}
|
||||
|
||||
@@ -19,6 +19,8 @@ export interface UserProfileMenuProps {
|
||||
avatarUrl?: string;
|
||||
coverImageUrl?: string;
|
||||
triggerLabel?: ReactNode;
|
||||
/** Optional status glyph between the label and avatar. */
|
||||
triggerIcon?: IconName;
|
||||
actions: readonly UserProfileMenuAction[];
|
||||
}
|
||||
|
||||
@@ -28,6 +30,7 @@ export function UserProfileMenu({
|
||||
avatarUrl,
|
||||
coverImageUrl,
|
||||
triggerLabel,
|
||||
triggerIcon,
|
||||
actions,
|
||||
}: UserProfileMenuProps) {
|
||||
const label = displayName || "NODE.DC";
|
||||
@@ -49,6 +52,7 @@ export function UserProfileMenu({
|
||||
onClick={toggle}
|
||||
>
|
||||
{triggerLabel === null ? null : <span className="nodedc-user-profile-menu__trigger-label">{triggerLabel ?? label}</span>}
|
||||
{triggerIcon ? <Icon name={triggerIcon} size={18} /> : null}
|
||||
<HeaderAvatar label={label} imageUrl={avatarUrl} />
|
||||
</button>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user