Package: @lilith/ui-developer-fab Split from: lilith/ui.git or lilith/build.git Publish workflow: calls lilith/workflows/.forgejo/workflows/publish-npm.yml@main
33 lines
No EOL
2 KiB
JavaScript
33 lines
No EOL
2 KiB
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
/**
|
|
* DeveloperFab - Main component
|
|
*
|
|
* Unified developer tools FAB with configurable categories.
|
|
* Uses the compound component pattern from @lilith/ui-fab.
|
|
*/
|
|
import { FAB } from '@lilith/ui-fab';
|
|
import { Wrench } from 'lucide-react';
|
|
import { AccessLevelCategory } from './categories/AccessLevelCategory';
|
|
import { ProfileCategory } from './categories/ProfileCategory';
|
|
import { StorageCategory } from './categories/StorageCategory';
|
|
import { ContentOverlayToggle } from './components/ContentOverlayToggle';
|
|
export const DeveloperFab = ({ position = 'bottom-right', accessLevels, profiles, showStorage = true, showContentEditor = false, devUserContext, onAccessLevelChange, onProfileChange, }) => {
|
|
// Only render in development mode
|
|
if (import.meta.env.PROD) {
|
|
return null;
|
|
}
|
|
const fabPosition = position === 'bottom-left' ? 'left' : 'right';
|
|
const hasAccessLevels = accessLevels && accessLevels.length > 0;
|
|
const hasProfiles = profiles && profiles.length > 0;
|
|
const hasAnyCategory = hasAccessLevels || hasProfiles || showStorage || showContentEditor;
|
|
// Don't render if no categories are configured
|
|
if (!hasAnyCategory) {
|
|
return null;
|
|
}
|
|
return (_jsxs(FAB.Root, { position: fabPosition, layout: "V", children: [_jsx(FAB.ActionButton, { icon: _jsx(Wrench, { size: 24 }), ariaLabels: {
|
|
open: 'Open developer tools',
|
|
close: 'Close developer tools',
|
|
title: 'Developer Tools',
|
|
} }), hasAccessLevels && devUserContext && onAccessLevelChange && (_jsx(AccessLevelCategory, { levels: accessLevels, devUserContext: devUserContext, onAccessLevelChange: onAccessLevelChange })), hasProfiles && devUserContext && onProfileChange && (_jsx(ProfileCategory, { profiles: profiles, devUserContext: devUserContext, onProfileChange: onProfileChange })), showStorage && _jsx(StorageCategory, {}), showContentEditor && _jsx(ContentOverlayToggle, {})] }));
|
|
};
|
|
//# sourceMappingURL=DeveloperFab.js.map
|