@feedmepos/mf-miniprogram-v2 0.2.2-dev.2 → 0.2.2-dev.21

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.
Files changed (33) hide show
  1. package/dist/App-BdvPLQMC.js +213 -0
  2. package/dist/AppTemplatePicker-CNJ6kIJk.js +237 -0
  3. package/dist/BrandFontPicker-kQKWf1hL.js +241 -0
  4. package/dist/BrandKitView-RaUWE69b.js +249 -0
  5. package/dist/{ControlPlaneView-DmhLvgWt.js → ControlPlaneView-l_gDDBtb.js} +8854 -8140
  6. package/dist/EcosystemView-CBEL5PT2.js +186 -0
  7. package/dist/{LegacyWorkspaceEntry-7DvIosoj.js → LegacyWorkspaceEntry-lEMtmdIe.js} +1 -1
  8. package/dist/MobileProjectsView-BruZHfdq.js +312 -0
  9. package/dist/{ModuleCenterView-Dqp-2hbL.js → ModuleCenterView-DI6Pakkr.js} +34 -34
  10. package/dist/{ModuleDetailView-cpQ_UfS9.js → ModuleDetailView-DteTTb-3.js} +49 -49
  11. package/dist/{PagesView-BHo_fnWa.js → PagesView-BYzldeqE.js} +1 -1
  12. package/dist/{PortalSettingsView-CkW-avwg.js → PortalSettingsView-Bl4z9cFG.js} +4 -4
  13. package/dist/StatusBadge.vue_vue_type_script_setup_true_lang-CMgQ0bd_.js +30 -0
  14. package/dist/TemplateCenterView-DNjVytwE.js +364 -0
  15. package/dist/{WorkspaceEntryView-ZdXuMQoJ.js → WorkspaceEntryView-BIumdrty.js} +1 -1
  16. package/dist/app.js +27 -10
  17. package/dist/{controlPlane-wUT1G_Gr.js → controlPlane-sXaC6pAh.js} +9 -9
  18. package/dist/{index-BDHUHtRw.js → index-CIJWcl_6.js} +25 -15
  19. package/dist/package.json +2 -1
  20. package/dist/{portalContext-CTVzkJV7.js → portalContext-BFTX5VVx.js} +2 -2
  21. package/dist/routes-D6BQSP4i.js +81 -0
  22. package/dist/style.css +1 -1
  23. package/dist/templatePickerFlag-BIYWgnaS.js +59 -0
  24. package/dist/useBrandKit-CkdPQRE-.js +1020 -0
  25. package/dist/{useModuleCatalog-CD5N246F.js → useModuleCatalog-Bk-gRmBb.js} +3 -3
  26. package/package.json +2 -1
  27. package/dist/App-D7vZDj-a.js +0 -213
  28. package/dist/BrandKitView-B8t8RkHr.js +0 -221
  29. package/dist/EcosystemView--S4hk_t4.js +0 -232
  30. package/dist/StatusBadge.vue_vue_type_script_setup_true_lang-Bh9Eoe_H.js +0 -26
  31. package/dist/localPreference-DneUpUrQ.js +0 -34
  32. package/dist/routes-L0ady_Wy.js +0 -53
  33. package/dist/useBrandKit-CpyR2j6m.js +0 -924
@@ -0,0 +1,241 @@
1
+ import { defineComponent as te, ref as n, computed as F, watch as G, resolveComponent as I, openBlock as s, createElementBlock as u, withKeys as L, withModifiers as N, createElementVNode as a, toDisplayString as k, createVNode as P, withCtx as J, normalizeStyle as E, withDirectives as K, vModelText as q, Fragment as S, renderList as oe, createCommentVNode as v, unref as T, createBlock as ae, createTextVNode as W, nextTick as le } from "vue";
2
+ import { G as V, f as ne, b as p, l as se } from "./useBrandKit-CkdPQRE-.js";
3
+ import { _ as re } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
+ const xe = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAACXBIWXMAACE4AAAhOAFFljFgAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAOdEVYdFNvZnR3YXJlAEZpZ21hnrGWYwAADbZJREFUeAHtW2lsXNUV/t4yi5cZO4mdxUlsEmiBkI2dCkJBAloQSEBaCUoKkahUCYLUqjRFbVVVqlS6qAKVlqpIVBRRlqjwg1KKQNCUJIWELEBQQkgIcZzEThzimfF4PDNv63fufTNeMuN4TSXgSMd3ljfvve9+55577nefjVwuH+BzZCY+Z/YF4M+62fg/W8YB+sRdwA9MOlkwNRNR/qmxAzpQb09OqjntgD9KA139wMcZIOWYsAwoQFHTQJxtjK1NoDY/l9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mUPCMSqyzzfF7aZysrnwZm/JsWWVh1eQxXLpr8rdiSGafj33h2M2F1ZAK1PdOTF52K7HJXUuZgFlJYOsdA6/TJZbKaGV/839Jn3L4A/Fm3/wGRTH3CBVOXMAAAAABJRU5ErkJggg==", ue = ["onKeydown"], ie = { class: "font-picker__label" }, de = ["disabled", "aria-label", "aria-expanded"], ce = ["onKeydown", "aria-label"], ve = {
5
+ key: 0,
6
+ class: "font-picker__muted"
7
+ }, me = ["aria-pressed", "onClick"], pe = { key: 0 }, fe = { key: 1 }, Ae = {
8
+ key: 0,
9
+ class: "font-picker__muted",
10
+ role: "status"
11
+ }, ge = { class: "font-picker__preview" }, be = { class: "font-picker__muted" }, ke = {
12
+ key: 0,
13
+ class: "font-picker__muted",
14
+ role: "status"
15
+ }, we = {
16
+ key: 1,
17
+ class: "font-picker__muted"
18
+ }, ye = {
19
+ key: 0,
20
+ class: "font-picker__muted"
21
+ }, he = /* @__PURE__ */ te({
22
+ __name: "BrandFontPicker",
23
+ props: {
24
+ modelValue: {},
25
+ label: {},
26
+ disabled: { type: Boolean }
27
+ },
28
+ emits: ["update:modelValue"],
29
+ setup(d, { emit: H }) {
30
+ const f = d, j = H, Y = n(), w = n(), B = n(), D = n(360), O = n(), U = n(), m = n(!1), y = n(""), l = n(""), X = n("The quick brown fox jumps over the lazy dog. 0123456789"), c = n({}), A = F(
31
+ () => [
32
+ { name: "App default", value: "", group: "Defaults" },
33
+ { name: "System font", value: "system-ui, sans-serif", group: "Defaults" },
34
+ ...V.map((e) => ({ name: e, value: ne(e), group: "Google Fonts" }))
35
+ ].filter((e) => e.name.toLowerCase().includes(y.value.trim().toLowerCase()))
36
+ ), h = F(() => p(f.modelValue || "")), M = F(() => p(l.value)), R = F(
37
+ () => !!l.value && !V.some((e) => e === M.value) && l.value !== "system-ui, sans-serif"
38
+ );
39
+ async function C(e) {
40
+ if (!(!V.some((t) => t === e) || c.value[e] === "loaded")) {
41
+ c.value[e] = "loading";
42
+ try {
43
+ await se(e), c.value[e] = "loaded";
44
+ } catch {
45
+ c.value[e] = "error";
46
+ }
47
+ }
48
+ }
49
+ G(h, (e) => void C(e), { immediate: !0 }), G(A, (e) => {
50
+ m.value && e.forEach((t) => void C(t.name));
51
+ }), G(
52
+ () => f.disabled,
53
+ (e) => {
54
+ e && Z();
55
+ }
56
+ ), G(() => f.modelValue, Z);
57
+ async function _(e) {
58
+ var t, r;
59
+ m.value = e, e && (D.value = Math.max(320, ((t = Y.value) == null ? void 0 : t.getBoundingClientRect().width) || 360), l.value = f.modelValue || "", y.value = "", m.value = !0, A.value.forEach((i) => void C(i.name)), await le(), (r = U.value) == null || r.focus());
60
+ }
61
+ function Z() {
62
+ var e;
63
+ m.value = !1, (e = B.value) == null || e.hide();
64
+ }
65
+ function z() {
66
+ var e;
67
+ Z(), (e = O.value) == null || e.focus();
68
+ }
69
+ function $() {
70
+ f.disabled || (j("update:modelValue", l.value.trim()), z());
71
+ }
72
+ function Q(e) {
73
+ var r, i;
74
+ const t = e.relatedTarget;
75
+ t && !((r = Y.value) != null && r.contains(t)) && !((i = w.value) != null && i.contains(t)) && Z();
76
+ }
77
+ function ee(e) {
78
+ var x, o;
79
+ if (!["ArrowDown", "ArrowUp", "Home", "End"].includes(e.key)) return;
80
+ const t = [...((x = w.value) == null ? void 0 : x.querySelectorAll("[data-font-option]")) || []];
81
+ if (!t.length) return;
82
+ e.preventDefault();
83
+ const r = t.indexOf(document.activeElement), i = e.key === "Home" ? 0 : e.key === "End" ? t.length - 1 : (r + (e.key === "ArrowDown" ? 1 : -1) + t.length) % t.length;
84
+ (o = t[i]) == null || o.focus();
85
+ }
86
+ return (e, t) => {
87
+ const r = I("FmIcon"), i = I("FmButton"), x = I("FmPopover");
88
+ return s(), u("div", {
89
+ ref_key: "root",
90
+ ref: Y,
91
+ class: "font-picker",
92
+ onFocusout: Q,
93
+ onKeydown: L(N(z, ["stop", "prevent"]), ["esc"])
94
+ }, [
95
+ a("span", ie, k(d.label), 1),
96
+ P(x, {
97
+ ref_key: "popover",
98
+ ref: B,
99
+ "show-popover": m.value,
100
+ disabled: d.disabled,
101
+ onPopoverChanged: _
102
+ }, {
103
+ "popover-button": J(() => [
104
+ a("button", {
105
+ ref_key: "trigger",
106
+ ref: O,
107
+ type: "button",
108
+ class: "font-picker__trigger",
109
+ disabled: d.disabled,
110
+ "aria-label": `${d.label} font: ${h.value}`,
111
+ "aria-haspopup": "dialog",
112
+ "aria-expanded": m.value
113
+ }, [
114
+ a("span", {
115
+ style: E({ fontFamily: d.modelValue || "inherit" })
116
+ }, k(h.value), 5),
117
+ P(r, {
118
+ name: "expand_more",
119
+ size: "sm"
120
+ })
121
+ ], 8, de)
122
+ ]),
123
+ default: J(() => [
124
+ a("div", {
125
+ ref_key: "menu",
126
+ ref: w,
127
+ class: "font-picker__menu",
128
+ style: E({ width: `${D.value}px` }),
129
+ onFocusout: Q,
130
+ onKeydown: L(N(z, ["stop", "prevent"]), ["esc"]),
131
+ role: "dialog",
132
+ "aria-label": `Choose ${d.label.toLowerCase()} font`
133
+ }, [
134
+ t[7] || (t[7] = a("span", { class: "font-picker__muted" }, "Fonts available", -1)),
135
+ K(a("input", {
136
+ ref_key: "search",
137
+ ref: U,
138
+ "onUpdate:modelValue": t[0] || (t[0] = (o) => y.value = o),
139
+ type: "search",
140
+ placeholder: "Search fonts",
141
+ "aria-label": "Search fonts",
142
+ class: "font-picker__input",
143
+ onKeydown: t[1] || (t[1] = L(N((o) => {
144
+ var g, b;
145
+ return (b = (g = w.value) == null ? void 0 : g.querySelector("[data-font-option]")) == null ? void 0 : b.focus();
146
+ }, ["prevent"]), ["down"]))
147
+ }, null, 544), [
148
+ [q, y.value]
149
+ ]),
150
+ a("div", {
151
+ class: "font-picker__options",
152
+ onKeydown: ee
153
+ }, [
154
+ (s(!0), u(S, null, oe(A.value, (o, g) => {
155
+ var b;
156
+ return s(), u(S, {
157
+ key: o.name
158
+ }, [
159
+ g === 0 || ((b = A.value[g - 1]) == null ? void 0 : b.group) !== o.group ? (s(), u("p", ve, k(o.group), 1)) : v("", !0),
160
+ a("button", {
161
+ type: "button",
162
+ "data-font-option": "",
163
+ class: "font-picker__option",
164
+ "aria-pressed": T(p)(l.value) === T(p)(o.value),
165
+ onClick: (Me) => l.value = o.value
166
+ }, [
167
+ a("span", {
168
+ style: E({ fontFamily: o.value || "inherit" })
169
+ }, k(o.name), 5),
170
+ c.value[o.name] === "loading" ? (s(), u("small", pe, "Loading…")) : c.value[o.name] === "error" ? (s(), u("small", fe, "Preview unavailable")) : v("", !0),
171
+ T(p)(l.value) === T(p)(o.value) ? (s(), ae(r, {
172
+ key: 2,
173
+ name: "check",
174
+ size: "sm"
175
+ })) : v("", !0)
176
+ ], 8, me)
177
+ ], 64);
178
+ }), 128)),
179
+ A.value.length ? v("", !0) : (s(), u("p", Ae, "No fonts found. Try another name."))
180
+ ], 32),
181
+ a("div", ge, [
182
+ a("label", be, [
183
+ W("Preview · " + k(M.value) + " ", 1),
184
+ K(a("textarea", {
185
+ "onUpdate:modelValue": t[2] || (t[2] = (o) => X.value = o),
186
+ rows: "2",
187
+ "aria-label": "Font preview text",
188
+ style: E({ fontFamily: l.value || "inherit" })
189
+ }, null, 4), [
190
+ [q, X.value]
191
+ ])
192
+ ]),
193
+ c.value[M.value] === "error" ? (s(), u("p", ke, [
194
+ t[5] || (t[5] = W(" Font preview could not load. Showing a fallback font. ", -1)),
195
+ a("button", {
196
+ type: "button",
197
+ class: "font-picker__retry",
198
+ onClick: t[3] || (t[3] = (o) => C(M.value))
199
+ }, "Retry")
200
+ ])) : v("", !0),
201
+ a("details", null, [
202
+ t[6] || (t[6] = a("summary", null, "Custom font stack", -1)),
203
+ K(a("input", {
204
+ "onUpdate:modelValue": t[4] || (t[4] = (o) => l.value = o),
205
+ class: "font-picker__input",
206
+ "aria-label": "Custom font stack",
207
+ placeholder: "App default",
208
+ spellcheck: "false"
209
+ }, null, 512), [
210
+ [q, l.value]
211
+ ])
212
+ ]),
213
+ R.value ? (s(), u("p", we, "Custom fonts preview only if installed or already loaded.")) : v("", !0)
214
+ ]),
215
+ a("footer", null, [
216
+ P(i, {
217
+ label: "Cancel",
218
+ variant: "tertiary",
219
+ size: "md",
220
+ onClick: z
221
+ }),
222
+ P(i, {
223
+ label: "Apply",
224
+ size: "md",
225
+ disabled: d.disabled,
226
+ onClick: $
227
+ }, null, 8, ["disabled"])
228
+ ])
229
+ ], 44, ce)
230
+ ]),
231
+ _: 1
232
+ }, 8, ["show-popover", "disabled"]),
233
+ c.value[h.value] === "error" ? (s(), u("p", ye, " Preview unavailable; showing a fallback font. ")) : v("", !0)
234
+ ], 40, ue);
235
+ };
236
+ }
237
+ }), Fe = /* @__PURE__ */ re(he, [["__scopeId", "data-v-c563c57c"]]);
238
+ export {
239
+ Fe as B,
240
+ xe as _
241
+ };
@@ -0,0 +1,249 @@
1
+ import { defineComponent as H, ref as K, computed as z, onMounted as S, onScopeDispose as M, resolveComponent as y, openBlock as l, createElementBlock as r, createElementVNode as t, unref as a, createTextVNode as m, createBlock as _, Teleport as O, toDisplayString as p, createCommentVNode as d, createVNode as c, withCtx as Y, normalizeClass as G, normalizeStyle as j, Fragment as b, renderList as f, withDirectives as A, vModelText as I } from "vue";
2
+ import { _ as q, B as J } from "./BrandFontPicker-kQKWf1hL.js";
3
+ import { useRouter as Q, onBeforeRouteLeave as W } from "vue-router";
4
+ import { useDialog as X, useSnackbar as Z } from "@feedmepos/ui-library";
5
+ import { a as ee, C as D, t as E, F as te, u as ae, i as se } from "./useBrandKit-CkdPQRE-.js";
6
+ import { _ as oe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
7
+ const ne = { class: "portal-page bg-portal-bg-canvas text-portal-text-primary" }, le = { class: "portal-page-inner brand-page" }, re = { class: "portal-page-heading" }, ie = { class: "brand-help" }, de = { class: "brand-actions" }, ue = {
8
+ key: 0,
9
+ class: "brand-unsaved"
10
+ }, pe = {
11
+ key: 1,
12
+ class: "portal-notice"
13
+ }, ce = {
14
+ key: 2,
15
+ class: "portal-loading",
16
+ role: "status"
17
+ }, ve = {
18
+ key: 3,
19
+ role: "alert",
20
+ class: "portal-section portal-error"
21
+ }, me = {
22
+ key: 4,
23
+ role: "status"
24
+ }, be = { class: "portal-section" }, he = { class: "portal-section-head" }, ge = { class: "brand-color-grid" }, ye = ["value", "aria-label", "disabled", "onInput"], _e = { class: "brand-field-label" }, fe = ["onUpdate:modelValue", "aria-label", "aria-invalid", "disabled"], ke = {
25
+ key: 0,
26
+ class: "portal-error"
27
+ }, xe = { class: "brand-advanced" }, Ce = { class: "brand-role-grid" }, Be = ["value", "aria-label", "disabled", "onInput"], we = ["onUpdate:modelValue", "aria-label", "aria-invalid", "disabled"], Fe = { class: "portal-section" }, Ve = { class: "portal-section-head" }, Ke = { class: "brand-font-grid" }, Se = /* @__PURE__ */ H({
28
+ __name: "BrandKitView",
29
+ setup(Ae) {
30
+ const e = ae(), h = ee(), k = X(), L = Z(), x = K(!1), T = Q(), u = K(!1), C = ["primary", "secondary", "accent", "background.base", "text.primary"], $ = C.map((n) => D.find((s) => s.path === n)), P = D.filter((n) => !C.includes(n.path)), B = z(
31
+ () => !h.value || !e.state.loaded || e.state.loading || e.state.saving || e.hasInvalidColor.value || e.dirtyCount.value === 0
32
+ ), g = (n) => !!(e.state.colors[n] && !se(e.state.colors[n]));
33
+ function w(n, s) {
34
+ e.state.colors[n] = s.target.value, u.value = !1;
35
+ }
36
+ function F(n) {
37
+ n === "colors" ? e.state.colors = { ...e.state.savedColors } : e.state.fonts = { ...e.state.savedFonts }, u.value = !1;
38
+ }
39
+ function U() {
40
+ k.open({
41
+ title: "Save the live Brand Kit?",
42
+ message: "Colors and fonts are shared business settings. Apps using this kit pick up the change immediately. This does not build or publish application code.",
43
+ dismissAway: !0,
44
+ primaryActions: { text: "Save Brand Kit", close: !0 },
45
+ secondaryActions: { text: "Cancel", close: !0 }
46
+ }).onPrimary(() => {
47
+ e.save().then(() => {
48
+ u.value = !0;
49
+ }).catch(() => {
50
+ u.value = !1;
51
+ });
52
+ });
53
+ }
54
+ S(() => {
55
+ x.value = !0, e.load();
56
+ });
57
+ function V(n) {
58
+ !e.dirtyCount.value && !e.state.saving || (n.preventDefault(), n.returnValue = "");
59
+ }
60
+ return S(() => window.addEventListener("beforeunload", V)), M(() => window.removeEventListener("beforeunload", V)), W((n) => e.state.saving ? !1 : e.dirtyCount.value ? (k.open({
61
+ title: "Discard unsaved Brand Kit changes?",
62
+ message: "Your live Brand Kit has not changed. Leave this page and discard the changes you have not saved?",
63
+ dismissAway: !0,
64
+ primaryActions: { text: "Discard and leave", close: !0 },
65
+ secondaryActions: { text: "Keep editing", close: !0 }
66
+ }).onPrimary(() => {
67
+ e.discardEdits(), T.push(n);
68
+ }), !1) : !0), (n, s) => {
69
+ const N = y("FmIcon"), v = y("FmButton"), R = y("FmCircularProgress");
70
+ return l(), r("div", ne, [
71
+ t("div", le, [
72
+ t("header", re, [
73
+ s[7] || (s[7] = t("div", null, [
74
+ t("p", { class: "portal-eyebrow" }, "Applies to every surface"),
75
+ t("h1", null, "Your Business Identity")
76
+ ], -1)),
77
+ t("div", ie, [
78
+ s[6] || (s[6] = t("span", null, "Need help on brand kit?", -1)),
79
+ t("button", {
80
+ class: "brand-ask-remy",
81
+ type: "button",
82
+ onClick: s[0] || (s[0] = (o) => a(L).open({ message: "Coming soon" }, 3e3))
83
+ }, [...s[5] || (s[5] = [
84
+ t("img", {
85
+ src: q,
86
+ alt: "",
87
+ width: "20",
88
+ height: "20"
89
+ }, null, -1),
90
+ m(" Ask Remy ", -1)
91
+ ])])
92
+ ])
93
+ ]),
94
+ x.value ? (l(), _(O, {
95
+ key: 0,
96
+ to: "#portal-page-actions"
97
+ }, [
98
+ t("div", de, [
99
+ a(e).dirtyCount.value ? (l(), r("span", ue, p(a(e).dirtyCount.value) + " unsaved", 1)) : d("", !0),
100
+ c(v, {
101
+ label: "Save",
102
+ disabled: B.value,
103
+ loading: a(e).state.saving,
104
+ onClick: U
105
+ }, {
106
+ default: Y(() => [
107
+ t("span", {
108
+ class: G(["brand-save-content fm-typo-en-body-lg-600", { invisible: a(e).state.saving }])
109
+ }, [
110
+ c(N, {
111
+ name: "save",
112
+ "aria-hidden": "true",
113
+ style: j({ color: B.value ? "#c7c7cc" : "#ffffff", fontSize: "20px", width: "20px", height: "20px", lineHeight: "20px", flex: "0 0 20px" })
114
+ }, null, 8, ["style"]),
115
+ s[8] || (s[8] = m(" Save ", -1))
116
+ ], 2)
117
+ ]),
118
+ _: 1
119
+ }, 8, ["disabled", "loading"])
120
+ ])
121
+ ])) : d("", !0),
122
+ a(h) ? d("", !0) : (l(), r("p", pe, " You can view this Brand Kit, but need Brand Kit management permission to save changes. ")),
123
+ a(e).state.loading ? (l(), r("div", ce, [
124
+ c(R, { size: "xl" }),
125
+ s[9] || (s[9] = m("Loading Brand Kit… ", -1))
126
+ ])) : d("", !0),
127
+ a(e).state.error ? (l(), r("div", ve, [
128
+ t("p", null, p(a(e).state.error), 1),
129
+ a(e).state.loaded ? d("", !0) : (l(), _(v, {
130
+ key: 0,
131
+ label: "Try again",
132
+ variant: "secondary",
133
+ onClick: s[1] || (s[1] = (o) => a(e).load(!0))
134
+ }))
135
+ ])) : d("", !0),
136
+ u.value && !a(e).dirtyCount.value && !a(e).state.error ? (l(), r("p", me, " Brand Kit saved. Apps using this kit can now pick up the changes. ")) : d("", !0),
137
+ a(e).state.loaded && !a(e).state.loading ? (l(), r(b, { key: 5 }, [
138
+ t("section", be, [
139
+ t("div", he, [
140
+ s[10] || (s[10] = t("div", null, [
141
+ t("h2", null, "Colors"),
142
+ t("p", { class: "portal-description" }, "The colors that represent your brand identity.")
143
+ ], -1)),
144
+ c(v, {
145
+ label: "Reset unsaved colors",
146
+ variant: "tertiary",
147
+ disabled: a(e).state.saving,
148
+ onClick: s[2] || (s[2] = (o) => F("colors"))
149
+ }, null, 8, ["disabled"])
150
+ ]),
151
+ t("div", ge, [
152
+ (l(!0), r(b, null, f(a($), (o) => (l(), r("label", {
153
+ key: o.path,
154
+ class: "brand-color-card"
155
+ }, [
156
+ t("input", {
157
+ type: "color",
158
+ value: a(E)(a(e).state.colors[o.path] ?? ""),
159
+ "aria-label": `${o.label} color picker`,
160
+ disabled: a(e).state.saving,
161
+ onInput: (i) => w(o.path, i)
162
+ }, null, 40, ye),
163
+ t("span", _e, p(o.path === "background.base" ? "Background" : o.path === "text.primary" ? "Text" : o.label), 1),
164
+ A(t("input", {
165
+ "onUpdate:modelValue": (i) => a(e).state.colors[o.path] = i,
166
+ class: "brand-value",
167
+ "aria-label": `${o.path} hex color`,
168
+ "aria-invalid": g(o.path),
169
+ disabled: a(e).state.saving,
170
+ placeholder: "App default",
171
+ spellcheck: "false"
172
+ }, null, 8, fe), [
173
+ [I, a(e).state.colors[o.path]]
174
+ ]),
175
+ g(o.path) ? (l(), r("small", ke, "Enter a hex color")) : d("", !0)
176
+ ]))), 128))
177
+ ]),
178
+ t("details", xe, [
179
+ s[11] || (s[11] = t("summary", null, [
180
+ m("More color roles "),
181
+ t("span", null, "Keep control of text, surfaces and status colors")
182
+ ], -1)),
183
+ s[12] || (s[12] = t("p", { class: "portal-description" }, " Each role is saved independently. Changing a brand color does not automatically replace text or status colors. ", -1)),
184
+ t("div", Ce, [
185
+ (l(!0), r(b, null, f(a(P), (o) => (l(), r("label", {
186
+ key: o.path
187
+ }, [
188
+ t("span", null, p(o.group) + " · " + p(o.label), 1),
189
+ t("div", null, [
190
+ t("input", {
191
+ type: "color",
192
+ value: a(E)(a(e).state.colors[o.path] ?? ""),
193
+ "aria-label": `${o.path} color picker`,
194
+ disabled: a(e).state.saving,
195
+ onInput: (i) => w(o.path, i)
196
+ }, null, 40, Be),
197
+ A(t("input", {
198
+ "onUpdate:modelValue": (i) => a(e).state.colors[o.path] = i,
199
+ "aria-label": `${o.path} hex color`,
200
+ "aria-invalid": g(o.path),
201
+ disabled: a(e).state.saving,
202
+ class: "brand-value",
203
+ placeholder: "App default",
204
+ spellcheck: "false"
205
+ }, null, 8, we), [
206
+ [I, a(e).state.colors[o.path]]
207
+ ])
208
+ ]),
209
+ t("small", null, p(o.hint), 1)
210
+ ]))), 128))
211
+ ])
212
+ ])
213
+ ]),
214
+ t("section", Fe, [
215
+ t("div", Ve, [
216
+ s[13] || (s[13] = t("div", null, [
217
+ t("h2", null, "Typeface"),
218
+ t("p", { class: "portal-description" }, "Fonts used in your interfaces.")
219
+ ], -1)),
220
+ c(v, {
221
+ label: "Reset unsaved fonts",
222
+ variant: "tertiary",
223
+ disabled: a(e).state.saving,
224
+ onClick: s[3] || (s[3] = (o) => F("fonts"))
225
+ }, null, 8, ["disabled"])
226
+ ]),
227
+ t("div", Ke, [
228
+ (l(!0), r(b, null, f(a(te), (o) => (l(), _(J, {
229
+ key: o.path,
230
+ modelValue: a(e).state.fonts[o.path],
231
+ "onUpdate:modelValue": [
232
+ (i) => a(e).state.fonts[o.path] = i,
233
+ s[4] || (s[4] = (i) => u.value = !1)
234
+ ],
235
+ label: o.label === "Heading" ? "Headings" : o.label,
236
+ disabled: !a(h) || a(e).state.saving
237
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "label", "disabled"]))), 128))
238
+ ]),
239
+ s[14] || (s[14] = t("p", { class: "portal-description brand-font-help" }, "Supported by Google Fonts", -1))
240
+ ])
241
+ ], 64)) : d("", !0)
242
+ ])
243
+ ]);
244
+ };
245
+ }
246
+ }), Pe = /* @__PURE__ */ oe(Se, [["__scopeId", "data-v-69311627"]]);
247
+ export {
248
+ Pe as default
249
+ };