hypnagaga/packages/graphics-components/docs/assets/InfoBox.stories-4cOKgJf0.js

46 lines
9.3 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{p as u,f as o,a,c as L}from"./props-b4vEeO_8.js";import{J as H,C as w,F as f,I as c,k as U,N as Y,B as J,G as K}from"./runtime-C3rQLW--.js";import{i as Q}from"./lifecycle-F2p_Qkk3.js";import{c as X,d as Z}from"./create-runtime-stories-7AWWVphH.js";import{s as I}from"./snippet-C5kbqVpq.js";import{i as g}from"./svelte-component-C8Ginrj8.js";import{a as $}from"./attributes-Cg6aLqN3.js";import{B as ee}from"./Block-D3Ui8rd-.js";import{M as R}from"./Markdown-DUxFwijc.js";import{B as P}from"./BodyText-CXnxLnBi.js";var te=o('<div class="header fmb-2"><!></div>'),re=o('<div class="header fmb-2"><!></div>'),ae=o('<div class="body"><!></div>'),oe=o('<div class="body"><!></div>'),se=o('<div class="footer fmt-2"><!></div>'),ne=o('<div class="footer fmt-2"><!></div>'),ie=o("<!> <!> <!>",1),de=o("<aside><!></aside>");function x(q,r){let p=u(r,"title",3,null),h=u(r,"notes",3,null),_=u(r,"width",3,"normal"),B=u(r,"class",3,""),v=u(r,"id",3,""),C=u(r,"theme",3,"light");var d=de(),m=c(d);ee(m,{get width(){return _()},get id(){return v()},get class(){return`${B()??""} fmy-6 fpx-6 fpy-5 border border-solid rounded`},children:(y,n)=>{var i=ie(),O=w(i);{var M=e=>{var t=te(),s=c(t);I(s,()=>r.header),a(e,t)},N=e=>{var t=L(),s=w(t);{var b=l=>{var k=re(),S=c(k);R(S,{get source(){return p()}}),a(l,k)};g(s,l=>{p()&&l(b)},!0)}a(e,t)};g(O,e=>{r.header?e(M):e(N,!1)})}var D=f(O,2);{var W=e=>{var t=ae(),s=c(t);I(s,()=>r.body),a(e,t)},z=e=>{var t=oe(),s=c(t);{let b=Y(()=>r.text||"");R(s,{get source(){return U(b)}})}a(e,t)};g(D,e=>{r.body?e(W):e(z,!1)})}var E=f(D,2);{var F=e=>{var t=se(),s=c(t);I(s,()=>r.footer),a(e,t)},G=e=>{var t=L(),s=w(t);{var b=l=>{var k=ne(),S=c(k);R(S,{get source(){return h()}}),a(l,k)};g(s,l=>{h()&&l(b)},!0)}a(e,t)};g(E,e=>{r.footer?e(F):e(G,!1)})}a(y,i)},$$slots:{default:!0}}),H(()=>$(d,1,`infobox ${C()??""}`,"svelte-l47an2")),a(q,d)}x.__docgen={data:[{name:"title",visibility:"public",description:"Title of the box",keywords:[],kind:"let",type:{kind:"type",type:"string",text:"string"},static:!1,readonly:!1,defaultValue:"null"},{name:"text",visibility:"public",description:"Contents of the note as a markdown string",keywords:[],kind:"let",type:{kind:"type",type:"string",text:"string"},static:!1,readonly:!1},{name:"notes",visibility:"public",description:"Additional footnotes",keywords:[],kind:"let",type:{kind:"type",type:"string",text:"string"},static:!1,readonly:!1,defaultValue:"null"},{name:"width",visibility:"public",description:"Width of the component within the text well.",keywords:[],kind:"let",type:{kind:"union",type:[{kind:"const",type:"string",value:"narrower",text:'"narrower"'},{kind:"const",type:"string",value:"narrow",text:'"narrow"'},{kind:"const",type:"string",value:"normal",text:'"normal"'},{kind:"const",type:"string",value:"wide",text:'"wide"'},{kind:"const",type:"string",value:"wider",text:'"wider"'},{kind:"const",type:"string",value:"widest",text:'"widest"'},{kind:"const",type:"string",value:"fluid",text:'"fluid"'}],text:'"narrower" | "narrow" | "normal" | "wide" | "wider" | "widest" | "fluid"'},static:!1,readonly:!1,defaultValue:'"normal"'},{name:"class",visibility:"public",description:"Add extra classes to the block tag to target it with custom CSS.",keywords:[],kind:"let",type:{kind:"type",type:"string",text:"string"},static:!1,readonly:!1},{name:"id",visibility:"public",description:"Add an id to the block tag to target it with custom CSS.",keywords:[],kind:"let",type:{kind:"type",type:"string",text:"string"},static:!1,readonly:!1,defaultValue:'""'},{name:"theme",visibility:"public",description:"Page theme",keywords:[],kind:"let",type:{kind:"union",type:[{kind:"const",type:"string",value:"light",text:'"light"'},{kind:"const",type:"string",value:"dark",text:'"dark"'}],text:'"light" | "dark"'},static:!1,readonly:!1,defaultValue:'"light"'},{name:"header",visibility:"public",description:"Optional custom header snippet",keywords:[],kind:"let",type:{kind:"function",text:"Snippet<[]>"},static:!1,readonly:!1},{name:"body",visibility:"public",description:"Optional custom body snippet",keywords:[],kind:"let",type:{kind:"function",text:"Snippet<[]>"},static:!1,readonly:!1},{name:"footer",visibility:"public",description:"Optional custom footer snippet",keywords:[],kind:"let",type:{kind:"function",text:"Snippet<[]>"},static:!1,readonly:!1}],name:"InfoBox.svelte"};const V={title:"Components/Text elements/InfoBox",component:x,tags:["autodocs"],argTypes:{theme:{control:"select",options:["light","dark"]},width:{control:"select",options:["normal","wide","wider","widest","fluid"]}}},{Story:T}=Z();var le=o("<!> <!> <!>",1),ce=o('<h3 class="svelte-1kq9q1w">Global video game market</h3>'),ue=o('<table class="svelte-1kq9q1w"><thead><tr><th class="svelte-1kq9q1w">Year</th><th class="svelte-1kq9q1w">Market size ($bln)</th></tr></thead><tbody><tr><td class="svelte-1kq9q1w">2024</td><td class="svelte-1kq9q1w">274.63</td></tr><tr><td class="svelte-1kq9q1w">2023</td><td class="svelte-1kq9q1w">281.77</td></tr><tr><td class="svelte-1kq9q1w">2022</td><td class="svelte-1kq9q1w">249.55</td></tr></tbody></table>'),fe=o('<div class="text-xs font-note">Source: Precedence Research</div>'),pe=o("<!> <!> <!>",1);function A(q,r){J(r,!1),Q();var p=pe(),h=w(p);T(h,{name:"Demo",children:(v,C)=>{var d=le(),m=w(d);P(m,{text:"Bacon ipsum dolor amet turducken buffalo beef ribs bresaola pancetta ribeye pork belly doner hamburger biltong cupim porchetta chuck ham tenderloin. Turducken bresaola jerky chicken."});var y=f(m,2);x(y,{title:"About this data",text:`Reuters is collecting daily COVID-19 infections and deaths data for 240 countries and territories around the world, updated regularly throughout each day.
Every country reports those figures a little differently and, inevitably, misses undiagnosed infections and deaths. With this project we are focusing on the trends within countries as they try to contain the virus spread, whether they are approaching or past peak infection rates, or if they are seeing a resurgence of infections or deaths.`,notes:"[Read more about our methodology](https://www.reuters.com/world-coronavirus-tracker-and-maps/en/methodology/)"});var n=f(y,2);P(n,{text:"Ham drumstick tail ribeye pancetta, leberkas hamburger chicken spare ribs buffalo jerky sausage ground round meatball. Leberkas kevin short loin, tri-tip shank spare ribs buffalo beef pork belly corned beef chislic tongue."}),a(v,d)},$$slots:{default:!0},parameters:{__svelteCsf:{rawCode:`<BodyText
text="Bacon ipsum dolor amet turducken buffalo beef ribs bresaola pancetta ribeye pork belly doner hamburger biltong cupim porchetta chuck ham tenderloin. Turducken bresaola jerky chicken."
/>
<InfoBox
title="About this data"
text={'Reuters is collecting daily COVID-19 infections and deaths data for 240 countries and territories around the world, updated regularly throughout each day. \\n\\n Every country reports those figures a little differently and, inevitably, misses undiagnosed infections and deaths. With this project we are focusing on the trends within countries as they try to contain the virus spread, whether they are approaching or past peak infection rates, or if they are seeing a resurgence of infections or deaths.'}
notes={'[Read more about our methodology](https://www.reuters.com/world-coronavirus-tracker-and-maps/en/methodology/)'}
/>
<BodyText
text="Ham drumstick tail ribeye pancetta, leberkas hamburger chicken spare ribs buffalo jerky sausage ground round meatball. Leberkas kevin short loin, tri-tip shank spare ribs buffalo beef pork belly corned beef chislic tongue."
/>`}}});var _=f(h,2);T(_,{name:"Lists",tags:["!autodocs","!dev"],args:{title:"What you need to know about the war",text:`- **Food crisis**: [Russia's invasion of Ukraine](#) in late February dramatically worsened the outlook for already inflated global food prices.
- **Under fire**: Civillian homes destroyed in the conflict and Russia accused of war crimes.
- **Nordstream sabotage**: A series of clandestine bombings and subsequent underwater gas leaks occurred on the Nord Stream 1 and Nord Stream 2 natural gas pipelines. `},parameters:{__svelteCsf:{rawCode:"<InfoBox {...args} />"}}});var B=f(_,2);T(B,{name:"Customised",tags:["!autodocs","!dev"],children:(v,C)=>{x(v,{header:n=>{var i=ce();a(n,i)},body:n=>{var i=ue();a(n,i)},footer:n=>{var i=fe();a(n,i)},$$slots:{header:!0,body:!0,footer:!0}})},$$slots:{default:!0},parameters:{__svelteCsf:{rawCode:`<InfoBox>
{#snippet header()}
<h3>Global video game market</h3>
{/snippet}
{#snippet body()}
<table>
<thead>
<tr>
<th>Year</th>
<th>Market size ($bln)</th>
</tr>
</thead>
<tbody>
<tr>
<td>2024</td>
<td>274.63</td>
</tr>
<tr>
<td>2023</td>
<td>281.77</td>
</tr>
<tr>
<td>2022</td>
<td>249.55</td>
</tr>
</tbody>
</table>
{/snippet}
{#snippet footer()}
<div class="text-xs font-note">Source: Precedence Research</div>
{/snippet}
</InfoBox>`}}}),a(q,p),K()}A.__docgen={version:3,name:"InfoBox.stories.svelte",data:[],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[],refs:[]};const j=X(A,V),he=["Demo","Lists","Customised"],ve=j.Demo,me=j.Lists,ye=j.Customised,Ie=Object.freeze(Object.defineProperty({__proto__:null,Customised:ye,Demo:ve,Lists:me,__namedExportsOrder:he,default:V},Symbol.toStringTag,{value:"Module"}));export{ye as C,ve as D,Ie as I,me as L};