@sevenfold/setto-client 0.19.0 → 0.20.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/setto-client.js +29 -14
- package/dist/setto-client.js.map +1 -1
- package/package.json +1 -1
package/dist/setto-client.js
CHANGED
|
@@ -174,9 +174,9 @@ function SettoLanguages({ languages, inline = false }) {
|
|
|
174
174
|
"aria-expanded": open,
|
|
175
175
|
"aria-haspopup": "listbox",
|
|
176
176
|
"aria-label": `Språk: ${languageName(current)}`,
|
|
177
|
-
style:
|
|
177
|
+
style: inline ? inlineTriggerStyle : floatingTriggerStyle,
|
|
178
178
|
children: [
|
|
179
|
-
/* @__PURE__ */ jsx(
|
|
179
|
+
/* @__PURE__ */ jsx(LanguagesIcon, {}),
|
|
180
180
|
languageName(current)
|
|
181
181
|
]
|
|
182
182
|
}
|
|
@@ -212,22 +212,26 @@ function AutoLanguageSwitcher({ languages }) {
|
|
|
212
212
|
if (inlineElsewhere || languages.length < 2) return null;
|
|
213
213
|
return /* @__PURE__ */ jsx(SettoLanguages, { languages });
|
|
214
214
|
}
|
|
215
|
-
function
|
|
215
|
+
function LanguagesIcon() {
|
|
216
216
|
return /* @__PURE__ */ jsxs(
|
|
217
217
|
"svg",
|
|
218
218
|
{
|
|
219
|
-
width: "
|
|
220
|
-
height: "
|
|
219
|
+
width: "16",
|
|
220
|
+
height: "16",
|
|
221
221
|
viewBox: "0 0 24 24",
|
|
222
222
|
fill: "none",
|
|
223
223
|
stroke: "currentColor",
|
|
224
|
-
strokeWidth: "1.
|
|
224
|
+
strokeWidth: "1.7",
|
|
225
225
|
strokeLinecap: "round",
|
|
226
226
|
strokeLinejoin: "round",
|
|
227
227
|
"aria-hidden": "true",
|
|
228
228
|
children: [
|
|
229
|
-
/* @__PURE__ */ jsx("
|
|
230
|
-
/* @__PURE__ */ jsx("path", { d: "M3
|
|
229
|
+
/* @__PURE__ */ jsx("path", { d: "M2.2 17.8 6.5 6.8l4.3 11" }),
|
|
230
|
+
/* @__PURE__ */ jsx("path", { d: "M3.7 14.2h5.6" }),
|
|
231
|
+
/* @__PURE__ */ jsx("path", { d: "M17.3 3.4 16.2 5.6" }),
|
|
232
|
+
/* @__PURE__ */ jsx("path", { d: "M12.8 8.2h9" }),
|
|
233
|
+
/* @__PURE__ */ jsx("path", { d: "M13.6 18.8 21 10.9" }),
|
|
234
|
+
/* @__PURE__ */ jsx("path", { d: "M14.7 10.9l7.1 7.9" })
|
|
231
235
|
]
|
|
232
236
|
}
|
|
233
237
|
);
|
|
@@ -244,25 +248,36 @@ const inlineWrapStyle = {
|
|
|
244
248
|
display: "inline-block",
|
|
245
249
|
fontFamily: "inherit"
|
|
246
250
|
};
|
|
247
|
-
const
|
|
251
|
+
const triggerBase = {
|
|
248
252
|
display: "inline-flex",
|
|
249
253
|
alignItems: "center",
|
|
250
254
|
gap: 7,
|
|
251
255
|
minHeight: 40,
|
|
256
|
+
fontSize: 13.5,
|
|
257
|
+
fontWeight: 500,
|
|
258
|
+
lineHeight: 1,
|
|
259
|
+
cursor: "pointer"
|
|
260
|
+
};
|
|
261
|
+
const floatingTriggerStyle = {
|
|
262
|
+
...triggerBase,
|
|
252
263
|
padding: "8px 14px",
|
|
253
264
|
borderRadius: 999,
|
|
254
265
|
border: "1px solid rgba(127, 127, 127, 0.32)",
|
|
255
|
-
// Translucent over whatever the site put behind it, and legible either way.
|
|
256
266
|
background: "rgba(255, 255, 255, 0.82)",
|
|
257
267
|
backdropFilter: "blur(8px)",
|
|
258
268
|
WebkitBackdropFilter: "blur(8px)",
|
|
259
269
|
color: "#1a1a1a",
|
|
260
|
-
fontSize: 13.5,
|
|
261
|
-
fontWeight: 500,
|
|
262
|
-
lineHeight: 1,
|
|
263
|
-
cursor: "pointer",
|
|
264
270
|
boxShadow: "0 4px 14px rgba(0, 0, 0, 0.12)"
|
|
265
271
|
};
|
|
272
|
+
const inlineTriggerStyle = {
|
|
273
|
+
...triggerBase,
|
|
274
|
+
padding: "8px 6px",
|
|
275
|
+
border: 0,
|
|
276
|
+
borderRadius: 8,
|
|
277
|
+
background: "transparent",
|
|
278
|
+
color: "inherit",
|
|
279
|
+
opacity: 0.75
|
|
280
|
+
};
|
|
266
281
|
const listBase = {
|
|
267
282
|
position: "absolute",
|
|
268
283
|
margin: 0,
|