@jirawatpyk/aura-react 5.34.0 → 5.35.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 +7 -0
- package/dist/aura.bundle.js +350 -207
- package/dist/cjs/index.cjs +350 -207
- package/dist/esm/ActionBar.js +1 -0
- package/dist/esm/AppShell.js +16 -2
- package/dist/esm/BottomNav.js +26 -2
- package/dist/esm/scrollHide.js +96 -0
- package/dist/esm/strings.js +1 -0
- package/dist/esm/strings.sv.js +1 -0
- package/dist/esm/strings.th.js +1 -0
- package/dist/esm/tiles.js +14 -6
- package/dist/index.d.cts +20 -5
- package/dist/index.d.ts +20 -5
- package/dist/locales/sv.cjs +1 -0
- package/dist/locales/sv.d.cts +2 -0
- package/dist/locales/sv.d.ts +2 -0
- package/dist/locales/th.cjs +1 -0
- package/dist/locales/th.d.cts +2 -0
- package/dist/locales/th.d.ts +2 -0
- package/dist/server/index.cjs +15 -4
- package/dist/server/index.d.cts +8 -5
- package/dist/server/index.d.ts +8 -5
- package/dist/server/index.js +15 -4
- package/dist/styles.css +24 -5
- package/dist/styles.layer.css +24 -5
- package/package.json +1 -1
package/dist/aura.bundle.js
CHANGED
|
@@ -949,6 +949,7 @@ window.Aura = (() => {
|
|
|
949
949
|
statusProblem: "\u0E21\u0E35\u0E1B\u0E31\u0E0D\u0E2B\u0E32",
|
|
950
950
|
statusMaintenance: "\u0E1B\u0E34\u0E14\u0E1B\u0E23\u0E31\u0E1A\u0E1B\u0E23\u0E38\u0E07",
|
|
951
951
|
statusOk: "\u0E1B\u0E01\u0E15\u0E34",
|
|
952
|
+
statusUnknown: "\u0E22\u0E31\u0E07\u0E44\u0E21\u0E48\u0E21\u0E35\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25",
|
|
952
953
|
accepts: function(list, max) {
|
|
953
954
|
return [list, max && "\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19 " + max + " \u0E15\u0E48\u0E2D\u0E44\u0E1F\u0E25\u0E4C"].filter(Boolean).join(" \xB7 ");
|
|
954
955
|
}
|
|
@@ -1084,6 +1085,7 @@ window.Aura = (() => {
|
|
|
1084
1085
|
statusProblem: "Problem",
|
|
1085
1086
|
statusMaintenance: "Underh\xE5ll",
|
|
1086
1087
|
statusOk: "OK",
|
|
1088
|
+
statusUnknown: "Ingen data",
|
|
1087
1089
|
accepts: function(list, max) {
|
|
1088
1090
|
return [list, max && "h\xF6gst " + max + " per fil"].filter(Boolean).join(", ");
|
|
1089
1091
|
}
|
|
@@ -1220,6 +1222,7 @@ window.Aura = (() => {
|
|
|
1220
1222
|
statusProblem: "Problem",
|
|
1221
1223
|
statusMaintenance: "Maintenance",
|
|
1222
1224
|
statusOk: "OK",
|
|
1225
|
+
statusUnknown: "No data",
|
|
1223
1226
|
accepts: function(list, max) {
|
|
1224
1227
|
return [list, max && "up to " + max + " each"].filter(Boolean).join(", ");
|
|
1225
1228
|
}
|
|
@@ -7685,19 +7688,22 @@ window.Aura = (() => {
|
|
|
7685
7688
|
down: IconCircleAlert,
|
|
7686
7689
|
problem: IconTriangleAlert,
|
|
7687
7690
|
maintenance: IconWrench,
|
|
7688
|
-
ok: IconCircleCheck
|
|
7691
|
+
ok: IconCircleCheck,
|
|
7692
|
+
unknown: IconCircleDotDashed
|
|
7689
7693
|
};
|
|
7690
7694
|
var STATUS_TONE = {
|
|
7691
7695
|
down: "danger",
|
|
7692
7696
|
problem: "warning",
|
|
7693
7697
|
maintenance: "accent",
|
|
7694
|
-
ok: "default"
|
|
7698
|
+
ok: "default",
|
|
7699
|
+
unknown: "default"
|
|
7695
7700
|
};
|
|
7696
7701
|
var STATUS_WORD = {
|
|
7697
7702
|
down: "statusDown",
|
|
7698
7703
|
problem: "statusProblem",
|
|
7699
7704
|
maintenance: "statusMaintenance",
|
|
7700
|
-
ok: "statusOk"
|
|
7705
|
+
ok: "statusOk",
|
|
7706
|
+
unknown: "statusUnknown"
|
|
7701
7707
|
};
|
|
7702
7708
|
function statusWord(status, t) {
|
|
7703
7709
|
return String(t[STATUS_WORD[status]] || STATUS_WORD[status]);
|
|
@@ -7712,7 +7718,12 @@ window.Aura = (() => {
|
|
|
7712
7718
|
}
|
|
7713
7719
|
var comma = h9("span", { className: "aura-status-tile__sep" }, ",");
|
|
7714
7720
|
function statusTileElement(props, ref, Link, t, titleRef) {
|
|
7715
|
-
const status = STATUS_ICON[props.status] ? props.status : "
|
|
7721
|
+
const status = STATUS_ICON[props.status] ? props.status : "unknown";
|
|
7722
|
+
if (status !== props.status)
|
|
7723
|
+
devWarnOnce(
|
|
7724
|
+
"status-tile-status-" + String(props.status),
|
|
7725
|
+
'StatusTile status="' + String(props.status) + '" is not down, problem, maintenance, ok or unknown: it shows as unknown ("No data"). Map your value first.'
|
|
7726
|
+
);
|
|
7716
7727
|
const valueTone = props.valueTone || STATUS_TONE[status];
|
|
7717
7728
|
const word = props.statusLabel || statusWord(status, t);
|
|
7718
7729
|
const markers = (props.markers || []).filter(Boolean);
|
|
@@ -7923,37 +7934,144 @@ window.Aura = (() => {
|
|
|
7923
7934
|
});
|
|
7924
7935
|
|
|
7925
7936
|
// src/AppShell.tsx
|
|
7937
|
+
var React47 = __toESM(require_react(), 1);
|
|
7938
|
+
|
|
7939
|
+
// src/scrollHide.ts
|
|
7926
7940
|
var React46 = __toESM(require_react(), 1);
|
|
7927
|
-
var
|
|
7941
|
+
var STEP = 8;
|
|
7942
|
+
function useHideOnScroll(enabled, el, media, from) {
|
|
7943
|
+
const st = React46.useState(false), hidden = st[0], setHidden = st[1];
|
|
7944
|
+
React46.useEffect(
|
|
7945
|
+
function() {
|
|
7946
|
+
if (!enabled || typeof window === "undefined") {
|
|
7947
|
+
setHidden(false);
|
|
7948
|
+
return;
|
|
7949
|
+
}
|
|
7950
|
+
const mq = window.matchMedia ? window.matchMedia(media) : null;
|
|
7951
|
+
let last = window.scrollY, lastH = window.innerHeight, resizedAt = -1e9, run = 0;
|
|
7952
|
+
let restore = null;
|
|
7953
|
+
function update() {
|
|
7954
|
+
if (restore) {
|
|
7955
|
+
const r2 = restore;
|
|
7956
|
+
if (performance.now() > r2.until || window.scrollY >= r2.y - 1) restore = null;
|
|
7957
|
+
else {
|
|
7958
|
+
restore = null;
|
|
7959
|
+
last = r2.y;
|
|
7960
|
+
window.scrollTo(window.scrollX, r2.y);
|
|
7961
|
+
return;
|
|
7962
|
+
}
|
|
7963
|
+
}
|
|
7964
|
+
const y = window.scrollY, dy = y - last;
|
|
7965
|
+
last = y;
|
|
7966
|
+
const node2 = el.current;
|
|
7967
|
+
if (mq && !mq.matches || y <= from || node2 && document.activeElement && node2.contains(document.activeElement)) {
|
|
7968
|
+
run = 0;
|
|
7969
|
+
setHidden(false);
|
|
7970
|
+
return;
|
|
7971
|
+
}
|
|
7972
|
+
if (window.innerHeight !== lastH || performance.now() - resizedAt < 150) {
|
|
7973
|
+
lastH = window.innerHeight;
|
|
7974
|
+
resizedAt = performance.now();
|
|
7975
|
+
run = 0;
|
|
7976
|
+
return;
|
|
7977
|
+
}
|
|
7978
|
+
if (y + window.innerHeight > document.documentElement.scrollHeight + 1) return;
|
|
7979
|
+
run = dy > 0 === run > 0 ? run + dy : dy;
|
|
7980
|
+
if (run > STEP) setHidden(true);
|
|
7981
|
+
else if (run < -STEP) setHidden(false);
|
|
7982
|
+
}
|
|
7983
|
+
let tabbing = false;
|
|
7984
|
+
function disarm() {
|
|
7985
|
+
restore = null;
|
|
7986
|
+
}
|
|
7987
|
+
function onKey(e) {
|
|
7988
|
+
if (e.key !== "Tab" && e.code !== "Tab") {
|
|
7989
|
+
if (e.key !== "Shift") restore = null;
|
|
7990
|
+
return;
|
|
7991
|
+
}
|
|
7992
|
+
tabbing = true;
|
|
7993
|
+
requestAnimationFrame(function() {
|
|
7994
|
+
tabbing = false;
|
|
7995
|
+
});
|
|
7996
|
+
}
|
|
7997
|
+
function reveal() {
|
|
7998
|
+
const n3 = el.current;
|
|
7999
|
+
if (n3 && n3.classList.contains("is-away")) {
|
|
8000
|
+
n3.classList.remove("is-away");
|
|
8001
|
+
if (tabbing) {
|
|
8002
|
+
if (window.scrollY < last) window.scrollTo(window.scrollX, last);
|
|
8003
|
+
else restore = { y: last, until: performance.now() + 400 };
|
|
8004
|
+
}
|
|
8005
|
+
}
|
|
8006
|
+
setHidden(false);
|
|
8007
|
+
}
|
|
8008
|
+
window.addEventListener("scroll", update, { passive: true });
|
|
8009
|
+
window.addEventListener("resize", update);
|
|
8010
|
+
document.addEventListener("keydown", onKey, true);
|
|
8011
|
+
window.addEventListener("wheel", disarm, { passive: true, capture: true });
|
|
8012
|
+
window.addEventListener("touchstart", disarm, { passive: true, capture: true });
|
|
8013
|
+
window.addEventListener("pointerdown", disarm, true);
|
|
8014
|
+
const node = el.current;
|
|
8015
|
+
if (node) node.addEventListener("focusin", reveal);
|
|
8016
|
+
if (mq && mq.addEventListener) mq.addEventListener("change", update);
|
|
8017
|
+
return function() {
|
|
8018
|
+
window.removeEventListener("scroll", update);
|
|
8019
|
+
window.removeEventListener("resize", update);
|
|
8020
|
+
document.removeEventListener("keydown", onKey, true);
|
|
8021
|
+
window.removeEventListener("wheel", disarm, true);
|
|
8022
|
+
window.removeEventListener("touchstart", disarm, true);
|
|
8023
|
+
window.removeEventListener("pointerdown", disarm, true);
|
|
8024
|
+
if (node) node.removeEventListener("focusin", reveal);
|
|
8025
|
+
if (mq && mq.removeEventListener) mq.removeEventListener("change", update);
|
|
8026
|
+
};
|
|
8027
|
+
},
|
|
8028
|
+
[enabled, el, media, from]
|
|
8029
|
+
);
|
|
8030
|
+
return enabled && hidden;
|
|
8031
|
+
}
|
|
8032
|
+
|
|
8033
|
+
// src/AppShell.tsx
|
|
8034
|
+
var AppShell = React47.forwardRef(function AppShell2(props, ref) {
|
|
7928
8035
|
const t = useStrings();
|
|
7929
8036
|
const bp = useBreakpoint();
|
|
7930
8037
|
const wide = bp === "lg" || bp === "xl";
|
|
7931
|
-
const st =
|
|
7932
|
-
|
|
8038
|
+
const st = React47.useState(false), open = st[0], setOpen = st[1];
|
|
8039
|
+
React47.useEffect(
|
|
7933
8040
|
function() {
|
|
7934
8041
|
if (wide) setOpen(false);
|
|
7935
8042
|
},
|
|
7936
8043
|
[wide]
|
|
7937
8044
|
);
|
|
7938
|
-
const navEl = props.nav &&
|
|
8045
|
+
const navEl = props.nav && React47.isValidElement(props.nav) ? props.nav : null;
|
|
7939
8046
|
const shared = !!navEl && navEl.props.value === void 0 && (navEl.props.defaultValue !== void 0 || navEl.props.sections !== void 0 || navEl.props.items !== void 0);
|
|
7940
|
-
const navState =
|
|
8047
|
+
const navState = React47.useState(navEl ? navEl.props.defaultValue : void 0);
|
|
7941
8048
|
function onNav(id) {
|
|
7942
8049
|
if (shared) navState[1](id);
|
|
7943
8050
|
if (navEl && navEl.props.onChange) navEl.props.onChange(id);
|
|
7944
8051
|
}
|
|
7945
|
-
const rootRef =
|
|
7946
|
-
const barRef =
|
|
8052
|
+
const rootRef = React47.useRef(null);
|
|
8053
|
+
const barRef = React47.useRef(null);
|
|
7947
8054
|
const mergedRef = useMergedRef(ref, rootRef);
|
|
7948
8055
|
const hasBar = !!(props.header || props.nav);
|
|
7949
|
-
const barH =
|
|
8056
|
+
const barH = React47.useState(null);
|
|
8057
|
+
const away = useHideOnScroll(!!props.headerHideOnScroll && hasBar, barRef, "(max-width: 1023.98px)", barH[0] || 56);
|
|
8058
|
+
const awayRef = React47.useRef(away);
|
|
8059
|
+
awayRef.current = away;
|
|
8060
|
+
useIsoLayoutEffect(
|
|
8061
|
+
function() {
|
|
8062
|
+
const root = rootRef.current, bar = barRef.current;
|
|
8063
|
+
if (!root || !bar) return;
|
|
8064
|
+
root.style.setProperty("--aura-shell-bar-height", away ? "0px" : bar.getBoundingClientRect().height + "px");
|
|
8065
|
+
},
|
|
8066
|
+
[away]
|
|
8067
|
+
);
|
|
7950
8068
|
useIsoLayoutEffect(
|
|
7951
8069
|
function() {
|
|
7952
8070
|
const root = rootRef.current, bar = barRef.current;
|
|
7953
8071
|
if (!root || !bar) return;
|
|
7954
8072
|
function sync() {
|
|
7955
8073
|
const h11 = bar.getBoundingClientRect().height;
|
|
7956
|
-
root.style.setProperty("--aura-shell-bar-height", h11 + "px");
|
|
8074
|
+
root.style.setProperty("--aura-shell-bar-height", awayRef.current ? "0px" : h11 + "px");
|
|
7957
8075
|
if (h11 > 0) barH[1](Math.round(h11));
|
|
7958
8076
|
}
|
|
7959
8077
|
sync();
|
|
@@ -7966,8 +8084,8 @@ window.Aura = (() => {
|
|
|
7966
8084
|
},
|
|
7967
8085
|
[hasBar]
|
|
7968
8086
|
);
|
|
7969
|
-
const deskNav = navEl && shared ?
|
|
7970
|
-
const drawerNav = navEl ?
|
|
8087
|
+
const deskNav = navEl && shared ? React47.cloneElement(navEl, { value: navState[0], onChange: onNav }) : props.nav;
|
|
8088
|
+
const drawerNav = navEl ? React47.cloneElement(navEl, {
|
|
7971
8089
|
value: shared ? navState[0] : navEl.props.value,
|
|
7972
8090
|
onChange: function(id) {
|
|
7973
8091
|
onNav(id);
|
|
@@ -7982,7 +8100,7 @@ window.Aura = (() => {
|
|
|
7982
8100
|
collapsed: false,
|
|
7983
8101
|
collapsible: false
|
|
7984
8102
|
}) : props.nav;
|
|
7985
|
-
return /* @__PURE__ */
|
|
8103
|
+
return /* @__PURE__ */ React47.createElement(
|
|
7986
8104
|
"div",
|
|
7987
8105
|
{
|
|
7988
8106
|
ref: mergedRef,
|
|
@@ -7997,8 +8115,8 @@ window.Aura = (() => {
|
|
|
7997
8115
|
props.className
|
|
7998
8116
|
)
|
|
7999
8117
|
},
|
|
8000
|
-
props.nav ? /* @__PURE__ */
|
|
8001
|
-
props.nav ? /* @__PURE__ */
|
|
8118
|
+
props.nav ? /* @__PURE__ */ React47.createElement("div", { className: "aura-shell__nav" }, deskNav) : null,
|
|
8119
|
+
props.nav ? /* @__PURE__ */ React47.createElement(
|
|
8002
8120
|
Drawer,
|
|
8003
8121
|
{
|
|
8004
8122
|
open,
|
|
@@ -8015,20 +8133,22 @@ window.Aura = (() => {
|
|
|
8015
8133
|
},
|
|
8016
8134
|
drawerNav
|
|
8017
8135
|
) : null,
|
|
8018
|
-
/* @__PURE__ */
|
|
8136
|
+
/* @__PURE__ */ React47.createElement("div", { className: "aura-shell__main" }, props.header || props.nav ? /* @__PURE__ */ React47.createElement(
|
|
8019
8137
|
"header",
|
|
8020
8138
|
{
|
|
8021
8139
|
ref: barRef,
|
|
8022
8140
|
className: cx(
|
|
8023
8141
|
"aura-shell__bar",
|
|
8024
|
-
(!props.header || props.headerHideFrom === "lg") && "aura-shell__bar--menu-only"
|
|
8142
|
+
(!props.header || props.headerHideFrom === "lg") && "aura-shell__bar--menu-only",
|
|
8143
|
+
props.headerHideOnScroll && "aura-shell__bar--hides",
|
|
8144
|
+
away && "is-away"
|
|
8025
8145
|
)
|
|
8026
8146
|
},
|
|
8027
|
-
props.nav ? /* @__PURE__ */
|
|
8147
|
+
props.nav ? /* @__PURE__ */ React47.createElement(
|
|
8028
8148
|
IconButton,
|
|
8029
8149
|
{
|
|
8030
8150
|
className: "aura-shell__menu",
|
|
8031
|
-
icon: /* @__PURE__ */
|
|
8151
|
+
icon: /* @__PURE__ */ React47.createElement(IconMenu, null),
|
|
8032
8152
|
label: props.menuLabel || t.openNav,
|
|
8033
8153
|
size: "md",
|
|
8034
8154
|
onClick: function() {
|
|
@@ -8037,8 +8157,8 @@ window.Aura = (() => {
|
|
|
8037
8157
|
"aria-expanded": open
|
|
8038
8158
|
}
|
|
8039
8159
|
) : null,
|
|
8040
|
-
/* @__PURE__ */
|
|
8041
|
-
) : null, /* @__PURE__ */
|
|
8160
|
+
/* @__PURE__ */ React47.createElement("div", { className: "aura-shell__bar-content" }, props.header)
|
|
8161
|
+
) : null, /* @__PURE__ */ React47.createElement(
|
|
8042
8162
|
"main",
|
|
8043
8163
|
{
|
|
8044
8164
|
className: cx("aura-shell__content", props.contentPadding === false && "is-flush"),
|
|
@@ -8051,17 +8171,17 @@ window.Aura = (() => {
|
|
|
8051
8171
|
});
|
|
8052
8172
|
|
|
8053
8173
|
// src/ActionBar.tsx
|
|
8054
|
-
var
|
|
8055
|
-
var ActionBar =
|
|
8174
|
+
var React48 = __toESM(require_react(), 1);
|
|
8175
|
+
var ActionBar = React48.forwardRef(function ActionBar2(props, ref) {
|
|
8056
8176
|
const t = useStrings();
|
|
8057
8177
|
const bulk = props.selected != null;
|
|
8058
8178
|
const idle = bulk && !props.selected;
|
|
8059
8179
|
const count = bulk && props.selected ? t.selectedCount(props.selected) : null;
|
|
8060
|
-
const hasStart =
|
|
8180
|
+
const hasStart = React48.Children.toArray(props.start).some(function(c) {
|
|
8061
8181
|
return c !== "";
|
|
8062
8182
|
});
|
|
8063
|
-
const cameFrom =
|
|
8064
|
-
const own =
|
|
8183
|
+
const cameFrom = React48.useRef(null);
|
|
8184
|
+
const own = React48.useRef(null);
|
|
8065
8185
|
function clear() {
|
|
8066
8186
|
props.onClearSelection();
|
|
8067
8187
|
setTimeout(function() {
|
|
@@ -8070,7 +8190,7 @@ window.Aura = (() => {
|
|
|
8070
8190
|
if ((!a || a === document.body || !a.isConnected) && back && back.isConnected) back.focus();
|
|
8071
8191
|
}, 0);
|
|
8072
8192
|
}
|
|
8073
|
-
return /* @__PURE__ */
|
|
8193
|
+
return /* @__PURE__ */ React48.createElement(
|
|
8074
8194
|
"div",
|
|
8075
8195
|
{
|
|
8076
8196
|
ref: function(el) {
|
|
@@ -8084,6 +8204,7 @@ window.Aura = (() => {
|
|
|
8084
8204
|
},
|
|
8085
8205
|
role: "region",
|
|
8086
8206
|
"aria-label": props.label || t.actions,
|
|
8207
|
+
"data-aura-hide-bottomnav": props.hidesBottomNav && !idle ? "" : void 0,
|
|
8087
8208
|
className: cx(
|
|
8088
8209
|
"aura-actionbar",
|
|
8089
8210
|
"aura-actionbar--" + (props.position || "viewport"),
|
|
@@ -8091,16 +8212,16 @@ window.Aura = (() => {
|
|
|
8091
8212
|
props.className
|
|
8092
8213
|
)
|
|
8093
8214
|
},
|
|
8094
|
-
/* @__PURE__ */
|
|
8215
|
+
/* @__PURE__ */ React48.createElement("div", { className: cx("aura-actionbar__inner", hasStart && "has-start") }, /* @__PURE__ */ React48.createElement("div", { className: "aura-actionbar__status", role: "status" }, count, count && props.status ? " \xB7 " : null, props.status), !idle && hasStart ? /* @__PURE__ */ React48.createElement("div", { className: "aura-actionbar__start" }, props.start) : null, !idle ? /* @__PURE__ */ React48.createElement("div", { className: "aura-actionbar__actions" }, count && props.onClearSelection ? /* @__PURE__ */ React48.createElement(Button, { variant: "ghost", size: "sm", touchHeight: props.touchHeight, onClick: clear }, t.clear()) : null, props.children) : null)
|
|
8095
8216
|
);
|
|
8096
8217
|
});
|
|
8097
8218
|
|
|
8098
8219
|
// src/Separator.tsx
|
|
8099
|
-
var
|
|
8100
|
-
var Separator =
|
|
8220
|
+
var React49 = __toESM(require_react(), 1);
|
|
8221
|
+
var Separator = React49.forwardRef(function Separator2(props, ref) {
|
|
8101
8222
|
const vertical = props.orientation === "vertical";
|
|
8102
8223
|
const decorative = props.decorative !== false;
|
|
8103
|
-
return /* @__PURE__ */
|
|
8224
|
+
return /* @__PURE__ */ React49.createElement(
|
|
8104
8225
|
"div",
|
|
8105
8226
|
{
|
|
8106
8227
|
ref,
|
|
@@ -8113,13 +8234,13 @@ window.Aura = (() => {
|
|
|
8113
8234
|
});
|
|
8114
8235
|
|
|
8115
8236
|
// src/Table.tsx
|
|
8116
|
-
var
|
|
8117
|
-
var StackLabels =
|
|
8118
|
-
var ColumnIndex =
|
|
8237
|
+
var React50 = __toESM(require_react(), 1);
|
|
8238
|
+
var StackLabels = React50.createContext(null);
|
|
8239
|
+
var ColumnIndex = React50.createContext(-1);
|
|
8119
8240
|
function flat2(children) {
|
|
8120
8241
|
const out = [];
|
|
8121
|
-
|
|
8122
|
-
if (
|
|
8242
|
+
React50.Children.toArray(children).forEach(function(c) {
|
|
8243
|
+
if (React50.isValidElement(c) && c.type === React50.Fragment)
|
|
8123
8244
|
out.push.apply(out, flat2(c.props.children));
|
|
8124
8245
|
else out.push(c);
|
|
8125
8246
|
});
|
|
@@ -8133,7 +8254,7 @@ window.Aura = (() => {
|
|
|
8133
8254
|
});
|
|
8134
8255
|
return parts.length ? parts.join("") : void 0;
|
|
8135
8256
|
}
|
|
8136
|
-
if (
|
|
8257
|
+
if (React50.isValidElement(node)) {
|
|
8137
8258
|
const p = node.props;
|
|
8138
8259
|
if (p["aria-hidden"] === true || p["aria-hidden"] === "true") return void 0;
|
|
8139
8260
|
return text(p.children);
|
|
@@ -8143,13 +8264,13 @@ window.Aura = (() => {
|
|
|
8143
8264
|
function headerLabels(children) {
|
|
8144
8265
|
let out = [];
|
|
8145
8266
|
flat2(children).forEach(function(c) {
|
|
8146
|
-
if (out.length || !
|
|
8267
|
+
if (out.length || !React50.isValidElement(c) || c.type !== THead) return;
|
|
8147
8268
|
const row = flat2(c.props.children).find(function(r2) {
|
|
8148
|
-
return
|
|
8269
|
+
return React50.isValidElement(r2);
|
|
8149
8270
|
});
|
|
8150
8271
|
if (!row) return;
|
|
8151
8272
|
flat2(row.props.children).forEach(function(cell) {
|
|
8152
|
-
if (!
|
|
8273
|
+
if (!React50.isValidElement(cell)) return;
|
|
8153
8274
|
const p = cell.props;
|
|
8154
8275
|
const t = text(p.children);
|
|
8155
8276
|
const label = p.label != null ? p.label : t != null ? t.replace(/\s+/g, " ").trim() || void 0 : void 0;
|
|
@@ -8159,7 +8280,7 @@ window.Aura = (() => {
|
|
|
8159
8280
|
});
|
|
8160
8281
|
return out;
|
|
8161
8282
|
}
|
|
8162
|
-
var Table =
|
|
8283
|
+
var Table = React50.forwardRef(function Table2(props, ref) {
|
|
8163
8284
|
const {
|
|
8164
8285
|
caption,
|
|
8165
8286
|
captionHidden,
|
|
@@ -8189,12 +8310,12 @@ window.Aura = (() => {
|
|
|
8189
8310
|
"tbl-stack-labels",
|
|
8190
8311
|
"Table stackBelow: no THead > Tr > Th found among its children, so cells have no labels. Pass `label` on each Td."
|
|
8191
8312
|
);
|
|
8192
|
-
const outer =
|
|
8313
|
+
const outer = React50.useContext(StackLabels);
|
|
8193
8314
|
const pageDensity = useDensity();
|
|
8194
8315
|
const capId = uid();
|
|
8195
|
-
const wrap =
|
|
8196
|
-
const sc =
|
|
8197
|
-
const wide =
|
|
8316
|
+
const wrap = React50.useRef(null);
|
|
8317
|
+
const sc = React50.useState(false), scrolls = sc[0];
|
|
8318
|
+
const wide = React50.useState(false);
|
|
8198
8319
|
useIsoLayoutEffect(function() {
|
|
8199
8320
|
const el = wrap.current;
|
|
8200
8321
|
if (!el || typeof ResizeObserver === "undefined") return;
|
|
@@ -8211,7 +8332,7 @@ window.Aura = (() => {
|
|
|
8211
8332
|
ro.disconnect();
|
|
8212
8333
|
};
|
|
8213
8334
|
}, []);
|
|
8214
|
-
const table = /* @__PURE__ */
|
|
8335
|
+
const table = /* @__PURE__ */ React50.createElement(
|
|
8215
8336
|
"div",
|
|
8216
8337
|
{
|
|
8217
8338
|
ref: wrap,
|
|
@@ -8235,7 +8356,7 @@ window.Aura = (() => {
|
|
|
8235
8356
|
"aria-labelledby": scrolls ? caption != null ? capId : rest["aria-labelledby"] : void 0,
|
|
8236
8357
|
"aria-label": scrolls && caption == null ? rest["aria-label"] : void 0
|
|
8237
8358
|
},
|
|
8238
|
-
/* @__PURE__ */
|
|
8359
|
+
/* @__PURE__ */ React50.createElement(
|
|
8239
8360
|
"table",
|
|
8240
8361
|
{
|
|
8241
8362
|
ref,
|
|
@@ -8251,11 +8372,11 @@ window.Aura = (() => {
|
|
|
8251
8372
|
role: stackBelow ? "table" : void 0,
|
|
8252
8373
|
...rest
|
|
8253
8374
|
},
|
|
8254
|
-
caption != null ? /* @__PURE__ */
|
|
8255
|
-
labels ? /* @__PURE__ */
|
|
8375
|
+
caption != null ? /* @__PURE__ */ React50.createElement("caption", { id: capId, className: cx("aura-tbl__caption", captionHidden && "aura-sr-only") }, caption) : null,
|
|
8376
|
+
labels ? /* @__PURE__ */ React50.createElement(StackLabels.Provider, { value: labels }, children) : outer ? /* @__PURE__ */ React50.createElement(StackLabels.Provider, { value: null }, children) : children
|
|
8256
8377
|
)
|
|
8257
8378
|
);
|
|
8258
|
-
return cards ? /* @__PURE__ */
|
|
8379
|
+
return cards ? /* @__PURE__ */ React50.createElement(
|
|
8259
8380
|
"div",
|
|
8260
8381
|
{
|
|
8261
8382
|
className: cx(
|
|
@@ -8268,10 +8389,10 @@ window.Aura = (() => {
|
|
|
8268
8389
|
) : table;
|
|
8269
8390
|
});
|
|
8270
8391
|
function section(tag, cls) {
|
|
8271
|
-
const C =
|
|
8392
|
+
const C = React50.forwardRef(function TableSection(props, ref) {
|
|
8272
8393
|
const { className, ...rest } = props;
|
|
8273
|
-
const stacked =
|
|
8274
|
-
return
|
|
8394
|
+
const stacked = React50.useContext(StackLabels) != null;
|
|
8395
|
+
return React50.createElement(
|
|
8275
8396
|
tag,
|
|
8276
8397
|
Object.assign({ ref, className: cx(cls, className), role: stacked ? "rowgroup" : void 0 }, rest)
|
|
8277
8398
|
);
|
|
@@ -8284,14 +8405,14 @@ window.Aura = (() => {
|
|
|
8284
8405
|
TBody.displayName = "TBody";
|
|
8285
8406
|
var TFoot = section("tfoot", "aura-tbl__foot");
|
|
8286
8407
|
TFoot.displayName = "TFoot";
|
|
8287
|
-
var Tr =
|
|
8408
|
+
var Tr = React50.forwardRef(function Tr2(props, ref) {
|
|
8288
8409
|
const { className, children, ...rest } = props;
|
|
8289
|
-
const stacked =
|
|
8410
|
+
const stacked = React50.useContext(StackLabels) != null;
|
|
8290
8411
|
let col = 0;
|
|
8291
|
-
return /* @__PURE__ */
|
|
8412
|
+
return /* @__PURE__ */ React50.createElement("tr", { ref, className: cx("aura-tbl__row", className), role: stacked ? "row" : void 0, ...rest }, stacked ? flat2(children).map(function(c) {
|
|
8292
8413
|
const at = col;
|
|
8293
|
-
if (
|
|
8294
|
-
return /* @__PURE__ */
|
|
8414
|
+
if (React50.isValidElement(c)) col += Math.max(1, Number(c.props.colSpan) || 1);
|
|
8415
|
+
return /* @__PURE__ */ React50.createElement(ColumnIndex.Provider, { key: React50.isValidElement(c) && c.key != null ? c.key : at, value: at }, c);
|
|
8295
8416
|
}) : children);
|
|
8296
8417
|
});
|
|
8297
8418
|
function cellClass(base, p) {
|
|
@@ -8305,10 +8426,10 @@ window.Aura = (() => {
|
|
|
8305
8426
|
p.className
|
|
8306
8427
|
);
|
|
8307
8428
|
}
|
|
8308
|
-
var Th =
|
|
8429
|
+
var Th = React50.forwardRef(function Th2(props, ref) {
|
|
8309
8430
|
const { align, numeric, mono, className, scope, label, card, ...rest } = props;
|
|
8310
|
-
const stacked =
|
|
8311
|
-
return /* @__PURE__ */
|
|
8431
|
+
const stacked = React50.useContext(StackLabels) != null;
|
|
8432
|
+
return /* @__PURE__ */ React50.createElement(
|
|
8312
8433
|
"th",
|
|
8313
8434
|
{
|
|
8314
8435
|
ref,
|
|
@@ -8320,12 +8441,12 @@ window.Aura = (() => {
|
|
|
8320
8441
|
}
|
|
8321
8442
|
);
|
|
8322
8443
|
});
|
|
8323
|
-
var Td =
|
|
8444
|
+
var Td = React50.forwardRef(function Td2(props, ref) {
|
|
8324
8445
|
const { align, numeric, mono, className, scope, label, card, ...rest } = props;
|
|
8325
|
-
const labels =
|
|
8446
|
+
const labels = React50.useContext(StackLabels), col = React50.useContext(ColumnIndex);
|
|
8326
8447
|
const slot = labels && (card === "title" || card === "action") ? card : void 0;
|
|
8327
8448
|
const shown = labels && !slot ? label != null ? label : col >= 0 ? labels[col] : void 0 : void 0;
|
|
8328
|
-
return /* @__PURE__ */
|
|
8449
|
+
return /* @__PURE__ */ React50.createElement(
|
|
8329
8450
|
"td",
|
|
8330
8451
|
{
|
|
8331
8452
|
ref,
|
|
@@ -8339,8 +8460,8 @@ window.Aura = (() => {
|
|
|
8339
8460
|
});
|
|
8340
8461
|
|
|
8341
8462
|
// src/BottomNav.tsx
|
|
8342
|
-
var
|
|
8343
|
-
var BottomNav =
|
|
8463
|
+
var React51 = __toESM(require_react(), 1);
|
|
8464
|
+
var BottomNav = React51.forwardRef(function BottomNav2(props, ref) {
|
|
8344
8465
|
const t = useStrings();
|
|
8345
8466
|
const Link = useLinkComponent(props.linkComponent);
|
|
8346
8467
|
const st = useMaybeControlled(
|
|
@@ -8350,14 +8471,36 @@ window.Aura = (() => {
|
|
|
8350
8471
|
);
|
|
8351
8472
|
const active = st[0];
|
|
8352
8473
|
const hide2 = props.hideFrom === false ? "always" : "below-" + (props.hideFrom || "lg");
|
|
8353
|
-
|
|
8474
|
+
const own = React51.useRef(null);
|
|
8475
|
+
const hf = props.hideFrom === false ? null : props.hideFrom || "lg";
|
|
8476
|
+
const away = useHideOnScroll(
|
|
8477
|
+
!!props.hideOnScroll,
|
|
8478
|
+
own,
|
|
8479
|
+
hf ? "(max-width: " + (breakpoints[hf] - 0.02) + "px)" : "all",
|
|
8480
|
+
64
|
|
8481
|
+
);
|
|
8482
|
+
const setRef = React51.useCallback(
|
|
8483
|
+
function(el) {
|
|
8484
|
+
own.current = el;
|
|
8485
|
+
if (typeof ref === "function") ref(el);
|
|
8486
|
+
else if (ref) ref.current = el;
|
|
8487
|
+
},
|
|
8488
|
+
[ref]
|
|
8489
|
+
);
|
|
8490
|
+
return /* @__PURE__ */ React51.createElement(React51.Fragment, null, /* @__PURE__ */ React51.createElement("div", { className: cx("aura-bottomnav-spacer", "aura-bottomnav--" + hide2), "aria-hidden": "true" }), /* @__PURE__ */ React51.createElement(
|
|
8354
8491
|
"nav",
|
|
8355
8492
|
{
|
|
8356
|
-
ref,
|
|
8357
|
-
className: cx(
|
|
8493
|
+
ref: setRef,
|
|
8494
|
+
className: cx(
|
|
8495
|
+
"aura-bottomnav",
|
|
8496
|
+
"aura-bottomnav--" + hide2,
|
|
8497
|
+
props.hideOnScroll && "aura-bottomnav--hides",
|
|
8498
|
+
away && "is-away",
|
|
8499
|
+
props.className
|
|
8500
|
+
),
|
|
8358
8501
|
"aria-label": props.label || t.mainNav
|
|
8359
8502
|
},
|
|
8360
|
-
/* @__PURE__ */
|
|
8503
|
+
/* @__PURE__ */ React51.createElement("ul", { className: "aura-bottomnav__list" }, props.items.map(function(it) {
|
|
8361
8504
|
if (it.ariaLabel && typeof it.label === "string" && it.ariaLabel.toLowerCase().indexOf(it.label.toLowerCase()) < 0)
|
|
8362
8505
|
devWarnOnce(
|
|
8363
8506
|
"bottomnav-label-" + it.id,
|
|
@@ -8378,20 +8521,20 @@ window.Aura = (() => {
|
|
|
8378
8521
|
}
|
|
8379
8522
|
};
|
|
8380
8523
|
const inner = [
|
|
8381
|
-
/* @__PURE__ */
|
|
8382
|
-
it.ariaLabel ? /* @__PURE__ */
|
|
8383
|
-
/* @__PURE__ */
|
|
8384
|
-
suffix && !it.ariaLabel ? /* @__PURE__ */
|
|
8524
|
+
/* @__PURE__ */ React51.createElement("span", { key: "i", className: "aura-bottomnav__icon" }, /* @__PURE__ */ React51.createElement(Icon, { name: it.icon, size: "md" }), count ? /* @__PURE__ */ React51.createElement("span", { className: "aura-bottomnav__count", "aria-hidden": "true" }, count) : it.badge ? /* @__PURE__ */ React51.createElement("span", { className: "aura-bottomnav__dot", "aria-hidden": "true" }) : null),
|
|
8525
|
+
it.ariaLabel ? /* @__PURE__ */ React51.createElement("span", { key: "n", className: "aura-sr-only" }, it.ariaLabel + suffix) : null,
|
|
8526
|
+
/* @__PURE__ */ React51.createElement("span", { key: "l", className: "aura-bottomnav__label", "aria-hidden": it.ariaLabel ? true : void 0 }, it.label),
|
|
8527
|
+
suffix && !it.ariaLabel ? /* @__PURE__ */ React51.createElement("span", { key: "s", className: "aura-sr-only" }, suffix) : null
|
|
8385
8528
|
];
|
|
8386
|
-
return /* @__PURE__ */
|
|
8529
|
+
return /* @__PURE__ */ React51.createElement("li", { key: it.id, className: "aura-bottomnav__cell" }, it.href ? /* @__PURE__ */ React51.createElement(Link, { href: it.href, ...common }, inner) : /* @__PURE__ */ React51.createElement("button", { type: "button", ...common }, inner));
|
|
8387
8530
|
}))
|
|
8388
8531
|
));
|
|
8389
8532
|
});
|
|
8390
8533
|
|
|
8391
8534
|
// src/Surface.tsx
|
|
8392
|
-
var
|
|
8393
|
-
var h10 =
|
|
8394
|
-
var Surface =
|
|
8535
|
+
var React52 = __toESM(require_react(), 1);
|
|
8536
|
+
var h10 = React52.createElement;
|
|
8537
|
+
var Surface = React52.forwardRef(function Surface2(props, ref) {
|
|
8395
8538
|
const t = props.texture || "mesh";
|
|
8396
8539
|
const rest = omit(props, ["texture", "className", "children", "as"]);
|
|
8397
8540
|
return h10(
|
|
@@ -8412,14 +8555,14 @@ window.Aura = (() => {
|
|
|
8412
8555
|
});
|
|
8413
8556
|
|
|
8414
8557
|
// src/Stat.tsx
|
|
8415
|
-
var
|
|
8416
|
-
var Stat =
|
|
8558
|
+
var React53 = __toESM(require_react(), 1);
|
|
8559
|
+
var Stat = React53.forwardRef(function Stat2(props, ref) {
|
|
8417
8560
|
const Link = useLinkComponent(props.linkComponent);
|
|
8418
8561
|
return statElement(props, ref, Link);
|
|
8419
8562
|
});
|
|
8420
8563
|
|
|
8421
8564
|
// src/TimePicker.tsx
|
|
8422
|
-
var
|
|
8565
|
+
var React54 = __toESM(require_react(), 1);
|
|
8423
8566
|
var import_react_dom12 = __toESM(require_react_dom(), 1);
|
|
8424
8567
|
|
|
8425
8568
|
// src/text.ts
|
|
@@ -8461,7 +8604,7 @@ window.Aura = (() => {
|
|
|
8461
8604
|
function fromMin(n3) {
|
|
8462
8605
|
return pad3(Math.floor(n3 / 60)) + ":" + pad3(n3 % 60);
|
|
8463
8606
|
}
|
|
8464
|
-
var TimePicker =
|
|
8607
|
+
var TimePicker = React54.forwardRef(function TimePicker2(props, ref) {
|
|
8465
8608
|
const t = useStrings();
|
|
8466
8609
|
const auto = uid(), id = props.id || auto, listId = id + "-list";
|
|
8467
8610
|
const st = useMaybeControlled(
|
|
@@ -8471,7 +8614,7 @@ window.Aura = (() => {
|
|
|
8471
8614
|
);
|
|
8472
8615
|
const value = st[0];
|
|
8473
8616
|
const step = props.step || 30, lo = toMin(props.min) != null ? toMin(props.min) : 0, hi = toMin(props.max) != null ? toMin(props.max) : 24 * 60 - 1;
|
|
8474
|
-
const slots =
|
|
8617
|
+
const slots = React54.useMemo(
|
|
8475
8618
|
function() {
|
|
8476
8619
|
const out = [];
|
|
8477
8620
|
for (let m = lo; m <= hi; m += step) out.push(fromMin(m));
|
|
@@ -8483,12 +8626,12 @@ window.Aura = (() => {
|
|
|
8483
8626
|
const n3 = toMin(v);
|
|
8484
8627
|
return n3 == null || n3 < lo || n3 > hi || props.isTimeDisabled && props.isTimeDisabled(v);
|
|
8485
8628
|
}
|
|
8486
|
-
const openState =
|
|
8487
|
-
const editState =
|
|
8488
|
-
const aState =
|
|
8489
|
-
const errState =
|
|
8490
|
-
const pos =
|
|
8491
|
-
const boxRef =
|
|
8629
|
+
const openState = React54.useState(false), open = openState[0], setOpen = openState[1];
|
|
8630
|
+
const editState = React54.useState(null), editing = editState[0], setEditing = editState[1];
|
|
8631
|
+
const aState = React54.useState(0), active = aState[0], setActive = aState[1];
|
|
8632
|
+
const errState = React54.useState(null);
|
|
8633
|
+
const pos = React54.useState(null);
|
|
8634
|
+
const boxRef = React54.useRef(null), inputRef = React54.useRef(null), listRef = React54.useRef(null), inputMerged = useMergedRef(ref, inputRef);
|
|
8492
8635
|
const mounted = useMounted();
|
|
8493
8636
|
function nearest(v) {
|
|
8494
8637
|
const n3 = toMin(v);
|
|
@@ -8516,7 +8659,7 @@ window.Aura = (() => {
|
|
|
8516
8659
|
},
|
|
8517
8660
|
[open]
|
|
8518
8661
|
);
|
|
8519
|
-
|
|
8662
|
+
React54.useEffect(
|
|
8520
8663
|
function() {
|
|
8521
8664
|
if (!open) return;
|
|
8522
8665
|
function outside(e) {
|
|
@@ -8538,7 +8681,7 @@ window.Aura = (() => {
|
|
|
8538
8681
|
},
|
|
8539
8682
|
[open]
|
|
8540
8683
|
);
|
|
8541
|
-
|
|
8684
|
+
React54.useEffect(
|
|
8542
8685
|
function() {
|
|
8543
8686
|
if (!open || !listRef.current) return;
|
|
8544
8687
|
const el = listRef.current.querySelector('[data-idx="' + active + '"]');
|
|
@@ -8637,9 +8780,9 @@ window.Aura = (() => {
|
|
|
8637
8780
|
}
|
|
8638
8781
|
const error = errState[0] || props.error;
|
|
8639
8782
|
const list = open && mounted && pos[0] ? (0, import_react_dom12.createPortal)(
|
|
8640
|
-
/* @__PURE__ */
|
|
8783
|
+
/* @__PURE__ */ React54.createElement("div", { ref: listRef, className: "aura-combo__popover aura-time__popover", style: pos[0] }, /* @__PURE__ */ React54.createElement("ul", { id: listId, role: "listbox", "aria-label": props.label, className: "aura-combo__list" }, slots.map(function(s, i) {
|
|
8641
8784
|
const dis = blocked(s), sel = s === value;
|
|
8642
|
-
return /* @__PURE__ */
|
|
8785
|
+
return /* @__PURE__ */ React54.createElement(
|
|
8643
8786
|
"li",
|
|
8644
8787
|
{
|
|
8645
8788
|
key: s,
|
|
@@ -8664,13 +8807,13 @@ window.Aura = (() => {
|
|
|
8664
8807
|
if (active !== i) setActive(i);
|
|
8665
8808
|
}
|
|
8666
8809
|
},
|
|
8667
|
-
/* @__PURE__ */
|
|
8668
|
-
sel ? /* @__PURE__ */
|
|
8810
|
+
/* @__PURE__ */ React54.createElement("span", { className: "aura-combo__label" }, s),
|
|
8811
|
+
sel ? /* @__PURE__ */ React54.createElement(Icon, { name: /* @__PURE__ */ React54.createElement(IconCheck, null), className: "aura-combo__check" }) : null
|
|
8669
8812
|
);
|
|
8670
8813
|
}))),
|
|
8671
8814
|
document.body
|
|
8672
8815
|
) : null;
|
|
8673
|
-
return /* @__PURE__ */
|
|
8816
|
+
return /* @__PURE__ */ React54.createElement(
|
|
8674
8817
|
Field,
|
|
8675
8818
|
{
|
|
8676
8819
|
id,
|
|
@@ -8682,7 +8825,7 @@ window.Aura = (() => {
|
|
|
8682
8825
|
disabled: props.disabled,
|
|
8683
8826
|
className: props.className
|
|
8684
8827
|
},
|
|
8685
|
-
/* @__PURE__ */
|
|
8828
|
+
/* @__PURE__ */ React54.createElement("div", { ref: boxRef, className: cx("aura-input aura-combo aura-time has-icon", open && "is-open") }, /* @__PURE__ */ React54.createElement(Icon, { name: /* @__PURE__ */ React54.createElement(IconClock, null), className: "aura-input__icon" }), /* @__PURE__ */ React54.createElement(
|
|
8686
8829
|
"input",
|
|
8687
8830
|
{
|
|
8688
8831
|
ref: inputMerged,
|
|
@@ -8722,7 +8865,7 @@ window.Aura = (() => {
|
|
|
8722
8865
|
}, 0);
|
|
8723
8866
|
}
|
|
8724
8867
|
}
|
|
8725
|
-
), props.clearable !== false && value != null && !props.disabled ? /* @__PURE__ */
|
|
8868
|
+
), props.clearable !== false && value != null && !props.disabled ? /* @__PURE__ */ React54.createElement(
|
|
8726
8869
|
"button",
|
|
8727
8870
|
{
|
|
8728
8871
|
type: "button",
|
|
@@ -8735,8 +8878,8 @@ window.Aura = (() => {
|
|
|
8735
8878
|
if (inputRef.current) inputRef.current.focus();
|
|
8736
8879
|
}
|
|
8737
8880
|
},
|
|
8738
|
-
/* @__PURE__ */
|
|
8739
|
-
) : null, /* @__PURE__ */
|
|
8881
|
+
/* @__PURE__ */ React54.createElement(Icon, { name: /* @__PURE__ */ React54.createElement(IconX, null) })
|
|
8882
|
+
) : null, /* @__PURE__ */ React54.createElement(
|
|
8740
8883
|
"button",
|
|
8741
8884
|
{
|
|
8742
8885
|
type: "button",
|
|
@@ -8754,14 +8897,14 @@ window.Aura = (() => {
|
|
|
8754
8897
|
}
|
|
8755
8898
|
}
|
|
8756
8899
|
},
|
|
8757
|
-
/* @__PURE__ */
|
|
8900
|
+
/* @__PURE__ */ React54.createElement(Icon, { name: /* @__PURE__ */ React54.createElement(IconChevronDown, null) })
|
|
8758
8901
|
)),
|
|
8759
8902
|
list
|
|
8760
8903
|
);
|
|
8761
8904
|
});
|
|
8762
8905
|
|
|
8763
8906
|
// src/FileUpload.tsx
|
|
8764
|
-
var
|
|
8907
|
+
var React55 = __toESM(require_react(), 1);
|
|
8765
8908
|
function matches(file, accept) {
|
|
8766
8909
|
if (!accept) return true;
|
|
8767
8910
|
const name = (file.name || "").toLowerCase(), type = (file.type || "").toLowerCase();
|
|
@@ -8785,24 +8928,24 @@ window.Aura = (() => {
|
|
|
8785
8928
|
}).join(", ");
|
|
8786
8929
|
}
|
|
8787
8930
|
var seq = 0;
|
|
8788
|
-
var FileUpload =
|
|
8931
|
+
var FileUpload = React55.forwardRef(function FileUpload2(props, ref) {
|
|
8789
8932
|
const t = useStrings();
|
|
8790
8933
|
const auto = uid(), id = props.id || auto;
|
|
8791
8934
|
const st = useMaybeControlled(props.value, props.defaultValue || [], props.onChange);
|
|
8792
8935
|
const items2 = st[0] || [];
|
|
8793
|
-
const dragState =
|
|
8794
|
-
const inputRef =
|
|
8795
|
-
const urls =
|
|
8936
|
+
const dragState = React55.useState(false), over = dragState[0];
|
|
8937
|
+
const inputRef = React55.useRef(null), inputMerged = useMergedRef(ref, inputRef);
|
|
8938
|
+
const urls = React55.useRef({});
|
|
8796
8939
|
const maxFiles = props.multiple ? props.maxFiles : 1;
|
|
8797
8940
|
const note = t.accepts(describeAccept(props.accept, t), props.maxSize ? formatBytes(props.maxSize) : "");
|
|
8798
|
-
|
|
8941
|
+
React55.useEffect(function() {
|
|
8799
8942
|
return function() {
|
|
8800
8943
|
Object.keys(urls.current).forEach(function(k) {
|
|
8801
8944
|
URL.revokeObjectURL(urls.current[k]);
|
|
8802
8945
|
});
|
|
8803
8946
|
};
|
|
8804
8947
|
}, []);
|
|
8805
|
-
|
|
8948
|
+
React55.useEffect(
|
|
8806
8949
|
function() {
|
|
8807
8950
|
const el = inputRef.current;
|
|
8808
8951
|
if (!el || !props.name || typeof DataTransfer === "undefined") return;
|
|
@@ -8862,7 +9005,7 @@ window.Aura = (() => {
|
|
|
8862
9005
|
if (inputRef.current) inputRef.current.focus();
|
|
8863
9006
|
}
|
|
8864
9007
|
const error = props.error;
|
|
8865
|
-
return /* @__PURE__ */
|
|
9008
|
+
return /* @__PURE__ */ React55.createElement(
|
|
8866
9009
|
Field,
|
|
8867
9010
|
{
|
|
8868
9011
|
id,
|
|
@@ -8874,7 +9017,7 @@ window.Aura = (() => {
|
|
|
8874
9017
|
disabled: props.disabled,
|
|
8875
9018
|
className: props.className
|
|
8876
9019
|
},
|
|
8877
|
-
/* @__PURE__ */
|
|
9020
|
+
/* @__PURE__ */ React55.createElement(
|
|
8878
9021
|
"div",
|
|
8879
9022
|
{
|
|
8880
9023
|
className: cx("aura-upload", over && "is-over", props.disabled && "is-disabled", error && "is-invalid"),
|
|
@@ -8895,9 +9038,9 @@ window.Aura = (() => {
|
|
|
8895
9038
|
add(e.dataTransfer && e.dataTransfer.files);
|
|
8896
9039
|
}
|
|
8897
9040
|
},
|
|
8898
|
-
/* @__PURE__ */
|
|
8899
|
-
/* @__PURE__ */
|
|
8900
|
-
/* @__PURE__ */
|
|
9041
|
+
/* @__PURE__ */ React55.createElement(Icon, { name: /* @__PURE__ */ React55.createElement(IconCloudUpload, null), size: "lg", className: "aura-upload__icon" }),
|
|
9042
|
+
/* @__PURE__ */ React55.createElement("span", { className: "aura-upload__text" }, t.dropFiles, " "),
|
|
9043
|
+
/* @__PURE__ */ React55.createElement(
|
|
8901
9044
|
"input",
|
|
8902
9045
|
{
|
|
8903
9046
|
ref: inputMerged,
|
|
@@ -8919,12 +9062,12 @@ window.Aura = (() => {
|
|
|
8919
9062
|
}
|
|
8920
9063
|
}
|
|
8921
9064
|
),
|
|
8922
|
-
/* @__PURE__ */
|
|
8923
|
-
note ? /* @__PURE__ */
|
|
9065
|
+
/* @__PURE__ */ React55.createElement("span", { className: "aura-upload__browse", "aria-hidden": true }, props.multiple ? t.browse : t.browseOne),
|
|
9066
|
+
note ? /* @__PURE__ */ React55.createElement("span", { className: "aura-upload__note", id: id + "-note" }, note) : null
|
|
8924
9067
|
),
|
|
8925
|
-
items2.length ? /* @__PURE__ */
|
|
9068
|
+
items2.length ? /* @__PURE__ */ React55.createElement("ul", { className: "aura-upload__list", "aria-live": "polite" }, items2.map(function(it) {
|
|
8926
9069
|
const src = thumb(it);
|
|
8927
|
-
return /* @__PURE__ */
|
|
9070
|
+
return /* @__PURE__ */ React55.createElement("li", { key: it.id, className: cx("aura-upload__item", it.error && "is-error") }, src ? /* @__PURE__ */ React55.createElement("img", { className: "aura-upload__thumb", src, alt: "" }) : /* @__PURE__ */ React55.createElement("span", { className: "aura-upload__thumb is-icon", "aria-hidden": true }, /* @__PURE__ */ React55.createElement(Icon, { name: /^image\//.test(it.type || "") ? /* @__PURE__ */ React55.createElement(IconImage, null) : /* @__PURE__ */ React55.createElement(IconFile, null), size: "md" })), /* @__PURE__ */ React55.createElement("span", { className: "aura-upload__meta" }, it.url && !it.error ? /* @__PURE__ */ React55.createElement("a", { className: "aura-upload__name", href: it.url, target: "_blank", rel: "noreferrer" }, it.name) : /* @__PURE__ */ React55.createElement("span", { className: "aura-upload__name" }, it.name), /* @__PURE__ */ React55.createElement("span", { className: "aura-upload__sub" }, it.error ? /* @__PURE__ */ React55.createElement(React55.Fragment, null, /* @__PURE__ */ React55.createElement(Icon, { name: /* @__PURE__ */ React55.createElement(IconCircleAlert, null), size: 12 }), it.error) : it.status === "uploading" ? t.uploading + (it.progress != null ? " " + Math.round(it.progress) + "%" : "") : it.status === "done" ? /* @__PURE__ */ React55.createElement(React55.Fragment, null, /* @__PURE__ */ React55.createElement(Icon, { name: /* @__PURE__ */ React55.createElement(IconCircleCheck, null), size: 12 }), formatBytes(it.size)) : formatBytes(it.size)), it.status === "uploading" ? /* @__PURE__ */ React55.createElement(
|
|
8928
9071
|
"span",
|
|
8929
9072
|
{
|
|
8930
9073
|
className: "aura-upload__bar",
|
|
@@ -8934,11 +9077,11 @@ window.Aura = (() => {
|
|
|
8934
9077
|
"aria-valuemax": 100,
|
|
8935
9078
|
"aria-valuenow": it.progress != null ? Math.round(it.progress) : void 0
|
|
8936
9079
|
},
|
|
8937
|
-
/* @__PURE__ */
|
|
8938
|
-
) : null), /* @__PURE__ */
|
|
9080
|
+
/* @__PURE__ */ React55.createElement("span", { style: { width: (it.progress || 0) + "%" } })
|
|
9081
|
+
) : null), /* @__PURE__ */ React55.createElement(
|
|
8939
9082
|
IconButton,
|
|
8940
9083
|
{
|
|
8941
|
-
icon: /* @__PURE__ */
|
|
9084
|
+
icon: /* @__PURE__ */ React55.createElement(IconX, null),
|
|
8942
9085
|
label: t.remove(it.name),
|
|
8943
9086
|
onClick: function() {
|
|
8944
9087
|
remove(it);
|
|
@@ -9254,9 +9397,9 @@ window.Aura = (() => {
|
|
|
9254
9397
|
}
|
|
9255
9398
|
|
|
9256
9399
|
// src/ThemeStyle.tsx
|
|
9257
|
-
var
|
|
9400
|
+
var React56 = __toESM(require_react(), 1);
|
|
9258
9401
|
function ThemeStyle(props) {
|
|
9259
|
-
const css =
|
|
9402
|
+
const css = React56.useMemo(
|
|
9260
9403
|
function() {
|
|
9261
9404
|
try {
|
|
9262
9405
|
return createTheme({
|
|
@@ -9273,11 +9416,11 @@ window.Aura = (() => {
|
|
|
9273
9416
|
[props.brand, props.signal, props.primary, props.name, props.selector]
|
|
9274
9417
|
);
|
|
9275
9418
|
if (css === null) return null;
|
|
9276
|
-
return /* @__PURE__ */
|
|
9419
|
+
return /* @__PURE__ */ React56.createElement("style", { "data-aura-theme": props.name || props.brand, dangerouslySetInnerHTML: { __html: css } });
|
|
9277
9420
|
}
|
|
9278
9421
|
|
|
9279
9422
|
// src/colorScheme.tsx
|
|
9280
|
-
var
|
|
9423
|
+
var React57 = __toESM(require_react(), 1);
|
|
9281
9424
|
|
|
9282
9425
|
// src/colorSchemeScript.ts
|
|
9283
9426
|
var DEFAULT_KEY = "aura-color-scheme";
|
|
@@ -9294,7 +9437,7 @@ window.Aura = (() => {
|
|
|
9294
9437
|
|
|
9295
9438
|
// src/colorScheme.tsx
|
|
9296
9439
|
function ColorSchemeScript(props) {
|
|
9297
|
-
return /* @__PURE__ */
|
|
9440
|
+
return /* @__PURE__ */ React57.createElement(
|
|
9298
9441
|
"script",
|
|
9299
9442
|
{
|
|
9300
9443
|
"data-aura-color-scheme": "",
|
|
@@ -9319,7 +9462,7 @@ window.Aura = (() => {
|
|
|
9319
9462
|
function useColorScheme(options) {
|
|
9320
9463
|
const key = options && options.storageKey || DEFAULT_KEY;
|
|
9321
9464
|
const fallback = options && options.defaultScheme || "system";
|
|
9322
|
-
const subscribe2 =
|
|
9465
|
+
const subscribe2 = React57.useCallback(
|
|
9323
9466
|
function(cb) {
|
|
9324
9467
|
const mq = window.matchMedia ? window.matchMedia("(prefers-color-scheme: dark)") : null;
|
|
9325
9468
|
function onSystem() {
|
|
@@ -9341,7 +9484,7 @@ window.Aura = (() => {
|
|
|
9341
9484
|
},
|
|
9342
9485
|
[fallback, key]
|
|
9343
9486
|
);
|
|
9344
|
-
const snapshot =
|
|
9487
|
+
const snapshot = React57.useSyncExternalStore(
|
|
9345
9488
|
subscribe2,
|
|
9346
9489
|
function() {
|
|
9347
9490
|
const s = readScheme(fallback);
|
|
@@ -9352,7 +9495,7 @@ window.Aura = (() => {
|
|
|
9352
9495
|
}
|
|
9353
9496
|
);
|
|
9354
9497
|
const parts = snapshot.split("|");
|
|
9355
|
-
const setScheme =
|
|
9498
|
+
const setScheme = React57.useCallback(
|
|
9356
9499
|
function(next) {
|
|
9357
9500
|
if (!valid(next)) return;
|
|
9358
9501
|
try {
|
|
@@ -9371,14 +9514,14 @@ window.Aura = (() => {
|
|
|
9371
9514
|
const cs = useColorScheme(props);
|
|
9372
9515
|
const names = { light: t.schemeLight, dark: t.schemeDark, system: t.schemeSystem };
|
|
9373
9516
|
const label = props.label || t.colorScheme;
|
|
9374
|
-
return /* @__PURE__ */
|
|
9517
|
+
return /* @__PURE__ */ React57.createElement(
|
|
9375
9518
|
DropdownMenu,
|
|
9376
9519
|
{
|
|
9377
9520
|
label,
|
|
9378
|
-
trigger: /* @__PURE__ */
|
|
9521
|
+
trigger: /* @__PURE__ */ React57.createElement(
|
|
9379
9522
|
IconButton,
|
|
9380
9523
|
{
|
|
9381
|
-
icon: cs.resolved === "dark" ? /* @__PURE__ */
|
|
9524
|
+
icon: cs.resolved === "dark" ? /* @__PURE__ */ React57.createElement(IconMoon, null) : /* @__PURE__ */ React57.createElement(IconSun, null),
|
|
9382
9525
|
label: label + ": " + names[cs.scheme]
|
|
9383
9526
|
}
|
|
9384
9527
|
),
|
|
@@ -9396,14 +9539,14 @@ window.Aura = (() => {
|
|
|
9396
9539
|
}
|
|
9397
9540
|
|
|
9398
9541
|
// src/Badge.tsx
|
|
9399
|
-
var
|
|
9400
|
-
var Badge =
|
|
9542
|
+
var React58 = __toESM(require_react(), 1);
|
|
9543
|
+
var Badge = React58.forwardRef(function Badge2(props, ref) {
|
|
9401
9544
|
return badgeElement(props, ref);
|
|
9402
9545
|
});
|
|
9403
9546
|
|
|
9404
9547
|
// src/Progress.tsx
|
|
9405
|
-
var
|
|
9406
|
-
var Progress =
|
|
9548
|
+
var React59 = __toESM(require_react(), 1);
|
|
9549
|
+
var Progress = React59.forwardRef(function Progress2(props, ref) {
|
|
9407
9550
|
const t = useStrings();
|
|
9408
9551
|
const auto = uid(), id = props.id || auto;
|
|
9409
9552
|
const max = props.max || 100, det = props.value != null;
|
|
@@ -9412,7 +9555,7 @@ window.Aura = (() => {
|
|
|
9412
9555
|
const spct = sec ? Math.max(0, Math.min(100 - pct, sec / max * 100)) : 0;
|
|
9413
9556
|
const valueText = props.valueText != null ? props.valueText : props.valueLabel != null ? String(props.valueLabel) : sec ? t.progressReserved(props.value, sec, max) : void 0;
|
|
9414
9557
|
const shown = props.valueLabel != null ? props.valueLabel : det ? Math.round(pct) + "%" : null;
|
|
9415
|
-
return /* @__PURE__ */
|
|
9558
|
+
return /* @__PURE__ */ React59.createElement(
|
|
9416
9559
|
"div",
|
|
9417
9560
|
{
|
|
9418
9561
|
ref,
|
|
@@ -9423,8 +9566,8 @@ window.Aura = (() => {
|
|
|
9423
9566
|
props.className
|
|
9424
9567
|
)
|
|
9425
9568
|
},
|
|
9426
|
-
props.label || props.showValue && shown ? /* @__PURE__ */
|
|
9427
|
-
/* @__PURE__ */
|
|
9569
|
+
props.label || props.showValue && shown ? /* @__PURE__ */ React59.createElement("div", { className: "aura-progress__head" }, props.label ? /* @__PURE__ */ React59.createElement("span", { className: "aura-progress__label", id: id + "-label" }, props.label) : /* @__PURE__ */ React59.createElement("span", null), props.showValue && shown ? /* @__PURE__ */ React59.createElement("span", { className: "aura-progress__value" }, shown) : null) : null,
|
|
9570
|
+
/* @__PURE__ */ React59.createElement(
|
|
9428
9571
|
"div",
|
|
9429
9572
|
{
|
|
9430
9573
|
className: cx("aura-progress__track", !det && "is-indeterminate"),
|
|
@@ -9436,8 +9579,8 @@ window.Aura = (() => {
|
|
|
9436
9579
|
"aria-valuenow": det ? props.value : void 0,
|
|
9437
9580
|
"aria-valuetext": det ? valueText : void 0
|
|
9438
9581
|
},
|
|
9439
|
-
/* @__PURE__ */
|
|
9440
|
-
sec ? /* @__PURE__ */
|
|
9582
|
+
/* @__PURE__ */ React59.createElement("span", { className: "aura-progress__bar", style: det ? { width: pct + "%" } : void 0 }),
|
|
9583
|
+
sec ? /* @__PURE__ */ React59.createElement(
|
|
9441
9584
|
"span",
|
|
9442
9585
|
{
|
|
9443
9586
|
className: "aura-progress__bar aura-progress__bar--reserved",
|
|
@@ -9445,19 +9588,19 @@ window.Aura = (() => {
|
|
|
9445
9588
|
}
|
|
9446
9589
|
) : null
|
|
9447
9590
|
),
|
|
9448
|
-
props.hint ? /* @__PURE__ */
|
|
9591
|
+
props.hint ? /* @__PURE__ */ React59.createElement("p", { className: "aura-progress__hint" }, props.hint) : null
|
|
9449
9592
|
);
|
|
9450
9593
|
});
|
|
9451
9594
|
|
|
9452
9595
|
// src/Skeleton.tsx
|
|
9453
|
-
var
|
|
9454
|
-
var Skeleton =
|
|
9596
|
+
var React60 = __toESM(require_react(), 1);
|
|
9597
|
+
var Skeleton = React60.forwardRef(function Skeleton2(props, ref) {
|
|
9455
9598
|
const v = props.variant || "text";
|
|
9456
9599
|
if (v === "text" && (props.lines || 1) > 1) {
|
|
9457
9600
|
const n3 = props.lines, rows = [];
|
|
9458
9601
|
for (let i = 0; i < n3; i++)
|
|
9459
|
-
rows.push(/* @__PURE__ */
|
|
9460
|
-
return /* @__PURE__ */
|
|
9602
|
+
rows.push(/* @__PURE__ */ React60.createElement("span", { key: i, className: "aura-skel aura-skel--text", style: { width: i === n3 - 1 ? "60%" : "100%" } }));
|
|
9603
|
+
return /* @__PURE__ */ React60.createElement(
|
|
9461
9604
|
"span",
|
|
9462
9605
|
{
|
|
9463
9606
|
ref,
|
|
@@ -9475,17 +9618,17 @@ window.Aura = (() => {
|
|
|
9475
9618
|
if (v === "circle") {
|
|
9476
9619
|
style.width = style.height = props.size || props.width || 40;
|
|
9477
9620
|
}
|
|
9478
|
-
return /* @__PURE__ */
|
|
9621
|
+
return /* @__PURE__ */ React60.createElement("span", { ref, "aria-hidden": true, className: cx("aura-skel", "aura-skel--" + v, props.className), style });
|
|
9479
9622
|
});
|
|
9480
9623
|
|
|
9481
9624
|
// src/EmptyState.tsx
|
|
9482
|
-
var
|
|
9483
|
-
var EmptyState =
|
|
9625
|
+
var React61 = __toESM(require_react(), 1);
|
|
9626
|
+
var EmptyState = React61.forwardRef(function EmptyState2(props, ref) {
|
|
9484
9627
|
return emptyStateElement(props, ref);
|
|
9485
9628
|
});
|
|
9486
9629
|
|
|
9487
9630
|
// src/Pagination.tsx
|
|
9488
|
-
var
|
|
9631
|
+
var React62 = __toESM(require_react(), 1);
|
|
9489
9632
|
function pageList(page, count, sib) {
|
|
9490
9633
|
let out = [], lo = Math.max(2, page - sib), hi = Math.min(count - 1, page + sib);
|
|
9491
9634
|
if (page - sib <= 3) {
|
|
@@ -9505,7 +9648,7 @@ window.Aura = (() => {
|
|
|
9505
9648
|
if (count > 1) out.push(count);
|
|
9506
9649
|
return out;
|
|
9507
9650
|
}
|
|
9508
|
-
var Pagination =
|
|
9651
|
+
var Pagination = React62.forwardRef(function Pagination2(props, ref) {
|
|
9509
9652
|
const t = useStrings();
|
|
9510
9653
|
useAutoTip();
|
|
9511
9654
|
const count = Math.max(1, props.pageCount || 1);
|
|
@@ -9525,7 +9668,7 @@ window.Aura = (() => {
|
|
|
9525
9668
|
},
|
|
9526
9669
|
extra
|
|
9527
9670
|
);
|
|
9528
|
-
return link ? /* @__PURE__ */
|
|
9671
|
+
return link ? /* @__PURE__ */ React62.createElement(
|
|
9529
9672
|
Link,
|
|
9530
9673
|
{
|
|
9531
9674
|
href: link(p),
|
|
@@ -9538,7 +9681,7 @@ window.Aura = (() => {
|
|
|
9538
9681
|
...common
|
|
9539
9682
|
},
|
|
9540
9683
|
label
|
|
9541
|
-
) : /* @__PURE__ */
|
|
9684
|
+
) : /* @__PURE__ */ React62.createElement(
|
|
9542
9685
|
"button",
|
|
9543
9686
|
{
|
|
9544
9687
|
type: "button",
|
|
@@ -9552,7 +9695,7 @@ window.Aura = (() => {
|
|
|
9552
9695
|
}
|
|
9553
9696
|
function arrow(p, icon, label, rel, disabled) {
|
|
9554
9697
|
if (!link || disabled)
|
|
9555
|
-
return /* @__PURE__ */
|
|
9698
|
+
return /* @__PURE__ */ React62.createElement(
|
|
9556
9699
|
IconButton,
|
|
9557
9700
|
{
|
|
9558
9701
|
icon,
|
|
@@ -9563,7 +9706,7 @@ window.Aura = (() => {
|
|
|
9563
9706
|
}
|
|
9564
9707
|
}
|
|
9565
9708
|
);
|
|
9566
|
-
return /* @__PURE__ */
|
|
9709
|
+
return /* @__PURE__ */ React62.createElement(
|
|
9567
9710
|
Link,
|
|
9568
9711
|
{
|
|
9569
9712
|
href: link(p),
|
|
@@ -9578,17 +9721,17 @@ window.Aura = (() => {
|
|
|
9578
9721
|
}
|
|
9579
9722
|
}
|
|
9580
9723
|
},
|
|
9581
|
-
/* @__PURE__ */
|
|
9724
|
+
/* @__PURE__ */ React62.createElement(Icon, { name: icon, size: "sm" })
|
|
9582
9725
|
);
|
|
9583
9726
|
}
|
|
9584
|
-
return /* @__PURE__ */
|
|
9585
|
-
return typeof p === "number" ? /* @__PURE__ */
|
|
9586
|
-
})), /* @__PURE__ */
|
|
9727
|
+
return /* @__PURE__ */ React62.createElement("nav", { ref, className: cx("aura-pagination", props.className), "aria-label": props.label || t.pagination }, arrow(page - 1, /* @__PURE__ */ React62.createElement(IconChevronLeft, null), t.prevPage, "prev", page <= 1), /* @__PURE__ */ React62.createElement("ol", { className: "aura-pagination__list" }, pageList(page, count, props.siblingCount == null ? 1 : props.siblingCount).map(function(p) {
|
|
9728
|
+
return typeof p === "number" ? /* @__PURE__ */ React62.createElement("li", { key: p }, item(p, p)) : /* @__PURE__ */ React62.createElement("li", { key: p, className: "aura-pagination__gap", "aria-hidden": true }, "\u2026");
|
|
9729
|
+
})), /* @__PURE__ */ React62.createElement("span", { className: "aura-pagination__compact", "aria-hidden": true }, t.page(page, count)), arrow(page + 1, /* @__PURE__ */ React62.createElement(IconChevronRight, null), t.nextPage, "next", page >= count));
|
|
9587
9730
|
});
|
|
9588
9731
|
|
|
9589
9732
|
// src/Accordion.tsx
|
|
9590
|
-
var
|
|
9591
|
-
var Accordion =
|
|
9733
|
+
var React63 = __toESM(require_react(), 1);
|
|
9734
|
+
var Accordion = React63.forwardRef(function Accordion2(props, ref) {
|
|
9592
9735
|
const auto = uid(), base = props.id || auto;
|
|
9593
9736
|
const multiple = props.type === "multiple";
|
|
9594
9737
|
const st = useMaybeControlled(
|
|
@@ -9626,9 +9769,9 @@ window.Aura = (() => {
|
|
|
9626
9769
|
n3.focus();
|
|
9627
9770
|
}
|
|
9628
9771
|
}
|
|
9629
|
-
return /* @__PURE__ */
|
|
9772
|
+
return /* @__PURE__ */ React63.createElement("div", { ref, className: cx("aura-accordion", props.className), onKeyDown: onKey }, items2.map(function(it) {
|
|
9630
9773
|
const on = open.indexOf(it.id) >= 0, bid = base + "-btn-" + it.id, pid = base + "-panel-" + it.id;
|
|
9631
|
-
return /* @__PURE__ */
|
|
9774
|
+
return /* @__PURE__ */ React63.createElement("div", { key: it.id, className: cx("aura-accordion__item", on && "is-open") }, /* @__PURE__ */ React63.createElement(HT, { className: "aura-accordion__heading" }, /* @__PURE__ */ React63.createElement(
|
|
9632
9775
|
"button",
|
|
9633
9776
|
{
|
|
9634
9777
|
type: "button",
|
|
@@ -9641,10 +9784,10 @@ window.Aura = (() => {
|
|
|
9641
9784
|
toggle(it.id);
|
|
9642
9785
|
}
|
|
9643
9786
|
},
|
|
9644
|
-
it.icon ? /* @__PURE__ */
|
|
9645
|
-
/* @__PURE__ */
|
|
9646
|
-
/* @__PURE__ */
|
|
9647
|
-
)), /* @__PURE__ */
|
|
9787
|
+
it.icon ? /* @__PURE__ */ React63.createElement(Icon, { name: it.icon, className: "aura-accordion__lead" }) : null,
|
|
9788
|
+
/* @__PURE__ */ React63.createElement("span", { className: "aura-accordion__title" }, /* @__PURE__ */ React63.createElement("span", { id: it.description ? bid + "-title" : void 0 }, it.title), it.description ? /* @__PURE__ */ React63.createElement("span", { className: "aura-accordion__desc", id: bid + "-desc", "aria-hidden": true }, it.description) : null),
|
|
9789
|
+
/* @__PURE__ */ React63.createElement(Icon, { name: /* @__PURE__ */ React63.createElement(IconChevronDown, null), className: "aura-accordion__chevron" })
|
|
9790
|
+
)), /* @__PURE__ */ React63.createElement(
|
|
9648
9791
|
"div",
|
|
9649
9792
|
{
|
|
9650
9793
|
id: pid,
|
|
@@ -9659,7 +9802,7 @@ window.Aura = (() => {
|
|
|
9659
9802
|
});
|
|
9660
9803
|
|
|
9661
9804
|
// src/Popover.tsx
|
|
9662
|
-
var
|
|
9805
|
+
var React64 = __toESM(require_react(), 1);
|
|
9663
9806
|
var import_react_dom13 = __toESM(require_react_dom(), 1);
|
|
9664
9807
|
function position(anchor, pop, placement) {
|
|
9665
9808
|
const r2 = anchor.getBoundingClientRect(), pw = pop.offsetWidth, ph = pop.scrollHeight, vw = window.innerWidth, vh = window.innerHeight, gap = 6;
|
|
@@ -9677,15 +9820,15 @@ window.Aura = (() => {
|
|
|
9677
9820
|
const left = align === "end" ? r2.right - pw : align === "center" ? r2.left + r2.width / 2 - pw / 2 : r2.left;
|
|
9678
9821
|
return { top: Math.max(8, top), left: Math.max(8, Math.min(left, vw - pw - 8)), side, maxHeight };
|
|
9679
9822
|
}
|
|
9680
|
-
var Popover =
|
|
9823
|
+
var Popover = React64.forwardRef(function Popover2(props, ref) {
|
|
9681
9824
|
const t = useStrings();
|
|
9682
9825
|
const density = useDensity();
|
|
9683
9826
|
const auto = uid(), id = props.id || auto;
|
|
9684
9827
|
const st = useMaybeControlled(props.open, !!props.defaultOpen, props.onOpenChange);
|
|
9685
9828
|
const open = !!st[0];
|
|
9686
|
-
const wrap =
|
|
9687
|
-
const pos =
|
|
9688
|
-
const inTree =
|
|
9829
|
+
const wrap = React64.useRef(null), pop = React64.useRef(null), popMerged = useMergedRef(ref, pop);
|
|
9830
|
+
const pos = React64.useState(null), mounted = useMounted();
|
|
9831
|
+
const inTree = React64.useRef(false);
|
|
9689
9832
|
function trigger() {
|
|
9690
9833
|
return wrap.current && (wrap.current.querySelector('button, [role="button"], a, input') || wrap.current.firstElementChild);
|
|
9691
9834
|
}
|
|
@@ -9712,7 +9855,7 @@ window.Aura = (() => {
|
|
|
9712
9855
|
},
|
|
9713
9856
|
[open, mounted, props.placement]
|
|
9714
9857
|
);
|
|
9715
|
-
|
|
9858
|
+
React64.useEffect(
|
|
9716
9859
|
function() {
|
|
9717
9860
|
if (!open || !mounted) return;
|
|
9718
9861
|
if (props.autoFocus !== false && pop.current) {
|
|
@@ -9737,9 +9880,9 @@ window.Aura = (() => {
|
|
|
9737
9880
|
},
|
|
9738
9881
|
[open, mounted]
|
|
9739
9882
|
);
|
|
9740
|
-
const child =
|
|
9883
|
+
const child = React64.Children.only(props.trigger);
|
|
9741
9884
|
const panel = open && mounted ? (0, import_react_dom13.createPortal)(
|
|
9742
|
-
/* @__PURE__ */
|
|
9885
|
+
/* @__PURE__ */ React64.createElement(
|
|
9743
9886
|
"div",
|
|
9744
9887
|
{
|
|
9745
9888
|
ref: popMerged,
|
|
@@ -9769,17 +9912,17 @@ window.Aura = (() => {
|
|
|
9769
9912
|
} else trapTab(e, pop.current);
|
|
9770
9913
|
}
|
|
9771
9914
|
},
|
|
9772
|
-
props.title ? /* @__PURE__ */
|
|
9915
|
+
props.title ? /* @__PURE__ */ React64.createElement("div", { className: "aura-popover__head" }, /* @__PURE__ */ React64.createElement("p", { className: "aura-popover__title", id: id + "-title" }, props.title), /* @__PURE__ */ React64.createElement(
|
|
9773
9916
|
IconButton,
|
|
9774
9917
|
{
|
|
9775
|
-
icon: /* @__PURE__ */
|
|
9918
|
+
icon: /* @__PURE__ */ React64.createElement(IconX, null),
|
|
9776
9919
|
label: t.close,
|
|
9777
9920
|
onClick: function() {
|
|
9778
9921
|
close(true);
|
|
9779
9922
|
}
|
|
9780
9923
|
}
|
|
9781
9924
|
)) : null,
|
|
9782
|
-
/* @__PURE__ */
|
|
9925
|
+
/* @__PURE__ */ React64.createElement("div", { className: "aura-popover__body" }, typeof props.children === "function" ? props.children({
|
|
9783
9926
|
close: function() {
|
|
9784
9927
|
close(true);
|
|
9785
9928
|
}
|
|
@@ -9787,7 +9930,7 @@ window.Aura = (() => {
|
|
|
9787
9930
|
),
|
|
9788
9931
|
document.body
|
|
9789
9932
|
) : null;
|
|
9790
|
-
return /* @__PURE__ */
|
|
9933
|
+
return /* @__PURE__ */ React64.createElement("span", { ref: wrap, className: "aura-popover-anchor" }, React64.cloneElement(child, {
|
|
9791
9934
|
onClick: function(e) {
|
|
9792
9935
|
if (child.props.onClick) child.props.onClick(e);
|
|
9793
9936
|
st[1](!open);
|
|
@@ -9799,7 +9942,7 @@ window.Aura = (() => {
|
|
|
9799
9942
|
});
|
|
9800
9943
|
|
|
9801
9944
|
// src/NumberField.tsx
|
|
9802
|
-
var
|
|
9945
|
+
var React65 = __toESM(require_react(), 1);
|
|
9803
9946
|
function decimalsOf(n3) {
|
|
9804
9947
|
const s = String(n3);
|
|
9805
9948
|
const i = s.indexOf(".");
|
|
@@ -9812,7 +9955,7 @@ window.Aura = (() => {
|
|
|
9812
9955
|
if (!/^-?(\d+\.?\d*|\.\d+)$/.test(s)) return NaN;
|
|
9813
9956
|
return Number(s);
|
|
9814
9957
|
}
|
|
9815
|
-
var NumberField =
|
|
9958
|
+
var NumberField = React65.forwardRef(function NumberField2(props, ref) {
|
|
9816
9959
|
const t = useStrings();
|
|
9817
9960
|
const auto = uid(), id = props.id || auto;
|
|
9818
9961
|
const step = props.step || 1;
|
|
@@ -9823,7 +9966,7 @@ window.Aura = (() => {
|
|
|
9823
9966
|
props.onChange
|
|
9824
9967
|
);
|
|
9825
9968
|
const value = st[0], setValue = st[1];
|
|
9826
|
-
const draftState =
|
|
9969
|
+
const draftState = React65.useState(null), draft = draftState[0], setDraft = draftState[1];
|
|
9827
9970
|
function fmt2(n3) {
|
|
9828
9971
|
if (n3 == null || isNaN(n3)) return "";
|
|
9829
9972
|
return n3.toLocaleString("en", { minimumFractionDigits: decimals, maximumFractionDigits: decimals });
|
|
@@ -9872,7 +10015,7 @@ window.Aura = (() => {
|
|
|
9872
10015
|
};
|
|
9873
10016
|
const valueText = value == null ? void 0 : [affixText(props.prefix), fmt2(value), affixText(props.suffix)].join(" ").trim();
|
|
9874
10017
|
const stepper = props.stepper !== false && !props.readOnly;
|
|
9875
|
-
return /* @__PURE__ */
|
|
10018
|
+
return /* @__PURE__ */ React65.createElement(
|
|
9876
10019
|
Field,
|
|
9877
10020
|
{
|
|
9878
10021
|
id,
|
|
@@ -9884,7 +10027,7 @@ window.Aura = (() => {
|
|
|
9884
10027
|
disabled: props.disabled,
|
|
9885
10028
|
className: props.className
|
|
9886
10029
|
},
|
|
9887
|
-
/* @__PURE__ */
|
|
10030
|
+
/* @__PURE__ */ React65.createElement("div", { className: cx("aura-input aura-number", stepper && "has-stepper") }, props.prefix != null ? /* @__PURE__ */ React65.createElement("span", { className: "aura-number__affix", "aria-hidden": true }, props.prefix) : null, /* @__PURE__ */ React65.createElement(
|
|
9888
10031
|
"input",
|
|
9889
10032
|
{
|
|
9890
10033
|
ref,
|
|
@@ -9931,7 +10074,7 @@ window.Aura = (() => {
|
|
|
9931
10074
|
},
|
|
9932
10075
|
onKeyDown
|
|
9933
10076
|
}
|
|
9934
|
-
), props.suffix != null ? /* @__PURE__ */
|
|
10077
|
+
), props.suffix != null ? /* @__PURE__ */ React65.createElement("span", { className: "aura-number__affix", "aria-hidden": true }, props.suffix) : null, stepper ? /* @__PURE__ */ React65.createElement("span", { className: "aura-number__steps" }, /* @__PURE__ */ React65.createElement(
|
|
9935
10078
|
"button",
|
|
9936
10079
|
{
|
|
9937
10080
|
type: "button",
|
|
@@ -9947,8 +10090,8 @@ window.Aura = (() => {
|
|
|
9947
10090
|
nudge(-step);
|
|
9948
10091
|
}
|
|
9949
10092
|
},
|
|
9950
|
-
/* @__PURE__ */
|
|
9951
|
-
), /* @__PURE__ */
|
|
10093
|
+
/* @__PURE__ */ React65.createElement(Icon, { name: /* @__PURE__ */ React65.createElement(IconMinus, null) })
|
|
10094
|
+
), /* @__PURE__ */ React65.createElement(
|
|
9952
10095
|
"button",
|
|
9953
10096
|
{
|
|
9954
10097
|
type: "button",
|
|
@@ -9964,14 +10107,14 @@ window.Aura = (() => {
|
|
|
9964
10107
|
nudge(step);
|
|
9965
10108
|
}
|
|
9966
10109
|
},
|
|
9967
|
-
/* @__PURE__ */
|
|
10110
|
+
/* @__PURE__ */ React65.createElement(Icon, { name: /* @__PURE__ */ React65.createElement(IconPlus, null) })
|
|
9968
10111
|
)) : null)
|
|
9969
10112
|
);
|
|
9970
10113
|
});
|
|
9971
10114
|
|
|
9972
10115
|
// src/Stepper.tsx
|
|
9973
|
-
var
|
|
9974
|
-
var Stepper =
|
|
10116
|
+
var React66 = __toESM(require_react(), 1);
|
|
10117
|
+
var Stepper = React66.forwardRef(function Stepper2(props, ref) {
|
|
9975
10118
|
const t = useStrings();
|
|
9976
10119
|
const idBase = uid();
|
|
9977
10120
|
const steps = props.steps || [];
|
|
@@ -9982,22 +10125,22 @@ window.Aura = (() => {
|
|
|
9982
10125
|
if (at < 0) at = 0;
|
|
9983
10126
|
const vertical = props.orientation === "vertical";
|
|
9984
10127
|
const cur2 = steps[at];
|
|
9985
|
-
return /* @__PURE__ */
|
|
10128
|
+
return /* @__PURE__ */ React66.createElement(
|
|
9986
10129
|
"nav",
|
|
9987
10130
|
{
|
|
9988
10131
|
ref,
|
|
9989
10132
|
"aria-label": props.label,
|
|
9990
10133
|
className: cx("aura-stepper", vertical ? "aura-stepper--vertical" : "aura-stepper--horizontal", props.className)
|
|
9991
10134
|
},
|
|
9992
|
-
/* @__PURE__ */
|
|
10135
|
+
/* @__PURE__ */ React66.createElement("ol", { className: "aura-stepper__list" }, steps.map(function(s, i) {
|
|
9993
10136
|
const state = i < at ? "done" : i === at ? "current" : "upcoming";
|
|
9994
10137
|
const error = s.status === "error";
|
|
9995
|
-
const marker = /* @__PURE__ */
|
|
10138
|
+
const marker = /* @__PURE__ */ React66.createElement("span", { className: "aura-stepper__marker", "aria-hidden": true }, error ? /* @__PURE__ */ React66.createElement(Icon, { name: /* @__PURE__ */ React66.createElement(IconCircleAlert, null) }) : state === "done" ? /* @__PURE__ */ React66.createElement(Icon, { name: /* @__PURE__ */ React66.createElement(IconCheck, null) }) : i + 1);
|
|
9996
10139
|
const note = error ? t.stepError : state === "done" ? t.stepDone : "";
|
|
9997
10140
|
const clickable = state === "done" && !!props.onStepClick;
|
|
9998
10141
|
const named = clickable && (typeof s.label === "string" || typeof s.label === "number") && String(s.label).trim() !== "";
|
|
9999
10142
|
const descId = idBase + "-step-" + i;
|
|
10000
|
-
const text2 = /* @__PURE__ */
|
|
10143
|
+
const text2 = /* @__PURE__ */ React66.createElement("span", { className: "aura-stepper__text" }, named ? /* @__PURE__ */ React66.createElement("span", { className: "aura-sr-only" }, String(s.label) + (note ? ", " + note : "")) : null, /* @__PURE__ */ React66.createElement("span", { className: "aura-stepper__label", "aria-hidden": named ? true : void 0 }, s.label, note && !named ? /* @__PURE__ */ React66.createElement("span", { className: "aura-sr-only" }, ", " + note) : null), s.description ? /* @__PURE__ */ React66.createElement(
|
|
10001
10144
|
"span",
|
|
10002
10145
|
{
|
|
10003
10146
|
className: "aura-stepper__desc",
|
|
@@ -10006,14 +10149,14 @@ window.Aura = (() => {
|
|
|
10006
10149
|
},
|
|
10007
10150
|
s.description
|
|
10008
10151
|
) : null);
|
|
10009
|
-
return /* @__PURE__ */
|
|
10152
|
+
return /* @__PURE__ */ React66.createElement(
|
|
10010
10153
|
"li",
|
|
10011
10154
|
{
|
|
10012
10155
|
key: s.id,
|
|
10013
10156
|
className: cx("aura-stepper__item", "is-" + state, error && "is-error"),
|
|
10014
10157
|
"aria-current": state === "current" ? "step" : void 0
|
|
10015
10158
|
},
|
|
10016
|
-
clickable ? /* @__PURE__ */
|
|
10159
|
+
clickable ? /* @__PURE__ */ React66.createElement(
|
|
10017
10160
|
"button",
|
|
10018
10161
|
{
|
|
10019
10162
|
type: "button",
|
|
@@ -10025,19 +10168,19 @@ window.Aura = (() => {
|
|
|
10025
10168
|
},
|
|
10026
10169
|
marker,
|
|
10027
10170
|
text2
|
|
10028
|
-
) : /* @__PURE__ */
|
|
10171
|
+
) : /* @__PURE__ */ React66.createElement("span", { className: "aura-stepper__step" }, marker, text2)
|
|
10029
10172
|
);
|
|
10030
10173
|
})),
|
|
10031
|
-
!vertical && cur2 ? /* @__PURE__ */
|
|
10174
|
+
!vertical && cur2 ? /* @__PURE__ */ React66.createElement("p", { className: "aura-stepper__compact", "aria-hidden": true }, /* @__PURE__ */ React66.createElement("span", { className: "aura-stepper__count" }, t.stepOf(at + 1, steps.length), cur2.status === "error" ? /* @__PURE__ */ React66.createElement("span", { className: "aura-stepper__count-error" }, " \u2014 " + t.stepError) : null), /* @__PURE__ */ React66.createElement("span", { className: "aura-stepper__compact-label" }, cur2.label)) : null
|
|
10032
10175
|
);
|
|
10033
10176
|
});
|
|
10034
10177
|
|
|
10035
10178
|
// src/SegmentedControl.tsx
|
|
10036
|
-
var
|
|
10179
|
+
var React67 = __toESM(require_react(), 1);
|
|
10037
10180
|
function toOpt2(o) {
|
|
10038
10181
|
return typeof o === "object" ? o : { value: o, label: o };
|
|
10039
10182
|
}
|
|
10040
|
-
var SegmentedControl =
|
|
10183
|
+
var SegmentedControl = React67.forwardRef(
|
|
10041
10184
|
function SegmentedControl2(props, ref) {
|
|
10042
10185
|
const options = (props.options || []).map(toOpt2);
|
|
10043
10186
|
useAutoTip();
|
|
@@ -10051,7 +10194,7 @@ window.Aura = (() => {
|
|
|
10051
10194
|
);
|
|
10052
10195
|
const value = st[0], setValue = st[1];
|
|
10053
10196
|
const auto = uid(), id = props.id || auto;
|
|
10054
|
-
const refs =
|
|
10197
|
+
const refs = React67.useRef([]);
|
|
10055
10198
|
const selIdx = options.findIndex(function(o) {
|
|
10056
10199
|
return o.value === value;
|
|
10057
10200
|
});
|
|
@@ -10084,7 +10227,7 @@ window.Aura = (() => {
|
|
|
10084
10227
|
move(options.length, -1);
|
|
10085
10228
|
}
|
|
10086
10229
|
}
|
|
10087
|
-
return /* @__PURE__ */
|
|
10230
|
+
return /* @__PURE__ */ React67.createElement(
|
|
10088
10231
|
"div",
|
|
10089
10232
|
{
|
|
10090
10233
|
ref,
|
|
@@ -10103,7 +10246,7 @@ window.Aura = (() => {
|
|
|
10103
10246
|
options.map(function(o, i) {
|
|
10104
10247
|
const on = o.value === value;
|
|
10105
10248
|
const off = props.disabled || o.disabled;
|
|
10106
|
-
return /* @__PURE__ */
|
|
10249
|
+
return /* @__PURE__ */ React67.createElement(
|
|
10107
10250
|
"button",
|
|
10108
10251
|
{
|
|
10109
10252
|
key: o.value,
|
|
@@ -10125,8 +10268,8 @@ window.Aura = (() => {
|
|
|
10125
10268
|
onKeyDown(e, i);
|
|
10126
10269
|
}
|
|
10127
10270
|
},
|
|
10128
|
-
o.icon ? /* @__PURE__ */
|
|
10129
|
-
o.iconOnly ? null : /* @__PURE__ */
|
|
10271
|
+
o.icon ? /* @__PURE__ */ React67.createElement(Icon, { name: o.icon }) : null,
|
|
10272
|
+
o.iconOnly ? null : /* @__PURE__ */ React67.createElement("span", null, o.label)
|
|
10130
10273
|
);
|
|
10131
10274
|
})
|
|
10132
10275
|
);
|