import React from 'react';
import { addStoryInGroup, MID_LEVEL_BLOCKS } from '../../../.storybook/utils';
import { boolean, number } from '@storybook/addon-knobs';
import { Island, Pagination, Button } from '../../index';

export default {
  component: Pagination,
  title: addStoryInGroup(MID_LEVEL_BLOCKS, 'Pagination'),

  parameters: {
    info: {
      propTablesExclude: [Island],
    },
  },
};

export const compact = () => (
  <Island style={boolean('Inverse', false) ? { backgroundColor: '#2a3b4d' } : {}}>
    <Pagination
      numPages={number('Number of pages', 21)}
      currentPage={number('Current page', 1)}
      inverse={boolean('Inverse', false)}
    >
      {({ number, text, isActive, ...others }) => {
        return (
          <Button
            level="link"
            label={text}
            disabled={isActive}
            inverse={boolean('Inverse', false)}
            size="small"
            {...others}
          />
        );
      }}
    </Pagination>
  </Island>
);

export const normal = () => (
  <Island style={boolean('Inverse', false) ? { backgroundColor: '#2a3b4d' } : {}}>
    <Pagination
      numPages={number('Number of pages', 21)}
      currentPage={number('Current page', 1)}
      inverse={boolean('Inverse', false)}
      prevPageText="previous"
      nextPageText="next"
    >
      {({ number, text, isActive, ...others }) => {
        return (
          <Button
            level="link"
            label={text}
            disabled={isActive}
            inverse={boolean('Inverse', false)}
            size="small"
            {...others}
          />
        );
      }}
    </Pagination>
  </Island>
);

@@ -111,74 +111,8 @@
 rt %7B
- boolean, number %7D from '@storybook/addon-knobs';%0Aimport %7B Island,
  Pag
@@ -254,361 +254,103 @@
 '),%0A
-%0A  parameters: %7B%0A    info: %7B%0A      propTablesExclude: %5BIsland%5D,%0A    %7D,%0A  %7D,%0A%7D;%0A%0Aexport const compact = () =%3E (%0A  %3CIsland style=%7Bboolean('I
+%7D;%0A%0Aexport const Full = (%7B i
 nverse
-'
 , 
-false) ? %7B backgroundColor: '#2a3b4d' %7D : %7B%7D%7D%3E%0A    %3CPagination%0A      numPages=%7Bnumber('Number of pages', 21)%7D%0A      currentPage=%7Bnumber('Current page', 1)%7D%0A      inverse=%7Bboolean('Inverse', false)%7D%0A    %3E%0A  
+...args %7D) =%3E (%0A  %3CPagination inverse=%7Binverse%7D %7B...args%7D%3E%0A
     
@@ -405,48 +405,22 @@
     
-  
 return 
-(%0A          %3CButton%0A           
+%3CButton
  lev
@@ -424,36 +424,24 @@
 level=%22link%22
-%0A           
  label=%7Btext
@@ -437,36 +437,24 @@
 label=%7Btext%7D
-%0A           
  disabled=%7Bi
@@ -465,141 +465,63 @@
 ive%7D
-%0A            inverse=%7Bboolean('Inverse', false)%7D%0A            size=%22small%22%0A            %7B...others%7D%0A          /%3E%0A        )
+ inverse=%7Binverse%7D size=%22small%22 %7B...others%7D /%3E
 ;%0A    
-  
 %7D%7D%0A
-  
   %3C/
@@ -536,292 +536,84 @@
 on%3E%0A
-  %3C/Island%3E%0A);%0A%0Aexport const normal = () =%3E (%0A  %3CIsland style=%7Bboolean('Inverse', false) ? %7B backgroundColor: '#2a3b4d' %7D : %7B%7D%7D%3E%0A    %3CPagination%0A      numPages=%7Bnumber('Number of pages', 21)%7D%0A      currentPage=%7Bnumber('Current page', 1)%7D%0A      inverse=%7Bboolean('Inverse', false)%7D%0A    
+);%0A%0AFull.args = %7B%0A  currentPage: 3,%0A  nextPageText: 'next',%0A  numPages: 21,%0A
   pr
@@ -626,18 +626,19 @@
 Text
-=%22
+: '
 previous
 %22%0A  
@@ -637,44 +637,75 @@
 ious
-%22%0A      nextPageText=%22next%22%0A    %3E%0A  
+',%0A%7D;%0A%0Aexport const Compact = (args) =%3E (%0A  %3CPagination %7B...args%7D%3E%0A
     
@@ -760,48 +760,22 @@
     
-  
 return 
-(%0A          %3CButton%0A           
+%3CButton
  lev
@@ -783,28 +783,16 @@
 l=%22link%22
-%0A           
  label=%7B
@@ -796,28 +796,16 @@
 l=%7Btext%7D
-%0A           
  disable
@@ -820,141 +820,45 @@
 ive%7D
-%0A            inverse=%7Bboolean('Inverse', false)%7D%0A            size=%22small%22%0A            %7B...others%7D%0A          /%3E%0A        )
+ size=%22small%22 %7B...others%7D /%3E
 ;%0A    
- 
- 
 %7D%7D%0A
-  
   %3C/
@@ -873,19 +873,62 @@
 on%3E%0A
-  %3C/Island%3E%0A)
+);%0A%0ACompact.args = %7B%0A  currentPage: 3,%0A  numPages: 21,%0A%7D
 ;%0A

update story