diff --git a/src/components/PermissionsEditor/PermissionsEditor.stories.tsx b/src/components/PermissionsEditor/PermissionsEditor.stories.tsx index 265149a9..428f9232 100644 --- a/src/components/PermissionsEditor/PermissionsEditor.stories.tsx +++ b/src/components/PermissionsEditor/PermissionsEditor.stories.tsx @@ -12,14 +12,41 @@ const meta: Meta = { title: 'Components/PermissionsEditor', component: PermissionsEditor, tags: ['autodocs'], + argTypes: { + userName: { + control: 'text', + description: 'User name being edited', + }, + showEmployerAccess: { + control: 'boolean', + description: 'Whether to show employer access section', + }, + className: { + control: 'text', + description: 'Custom className', + }, + groups: { control: false }, + assignedPermissions: { control: false }, + onPermissionsChange: { control: false }, + employers: { control: false }, + selectedEmployers: { control: false }, + onEmployersChange: { control: false }, + labels: { control: false }, + }, parameters: { docs: { description: { component: 'A hierarchical permission editor for managing user roles with support for nested permissions, employer access control, and summary display.', }, + story: { inline: true }, }, }, + args: { + userName: 'John Doe', + showEmployerAccess: false, + className: '', + }, }; export default meta; @@ -120,6 +147,34 @@ const sampleEmployers: EmployerAccess[] = [ }, ]; +export const Default: Story = { + args: { + userName: 'John Doe', + showEmployerAccess: false, + className: '', + }, + render: function Render(args) { + const [permissions, setPermissions] = React.useState([]); + const [employers, setEmployers] = React.useState([]); + + return ( + + + + ); + }, +}; + // Interactive demo function InteractiveDemo() { const [permissions, setPermissions] = React.useState([ @@ -153,25 +208,6 @@ export const Interactive: Story = { render: () => , }; -// Basic usage -function DefaultDemo() { - const [permissions, setPermissions] = React.useState([]); - - return ( - - - - ); -} - -export const Default: Story = { - render: () => , -}; - // With pre-assigned permissions function WithPreAssignedDemo() { const [permissions, setPermissions] = React.useState([