@stenajs-webui/elements 23.12.11 → 23.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ui/banners/banner/Banner.d.ts +2 -1
- package/dist/index.es.js +62 -61
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { AriaAttributes, ReactNode } from "react";
|
|
3
3
|
import { IconDefinition } from "@fortawesome/fontawesome-svg-core";
|
|
4
|
-
import { DivProps, HeadingVariant } from "@stenajs-webui/core";
|
|
4
|
+
import { BoxProps, DivProps, HeadingVariant } from "@stenajs-webui/core";
|
|
5
5
|
export type BannerVariant = "standard" | "info" | "success" | "warning" | "error";
|
|
6
6
|
export interface BannerProps extends AriaAttributes {
|
|
7
7
|
icon?: IconDefinition;
|
|
@@ -12,6 +12,7 @@ export interface BannerProps extends AriaAttributes {
|
|
|
12
12
|
contentRight?: ReactNode;
|
|
13
13
|
variant?: BannerVariant;
|
|
14
14
|
children?: ReactNode;
|
|
15
|
+
contentFlex?: BoxProps["flex"];
|
|
15
16
|
/**
|
|
16
17
|
* The role prop of the element, used for accessibility.
|
|
17
18
|
* If not set, it will default to "status" when variant is success, error or warning, otherwise not set.
|
package/dist/index.es.js
CHANGED
|
@@ -3803,7 +3803,7 @@ const b5 = ({
|
|
|
3803
3803
|
transform: d,
|
|
3804
3804
|
display: Z,
|
|
3805
3805
|
...z
|
|
3806
|
-
},
|
|
3806
|
+
}, f) {
|
|
3807
3807
|
if (!i)
|
|
3808
3808
|
return null;
|
|
3809
3809
|
const x = typeof r == "string" ? r : r / 10 + "rem";
|
|
@@ -3818,7 +3818,7 @@ const b5 = ({
|
|
|
3818
3818
|
rotation: a,
|
|
3819
3819
|
spin: s,
|
|
3820
3820
|
style: { fontSize: x, ...m },
|
|
3821
|
-
ref:
|
|
3821
|
+
ref: f,
|
|
3822
3822
|
transform: d,
|
|
3823
3823
|
...z
|
|
3824
3824
|
}
|
|
@@ -3877,18 +3877,19 @@ const b5 = ({
|
|
|
3877
3877
|
variant: a = "standard",
|
|
3878
3878
|
loading: r = !1,
|
|
3879
3879
|
role: s,
|
|
3880
|
-
|
|
3880
|
+
contentFlex: m,
|
|
3881
|
+
...d
|
|
3881
3882
|
}) => {
|
|
3882
|
-
const
|
|
3883
|
+
const Z = s ?? (a === "error" || a === "warning" || a === "success" ? "status" : void 0), z = j(d), f = a === "error" ? "polite" : void 0;
|
|
3883
3884
|
return /* @__PURE__ */ c(
|
|
3884
3885
|
y,
|
|
3885
3886
|
{
|
|
3886
3887
|
className: l(r1.banner, r1[a]),
|
|
3887
3888
|
spacing: L || e && n ? 2 : 1,
|
|
3888
3889
|
indent: 2,
|
|
3889
|
-
role:
|
|
3890
|
-
"aria-live":
|
|
3891
|
-
...
|
|
3890
|
+
role: Z,
|
|
3891
|
+
"aria-live": f,
|
|
3892
|
+
...z,
|
|
3892
3893
|
children: [
|
|
3893
3894
|
/* @__PURE__ */ c(M, { justifyContent: "space-between", children: [
|
|
3894
3895
|
/* @__PURE__ */ t(M, { flex: "none", width: n2, alignItems: "center", children: /* @__PURE__ */ t("div", { className: r1.iconBackground, children: (o || C2[a] || r) && /* @__PURE__ */ t(B, { children: r ? /* @__PURE__ */ t(E1, { size: "tiny" }) : /* @__PURE__ */ t(
|
|
@@ -3909,7 +3910,7 @@ const b5 = ({
|
|
|
3909
3910
|
] }),
|
|
3910
3911
|
L && /* @__PURE__ */ c(M, { children: [
|
|
3911
3912
|
/* @__PURE__ */ t(b, { minWidth: n2 }),
|
|
3912
|
-
/* @__PURE__ */ c(b, { children: [
|
|
3913
|
+
/* @__PURE__ */ c(b, { flex: m, children: [
|
|
3913
3914
|
/* @__PURE__ */ t(P, {}),
|
|
3914
3915
|
L
|
|
3915
3916
|
] })
|
|
@@ -4140,7 +4141,7 @@ const b5 = ({
|
|
|
4140
4141
|
leftWrapperClassName: d,
|
|
4141
4142
|
rightWrapperClassName: Z,
|
|
4142
4143
|
size: z = "medium",
|
|
4143
|
-
responsiveIconOnly:
|
|
4144
|
+
responsiveIconOnly: f = !1
|
|
4144
4145
|
}) => {
|
|
4145
4146
|
const x = (e || C || n || L) && /* @__PURE__ */ t(
|
|
4146
4147
|
"div",
|
|
@@ -4149,7 +4150,7 @@ const b5 = ({
|
|
|
4149
4150
|
A.leftWrapper,
|
|
4150
4151
|
A[z],
|
|
4151
4152
|
d,
|
|
4152
|
-
|
|
4153
|
+
f && A.responsiveIconOnly
|
|
4153
4154
|
),
|
|
4154
4155
|
children: e ? /* @__PURE__ */ t(
|
|
4155
4156
|
F,
|
|
@@ -4178,7 +4179,7 @@ const b5 = ({
|
|
|
4178
4179
|
A.rightWrapper,
|
|
4179
4180
|
A[z],
|
|
4180
4181
|
Z,
|
|
4181
|
-
|
|
4182
|
+
f && A.responsiveIconOnly
|
|
4182
4183
|
),
|
|
4183
4184
|
children: i || (o ? /* @__PURE__ */ t(
|
|
4184
4185
|
F,
|
|
@@ -4198,7 +4199,7 @@ const b5 = ({
|
|
|
4198
4199
|
className: l(
|
|
4199
4200
|
A.label,
|
|
4200
4201
|
s,
|
|
4201
|
-
|
|
4202
|
+
f && A.responsiveIconOnly
|
|
4202
4203
|
),
|
|
4203
4204
|
children: a
|
|
4204
4205
|
}
|
|
@@ -4220,7 +4221,7 @@ const b5 = ({
|
|
|
4220
4221
|
rightIcon: d,
|
|
4221
4222
|
right: Z,
|
|
4222
4223
|
disabled: z,
|
|
4223
|
-
onClick:
|
|
4224
|
+
onClick: f,
|
|
4224
4225
|
iconClassName: x,
|
|
4225
4226
|
labelClassName: $,
|
|
4226
4227
|
spinnerClassName: Q,
|
|
@@ -4242,10 +4243,10 @@ const b5 = ({
|
|
|
4242
4243
|
{
|
|
4243
4244
|
ref: s5,
|
|
4244
4245
|
onClick: (N1) => {
|
|
4245
|
-
if (
|
|
4246
|
+
if (f) {
|
|
4246
4247
|
if (N1.stopPropagation(), N1.preventDefault(), z || a || o)
|
|
4247
4248
|
return;
|
|
4248
|
-
|
|
4249
|
+
f(N1);
|
|
4249
4250
|
}
|
|
4250
4251
|
},
|
|
4251
4252
|
className: l(
|
|
@@ -4465,7 +4466,7 @@ const b5 = ({
|
|
|
4465
4466
|
)
|
|
4466
4467
|
}
|
|
4467
4468
|
);
|
|
4468
|
-
}), M3 = "_menuButton_skzzy_1", Z3 = "_label_skzzy_44", f3 = "_buttonLink_skzzy_50", p3 = "_button_skzzy_50", h3 = "_hasLabel_skzzy_69", g3 = "_success_skzzy_73", x3 = "_danger_skzzy_80", _3 = "_disabled_skzzy_87", N3 = "_iconOnly_skzzy_119", b3 = "_selected_skzzy_124",
|
|
4469
|
+
}), M3 = "_menuButton_skzzy_1", Z3 = "_label_skzzy_44", f3 = "_buttonLink_skzzy_50", p3 = "_button_skzzy_50", h3 = "_hasLabel_skzzy_69", g3 = "_success_skzzy_73", x3 = "_danger_skzzy_80", _3 = "_disabled_skzzy_87", N3 = "_iconOnly_skzzy_119", b3 = "_selected_skzzy_124", p = {
|
|
4469
4470
|
menuButton: M3,
|
|
4470
4471
|
label: Z3,
|
|
4471
4472
|
buttonLink: f3,
|
|
@@ -5136,14 +5137,14 @@ function u1(e, C, n, L, i, o) {
|
|
|
5136
5137
|
var d = o.get(e);
|
|
5137
5138
|
if (d)
|
|
5138
5139
|
return d;
|
|
5139
|
-
o.set(e, a), Y9(e) ? e.forEach(function(
|
|
5140
|
-
a.add(u1(
|
|
5141
|
-
}) : K9(e) && e.forEach(function(
|
|
5142
|
-
a.set(x, u1(
|
|
5140
|
+
o.set(e, a), Y9(e) ? e.forEach(function(f) {
|
|
5141
|
+
a.add(u1(f, C, n, f, e, o));
|
|
5142
|
+
}) : K9(e) && e.forEach(function(f, x) {
|
|
5143
|
+
a.set(x, u1(f, C, n, x, e, o));
|
|
5143
5144
|
});
|
|
5144
5145
|
var Z = L5, z = r ? void 0 : Z(e);
|
|
5145
|
-
return o6(z || e, function(
|
|
5146
|
-
z && (x =
|
|
5146
|
+
return o6(z || e, function(f, x) {
|
|
5147
|
+
z && (x = f, f = e[x]), U2(a, x, u1(f, C, n, x, e, o));
|
|
5147
5148
|
}), a;
|
|
5148
5149
|
}
|
|
5149
5150
|
function x8(e) {
|
|
@@ -5191,7 +5192,7 @@ const q1 = ({
|
|
|
5191
5192
|
w,
|
|
5192
5193
|
{
|
|
5193
5194
|
variant: "bold",
|
|
5194
|
-
className:
|
|
5195
|
+
className: p.label,
|
|
5195
5196
|
color: i ?? N("--swui-text-primary-color"),
|
|
5196
5197
|
children: o.label
|
|
5197
5198
|
}
|
|
@@ -5227,20 +5228,20 @@ const w8 = g(
|
|
|
5227
5228
|
left: d,
|
|
5228
5229
|
right: Z,
|
|
5229
5230
|
success: z = !1,
|
|
5230
|
-
loading:
|
|
5231
|
+
loading: f = !1,
|
|
5231
5232
|
...x
|
|
5232
5233
|
}, $) {
|
|
5233
5234
|
const Q = "label" in x ? { label: x.label } : { renderLabel: x.renderLabel }, X = A8(x, ["label", "renderLabel"]), e1 = T2(), a1 = e ?? e1;
|
|
5234
5235
|
return /* @__PURE__ */ c(b, { gap: 1, children: [
|
|
5235
|
-
/* @__PURE__ */ t(b, { className: l(
|
|
5236
|
+
/* @__PURE__ */ t(b, { className: l(p.menuButton), width: "100%", children: /* @__PURE__ */ c(
|
|
5236
5237
|
"button",
|
|
5237
5238
|
{
|
|
5238
5239
|
className: l(
|
|
5239
|
-
|
|
5240
|
-
L &&
|
|
5241
|
-
s &&
|
|
5242
|
-
|
|
5243
|
-
|
|
5240
|
+
p.button,
|
|
5241
|
+
L && p.selected,
|
|
5242
|
+
s && p.disabled,
|
|
5243
|
+
p[m],
|
|
5244
|
+
p.hasLabel,
|
|
5244
5245
|
i
|
|
5245
5246
|
),
|
|
5246
5247
|
disabled: s,
|
|
@@ -5254,7 +5255,7 @@ const w8 = g(
|
|
|
5254
5255
|
{
|
|
5255
5256
|
leftIcon: o,
|
|
5256
5257
|
left: d,
|
|
5257
|
-
right:
|
|
5258
|
+
right: f ? /* @__PURE__ */ t(I2, {}) : Z,
|
|
5258
5259
|
rightIcon: z ? o1 : a,
|
|
5259
5260
|
color: "var(--current-text-color)",
|
|
5260
5261
|
...Q
|
|
@@ -5289,7 +5290,7 @@ const w8 = g(
|
|
|
5289
5290
|
return /* @__PURE__ */ t(
|
|
5290
5291
|
b,
|
|
5291
5292
|
{
|
|
5292
|
-
className: l(
|
|
5293
|
+
className: l(p.menuButton),
|
|
5293
5294
|
width: "100%",
|
|
5294
5295
|
borderRadius: "99rem",
|
|
5295
5296
|
overflow: "hidden",
|
|
@@ -5298,11 +5299,11 @@ const w8 = g(
|
|
|
5298
5299
|
"button",
|
|
5299
5300
|
{
|
|
5300
5301
|
className: l(
|
|
5301
|
-
|
|
5302
|
-
e &&
|
|
5303
|
-
L &&
|
|
5304
|
-
|
|
5305
|
-
|
|
5302
|
+
p.button,
|
|
5303
|
+
e && p.selected,
|
|
5304
|
+
L && p.disabled,
|
|
5305
|
+
p.iconOnly,
|
|
5306
|
+
p[i],
|
|
5306
5307
|
C
|
|
5307
5308
|
),
|
|
5308
5309
|
disabled: L,
|
|
@@ -5338,21 +5339,21 @@ const w8 = g(
|
|
|
5338
5339
|
color: "var(--current-text-color)"
|
|
5339
5340
|
}
|
|
5340
5341
|
), m = "renderLink" in a ? a : void 0, d = "selected" in a ? a : void 0, Z = l(
|
|
5341
|
-
|
|
5342
|
-
|
|
5343
|
-
e ?
|
|
5344
|
-
L &&
|
|
5345
|
-
d?.selected &&
|
|
5346
|
-
|
|
5342
|
+
p.button,
|
|
5343
|
+
p.buttonLink,
|
|
5344
|
+
e ? p.hasLabel : void 0,
|
|
5345
|
+
L && p.disabled,
|
|
5346
|
+
d?.selected && p.selected,
|
|
5347
|
+
p[i],
|
|
5347
5348
|
C
|
|
5348
|
-
), { renderLink: z, selected:
|
|
5349
|
+
), { renderLink: z, selected: f, ...x } = a, $ = m?.renderLink?.(
|
|
5349
5350
|
{
|
|
5350
5351
|
...x,
|
|
5351
5352
|
className: Z,
|
|
5352
5353
|
href: L ? void 0 : o,
|
|
5353
5354
|
children: s
|
|
5354
5355
|
},
|
|
5355
|
-
|
|
5356
|
+
p.selected
|
|
5356
5357
|
) ?? /* @__PURE__ */ t(
|
|
5357
5358
|
"a",
|
|
5358
5359
|
{
|
|
@@ -5363,7 +5364,7 @@ const w8 = g(
|
|
|
5363
5364
|
children: s
|
|
5364
5365
|
}
|
|
5365
5366
|
);
|
|
5366
|
-
return /* @__PURE__ */ t(b, { className: l(
|
|
5367
|
+
return /* @__PURE__ */ t(b, { className: l(p.menuButton), width: "100%", children: $ });
|
|
5367
5368
|
}), jo = g(function({ className: e, icon: C, disabled: n, variant: L = "standard", href: i, ...o }, a) {
|
|
5368
5369
|
const r = /* @__PURE__ */ t(M, { justifyContent: "center", indent: 1, children: /* @__PURE__ */ t(b, { alignItems: "center", justifyContent: "center", width: "20px", children: /* @__PURE__ */ t(
|
|
5369
5370
|
v,
|
|
@@ -5374,35 +5375,35 @@ const w8 = g(
|
|
|
5374
5375
|
"data-hover": !0
|
|
5375
5376
|
}
|
|
5376
5377
|
) }) }), s = "renderLink" in o ? o : void 0, m = "selected" in o ? o : void 0, d = l(
|
|
5377
|
-
|
|
5378
|
-
|
|
5379
|
-
n &&
|
|
5380
|
-
m?.selected &&
|
|
5381
|
-
|
|
5382
|
-
|
|
5378
|
+
p.button,
|
|
5379
|
+
p.buttonLink,
|
|
5380
|
+
n && p.disabled,
|
|
5381
|
+
m?.selected && p.selected,
|
|
5382
|
+
p.iconOnly,
|
|
5383
|
+
p[L],
|
|
5383
5384
|
e
|
|
5384
|
-
), { renderLink: Z, selected: z, ...
|
|
5385
|
+
), { renderLink: Z, selected: z, ...f } = o, x = s?.renderLink?.(
|
|
5385
5386
|
{
|
|
5386
|
-
...
|
|
5387
|
+
...f,
|
|
5387
5388
|
className: d,
|
|
5388
5389
|
href: n ? void 0 : i,
|
|
5389
5390
|
children: r
|
|
5390
5391
|
},
|
|
5391
|
-
|
|
5392
|
+
p.selected
|
|
5392
5393
|
) ?? /* @__PURE__ */ t(
|
|
5393
5394
|
"a",
|
|
5394
5395
|
{
|
|
5395
5396
|
className: d,
|
|
5396
5397
|
href: n ? void 0 : i,
|
|
5397
5398
|
ref: a,
|
|
5398
|
-
...
|
|
5399
|
+
...f,
|
|
5399
5400
|
children: r
|
|
5400
5401
|
}
|
|
5401
5402
|
);
|
|
5402
5403
|
return /* @__PURE__ */ t(
|
|
5403
5404
|
b,
|
|
5404
5405
|
{
|
|
5405
|
-
className: l(
|
|
5406
|
+
className: l(p.menuButton),
|
|
5406
5407
|
width: "100%",
|
|
5407
5408
|
borderRadius: "99rem",
|
|
5408
5409
|
overflow: "hidden",
|
|
@@ -5425,7 +5426,7 @@ const w8 = g(
|
|
|
5425
5426
|
rightIcon: d,
|
|
5426
5427
|
right: Z,
|
|
5427
5428
|
responsiveIconOnly: z,
|
|
5428
|
-
...
|
|
5429
|
+
...f
|
|
5429
5430
|
}, x) {
|
|
5430
5431
|
const $ = O1(
|
|
5431
5432
|
C,
|
|
@@ -5446,7 +5447,7 @@ const w8 = g(
|
|
|
5446
5447
|
X && k.labelOnly,
|
|
5447
5448
|
n
|
|
5448
5449
|
),
|
|
5449
|
-
...
|
|
5450
|
+
...f,
|
|
5450
5451
|
children: /* @__PURE__ */ t(
|
|
5451
5452
|
R1,
|
|
5452
5453
|
{
|
|
@@ -5936,7 +5937,7 @@ const w8 = g(
|
|
|
5936
5937
|
responsiveIconOnly: d,
|
|
5937
5938
|
...Z
|
|
5938
5939
|
}, z) {
|
|
5939
|
-
const
|
|
5940
|
+
const f = O1(
|
|
5940
5941
|
n,
|
|
5941
5942
|
s,
|
|
5942
5943
|
void 0,
|
|
@@ -5961,7 +5962,7 @@ const w8 = g(
|
|
|
5961
5962
|
left: i,
|
|
5962
5963
|
right: a,
|
|
5963
5964
|
rightIcon: r,
|
|
5964
|
-
label:
|
|
5965
|
+
label: f,
|
|
5965
5966
|
responsiveIconOnly: d
|
|
5966
5967
|
}
|
|
5967
5968
|
)
|