@styleless-ui/react
Version:
Completely unstyled, headless and accessible React UI components.
1 lines • 1.09 kB
JavaScript
var r=this&&this.__assign||function(){return r=Object.assign||function(r){for(var t,e=1,n=arguments.length;e<n;e++)for(var o in t=arguments[e])Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=t[o]);return r},r.apply(this,arguments)},t=this&&this.__rest||function(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(r);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(r,n[o])&&(e[n[o]]=r[n[o]])}return e};import{jsx as e}from"react/jsx-runtime";import*as n from"react";import{componentWithForwardedRef as o}from"../../utils";import a from"../Panel";import{PanelsRoot as i}from"../slots";var l=o((function(o,l){var s=o.children,c=o.className,f=t(o,["children","className"]),p=0,m=n.Children.map(s,(function(r){if(!n.isValidElement(r))return null;if(r.type===a){var t={"data-index":p++};return n.cloneElement(r,t)}return r}));return e("div",r({},f,{ref:l,className:c,"data-slot":i},{children:m}))}));export default l;