@redocly/asyncapi-docs
Version:
Async API docs for Redocly Realm
32 lines (31 loc) • 1.05 kB
JavaScript
import{jsx as o,jsxs as c}from"react/jsx-runtime";import e from"styled-components";import{Tag as l}from"@redocly/theme/components/Tag/Tag";const u=({icon:r,info:a,children:i,capitalize:n,className:s,onClick:t})=>c(d,{className:s,onClick:t,tabIndex:t?0:-1,children:[r&&o(p,{children:r}),o(g,{borderless:!0,capitalize:n,children:i}),a&&o(h,{children:a})]}),d=e.button`
display: flex;
gap: var(--spacing-xxs);
padding: 0;
`,p=e.div`
width: 24px;
height: 24px;
border-radius: 50%;
align-items: center;
justify-content: center;
display: flex;
flex-shrink: 0;
background-color: var(--layer-color-hover);
`,g=e(l)`
text-transform: ${({capitalize:r})=>r?"capitalize":"initial"};
margin: 0;
background-color: var(--layer-color-hover);
color: inherit;
& span {
font-weight: 600;
}
`,h=e.div`
width: 24px;
height: 24px;
border-radius: var(--border-radius);
align-items: center;
justify-content: center;
background-color: var(--layer-color-hover);
display: flex;
cursor: pointer;
`;export{u as TagWithIcon};