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