@phila/phila-ui-app-footer 0.0.18 → 0.0.22

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/README.md CHANGED
@@ -1,49 +1,30 @@
1
- ## Code Samples
2
- ### Props vs Slots Links
3
- The footer links can be added via props using the [Navigation Links](/components/NavLink) format.
4
- ```html
5
- <app-footer
6
- :links="myFooterLinks"
7
- />
8
- ```
1
+ ## Usage
9
2
 
10
- Or the links can be added using the default slot. The default slot accepts an unordered list of links.
11
- ```html
12
- <app-footer>
13
- <ul>
14
- <li>
15
- <a href="/about">About</a>
16
- </li>
17
- <li>
18
- <a href="/terms-and-conditions">Terms & Conditions</a>
19
- </li>
20
- </ul>
21
- </app-footer>
22
- ```
3
+ #### Import single component...
23
4
 
24
- ### Sticky Footer
25
- The footer can be fixed to the bottom of the page, so it's always visible.
26
- ```html
27
- <app-footer
28
- :is-sticky="true"
29
- />
30
- ```
5
+ ```js
6
+ import { AppFooter } from '@phila/phila-ui';
31
7
 
32
- ### Mobile Display
33
- By default the footer is hidden on mobile devices. If the links in the footer are important, they should be added to the [Mobile Navigation](/components/MobileNav).
8
+ //register it locally...
9
+ components: {
10
+ AppFooter,
11
+ }
34
12
 
35
- If the footer must be displayed on mobile, set ``is-hidden-mobile`` to ``false``.
36
- ```html
37
- <app-footer
38
- :is-hidden-mobile="false"
39
- />
13
+ //... or register it globally
14
+ Vue.component('app-footer', AppFooter);
40
15
  ```
41
16
 
42
- ## Live Examples
43
- <alert type="warning">Open the iframe below in a new window as the footer is by default hidden on smaller screens</alert>
17
+ #### or import the whole library,
18
+
19
+ ```js
20
+ import * as PhilaUI from "@phila/phila-ui";
44
21
 
45
- ### Non-sticky, using the slot
46
- <example name="AppFooter1" height="300" :options="{ horizontal: true}"></example>
22
+ //register it globally
23
+ Vue.use(PhilaUI);
24
+ ```
47
25
 
48
- ### Sticky, using the link prop
49
- <example name="AppFooter2" height="300" :options="{ horizontal: true}"></example>
26
+ #### then use it in the vue template
27
+
28
+ ```html
29
+ <app-footer></app-footer>
30
+ ```
package/dist/AppFooter.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import "./AppFooter.css";
2
- import { defineComponent as m, inject as h, computed as v, ref as y, onMounted as k, resolveComponent as _, openBlock as a, createElementBlock as c, normalizeClass as g, createElementVNode as u, Fragment as H, renderList as S, createVNode as b, mergeProps as M, renderSlot as x, createCommentVNode as B, pushScopeId as F, popScopeId as I } from "vue";
3
- const N = (e) => (F("data-v-f34d21d1"), e = e(), I(), e), A = /* @__PURE__ */ N(() => /* @__PURE__ */ u("div", { class: "container" }, null, -1)), C = { class: "container has-text-centered" }, T = {
2
+ import { defineComponent as m, inject as v, computed as y, ref as k, onMounted as h, resolveComponent as _, createElementBlock as a, createCommentVNode as g, openBlock as c, normalizeClass as H, createElementVNode as u, renderSlot as b, Fragment as M, renderList as S, createVNode as x, mergeProps as B } from "vue";
3
+ const F = { class: "container has-text-centered" }, N = {
4
4
  key: 0,
5
5
  role: "menu",
6
6
  class: "inline-list"
7
- }, $ = /* @__PURE__ */ m({
7
+ }, A = /* @__PURE__ */ m({
8
8
  __name: "AppFooter",
9
9
  props: {
10
10
  links: { default() {
@@ -13,51 +13,51 @@ const N = (e) => (F("data-v-f34d21d1"), e = e(), I(), e), A = /* @__PURE__ */ N(
13
13
  isSticky: { type: Boolean, default: !0 },
14
14
  isHiddenMobile: { type: Boolean, default: !1 }
15
15
  },
16
- setup(e) {
17
- const n = e, l = h("responsiveHelpers"), { responsiveState: p } = l, o = v(() => p.isMobile), i = y();
18
- return k(() => {
19
- var r;
20
- const t = document.getElementById("app-header"), s = document.querySelector("main");
21
- if (s) {
22
- if (n.isSticky && i.value)
23
- s.style.cssText = s.style.cssText + `padding-bottom: ${i.value.offsetHeight}px`;
24
- else if (o.value && !n.isHiddenMobile || !o.value)
25
- if (t) {
26
- const d = t.offsetHeight + (((r = i.value) == null ? void 0 : r.offsetHeight) || 0);
27
- s.style.cssText = s.style.cssText + `min-height: calc(100vh - ${d}px)`;
16
+ setup(n) {
17
+ const s = n, l = v("responsiveHelpers"), { responsiveState: p } = l, o = y(() => p.isMobile), r = k();
18
+ return h(() => {
19
+ var i;
20
+ const e = document.getElementById("app-header"), t = document.querySelector("main");
21
+ if (t) {
22
+ if (s.isSticky && r.value)
23
+ t.style.cssText = t.style.cssText + `padding-bottom: ${r.value.offsetHeight}px`;
24
+ else if (o.value && !s.isHiddenMobile || !o.value)
25
+ if (e) {
26
+ const d = e.offsetHeight + (((i = r.value) == null ? void 0 : i.offsetHeight) || 0);
27
+ t.style.cssText = t.style.cssText + `min-height: calc(100vh - ${d}px)`;
28
28
  } else
29
29
  console.warn("AppFooter: No app-header found, unable to calculate sticky footer height");
30
30
  } else
31
31
  console.warn("AppFooter: No main element found, unable to calculate sticky footer height");
32
- }), (t, s) => {
33
- const r = _("nav-link");
34
- return o.value && !t.isHiddenMobile || !o.value ? (a(), c("footer", {
32
+ }), (e, t) => {
33
+ const i = _("nav-link");
34
+ return o.value && !e.isHiddenMobile || !o.value ? (c(), a("footer", {
35
35
  key: 0,
36
36
  id: "app-footer",
37
37
  ref_key: "footer",
38
- ref: i,
39
- class: g({ "is-sticky": t.isSticky })
38
+ ref: r,
39
+ class: H({ "is-sticky": e.isSticky })
40
40
  }, [
41
- A,
42
- u("div", C, [
43
- t.links.length > 0 ? (a(), c("ul", T, [
44
- (a(!0), c(H, null, S(t.links, (d, f) => (a(), c("li", {
41
+ t[0] || (t[0] = u("div", { class: "container" }, null, -1)),
42
+ u("div", F, [
43
+ e.links.length > 0 ? (c(), a("ul", N, [
44
+ (c(!0), a(M, null, S(e.links, (d, f) => (c(), a("li", {
45
45
  key: `fl-${f}`,
46
46
  role: "none"
47
47
  }, [
48
- b(r, M({ ref_for: !0 }, d, { role: "menuitem" }), null, 16)
48
+ x(i, B({ ref_for: !0 }, d, { role: "menuitem" }), null, 16)
49
49
  ]))), 128))
50
- ])) : x(t.$slots, "default", { key: 1 }, void 0, !0)
50
+ ])) : b(e.$slots, "default", { key: 1 }, void 0, !0)
51
51
  ])
52
- ], 2)) : B("", !0);
52
+ ], 2)) : g("", !0);
53
53
  };
54
54
  }
55
- }), w = (e, n) => {
56
- const l = e.__vccOpts || e;
57
- for (const [p, o] of n)
55
+ }), C = (n, s) => {
56
+ const l = n.__vccOpts || n;
57
+ for (const [p, o] of s)
58
58
  l[p] = o;
59
59
  return l;
60
- }, j = /* @__PURE__ */ w($, [["__scopeId", "data-v-f34d21d1"]]);
60
+ }, E = /* @__PURE__ */ C(A, [["__scopeId", "data-v-f34d21d1"]]);
61
61
  export {
62
- j as default
62
+ E as default
63
63
  };
@@ -1,2 +1,2 @@
1
1
  (function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n(require("vue")):typeof define=="function"&&define.amd?define(["vue"],n):(e=typeof globalThis<"u"?globalThis:e||self,e.AppFooter=n(e.Vue))})(this,function(e){"use strict";var n=document.createElement("style");n.textContent=`@font-face{font-family:Montserrat;src:local("Montserrat Regular"),local("Montserrat-Regular"),url(https://www.phila.gov/assets/fonts/Montserrat/Montserrat-Regular.woff2) format("woff2"),url(https://www.phila.gov/assets/fonts/Montserrat/Montserrat-Regular.woff) format("woff");font-weight:400;font-style:normal}@font-face{font-family:Open Sans;src:local("Open Sans Italic"),local("OpenSans-Italic"),url(https://www.phila.gov/assets/fonts/OpenSans/OpenSans-Italic.woff2) format("woff2"),url(https://www.phila.gov/assets/fonts/OpenSans/OpenSans-Italic.woff) format("woff");font-weight:400;font-style:italic}@font-face{font-family:Open Sans;src:local("Open Sans Bold Italic"),local("OpenSans-BoldItalic"),url(https://www.phila.gov/assets/fonts/OpenSans/OpenSans-BoldItalic.woff2) format("woff2"),url(https://www.phila.gov/assets/fonts/OpenSans/OpenSans-BoldItalic.woff) format("woff");font-weight:700;font-style:italic}@font-face{font-family:Montserrat;src:local("Montserrat Bold"),local("Montserrat-Bold"),url(https://www.phila.gov/assets/fonts/Montserrat/Montserrat-Bold.woff2) format("woff2"),url(https://www.phila.gov/assets/fonts/Montserrat/Montserrat-Bold.woff) format("woff");font-weight:700;font-style:normal}@font-face{font-family:Open Sans;src:local("Open Sans Bold"),local("OpenSans-Bold"),url(https://www.phila.gov/assets/fonts/OpenSans/OpenSans-Bold.woff2) format("woff2"),url(https://www.phila.gov/assets/fonts/OpenSans/OpenSans-Bold.woff) format("woff");font-weight:700;font-style:normal}@font-face{font-family:Open Sans;src:local("Open Sans SemiBold Italic"),local("OpenSans-SemiBoldItalic"),url(https://www.phila.gov/assets/fonts/OpenSans/OpenSans-SemiBoldItalic.woff2) format("woff2"),url(https://www.phila.gov/assets/fonts/OpenSans/OpenSans-SemiBoldItalic.woff) format("woff");font-weight:600;font-style:italic}@font-face{font-family:Open Sans;src:local("Open Sans SemiBold"),local("OpenSans-SemiBold"),url(https://www.phila.gov/assets/fonts/OpenSans/OpenSans-SemiBold.woff2) format("woff2"),url(https://www.phila.gov/assets/fonts/OpenSans/OpenSans-SemiBold.woff) format("woff");font-weight:600;font-style:normal}@font-face{font-family:Open Sans;src:local("Open Sans Regular"),local("OpenSans-Regular"),url(https://www.phila.gov/assets/fonts/OpenSans/OpenSans-Regular.woff2) format("woff2"),url(https://www.phila.gov/assets/fonts/OpenSans/OpenSans-Regular.woff) format("woff");font-weight:400;font-style:normal}#app-footer[data-v-f34d21d1]{background-color:#0f4d90;height:46px;max-height:46px;overflow:hidden;width:100%}#app-footer a[data-v-f34d21d1]{color:#fff;line-height:46px}#app-footer a[data-v-f34d21d1]:hover{color:#25cef7}#app-footer.is-sticky[data-v-f34d21d1]{position:fixed;bottom:0;z-index:99}#app-footer ul[data-v-f34d21d1]{list-style:none;padding:0;margin:0}#app-footer ul li[data-v-f34d21d1]{display:inline-block;vertical-align:middle;margin:0;padding:0}#app-footer ul li[data-v-f34d21d1]:not(:last-child):after{content:"|";margin:0 1rem;display:inline-block;position:relative;color:#fff;font-weight:700}
2
- `,document.head.appendChild(n);const d=(t=>(e.pushScopeId("data-v-f34d21d1"),t=t(),e.popScopeId(),t))(()=>e.createElementVNode("div",{class:"container"},null,-1)),w={class:"container has-text-centered"},m={key:0,role:"menu",class:"inline-list"};return((t,l)=>{const f=t.__vccOpts||t;for(const[p,a]of l)f[p]=a;return f})(e.defineComponent({__name:"AppFooter",props:{links:{default(){return[]}},isSticky:{type:Boolean,default:!0},isHiddenMobile:{type:Boolean,default:!1}},setup(t){const l=t,f=e.inject("responsiveHelpers"),{responsiveState:p}=f,a=e.computed(()=>p.isMobile),r=e.ref();return e.onMounted(()=>{var i;const o=document.getElementById("app-header"),s=document.querySelector("main");if(s){if(l.isSticky&&r.value)s.style.cssText=s.style.cssText+`padding-bottom: ${r.value.offsetHeight}px`;else if(a.value&&!l.isHiddenMobile||!a.value)if(o){const c=o.offsetHeight+(((i=r.value)==null?void 0:i.offsetHeight)||0);s.style.cssText=s.style.cssText+`min-height: calc(100vh - ${c}px)`}else console.warn("AppFooter: No app-header found, unable to calculate sticky footer height")}else console.warn("AppFooter: No main element found, unable to calculate sticky footer height")}),(o,s)=>{const i=e.resolveComponent("nav-link");return a.value&&!o.isHiddenMobile||!a.value?(e.openBlock(),e.createElementBlock("footer",{key:0,id:"app-footer",ref_key:"footer",ref:r,class:e.normalizeClass({"is-sticky":o.isSticky})},[d,e.createElementVNode("div",w,[o.links.length>0?(e.openBlock(),e.createElementBlock("ul",m,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.links,(c,h)=>(e.openBlock(),e.createElementBlock("li",{key:`fl-${h}`,role:"none"},[e.createVNode(i,e.mergeProps({ref_for:!0},c,{role:"menuitem"}),null,16)]))),128))])):e.renderSlot(o.$slots,"default",{key:1},void 0,!0)])],2)):e.createCommentVNode("",!0)}}}),[["__scopeId","data-v-f34d21d1"]])});
2
+ /*$vite$:1*/`,document.head.appendChild(n);const d={class:"container has-text-centered"},w={key:0,role:"menu",class:"inline-list"};return((s,l)=>{const f=s.__vccOpts||s;for(const[p,a]of l)f[p]=a;return f})(e.defineComponent({__name:"AppFooter",props:{links:{default(){return[]}},isSticky:{type:Boolean,default:!0},isHiddenMobile:{type:Boolean,default:!1}},setup(s){const l=s,f=e.inject("responsiveHelpers"),{responsiveState:p}=f,a=e.computed(()=>p.isMobile),r=e.ref();return e.onMounted(()=>{var i;const t=document.getElementById("app-header"),o=document.querySelector("main");if(o){if(l.isSticky&&r.value)o.style.cssText=o.style.cssText+`padding-bottom: ${r.value.offsetHeight}px`;else if(a.value&&!l.isHiddenMobile||!a.value)if(t){const c=t.offsetHeight+(((i=r.value)==null?void 0:i.offsetHeight)||0);o.style.cssText=o.style.cssText+`min-height: calc(100vh - ${c}px)`}else console.warn("AppFooter: No app-header found, unable to calculate sticky footer height")}else console.warn("AppFooter: No main element found, unable to calculate sticky footer height")}),(t,o)=>{const i=e.resolveComponent("nav-link");return a.value&&!t.isHiddenMobile||!a.value?(e.openBlock(),e.createElementBlock("footer",{key:0,id:"app-footer",ref_key:"footer",ref:r,class:e.normalizeClass({"is-sticky":t.isSticky})},[o[0]||(o[0]=e.createElementVNode("div",{class:"container"},null,-1)),e.createElementVNode("div",d,[t.links.length>0?(e.openBlock(),e.createElementBlock("ul",w,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.links,(c,m)=>(e.openBlock(),e.createElementBlock("li",{key:`fl-${m}`,role:"none"},[e.createVNode(i,e.mergeProps({ref_for:!0},c,{role:"menuitem"}),null,16)]))),128))])):e.renderSlot(t.$slots,"default",{key:1},void 0,!0)])],2)):e.createCommentVNode("",!0)}}}),[["__scopeId","data-v-f34d21d1"]])});
@@ -1,20 +1,22 @@
1
1
  import { AppFooterProps } from './types';
2
2
 
3
- declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<AppFooterProps>, {
3
+ declare function __VLS_template(): {
4
+ default?(_: {}): any;
5
+ };
6
+ declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<AppFooterProps>, {
4
7
  links(): never[];
5
8
  isSticky: boolean;
6
9
  isHiddenMobile: boolean;
7
- }>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<AppFooterProps>, {
10
+ }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<AppFooterProps>, {
8
11
  links(): never[];
9
12
  isSticky: boolean;
10
13
  isHiddenMobile: boolean;
11
- }>>>, {
14
+ }>>> & Readonly<{}>, {
12
15
  links: import('@phila/phila-ui-nav-link').NavLinkProps[];
13
16
  isSticky: boolean;
14
17
  isHiddenMobile: boolean;
15
- }, {}>, {
16
- default?(_: {}): any;
17
- }>;
18
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
19
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
18
20
  export default _default;
19
21
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
20
22
  type __VLS_TypePropsToRuntimeProps<T> = {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@phila/phila-ui-app-footer",
3
3
  "private": false,
4
- "version": "0.0.18",
4
+ "version": "0.0.22",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist"
@@ -25,8 +25,8 @@
25
25
  "preview": "vite preview"
26
26
  },
27
27
  "dependencies": {
28
- "@phila/phila-ui-core": "^1.0.21",
29
- "@phila/phila-ui-nav-link": "^0.0.11",
28
+ "@phila/phila-ui-core": "^1.0.24",
29
+ "@phila/phila-ui-nav-link": "^0.0.13",
30
30
  "bulma": "^0.9.4",
31
31
  "vue": "^3.3.8"
32
32
  },
@@ -34,15 +34,15 @@
34
34
  "@types/node": "^20.10.3",
35
35
  "@vitejs/plugin-vue": "^4.5.0",
36
36
  "sass": "^1.69.5",
37
- "typescript": "^5.2.2",
37
+ "typescript": "^5.8.2",
38
38
  "vite": "^5.0.0",
39
39
  "vite-plugin-dts": "^3.6.4",
40
40
  "vite-plugin-lib-inject-css": "^1.3.0",
41
- "vue-tsc": "^1.8.22"
41
+ "vue-tsc": "^2.2.8"
42
42
  },
43
43
  "publishConfig": {
44
44
  "registry": "https://registry.npmjs.com/",
45
45
  "access": "public"
46
46
  },
47
- "gitHead": "7beebf0e6eb642e0ff731041d46281f71923c0d4"
47
+ "gitHead": "f00518592815b1bf558d88f77fc4b6b3a30296e5"
48
48
  }