UNPKG

@styleless-ui/react

Version:

Completely unstyled, headless and accessible React UI components.

1 lines 1.17 kB
var t=this&&this.__assign||function(){return t=Object.assign||function(t){for(var r,e=1,o=arguments.length;e<o;e++)for(var n in r=arguments[e])Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n]);return t},t.apply(this,arguments)},r=this&&this.__rest||function(t,r){var e={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&r.indexOf(o)<0&&(e[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(t);n<o.length;n++)r.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(t,o[n])&&(e[o[n]]=t[o[n]])}return e};import{jsx as e}from"react/jsx-runtime";import*as o from"react";import n from"../../FocusTrap";import{componentWithForwardedRef as i,useDeterministicId as a}from"../../utils";import l from"../context";import{ContentRoot as s}from"../slots";var c=i((function(i,c){var p=i.className,f=i.children,m=i.id,u=r(i,["className","children","id"]),d=o.useContext(l),h=a(m,"styleless-ui__dialog-content");return e(n,t({enabled:null==d?void 0:d.open},{children:e("div",t({},u,{id:h,ref:c,className:p,role:null==d?void 0:d.role,"data-slot":s,"aria-modal":"true"},{children:f}))}))}));export default c;