"use strict";
// The require scope
var __webpack_require__ = {};
/************************************************************************/ // webpack/runtime/compat_get_default_export
(()=>{
    // getDefaultExport function for compatibility with non-ESM modules
    __webpack_require__.n = function(module) {
        var getter = module && module.__esModule ? function() {
            return module['default'];
        } : function() {
            return module;
        };
        __webpack_require__.d(getter, {
            a: getter
        });
        return getter;
    };
})();
// webpack/runtime/define_property_getters
(()=>{
    __webpack_require__.d = function(exports1, definition) {
        for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
            enumerable: true,
            get: definition[key]
        });
    };
})();
// webpack/runtime/has_own_property
(()=>{
    __webpack_require__.o = function(obj, prop) {
        return Object.prototype.hasOwnProperty.call(obj, prop);
    };
})();
// webpack/runtime/make_namespace_object
(()=>{
    // define __esModule on exports
    __webpack_require__.r = function(exports1) {
        if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
            value: 'Module'
        });
        Object.defineProperty(exports1, '__esModule', {
            value: true
        });
    };
})();
/************************************************************************/ var __webpack_exports__ = {};
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
    Default: ()=>/* binding */ Default,
    TabsFitted: ()=>/* binding */ TabsFitted,
    default: ()=>/* binding */ Tabs_stories_rslib_entry_,
    LazyDemo: ()=>/* binding */ LazyDemo,
    ReactNodeNames: ()=>/* binding */ ReactNodeNames
});
const external_react_namespaceObject = require("react");
const react_namespaceObject = require("@chakra-ui/react");
const test_namespaceObject = require("@storybook/test");
const external_Tabs_js_namespaceObject = require("./Tabs.js");
var external_Tabs_js_default = /*#__PURE__*/ __webpack_require__.n(external_Tabs_js_namespaceObject);
const meta = {
    title: 'Components/Tabs',
    component: external_Tabs_js_default(),
    parameters: {
        design: {
            type: 'figma',
            url: 'https://www.figma.com/file/bJcVrZNilxa06jYuVCGWYd/Redpanda-Design-System-2023?type=design&node-id=3-3592&mode=design'
        }
    }
};
/* ESM default export */ const Tabs_stories_rslib_entry_ = meta;
const Default = {
    args: {
        items: [
            {
                key: 'nodeJS',
                name: 'nodeJS',
                component: /*#__PURE__*/ React.createElement(React.Fragment, null, "nodeJS content")
            },
            {
                key: 'Java',
                name: 'Java',
                component: /*#__PURE__*/ React.createElement(React.Fragment, null, "Java content")
            },
            {
                key: 'C++',
                name: 'C++',
                component: /*#__PURE__*/ React.createElement(React.Fragment, null, "C++ content"),
                isDisabled: 'Disabled for X reason'
            }
        ]
    }
};
// More on interaction testing: https://storybook.js.org/docs/react/writing-tests/interaction-testing
const ReactNodeNames = {
    args: {
        items: [
            {
                key: 'nodeJS',
                name: /*#__PURE__*/ React.createElement(react_namespaceObject.Text, {
                    "data-testid": "node"
                }, "nodeJS"),
                component: /*#__PURE__*/ React.createElement(react_namespaceObject.Box, {
                    "data-testid": "node-content"
                }, "nodeJS content")
            },
            {
                key: 'Java',
                name: /*#__PURE__*/ React.createElement(react_namespaceObject.Heading, {
                    "data-testid": "java"
                }, "Java"),
                component: /*#__PURE__*/ React.createElement(react_namespaceObject.Box, {
                    "data-testid": "java-content"
                }, "Java content")
            },
            {
                key: 'C++',
                name: /*#__PURE__*/ React.createElement(react_namespaceObject.Box, {
                    "data-testid": "cplusplus"
                }, /*#__PURE__*/ React.createElement(react_namespaceObject.Highlight, {
                    query: "spotlight"
                }, "C++")),
                component: /*#__PURE__*/ React.createElement(react_namespaceObject.Box, {
                    "data-testid": "cplusplus-content"
                }, "C++ content")
            }
        ],
        onChange: (0, test_namespaceObject.fn)()
    },
    play: async ({ canvasElement, step })=>{
        const canvas = (0, test_namespaceObject.within)(canvasElement);
        await step('Select NodeJS', async ()=>{
            await test_namespaceObject.userEvent.click(canvas.getByTestId('node'));
            (0, test_namespaceObject.expect)(canvas.getByTestId('node-content')).toHaveTextContent('nodeJS content');
        });
        await step('Select Java', async ()=>{
            await test_namespaceObject.userEvent.click(canvas.getByTestId('java'));
            (0, test_namespaceObject.expect)(canvas.getByTestId('java-content')).toHaveTextContent('Java content');
        });
        await step('Select C++', async ()=>{
            await test_namespaceObject.userEvent.click(canvas.getByTestId('cplusplus'));
            (0, test_namespaceObject.expect)(canvas.getByTestId('cplusplus-content')).toHaveTextContent('C++ content');
        });
    }
};
const LazyDemo = ()=>{
    const [isLoading, setIsLoading] = (0, external_react_namespaceObject.useState)(false);
    (0, react_namespaceObject.useTimeout)(()=>{
        if (isLoading) setIsLoading(false);
    }, 5000);
    const items = [
        {
            key: 'nodeJS',
            name: 'nodeJS',
            component: 'Initially rendered data'
        },
        {
            key: 'Java',
            name: 'Java',
            component: isLoading ? /*#__PURE__*/ React.createElement(react_namespaceObject.Spinner, null) : /*#__PURE__*/ React.createElement(react_namespaceObject.Text, null, "Content")
        }
    ];
    return /*#__PURE__*/ React.createElement(external_Tabs_js_default(), {
        items: items,
        lazyBehavior: "unmount",
        onChange: (_index, key)=>{
            setIsLoading('Java' === key);
        }
    });
};
const TabsFitted = {
    args: {
        isFitted: true,
        variant: 'fitted',
        size: 'sm',
        items: [
            {
                key: 'nodeJS',
                name: 'nodeJS',
                component: /*#__PURE__*/ React.createElement(React.Fragment, null, "nodeJS content")
            },
            {
                key: 'Java',
                name: 'Java',
                component: /*#__PURE__*/ React.createElement(React.Fragment, null, "Java content")
            },
            {
                key: 'C++',
                name: 'C++',
                component: /*#__PURE__*/ React.createElement(React.Fragment, null, "C++ content"),
                isDisabled: 'Disabled for X reason'
            }
        ]
    }
};
var __webpack_export_target__ = exports;
for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
    value: true
});
