function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
import React, { useState } from 'react';
import styled from 'styled-components';
import { action } from '@storybook/addon-actions';
import { Box, Button, Card, CoachMarks, Flexbox, Icon, Typography } from '../..';
var MockItem = styled.div.withConfig({
  displayName: "CoachMarksstories__MockItem",
  componentId: "sc-e7l98d-0"
})(["padding:", "px;border:1px solid ", ";"], function (p) {
  return p.theme.spacing.unit(5);
}, function (p) {
  return p.theme.color.positive;
});
export default {
  title: 'Molecules / CoachMarks',
  parameters: {
    component: CoachMarks
  }
};
export var DefaultStory = {
  render: function render() {
    var Example = function Example() {
      var _useState = useState(true),
        _useState2 = _slicedToArray(_useState, 2),
        activeGuide = _useState2[0],
        setActiveGuide = _useState2[1];
      var _useState3 = useState(null),
        _useState4 = _slicedToArray(_useState3, 2),
        referenceElement = _useState4[0],
        setReferenceElement = _useState4[1];
      return React.createElement(React.Fragment, null, React.createElement(Card, null, React.createElement(Button, {
        onClick: function onClick() {
          return setActiveGuide(true);
        }
      }, "Start guide"), React.createElement(Box, {
        py: 5
      }, React.createElement(Flexbox, {
        container: true,
        justifyContent: "space-between"
      }, React.createElement(Flexbox, {
        item: true
      }, React.createElement(MockItem, {
        ref: setReferenceElement
      }, "New feature"))))), referenceElement && activeGuide && React.createElement(CoachMarks, {
        onClose: function onClose() {
          return setActiveGuide(false);
        },
        onDone: function onDone() {
          return setActiveGuide(false);
        },
        onNext: action('next'),
        onPrev: action('previous'),
        steps: [{
          referenceElement: referenceElement,
          icon: React.createElement(Icon.Bank32, null),
          title: 'New feature',
          content: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
          placement: 'bottom'
        }]
      }));
    };
    return React.createElement(Example, null);
  },
  name: 'Default'
};
export var WithCustomBackdropPadding = {
  render: function render() {
    var Example = function Example() {
      var _useState5 = useState(true),
        _useState6 = _slicedToArray(_useState5, 2),
        activeGuide = _useState6[0],
        setActiveGuide = _useState6[1];
      var _useState7 = useState(null),
        _useState8 = _slicedToArray(_useState7, 2),
        referenceElement = _useState8[0],
        setReferenceElement = _useState8[1];
      return React.createElement(React.Fragment, null, React.createElement(Card, null, React.createElement(Button, {
        onClick: function onClick() {
          return setActiveGuide(true);
        }
      }, "Start guide"), React.createElement(Box, {
        py: 5,
        pl: 5
      }, React.createElement(Flexbox, {
        container: true,
        justifyContent: "space-between"
      }, React.createElement(Flexbox, {
        item: true
      }, React.createElement(MockItem, {
        ref: setReferenceElement
      }, "New feature"))))), referenceElement && activeGuide && React.createElement(CoachMarks, {
        onClose: function onClose() {
          return setActiveGuide(false);
        },
        onDone: function onDone() {
          return setActiveGuide(false);
        },
        onNext: action('next'),
        onPrev: action('previous'),
        steps: [{
          referenceElement: referenceElement,
          icon: React.createElement(Icon.Bank32, null),
          title: 'New feature',
          content: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
          placement: 'bottom',
          backdropPadding: '20'
        }]
      }));
    };
    return React.createElement(Example, null);
  },
  name: 'With custom backdrop padding'
};
export var WithCustomBackdropPxpy = {
  render: function render() {
    var Example = function Example() {
      var _useState9 = useState(true),
        _useState10 = _slicedToArray(_useState9, 2),
        activeGuide = _useState10[0],
        setActiveGuide = _useState10[1];
      var _useState11 = useState(null),
        _useState12 = _slicedToArray(_useState11, 2),
        referenceElement = _useState12[0],
        setReferenceElement = _useState12[1];
      return React.createElement(React.Fragment, null, React.createElement(Card, null, React.createElement(Button, {
        onClick: function onClick() {
          return setActiveGuide(true);
        }
      }, "Start guide"), React.createElement(Box, {
        py: 5,
        pl: 5
      }, React.createElement(Flexbox, {
        container: true,
        justifyContent: "space-between"
      }, React.createElement(Flexbox, {
        item: true
      }, React.createElement(MockItem, {
        ref: setReferenceElement
      }, "New feature"))))), referenceElement && activeGuide && React.createElement(CoachMarks, {
        onClose: function onClose() {
          return setActiveGuide(false);
        },
        onDone: function onDone() {
          return setActiveGuide(false);
        },
        onNext: action('next'),
        onPrev: action('previous'),
        steps: [{
          referenceElement: referenceElement,
          icon: React.createElement(Icon.Bank32, null),
          title: 'New feature',
          content: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
          placement: 'bottom',
          px: '10',
          py: '50'
        }]
      }));
    };
    return React.createElement(Example, null);
  },
  name: 'With custom horizontal and vertical backdrop padding'
};
export var WithCircularBackdrop = {
  render: function render() {
    var Example = function Example() {
      var _useState13 = useState(true),
        _useState14 = _slicedToArray(_useState13, 2),
        activeGuide = _useState14[0],
        setActiveGuide = _useState14[1];
      var _useState15 = useState(null),
        _useState16 = _slicedToArray(_useState15, 2),
        referenceElement = _useState16[0],
        setReferenceElement = _useState16[1];
      return React.createElement(React.Fragment, null, React.createElement(Card, null, React.createElement(Button, {
        onClick: function onClick() {
          return setActiveGuide(true);
        }
      }, "Start guide"), React.createElement(Box, {
        py: 10,
        pl: 25
      }, React.createElement(Flexbox, {
        container: true,
        justifyContent: "space-between"
      }, React.createElement(Flexbox, {
        item: true
      }, React.createElement("div", {
        ref: setReferenceElement
      }, React.createElement(Icon.More24, null)))))), referenceElement && activeGuide && React.createElement(CoachMarks, {
        onClose: function onClose() {
          return setActiveGuide(false);
        },
        onDone: function onDone() {
          return setActiveGuide(false);
        },
        onNext: action('next'),
        onPrev: action('previous'),
        steps: [{
          referenceElement: referenceElement,
          icon: React.createElement(Icon.Bank32, null),
          title: 'New feature',
          content: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
          placement: 'bottom',
          isCircular: true,
          backdropPadding: '30'
        }]
      }));
    };
    return React.createElement(Example, null);
  },
  name: 'With circular backdrop'
};
export var WithCircularHighlightSurroundingLongElement = {
  render: function render() {
    var Example = function Example() {
      var _useState17 = useState(true),
        _useState18 = _slicedToArray(_useState17, 2),
        activeGuide = _useState18[0],
        setActiveGuide = _useState18[1];
      var _useState19 = useState(null),
        _useState20 = _slicedToArray(_useState19, 2),
        referenceElement = _useState20[0],
        setReferenceElement = _useState20[1];
      return React.createElement(React.Fragment, null, React.createElement(Card, null, React.createElement(Button, {
        onClick: function onClick() {
          return setActiveGuide(true);
        }
      }, "Start guide"), React.createElement(Box, {
        py: 10,
        pl: 55
      }, React.createElement(Flexbox, {
        container: true,
        justifyContent: "space-between"
      }, React.createElement(Flexbox, {
        item: true
      }, React.createElement("div", {
        ref: setReferenceElement
      }, React.createElement(Box, {
        style: {
          width: 100,
          height: 350
        },
        backgroundColor: function backgroundColor(t) {
          return t.color.cta;
        }
      })))))), referenceElement && activeGuide && React.createElement(CoachMarks, {
        onClose: function onClose() {
          return setActiveGuide(false);
        },
        onDone: function onDone() {
          return setActiveGuide(false);
        },
        onNext: action('next'),
        onPrev: action('previous'),
        steps: [{
          referenceElement: referenceElement,
          icon: React.createElement(Icon.Bank32, null),
          title: 'New feature',
          content: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
          placement: 'bottom',
          isCircular: true,
          backdropPadding: '30'
        }]
      }));
    };
    return React.createElement(Example, null);
  },
  name: 'With long element and circular highlight'
};
var MultpipleStepsExample = function MultpipleStepsExample() {
  var _useState21 = useState(true),
    _useState22 = _slicedToArray(_useState21, 2),
    activeGuide = _useState22[0],
    setActiveGuide = _useState22[1];
  var _useState23 = useState(null),
    _useState24 = _slicedToArray(_useState23, 2),
    referenceElement1 = _useState24[0],
    setReferenceElement1 = _useState24[1];
  var _useState25 = useState(null),
    _useState26 = _slicedToArray(_useState25, 2),
    referenceElement2 = _useState26[0],
    setReferenceElement2 = _useState26[1];
  var _useState27 = useState(null),
    _useState28 = _slicedToArray(_useState27, 2),
    referenceElement3 = _useState28[0],
    setReferenceElement3 = _useState28[1];
  var _useState29 = useState(null),
    _useState30 = _slicedToArray(_useState29, 2),
    referenceElement4 = _useState30[0],
    setReferenceElement4 = _useState30[1];
  return React.createElement(React.Fragment, null, React.createElement(Card, null, React.createElement(Button, {
    onClick: function onClick() {
      return setActiveGuide(true);
    }
  }, "Start guide"), React.createElement(Box, {
    py: 5
  }, React.createElement(Flexbox, {
    container: true,
    justifyContent: "space-between"
  }, React.createElement(Flexbox, {
    item: true
  }, React.createElement(MockItem, {
    ref: setReferenceElement1
  }, "New feature")), React.createElement(Flexbox, {
    item: true
  }, React.createElement(MockItem, {
    ref: setReferenceElement2
  }, "Another new feature")))), React.createElement(Box, {
    py: 5
  }, React.createElement(Flexbox, {
    container: true,
    justifyContent: "space-between"
  }, React.createElement(Flexbox, {
    item: true
  }, React.createElement(MockItem, {
    ref: setReferenceElement3
  }, "New feature")))), React.createElement(Box, {
    py: 5
  }, React.createElement(Flexbox, {
    container: true,
    justifyContent: "space-between"
  }, React.createElement(Flexbox, {
    item: true
  }, React.createElement(MockItem, {
    ref: setReferenceElement4
  }, "Another new feature"))))), referenceElement1 && referenceElement2 && referenceElement3 && referenceElement4 && activeGuide && React.createElement(CoachMarks, {
    bottomSheet: true,
    onClose: function onClose() {
      return setActiveGuide(false);
    },
    onDone: function onDone() {
      return setActiveGuide(false);
    },
    onNext: action('next'),
    onPrev: action('previous'),
    steps: [{
      referenceElement: referenceElement1,
      icon: React.createElement(Icon.Bank32, null),
      title: 'New feature',
      content: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
      placement: 'right'
    }, {
      referenceElement: referenceElement2,
      title: 'Another new feature',
      content: React.createElement(React.Fragment, null, React.createElement(Typography, {
        as: "p",
        type: "secondary",
        color: "inherit"
      }, "Lorem ipsum dolor sit amet"), React.createElement(Typography, {
        as: "p",
        type: "secondary",
        color: "inherit"
      }, "Consectetur adipiscing elit")),
      placement: 'left'
    }, {
      referenceElement: referenceElement3,
      title: 'New feature',
      content: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
      placement: 'bottom',
      isCircular: true,
      backdropPadding: '30'
    }, {
      referenceElement: referenceElement4,
      title: 'New feature',
      content: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit',
      placement: 'top',
      backdropPadding: '30'
    }]
  }));
};
export var MultpipleSteps = {
  render: function render() {
    return React.createElement(MultpipleStepsExample, null);
  }
};
export var WithBarColor = {
  render: function render() {
    var Example = function Example() {
      var _useState31 = useState(true),
        _useState32 = _slicedToArray(_useState31, 2),
        activeGuide = _useState32[0],
        setActiveGuide = _useState32[1];
      var _useState33 = useState(null),
        _useState34 = _slicedToArray(_useState33, 2),
        referenceElement = _useState34[0],
        setReferenceElement = _useState34[1];
      return React.createElement(React.Fragment, null, React.createElement(Card, null, React.createElement(Button, {
        onClick: function onClick() {
          return setActiveGuide(true);
        }
      }, "Start guide"), React.createElement(Box, {
        py: 5
      }, React.createElement(Flexbox, {
        container: true,
        justifyContent: "space-between"
      }, React.createElement(Flexbox, {
        item: true
      }, React.createElement(MockItem, {
        ref: setReferenceElement
      }, "New feature"))))), referenceElement && activeGuide && React.createElement(CoachMarks, {
        barColor: function barColor(t) {
          return t.color.buy;
        },
        onClose: function onClose() {
          return setActiveGuide(false);
        },
        onDone: function onDone() {
          return setActiveGuide(false);
        },
        onNext: action('next'),
        onPrev: action('previous'),
        steps: [{
          referenceElement: referenceElement,
          icon: React.createElement(Icon.Bank32, null),
          title: 'New feature',
          content: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
          placement: 'right'
        }]
      }));
    };
    return React.createElement(Example, null);
  },
  name: 'With bar color'
};
var MobileBottomSheetExample = function MobileBottomSheetExample() {
  var _useState35 = useState(true),
    _useState36 = _slicedToArray(_useState35, 2),
    activeGuide = _useState36[0],
    setActiveGuide = _useState36[1];
  var _useState37 = useState(null),
    _useState38 = _slicedToArray(_useState37, 2),
    referenceElement = _useState38[0],
    setReferenceElement = _useState38[1];
  return React.createElement(React.Fragment, null, React.createElement(Card, null, React.createElement(Button, {
    onClick: function onClick() {
      return setActiveGuide(true);
    }
  }, "Start guide"), React.createElement(Box, {
    py: 5
  }, React.createElement(Flexbox, {
    container: true,
    justifyContent: "space-between"
  }, React.createElement(Flexbox, {
    item: true
  }, React.createElement(MockItem, {
    ref: setReferenceElement
  }, "New feature"))))), referenceElement && activeGuide && React.createElement(CoachMarks, {
    bottomSheet: true,
    onClose: function onClose() {
      return setActiveGuide(false);
    },
    onDone: function onDone() {
      return setActiveGuide(false);
    },
    onNext: action('next'),
    onPrev: action('previous'),
    steps: [{
      referenceElement: referenceElement,
      icon: React.createElement(Icon.Bank32, null),
      title: 'New feature',
      content: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
      placement: 'bottom'
    }]
  }));
};
export var MobileBottomSheet = {
  render: function render() {
    return React.createElement(MobileBottomSheetExample, null);
  }
};
var OverrideStepExample = function OverrideStepExample() {
  var _useState39 = useState(0),
    _useState40 = _slicedToArray(_useState39, 2),
    currentStep = _useState40[0],
    setCurrentStep = _useState40[1];
  var _useState41 = useState(true),
    _useState42 = _slicedToArray(_useState41, 2),
    activeGuide = _useState42[0],
    setActiveGuide = _useState42[1];
  var _useState43 = useState(null),
    _useState44 = _slicedToArray(_useState43, 2),
    referenceElement = _useState44[0],
    setReferenceElement = _useState44[1];
  var handleNext = function handleNext(step) {
    setCurrentStep(step + 1);
  };
  var handlePrev = function handlePrev(step) {
    setCurrentStep(step - 1);
  };
  return React.createElement(React.Fragment, null, React.createElement(Card, null, React.createElement(Button, {
    onClick: function onClick() {
      return setActiveGuide(true);
    }
  }, "Start guide"), React.createElement(Box, {
    py: 5
  }, React.createElement(Flexbox, {
    container: true,
    justifyContent: "space-between"
  }, React.createElement(Flexbox, {
    item: true
  }, React.createElement(MockItem, {
    ref: setReferenceElement
  }, "New feature"))))), referenceElement && activeGuide && React.createElement(CoachMarks, {
    bottomSheet: true,
    overrideStep: currentStep,
    onNext: handleNext,
    onPrev: handlePrev,
    steps: [{
      referenceElement: referenceElement,
      icon: React.createElement(Icon.Bank32, null),
      title: 'Step 1',
      content: React.createElement("div", null, "Click the button if youre too smart for steps 1-3.", React.createElement(Button, {
        onClick: function onClick() {
          return setCurrentStep(3);
        }
      }, "Skip")),
      placement: 'bottom'
    }, {
      referenceElement: referenceElement,
      icon: React.createElement(Icon.Bank32, null),
      title: 'Step 2',
      content: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
      placement: 'bottom'
    }, {
      referenceElement: referenceElement,
      icon: React.createElement(Icon.Bank32, null),
      title: 'Step 3',
      content: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
      placement: 'bottom'
    }, {
      referenceElement: referenceElement,
      icon: React.createElement(Icon.Bank32, null),
      title: 'Step 4',
      content: React.createElement("div", null, "Click the button to go to step 2", React.createElement(Button, {
        onClick: function onClick() {
          return setCurrentStep(1);
        }
      }, "Go back")),
      placement: 'bottom'
    }]
  }));
};
export var OverrideStep = {
  render: function render() {
    return React.createElement(OverrideStepExample, null);
  }
};