17 lines
5.7 KiB
JavaScript
17 lines
5.7 KiB
JavaScript
import{S as P,i as I,s as q,p as j,q as E,w as k,j as h,D as C,x as p,_ as A,y as B,C as w,a as S,z as T,m as b,k as L,u as N,r as O,v as F,b as _,t as y,d as D,n as v,l as R}from"./index-25af778d.js";import{p as J,M as K,T as Q,S as W}from"./collect-stories-cce06d4a.js";import{R as X}from"./ReutersGraphicsLogo-07d6663d.js";import{w as V}from"./withParams-90715500.js";const M=`A header for internal tooling sites.
|
|
|
|
> **Note:** Don't use this component for public pages.
|
|
|
|
\`\`\`html
|
|
<script>
|
|
import { ToolsHeader } from '@reuters-graphics/graphics-components';
|
|
<\/script>
|
|
|
|
<ToolsHeader>
|
|
<!-- Anything else goes right of the logo -->
|
|
</ToolsHeader>
|
|
\`\`\`
|
|
`;function Y(r){let e,l,a,d,f,o,u,i;const t=[{...r[5],width:"100%"}];let c={};for(let n=0;n<t.length;n+=1)c=j(c,t[n]);d=new X({props:c});const g=r[8].default,s=E(g,r,r[7],null);return{c(){e=k("header"),l=k("div"),a=k("a"),h(d.$$.fragment),f=C(),o=k("div"),s&&s.c(),p(a,"href",r[6]),p(l,"class","logo-container svelte-11n4jn3"),p(o,"class","menu-items-container svelte-11n4jn3"),p(e,"id",r[0]),p(e,"class",u=A(r[1])+" svelte-11n4jn3"),B(e,"sticky",r[2]),w(e,"background",r[3]),w(e,"border-bottom",r[4])},m(n,m){S(n,e,m),T(e,l),T(l,a),b(d,a,null),T(e,f),T(e,o),s&&s.m(o,null),i=!0},p(n,[m]){const z=m&32?L(t,[{...n[5],width:"100%"}]):{};d.$set(z),(!i||m&64)&&p(a,"href",n[6]),s&&s.p&&(!i||m&128)&&N(s,g,n,n[7],i?F(g,n[7],m,null):O(n[7]),null),(!i||m&1)&&p(e,"id",n[0]),(!i||m&2&&u!==(u=A(n[1])+" svelte-11n4jn3"))&&p(e,"class",u),(!i||m&6)&&B(e,"sticky",n[2]),m&8&&w(e,"background",n[3]),m&16&&w(e,"border-bottom",n[4])},i(n){i||(_(d.$$.fragment,n),_(s,n),i=!0)},o(n){y(d.$$.fragment,n),y(s,n),i=!1},d(n){n&&D(e),v(d),s&&s.d(n)}}}function Z(r,e,l){let{$$slots:a={},$$scope:d}=e,{id:f=""}=e,{cls:o=""}=e,{sticky:u=!1}=e,{background:i="transparent"}=e,{borderBottom:t="1px solid #dedede"}=e,{logoProps:c={logoColour:"#404040"}}=e,{homeLink:g="/"}=e;return r.$$set=s=>{"id"in s&&l(0,f=s.id),"cls"in s&&l(1,o=s.cls),"sticky"in s&&l(2,u=s.sticky),"background"in s&&l(3,i=s.background),"borderBottom"in s&&l(4,t=s.borderBottom),"logoProps"in s&&l(5,c=s.logoProps),"homeLink"in s&&l(6,g=s.homeLink),"$$scope"in s&&l(7,d=s.$$scope)},[f,o,u,i,t,c,g,d,a]}class H extends P{constructor(e){super(),I(this,e,Z,Y,q,{id:0,cls:1,sticky:2,background:3,borderBottom:4,logoProps:5,homeLink:6})}}H.__docgen={version:3,name:"ToolsHeader.svelte",data:[{keywords:[],visibility:"public",description:"Add an ID to target with SCSS.",name:"id",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:""},{keywords:[],visibility:"public",description:"Add a class to target with SCSS.",name:"cls",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:""},{keywords:[],visibility:"public",description:"Make the header stick when user scrolls.",name:"sticky",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"boolean",type:"boolean"},defaultValue:!1},{keywords:[],visibility:"public",description:"Background CSS",name:"background",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:"transparent"},{keywords:[],visibility:"public",description:"Border bottom CSS",name:"borderBottom",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:"1px solid #dedede"},{keywords:[],visibility:"public",description:"Colour props passed to `ReutersGraphicsLogo` component.",name:"logoProps",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"object",type:"object"}},{keywords:[],visibility:"public",description:"Link the logo points to.",name:"homeLink",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:"/"}],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[{keywords:[],visibility:"public",description:"Any additional content",name:"default"}],refs:[]};function x(r){let e,l,a;const d=[r[0]];let f={};for(let o=0;o<d.length;o+=1)f=j(f,d[o]);return l=new H({props:f}),{c(){e=k("div"),h(l.$$.fragment),p(e,"class","svelte-kaguqp")},m(o,u){S(o,e,u),b(l,e,null),a=!0},p(o,u){const i=u&1?L(d,[R(o[0])]):{};l.$set(i)},i(o){a||(_(l.$$.fragment,o),a=!0)},o(o){y(l.$$.fragment,o),a=!1},d(o){o&&D(e),v(l)}}}function $(r){let e,l,a,d,f,o;const u=[{title:"Utilities/ToolsHeader"},{component:H},V(M)];let i={};for(let t=0;t<u.length;t+=1)i=j(i,u[t]);return e=new K({props:i}),a=new Q({props:{$$slots:{default:[x,({args:t})=>({0:t}),({args:t})=>t?1:0]},$$scope:{ctx:r}}}),f=new W({props:{name:"Default",args:{}}}),{c(){h(e.$$.fragment),l=C(),h(a.$$.fragment),d=C(),h(f.$$.fragment)},m(t,c){b(e,t,c),S(t,l,c),b(a,t,c),S(t,d,c),b(f,t,c),o=!0},p(t,[c]){const g=c&0?L(u,[u[0],c&0&&{component:H},c&0&&R(V(M))]):{};e.$set(g);const s={};c&3&&(s.$$scope={dirty:c,ctx:t}),a.$set(s)},i(t){o||(_(e.$$.fragment,t),_(a.$$.fragment,t),_(f.$$.fragment,t),o=!0)},o(t){y(e.$$.fragment,t),y(a.$$.fragment,t),y(f.$$.fragment,t),o=!1},d(t){v(e,t),t&&D(l),v(a,t),t&&D(d),v(f,t)}}}class G extends P{constructor(e){super(),I(this,e,null,$,q,{})}}G.__docgen={version:3,name:"ToolsHeader.stories.svelte",data:[],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[],refs:[]};const U=J(G,{meta:{title:"Utilities/ToolsHeader"},stories:{"tpl:default":{storyId:"utilities-toolsheader--default",name:"default",template:!0,source:`<div>
|
|
<ToolsHeader {...args} />
|
|
</div>`,hasArgs:!0},Default:{storyId:"utilities-toolsheader--default",name:"Default",template:!1,hasArgs:!1}},allocatedIds:["default","Meta","Template","Story","componentDocs","ToolsHeader","withComponentDocs"]}),ne=U.meta,le=["Default"],ae=U.stories.Default;export{ae as Default,le as __namedExportsOrder,ne as default};
|
|
//# sourceMappingURL=ToolsHeader.stories-8546dde0.js.map
|