"use strict";
var __rest = (this && this.__rest) || function (s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.reviewBlockWithHiddenTitle = exports.reviewBlock = exports.withNoWrap = exports.withAriaLabelForLink = exports.withLink = exports.defaultState = void 0;
const react_1 = __importDefault(require("react"));
const addon_knobs_1 = require("@storybook/addon-knobs");
const storybook_utilities_1 = require("../../storybook-utilities");
const ReviewItem_1 = require("./ReviewItem");
const meta = {
    component: ReviewItem_1.ReviewItem,
    title: 'checkout-web-ui/ReviewItem',
    decorators: [addon_knobs_1.withKnobs, storybook_utilities_1.themeWithKnobs('reviewBlock')],
    argTypes: {
        to: { type: { name: 'string', required: false } },
        linkLabel: { type: { name: 'string', required: false } },
        linkAccessibilityLabel: { type: { name: 'string', required: false } },
    },
};
exports.default = meta;
const Template = (args) => (<div role="table">
    <ReviewItem_1.ReviewItem {...args}>snowdevil@shopify.com</ReviewItem_1.ReviewItem>
  </div>);
exports.defaultState = Template.bind({});
exports.defaultState.args = {
    label: 'Contact',
    to: undefined,
    linkLabel: undefined,
    linkAccessibilityLabel: undefined,
};
exports.withLink = Template.bind({});
exports.withLink.args = Object.assign(Object.assign({}, exports.defaultState.args), { to: '/shipping', linkLabel: 'Change', linkAccessibilityLabel: undefined });
exports.withAriaLabelForLink = Template.bind({});
exports.withAriaLabelForLink.args = Object.assign(Object.assign({}, exports.withLink.args), { linkAccessibilityLabel: 'Change contact information' });
exports.withNoWrap = Template.bind({});
exports.withNoWrap.args = Object.assign(Object.assign({}, exports.withAriaLabelForLink.args), { noWrap: true });
const ReviewBlockTemplate = (_a) => {
    var { title, titleHidden } = _a, reviewItemArgs = __rest(_a, ["title", "titleHidden"]);
    return (<ReviewItem_1.ReviewBlock {...{ title, titleHidden }}>
    <ReviewItem_1.ReviewItem {...reviewItemArgs}>snowdevil@shopify.com</ReviewItem_1.ReviewItem>
    <ReviewItem_1.ReviewItem label="Ship to" to="/information" linkLabel="Change" linkAccessibilityLabel="Change shipping address">
      490 Rue de la Gauchetière O, Montréal, QC H2Z 0B3
    </ReviewItem_1.ReviewItem>
    <ReviewItem_1.ReviewItem label="Method" to="/shipping" linkLabel="Change" linkAccessibilityLabel="Change shipping method">
      Standard - <strong>$14.90</strong>
    </ReviewItem_1.ReviewItem>
  </ReviewItem_1.ReviewBlock>);
};
exports.reviewBlock = ReviewBlockTemplate.bind({});
exports.reviewBlock.args = Object.assign(Object.assign({}, exports.withAriaLabelForLink.args), { title: 'Review', titleHidden: false });
exports.reviewBlockWithHiddenTitle = ReviewBlockTemplate.bind({});
exports.reviewBlockWithHiddenTitle.args = Object.assign(Object.assign({}, exports.withAriaLabelForLink.args), { title: 'Review your information', titleHidden: true });
