Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
box-shadow: inset 0 0 0 3px var(--px-color-border-focus-boxshadow);
border-radius: var(--px-border-radius-medium);
}
&:disabled {
cursor: not-allowed;
opacity: 0.4;
background: var(--px-color-background-default);
}
}

.iconWrapper {
Expand Down Expand Up @@ -74,3 +79,12 @@
cursor: pointer;
}
}

.actionItem:disabled .labelHover {
cursor: not-allowed;
}

.actionItem:disabled .iconWrapper-large {
opacity: 0.4;
background: var(--px-color-background-default);
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Meta, StoryObj } from '@storybook/react-vite';
import { Meta, StoryObj, StoryFn } from '@storybook/react-vite';
import { ActionItem } from './ActionItem';

const meta: Meta<typeof ActionItem> = {
Expand All @@ -19,36 +19,46 @@ type Story = StoryObj<typeof ActionItem>;

export const Default: Story = {};

export const LargeDefault: Story = {
args: {
largeIconName: 'Table',
label: 'Action with description',
size: 'large',
},
};

export const MediumDefault: Story = {
args: {
iconName: 'File',
label: 'Medium default',
size: 'medium',
},
};

export const MediumWithDescription: Story = {
args: {
iconName: 'File',
label: 'Action with description',
size: 'medium',
description: 'This is a description of the action item.',
},
};

export const MediumWithLoading: Story = {
args: {
iconName: 'File',
label: 'Action with loading spinner',
size: 'medium',
isLoading: true,
},
export const Variants: StoryFn<typeof ActionItem> = () => {
return (
<>
Medium
<br />
<br />
<ActionItem
label="Medium Action"
size="medium"
onClick={() => alert('Clicked medium action!')}
/>
<br />
<br />
<ActionItem
label="Medium Action with Description"
size="medium"
description="This is a description."
onClick={() => alert('Clicked medium action with description!')}
/>
<br />
<br />
<ActionItem label="Medium Action" size="medium" disabled />
<br />
<br />
Large
<br />
<br />
<ActionItem
label="Large Action"
size="large"
onClick={() => alert('Clicked large action!')}
/>
<br />
<br />
<ActionItem
label="Large Action"
disabled
size="large"
onClick={() => alert('Clicked large action!')}
/>
</>
);
};