diff --git a/docs/404.html b/docs/404.html index d2f0be7..7f51587 100644 --- a/docs/404.html +++ b/docs/404.html @@ -1 +1 @@ -@magic-modules/accordion
404 - not found
\ No newline at end of file +@magic-modules/accordion
404 - not found
\ No newline at end of file diff --git a/docs/index.html b/docs/index.html index a1d3521..41e0d24 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1 +1 @@ -@magic-modules/accordion

@magic-modules/accordion

this is the @magic-modules Accordion component. shows / hides items in a vertical accordion

installation:

npm install @magic-modules/accordion

usage:

in a page or Component.

export const View = state => Accordion({  key: 'about',  items: [    { title: 'title', text: 'content' },    { title: 'title 2', text: 'content 2' },    {      title: 'title 3',      text: [        p('content'),        p('can also be an'),        p(['array', ' of', ' modules']),        Link({ to: 'https://magic.github.io' }, 'magic.github.io'),      ],    },  ],  title: 'optional title',  state,})

demo

the example above renders

optional title

title

content

title 2

content 2

title 3

content

can also be an

array of modules

magic.github.io

css

by default, css is minimal. to adapt the styles for your theme, add (and change) the following object to /assets/theme/{THEME_NAME}/index.mjs

'.Accordion': {  h3: {}, // main title  '.AccordionItem': {    h4: {}, // item title    '.content': {}, // item content    '&.open': {      '.content': {}, // item content if opened    },  },}

source

the source for this page is in the example directory and gets built and published to github using @magic/core

\ No newline at end of file +@magic-modules/accordion

@magic-modules/accordion

this is the @magic-modules Accordion component. shows / hides items in a vertical accordion

installation:

npm install @magic-modules/accordion

usage:

in a page or Component.

export const View = state => Accordion({  key: 'about',  items: [    { title: 'title', text: 'content' },    { title: 'title 2', text: 'content 2' },    {      title: 'title 3',      text: [        p('content'),        p('can also be an'),        p(['array', ' of', ' modules']),        Link({ to: 'https://magic.github.io' }, 'magic.github.io'),      ],    },  ],  title: 'optional title',  state,})

demo

the example above renders

optional title

title

content

title 2

content 2

title 3

content

can also be an

array of modules

magic.github.io

css

by default, css is minimal. to adapt the styles for your theme, add (and change) the following object to /assets/theme/{THEME_NAME}/index.mjs

'.Accordion': {  h3: {}, // main title  '.AccordionItem': {    h4: {}, // item title    '.content': {}, // item content    '&.open': {      '.content': {}, // item content if opened    },  },}

source

the source for this page is in the example directory and gets built and published to github using @magic/core

\ No newline at end of file diff --git a/docs/magic.css b/docs/magic.css index 7a21ce5..84181d9 100644 --- a/docs/magic.css +++ b/docs/magic.css @@ -1 +1 @@ -html{scroll-behavior:smooth;overflow-y:scroll}h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,img,picture,source,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video,div,body{border:0;box-sizing:border-box;font:inherit;font-size:100%;margin:0;padding:0;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1.5;margin:0;max-width:100vw;overflow-x:hidden;padding:0;font-family:"Ubuntu Narrow",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,sans-serif}ul{display:inline-block;list-style:none}ol{display:inline-block;list-style:inside decimal}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:none}table{border-collapse:collapse;border-spacing:0}a{cursor:pointer;outline:none;white-space:nowrap;color:#eeeeee;text-decoration:underline;transition:color 500ms}button,.button,input[type="reset"],input[type="button"],input[type="submit"],input[type="file"] > input[type="button"]{background-color:#9E9E9E;color:#212121;cursor:pointer;padding:0.5em}button:hover,.button:hover,input[type="reset"]:hover,input[type="button"]:hover,input[type="submit"]:hover,input[type="file"] > input[type="button"]:hover{background-color:#616161;color:#F5F5F5}button::-moz-focus-inner,.button::-moz-focus-inner,input[type="reset"]::-moz-focus-inner,input[type="button"]::-moz-focus-inner,input[type="submit"]::-moz-focus-inner,input[type="file"] > input[type="button"]::-moz-focus-inner{border:0 none;padding:0}#Magic{height:100%;min-height:100vh;width:100%;background-color:#232323;color:#cccccc;transition:color 300ms,background-color 300ms;font-weight:400}.Wrapper{margin:0 auto;max-width:1300px;width:90%}.Header{display:inline-block;width:90%}.Header .Logo{display:inline-block}.Header .Logo img{float:left;margin:0.3em 0 0}.Header .Logo span{float:left;font-size:1.1em;margin:.7em .2em}.Page h1{padding:1em 0 .2em}.Footer{width:100%;padding:2em 0 .5em;position:relative}h1,h2,h3,h4,h5{padding:1em 0 .2em}h1{font-size:1.4em}h2{font-size:1.3em}h3{font-size:1.2em}.Accordion{position:relative}.Accordion .AccordionItem h4{cursor:pointer;display:block;line-height:1;margin:0;padding:0}.Accordion .AccordionItem .content{font-size:0;margin:0;padding:0;transition:font-size 300ms,margin 300ms}.Accordion .AccordionItem.open .content{font-size:inherit;margin:0 0 1em;transition:font-size 300ms,margin 300ms}.Footer .Container{text-align:center}.Footer .Credits{display:block;clear:both}.Gdpr{-webkit-animation:showGdpr 1s 1s forwards;animation:showGdpr 1s 1s forwards;bottom:0.5em;left:3%;max-width:94%;opacity:0;position:fixed;text-align:center}.Gdpr .Container{background-color:#212121;border:1px solid;border-radius:.5em;color:#F5F5F5;display:inline-block;padding:1em;position:relative;text-align:left}.light .Gdpr .Container{background-color:#F5F5F5;color:#212121}.Gdpr .ShowHide{position:fixed;left:1em;bottom:1em;width:2em;height:2em;cursor:pointer;color:#9E9E9E;stroke:#9E9E9E;fill:#9E9E9E}.Gdpr .ShowHide:hover{color:#616161;stroke:#616161;fill:#616161}.Gdpr h3{padding:0;margin:0}.Gdpr h4{display:inline;font-weight:bold}.Gdpr input[type=button]{display:inline-block;margin:0.5em 0;width:100%}.Gdpr ul{display:block}@-webkit-keyframes showGdpr{0%{opacity:0}100%{opacity:1}}@keyframes showGdpr{0%{opacity:0}100%{opacity:1}}.GitBadges{display:inline-block}.GitBadges img{height:20px}.GitBadges li{margin:0 .5em 0 0;display:inline-block;float:left}.LightSwitch{background:none;border:none;color:inherit;cursor:pointer;fill:#9E9E9E;font:inherit;height:2em;outline:inherit;padding:0;width:2em;left:auto;position:fixed;right:0.5em;top:0.5em}.LightSwitch:hover{background:none;fill:#616161}.Menu{float:none;margin:1.5em 0 0;position:relative;display:block;clear:both}.Menu li{float:none;margin:0 .5em 0 0;display:block}.Menu li.active > a{text-decoration:underline;color:#fefefe}.Menu li a{display:block;text-decoration:none}.Menu ul ul{position:relative;left:0;border-left:1px dotted;display:block;margin:0 0 0 0.2em;padding:0 0 0 0.3em}.Pre{background-color:#121212;border:1px solid #666;border-radius:5px;color:#eee;counter-reset:line;display:block;font-family:monospace;line-height:1.3;margin:1em 0;padding:1em .5em 0 .2em;position:relative;transition:color 300ms,background-color 300ms;white-space:pre}.Pre.lines pre > code{counter-increment:line;padding:0}.Pre.lines pre > code:last-child{padding:0 0 1em}.Pre.lines pre > code:before{content:counter(line);display:inline-block;padding:0 .5em 0 0;text-align:right;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:3ch}.Pre .actions{color:blueviolet}.Pre .boolean{color:#7979e4}.Pre .builtin{color:cadetblue}.Pre .colon{color:#8eef8e}.Pre .comment{opacity:0.7;font-style:italic}.Pre .html{color:#008800}.Pre .keyword{color:violet}.light .Pre{background-color:#ddd;color:#111}.light .Pre > code:before{color:#666}.light .Pre .html{color:#008800}.light .Pre .keyword{color:purple}.light .Pre .builtin{color:cadetblue}.light .Pre .string{color:#d15100}.light .Pre .colon{color:#016301}.light .Pre .boolean{color:blue}.light .Pre .actions{color:blueviolet}.light .Pre .state{color:cornflowerblue}.light .Pre .comment{color:#555;opacity:0.8;font-style:italic}.light .Pre .object{color:#016301}.light .Pre .property{color:#2a952a}.light .Pre a{color:#d15100}.light .Pre a:hover{color:turquoise}.Pre .menu{position:absolute;margin-top:-2em;right:0}.Pre .object{color:#00ff00}.Pre .property{color:#8eef8e}.Pre .state{color:cornflowerblue}.Pre .string{color:#dd8f00}.Pre > code:before{color:#666}.Pre a{color:turquoise}.Pre a:hover{color:#d15100}.Pre button{background-color:#666;border-radius:3px;color:#fefefe;margin:0 .2em;padding:1px 3px;border:0 none}.Pre pre{overflow-x:auto}.Pre pre > code{display:block;padding:0 1em 0}.Pre pre > code:last-child{padding:0 1em 1em}.SkipLink{height:1px;left:0;overflow:hidden;position:absolute;top:0;width:1px}#Magic.light{background-color:#eeeeee;color:#232323}h1:target,h2:target,h3:target,h4:target,h5:target{text-decoration:underline}:target > h1:first-child,:target > h2:first-child,:target > h3:first-child,:target > h4:first-child,:target > h5:first-child{text-decoration:underline}a:hover{color:#fefefe}.light a{color:#232323}.light a:hover{color:#232323}.Page{margin-bottom:3em}h4{font-size:1.1em}p{line-height:1.8}.light .Menu li.active > a{color:#232323}.Menu li.active li a{text-decoration:none}@media screen and (min-width:900px){.Gdpr input[type=button]{margin:1em 3% 0 0;max-width:30%;width:auto}}@media screen and (min-width:1000px){.Header{width:210px;position:fixed;float:left;max-height:100vh;height:100vh;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;box-sizing:border-box}.Menu{max-width:210px;padding:0 0 2em}.Page{float:right;width:calc(100% - 220px);min-height:83vh}.Footer{clear:both}} \ No newline at end of file +html{scroll-behavior:smooth;overflow-y:scroll}h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,img,picture,source,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video,div,body{border:0;box-sizing:border-box;font:inherit;font-size:100%;margin:0;padding:0;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1.5;margin:0;max-width:100vw;overflow-x:hidden;padding:0;font-family:"Ubuntu Narrow",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,sans-serif}ul{display:inline-block;list-style:none}ol{display:inline-block;list-style:inside decimal}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:none}table{border-collapse:collapse;border-spacing:0}a{cursor:pointer;outline:none;white-space:nowrap;color:#eeeeee;text-decoration:underline;transition:color 500ms}b,strong{font-weight:700}i,em{font-style:italic}button,.button,input[type="reset"],input[type="button"],input[type="submit"],input[type="file"] > input[type="button"]{background-color:#9E9E9E;color:#212121;cursor:pointer;padding:0.5em}button:hover,.button:hover,input[type="reset"]:hover,input[type="button"]:hover,input[type="submit"]:hover,input[type="file"] > input[type="button"]:hover{background-color:#616161;color:#F5F5F5}button::-moz-focus-inner,.button::-moz-focus-inner,input[type="reset"]::-moz-focus-inner,input[type="button"]::-moz-focus-inner,input[type="submit"]::-moz-focus-inner,input[type="file"] > input[type="button"]::-moz-focus-inner{border:0 none;padding:0}#Magic{height:100%;min-height:100vh;width:100%;background-color:#232323;color:#cccccc;transition:color 300ms,background-color 300ms;font-weight:400}.Wrapper{margin:0 auto;max-width:1300px;width:90%}.Header{display:inline-block;width:90%}.Header .Logo{display:inline-block}.Header .Logo img{float:left;margin:0.3em 0 0}.Header .Logo span{float:left;font-size:1.1em;margin:.7em .2em}.Page h1{padding:1em 0 .2em}.Footer{width:100%;padding:2em 0 .5em;position:relative}h1,h2,h3,h4,h5{padding:1em 0 .2em}h1{font-size:1.4em}h2{font-size:1.3em}h3{font-size:1.2em}.Accordion{position:relative}.Accordion .AccordionItem h4{cursor:pointer;display:block;line-height:1;margin:0;padding:0}.Accordion .AccordionItem .content{font-size:0;margin:0;padding:0;transition:font-size 300ms,margin 300ms}.Accordion .AccordionItem.open .content{font-size:inherit;margin:0 0 1em;transition:font-size 300ms,margin 300ms}.Credits{clear:both;display:block;margin:2em 0 1em}.Credits a{color:#cccccc;text-decoration:underline}.Credits a:hover{color:undefined}.Footer .Container{text-align:center}.Gdpr{-webkit-animation:showGdpr 1s 1s forwards;animation:showGdpr 1s 1s forwards;bottom:0.5em;left:3%;max-width:94%;opacity:0;position:fixed;text-align:center}.Gdpr .Container{background-color:#212121;border:1px solid;border-radius:.5em;color:#F5F5F5;display:inline-block;padding:1em;position:relative;text-align:left}.light .Gdpr .Container{background-color:#F5F5F5;color:#212121}.Gdpr .ShowHide{position:fixed;left:1em;bottom:1em;width:2em;height:2em;cursor:pointer;color:#9E9E9E;stroke:#9E9E9E;fill:#9E9E9E}.Gdpr .ShowHide:hover{color:#616161;stroke:#616161;fill:#616161}.Gdpr h3{padding:0;margin:0}.Gdpr h4{display:inline;font-weight:bold}.Gdpr input[type=button]{display:inline-block;margin:0.5em 0;width:100%}.Gdpr ul{display:block}@-webkit-keyframes showGdpr{0%{opacity:0}100%{opacity:1}}@keyframes showGdpr{0%{opacity:0}100%{opacity:1}}.GitBadges{display:inline-block}.GitBadges img{height:20px}.GitBadges li{margin:0 .5em 0 0;display:inline-block;float:left}.LightSwitch{background:none;border:none;color:inherit;cursor:pointer;fill:#9E9E9E;font:inherit;height:2em;outline:inherit;padding:0;width:2em;left:auto;position:fixed;right:0.5em;top:0.5em}.LightSwitch:hover{background:none;fill:#616161}.Menu{float:none;margin:1.5em 0 0;position:relative;display:block;clear:both}.Menu li{float:none;margin:0 .5em 0 0;display:block}.Menu li.active > a{text-decoration:underline;color:#fefefe}.Menu li a{display:block;text-decoration:none}.Menu ul ul{position:relative;left:0;border-left:1px dotted;display:block;margin:0 0 0 0.2em;padding:0 0 0 0.3em}.Pre{background-color:#121212;border:1px solid #666;border-radius:5px;color:#eee;counter-reset:line;display:block;font-family:monospace;line-height:1.3;margin:1em 0;padding:1em .5em 0 .2em;position:relative;transition:color 300ms,background-color 300ms;white-space:pre}.Pre.lines pre > code{counter-increment:line;padding:0}.Pre.lines pre > code:last-child{padding:0 0 1em}.Pre.lines pre > code:before{content:counter(line);display:inline-block;padding:0 .5em 0 0;text-align:right;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:3ch}.Pre .actions{color:blueviolet}.Pre .boolean{color:#7979e4}.Pre .builtin{color:cadetblue}.Pre .colon{color:#8eef8e}.Pre .comment{opacity:0.7;font-style:italic}.Pre .html{color:#008800}.Pre .keyword{color:violet}.light .Pre{background-color:#ddd;color:#111}.light .Pre > code:before{color:#666}.light .Pre .html{color:#008800}.light .Pre .keyword{color:purple}.light .Pre .builtin{color:cadetblue}.light .Pre .string{color:#d15100}.light .Pre .colon{color:#016301}.light .Pre .boolean{color:blue}.light .Pre .actions{color:blueviolet}.light .Pre .state{color:cornflowerblue}.light .Pre .comment{color:#555;opacity:0.8;font-style:italic}.light .Pre .object{color:#016301}.light .Pre .property{color:#2a952a}.light .Pre a{color:#d15100}.light .Pre a:hover{color:turquoise}.Pre .menu{position:absolute;margin-top:-2em;right:0}.Pre .object{color:#00ff00}.Pre .property{color:#8eef8e}.Pre .state{color:cornflowerblue}.Pre .string{color:#dd8f00}.Pre > code:before{color:#666}.Pre a{color:turquoise}.Pre a:hover{color:#d15100}.Pre button{background-color:#666;border-radius:3px;color:#fefefe;margin:0 .2em;padding:1px 3px;border:0 none}.Pre pre{overflow-x:auto}.Pre pre > code{display:block;padding:0 1em 0}.Pre pre > code:last-child{padding:0 1em 1em}.SkipLink{height:1px;left:0;overflow:hidden;position:absolute;top:0;width:1px}#Magic.light{background-color:#eeeeee;color:#232323}h1:target,h2:target,h3:target,h4:target,h5:target{text-decoration:underline}:target > h1:first-child,:target > h2:first-child,:target > h3:first-child,:target > h4:first-child,:target > h5:first-child{text-decoration:underline}a:hover{color:#fefefe}.light a{color:#232323}.light a:hover{color:#232323}.Page{margin-bottom:3em}h4{font-size:1.1em}p{line-height:1.8}.light .Menu li.active > a{color:#232323}.Menu li.active li a{text-decoration:none}@media screen and (min-width:900px){.Gdpr input[type=button]{margin:1em 3% 0 0;max-width:30%;width:auto}}@media screen and (min-width:1000px){.Header{width:210px;position:fixed;float:left;max-height:100vh;height:100vh;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;box-sizing:border-box}.Menu{max-width:210px;padding:0 0 2em}.Page{float:right;width:calc(100% - 220px);min-height:83vh}.Footer{clear:both}} \ No newline at end of file diff --git a/docs/magic.js b/docs/magic.js index a3ed145..d34fac6 100644 --- a/docs/magic.js +++ b/docs/magic.js @@ -1 +1 @@ -"use strict";function b(a){return o(a)||c(a)||m()}function c(a){if(Symbol.iterator in Object(a)||"[object Arguments]"===Object.prototype.toString.call(a))return Array.from(a)}function d(a,b){if(null==a)return{};var c,d,f=e(a,b);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(a);for(d=0;dy)for(;x<=z;)c.insertBefore(p(u[x]=v(u[x++]),f,g),(k=t[w])&&k.node);else if(x>z)for(;w<=y;)c.removeChild(t[w++].node);else{for(var A=w,B={},C={};A<=y;A++)null!=(l=t[A].key)&&(B[l]=t[A]);for(;x<=z;){if(l=r(k=t[w]),m=r(u[x]=v(u[x],k)),C[l]||null!=m&&m===r(t[w+1])){null==l&&c.removeChild(k.node),w++;continue}null==m||1===d.type?(null==l&&(s(c,k&&k.node,k,u[x],f,g),x++),w++):(l===m?(s(c,k.node,k,u[x],f,g),C[m]=!0,w++):null==(h=B[m])?s(c,k&&k.node,null,u[x],f,g):(s(c,c.insertBefore(h.node,k&&k.node),h,u[x],f,g),C[m]=!0),x++)}for(;w<=y;)null==r(k=t[w++])&&c.removeChild(k.node);for(var A in B)null==C[A]&&c.removeChild(B[A].node)}}return e.node=c},t=function(c,a){for(var b in c)if(c[b]!==a[b])return!0;for(var b in a)if(c[b]!==a[b])return!0},u=function(a){return"object"===q(a)?a:x(a)},v=function(b,c){return b.type===a?((!c||c.type!==a||t(c.lazy,b.lazy))&&((c=u(b.lazy.view(b.lazy))).lazy=b.lazy),c):b},w=function(a,b,c,d,e,f){return{name:a,props:b,children:c,node:d,type:f,key:e}},x=function(a,e){return w(a,c,d,e,void 0,b)},y=function(a){return a.nodeType===b?x(a.nodeValue,a):w(a.nodeName.toLowerCase(),c,e.call(a.childNodes,y),a,void 0,1)};return{h:function h(a,b){for(var d,e=[],g=[],h=arguments.length;2 Accordion({\n key: 'about',\n items: [\n { title: 'title', text: 'content' },\n { title: 'title 2', text: 'content 2' },\n {\n title: 'title 3',\n text: [\n p('content'),\n p('can also be an'),\n p(['array', ' of', ' modules']),\n Link({ to: 'https://magic.github.io' }, 'magic.github.io'),\n ],\n },\n ],\n title: 'optional title',\n state,\n})\n"),z({id:"demo"},"demo"),M("the example above renders"),W({key:"about",items:[{title:"title",text:"content"},{title:"title 2",text:"content 2"},{title:"title 3",text:[M("content"),M("can also be an"),M(["array"," of"," modules"]),ea({to:"https://magic.github.io"},"magic.github.io")]}],title:"optional title",state:a}),z({id:"css"},"css"),M(["by default, css is minimal. to adapt the styles for your theme,"," add (and change) the following object to /assets/theme/{THEME_NAME}/index.mjs"]),ka("\n'.Accordion': {\n h3: {}, // main title\n '.AccordionItem': {\n h4: {}, // item title\n\n '.content': {}, // item content\n\n '&.open': {\n '.content': {}, // item content if opened\n },\n },\n}"),z({id:"source"},"source"),M(["the source for this page is in the ",ea({to:"https://github.com/magic-modules/accordion/tree/master/example"},"example directory")," and gets built and published to github using ",ea({to:"https://github.com/magic/core"},"@magic/core")]),da(a)]},"/accordion/404/":function accordion404(){return w("404 - not found")}};h({init:[j({},U,{url:window.location.pathname,hash:window.location.hash.substr(1)}),[[ma.db.get,{key:"magic-gdpr",action:na.gdpr.show}]]],subscriptions:function subscriptions(){return[[V.listenPopState,na.pop]]},view:function(a){var b=oa[a.url]?a.url:"/404/",c=oa[b],d=a.pages&&a.pages[b];return d&&Object.keys(d).forEach(function(b){a[b]=d[b]}),a.titles={},ja({page:c,state:a},_(a))},node:document.getElementById("Magic")}); \ No newline at end of file +"use strict";function _toArray(a){return _arrayWithHoles(a)||_iterableToArray(a)||_nonIterableRest()}function _iterableToArray(a){if(Symbol.iterator in Object(a)||"[object Arguments]"===Object.prototype.toString.call(a))return Array.from(a)}function _objectWithoutProperties(a,b){if(null==a)return{};var c,d,e=_objectWithoutPropertiesLoose(a,b);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(a);for(d=0;dy)for(;x<=z;)c.insertBefore(p(v[x]=u(v[x++]),f,g),(k=t[w])&&k.node);else if(x>z)for(;w<=y;)c.removeChild(t[w++].node);else{for(var A=w,B={},C={};A<=y;A++)null!=(l=t[A].key)&&(B[l]=t[A]);for(;x<=z;){if(l=q(k=t[w]),m=q(v[x]=u(v[x],k)),C[l]||null!=m&&m===q(t[w+1])){null==l&&c.removeChild(k.node),w++;continue}null==m||1===d.type?(null==l&&(r(c,k&&k.node,k,v[x],f,g),x++),w++):(l===m?(r(c,k.node,k,v[x],f,g),C[m]=!0,w++):null==(h=B[m])?r(c,k&&k.node,null,v[x],f,g):(r(c,c.insertBefore(h.node,k&&k.node),h,v[x],f,g),C[m]=!0),x++)}for(;w<=y;)null==q(k=t[w++])&&c.removeChild(k.node);for(var A in B)null==C[A]&&c.removeChild(B[A].node)}}return e.node=c},s=function(c,a){for(var b in c)if(c[b]!==a[b])return!0;for(var b in a)if(c[b]!==a[b])return!0},t=function(a){return"object"===_typeof(a)?a:w(a)},u=function(b,c){return b.type===a?((!c||c.type!==a||s(c.lazy,b.lazy))&&((c=t(b.lazy.view(b.lazy))).lazy=b.lazy),c):b},v=function(a,b,c,d,e,f){return{name:a,props:b,children:c,node:d,type:f,key:e}},w=function(a,e){return v(a,c,d,e,void 0,b)},x=function(a){return a.nodeType===b?w(a.nodeValue,a):v(a.nodeName.toLowerCase(),c,e.call(a.childNodes,x),a,void 0,1)};return{h:function h(a,b){for(var d,e=[],g=[],h=arguments.length;2 Accordion({\n key: 'about',\n items: [\n { title: 'title', text: 'content' },\n { title: 'title 2', text: 'content 2' },\n {\n title: 'title 3',\n text: [\n p('content'),\n p('can also be an'),\n p(['array', ' of', ' modules']),\n Link({ to: 'https://magic.github.io' }, 'magic.github.io'),\n ],\n },\n ],\n title: 'optional title',\n state,\n})\n"),h2({id:"demo"},"demo"),p("the example above renders"),Accordion({key:"about",items:[{title:"title",text:"content"},{title:"title 2",text:"content 2"},{title:"title 3",text:[p("content"),p("can also be an"),p(["array"," of"," modules"]),Link({to:"https://magic.github.io"},"magic.github.io")]}],title:"optional title",state:a}),h2({id:"css"},"css"),p(["by default, css is minimal. to adapt the styles for your theme,"," add (and change) the following object to /assets/theme/{THEME_NAME}/index.mjs"]),Pre("\n'.Accordion': {\n h3: {}, // main title\n '.AccordionItem': {\n h4: {}, // item title\n\n '.content': {}, // item content\n\n '&.open': {\n '.content': {}, // item content if opened\n },\n },\n}"),h2({id:"source"},"source"),p(["the source for this page is in the ",Link({to:"https://github.com/magic-modules/accordion/tree/master/example"},"example directory")," and gets built and published to github using ",Link({to:"https://github.com/magic/core"},"@magic/core")]),LightSwitch(a)]},"/accordion/404/":function accordion404(){return div("404 - not found")}};app({init:[_objectSpread({},initialState,{url:window.location.pathname,hash:window.location.hash.substr(1)}),[[lib.db.get,{key:"magic-gdpr",action:actions.gdpr.show}]]],subscriptions:function subscriptions(){return[[helpers.listenPopState,actions.pop]]},view:function(a){var b=pages[a.url]?a.url:"/404/",c=pages[b],d=a.pages&&a.pages[b];return d&&Object.keys(d).forEach(function(b){a[b]=d[b]}),a.titles={},Page({page:c,state:a},Gdpr(a))},node:document.getElementById("Magic")}); \ No newline at end of file diff --git a/docs/sitemap.xml b/docs/sitemap.xml index 55c854b..555375c 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -7,14 +7,14 @@ https://magic-modules.github.io/accordion/ - 2020-02-23 + 2020-02-29 weekly 0.5 https://magic-modules.github.io/accordion/404/ - 2020-02-23 + 2020-02-29 weekly 0.5 diff --git a/docs/sri-hashes.json b/docs/sri-hashes.json index 8e449c7..d5d50d9 100644 --- a/docs/sri-hashes.json +++ b/docs/sri-hashes.json @@ -1,13 +1,13 @@ { - "css": "sha384-Rddte7F/D3Ikf3CciZDgzrAmb2vtW9Ry6pqdM5gJX4wEsLuz1l/pRvKb1e+hSoEX", - "js": "sha384-GQGnMeNd1tHpbVRgW//hD/6uBNQqPog7s/TzgvTHIVStleydABtcP6pTQxCtV8hm", + "css": "sha384-K463tkXWu1Dcil5kr+osWZ3DAQlWe42XOC6dPQPPn9sPEga46sWgSG2+T01z337h", + "js": "sha384-xjjalnA/A+Q63EfIJ/k0OqrBvvPl1goDoRTo203BloNlUPFcQrM5XYRjNItl47sY", "pages": { - "/accordion/": "sha384-RZUP/lTz22i8TfDfkXzDLr9SHxZlfjm+JUc3/UqiGcUMbMCuXbNpa5AcHn39w7kD", - "/accordion/404/": "sha384-U2HfrGPTqA9J6vFm834ofzCKcB7UkQw/Uw7hrmgQ3UDXDFVYzLmH4vQah2QrxV3N" + "/accordion/": "sha384-YqFghD+5XgEW1Pcs06MnIikfIB/tW5KvqRYnFbEBdN00qJSMXENfwv3mnKDYQkFR", + "/accordion/404/": "sha384-dPtx593GwRgcXPoOq4hb4iU2MXtM/ROubtdsBHj+bHvaNjiMr31N+bD+doNALvl8" }, "static": { "/favicon.ico": "sha384-pf51ay6pZCj3+XlVCPmCKLDFpLj7QP+2heR+/n08WgS7Bve7JMkgubHOkwLzaTr+", "/robots.txt": "sha384-O96jWHE91wsOvBEoExJ6vu0wHhZYPqr9CmVG7fTdzySd6WE+NIdZwkzGl+4/0S8i", - "/sitemap.xml": "sha384-tXnUkBBG5tzVJYIndQDl6IcA0vg51bNXmeryJJ8fxmBuyEjGKD5yYcWKz1DynmQJ" + "/sitemap.xml": "sha384-hqF0GNfEJhAx5vqKboA8w+23U5oR8WiKcbKiqy8PZDylpoKq2XXKF9C4Ibt5cEH2" } } \ No newline at end of file