header.stories.tsx 768 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. import React from 'react';
  2. import { Pattern, generateDocs } from 'storybook-django/src/react';
  3. import template from './header.html';
  4. const { docs, argTypes } = generateDocs(template);
  5. export default {
  6. parameters: {
  7. docs,
  8. },
  9. argTypes: {
  10. ...argTypes,
  11. icon: {
  12. options: window.WAGTAIL_ICONS,
  13. control: { type: 'select' },
  14. description: 'name of an icon to place against the title',
  15. },
  16. },
  17. };
  18. const Template = (args) => <Pattern filename={__filename} context={args} />;
  19. export const Base = Template.bind({});
  20. Base.args = {
  21. title: 'Calendar',
  22. icon: 'date',
  23. };
  24. export const Action = Template.bind({});
  25. Action.args = {
  26. title: 'Users',
  27. subtitle: 'Editors',
  28. icon: 'user',
  29. action_url: '/test/',
  30. action_text: 'Add',
  31. };