@kong-ui-public/sandbox-layout 2.8.7 → 2.8.8-pr.4063.bf809a10e.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.
- package/dist/sandbox-layout.es.js +220 -287
- package/dist/sandbox-layout.umd.js +1 -1
- package/dist/style.css +2 -1
- package/package.json +2 -2
|
@@ -1,291 +1,224 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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
|
|
53
|
-
|
|
51
|
+
function z(e, t, n) {
|
|
52
|
+
return n ? `${e}-${t}-high-contrast` : `${e}-${t}`;
|
|
54
53
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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
|
|
67
|
-
|
|
62
|
+
function q() {
|
|
63
|
+
return K(), {
|
|
64
|
+
theme: W,
|
|
65
|
+
family: V,
|
|
66
|
+
mode: H,
|
|
67
|
+
highContrast: U
|
|
68
|
+
};
|
|
68
69
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
},
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
},
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
},
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
},
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
},
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
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(
|
|
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});
|