@babelize/elements 1.1.1 → 1.1.3
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/README.md +37 -3
- package/dist/cli/index.js +77 -6
- package/dist/cli/index.js.map +1 -1
- package/dist/index.cjs +236 -184
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +0 -16
- package/dist/index.d.ts +0 -16
- package/dist/index.js +172 -134
- package/dist/index.js.map +1 -1
- package/dist/utils.cjs +35 -0
- package/dist/utils.cjs.map +1 -0
- package/dist/utils.d.cts +5 -0
- package/dist/utils.d.ts +5 -0
- package/dist/utils.js +10 -0
- package/dist/utils.js.map +1 -0
- package/package.json +19 -4
package/dist/index.cjs
CHANGED
|
@@ -1,43 +1,65 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
});
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
21
18
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
30
|
|
|
26
|
-
|
|
31
|
+
// src/registry/components/index.ts
|
|
32
|
+
var components_exports = {};
|
|
33
|
+
__export(components_exports, {
|
|
34
|
+
COUNTRIES: () => COUNTRIES,
|
|
35
|
+
LanguageSwitcher: () => LanguageSwitcher,
|
|
36
|
+
NavBar: () => NavBar,
|
|
37
|
+
PhoneInput: () => PhoneInput,
|
|
38
|
+
cn: () => cn
|
|
39
|
+
});
|
|
40
|
+
module.exports = __toCommonJS(components_exports);
|
|
27
41
|
|
|
28
42
|
// src/lib/utils.ts
|
|
43
|
+
var import_clsx = require("clsx");
|
|
44
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
29
45
|
function cn(...inputs) {
|
|
30
|
-
return
|
|
46
|
+
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
31
47
|
}
|
|
48
|
+
|
|
49
|
+
// src/registry/components/language-switcher.tsx
|
|
50
|
+
var React2 = __toESM(require("react"), 1);
|
|
51
|
+
|
|
52
|
+
// src/lib/use-controllable-state.ts
|
|
53
|
+
var React = __toESM(require("react"), 1);
|
|
32
54
|
function useControllableState(value, defaultValue, onChange) {
|
|
33
55
|
const isControlled = value !== void 0;
|
|
34
|
-
const [uncontrolled, setUncontrolled] =
|
|
35
|
-
const onChangeRef =
|
|
36
|
-
|
|
56
|
+
const [uncontrolled, setUncontrolled] = React.useState(defaultValue);
|
|
57
|
+
const onChangeRef = React.useRef(onChange);
|
|
58
|
+
React.useEffect(() => {
|
|
37
59
|
onChangeRef.current = onChange;
|
|
38
60
|
}, [onChange]);
|
|
39
61
|
const current = isControlled ? value : uncontrolled;
|
|
40
|
-
const setValue =
|
|
62
|
+
const setValue = React.useCallback(
|
|
41
63
|
(next) => {
|
|
42
64
|
var _a;
|
|
43
65
|
if (!isControlled) setUncontrolled(next);
|
|
@@ -47,6 +69,9 @@ function useControllableState(value, defaultValue, onChange) {
|
|
|
47
69
|
);
|
|
48
70
|
return [current, setValue];
|
|
49
71
|
}
|
|
72
|
+
|
|
73
|
+
// src/registry/components/language-switcher.tsx
|
|
74
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
50
75
|
var RTL_LOCALES = /* @__PURE__ */ new Set(["ar", "he", "fa", "ur", "ps", "sd", "yi"]);
|
|
51
76
|
function isRtl(code) {
|
|
52
77
|
const lang = code.split("-")[0].toLowerCase();
|
|
@@ -247,7 +272,7 @@ function getLabel(code, mode) {
|
|
|
247
272
|
if (!names) return code;
|
|
248
273
|
return mode === "native" ? names[0] : names[1];
|
|
249
274
|
}
|
|
250
|
-
var LanguageSwitcher =
|
|
275
|
+
var LanguageSwitcher = React2.forwardRef(
|
|
251
276
|
function LanguageSwitcher2({
|
|
252
277
|
locales,
|
|
253
278
|
value,
|
|
@@ -264,11 +289,11 @@ var LanguageSwitcher = React3__namespace.forwardRef(
|
|
|
264
289
|
(_b = defaultValue != null ? defaultValue : (_a = locales[0]) == null ? void 0 : _a.code) != null ? _b : "",
|
|
265
290
|
onValueChange
|
|
266
291
|
);
|
|
267
|
-
const [open, setOpen] =
|
|
268
|
-
const [search, setSearch] =
|
|
269
|
-
const ref =
|
|
270
|
-
const inputRef =
|
|
271
|
-
|
|
292
|
+
const [open, setOpen] = React2.useState(false);
|
|
293
|
+
const [search, setSearch] = React2.useState("");
|
|
294
|
+
const ref = React2.useRef(null);
|
|
295
|
+
const inputRef = React2.useRef(null);
|
|
296
|
+
React2.useImperativeHandle(forwardedRef, () => ref.current);
|
|
272
297
|
const resolveLabel = (l) => {
|
|
273
298
|
var _a2;
|
|
274
299
|
return (_a2 = l.label) != null ? _a2 : getLabel(l.code, labelMode);
|
|
@@ -278,7 +303,7 @@ var LanguageSwitcher = React3__namespace.forwardRef(
|
|
|
278
303
|
(l) => resolveLabel(l).toLowerCase().includes(search.toLowerCase()) || l.code.toLowerCase().includes(search.toLowerCase())
|
|
279
304
|
);
|
|
280
305
|
const dir = isRtl(locale) ? "rtl" : "ltr";
|
|
281
|
-
|
|
306
|
+
React2.useEffect(() => {
|
|
282
307
|
function handleClickOutside(e) {
|
|
283
308
|
if (ref.current && !ref.current.contains(e.target)) {
|
|
284
309
|
setOpen(false);
|
|
@@ -288,11 +313,11 @@ var LanguageSwitcher = React3__namespace.forwardRef(
|
|
|
288
313
|
document.addEventListener("mousedown", handleClickOutside);
|
|
289
314
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
290
315
|
}, []);
|
|
291
|
-
|
|
316
|
+
React2.useEffect(() => {
|
|
292
317
|
var _a2;
|
|
293
318
|
if (open) (_a2 = inputRef.current) == null ? void 0 : _a2.focus();
|
|
294
319
|
}, [open]);
|
|
295
|
-
|
|
320
|
+
React2.useEffect(() => {
|
|
296
321
|
function handleKeyDown(e) {
|
|
297
322
|
if (e.key === "Escape") {
|
|
298
323
|
setOpen(false);
|
|
@@ -304,8 +329,8 @@ var LanguageSwitcher = React3__namespace.forwardRef(
|
|
|
304
329
|
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
305
330
|
}
|
|
306
331
|
}, [open]);
|
|
307
|
-
return /* @__PURE__ */
|
|
308
|
-
/* @__PURE__ */
|
|
332
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { ref, className: cn("relative inline-block text-sm z-50", className), ...rest, children: [
|
|
333
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
309
334
|
"button",
|
|
310
335
|
{
|
|
311
336
|
type: "button",
|
|
@@ -318,9 +343,9 @@ var LanguageSwitcher = React3__namespace.forwardRef(
|
|
|
318
343
|
"aria-haspopup": "listbox",
|
|
319
344
|
"aria-label": `Current language: ${activeLocale ? resolveLabel(activeLocale) : locale}`,
|
|
320
345
|
children: [
|
|
321
|
-
showFlags && /* @__PURE__ */
|
|
322
|
-
/* @__PURE__ */
|
|
323
|
-
/* @__PURE__ */
|
|
346
|
+
showFlags && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-base", children: (_c = activeLocale == null ? void 0 : activeLocale.flag) != null ? _c : getFlag(locale) }),
|
|
347
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: activeLocale ? resolveLabel(activeLocale) : locale }),
|
|
348
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
324
349
|
"svg",
|
|
325
350
|
{
|
|
326
351
|
className: cn(
|
|
@@ -331,36 +356,37 @@ var LanguageSwitcher = React3__namespace.forwardRef(
|
|
|
331
356
|
viewBox: "0 0 24 24",
|
|
332
357
|
stroke: "currentColor",
|
|
333
358
|
strokeWidth: 2,
|
|
334
|
-
children: /* @__PURE__ */
|
|
359
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" })
|
|
335
360
|
}
|
|
336
361
|
)
|
|
337
362
|
]
|
|
338
363
|
}
|
|
339
364
|
),
|
|
340
|
-
open && /* @__PURE__ */
|
|
365
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
341
366
|
"div",
|
|
342
367
|
{
|
|
343
368
|
className: "absolute z-50 mt-1 min-w-[200px] overflow-hidden rounded-xl border border-zinc-200 bg-white shadow-xl dark:border-zinc-800 dark:bg-zinc-950",
|
|
344
369
|
role: "listbox",
|
|
345
370
|
"aria-label": "Select language",
|
|
346
371
|
children: [
|
|
347
|
-
/* @__PURE__ */
|
|
372
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "border-b border-zinc-200 p-2 dark:border-zinc-800", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
348
373
|
"input",
|
|
349
374
|
{
|
|
350
375
|
ref: inputRef,
|
|
351
376
|
type: "text",
|
|
352
377
|
placeholder: "Search...",
|
|
378
|
+
"aria-label": "Search languages",
|
|
353
379
|
value: search,
|
|
354
380
|
onChange: (e) => setSearch(e.target.value),
|
|
355
381
|
className: "w-full rounded-lg bg-zinc-100 px-3 py-1.5 text-sm text-zinc-900 outline-none placeholder:text-zinc-400 focus:ring-1 focus:ring-emerald-500/50 dark:bg-zinc-800 dark:text-zinc-100 dark:placeholder:text-zinc-500"
|
|
356
382
|
}
|
|
357
383
|
) }),
|
|
358
|
-
/* @__PURE__ */
|
|
384
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "max-h-60 overflow-y-auto p-1", children: [
|
|
359
385
|
filtered.map((l) => {
|
|
360
386
|
var _a2;
|
|
361
387
|
const isActive = l.code === locale;
|
|
362
388
|
const itemDir = l.rtl || isRtl(l.code) ? "rtl" : "ltr";
|
|
363
|
-
return /* @__PURE__ */
|
|
389
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
364
390
|
"button",
|
|
365
391
|
{
|
|
366
392
|
type: "button",
|
|
@@ -378,9 +404,9 @@ var LanguageSwitcher = React3__namespace.forwardRef(
|
|
|
378
404
|
isActive ? "bg-emerald-500/10 text-emerald-600 font-medium dark:text-emerald-400" : "text-zinc-500 hover:bg-zinc-100 hover:text-zinc-900 dark:text-zinc-400 dark:hover:bg-zinc-800 dark:hover:text-zinc-100"
|
|
379
405
|
),
|
|
380
406
|
children: [
|
|
381
|
-
showFlags && /* @__PURE__ */
|
|
382
|
-
/* @__PURE__ */
|
|
383
|
-
isActive && /* @__PURE__ */
|
|
407
|
+
showFlags && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-base", children: (_a2 = l.flag) != null ? _a2 : getFlag(l.code) }),
|
|
408
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "flex-1", children: resolveLabel(l) }),
|
|
409
|
+
isActive && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
384
410
|
"svg",
|
|
385
411
|
{
|
|
386
412
|
className: "size-4 text-emerald-600 dark:text-emerald-400",
|
|
@@ -388,7 +414,7 @@ var LanguageSwitcher = React3__namespace.forwardRef(
|
|
|
388
414
|
viewBox: "0 0 24 24",
|
|
389
415
|
stroke: "currentColor",
|
|
390
416
|
strokeWidth: 2,
|
|
391
|
-
children: /* @__PURE__ */
|
|
417
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" })
|
|
392
418
|
}
|
|
393
419
|
)
|
|
394
420
|
]
|
|
@@ -396,7 +422,7 @@ var LanguageSwitcher = React3__namespace.forwardRef(
|
|
|
396
422
|
l.code
|
|
397
423
|
);
|
|
398
424
|
}),
|
|
399
|
-
filtered.length === 0 && /* @__PURE__ */
|
|
425
|
+
filtered.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "px-3 py-2 text-sm text-zinc-500 dark:text-zinc-400", children: "No results" })
|
|
400
426
|
] })
|
|
401
427
|
]
|
|
402
428
|
}
|
|
@@ -404,6 +430,10 @@ var LanguageSwitcher = React3__namespace.forwardRef(
|
|
|
404
430
|
] });
|
|
405
431
|
}
|
|
406
432
|
);
|
|
433
|
+
|
|
434
|
+
// src/registry/components/phone-input.tsx
|
|
435
|
+
var React3 = __toESM(require("react"), 1);
|
|
436
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
407
437
|
var COUNTRIES = [
|
|
408
438
|
{ code: "US", dialCode: "+1", name: "United States", flag: "\u{1F1FA}\u{1F1F8}" },
|
|
409
439
|
{ code: "GB", dialCode: "+44", name: "United Kingdom", flag: "\u{1F1EC}\u{1F1E7}" },
|
|
@@ -459,39 +489,35 @@ var COUNTRIES = [
|
|
|
459
489
|
function getCountryByCode(code) {
|
|
460
490
|
return COUNTRIES.find((c) => c.code === code.toUpperCase());
|
|
461
491
|
}
|
|
462
|
-
var PhoneInput =
|
|
492
|
+
var PhoneInput = React3.forwardRef(function PhoneInput2({
|
|
463
493
|
value,
|
|
464
494
|
defaultValue,
|
|
465
495
|
onValueChange,
|
|
466
|
-
onChange,
|
|
467
496
|
defaultCountry = "US",
|
|
468
497
|
placeholder = "Phone number",
|
|
469
498
|
disabled = false,
|
|
470
499
|
className,
|
|
471
|
-
showFlags,
|
|
472
|
-
showFlag,
|
|
500
|
+
showFlags = true,
|
|
473
501
|
label = "Phone number",
|
|
474
502
|
...rest
|
|
475
503
|
}, forwardedRef) {
|
|
476
|
-
|
|
477
|
-
const flagsVisible = (_a = showFlags != null ? showFlags : showFlag) != null ? _a : true;
|
|
478
|
-
const [selectedCountry, setSelectedCountry] = React3__namespace.useState(
|
|
504
|
+
const [selectedCountry, setSelectedCountry] = React3.useState(
|
|
479
505
|
() => {
|
|
480
|
-
var
|
|
481
|
-
return (
|
|
506
|
+
var _a;
|
|
507
|
+
return (_a = getCountryByCode(defaultCountry)) != null ? _a : COUNTRIES[0];
|
|
482
508
|
}
|
|
483
509
|
);
|
|
484
|
-
const notify = onValueChange != null ? onValueChange : onChange;
|
|
485
510
|
const [inputValue, setInputValue] = useControllableState(value, defaultValue != null ? defaultValue : "", void 0);
|
|
486
|
-
const [open, setOpen] =
|
|
487
|
-
const [search, setSearch] =
|
|
488
|
-
const ref =
|
|
489
|
-
const inputRef =
|
|
490
|
-
|
|
511
|
+
const [open, setOpen] = React3.useState(false);
|
|
512
|
+
const [search, setSearch] = React3.useState("");
|
|
513
|
+
const ref = React3.useRef(null);
|
|
514
|
+
const inputRef = React3.useRef(null);
|
|
515
|
+
const searchRef = React3.useRef(null);
|
|
516
|
+
React3.useImperativeHandle(forwardedRef, () => inputRef.current);
|
|
491
517
|
const filtered = COUNTRIES.filter(
|
|
492
518
|
(c) => c.name.toLowerCase().includes(search.toLowerCase()) || c.dialCode.includes(search) || c.code.toLowerCase().includes(search.toLowerCase())
|
|
493
519
|
);
|
|
494
|
-
|
|
520
|
+
React3.useEffect(() => {
|
|
495
521
|
function handleClickOutside(e) {
|
|
496
522
|
if (ref.current && !ref.current.contains(e.target)) {
|
|
497
523
|
setOpen(false);
|
|
@@ -501,11 +527,11 @@ var PhoneInput = React3__namespace.forwardRef(function PhoneInput2({
|
|
|
501
527
|
document.addEventListener("mousedown", handleClickOutside);
|
|
502
528
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
503
529
|
}, []);
|
|
504
|
-
|
|
505
|
-
var
|
|
506
|
-
if (open) (
|
|
530
|
+
React3.useEffect(() => {
|
|
531
|
+
var _a;
|
|
532
|
+
if (open) (_a = searchRef.current) == null ? void 0 : _a.focus();
|
|
507
533
|
}, [open]);
|
|
508
|
-
|
|
534
|
+
React3.useEffect(() => {
|
|
509
535
|
function handleKeyDown(e) {
|
|
510
536
|
if (e.key === "Escape") {
|
|
511
537
|
setOpen(false);
|
|
@@ -518,20 +544,20 @@ var PhoneInput = React3__namespace.forwardRef(function PhoneInput2({
|
|
|
518
544
|
}
|
|
519
545
|
}, [open]);
|
|
520
546
|
const handleCountrySelect = (country) => {
|
|
521
|
-
var
|
|
547
|
+
var _a;
|
|
522
548
|
setSelectedCountry(country);
|
|
523
549
|
setOpen(false);
|
|
524
550
|
setSearch("");
|
|
525
|
-
|
|
526
|
-
(
|
|
551
|
+
onValueChange == null ? void 0 : onValueChange(inputValue, country);
|
|
552
|
+
(_a = inputRef.current) == null ? void 0 : _a.focus();
|
|
527
553
|
};
|
|
528
554
|
const handleInputChange = (e) => {
|
|
529
555
|
const newValue = e.target.value;
|
|
530
556
|
setInputValue(newValue);
|
|
531
|
-
|
|
557
|
+
onValueChange == null ? void 0 : onValueChange(newValue, selectedCountry);
|
|
532
558
|
};
|
|
533
|
-
return /* @__PURE__ */
|
|
534
|
-
/* @__PURE__ */
|
|
559
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { ref, className: cn("relative inline-block text-sm", className), children: [
|
|
560
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
535
561
|
"div",
|
|
536
562
|
{
|
|
537
563
|
className: cn(
|
|
@@ -540,7 +566,7 @@ var PhoneInput = React3__namespace.forwardRef(function PhoneInput2({
|
|
|
540
566
|
disabled && "opacity-50 cursor-not-allowed"
|
|
541
567
|
),
|
|
542
568
|
children: [
|
|
543
|
-
/* @__PURE__ */
|
|
569
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
544
570
|
"button",
|
|
545
571
|
{
|
|
546
572
|
type: "button",
|
|
@@ -555,9 +581,9 @@ var PhoneInput = React3__namespace.forwardRef(function PhoneInput2({
|
|
|
555
581
|
"aria-expanded": open,
|
|
556
582
|
"aria-haspopup": "listbox",
|
|
557
583
|
children: [
|
|
558
|
-
|
|
559
|
-
/* @__PURE__ */
|
|
560
|
-
/* @__PURE__ */
|
|
584
|
+
showFlags && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "text-base leading-none", children: selectedCountry.flag }),
|
|
585
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "font-mono text-xs", children: selectedCountry.dialCode }),
|
|
586
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
561
587
|
"svg",
|
|
562
588
|
{
|
|
563
589
|
className: cn(
|
|
@@ -568,13 +594,13 @@ var PhoneInput = React3__namespace.forwardRef(function PhoneInput2({
|
|
|
568
594
|
viewBox: "0 0 24 24",
|
|
569
595
|
stroke: "currentColor",
|
|
570
596
|
strokeWidth: 2,
|
|
571
|
-
children: /* @__PURE__ */
|
|
597
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" })
|
|
572
598
|
}
|
|
573
599
|
)
|
|
574
600
|
]
|
|
575
601
|
}
|
|
576
602
|
),
|
|
577
|
-
/* @__PURE__ */
|
|
603
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
578
604
|
"input",
|
|
579
605
|
{
|
|
580
606
|
ref: inputRef,
|
|
@@ -596,28 +622,29 @@ var PhoneInput = React3__namespace.forwardRef(function PhoneInput2({
|
|
|
596
622
|
]
|
|
597
623
|
}
|
|
598
624
|
),
|
|
599
|
-
open && /* @__PURE__ */
|
|
625
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
600
626
|
"div",
|
|
601
627
|
{
|
|
602
628
|
className: "absolute z-50 mt-1 min-w-[280px] overflow-hidden rounded-xl border border-zinc-200 bg-white shadow-xl dark:border-zinc-800 dark:bg-zinc-950",
|
|
603
629
|
role: "listbox",
|
|
604
630
|
"aria-label": "Select country",
|
|
605
631
|
children: [
|
|
606
|
-
/* @__PURE__ */
|
|
632
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "border-b border-zinc-200 p-2 dark:border-zinc-800", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
607
633
|
"input",
|
|
608
634
|
{
|
|
609
|
-
ref:
|
|
635
|
+
ref: searchRef,
|
|
610
636
|
type: "text",
|
|
611
637
|
placeholder: "Search countries...",
|
|
638
|
+
"aria-label": "Search countries",
|
|
612
639
|
value: search,
|
|
613
640
|
onChange: (e) => setSearch(e.target.value),
|
|
614
641
|
className: "w-full rounded-lg bg-zinc-100 px-3 py-1.5 text-sm text-zinc-900 outline-none placeholder:text-zinc-400 focus:ring-1 focus:ring-emerald-500/50 dark:bg-zinc-800 dark:text-zinc-100 dark:placeholder:text-zinc-500"
|
|
615
642
|
}
|
|
616
643
|
) }),
|
|
617
|
-
/* @__PURE__ */
|
|
644
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "max-h-60 overflow-y-auto p-1", children: [
|
|
618
645
|
filtered.map((country) => {
|
|
619
646
|
const isActive = country.code === selectedCountry.code;
|
|
620
|
-
return /* @__PURE__ */
|
|
647
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
621
648
|
"button",
|
|
622
649
|
{
|
|
623
650
|
type: "button",
|
|
@@ -629,10 +656,10 @@ var PhoneInput = React3__namespace.forwardRef(function PhoneInput2({
|
|
|
629
656
|
isActive ? "bg-emerald-500/10 text-emerald-600 font-medium dark:text-emerald-400" : "text-zinc-500 hover:bg-zinc-100 hover:text-zinc-900 dark:text-zinc-400 dark:hover:bg-zinc-800 dark:hover:text-zinc-100"
|
|
630
657
|
),
|
|
631
658
|
children: [
|
|
632
|
-
/* @__PURE__ */
|
|
633
|
-
/* @__PURE__ */
|
|
634
|
-
/* @__PURE__ */
|
|
635
|
-
isActive && /* @__PURE__ */
|
|
659
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "text-base leading-none", children: country.flag }),
|
|
660
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "flex-1", children: country.name }),
|
|
661
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "font-mono text-xs text-zinc-500 dark:text-zinc-400", children: country.dialCode }),
|
|
662
|
+
isActive && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
636
663
|
"svg",
|
|
637
664
|
{
|
|
638
665
|
className: "size-4 text-emerald-600 dark:text-emerald-400",
|
|
@@ -640,7 +667,7 @@ var PhoneInput = React3__namespace.forwardRef(function PhoneInput2({
|
|
|
640
667
|
viewBox: "0 0 24 24",
|
|
641
668
|
stroke: "currentColor",
|
|
642
669
|
strokeWidth: 2,
|
|
643
|
-
children: /* @__PURE__ */
|
|
670
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" })
|
|
644
671
|
}
|
|
645
672
|
)
|
|
646
673
|
]
|
|
@@ -648,13 +675,17 @@ var PhoneInput = React3__namespace.forwardRef(function PhoneInput2({
|
|
|
648
675
|
country.code
|
|
649
676
|
);
|
|
650
677
|
}),
|
|
651
|
-
filtered.length === 0 && /* @__PURE__ */
|
|
678
|
+
filtered.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "px-3 py-2 text-sm text-zinc-500 dark:text-zinc-400", children: "No countries found" })
|
|
652
679
|
] })
|
|
653
680
|
]
|
|
654
681
|
}
|
|
655
682
|
)
|
|
656
683
|
] });
|
|
657
684
|
});
|
|
685
|
+
|
|
686
|
+
// src/registry/components/navbar.tsx
|
|
687
|
+
var React4 = __toESM(require("react"), 1);
|
|
688
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
658
689
|
var LOCALE_MAP = {
|
|
659
690
|
en: { label: "English", flag: "\u{1F1FA}\u{1F1F8}" },
|
|
660
691
|
fr: { label: "Fran\xE7ais", flag: "\u{1F1EB}\u{1F1F7}" },
|
|
@@ -705,15 +736,13 @@ function getLocaleInfo(code) {
|
|
|
705
736
|
var _a;
|
|
706
737
|
return (_a = LOCALE_MAP[code]) != null ? _a : { label: code.toUpperCase(), flag: "\u{1F310}" };
|
|
707
738
|
}
|
|
708
|
-
var NavBar =
|
|
739
|
+
var NavBar = React4.forwardRef(function NavBar2({
|
|
709
740
|
logo,
|
|
710
741
|
links = [],
|
|
711
742
|
locales = [],
|
|
712
743
|
value,
|
|
713
744
|
defaultValue,
|
|
714
745
|
onValueChange,
|
|
715
|
-
currentLocale,
|
|
716
|
-
onLocaleChange,
|
|
717
746
|
cta,
|
|
718
747
|
showGitHub = false,
|
|
719
748
|
githubUrl = "https://github.com/babelize/babelize-elements",
|
|
@@ -723,75 +752,85 @@ var NavBar = React3__namespace.forwardRef(function NavBar2({
|
|
|
723
752
|
linkComponent: Link = "a",
|
|
724
753
|
...rest
|
|
725
754
|
}, forwardedRef) {
|
|
755
|
+
var _a, _b;
|
|
726
756
|
const [locale, setLocale] = useControllableState(
|
|
727
|
-
value
|
|
728
|
-
defaultValue != null ? defaultValue : "en",
|
|
729
|
-
onValueChange
|
|
757
|
+
value,
|
|
758
|
+
(_b = defaultValue != null ? defaultValue : (_a = locales[0]) == null ? void 0 : _a.code) != null ? _b : "en",
|
|
759
|
+
onValueChange
|
|
730
760
|
);
|
|
731
|
-
const [mobileOpen, setMobileOpen] =
|
|
732
|
-
const [langOpen, setLangOpen] =
|
|
733
|
-
const langRef =
|
|
734
|
-
const mobileLangRef =
|
|
761
|
+
const [mobileOpen, setMobileOpen] = React4.useState(false);
|
|
762
|
+
const [langOpen, setLangOpen] = React4.useState(null);
|
|
763
|
+
const langRef = React4.useRef(null);
|
|
764
|
+
const mobileLangRef = React4.useRef(null);
|
|
765
|
+
const menuId = React4.useId();
|
|
735
766
|
const currentLocaleInfo = getLocaleInfo(locale);
|
|
736
|
-
|
|
767
|
+
React4.useEffect(() => {
|
|
737
768
|
function handleClickOutside(e) {
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
769
|
+
var _a2, _b2;
|
|
770
|
+
const target = e.target;
|
|
771
|
+
if (((_a2 = langRef.current) == null ? void 0 : _a2.contains(target)) || ((_b2 = mobileLangRef.current) == null ? void 0 : _b2.contains(target))) return;
|
|
772
|
+
setLangOpen(null);
|
|
741
773
|
}
|
|
742
774
|
document.addEventListener("mousedown", handleClickOutside);
|
|
743
775
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
744
776
|
}, []);
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
777
|
+
React4.useEffect(() => {
|
|
778
|
+
function handleKeyDown(e) {
|
|
779
|
+
if (e.key !== "Escape") return;
|
|
780
|
+
setLangOpen(null);
|
|
781
|
+
setMobileOpen(false);
|
|
750
782
|
}
|
|
783
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
784
|
+
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
785
|
+
}, []);
|
|
786
|
+
React4.useEffect(() => {
|
|
787
|
+
if (!mobileOpen) return;
|
|
788
|
+
const previous = document.body.style.overflow;
|
|
789
|
+
document.body.style.overflow = "hidden";
|
|
751
790
|
return () => {
|
|
752
|
-
document.body.style.overflow =
|
|
791
|
+
document.body.style.overflow = previous;
|
|
753
792
|
};
|
|
754
793
|
}, [mobileOpen]);
|
|
755
|
-
const langButton = /* @__PURE__ */
|
|
794
|
+
const langButton = /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
756
795
|
"button",
|
|
757
796
|
{
|
|
758
797
|
type: "button",
|
|
759
|
-
onClick: () => setLangOpen(
|
|
798
|
+
onClick: () => setLangOpen(langOpen === "desktop" ? null : "desktop"),
|
|
760
799
|
className: "flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-sm font-medium text-zinc-500 transition-colors hover:text-zinc-900 dark:text-zinc-400 dark:hover:text-zinc-50",
|
|
761
|
-
"aria-expanded": langOpen,
|
|
800
|
+
"aria-expanded": langOpen === "desktop",
|
|
762
801
|
"aria-haspopup": "listbox",
|
|
763
802
|
"aria-label": `Current language: ${currentLocaleInfo.label}`,
|
|
764
803
|
children: [
|
|
765
|
-
showFlags && /* @__PURE__ */
|
|
766
|
-
/* @__PURE__ */
|
|
767
|
-
/* @__PURE__ */
|
|
804
|
+
showFlags && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "text-sm leading-none", children: currentLocaleInfo.flag }),
|
|
805
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "hidden sm:inline", children: currentLocaleInfo.label }),
|
|
806
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
768
807
|
"svg",
|
|
769
808
|
{
|
|
770
809
|
className: cn(
|
|
771
810
|
"size-3 text-zinc-500 transition-transform dark:text-zinc-400",
|
|
772
|
-
langOpen && "rotate-180"
|
|
811
|
+
langOpen === "desktop" && "rotate-180"
|
|
773
812
|
),
|
|
774
813
|
fill: "none",
|
|
775
814
|
viewBox: "0 0 24 24",
|
|
776
815
|
stroke: "currentColor",
|
|
777
816
|
strokeWidth: 2,
|
|
778
|
-
children: /* @__PURE__ */
|
|
817
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" })
|
|
779
818
|
}
|
|
780
819
|
)
|
|
781
820
|
]
|
|
782
821
|
}
|
|
783
822
|
);
|
|
784
|
-
const langDropdown = /* @__PURE__ */
|
|
823
|
+
const langDropdown = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
785
824
|
"div",
|
|
786
825
|
{
|
|
787
826
|
className: "absolute right-0 top-full z-50 mt-1.5 min-w-[170px] rounded-xl border border-zinc-200 bg-white py-1.5 shadow-xl dark:border-zinc-800 dark:bg-zinc-950",
|
|
788
827
|
role: "listbox",
|
|
789
828
|
"aria-label": "Select language",
|
|
790
829
|
children: locales.map((item) => {
|
|
791
|
-
var
|
|
830
|
+
var _a2;
|
|
792
831
|
const info = getLocaleInfo(item.code);
|
|
793
832
|
const isActive = item.code === locale;
|
|
794
|
-
return /* @__PURE__ */
|
|
833
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
795
834
|
"button",
|
|
796
835
|
{
|
|
797
836
|
type: "button",
|
|
@@ -799,16 +838,16 @@ var NavBar = React3__namespace.forwardRef(function NavBar2({
|
|
|
799
838
|
"aria-selected": isActive,
|
|
800
839
|
onClick: () => {
|
|
801
840
|
setLocale(item.code);
|
|
802
|
-
setLangOpen(
|
|
841
|
+
setLangOpen(null);
|
|
803
842
|
},
|
|
804
843
|
className: cn(
|
|
805
|
-
"flex w-
|
|
844
|
+
"mx-1.5 flex w-[calc(100%-12px)] items-center gap-2.5 rounded-lg px-3 py-2 text-sm transition-colors",
|
|
806
845
|
isActive ? "bg-emerald-500/10 text-emerald-600 font-medium dark:text-emerald-400" : "text-zinc-500 hover:bg-zinc-100 hover:text-zinc-900 dark:text-zinc-400 dark:hover:bg-zinc-800 dark:hover:text-zinc-100"
|
|
807
846
|
),
|
|
808
847
|
children: [
|
|
809
|
-
showFlags && /* @__PURE__ */
|
|
810
|
-
/* @__PURE__ */
|
|
811
|
-
isActive && /* @__PURE__ */
|
|
848
|
+
showFlags && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "text-base leading-none", children: info.flag }),
|
|
849
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "flex-1", children: (_a2 = item.label) != null ? _a2 : info.label }),
|
|
850
|
+
isActive && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
812
851
|
"svg",
|
|
813
852
|
{
|
|
814
853
|
className: "size-4 shrink-0 text-emerald-600 dark:text-emerald-400",
|
|
@@ -816,7 +855,7 @@ var NavBar = React3__namespace.forwardRef(function NavBar2({
|
|
|
816
855
|
viewBox: "0 0 24 24",
|
|
817
856
|
stroke: "currentColor",
|
|
818
857
|
strokeWidth: 2.5,
|
|
819
|
-
children: /* @__PURE__ */
|
|
858
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" })
|
|
820
859
|
}
|
|
821
860
|
)
|
|
822
861
|
]
|
|
@@ -826,7 +865,7 @@ var NavBar = React3__namespace.forwardRef(function NavBar2({
|
|
|
826
865
|
})
|
|
827
866
|
}
|
|
828
867
|
);
|
|
829
|
-
return /* @__PURE__ */
|
|
868
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
830
869
|
"nav",
|
|
831
870
|
{
|
|
832
871
|
ref: forwardedRef,
|
|
@@ -837,9 +876,9 @@ var NavBar = React3__namespace.forwardRef(function NavBar2({
|
|
|
837
876
|
className
|
|
838
877
|
),
|
|
839
878
|
children: [
|
|
840
|
-
/* @__PURE__ */
|
|
841
|
-
logo && /* @__PURE__ */
|
|
842
|
-
/* @__PURE__ */
|
|
879
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "mx-auto hidden max-w-6xl items-center justify-between px-5 py-3 md:flex", children: [
|
|
880
|
+
logo && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "flex-shrink-0", children: logo }),
|
|
881
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "flex items-center gap-1", children: links.map((link) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
843
882
|
Link,
|
|
844
883
|
{
|
|
845
884
|
href: link.href,
|
|
@@ -848,12 +887,12 @@ var NavBar = React3__namespace.forwardRef(function NavBar2({
|
|
|
848
887
|
},
|
|
849
888
|
link.href
|
|
850
889
|
)) }),
|
|
851
|
-
/* @__PURE__ */
|
|
852
|
-
locales.length > 0 && /* @__PURE__ */
|
|
890
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
891
|
+
locales.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { ref: langRef, className: "relative", children: [
|
|
853
892
|
langButton,
|
|
854
|
-
langOpen && langDropdown
|
|
893
|
+
langOpen === "desktop" && langDropdown
|
|
855
894
|
] }),
|
|
856
|
-
showGitHub && /* @__PURE__ */
|
|
895
|
+
showGitHub && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
857
896
|
"a",
|
|
858
897
|
{
|
|
859
898
|
href: githubUrl,
|
|
@@ -861,10 +900,10 @@ var NavBar = React3__namespace.forwardRef(function NavBar2({
|
|
|
861
900
|
rel: "noopener noreferrer",
|
|
862
901
|
className: "inline-flex size-8 items-center justify-center rounded-md transition-colors no-underline text-zinc-500 hover:text-zinc-900 dark:text-zinc-400 dark:hover:text-zinc-50",
|
|
863
902
|
"aria-label": "GitHub",
|
|
864
|
-
children: /* @__PURE__ */
|
|
903
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { d: "M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12" }) })
|
|
865
904
|
}
|
|
866
905
|
),
|
|
867
|
-
cta && /* @__PURE__ */
|
|
906
|
+
cta && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
868
907
|
Link,
|
|
869
908
|
{
|
|
870
909
|
href: cta.href,
|
|
@@ -874,29 +913,34 @@ var NavBar = React3__namespace.forwardRef(function NavBar2({
|
|
|
874
913
|
)
|
|
875
914
|
] })
|
|
876
915
|
] }),
|
|
877
|
-
/* @__PURE__ */
|
|
878
|
-
logo && /* @__PURE__ */
|
|
879
|
-
/* @__PURE__ */
|
|
880
|
-
locales.length > 0 && /* @__PURE__ */
|
|
881
|
-
/* @__PURE__ */
|
|
916
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex items-center justify-between px-4 py-3 md:hidden", children: [
|
|
917
|
+
logo && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "flex-shrink-0", children: logo }),
|
|
918
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
919
|
+
locales.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { ref: mobileLangRef, className: "relative", children: [
|
|
920
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
882
921
|
"button",
|
|
883
922
|
{
|
|
884
923
|
type: "button",
|
|
885
|
-
onClick: () => setLangOpen(
|
|
924
|
+
onClick: () => setLangOpen(langOpen === "mobile" ? null : "mobile"),
|
|
886
925
|
className: "inline-flex size-8 items-center justify-center rounded-md transition-colors text-zinc-500 hover:text-zinc-900 dark:text-zinc-400 dark:hover:text-zinc-50",
|
|
926
|
+
"aria-expanded": langOpen === "mobile",
|
|
927
|
+
"aria-haspopup": "listbox",
|
|
887
928
|
"aria-label": `Current language: ${currentLocaleInfo.label}`,
|
|
888
|
-
children: showFlags && /* @__PURE__ */
|
|
929
|
+
children: showFlags && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "text-base leading-none", children: currentLocaleInfo.flag })
|
|
889
930
|
}
|
|
890
931
|
),
|
|
891
|
-
langOpen && langDropdown
|
|
932
|
+
langOpen === "mobile" && langDropdown
|
|
892
933
|
] }),
|
|
893
|
-
/* @__PURE__ */
|
|
934
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
894
935
|
"button",
|
|
895
936
|
{
|
|
937
|
+
type: "button",
|
|
896
938
|
className: "inline-flex size-8 items-center justify-center rounded-md transition-colors text-zinc-500 hover:text-zinc-900 dark:text-zinc-400 dark:hover:text-zinc-50",
|
|
897
939
|
onClick: () => setMobileOpen(!mobileOpen),
|
|
898
940
|
"aria-label": "Toggle menu",
|
|
899
|
-
|
|
941
|
+
"aria-expanded": mobileOpen,
|
|
942
|
+
"aria-controls": mobileOpen ? menuId : void 0,
|
|
943
|
+
children: mobileOpen ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
900
944
|
"svg",
|
|
901
945
|
{
|
|
902
946
|
className: "size-4",
|
|
@@ -904,9 +948,9 @@ var NavBar = React3__namespace.forwardRef(function NavBar2({
|
|
|
904
948
|
viewBox: "0 0 24 24",
|
|
905
949
|
stroke: "currentColor",
|
|
906
950
|
strokeWidth: 2,
|
|
907
|
-
children: /* @__PURE__ */
|
|
951
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" })
|
|
908
952
|
}
|
|
909
|
-
) : /* @__PURE__ */
|
|
953
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
910
954
|
"svg",
|
|
911
955
|
{
|
|
912
956
|
className: "size-4",
|
|
@@ -914,43 +958,51 @@ var NavBar = React3__namespace.forwardRef(function NavBar2({
|
|
|
914
958
|
viewBox: "0 0 24 24",
|
|
915
959
|
stroke: "currentColor",
|
|
916
960
|
strokeWidth: 2,
|
|
917
|
-
children: /* @__PURE__ */
|
|
961
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 6h16M4 12h16M4 18h16" })
|
|
918
962
|
}
|
|
919
963
|
)
|
|
920
964
|
}
|
|
921
965
|
)
|
|
922
966
|
] })
|
|
923
967
|
] }),
|
|
924
|
-
mobileOpen && /* @__PURE__ */
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
968
|
+
mobileOpen && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
969
|
+
"div",
|
|
970
|
+
{
|
|
971
|
+
id: menuId,
|
|
972
|
+
className: "border-t border-zinc-200 bg-white px-4 py-3 md:hidden dark:border-zinc-800 dark:bg-zinc-900",
|
|
973
|
+
children: [
|
|
974
|
+
links.map((link) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
975
|
+
Link,
|
|
976
|
+
{
|
|
977
|
+
href: link.href,
|
|
978
|
+
onClick: () => setMobileOpen(false),
|
|
979
|
+
className: "block py-2.5 text-sm transition-colors no-underline text-zinc-500 hover:text-zinc-900 dark:text-zinc-400 dark:hover:text-zinc-50",
|
|
980
|
+
children: link.label
|
|
981
|
+
},
|
|
982
|
+
link.href
|
|
983
|
+
)),
|
|
984
|
+
cta && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
985
|
+
Link,
|
|
986
|
+
{
|
|
987
|
+
href: cta.href,
|
|
988
|
+
onClick: () => setMobileOpen(false),
|
|
989
|
+
className: "mt-2 block rounded-md px-3.5 py-2 text-center text-sm font-medium transition-colors no-underline bg-emerald-500 text-white hover:opacity-90",
|
|
990
|
+
children: cta.label
|
|
991
|
+
}
|
|
992
|
+
)
|
|
993
|
+
]
|
|
994
|
+
}
|
|
995
|
+
)
|
|
945
996
|
]
|
|
946
997
|
}
|
|
947
998
|
);
|
|
948
999
|
});
|
|
949
|
-
|
|
950
|
-
exports
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
1000
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
1001
|
+
0 && (module.exports = {
|
|
1002
|
+
COUNTRIES,
|
|
1003
|
+
LanguageSwitcher,
|
|
1004
|
+
NavBar,
|
|
1005
|
+
PhoneInput,
|
|
1006
|
+
cn
|
|
1007
|
+
});
|
|
956
1008
|
//# sourceMappingURL=index.cjs.map
|