2 lines
3.0 KiB
JavaScript
2 lines
3.0 KiB
JavaScript
import{r as l,u as m,j as o,c as i,ab as B,aj as D,a8 as R,a2 as M,a3 as U,P as y}from"./index-DGCPJq4z.js";import{d as V}from"./Card-D1j94NWu.js";import{F as p}from"./FormCheck-tmQhdIFS.js";import{F as W}from"./FormControl-DGdX8GC2.js";import{F as h}from"./FormContext-DDFZ16IF.js";import{F as _}from"./FormLabel-DoSLr8ng.js";const A=V("h4");A.displayName="DivStyledAsH4";const L=l.forwardRef(({className:e,bsPrefix:a,as:r=A,...s},t)=>(a=m(a,"alert-heading"),o.jsx(r,{ref:t,className:i(e,a),...s})));L.displayName="AlertHeading";const S=l.forwardRef(({className:e,bsPrefix:a,as:r=B,...s},t)=>(a=m(a,"alert-link"),o.jsx(r,{ref:t,className:i(e,a),...s})));S.displayName="AlertLink";const k=l.forwardRef((e,a)=>{const{bsPrefix:r,show:s=!0,closeLabel:t="Close alert",closeVariant:n,className:c,children:u,variant:d="primary",onClose:f,dismissible:w,transition:x=R,...v}=D(e,{show:"onClose"}),F=m(r,"alert"),G=M(I=>{f&&f(!1,I)}),N=x===!0?R:x,C=o.jsxs("div",{role:"alert",...N?void 0:v,ref:a,className:i(c,F,d&&`${F}-${d}`,w&&`${F}-dismissible`),children:[w&&o.jsx(U,{onClick:G,"aria-label":t,variant:n}),u]});return N?o.jsx(N,{unmountOnExit:!0,...v,ref:void 0,in:s,children:C}):s?C:null});k.displayName="Alert";const P=Object.assign(k,{Link:S,Heading:L}),T=l.forwardRef(({className:e,bsPrefix:a,as:r="div",...s},t)=>(a=m(a,"form-floating"),o.jsx(r,{ref:t,className:i(e,a),...s})));T.displayName="FormFloating";const j=l.forwardRef(({controlId:e,as:a="div",...r},s)=>{const t=l.useMemo(()=>({controlId:e}),[e]);return o.jsx(h.Provider,{value:t,children:o.jsx(a,{...r,ref:s})})});j.displayName="FormGroup";const $=l.forwardRef(({bsPrefix:e,className:a,id:r,...s},t)=>{const{controlId:n}=l.useContext(h);return e=m(e,"form-range"),o.jsx("input",{...s,type:"range",ref:t,className:i(a,e),id:r||n})});$.displayName="FormRange";const H=l.forwardRef(({bsPrefix:e,size:a,htmlSize:r,className:s,isValid:t=!1,isInvalid:n=!1,id:c,...u},d)=>{const{controlId:f}=l.useContext(h);return e=m(e,"form-select"),o.jsx("select",{...u,size:r,ref:d,className:i(s,e,a&&`${e}-${a}`,t&&"is-valid",n&&"is-invalid"),id:c||f})});H.displayName="FormSelect";const E=l.forwardRef(({bsPrefix:e,className:a,as:r="small",muted:s,...t},n)=>(e=m(e,"form-text"),o.jsx(r,{...t,ref:n,className:i(a,e,s&&"text-muted")})));E.displayName="FormText";const O=l.forwardRef((e,a)=>o.jsx(p,{...e,ref:a,type:"switch"}));O.displayName="Switch";const q=Object.assign(O,{Input:p.Input,Label:p.Label}),b=l.forwardRef(({bsPrefix:e,className:a,children:r,controlId:s,label:t,...n},c)=>(e=m(e,"form-floating"),o.jsxs(j,{ref:c,className:i(a,e),controlId:s,...n,children:[r,o.jsx("label",{htmlFor:s,children:t})]})));b.displayName="FloatingLabel";const z={_ref:y.any,validated:y.bool,as:y.elementType},g=l.forwardRef(({className:e,validated:a,as:r="form",...s},t)=>o.jsx(r,{...s,ref:t,className:i(e,a&&"was-validated")}));g.displayName="Form";g.propTypes=z;const ee=Object.assign(g,{Group:j,Control:W,Floating:T,Check:p,Switch:q,Label:_,Text:E,Range:$,Select:H,FloatingLabel:b});export{P as A,ee as F};
|