@fpkit/acss 3.2.1 → 3.4.0
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/libs/chunk-KAR3HDXK.js +8 -0
- package/libs/chunk-KAR3HDXK.js.map +1 -0
- package/libs/chunk-M5JARVJD.cjs +18 -0
- package/libs/chunk-M5JARVJD.cjs.map +1 -0
- package/libs/components/alert/alert.min.min.css +2 -0
- package/libs/components/badge/badge.min.min.css +2 -0
- package/libs/components/box/box.min.min.css +2 -0
- package/libs/components/breadcrumbs/breadcrumb.min.min.css +2 -0
- package/libs/components/buttons/button.min.min.css +2 -0
- package/libs/components/card.cjs +6 -6
- package/libs/components/card.js +1 -1
- package/libs/components/cards/card-style.min.min.css +2 -0
- package/libs/components/cards/card.min.min.css +2 -0
- package/libs/components/cluster/cluster.min.min.css +2 -0
- package/libs/components/details/details.min.min.css +2 -0
- package/libs/components/dialog/dialog.min.min.css +2 -0
- package/libs/components/flexbox/flex.min.min.css +2 -0
- package/libs/components/form/form.min.min.css +2 -0
- package/libs/components/grid/grid.min.min.css +2 -0
- package/libs/components/icons/icon.min.min.css +2 -0
- package/libs/components/images/img.min.min.css +2 -0
- package/libs/components/layout/landmarks.min.min.css +2 -0
- package/libs/components/link/link.min.min.css +2 -0
- package/libs/components/list/list.min.min.css +2 -0
- package/libs/components/nav/nav.min.min.css +2 -0
- package/libs/components/progress/progress.min.min.css +2 -0
- package/libs/components/stack/stack.min.min.css +2 -0
- package/libs/components/styles/index.min.min.css +2 -0
- package/libs/components/tag/tag.min.min.css +2 -0
- package/libs/components/text-to-speech/text-to-speech.min.min.css +2 -0
- package/libs/index.cjs +27 -25
- package/libs/index.cjs.map +1 -1
- package/libs/index.css +1 -1
- package/libs/index.css.map +1 -1
- package/libs/index.d.cts +275 -1
- package/libs/index.d.ts +275 -1
- package/libs/index.js +10 -10
- package/libs/index.js.map +1 -1
- package/package.json +2 -2
- package/src/components/cards/card.stories.tsx +1 -1
- package/src/components/cards/card.tsx +46 -41
- package/src/components/col/README.mdx +532 -0
- package/src/components/col/col.stories.tsx +424 -0
- package/src/components/col/col.test.tsx +321 -0
- package/src/components/col/col.tsx +105 -0
- package/src/components/col/col.types.ts +76 -0
- package/src/components/row/README.mdx +324 -0
- package/src/components/row/row.stories.tsx +595 -0
- package/src/components/row/row.test.tsx +358 -0
- package/src/components/row/row.tsx +121 -0
- package/src/components/row/row.types.ts +93 -0
- package/src/index.scss +1 -0
- package/src/index.ts +2 -0
- package/src/sass/README.mdx +597 -0
- package/src/sass/_columns.scss +198 -0
- package/src/sass/columns.stories.tsx +456 -0
- package/src/styles/index.css +340 -0
- package/src/styles/index.css.map +1 -1
- package/src/types/layout-primitives.ts +61 -0
- package/libs/chunk-OU52NIKA.js +0 -8
- package/libs/chunk-OU52NIKA.js.map +0 -1
- package/libs/chunk-WWPLBWCQ.cjs +0 -18
- package/libs/chunk-WWPLBWCQ.cjs.map +0 -1
package/libs/index.js
CHANGED
|
@@ -12,7 +12,7 @@ export { b as Breadcrumb, a as useBreadcrumbSegments } from './chunk-DIJBIOFE.js
|
|
|
12
12
|
import './chunk-GCGKYLDG.js';
|
|
13
13
|
import { b as b$1 } from './chunk-M7JLT62Q.js';
|
|
14
14
|
export { a as Icon } from './chunk-M7JLT62Q.js';
|
|
15
|
-
export { d as Card, b as CardContent, c as CardFooter, a as CardTitle } from './chunk-
|
|
15
|
+
export { d as Card, b as CardContent, c as CardFooter, a as CardTitle } from './chunk-KAR3HDXK.js';
|
|
16
16
|
export { a as Modal } from './chunk-PMWL5XZ4.js';
|
|
17
17
|
import { b } from './chunk-TF3GQKOY.js';
|
|
18
18
|
export { a as Button } from './chunk-TF3GQKOY.js';
|
|
@@ -23,22 +23,22 @@ import './chunk-75QHTLFO.js';
|
|
|
23
23
|
export { d as Link, d as To } from './chunk-IBUTNPTQ.js';
|
|
24
24
|
import { a } from './chunk-DDSXKOUB.js';
|
|
25
25
|
export { a as UI } from './chunk-DDSXKOUB.js';
|
|
26
|
-
import
|
|
26
|
+
import v, { useCallback, useMemo, useState, useEffect } from 'react';
|
|
27
27
|
|
|
28
|
-
var
|
|
28
|
+
var He={default:"",info:"Information: ",success:"Success: ",warning:"Warning: ",error:"Error: "},H=({severity:e})=>{let t=He[e];return t?v.createElement("span",{className:"sr-only"},t):null};var je=(e,t)=>({info:v.createElement(b$1.InfoSolid,{...t}),success:v.createElement(b$1.SuccessSolid,{...t}),warning:v.createElement(b$1.WarnSolid,{...t}),error:v.createElement(b$1.AlertSolid,{...t}),default:v.createElement(b$1.AlertSquareSolid,{...t})})[e],j=({severity:e,iconProps:t,hideIcon:o})=>{if(o)return null;let s=je(e,t);return v.createElement(a,{"aria-hidden":"true",className:"alert-icon"},s)};var z=({title:e,titleLevel:t})=>{if(!e)return null;let o=t?`h${t}`:"strong";return v.createElement(a,{as:o,className:"alert-title"},e)};var O=({children:e,contentType:t})=>t==="node"?v.createElement(v.Fragment,null,e):v.createElement(a,{as:"p"},e);var J=({actions:e})=>e?v.createElement(a,{as:"div",className:"alert-actions"},e):null;var Z=v.memo(({onDismiss:e,iconSize:t=16})=>v.createElement(b,{type:"button",onClick:e,"aria-label":"Close alert",className:"alert-dismiss","data-btn":"icon sm"},v.createElement(b$1,null,v.createElement(b$1.Close,{size:t})))),ee=Z;Z.displayName="DismissButton";var Oe={default:"polite",info:"polite",success:"polite",warning:"polite",error:"assertive"},B=v.forwardRef(({severity:e,variant:t,isVisible:o,dismissible:s,onDismiss:r,onInteractionStart:i,onInteractionEnd:a$1,autoFocus:l,title:c,titleLevel:x,children:y,contentType:f,actions:S,hideIcon:g,iconProps:I,...m},u)=>v.createElement(a,{as:"div",ref:u,role:"alert","aria-live":Oe[e],"aria-atomic":"true",className:`alert alert-${e}`,"data-alert":e,"data-visible":o,"data-variant":t,tabIndex:l?-1:void 0,onMouseEnter:i,onMouseLeave:a$1,onFocus:i,onBlur:a$1,...m},v.createElement(H,{severity:e}),v.createElement(j,{severity:e,iconProps:I,hideIcon:g}),v.createElement(a,{as:"div",className:"alert-message"},v.createElement(z,{title:c,titleLevel:x}),v.createElement(O,{contentType:f},y),v.createElement(J,{actions:S})),s&&v.createElement(ee,{onDismiss:r})));B.displayName="AlertView";var Je=({open:e,onDismiss:t,dismissible:o,autoHideDuration:s,pauseOnHover:r,autoFocus:i,alertRef:a})=>{let[l,c]=v.useState(e),[x,y]=v.useState(e),[f,S]=v.useState(!1),g=v.useCallback(()=>{c(!1),setTimeout(()=>{y(!1),t?.();},300);},[t]);v.useEffect(()=>{e?(y(!0),c(!0)):c(!1);},[e]),v.useEffect(()=>{if(!s||!l||f)return;let u=setTimeout(()=>{g();},s);return ()=>clearTimeout(u)},[s,l,f,g]),v.useEffect(()=>{if(!o||!l)return;let u=h=>{h.key==="Escape"&&g();};return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[o,l,g]),v.useEffect(()=>{i&&l&&a.current&&a.current.focus();},[i,l,a]);let I=v.useCallback(()=>{r&&s&&S(!0);},[r,s]),m=v.useCallback(()=>{r&&s&&S(!1);},[r,s]);return {isVisible:l,shouldRender:x,handleDismiss:g,handleInteractionStart:I,handleInteractionEnd:m}},te=({open:e,severity:t="default",children:o,title:s,dismissible:r=!1,onDismiss:i,iconSize:a,iconProps:l,hideIcon:c,autoHideDuration:x,pauseOnHover:y=!0,titleLevel:f=3,actions:S,autoFocus:g=!1,variant:I="outlined",contentType:m="text",...u})=>{let h=v.useRef(null),{isVisible:p,shouldRender:d,handleDismiss:U,handleInteractionStart:b,handleInteractionEnd:G}=Je({open:e,onDismiss:i,dismissible:r,autoHideDuration:x,pauseOnHover:y,autoFocus:g,alertRef:h});if(!d)return null;let D={size:a||16,...l};return v.createElement(B,{ref:h,severity:t,variant:I,isVisible:p,dismissible:r,onDismiss:U,onInteractionStart:b,onInteractionEnd:G,autoFocus:g,title:s,titleLevel:f,contentType:m,actions:S,hideIcon:c,iconProps:D,...u},o)};te.displayName="Alert";var oe=({src:e="//",alt:t,width:o=480,height:s,styles:r,loading:i="lazy",placeholder:a$1,fetchpriority:l="low",decoding:c="auto",srcSet:x,sizes:y,onError:f,onLoad:S,...g})=>{let I=useMemo(()=>{let p=typeof o=="number"?o:480,d=typeof s=="number"?s:Math.round(p*.75),U=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${p} ${d}">
|
|
29
29
|
<defs>
|
|
30
|
-
<linearGradient id="grad-${
|
|
30
|
+
<linearGradient id="grad-${p}-${d}" x1="0%" y1="0%" x2="100%" y2="100%">
|
|
31
31
|
<stop offset="0%" style="stop-color:#6366f1;stop-opacity:1" />
|
|
32
32
|
<stop offset="50%" style="stop-color:#8b5cf6;stop-opacity:1" />
|
|
33
33
|
<stop offset="100%" style="stop-color:#ec4899;stop-opacity:1" />
|
|
34
34
|
</linearGradient>
|
|
35
35
|
</defs>
|
|
36
|
-
<rect width="${
|
|
37
|
-
<circle cx="${
|
|
38
|
-
<path d="M0,${
|
|
39
|
-
<text x="50%" y="50%" dominant-baseline="middle" text-anchor="middle" font-family="system-ui,-apple-system,sans-serif" font-size="${Math.max(16,Math.min(
|
|
40
|
-
</svg>`;return `data:image/svg+xml,${encodeURIComponent(k)}`},[o,s]),f=l??I;return P.createElement(a,{as:"img",src:e,alt:t,width:o,height:s||"auto",loading:i,style:r,srcSet:x,sizes:g,onError:a=>{u&&u(a),a.defaultPrevented||a.currentTarget.src!==f&&(a.currentTarget.src=f);},onLoad:a=>{S?.(a);},decoding:c,...h,...p&&{fetchpriority:p}})};oe.displayName="Img";var se=e=>{let[t,o]=useState([]),[s,r]=useState(e),[i,l]=useState(!1),[p,c]=useState(!1);return useEffect(()=>{let f=()=>{let d=window.speechSynthesis.getVoices();o(d);let y=d.find(a=>a.name==="Google US English");if(y)r(y);else {let a=d.find(m=>m.lang.startsWith("en-"));a&&r(a);}};return f(),window.speechSynthesis.onvoiceschanged=f,()=>{window.speechSynthesis.onvoiceschanged=null;}},[]),{speak:(f,d={},y)=>{let a=new SpeechSynthesisUtterance(f);a.lang=d.lang??"en-US",a.pitch=d.pitch??1,a.rate=d.rate??1,a.voice=s??d.voice??null,a.onend=()=>{l(!1),c(!1),y&&y();},"speechSynthesis"in window?(window.speechSynthesis.speak(a),l(!0),c(!1)):l(!1);},pause:()=>{i&&!p&&(window.speechSynthesis.pause(),c(!0));},resume:()=>{i&&p&&(window.speechSynthesis.resume(),c(!1));},cancel:()=>{i&&(window.speechSynthesis.cancel(),l(!1),c(!1));},isSpeaking:i,isPaused:p,availableVoices:t,changeVoice:f=>{r(f);},currentVoice:s,getAvailableLanguages:()=>[...new Set(t.map(f=>f.lang))]}};var Je=({children:e,onClick:t})=>P.createElement(a,{as:"button",type:"button",className:"tts-border","data-btn":"sm text pill",onClick:t},e),U=P.memo(Je),W=({label:e,isSpeaking:t,isPaused:o,onSpeak:s,onPause:r,onResume:i,onCancel:l})=>P.createElement(a,{as:"div","data-tts":!0},e&&P.createElement("p",null,e),!t&&P.createElement(U,{"aria-label":"Speak",onClick:s},P.createElement(b$1.PlaySolid,{size:16})),t&&!o&&P.createElement(U,{"aria-label":"Pause",onClick:r},P.createElement(b$1.PauseSolid,{size:16})),o&&P.createElement(U,{"aria-label":"Resume",onClick:i},P.createElement(b$1.ResumeSolid,{size:16})),P.createElement(U,{"aria-label":"Stop",onClick:l},P.createElement(b$1.StopSolid,{size:16})));W.displayName="TextToSpeechControls";W.TTSButton=U;var re=W;var ne=({initialText:e="",showTextInput:t=!1,voice:o,pitch:s=1,rate:r=1,label:i,onEnd:l})=>{let{speak:p,pause:c,resume:x,cancel:g,isSpeaking:u,isPaused:S}=se(),[h,I]=useState(e);useEffect(()=>{I(e);},[e]);let f=()=>{h.trim()!==""&&p(h,{voice:o,pitch:s,rate:r},y);},d=a=>{I(a.target.value);},y=()=>{l&&l();};return P.createElement(P.Fragment,null,t&&P.createElement(b$2,{value:h,onChange:d}),P.createElement(re,{label:i,isSpeaking:u,isPaused:S,onSpeak:f,onPause:c,onResume:x,onCancel:g}))};ne.displayName="TextToSpeechComponent";var $=e=>P.createElement(P.Fragment,null,e),Xe=({id:e,children:t,headerBackground:o,styles:s,classes:r,...i})=>P.createElement(a,{as:"header",id:e,styles:s,className:r,...i},o,P.createElement(a,{as:"section"},t)),qe=({id:e,children:t,styles:o,classes:s,...r})=>P.createElement(a,{as:"main",id:e,styles:o,...r,className:s},t),Qe=({id:e,classes:t,children:o,styles:s={},...r})=>P.createElement(a,{as:"footer",id:e,className:t,styles:s,...r},P.createElement(a,{as:"section"},o||"Copyright \xA9 2022")),Ye=({id:e,children:t,styles:o={},classes:s,...r})=>P.createElement(a,{as:"aside",id:e,styles:o,className:s,...r},P.createElement(a,{as:"section"},t)),Ze=({id:e,children:t,styles:o,classes:s,...r})=>P.createElement(a,{as:"section",id:e,styles:o,className:s,...r},t),et=({id:e,children:t,styles:o,classes:s,...r})=>P.createElement(a,{as:"article",id:e,styles:o,className:s,...r},t);$.displayName="Landmarks";$.Header=Xe;$.Main=qe;$.Footer=Qe;$.Aside=Ye;$.Section=Ze;$.Article=et;var ae=P.forwardRef(({padding:e,paddingInline:t,paddingBlock:o,margin:s,marginInline:r,marginBlock:i,width:l,maxWidth:p,radius:c,as:x="div",className:g,classes:u,children:S,...h},I)=>{let f=[];e&&f.push(`box-padding-${e}`),t&&f.push(`box-padding-inline-${t}`),o&&f.push(`box-padding-block-${o}`),s&&f.push(`box-margin-${s}`),r&&f.push(`box-margin-inline-${r}`),i&&f.push(`box-margin-block-${i}`),l&&f.push(`box-width-${l}`),p&&f.push(`box-max-width-${p}`),c&&f.push(`box-radius-${c}`);let d=[...f,g,u].filter(Boolean).join(" ");return P.createElement(a,{as:x,ref:I,classes:d||void 0,...h},S)});ae.displayName="Box";var pe=P.forwardRef(({gap:e,direction:t="vertical",align:o,justify:s,wrap:r,as:i="div",className:l,classes:p,children:c,...x},g)=>{let u=["stack"];t==="horizontal"?u.push("stack-horizontal"):u.push("stack-vertical"),e&&u.push(`stack-gap-${e}`),o&&u.push(`stack-align-${o}`),s&&u.push(`stack-justify-${s}`),r&&u.push(`stack-${r}`);let S=[...u,l,p].filter(Boolean).join(" ");return P.createElement(a,{as:i,ref:g,classes:S,...x},c)});pe.displayName="Stack";var fe=P.forwardRef(({gap:e,justify:t,align:o,as:s="div",className:r,classes:i,children:l,...p},c)=>{let x=["cluster"];e&&x.push(`cluster-gap-${e}`),t&&x.push(`cluster-justify-${t}`),o&&x.push(`cluster-align-${o}`);let g=[...x,r,i].filter(Boolean).join(" ");return P.createElement(a,{as:s,ref:c,classes:g,...p},l)});fe.displayName="Cluster";var me=P.forwardRef(({columns:e,auto:t,minColumnWidth:o,gap:s,gapX:r,gapY:i,justifyItems:l,alignItems:p,as:c="div",className:x,classes:g,children:u,style:S,styles:h,...I},f)=>{let d=["grid"];e&&d.push(`grid-cols-${e}`),t&&d.push(`grid-auto-${t}`),s&&d.push(`grid-gap-${s}`),r&&d.push(`grid-gap-x-${r}`),i&&d.push(`grid-gap-y-${i}`),l&&d.push(`grid-justify-items-${l}`),p&&d.push(`grid-align-items-${p}`);let y=[...d,x,g].filter(Boolean).join(" "),a$1={...S||{},...h||{}};return t&&o&&(a$1.gridTemplateColumns=`repeat(auto-${t}, minmax(${o}, 1fr))`),P.createElement(a,{as:c,ref:f,classes:y,style:Object.keys(a$1).length>0?a$1:void 0,...I},u)});me.displayName="Grid";var K=P.forwardRef(({span:e,rowSpan:t,as:o="div",className:s,classes:r,children:i,...l},p)=>{let c=[];e&&c.push(`grid-col-span-${e}`),t&&c.push(`grid-row-span-${t}`);let x=[...c,s,r].filter(Boolean).join(" ");return P.createElement(a,{as:o,ref:p,classes:x,...l},i)});K.displayName="GridItem";var de=me;de.Item=K;var tt=de;var A=(e,t="")=>{let o=[];if(e.direction){let s={row:"flex-row","row-reverse":"flex-row-reverse",column:"flex-col","column-reverse":"flex-col-reverse"};o.push(`${t}${s[e.direction]}`);}if(e.wrap){let s={wrap:"flex-wrap",nowrap:"flex-nowrap","wrap-reverse":"flex-wrap-reverse"};o.push(`${t}${s[e.wrap]}`);}if(e.gap&&o.push(`${t}gap-${e.gap}`),e.rowGap&&o.push(`${t}row-gap-${e.rowGap}`),e.colGap&&o.push(`${t}col-gap-${e.colGap}`),e.justify){let s={start:"justify-start",end:"justify-end",center:"justify-center",between:"justify-between",around:"justify-around",evenly:"justify-evenly"};o.push(`${t}${s[e.justify]}`);}if(e.align){let s={start:"items-start",end:"items-end",center:"items-center",baseline:"items-baseline",stretch:"items-stretch"};o.push(`${t}${s[e.align]}`);}if(e.alignContent){let s={start:"content-start",end:"content-end",center:"content-center",between:"content-between",around:"content-around",evenly:"content-evenly",stretch:"content-stretch"};o.push(`${t}${s[e.alignContent]}`);}return o},ue=P.forwardRef((e,t)=>{let{variant:o,inline:s=!1,as:r="div",className:i="",styles:l,children:p,sm:c,md:x,lg:g,xl:u,direction:S,wrap:h,gap:I,rowGap:f,colGap:d,justify:y,align:a$1,alignContent:m,...k}=e,C=[];if(C.push(s?"flex-inline":"flex"),o){let D={center:"flex-center",between:"flex-between",around:"flex-around",stack:"flex-stack",spread:"flex-spread"};C.push(D[o]);}C.push(...A({direction:S,wrap:h,gap:I,rowGap:f,colGap:d,justify:y,align:a$1,alignContent:m})),c&&C.push(...A(c,"sm:")),x&&C.push(...A(x,"md:")),g&&C.push(...A(g,"lg:")),u&&C.push(...A(u,"xl:"));let G=[...C,i].filter(Boolean).join(" ");return P.createElement(a,{as:r,ref:t,classes:G,styles:l,...k},p)});ue.displayName="Flex";var xe=P.forwardRef((e,t)=>{let{grow:o,shrink:s,basis:r,flex:i,alignSelf:l,order:p,as:c="div",className:x="",styles:g,children:u,sm:S,md:h,lg:I,xl:f,...d}=e,y=[];if(i){let m={1:"flex-1",auto:"flex-auto",initial:"flex-initial",none:"flex-none"};y.push(m[i]);}if(o!==void 0&&y.push(`flex-grow-${o}`),s!==void 0&&y.push(`flex-shrink-${s}`),r){let m={auto:"flex-basis-auto",0:"flex-basis-0",full:"flex-basis-full"};y.push(m[r]);}if(l){let m={auto:"self-auto",start:"self-start",end:"self-end",center:"self-center",baseline:"self-baseline",stretch:"self-stretch"};y.push(m[l]);}if(p){let m={first:"order-first",last:"order-last",none:"order-none"};y.push(m[p]);}if(S?.flex){let m={1:"flex-1",auto:"flex-auto",none:"flex-none"};y.push(`sm:${m[S.flex]}`);}if(h?.flex){let m={1:"flex-1",auto:"flex-auto",none:"flex-none"};y.push(`md:${m[h.flex]}`);}if(I?.flex){let m={1:"flex-1",auto:"flex-auto",none:"flex-none"};y.push(`lg:${m[I.flex]}`);}if(f?.flex){let m={1:"flex-1",auto:"flex-auto",none:"flex-none"};y.push(`xl:${m[f.flex]}`);}let a$1=[...y,x].filter(Boolean).join(" ");return P.createElement(a,{as:c,ref:t,classes:a$1,styles:g,...d},u)});xe.displayName="Flex.Item";var ye=P.forwardRef((e,t)=>{let{as:o="div",className:s="",styles:r,...i}=e,l=["flex-1",s].filter(Boolean).join(" ");return P.createElement(a,{as:o,ref:t,classes:l,styles:r,...i})});ye.displayName="Flex.Spacer";var X=ue;X.Item=xe;X.Spacer=ye;var ot=X;var ge=({id:e,styles:t,classes:o,children:s,variant:r,...i})=>P.createElement(a,{as:"sup",id:e,styles:t,className:o,"data-badge":r||void 0,role:"status",...i},P.createElement(a,{as:"span"},s));ge.displayName="Badge";var rt=({elm:e="span",role:t="note",variant:o,children:s,styles:r,...i})=>P.createElement(a,{as:e,role:t,"data-tag":o||void 0,styles:r,...i},s);rt.displayName="Tag";var nt=P.forwardRef(({summary:e,icon:t,styles:o,classes:s,ariaLabel:r,name:i,open:l,onPointerDown:p,onToggle:c,children:x,...g},u)=>{let S=useCallback(I=>{p?.(I);},[p]),h=useCallback(I=>{c?.(I);},[c]);return P.createElement(a,{as:"details",styles:o,classes:s,onToggle:h,ref:u,open:l,"aria-label":r,name:i,...g},P.createElement(a,{as:"summary",onPointerDown:S},t,e),P.createElement(a,{as:"section"},x))});nt.displayName="Details";
|
|
36
|
+
<rect width="${p}" height="${d}" fill="url(#grad-${p}-${d})"/>
|
|
37
|
+
<circle cx="${p*.15}" cy="${d*.2}" r="${Math.min(p,d)*.08}" fill="rgba(255,255,255,0.2)"/>
|
|
38
|
+
<path d="M0,${d*.75} Q${p*.25},${d*.65} ${p*.5},${d*.75} T${p},${d*.75} L${p},${d} L0,${d} Z" fill="rgba(0,0,0,0.15)"/>
|
|
39
|
+
<text x="50%" y="50%" dominant-baseline="middle" text-anchor="middle" font-family="system-ui,-apple-system,sans-serif" font-size="${Math.max(16,Math.min(p,d)*.05)}" font-weight="500" fill="rgba(255,255,255,0.9)">${p}\xD7${d}</text>
|
|
40
|
+
</svg>`;return `data:image/svg+xml,${encodeURIComponent(U)}`},[o,s]),m=a$1??I;return v.createElement(a,{as:"img",src:e,alt:t,width:o,height:s||"auto",loading:i,style:r,srcSet:x,sizes:y,onError:p=>{f&&f(p),p.defaultPrevented||p.currentTarget.src!==m&&(p.currentTarget.src=m);},onLoad:p=>{S?.(p);},decoding:c,...g,...l&&{fetchpriority:l}})};oe.displayName="Img";var se=e=>{let[t,o]=useState([]),[s,r]=useState(e),[i,a]=useState(!1),[l,c]=useState(!1);return useEffect(()=>{let m=()=>{let u=window.speechSynthesis.getVoices();o(u);let h=u.find(p=>p.name==="Google US English");if(h)r(h);else {let p=u.find(d=>d.lang.startsWith("en-"));p&&r(p);}};return m(),window.speechSynthesis.onvoiceschanged=m,()=>{window.speechSynthesis.onvoiceschanged=null;}},[]),{speak:(m,u={},h)=>{let p=new SpeechSynthesisUtterance(m);p.lang=u.lang??"en-US",p.pitch=u.pitch??1,p.rate=u.rate??1,p.voice=s??u.voice??null,p.onend=()=>{a(!1),c(!1),h&&h();},"speechSynthesis"in window?(window.speechSynthesis.speak(p),a(!0),c(!1)):a(!1);},pause:()=>{i&&!l&&(window.speechSynthesis.pause(),c(!0));},resume:()=>{i&&l&&(window.speechSynthesis.resume(),c(!1));},cancel:()=>{i&&(window.speechSynthesis.cancel(),a(!1),c(!1));},isSpeaking:i,isPaused:l,availableVoices:t,changeVoice:m=>{r(m);},currentVoice:s,getAvailableLanguages:()=>[...new Set(t.map(m=>m.lang))]}};var qe=({children:e,onClick:t})=>v.createElement(a,{as:"button",type:"button",className:"tts-border","data-btn":"sm text pill",onClick:t},e),k=v.memo(qe),W=({label:e,isSpeaking:t,isPaused:o,onSpeak:s,onPause:r,onResume:i,onCancel:a$1})=>v.createElement(a,{as:"div","data-tts":!0},e&&v.createElement("p",null,e),!t&&v.createElement(k,{"aria-label":"Speak",onClick:s},v.createElement(b$1.PlaySolid,{size:16})),t&&!o&&v.createElement(k,{"aria-label":"Pause",onClick:r},v.createElement(b$1.PauseSolid,{size:16})),o&&v.createElement(k,{"aria-label":"Resume",onClick:i},v.createElement(b$1.ResumeSolid,{size:16})),v.createElement(k,{"aria-label":"Stop",onClick:a$1},v.createElement(b$1.StopSolid,{size:16})));W.displayName="TextToSpeechControls";W.TTSButton=k;var re=W;var ne=({initialText:e="",showTextInput:t=!1,voice:o,pitch:s=1,rate:r=1,label:i,onEnd:a})=>{let{speak:l,pause:c,resume:x,cancel:y,isSpeaking:f,isPaused:S}=se(),[g,I]=useState(e);useEffect(()=>{I(e);},[e]);let m=()=>{g.trim()!==""&&l(g,{voice:o,pitch:s,rate:r},h);},u=p=>{I(p.target.value);},h=()=>{a&&a();};return v.createElement(v.Fragment,null,t&&v.createElement(b$2,{value:g,onChange:u}),v.createElement(re,{label:i,isSpeaking:f,isPaused:S,onSpeak:m,onPause:c,onResume:x,onCancel:y}))};ne.displayName="TextToSpeechComponent";var $=e=>v.createElement(v.Fragment,null,e),Ze=({id:e,children:t,headerBackground:o,styles:s,classes:r,...i})=>v.createElement(a,{as:"header",id:e,styles:s,className:r,...i},o,v.createElement(a,{as:"section"},t)),et=({id:e,children:t,styles:o,classes:s,...r})=>v.createElement(a,{as:"main",id:e,styles:o,...r,className:s},t),tt=({id:e,classes:t,children:o,styles:s={},...r})=>v.createElement(a,{as:"footer",id:e,className:t,styles:s,...r},v.createElement(a,{as:"section"},o||"Copyright \xA9 2022")),ot=({id:e,children:t,styles:o={},classes:s,...r})=>v.createElement(a,{as:"aside",id:e,styles:o,className:s,...r},v.createElement(a,{as:"section"},t)),st=({id:e,children:t,styles:o,classes:s,...r})=>v.createElement(a,{as:"section",id:e,styles:o,className:s,...r},t),rt=({id:e,children:t,styles:o,classes:s,...r})=>v.createElement(a,{as:"article",id:e,styles:o,className:s,...r},t);$.displayName="Landmarks";$.Header=Ze;$.Main=et;$.Footer=tt;$.Aside=ot;$.Section=st;$.Article=rt;var ae=v.forwardRef(({padding:e,paddingInline:t,paddingBlock:o,margin:s,marginInline:r,marginBlock:i,width:a$1,maxWidth:l,radius:c,as:x="div",className:y,classes:f,children:S,...g},I)=>{let m=[];e&&m.push(`box-padding-${e}`),t&&m.push(`box-padding-inline-${t}`),o&&m.push(`box-padding-block-${o}`),s&&m.push(`box-margin-${s}`),r&&m.push(`box-margin-inline-${r}`),i&&m.push(`box-margin-block-${i}`),a$1&&m.push(`box-width-${a$1}`),l&&m.push(`box-max-width-${l}`),c&&m.push(`box-radius-${c}`);let u=[...m,y,f].filter(Boolean).join(" ");return v.createElement(a,{as:x,ref:I,classes:u||void 0,...g},S)});ae.displayName="Box";var pe=v.forwardRef(({gap:e,direction:t="vertical",align:o,justify:s,wrap:r,as:i="div",className:a$1,classes:l,children:c,...x},y)=>{let f=["stack"];t==="horizontal"?f.push("stack-horizontal"):f.push("stack-vertical"),e&&f.push(`stack-gap-${e}`),o&&f.push(`stack-align-${o}`),s&&f.push(`stack-justify-${s}`),r&&f.push(`stack-${r}`);let S=[...f,a$1,l].filter(Boolean).join(" ");return v.createElement(a,{as:i,ref:y,classes:S,...x},c)});pe.displayName="Stack";var fe=v.forwardRef(({gap:e,justify:t,align:o,as:s="div",className:r,classes:i,children:a$1,...l},c)=>{let x=["cluster"];e&&x.push(`cluster-gap-${e}`),t&&x.push(`cluster-justify-${t}`),o&&x.push(`cluster-align-${o}`);let y=[...x,r,i].filter(Boolean).join(" ");return v.createElement(a,{as:s,ref:c,classes:y,...l},a$1)});fe.displayName="Cluster";var me=v.forwardRef(({columns:e,auto:t,minColumnWidth:o,gap:s,gapX:r,gapY:i,justifyItems:a$1,alignItems:l,as:c="div",className:x,classes:y,children:f,style:S,styles:g,...I},m)=>{let u=["grid"];e&&u.push(`grid-cols-${e}`),t&&u.push(`grid-auto-${t}`),s&&u.push(`grid-gap-${s}`),r&&u.push(`grid-gap-x-${r}`),i&&u.push(`grid-gap-y-${i}`),a$1&&u.push(`grid-justify-items-${a$1}`),l&&u.push(`grid-align-items-${l}`);let h=[...u,x,y].filter(Boolean).join(" "),p={...S||{},...g||{}};return t&&o&&(p.gridTemplateColumns=`repeat(auto-${t}, minmax(${o}, 1fr))`),v.createElement(a,{as:c,ref:m,classes:h,style:Object.keys(p).length>0?p:void 0,...I},f)});me.displayName="Grid";var K=v.forwardRef(({span:e,rowSpan:t,as:o="div",className:s,classes:r,children:i,...a$1},l)=>{let c=[];e&&c.push(`grid-col-span-${e}`),t&&c.push(`grid-row-span-${t}`);let x=[...c,s,r].filter(Boolean).join(" ");return v.createElement(a,{as:o,ref:l,classes:x,...a$1},i)});K.displayName="GridItem";var de=me;de.Item=K;var nt=de;var xe=v.forwardRef(({gap:e,justify:t,align:o,wrap:s,alwaysProportional:r=!1,as:i="div",className:a$1,classes:l,children:c,...x},y)=>{let f=["col-row"];e&&f.push(`col-row-gap-${e}`),t&&f.push(`col-row-justify-${t}`),o&&f.push(`col-row-align-${o}`),s&&s!=="wrap"&&f.push(`col-row-${s}`),r&&f.push("col-row-proportional");let S=[...f,a$1,l].filter(Boolean).join(" ");return v.createElement(a,{as:i,ref:y,classes:S,...x},c)});xe.displayName="Row";var he=v.forwardRef(({span:e,offset:t,order:o,auto:s=!1,as:r="div",className:i,classes:a$1,children:l,...c},x)=>{let y=[];s?y.push("col-auto"):e&&y.push(`col-${e}`),t!==void 0&&y.push(`col-offset-${t}`),o!==void 0&&y.push(`col-order-${o}`);let f=[...y,i,a$1].filter(Boolean).join(" ");return v.createElement(a,{as:r,ref:x,classes:f,...c},l)});he.displayName="Col";var A=(e,t="")=>{let o=[];if(e.direction){let s={row:"flex-row","row-reverse":"flex-row-reverse",column:"flex-col","column-reverse":"flex-col-reverse"};o.push(`${t}${s[e.direction]}`);}if(e.wrap){let s={wrap:"flex-wrap",nowrap:"flex-nowrap","wrap-reverse":"flex-wrap-reverse"};o.push(`${t}${s[e.wrap]}`);}if(e.gap&&o.push(`${t}gap-${e.gap}`),e.rowGap&&o.push(`${t}row-gap-${e.rowGap}`),e.colGap&&o.push(`${t}col-gap-${e.colGap}`),e.justify){let s={start:"justify-start",end:"justify-end",center:"justify-center",between:"justify-between",around:"justify-around",evenly:"justify-evenly"};o.push(`${t}${s[e.justify]}`);}if(e.align){let s={start:"items-start",end:"items-end",center:"items-center",baseline:"items-baseline",stretch:"items-stretch"};o.push(`${t}${s[e.align]}`);}if(e.alignContent){let s={start:"content-start",end:"content-end",center:"content-center",between:"content-between",around:"content-around",evenly:"content-evenly",stretch:"content-stretch"};o.push(`${t}${s[e.alignContent]}`);}return o},ge=v.forwardRef((e,t)=>{let{variant:o,inline:s=!1,as:r="div",className:i="",styles:a$1,children:l,sm:c,md:x,lg:y,xl:f,direction:S,wrap:g,gap:I,rowGap:m,colGap:u,justify:h,align:p,alignContent:d,...U}=e,b=[];if(b.push(s?"flex-inline":"flex"),o){let D={center:"flex-center",between:"flex-between",around:"flex-around",stack:"flex-stack",spread:"flex-spread"};b.push(D[o]);}b.push(...A({direction:S,wrap:g,gap:I,rowGap:m,colGap:u,justify:h,align:p,alignContent:d})),c&&b.push(...A(c,"sm:")),x&&b.push(...A(x,"md:")),y&&b.push(...A(y,"lg:")),f&&b.push(...A(f,"xl:"));let G=[...b,i].filter(Boolean).join(" ");return v.createElement(a,{as:r,ref:t,classes:G,styles:a$1,...U},l)});ge.displayName="Flex";var Se=v.forwardRef((e,t)=>{let{grow:o,shrink:s,basis:r,flex:i,alignSelf:a$1,order:l,as:c="div",className:x="",styles:y,children:f,sm:S,md:g,lg:I,xl:m,...u}=e,h=[];if(i){let d={1:"flex-1",auto:"flex-auto",initial:"flex-initial",none:"flex-none"};h.push(d[i]);}if(o!==void 0&&h.push(`flex-grow-${o}`),s!==void 0&&h.push(`flex-shrink-${s}`),r){let d={auto:"flex-basis-auto",0:"flex-basis-0",full:"flex-basis-full"};h.push(d[r]);}if(a$1){let d={auto:"self-auto",start:"self-start",end:"self-end",center:"self-center",baseline:"self-baseline",stretch:"self-stretch"};h.push(d[a$1]);}if(l){let d={first:"order-first",last:"order-last",none:"order-none"};h.push(d[l]);}if(S?.flex){let d={1:"flex-1",auto:"flex-auto",none:"flex-none"};h.push(`sm:${d[S.flex]}`);}if(g?.flex){let d={1:"flex-1",auto:"flex-auto",none:"flex-none"};h.push(`md:${d[g.flex]}`);}if(I?.flex){let d={1:"flex-1",auto:"flex-auto",none:"flex-none"};h.push(`lg:${d[I.flex]}`);}if(m?.flex){let d={1:"flex-1",auto:"flex-auto",none:"flex-none"};h.push(`xl:${d[m.flex]}`);}let p=[...h,x].filter(Boolean).join(" ");return v.createElement(a,{as:c,ref:t,classes:p,styles:y,...u},f)});Se.displayName="Flex.Item";var Ie=v.forwardRef((e,t)=>{let{as:o="div",className:s="",styles:r,...i}=e,a$1=["flex-1",s].filter(Boolean).join(" ");return v.createElement(a,{as:o,ref:t,classes:a$1,styles:r,...i})});Ie.displayName="Flex.Spacer";var X=ge;X.Item=Se;X.Spacer=Ie;var it=X;var ve=({id:e,styles:t,classes:o,children:s,variant:r,...i})=>v.createElement(a,{as:"sup",id:e,styles:t,className:o,"data-badge":r||void 0,role:"status",...i},v.createElement(a,{as:"span"},s));ve.displayName="Badge";var lt=({elm:e="span",role:t="note",variant:o,children:s,styles:r,...i})=>v.createElement(a,{as:e,role:t,"data-tag":o||void 0,styles:r,...i},s);lt.displayName="Tag";var pt=v.forwardRef(({summary:e,icon:t,styles:o,classes:s,ariaLabel:r,name:i,open:a$1,onPointerDown:l,onToggle:c,children:x,...y},f)=>{let S=useCallback(I=>{l?.(I);},[l]),g=useCallback(I=>{c?.(I);},[c]);return v.createElement(a,{as:"details",styles:o,classes:s,onToggle:g,ref:f,open:a$1,"aria-label":r,name:i,...y},v.createElement(a,{as:"summary",onPointerDown:S},t,e),v.createElement(a,{as:"section"},x))});pt.displayName="Details";
|
|
41
41
|
|
|
42
|
-
export { te as Alert,
|
|
42
|
+
export { te as Alert, rt as Article, ot as Aside, ve as Badge, ae as Box, fe as Cluster, he as Col, pt as Details, it as Flex, tt as Footer, nt as Grid, K as GridItem, Ze as Header, oe as Img, $ as Landmarks, et as Main, xe as Row, st as Section, pe as Stack, lt as Tag, ne as TextToSpeech };
|
|
43
43
|
//# sourceMappingURL=out.js.map
|
|
44
44
|
//# sourceMappingURL=index.js.map
|