@carparkteam/parz-ui 0.0.0-stage → 1.0.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/CHANGELOG.hy.md +39 -0
- package/CHANGELOG.md +39 -0
- package/CHANGELOG.ru.md +39 -0
- package/LICENSE +40 -0
- package/README.hy.md +99 -0
- package/README.md +98 -2
- package/README.ru.md +99 -0
- package/dist/parz-ui.css +1 -0
- package/dist/parz-ui.js +1442 -0
- package/dist/types/Icon.d.ts +49 -0
- package/dist/types/ParzCheckbox.d.ts +41 -0
- package/dist/types/ParzCredit.d.ts +13 -0
- package/dist/types/ParzMenu.d.ts +240 -0
- package/dist/types/ParzSlider.d.ts +68 -0
- package/dist/types/ParzToggle.d.ts +42 -0
- package/dist/types/Wordmark.d.ts +42 -0
- package/dist/types/icons.d.ts +2 -0
- package/dist/types/index.d.ts +16 -0
- package/docs/animologo.en.md +35 -0
- package/docs/animologo.hy.md +35 -0
- package/docs/animologo.ru.md +35 -0
- package/docs/parz-checkbox.en.md +58 -0
- package/docs/parz-checkbox.hy.md +58 -0
- package/docs/parz-checkbox.ru.md +58 -0
- package/docs/parz-menu.en.md +394 -0
- package/docs/parz-menu.hy.md +395 -0
- package/docs/parz-menu.ru.md +393 -0
- package/docs/parz-slider.en.md +76 -0
- package/docs/parz-slider.hy.md +76 -0
- package/docs/parz-slider.ru.md +76 -0
- package/docs/parz-toggle.en.md +62 -0
- package/docs/parz-toggle.hy.md +62 -0
- package/docs/parz-toggle.ru.md +62 -0
- package/package.json +83 -6
package/dist/parz-ui.js
ADDED
|
@@ -0,0 +1,1442 @@
|
|
|
1
|
+
import { jsxs as z, jsx as r, Fragment as Tt } from "react/jsx-runtime";
|
|
2
|
+
import { isValidElement as Yt, useState as B, useRef as $, useLayoutEffect as Me, useCallback as ot, useEffect as ae, useMemo as mt, useReducer as Qt, useId as Jt } from "react";
|
|
3
|
+
const Dt = {
|
|
4
|
+
film: [
|
|
5
|
+
'<rect x="2" y="2.75" width="12" height="10.5" rx="2"/><line x1="5.25" y1="2.75" x2="5.25" y2="13.25"/><line x1="10.75" y1="2.75" x2="10.75" y2="13.25"/><line x1="2" y1="8" x2="5.25" y2="8"/><line x1="10.75" y1="8" x2="14" y2="8"/>',
|
|
6
|
+
'<path d="M3.417 2.407 L3.508 2.386 L3.953 2.336 L4 2.333 L12 2.333 L12.047 2.336 L12.492 2.386 L12.583 2.407 L13.005 2.555 L13.076 2.587 L13.089 2.595 L13.469 2.834 L13.542 2.892 L13.858 3.208 L13.916 3.281 L14.155 3.661 L14.163 3.674 L14.195 3.745 L14.343 4.167 L14.364 4.258 L14.414 4.703 L14.417 4.75 L14.417 11.25 L14.414 11.297 L14.364 11.742 L14.343 11.833 L14.195 12.255 L14.163 12.326 L14.155 12.339 L13.916 12.719 L13.858 12.792 L13.542 13.108 L13.469 13.166 L13.089 13.405 L13.076 13.413 L13.005 13.445 L12.583 13.593 L12.492 13.614 L12.047 13.664 L12 13.667 L4 13.667 L3.953 13.664 L3.508 13.614 L3.417 13.593 L2.995 13.445 L2.924 13.413 L2.911 13.405 L2.531 13.166 L2.458 13.108 L2.142 12.792 L2.084 12.719 L1.845 12.339 L1.837 12.326 L1.805 12.255 L1.657 11.833 L1.636 11.742 L1.586 11.297 L1.583 11.25 L1.583 4.75 L1.586 4.703 L1.636 4.258 L1.657 4.167 L1.805 3.745 L1.837 3.674 L1.845 3.661 L2.084 3.281 L2.142 3.208 L2.458 2.892 L2.531 2.834 L2.911 2.595 L2.924 2.587 L2.995 2.555 Z M4.833 2.75 L4.833 7.583 L2 7.583 L1.792 7.639 L1.639 7.792 L1.583 8 L1.639 8.208 L1.792 8.361 L2 8.417 L4.833 8.417 L4.833 13.25 L4.889 13.458 L5.042 13.611 L5.25 13.667 L5.458 13.611 L5.611 13.458 L5.667 13.25 L5.667 2.75 L5.611 2.542 L5.458 2.389 L5.25 2.333 L5.042 2.389 L4.889 2.542 Z M10.389 2.542 L10.333 2.75 L10.333 13.25 L10.389 13.458 L10.542 13.611 L10.75 13.667 L10.958 13.611 L11.111 13.458 L11.167 13.25 L11.167 8.417 L14 8.417 L14.208 8.361 L14.361 8.208 L14.417 8 L14.361 7.792 L14.208 7.639 L14 7.583 L11.167 7.583 L11.167 2.75 L11.111 2.542 L10.958 2.389 L10.75 2.333 L10.542 2.389 Z" fill="currentColor" fill-rule="evenodd" stroke="none"/>'
|
|
7
|
+
],
|
|
8
|
+
ticket: [
|
|
9
|
+
'<path d="M3.25 3.5 H12.75 A1.25 1.25 0 0 1 14 4.75 V6.25 A1.75 1.75 0 0 0 14 9.75 V11.25 A1.25 1.25 0 0 1 12.75 12.5 H3.25 A1.25 1.25 0 0 1 2 11.25 V9.75 A1.75 1.75 0 0 0 2 6.25 V4.75 A1.25 1.25 0 0 1 3.25 3.5 Z"/><circle cx="9.75" cy="5.75" r="0.55" fill="currentColor" stroke="none"/><circle cx="9.75" cy="8" r="0.55" fill="currentColor" stroke="none"/><circle cx="9.75" cy="10.25" r="0.55" fill="currentColor" stroke="none"/>',
|
|
10
|
+
'<path d="M3.25 3.5 L12.75 3.5 A1.25 1.25 0 0 1 14 4.75 L14 6.25 A1.75 1.75 0 0 0 14 9.75 L14 11.25 A1.25 1.25 0 0 1 12.75 12.5 L3.25 12.5 A1.25 1.25 0 0 1 2 11.25 L2 9.75 A1.75 1.75 0 0 0 2 6.25 L2 4.75 A1.25 1.25 0 0 1 3.25 3.5 Z M10.246 5.511 L10.093 5.32 L9.872 5.214 L9.628 5.214 L9.407 5.32 L9.254 5.511 L9.2 5.75 L9.254 5.989 L9.407 6.18 L9.628 6.286 L9.872 6.286 L10.093 6.18 L10.246 5.989 L10.3 5.75 Z M10.246 7.761 L10.093 7.57 L9.872 7.464 L9.628 7.464 L9.407 7.57 L9.254 7.761 L9.2 8 L9.254 8.239 L9.407 8.43 L9.628 8.536 L9.872 8.536 L10.093 8.43 L10.246 8.239 L10.3 8 Z M10.246 10.011 L10.093 9.82 L9.872 9.714 L9.628 9.714 L9.407 9.82 L9.254 10.011 L9.2 10.25 L9.254 10.489 L9.407 10.68 L9.628 10.786 L9.872 10.786 L10.093 10.68 L10.246 10.489 L10.3 10.25 Z" fill="currentColor" fill-rule="evenodd" stroke="none"/><path d="M3.25 3.5 H12.75 A1.25 1.25 0 0 1 14 4.75 V6.25 A1.75 1.75 0 0 0 14 9.75 V11.25 A1.25 1.25 0 0 1 12.75 12.5 H3.25 A1.25 1.25 0 0 1 2 11.25 V9.75 A1.75 1.75 0 0 0 2 6.25 V4.75 A1.25 1.25 0 0 1 3.25 3.5 Z" fill="none"/>'
|
|
11
|
+
],
|
|
12
|
+
pin: [
|
|
13
|
+
'<path d="M8 14 C8 14 3.25 10 3.25 6.75 A4.75 4.75 0 0 1 12.75 6.75 C12.75 10 8 14 8 14 Z"/><circle cx="8" cy="6.75" r="1.75"/>',
|
|
14
|
+
'<path d="M8 14 C8 14 3.25 10 3.25 6.75 A4.75 4.75 0 0 1 12.75 6.75 C12.75 10 8 14 8 14 Z M9.284 7.094 L9.33 6.75 L9.284 6.406 L9.152 6.085 L8.94 5.81 L8.665 5.598 L8.344 5.466 L8 5.42 L7.656 5.466 L7.335 5.598 L7.06 5.81 L6.848 6.085 L6.716 6.406 L6.67 6.75 L6.716 7.094 L6.848 7.415 L7.06 7.69 L7.335 7.902 L7.656 8.034 L8 8.08 L8.344 8.034 L8.665 7.902 L8.94 7.69 L9.152 7.415 Z" fill="currentColor" fill-rule="evenodd" stroke="none"/><path d="M8 14 C8 14 3.25 10 3.25 6.75 A4.75 4.75 0 0 1 12.75 6.75 C12.75 10 8 14 8 14 Z" fill="none"/>'
|
|
15
|
+
],
|
|
16
|
+
bell: [
|
|
17
|
+
'<path d="M3.75 10.75 V6.5 A4.25 4.25 0 0 1 12.25 6.5 V10.75 L13.25 11.75 H2.75 Z"/><line x1="6.5" y1="13.75" x2="9.5" y2="13.75"/>',
|
|
18
|
+
'<path d="M3.75 10.75 V6.5 A4.25 4.25 0 0 1 12.25 6.5 V10.75 L13.25 11.75 H2.75 Z" fill="currentColor"/><line x1="6.5" y1="13.75" x2="9.5" y2="13.75"/>'
|
|
19
|
+
],
|
|
20
|
+
glasses3d: [
|
|
21
|
+
'<rect x="1.75" y="5.25" width="5.25" height="4.75" rx="2"/><rect x="9" y="5.25" width="5.25" height="4.75" rx="2"/><path d="M7 6.75 A1 1 0 0 1 9 6.75"/>',
|
|
22
|
+
null
|
|
23
|
+
],
|
|
24
|
+
clapperboard: [
|
|
25
|
+
'<rect x="2.25" y="7.25" width="11.5" height="6.5" rx="2"/><path d="M2.25 7.25 L12.703 4.463 C13.139 4.346 13.393 3.892 13.263 3.46 L12.973 2.493 C12.849 2.079 12.418 1.838 12.001 1.95 L2.297 4.537 C1.861 4.654 1.607 5.108 1.737 5.54 L2.25 7.25 Z"/><line x1="4.25" y1="4" x2="6.75" y2="6"/><line x1="8.25" y1="3" x2="10.75" y2="5"/>',
|
|
26
|
+
null
|
|
27
|
+
],
|
|
28
|
+
flame: [
|
|
29
|
+
'<path d="M8 14 A4.5 4.5 0 0 1 3.5 9.5 C3.5 6.5 6 5 6.5 2 C8.75 3.5 9.75 5.25 9.5 7.25 C10.25 6.75 10.75 6 11 5.25 C12 6.5 12.5 8 12.5 9.5 A4.5 4.5 0 0 1 8 14 Z"/>',
|
|
30
|
+
null
|
|
31
|
+
],
|
|
32
|
+
gift: [
|
|
33
|
+
'<rect x="2.75" y="7.5" width="10.5" height="6.25" rx="2"/><rect x="2" y="4.75" width="12" height="2.75" rx="1"/><line x1="8" y1="4.75" x2="8" y2="13.75"/><path d="M8 4.75 C7 2 4.25 1.75 4.25 3.5 C4.25 4.5 5.75 4.75 8 4.75 C10.25 4.75 11.75 4.5 11.75 3.5 C11.75 1.75 9 2 8 4.75"/>',
|
|
34
|
+
null
|
|
35
|
+
],
|
|
36
|
+
card: [
|
|
37
|
+
'<rect x="1.75" y="3.25" width="12.5" height="9.5" rx="2"/><line x1="1.75" y1="6.5" x2="14.25" y2="6.5"/><line x1="4" y1="10" x2="6.5" y2="10"/>',
|
|
38
|
+
null
|
|
39
|
+
],
|
|
40
|
+
globe: [
|
|
41
|
+
'<circle cx="8" cy="8" r="6"/><line x1="2" y1="8" x2="14" y2="8"/><ellipse cx="8" cy="8" rx="2.5" ry="6"/>',
|
|
42
|
+
null
|
|
43
|
+
],
|
|
44
|
+
sparkles: [
|
|
45
|
+
'<path d="M7 4 C7.5 7.25 8.75 8.5 12 9 C8.75 9.5 7.5 10.75 7 14 C6.5 10.75 5.25 9.5 2 9 C5.25 8.5 6.5 7.25 7 4 Z"/><path d="M12 1.75 C12.225 3.212 12.787 3.775 14.25 4 C12.787 4.225 12.225 4.787 12 6.25 C11.775 4.787 11.213 4.225 9.75 4 C11.213 3.775 11.775 3.212 12 1.75 Z"/>',
|
|
46
|
+
null
|
|
47
|
+
],
|
|
48
|
+
info: [
|
|
49
|
+
'<circle cx="8" cy="8" r="6"/><line x1="8" y1="7.25" x2="8" y2="11"/><circle cx="8" cy="4.85" r="0.55" fill="currentColor" stroke="none"/>',
|
|
50
|
+
null
|
|
51
|
+
],
|
|
52
|
+
logout: [
|
|
53
|
+
'<path d="M6.25 2.25 L4.75 2.25 C3.922 2.25 3.25 2.922 3.25 3.75 L3.25 12.25 C3.25 13.078 3.922 13.75 4.75 13.75 L6.25 13.75"/><line x1="6.75" y1="8" x2="13.5" y2="8"/><path d="M10.5 5 L13.5 8 L10.5 11"/>',
|
|
54
|
+
null
|
|
55
|
+
],
|
|
56
|
+
bulb: [
|
|
57
|
+
'<path d="M6.25 9.25 C6.25 8.6 5.8 8.1 5.25 7.6 C4.45 6.9 4 6.4 4 5.75 A4 4 0 0 1 12 5.75 C12 6.4 11.55 6.9 10.75 7.6 C10.2 8.1 9.75 8.6 9.75 9.25"/><line x1="6" y1="11.75" x2="10" y2="11.75"/><line x1="7" y1="14.25" x2="9" y2="14.25"/>',
|
|
58
|
+
'<path d="M6.25 9.25 C6.25 8.6 5.8 8.1 5.25 7.6 C4.45 6.9 4 6.4 4 5.75 A4 4 0 0 1 12 5.75 C12 6.4 11.55 6.9 10.75 7.6 C10.2 8.1 9.75 8.6 9.75 9.25" fill="currentColor"/><line x1="6" y1="11.75" x2="10" y2="11.75"/><line x1="7" y1="14.25" x2="9" y2="14.25"/>'
|
|
59
|
+
],
|
|
60
|
+
rotate: [
|
|
61
|
+
'<rect x="2.5" y="5.5" width="6.5" height="8.5" rx="2"/><line x1="5" y1="12.5" x2="6.5" y2="12.5"/><path d="M5.25 3.237 A5.5 5.5 0 0 1 13.168 6.119"/><path d="M13.802 4.759 L13.168 6.119 L11.809 5.485"/>',
|
|
62
|
+
null
|
|
63
|
+
],
|
|
64
|
+
star: [
|
|
65
|
+
null,
|
|
66
|
+
'<path d="M8.454 3.234 L9.646 5.819 C9.719 5.977 9.869 6.085 10.041 6.106 L12.868 6.441 C13.291 6.491 13.461 7.015 13.148 7.305 L11.059 9.237 C10.931 9.355 10.874 9.531 10.908 9.702 L11.462 12.493 C11.546 12.912 11.1 13.235 10.728 13.027 L8.244 11.637 C8.092 11.552 7.908 11.552 7.756 11.637 L5.272 13.027 C4.9 13.235 4.454 12.912 4.538 12.493 L5.092 9.702 C5.126 9.531 5.069 9.355 4.941 9.237 L2.852 7.305 C2.539 7.015 2.709 6.491 3.132 6.441 L5.959 6.106 C6.131 6.085 6.281 5.977 6.354 5.819 L7.546 3.234 C7.725 2.847 8.275 2.847 8.454 3.234 Z" fill="currentColor"/>'
|
|
67
|
+
],
|
|
68
|
+
check: [
|
|
69
|
+
'<path d="M2.75 8.5 L6.25 12 L13.25 4.5"/>',
|
|
70
|
+
null
|
|
71
|
+
],
|
|
72
|
+
chevL: [
|
|
73
|
+
'<path d="M10.125 3.75 L5.875 8 L10.125 12.25"/>',
|
|
74
|
+
null
|
|
75
|
+
],
|
|
76
|
+
chevR: [
|
|
77
|
+
'<path d="M5.875 3.75 L10.125 8 L5.875 12.25"/>',
|
|
78
|
+
null
|
|
79
|
+
],
|
|
80
|
+
popcorn: [
|
|
81
|
+
'<path d="M4.211 7.5 L11.789 7.5 C12.417 7.5 12.89 8.072 12.771 8.689 L11.906 13.189 C11.815 13.66 11.403 14 10.924 14 L5.076 14 C4.597 14 4.185 13.66 4.094 13.189 L3.229 8.689 C3.11 8.072 3.583 7.5 4.211 7.5 Z"/><path d="M3.25 7.5 A2.25 2.25 0 0 1 5.75 4.25 A2.25 2.25 0 0 1 10.25 4.25 A2.25 2.25 0 0 1 12.75 7.5"/><line x1="6.5" y1="7.5" x2="6.75" y2="14"/><line x1="9.5" y1="7.5" x2="9.25" y2="14"/>',
|
|
82
|
+
null
|
|
83
|
+
],
|
|
84
|
+
calendar: [
|
|
85
|
+
'<rect x="2.25" y="3.25" width="11.5" height="10.5" rx="2"/><line x1="5.5" y1="1.75" x2="5.5" y2="4.5"/><line x1="10.5" y1="1.75" x2="10.5" y2="4.5"/><line x1="2.25" y1="7" x2="13.75" y2="7"/>',
|
|
86
|
+
null
|
|
87
|
+
],
|
|
88
|
+
wallet: [
|
|
89
|
+
'<rect x="2" y="4" width="12" height="9.5" rx="2"/><path d="M4 4 L10.5 2.25 C11.2 2.05 11.75 2.5 11.75 3.25 V4"/><circle cx="11" cy="8.75" r="0.55" fill="currentColor" stroke="none"/>',
|
|
90
|
+
null
|
|
91
|
+
],
|
|
92
|
+
route: [
|
|
93
|
+
'<circle cx="3.75" cy="12" r="1.75"/><path d="M5.5 12 H11.5 A2 2 0 0 0 11.5 8 H4.5 A2 2 0 0 1 4.5 4 H10.5"/><circle cx="12.25" cy="4" r="1.75"/>',
|
|
94
|
+
null
|
|
95
|
+
],
|
|
96
|
+
users: [
|
|
97
|
+
'<circle cx="6" cy="5.25" r="2.5"/><path d="M1.75 13.5 C2.25 11.25 3.9 9.75 6 9.75 C8.1 9.75 9.75 11.25 10.25 13.5"/><path d="M10.25 2.85 A2.5 2.5 0 0 1 10.25 7.65"/><path d="M11.75 10 C12.9 10.5 13.7 11.8 14 13.5"/>',
|
|
98
|
+
null
|
|
99
|
+
],
|
|
100
|
+
more: ['<circle cx="8" cy="8" r="6"/><circle cx="5" cy="8" r="0.726" fill="currentColor" stroke="none"/><circle cx="8" cy="8" r="0.726" fill="currentColor" stroke="none"/><circle cx="11" cy="8" r="0.726" fill="currentColor" stroke="none"/>', '<path d="M14 8 A6 6 0 0 1 2 8 A6 6 0 0 1 14 8 Z M5.671 7.722 L5.513 7.487 L5.278 7.329 L5 7.274 L4.722 7.329 L4.487 7.487 L4.329 7.722 L4.274 8 L4.329 8.278 L4.487 8.513 L4.722 8.671 L5 8.726 L5.278 8.671 L5.513 8.513 L5.671 8.278 L5.726 8 Z M8.671 7.722 L8.513 7.487 L8.278 7.329 L8 7.274 L7.722 7.329 L7.487 7.487 L7.329 7.722 L7.274 8 L7.329 8.278 L7.487 8.513 L7.722 8.671 L8 8.726 L8.278 8.671 L8.513 8.513 L8.671 8.278 L8.726 8 Z M11.671 7.722 L11.513 7.487 L11.278 7.329 L11 7.274 L10.722 7.329 L10.487 7.487 L10.329 7.722 L10.274 8 L10.329 8.278 L10.487 8.513 L10.722 8.671 L11 8.726 L11.278 8.671 L11.513 8.513 L11.671 8.278 L11.726 8 Z" fill="currentColor" fill-rule="evenodd" stroke="none"/><circle cx="8" cy="8" r="6" fill="none"/>'],
|
|
101
|
+
plus: ['<line x1="8" y1="2.75" x2="8" y2="13.25"/><line x1="2.75" y1="8" x2="13.25" y2="8"/>', null],
|
|
102
|
+
search: ['<circle cx="7" cy="7" r="4.75"/><line x1="10.5" y1="10.5" x2="13.75" y2="13.75"/>', '<circle cx="7" cy="7" r="4.75" fill="currentColor"/><line x1="10.5" y1="10.5" x2="13.75" y2="13.75"/>'],
|
|
103
|
+
close: ['<line x1="3.75" y1="3.75" x2="12.25" y2="12.25"/><line x1="12.25" y1="3.75" x2="3.75" y2="12.25"/>', null],
|
|
104
|
+
arrowR: ['<line x1="2.75" y1="8" x2="13.25" y2="8"/><path d="M8.5 3.25 L13.25 8 L8.5 12.75"/>', null]
|
|
105
|
+
}, Rt = { rounded: "Rounded", outlined: "Outlined", sharp: "Sharp" }, gt = { filled: "", outlined: "Outlined", round: "Round", sharp: "Sharp", "two-tone": "Two Tone" };
|
|
106
|
+
function Pt(s) {
|
|
107
|
+
if (typeof s != "string") return { kind: "node" };
|
|
108
|
+
const [d, l, u] = s.split(":");
|
|
109
|
+
return d === "ms" && l ? { kind: "ms", name: l, style: u in Rt ? u : "rounded" } : d === "mi" && l ? { kind: "mi", name: l, style: u in gt ? u : "filled" } : { kind: "builtin", name: s };
|
|
110
|
+
}
|
|
111
|
+
function Ot(s, d = s === "ms" ? "rounded" : "filled") {
|
|
112
|
+
if (typeof document > "u") return;
|
|
113
|
+
const l = s === "ms" ? `Material+Symbols+${(Rt[d] || "Rounded").replace(" ", "+")}:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200` : `Material+Icons${gt[d] ? "+" + gt[d].replace(" ", "+") : ""}`, u = "ltb-font-" + l.replace(/[^a-z0-9]/gi, "");
|
|
114
|
+
if (document.getElementById(u)) return;
|
|
115
|
+
const p = document.createElement("link");
|
|
116
|
+
p.id = u, p.rel = "stylesheet", p.href = `https://fonts.googleapis.com/css2?family=${l}&display=block`, document.head.appendChild(p);
|
|
117
|
+
}
|
|
118
|
+
const en = (s) => "material-symbols-" + s, tn = (s) => s === "filled" ? "material-icons" : "material-icons-" + s;
|
|
119
|
+
function bt({ body: s, cls: d }) {
|
|
120
|
+
return /* @__PURE__ */ r(
|
|
121
|
+
"svg",
|
|
122
|
+
{
|
|
123
|
+
className: d,
|
|
124
|
+
viewBox: "0 0 16 16",
|
|
125
|
+
fill: "none",
|
|
126
|
+
stroke: "currentColor",
|
|
127
|
+
strokeWidth: 1.1,
|
|
128
|
+
strokeLinecap: "round",
|
|
129
|
+
strokeLinejoin: "round",
|
|
130
|
+
"aria-hidden": "true",
|
|
131
|
+
dangerouslySetInnerHTML: { __html: s }
|
|
132
|
+
}
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
function ve({ icon: s, activeIcon: d }) {
|
|
136
|
+
return d !== void 0 ? /* @__PURE__ */ z("span", { className: "ltb-icon ltb-icon--pair", children: [
|
|
137
|
+
/* @__PURE__ */ r("span", { className: "ltb-off", children: /* @__PURE__ */ r(Lt, { spec: s }) }),
|
|
138
|
+
/* @__PURE__ */ r("span", { className: "ltb-on", children: /* @__PURE__ */ r(Lt, { spec: d }) })
|
|
139
|
+
] }) : /* @__PURE__ */ r("span", { className: "ltb-icon", children: /* @__PURE__ */ r(Lt, { spec: s, dual: !0 }) });
|
|
140
|
+
}
|
|
141
|
+
function Lt({ spec: s, dual: d }) {
|
|
142
|
+
const l = Pt(s);
|
|
143
|
+
if (l.kind === "node") return /* @__PURE__ */ r(Tt, { children: Yt(s) || s != null ? s : null });
|
|
144
|
+
if (l.kind === "ms") return /* @__PURE__ */ r("span", { className: `${en(l.style)} ltb-ms`, "aria-hidden": "true", children: l.name });
|
|
145
|
+
if (l.kind === "mi") return /* @__PURE__ */ r("span", { className: `${tn(l.style)} ltb-mi`, "aria-hidden": "true", children: l.name });
|
|
146
|
+
const u = Dt[l.name];
|
|
147
|
+
if (!u) return /* @__PURE__ */ r("span", { className: "ltb-missing", title: `Нет иконки «${l.name}»`, children: "?" });
|
|
148
|
+
const p = u[0] || u[1], L = u[1] || u[0];
|
|
149
|
+
return d ? /* @__PURE__ */ z(Tt, { children: [
|
|
150
|
+
/* @__PURE__ */ r(bt, { body: p, cls: "ltb-svg ltb-o" }),
|
|
151
|
+
/* @__PURE__ */ r(bt, { body: L, cls: "ltb-svg ltb-s" })
|
|
152
|
+
] }) : /* @__PURE__ */ r(bt, { body: p, cls: "ltb-svg" });
|
|
153
|
+
}
|
|
154
|
+
const At = {
|
|
155
|
+
accent: "#6ee7a0",
|
|
156
|
+
text: "#8b8b93",
|
|
157
|
+
textActive: "#ffffff",
|
|
158
|
+
surfaceTop: "rgba(38,38,42,.82)",
|
|
159
|
+
surfaceBottom: "rgba(20,20,23,.88)",
|
|
160
|
+
border: "rgba(255,255,255,.06)",
|
|
161
|
+
bevelTop: "rgba(255,255,255,.14)",
|
|
162
|
+
bevelBottom: "rgba(0,0,0,.4)",
|
|
163
|
+
highlightTop: "rgba(255,255,255,.13)",
|
|
164
|
+
highlightBottom: "rgba(255,255,255,.05)",
|
|
165
|
+
highlightShadow: "inset 0 1px 0 rgba(255,255,255,.16),inset 0 -1px 0 rgba(0,0,0,.25)",
|
|
166
|
+
actionBg: "rgba(255,255,255,.07)",
|
|
167
|
+
actionActiveBg: "#ffffff",
|
|
168
|
+
actionActiveText: "#000000",
|
|
169
|
+
actionAccentBg: "#6ee7a0",
|
|
170
|
+
actionAccentText: "#04130a",
|
|
171
|
+
badgeBg: "#ff4d5e",
|
|
172
|
+
badgeText: "#ffffff",
|
|
173
|
+
badgeRing: "#1d1d21",
|
|
174
|
+
avatarFrom: "#6ee7a0",
|
|
175
|
+
avatarTo: "#2d6a4f",
|
|
176
|
+
avatarText: "#04130a",
|
|
177
|
+
fontFamily: "inherit",
|
|
178
|
+
radius: 999,
|
|
179
|
+
padding: 6,
|
|
180
|
+
gap: 10,
|
|
181
|
+
itemPaddingY: 8,
|
|
182
|
+
iconSize: 22,
|
|
183
|
+
fontSize: 11,
|
|
184
|
+
actionSize: 50,
|
|
185
|
+
blur: 20,
|
|
186
|
+
maxWidth: 540,
|
|
187
|
+
offset: 12,
|
|
188
|
+
itemMinWidth: 84,
|
|
189
|
+
shadow: "0 18px 40px -12px rgba(0,0,0,.8)",
|
|
190
|
+
headerTop: "rgba(9,9,11,.96)",
|
|
191
|
+
headerMid: "rgba(9,9,11,.82)",
|
|
192
|
+
headerBlur: 14,
|
|
193
|
+
searchBg: "rgba(255,255,255,.06)",
|
|
194
|
+
searchBorder: "rgba(255,255,255,.08)"
|
|
195
|
+
}, nn = {
|
|
196
|
+
solid: { label: "Сплошной", transparency: 0, blur: 0 },
|
|
197
|
+
frosted: { label: "Матовое", transparency: 15, blur: 20 },
|
|
198
|
+
glass: { label: "Стекло", transparency: 40, blur: 16 },
|
|
199
|
+
clear: { label: "Прозрачное", transparency: 70, blur: 10 },
|
|
200
|
+
none: { label: "Без фона", transparency: 100, blur: 0 }
|
|
201
|
+
};
|
|
202
|
+
function Ct(s, d) {
|
|
203
|
+
const l = Math.max(0, Math.min(1, d));
|
|
204
|
+
let u, p, L;
|
|
205
|
+
const m = /^rgba?\(\s*(\d+)[\s,]+(\d+)[\s,]+(\d+)/i.exec(s.trim());
|
|
206
|
+
if (m) [u, p, L] = [+m[1], +m[2], +m[3]];
|
|
207
|
+
else if (/^#[0-9a-f]{6}$/i.test(s)) {
|
|
208
|
+
const w = parseInt(s.slice(1), 16);
|
|
209
|
+
[u, p, L] = [w >> 16, w >> 8 & 255, w & 255];
|
|
210
|
+
} else if (/^#[0-9a-f]{3}$/i.test(s)) [u, p, L] = [...s.slice(1)].map((w) => parseInt(w + w, 16));
|
|
211
|
+
else return s;
|
|
212
|
+
return `rgba(${u},${p},${L},${+l.toFixed(3)})`;
|
|
213
|
+
}
|
|
214
|
+
const rn = { lead: 360, lag: 660, squash: 0.26, jelly: !0, overshoot: 1.35, shift: 550, wave: 0.035 }, It = {
|
|
215
|
+
accent: "--ltb-accent",
|
|
216
|
+
text: "--ltb-text",
|
|
217
|
+
textActive: "--ltb-text-active",
|
|
218
|
+
surfaceTop: "--ltb-surface-top",
|
|
219
|
+
surfaceBottom: "--ltb-surface-bottom",
|
|
220
|
+
border: "--ltb-border",
|
|
221
|
+
bevelTop: "--ltb-bevel-top",
|
|
222
|
+
bevelBottom: "--ltb-bevel-bottom",
|
|
223
|
+
highlightTop: "--ltb-hl-top",
|
|
224
|
+
highlightBottom: "--ltb-hl-bottom",
|
|
225
|
+
highlightShadow: "--ltb-hl-shadow",
|
|
226
|
+
actionBg: "--ltb-action-bg",
|
|
227
|
+
actionActiveBg: "--ltb-action-active-bg",
|
|
228
|
+
actionActiveText: "--ltb-action-active-text",
|
|
229
|
+
actionAccentBg: "--ltb-action-accent-bg",
|
|
230
|
+
actionAccentText: "--ltb-action-accent-text",
|
|
231
|
+
badgeBg: "--ltb-badge-bg",
|
|
232
|
+
badgeText: "--ltb-badge-text",
|
|
233
|
+
badgeRing: "--ltb-badge-ring",
|
|
234
|
+
avatarFrom: "--ltb-avatar-from",
|
|
235
|
+
avatarTo: "--ltb-avatar-to",
|
|
236
|
+
avatarText: "--ltb-avatar-text",
|
|
237
|
+
fontFamily: "--ltb-font",
|
|
238
|
+
radius: "--ltb-radius",
|
|
239
|
+
padding: "--ltb-pad",
|
|
240
|
+
gap: "--ltb-gap",
|
|
241
|
+
itemPaddingY: "--ltb-item-py",
|
|
242
|
+
iconSize: "--ltb-icon",
|
|
243
|
+
fontSize: "--ltb-font-size",
|
|
244
|
+
actionSize: "--ltb-action",
|
|
245
|
+
blur: "--ltb-blur",
|
|
246
|
+
maxWidth: "--ltb-max-width",
|
|
247
|
+
offset: "--ltb-offset",
|
|
248
|
+
itemMinWidth: "--ltb-item-min",
|
|
249
|
+
shadow: "--ltb-shadow",
|
|
250
|
+
headerTop: "--ltb-header-top",
|
|
251
|
+
headerMid: "--ltb-header-mid",
|
|
252
|
+
headerBlur: "--ltb-header-blur",
|
|
253
|
+
searchBg: "--ltb-search-bg",
|
|
254
|
+
searchBorder: "--ltb-search-border"
|
|
255
|
+
}, Et = {
|
|
256
|
+
en: { more: "More", nav: "Navigation", search: "Search", closeSearch: "Close search", go: "Search", hasNew: "new" },
|
|
257
|
+
ru: { more: "Меню", nav: "Навигация", search: "Поиск", closeSearch: "Закрыть поиск", go: "Искать", hasNew: "есть новое" },
|
|
258
|
+
hy: { more: "Մենյու", nav: "Նավիգացիա", search: "Որոնում", closeSearch: "Փակել որոնումը", go: "Որոնել", hasNew: "նոր" }
|
|
259
|
+
}, an = (s) => (d, l) => l === "dot" || l === !0 ? `${d}, ${s}` : `${d}, ${l}`;
|
|
260
|
+
function sn() {
|
|
261
|
+
const [s, d] = B(() => typeof matchMedia < "u" && matchMedia("(prefers-reduced-motion: reduce)").matches);
|
|
262
|
+
return ae(() => {
|
|
263
|
+
const l = matchMedia("(prefers-reduced-motion: reduce)"), u = () => d(l.matches);
|
|
264
|
+
return l.addEventListener("change", u), () => l.removeEventListener("change", u);
|
|
265
|
+
}, []), s;
|
|
266
|
+
}
|
|
267
|
+
const on = "cubic-bezier(.22,1,.36,1)", de = (s) => s.map((d) => ({ easing: on, ...d })), He = "__ltb_more__";
|
|
268
|
+
function yt(s, d) {
|
|
269
|
+
const [, l] = Qt((h) => h + 1, 0), u = $(s), p = $(/* @__PURE__ */ new Map()), L = $(new Set(s.map((h) => h.id))), m = new Set(s.map((h) => h.id));
|
|
270
|
+
p.current.forEach((h, M) => {
|
|
271
|
+
m.has(M) && p.current.delete(M);
|
|
272
|
+
}), u.current.forEach((h, M) => {
|
|
273
|
+
!m.has(h.id) && !p.current.has(h.id) && p.current.set(h.id, { item: h, at: M });
|
|
274
|
+
});
|
|
275
|
+
const w = s.map((h) => ({ item: h, leaving: !1, entering: !L.current.has(h.id) }));
|
|
276
|
+
[...p.current.values()].sort((h, M) => h.at - M.at).forEach(({ item: h, at: M }) => w.splice(Math.min(M, w.length), 0, { item: h, leaving: !0, entering: !1 })), Me(() => {
|
|
277
|
+
u.current = s, s.forEach((h) => L.current.add(h.id));
|
|
278
|
+
});
|
|
279
|
+
const b = [...p.current.keys()].join("|");
|
|
280
|
+
return ae(() => {
|
|
281
|
+
if (!b) return;
|
|
282
|
+
const h = window.setTimeout(() => {
|
|
283
|
+
p.current.forEach((M, Z) => L.current.delete(Z)), p.current.clear(), l();
|
|
284
|
+
}, d + 40);
|
|
285
|
+
return () => window.clearTimeout(h);
|
|
286
|
+
}, [b, d]), w;
|
|
287
|
+
}
|
|
288
|
+
const it = 2, ct = (s) => !(s == null || s === !1 || s === 0 || s === "");
|
|
289
|
+
function Ae({ value: s, max: d = 99, inline: l }) {
|
|
290
|
+
if (!ct(s)) return null;
|
|
291
|
+
if (s === "dot" || s === !0) return /* @__PURE__ */ r("span", { className: `ltb-badge ltb-badge--dot${l ? " ltb-badge--inline" : ""}`, "aria-hidden": "true" });
|
|
292
|
+
const u = typeof s == "number" && s > d ? `${d}+` : String(s);
|
|
293
|
+
return /* @__PURE__ */ r("span", { className: `ltb-badge ltb-badge--count${u.length > 2 ? " ltb-badge--wide" : ""}${l ? " ltb-badge--inline" : ""}`, "aria-hidden": "true", children: /* @__PURE__ */ r("span", { className: "ltb-badge-n", children: u }) }, u);
|
|
294
|
+
}
|
|
295
|
+
function cn({
|
|
296
|
+
items: s,
|
|
297
|
+
value: d,
|
|
298
|
+
defaultValue: l,
|
|
299
|
+
onChange: u,
|
|
300
|
+
actions: p = [],
|
|
301
|
+
activeAction: L = null,
|
|
302
|
+
onAction: m,
|
|
303
|
+
hideActions: w = !1,
|
|
304
|
+
position: b = "bottom",
|
|
305
|
+
layout: h = "stacked",
|
|
306
|
+
theme: M,
|
|
307
|
+
motion: Z,
|
|
308
|
+
maxBadge: S = 99,
|
|
309
|
+
badgeLabel: F,
|
|
310
|
+
locale: ee = "en",
|
|
311
|
+
glass: J,
|
|
312
|
+
overflow: ye = "more",
|
|
313
|
+
minItemWidth: se,
|
|
314
|
+
moreLabel: ue,
|
|
315
|
+
moreIcon: fe,
|
|
316
|
+
desktop: Y,
|
|
317
|
+
mobileSearch: V,
|
|
318
|
+
autoLoadFonts: C = !0,
|
|
319
|
+
ariaLabel: oe,
|
|
320
|
+
className: pe,
|
|
321
|
+
style: D
|
|
322
|
+
}) {
|
|
323
|
+
var zt;
|
|
324
|
+
const I = Et[ee] ?? Et.en, H = ue ?? I.more, K = oe ?? I.nav, y = F ?? an(I.hasNew), R = p.length > it ? p.slice(0, it) : p;
|
|
325
|
+
p.length > it && typeof console < "u" && console.warn(`LiquidTabBar: в actions ${p.length} кнопки, показаны первые ${it}.`);
|
|
326
|
+
const ie = !w && R.length > 0, [U, ge] = B(l ?? ((zt = s[0]) == null ? void 0 : zt.id)), te = d !== void 0 ? d : U, N = { ...rn, ...Z }, E = sn(), Q = $(null), o = Y ? Y === !0 ? {} : Y : null, we = (o == null ? void 0 : o.breakpoint) ?? 1100, he = (o == null ? void 0 : o.breakpointBy) ?? "window", [P, We] = B(() => !!o && he === "window" && typeof window < "u" && window.innerWidth >= we);
|
|
327
|
+
Me(() => {
|
|
328
|
+
var n;
|
|
329
|
+
if (!o) {
|
|
330
|
+
We(!1);
|
|
331
|
+
return;
|
|
332
|
+
}
|
|
333
|
+
const e = () => {
|
|
334
|
+
var A, O;
|
|
335
|
+
const x = he === "parent" ? ((O = (A = Q.current) == null ? void 0 : A.parentElement) == null ? void 0 : O.clientWidth) ?? window.innerWidth : window.innerWidth;
|
|
336
|
+
We(x >= we);
|
|
337
|
+
};
|
|
338
|
+
e();
|
|
339
|
+
const t = (n = Q.current) == null ? void 0 : n.parentElement, a = typeof ResizeObserver < "u" && he === "parent" && t ? new ResizeObserver(e) : null;
|
|
340
|
+
return a && t && a.observe(t), window.addEventListener("resize", e), () => {
|
|
341
|
+
a == null || a.disconnect(), window.removeEventListener("resize", e);
|
|
342
|
+
};
|
|
343
|
+
}, [!!o, we, he]);
|
|
344
|
+
const X = P ? (o == null ? void 0 : o.layout) ?? "inline" : h, Ze = P ? "top" : b, Ce = V ? V === !0 ? {} : V : null, k = P ? (o == null ? void 0 : o.search) ?? "bar" : Ce ? "full" : "none", i = P ? o : Ce, me = k === "button" || k === "expand" || k === "full", T = k === "full" ? R.slice(-1) : R, W = ie || me, ce = (ie ? T.length : 0) + (me ? 1 : 0), Ie = (o == null ? void 0 : o.searchWidth) ?? 320, $e = $(null), Ne = (o == null ? void 0 : o.logo) != null && o.logo !== !1 && o.logo !== "", c = $(!1), f = $(null), g = $(null), _ = $(null), G = $(null), Ee = se ?? (X === "inline" ? 104 : X === "icons" ? 52 : 64), [Re, ke] = B(1 / 0), [De, lt] = B(0), xe = ot(() => {
|
|
345
|
+
const e = Q.current;
|
|
346
|
+
if (!e) return;
|
|
347
|
+
const t = getComputedStyle(e), a = (q) => parseFloat(t.getPropertyValue(q)) || 0, n = a("--ltb-pad"), x = a("--ltb-gap"), A = a("--ltb-action"), O = P ? parseFloat(t.columnGap) || 0 : x;
|
|
348
|
+
let be = ce ? ce * (A + n) + n + O : 0;
|
|
349
|
+
me && k !== "full" && c.current && (be += Math.max(0, Ie - A));
|
|
350
|
+
let le = e.clientWidth - be - 2 * n, v;
|
|
351
|
+
if (P) {
|
|
352
|
+
le -= (parseFloat(t.paddingLeft) || 0) + (parseFloat(t.paddingRight) || 0), $e.current && Ne && (le -= $e.current.offsetWidth + O), le -= (k === "bar" ? 220 : 0) + (k === "bar" || (o == null ? void 0 : o.actionsAlign) !== "next" ? O : 0);
|
|
353
|
+
const q = f.current, re = q ? [...q.children].map((Le) => Le.offsetWidth) : [], Qe = re.pop() ?? 0, Je = re.reduce((Le, st) => Le + st, 0);
|
|
354
|
+
if (!re.length || Je <= le) v = 1 / 0;
|
|
355
|
+
else {
|
|
356
|
+
let Le = 0, st = 0;
|
|
357
|
+
for (; Le < re.length && st + re[Le] + Qe <= le; ) st += re[Le++];
|
|
358
|
+
v = Math.max(1, Le) + 1;
|
|
359
|
+
}
|
|
360
|
+
} else v = Math.max(1, Math.floor(le / Ee));
|
|
361
|
+
ke((q) => q === v ? q : v), lt((q) => q === be ? q : be);
|
|
362
|
+
}, [ce, me, Ie, Ee, P, k, Ne, o == null ? void 0 : o.actionsAlign]);
|
|
363
|
+
Me(() => {
|
|
364
|
+
xe();
|
|
365
|
+
}, [xe, X]), ae(() => {
|
|
366
|
+
const e = Q.current;
|
|
367
|
+
if (!e || typeof ResizeObserver > "u") return;
|
|
368
|
+
const t = new ResizeObserver(() => xe());
|
|
369
|
+
return t.observe(e), f.current && t.observe(f.current), () => t.disconnect();
|
|
370
|
+
}, [xe]);
|
|
371
|
+
const _e = ye === "more" && s.length > Re, Pe = _e ? s.slice(0, Math.max(1, Re - 1)) : s, Se = _e ? s.slice(Pe.length) : [], dt = Se.some((e) => e.id === te), ut = dt ? He : te, Be = (() => {
|
|
372
|
+
const e = Se.map((a) => a.badge).filter(ct);
|
|
373
|
+
if (!e.length) return;
|
|
374
|
+
const t = e.reduce((a, n) => a + (typeof n == "number" ? n : 0), 0);
|
|
375
|
+
return t > 0 ? t : "dot";
|
|
376
|
+
})(), [ze, Ke] = B(!1);
|
|
377
|
+
ae(() => {
|
|
378
|
+
Se.length || Ke(!1);
|
|
379
|
+
}, [Se.length]);
|
|
380
|
+
const ft = E ? 0 : N.shift, Wt = yt(mt(
|
|
381
|
+
() => [...Pe.map((e) => ({ id: e.id, it: e })), ..._e ? [{ id: He }] : []],
|
|
382
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
383
|
+
[Pe.map((e) => e.id + "" + e.label).join("|"), _e, Pe]
|
|
384
|
+
), ft), xt = yt(T, ft), vt = yt(mt(() => me ? [{ id: `search-${k}` }] : [], [me, k]), ft), wt = $(!0);
|
|
385
|
+
Me(() => {
|
|
386
|
+
if (wt.current) {
|
|
387
|
+
wt.current = !1;
|
|
388
|
+
return;
|
|
389
|
+
}
|
|
390
|
+
const e = Q.current;
|
|
391
|
+
!(e != null && e.animate) || E || e.animate(de([{ opacity: 0, transform: `translateY(${P ? -16 : 16}px)` }, { opacity: 1, transform: "none" }]), { duration: 520 });
|
|
392
|
+
}, [P]), ae(() => {
|
|
393
|
+
if (!ze) return;
|
|
394
|
+
const e = (a) => {
|
|
395
|
+
var n;
|
|
396
|
+
(n = Q.current) != null && n.contains(a.target) || Ke(!1);
|
|
397
|
+
}, t = (a) => {
|
|
398
|
+
var n;
|
|
399
|
+
a.key === "Escape" && (Ke(!1), (n = G.current) == null || n.focus());
|
|
400
|
+
};
|
|
401
|
+
return document.addEventListener("pointerdown", e), document.addEventListener("keydown", t), () => {
|
|
402
|
+
document.removeEventListener("pointerdown", e), document.removeEventListener("keydown", t);
|
|
403
|
+
};
|
|
404
|
+
}, [ze]);
|
|
405
|
+
const je = $(null), Fe = $(/* @__PURE__ */ new Map()), Oe = $(null);
|
|
406
|
+
ae(() => {
|
|
407
|
+
C && [...s, ...R].flatMap((e) => [e.icon, e.activeIcon]).forEach((e) => {
|
|
408
|
+
const t = Pt(e);
|
|
409
|
+
(t.kind === "ms" || t.kind === "mi") && Ot(t.kind, t.style);
|
|
410
|
+
});
|
|
411
|
+
}, [s, R, C]);
|
|
412
|
+
const Ue = ot((e, t = 1) => {
|
|
413
|
+
const a = _.current, n = N.squash * t;
|
|
414
|
+
!(a != null && a.animate) || E || n <= 0 || a.animate(
|
|
415
|
+
de(
|
|
416
|
+
[
|
|
417
|
+
{ transform: "scaleY(1)" },
|
|
418
|
+
{ transform: `scaleY(${1 - n})`, offset: 0.28 },
|
|
419
|
+
{ transform: `scaleY(${1 + n * 0.27})`, offset: 0.62 },
|
|
420
|
+
{ transform: `scaleY(${1 - n * 0.08})`, offset: 0.82 },
|
|
421
|
+
{ transform: "scaleY(1)" }
|
|
422
|
+
]
|
|
423
|
+
),
|
|
424
|
+
{ duration: e }
|
|
425
|
+
);
|
|
426
|
+
}, [N.squash, E]), Xe = ot((e) => {
|
|
427
|
+
const t = g.current, a = N.wave;
|
|
428
|
+
!(t != null && t.animate) || E || a <= 0 || (t.style.transformOrigin = e > 0 ? "0 50%" : e < 0 ? "100% 50%" : "50% 50%", t.animate(
|
|
429
|
+
de(
|
|
430
|
+
[
|
|
431
|
+
{ transform: "none" },
|
|
432
|
+
{ transform: `scale(${1 + a},${1 - a * 0.9})`, offset: 0.22 },
|
|
433
|
+
{ transform: `scale(${1 - a * 0.35},${1 + a * 0.45})`, offset: 0.48 },
|
|
434
|
+
{ transform: `scale(${1 + a * 0.2},${1 - a * 0.1})`, offset: 0.72 },
|
|
435
|
+
{ transform: "none" }
|
|
436
|
+
]
|
|
437
|
+
),
|
|
438
|
+
{ duration: 750 }
|
|
439
|
+
));
|
|
440
|
+
}, [N.wave, E]), Mt = $(!1), et = ot((e) => {
|
|
441
|
+
const t = g.current, a = _.current;
|
|
442
|
+
if (!t || !a) return;
|
|
443
|
+
const n = ut != null ? Fe.current.get(ut) : void 0;
|
|
444
|
+
if (!n) {
|
|
445
|
+
a.style.opacity = "0", Oe.current = null;
|
|
446
|
+
return;
|
|
447
|
+
}
|
|
448
|
+
const x = n.offsetLeft, A = t.clientWidth - x - n.offsetWidth, O = a.style.opacity === "0" || Oe.current == null, be = e && O && Mt.current;
|
|
449
|
+
Mt.current = !0;
|
|
450
|
+
const le = !e || O ? 0 : Math.sign(x - (Oe.current ?? x));
|
|
451
|
+
Oe.current = x;
|
|
452
|
+
const v = E ? 160 : N.lead, q = E ? 160 : N.lag, re = `cubic-bezier(.3,${E ? 1 : N.overshoot},.5,1)`;
|
|
453
|
+
a.style.transitionProperty = "left, right, opacity", a.style.transitionTimingFunction = `${re}, ${re}, ease`, a.style.transitionDuration = O || !e ? "0ms, 0ms, 300ms" : `${le > 0 ? q : v}ms, ${le < 0 ? q : v}ms, 300ms`, a.style.left = x + "px", a.style.right = A + "px", a.style.opacity = "1", le ? (Ue(700), Xe(le)) : be && (Ue(700, 0.7), Xe(-1));
|
|
454
|
+
}, [ut, N.lead, N.lag, N.overshoot, E, Ue, Xe]);
|
|
455
|
+
Me(() => {
|
|
456
|
+
et(!0);
|
|
457
|
+
}, [et]);
|
|
458
|
+
const Te = $(et);
|
|
459
|
+
Te.current = et, Me(() => {
|
|
460
|
+
Te.current(!1);
|
|
461
|
+
}, [s.length, Pe.length, X, ie]);
|
|
462
|
+
const $t = $(!0);
|
|
463
|
+
ae(() => {
|
|
464
|
+
if ($t.current) {
|
|
465
|
+
$t.current = !1;
|
|
466
|
+
return;
|
|
467
|
+
}
|
|
468
|
+
const e = g.current, t = (A) => {
|
|
469
|
+
(!A || A.target === e) && Te.current(!1);
|
|
470
|
+
};
|
|
471
|
+
e == null || e.addEventListener("transitionend", t);
|
|
472
|
+
const a = window.setTimeout(t, (E ? 0 : N.shift) + 80), n = je.current, x = [];
|
|
473
|
+
if (ie && (n != null && n.animate) && !E && N.jelly) {
|
|
474
|
+
const A = N.shift;
|
|
475
|
+
n.style.transformOrigin = "0 50%", x.push(n.animate(
|
|
476
|
+
de(
|
|
477
|
+
[
|
|
478
|
+
{ transform: "scale(.55,.7)", opacity: 0 },
|
|
479
|
+
{ transform: "scale(1.1,.9)", opacity: 1, offset: 0.45 },
|
|
480
|
+
{ transform: "scale(.96,1.05)", offset: 0.68 },
|
|
481
|
+
{ transform: "scale(1.02,.99)", offset: 0.85 },
|
|
482
|
+
{ transform: "none", opacity: 1 }
|
|
483
|
+
]
|
|
484
|
+
),
|
|
485
|
+
{ duration: A + 250 }
|
|
486
|
+
)), [...n.children].forEach((O, be) => x.push(O.animate(
|
|
487
|
+
de(
|
|
488
|
+
[
|
|
489
|
+
{ transform: "scale(.3)", opacity: 0 },
|
|
490
|
+
{ transform: "scale(1.18,.86)", opacity: 1, offset: 0.4 },
|
|
491
|
+
{ transform: "scale(.9,1.1)", offset: 0.62 },
|
|
492
|
+
{ transform: "scale(1.04,.97)", offset: 0.8 },
|
|
493
|
+
{ transform: "none", opacity: 1 }
|
|
494
|
+
]
|
|
495
|
+
),
|
|
496
|
+
{ duration: 700, delay: A * 0.35 + be * 90, fill: "backwards" }
|
|
497
|
+
)));
|
|
498
|
+
}
|
|
499
|
+
return () => {
|
|
500
|
+
e == null || e.removeEventListener("transitionend", t), window.clearTimeout(a), x.forEach((A) => A.cancel());
|
|
501
|
+
};
|
|
502
|
+
}, [ie]), ae(() => {
|
|
503
|
+
var x;
|
|
504
|
+
const e = g.current;
|
|
505
|
+
if (!e || typeof ResizeObserver > "u") return;
|
|
506
|
+
let t = !0, a = !0;
|
|
507
|
+
const n = new ResizeObserver(() => {
|
|
508
|
+
if (t) {
|
|
509
|
+
t = !1;
|
|
510
|
+
return;
|
|
511
|
+
}
|
|
512
|
+
Te.current(!1);
|
|
513
|
+
});
|
|
514
|
+
return n.observe(e), Fe.current.forEach((A) => n.observe(A)), (x = document.fonts) == null || x.ready.then(() => {
|
|
515
|
+
a && Te.current(!1);
|
|
516
|
+
}), () => {
|
|
517
|
+
a = !1, n.disconnect();
|
|
518
|
+
};
|
|
519
|
+
}, [s.length, Pe.length, _e, X, ie]);
|
|
520
|
+
const Nt = (e) => {
|
|
521
|
+
e.disabled || (e.id === te && (Ue(560, 0.6), Xe(0)), Ke(!1), d === void 0 && ge(e.id), u == null || u(e.id));
|
|
522
|
+
}, [Zt, _t] = B(null), jt = () => {
|
|
523
|
+
if (!ze) {
|
|
524
|
+
Ue(520, 0.5);
|
|
525
|
+
const e = Q.current, t = g.current, a = G.current;
|
|
526
|
+
_t(P && e && t && a ? e.clientWidth - (t.offsetLeft + a.offsetLeft + a.offsetWidth) : null);
|
|
527
|
+
}
|
|
528
|
+
Ke((e) => !e);
|
|
529
|
+
}, [Ft, Vt] = B(""), ne = (i == null ? void 0 : i.searchValue) !== void 0 ? i.searchValue : Ft, Ge = (e) => {
|
|
530
|
+
var t;
|
|
531
|
+
(i == null ? void 0 : i.searchValue) === void 0 && Vt(e), (t = i == null ? void 0 : i.onSearchChange) == null || t.call(i, e);
|
|
532
|
+
}, [j, qe] = B(!1);
|
|
533
|
+
c.current = j, Me(() => {
|
|
534
|
+
xe();
|
|
535
|
+
}, [j, xe]);
|
|
536
|
+
const Ye = $(null), tt = $(null), pt = () => {
|
|
537
|
+
var t;
|
|
538
|
+
if (k !== "expand" && k !== "full" || j) return (t = Ye.current) == null ? void 0 : t.focus();
|
|
539
|
+
qe(!0);
|
|
540
|
+
const e = me ? je.current : tt.current;
|
|
541
|
+
e != null && e.animate && !E && N.jelly && (e.style.transformOrigin = "100% 50%", e.animate(de([{ transform: "none" }, { transform: "scale(1.05,.9)", offset: 0.3 }, { transform: "scale(.98,1.04)", offset: 0.6 }, { transform: "none" }]), { duration: N.shift + 200 })), window.setTimeout(() => {
|
|
542
|
+
var a;
|
|
543
|
+
return (a = Ye.current) == null ? void 0 : a.focus();
|
|
544
|
+
}, 60);
|
|
545
|
+
}, ht = () => {
|
|
546
|
+
(k === "expand" || k === "full") && qe(!1);
|
|
547
|
+
}, kt = () => {
|
|
548
|
+
Ge(""), qe(!1);
|
|
549
|
+
const e = je.current;
|
|
550
|
+
e != null && e.animate && !E && N.jelly && (e.style.transformOrigin = "100% 50%", e.animate(de([{ transform: "none" }, { transform: "scale(.94,1.06)", offset: 0.3 }, { transform: "scale(1.03,.97)", offset: 0.6 }, { transform: "none" }]), { duration: N.shift + 200 }));
|
|
551
|
+
}, [Ht, Kt] = B(0), [Ut, Xt] = B(0);
|
|
552
|
+
Me(() => {
|
|
553
|
+
if (k !== "full") return;
|
|
554
|
+
const e = Q.current;
|
|
555
|
+
if (!e) return;
|
|
556
|
+
const t = () => {
|
|
557
|
+
const n = getComputedStyle(e);
|
|
558
|
+
Kt(e.clientWidth - (parseFloat(n.paddingLeft) || 0) - (parseFloat(n.paddingRight) || 0)), Xt(e.clientHeight);
|
|
559
|
+
};
|
|
560
|
+
t();
|
|
561
|
+
const a = typeof ResizeObserver < "u" ? new ResizeObserver(t) : null;
|
|
562
|
+
return a == null || a.observe(e), () => a == null ? void 0 : a.disconnect();
|
|
563
|
+
}, [k]), ae(() => {
|
|
564
|
+
qe(!1);
|
|
565
|
+
}, [P, k]), ae(() => {
|
|
566
|
+
if (!j) return;
|
|
567
|
+
const e = (t) => {
|
|
568
|
+
var a, n;
|
|
569
|
+
!ne && !((a = tt.current) != null && a.contains(t.target)) && !((n = Q.current) != null && n.contains(t.target)) && qe(!1);
|
|
570
|
+
};
|
|
571
|
+
return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
|
|
572
|
+
}, [j, ne]);
|
|
573
|
+
const nt = (o == null ? void 0 : o.searchShortcut) === void 0 ? "/" : o.searchShortcut;
|
|
574
|
+
ae(() => {
|
|
575
|
+
if (!P || k === "none" || !nt) return;
|
|
576
|
+
const e = (t) => {
|
|
577
|
+
var n;
|
|
578
|
+
const a = t.target;
|
|
579
|
+
t.key !== nt || t.ctrlKey || t.metaKey || t.altKey || /^(INPUT|TEXTAREA|SELECT)$/.test(a.tagName) || a.isContentEditable || (t.preventDefault(), k === "button" ? (n = o == null ? void 0 : o.onSearchClick) == null || n.call(o) : pt());
|
|
580
|
+
};
|
|
581
|
+
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
582
|
+
});
|
|
583
|
+
const rt = (e, t, a = !0) => {
|
|
584
|
+
if (!N.jelly || E || !e.animate) return;
|
|
585
|
+
e.animate(
|
|
586
|
+
de(
|
|
587
|
+
[
|
|
588
|
+
{ transform: "scale(.9)" },
|
|
589
|
+
{ transform: "scale(1.18,.8)", offset: 0.2 },
|
|
590
|
+
{ transform: "scale(.88,1.12)", offset: 0.42 },
|
|
591
|
+
{ transform: "scale(1.06,.95)", offset: 0.62 },
|
|
592
|
+
{ transform: "scale(.98,1.02)", offset: 0.8 },
|
|
593
|
+
{ transform: "scale(1)" }
|
|
594
|
+
]
|
|
595
|
+
),
|
|
596
|
+
{ duration: 750 }
|
|
597
|
+
);
|
|
598
|
+
const n = je.current;
|
|
599
|
+
a && (n != null && n.animate) && (n.style.transformOrigin = t < R.length / 2 ? "100% 50%" : "0 50%", n.animate(
|
|
600
|
+
de(
|
|
601
|
+
[
|
|
602
|
+
{ transform: "none" },
|
|
603
|
+
{ transform: "scale(1.09,.92)", offset: 0.22 },
|
|
604
|
+
{ transform: "scale(.97,1.04)", offset: 0.48 },
|
|
605
|
+
{ transform: "scale(1.02,.99)", offset: 0.72 },
|
|
606
|
+
{ transform: "none" }
|
|
607
|
+
]
|
|
608
|
+
),
|
|
609
|
+
{ duration: 750 }
|
|
610
|
+
));
|
|
611
|
+
}, Gt = mt(() => {
|
|
612
|
+
const e = {};
|
|
613
|
+
if (M && Object.keys(M).forEach((t) => {
|
|
614
|
+
const a = M[t];
|
|
615
|
+
a === void 0 || !It[t] || (e[It[t]] = typeof a == "number" ? `${a}px` : a);
|
|
616
|
+
}), J !== void 0) {
|
|
617
|
+
const t = typeof J == "string" ? nn[J] : void 0, a = Math.max(0, Math.min(100, t ? t.transparency : +J || 0)) / 100, n = 1 - a, x = a >= 1 ? 0 : Math.min(1, n + 0.06);
|
|
618
|
+
e["--ltb-surface-top"] = Ct((M == null ? void 0 : M.surfaceTop) ?? At.surfaceTop, n), e["--ltb-surface-bottom"] = Ct((M == null ? void 0 : M.surfaceBottom) ?? At.surfaceBottom, x), t && (e["--ltb-blur"] = `${t.blur}px`);
|
|
619
|
+
}
|
|
620
|
+
return e;
|
|
621
|
+
}, [M, J]), at = (e, t) => ct(t) ? y(e, t) : e, Ve = (e) => X === "inline" && ct(e) && e !== "dot" && e !== !0, qt = (e, t) => {
|
|
622
|
+
var a;
|
|
623
|
+
return /* @__PURE__ */ z(
|
|
624
|
+
"button",
|
|
625
|
+
{
|
|
626
|
+
type: "button",
|
|
627
|
+
ref: (n) => {
|
|
628
|
+
e || (G.current = n, n ? Fe.current.set(He, n) : Fe.current.delete(He));
|
|
629
|
+
},
|
|
630
|
+
className: `ltb-item ltb-more${dt && !e ? " is-active" : ""}${ze ? " is-open" : ""}${e ? " is-leaving" : ""}`,
|
|
631
|
+
"data-enter": t ? "1" : void 0,
|
|
632
|
+
"aria-hidden": e || void 0,
|
|
633
|
+
tabIndex: e ? -1 : void 0,
|
|
634
|
+
"aria-haspopup": "menu",
|
|
635
|
+
"aria-expanded": ze,
|
|
636
|
+
"aria-label": at(dt ? `${H}: ${(a = Se.find((n) => n.id === te)) == null ? void 0 : a.label}` : H, Be),
|
|
637
|
+
title: X === "icons" ? H : void 0,
|
|
638
|
+
onClick: () => {
|
|
639
|
+
e || jt();
|
|
640
|
+
},
|
|
641
|
+
children: [
|
|
642
|
+
/* @__PURE__ */ z("span", { className: "ltb-ico", children: [
|
|
643
|
+
/* @__PURE__ */ r(ve, { icon: fe ?? "more" }),
|
|
644
|
+
!Ve(Be) && /* @__PURE__ */ r(Ae, { value: Be, max: S })
|
|
645
|
+
] }),
|
|
646
|
+
X !== "icons" && /* @__PURE__ */ r("span", { className: "ltb-label", children: H }),
|
|
647
|
+
Ve(Be) && /* @__PURE__ */ r(Ae, { value: Be, max: S, inline: !0 })
|
|
648
|
+
]
|
|
649
|
+
},
|
|
650
|
+
He
|
|
651
|
+
);
|
|
652
|
+
};
|
|
653
|
+
return Me(() => {
|
|
654
|
+
const e = Q.current;
|
|
655
|
+
if (!e) return;
|
|
656
|
+
const t = e.querySelectorAll('[data-enter="1"]'), a = e.querySelectorAll(".is-leaving:not([data-left])"), n = getComputedStyle(e), x = e.classList.contains("ltb--desktop");
|
|
657
|
+
let A = 0, O = !1;
|
|
658
|
+
a.forEach((v) => {
|
|
659
|
+
if (v.dataset.left = "1", v.closest(".ltb-main") ? A = A || -1 : v.closest(".ltb-side") && (O = !0), E || !v.animate || !x || !v.classList.contains("ltb-item")) return;
|
|
660
|
+
const q = v.offsetWidth;
|
|
661
|
+
v.animate(de([
|
|
662
|
+
{ width: `${q}px`, minWidth: "0px", paddingLeft: getComputedStyle(v).paddingLeft, paddingRight: getComputedStyle(v).paddingRight, opacity: 1, transform: "none" },
|
|
663
|
+
{ width: "0px", minWidth: "0px", paddingLeft: "0px", paddingRight: "0px", opacity: 0, transform: "scale(.6)" }
|
|
664
|
+
]), { duration: N.shift, fill: "forwards" });
|
|
665
|
+
});
|
|
666
|
+
const be = `${parseFloat((n == null ? void 0 : n.getPropertyValue("--ltb-action")) || "") || 50}px`, le = `${-(parseFloat((n == null ? void 0 : n.getPropertyValue("--ltb-pad")) || "") || 6)}px`;
|
|
667
|
+
if (t.forEach((v) => {
|
|
668
|
+
if (v.dataset.enter = "0", v.closest(".ltb-main") ? A = 1 : v.closest(".ltb-side") && (O = !0), E || !v.animate) return;
|
|
669
|
+
const q = v.classList.contains("ltb-action") || v.classList.contains("ltb-expand"), re = N.shift + 150;
|
|
670
|
+
if (x && !q) {
|
|
671
|
+
const Qe = v.offsetWidth, Je = getComputedStyle(v).paddingLeft, Le = getComputedStyle(v).paddingRight;
|
|
672
|
+
v.animate(de([
|
|
673
|
+
{ width: "0px", paddingLeft: "0px", paddingRight: "0px", opacity: 0, transform: "scale(.55)" },
|
|
674
|
+
{ width: `${Qe}px`, paddingLeft: Je, paddingRight: Le, opacity: 1, transform: "scale(1.06,.95)", offset: 0.6 },
|
|
675
|
+
{ width: `${Qe}px`, paddingLeft: Je, paddingRight: Le, transform: "scale(.98,1.02)", offset: 0.8 },
|
|
676
|
+
{ width: `${Qe}px`, paddingLeft: Je, paddingRight: Le, opacity: 1, transform: "none" }
|
|
677
|
+
]), { duration: re }), window.setTimeout(() => Te.current(!1), re + 30);
|
|
678
|
+
return;
|
|
679
|
+
}
|
|
680
|
+
v.animate(
|
|
681
|
+
de(q ? [
|
|
682
|
+
{ width: "0px", marginLeft: le, opacity: 0, transform: "scale(.3)" },
|
|
683
|
+
{ width: be, marginLeft: "0px", opacity: 1, transform: "scale(1.12,.9)", offset: 0.6 },
|
|
684
|
+
{ width: be, marginLeft: "0px", transform: "scale(.96,1.04)", offset: 0.8 },
|
|
685
|
+
{ width: be, marginLeft: "0px", opacity: 1, transform: "none" }
|
|
686
|
+
] : [
|
|
687
|
+
{ flexGrow: 0, opacity: 0, transform: "scale(.55)" },
|
|
688
|
+
{ flexGrow: 1, opacity: 1, transform: "scale(1.08,.94)", offset: 0.6 },
|
|
689
|
+
{ flexGrow: 1, transform: "scale(.97,1.03)", offset: 0.8 },
|
|
690
|
+
{ flexGrow: 1, opacity: 1, transform: "none" }
|
|
691
|
+
]),
|
|
692
|
+
{ duration: re }
|
|
693
|
+
), window.setTimeout(() => Te.current(!1), re + 30);
|
|
694
|
+
}), A && Xe(A > 0 ? 1 : 0), O) {
|
|
695
|
+
const v = je.current;
|
|
696
|
+
v != null && v.animate && !E && N.jelly && (v.style.transformOrigin = "0 50%", v.animate(de([
|
|
697
|
+
{ transform: "none" },
|
|
698
|
+
{ transform: "scale(1.07,.93)", offset: 0.25 },
|
|
699
|
+
{ transform: "scale(.97,1.04)", offset: 0.5 },
|
|
700
|
+
{ transform: "scale(1.015,.99)", offset: 0.75 },
|
|
701
|
+
{ transform: "none" }
|
|
702
|
+
]), { duration: 750 }));
|
|
703
|
+
}
|
|
704
|
+
a.length && window.setTimeout(() => Te.current(!1), N.shift + 60);
|
|
705
|
+
}), /* @__PURE__ */ z(
|
|
706
|
+
"nav",
|
|
707
|
+
{
|
|
708
|
+
ref: Q,
|
|
709
|
+
className: `ltb ltb--${Ze} ltb--${X}${W ? "" : " ltb--solo"}${P ? " ltb--desktop" : ""}${P && (o == null ? void 0 : o.actionsAlign) === "next" ? " ltb--actions-next" : ""}${k === "full" && j ? " ltb--searching" : ""}${pe ? " " + pe : ""}`,
|
|
710
|
+
style: {
|
|
711
|
+
"--ltb-n": Pe.length + (_e ? 1 : 0),
|
|
712
|
+
"--ltb-menu-right": `${Zt ?? De}px`,
|
|
713
|
+
...P ? { "--ltb-header-max": `${(o == null ? void 0 : o.maxWidth) ?? 1360}px`, "--ltb-header-h": `${(o == null ? void 0 : o.height) ?? 80}px`, "--ltb-search-w": `${(o == null ? void 0 : o.searchWidth) ?? 420}px`, "--ltb-search-in": `${Ie}px` } : {},
|
|
714
|
+
"--ltb-side-extra": me && j ? "calc(var(--ltb-search-in) - var(--ltb-action))" : "0px",
|
|
715
|
+
"--ltb-na": ce || R.length,
|
|
716
|
+
"--ltb-full-w": `${Ht}px`,
|
|
717
|
+
"--ltb-row-h": `${Ut}px`,
|
|
718
|
+
"--ltb-shift": `${E ? 0 : N.shift}ms`,
|
|
719
|
+
...Gt,
|
|
720
|
+
...D
|
|
721
|
+
},
|
|
722
|
+
"aria-label": K,
|
|
723
|
+
children: [
|
|
724
|
+
P && /* @__PURE__ */ r("div", { className: `ltb-logo${Ne ? "" : " is-empty"}`, ref: $e, "aria-hidden": !Ne || void 0, children: Ne && /* @__PURE__ */ r("span", { className: "ltb-logo-in", children: typeof (o == null ? void 0 : o.logo) == "string" ? /* @__PURE__ */ r("span", { className: "ltb-wordmark", children: o.logo }) : o == null ? void 0 : o.logo }, typeof (o == null ? void 0 : o.logo) == "string" ? o.logo : "node") }),
|
|
725
|
+
P && /* @__PURE__ */ z("div", { className: "ltb-main ltb-measure", ref: f, "aria-hidden": "true", children: [
|
|
726
|
+
s.map((e) => /* @__PURE__ */ z("span", { className: "ltb-item", children: [
|
|
727
|
+
/* @__PURE__ */ r("span", { className: "ltb-ico" }),
|
|
728
|
+
X !== "icons" && /* @__PURE__ */ r("span", { className: "ltb-label", children: e.label }),
|
|
729
|
+
Ve(e.badge) && /* @__PURE__ */ r(Ae, { value: e.badge, max: S, inline: !0 })
|
|
730
|
+
] }, e.id)),
|
|
731
|
+
/* @__PURE__ */ z("span", { className: "ltb-item", children: [
|
|
732
|
+
/* @__PURE__ */ r("span", { className: "ltb-ico" }),
|
|
733
|
+
X !== "icons" && /* @__PURE__ */ r("span", { className: "ltb-label", children: H }),
|
|
734
|
+
Ve(Be) && /* @__PURE__ */ r(Ae, { value: Be, max: S, inline: !0 })
|
|
735
|
+
] })
|
|
736
|
+
] }),
|
|
737
|
+
/* @__PURE__ */ z("div", { className: "ltb-main", ref: g, children: [
|
|
738
|
+
/* @__PURE__ */ r("span", { className: "ltb-hl", ref: _, "aria-hidden": "true", style: { opacity: 0 } }),
|
|
739
|
+
Wt.map(({ item: e, leaving: t, entering: a }) => {
|
|
740
|
+
if (e.id === He) return qt(t, a);
|
|
741
|
+
const n = e.it, x = n.id === te && !t;
|
|
742
|
+
return /* @__PURE__ */ z(
|
|
743
|
+
"button",
|
|
744
|
+
{
|
|
745
|
+
type: "button",
|
|
746
|
+
ref: (A) => {
|
|
747
|
+
t || (A ? Fe.current.set(n.id, A) : Fe.current.delete(n.id));
|
|
748
|
+
},
|
|
749
|
+
className: `ltb-item${x ? " is-active" : ""}${t ? " is-leaving" : ""}`,
|
|
750
|
+
"data-enter": a ? "1" : void 0,
|
|
751
|
+
"aria-hidden": t || void 0,
|
|
752
|
+
tabIndex: t ? -1 : void 0,
|
|
753
|
+
"aria-current": x ? "page" : void 0,
|
|
754
|
+
"aria-label": at(n.ariaLabel || n.label, n.badge),
|
|
755
|
+
title: X === "icons" ? n.label : void 0,
|
|
756
|
+
disabled: n.disabled,
|
|
757
|
+
onClick: () => {
|
|
758
|
+
t || Nt(n);
|
|
759
|
+
},
|
|
760
|
+
children: [
|
|
761
|
+
/* @__PURE__ */ z("span", { className: "ltb-ico", children: [
|
|
762
|
+
/* @__PURE__ */ r(ve, { icon: n.icon, activeIcon: n.activeIcon }),
|
|
763
|
+
!Ve(n.badge) && /* @__PURE__ */ r(Ae, { value: n.badge, max: S })
|
|
764
|
+
] }),
|
|
765
|
+
X !== "icons" && /* @__PURE__ */ r("span", { className: "ltb-label", children: n.label }),
|
|
766
|
+
Ve(n.badge) && /* @__PURE__ */ r(Ae, { value: n.badge, max: S, inline: !0 })
|
|
767
|
+
]
|
|
768
|
+
},
|
|
769
|
+
n.id
|
|
770
|
+
);
|
|
771
|
+
})
|
|
772
|
+
] }),
|
|
773
|
+
Se.length > 0 && // список спрятанных пунктов; стоит над кнопкой «Меню» (под ней — если меню вверху экрана)
|
|
774
|
+
/* @__PURE__ */ r("div", { className: `ltb-menu${ze ? " is-open" : ""}`, role: "menu", "aria-label": H, "aria-hidden": !ze || void 0, ...ze ? {} : { inert: "" }, children: Se.map((e, t) => {
|
|
775
|
+
const a = e.id === te;
|
|
776
|
+
return /* @__PURE__ */ z(
|
|
777
|
+
"button",
|
|
778
|
+
{
|
|
779
|
+
type: "button",
|
|
780
|
+
role: "menuitem",
|
|
781
|
+
style: { "--i": t },
|
|
782
|
+
className: `ltb-row${a ? " is-active" : ""}`,
|
|
783
|
+
"aria-current": a ? "page" : void 0,
|
|
784
|
+
"aria-label": at(e.ariaLabel || e.label, e.badge),
|
|
785
|
+
disabled: e.disabled,
|
|
786
|
+
onClick: () => Nt(e),
|
|
787
|
+
children: [
|
|
788
|
+
/* @__PURE__ */ r("span", { className: "ltb-ico", children: /* @__PURE__ */ r(ve, { icon: e.icon, activeIcon: e.activeIcon }) }),
|
|
789
|
+
/* @__PURE__ */ r("span", { className: "ltb-row-label", children: e.label }),
|
|
790
|
+
/* @__PURE__ */ r(Ae, { value: e.badge, max: S, inline: !0 })
|
|
791
|
+
]
|
|
792
|
+
},
|
|
793
|
+
e.id
|
|
794
|
+
);
|
|
795
|
+
}) }),
|
|
796
|
+
P && /* @__PURE__ */ r("div", { className: `ltb-search-slot${k !== "bar" && (o == null ? void 0 : o.actionsAlign) === "next" ? " is-collapsed" : ""}`, children: /* @__PURE__ */ z("label", { className: `ltb-search${k === "bar" ? "" : " is-hidden"}`, "aria-hidden": k !== "bar" || void 0, ...k !== "bar" ? { inert: "" } : {}, children: [
|
|
797
|
+
/* @__PURE__ */ r("span", { className: "ltb-ico", children: /* @__PURE__ */ r(ve, { icon: "search" }) }),
|
|
798
|
+
/* @__PURE__ */ r(
|
|
799
|
+
"input",
|
|
800
|
+
{
|
|
801
|
+
ref: k === "bar" ? Ye : void 0,
|
|
802
|
+
type: "search",
|
|
803
|
+
value: ne,
|
|
804
|
+
placeholder: (i == null ? void 0 : i.searchPlaceholder) ?? I.search,
|
|
805
|
+
"aria-label": (i == null ? void 0 : i.searchPlaceholder) ?? I.search,
|
|
806
|
+
onChange: (e) => Ge(e.target.value),
|
|
807
|
+
onKeyDown: (e) => {
|
|
808
|
+
var t;
|
|
809
|
+
e.key === "Enter" && ((t = i == null ? void 0 : i.onSearch) == null || t.call(i, ne)), e.key === "Escape" && e.target.blur();
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
),
|
|
813
|
+
nt && /* @__PURE__ */ r("kbd", { "aria-hidden": "true", children: nt })
|
|
814
|
+
] }) }),
|
|
815
|
+
(xt.length > 0 || vt.length > 0) && // группа не исчезает из разметки, а сворачивается — так появление и скрытие анимируются
|
|
816
|
+
/* @__PURE__ */ z("div", { className: `ltb-side${W ? "" : " is-hidden"}${(i == null ? void 0 : i.searchAt) === "end" ? " ltb-side--search-end" : ""}`, ref: je, "aria-hidden": !W || void 0, ...W ? {} : { inert: "" }, children: [
|
|
817
|
+
vt.map(({ item: e, leaving: t, entering: a }) => e.id === "search-full" ? (
|
|
818
|
+
// узкий экран, как в iOS: лупа → «✕» слева, поле посередине, «→» справа; группа растекается на всю ширину
|
|
819
|
+
/* @__PURE__ */ z(
|
|
820
|
+
"div",
|
|
821
|
+
{
|
|
822
|
+
ref: t ? void 0 : tt,
|
|
823
|
+
className: `ltb-expand ltb-expand--full${j && !t ? " is-open" : ""}${t ? " is-leaving" : ""}`,
|
|
824
|
+
"data-enter": a ? "1" : void 0,
|
|
825
|
+
"aria-hidden": t || void 0,
|
|
826
|
+
role: "search",
|
|
827
|
+
children: [
|
|
828
|
+
/* @__PURE__ */ r(
|
|
829
|
+
"button",
|
|
830
|
+
{
|
|
831
|
+
type: "button",
|
|
832
|
+
className: `ltb-action ltb-swap${j ? " is-open" : ""}`,
|
|
833
|
+
"aria-label": j ? I.closeSearch : (i == null ? void 0 : i.searchPlaceholder) ?? I.search,
|
|
834
|
+
"aria-expanded": j,
|
|
835
|
+
tabIndex: t ? -1 : void 0,
|
|
836
|
+
onClick: (n) => {
|
|
837
|
+
t || (j ? kt() : (rt(n.currentTarget, 0, !1), pt()));
|
|
838
|
+
},
|
|
839
|
+
children: /* @__PURE__ */ z("span", { className: "ltb-ico", children: [
|
|
840
|
+
/* @__PURE__ */ r("span", { className: "ltb-swap-a", children: /* @__PURE__ */ r(ve, { icon: "search" }) }),
|
|
841
|
+
/* @__PURE__ */ r("span", { className: "ltb-swap-b", children: /* @__PURE__ */ r(ve, { icon: "close" }) })
|
|
842
|
+
] })
|
|
843
|
+
}
|
|
844
|
+
),
|
|
845
|
+
/* @__PURE__ */ r(
|
|
846
|
+
"input",
|
|
847
|
+
{
|
|
848
|
+
ref: t ? void 0 : Ye,
|
|
849
|
+
type: "search",
|
|
850
|
+
enterKeyHint: "search",
|
|
851
|
+
value: ne,
|
|
852
|
+
placeholder: (i == null ? void 0 : i.searchPlaceholder) ?? I.search,
|
|
853
|
+
"aria-label": (i == null ? void 0 : i.searchPlaceholder) ?? I.search,
|
|
854
|
+
tabIndex: j && !t ? 0 : -1,
|
|
855
|
+
onChange: (n) => Ge(n.target.value),
|
|
856
|
+
onKeyDown: (n) => {
|
|
857
|
+
var x;
|
|
858
|
+
n.key === "Enter" && ((x = i == null ? void 0 : i.onSearch) == null || x.call(i, ne)), n.key === "Escape" && kt();
|
|
859
|
+
}
|
|
860
|
+
}
|
|
861
|
+
)
|
|
862
|
+
]
|
|
863
|
+
},
|
|
864
|
+
e.id
|
|
865
|
+
)
|
|
866
|
+
) : e.id === "search-button" ? /* @__PURE__ */ r(
|
|
867
|
+
"button",
|
|
868
|
+
{
|
|
869
|
+
type: "button",
|
|
870
|
+
className: `ltb-action ltb-search-btn${t ? " is-leaving" : ""}`,
|
|
871
|
+
"data-enter": a ? "1" : void 0,
|
|
872
|
+
"aria-hidden": t || void 0,
|
|
873
|
+
tabIndex: t ? -1 : void 0,
|
|
874
|
+
"aria-label": (i == null ? void 0 : i.searchPlaceholder) ?? I.search,
|
|
875
|
+
onClick: (n) => {
|
|
876
|
+
var x;
|
|
877
|
+
t || (rt(n.currentTarget, 0), (x = o == null ? void 0 : o.onSearchClick) == null || x.call(o));
|
|
878
|
+
},
|
|
879
|
+
children: /* @__PURE__ */ r("span", { className: "ltb-ico", children: /* @__PURE__ */ r(ve, { icon: "search" }) })
|
|
880
|
+
},
|
|
881
|
+
e.id
|
|
882
|
+
) : (
|
|
883
|
+
// поиск внутри группы: круг раскрывается в строку, вместе с ним растёт вся группа
|
|
884
|
+
/* @__PURE__ */ z(
|
|
885
|
+
"div",
|
|
886
|
+
{
|
|
887
|
+
ref: t ? void 0 : tt,
|
|
888
|
+
className: `ltb-expand${j && !t ? " is-open" : ""}${t ? " is-leaving" : ""}`,
|
|
889
|
+
"data-enter": a ? "1" : void 0,
|
|
890
|
+
"aria-hidden": t || void 0,
|
|
891
|
+
onBlur: (n) => {
|
|
892
|
+
!ne && !n.currentTarget.contains(n.relatedTarget) && ht();
|
|
893
|
+
},
|
|
894
|
+
children: [
|
|
895
|
+
/* @__PURE__ */ r(
|
|
896
|
+
"button",
|
|
897
|
+
{
|
|
898
|
+
type: "button",
|
|
899
|
+
className: `ltb-action${j ? " is-open" : ""}`,
|
|
900
|
+
"aria-label": (i == null ? void 0 : i.searchPlaceholder) ?? I.search,
|
|
901
|
+
"aria-expanded": j,
|
|
902
|
+
tabIndex: t ? -1 : void 0,
|
|
903
|
+
onClick: () => {
|
|
904
|
+
var n;
|
|
905
|
+
t || (j ? ne ? (n = i == null ? void 0 : i.onSearch) == null || n.call(i, ne) : ht() : pt());
|
|
906
|
+
},
|
|
907
|
+
children: /* @__PURE__ */ r("span", { className: "ltb-ico", children: /* @__PURE__ */ r(ve, { icon: "search" }) })
|
|
908
|
+
}
|
|
909
|
+
),
|
|
910
|
+
/* @__PURE__ */ r(
|
|
911
|
+
"input",
|
|
912
|
+
{
|
|
913
|
+
ref: t ? void 0 : Ye,
|
|
914
|
+
type: "search",
|
|
915
|
+
value: ne,
|
|
916
|
+
placeholder: (i == null ? void 0 : i.searchPlaceholder) ?? I.search,
|
|
917
|
+
"aria-label": (i == null ? void 0 : i.searchPlaceholder) ?? I.search,
|
|
918
|
+
tabIndex: j && !t ? 0 : -1,
|
|
919
|
+
onChange: (n) => Ge(n.target.value),
|
|
920
|
+
onKeyDown: (n) => {
|
|
921
|
+
var x;
|
|
922
|
+
n.key === "Enter" && ((x = i == null ? void 0 : i.onSearch) == null || x.call(i, ne)), n.key === "Escape" && (Ge(""), ht());
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
)
|
|
926
|
+
]
|
|
927
|
+
},
|
|
928
|
+
e.id
|
|
929
|
+
)
|
|
930
|
+
)),
|
|
931
|
+
xt.map(({ item: e, leaving: t, entering: a }, n) => {
|
|
932
|
+
const x = e.id === L && !t;
|
|
933
|
+
return /* @__PURE__ */ z(
|
|
934
|
+
"button",
|
|
935
|
+
{
|
|
936
|
+
type: "button",
|
|
937
|
+
className: `ltb-action${e.avatar ? " ltb-action--avatar" : e.variant === "accent" ? " ltb-action--accent" : ""}${x ? " is-active" : ""}${t ? " is-leaving" : ""}`,
|
|
938
|
+
"data-enter": a ? "1" : void 0,
|
|
939
|
+
"aria-hidden": t || void 0,
|
|
940
|
+
tabIndex: t ? -1 : void 0,
|
|
941
|
+
"aria-label": at(e.ariaLabel, e.badge),
|
|
942
|
+
"aria-pressed": x,
|
|
943
|
+
onClick: (A) => {
|
|
944
|
+
t || (rt(A.currentTarget, n), m == null || m(e.id));
|
|
945
|
+
},
|
|
946
|
+
children: [
|
|
947
|
+
e.avatar ? e.avatar.src ? /* @__PURE__ */ r("img", { src: e.avatar.src, alt: "" }) : /* @__PURE__ */ r("span", { className: "ltb-avatar-text", children: e.avatar.text }) : /* @__PURE__ */ r("span", { className: "ltb-ico", children: e.icon !== void 0 && /* @__PURE__ */ r(ve, { icon: e.icon, activeIcon: e.activeIcon }) }),
|
|
948
|
+
/* @__PURE__ */ r(Ae, { value: e.badge, max: S })
|
|
949
|
+
]
|
|
950
|
+
},
|
|
951
|
+
e.id
|
|
952
|
+
);
|
|
953
|
+
})
|
|
954
|
+
] }),
|
|
955
|
+
k === "full" && // «→» — отдельная круглая кнопка в своём стекле справа; при раскрытии поиска «отпочковывается» от группы
|
|
956
|
+
/* @__PURE__ */ r("div", { className: `ltb-pill ltb-go-pill${j ? " is-open" : ""}`, "aria-hidden": !j || void 0, ...j ? {} : { inert: "" }, children: /* @__PURE__ */ r(
|
|
957
|
+
"button",
|
|
958
|
+
{
|
|
959
|
+
type: "button",
|
|
960
|
+
className: `ltb-action ltb-go${ne ? " is-ready" : ""}`,
|
|
961
|
+
"aria-label": I.go,
|
|
962
|
+
disabled: !ne,
|
|
963
|
+
onClick: (e) => {
|
|
964
|
+
var t;
|
|
965
|
+
rt(e.currentTarget, 1, !1), (t = i == null ? void 0 : i.onSearch) == null || t.call(i, ne);
|
|
966
|
+
},
|
|
967
|
+
children: /* @__PURE__ */ r("span", { className: "ltb-ico", children: /* @__PURE__ */ r(ve, { icon: "arrowR" }) })
|
|
968
|
+
}
|
|
969
|
+
) })
|
|
970
|
+
]
|
|
971
|
+
}
|
|
972
|
+
);
|
|
973
|
+
}
|
|
974
|
+
const gn = cn;
|
|
975
|
+
function ln({
|
|
976
|
+
text: s = "PARZ",
|
|
977
|
+
intro: d = !0,
|
|
978
|
+
introDelay: l = 150,
|
|
979
|
+
idle: u = !0,
|
|
980
|
+
hoverWave: p = !0,
|
|
981
|
+
holdEffect: L = !0,
|
|
982
|
+
holdDuration: m = 1e3,
|
|
983
|
+
onHoldComplete: w,
|
|
984
|
+
onClick: b,
|
|
985
|
+
size: h = 13,
|
|
986
|
+
dimColor: M,
|
|
987
|
+
brightColor: Z,
|
|
988
|
+
hoverColor: S,
|
|
989
|
+
accent: F,
|
|
990
|
+
spacing: ee,
|
|
991
|
+
ariaLabel: J,
|
|
992
|
+
className: ye,
|
|
993
|
+
style: se
|
|
994
|
+
}) {
|
|
995
|
+
const ue = [...s], fe = (ue.length - 1) / 2 || 1, [Y, V] = B({ intro: d, wave: 0, hold: !1, full: !1, pop: !1 }), C = $({ intro: 0, wave: 0, hold: 0, pop: 0 }), oe = $(!1);
|
|
996
|
+
ae(() => {
|
|
997
|
+
if (!d) return;
|
|
998
|
+
V((R) => ({ ...R, intro: !0 }));
|
|
999
|
+
const y = l + ue.length * 70 + 1700;
|
|
1000
|
+
return C.current.intro = window.setTimeout(() => V((R) => ({ ...R, intro: !1 })), y), () => window.clearTimeout(C.current.intro);
|
|
1001
|
+
}, [d, l, s]), ae(() => () => Object.values(C.current).forEach((y) => window.clearTimeout(y)), []);
|
|
1002
|
+
const pe = () => {
|
|
1003
|
+
!p || oe.current || Y.intro || (V((y) => ({ ...y, wave: y.wave + 1 })), window.clearTimeout(C.current.wave), C.current.wave = window.setTimeout(() => V((y) => ({ ...y, wave: 0 })), 700 + ue.length * 55));
|
|
1004
|
+
}, D = () => {
|
|
1005
|
+
L && (oe.current = !0, window.clearTimeout(C.current.pop), V((y) => ({ ...y, pop: !1, hold: !0 })), C.current.hold = window.setTimeout(() => {
|
|
1006
|
+
V((y) => ({ ...y, full: !0 })), w == null || w();
|
|
1007
|
+
}, m));
|
|
1008
|
+
}, I = () => {
|
|
1009
|
+
oe.current && (oe.current = !1, window.clearTimeout(C.current.hold), V((y) => ({ ...y, hold: !1, full: !1, pop: !0 })), C.current.pop = window.setTimeout(() => V((y) => ({ ...y, pop: !1 })), 480));
|
|
1010
|
+
}, H = ["pz-wm", Y.intro && "is-intro", Y.wave && "is-wave", Y.hold && "is-hold", Y.full && "is-full", Y.pop && "is-pop", !u && "no-idle", b && "is-btn", ye].filter(Boolean).join(" "), K = { "--pz-size": typeof h == "number" ? `${h}px` : h, "--pz-hold": `${m}ms`, "--pz-intro": `${l}ms` };
|
|
1011
|
+
return M && (K["--pz-dim"] = M), Z && (K["--pz-bright"] = Z), S && (K["--pz-hover"] = S), F && (K["--pz-accent"] = F), ee != null && (K["--pz-gap"] = `${ee}em`), /* @__PURE__ */ r(
|
|
1012
|
+
"span",
|
|
1013
|
+
{
|
|
1014
|
+
className: H,
|
|
1015
|
+
style: { ...K, ...se },
|
|
1016
|
+
role: b ? "button" : "img",
|
|
1017
|
+
tabIndex: b ? 0 : void 0,
|
|
1018
|
+
"aria-label": J ?? s,
|
|
1019
|
+
onClick: b,
|
|
1020
|
+
onKeyDown: b ? (y) => {
|
|
1021
|
+
(y.key === "Enter" || y.key === " ") && (y.preventDefault(), b());
|
|
1022
|
+
} : void 0,
|
|
1023
|
+
onPointerEnter: (y) => {
|
|
1024
|
+
y.pointerType === "mouse" && pe();
|
|
1025
|
+
},
|
|
1026
|
+
onPointerDown: D,
|
|
1027
|
+
onPointerUp: I,
|
|
1028
|
+
onPointerLeave: I,
|
|
1029
|
+
onPointerCancel: I,
|
|
1030
|
+
onContextMenu: (y) => L && y.preventDefault(),
|
|
1031
|
+
children: ue.map((y, R) => /* @__PURE__ */ r(
|
|
1032
|
+
"span",
|
|
1033
|
+
{
|
|
1034
|
+
"aria-hidden": "true",
|
|
1035
|
+
style: { "--i": R, "--b": (1 - Math.abs(R - fe) / fe).toFixed(2), "--c": (fe - R).toFixed(2) },
|
|
1036
|
+
children: y === " " ? " " : y
|
|
1037
|
+
},
|
|
1038
|
+
`${R}-${Y.wave}`
|
|
1039
|
+
))
|
|
1040
|
+
}
|
|
1041
|
+
);
|
|
1042
|
+
}
|
|
1043
|
+
const xn = ln, dn = { sm: 16, md: 20, lg: 28 };
|
|
1044
|
+
function vn({
|
|
1045
|
+
checked: s,
|
|
1046
|
+
defaultChecked: d = !1,
|
|
1047
|
+
onChange: l,
|
|
1048
|
+
label: u,
|
|
1049
|
+
labelPosition: p = "end",
|
|
1050
|
+
disabled: L = !1,
|
|
1051
|
+
size: m = "md",
|
|
1052
|
+
accent: w,
|
|
1053
|
+
trackColor: b,
|
|
1054
|
+
thumbColor: h,
|
|
1055
|
+
ariaLabel: M,
|
|
1056
|
+
draggable: Z = !0,
|
|
1057
|
+
cooldown: S = 0,
|
|
1058
|
+
canChange: F,
|
|
1059
|
+
onReject: ee,
|
|
1060
|
+
rejectColor: J,
|
|
1061
|
+
name: ye,
|
|
1062
|
+
id: se,
|
|
1063
|
+
className: ue,
|
|
1064
|
+
style: fe
|
|
1065
|
+
}) {
|
|
1066
|
+
const [Y, V] = B(d), C = s ?? Y, [oe, pe] = B(!1), [D, I] = B(null), H = $(null), K = $(!1), y = $(null), R = $(0), [ie, U] = B(0), ge = $(0), [te, N] = B(!1), E = typeof m == "number" ? m : dn[m], Q = Math.max(2, Math.round(E / 10)), o = E - Q * 2, we = Math.round(E * 1.7), he = we - o - Q * 2, P = (T) => {
|
|
1067
|
+
if (L || T === C) return;
|
|
1068
|
+
const W = Date.now();
|
|
1069
|
+
if (S > 0 && W - R.current < S || F && !F(T)) {
|
|
1070
|
+
U((ce) => ce + 1), N(!0), window.clearTimeout(ge.current), ge.current = window.setTimeout(() => N(!1), 1e3), ee == null || ee(T);
|
|
1071
|
+
return;
|
|
1072
|
+
}
|
|
1073
|
+
R.current = W, pe(!0), s === void 0 && V(T), l == null || l(T);
|
|
1074
|
+
}, We = (T) => {
|
|
1075
|
+
L || !Z || T.button !== 0 || (H.current = { x0: T.clientX, start: C ? he : 0, pid: T.pointerId, moved: !1 });
|
|
1076
|
+
}, X = (T) => {
|
|
1077
|
+
var $e;
|
|
1078
|
+
const W = H.current;
|
|
1079
|
+
if (!W || W.pid !== T.pointerId) return;
|
|
1080
|
+
const ce = T.clientX - W.x0;
|
|
1081
|
+
if (!W.moved && Math.abs(ce) < 4) return;
|
|
1082
|
+
if (!W.moved) {
|
|
1083
|
+
W.moved = !0;
|
|
1084
|
+
try {
|
|
1085
|
+
($e = y.current) == null || $e.setPointerCapture(T.pointerId);
|
|
1086
|
+
} catch {
|
|
1087
|
+
}
|
|
1088
|
+
}
|
|
1089
|
+
const Ie = getComputedStyle(T.currentTarget).direction === "rtl" ? -1 : 1;
|
|
1090
|
+
I(Math.min(he, Math.max(0, W.start + ce * Ie)));
|
|
1091
|
+
}, Ze = (T) => {
|
|
1092
|
+
const W = H.current;
|
|
1093
|
+
if (H.current = null, !W || !W.moved) return;
|
|
1094
|
+
K.current = !0, setTimeout(() => {
|
|
1095
|
+
K.current = !1;
|
|
1096
|
+
}, 0);
|
|
1097
|
+
const ce = D ?? W.start;
|
|
1098
|
+
I(null), T.type !== "pointercancel" && P(ce > he / 2);
|
|
1099
|
+
}, Ce = (T) => {
|
|
1100
|
+
K.current && (T.preventDefault(), K.current = !1);
|
|
1101
|
+
}, k = (T) => {
|
|
1102
|
+
T.key === "Enter" && (T.preventDefault(), P(!C));
|
|
1103
|
+
}, i = {
|
|
1104
|
+
"--pz-tg-h": `${E}px`,
|
|
1105
|
+
"--pz-tg-w": `${we}px`,
|
|
1106
|
+
"--pz-tg-pad": `${Q}px`,
|
|
1107
|
+
"--pz-tg-thumb": `${o}px`,
|
|
1108
|
+
"--pz-tg-x": `${D ?? (C ? he : 0)}px`,
|
|
1109
|
+
...w && { "--pz-tg-accent": w },
|
|
1110
|
+
...b && { "--pz-tg-track": b },
|
|
1111
|
+
...h && { "--pz-tg-knob": h },
|
|
1112
|
+
...J && { "--pz-tg-reject": J },
|
|
1113
|
+
...fe
|
|
1114
|
+
}, me = ["pz-tg", C && "is-on", L && "is-disabled", D !== null && "is-drag", oe && "is-moved", te && "is-reject", te && (ie % 2 ? "is-reject-a" : "is-reject-b"), p === "start" && "pz-tg--start", ue].filter(Boolean).join(" ");
|
|
1115
|
+
return /* @__PURE__ */ z("label", { className: me, style: i, onClick: Ce, onPointerDown: We, onPointerMove: X, onPointerUp: Ze, onPointerCancel: Ze, children: [
|
|
1116
|
+
/* @__PURE__ */ z("span", { className: "pz-tg-track", ref: y, children: [
|
|
1117
|
+
/* @__PURE__ */ r(
|
|
1118
|
+
"input",
|
|
1119
|
+
{
|
|
1120
|
+
type: "checkbox",
|
|
1121
|
+
role: "switch",
|
|
1122
|
+
className: "pz-tg-in",
|
|
1123
|
+
checked: C,
|
|
1124
|
+
"aria-checked": C,
|
|
1125
|
+
disabled: L,
|
|
1126
|
+
"aria-label": M,
|
|
1127
|
+
name: ye,
|
|
1128
|
+
id: se,
|
|
1129
|
+
onChange: (T) => P(T.target.checked),
|
|
1130
|
+
onKeyDown: k
|
|
1131
|
+
}
|
|
1132
|
+
),
|
|
1133
|
+
/* @__PURE__ */ r("span", { className: "pz-tg-ring", "aria-hidden": "true" }),
|
|
1134
|
+
/* @__PURE__ */ r("span", { className: "pz-tg-thumb", "aria-hidden": "true", children: /* @__PURE__ */ r("span", { className: "pz-tg-blob", children: /* @__PURE__ */ r("span", { className: "pz-tg-core" }) }) })
|
|
1135
|
+
] }),
|
|
1136
|
+
u != null && u !== "" && /* @__PURE__ */ r("span", { className: "pz-tg-label", children: u })
|
|
1137
|
+
] });
|
|
1138
|
+
}
|
|
1139
|
+
const un = { sm: 16, md: 20, lg: 26 };
|
|
1140
|
+
function wn({
|
|
1141
|
+
checked: s,
|
|
1142
|
+
defaultChecked: d = !1,
|
|
1143
|
+
onChange: l,
|
|
1144
|
+
indeterminate: u = !1,
|
|
1145
|
+
label: p,
|
|
1146
|
+
description: L,
|
|
1147
|
+
labelPosition: m = "end",
|
|
1148
|
+
disabled: w = !1,
|
|
1149
|
+
invalid: b = !1,
|
|
1150
|
+
size: h = "md",
|
|
1151
|
+
radius: M,
|
|
1152
|
+
accent: Z,
|
|
1153
|
+
borderColor: S,
|
|
1154
|
+
checkColor: F,
|
|
1155
|
+
ariaLabel: ee,
|
|
1156
|
+
name: J,
|
|
1157
|
+
value: ye,
|
|
1158
|
+
id: se,
|
|
1159
|
+
className: ue,
|
|
1160
|
+
style: fe
|
|
1161
|
+
}) {
|
|
1162
|
+
const [Y, V] = B(d), C = s ?? Y, [oe, pe] = B(!1), D = $(null);
|
|
1163
|
+
ae(() => {
|
|
1164
|
+
D.current && (D.current.indeterminate = u);
|
|
1165
|
+
}, [u]);
|
|
1166
|
+
const I = typeof h == "number" ? h : un[h], H = C || u, K = (U) => {
|
|
1167
|
+
w || (pe(!0), s === void 0 && V(U), l == null || l(U));
|
|
1168
|
+
}, y = (U) => {
|
|
1169
|
+
U.key === "Enter" && (U.preventDefault(), K(!C));
|
|
1170
|
+
}, R = {
|
|
1171
|
+
"--pz-cb-s": `${I}px`,
|
|
1172
|
+
"--pz-cb-r": `${M ?? Math.round(I / 3.4)}px`,
|
|
1173
|
+
...Z && { "--pz-cb-accent": Z },
|
|
1174
|
+
...S && { "--pz-cb-border": S },
|
|
1175
|
+
...F && { "--pz-cb-check": F },
|
|
1176
|
+
...fe
|
|
1177
|
+
}, ie = [
|
|
1178
|
+
"pz-cb",
|
|
1179
|
+
H && "is-on",
|
|
1180
|
+
u && "is-mixed",
|
|
1181
|
+
w && "is-disabled",
|
|
1182
|
+
b && "is-invalid",
|
|
1183
|
+
oe && "is-moved",
|
|
1184
|
+
m === "start" && "pz-cb--start",
|
|
1185
|
+
ue
|
|
1186
|
+
].filter(Boolean).join(" ");
|
|
1187
|
+
return /* @__PURE__ */ z("label", { className: ie, style: R, children: [
|
|
1188
|
+
/* @__PURE__ */ z("span", { className: "pz-cb-box", children: [
|
|
1189
|
+
/* @__PURE__ */ r(
|
|
1190
|
+
"input",
|
|
1191
|
+
{
|
|
1192
|
+
ref: D,
|
|
1193
|
+
type: "checkbox",
|
|
1194
|
+
className: "pz-cb-in",
|
|
1195
|
+
checked: C,
|
|
1196
|
+
disabled: w,
|
|
1197
|
+
"aria-label": ee,
|
|
1198
|
+
"aria-invalid": b || void 0,
|
|
1199
|
+
"aria-checked": u ? "mixed" : C,
|
|
1200
|
+
name: J,
|
|
1201
|
+
value: ye,
|
|
1202
|
+
id: se,
|
|
1203
|
+
onChange: (U) => K(U.target.checked),
|
|
1204
|
+
onKeyDown: y
|
|
1205
|
+
}
|
|
1206
|
+
),
|
|
1207
|
+
/* @__PURE__ */ r("span", { className: "pz-cb-ring", "aria-hidden": "true" }),
|
|
1208
|
+
/* @__PURE__ */ r("span", { className: "pz-cb-fill", "aria-hidden": "true" }),
|
|
1209
|
+
/* @__PURE__ */ z("svg", { className: "pz-cb-mark", viewBox: "0 0 20 20", "aria-hidden": "true", children: [
|
|
1210
|
+
/* @__PURE__ */ r("path", { className: "pz-cb-tick", d: "M5 10.4 8.6 14 15.2 6.6", pathLength: 1 }),
|
|
1211
|
+
/* @__PURE__ */ r("path", { className: "pz-cb-dash", d: "M5.5 10h9", pathLength: 1 })
|
|
1212
|
+
] })
|
|
1213
|
+
] }),
|
|
1214
|
+
p != null && p !== "" || L ? /* @__PURE__ */ z("span", { className: "pz-cb-text", children: [
|
|
1215
|
+
p != null && p !== "" && /* @__PURE__ */ r("span", { className: "pz-cb-label", children: p }),
|
|
1216
|
+
L && /* @__PURE__ */ r("span", { className: "pz-cb-desc", children: L })
|
|
1217
|
+
] }) : null
|
|
1218
|
+
] });
|
|
1219
|
+
}
|
|
1220
|
+
const fn = { sm: 16, md: 20, lg: 26 }, pn = (s) => {
|
|
1221
|
+
const d = String(s), l = d.indexOf(".");
|
|
1222
|
+
return l < 0 ? 0 : d.length - l - 1;
|
|
1223
|
+
}, hn = 2, mn = 5;
|
|
1224
|
+
function St(s, d, l, u) {
|
|
1225
|
+
let p = s.slice(0, u ? mn : 1).map((L) => Math.min(l, Math.max(d, L)));
|
|
1226
|
+
if (u) for (; p.length < hn; ) p.push(l);
|
|
1227
|
+
return p.sort((L, m) => L - m);
|
|
1228
|
+
}
|
|
1229
|
+
function Bt({
|
|
1230
|
+
multi: s,
|
|
1231
|
+
vals: d,
|
|
1232
|
+
setVals: l,
|
|
1233
|
+
end: u,
|
|
1234
|
+
minDistance: p,
|
|
1235
|
+
labels: L,
|
|
1236
|
+
min: m = 0,
|
|
1237
|
+
max: w = 100,
|
|
1238
|
+
step: b = 1,
|
|
1239
|
+
disabled: h = !1,
|
|
1240
|
+
size: M = "md",
|
|
1241
|
+
accent: Z,
|
|
1242
|
+
trackColor: S,
|
|
1243
|
+
thumbColor: F,
|
|
1244
|
+
showValue: ee = "auto",
|
|
1245
|
+
marks: J,
|
|
1246
|
+
formatValue: ye,
|
|
1247
|
+
label: se,
|
|
1248
|
+
showOutput: ue,
|
|
1249
|
+
name: fe,
|
|
1250
|
+
className: Y,
|
|
1251
|
+
style: V,
|
|
1252
|
+
fill: C = "span"
|
|
1253
|
+
}) {
|
|
1254
|
+
const oe = Jt(), pe = $(null), D = $([]), [I, H] = B(null), [K, y] = B(!1), R = $(null), ie = $(0), U = $(d);
|
|
1255
|
+
U.current = d;
|
|
1256
|
+
const ge = w - m || 1, te = (c) => (c - m) / ge * 100, N = (c) => ye ? ye(c) : String(c), E = pn(b), Q = (c) => +(Math.round((c - m) / b) * b + m).toFixed(E), o = (c, f) => {
|
|
1257
|
+
const g = U.current;
|
|
1258
|
+
let _ = Math.min(w, Math.max(m, Q(f)));
|
|
1259
|
+
if (s) {
|
|
1260
|
+
const Ee = c > 0 ? g[c - 1] + p : m, Re = c < g.length - 1 ? g[c + 1] - p : w;
|
|
1261
|
+
_ = Math.min(Re, Math.max(Ee, _));
|
|
1262
|
+
}
|
|
1263
|
+
if (_ === g[c]) return g;
|
|
1264
|
+
const G = g.slice();
|
|
1265
|
+
return G[c] = _, U.current = G, l(G), G;
|
|
1266
|
+
}, we = (c) => {
|
|
1267
|
+
const f = pe.current.getBoundingClientRect();
|
|
1268
|
+
return m + Math.min(1, Math.max(0, (c - f.left) / f.width)) * ge;
|
|
1269
|
+
}, he = (c, f) => {
|
|
1270
|
+
const g = D.current[c];
|
|
1271
|
+
if (!g) return;
|
|
1272
|
+
const _ = Math.min(0.42, Math.abs(f) * 0.22);
|
|
1273
|
+
g.style.setProperty("--pz-sl-sx", String(1 + _)), g.style.setProperty("--pz-sl-sy", String(1 - _ * 0.55)), window.clearTimeout(ie.current), ie.current = window.setTimeout(() => {
|
|
1274
|
+
g.style.setProperty("--pz-sl-sx", "1"), g.style.setProperty("--pz-sl-sy", "1");
|
|
1275
|
+
}, 70);
|
|
1276
|
+
}, P = (c) => {
|
|
1277
|
+
var Ee, Re;
|
|
1278
|
+
if (h || c.button !== 0) return;
|
|
1279
|
+
const f = we(c.clientX), g = U.current, _ = D.current.findIndex((ke) => ke && ke.contains(c.target));
|
|
1280
|
+
let G = _;
|
|
1281
|
+
if (G < 0) {
|
|
1282
|
+
let ke = 1 / 0;
|
|
1283
|
+
g.forEach((De, lt) => {
|
|
1284
|
+
const xe = Math.abs(De - f);
|
|
1285
|
+
(xe < ke || xe === ke && f > De) && (ke = xe, G = lt);
|
|
1286
|
+
});
|
|
1287
|
+
}
|
|
1288
|
+
c.preventDefault();
|
|
1289
|
+
try {
|
|
1290
|
+
(Ee = pe.current) == null || Ee.setPointerCapture(c.pointerId);
|
|
1291
|
+
} catch {
|
|
1292
|
+
}
|
|
1293
|
+
(Re = D.current[G]) == null || Re.focus({ preventScroll: !0 }), H(G), R.current = { i: G, pid: c.pointerId, x: c.clientX, t: performance.now(), moved: !1 }, _ < 0 && o(G, f);
|
|
1294
|
+
}, We = (c) => {
|
|
1295
|
+
const f = R.current;
|
|
1296
|
+
if (!f || f.pid !== c.pointerId) return;
|
|
1297
|
+
const g = performance.now();
|
|
1298
|
+
if (!f.moved) {
|
|
1299
|
+
if (Math.abs(c.clientX - f.x) < 2) return;
|
|
1300
|
+
f.moved = !0, y(!0);
|
|
1301
|
+
}
|
|
1302
|
+
he(f.i, (c.clientX - f.x) / Math.max(1, g - f.t)), f.x = c.clientX, f.t = g, o(f.i, we(c.clientX));
|
|
1303
|
+
}, X = (c) => {
|
|
1304
|
+
const f = R.current;
|
|
1305
|
+
!f || f.pid !== c.pointerId || (R.current = null, y(!1), H(null), he(f.i, 0), u(U.current));
|
|
1306
|
+
}, Ze = (c) => (f) => {
|
|
1307
|
+
if (h) return;
|
|
1308
|
+
const g = Math.max(b, Math.round(ge / 10 / b) * b), _ = U.current[c], G = {
|
|
1309
|
+
ArrowRight: _ + b,
|
|
1310
|
+
ArrowUp: _ + b,
|
|
1311
|
+
ArrowLeft: _ - b,
|
|
1312
|
+
ArrowDown: _ - b,
|
|
1313
|
+
PageUp: _ + g,
|
|
1314
|
+
PageDown: _ - g,
|
|
1315
|
+
Home: m,
|
|
1316
|
+
End: w
|
|
1317
|
+
};
|
|
1318
|
+
f.key in G && (f.preventDefault(), u(o(c, G[f.key])));
|
|
1319
|
+
}, Ce = J === !0 ? ge / b <= 60 ? Array.from({ length: Math.round(ge / b) + 1 }, (c, f) => ({ value: +(m + f * b).toFixed(E) })) : [] : Array.isArray(J) ? J.map((c) => typeof c == "number" ? { value: c } : c) : [], k = Ce.some((c) => c.label != null), i = typeof M == "number" ? M : fn[M], me = s ? d[0] : m, T = d[d.length - 1], W = s && C === "pairs" ? d.reduce((c, f, g) => (g % 2 && c.push([d[g - 1], f]), c), []) : [[me, T]], ce = (c) => W.some(([f, g]) => c >= f && c <= g), Ie = {
|
|
1320
|
+
"--pz-sl-d": `${i}px`,
|
|
1321
|
+
"--pz-sl-h": `${Math.max(3, Math.round(i * 0.3))}px`,
|
|
1322
|
+
...Z && { "--pz-sl-accent": Z },
|
|
1323
|
+
...S && { "--pz-sl-track": S },
|
|
1324
|
+
...F && { "--pz-sl-knob": F },
|
|
1325
|
+
...V
|
|
1326
|
+
}, $e = ["pz-sl", s && "pz-sl--range", K && "is-drag", h && "is-disabled", `pz-sl--tip-${ee}`, k && "has-labels", Y].filter(Boolean).join(" "), Ne = ue ?? se != null;
|
|
1327
|
+
return /* @__PURE__ */ z("div", { className: $e, style: Ie, children: [
|
|
1328
|
+
(se != null || Ne) && /* @__PURE__ */ z("div", { className: "pz-sl-head", children: [
|
|
1329
|
+
se != null && /* @__PURE__ */ r("span", { className: "pz-sl-label", id: `${oe}l`, children: se }),
|
|
1330
|
+
Ne && /* @__PURE__ */ r("output", { className: "pz-sl-out", "aria-live": "off", children: d.map(N).join(" – ") })
|
|
1331
|
+
] }),
|
|
1332
|
+
/* @__PURE__ */ z("div", { className: "pz-sl-rail", ref: pe, onPointerDown: P, onPointerMove: We, onPointerUp: X, onPointerCancel: X, children: [
|
|
1333
|
+
/* @__PURE__ */ r("div", { className: "pz-sl-track" }),
|
|
1334
|
+
W.map(([c, f], g) => /* @__PURE__ */ r("div", { className: "pz-sl-fill", style: { left: `${te(c)}%`, width: `${te(f) - te(c)}%` } }, g)),
|
|
1335
|
+
Ce.map((c) => /* @__PURE__ */ r("span", { className: `pz-sl-mark${ce(c.value) ? " is-in" : ""}`, style: { left: `${te(c.value)}%` }, children: c.label != null && /* @__PURE__ */ r("span", { className: "pz-sl-mark-l", children: c.label }) }, c.value)),
|
|
1336
|
+
d.map((c, f) => /* @__PURE__ */ z(
|
|
1337
|
+
"div",
|
|
1338
|
+
{
|
|
1339
|
+
ref: (g) => {
|
|
1340
|
+
D.current[f] = g;
|
|
1341
|
+
},
|
|
1342
|
+
className: `pz-sl-thumb${I === f ? " is-active" : ""}`,
|
|
1343
|
+
style: { left: `${te(c)}%`, zIndex: I === f ? 3 : 2 },
|
|
1344
|
+
role: "slider",
|
|
1345
|
+
tabIndex: h ? -1 : 0,
|
|
1346
|
+
"aria-valuemin": m,
|
|
1347
|
+
"aria-valuemax": w,
|
|
1348
|
+
"aria-valuenow": c,
|
|
1349
|
+
"aria-valuetext": N(c),
|
|
1350
|
+
"aria-label": L[f],
|
|
1351
|
+
"aria-labelledby": !L[f] && se != null ? `${oe}l` : void 0,
|
|
1352
|
+
"aria-disabled": h || void 0,
|
|
1353
|
+
"aria-orientation": "horizontal",
|
|
1354
|
+
onKeyDown: Ze(f),
|
|
1355
|
+
children: [
|
|
1356
|
+
/* @__PURE__ */ r("span", { className: "pz-sl-blob" }),
|
|
1357
|
+
ee !== "never" && /* @__PURE__ */ r("span", { className: "pz-sl-tip", children: N(c) })
|
|
1358
|
+
]
|
|
1359
|
+
},
|
|
1360
|
+
f
|
|
1361
|
+
))
|
|
1362
|
+
] }),
|
|
1363
|
+
fe && d.map((c, f) => /* @__PURE__ */ r("input", { type: "hidden", name: fe, value: c }, f))
|
|
1364
|
+
] });
|
|
1365
|
+
}
|
|
1366
|
+
function Mn({ value: s, defaultValue: d, onChange: l, onChangeEnd: u, ariaLabel: p, ...L }) {
|
|
1367
|
+
const m = L.min ?? 0, w = L.max ?? 100, [b, h] = B(() => d ?? m), M = St([s ?? b], m, w, !1);
|
|
1368
|
+
return /* @__PURE__ */ r(
|
|
1369
|
+
Bt,
|
|
1370
|
+
{
|
|
1371
|
+
...L,
|
|
1372
|
+
multi: !1,
|
|
1373
|
+
vals: M,
|
|
1374
|
+
minDistance: 0,
|
|
1375
|
+
labels: [p],
|
|
1376
|
+
setVals: (Z) => {
|
|
1377
|
+
s === void 0 && h(Z[0]), l == null || l(Z[0]);
|
|
1378
|
+
},
|
|
1379
|
+
end: (Z) => u == null ? void 0 : u(Z[0])
|
|
1380
|
+
}
|
|
1381
|
+
);
|
|
1382
|
+
}
|
|
1383
|
+
function $n({ value: s, defaultValue: d, onChange: l, onChangeEnd: u, minDistance: p = 0, ariaLabels: L = [], fill: m, ...w }) {
|
|
1384
|
+
const b = w.min ?? 0, h = w.max ?? 100, [M, Z] = B(() => d ?? [b + (h - b) * 0.25, b + (h - b) * 0.75]), S = St(s ?? M, b, h, !0);
|
|
1385
|
+
return /* @__PURE__ */ r(
|
|
1386
|
+
Bt,
|
|
1387
|
+
{
|
|
1388
|
+
...w,
|
|
1389
|
+
multi: !0,
|
|
1390
|
+
fill: m,
|
|
1391
|
+
vals: S,
|
|
1392
|
+
minDistance: p,
|
|
1393
|
+
labels: S.map((F, ee) => L[ee]),
|
|
1394
|
+
setVals: (F) => {
|
|
1395
|
+
s === void 0 && Z(F), l == null || l(F);
|
|
1396
|
+
},
|
|
1397
|
+
end: (F) => u == null ? void 0 : u(F)
|
|
1398
|
+
}
|
|
1399
|
+
);
|
|
1400
|
+
}
|
|
1401
|
+
const bn = "https://dev.carpark.am/parz-ui";
|
|
1402
|
+
function Nn({ prefix: s = "Components by", color: d, className: l, style: u }) {
|
|
1403
|
+
return /* @__PURE__ */ z(
|
|
1404
|
+
"a",
|
|
1405
|
+
{
|
|
1406
|
+
className: ["pz-credit", l].filter(Boolean).join(" "),
|
|
1407
|
+
href: bn,
|
|
1408
|
+
target: "_blank",
|
|
1409
|
+
rel: "noopener",
|
|
1410
|
+
style: d ? { color: d, ...u } : u,
|
|
1411
|
+
children: [
|
|
1412
|
+
s,
|
|
1413
|
+
" ",
|
|
1414
|
+
/* @__PURE__ */ r("b", { children: "CarPark Team" })
|
|
1415
|
+
]
|
|
1416
|
+
}
|
|
1417
|
+
);
|
|
1418
|
+
}
|
|
1419
|
+
export {
|
|
1420
|
+
ln as AnimoLogo,
|
|
1421
|
+
Dt as BUILTIN_ICONS,
|
|
1422
|
+
Ae as Badge,
|
|
1423
|
+
rn as DEFAULT_MOTION,
|
|
1424
|
+
At as DEFAULT_THEME,
|
|
1425
|
+
nn as GLASS_PRESETS,
|
|
1426
|
+
ve as Icon,
|
|
1427
|
+
Et as LTB_STRINGS,
|
|
1428
|
+
cn as LiquidTabBar,
|
|
1429
|
+
bn as PARZ_CREDIT_URL,
|
|
1430
|
+
wn as ParzCheckbox,
|
|
1431
|
+
Nn as ParzCredit,
|
|
1432
|
+
gn as ParzMenu,
|
|
1433
|
+
$n as ParzRange,
|
|
1434
|
+
Mn as ParzSlider,
|
|
1435
|
+
vn as ParzToggle,
|
|
1436
|
+
mn as RANGE_MAX_THUMBS,
|
|
1437
|
+
hn as RANGE_MIN_THUMBS,
|
|
1438
|
+
xn as Wordmark,
|
|
1439
|
+
Ot as loadMaterialFont,
|
|
1440
|
+
Pt as parseIcon,
|
|
1441
|
+
Ct as withAlpha
|
|
1442
|
+
};
|