"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 Onboarding_exports = {};
__export(Onboarding_exports, {
  default: () => Onboarding_default
});
module.exports = __toCommonJS(Onboarding_exports);
var import_react = __toESM(require("react"));
var import_styled_components = __toESM(require("styled-components"));
var import_Text = __toESM(require("../../../asorted/Text"));
const Container = import_styled_components.default.div`
  display: flex;
  flex-direction: row;
  height: 24px;
  align-items: center;
`;
const Bar = import_styled_components.default.div`
  transition: all 600ms linear;
  height: 4px;
  border-radius: 2px;
  /* Disable left/right border radius to match the handler */
  border-top-${(p) => p.on ? "right" : "left"}-radius: 0;
  border-bottom-${(p) => p.on ? "right" : "left"}-radius: 0;
  flex: ${(p) => p.fill};
  background: ${(p) => p.on ? p.theme.colors.neutral.c100 : p.theme.colors.neutral.c40};
`;
const Handler = import_styled_components.default.div`
  transition: all 600ms linear;
  padding: 4px;
  background: ${(p) => p.theme.colors.neutral.c100};
  border-radius: ${(p) => `${p.theme.radii[1]}px`};

  display: flex;
  align-items: center;
  justify-content: center;
  column-gap: 6px;

  & span.index {
    display: flex;
    border-radius: 2px;
    height: 16px;
    width: 16px;
    justify-content: center;
    align-items: center;
    color: ${(p) => p.theme.colors.neutral.c100};
    background: ${(p) => p.theme.colors.neutral.c00};
  }
`;
const Onboarding = ({ steps, currentIndex }) => {
  const currentStep = steps[currentIndex];
  const fill = (currentIndex / (steps.length - 1) * 100).toFixed(2);
  return /* @__PURE__ */ import_react.default.createElement(Container, null, /* @__PURE__ */ import_react.default.createElement(Bar, { on: true, fill }), /* @__PURE__ */ import_react.default.createElement(Handler, { key: currentStep.key }, /* @__PURE__ */ import_react.default.createElement(import_Text.default, { className: "index", color: "neutral.c00", fontWeight: "medium", variant: "micro" }, currentIndex + 1), /* @__PURE__ */ import_react.default.createElement(import_Text.default, { color: "neutral.c00", fontWeight: "medium", textTransform: "uppercase", variant: "micro" }, currentStep.label)), /* @__PURE__ */ import_react.default.createElement(Bar, { fill: 100 - Number(fill) }));
};
var Onboarding_default = Onboarding;
//# sourceMappingURL=Onboarding.js.map
