@kong-ui-public/sandbox-layout 2.3.7-pr.2592.60d898979.0 → 2.3.7-pr.2604.449d9d72a.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.
@@ -0,0 +1,163 @@
1
+ import { defineComponent as y, inject as N, resolveComponent as k, createElementBlock as s, openBlock as l, createCommentVNode as _, unref as u, Fragment as T, renderList as $, createVNode as e, withCtx as d, createTextVNode as x, toDisplayString as p, useCssVars as K, computed as L, provide as O, createElementVNode as o, renderSlot as b } from "vue";
2
+ import { MenuIcon as E, CogIcon as V } from "@kong/icons";
3
+ const S = "kong-ui-sandbox-layout-links", z = {
4
+ key: 0,
5
+ class: "kong-ui-sandbox-navigation"
6
+ }, A = /* @__PURE__ */ y({
7
+ __name: "SandboxNavigation",
8
+ emits: ["router-link-click"],
9
+ setup(n, { emit: i }) {
10
+ const c = i, t = N(S, []);
11
+ return (h, g) => {
12
+ const v = k("router-link");
13
+ return l(), s("nav", null, [
14
+ u(t).length ? (l(), s("ul", z, [
15
+ (l(!0), s(T, null, $(u(t), (a) => (l(), s("li", {
16
+ key: a.name,
17
+ class: "sandbox-link"
18
+ }, [
19
+ e(v, {
20
+ to: a.to,
21
+ onClick: (m) => c("router-link-click", a)
22
+ }, {
23
+ default: d(() => [
24
+ x(p(a.name), 1)
25
+ ]),
26
+ _: 2
27
+ }, 1032, ["to", "onClick"])
28
+ ]))), 128))
29
+ ])) : _("", !0)
30
+ ]);
31
+ };
32
+ }
33
+ }), I = (n, i) => {
34
+ const c = n.__vccOpts || n;
35
+ for (const [t, h] of i)
36
+ c[t] = h;
37
+ return c;
38
+ }, f = /* @__PURE__ */ I(A, [["__scopeId", "data-v-2cb154ed"]]), C = "24px", B = { class: "kong-ui-sandbox-layout" }, M = { class: "header" }, U = { class: "header-left" }, W = { class: "mobile-nav-container" }, D = { class: "toggle-mobile-nav" }, R = {
39
+ key: 0,
40
+ class: "mobile-title"
41
+ }, Y = { class: "header-right" }, j = {
42
+ key: 0,
43
+ class: "mobile-controls-container"
44
+ }, q = { class: "toggle-mobile-controls" }, w = { class: "layout" }, F = { class: "desktop-nav-container" }, G = { class: "sandbox-container" }, J = { key: 0 }, X = {
45
+ key: 0,
46
+ class: "sandbox-controls"
47
+ }, Z = /* @__PURE__ */ y({
48
+ __name: "SandboxLayout",
49
+ props: {
50
+ title: {
51
+ type: String,
52
+ default: ""
53
+ },
54
+ links: {
55
+ type: Array,
56
+ required: !1,
57
+ default: () => []
58
+ },
59
+ controlsMinWidth: {
60
+ type: Number,
61
+ default: 240
62
+ }
63
+ },
64
+ setup(n) {
65
+ K((t) => ({
66
+ v4f585fbc: c.value
67
+ }));
68
+ const i = n;
69
+ O(S, i.links);
70
+ const c = L(() => `${i.controlsMinWidth}px`);
71
+ return (t, h) => {
72
+ const g = k("KSlideout"), v = k("KToggle"), a = k("router-link");
73
+ return l(), s("div", B, [
74
+ o("header", M, [
75
+ o("div", U, [
76
+ o("div", W, [
77
+ e(v, null, {
78
+ default: d(({ isToggled: m, toggle: r }) => [
79
+ o("div", null, [
80
+ o("div", D, [
81
+ e(u(E), {
82
+ role: "button",
83
+ size: u(C),
84
+ title: "Toggle menu",
85
+ onClick: r
86
+ }, null, 8, ["size", "onClick"])
87
+ ]),
88
+ e(g, {
89
+ title: "Main Menu",
90
+ visible: m.value,
91
+ onClose: r
92
+ }, {
93
+ default: d(() => [
94
+ e(f, { onRouterLinkClick: r }, null, 8, ["onRouterLinkClick"])
95
+ ]),
96
+ _: 2
97
+ }, 1032, ["visible", "onClose"])
98
+ ])
99
+ ]),
100
+ _: 1
101
+ }),
102
+ n.title ? (l(), s("h1", R, [
103
+ e(a, {
104
+ class: "home-link",
105
+ to: { name: "home" }
106
+ }, {
107
+ default: d(() => [
108
+ x(p(n.title), 1)
109
+ ]),
110
+ _: 1
111
+ })
112
+ ])) : _("", !0)
113
+ ])
114
+ ]),
115
+ o("div", Y, [
116
+ t.$slots.controls ? (l(), s("div", j, [
117
+ e(v, null, {
118
+ default: d(({ isToggled: m, toggle: r }) => [
119
+ o("div", null, [
120
+ o("div", q, [
121
+ e(u(V), {
122
+ role: "button",
123
+ size: u(C),
124
+ title: "Toggle controls",
125
+ onClick: r
126
+ }, null, 8, ["size", "onClick"])
127
+ ]),
128
+ e(g, {
129
+ title: "Controls",
130
+ visible: m.value,
131
+ onClose: r
132
+ }, {
133
+ default: d(() => [
134
+ b(t.$slots, "controls", {}, void 0, !0)
135
+ ]),
136
+ _: 3
137
+ }, 8, ["visible", "onClose"])
138
+ ])
139
+ ]),
140
+ _: 3
141
+ })
142
+ ])) : _("", !0)
143
+ ])
144
+ ]),
145
+ o("div", w, [
146
+ o("div", F, [
147
+ e(f)
148
+ ]),
149
+ o("div", G, [
150
+ n.title ? (l(), s("h1", J, p(n.title), 1)) : _("", !0),
151
+ b(t.$slots, "default", {}, void 0, !0)
152
+ ]),
153
+ t.$slots.controls ? (l(), s("div", X, [
154
+ b(t.$slots, "controls", {}, void 0, !0)
155
+ ])) : _("", !0)
156
+ ])
157
+ ]);
158
+ };
159
+ }
160
+ }), Q = /* @__PURE__ */ I(Z, [["__scopeId", "data-v-62a393b2"]]);
161
+ export {
162
+ Q as SandboxLayout
163
+ };
@@ -0,0 +1 @@
1
+ (function(n,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@kong/icons")):typeof define=="function"&&define.amd?define(["exports","vue","@kong/icons"],e):(n=typeof globalThis<"u"?globalThis:n||self,e(n["kong-ui-public-sandbox-layout"]={},n.Vue,n.KongIcons))})(this,function(n,e,m){"use strict";const k="kong-ui-sandbox-layout-links",N={key:0,class:"kong-ui-sandbox-navigation"},g=e.defineComponent({__name:"SandboxNavigation",emits:["router-link-click"],setup(o,{emit:l}){const s=l,t=e.inject(k,[]);return(d,_)=>{const r=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("nav",null,[e.unref(t).length?(e.openBlock(),e.createElementBlock("ul",N,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(t),c=>(e.openBlock(),e.createElementBlock("li",{key:c.name,class:"sandbox-link"},[e.createVNode(r,{to:c.to,onClick:a=>s("router-link-click",c)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.name),1)]),_:2},1032,["to","onClick"])]))),128))])):e.createCommentVNode("",!0)])}}}),p=(o,l)=>{const s=o.__vccOpts||o;for(const[t,d]of l)s[t]=d;return s},f=p(g,[["__scopeId","data-v-2cb154ed"]]),h="24px",C={class:"kong-ui-sandbox-layout"},V={class:"header"},b={class:"header-left"},y={class:"mobile-nav-container"},x={class:"toggle-mobile-nav"},E={key:0,class:"mobile-title"},B={class:"header-right"},S={key:0,class:"mobile-controls-container"},u={class:"toggle-mobile-controls"},T={class:"layout"},I={class:"desktop-nav-container"},K={class:"sandbox-container"},L={key:0},$={key:0,class:"sandbox-controls"},O=p(e.defineComponent({__name:"SandboxLayout",props:{title:{type:String,default:""},links:{type:Array,required:!1,default:()=>[]},controlsMinWidth:{type:Number,default:240}},setup(o){e.useCssVars(t=>({v4f585fbc:s.value}));const l=o;e.provide(k,l.links);const s=e.computed(()=>`${l.controlsMinWidth}px`);return(t,d)=>{const _=e.resolveComponent("KSlideout"),r=e.resolveComponent("KToggle"),c=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("div",C,[e.createElementVNode("header",V,[e.createElementVNode("div",b,[e.createElementVNode("div",y,[e.createVNode(r,null,{default:e.withCtx(({isToggled:a,toggle:i})=>[e.createElementVNode("div",null,[e.createElementVNode("div",x,[e.createVNode(e.unref(m.MenuIcon),{role:"button",size:e.unref(h),title:"Toggle menu",onClick:i},null,8,["size","onClick"])]),e.createVNode(_,{title:"Main Menu",visible:a.value,onClose:i},{default:e.withCtx(()=>[e.createVNode(f,{onRouterLinkClick:i},null,8,["onRouterLinkClick"])]),_:2},1032,["visible","onClose"])])]),_:1}),o.title?(e.openBlock(),e.createElementBlock("h1",E,[e.createVNode(c,{class:"home-link",to:{name:"home"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.title),1)]),_:1})])):e.createCommentVNode("",!0)])]),e.createElementVNode("div",B,[t.$slots.controls?(e.openBlock(),e.createElementBlock("div",S,[e.createVNode(r,null,{default:e.withCtx(({isToggled:a,toggle:i})=>[e.createElementVNode("div",null,[e.createElementVNode("div",u,[e.createVNode(e.unref(m.CogIcon),{role:"button",size:e.unref(h),title:"Toggle controls",onClick:i},null,8,["size","onClick"])]),e.createVNode(_,{title:"Controls",visible:a.value,onClose:i},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"controls",{},void 0,!0)]),_:3},8,["visible","onClose"])])]),_:3})])):e.createCommentVNode("",!0)])]),e.createElementVNode("div",T,[e.createElementVNode("div",I,[e.createVNode(f)]),e.createElementVNode("div",K,[o.title?(e.openBlock(),e.createElementBlock("h1",L,e.toDisplayString(o.title),1)):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"default",{},void 0,!0)]),t.$slots.controls?(e.openBlock(),e.createElementBlock("div",$,[e.renderSlot(t.$slots,"controls",{},void 0,!0)])):e.createCommentVNode("",!0)])])}}}),[["__scopeId","data-v-62a393b2"]]);n.SandboxLayout=O,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})});
package/dist/style.css ADDED
@@ -0,0 +1 @@
1
+ .kong-ui-sandbox-navigation[data-v-2cb154ed]{list-style:none;margin:0;padding:0}.kong-ui-sandbox-navigation .sandbox-link[data-v-2cb154ed]{margin-bottom:8px}.kong-ui-sandbox-navigation .sandbox-link[data-v-2cb154ed]:last-of-type{margin-bottom:0}.kong-ui-sandbox-navigation .sandbox-link a[data-v-2cb154ed]{background:#eee;border-radius:4px;color:#0044f4;display:block;font-weight:600;overflow:hidden;padding:8px 16px;text-decoration:none;text-overflow:ellipsis;transition:all .2s ease-in-out;white-space:nowrap}.kong-ui-sandbox-navigation .sandbox-link a[data-v-2cb154ed]:hover{background:#ccc;color:#002099}.kong-ui-sandbox-navigation .sandbox-link a.router-link-exact-active[data-v-2cb154ed],.kong-ui-sandbox-navigation .sandbox-link a.active[data-v-2cb154ed],.kong-ui-sandbox-navigation .sandbox-link a.router-link-exact-active[data-v-2cb154ed]:hover,.kong-ui-sandbox-navigation .sandbox-link a.active[data-v-2cb154ed]:hover{background:#0044f4;color:#fff}html,body{margin:0;padding:0}.kong-ui-sandbox-layout .header[data-v-62a393b2]{align-items:center;border-bottom:1px solid #e0e4ea;display:flex;justify-content:space-between;width:100%}@media (min-width: 1280px){.kong-ui-sandbox-layout .header[data-v-62a393b2]{display:none}}.kong-ui-sandbox-layout .header .header-left[data-v-62a393b2],.kong-ui-sandbox-layout .header .header-right[data-v-62a393b2]{align-items:center;display:flex;gap:20px;padding:20px;width:100%}.kong-ui-sandbox-layout .header .header-right[data-v-62a393b2]{justify-content:flex-end}.kong-ui-sandbox-layout .header h1[data-v-62a393b2]{font-size:18px;margin:0;white-space:nowrap}@media (min-width: 768px){.kong-ui-sandbox-layout .header h1[data-v-62a393b2]{font-size:24px}}.kong-ui-sandbox-layout .layout[data-v-62a393b2]{display:flex;gap:20px;padding:20px}.kong-ui-sandbox-layout .mobile-nav-container[data-v-62a393b2]{align-items:center;display:flex;gap:20px}@media (min-width: 1280px){.kong-ui-sandbox-layout .mobile-nav-container[data-v-62a393b2],.kong-ui-sandbox-layout .mobile-controls-container[data-v-62a393b2],.kong-ui-sandbox-layout .mobile-title[data-v-62a393b2]{display:none}}.kong-ui-sandbox-layout .sandbox-controls[data-v-62a393b2],.kong-ui-sandbox-layout .desktop-nav-container[data-v-62a393b2]{display:none}@media (min-width: 1280px){.kong-ui-sandbox-layout .sandbox-controls[data-v-62a393b2],.kong-ui-sandbox-layout .desktop-nav-container[data-v-62a393b2]{display:block}}.kong-ui-sandbox-layout .desktop-nav-container[data-v-62a393b2]{min-width:240px}.kong-ui-sandbox-layout .sandbox-container[data-v-62a393b2]{min-height:50vh;width:100%}@media (min-width: 1280px){.kong-ui-sandbox-layout .sandbox-container[data-v-62a393b2]{border:1px solid #e0e4ea;border-radius:6px;padding:20px}}.kong-ui-sandbox-layout .sandbox-container h1[data-v-62a393b2]{margin:0 0 20px}.kong-ui-sandbox-layout .sandbox-controls[data-v-62a393b2]{min-width:var(--v4f585fbc)}@media (min-width: 1280px){.kong-ui-sandbox-layout .sandbox-controls[data-v-62a393b2]{border:1px solid #e0e4ea;border-radius:6px;padding:20px}}.kong-ui-sandbox-layout .home-link[data-v-62a393b2],.kong-ui-sandbox-layout .home-link[data-v-62a393b2]:visited{color:#0044f4;text-decoration:none}.kong-ui-sandbox-layout .toggle-mobile-nav[data-v-62a393b2],.kong-ui-sandbox-layout .toggle-mobile-controls[data-v-62a393b2]{color:#0044f4;cursor:pointer;transition:color .2s ease-in-out}.kong-ui-sandbox-layout .toggle-mobile-nav[data-v-62a393b2]:hover,.kong-ui-sandbox-layout .toggle-mobile-controls[data-v-62a393b2]:hover{color:#0030cc}.kong-ui-sandbox-layout[data-v-62a393b2] .k-slideout,.kong-ui-sandbox-layout[data-v-62a393b2] .k-card-body{font-size:16px}
@@ -0,0 +1,51 @@
1
+ import type { PropType } from 'vue';
2
+ import type { SandboxNavigationItem } from '../types';
3
+ declare var __VLS_55: {}, __VLS_61: {}, __VLS_63: {};
4
+ type __VLS_Slots = {} & {
5
+ controls?: (props: typeof __VLS_55) => any;
6
+ } & {
7
+ default?: (props: typeof __VLS_61) => any;
8
+ } & {
9
+ controls?: (props: typeof __VLS_63) => any;
10
+ };
11
+ declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
12
+ title: {
13
+ type: StringConstructor;
14
+ default: string;
15
+ };
16
+ links: {
17
+ type: PropType<SandboxNavigationItem[]>;
18
+ required: false;
19
+ default: () => never[];
20
+ };
21
+ controlsMinWidth: {
22
+ type: NumberConstructor;
23
+ default: number;
24
+ };
25
+ }>, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
26
+ title: {
27
+ type: StringConstructor;
28
+ default: string;
29
+ };
30
+ links: {
31
+ type: PropType<SandboxNavigationItem[]>;
32
+ required: false;
33
+ default: () => never[];
34
+ };
35
+ controlsMinWidth: {
36
+ type: NumberConstructor;
37
+ default: number;
38
+ };
39
+ }>> & Readonly<{}>, {
40
+ title: string;
41
+ links: SandboxNavigationItem[];
42
+ controlsMinWidth: number;
43
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
44
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
45
+ export default _default;
46
+ type __VLS_WithSlots<T, S> = T & {
47
+ new (): {
48
+ $slots: S;
49
+ };
50
+ };
51
+ //# sourceMappingURL=SandboxLayout.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SandboxLayout.vue.d.ts","sourceRoot":"","sources":["../../../src/components/SandboxLayout.vue"],"names":[],"mappings":"AAiPA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAA;AACnC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AA+SrD,QAAA,IAAI,QAAQ,IAAW,EAAE,QAAQ,IAAW,EAAE,QAAQ,IAAY,CAAE;AACpE,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,GAC9C;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,GAC7C;IAAE,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAqCjD,QAAA,MAAM,eAAe;;;;;;cASF,QAAQ,CAAC,qBAAqB,EAAE,CAAC;;;;;;;;;;;;;;cAAjC,QAAQ,CAAC,qBAAqB,EAAE,CAAC;;;;;;;;;;;;4EASlD,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAE1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -0,0 +1,7 @@
1
+ declare const _default: import("vue").DefineComponent<{}, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
2
+ "router-link-click": (link: string | import("vue-router").RouteLocationAsRelativeGeneric | import("vue-router").RouteLocationAsPathGeneric) => any;
3
+ }, string, import("vue").PublicProps, Readonly<{}> & Readonly<{
4
+ "onRouter-link-click"?: ((link: string | import("vue-router").RouteLocationAsRelativeGeneric | import("vue-router").RouteLocationAsPathGeneric) => any) | undefined;
5
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
6
+ export default _default;
7
+ //# sourceMappingURL=SandboxNavigation.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SandboxNavigation.vue.d.ts","sourceRoot":"","sources":["../../../src/components/SandboxNavigation.vue"],"names":[],"mappings":";;;;;AAuLA,wBAIG"}
@@ -0,0 +1,2 @@
1
+ export declare const KONG_UI_SANDBOX_LAYOUT_LINKS_INJECTION_KEY = "kong-ui-sandbox-layout-links";
2
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,0CAA0C,iCAAiC,CAAA"}
@@ -0,0 +1,4 @@
1
+ import SandboxLayout from './components/SandboxLayout.vue';
2
+ export { SandboxLayout };
3
+ export * from './types';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,gCAAgC,CAAA;AAE1D,OAAO,EAAE,aAAa,EAAE,CAAA;AAExB,cAAc,SAAS,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './navigation';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAIA,cAAc,cAAc,CAAA"}
@@ -0,0 +1,8 @@
1
+ import type { RouteLocationRaw } from 'vue-router';
2
+ export interface SandboxNavigationItem {
3
+ /** The name of the item to display in the navigation, e.g. `My page` */
4
+ name: string;
5
+ /** The router link object, e.g. `{ name: 'my-page' }` */
6
+ to: RouteLocationRaw;
7
+ }
8
+ //# sourceMappingURL=navigation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../../src/types/navigation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAElD,MAAM,WAAW,qBAAqB;IACpC,wEAAwE;IACxE,IAAI,EAAE,MAAM,CAAA;IACZ,yDAAyD;IACzD,EAAE,EAAE,gBAAgB,CAAA;CACrB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kong-ui-public/sandbox-layout",
3
- "version": "2.3.7-pr.2592.60d898979.0",
3
+ "version": "2.3.7-pr.2604.449d9d72a.0",
4
4
  "type": "module",
5
5
  "main": "./dist/sandbox-layout.umd.js",
6
6
  "module": "./dist/sandbox-layout.es.js",
@@ -23,7 +23,7 @@
23
23
  "devDependencies": {
24
24
  "@kong/design-tokens": "1.18.0",
25
25
  "@kong/kongponents": "9.43.2",
26
- "vue": "^3.5.13",
26
+ "vue": "^3.5.22",
27
27
  "vue-router": "^4.4.5"
28
28
  },
29
29
  "repository": {