@kong-ui-public/sandbox-layout 2.8.0 → 2.8.1-pr.3948.a10ca59e2.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,30 +1,33 @@
1
- import { defineComponent as f, inject as B, resolveComponent as k, openBlock as n, createElementBlock as l, unref as c, Fragment as x, renderList as N, createVNode as i, withCtx as m, createTextVNode as O, toDisplayString as b, createCommentVNode as u, ref as E, computed as K, effectScope as V, watch as w, createElementVNode as t, createBlock as C, normalizeClass as G, resolveDynamicComponent as H, isRef as R, useCssVars as W, provide as X, renderSlot as g } from "vue";
2
- import { DarkModeIcon as P, LightModeIcon as Y, MenuIcon as F, CogIcon as Z } from "@kong/icons";
3
- const D = "kong-ui-sandbox-layout-links", z = "kong-ui-sandbox-theme", j = "electric-lime-day", q = [
1
+ import { defineComponent as y, inject as G, resolveComponent as v, openBlock as n, createElementBlock as l, unref as c, Fragment as K, renderList as M, createVNode as s, withCtx as h, createTextVNode as A, toDisplayString as b, createCommentVNode as u, ref as C, computed as D, effectScope as H, watch as W, isRef as I, createElementVNode as o, createBlock as $, normalizeClass as X, resolveDynamicComponent as P, useCssVars as R, provide as Y, renderSlot as k } from "vue";
2
+ import { DarkModeIcon as F, LightModeIcon as Z, MenuIcon as j, CogIcon as q } from "@kong/icons";
3
+ const L = "kong-ui-sandbox-layout-links", U = "kong-ui-sandbox-theme", J = "mono-lime-day", Q = [
4
+ { label: "Mono lime", value: "mono-lime" },
5
+ { label: "Electric lime", value: "electric-lime" }
6
+ ], ee = [
4
7
  { label: "Day", value: "day" },
5
8
  { label: "Night", value: "night" }
6
- ], J = {
9
+ ], te = {
7
10
  key: 0,
8
11
  class: "kong-ui-sandbox-navigation"
9
- }, Q = /* @__PURE__ */ f({
12
+ }, oe = /* @__PURE__ */ y({
10
13
  __name: "SandboxNavigation",
11
14
  emits: ["router-link-click"],
12
- setup(e, { emit: a }) {
13
- const r = a, o = B(D, []);
14
- return (p, d) => {
15
- const v = k("router-link");
15
+ setup(e, { emit: i }) {
16
+ const r = i, t = G(L, []);
17
+ return (g, f) => {
18
+ const a = v("router-link");
16
19
  return n(), l("nav", null, [
17
- c(o).length ? (n(), l("ul", J, [
18
- (n(!0), l(x, null, N(c(o), (_) => (n(), l("li", {
20
+ c(t).length ? (n(), l("ul", te, [
21
+ (n(!0), l(K, null, M(c(t), (_) => (n(), l("li", {
19
22
  key: _.name,
20
23
  class: "sandbox-link"
21
24
  }, [
22
- i(v, {
25
+ s(a, {
23
26
  to: _.to,
24
- onClick: (s) => r("router-link-click", _)
27
+ onClick: (p) => r("router-link-click", _)
25
28
  }, {
26
- default: m(() => [
27
- O(b(_.name), 1)
29
+ default: h(() => [
30
+ A(b(_.name), 1)
28
31
  ]),
29
32
  _: 2
30
33
  }, 1032, ["to", "onClick"])
@@ -33,73 +36,80 @@ const D = "kong-ui-sandbox-layout-links", z = "kong-ui-sandbox-theme", j = "elec
33
36
  ]);
34
37
  };
35
38
  }
36
- }), y = (e, a) => {
39
+ }), S = (e, i) => {
37
40
  const r = e.__vccOpts || e;
38
- for (const [o, p] of a)
39
- r[o] = p;
41
+ for (const [t, g] of i)
42
+ r[t] = g;
40
43
  return r;
41
- }, S = /* @__PURE__ */ y(Q, [["__scopeId", "data-v-f67e3d83"]]), ee = "16px", T = "24px";
42
- function te(e) {
44
+ }, N = /* @__PURE__ */ S(oe, [["__scopeId", "data-v-f67e3d83"]]), ne = "16px", O = "24px";
45
+ function le(e) {
43
46
  return {
47
+ family: e.startsWith("electric-lime") ? "electric-lime" : "mono-lime",
44
48
  mode: e.includes("night") ? "night" : "day",
45
49
  highContrast: e.endsWith("high-contrast")
46
50
  };
47
51
  }
48
- function oe(e, a) {
49
- return a ? `electric-lime-${e}-high-contrast` : `electric-lime-${e}`;
52
+ function se(e, i, r) {
53
+ return r ? `${e}-${i}-high-contrast` : `${e}-${i}`;
50
54
  }
51
- const A = te(
52
- localStorage.getItem(z) || j
53
- ), L = E(A.mode), M = E(A.highContrast), U = K(() => oe(L.value, M.value));
54
- let I = !1;
55
- function ne() {
56
- I || (I = !0, V(!0).run(() => {
57
- w(U, (e) => {
58
- document.documentElement.setAttribute("data-kui-theme", e), localStorage.setItem(z, e);
55
+ const T = le(
56
+ localStorage.getItem(U) || J
57
+ ), V = C(T.family), z = C(T.mode), B = C(T.highContrast), w = D(() => se(V.value, z.value, B.value));
58
+ let x = !1;
59
+ function ie() {
60
+ x || (x = !0, H(!0).run(() => {
61
+ W(w, (e) => {
62
+ document.documentElement.setAttribute("data-kui-theme", e), localStorage.setItem(U, e);
59
63
  }, { immediate: !0 });
60
64
  }));
61
65
  }
62
- function se() {
63
- return ne(), { theme: U, mode: L, highContrast: M };
66
+ function ae() {
67
+ return ie(), { theme: w, family: V, mode: z, highContrast: B };
64
68
  }
65
- const le = { class: "kong-ui-sandbox-theme-picker" }, ie = { class: "theme-picker-row" }, ae = {
69
+ const ce = { class: "kong-ui-sandbox-theme-picker" }, re = { class: "theme-picker-row" }, de = {
66
70
  "aria-label": "Theme",
67
71
  class: "theme-picker-group",
68
72
  role: "radiogroup"
69
- }, ce = ["aria-label", "checked", "value", "onChange"], re = { class: "theme-picker-row" }, de = /* @__PURE__ */ f({
73
+ }, ue = ["aria-label", "checked", "value", "onChange"], _e = { class: "theme-picker-row" }, me = /* @__PURE__ */ y({
70
74
  __name: "SandboxThemePicker",
71
75
  setup(e) {
72
- const { mode: a, highContrast: r } = se(), o = {
73
- day: Y,
74
- night: P
76
+ const { family: i, mode: r, highContrast: t } = ae(), g = {
77
+ day: Z,
78
+ night: F
75
79
  };
76
- return (p, d) => {
77
- const v = k("KTooltip"), _ = k("KInputSwitch");
78
- return n(), l("div", le, [
79
- t("div", ie, [
80
- d[1] || (d[1] = t("span", { class: "theme-picker-label" }, "Theme", -1)),
81
- t("div", ae, [
82
- (n(!0), l(x, null, N(c(q), (s) => (n(), C(v, {
83
- key: s.value,
80
+ return (f, a) => {
81
+ const _ = v("KSegmentedControl"), p = v("KTooltip"), m = v("KInputSwitch");
82
+ return n(), l("div", ce, [
83
+ s(_, {
84
+ modelValue: c(i),
85
+ "onUpdate:modelValue": a[0] || (a[0] = (d) => I(i) ? i.value = d : null),
86
+ "aria-label": "Theme family",
87
+ options: c(Q)
88
+ }, null, 8, ["modelValue", "options"]),
89
+ o("div", re, [
90
+ a[2] || (a[2] = o("span", { class: "theme-picker-label" }, "Theme", -1)),
91
+ o("div", de, [
92
+ (n(!0), l(K, null, M(c(ee), (d) => (n(), $(p, {
93
+ key: d.value,
84
94
  placement: "top",
85
- text: s.label
95
+ text: d.label
86
96
  }, {
87
- default: m(() => [
88
- t("label", {
89
- class: G(["theme-picker-option", { active: s.value === c(a) }])
97
+ default: h(() => [
98
+ o("label", {
99
+ class: X(["theme-picker-option", { active: d.value === c(r) }])
90
100
  }, [
91
- t("input", {
92
- "aria-label": s.label,
93
- checked: s.value === c(a),
101
+ o("input", {
102
+ "aria-label": d.label,
103
+ checked: d.value === c(r),
94
104
  class: "theme-picker-input",
95
105
  name: "sandbox-theme-mode",
96
106
  type: "radio",
97
- value: s.value,
98
- onChange: (h) => a.value = s.value
99
- }, null, 40, ce),
100
- (n(), C(H(o[s.value]), {
107
+ value: d.value,
108
+ onChange: (Ae) => r.value = d.value
109
+ }, null, 40, ue),
110
+ (n(), $(P(g[d.value]), {
101
111
  decorative: "",
102
- size: `var(--kui-icon-size-30, ${c(ee)})`
112
+ size: `var(--kui-icon-size-30, ${c(ne)})`
103
113
  }, null, 8, ["size"]))
104
114
  ], 2)
105
115
  ]),
@@ -107,39 +117,39 @@ const le = { class: "kong-ui-sandbox-theme-picker" }, ie = { class: "theme-picke
107
117
  }, 1032, ["text"]))), 128))
108
118
  ])
109
119
  ]),
110
- t("div", re, [
111
- d[2] || (d[2] = t("span", { class: "theme-picker-label" }, "High contrast", -1)),
112
- i(_, {
113
- modelValue: c(r),
114
- "onUpdate:modelValue": d[0] || (d[0] = (s) => R(r) ? r.value = s : null),
120
+ o("div", _e, [
121
+ a[3] || (a[3] = o("span", { class: "theme-picker-label" }, "High contrast", -1)),
122
+ s(m, {
123
+ modelValue: c(t),
124
+ "onUpdate:modelValue": a[1] || (a[1] = (d) => I(t) ? t.value = d : null),
115
125
  "aria-label": "High contrast"
116
126
  }, null, 8, ["modelValue"])
117
127
  ])
118
128
  ]);
119
129
  };
120
130
  }
121
- }), $ = /* @__PURE__ */ y(de, [["__scopeId", "data-v-d7ba3b0d"]]), ue = { class: "kong-ui-sandbox-layout" }, _e = { class: "header" }, he = { class: "header-left" }, me = { class: "mobile-nav-container" }, ve = { class: "toggle-mobile-nav" }, ke = {
131
+ }), E = /* @__PURE__ */ S(me, [["__scopeId", "data-v-942c4583"]]), he = { class: "kong-ui-sandbox-layout" }, ve = { class: "header" }, pe = { class: "header-left" }, ge = { class: "mobile-nav-container" }, ke = { class: "toggle-mobile-nav" }, fe = {
122
132
  key: 0,
123
133
  class: "nav-theme-picker"
124
- }, ge = {
134
+ }, be = {
125
135
  key: 1,
126
136
  class: "navigation-after"
127
- }, pe = {
137
+ }, ye = {
128
138
  key: 0,
129
139
  class: "mobile-title"
130
- }, be = { class: "header-right" }, fe = {
140
+ }, Ce = { class: "header-right" }, Se = {
131
141
  key: 0,
132
142
  class: "mobile-controls-container"
133
- }, ye = { class: "toggle-mobile-controls" }, Ce = { class: "layout" }, Se = { class: "desktop-nav-container" }, Te = {
143
+ }, Te = { class: "toggle-mobile-controls" }, Ie = { class: "layout" }, $e = { class: "desktop-nav-container" }, Ne = {
134
144
  key: 0,
135
145
  class: "nav-theme-picker"
136
- }, Ie = {
146
+ }, Oe = {
137
147
  key: 1,
138
148
  class: "navigation-after"
139
- }, $e = { class: "sandbox-container" }, xe = { key: 0 }, Ne = {
149
+ }, xe = { class: "sandbox-container" }, Ee = { key: 0 }, Ke = {
140
150
  key: 0,
141
151
  class: "sandbox-controls"
142
- }, Oe = /* @__PURE__ */ f({
152
+ }, Me = /* @__PURE__ */ y({
143
153
  __name: "SandboxLayout",
144
154
  props: {
145
155
  title: {
@@ -162,41 +172,41 @@ const le = { class: "kong-ui-sandbox-theme-picker" }, ie = { class: "theme-picke
162
172
  }
163
173
  },
164
174
  setup(e) {
165
- W((o) => ({
175
+ R((t) => ({
166
176
  v62569402: r.value
167
177
  }));
168
- const a = e;
169
- X(D, a.links);
170
- const r = K(() => `${a.controlsMinWidth}px`);
171
- return (o, p) => {
172
- const d = k("KSlideout"), v = k("KToggle"), _ = k("router-link");
173
- return n(), l("div", ue, [
174
- t("header", _e, [
175
- t("div", he, [
176
- t("div", me, [
177
- i(v, null, {
178
- default: m(({ isToggled: s, toggle: h }) => [
179
- t("div", null, [
180
- t("div", ve, [
181
- i(c(F), {
178
+ const i = e;
179
+ Y(L, i.links);
180
+ const r = D(() => `${i.controlsMinWidth}px`);
181
+ return (t, g) => {
182
+ const f = v("KSlideout"), a = v("KToggle"), _ = v("router-link");
183
+ return n(), l("div", he, [
184
+ o("header", ve, [
185
+ o("div", pe, [
186
+ o("div", ge, [
187
+ s(a, null, {
188
+ default: h(({ isToggled: p, toggle: m }) => [
189
+ o("div", null, [
190
+ o("div", ke, [
191
+ s(c(j), {
182
192
  role: "button",
183
- size: `var(--kui-icon-size-50, ${c(T)})`,
193
+ size: `var(--kui-icon-size-50, ${c(O)})`,
184
194
  title: "Toggle menu",
185
- onClick: h
195
+ onClick: m
186
196
  }, null, 8, ["size", "onClick"])
187
197
  ]),
188
- i(d, {
198
+ s(f, {
189
199
  title: "Main Menu",
190
- visible: s.value,
191
- onClose: h
200
+ visible: p.value,
201
+ onClose: m
192
202
  }, {
193
- default: m(() => [
194
- e.applyTheming ? (n(), l("div", ke, [
195
- i($)
203
+ default: h(() => [
204
+ e.applyTheming ? (n(), l("div", fe, [
205
+ s(E)
196
206
  ])) : u("", !0),
197
- i(S, { onRouterLinkClick: h }, null, 8, ["onRouterLinkClick"]),
198
- o.$slots["navigation-after"] ? (n(), l("div", ge, [
199
- g(o.$slots, "navigation-after", {}, void 0, !0)
207
+ s(N, { onRouterLinkClick: m }, null, 8, ["onRouterLinkClick"]),
208
+ t.$slots["navigation-after"] ? (n(), l("div", be, [
209
+ k(t.$slots, "navigation-after", {}, void 0, !0)
200
210
  ])) : u("", !0)
201
211
  ]),
202
212
  _: 2
@@ -205,39 +215,39 @@ const le = { class: "kong-ui-sandbox-theme-picker" }, ie = { class: "theme-picke
205
215
  ]),
206
216
  _: 3
207
217
  }),
208
- e.title ? (n(), l("h1", pe, [
209
- i(_, {
218
+ e.title ? (n(), l("h1", ye, [
219
+ s(_, {
210
220
  class: "home-link",
211
221
  to: { name: "home" }
212
222
  }, {
213
- default: m(() => [
214
- O(b(e.title), 1)
223
+ default: h(() => [
224
+ A(b(e.title), 1)
215
225
  ]),
216
226
  _: 1
217
227
  })
218
228
  ])) : u("", !0)
219
229
  ])
220
230
  ]),
221
- t("div", be, [
222
- o.$slots.controls ? (n(), l("div", fe, [
223
- i(v, null, {
224
- default: m(({ isToggled: s, toggle: h }) => [
225
- t("div", null, [
226
- t("div", ye, [
227
- i(c(Z), {
231
+ o("div", Ce, [
232
+ t.$slots.controls ? (n(), l("div", Se, [
233
+ s(a, null, {
234
+ default: h(({ isToggled: p, toggle: m }) => [
235
+ o("div", null, [
236
+ o("div", Te, [
237
+ s(c(q), {
228
238
  role: "button",
229
- size: `var(--kui-icon-size-50, ${c(T)})`,
239
+ size: `var(--kui-icon-size-50, ${c(O)})`,
230
240
  title: "Toggle controls",
231
- onClick: h
241
+ onClick: m
232
242
  }, null, 8, ["size", "onClick"])
233
243
  ]),
234
- i(d, {
244
+ s(f, {
235
245
  title: "Controls",
236
- visible: s.value,
237
- onClose: h
246
+ visible: p.value,
247
+ onClose: m
238
248
  }, {
239
- default: m(() => [
240
- g(o.$slots, "controls", {}, void 0, !0)
249
+ default: h(() => [
250
+ k(t.$slots, "controls", {}, void 0, !0)
241
251
  ]),
242
252
  _: 3
243
253
  }, 8, ["visible", "onClose"])
@@ -248,33 +258,34 @@ const le = { class: "kong-ui-sandbox-theme-picker" }, ie = { class: "theme-picke
248
258
  ])) : u("", !0)
249
259
  ])
250
260
  ]),
251
- t("div", Ce, [
252
- t("div", Se, [
253
- e.applyTheming ? (n(), l("div", Te, [
254
- i($)
261
+ o("div", Ie, [
262
+ o("div", $e, [
263
+ e.applyTheming ? (n(), l("div", Ne, [
264
+ s(E)
255
265
  ])) : u("", !0),
256
- i(S),
257
- o.$slots["navigation-after"] ? (n(), l("div", Ie, [
258
- g(o.$slots, "navigation-after", {}, void 0, !0)
266
+ s(N),
267
+ t.$slots["navigation-after"] ? (n(), l("div", Oe, [
268
+ k(t.$slots, "navigation-after", {}, void 0, !0)
259
269
  ])) : u("", !0)
260
270
  ]),
261
- t("div", $e, [
262
- e.title ? (n(), l("h1", xe, b(e.title), 1)) : u("", !0),
263
- g(o.$slots, "default", {}, void 0, !0)
271
+ o("div", xe, [
272
+ e.title ? (n(), l("h1", Ee, b(e.title), 1)) : u("", !0),
273
+ k(t.$slots, "default", {}, void 0, !0)
264
274
  ]),
265
- o.$slots.controls ? (n(), l("div", Ne, [
266
- g(o.$slots, "controls", {}, void 0, !0)
275
+ t.$slots.controls ? (n(), l("div", Ke, [
276
+ k(t.$slots, "controls", {}, void 0, !0)
267
277
  ])) : u("", !0)
268
278
  ])
269
279
  ]);
270
280
  };
271
281
  }
272
- }), De = /* @__PURE__ */ y(Oe, [["__scopeId", "data-v-e36d58ea"]]);
282
+ }), Ue = /* @__PURE__ */ S(Me, [["__scopeId", "data-v-e36d58ea"]]);
273
283
  export {
274
- j as KONG_UI_SANDBOX_DEFAULT_THEME,
275
- D as KONG_UI_SANDBOX_LAYOUT_LINKS_INJECTION_KEY,
276
- q as KONG_UI_SANDBOX_THEME_MODE_OPTIONS,
277
- z as KONG_UI_SANDBOX_THEME_STORAGE_KEY,
278
- De as SandboxLayout,
279
- $ as SandboxThemePicker
284
+ J as KONG_UI_SANDBOX_DEFAULT_THEME,
285
+ L as KONG_UI_SANDBOX_LAYOUT_LINKS_INJECTION_KEY,
286
+ Q as KONG_UI_SANDBOX_THEME_FAMILY_OPTIONS,
287
+ ee as KONG_UI_SANDBOX_THEME_MODE_OPTIONS,
288
+ U as KONG_UI_SANDBOX_THEME_STORAGE_KEY,
289
+ Ue as SandboxLayout,
290
+ E as SandboxThemePicker
280
291
  };
@@ -1 +1 @@
1
- (function(l,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):(l=typeof globalThis<"u"?globalThis:l||self,e(l["kong-ui-public-sandbox-layout"]={},l.Vue,l.KongIcons))})(this,(function(l,e,m){"use strict";const h="kong-ui-sandbox-layout-links",k="kong-ui-sandbox-theme",g="electric-lime-day",f=[{label:"Day",value:"day"},{label:"Night",value:"night"}],T={key:0,class:"kong-ui-sandbox-navigation"},u=e.defineComponent({__name:"SandboxNavigation",emits:["router-link-click"],setup(t,{emit:a}){const c=a,o=e.inject(h,[]);return(_,i)=>{const d=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("nav",null,[e.unref(o).length?(e.openBlock(),e.createElementBlock("ul",T,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(o),s=>(e.openBlock(),e.createElementBlock("li",{key:s.name,class:"sandbox-link"},[e.createVNode(d,{to:s.to,onClick:n=>c("router-link-click",s)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.name),1)]),_:2},1032,["to","onClick"])]))),128))])):e.createCommentVNode("",!0)])}}}),p=(t,a)=>{const c=t.__vccOpts||t;for(const[o,_]of a)c[o]=_;return c},E=p(u,[["__scopeId","data-v-f67e3d83"]]),I="16px",C="24px";function O(t){return{mode:t.includes("night")?"night":"day",highContrast:t.endsWith("high-contrast")}}function x(t,a){return a?`electric-lime-${t}-high-contrast`:`electric-lime-${t}`}const b=O(localStorage.getItem(k)||g),V=e.ref(b.mode),S=e.ref(b.highContrast),B=e.computed(()=>x(V.value,S.value));let y=!1;function $(){y||(y=!0,e.effectScope(!0).run(()=>{e.watch(B,t=>{document.documentElement.setAttribute("data-kui-theme",t),localStorage.setItem(k,t)},{immediate:!0})}))}function K(){return $(),{theme:B,mode:V,highContrast:S}}const D={class:"kong-ui-sandbox-theme-picker"},A={class:"theme-picker-row"},L={"aria-label":"Theme",class:"theme-picker-group",role:"radiogroup"},M=["aria-label","checked","value","onChange"],U={class:"theme-picker-row"},N=p(e.defineComponent({__name:"SandboxThemePicker",setup(t){const{mode:a,highContrast:c}=K(),o={day:m.LightModeIcon,night:m.DarkModeIcon};return(_,i)=>{const d=e.resolveComponent("KTooltip"),s=e.resolveComponent("KInputSwitch");return e.openBlock(),e.createElementBlock("div",D,[e.createElementVNode("div",A,[i[1]||(i[1]=e.createElementVNode("span",{class:"theme-picker-label"},"Theme",-1)),e.createElementVNode("div",L,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(f),n=>(e.openBlock(),e.createBlock(d,{key:n.value,placement:"top",text:n.label},{default:e.withCtx(()=>[e.createElementVNode("label",{class:e.normalizeClass(["theme-picker-option",{active:n.value===e.unref(a)}])},[e.createElementVNode("input",{"aria-label":n.label,checked:n.value===e.unref(a),class:"theme-picker-input",name:"sandbox-theme-mode",type:"radio",value:n.value,onChange:r=>a.value=n.value},null,40,M),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o[n.value]),{decorative:"",size:`var(--kui-icon-size-30, ${e.unref(I)})`},null,8,["size"]))],2)]),_:2},1032,["text"]))),128))])]),e.createElementVNode("div",U,[i[2]||(i[2]=e.createElementVNode("span",{class:"theme-picker-label"},"High contrast",-1)),e.createVNode(s,{modelValue:e.unref(c),"onUpdate:modelValue":i[0]||(i[0]=n=>e.isRef(c)?c.value=n:null),"aria-label":"High contrast"},null,8,["modelValue"])])])}}}),[["__scopeId","data-v-d7ba3b0d"]]),w={class:"kong-ui-sandbox-layout"},z={class:"header"},G={class:"header-left"},H={class:"mobile-nav-container"},X={class:"toggle-mobile-nav"},P={key:0,class:"nav-theme-picker"},Y={key:1,class:"navigation-after"},R={key:0,class:"mobile-title"},F={class:"header-right"},W={key:0,class:"mobile-controls-container"},j={class:"toggle-mobile-controls"},q={class:"layout"},J={class:"desktop-nav-container"},Z={key:0,class:"nav-theme-picker"},Q={key:1,class:"navigation-after"},v={class:"sandbox-container"},ee={key:0},te={key:0,class:"sandbox-controls"},oe=p(e.defineComponent({__name:"SandboxLayout",props:{title:{type:String,default:""},links:{type:Array,required:!1,default:()=>[]},controlsMinWidth:{type:Number,default:240},applyTheming:{type:Boolean,default:!0}},setup(t){e.useCssVars(o=>({v62569402:c.value}));const a=t;e.provide(h,a.links);const c=e.computed(()=>`${a.controlsMinWidth}px`);return(o,_)=>{const i=e.resolveComponent("KSlideout"),d=e.resolveComponent("KToggle"),s=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("div",w,[e.createElementVNode("header",z,[e.createElementVNode("div",G,[e.createElementVNode("div",H,[e.createVNode(d,null,{default:e.withCtx(({isToggled:n,toggle:r})=>[e.createElementVNode("div",null,[e.createElementVNode("div",X,[e.createVNode(e.unref(m.MenuIcon),{role:"button",size:`var(--kui-icon-size-50, ${e.unref(C)})`,title:"Toggle menu",onClick:r},null,8,["size","onClick"])]),e.createVNode(i,{title:"Main Menu",visible:n.value,onClose:r},{default:e.withCtx(()=>[t.applyTheming?(e.openBlock(),e.createElementBlock("div",P,[e.createVNode(N)])):e.createCommentVNode("",!0),e.createVNode(E,{onRouterLinkClick:r},null,8,["onRouterLinkClick"]),o.$slots["navigation-after"]?(e.openBlock(),e.createElementBlock("div",Y,[e.renderSlot(o.$slots,"navigation-after",{},void 0,!0)])):e.createCommentVNode("",!0)]),_:2},1032,["visible","onClose"])])]),_:3}),t.title?(e.openBlock(),e.createElementBlock("h1",R,[e.createVNode(s,{class:"home-link",to:{name:"home"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title),1)]),_:1})])):e.createCommentVNode("",!0)])]),e.createElementVNode("div",F,[o.$slots.controls?(e.openBlock(),e.createElementBlock("div",W,[e.createVNode(d,null,{default:e.withCtx(({isToggled:n,toggle:r})=>[e.createElementVNode("div",null,[e.createElementVNode("div",j,[e.createVNode(e.unref(m.CogIcon),{role:"button",size:`var(--kui-icon-size-50, ${e.unref(C)})`,title:"Toggle controls",onClick:r},null,8,["size","onClick"])]),e.createVNode(i,{title:"Controls",visible:n.value,onClose:r},{default:e.withCtx(()=>[e.renderSlot(o.$slots,"controls",{},void 0,!0)]),_:3},8,["visible","onClose"])])]),_:3})])):e.createCommentVNode("",!0)])]),e.createElementVNode("div",q,[e.createElementVNode("div",J,[t.applyTheming?(e.openBlock(),e.createElementBlock("div",Z,[e.createVNode(N)])):e.createCommentVNode("",!0),e.createVNode(E),o.$slots["navigation-after"]?(e.openBlock(),e.createElementBlock("div",Q,[e.renderSlot(o.$slots,"navigation-after",{},void 0,!0)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",v,[t.title?(e.openBlock(),e.createElementBlock("h1",ee,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"default",{},void 0,!0)]),o.$slots.controls?(e.openBlock(),e.createElementBlock("div",te,[e.renderSlot(o.$slots,"controls",{},void 0,!0)])):e.createCommentVNode("",!0)])])}}}),[["__scopeId","data-v-e36d58ea"]]);l.KONG_UI_SANDBOX_DEFAULT_THEME=g,l.KONG_UI_SANDBOX_LAYOUT_LINKS_INJECTION_KEY=h,l.KONG_UI_SANDBOX_THEME_MODE_OPTIONS=f,l.KONG_UI_SANDBOX_THEME_STORAGE_KEY=k,l.SandboxLayout=oe,l.SandboxThemePicker=N,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})}));
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,_){"use strict";const k="kong-ui-sandbox-layout-links",p="kong-ui-sandbox-theme",E="mono-lime-day",C=[{label:"Mono lime",value:"mono-lime"},{label:"Electric lime",value:"electric-lime"}],S=[{label:"Day",value:"day"},{label:"Night",value:"night"}],I={key:0,class:"kong-ui-sandbox-navigation"},K=e.defineComponent({__name:"SandboxNavigation",emits:["router-link-click"],setup(t,{emit:l}){const c=l,o=e.inject(k,[]);return(m,h)=>{const a=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("nav",null,[e.unref(o).length?(e.openBlock(),e.createElementBlock("ul",I,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(o),s=>(e.openBlock(),e.createElementBlock("li",{key:s.name,class:"sandbox-link"},[e.createVNode(a,{to:s.to,onClick:d=>c("router-link-click",s)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.name),1)]),_:2},1032,["to","onClick"])]))),128))])):e.createCommentVNode("",!0)])}}}),N=(t,l)=>{const c=t.__vccOpts||t;for(const[o,m]of l)c[o]=m;return c},V=N(K,[["__scopeId","data-v-f67e3d83"]]),$="16px",b="24px";function x(t){return{family:t.startsWith("electric-lime")?"electric-lime":"mono-lime",mode:t.includes("night")?"night":"day",highContrast:t.endsWith("high-contrast")}}function A(t,l,c){return c?`${t}-${l}-high-contrast`:`${t}-${l}`}const f=x(localStorage.getItem(p)||E),y=e.ref(f.family),T=e.ref(f.mode),B=e.ref(f.highContrast),O=e.computed(()=>A(y.value,T.value,B.value));let u=!1;function D(){u||(u=!0,e.effectScope(!0).run(()=>{e.watch(O,t=>{document.documentElement.setAttribute("data-kui-theme",t),localStorage.setItem(p,t)},{immediate:!0})}))}function M(){return D(),{theme:O,family:y,mode:T,highContrast:B}}const U={class:"kong-ui-sandbox-theme-picker"},L={class:"theme-picker-row"},w={"aria-label":"Theme",class:"theme-picker-group",role:"radiogroup"},G=["aria-label","checked","value","onChange"],z={class:"theme-picker-row"},g=N(e.defineComponent({__name:"SandboxThemePicker",setup(t){const{family:l,mode:c,highContrast:o}=M(),m={day:_.LightModeIcon,night:_.DarkModeIcon};return(h,a)=>{const s=e.resolveComponent("KSegmentedControl"),d=e.resolveComponent("KTooltip"),r=e.resolveComponent("KInputSwitch");return e.openBlock(),e.createElementBlock("div",U,[e.createVNode(s,{modelValue:e.unref(l),"onUpdate:modelValue":a[0]||(a[0]=i=>e.isRef(l)?l.value=i:null),"aria-label":"Theme family",options:e.unref(C)},null,8,["modelValue","options"]),e.createElementVNode("div",L,[a[2]||(a[2]=e.createElementVNode("span",{class:"theme-picker-label"},"Theme",-1)),e.createElementVNode("div",w,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(S),i=>(e.openBlock(),e.createBlock(d,{key:i.value,placement:"top",text:i.label},{default:e.withCtx(()=>[e.createElementVNode("label",{class:e.normalizeClass(["theme-picker-option",{active:i.value===e.unref(c)}])},[e.createElementVNode("input",{"aria-label":i.label,checked:i.value===e.unref(c),class:"theme-picker-input",name:"sandbox-theme-mode",type:"radio",value:i.value,onChange:se=>c.value=i.value},null,40,G),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(m[i.value]),{decorative:"",size:`var(--kui-icon-size-30, ${e.unref($)})`},null,8,["size"]))],2)]),_:2},1032,["text"]))),128))])]),e.createElementVNode("div",z,[a[3]||(a[3]=e.createElementVNode("span",{class:"theme-picker-label"},"High contrast",-1)),e.createVNode(r,{modelValue:e.unref(o),"onUpdate:modelValue":a[1]||(a[1]=i=>e.isRef(o)?o.value=i:null),"aria-label":"High contrast"},null,8,["modelValue"])])])}}}),[["__scopeId","data-v-942c4583"]]),H={class:"kong-ui-sandbox-layout"},X={class:"header"},P={class:"header-left"},Y={class:"mobile-nav-container"},F={class:"toggle-mobile-nav"},R={key:0,class:"nav-theme-picker"},W={key:1,class:"navigation-after"},j={key:0,class:"mobile-title"},q={class:"header-right"},J={key:0,class:"mobile-controls-container"},Z={class:"toggle-mobile-controls"},Q={class:"layout"},v={class:"desktop-nav-container"},ee={key:0,class:"nav-theme-picker"},te={key:1,class:"navigation-after"},oe={class:"sandbox-container"},ne={key:0},le={key:0,class:"sandbox-controls"},ae=N(e.defineComponent({__name:"SandboxLayout",props:{title:{type:String,default:""},links:{type:Array,required:!1,default:()=>[]},controlsMinWidth:{type:Number,default:240},applyTheming:{type:Boolean,default:!0}},setup(t){e.useCssVars(o=>({v62569402:c.value}));const l=t;e.provide(k,l.links);const c=e.computed(()=>`${l.controlsMinWidth}px`);return(o,m)=>{const h=e.resolveComponent("KSlideout"),a=e.resolveComponent("KToggle"),s=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("div",H,[e.createElementVNode("header",X,[e.createElementVNode("div",P,[e.createElementVNode("div",Y,[e.createVNode(a,null,{default:e.withCtx(({isToggled:d,toggle:r})=>[e.createElementVNode("div",null,[e.createElementVNode("div",F,[e.createVNode(e.unref(_.MenuIcon),{role:"button",size:`var(--kui-icon-size-50, ${e.unref(b)})`,title:"Toggle menu",onClick:r},null,8,["size","onClick"])]),e.createVNode(h,{title:"Main Menu",visible:d.value,onClose:r},{default:e.withCtx(()=>[t.applyTheming?(e.openBlock(),e.createElementBlock("div",R,[e.createVNode(g)])):e.createCommentVNode("",!0),e.createVNode(V,{onRouterLinkClick:r},null,8,["onRouterLinkClick"]),o.$slots["navigation-after"]?(e.openBlock(),e.createElementBlock("div",W,[e.renderSlot(o.$slots,"navigation-after",{},void 0,!0)])):e.createCommentVNode("",!0)]),_:2},1032,["visible","onClose"])])]),_:3}),t.title?(e.openBlock(),e.createElementBlock("h1",j,[e.createVNode(s,{class:"home-link",to:{name:"home"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title),1)]),_:1})])):e.createCommentVNode("",!0)])]),e.createElementVNode("div",q,[o.$slots.controls?(e.openBlock(),e.createElementBlock("div",J,[e.createVNode(a,null,{default:e.withCtx(({isToggled:d,toggle:r})=>[e.createElementVNode("div",null,[e.createElementVNode("div",Z,[e.createVNode(e.unref(_.CogIcon),{role:"button",size:`var(--kui-icon-size-50, ${e.unref(b)})`,title:"Toggle controls",onClick:r},null,8,["size","onClick"])]),e.createVNode(h,{title:"Controls",visible:d.value,onClose:r},{default:e.withCtx(()=>[e.renderSlot(o.$slots,"controls",{},void 0,!0)]),_:3},8,["visible","onClose"])])]),_:3})])):e.createCommentVNode("",!0)])]),e.createElementVNode("div",Q,[e.createElementVNode("div",v,[t.applyTheming?(e.openBlock(),e.createElementBlock("div",ee,[e.createVNode(g)])):e.createCommentVNode("",!0),e.createVNode(V),o.$slots["navigation-after"]?(e.openBlock(),e.createElementBlock("div",te,[e.renderSlot(o.$slots,"navigation-after",{},void 0,!0)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",oe,[t.title?(e.openBlock(),e.createElementBlock("h1",ne,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"default",{},void 0,!0)]),o.$slots.controls?(e.openBlock(),e.createElementBlock("div",le,[e.renderSlot(o.$slots,"controls",{},void 0,!0)])):e.createCommentVNode("",!0)])])}}}),[["__scopeId","data-v-e36d58ea"]]);n.KONG_UI_SANDBOX_DEFAULT_THEME=E,n.KONG_UI_SANDBOX_LAYOUT_LINKS_INJECTION_KEY=k,n.KONG_UI_SANDBOX_THEME_FAMILY_OPTIONS=C,n.KONG_UI_SANDBOX_THEME_MODE_OPTIONS=S,n.KONG_UI_SANDBOX_THEME_STORAGE_KEY=p,n.SandboxLayout=ae,n.SandboxThemePicker=g,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})}));