@jirawatpyk/aura-react 5.14.0 → 5.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -0
- package/dist/aura.bundle.js +153 -21
- package/dist/cjs/index.cjs +153 -21
- package/dist/esm/Breadcrumb.js +76 -6
- package/dist/esm/Button.js +6 -2
- package/dist/esm/Checkbox.js +12 -2
- package/dist/esm/FilterBar.js +7 -1
- package/dist/esm/IconButton.js +7 -2
- package/dist/esm/Progress.js +14 -2
- package/dist/esm/Table.js +5 -2
- package/dist/esm/Tabs.js +7 -1
- package/dist/esm/display.js +8 -3
- package/dist/esm/strings.js +4 -0
- package/dist/esm/strings.sv.js +4 -0
- package/dist/esm/strings.th.js +4 -0
- package/dist/index.d.cts +57 -4
- package/dist/index.d.ts +57 -4
- package/dist/locales/sv.cjs +4 -0
- package/dist/locales/sv.d.cts +4 -0
- package/dist/locales/sv.d.ts +4 -0
- package/dist/locales/th.cjs +4 -0
- package/dist/locales/th.d.cts +4 -0
- package/dist/locales/th.d.ts +4 -0
- package/dist/server/index.cjs +20 -3
- package/dist/server/index.d.cts +14 -0
- package/dist/server/index.d.ts +14 -0
- package/dist/server/index.js +20 -3
- package/dist/styles.css +96 -0
- package/dist/styles.layer.css +96 -0
- package/package.json +1 -1
package/dist/cjs/index.cjs
CHANGED
|
@@ -604,8 +604,11 @@ function cardElement(props, ref) {
|
|
|
604
604
|
"interactive",
|
|
605
605
|
"as",
|
|
606
606
|
"className",
|
|
607
|
-
"titleId"
|
|
607
|
+
"titleId",
|
|
608
|
+
"header",
|
|
609
|
+
"flushBelow"
|
|
608
610
|
]);
|
|
611
|
+
const head = props.header !== void 0 && props.header !== null && props.header !== false;
|
|
609
612
|
return h2(
|
|
610
613
|
props.as || "section",
|
|
611
614
|
Object.assign({}, rest, {
|
|
@@ -614,12 +617,13 @@ function cardElement(props, ref) {
|
|
|
614
617
|
"aura-card",
|
|
615
618
|
creative && "aura-card--creative",
|
|
616
619
|
props.interactive && "is-interactive",
|
|
620
|
+
props.flushBelow && "aura-card--flush-below-" + props.flushBelow,
|
|
617
621
|
props.className
|
|
618
622
|
),
|
|
619
623
|
/* A titled card is labelled by its title; otherwise the caller's aria-labelledby stays (5.8). */
|
|
620
|
-
"aria-labelledby": props.title && props.titleId ? props.titleId : props["aria-labelledby"]
|
|
624
|
+
"aria-labelledby": !head && props.title && props.titleId ? props.titleId : props["aria-labelledby"]
|
|
621
625
|
}),
|
|
622
|
-
props.title || props.actions ? /* @__PURE__ */ React4.createElement("div", { className: "aura-card__head" }, /* @__PURE__ */ React4.createElement("div", { className: "aura-card__heading" }, props.title ? h2("h" + (props.headingLevel || 3), { className: "aura-card__title", id: props.titleId }, props.title) : null, props.description ? /* @__PURE__ */ React4.createElement("p", { className: "aura-card__desc" }, props.description) : null), props.actions ? /* @__PURE__ */ React4.createElement("div", { className: "aura-card__actions" }, props.actions) : null) : null,
|
|
626
|
+
head || props.title || props.actions ? /* @__PURE__ */ React4.createElement("div", { className: "aura-card__head" }, /* @__PURE__ */ React4.createElement("div", { className: "aura-card__heading" }, head ? props.header : null, !head && props.title ? h2("h" + (props.headingLevel || 3), { className: "aura-card__title", id: props.titleId }, props.title) : null, !head && props.description ? /* @__PURE__ */ React4.createElement("p", { className: "aura-card__desc" }, props.description) : null), props.actions ? /* @__PURE__ */ React4.createElement("div", { className: "aura-card__actions" }, props.actions) : null) : null,
|
|
623
627
|
props.children ? /* @__PURE__ */ React4.createElement("div", { className: "aura-card__body" }, props.children) : null,
|
|
624
628
|
props.footer ? /* @__PURE__ */ React4.createElement("div", { className: "aura-card__foot" }, props.footer) : null
|
|
625
629
|
);
|
|
@@ -754,6 +758,7 @@ function buttonClass(opts = {}) {
|
|
|
754
758
|
"aura-btn--" + (opts.variant || "primary"),
|
|
755
759
|
opts.size === "sm" && "aura-btn--sm",
|
|
756
760
|
opts.fullWidth && "aura-btn--full",
|
|
761
|
+
opts.touchHeight && "aura-btn--touch",
|
|
757
762
|
opts.loading && "is-loading",
|
|
758
763
|
opts.className
|
|
759
764
|
);
|
|
@@ -883,6 +888,10 @@ var th = {
|
|
|
883
888
|
pageN: function(p) {
|
|
884
889
|
return "\u0E2B\u0E19\u0E49\u0E32 " + p;
|
|
885
890
|
},
|
|
891
|
+
progressReserved: function(v, r, max) {
|
|
892
|
+
return "\u0E43\u0E0A\u0E49\u0E41\u0E25\u0E49\u0E27 " + n(v) + " \u0E08\u0E32\u0E01 " + n(max) + " \u0E08\u0E2D\u0E07\u0E44\u0E27\u0E49 " + n(r);
|
|
893
|
+
},
|
|
894
|
+
breadcrumbMore: "\u0E41\u0E2A\u0E14\u0E07\u0E40\u0E2A\u0E49\u0E19\u0E17\u0E32\u0E07\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14",
|
|
886
895
|
accepts: function(list, max) {
|
|
887
896
|
return [list, max && "\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19 " + max + " \u0E15\u0E48\u0E2D\u0E44\u0E1F\u0E25\u0E4C"].filter(Boolean).join(" \xB7 ");
|
|
888
897
|
}
|
|
@@ -1009,6 +1018,10 @@ var sv = {
|
|
|
1009
1018
|
pageN: function(p) {
|
|
1010
1019
|
return "Sida " + p;
|
|
1011
1020
|
},
|
|
1021
|
+
progressReserved: function(v, r, max) {
|
|
1022
|
+
return nsv(v) + " av " + nsv(max) + " anv\xE4nda, " + nsv(r) + " reserverade";
|
|
1023
|
+
},
|
|
1024
|
+
breadcrumbMore: "Visa hela s\xF6kv\xE4gen",
|
|
1012
1025
|
accepts: function(list, max) {
|
|
1013
1026
|
return [list, max && "h\xF6gst " + max + " per fil"].filter(Boolean).join(", ");
|
|
1014
1027
|
}
|
|
@@ -1136,6 +1149,10 @@ var STRINGS = {
|
|
|
1136
1149
|
pageN: function(p) {
|
|
1137
1150
|
return "Page " + p;
|
|
1138
1151
|
},
|
|
1152
|
+
progressReserved: function(v, r, max) {
|
|
1153
|
+
return n2(v) + " of " + n2(max) + " used, " + n2(r) + " reserved";
|
|
1154
|
+
},
|
|
1155
|
+
breadcrumbMore: "Show the full path",
|
|
1139
1156
|
accepts: function(list, max) {
|
|
1140
1157
|
return [list, max && "up to " + max + " each"].filter(Boolean).join(", ");
|
|
1141
1158
|
}
|
|
@@ -1202,7 +1219,8 @@ function ButtonLink(props, ref, Link) {
|
|
|
1202
1219
|
"linkComponent",
|
|
1203
1220
|
"href",
|
|
1204
1221
|
"fullWidth",
|
|
1205
|
-
"size"
|
|
1222
|
+
"size",
|
|
1223
|
+
"touchHeight"
|
|
1206
1224
|
]);
|
|
1207
1225
|
const Tag3 = disabled ? "a" : Link;
|
|
1208
1226
|
return /* @__PURE__ */ React6.createElement(
|
|
@@ -1218,6 +1236,7 @@ function ButtonLink(props, ref, Link) {
|
|
|
1218
1236
|
variant,
|
|
1219
1237
|
size: props.size,
|
|
1220
1238
|
fullWidth: props.fullWidth,
|
|
1239
|
+
touchHeight: props.touchHeight,
|
|
1221
1240
|
className: props.className
|
|
1222
1241
|
}),
|
|
1223
1242
|
onClick: disabled ? void 0 : props.onClick
|
|
@@ -1248,7 +1267,8 @@ var Button = React6.forwardRef(
|
|
|
1248
1267
|
"loading",
|
|
1249
1268
|
"onClick",
|
|
1250
1269
|
"fullWidth",
|
|
1251
|
-
"size"
|
|
1270
|
+
"size",
|
|
1271
|
+
"touchHeight"
|
|
1252
1272
|
]);
|
|
1253
1273
|
return /* @__PURE__ */ React6.createElement(
|
|
1254
1274
|
"button",
|
|
@@ -1260,6 +1280,7 @@ var Button = React6.forwardRef(
|
|
|
1260
1280
|
variant,
|
|
1261
1281
|
size: props.size,
|
|
1262
1282
|
fullWidth: props.fullWidth,
|
|
1283
|
+
touchHeight: props.touchHeight,
|
|
1263
1284
|
loading,
|
|
1264
1285
|
className: props.className
|
|
1265
1286
|
}),
|
|
@@ -1279,7 +1300,7 @@ var Button = React6.forwardRef(
|
|
|
1279
1300
|
// src/IconButton.tsx
|
|
1280
1301
|
var React7 = __toESM(require("react"), 1);
|
|
1281
1302
|
var IconButton = React7.forwardRef(function IconButton2(props, ref) {
|
|
1282
|
-
const rest = omit(props, ["icon", "label", "className", "size", "tone"]);
|
|
1303
|
+
const rest = omit(props, ["icon", "label", "className", "size", "tone", "touchHeight"]);
|
|
1283
1304
|
return /* @__PURE__ */ React7.createElement(
|
|
1284
1305
|
"button",
|
|
1285
1306
|
{
|
|
@@ -1288,7 +1309,12 @@ var IconButton = React7.forwardRef(function IconButton2(props, ref) {
|
|
|
1288
1309
|
type: props.type || "button",
|
|
1289
1310
|
"aria-label": props.label,
|
|
1290
1311
|
title: props.label,
|
|
1291
|
-
className: cx(
|
|
1312
|
+
className: cx(
|
|
1313
|
+
"aura-icon-btn",
|
|
1314
|
+
props.tone === "danger" && "aura-icon-btn--danger",
|
|
1315
|
+
props.touchHeight && "aura-icon-btn--touch",
|
|
1316
|
+
props.className
|
|
1317
|
+
)
|
|
1292
1318
|
},
|
|
1293
1319
|
/* @__PURE__ */ React7.createElement(Icon, { name: props.icon, size: props.size || "sm" })
|
|
1294
1320
|
);
|
|
@@ -1560,7 +1586,8 @@ var Checkbox = React10.forwardRef(function Checkbox2(props, ref) {
|
|
|
1560
1586
|
"description",
|
|
1561
1587
|
"className",
|
|
1562
1588
|
"tabIndex",
|
|
1563
|
-
"disabled"
|
|
1589
|
+
"disabled",
|
|
1590
|
+
"hitArea"
|
|
1564
1591
|
]);
|
|
1565
1592
|
const text2 = props.children;
|
|
1566
1593
|
const labelled = text2 != null && text2 !== "";
|
|
@@ -1570,10 +1597,19 @@ var Checkbox = React10.forwardRef(function Checkbox2(props, ref) {
|
|
|
1570
1597
|
"Checkbox `label` is only the accessible name: it is not shown. In 6.0 it will be shown beside the box, like Switch and TextField. For visible text now pass it as children; for a bare box (a table row) add `hideLabel`."
|
|
1571
1598
|
);
|
|
1572
1599
|
const descId = props.description ? (props.id || auto) + "-desc" : void 0;
|
|
1600
|
+
const ha = props.hitArea;
|
|
1601
|
+
const hit = !labelled && ha && ha !== "box" ? ha === "target" ? { x: 4, y: 4 } : ha : null;
|
|
1573
1602
|
return /* @__PURE__ */ React10.createElement(
|
|
1574
1603
|
"label",
|
|
1575
1604
|
{
|
|
1576
|
-
className: cx(
|
|
1605
|
+
className: cx(
|
|
1606
|
+
"aura-check",
|
|
1607
|
+
labelled && "aura-check--labelled",
|
|
1608
|
+
hit && "has-hit",
|
|
1609
|
+
props.disabled && "is-disabled",
|
|
1610
|
+
props.className
|
|
1611
|
+
),
|
|
1612
|
+
style: hit ? { "--aura-check-hit-x": hit.x + "px", "--aura-check-hit-y": hit.y + "px" } : void 0,
|
|
1577
1613
|
onClick: function(e) {
|
|
1578
1614
|
e.stopPropagation();
|
|
1579
1615
|
}
|
|
@@ -4122,7 +4158,13 @@ var FilterBar = React26.forwardRef(function FilterBar2(props, ref) {
|
|
|
4122
4158
|
ref,
|
|
4123
4159
|
role: "region",
|
|
4124
4160
|
"aria-label": props.label || t.filters,
|
|
4125
|
-
className: cx(
|
|
4161
|
+
className: cx(
|
|
4162
|
+
"aura-filterbar",
|
|
4163
|
+
props.searchGrow && "aura-filterbar--grow",
|
|
4164
|
+
props.controlsLayout === "fill" && "aura-filterbar--fill",
|
|
4165
|
+
props.stackBelow === "lg" && "aura-filterbar--stack-lg",
|
|
4166
|
+
props.className
|
|
4167
|
+
)
|
|
4126
4168
|
},
|
|
4127
4169
|
/* @__PURE__ */ React26.createElement("div", { className: "aura-filterbar__row" }, hasSearch ? /* @__PURE__ */ React26.createElement("div", { className: "aura-input has-icon aura-filterbar__search" }, /* @__PURE__ */ React26.createElement(Icon, { name: /* @__PURE__ */ React26.createElement(IconSearch, null), className: "aura-input__icon" }), /* @__PURE__ */ React26.createElement(
|
|
4128
4170
|
"input",
|
|
@@ -6124,7 +6166,13 @@ var Tabs = React33.forwardRef(function Tabs2(props, ref) {
|
|
|
6124
6166
|
const Link = useLinkComponent(props.linkComponent);
|
|
6125
6167
|
const manual = props.activation === "manual";
|
|
6126
6168
|
const seg = props.variant === "segmented";
|
|
6127
|
-
const
|
|
6169
|
+
const fw = props.fullWidth;
|
|
6170
|
+
const listCls = cx(
|
|
6171
|
+
"aura-tabs__list",
|
|
6172
|
+
seg && "aura-segmented",
|
|
6173
|
+
fw === true && (seg ? "is-full" : "is-fill"),
|
|
6174
|
+
typeof fw === "string" && (seg ? "is-full-" : "is-fill-") + fw
|
|
6175
|
+
);
|
|
6128
6176
|
const tabCls = function(on, extra) {
|
|
6129
6177
|
return cx("aura-tab", on && "is-active", seg && "aura-segmented__option", seg && on && "is-selected", extra);
|
|
6130
6178
|
};
|
|
@@ -6517,13 +6565,83 @@ var Breadcrumb = React35.forwardRef(function Breadcrumb2(props, ref) {
|
|
|
6517
6565
|
const t = useStrings();
|
|
6518
6566
|
const Link = useLinkComponent(props.linkComponent);
|
|
6519
6567
|
const items2 = props.items || [];
|
|
6520
|
-
|
|
6568
|
+
const collapsible = !!props.collapseBelow && items2.length > 2;
|
|
6569
|
+
const trail = items2.map(function(it) {
|
|
6570
|
+
return it.label + "" + (it.href || "");
|
|
6571
|
+
}).join("");
|
|
6572
|
+
const st = React35.useState(null), expanded = st[0] === trail, setExpanded = function() {
|
|
6573
|
+
st[1](trail);
|
|
6574
|
+
};
|
|
6575
|
+
const listRef = React35.useRef(null);
|
|
6576
|
+
const focusNext = React35.useRef(false);
|
|
6577
|
+
React35.useEffect(
|
|
6578
|
+
function() {
|
|
6579
|
+
if (!expanded || !focusNext.current) return;
|
|
6580
|
+
focusNext.current = false;
|
|
6581
|
+
const ol = listRef.current;
|
|
6582
|
+
if (!ol) return;
|
|
6583
|
+
let target = ol.querySelector(".aura-crumbs__middle a, .aura-crumbs__middle button");
|
|
6584
|
+
if (!target) {
|
|
6585
|
+
target = ol.querySelector(".aura-crumbs__middle > *");
|
|
6586
|
+
if (target) target.tabIndex = -1;
|
|
6587
|
+
}
|
|
6588
|
+
if (target) target.focus();
|
|
6589
|
+
},
|
|
6590
|
+
[expanded]
|
|
6591
|
+
);
|
|
6592
|
+
const sep = /* @__PURE__ */ React35.createElement(Icon, { name: /* @__PURE__ */ React35.createElement(IconChevronRight, null), size: 12, className: "aura-crumbs__sep" });
|
|
6593
|
+
const more = collapsible && !expanded ? /* @__PURE__ */ React35.createElement("li", { key: "more", className: "aura-crumbs__more" }, /* @__PURE__ */ React35.createElement(
|
|
6594
|
+
"button",
|
|
6595
|
+
{
|
|
6596
|
+
type: "button",
|
|
6597
|
+
"aria-label": t.breadcrumbMore,
|
|
6598
|
+
onClick: function() {
|
|
6599
|
+
focusNext.current = true;
|
|
6600
|
+
setExpanded();
|
|
6601
|
+
}
|
|
6602
|
+
},
|
|
6603
|
+
"\u2026"
|
|
6604
|
+
), sep) : null;
|
|
6605
|
+
const out = [];
|
|
6606
|
+
items2.forEach(function(it, i) {
|
|
6521
6607
|
const last = i === items2.length - 1;
|
|
6522
|
-
|
|
6523
|
-
|
|
6524
|
-
|
|
6525
|
-
|
|
6526
|
-
|
|
6608
|
+
const lp = it.linkProps || {};
|
|
6609
|
+
const plain = lp;
|
|
6610
|
+
const own = lp.onClick;
|
|
6611
|
+
const click = own || it.onClick ? function(e) {
|
|
6612
|
+
if (own) own(e);
|
|
6613
|
+
if (it.onClick) it.onClick();
|
|
6614
|
+
} : void 0;
|
|
6615
|
+
out.push(
|
|
6616
|
+
/* @__PURE__ */ React35.createElement(
|
|
6617
|
+
"li",
|
|
6618
|
+
{
|
|
6619
|
+
key: i,
|
|
6620
|
+
...it.itemProps,
|
|
6621
|
+
className: cx(it.itemProps && it.itemProps.className, collapsible && !last && i > 0 && "aura-crumbs__middle") || void 0
|
|
6622
|
+
},
|
|
6623
|
+
last ? /* @__PURE__ */ React35.createElement("span", { ...plain, "aria-current": "page", className: cx("aura-crumbs__current", lp.className) }, it.label) : it.href ? /* @__PURE__ */ React35.createElement(Link, { ...lp, href: it.href, onClick: click }, it.label) : it.onClick ? /* @__PURE__ */ React35.createElement("button", { ...lp, type: "button", onClick: click }, it.label) : (
|
|
6624
|
+
/* 5.7: a segment with no page and no action is text, not a button that does nothing. */
|
|
6625
|
+
/* @__PURE__ */ React35.createElement("span", { ...plain, className: cx("aura-crumbs__text", lp.className) }, it.label)
|
|
6626
|
+
),
|
|
6627
|
+
last ? null : sep
|
|
6628
|
+
)
|
|
6629
|
+
);
|
|
6630
|
+
if (i === 0 && more) out.push(more);
|
|
6631
|
+
});
|
|
6632
|
+
return /* @__PURE__ */ React35.createElement(
|
|
6633
|
+
"nav",
|
|
6634
|
+
{
|
|
6635
|
+
ref,
|
|
6636
|
+
"aria-label": props.label || t.breadcrumb,
|
|
6637
|
+
className: cx(
|
|
6638
|
+
"aura-crumbs",
|
|
6639
|
+
collapsible && !expanded && "aura-crumbs--collapse-" + props.collapseBelow,
|
|
6640
|
+
props.className
|
|
6641
|
+
)
|
|
6642
|
+
},
|
|
6643
|
+
/* @__PURE__ */ React35.createElement("ol", { ref: listRef }, out)
|
|
6644
|
+
);
|
|
6527
6645
|
});
|
|
6528
6646
|
|
|
6529
6647
|
// src/Avatar.tsx
|
|
@@ -6844,7 +6962,8 @@ function headerLabels(children) {
|
|
|
6844
6962
|
return out;
|
|
6845
6963
|
}
|
|
6846
6964
|
var Table = React44.forwardRef(function Table2(props, ref) {
|
|
6847
|
-
const { caption, captionHidden, density, stackBelow, align, bordered, className, children, ...rest } = props;
|
|
6965
|
+
const { caption, captionHidden, density, stackBelow, align, bordered, stackStyle, className, children, ...rest } = props;
|
|
6966
|
+
const cards = !!stackBelow && stackStyle === "cards";
|
|
6848
6967
|
const labels = stackBelow ? headerLabels(children) : null;
|
|
6849
6968
|
if (labels && !labels.length)
|
|
6850
6969
|
devWarnOnce(
|
|
@@ -6868,7 +6987,7 @@ var Table = React44.forwardRef(function Table2(props, ref) {
|
|
|
6868
6987
|
ro.disconnect();
|
|
6869
6988
|
};
|
|
6870
6989
|
}, []);
|
|
6871
|
-
|
|
6990
|
+
const table = /* @__PURE__ */ React44.createElement(
|
|
6872
6991
|
"div",
|
|
6873
6992
|
{
|
|
6874
6993
|
ref: wrap,
|
|
@@ -6887,6 +7006,7 @@ var Table = React44.forwardRef(function Table2(props, ref) {
|
|
|
6887
7006
|
"aura-tbl",
|
|
6888
7007
|
stackBelow && "aura-tbl--stack-" + stackBelow,
|
|
6889
7008
|
align === "middle" && "aura-tbl--middle",
|
|
7009
|
+
cards && "aura-tbl--cards",
|
|
6890
7010
|
className
|
|
6891
7011
|
),
|
|
6892
7012
|
role: stackBelow ? "table" : void 0,
|
|
@@ -6896,6 +7016,7 @@ var Table = React44.forwardRef(function Table2(props, ref) {
|
|
|
6896
7016
|
labels ? /* @__PURE__ */ React44.createElement(StackLabels.Provider, { value: labels }, children) : outer ? /* @__PURE__ */ React44.createElement(StackLabels.Provider, { value: null }, children) : children
|
|
6897
7017
|
)
|
|
6898
7018
|
);
|
|
7019
|
+
return cards ? /* @__PURE__ */ React44.createElement("div", { className: "aura-tbl-cards aura-tbl-cards--" + stackBelow }, table) : table;
|
|
6899
7020
|
});
|
|
6900
7021
|
function section(tag, cls) {
|
|
6901
7022
|
const C = React44.forwardRef(function TableSection(props, ref) {
|
|
@@ -7997,9 +8118,13 @@ var Badge = React52.forwardRef(function Badge2(props, ref) {
|
|
|
7997
8118
|
// src/Progress.tsx
|
|
7998
8119
|
var React53 = __toESM(require("react"), 1);
|
|
7999
8120
|
var Progress = React53.forwardRef(function Progress2(props, ref) {
|
|
8121
|
+
const t = useStrings();
|
|
8000
8122
|
const auto = uid(), id = props.id || auto;
|
|
8001
8123
|
const max = props.max || 100, det = props.value != null;
|
|
8002
8124
|
const pct = det ? Math.max(0, Math.min(100, props.value / max * 100)) : 0;
|
|
8125
|
+
const sec = det && props.secondaryValue != null && props.secondaryValue > 0 ? props.secondaryValue : 0;
|
|
8126
|
+
const spct = sec ? Math.max(0, Math.min(100 - pct, sec / max * 100)) : 0;
|
|
8127
|
+
const valueText = props.valueLabel != null ? String(props.valueLabel) : sec ? t.progressReserved(props.value, sec, max) : void 0;
|
|
8003
8128
|
const shown = props.valueLabel != null ? props.valueLabel : det ? Math.round(pct) + "%" : null;
|
|
8004
8129
|
return /* @__PURE__ */ React53.createElement(
|
|
8005
8130
|
"div",
|
|
@@ -8023,9 +8148,16 @@ var Progress = React53.forwardRef(function Progress2(props, ref) {
|
|
|
8023
8148
|
"aria-valuemin": det ? 0 : void 0,
|
|
8024
8149
|
"aria-valuemax": det ? max : void 0,
|
|
8025
8150
|
"aria-valuenow": det ? props.value : void 0,
|
|
8026
|
-
"aria-valuetext": det
|
|
8151
|
+
"aria-valuetext": det ? valueText : void 0
|
|
8027
8152
|
},
|
|
8028
|
-
/* @__PURE__ */ React53.createElement("span", { className: "aura-progress__bar", style: det ? { width: pct + "%" } : void 0 })
|
|
8153
|
+
/* @__PURE__ */ React53.createElement("span", { className: "aura-progress__bar", style: det ? { width: pct + "%" } : void 0 }),
|
|
8154
|
+
sec ? /* @__PURE__ */ React53.createElement(
|
|
8155
|
+
"span",
|
|
8156
|
+
{
|
|
8157
|
+
className: "aura-progress__bar aura-progress__bar--reserved",
|
|
8158
|
+
style: { left: pct + "%", width: spct + "%" }
|
|
8159
|
+
}
|
|
8160
|
+
) : null
|
|
8029
8161
|
),
|
|
8030
8162
|
props.hint ? /* @__PURE__ */ React53.createElement("p", { className: "aura-progress__hint" }, props.hint) : null
|
|
8031
8163
|
);
|
package/dist/esm/Breadcrumb.js
CHANGED
|
@@ -8,13 +8,83 @@ const Breadcrumb = React.forwardRef(function Breadcrumb2(props, ref) {
|
|
|
8
8
|
const t = useStrings();
|
|
9
9
|
const Link = useLinkComponent(props.linkComponent);
|
|
10
10
|
const items = props.items || [];
|
|
11
|
-
|
|
11
|
+
const collapsible = !!props.collapseBelow && items.length > 2;
|
|
12
|
+
const trail = items.map(function(it) {
|
|
13
|
+
return it.label + "" + (it.href || "");
|
|
14
|
+
}).join("");
|
|
15
|
+
const st = React.useState(null), expanded = st[0] === trail, setExpanded = function() {
|
|
16
|
+
st[1](trail);
|
|
17
|
+
};
|
|
18
|
+
const listRef = React.useRef(null);
|
|
19
|
+
const focusNext = React.useRef(false);
|
|
20
|
+
React.useEffect(
|
|
21
|
+
function() {
|
|
22
|
+
if (!expanded || !focusNext.current) return;
|
|
23
|
+
focusNext.current = false;
|
|
24
|
+
const ol = listRef.current;
|
|
25
|
+
if (!ol) return;
|
|
26
|
+
let target = ol.querySelector(".aura-crumbs__middle a, .aura-crumbs__middle button");
|
|
27
|
+
if (!target) {
|
|
28
|
+
target = ol.querySelector(".aura-crumbs__middle > *");
|
|
29
|
+
if (target) target.tabIndex = -1;
|
|
30
|
+
}
|
|
31
|
+
if (target) target.focus();
|
|
32
|
+
},
|
|
33
|
+
[expanded]
|
|
34
|
+
);
|
|
35
|
+
const sep = /* @__PURE__ */ React.createElement(Icon, { name: /* @__PURE__ */ React.createElement(IconChevronRight, null), size: 12, className: "aura-crumbs__sep" });
|
|
36
|
+
const more = collapsible && !expanded ? /* @__PURE__ */ React.createElement("li", { key: "more", className: "aura-crumbs__more" }, /* @__PURE__ */ React.createElement(
|
|
37
|
+
"button",
|
|
38
|
+
{
|
|
39
|
+
type: "button",
|
|
40
|
+
"aria-label": t.breadcrumbMore,
|
|
41
|
+
onClick: function() {
|
|
42
|
+
focusNext.current = true;
|
|
43
|
+
setExpanded();
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"\u2026"
|
|
47
|
+
), sep) : null;
|
|
48
|
+
const out = [];
|
|
49
|
+
items.forEach(function(it, i) {
|
|
12
50
|
const last = i === items.length - 1;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
51
|
+
const lp = it.linkProps || {};
|
|
52
|
+
const plain = lp;
|
|
53
|
+
const own = lp.onClick;
|
|
54
|
+
const click = own || it.onClick ? function(e) {
|
|
55
|
+
if (own) own(e);
|
|
56
|
+
if (it.onClick) it.onClick();
|
|
57
|
+
} : void 0;
|
|
58
|
+
out.push(
|
|
59
|
+
/* @__PURE__ */ React.createElement(
|
|
60
|
+
"li",
|
|
61
|
+
{
|
|
62
|
+
key: i,
|
|
63
|
+
...it.itemProps,
|
|
64
|
+
className: cx(it.itemProps && it.itemProps.className, collapsible && !last && i > 0 && "aura-crumbs__middle") || void 0
|
|
65
|
+
},
|
|
66
|
+
last ? /* @__PURE__ */ React.createElement("span", { ...plain, "aria-current": "page", className: cx("aura-crumbs__current", lp.className) }, it.label) : it.href ? /* @__PURE__ */ React.createElement(Link, { ...lp, href: it.href, onClick: click }, it.label) : it.onClick ? /* @__PURE__ */ React.createElement("button", { ...lp, type: "button", onClick: click }, it.label) : (
|
|
67
|
+
/* 5.7: a segment with no page and no action is text, not a button that does nothing. */
|
|
68
|
+
/* @__PURE__ */ React.createElement("span", { ...plain, className: cx("aura-crumbs__text", lp.className) }, it.label)
|
|
69
|
+
),
|
|
70
|
+
last ? null : sep
|
|
71
|
+
)
|
|
72
|
+
);
|
|
73
|
+
if (i === 0 && more) out.push(more);
|
|
74
|
+
});
|
|
75
|
+
return /* @__PURE__ */ React.createElement(
|
|
76
|
+
"nav",
|
|
77
|
+
{
|
|
78
|
+
ref,
|
|
79
|
+
"aria-label": props.label || t.breadcrumb,
|
|
80
|
+
className: cx(
|
|
81
|
+
"aura-crumbs",
|
|
82
|
+
collapsible && !expanded && "aura-crumbs--collapse-" + props.collapseBelow,
|
|
83
|
+
props.className
|
|
84
|
+
)
|
|
85
|
+
},
|
|
86
|
+
/* @__PURE__ */ React.createElement("ol", { ref: listRef }, out)
|
|
87
|
+
);
|
|
18
88
|
});
|
|
19
89
|
export {
|
|
20
90
|
Breadcrumb
|
package/dist/esm/Button.js
CHANGED
|
@@ -18,7 +18,8 @@ function ButtonLink(props, ref, Link) {
|
|
|
18
18
|
"linkComponent",
|
|
19
19
|
"href",
|
|
20
20
|
"fullWidth",
|
|
21
|
-
"size"
|
|
21
|
+
"size",
|
|
22
|
+
"touchHeight"
|
|
22
23
|
]);
|
|
23
24
|
const Tag = disabled ? "a" : Link;
|
|
24
25
|
return /* @__PURE__ */ React.createElement(
|
|
@@ -34,6 +35,7 @@ function ButtonLink(props, ref, Link) {
|
|
|
34
35
|
variant,
|
|
35
36
|
size: props.size,
|
|
36
37
|
fullWidth: props.fullWidth,
|
|
38
|
+
touchHeight: props.touchHeight,
|
|
37
39
|
className: props.className
|
|
38
40
|
}),
|
|
39
41
|
onClick: disabled ? void 0 : props.onClick
|
|
@@ -64,7 +66,8 @@ const Button = React.forwardRef(
|
|
|
64
66
|
"loading",
|
|
65
67
|
"onClick",
|
|
66
68
|
"fullWidth",
|
|
67
|
-
"size"
|
|
69
|
+
"size",
|
|
70
|
+
"touchHeight"
|
|
68
71
|
]);
|
|
69
72
|
return /* @__PURE__ */ React.createElement(
|
|
70
73
|
"button",
|
|
@@ -76,6 +79,7 @@ const Button = React.forwardRef(
|
|
|
76
79
|
variant,
|
|
77
80
|
size: props.size,
|
|
78
81
|
fullWidth: props.fullWidth,
|
|
82
|
+
touchHeight: props.touchHeight,
|
|
79
83
|
loading,
|
|
80
84
|
className: props.className
|
|
81
85
|
}),
|
package/dist/esm/Checkbox.js
CHANGED
|
@@ -22,7 +22,8 @@ const Checkbox = React.forwardRef(function Checkbox2(props, ref) {
|
|
|
22
22
|
"description",
|
|
23
23
|
"className",
|
|
24
24
|
"tabIndex",
|
|
25
|
-
"disabled"
|
|
25
|
+
"disabled",
|
|
26
|
+
"hitArea"
|
|
26
27
|
]);
|
|
27
28
|
const text = props.children;
|
|
28
29
|
const labelled = text != null && text !== "";
|
|
@@ -32,10 +33,19 @@ const Checkbox = React.forwardRef(function Checkbox2(props, ref) {
|
|
|
32
33
|
"Checkbox `label` is only the accessible name: it is not shown. In 6.0 it will be shown beside the box, like Switch and TextField. For visible text now pass it as children; for a bare box (a table row) add `hideLabel`."
|
|
33
34
|
);
|
|
34
35
|
const descId = props.description ? (props.id || auto) + "-desc" : void 0;
|
|
36
|
+
const ha = props.hitArea;
|
|
37
|
+
const hit = !labelled && ha && ha !== "box" ? ha === "target" ? { x: 4, y: 4 } : ha : null;
|
|
35
38
|
return /* @__PURE__ */ React.createElement(
|
|
36
39
|
"label",
|
|
37
40
|
{
|
|
38
|
-
className: cx(
|
|
41
|
+
className: cx(
|
|
42
|
+
"aura-check",
|
|
43
|
+
labelled && "aura-check--labelled",
|
|
44
|
+
hit && "has-hit",
|
|
45
|
+
props.disabled && "is-disabled",
|
|
46
|
+
props.className
|
|
47
|
+
),
|
|
48
|
+
style: hit ? { "--aura-check-hit-x": hit.x + "px", "--aura-check-hit-y": hit.y + "px" } : void 0,
|
|
39
49
|
onClick: function(e) {
|
|
40
50
|
e.stopPropagation();
|
|
41
51
|
}
|
package/dist/esm/FilterBar.js
CHANGED
|
@@ -55,7 +55,13 @@ const FilterBar = React.forwardRef(function FilterBar2(props, ref) {
|
|
|
55
55
|
ref,
|
|
56
56
|
role: "region",
|
|
57
57
|
"aria-label": props.label || t.filters,
|
|
58
|
-
className: cx(
|
|
58
|
+
className: cx(
|
|
59
|
+
"aura-filterbar",
|
|
60
|
+
props.searchGrow && "aura-filterbar--grow",
|
|
61
|
+
props.controlsLayout === "fill" && "aura-filterbar--fill",
|
|
62
|
+
props.stackBelow === "lg" && "aura-filterbar--stack-lg",
|
|
63
|
+
props.className
|
|
64
|
+
)
|
|
59
65
|
},
|
|
60
66
|
/* @__PURE__ */ React.createElement("div", { className: "aura-filterbar__row" }, hasSearch ? /* @__PURE__ */ React.createElement("div", { className: "aura-input has-icon aura-filterbar__search" }, /* @__PURE__ */ React.createElement(Icon, { name: /* @__PURE__ */ React.createElement(IconSearch, null), className: "aura-input__icon" }), /* @__PURE__ */ React.createElement(
|
|
61
67
|
"input",
|
package/dist/esm/IconButton.js
CHANGED
|
@@ -3,7 +3,7 @@ import * as React from "react";
|
|
|
3
3
|
import { cx, omit } from "./internal.js";
|
|
4
4
|
import { Icon } from "./Icon.js";
|
|
5
5
|
const IconButton = React.forwardRef(function IconButton2(props, ref) {
|
|
6
|
-
const rest = omit(props, ["icon", "label", "className", "size", "tone"]);
|
|
6
|
+
const rest = omit(props, ["icon", "label", "className", "size", "tone", "touchHeight"]);
|
|
7
7
|
return /* @__PURE__ */ React.createElement(
|
|
8
8
|
"button",
|
|
9
9
|
{
|
|
@@ -12,7 +12,12 @@ const IconButton = React.forwardRef(function IconButton2(props, ref) {
|
|
|
12
12
|
type: props.type || "button",
|
|
13
13
|
"aria-label": props.label,
|
|
14
14
|
title: props.label,
|
|
15
|
-
className: cx(
|
|
15
|
+
className: cx(
|
|
16
|
+
"aura-icon-btn",
|
|
17
|
+
props.tone === "danger" && "aura-icon-btn--danger",
|
|
18
|
+
props.touchHeight && "aura-icon-btn--touch",
|
|
19
|
+
props.className
|
|
20
|
+
)
|
|
16
21
|
},
|
|
17
22
|
/* @__PURE__ */ React.createElement(Icon, { name: props.icon, size: props.size || "sm" })
|
|
18
23
|
);
|
package/dist/esm/Progress.js
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { cx, tone, uid } from "./internal.js";
|
|
4
|
+
import { useStrings } from "./locale.js";
|
|
4
5
|
const Progress = React.forwardRef(function Progress2(props, ref) {
|
|
6
|
+
const t = useStrings();
|
|
5
7
|
const auto = uid(), id = props.id || auto;
|
|
6
8
|
const max = props.max || 100, det = props.value != null;
|
|
7
9
|
const pct = det ? Math.max(0, Math.min(100, props.value / max * 100)) : 0;
|
|
10
|
+
const sec = det && props.secondaryValue != null && props.secondaryValue > 0 ? props.secondaryValue : 0;
|
|
11
|
+
const spct = sec ? Math.max(0, Math.min(100 - pct, sec / max * 100)) : 0;
|
|
12
|
+
const valueText = props.valueLabel != null ? String(props.valueLabel) : sec ? t.progressReserved(props.value, sec, max) : void 0;
|
|
8
13
|
const shown = props.valueLabel != null ? props.valueLabel : det ? Math.round(pct) + "%" : null;
|
|
9
14
|
return /* @__PURE__ */ React.createElement(
|
|
10
15
|
"div",
|
|
@@ -28,9 +33,16 @@ const Progress = React.forwardRef(function Progress2(props, ref) {
|
|
|
28
33
|
"aria-valuemin": det ? 0 : void 0,
|
|
29
34
|
"aria-valuemax": det ? max : void 0,
|
|
30
35
|
"aria-valuenow": det ? props.value : void 0,
|
|
31
|
-
"aria-valuetext": det
|
|
36
|
+
"aria-valuetext": det ? valueText : void 0
|
|
32
37
|
},
|
|
33
|
-
/* @__PURE__ */ React.createElement("span", { className: "aura-progress__bar", style: det ? { width: pct + "%" } : void 0 })
|
|
38
|
+
/* @__PURE__ */ React.createElement("span", { className: "aura-progress__bar", style: det ? { width: pct + "%" } : void 0 }),
|
|
39
|
+
sec ? /* @__PURE__ */ React.createElement(
|
|
40
|
+
"span",
|
|
41
|
+
{
|
|
42
|
+
className: "aura-progress__bar aura-progress__bar--reserved",
|
|
43
|
+
style: { left: pct + "%", width: spct + "%" }
|
|
44
|
+
}
|
|
45
|
+
) : null
|
|
34
46
|
),
|
|
35
47
|
props.hint ? /* @__PURE__ */ React.createElement("p", { className: "aura-progress__hint" }, props.hint) : null
|
|
36
48
|
);
|
package/dist/esm/Table.js
CHANGED
|
@@ -47,7 +47,8 @@ function headerLabels(children) {
|
|
|
47
47
|
return out;
|
|
48
48
|
}
|
|
49
49
|
const Table = React.forwardRef(function Table2(props, ref) {
|
|
50
|
-
const { caption, captionHidden, density, stackBelow, align, bordered, className, children, ...rest } = props;
|
|
50
|
+
const { caption, captionHidden, density, stackBelow, align, bordered, stackStyle, className, children, ...rest } = props;
|
|
51
|
+
const cards = !!stackBelow && stackStyle === "cards";
|
|
51
52
|
const labels = stackBelow ? headerLabels(children) : null;
|
|
52
53
|
if (labels && !labels.length)
|
|
53
54
|
devWarnOnce(
|
|
@@ -71,7 +72,7 @@ const Table = React.forwardRef(function Table2(props, ref) {
|
|
|
71
72
|
ro.disconnect();
|
|
72
73
|
};
|
|
73
74
|
}, []);
|
|
74
|
-
|
|
75
|
+
const table = /* @__PURE__ */ React.createElement(
|
|
75
76
|
"div",
|
|
76
77
|
{
|
|
77
78
|
ref: wrap,
|
|
@@ -90,6 +91,7 @@ const Table = React.forwardRef(function Table2(props, ref) {
|
|
|
90
91
|
"aura-tbl",
|
|
91
92
|
stackBelow && "aura-tbl--stack-" + stackBelow,
|
|
92
93
|
align === "middle" && "aura-tbl--middle",
|
|
94
|
+
cards && "aura-tbl--cards",
|
|
93
95
|
className
|
|
94
96
|
),
|
|
95
97
|
role: stackBelow ? "table" : void 0,
|
|
@@ -99,6 +101,7 @@ const Table = React.forwardRef(function Table2(props, ref) {
|
|
|
99
101
|
labels ? /* @__PURE__ */ React.createElement(StackLabels.Provider, { value: labels }, children) : outer ? /* @__PURE__ */ React.createElement(StackLabels.Provider, { value: null }, children) : children
|
|
100
102
|
)
|
|
101
103
|
);
|
|
104
|
+
return cards ? /* @__PURE__ */ React.createElement("div", { className: "aura-tbl-cards aura-tbl-cards--" + stackBelow }, table) : table;
|
|
102
105
|
});
|
|
103
106
|
function section(tag, cls) {
|
|
104
107
|
const C = React.forwardRef(function TableSection(props, ref) {
|
package/dist/esm/Tabs.js
CHANGED
|
@@ -24,7 +24,13 @@ const Tabs = React.forwardRef(function Tabs2(props, ref) {
|
|
|
24
24
|
const Link = useLinkComponent(props.linkComponent);
|
|
25
25
|
const manual = props.activation === "manual";
|
|
26
26
|
const seg = props.variant === "segmented";
|
|
27
|
-
const
|
|
27
|
+
const fw = props.fullWidth;
|
|
28
|
+
const listCls = cx(
|
|
29
|
+
"aura-tabs__list",
|
|
30
|
+
seg && "aura-segmented",
|
|
31
|
+
fw === true && (seg ? "is-full" : "is-fill"),
|
|
32
|
+
typeof fw === "string" && (seg ? "is-full-" : "is-fill-") + fw
|
|
33
|
+
);
|
|
28
34
|
const tabCls = function(on, extra) {
|
|
29
35
|
return cx("aura-tab", on && "is-active", seg && "aura-segmented__option", seg && on && "is-selected", extra);
|
|
30
36
|
};
|