'use strict';

var reactSlot = require('@radix-ui/react-slot');
var lodashEs = require('lodash-es');
var react$1 = require('react');
var ReactVirtualizedAutoSizer = require('react-virtualized-auto-sizer');
var tailwindMerge = require('tailwind-merge');
var react = require('@tw-classed/react');
var core = require('@tw-classed/core');
require('clsx');
var createVariatGroupTransfomer = require('tailwind-group-variant');
var ScrollAreaPrimitive = require('@radix-ui/react-scroll-area');
var jsxRuntime = require('react/jsx-runtime');

function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }

function _interopNamespace(e) {
  if (e && e.__esModule) return e;
  var n = Object.create(null);
  if (e) {
    Object.keys(e).forEach(function (k) {
      if (k !== 'default') {
        var d = Object.getOwnPropertyDescriptor(e, k);
        Object.defineProperty(n, k, d.get ? d : {
          enumerable: true,
          get: function () { return e[k]; }
        });
      }
    });
  }
  n.default = e;
  return Object.freeze(n);
}

var ReactVirtualizedAutoSizer__default = /*#__PURE__*/_interopDefault(ReactVirtualizedAutoSizer);
var createVariatGroupTransfomer__default = /*#__PURE__*/_interopDefault(createVariatGroupTransfomer);
var ScrollAreaPrimitive__namespace = /*#__PURE__*/_interopNamespace(ScrollAreaPrimitive);

// src/components/AutoSizer/AutoSizer.tsx
var twMerge = tailwindMerge.extendTailwindMerge({
  classGroups: {
    "font-size": [
      {
        // Fixes incorect merging of text size
        text: ["h1", "h2", "h3", "h4", "h5", "h6"]
      }
    ]
  }
});
var { classed } = react.createClassed({ merger: twMerge });
core.createClassed({ merger: twMerge });
createVariatGroupTransfomer__default.default({});
var AutoSizer = ({
  children,
  autoSizerClassName,
  ...props
}) => {
  const element = react$1.useCallback(
    ({ width, height }) => {
      if (typeof children === "function") {
        return children({ height, width });
      }
      const { style, ...rest } = props;
      return /* @__PURE__ */ jsxRuntime.jsx(
        reactSlot.Slot,
        {
          ...rest,
          style: {
            ...style,
            width,
            height
          },
          children
        }
      );
    },
    [children, props]
  );
  return /* @__PURE__ */ jsxRuntime.jsx(ReactVirtualizedAutoSizer__default.default, { className: autoSizerClassName, children: ({ width, height }) => element({ width, height }) });
};
var pickedScrollAreaProps = {
  scrollHideDelay: true,
  type: true,
  dir: true
};
var ScrollerContainerElementWrapper = classed("div", "w-full", {
  variants: {
    grow: {
      true: "grow"
    }
  }
});
var ScrollArea = react$1.forwardRef(
  ({ children, ...props }, forwardedRef) => {
    return /* @__PURE__ */ jsxRuntime.jsx(ScrollerContainer, { ...props, children: /* @__PURE__ */ jsxRuntime.jsx(ScrollAreaViewport, { ref: forwardedRef, children }) });
  }
);
var ScrollerContainer = (props) => {
  const scrollAreaProps = lodashEs.pick(props, Object.keys(pickedScrollAreaProps));
  const { children, className, ...rest } = lodashEs.omit(props, Object.keys(pickedScrollAreaProps));
  return /* @__PURE__ */ jsxRuntime.jsx(ScrollerContainerElementWrapper, { className, ...rest, children: /* @__PURE__ */ jsxRuntime.jsx(AutoSizer, { children: /* @__PURE__ */ jsxRuntime.jsx(ScrollerContainerElement, { ...scrollAreaProps, children }) }) });
};
var ScrollAreaViewport = classed(ScrollAreaPrimitive__namespace.Viewport, "w-full h-full");
var ScrollerContainerElement = classed(ScrollAreaPrimitive__namespace.Root, "w-full bg-danger", {
  variants: {}
});
var Container = classed("div", "grow flex flex-col");
var Header = classed("div", "shrink-0");
var Footer = classed("div", "shrink-0");

exports.AutoSizer = AutoSizer;
exports.Container = Container;
exports.Footer = Footer;
exports.Header = Header;
exports.ScrollArea = ScrollArea;
exports.ScrollAreaViewport = ScrollAreaViewport;
exports.ScrollerContainer = ScrollerContainer;
//# sourceMappingURL=out.js.map
//# sourceMappingURL=index.cjs.map