@alfadocs/ui-kit 1.71.0 → 1.71.1
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/_chunks/header-settings-CAC0Yl0t.js +516 -0
- package/dist/_chunks/{marketplace-app-shell-CcLQ0Dn-.js → marketplace-app-shell-BeWm-Efp.js} +2 -2
- package/dist/agent-catalog.json +1 -1
- package/dist/components/header-settings/index.js +1 -1
- package/dist/i18n/locales/ar.d.ts +1 -0
- package/dist/i18n/locales/ar.js +1 -0
- package/dist/i18n/locales/de.d.ts +1 -0
- package/dist/i18n/locales/de.js +1 -0
- package/dist/i18n/locales/el.d.ts +1 -0
- package/dist/i18n/locales/el.js +1 -0
- package/dist/i18n/locales/en.d.ts +1 -0
- package/dist/i18n/locales/en.js +1 -0
- package/dist/i18n/locales/es.d.ts +1 -0
- package/dist/i18n/locales/es.js +1 -0
- package/dist/i18n/locales/fr.d.ts +1 -0
- package/dist/i18n/locales/fr.js +1 -0
- package/dist/i18n/locales/hi.d.ts +1 -0
- package/dist/i18n/locales/hi.js +1 -0
- package/dist/i18n/locales/it.d.ts +1 -0
- package/dist/i18n/locales/it.js +1 -0
- package/dist/i18n/locales/ja.d.ts +1 -0
- package/dist/i18n/locales/ja.js +1 -0
- package/dist/i18n/locales/nl.d.ts +1 -0
- package/dist/i18n/locales/nl.js +1 -0
- package/dist/i18n/locales/pl.d.ts +1 -0
- package/dist/i18n/locales/pl.js +1 -0
- package/dist/i18n/locales/pt.d.ts +1 -0
- package/dist/i18n/locales/pt.js +1 -0
- package/dist/i18n/locales/ro.d.ts +1 -0
- package/dist/i18n/locales/ro.js +1 -0
- package/dist/i18n/locales/ru.d.ts +1 -0
- package/dist/i18n/locales/ru.js +1 -0
- package/dist/i18n/locales/sq.d.ts +1 -0
- package/dist/i18n/locales/sq.js +1 -0
- package/dist/i18n/locales/sv.d.ts +1 -0
- package/dist/i18n/locales/sv.js +1 -0
- package/dist/i18n/locales/tr.d.ts +1 -0
- package/dist/i18n/locales/tr.js +1 -0
- package/dist/i18n/locales/zh.d.ts +1 -0
- package/dist/i18n/locales/zh.js +1 -0
- package/dist/index.js +1 -1
- package/dist/locales/ar.json +1 -0
- package/dist/locales/de.json +1 -0
- package/dist/locales/el.json +1 -0
- package/dist/locales/en.json +1 -0
- package/dist/locales/es.json +1 -0
- package/dist/locales/fr.json +1 -0
- package/dist/locales/hi.json +1 -0
- package/dist/locales/it.json +1 -0
- package/dist/locales/ja.json +1 -0
- package/dist/locales/nl.json +1 -0
- package/dist/locales/pl.json +1 -0
- package/dist/locales/pt.json +1 -0
- package/dist/locales/ro.json +1 -0
- package/dist/locales/ru.json +1 -0
- package/dist/locales/sq.json +1 -0
- package/dist/locales/sv.json +1 -0
- package/dist/locales/tr.json +1 -0
- package/dist/locales/zh.json +1 -0
- package/dist/patterns/marketplace-app-shell/index.js +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/header-settings-DlUbvAUx.js +0 -306
package/package.json
CHANGED
|
@@ -1,306 +0,0 @@
|
|
|
1
|
-
import { jsx as s, jsxs as h } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as E, useRef as p, useImperativeHandle as I, useCallback as R, useMemo as K } from "react";
|
|
3
|
-
import { c as _ } from "./index-D2ZczOXr.js";
|
|
4
|
-
import { useTranslation as T } from "react-i18next";
|
|
5
|
-
import { I as H } from "./icon-button-C_1TgRiK.js";
|
|
6
|
-
import { D as n } from "./dropdown-menu-D1we7oAY.js";
|
|
7
|
-
import { u as O, c as g, L as P, a as j } from "./locale-picker-CeveTnDK.js";
|
|
8
|
-
import { u as x } from "./use-locale-BExNy9Dl.js";
|
|
9
|
-
import { u as N } from "./use-theme-CAuo6EYT.js";
|
|
10
|
-
import { u as D } from "./registry-DvAUVLHh.js";
|
|
11
|
-
import { u as M } from "./length-token-DwMnGEYT.js";
|
|
12
|
-
import { S as F } from "./settings-d25ju_6L.js";
|
|
13
|
-
const V = {
|
|
14
|
-
id: "header-settings",
|
|
15
|
-
// Each setter persists a single preference value (locale / theme /
|
|
16
|
-
// accessibility) — `set_value` semantics, not an ephemeral view switch.
|
|
17
|
-
capabilities: ["set_value"],
|
|
18
|
-
// Read-back for all three setters. None of these preferences is
|
|
19
|
-
// recoverable from the DOM — `useTheme` resolves preference + OS into
|
|
20
|
-
// a single applied class, so `theme: 'system'` and `theme: 'light'`
|
|
21
|
-
// both paint `.theme-light` — and `set_locale` swallows unknown tags.
|
|
22
|
-
// Without these slots an agent cannot distinguish "switched to
|
|
23
|
-
// Italian" from "the tag was dropped on the floor". All four are UI
|
|
24
|
-
// preferences: no PHI, no patient-identifiable data (§7).
|
|
25
|
-
state: {
|
|
26
|
-
locale: {
|
|
27
|
-
type: "string",
|
|
28
|
-
descriptionKey: "ui.agent.headerSettings.state.locale",
|
|
29
|
-
description: 'Active IETF language tag (e.g. "en", "it", "ar"). Read after `set_locale` to confirm the switch landed — an unknown tag is silently dropped and leaves this unchanged.',
|
|
30
|
-
read: (e) => e.getLocale()
|
|
31
|
-
},
|
|
32
|
-
theme: {
|
|
33
|
-
type: "'light' | 'dark' | 'system'",
|
|
34
|
-
descriptionKey: "ui.agent.headerSettings.state.theme",
|
|
35
|
-
description: "Stored base-theme preference. `'system'` means no override is set and the OS decides — read `resolvedTheme` for what is actually painted.",
|
|
36
|
-
read: (e) => e.getTheme()
|
|
37
|
-
},
|
|
38
|
-
accessibility: {
|
|
39
|
-
type: "'default' | 'accessible' | 'system'",
|
|
40
|
-
descriptionKey: "ui.agent.headerSettings.state.accessibility",
|
|
41
|
-
description: "Stored AAA-contrast preference. `'system'` means no override is set and `prefers-contrast` decides.",
|
|
42
|
-
read: (e) => e.getAccessibility()
|
|
43
|
-
},
|
|
44
|
-
resolvedTheme: {
|
|
45
|
-
type: "'light' | 'dark' | 'light-accessible' | 'dark-accessible'",
|
|
46
|
-
descriptionKey: "ui.agent.headerSettings.state.resolvedTheme",
|
|
47
|
-
description: 'The theme actually applied to the document once preference and OS signals resolve. This is what makes a `set_theme("system")` or `set_accessibility("system")` write verifiable.',
|
|
48
|
-
read: (e) => e.getResolvedTheme()
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
actions: {
|
|
52
|
-
set_locale: {
|
|
53
|
-
safety: "write",
|
|
54
|
-
argsType: "{ locale: string }",
|
|
55
|
-
argsSchema: {
|
|
56
|
-
type: "object",
|
|
57
|
-
properties: {
|
|
58
|
-
locale: {
|
|
59
|
-
type: "string",
|
|
60
|
-
description: 'IETF language tag (e.g. "en", "it", "ar"). Unknown tags are silently dropped.'
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
required: ["locale"]
|
|
64
|
-
},
|
|
65
|
-
idempotent: !0,
|
|
66
|
-
descriptionKey: "ui.agent.headerSettings.actions.setLocale",
|
|
67
|
-
description: "Switch the active locale to the given IETF tag. Unknown tags are silently dropped — read the `locale` state slot afterwards to confirm.",
|
|
68
|
-
errors: [
|
|
69
|
-
"Silently ignored when the tag names a locale the kit ships no bundle for — `locale` is unchanged."
|
|
70
|
-
],
|
|
71
|
-
examples: [{ args: { locale: "it" }, note: "Switch to Italian." }],
|
|
72
|
-
invoke: (e, a) => {
|
|
73
|
-
e.setLocale(a.locale);
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
set_theme: {
|
|
77
|
-
safety: "write",
|
|
78
|
-
argsType: '{ theme: "light" | "dark" | "system" }',
|
|
79
|
-
argsSchema: {
|
|
80
|
-
type: "object",
|
|
81
|
-
properties: { theme: { enum: ["light", "dark", "system"] } },
|
|
82
|
-
required: ["theme"]
|
|
83
|
-
},
|
|
84
|
-
idempotent: !0,
|
|
85
|
-
descriptionKey: "ui.agent.headerSettings.actions.setTheme",
|
|
86
|
-
description: "Switch the theme preference. Verify with the `theme` slot (the stored preference) and `resolvedTheme` (what is actually painted).",
|
|
87
|
-
examples: [
|
|
88
|
-
{ args: { theme: "dark" }, note: "Switch to the dark theme." }
|
|
89
|
-
],
|
|
90
|
-
invoke: (e, a) => {
|
|
91
|
-
e.setTheme(a.theme);
|
|
92
|
-
}
|
|
93
|
-
},
|
|
94
|
-
set_accessibility: {
|
|
95
|
-
safety: "write",
|
|
96
|
-
argsType: '{ accessibility: "default" | "accessible" | "system" }',
|
|
97
|
-
argsSchema: {
|
|
98
|
-
type: "object",
|
|
99
|
-
properties: {
|
|
100
|
-
accessibility: {
|
|
101
|
-
enum: ["default", "accessible", "system"],
|
|
102
|
-
description: "`'system'` clears the override and follows `prefers-contrast`."
|
|
103
|
-
}
|
|
104
|
-
},
|
|
105
|
-
required: ["accessibility"]
|
|
106
|
-
},
|
|
107
|
-
idempotent: !0,
|
|
108
|
-
descriptionKey: "ui.agent.headerSettings.actions.setAccessibility",
|
|
109
|
-
description: "Switch the accessibility preference. Verify with the `accessibility` slot (the stored preference) and `resolvedTheme` (what is actually painted).",
|
|
110
|
-
examples: [
|
|
111
|
-
{
|
|
112
|
-
args: { accessibility: "accessible" },
|
|
113
|
-
note: "Enable the AAA-accessible profile."
|
|
114
|
-
}
|
|
115
|
-
],
|
|
116
|
-
invoke: (e, a) => {
|
|
117
|
-
e.setAccessibility(a.accessibility);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
},
|
|
121
|
-
domHooks: {
|
|
122
|
-
root: {
|
|
123
|
-
attr: "data-component",
|
|
124
|
-
value: "header-settings",
|
|
125
|
-
description: "Marks the HeaderSettings wrapper."
|
|
126
|
-
},
|
|
127
|
-
instanceId: {
|
|
128
|
-
attr: "data-component-id",
|
|
129
|
-
sourceProp: "id",
|
|
130
|
-
description: "Sourced from the id prop (forwarded via HTMLAttributes)."
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
};
|
|
134
|
-
function q(e, a) {
|
|
135
|
-
if (!(typeof window > "u"))
|
|
136
|
-
try {
|
|
137
|
-
window.localStorage.setItem(e, a);
|
|
138
|
-
} catch {
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
function z(e) {
|
|
142
|
-
if (typeof document > "u") return;
|
|
143
|
-
const a = document.documentElement;
|
|
144
|
-
a.lang = e, a.dir = g[e].dir;
|
|
145
|
-
}
|
|
146
|
-
const U = _("ds:inline-flex ds:items-center", {
|
|
147
|
-
variants: {
|
|
148
|
-
align: {
|
|
149
|
-
start: "",
|
|
150
|
-
end: ""
|
|
151
|
-
}
|
|
152
|
-
},
|
|
153
|
-
defaultVariants: { align: "end" }
|
|
154
|
-
}), W = "ds:w-[var(--popover-size-md)]";
|
|
155
|
-
function B(e) {
|
|
156
|
-
return Object.prototype.hasOwnProperty.call(g, e);
|
|
157
|
-
}
|
|
158
|
-
function G({ locale: e }) {
|
|
159
|
-
const { t: a } = T("ui"), o = g[B(e) ? e : "en"], m = (t) => {
|
|
160
|
-
var r;
|
|
161
|
-
t.target === t.currentTarget && ((r = t.currentTarget.querySelector("input")) == null || r.focus({ preventScroll: !0 }));
|
|
162
|
-
}, u = (t) => {
|
|
163
|
-
const r = t.target;
|
|
164
|
-
if (r instanceof HTMLInputElement) {
|
|
165
|
-
if (t.nativeEvent.isComposing) {
|
|
166
|
-
t.stopPropagation();
|
|
167
|
-
return;
|
|
168
|
-
}
|
|
169
|
-
t.key !== "ArrowLeft" && t.key !== "ArrowRight" || (r.selectionStart !== 0 || r.selectionEnd !== 0) && t.stopPropagation();
|
|
170
|
-
}
|
|
171
|
-
};
|
|
172
|
-
return /* @__PURE__ */ h(n.Sub, { children: [
|
|
173
|
-
/* @__PURE__ */ s(n.SubTrigger, { "aria-haspopup": "dialog", "data-value": o.code, children: /* @__PURE__ */ h("span", { className: "ds:flex ds:min-w-0 ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
|
|
174
|
-
/* @__PURE__ */ s("span", { className: "ds:truncate", children: a("navigation.headerSettings.language.label") }),
|
|
175
|
-
/* @__PURE__ */ s(
|
|
176
|
-
"span",
|
|
177
|
-
{
|
|
178
|
-
lang: o.code,
|
|
179
|
-
className: "ds:shrink-0 ds:text-[color:var(--muted-foreground)] ds:[[data-highlighted]_&]:text-current",
|
|
180
|
-
children: o.nativeName
|
|
181
|
-
}
|
|
182
|
-
)
|
|
183
|
-
] }) }),
|
|
184
|
-
/* @__PURE__ */ s(
|
|
185
|
-
n.SubContent,
|
|
186
|
-
{
|
|
187
|
-
role: "dialog",
|
|
188
|
-
"aria-orientation": void 0,
|
|
189
|
-
className: W,
|
|
190
|
-
onFocus: m,
|
|
191
|
-
onKeyDownCapture: u,
|
|
192
|
-
onEscapeKeyDown: (t) => {
|
|
193
|
-
t.isComposing && t.preventDefault();
|
|
194
|
-
},
|
|
195
|
-
children: /* @__PURE__ */ s(j.SearchList, {})
|
|
196
|
-
}
|
|
197
|
-
)
|
|
198
|
-
] });
|
|
199
|
-
}
|
|
200
|
-
const Y = E(
|
|
201
|
-
(e, a) => {
|
|
202
|
-
const {
|
|
203
|
-
align: o = "end",
|
|
204
|
-
size: m = "md",
|
|
205
|
-
disabled: u = !1,
|
|
206
|
-
className: t,
|
|
207
|
-
id: r,
|
|
208
|
-
...k
|
|
209
|
-
} = e, { t: c } = T("ui"), l = N(), { locale: y, setLocale: b } = x();
|
|
210
|
-
O();
|
|
211
|
-
const f = p(null);
|
|
212
|
-
I(a, () => f.current, []);
|
|
213
|
-
const S = R(
|
|
214
|
-
(i) => {
|
|
215
|
-
b(i), z(i), q(P, i);
|
|
216
|
-
},
|
|
217
|
-
[b]
|
|
218
|
-
), w = p(S);
|
|
219
|
-
w.current = S;
|
|
220
|
-
const v = p(y);
|
|
221
|
-
v.current = y;
|
|
222
|
-
const d = p(l);
|
|
223
|
-
d.current = l;
|
|
224
|
-
const A = K(
|
|
225
|
-
() => ({
|
|
226
|
-
setLocale: (i) => {
|
|
227
|
-
Object.prototype.hasOwnProperty.call(g, i) && w.current(i);
|
|
228
|
-
},
|
|
229
|
-
setTheme: (i) => d.current.setTheme(i),
|
|
230
|
-
setAccessibility: (i) => d.current.setAccessibility(i),
|
|
231
|
-
// Read-back. None of the three preferences is recoverable from
|
|
232
|
-
// the DOM: `useTheme` resolves preference + OS into one applied
|
|
233
|
-
// class, so `theme: 'system'` and `theme: 'light'` both paint
|
|
234
|
-
// `.theme-light`. Without these an agent cannot tell a switch
|
|
235
|
-
// that landed from one that was dropped.
|
|
236
|
-
getLocale: () => v.current,
|
|
237
|
-
getTheme: () => d.current.theme,
|
|
238
|
-
getAccessibility: () => d.current.accessibility,
|
|
239
|
-
getResolvedTheme: () => d.current.resolvedTheme
|
|
240
|
-
}),
|
|
241
|
-
[]
|
|
242
|
-
);
|
|
243
|
-
D(V, A, r);
|
|
244
|
-
const L = l.accessibility === "accessible", C = M("--spacing-lg", f, 24);
|
|
245
|
-
return /* @__PURE__ */ s(
|
|
246
|
-
"div",
|
|
247
|
-
{
|
|
248
|
-
ref: f,
|
|
249
|
-
"data-component": "header-settings",
|
|
250
|
-
"data-component-id": r,
|
|
251
|
-
className: U({ align: o, className: t }),
|
|
252
|
-
...k,
|
|
253
|
-
children: /* @__PURE__ */ h(n.Root, { children: [
|
|
254
|
-
/* @__PURE__ */ s(n.Trigger, { asChild: !0, children: /* @__PURE__ */ s(
|
|
255
|
-
H,
|
|
256
|
-
{
|
|
257
|
-
size: m,
|
|
258
|
-
disabled: u,
|
|
259
|
-
icon: /* @__PURE__ */ s(F, { "aria-hidden": !0 }),
|
|
260
|
-
"aria-label": c("navigation.headerSettings.trigger")
|
|
261
|
-
}
|
|
262
|
-
) }),
|
|
263
|
-
/* @__PURE__ */ h(n.Content, { align: o, collisionPadding: C, children: [
|
|
264
|
-
/* @__PURE__ */ s(G, { locale: y }),
|
|
265
|
-
/* @__PURE__ */ s(n.Separator, {}),
|
|
266
|
-
/* @__PURE__ */ s(
|
|
267
|
-
n.ChoiceSub,
|
|
268
|
-
{
|
|
269
|
-
label: c("navigation.headerSettings.appearance.label"),
|
|
270
|
-
value: l.theme,
|
|
271
|
-
onValueChange: l.setTheme,
|
|
272
|
-
options: [
|
|
273
|
-
{
|
|
274
|
-
value: "light",
|
|
275
|
-
label: c("navigation.headerSettings.appearance.light")
|
|
276
|
-
},
|
|
277
|
-
{
|
|
278
|
-
value: "dark",
|
|
279
|
-
label: c("navigation.headerSettings.appearance.dark")
|
|
280
|
-
},
|
|
281
|
-
{
|
|
282
|
-
value: "system",
|
|
283
|
-
label: c("navigation.headerSettings.appearance.system")
|
|
284
|
-
}
|
|
285
|
-
]
|
|
286
|
-
}
|
|
287
|
-
),
|
|
288
|
-
/* @__PURE__ */ s(
|
|
289
|
-
n.SwitchItem,
|
|
290
|
-
{
|
|
291
|
-
checked: L,
|
|
292
|
-
onCheckedChange: (i) => l.setAccessibility(i ? "accessible" : "default"),
|
|
293
|
-
children: c("navigation.headerSettings.appearance.accessible")
|
|
294
|
-
}
|
|
295
|
-
)
|
|
296
|
-
] })
|
|
297
|
-
] })
|
|
298
|
-
}
|
|
299
|
-
);
|
|
300
|
-
}
|
|
301
|
-
);
|
|
302
|
-
Y.displayName = "HeaderSettings";
|
|
303
|
-
export {
|
|
304
|
-
Y as H
|
|
305
|
-
};
|
|
306
|
-
//# sourceMappingURL=header-settings-DlUbvAUx.js.map
|