md-components-mdigial-azamat 0.0.352 → 0.0.353
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.
|
@@ -1,123 +1,138 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { useState as
|
|
3
|
-
import { u as
|
|
4
|
-
import { r as x, a as
|
|
5
|
-
import { c as
|
|
6
|
-
import { actionsGenerator as
|
|
2
|
+
import { useState as L, useEffect as O } from "react";
|
|
3
|
+
import { u as T, a as A, r as e, t as n } from "../../LayoutContext-226d5893.js";
|
|
4
|
+
import { r as x, a as D } from "../../tokens-29849cf7.js";
|
|
5
|
+
import { c as g } from "../../cn-6a4bf187.js";
|
|
6
|
+
import { actionsGenerator as G } from "../../Actions/actionsGenerator.js";
|
|
7
7
|
import "../../Actions/projectActions.js";
|
|
8
8
|
import "../../Actions/types.js";
|
|
9
|
-
import { propsToEdit as
|
|
10
|
-
const
|
|
9
|
+
import { propsToEdit as V } from "./schema.js";
|
|
10
|
+
const $ = (o) => o !== "" && (o.includes("/") || o.includes(".") || o.startsWith("data:") || o.startsWith("blob:")), q = ({
|
|
11
11
|
link: o,
|
|
12
|
-
target:
|
|
12
|
+
target: v,
|
|
13
13
|
action: y,
|
|
14
|
-
aria_label:
|
|
15
|
-
name:
|
|
16
|
-
size:
|
|
14
|
+
aria_label: d,
|
|
15
|
+
name: s = "star",
|
|
16
|
+
size: i = 24,
|
|
17
17
|
color: C,
|
|
18
18
|
stroke_width: N = 1.5,
|
|
19
|
-
shape:
|
|
20
|
-
background_color:
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
shape: c = "none",
|
|
20
|
+
background_color: j,
|
|
21
|
+
box_size: l,
|
|
22
|
+
padding: E = 8,
|
|
23
|
+
className: m
|
|
23
24
|
}) => {
|
|
24
|
-
const [
|
|
25
|
-
|
|
26
|
-
if (
|
|
27
|
-
|
|
25
|
+
const [p, h] = L(null), I = T(), u = $(s);
|
|
26
|
+
O(() => {
|
|
27
|
+
if (u) {
|
|
28
|
+
h(null);
|
|
28
29
|
return;
|
|
29
30
|
}
|
|
30
31
|
let t = !0;
|
|
31
|
-
return import("../../iconNodes-2395ac4a.js").then((
|
|
32
|
-
t &&
|
|
32
|
+
return import("../../iconNodes-2395ac4a.js").then((b) => {
|
|
33
|
+
t && h(b.ICON_NODES[s] ?? null);
|
|
33
34
|
}).catch(() => {
|
|
34
|
-
t &&
|
|
35
|
+
t && h(null);
|
|
35
36
|
}), () => {
|
|
36
37
|
t = !1;
|
|
37
38
|
};
|
|
38
|
-
}, [
|
|
39
|
-
const
|
|
39
|
+
}, [s, u]);
|
|
40
|
+
const a = A(i, I ?? "base") ?? 24, B = x(C) ?? "currentColor", R = /* @__PURE__ */ r(
|
|
40
41
|
"img",
|
|
41
42
|
{
|
|
42
|
-
className:
|
|
43
|
+
className: g("mbl", c === "none" ? m : void 0),
|
|
43
44
|
style: {
|
|
44
|
-
...
|
|
45
|
+
...e("w", i, n),
|
|
45
46
|
// Высота тоже по экранам: без переменной на брейкпоинте картинка
|
|
46
47
|
// взяла бы атрибут ниже, а не растянулась вместе с шириной
|
|
47
|
-
...
|
|
48
|
+
...e("h", i, n),
|
|
48
49
|
objectFit: "contain"
|
|
49
50
|
},
|
|
50
|
-
width:
|
|
51
|
-
height:
|
|
52
|
-
src:
|
|
53
|
-
alt:
|
|
51
|
+
width: a,
|
|
52
|
+
height: a,
|
|
53
|
+
src: s,
|
|
54
|
+
alt: d ?? "",
|
|
54
55
|
loading: "lazy",
|
|
55
56
|
decoding: "async"
|
|
56
57
|
}
|
|
57
|
-
),
|
|
58
|
+
), W = /* @__PURE__ */ r(
|
|
58
59
|
"svg",
|
|
59
60
|
{
|
|
60
|
-
className:
|
|
61
|
-
style:
|
|
62
|
-
width:
|
|
63
|
-
height:
|
|
61
|
+
className: g("mbl", c === "none" ? m : void 0),
|
|
62
|
+
style: e("w", i, n),
|
|
63
|
+
width: a,
|
|
64
|
+
height: a,
|
|
64
65
|
viewBox: "0 0 24 24",
|
|
65
66
|
fill: "none",
|
|
66
|
-
stroke:
|
|
67
|
+
stroke: B,
|
|
67
68
|
strokeWidth: N,
|
|
68
69
|
strokeLinecap: "round",
|
|
69
70
|
strokeLinejoin: "round",
|
|
70
71
|
"aria-hidden": !0,
|
|
71
72
|
focusable: "false",
|
|
72
|
-
children:
|
|
73
|
+
children: p == null ? void 0 : p.map(([t, b], F) => /* @__PURE__ */ r(
|
|
73
74
|
t,
|
|
74
75
|
{
|
|
75
|
-
...
|
|
76
|
+
...b
|
|
76
77
|
},
|
|
77
|
-
|
|
78
|
+
F
|
|
78
79
|
))
|
|
79
80
|
}
|
|
80
|
-
),
|
|
81
|
+
), k = u ? R : W, w = l != null, f = c === "none" ? k : /* @__PURE__ */ r(
|
|
81
82
|
"span",
|
|
82
83
|
{
|
|
83
|
-
className:
|
|
84
|
+
className: g(
|
|
85
|
+
// `mbl` — чтобы сторона подложки шла по экранам тем же каскадом
|
|
86
|
+
// переменных, что размер иконки
|
|
84
87
|
"inline-flex items-center justify-center shrink-0",
|
|
85
|
-
|
|
88
|
+
w && "mbl",
|
|
89
|
+
m
|
|
86
90
|
),
|
|
87
91
|
style: {
|
|
88
|
-
backgroundColor: x(
|
|
89
|
-
borderRadius:
|
|
90
|
-
|
|
92
|
+
backgroundColor: x(j) ?? "transparent",
|
|
93
|
+
borderRadius: c === "circle" ? "9999px" : D("md"),
|
|
94
|
+
...w ? {
|
|
95
|
+
...e("w", l, n),
|
|
96
|
+
...e("h", l, n),
|
|
97
|
+
// Сторона — инлайном, а не классом `.mbl`: подложка — прямой
|
|
98
|
+
// ребёнок обёртки узла, и `.mbl-item > .mbl { height: 100% }`
|
|
99
|
+
// перебивал высоту — квадрат 61 сплющивался до высоты иконки
|
|
100
|
+
width: "var(--mbl-w-c)",
|
|
101
|
+
height: "var(--mbl-h-c)",
|
|
102
|
+
// flex у `.mbl` по умолчанию разрешает сжатие — подложка
|
|
103
|
+
// в узкой строке сплющилась бы в овал
|
|
104
|
+
flexShrink: 0
|
|
105
|
+
} : { padding: `${E}px` }
|
|
91
106
|
},
|
|
92
|
-
children:
|
|
107
|
+
children: k
|
|
93
108
|
}
|
|
94
109
|
);
|
|
95
110
|
if (!o && !y)
|
|
96
|
-
return
|
|
97
|
-
const
|
|
111
|
+
return f;
|
|
112
|
+
const S = "inline-flex cursor-pointer transition-opacity hover:opacity-80";
|
|
98
113
|
return o ? /* @__PURE__ */ r(
|
|
99
114
|
"a",
|
|
100
115
|
{
|
|
101
116
|
href: o,
|
|
102
|
-
target:
|
|
103
|
-
rel:
|
|
104
|
-
"aria-label":
|
|
105
|
-
className:
|
|
106
|
-
children:
|
|
117
|
+
target: v,
|
|
118
|
+
rel: v === "_blank" ? "noreferrer" : void 0,
|
|
119
|
+
"aria-label": d,
|
|
120
|
+
className: S,
|
|
121
|
+
children: f
|
|
107
122
|
}
|
|
108
123
|
) : /* @__PURE__ */ r(
|
|
109
124
|
"button",
|
|
110
125
|
{
|
|
111
126
|
type: "button",
|
|
112
|
-
"aria-label":
|
|
113
|
-
className:
|
|
114
|
-
...
|
|
115
|
-
children:
|
|
127
|
+
"aria-label": d,
|
|
128
|
+
className: S,
|
|
129
|
+
...G(y),
|
|
130
|
+
children: f
|
|
116
131
|
}
|
|
117
132
|
);
|
|
118
133
|
};
|
|
119
|
-
|
|
134
|
+
q.propsToEdit = V;
|
|
120
135
|
export {
|
|
121
|
-
|
|
122
|
-
|
|
136
|
+
q as AtomIcon,
|
|
137
|
+
$ as isImageSource
|
|
123
138
|
};
|
|
@@ -34,6 +34,13 @@ const t = [
|
|
|
34
34
|
dataType: a.string,
|
|
35
35
|
key: "background_color",
|
|
36
36
|
label: "Цвет подложки"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
type: e.RESPONSIVE_NUMBER,
|
|
40
|
+
dataType: a.number,
|
|
41
|
+
key: "box_size",
|
|
42
|
+
label: "Размер подложки",
|
|
43
|
+
hint: "Пусто — подложка обхватывает иконку с отступом 8px"
|
|
37
44
|
}
|
|
38
45
|
];
|
|
39
46
|
export {
|