@quietmind/mdx-docs 0.1.18 → 0.1.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # @quietmind/mdx-docs
2
2
 
3
+ <a href="https://www.producthunt.com/posts/mdx-docs">
4
+ <img src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=1095911&theme=dark" height="32" />
5
+ </a>
6
+
3
7
  > ⚡ A lightweight React framework for building MDX documentation sites.
4
8
 
5
9
  MDX Docs turns MDX files into routed documentation pages with a built-in layout, sidebar, and navigation.
@@ -70,6 +74,14 @@ export const site = {
70
74
  };
71
75
  ```
72
76
 
77
+ ## Writing MDX
78
+
79
+ MDX files are JSX, not HTML. A few things to keep in mind:
80
+
81
+ - **Inline styles must be objects**, not strings — `style={{ marginRight: '0.5rem' }}` not `style="margin-right: 0.5rem"`. A CSS string will cause a runtime error due to Emotion's JSX transform.
82
+ - Use `className` instead of `class`.
83
+ - Self-close void elements: `<img />`, `<br />`, `<hr />`.
84
+
73
85
  ## Favicon
74
86
 
75
87
  Place your favicon in the `public/` directory and add a `<link>` tag to `index.html`:
@@ -0,0 +1 @@
1
+ import{j as u,r as y}from"./react-vendor-BVjvCnQb.js";import{c as M}from"./prism-DjoQ0BfU.js";import{c as N,g as T,a as z,u as U,b as v,e as E,s as b,m as q}from"./index-C5FzG5L5.js";const L=N(u.jsx("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"}));function B(o){return T("MuiAvatar",o)}z("MuiAvatar",["root","colorDefault","circular","rounded","square","img","fallback"]);const H=o=>{const{classes:t,variant:a,colorDefault:r}=o;return E({root:["root",a,r&&"colorDefault"],img:["img"],fallback:["fallback"]},B,t)},G=b("div",{name:"MuiAvatar",slot:"Root",overridesResolver:(o,t)=>{const{ownerState:a}=o;return[t.root,t[a.variant],a.colorDefault&&t.colorDefault]}})(q(({theme:o})=>({position:"relative",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:40,height:40,fontFamily:o.typography.fontFamily,fontSize:o.typography.pxToRem(20),lineHeight:1,borderRadius:"50%",overflow:"hidden",userSelect:"none",variants:[{props:{variant:"rounded"},style:{borderRadius:(o.vars||o).shape.borderRadius}},{props:{variant:"square"},style:{borderRadius:0}},{props:{colorDefault:!0},style:{color:(o.vars||o).palette.background.default,...o.vars?{backgroundColor:o.vars.palette.Avatar.defaultBg}:{backgroundColor:o.palette.grey[400],...o.applyStyles("dark",{backgroundColor:o.palette.grey[600]})}}}]}))),J=b("img",{name:"MuiAvatar",slot:"Img"})({width:"100%",height:"100%",textAlign:"center",objectFit:"cover",color:"transparent",textIndent:1e4}),K=b(L,{name:"MuiAvatar",slot:"Fallback"})({width:"75%",height:"75%"});function O({crossOrigin:o,referrerPolicy:t,src:a,srcSet:r}){const[n,s]=y.useState(!1);return y.useEffect(()=>{if(!a&&!r)return;s(!1);let c=!0;const e=new Image;return e.onload=()=>{c&&s("loaded")},e.onerror=()=>{c&&s("error")},e.crossOrigin=o,e.referrerPolicy=t,e.src=a,r&&(e.srcset=r),()=>{c=!1}},[o,t,a,r]),n}const X=y.forwardRef(function(t,a){const r=U({props:t,name:"MuiAvatar"}),{alt:n,children:s,className:c,component:e="div",slots:p={},slotProps:i={},imgProps:x,sizes:A,src:f,srcSet:g,variant:P="circular",...S}=r;let d=null;const l={...r,component:e,variant:P},w=O({...x,...typeof i.img=="function"?i.img(l):i.img,src:f,srcSet:g}),h=f||g,k=h&&w!=="error";l.colorDefault=!k,delete l.ownerState;const m=H(l),[F,R]=v("root",{ref:a,className:M(m.root,c),elementType:G,externalForwardedProps:{slots:p,slotProps:i,component:e,...S},ownerState:l}),[C,I]=v("img",{className:m.img,elementType:J,externalForwardedProps:{slots:p,slotProps:{img:{...x,...i.img}}},additionalProps:{alt:n,src:f,srcSet:g,sizes:A},ownerState:l}),[j,D]=v("fallback",{className:m.fallback,elementType:K,externalForwardedProps:{slots:p,slotProps:i},shouldForwardComponentProp:!0,ownerState:l});return k?d=u.jsx(C,{...I}):s||s===0?d=s:h&&n?d=n[0]:d=u.jsx(j,{...D}),u.jsx(F,{...R,children:d})});export{X as A};
@@ -0,0 +1 @@
1
+ import{r as v,j as s}from"./react-vendor-BVjvCnQb.js";import{c as W}from"./prism-DjoQ0BfU.js";import{g as G,a as D,r as H,u as A,h as q,d as i,e as J,s as x,i as K,j as Q,m as X,C as Y,f as Z}from"./index-C5FzG5L5.js";function _(o){return G("MuiButton",o)}const d=D("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge","loading","loadingWrapper","loadingIconPlaceholder","loadingIndicator","loadingPositionCenter","loadingPositionStart","loadingPositionEnd"]),oo=v.createContext({}),ao=v.createContext(void 0),to=o=>{const{color:a,disableElevation:t,fullWidth:n,size:c,variant:p,loading:u,loadingPosition:S,classes:y}=o,b={root:["root",u&&"loading",p,`${p}${i(a)}`,`size${i(c)}`,`${p}Size${i(c)}`,`color${i(a)}`,t&&"disableElevation",n&&"fullWidth",u&&`loadingPosition${i(S)}`],startIcon:["icon","startIcon",`iconSize${i(c)}`],endIcon:["icon","endIcon",`iconSize${i(c)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]},f=J(b,_,y);return{...y,...f}},m=[{props:{size:"small"},style:{"& > *:nth-of-type(1)":{fontSize:18}}},{props:{size:"medium"},style:{"& > *:nth-of-type(1)":{fontSize:20}}},{props:{size:"large"},style:{"& > *:nth-of-type(1)":{fontSize:22}}}],no=x(K,{shouldForwardProp:o=>Q(o)||o==="classes",name:"MuiButton",slot:"Root",overridesResolver:(o,a)=>{const{ownerState:t}=o;return[a.root,a[t.variant],a[`${t.variant}${i(t.color)}`],a[`size${i(t.size)}`],a[`${t.variant}Size${i(t.size)}`],t.color==="inherit"&&a.colorInherit,t.disableElevation&&a.disableElevation,t.fullWidth&&a.fullWidth,t.loading&&a.loading]}})(X(({theme:o})=>{const a=o.palette.mode==="light"?o.palette.grey[300]:o.palette.grey[800],t=o.palette.mode==="light"?o.palette.grey.A100:o.palette.grey[700];return{...o.typography.button,minWidth:64,padding:"6px 16px",border:0,borderRadius:(o.vars||o).shape.borderRadius,transition:o.transitions.create(["background-color","box-shadow","border-color","color"],{duration:o.transitions.duration.short}),"&:hover":{textDecoration:"none"},[`&.${d.disabled}`]:{color:(o.vars||o).palette.action.disabled},variants:[{props:{variant:"contained"},style:{color:"var(--variant-containedColor)",backgroundColor:"var(--variant-containedBg)",boxShadow:(o.vars||o).shadows[2],"&:hover":{boxShadow:(o.vars||o).shadows[4],"@media (hover: none)":{boxShadow:(o.vars||o).shadows[2]}},"&:active":{boxShadow:(o.vars||o).shadows[8]},[`&.${d.focusVisible}`]:{boxShadow:(o.vars||o).shadows[6]},[`&.${d.disabled}`]:{color:(o.vars||o).palette.action.disabled,boxShadow:(o.vars||o).shadows[0],backgroundColor:(o.vars||o).palette.action.disabledBackground}}},{props:{variant:"outlined"},style:{padding:"5px 15px",border:"1px solid currentColor",borderColor:"var(--variant-outlinedBorder, currentColor)",backgroundColor:"var(--variant-outlinedBg)",color:"var(--variant-outlinedColor)",[`&.${d.disabled}`]:{border:`1px solid ${(o.vars||o).palette.action.disabledBackground}`}}},{props:{variant:"text"},style:{padding:"6px 8px",color:"var(--variant-textColor)",backgroundColor:"var(--variant-textBg)"}},...Object.entries(o.palette).filter(Z()).map(([n])=>({props:{color:n},style:{"--variant-textColor":(o.vars||o).palette[n].main,"--variant-outlinedColor":(o.vars||o).palette[n].main,"--variant-outlinedBorder":o.alpha((o.vars||o).palette[n].main,.5),"--variant-containedColor":(o.vars||o).palette[n].contrastText,"--variant-containedBg":(o.vars||o).palette[n].main,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":(o.vars||o).palette[n].dark,"--variant-textBg":o.alpha((o.vars||o).palette[n].main,(o.vars||o).palette.action.hoverOpacity),"--variant-outlinedBorder":(o.vars||o).palette[n].main,"--variant-outlinedBg":o.alpha((o.vars||o).palette[n].main,(o.vars||o).palette.action.hoverOpacity)}}}})),{props:{color:"inherit"},style:{color:"inherit",borderColor:"currentColor","--variant-containedBg":o.vars?o.vars.palette.Button.inheritContainedBg:a,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":o.vars?o.vars.palette.Button.inheritContainedHoverBg:t,"--variant-textBg":o.alpha((o.vars||o).palette.text.primary,(o.vars||o).palette.action.hoverOpacity),"--variant-outlinedBg":o.alpha((o.vars||o).palette.text.primary,(o.vars||o).palette.action.hoverOpacity)}}}},{props:{size:"small",variant:"text"},style:{padding:"4px 5px",fontSize:o.typography.pxToRem(13)}},{props:{size:"large",variant:"text"},style:{padding:"8px 11px",fontSize:o.typography.pxToRem(15)}},{props:{size:"small",variant:"outlined"},style:{padding:"3px 9px",fontSize:o.typography.pxToRem(13)}},{props:{size:"large",variant:"outlined"},style:{padding:"7px 21px",fontSize:o.typography.pxToRem(15)}},{props:{size:"small",variant:"contained"},style:{padding:"4px 10px",fontSize:o.typography.pxToRem(13)}},{props:{size:"large",variant:"contained"},style:{padding:"8px 22px",fontSize:o.typography.pxToRem(15)}},{props:{disableElevation:!0},style:{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${d.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${d.disabled}`]:{boxShadow:"none"}}},{props:{fullWidth:!0},style:{width:"100%"}},{props:{loadingPosition:"center"},style:{transition:o.transitions.create(["background-color","box-shadow","border-color"],{duration:o.transitions.duration.short}),[`&.${d.loading}`]:{color:"transparent"}}}]}})),io=x("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(o,a)=>{const{ownerState:t}=o;return[a.startIcon,t.loading&&a.startIconLoadingStart,a[`iconSize${i(t.size)}`]]}})(({theme:o})=>({display:"inherit",marginRight:8,marginLeft:-4,variants:[{props:{size:"small"},style:{marginLeft:-2}},{props:{loadingPosition:"start",loading:!0},style:{transition:o.transitions.create(["opacity"],{duration:o.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"start",loading:!0,fullWidth:!0},style:{marginRight:-8}},...m]})),ro=x("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(o,a)=>{const{ownerState:t}=o;return[a.endIcon,t.loading&&a.endIconLoadingEnd,a[`iconSize${i(t.size)}`]]}})(({theme:o})=>({display:"inherit",marginRight:-4,marginLeft:8,variants:[{props:{size:"small"},style:{marginRight:-2}},{props:{loadingPosition:"end",loading:!0},style:{transition:o.transitions.create(["opacity"],{duration:o.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"end",loading:!0,fullWidth:!0},style:{marginLeft:-8}},...m]})),so=x("span",{name:"MuiButton",slot:"LoadingIndicator"})(({theme:o})=>({display:"none",position:"absolute",visibility:"visible",variants:[{props:{loading:!0},style:{display:"flex"}},{props:{loadingPosition:"start"},style:{left:14}},{props:{loadingPosition:"start",size:"small"},style:{left:10}},{props:{variant:"text",loadingPosition:"start"},style:{left:6}},{props:{loadingPosition:"center"},style:{left:"50%",transform:"translate(-50%)",color:(o.vars||o).palette.action.disabled}},{props:{loadingPosition:"end"},style:{right:14}},{props:{loadingPosition:"end",size:"small"},style:{right:10}},{props:{variant:"text",loadingPosition:"end"},style:{right:6}},{props:{loadingPosition:"start",fullWidth:!0},style:{position:"relative",left:-10}},{props:{loadingPosition:"end",fullWidth:!0},style:{position:"relative",right:-10}}]})),E=x("span",{name:"MuiButton",slot:"LoadingIconPlaceholder"})({display:"inline-block",width:"1em",height:"1em"}),po=v.forwardRef(function(a,t){const n=v.useContext(oo),c=v.useContext(ao),p=H(n,a),u=A({props:p,name:"MuiButton"}),{children:S,color:y="primary",component:b="button",className:f,disabled:z=!1,disableElevation:L=!1,disableFocusRipple:I=!1,endIcon:B,focusVisibleClassName:M,fullWidth:N=!1,id:C,loading:e=null,loadingIndicator:j,loadingPosition:g="center",size:k="medium",startIcon:P,type:h,variant:T="text",...V}=u,w=q(C),$=j??s.jsx(Y,{"aria-labelledby":w,color:"inherit",size:16}),l={...u,color:y,component:b,disabled:z,disableElevation:L,disableFocusRipple:I,fullWidth:N,loading:e,loadingIndicator:$,loadingPosition:g,size:k,type:h,variant:T},r=to(l),O=(P||e&&g==="start")&&s.jsx(io,{className:r.startIcon,ownerState:l,children:P||s.jsx(E,{className:r.loadingIconPlaceholder,ownerState:l})}),F=(B||e&&g==="end")&&s.jsx(ro,{className:r.endIcon,ownerState:l,children:B||s.jsx(E,{className:r.loadingIconPlaceholder,ownerState:l})}),U=c||"",R=typeof e=="boolean"?s.jsx("span",{className:r.loadingWrapper,style:{display:"contents"},children:e&&s.jsx(so,{className:r.loadingIndicator,ownerState:l,children:$})}):null;return s.jsxs(no,{ownerState:l,className:W(n.className,r.root,f,U),component:b,disabled:z||e,focusRipple:!I,focusVisibleClassName:W(r.focusVisible,M),ref:t,type:h,id:e?w:C,...V,classes:r,children:[O,g!=="end"&&R,S,g==="end"&&R,F]})});export{po as B};
@@ -0,0 +1 @@
1
+ import{j as o}from"./react-vendor-BVjvCnQb.js";import{c as t}from"./index-C5FzG5L5.js";const s=t(o.jsx("path",{d:"m12 21.35-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54z"}));export{s as F};
@@ -0,0 +1,38 @@
1
+ import{n as t,o as n,p as r,F as c}from"./react-vendor-BVjvCnQb.js";function d(o){const e={blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...t(),...o.components};return r(c,{children:[n(e.h1,{children:"Advanced"}),`
2
+ `,r(e.p,{children:["By default, ",n(e.code,{children:"createApp()"})," renders a full docs site with a top bar and side navigation. For cases where you want to bring your own shell — or embed the content area inside an existing layout — you can use ",n(e.code,{children:"DocsProvider"})," and ",n(e.code,{children:"MDXContent"})," directly."]}),`
3
+ `,n(e.h2,{children:"DocsProvider"}),`
4
+ `,r(e.p,{children:[n(e.code,{children:"DocsProvider"})," is the React context provider that makes your pages and site config available to all mdx-docs components. It must wrap anything that uses ",n(e.code,{children:"MDXContent"}),"."]}),`
5
+ `,n(e.pre,{children:n(e.code,{className:"language-jsx",children:`import { DocsProvider } from '@quietmind/mdx-docs'
6
+ `})}),`
7
+ `,r(e.table,{children:[n(e.thead,{children:r(e.tr,{children:[n(e.th,{children:"Prop"}),n(e.th,{children:"Type"}),n(e.th,{children:"Required"}),n(e.th,{children:"Description"})]})}),r(e.tbody,{children:[r(e.tr,{children:[n(e.td,{children:n(e.code,{children:"pages"})}),n(e.td,{children:n(e.code,{children:"Page[]"})}),n(e.td,{children:"Yes"}),r(e.td,{children:["Array of page objects (same shape as ",n(e.code,{children:"createApp"}),")"]})]}),r(e.tr,{children:[n(e.td,{children:n(e.code,{children:"site"})}),n(e.td,{children:n(e.code,{children:"object"})}),n(e.td,{children:"Yes"}),r(e.td,{children:["Site config with ",n(e.code,{children:"name"})," and ",n(e.code,{children:"description"})]})]}),r(e.tr,{children:[n(e.td,{children:n(e.code,{children:"hideHomeFromNav"})}),n(e.td,{children:n(e.code,{children:"boolean"})}),n(e.td,{children:"No"}),r(e.td,{children:["Hide the home route from navigation (default: ",n(e.code,{children:"false"}),")"]})]})]})]}),`
8
+ `,n(e.h2,{children:"MDXContent"}),`
9
+ `,r(e.p,{children:[n(e.code,{children:"MDXContent"})," renders the routed MDX content area. It reads ",n(e.code,{children:"pages"})," from the nearest ",n(e.code,{children:"DocsProvider"})," and sets up React Router ",n(e.code,{children:"<Routes>"})," for each page. It must be rendered inside both a ",n(e.code,{children:"DocsProvider"})," and a React Router context."]}),`
10
+ `,n(e.pre,{children:n(e.code,{className:"language-jsx",children:`import { MDXContent } from '@quietmind/mdx-docs'
11
+ `})}),`
12
+ `,r(e.p,{children:[n(e.code,{children:"MDXContent"})," takes no props."]}),`
13
+ `,n(e.h2,{children:"Custom layout example"}),`
14
+ `,n(e.p,{children:"Use these two components together to render just the content area inside your own layout:"}),`
15
+ `,n(e.pre,{children:n(e.code,{className:"language-jsx",children:`import { BrowserRouter } from 'react-router-dom'
16
+ import { DocsProvider, MDXContent } from '@quietmind/mdx-docs'
17
+ import '@quietmind/mdx-docs/index.css'
18
+
19
+ import pages from './config/pages'
20
+ import site from './config/site'
21
+
22
+ export default function App() {
23
+ return (
24
+ <DocsProvider pages={pages} site={site}>
25
+ <BrowserRouter>
26
+ <MyTopBar />
27
+ <MySideNav />
28
+ <main>
29
+ <MDXContent />
30
+ </main>
31
+ </BrowserRouter>
32
+ </DocsProvider>
33
+ )
34
+ }
35
+ `})}),`
36
+ `,r(e.blockquote,{children:[`
37
+ `,r(e.p,{children:[n(e.code,{children:"MDXContent"})," does not include any MUI ",n(e.code,{children:"ThemeProvider"}),". If you are using MUI components in your own layout or MDX pages, wrap the tree in a ",n(e.code,{children:"ThemeProvider"})," before rendering ",n(e.code,{children:"MDXContent"}),"."]}),`
38
+ `]})]})}function a(o={}){const{wrapper:e}={...t(),...o.components};return e?n(e,{...o,children:n(d,{...o})}):d(o)}export{a as default};
@@ -0,0 +1,191 @@
1
+ import{j as l,r as C,n as B,o as e,p as i,F as ie}from"./react-vendor-BVjvCnQb.js";import{g as R,a as U,c as p,u as W,b as h,I as $,d as b,e as L,s as f,P as se,m as E,f as T,T as le,B as g}from"./index-C5FzG5L5.js";import{c as O}from"./prism-DjoQ0BfU.js";import"./router-d4Dt6g8h.js";function ae(r){return R("MuiAlert",r)}const N=U("MuiAlert",["root","action","icon","message","filled","colorSuccess","colorInfo","colorWarning","colorError","filledSuccess","filledInfo","filledWarning","filledError","outlined","outlinedSuccess","outlinedInfo","outlinedWarning","outlinedError","standard","standardSuccess","standardInfo","standardWarning","standardError"]),oe=p(l.jsx("path",{d:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"})),ce=p(l.jsx("path",{d:"M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"})),de=p(l.jsx("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"})),he=p(l.jsx("path",{d:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"})),pe=p(l.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),ue=r=>{const{variant:n,color:a,severity:t,classes:o}=r,u={root:["root",`color${b(a||t)}`,`${n}${b(a||t)}`,`${n}`],icon:["icon"],message:["message"],action:["action"]};return L(u,ae,o)},ge=f(se,{name:"MuiAlert",slot:"Root",overridesResolver:(r,n)=>{const{ownerState:a}=r;return[n.root,n[a.variant],n[`${a.variant}${b(a.color||a.severity)}`]]}})(E(({theme:r})=>{const n=r.palette.mode==="light"?r.darken:r.lighten,a=r.palette.mode==="light"?r.lighten:r.darken;return{...r.typography.body2,backgroundColor:"transparent",display:"flex",padding:"6px 16px",variants:[...Object.entries(r.palette).filter(T(["light"])).map(([t])=>({props:{colorSeverity:t,variant:"standard"},style:{color:r.vars?r.vars.palette.Alert[`${t}Color`]:n(r.palette[t].light,.6),backgroundColor:r.vars?r.vars.palette.Alert[`${t}StandardBg`]:a(r.palette[t].light,.9),[`& .${N.icon}`]:r.vars?{color:r.vars.palette.Alert[`${t}IconColor`]}:{color:r.palette[t].main}}})),...Object.entries(r.palette).filter(T(["light"])).map(([t])=>({props:{colorSeverity:t,variant:"outlined"},style:{color:r.vars?r.vars.palette.Alert[`${t}Color`]:n(r.palette[t].light,.6),border:`1px solid ${(r.vars||r).palette[t].light}`,[`& .${N.icon}`]:r.vars?{color:r.vars.palette.Alert[`${t}IconColor`]}:{color:r.palette[t].main}}})),...Object.entries(r.palette).filter(T(["dark"])).map(([t])=>({props:{colorSeverity:t,variant:"filled"},style:{fontWeight:r.typography.fontWeightMedium,...r.vars?{color:r.vars.palette.Alert[`${t}FilledColor`],backgroundColor:r.vars.palette.Alert[`${t}FilledBg`]}:{backgroundColor:r.palette.mode==="dark"?r.palette[t].dark:r.palette[t].main,color:r.palette.getContrastText(r.palette[t].main)}}}))]}})),fe=f("div",{name:"MuiAlert",slot:"Icon"})({marginRight:12,padding:"7px 0",display:"flex",fontSize:22,opacity:.9}),me=f("div",{name:"MuiAlert",slot:"Message"})({padding:"8px 0",minWidth:0,overflow:"auto"}),ve=f("div",{name:"MuiAlert",slot:"Action"})({display:"flex",alignItems:"flex-start",padding:"4px 0 0 16px",marginLeft:"auto",marginRight:-8}),P={success:l.jsx(oe,{fontSize:"inherit"}),warning:l.jsx(ce,{fontSize:"inherit"}),error:l.jsx(de,{fontSize:"inherit"}),info:l.jsx(he,{fontSize:"inherit"})},s=C.forwardRef(function(n,a){const t=W({props:n,name:"MuiAlert"}),{action:o,children:u,className:m,closeText:v="Close",color:w,components:k={},componentsProps:D={},icon:S,iconMapping:F=P,onClose:M,role:V="alert",severity:A="success",slotProps:H={},slots:X={},variant:q="standard",...K}=t,c={...t,color:w,severity:A,variant:q,colorSeverity:w||A},y=ue(c),d={slots:{closeButton:k.CloseButton,closeIcon:k.CloseIcon,...X},slotProps:{...D,...H}},[Y,Z]=h("root",{ref:a,shouldForwardComponentProp:!0,className:O(y.root,m),elementType:ge,externalForwardedProps:{...d,...K},ownerState:c,additionalProps:{role:V,elevation:0}}),[_,G]=h("icon",{className:y.icon,elementType:fe,externalForwardedProps:d,ownerState:c}),[J,Q]=h("message",{className:y.message,elementType:me,externalForwardedProps:d,ownerState:c}),[j,I]=h("action",{className:y.action,elementType:ve,externalForwardedProps:d,ownerState:c}),[ee,ne]=h("closeButton",{elementType:$,externalForwardedProps:d,ownerState:c}),[re,te]=h("closeIcon",{elementType:pe,externalForwardedProps:d,ownerState:c});return l.jsxs(Y,{...Z,children:[S!==!1?l.jsx(_,{...G,children:S||F[A]||P[A]}):null,l.jsx(J,{...Q,children:u}),o!=null?l.jsx(j,{...I,children:o}):null,o==null&&M?l.jsx(j,{...I,children:l.jsx(ee,{size:"small","aria-label":v,title:v,color:"inherit",onClick:M,...ne,children:l.jsx(re,{fontSize:"small",...te})})}):null]})});function Ae(r){return R("MuiAlertTitle",r)}U("MuiAlertTitle",["root"]);const ye=r=>{const{classes:n}=r;return L({root:["root"]},Ae,n)},xe=f(le,{name:"MuiAlertTitle",slot:"Root"})(E(({theme:r})=>({fontWeight:r.typography.fontWeightMedium,marginTop:-2}))),x=C.forwardRef(function(n,a){const t=W({props:n,name:"MuiAlertTitle"}),{className:o,...u}=t,m=t,v=ye(m);return l.jsx(xe,{gutterBottom:!0,component:"div",ownerState:m,ref:a,className:O(v.root,o),...u})}),Te=p(l.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),be=({severity:r,children:n})=>{const[a,t]=C.useState(!0);return a?e(s,{severity:r,action:e($,{"aria-label":"close",color:"inherit",size:"small",onClick:()=>t(!1),children:e(Te,{fontSize:"inherit"})}),children:n}):null};function z(r){const n={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...B(),...r.components};return i(ie,{children:[e(n.h1,{children:"Alert"}),`
2
+ `,i(n.p,{children:["The ",e(n.code,{children:"Alert"})," component displays important messages to users, such as success confirmations, error notifications, warnings, or informational messages. Material UI's Alert component provides a consistent, accessible, and customizable way to communicate feedback to users."]}),`
3
+ `,e(n.p,{children:"Alerts are used to provide contextual feedback about user actions, system status, or important information that requires user attention."}),`
4
+ `,e(n.h2,{children:"Variants"}),`
5
+ `,e(n.p,{children:"Material UI Alerts come in three variants to suit different design needs:"}),`
6
+ `,e(n.h3,{children:"Standard"}),`
7
+ `,e(n.p,{children:"The default variant with a colored background:"}),`
8
+ `,e(s,{severity:"info",children:e("span",{children:"This is an info alert — check it out!"})}),`
9
+ `,e(n.pre,{children:e(n.code,{className:"language-jsx",children:`<Alert severity="info">
10
+ <span>This is an info alert — check it out!</span>
11
+ </Alert>
12
+ `})}),`
13
+ `,e(n.h3,{children:"Filled"}),`
14
+ `,e(n.p,{children:"A variant with a solid colored background:"}),`
15
+ `,e(s,{severity:"success",variant:"filled",children:e("span",{children:"This is a filled success alert — check it out!"})}),`
16
+ `,e(n.pre,{children:e(n.code,{className:"language-jsx",children:`<Alert severity="success" variant="filled">
17
+ <span>This is a filled success alert — check it out!</span>
18
+ </Alert>
19
+ `})}),`
20
+ `,e(n.h3,{children:"Outlined"}),`
21
+ `,e(n.p,{children:"A variant with an outlined border:"}),`
22
+ `,e(s,{severity:"warning",variant:"outlined",children:e("span",{children:"This is an outlined warning alert — check it out!"})}),`
23
+ `,e(n.pre,{children:e(n.code,{className:"language-jsx",children:`<Alert severity="warning" variant="outlined">
24
+ <span>This is an outlined warning alert — check it out!</span>
25
+ </Alert>
26
+ `})}),`
27
+ `,e(n.h2,{children:"Severity Levels"}),`
28
+ `,e(n.p,{children:"Alerts support different severity levels to convey different types of messages:"}),`
29
+ `,e(n.h3,{children:"Success"}),`
30
+ `,e(n.p,{children:"Used to indicate successful operations or positive feedback:"}),`
31
+ `,i(g,{sx:{display:"flex",flexDirection:"column",gap:2},children:[e(s,{severity:"success",children:e("span",{children:"This is a success alert — check it out!"})}),e(s,{severity:"success",variant:"filled",children:e("span",{children:"This is a filled success alert — check it out!"})}),e(s,{severity:"success",variant:"outlined",children:e("span",{children:"This is an outlined success alert — check it out!"})})]}),`
32
+ `,e(n.pre,{children:e(n.code,{className:"language-jsx",children:`<Alert severity="success">
33
+ <span>This is a success alert — check it out!</span>
34
+ </Alert>
35
+ `})}),`
36
+ `,e(n.h3,{children:"Error"}),`
37
+ `,e(n.p,{children:"Used to indicate errors or problems that need attention:"}),`
38
+ `,i(g,{sx:{display:"flex",flexDirection:"column",gap:2},children:[e(s,{severity:"error",children:e("span",{children:"This is an error alert — check it out!"})}),e(s,{severity:"error",variant:"filled",children:e("span",{children:"This is a filled error alert — check it out!"})}),e(s,{severity:"error",variant:"outlined",children:e("span",{children:"This is an outlined error alert — check it out!"})})]}),`
39
+ `,e(n.pre,{children:e(n.code,{className:"language-jsx",children:`<Alert severity="error">
40
+ <span>This is an error alert — check it out!</span>
41
+ </Alert>
42
+ `})}),`
43
+ `,e(n.h3,{children:"Warning"}),`
44
+ `,e(n.p,{children:"Used to indicate warnings or cautionary information:"}),`
45
+ `,i(g,{sx:{display:"flex",flexDirection:"column",gap:2},children:[e(s,{severity:"warning",children:e("span",{children:"This is a warning alert — check it out!"})}),e(s,{severity:"warning",variant:"filled",children:e("span",{children:"This is a filled warning alert — check it out!"})}),e(s,{severity:"warning",variant:"outlined",children:e("span",{children:"This is an outlined warning alert — check it out!"})})]}),`
46
+ `,e(n.pre,{children:e(n.code,{className:"language-jsx",children:`<Alert severity="warning">
47
+ <span>This is a warning alert — check it out!</span>
48
+ </Alert>
49
+ `})}),`
50
+ `,e(n.h3,{children:"Info"}),`
51
+ `,e(n.p,{children:"Used to provide informational messages:"}),`
52
+ `,i(g,{sx:{display:"flex",flexDirection:"column",gap:2},children:[e(s,{severity:"info",children:e("span",{children:"This is an info alert — check it out!"})}),e(s,{severity:"info",variant:"filled",children:e("span",{children:"This is a filled info alert — check it out!"})}),e(s,{severity:"info",variant:"outlined",children:e("span",{children:"This is an outlined info alert — check it out!"})})]}),`
53
+ `,e(n.pre,{children:e(n.code,{className:"language-jsx",children:`<Alert severity="info">
54
+ <span>This is an info alert — check it out!</span>
55
+ </Alert>
56
+ `})}),`
57
+ `,e(n.h2,{children:"With Title"}),`
58
+ `,e(n.p,{children:"Alerts can include a title for better organization:"}),`
59
+ `,i(g,{sx:{display:"flex",flexDirection:"column",gap:2},children:[i(s,{severity:"error",children:[e(x,{children:"Error"}),e("span",{children:"This is an error alert with a title — check it out!"})]}),i(s,{severity:"warning",children:[e(x,{children:"Warning"}),e("span",{children:"This is a warning alert with a title — check it out!"})]}),i(s,{severity:"info",children:[e(x,{children:"Info"}),e("span",{children:"This is an info alert with a title — check it out!"})]}),i(s,{severity:"success",children:[e(x,{children:"Success"}),e("span",{children:"This is a success alert with a title — check it out!"})]})]}),`
60
+ `,e(n.pre,{children:e(n.code,{className:"language-jsx",children:`<Alert severity="error">
61
+ <AlertTitle>Error</AlertTitle>
62
+ <span>This is an error alert with a title — check it out!</span>
63
+ </Alert>
64
+ `})}),`
65
+ `,e(n.h2,{children:"Icons"}),`
66
+ `,e(n.h3,{children:"With Icons (Default)"}),`
67
+ `,e(n.p,{children:"By default, alerts display an icon based on their severity:"}),`
68
+ `,e(s,{severity:"success",children:e("span",{children:"This alert has an icon by default"})}),`
69
+ `,e(n.h3,{children:"Without Icons"}),`
70
+ `,e(n.p,{children:"You can hide the icon if needed:"}),`
71
+ `,e(s,{severity:"info",icon:!1,children:e("span",{children:"This alert has no icon"})}),`
72
+ `,e(n.pre,{children:e(n.code,{className:"language-jsx",children:`<Alert severity="info" icon={false}>
73
+ <span>This alert has no icon</span>
74
+ </Alert>
75
+ `})}),`
76
+ `,e(n.h2,{children:"Dismissible Alerts"}),`
77
+ `,e(n.p,{children:"Alerts can be made dismissible with a close button:"}),`
78
+ `,e(be,{severity:"info",children:e("span",{children:"This is a dismissible alert — click the X to close it!"})}),`
79
+ `,e(n.pre,{children:e(n.code,{className:"language-jsx",children:`const [open, setOpen] = useState(true);
80
+
81
+ if (!open) return null;
82
+
83
+ <Alert
84
+ severity="info"
85
+ action={
86
+ <IconButton
87
+ aria-label="close"
88
+ color="inherit"
89
+ size="small"
90
+ onClick={() => setOpen(false)}
91
+ >
92
+ <Close fontSize="inherit" />
93
+ </IconButton>
94
+ }
95
+ >
96
+ <span>This is a dismissible alert — click the X to close it!</span>
97
+ </Alert>;
98
+ `})}),`
99
+ `,e(n.h2,{children:"Common Props"}),`
100
+ `,e(n.p,{children:"The Alert component accepts various props to customize its appearance and behavior:"}),`
101
+ `,e(n.pre,{children:e(n.code,{className:"language-jsx",children:`<Alert
102
+ severity="info" // 'error' | 'info' | 'success' | 'warning'
103
+ variant="standard" // 'standard' | 'filled' | 'outlined'
104
+ icon={true} // boolean | ReactNode
105
+ onClose={handleClose} // function (makes alert dismissible)
106
+ color="info" // 'error' | 'info' | 'success' | 'warning'
107
+ action={<Button>Action</Button>} // ReactNode - custom action button
108
+ sx={{}} // object - custom styles
109
+ >
110
+ <span>Alert content</span>
111
+ </Alert>
112
+ `})}),`
113
+ `,e(n.h2,{children:"Accessibility"}),`
114
+ `,e(n.p,{children:"Material UI Alerts are built with accessibility in mind:"}),`
115
+ `,i(n.ul,{children:[`
116
+ `,i(n.li,{children:[e(n.strong,{children:"ARIA roles"}),": Proper ARIA roles and attributes for screen readers"]}),`
117
+ `,i(n.li,{children:[e(n.strong,{children:"Color contrast"}),": Meets WCAG guidelines for color contrast ratios"]}),`
118
+ `,i(n.li,{children:[e(n.strong,{children:"Icon indicators"}),": Visual and semantic indicators for different severity levels"]}),`
119
+ `,i(n.li,{children:[e(n.strong,{children:"Keyboard navigation"}),": Full keyboard support for dismissible alerts"]}),`
120
+ `,i(n.li,{children:[e(n.strong,{children:"Focus management"}),": Proper focus handling when alerts appear or disappear"]}),`
121
+ `,i(n.li,{children:[e(n.strong,{children:"Screen reader announcements"}),": Alerts are properly announced to screen readers"]}),`
122
+ `]}),`
123
+ `,e(n.h2,{children:"Best Practices"}),`
124
+ `,i(n.ol,{children:[`
125
+ `,i(n.li,{children:[e(n.strong,{children:"Use appropriate severity levels"})," - Choose the right severity (error, warning, info, success) to match the message importance"]}),`
126
+ `,i(n.li,{children:[e(n.strong,{children:"Keep messages concise"})," - Alert messages should be brief and actionable"]}),`
127
+ `,i(n.li,{children:[e(n.strong,{children:"Use titles for complex messages"})," - Add AlertTitle for longer or more structured messages"]}),`
128
+ `,i(n.li,{children:[e(n.strong,{children:"Make critical alerts dismissible"})," - Allow users to dismiss non-critical alerts"]}),`
129
+ `,i(n.li,{children:[e(n.strong,{children:"Don't overuse alerts"})," - Reserve alerts for important information that requires attention"]}),`
130
+ `,i(n.li,{children:[e(n.strong,{children:"Provide actionable content"})," - Include clear next steps when appropriate"]}),`
131
+ `,i(n.li,{children:[e(n.strong,{children:"Consider placement"})," - Position alerts where users will notice them without being intrusive"]}),`
132
+ `,i(n.li,{children:[e(n.strong,{children:"Use consistent styling"})," - Maintain consistent alert styling throughout your application"]}),`
133
+ `]}),`
134
+ `,e(n.h2,{children:"Examples"}),`
135
+ `,e(n.h3,{children:"Form Validation Error"}),`
136
+ `,e(n.pre,{children:e(n.code,{className:"language-jsx",children:`<Alert severity="error">
137
+ <AlertTitle>Validation Error</AlertTitle>
138
+ <span>Please correct the following errors:</span>
139
+ <ul>
140
+ <li>Email is required</li>
141
+ <li>Password must be at least 8 characters</li>
142
+ </ul>
143
+ </Alert>
144
+ `})}),`
145
+ `,e(n.h3,{children:"Success Confirmation"}),`
146
+ `,e(n.pre,{children:e(n.code,{className:"language-jsx",children:`<Alert severity="success" variant="filled">
147
+ <span>Your changes have been saved successfully!</span>
148
+ </Alert>
149
+ `})}),`
150
+ `,e(n.h3,{children:"Warning Message"}),`
151
+ `,e(n.pre,{children:e(n.code,{className:"language-jsx",children:`<Alert severity="warning" variant="outlined">
152
+ <AlertTitle>Warning</AlertTitle>
153
+ <span>This action cannot be undone. Are you sure you want to continue?</span>
154
+ </Alert>
155
+ `})}),`
156
+ `,e(n.h3,{children:"Info with Action"}),`
157
+ `,e(n.pre,{children:e(n.code,{className:"language-jsx",children:`<Alert
158
+ severity="info"
159
+ action={
160
+ <Button color="inherit" size="small">
161
+ Learn More
162
+ </Button>
163
+ }
164
+ >
165
+ <span>New features are available. Click to learn more!</span>
166
+ </Alert>
167
+ `})}),`
168
+ `,e(n.h3,{children:"Auto-dismissing Alert"}),`
169
+ `,e(n.pre,{children:e(n.code,{className:"language-jsx",children:`const [open, setOpen] = useState(true);
170
+
171
+ useEffect(() => {
172
+ if (open) {
173
+ const timer = setTimeout(() => {
174
+ setOpen(false);
175
+ }, 5000);
176
+ return () => clearTimeout(timer);
177
+ }
178
+ }, [open]);
179
+
180
+ {
181
+ open && (
182
+ <Alert severity="success" onClose={() => setOpen(false)}>
183
+ <span>Operation completed successfully!</span>
184
+ </Alert>
185
+ );
186
+ }
187
+ `})}),`
188
+ `,e(n.h2,{children:"Documentation"}),`
189
+ `,i(n.ul,{children:[`
190
+ `,e(n.li,{children:e(n.a,{href:"https://mui.com/material-ui/react-alert/",children:"Material UI - Alert"})}),`
191
+ `]})]})}function Me(r={}){const{wrapper:n}={...B(),...r.components};return n?e(n,{...r,children:e(z,{...r})}):z(r)}export{be as DismissibleAlert,Me as default};
@@ -0,0 +1,97 @@
1
+ import{n as a,o as e,p as t,F as c}from"./react-vendor-BVjvCnQb.js";import{B as i}from"./Button-BXcSdEL6.js";import"./prism-DjoQ0BfU.js";import"./index-C5FzG5L5.js";import"./router-d4Dt6g8h.js";function o(r){const n={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...a(),...r.components};return t(c,{children:[e(n.h1,{children:"Button"}),`
2
+ `,t(n.p,{children:["The ",e(n.code,{children:"Button"})," component is a fundamental UI element that allows users to trigger actions and events. Material UI's Button component provides a consistent, accessible, and customizable button implementation."]}),`
3
+ `,e(n.p,{children:"Buttons can be used to trigger actions, submit forms, or navigate to different pages."}),`
4
+ `,e(n.h2,{children:"Variants"}),`
5
+ `,e(n.p,{children:"Material UI buttons come in several variants to suit different use cases:"}),`
6
+ `,e(n.h3,{children:"Contained Button"}),`
7
+ `,e(n.p,{children:"The most prominent button style, used for primary actions:"}),`
8
+ `,e(i,{variant:"contained",color:"primary",children:"Primary Action"}),`
9
+ `,e(n.pre,{children:e(n.code,{className:"language-jsx",children:`<Button variant="contained" color="primary">
10
+ Primary Action
11
+ </Button>
12
+ `})}),`
13
+ `,e(n.h3,{children:"Outlined Button"}),`
14
+ `,e(n.p,{children:"Used for secondary actions or when you want a less prominent button:"}),`
15
+ `,e(i,{variant:"outlined",color:"secondary",children:"Secondary Action"}),`
16
+ `,e(n.pre,{children:e(n.code,{className:"language-jsx",children:`<Button variant="outlined" color="secondary">
17
+ Secondary Action
18
+ </Button>
19
+ `})}),`
20
+ `,e(n.h3,{children:"Text Button"}),`
21
+ `,e(n.p,{children:"The most subtle button style, often used for tertiary actions:"}),`
22
+ `,e(i,{variant:"text",color:"inherit",children:"Text Button"}),`
23
+ `,e(n.pre,{children:e(n.code,{className:"language-jsx",children:`<Button variant="text" color="inherit">
24
+ Text Button
25
+ </Button>
26
+ `})}),`
27
+ `,e(n.h2,{children:"Colors"}),`
28
+ `,e(n.p,{children:"Buttons support different color schemes:"}),`
29
+ `,e(i,{variant:"contained",color:"primary",sx:{mr:.5,mb:1},children:"Primary"}),`
30
+ `,e(i,{variant:"contained",color:"secondary",sx:{mr:.5,mb:1},children:"Secondary"}),`
31
+ `,e(i,{variant:"contained",color:"success",sx:{mr:.5,mb:1},children:"Success"}),`
32
+ `,e(i,{variant:"contained",color:"error",sx:{mb:1},children:"Error"}),`
33
+ `,e(n.h2,{children:"Sizes"}),`
34
+ `,e(n.p,{children:"Buttons come in three sizes to accommodate different design needs:"}),`
35
+ `,e(i,{size:"small",variant:"contained",sx:{mr:.5,mb:1},children:"Small"}),`
36
+ `,e(i,{size:"medium",variant:"contained",sx:{mr:.5,mb:1},children:"Medium"}),`
37
+ `,e(i,{size:"large",variant:"contained",sx:{mb:1},children:"Large"}),`
38
+ `,e(n.h2,{children:"Common Props"}),`
39
+ `,e(n.p,{children:"The Button component accepts various props to customize its appearance and behavior:"}),`
40
+ `,e(n.pre,{children:e(n.code,{className:"language-jsx",children:`<Button
41
+ variant="contained" // 'text' | 'outlined' | 'contained'
42
+ color="primary" // 'inherit' | 'primary' | 'secondary' | 'success' | 'error' | 'info' | 'warning'
43
+ size="medium" // 'small' | 'medium' | 'large'
44
+ disabled={false} // boolean
45
+ fullWidth={false} // boolean
46
+ startIcon={<Icon />} // ReactNode
47
+ endIcon={<Icon />} // ReactNode
48
+ onClick={handleClick} // function
49
+ >
50
+ Button Text
51
+ </Button>
52
+ `})}),`
53
+ `,e(n.h2,{children:"Accessibility"}),`
54
+ `,e(n.p,{children:"Material UI buttons are built with accessibility in mind:"}),`
55
+ `,t(n.ul,{children:[`
56
+ `,t(n.li,{children:[e(n.strong,{children:"Keyboard navigation"}),": Buttons can be focused and activated using the keyboard"]}),`
57
+ `,t(n.li,{children:[e(n.strong,{children:"Screen readers"}),": Proper ARIA labels and roles are automatically applied"]}),`
58
+ `,t(n.li,{children:[e(n.strong,{children:"Color contrast"}),": Meets WCAG guidelines for color contrast ratios"]}),`
59
+ `,t(n.li,{children:[e(n.strong,{children:"Focus indicators"}),": Clear visual focus indicators for keyboard users"]}),`
60
+ `]}),`
61
+ `,e(n.h2,{children:"Best Practices"}),`
62
+ `,t(n.ol,{children:[`
63
+ `,t(n.li,{children:[e(n.strong,{children:"Use clear, action-oriented text"})," that describes what the button does"]}),`
64
+ `,t(n.li,{children:[e(n.strong,{children:"Choose appropriate variants"})," - contained for primary actions, outlined for secondary"]}),`
65
+ `,t(n.li,{children:[e(n.strong,{children:"Maintain consistent sizing"})," within your interface"]}),`
66
+ `,t(n.li,{children:[e(n.strong,{children:"Provide loading states"})," for buttons that trigger async operations"]}),`
67
+ `,t(n.li,{children:[e(n.strong,{children:"Use appropriate colors"})," to convey meaning (success, error, etc.)"]}),`
68
+ `]}),`
69
+ `,e(n.h2,{children:"Examples"}),`
70
+ `,e(n.h3,{children:"Button with Icons"}),`
71
+ `,e(n.pre,{children:e(n.code,{className:"language-jsx",children:`import { Button } from '@mui/material';
72
+ import { Send, Download } from '@mui/icons-material';
73
+
74
+ <Button variant="contained" startIcon={<Send />}>
75
+ Send Message
76
+ </Button>
77
+
78
+ <Button variant="outlined" endIcon={<Download />}>
79
+ Download File
80
+ </Button>
81
+ `})}),`
82
+ `,e(n.h3,{children:"Disabled State"}),`
83
+ `,t(n.p,{children:["Use the ",e(n.code,{children:"disabled"})," attribute to specify that a button should be disabled."]}),`
84
+ `,e(n.pre,{children:e(n.code,{className:"language-jsx",children:`<Button variant="contained" disabled>
85
+ Disabled Button
86
+ </Button>
87
+ `})}),`
88
+ `,e(n.h3,{children:"Full Width Button"}),`
89
+ `,t(n.p,{children:["Use the ",e(n.code,{children:"fullWidth"})," attribute to specify that a button should be full width."]}),`
90
+ `,e(n.pre,{children:e(n.code,{className:"language-jsx",children:`<Button variant="contained" fullWidth>
91
+ Full Width Button
92
+ </Button>
93
+ `})}),`
94
+ `,e(n.h2,{children:"Documentation"}),`
95
+ `,t(n.ul,{children:[`
96
+ `,e(n.li,{children:e(n.a,{href:"https://mui.com/material-ui/react-button/",children:"Material UI - Button"})}),`
97
+ `]})]})}function m(r={}){const{wrapper:n}={...a(),...r.components};return n?e(n,{...r,children:e(o,{...r})}):o(r)}export{m as default};