"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var Carousel_stories_exports = {};
__export(Carousel_stories_exports, {
  Default: () => Default,
  PortfolioContentCards: () => PortfolioContentCards,
  default: () => Carousel_stories_default
});
module.exports = __toCommonJS(Carousel_stories_exports);
var import_addon_actions = require("@storybook/addon-actions");
var import_react = __toESM(require("react"));
var import_PortfolioContentCard = __toESM(require("../ContentCard/PortfolioContentCard"));
var import__ = __toESM(require("./"));
const SlideContext = import_react.default.createContext([]);
var Carousel_stories_default = {
  title: "Layout/Carousel",
  argTypes: {
    children: {
      description: "The elements to be displayed.",
      control: { type: "range", min: 0, max: 10, step: 1 }
    },
    variant: {
      description: "Variant for the carousel.",
      options: ["default", "content-card"],
      defaultValue: "default",
      control: "inline-radio"
    },
    autoPlay: {
      description: "The time in milliseconds between automatic slide change (0 for no auto-play)."
    },
    onNext: {
      description: "Function called when the user moves to the next slide."
    },
    onPrev: {
      description: "Function called when the user moves to the previous slide."
    }
  },
  args: {
    variant: "default",
    children: 5,
    autoPlay: 0
  },
  parameters: {
    docs: {
      description: {
        component: "A simple Carousel component."
      }
    }
  },
  decorators: [
    (Story, { args, parameters }) => /* @__PURE__ */ import_react.default.createElement(
      SlideContext.Provider,
      {
        value: Array.from({ length: args.children }, (_, index) => /* @__PURE__ */ import_react.default.createElement(parameters.Slide, { key: index, index }))
      },
      /* @__PURE__ */ import_react.default.createElement(Story, null)
    )
  ],
  render: ({ children, ...props }) => /* @__PURE__ */ import_react.default.createElement(import__.default, { ...props }, (0, import_react.useContext)(SlideContext))
};
const Default = {
  parameters: {
    Slide: ({ index }) => /* @__PURE__ */ import_react.default.createElement(
      "div",
      {
        style: {
          backgroundColor: `hsl(${Math.random() * 360}, 100%, 75%)`,
          padding: "16px 24px",
          borderRadius: "5px"
        }
      },
      "Slide ",
      index
    )
  }
};
const PortfolioContentCards = {
  parameters: {
    Slide: ({ index }) => /* @__PURE__ */ import_react.default.createElement(
      import_PortfolioContentCard.default,
      {
        title: "Ledger Recover",
        description: "Get peace of mind and start your free trial.",
        cta: index % 2 ? void 0 : "Start my free trial",
        tag: index % 3 ? void 0 : "New",
        image: (index + 1) % 4 ? IMAGE_SRC : void 0,
        onClick: () => onSlideAction(`click on slide ${index}`),
        onClose: () => onSlideAction(`close slide ${index}`)
      }
    )
  }
};
const onSlideAction = (0, import_addon_actions.action)("onSlideAction");
const IMAGE_SRC = "data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='450' height='526' viewBox='0 0 450 526'><defs><linearGradient id='g' x0='0' y0='0' x1='1' y1='1'><stop stop-color='%23000' offset='0%' /><stop stop-color='%23FFF' offset='100%' /></linearGradient></defs><path d='M0,0 H450 V526 Q0,526 0,0 z' fill='url(%23g)' /></svg>";
//# sourceMappingURL=Carousel.stories.js.map
