@kiva/kv-components 10.3.0 → 10.4.0

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.
@@ -1 +1 @@
1
- .kv-secondary-nav-holder[data-v-230060bf]{height:62px}.kv-secondary-nav[data-v-230060bf]{min-height:62px}
1
+ .kv-secondary-nav-holder[data-v-0dd9683b]{height:62px}.kv-secondary-nav[data-v-0dd9683b]{min-height:62px}
@@ -1,69 +1,74 @@
1
1
  import x from "./KvSecondaryNav2.js";
2
- import { resolveComponent as l, openBlock as i, createBlock as d, withCtx as o, createElementVNode as r, normalizeClass as a, createVNode as v, createElementBlock as c, resolveDynamicComponent as s, createTextVNode as m, toDisplayString as _, createCommentVNode as u, Fragment as y, renderList as b } from "vue";
2
+ import { resolveComponent as d, openBlock as a, createBlock as c, withCtx as l, createElementVNode as r, normalizeClass as i, createVNode as s, createElementBlock as o, resolveDynamicComponent as v, Fragment as m, createTextVNode as g, toDisplayString as h, createCommentVNode as y, renderList as b } from "vue";
3
3
  import "./KvSecondaryNav.css";
4
4
  import C from "../_virtual/_plugin-vue_export-helper.js";
5
- const L = { class: "kv-secondary-nav__links tw-flex tw-flex-col md:tw-flex-row tw-items-center tw-gap-3" };
6
- function N(p, w, t, e, E, A) {
7
- const g = l("kv-material-icon"), h = l("kv-page-container"), k = l("kv-theme-provider");
8
- return i(), d(k, { theme: e.themeStyle }, {
9
- default: o(() => [
5
+ const L = ["src", "alt"], N = { class: "kv-secondary-nav__links tw-flex tw-flex-col md:tw-flex-row tw-items-center tw-gap-3" };
6
+ function E(I, w, t, e, A, H) {
7
+ const _ = d("kv-material-icon"), k = d("kv-page-container"), f = d("kv-theme-provider");
8
+ return a(), c(f, { theme: e.themeStyle }, {
9
+ default: l(() => [
10
10
  r("div", {
11
- class: a(["tw-z-1 tw-w-full kv-secondary-nav-holder relative tw-text-primary", e.bgClass])
11
+ class: i(["tw-z-1 tw-w-full kv-secondary-nav-holder relative tw-text-primary", e.bgClass])
12
12
  }, [
13
13
  r("div", {
14
- class: a(["tw-w-full tw-overflow-x-auto kv-secondary-nav tw-absolute tw-top-0 tw-left-0 tw-right-0", e.bgClass])
14
+ class: i(["tw-w-full tw-overflow-x-auto kv-secondary-nav tw-absolute tw-top-0 tw-left-0 tw-right-0", e.bgClass])
15
15
  }, [
16
- v(h, null, {
17
- default: o(() => [
16
+ s(k, null, {
17
+ default: l(() => [
18
18
  r("div", {
19
19
  ref: "navInner",
20
- class: a(["kv-secondary-nav__inner tw-flex tw-gap-2 md:tw-gap-4 tw-items-center tw-flex-wrap tw-py-2", e.navAlignmentClass])
20
+ class: i(["kv-secondary-nav__inner tw-flex tw-gap-2 md:tw-gap-4 tw-items-center tw-flex-wrap tw-py-2", e.navAlignmentClass])
21
21
  }, [
22
- t.heading && t.heading.length > 0 ? (i(), c("div", {
22
+ e.hasHeadingContent ? (a(), o("div", {
23
23
  key: 0,
24
- class: a(["kv-secondary-nav__heading-container", { "tw-block md:tw-hidden": t.linkAlignment === "left" || t.linkAlignment === "center" }])
24
+ class: i(["kv-secondary-nav__heading-container", { "tw-block md:tw-hidden": t.linkAlignment === "left" || t.linkAlignment === "center" }])
25
25
  }, [
26
- (i(), d(s(e.hasHeadingLink ? t.headingLink.isExternal ? "a" : "router-link" : "div"), {
26
+ (a(), c(v(e.hasHeadingLink ? t.headingLink.isExternal ? "a" : "router-link" : "div"), {
27
27
  to: e.hasHeadingLink ? t.headingLink.isExternal ? void 0 : t.headingLink.href : void 0,
28
28
  href: e.hasHeadingLink && t.headingLink.isExternal ? t.headingLink.href : void 0,
29
- class: a(["kv-secondary-nav__heading tw-text-h3 tw-text-primary tw-bg-transparent tw-border-none tw-no-underline", {
30
- "tw-cursor-pointer": e.hasHeadingLink
31
- }])
29
+ class: i(["kv-secondary-nav__heading tw-text-h3 tw-text-primary tw-bg-transparent tw-border-none tw-no-underline", { "tw-cursor-pointer": e.hasHeadingLink }])
32
30
  }, {
33
- default: o(() => [
34
- m(_(t.heading), 1)
31
+ default: l(() => [
32
+ t.headingImage && t.headingImage.url ? (a(), o("img", {
33
+ key: 0,
34
+ src: t.headingImage.url,
35
+ alt: t.headingImage.alt || t.heading,
36
+ class: "tw-max-h-2.5 tw-w-auto"
37
+ }, null, 8, L)) : (a(), o(m, { key: 1 }, [
38
+ g(h(t.heading), 1)
39
+ ], 64))
35
40
  ]),
36
41
  _: 1
37
42
  }, 8, ["to", "href", "class"]))
38
- ], 2)) : u("", !0),
43
+ ], 2)) : y("", !0),
39
44
  r("button", {
40
45
  class: "kv-secondary-nav__toggle tw-flex md:tw-hidden tw-text-primary tw-bg-transparent tw-border-none tw-cursor-pointer",
41
46
  onClick: w[0] || (w[0] = (...n) => e.toggleSubNavigation && e.toggleSubNavigation(...n))
42
47
  }, [
43
- v(g, {
48
+ s(_, {
44
49
  icon: e.subNavigationOpen ? e.mdiChevronUp : e.mdiChevronDown
45
50
  }, null, 8, ["icon"])
46
51
  ]),
47
52
  r("div", {
48
53
  ref: "subNavigation",
49
- class: a(["kv-secondary-nav__links-container tw-pt-1 md:tw-pt-0 md:tw-block tw-w-full md:tw-w-auto", { "tw-hidden": !e.subNavigationOpen }])
54
+ class: i(["kv-secondary-nav__links-container tw-pt-1 md:tw-pt-0 md:tw-block tw-w-full md:tw-w-auto", { "tw-hidden": !e.subNavigationOpen }])
50
55
  }, [
51
- r("ul", L, [
52
- (i(!0), c(y, null, b(t.links, (n, f) => (i(), c("li", {
53
- key: f,
56
+ r("ul", N, [
57
+ (a(!0), o(m, null, b(t.links, (n, u) => (a(), o("li", {
58
+ key: u,
54
59
  class: "kv-secondary-nav__link-item tw-w-full md:tw-w-auto"
55
60
  }, [
56
- (i(), d(s(n.isExternal ? "a" : "router-link"), {
61
+ (a(), c(v(n.isExternal ? "a" : "router-link"), {
57
62
  to: n.isExternal ? void 0 : n.href,
58
63
  href: n.isExternal ? n.href : void 0,
59
- class: a([{
64
+ class: i([{
60
65
  "tw-underline": n.isActive,
61
66
  "tw-no-underline": !n.isActive
62
67
  }, "kv-secondary-nav__link tw-py-2 md:tw-py-n tw-text-primary tw-font-medium hover:tw-underline hover:tw-text-primary tw-cursor-pointer"]),
63
68
  onClick: (S) => e.handleLinkClick(n)
64
69
  }, {
65
- default: o(() => [
66
- m(_(n.text), 1)
70
+ default: l(() => [
71
+ g(h(n.text), 1)
67
72
  ]),
68
73
  _: 2
69
74
  }, 1032, ["to", "href", "class", "onClick"]))
@@ -80,7 +85,7 @@ function N(p, w, t, e, E, A) {
80
85
  _: 1
81
86
  }, 8, ["theme"]);
82
87
  }
83
- const z = /* @__PURE__ */ C(x, [["render", N], ["__scopeId", "data-v-230060bf"]]);
88
+ const O = /* @__PURE__ */ C(x, [["render", E], ["__scopeId", "data-v-0dd9683b"]]);
84
89
  export {
85
- z as default
90
+ O as default
86
91
  };
@@ -32,8 +32,16 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
32
32
  default: string;
33
33
  validator(value: string): boolean;
34
34
  };
35
+ headingImage: {
36
+ type: PropType<{
37
+ url?: string;
38
+ alt?: string;
39
+ }>;
40
+ default: () => {};
41
+ };
35
42
  }>, {
36
43
  hasHeadingLink: import('vue').ComputedRef<string>;
44
+ hasHeadingContent: import('vue').ComputedRef<boolean>;
37
45
  navAlignmentClass: import('vue').ComputedRef<"" | "tw-justify-between" | "tw-justify-between md:tw-justify-end" | "tw-justify-between md:tw-justify-start" | "tw-justify-between md:tw-justify-center">;
38
46
  toggleSubNavigation: () => void;
39
47
  subNavigationOpen: import('vue').Ref<boolean, boolean>;
@@ -69,6 +77,13 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
69
77
  default: string;
70
78
  validator(value: string): boolean;
71
79
  };
80
+ headingImage: {
81
+ type: PropType<{
82
+ url?: string;
83
+ alt?: string;
84
+ }>;
85
+ default: () => {};
86
+ };
72
87
  }>> & Readonly<{
73
88
  onSubnavLinkClicked?: (...args: any[]) => any;
74
89
  }>, {
@@ -77,6 +92,10 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
77
92
  heading: string;
78
93
  headingLink: NavLink;
79
94
  linkAlignment: string;
95
+ headingImage: {
96
+ url?: string;
97
+ alt?: string;
98
+ };
80
99
  }, {}, {
81
100
  KvThemeProvider: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
82
101
  tag: {
@@ -1,15 +1,15 @@
1
- import { toRefs as c, ref as g, computed as n } from "vue";
2
- import { stoneLightTheme as y, marigoldLightTheme as p, greenDarkTheme as b, greenLightTheme as v, defaultTheme as w } from "@kiva/kv-tokens";
3
- import { mdiChevronDown as k, mdiChevronUp as L } from "@mdi/js";
4
- import C from "./KvThemeProvider.js";
5
- import j from "./KvMaterialIcon.js";
6
- import O from "./KvPageContainer.js";
1
+ import { toRefs as p, computed as n, ref as g } from "vue";
2
+ import { stoneLightTheme as b, marigoldLightTheme as v, greenDarkTheme as w, greenLightTheme as k, defaultTheme as C } from "@kiva/kv-tokens";
3
+ import { mdiChevronDown as L, mdiChevronUp as j } from "@mdi/js";
4
+ import O from "./KvThemeProvider.js";
5
+ import S from "./KvMaterialIcon.js";
6
+ import P from "./KvPageContainer.js";
7
7
  const _ = {
8
8
  name: "KvSecondaryNav",
9
9
  components: {
10
- KvThemeProvider: C,
11
- KvMaterialIcon: j,
12
- KvPageContainer: O
10
+ KvThemeProvider: O,
11
+ KvMaterialIcon: S,
12
+ KvPageContainer: P
13
13
  },
14
14
  props: {
15
15
  heading: {
@@ -52,6 +52,10 @@ const _ = {
52
52
  "stoneLight"
53
53
  ].includes(e);
54
54
  }
55
+ },
56
+ headingImage: {
57
+ type: Object,
58
+ default: () => ({})
55
59
  }
56
60
  },
57
61
  emits: [
@@ -59,34 +63,39 @@ const _ = {
59
63
  ],
60
64
  setup(e, { emit: r }) {
61
65
  const {
62
- heading: l,
63
- linkAlignment: a,
64
- theme: s
65
- } = c(e), u = g(null), i = g(!1), m = n(() => e.headingLink && e.headingLink.href), d = n(() => a.value === "right" ? l.value && l.value.length > 0 ? "tw-justify-between" : "tw-justify-between md:tw-justify-end" : a.value === "left" ? "tw-justify-between md:tw-justify-start" : a.value === "center" ? "tw-justify-between md:tw-justify-center" : ""), o = {
66
- default: { style: w, bgClass: "tw-bg-secondary" },
67
- greenLight: { style: v, bgClass: "tw-bg-secondary" },
68
- greenDark: { style: b, bgClass: "tw-bg-primary" },
69
- marigoldLight: { style: p, bgClass: "tw-bg-primary" },
70
- stoneLight: { style: y, bgClass: "tw-bg-primary" }
71
- }, h = n(() => {
66
+ heading: a,
67
+ linkAlignment: i,
68
+ theme: s,
69
+ headingImage: u
70
+ } = p(e), d = n(() => {
71
+ var t;
72
+ return a.value && a.value.length > 0 || !!((t = u.value) != null && t.url);
73
+ }), h = g(null), l = g(!1), m = n(() => e.headingLink && e.headingLink.href), c = n(() => i.value === "right" ? a.value && a.value.length > 0 ? "tw-justify-between" : "tw-justify-between md:tw-justify-end" : i.value === "left" ? "tw-justify-between md:tw-justify-start" : i.value === "center" ? "tw-justify-between md:tw-justify-center" : ""), o = {
74
+ default: { style: C, bgClass: "tw-bg-secondary" },
75
+ greenLight: { style: k, bgClass: "tw-bg-secondary" },
76
+ greenDark: { style: w, bgClass: "tw-bg-primary" },
77
+ marigoldLight: { style: v, bgClass: "tw-bg-primary" },
78
+ stoneLight: { style: b, bgClass: "tw-bg-primary" }
79
+ }, f = n(() => {
72
80
  var t;
73
81
  return (t = o[s.value]) == null ? void 0 : t.style;
74
- }), f = n(() => {
82
+ }), y = n(() => {
75
83
  var t;
76
84
  return ((t = o[s.value]) == null ? void 0 : t.bgClass) ?? "tw-bg-primary";
77
85
  });
78
86
  return {
79
87
  hasHeadingLink: m,
80
- navAlignmentClass: d,
88
+ hasHeadingContent: d,
89
+ navAlignmentClass: c,
81
90
  toggleSubNavigation: () => {
82
- i.value = !i.value;
91
+ l.value = !l.value;
83
92
  },
84
- subNavigationOpen: i,
85
- mdiChevronUp: L,
86
- mdiChevronDown: k,
87
- subNavigation: u,
88
- themeStyle: h,
89
- bgClass: f,
93
+ subNavigationOpen: l,
94
+ mdiChevronUp: j,
95
+ mdiChevronDown: L,
96
+ subNavigation: h,
97
+ themeStyle: f,
98
+ bgClass: y,
90
99
  handleLinkClick: (t) => {
91
100
  r("subnavLinkClicked", t);
92
101
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiva/kv-components",
3
- "version": "10.3.0",
3
+ "version": "10.4.0",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -112,5 +112,5 @@
112
112
  "dependencies": {
113
113
  "fuse.js": "^7.1.0"
114
114
  },
115
- "gitHead": "85947c6f6991c7ef893d142a4aac78afe3017d06"
115
+ "gitHead": "85f612013133d5c2488e0ea23e81c576d1d1663f"
116
116
  }