Skip to content
Merged
Changes from 1 commit
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
67 changes: 67 additions & 0 deletions shared/aries-core/src/stories/components/Toolbar.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import React from 'react';
import type { Meta, StoryObj } from '@storybook/react';
import { Data, DataSearch, DataSort, DataSummary, Toolbar } from 'grommet';
import { gapArg } from '../utils/commonArgs';

// Mock data for the toolbar example
const mockApplications = [
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we remove unused data? Or is there plan to pass it down to <Data data={DATA}> to ensure data sort by drop down is not empty like we have on community storybook for data filters?

community storybook
Image

core storybook
Image

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added Data as well as DataTable as we decided yesterday in our dev chat

{
id: 1,
title: 'scikit-learn',
publisher: 'scikit-learn',
categories: ['Machine learning', 'Developer tools'],
rating: 4.8,
pricing: 'Free',
delivery: 'Package manager',
},
{
id: 2,
title: 'Personalizer',
publisher: 'Acme Software Co.',
categories: ['Machine learning', 'Developer tools'],
rating: 4.1,
pricing: 'Free trial',
delivery: 'Web application',
},
{
id: 3,
title: 'TensorFlow',
publisher: 'Google',
categories: ['Machine learning', 'Developer tools'],
rating: 4.6,
pricing: 'Free',
delivery: 'Package manager',
},
];

const meta = {
title: 'Components/Toolbar',
component: Toolbar,
argTypes: {
gap: gapArg,
},
parameters: {
layout: 'padded',
},
Comment on lines +39 to +41
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
parameters: {
layout: 'fullscreen',
},
argTypes: {},

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

} satisfies Meta<typeof Toolbar>;

export default meta;
type Story = StoryObj<typeof meta>;

export const WithDataControls: Story = {
name: 'Toolbar with Data Controls',
args: {
gap: 'small',
},
render: args => {
return (
<Data data={mockApplications}>
<Toolbar {...args}>
<DataSearch />
<DataSort drop />
</Toolbar>
<DataSummary />
</Data>
);
},
};
Comment on lines +50 to +92
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
render: args => {
return (
<Toolbar {...args}>
<DataSearch />
<DataSort drop />
</Toolbar>
);
},
};
render: args => (
<Toolbar {...args}>
<DataSearch />
<DataSort drop />
</Toolbar>
),
args: {},
} satisfies Story;

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done