@styleless-ui/react
Version:
Completely unstyled, headless and accessible React UI components.
1 lines • 1.34 kB
JavaScript
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 a in r=arguments[e])Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a]);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 a=0;for(o=Object.getOwnPropertySymbols(t);a<o.length;a++)r.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(t,o[a])&&(e[o[a]]=t[o[a]])}return e};import{jsx as e}from"react/jsx-runtime";import*as o from"react";import{componentWithForwardedRef as a,useDeterministicId as s,useForkedRefs as n}from"../../utils";import{ContentRoot as i,TitleRoot as l}from"../slots";var c=a((function(a,c){var f=a.className,u=a.children,p=a.id,y=a.as,b=void 0===y?"strong":y,d=r(a,["className","children","id","as"]),m=s(p,"styleless-ui__snackbar-title"),h=o.useRef(null),O=n(c,h);return e(b,t({},d,{id:m,ref:function(t){if(O(t),t&&m){var r=t.closest("[data-slot='".concat(i,"']"));r?r.setAttribute("aria-labelledby",m):console.error("[StylelessUI][Snackbar]: You should always wrap your content with `<Snackbar.Content>` to provide accessibility features.")}},"data-slot":l,className:f},{children:u}))}));export default c;