Files
metabuilder/packages/user_manager/seed/components.json
2025-12-30 19:08:56 +00:00

719 lines
20 KiB
JSON

[
{
"id": "user_management",
"type": "Card",
"name": "UserManagement",
"description": "Main user management container with search and user list",
"props": {
"variant": "outlined",
"className": "user-management"
},
"children": [
{
"id": "user_management_header",
"type": "Box",
"props": {
"className": "user-management-header",
"sx": {
"p": 3,
"borderBottom": 1,
"borderColor": "divider"
}
},
"children": [
{
"id": "user_management_title_row",
"type": "Flex",
"props": {
"justifyContent": "space-between",
"alignItems": "center",
"sx": {
"mb": 2
}
},
"children": [
{
"id": "user_management_title",
"type": "Text",
"props": {
"variant": "h5",
"fontWeight": "bold"
},
"children": []
},
{
"id": "user_management_add_button",
"type": "Button",
"props": {
"variant": "contained",
"color": "primary",
"startIcon": "PersonAdd"
},
"children": []
}
]
},
{
"id": "user_management_search_row",
"type": "Grid",
"props": {
"container": true,
"spacing": 2,
"alignItems": "center"
},
"children": [
{
"id": "user_management_search_field_container",
"type": "Grid",
"props": {
"item": true,
"xs": 12,
"md": 6
},
"children": [
{
"id": "user_management_search_field",
"type": "TextField",
"props": {
"placeholder": "Search users...",
"variant": "outlined",
"size": "small",
"fullWidth": true,
"startAdornment": "Search"
},
"children": []
}
]
},
{
"id": "user_management_filter_container",
"type": "Grid",
"props": {
"item": true,
"xs": 12,
"md": 6
},
"children": [
{
"id": "user_management_filters",
"type": "Flex",
"props": {
"gap": 1,
"justifyContent": "flex-end"
},
"children": [
{
"id": "user_management_role_filter",
"type": "Select",
"props": {
"placeholder": "Filter by role",
"size": "small",
"options": []
},
"children": []
},
{
"id": "user_management_status_filter",
"type": "Select",
"props": {
"placeholder": "Status",
"size": "small",
"options": []
},
"children": []
}
]
}
]
}
]
}
]
},
{
"id": "user_management_content",
"type": "Box",
"props": {
"className": "user-management-content",
"sx": {
"p": 0
}
},
"children": [
{
"id": "user_management_list",
"type": "ComponentRef",
"props": {
"ref": "user_list"
},
"children": []
}
]
},
{
"id": "user_management_footer",
"type": "Box",
"props": {
"className": "user-management-footer",
"sx": {
"p": 2,
"borderTop": 1,
"borderColor": "divider",
"display": "flex",
"justifyContent": "space-between",
"alignItems": "center"
}
},
"children": [
{
"id": "user_management_count",
"type": "Text",
"props": {
"variant": "body2",
"color": "secondary"
},
"children": []
},
{
"id": "user_management_pagination",
"type": "Pagination",
"props": {
"count": 1,
"page": 1,
"size": "small"
},
"children": []
}
]
}
],
"scripts": {
"init": "list.initialize",
"search": "list.filterUsers",
"refresh": "list.refreshUsers"
}
},
{
"id": "user_list",
"type": "Table",
"name": "UserList",
"description": "Data table showing users with columns for username, email, role, level, and status",
"props": {
"className": "user-list",
"stickyHeader": true,
"size": "medium"
},
"children": [
{
"id": "user_list_head",
"type": "TableHead",
"props": {},
"children": [
{
"id": "user_list_header_row",
"type": "TableRow",
"props": {},
"children": [
{
"id": "user_list_col_username",
"type": "TableCell",
"props": {
"sortable": true,
"sortKey": "username"
},
"children": [
{
"id": "user_list_col_username_text",
"type": "Text",
"props": {
"fontWeight": "bold"
},
"children": []
}
]
},
{
"id": "user_list_col_email",
"type": "TableCell",
"props": {
"sortable": true,
"sortKey": "email"
},
"children": [
{
"id": "user_list_col_email_text",
"type": "Text",
"props": {
"fontWeight": "bold"
},
"children": []
}
]
},
{
"id": "user_list_col_role",
"type": "TableCell",
"props": {
"sortable": true,
"sortKey": "role"
},
"children": [
{
"id": "user_list_col_role_text",
"type": "Text",
"props": {
"fontWeight": "bold"
},
"children": []
}
]
},
{
"id": "user_list_col_level",
"type": "TableCell",
"props": {
"sortable": true,
"sortKey": "level",
"align": "center"
},
"children": [
{
"id": "user_list_col_level_text",
"type": "Text",
"props": {
"fontWeight": "bold"
},
"children": []
}
]
},
{
"id": "user_list_col_status",
"type": "TableCell",
"props": {
"sortable": true,
"sortKey": "active",
"align": "center"
},
"children": [
{
"id": "user_list_col_status_text",
"type": "Text",
"props": {
"fontWeight": "bold"
},
"children": []
}
]
},
{
"id": "user_list_col_actions",
"type": "TableCell",
"props": {
"align": "right"
},
"children": [
{
"id": "user_list_col_actions_text",
"type": "Text",
"props": {
"fontWeight": "bold"
},
"children": []
}
]
}
]
}
]
},
{
"id": "user_list_body",
"type": "TableBody",
"props": {},
"children": [
{
"id": "user_list_row_template",
"type": "TableRow",
"props": {
"hover": true,
"className": "user-list-row"
},
"children": [
{
"id": "user_list_cell_username",
"type": "TableCell",
"props": {},
"children": [
{
"id": "user_list_username_content",
"type": "Flex",
"props": {
"alignItems": "center",
"gap": 1.5
},
"children": [
{
"id": "user_list_avatar",
"type": "Avatar",
"props": {
"size": "small"
},
"children": []
},
{
"id": "user_list_username_text",
"type": "Text",
"props": {
"fontWeight": "medium"
},
"children": []
}
]
}
]
},
{
"id": "user_list_cell_email",
"type": "TableCell",
"props": {},
"children": [
{
"id": "user_list_email_text",
"type": "Text",
"props": {
"variant": "body2",
"color": "secondary"
},
"children": []
}
]
},
{
"id": "user_list_cell_role",
"type": "TableCell",
"props": {},
"children": [
{
"id": "user_list_role_chip",
"type": "Chip",
"props": {
"size": "small",
"variant": "outlined"
},
"children": []
}
]
},
{
"id": "user_list_cell_level",
"type": "TableCell",
"props": {
"align": "center"
},
"children": [
{
"id": "user_list_level_badge",
"type": "Badge",
"props": {
"variant": "standard"
},
"children": []
}
]
},
{
"id": "user_list_cell_status",
"type": "TableCell",
"props": {
"align": "center"
},
"children": [
{
"id": "user_list_status_chip",
"type": "Chip",
"props": {
"size": "small"
},
"children": []
}
]
},
{
"id": "user_list_cell_actions",
"type": "TableCell",
"props": {
"align": "right"
},
"children": [
{
"id": "user_list_actions_ref",
"type": "ComponentRef",
"props": {
"ref": "user_actions"
},
"children": []
}
]
}
]
}
]
},
{
"id": "user_list_empty",
"type": "TableRow",
"props": {
"className": "user-list-empty"
},
"children": [
{
"id": "user_list_empty_cell",
"type": "TableCell",
"props": {
"colSpan": 6,
"align": "center"
},
"children": [
{
"id": "user_list_empty_content",
"type": "Box",
"props": {
"sx": {
"py": 4
}
},
"children": [
{
"id": "user_list_empty_icon",
"type": "Icon",
"props": {
"name": "PersonOff",
"size": 48,
"color": "disabled"
},
"children": []
},
{
"id": "user_list_empty_text",
"type": "Text",
"props": {
"variant": "body1",
"color": "secondary",
"sx": {
"mt": 1
}
},
"children": []
}
]
}
]
}
]
}
],
"scripts": {
"init": "list.initialize",
"sort": "list.sortUsers",
"select": "list.selectUser"
}
},
{
"id": "user_actions",
"type": "Flex",
"name": "UserActions",
"description": "Action buttons for user management operations",
"props": {
"gap": 0.5,
"className": "user-actions"
},
"children": [
{
"id": "user_actions_view",
"type": "IconButton",
"props": {
"size": "small",
"color": "default",
"title": "View user details"
},
"children": [
{
"id": "user_actions_view_icon",
"type": "Icon",
"props": {
"name": "Visibility",
"size": 18
},
"children": []
}
]
},
{
"id": "user_actions_edit",
"type": "IconButton",
"props": {
"size": "small",
"color": "primary",
"title": "Edit user"
},
"children": [
{
"id": "user_actions_edit_icon",
"type": "Icon",
"props": {
"name": "Edit",
"size": 18
},
"children": []
}
]
},
{
"id": "user_actions_permissions",
"type": "IconButton",
"props": {
"size": "small",
"color": "secondary",
"title": "Manage permissions"
},
"children": [
{
"id": "user_actions_permissions_icon",
"type": "Icon",
"props": {
"name": "Security",
"size": 18
},
"children": []
}
]
},
{
"id": "user_actions_ban",
"type": "IconButton",
"props": {
"size": "small",
"color": "warning",
"title": "Ban user"
},
"children": [
{
"id": "user_actions_ban_icon",
"type": "Icon",
"props": {
"name": "Block",
"size": 18
},
"children": []
}
]
},
{
"id": "user_actions_delete",
"type": "IconButton",
"props": {
"size": "small",
"color": "error",
"title": "Delete user"
},
"children": [
{
"id": "user_actions_delete_icon",
"type": "Icon",
"props": {
"name": "Delete",
"size": 18
},
"children": []
}
]
},
{
"id": "user_actions_menu",
"type": "Menu",
"props": {
"className": "user-actions-menu"
},
"children": [
{
"id": "user_actions_menu_trigger",
"type": "IconButton",
"props": {
"size": "small",
"title": "More actions"
},
"children": [
{
"id": "user_actions_menu_icon",
"type": "Icon",
"props": {
"name": "MoreVert",
"size": 18
},
"children": []
}
]
},
{
"id": "user_actions_menu_content",
"type": "MenuList",
"props": {},
"children": [
{
"id": "user_actions_menu_reset_password",
"type": "MenuItem",
"props": {
"icon": "LockReset"
},
"children": []
},
{
"id": "user_actions_menu_send_email",
"type": "MenuItem",
"props": {
"icon": "Email"
},
"children": []
},
{
"id": "user_actions_menu_divider",
"type": "Divider",
"props": {},
"children": []
},
{
"id": "user_actions_menu_activate",
"type": "MenuItem",
"props": {
"icon": "CheckCircle"
},
"children": []
},
{
"id": "user_actions_menu_deactivate",
"type": "MenuItem",
"props": {
"icon": "Cancel"
},
"children": []
}
]
}
]
}
],
"scripts": {
"view": "actions.viewUser",
"edit": "actions.editUser",
"permissions": "actions.managePermissions",
"ban": "actions.banUser",
"delete": "actions.deleteUser",
"resetPassword": "actions.resetPassword",
"sendEmail": "actions.sendEmail",
"activate": "actions.activateUser",
"deactivate": "actions.deactivateUser"
}
}
]