"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);

// src/components/Title/Title.tsx
var Title_exports = {};
__export(Title_exports, {
  Title: () => Title
});
module.exports = __toCommonJS(Title_exports);
var import_dedupe2 = __toESM(require("classnames/dedupe"));

// src/components/Flex/Flex.tsx
var import_dedupe = __toESM(require("classnames/dedupe"));

// src/utils/filterUndefinedProps.ts
var filterUndefinedProps = (props) => {
  const filteredProps = {};
  Object.keys(props).forEach((key) => {
    if (props[key] !== void 0) {
      filteredProps[key] = props[key];
    }
  });
  return filteredProps;
};

// src/utils/getSpacingValue.ts
var getSpacingValue = (padding) => {
  if (typeof padding === "string") {
    return `var(--size-${padding})`;
  }
  if (typeof padding === "number") {
    return `${padding}px`;
  }
  return void 0;
};

// src/components/Flex/propUtils.ts
var buildFlexStyles = (props) => {
  const {
    flexDirection,
    flexWrap,
    flexGrow,
    flex,
    justifyContent,
    alignItems,
    alignContent,
    gap,
    rowGap,
    columnGap
  } = props;
  const styleProps = {
    flexDirection,
    flexWrap,
    flexGrow,
    flex,
    justifyContent,
    alignItems,
    alignContent,
    gap: getSpacingValue(gap),
    columnGap: getSpacingValue(columnGap),
    rowGap: getSpacingValue(rowGap)
  };
  return filterUndefinedProps(styleProps);
};
var splitProps = (props) => {
  const {
    flexDirection,
    flexWrap,
    flexGrow,
    flex,
    justifyContent,
    alignItems,
    alignContent,
    gap,
    rowGap,
    columnGap,
    ...otherProps
  } = props;
  return [
    {
      flexDirection,
      flexWrap,
      flexGrow,
      flex,
      justifyContent,
      alignItems,
      alignContent,
      gap,
      rowGap,
      columnGap
    },
    otherProps
  ];
};

// src/components/Flex/Flex.tsx
var import_Flex = require("@simplybusiness/mobius/src/components/Flex/Flex.css");
var import_jsx_runtime = require("react/jsx-runtime");
var Flex = ({ ref, ...props }) => {
  const {
    elementType: Element = "div",
    style,
    className,
    ...otherProps
  } = props;
  const classes = (0, import_dedupe.default)("mobius", "mobius-flex", className);
  const [styleProps, restProps] = splitProps(otherProps);
  const flexStyles = buildFlexStyles(styleProps);
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
    Element,
    {
      ref,
      style: {
        ...flexStyles,
        ...style
      },
      className: classes,
      ...restProps
    }
  );
};
Flex.displayName = "Flex";

// src/components/Title/Title.tsx
var import_Title = require("@simplybusiness/mobius/src/components/Title/Title.css");
var import_jsx_runtime2 = require("react/jsx-runtime");
var Title = ({ ref, ...props }) => {
  const {
    elementType: Element = "div",
    title,
    description,
    ...otherProps
  } = props;
  const classes = (0, import_dedupe2.default)("mobius", "mobius-title", otherProps.className);
  const headerClasses = (0, import_dedupe2.default)("mobius", "mobius-title__header");
  const contentClasses = (0, import_dedupe2.default)("mobius", "mobius-title__description");
  const containerClasses = (0, import_dedupe2.default)("mobius", "mobius-title__container");
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Element, { ref, ...otherProps, className: classes, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Flex, { flexDirection: "column", className: containerClasses, children: [
    /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: headerClasses, children: title }),
    /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: contentClasses, children: description })
  ] }) });
};
Title.displayName = "Title";
//# sourceMappingURL=Title.js.map
