UNPKG

12.1 kBJavaScriptView Raw
1'use strict';
2
3Object.defineProperty(exports, '__esModule', { value: true });
4
5const core = require('./core-96a5dc61.js');
6
7const App = class {
8 constructor(hostRef) {
9 core.registerInstance(this, hostRef);
10 }
11 render() {
12 return [
13 core.h("slot", { name: 'header' }),
14 core.h("slot", { name: 'side-nav' }),
15 core.h("main", null, core.h("ad-container", null, core.h("slot", null)))
16 ];
17 }
18 static get style() { return "ad-app{display:block;font-size:.875rem;font-family:var(--anj-font-family);font-weight:400;line-height:1.5;outline:none;background-color:#fbfbfb;min-height:100%;padding:3rem 0 2rem;position:relative}ad-app,ad-app:after,ad-app:before{-webkit-box-sizing:border-box;box-sizing:border-box;outline:none}ad-app:active,ad-app :active,ad-app:focus,ad-app :focus{outline:none}ad-app[layout=fluid] ad-container{max-width:none}\@media (min-width:768px){ad-app main{margin-left:13rem;padding-left:1rem;padding-right:1rem}ad-app ad-nav[disabled]~main{margin-left:0}}ad-app main>ad-container{padding-bottom:1rem;padding-top:2rem}\@media (min-width:768px){ad-app main>ad-container{padding-left:2rem;padding-right:2rem}}"; }
19};
20
21const Container = class {
22 constructor(hostRef) {
23 core.registerInstance(this, hostRef);
24 }
25 static get style() { return ".sc-ad-container-h{display:block;margin-left:auto;margin-right:auto;max-width:1140px;padding-left:15px;padding-right:15px;width:100%}"; }
26};
27
28const Footer = class {
29 constructor(hostRef) {
30 core.registerInstance(this, hostRef);
31 }
32 render() {
33 const year = new Date().getFullYear();
34 return (core.h("div", null, "\u00A9 ", year, " Zuora"));
35 }
36 static get style() { return ".sc-ad-footer-h{display:block;font-size:.875rem;font-family:var(--anj-font-family);font-weight:400;line-height:1.5;outline:none;bottom:.5rem;color:var(--anj-neutral-dark);font-size:.75rem;left:50%;padding:1rem 1rem 0;position:absolute;text-align:center;-webkit-transform:translateX(-50%);transform:translateX(-50%)}.sc-ad-footer-h, .sc-ad-footer-h:after, .sc-ad-footer-h:before{-webkit-box-sizing:border-box;box-sizing:border-box;outline:none}.sc-ad-footer-h:active, .sc-ad-footer-h .sc-ad-footer:active, .sc-ad-footer-h:focus, .sc-ad-footer-h .sc-ad-footer:focus{outline:none}\@media (min-width:768px){.sc-ad-footer-h{padding-left:2rem;padding-right:2rem}}"; }
37};
38
39const FrameworkSwitcher = class {
40 constructor(hostRef) {
41 core.registerInstance(this, hostRef);
42 this.frameworks = ['js', 'angular', 'vue'];
43 }
44 switch(framework) {
45 const current = this.getCurrent();
46 if (framework !== current) {
47 document.location.assign(document.location.toString().replace(current, framework));
48 }
49 }
50 getCurrent() {
51 return this.frameworks.find(f => document.location.pathname.includes(f));
52 }
53 render() {
54 const current = this.getCurrent();
55 return (core.h("anj-dropdown", null, core.h("anj-button", { context: "text", slot: "dropdown-toggle" }, "Framework"), this.frameworks.map(f => core.h("anj-dropdown-item", { active: f === current, onClick: () => this.switch(f) }, f))));
56 }
57 static get style() { return "ad-framework-switcher{display:block;font-size:.875rem;font-family:var(--anj-font-family);font-weight:400;line-height:1.5;outline:none;margin:-25px 0 0 -13px;width:50%}ad-framework-switcher,ad-framework-switcher:after,ad-framework-switcher:before{-webkit-box-sizing:border-box;box-sizing:border-box;outline:none}ad-framework-switcher:active,ad-framework-switcher :active,ad-framework-switcher:focus,ad-framework-switcher :focus{outline:none}ad-framework-switcher .anj-dropdown-item{text-transform:capitalize}ad-framework-switcher img{height:.875rem;margin-right:.25rem;position:relative;top:-2px}"; }
58};
59
60const Header = class {
61 constructor(hostRef) {
62 core.registerInstance(this, hostRef);
63 }
64 render() {
65 const navStyle = {
66 height: this.active ? `${this.element.querySelector('ul').clientHeight}px` : '0'
67 };
68 const toggleClass = this.active ? 'nav-toggle header-toggle active' : 'nav-toggle header-toggle';
69 return [
70 core.h("div", { class: "nav-left" }, core.h("slot", { name: "nav-toggle" }), core.h("slot", { name: "home" })),
71 core.h("nav", { style: navStyle }, core.h("ul", { onClick: () => this.toggleNav(false) }, core.h("slot", null), this.github ?
72 core.h("li", null, core.h("a", { href: this.github, target: "_blank" }, core.h("svg", { class: "nav-item-icon", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 499.36", focusable: "false" }, core.h("title", null, "GitHub"), core.h("path", { d: "M256 0C114.64 0 0 114.61 0 256c0 113.09 73.34 209 175.08 242.9 12.8 2.35 17.47-5.56 17.47-12.34 0-6.08-.22-22.18-.35-43.54-71.2 15.49-86.2-34.34-86.2-34.34-11.64-29.57-28.42-37.45-28.42-37.45-23.27-15.84 1.73-15.55 1.73-15.55 25.69 1.81 39.21 26.38 39.21 26.38 22.84 39.12 59.92 27.82 74.5 21.27 2.33-16.54 8.94-27.82 16.25-34.22-56.84-6.43-116.6-28.43-116.6-126.49 0-27.95 10-50.8 26.35-68.69-2.63-6.48-11.42-32.5 2.51-67.75 0 0 21.49-6.88 70.4 26.24a242.65 242.65 0 0 1 128.18 0c48.87-33.13 70.33-26.24 70.33-26.24 14 35.25 5.18 61.27 2.55 67.75 16.41 17.9 26.31 40.75 26.31 68.69 0 98.35-59.85 120-116.88 126.32 9.19 7.9 17.38 23.53 17.38 47.41 0 34.22-.31 61.83-.31 70.23 0 6.85 4.61 14.81 17.6 12.31C438.72 464.97 512 369.08 512 256.02 512 114.62 397.37 0 256 0z", fill: "currentColor", "fill-rule": "evenodd" })), "Github")) : '')),
73 core.h("div", { class: "nav-right" }, this.version ? core.h("span", { class: "version-text" }, this.version) : '', core.h("span", { class: toggleClass, onClick: () => this.toggleNav() }, core.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24" }, core.h("path", { fill: "currentColor", d: "M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z" }))))
74 ];
75 }
76 toggleNav(active) {
77 this.active = active !== undefined ? active : !this.active;
78 }
79 get element() { return core.getElement(this); }
80 static get style() { return "ad-header{-webkit-box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.12),0 1px 5px 0 rgba(0,0,0,.2);box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.12),0 1px 5px 0 rgba(0,0,0,.2);-ms-flex-align:center;align-items:center;background-color:var(--anj-primary-dark);display:-ms-flexbox;display:flex;-ms-flex-flow:row nowrap;flex-flow:row nowrap;font-size:1rem;-ms-flex-pack:justify;justify-content:space-between;left:0;letter-spacing:var(--anj-spacing-wide);min-height:3rem;right:0;padding:0 .75rem;position:fixed;top:0;z-index:1030}\@media (max-width:767.98px){ad-header.active nav{-webkit-box-shadow:0 1px 3px var(--anj-shadow);box-shadow:0 1px 3px var(--anj-shadow)}}ad-header a{color:var(--anj-border-dark);display:block;padding:.5rem .75rem;text-decoration:none;-webkit-transition:color .2s ease;transition:color .2s ease}ad-header a:focus,ad-header a:hover{color:var(--anj-background);text-decoration:none}ad-header a:active{text-decoration:none}ad-header a.active,ad-header a.active:focus,ad-header a.active:hover,ad-header a:active{color:var(--anj-light)}ad-header a .nav-item-icon{height:1rem;margin-right:.2rem;position:relative;top:-1px;width:1rem}ad-header a[slot=home]{color:var(--anj-light);font-size:1.25rem;font-weight:200;display:inline-block;padding-left:3rem;position:relative}ad-header a[slot=home] img{height:2.5rem;left:0;position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%)}ad-header .version-text{color:var(--anj-border-dark);display:none;font-size:.75rem;font-weight:200;letter-spacing:normal;opacity:.8}\@media (min-width:768px){ad-header .version-text{display:inline-block}}ad-header .nav-toggle{color:var(--anj-border-dark);cursor:pointer;display:inline-block;font-size:1.25rem;font-weight:600;-webkit-transition:color .2s ease;transition:color .2s ease}\@media (min-width:768px){ad-header .nav-toggle{display:none}}ad-header .nav-toggle.header-toggle{margin-right:-9px;-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}ad-header .nav-toggle:hover{color:var(--anj-light)}ad-header .nav-toggle.active,ad-header .nav-toggle:active,ad-header .nav-toggle[active]{color:var(--anj-background)}ad-header nav{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-preferred-size:auto;flex-basis:auto;-ms-flex-positive:1;flex-grow:1;margin-right:.75rem}\@media (max-width:767.98px){ad-header nav{background-color:var(--anj-primary);display:block;height:0;-ms-flex-preferred-size:100%;flex-basis:100%;left:0;margin-right:0;overflow:hidden;position:absolute;right:0;top:100%;-webkit-transition:height .5s ease;transition:height .5s ease}}\@media (min-width:768px){ad-header nav{height:inherit!important}}ad-header nav ul{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;list-style:none;margin:0;padding-bottom:.5rem;padding-left:0}\@media (min-width:768px){ad-header nav ul{-ms-flex-direction:row;flex-direction:row;margin-left:auto;margin-right:auto;padding-bottom:0}}"; }
81};
82
83const Nav = class {
84 constructor(hostRef) {
85 core.registerInstance(this, hostRef);
86 }
87 render() {
88 return (core.h("nav", null, core.h("slot", null)));
89 }
90 static get style() { return "ad-nav{-webkit-box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.12),0 1px 5px 0 rgba(0,0,0,.2);box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.12),0 1px 5px 0 rgba(0,0,0,.2);background-color:#f8f8f8;border-right:1px solid var(--anj-border-dark);bottom:0;overflow-y:auto;position:fixed;top:3rem;width:13rem;z-index:1020}ad-nav[disabled]{display:none}\@media (max-width:767.98px){ad-nav{-webkit-box-shadow:none;box-shadow:none;-webkit-transform:translateX(-100%);transform:translateX(-100%);-webkit-transition:all .5s ease;transition:all .5s ease;z-index:1020}ad-nav[active]{-webkit-box-shadow:0 3px 7px var(--anj-shadow);box-shadow:0 3px 7px var(--anj-shadow);-webkit-transform:translateX(0);transform:translateX(0)}}ad-nav nav{padding:1rem 1.25rem 1rem 0}"; }
91};
92
93const NavItem = class {
94 constructor(hostRef) {
95 core.registerInstance(this, hostRef);
96 }
97 static get style() { return "ad-nav-item{display:block;margin-bottom:.5rem}ad-nav-item a{border-left:.25rem solid transparent;color:var(--anj-highlight-dark);display:block;padding-left:1rem;text-decoration:none;text-transform:capitalize;-webkit-transition:border-color .2s ease,color .2s ease;transition:border-color .2s ease,color .2s ease}ad-nav-item a.active,ad-nav-item a:focus,ad-nav-item a:hover{color:var(--anj-primary);text-decoration:none}ad-nav-item a.active{border-left:.25rem solid var(--anj-primary)}"; }
98};
99
100const NavToggle = class {
101 constructor(hostRef) {
102 core.registerInstance(this, hostRef);
103 }
104 render() {
105 return (core.h("button", { class: "ad-nav-toggle", type: "button" }, core.h("svg", { "aria-label": "Menu", xmlns: "http://www.w3.org/2000/svg", width: "36", height: "36", viewBox: "0 0 36 36" }, core.h("path", { fill: "currentColor", d: "M4 27h28v-3H4v3zm0-8h28v-3H4v3zM4 8v3h28V8H4z" }))));
106 }
107 static get style() { return "ad-nav-toggle .ad-nav-toggle{background-color:transparent;border:0;color:var(--anj-border);margin-left:-3px;margin-right:.75rem;padding:0;position:relative;top:-.25rem;-webkit-transition:color .2s ease;transition:color .2s ease}ad-nav-toggle .ad-nav-toggle:focus{outline:none}ad-nav-toggle[active] .ad-nav-toggle{color:var(--anj-secondary)}ad-nav-toggle[disabled]{display:none!important}\@media (min-width:768px){ad-nav-toggle{display:none}}"; }
108};
109
110exports.ad_app = App;
111exports.ad_container = Container;
112exports.ad_footer = Footer;
113exports.ad_framework_switcher = FrameworkSwitcher;
114exports.ad_header = Header;
115exports.ad_nav = Nav;
116exports.ad_nav_item = NavItem;
117exports.ad_nav_toggle = NavToggle;