@jirawatpyk/aura-react 5.34.0 → 5.36.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 +12 -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 +40 -5
- package/dist/styles.layer.css +40 -5
- package/package.json +1 -1
package/dist/cjs/index.cjs
CHANGED
|
@@ -931,6 +931,7 @@ var th = {
|
|
|
931
931
|
statusProblem: "\u0E21\u0E35\u0E1B\u0E31\u0E0D\u0E2B\u0E32",
|
|
932
932
|
statusMaintenance: "\u0E1B\u0E34\u0E14\u0E1B\u0E23\u0E31\u0E1A\u0E1B\u0E23\u0E38\u0E07",
|
|
933
933
|
statusOk: "\u0E1B\u0E01\u0E15\u0E34",
|
|
934
|
+
statusUnknown: "\u0E22\u0E31\u0E07\u0E44\u0E21\u0E48\u0E21\u0E35\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25",
|
|
934
935
|
accepts: function(list, max) {
|
|
935
936
|
return [list, max && "\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19 " + max + " \u0E15\u0E48\u0E2D\u0E44\u0E1F\u0E25\u0E4C"].filter(Boolean).join(" \xB7 ");
|
|
936
937
|
}
|
|
@@ -1066,6 +1067,7 @@ var sv = {
|
|
|
1066
1067
|
statusProblem: "Problem",
|
|
1067
1068
|
statusMaintenance: "Underh\xE5ll",
|
|
1068
1069
|
statusOk: "OK",
|
|
1070
|
+
statusUnknown: "Ingen data",
|
|
1069
1071
|
accepts: function(list, max) {
|
|
1070
1072
|
return [list, max && "h\xF6gst " + max + " per fil"].filter(Boolean).join(", ");
|
|
1071
1073
|
}
|
|
@@ -1202,6 +1204,7 @@ var STRINGS = {
|
|
|
1202
1204
|
statusProblem: "Problem",
|
|
1203
1205
|
statusMaintenance: "Maintenance",
|
|
1204
1206
|
statusOk: "OK",
|
|
1207
|
+
statusUnknown: "No data",
|
|
1205
1208
|
accepts: function(list, max) {
|
|
1206
1209
|
return [list, max && "up to " + max + " each"].filter(Boolean).join(", ");
|
|
1207
1210
|
}
|
|
@@ -7667,19 +7670,22 @@ var STATUS_ICON = {
|
|
|
7667
7670
|
down: IconCircleAlert,
|
|
7668
7671
|
problem: IconTriangleAlert,
|
|
7669
7672
|
maintenance: IconWrench,
|
|
7670
|
-
ok: IconCircleCheck
|
|
7673
|
+
ok: IconCircleCheck,
|
|
7674
|
+
unknown: IconCircleDotDashed
|
|
7671
7675
|
};
|
|
7672
7676
|
var STATUS_TONE = {
|
|
7673
7677
|
down: "danger",
|
|
7674
7678
|
problem: "warning",
|
|
7675
7679
|
maintenance: "accent",
|
|
7676
|
-
ok: "default"
|
|
7680
|
+
ok: "default",
|
|
7681
|
+
unknown: "default"
|
|
7677
7682
|
};
|
|
7678
7683
|
var STATUS_WORD = {
|
|
7679
7684
|
down: "statusDown",
|
|
7680
7685
|
problem: "statusProblem",
|
|
7681
7686
|
maintenance: "statusMaintenance",
|
|
7682
|
-
ok: "statusOk"
|
|
7687
|
+
ok: "statusOk",
|
|
7688
|
+
unknown: "statusUnknown"
|
|
7683
7689
|
};
|
|
7684
7690
|
function statusWord(status, t) {
|
|
7685
7691
|
return String(t[STATUS_WORD[status]] || STATUS_WORD[status]);
|
|
@@ -7694,7 +7700,12 @@ function attrs(props) {
|
|
|
7694
7700
|
}
|
|
7695
7701
|
var comma = h9("span", { className: "aura-status-tile__sep" }, ",");
|
|
7696
7702
|
function statusTileElement(props, ref, Link, t, titleRef) {
|
|
7697
|
-
const status = STATUS_ICON[props.status] ? props.status : "
|
|
7703
|
+
const status = STATUS_ICON[props.status] ? props.status : "unknown";
|
|
7704
|
+
if (status !== props.status)
|
|
7705
|
+
devWarnOnce(
|
|
7706
|
+
"status-tile-status-" + String(props.status),
|
|
7707
|
+
'StatusTile status="' + String(props.status) + '" is not down, problem, maintenance, ok or unknown: it shows as unknown ("No data"). Map your value first.'
|
|
7708
|
+
);
|
|
7698
7709
|
const valueTone = props.valueTone || STATUS_TONE[status];
|
|
7699
7710
|
const word = props.statusLabel || statusWord(status, t);
|
|
7700
7711
|
const markers = (props.markers || []).filter(Boolean);
|
|
@@ -7905,37 +7916,144 @@ var StatusTile = React45.forwardRef(function StatusTile2(props, ref) {
|
|
|
7905
7916
|
});
|
|
7906
7917
|
|
|
7907
7918
|
// src/AppShell.tsx
|
|
7919
|
+
var React47 = __toESM(require("react"), 1);
|
|
7920
|
+
|
|
7921
|
+
// src/scrollHide.ts
|
|
7908
7922
|
var React46 = __toESM(require("react"), 1);
|
|
7909
|
-
var
|
|
7923
|
+
var STEP = 8;
|
|
7924
|
+
function useHideOnScroll(enabled, el, media, from) {
|
|
7925
|
+
const st = React46.useState(false), hidden = st[0], setHidden = st[1];
|
|
7926
|
+
React46.useEffect(
|
|
7927
|
+
function() {
|
|
7928
|
+
if (!enabled || typeof window === "undefined") {
|
|
7929
|
+
setHidden(false);
|
|
7930
|
+
return;
|
|
7931
|
+
}
|
|
7932
|
+
const mq = window.matchMedia ? window.matchMedia(media) : null;
|
|
7933
|
+
let last = window.scrollY, lastH = window.innerHeight, resizedAt = -1e9, run = 0;
|
|
7934
|
+
let restore = null;
|
|
7935
|
+
function update() {
|
|
7936
|
+
if (restore) {
|
|
7937
|
+
const r2 = restore;
|
|
7938
|
+
if (performance.now() > r2.until || window.scrollY >= r2.y - 1) restore = null;
|
|
7939
|
+
else {
|
|
7940
|
+
restore = null;
|
|
7941
|
+
last = r2.y;
|
|
7942
|
+
window.scrollTo(window.scrollX, r2.y);
|
|
7943
|
+
return;
|
|
7944
|
+
}
|
|
7945
|
+
}
|
|
7946
|
+
const y = window.scrollY, dy = y - last;
|
|
7947
|
+
last = y;
|
|
7948
|
+
const node2 = el.current;
|
|
7949
|
+
if (mq && !mq.matches || y <= from || node2 && document.activeElement && node2.contains(document.activeElement)) {
|
|
7950
|
+
run = 0;
|
|
7951
|
+
setHidden(false);
|
|
7952
|
+
return;
|
|
7953
|
+
}
|
|
7954
|
+
if (window.innerHeight !== lastH || performance.now() - resizedAt < 150) {
|
|
7955
|
+
lastH = window.innerHeight;
|
|
7956
|
+
resizedAt = performance.now();
|
|
7957
|
+
run = 0;
|
|
7958
|
+
return;
|
|
7959
|
+
}
|
|
7960
|
+
if (y + window.innerHeight > document.documentElement.scrollHeight + 1) return;
|
|
7961
|
+
run = dy > 0 === run > 0 ? run + dy : dy;
|
|
7962
|
+
if (run > STEP) setHidden(true);
|
|
7963
|
+
else if (run < -STEP) setHidden(false);
|
|
7964
|
+
}
|
|
7965
|
+
let tabbing = false;
|
|
7966
|
+
function disarm() {
|
|
7967
|
+
restore = null;
|
|
7968
|
+
}
|
|
7969
|
+
function onKey(e) {
|
|
7970
|
+
if (e.key !== "Tab" && e.code !== "Tab") {
|
|
7971
|
+
if (e.key !== "Shift") restore = null;
|
|
7972
|
+
return;
|
|
7973
|
+
}
|
|
7974
|
+
tabbing = true;
|
|
7975
|
+
requestAnimationFrame(function() {
|
|
7976
|
+
tabbing = false;
|
|
7977
|
+
});
|
|
7978
|
+
}
|
|
7979
|
+
function reveal() {
|
|
7980
|
+
const n3 = el.current;
|
|
7981
|
+
if (n3 && n3.classList.contains("is-away")) {
|
|
7982
|
+
n3.classList.remove("is-away");
|
|
7983
|
+
if (tabbing) {
|
|
7984
|
+
if (window.scrollY < last) window.scrollTo(window.scrollX, last);
|
|
7985
|
+
else restore = { y: last, until: performance.now() + 400 };
|
|
7986
|
+
}
|
|
7987
|
+
}
|
|
7988
|
+
setHidden(false);
|
|
7989
|
+
}
|
|
7990
|
+
window.addEventListener("scroll", update, { passive: true });
|
|
7991
|
+
window.addEventListener("resize", update);
|
|
7992
|
+
document.addEventListener("keydown", onKey, true);
|
|
7993
|
+
window.addEventListener("wheel", disarm, { passive: true, capture: true });
|
|
7994
|
+
window.addEventListener("touchstart", disarm, { passive: true, capture: true });
|
|
7995
|
+
window.addEventListener("pointerdown", disarm, true);
|
|
7996
|
+
const node = el.current;
|
|
7997
|
+
if (node) node.addEventListener("focusin", reveal);
|
|
7998
|
+
if (mq && mq.addEventListener) mq.addEventListener("change", update);
|
|
7999
|
+
return function() {
|
|
8000
|
+
window.removeEventListener("scroll", update);
|
|
8001
|
+
window.removeEventListener("resize", update);
|
|
8002
|
+
document.removeEventListener("keydown", onKey, true);
|
|
8003
|
+
window.removeEventListener("wheel", disarm, true);
|
|
8004
|
+
window.removeEventListener("touchstart", disarm, true);
|
|
8005
|
+
window.removeEventListener("pointerdown", disarm, true);
|
|
8006
|
+
if (node) node.removeEventListener("focusin", reveal);
|
|
8007
|
+
if (mq && mq.removeEventListener) mq.removeEventListener("change", update);
|
|
8008
|
+
};
|
|
8009
|
+
},
|
|
8010
|
+
[enabled, el, media, from]
|
|
8011
|
+
);
|
|
8012
|
+
return enabled && hidden;
|
|
8013
|
+
}
|
|
8014
|
+
|
|
8015
|
+
// src/AppShell.tsx
|
|
8016
|
+
var AppShell = React47.forwardRef(function AppShell2(props, ref) {
|
|
7910
8017
|
const t = useStrings();
|
|
7911
8018
|
const bp = useBreakpoint();
|
|
7912
8019
|
const wide = bp === "lg" || bp === "xl";
|
|
7913
|
-
const st =
|
|
7914
|
-
|
|
8020
|
+
const st = React47.useState(false), open = st[0], setOpen = st[1];
|
|
8021
|
+
React47.useEffect(
|
|
7915
8022
|
function() {
|
|
7916
8023
|
if (wide) setOpen(false);
|
|
7917
8024
|
},
|
|
7918
8025
|
[wide]
|
|
7919
8026
|
);
|
|
7920
|
-
const navEl = props.nav &&
|
|
8027
|
+
const navEl = props.nav && React47.isValidElement(props.nav) ? props.nav : null;
|
|
7921
8028
|
const shared = !!navEl && navEl.props.value === void 0 && (navEl.props.defaultValue !== void 0 || navEl.props.sections !== void 0 || navEl.props.items !== void 0);
|
|
7922
|
-
const navState =
|
|
8029
|
+
const navState = React47.useState(navEl ? navEl.props.defaultValue : void 0);
|
|
7923
8030
|
function onNav(id) {
|
|
7924
8031
|
if (shared) navState[1](id);
|
|
7925
8032
|
if (navEl && navEl.props.onChange) navEl.props.onChange(id);
|
|
7926
8033
|
}
|
|
7927
|
-
const rootRef =
|
|
7928
|
-
const barRef =
|
|
8034
|
+
const rootRef = React47.useRef(null);
|
|
8035
|
+
const barRef = React47.useRef(null);
|
|
7929
8036
|
const mergedRef = useMergedRef(ref, rootRef);
|
|
7930
8037
|
const hasBar = !!(props.header || props.nav);
|
|
7931
|
-
const barH =
|
|
8038
|
+
const barH = React47.useState(null);
|
|
8039
|
+
const away = useHideOnScroll(!!props.headerHideOnScroll && hasBar, barRef, "(max-width: 1023.98px)", barH[0] || 56);
|
|
8040
|
+
const awayRef = React47.useRef(away);
|
|
8041
|
+
awayRef.current = away;
|
|
8042
|
+
useIsoLayoutEffect(
|
|
8043
|
+
function() {
|
|
8044
|
+
const root = rootRef.current, bar = barRef.current;
|
|
8045
|
+
if (!root || !bar) return;
|
|
8046
|
+
root.style.setProperty("--aura-shell-bar-height", away ? "0px" : bar.getBoundingClientRect().height + "px");
|
|
8047
|
+
},
|
|
8048
|
+
[away]
|
|
8049
|
+
);
|
|
7932
8050
|
useIsoLayoutEffect(
|
|
7933
8051
|
function() {
|
|
7934
8052
|
const root = rootRef.current, bar = barRef.current;
|
|
7935
8053
|
if (!root || !bar) return;
|
|
7936
8054
|
function sync() {
|
|
7937
8055
|
const h11 = bar.getBoundingClientRect().height;
|
|
7938
|
-
root.style.setProperty("--aura-shell-bar-height", h11 + "px");
|
|
8056
|
+
root.style.setProperty("--aura-shell-bar-height", awayRef.current ? "0px" : h11 + "px");
|
|
7939
8057
|
if (h11 > 0) barH[1](Math.round(h11));
|
|
7940
8058
|
}
|
|
7941
8059
|
sync();
|
|
@@ -7948,8 +8066,8 @@ var AppShell = React46.forwardRef(function AppShell2(props, ref) {
|
|
|
7948
8066
|
},
|
|
7949
8067
|
[hasBar]
|
|
7950
8068
|
);
|
|
7951
|
-
const deskNav = navEl && shared ?
|
|
7952
|
-
const drawerNav = navEl ?
|
|
8069
|
+
const deskNav = navEl && shared ? React47.cloneElement(navEl, { value: navState[0], onChange: onNav }) : props.nav;
|
|
8070
|
+
const drawerNav = navEl ? React47.cloneElement(navEl, {
|
|
7953
8071
|
value: shared ? navState[0] : navEl.props.value,
|
|
7954
8072
|
onChange: function(id) {
|
|
7955
8073
|
onNav(id);
|
|
@@ -7964,7 +8082,7 @@ var AppShell = React46.forwardRef(function AppShell2(props, ref) {
|
|
|
7964
8082
|
collapsed: false,
|
|
7965
8083
|
collapsible: false
|
|
7966
8084
|
}) : props.nav;
|
|
7967
|
-
return /* @__PURE__ */
|
|
8085
|
+
return /* @__PURE__ */ React47.createElement(
|
|
7968
8086
|
"div",
|
|
7969
8087
|
{
|
|
7970
8088
|
ref: mergedRef,
|
|
@@ -7979,8 +8097,8 @@ var AppShell = React46.forwardRef(function AppShell2(props, ref) {
|
|
|
7979
8097
|
props.className
|
|
7980
8098
|
)
|
|
7981
8099
|
},
|
|
7982
|
-
props.nav ? /* @__PURE__ */
|
|
7983
|
-
props.nav ? /* @__PURE__ */
|
|
8100
|
+
props.nav ? /* @__PURE__ */ React47.createElement("div", { className: "aura-shell__nav" }, deskNav) : null,
|
|
8101
|
+
props.nav ? /* @__PURE__ */ React47.createElement(
|
|
7984
8102
|
Drawer,
|
|
7985
8103
|
{
|
|
7986
8104
|
open,
|
|
@@ -7997,20 +8115,22 @@ var AppShell = React46.forwardRef(function AppShell2(props, ref) {
|
|
|
7997
8115
|
},
|
|
7998
8116
|
drawerNav
|
|
7999
8117
|
) : null,
|
|
8000
|
-
/* @__PURE__ */
|
|
8118
|
+
/* @__PURE__ */ React47.createElement("div", { className: "aura-shell__main" }, props.header || props.nav ? /* @__PURE__ */ React47.createElement(
|
|
8001
8119
|
"header",
|
|
8002
8120
|
{
|
|
8003
8121
|
ref: barRef,
|
|
8004
8122
|
className: cx(
|
|
8005
8123
|
"aura-shell__bar",
|
|
8006
|
-
(!props.header || props.headerHideFrom === "lg") && "aura-shell__bar--menu-only"
|
|
8124
|
+
(!props.header || props.headerHideFrom === "lg") && "aura-shell__bar--menu-only",
|
|
8125
|
+
props.headerHideOnScroll && "aura-shell__bar--hides",
|
|
8126
|
+
away && "is-away"
|
|
8007
8127
|
)
|
|
8008
8128
|
},
|
|
8009
|
-
props.nav ? /* @__PURE__ */
|
|
8129
|
+
props.nav ? /* @__PURE__ */ React47.createElement(
|
|
8010
8130
|
IconButton,
|
|
8011
8131
|
{
|
|
8012
8132
|
className: "aura-shell__menu",
|
|
8013
|
-
icon: /* @__PURE__ */
|
|
8133
|
+
icon: /* @__PURE__ */ React47.createElement(IconMenu, null),
|
|
8014
8134
|
label: props.menuLabel || t.openNav,
|
|
8015
8135
|
size: "md",
|
|
8016
8136
|
onClick: function() {
|
|
@@ -8019,8 +8139,8 @@ var AppShell = React46.forwardRef(function AppShell2(props, ref) {
|
|
|
8019
8139
|
"aria-expanded": open
|
|
8020
8140
|
}
|
|
8021
8141
|
) : null,
|
|
8022
|
-
/* @__PURE__ */
|
|
8023
|
-
) : null, /* @__PURE__ */
|
|
8142
|
+
/* @__PURE__ */ React47.createElement("div", { className: "aura-shell__bar-content" }, props.header)
|
|
8143
|
+
) : null, /* @__PURE__ */ React47.createElement(
|
|
8024
8144
|
"main",
|
|
8025
8145
|
{
|
|
8026
8146
|
className: cx("aura-shell__content", props.contentPadding === false && "is-flush"),
|
|
@@ -8033,17 +8153,17 @@ var AppShell = React46.forwardRef(function AppShell2(props, ref) {
|
|
|
8033
8153
|
});
|
|
8034
8154
|
|
|
8035
8155
|
// src/ActionBar.tsx
|
|
8036
|
-
var
|
|
8037
|
-
var ActionBar =
|
|
8156
|
+
var React48 = __toESM(require("react"), 1);
|
|
8157
|
+
var ActionBar = React48.forwardRef(function ActionBar2(props, ref) {
|
|
8038
8158
|
const t = useStrings();
|
|
8039
8159
|
const bulk = props.selected != null;
|
|
8040
8160
|
const idle = bulk && !props.selected;
|
|
8041
8161
|
const count = bulk && props.selected ? t.selectedCount(props.selected) : null;
|
|
8042
|
-
const hasStart =
|
|
8162
|
+
const hasStart = React48.Children.toArray(props.start).some(function(c) {
|
|
8043
8163
|
return c !== "";
|
|
8044
8164
|
});
|
|
8045
|
-
const cameFrom =
|
|
8046
|
-
const own =
|
|
8165
|
+
const cameFrom = React48.useRef(null);
|
|
8166
|
+
const own = React48.useRef(null);
|
|
8047
8167
|
function clear() {
|
|
8048
8168
|
props.onClearSelection();
|
|
8049
8169
|
setTimeout(function() {
|
|
@@ -8052,7 +8172,7 @@ var ActionBar = React47.forwardRef(function ActionBar2(props, ref) {
|
|
|
8052
8172
|
if ((!a || a === document.body || !a.isConnected) && back && back.isConnected) back.focus();
|
|
8053
8173
|
}, 0);
|
|
8054
8174
|
}
|
|
8055
|
-
return /* @__PURE__ */
|
|
8175
|
+
return /* @__PURE__ */ React48.createElement(
|
|
8056
8176
|
"div",
|
|
8057
8177
|
{
|
|
8058
8178
|
ref: function(el) {
|
|
@@ -8066,6 +8186,7 @@ var ActionBar = React47.forwardRef(function ActionBar2(props, ref) {
|
|
|
8066
8186
|
},
|
|
8067
8187
|
role: "region",
|
|
8068
8188
|
"aria-label": props.label || t.actions,
|
|
8189
|
+
"data-aura-hide-bottomnav": props.hidesBottomNav && !idle ? "" : void 0,
|
|
8069
8190
|
className: cx(
|
|
8070
8191
|
"aura-actionbar",
|
|
8071
8192
|
"aura-actionbar--" + (props.position || "viewport"),
|
|
@@ -8073,16 +8194,16 @@ var ActionBar = React47.forwardRef(function ActionBar2(props, ref) {
|
|
|
8073
8194
|
props.className
|
|
8074
8195
|
)
|
|
8075
8196
|
},
|
|
8076
|
-
/* @__PURE__ */
|
|
8197
|
+
/* @__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)
|
|
8077
8198
|
);
|
|
8078
8199
|
});
|
|
8079
8200
|
|
|
8080
8201
|
// src/Separator.tsx
|
|
8081
|
-
var
|
|
8082
|
-
var Separator =
|
|
8202
|
+
var React49 = __toESM(require("react"), 1);
|
|
8203
|
+
var Separator = React49.forwardRef(function Separator2(props, ref) {
|
|
8083
8204
|
const vertical = props.orientation === "vertical";
|
|
8084
8205
|
const decorative = props.decorative !== false;
|
|
8085
|
-
return /* @__PURE__ */
|
|
8206
|
+
return /* @__PURE__ */ React49.createElement(
|
|
8086
8207
|
"div",
|
|
8087
8208
|
{
|
|
8088
8209
|
ref,
|
|
@@ -8095,13 +8216,13 @@ var Separator = React48.forwardRef(function Separator2(props, ref) {
|
|
|
8095
8216
|
});
|
|
8096
8217
|
|
|
8097
8218
|
// src/Table.tsx
|
|
8098
|
-
var
|
|
8099
|
-
var StackLabels =
|
|
8100
|
-
var ColumnIndex =
|
|
8219
|
+
var React50 = __toESM(require("react"), 1);
|
|
8220
|
+
var StackLabels = React50.createContext(null);
|
|
8221
|
+
var ColumnIndex = React50.createContext(-1);
|
|
8101
8222
|
function flat2(children) {
|
|
8102
8223
|
const out = [];
|
|
8103
|
-
|
|
8104
|
-
if (
|
|
8224
|
+
React50.Children.toArray(children).forEach(function(c) {
|
|
8225
|
+
if (React50.isValidElement(c) && c.type === React50.Fragment)
|
|
8105
8226
|
out.push.apply(out, flat2(c.props.children));
|
|
8106
8227
|
else out.push(c);
|
|
8107
8228
|
});
|
|
@@ -8115,7 +8236,7 @@ function text(node) {
|
|
|
8115
8236
|
});
|
|
8116
8237
|
return parts.length ? parts.join("") : void 0;
|
|
8117
8238
|
}
|
|
8118
|
-
if (
|
|
8239
|
+
if (React50.isValidElement(node)) {
|
|
8119
8240
|
const p = node.props;
|
|
8120
8241
|
if (p["aria-hidden"] === true || p["aria-hidden"] === "true") return void 0;
|
|
8121
8242
|
return text(p.children);
|
|
@@ -8125,13 +8246,13 @@ function text(node) {
|
|
|
8125
8246
|
function headerLabels(children) {
|
|
8126
8247
|
let out = [];
|
|
8127
8248
|
flat2(children).forEach(function(c) {
|
|
8128
|
-
if (out.length || !
|
|
8249
|
+
if (out.length || !React50.isValidElement(c) || c.type !== THead) return;
|
|
8129
8250
|
const row = flat2(c.props.children).find(function(r2) {
|
|
8130
|
-
return
|
|
8251
|
+
return React50.isValidElement(r2);
|
|
8131
8252
|
});
|
|
8132
8253
|
if (!row) return;
|
|
8133
8254
|
flat2(row.props.children).forEach(function(cell) {
|
|
8134
|
-
if (!
|
|
8255
|
+
if (!React50.isValidElement(cell)) return;
|
|
8135
8256
|
const p = cell.props;
|
|
8136
8257
|
const t = text(p.children);
|
|
8137
8258
|
const label = p.label != null ? p.label : t != null ? t.replace(/\s+/g, " ").trim() || void 0 : void 0;
|
|
@@ -8141,7 +8262,7 @@ function headerLabels(children) {
|
|
|
8141
8262
|
});
|
|
8142
8263
|
return out;
|
|
8143
8264
|
}
|
|
8144
|
-
var Table =
|
|
8265
|
+
var Table = React50.forwardRef(function Table2(props, ref) {
|
|
8145
8266
|
const {
|
|
8146
8267
|
caption,
|
|
8147
8268
|
captionHidden,
|
|
@@ -8171,12 +8292,12 @@ var Table = React49.forwardRef(function Table2(props, ref) {
|
|
|
8171
8292
|
"tbl-stack-labels",
|
|
8172
8293
|
"Table stackBelow: no THead > Tr > Th found among its children, so cells have no labels. Pass `label` on each Td."
|
|
8173
8294
|
);
|
|
8174
|
-
const outer =
|
|
8295
|
+
const outer = React50.useContext(StackLabels);
|
|
8175
8296
|
const pageDensity = useDensity();
|
|
8176
8297
|
const capId = uid();
|
|
8177
|
-
const wrap =
|
|
8178
|
-
const sc =
|
|
8179
|
-
const wide =
|
|
8298
|
+
const wrap = React50.useRef(null);
|
|
8299
|
+
const sc = React50.useState(false), scrolls = sc[0];
|
|
8300
|
+
const wide = React50.useState(false);
|
|
8180
8301
|
useIsoLayoutEffect(function() {
|
|
8181
8302
|
const el = wrap.current;
|
|
8182
8303
|
if (!el || typeof ResizeObserver === "undefined") return;
|
|
@@ -8193,7 +8314,7 @@ var Table = React49.forwardRef(function Table2(props, ref) {
|
|
|
8193
8314
|
ro.disconnect();
|
|
8194
8315
|
};
|
|
8195
8316
|
}, []);
|
|
8196
|
-
const table = /* @__PURE__ */
|
|
8317
|
+
const table = /* @__PURE__ */ React50.createElement(
|
|
8197
8318
|
"div",
|
|
8198
8319
|
{
|
|
8199
8320
|
ref: wrap,
|
|
@@ -8217,7 +8338,7 @@ var Table = React49.forwardRef(function Table2(props, ref) {
|
|
|
8217
8338
|
"aria-labelledby": scrolls ? caption != null ? capId : rest["aria-labelledby"] : void 0,
|
|
8218
8339
|
"aria-label": scrolls && caption == null ? rest["aria-label"] : void 0
|
|
8219
8340
|
},
|
|
8220
|
-
/* @__PURE__ */
|
|
8341
|
+
/* @__PURE__ */ React50.createElement(
|
|
8221
8342
|
"table",
|
|
8222
8343
|
{
|
|
8223
8344
|
ref,
|
|
@@ -8233,11 +8354,11 @@ var Table = React49.forwardRef(function Table2(props, ref) {
|
|
|
8233
8354
|
role: stackBelow ? "table" : void 0,
|
|
8234
8355
|
...rest
|
|
8235
8356
|
},
|
|
8236
|
-
caption != null ? /* @__PURE__ */
|
|
8237
|
-
labels ? /* @__PURE__ */
|
|
8357
|
+
caption != null ? /* @__PURE__ */ React50.createElement("caption", { id: capId, className: cx("aura-tbl__caption", captionHidden && "aura-sr-only") }, caption) : null,
|
|
8358
|
+
labels ? /* @__PURE__ */ React50.createElement(StackLabels.Provider, { value: labels }, children) : outer ? /* @__PURE__ */ React50.createElement(StackLabels.Provider, { value: null }, children) : children
|
|
8238
8359
|
)
|
|
8239
8360
|
);
|
|
8240
|
-
return cards ? /* @__PURE__ */
|
|
8361
|
+
return cards ? /* @__PURE__ */ React50.createElement(
|
|
8241
8362
|
"div",
|
|
8242
8363
|
{
|
|
8243
8364
|
className: cx(
|
|
@@ -8250,10 +8371,10 @@ var Table = React49.forwardRef(function Table2(props, ref) {
|
|
|
8250
8371
|
) : table;
|
|
8251
8372
|
});
|
|
8252
8373
|
function section(tag, cls) {
|
|
8253
|
-
const C =
|
|
8374
|
+
const C = React50.forwardRef(function TableSection(props, ref) {
|
|
8254
8375
|
const { className, ...rest } = props;
|
|
8255
|
-
const stacked =
|
|
8256
|
-
return
|
|
8376
|
+
const stacked = React50.useContext(StackLabels) != null;
|
|
8377
|
+
return React50.createElement(
|
|
8257
8378
|
tag,
|
|
8258
8379
|
Object.assign({ ref, className: cx(cls, className), role: stacked ? "rowgroup" : void 0 }, rest)
|
|
8259
8380
|
);
|
|
@@ -8266,14 +8387,14 @@ var TBody = section("tbody", "aura-tbl__body");
|
|
|
8266
8387
|
TBody.displayName = "TBody";
|
|
8267
8388
|
var TFoot = section("tfoot", "aura-tbl__foot");
|
|
8268
8389
|
TFoot.displayName = "TFoot";
|
|
8269
|
-
var Tr =
|
|
8390
|
+
var Tr = React50.forwardRef(function Tr2(props, ref) {
|
|
8270
8391
|
const { className, children, ...rest } = props;
|
|
8271
|
-
const stacked =
|
|
8392
|
+
const stacked = React50.useContext(StackLabels) != null;
|
|
8272
8393
|
let col = 0;
|
|
8273
|
-
return /* @__PURE__ */
|
|
8394
|
+
return /* @__PURE__ */ React50.createElement("tr", { ref, className: cx("aura-tbl__row", className), role: stacked ? "row" : void 0, ...rest }, stacked ? flat2(children).map(function(c) {
|
|
8274
8395
|
const at = col;
|
|
8275
|
-
if (
|
|
8276
|
-
return /* @__PURE__ */
|
|
8396
|
+
if (React50.isValidElement(c)) col += Math.max(1, Number(c.props.colSpan) || 1);
|
|
8397
|
+
return /* @__PURE__ */ React50.createElement(ColumnIndex.Provider, { key: React50.isValidElement(c) && c.key != null ? c.key : at, value: at }, c);
|
|
8277
8398
|
}) : children);
|
|
8278
8399
|
});
|
|
8279
8400
|
function cellClass(base, p) {
|
|
@@ -8287,10 +8408,10 @@ function cellClass(base, p) {
|
|
|
8287
8408
|
p.className
|
|
8288
8409
|
);
|
|
8289
8410
|
}
|
|
8290
|
-
var Th =
|
|
8411
|
+
var Th = React50.forwardRef(function Th2(props, ref) {
|
|
8291
8412
|
const { align, numeric, mono, className, scope, label, card, ...rest } = props;
|
|
8292
|
-
const stacked =
|
|
8293
|
-
return /* @__PURE__ */
|
|
8413
|
+
const stacked = React50.useContext(StackLabels) != null;
|
|
8414
|
+
return /* @__PURE__ */ React50.createElement(
|
|
8294
8415
|
"th",
|
|
8295
8416
|
{
|
|
8296
8417
|
ref,
|
|
@@ -8302,12 +8423,12 @@ var Th = React49.forwardRef(function Th2(props, ref) {
|
|
|
8302
8423
|
}
|
|
8303
8424
|
);
|
|
8304
8425
|
});
|
|
8305
|
-
var Td =
|
|
8426
|
+
var Td = React50.forwardRef(function Td2(props, ref) {
|
|
8306
8427
|
const { align, numeric, mono, className, scope, label, card, ...rest } = props;
|
|
8307
|
-
const labels =
|
|
8428
|
+
const labels = React50.useContext(StackLabels), col = React50.useContext(ColumnIndex);
|
|
8308
8429
|
const slot = labels && (card === "title" || card === "action") ? card : void 0;
|
|
8309
8430
|
const shown = labels && !slot ? label != null ? label : col >= 0 ? labels[col] : void 0 : void 0;
|
|
8310
|
-
return /* @__PURE__ */
|
|
8431
|
+
return /* @__PURE__ */ React50.createElement(
|
|
8311
8432
|
"td",
|
|
8312
8433
|
{
|
|
8313
8434
|
ref,
|
|
@@ -8321,8 +8442,8 @@ var Td = React49.forwardRef(function Td2(props, ref) {
|
|
|
8321
8442
|
});
|
|
8322
8443
|
|
|
8323
8444
|
// src/BottomNav.tsx
|
|
8324
|
-
var
|
|
8325
|
-
var BottomNav =
|
|
8445
|
+
var React51 = __toESM(require("react"), 1);
|
|
8446
|
+
var BottomNav = React51.forwardRef(function BottomNav2(props, ref) {
|
|
8326
8447
|
const t = useStrings();
|
|
8327
8448
|
const Link = useLinkComponent(props.linkComponent);
|
|
8328
8449
|
const st = useMaybeControlled(
|
|
@@ -8332,14 +8453,36 @@ var BottomNav = React50.forwardRef(function BottomNav2(props, ref) {
|
|
|
8332
8453
|
);
|
|
8333
8454
|
const active = st[0];
|
|
8334
8455
|
const hide2 = props.hideFrom === false ? "always" : "below-" + (props.hideFrom || "lg");
|
|
8335
|
-
|
|
8456
|
+
const own = React51.useRef(null);
|
|
8457
|
+
const hf = props.hideFrom === false ? null : props.hideFrom || "lg";
|
|
8458
|
+
const away = useHideOnScroll(
|
|
8459
|
+
!!props.hideOnScroll,
|
|
8460
|
+
own,
|
|
8461
|
+
hf ? "(max-width: " + (breakpoints[hf] - 0.02) + "px)" : "all",
|
|
8462
|
+
64
|
|
8463
|
+
);
|
|
8464
|
+
const setRef = React51.useCallback(
|
|
8465
|
+
function(el) {
|
|
8466
|
+
own.current = el;
|
|
8467
|
+
if (typeof ref === "function") ref(el);
|
|
8468
|
+
else if (ref) ref.current = el;
|
|
8469
|
+
},
|
|
8470
|
+
[ref]
|
|
8471
|
+
);
|
|
8472
|
+
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(
|
|
8336
8473
|
"nav",
|
|
8337
8474
|
{
|
|
8338
|
-
ref,
|
|
8339
|
-
className: cx(
|
|
8475
|
+
ref: setRef,
|
|
8476
|
+
className: cx(
|
|
8477
|
+
"aura-bottomnav",
|
|
8478
|
+
"aura-bottomnav--" + hide2,
|
|
8479
|
+
props.hideOnScroll && "aura-bottomnav--hides",
|
|
8480
|
+
away && "is-away",
|
|
8481
|
+
props.className
|
|
8482
|
+
),
|
|
8340
8483
|
"aria-label": props.label || t.mainNav
|
|
8341
8484
|
},
|
|
8342
|
-
/* @__PURE__ */
|
|
8485
|
+
/* @__PURE__ */ React51.createElement("ul", { className: "aura-bottomnav__list" }, props.items.map(function(it) {
|
|
8343
8486
|
if (it.ariaLabel && typeof it.label === "string" && it.ariaLabel.toLowerCase().indexOf(it.label.toLowerCase()) < 0)
|
|
8344
8487
|
devWarnOnce(
|
|
8345
8488
|
"bottomnav-label-" + it.id,
|
|
@@ -8360,20 +8503,20 @@ var BottomNav = React50.forwardRef(function BottomNav2(props, ref) {
|
|
|
8360
8503
|
}
|
|
8361
8504
|
};
|
|
8362
8505
|
const inner = [
|
|
8363
|
-
/* @__PURE__ */
|
|
8364
|
-
it.ariaLabel ? /* @__PURE__ */
|
|
8365
|
-
/* @__PURE__ */
|
|
8366
|
-
suffix && !it.ariaLabel ? /* @__PURE__ */
|
|
8506
|
+
/* @__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),
|
|
8507
|
+
it.ariaLabel ? /* @__PURE__ */ React51.createElement("span", { key: "n", className: "aura-sr-only" }, it.ariaLabel + suffix) : null,
|
|
8508
|
+
/* @__PURE__ */ React51.createElement("span", { key: "l", className: "aura-bottomnav__label", "aria-hidden": it.ariaLabel ? true : void 0 }, it.label),
|
|
8509
|
+
suffix && !it.ariaLabel ? /* @__PURE__ */ React51.createElement("span", { key: "s", className: "aura-sr-only" }, suffix) : null
|
|
8367
8510
|
];
|
|
8368
|
-
return /* @__PURE__ */
|
|
8511
|
+
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));
|
|
8369
8512
|
}))
|
|
8370
8513
|
));
|
|
8371
8514
|
});
|
|
8372
8515
|
|
|
8373
8516
|
// src/Surface.tsx
|
|
8374
|
-
var
|
|
8375
|
-
var h10 =
|
|
8376
|
-
var Surface =
|
|
8517
|
+
var React52 = __toESM(require("react"), 1);
|
|
8518
|
+
var h10 = React52.createElement;
|
|
8519
|
+
var Surface = React52.forwardRef(function Surface2(props, ref) {
|
|
8377
8520
|
const t = props.texture || "mesh";
|
|
8378
8521
|
const rest = omit(props, ["texture", "className", "children", "as"]);
|
|
8379
8522
|
return h10(
|
|
@@ -8394,14 +8537,14 @@ var Surface = React51.forwardRef(function Surface2(props, ref) {
|
|
|
8394
8537
|
});
|
|
8395
8538
|
|
|
8396
8539
|
// src/Stat.tsx
|
|
8397
|
-
var
|
|
8398
|
-
var Stat =
|
|
8540
|
+
var React53 = __toESM(require("react"), 1);
|
|
8541
|
+
var Stat = React53.forwardRef(function Stat2(props, ref) {
|
|
8399
8542
|
const Link = useLinkComponent(props.linkComponent);
|
|
8400
8543
|
return statElement(props, ref, Link);
|
|
8401
8544
|
});
|
|
8402
8545
|
|
|
8403
8546
|
// src/TimePicker.tsx
|
|
8404
|
-
var
|
|
8547
|
+
var React54 = __toESM(require("react"), 1);
|
|
8405
8548
|
var import_react_dom12 = require("react-dom");
|
|
8406
8549
|
|
|
8407
8550
|
// src/text.ts
|
|
@@ -8443,7 +8586,7 @@ function toMin(t) {
|
|
|
8443
8586
|
function fromMin(n3) {
|
|
8444
8587
|
return pad3(Math.floor(n3 / 60)) + ":" + pad3(n3 % 60);
|
|
8445
8588
|
}
|
|
8446
|
-
var TimePicker =
|
|
8589
|
+
var TimePicker = React54.forwardRef(function TimePicker2(props, ref) {
|
|
8447
8590
|
const t = useStrings();
|
|
8448
8591
|
const auto = uid(), id = props.id || auto, listId = id + "-list";
|
|
8449
8592
|
const st = useMaybeControlled(
|
|
@@ -8453,7 +8596,7 @@ var TimePicker = React53.forwardRef(function TimePicker2(props, ref) {
|
|
|
8453
8596
|
);
|
|
8454
8597
|
const value = st[0];
|
|
8455
8598
|
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;
|
|
8456
|
-
const slots =
|
|
8599
|
+
const slots = React54.useMemo(
|
|
8457
8600
|
function() {
|
|
8458
8601
|
const out = [];
|
|
8459
8602
|
for (let m = lo; m <= hi; m += step) out.push(fromMin(m));
|
|
@@ -8465,12 +8608,12 @@ var TimePicker = React53.forwardRef(function TimePicker2(props, ref) {
|
|
|
8465
8608
|
const n3 = toMin(v);
|
|
8466
8609
|
return n3 == null || n3 < lo || n3 > hi || props.isTimeDisabled && props.isTimeDisabled(v);
|
|
8467
8610
|
}
|
|
8468
|
-
const openState =
|
|
8469
|
-
const editState =
|
|
8470
|
-
const aState =
|
|
8471
|
-
const errState =
|
|
8472
|
-
const pos =
|
|
8473
|
-
const boxRef =
|
|
8611
|
+
const openState = React54.useState(false), open = openState[0], setOpen = openState[1];
|
|
8612
|
+
const editState = React54.useState(null), editing = editState[0], setEditing = editState[1];
|
|
8613
|
+
const aState = React54.useState(0), active = aState[0], setActive = aState[1];
|
|
8614
|
+
const errState = React54.useState(null);
|
|
8615
|
+
const pos = React54.useState(null);
|
|
8616
|
+
const boxRef = React54.useRef(null), inputRef = React54.useRef(null), listRef = React54.useRef(null), inputMerged = useMergedRef(ref, inputRef);
|
|
8474
8617
|
const mounted = useMounted();
|
|
8475
8618
|
function nearest(v) {
|
|
8476
8619
|
const n3 = toMin(v);
|
|
@@ -8498,7 +8641,7 @@ var TimePicker = React53.forwardRef(function TimePicker2(props, ref) {
|
|
|
8498
8641
|
},
|
|
8499
8642
|
[open]
|
|
8500
8643
|
);
|
|
8501
|
-
|
|
8644
|
+
React54.useEffect(
|
|
8502
8645
|
function() {
|
|
8503
8646
|
if (!open) return;
|
|
8504
8647
|
function outside(e) {
|
|
@@ -8520,7 +8663,7 @@ var TimePicker = React53.forwardRef(function TimePicker2(props, ref) {
|
|
|
8520
8663
|
},
|
|
8521
8664
|
[open]
|
|
8522
8665
|
);
|
|
8523
|
-
|
|
8666
|
+
React54.useEffect(
|
|
8524
8667
|
function() {
|
|
8525
8668
|
if (!open || !listRef.current) return;
|
|
8526
8669
|
const el = listRef.current.querySelector('[data-idx="' + active + '"]');
|
|
@@ -8619,9 +8762,9 @@ var TimePicker = React53.forwardRef(function TimePicker2(props, ref) {
|
|
|
8619
8762
|
}
|
|
8620
8763
|
const error = errState[0] || props.error;
|
|
8621
8764
|
const list = open && mounted && pos[0] ? (0, import_react_dom12.createPortal)(
|
|
8622
|
-
/* @__PURE__ */
|
|
8765
|
+
/* @__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) {
|
|
8623
8766
|
const dis = blocked(s), sel = s === value;
|
|
8624
|
-
return /* @__PURE__ */
|
|
8767
|
+
return /* @__PURE__ */ React54.createElement(
|
|
8625
8768
|
"li",
|
|
8626
8769
|
{
|
|
8627
8770
|
key: s,
|
|
@@ -8646,13 +8789,13 @@ var TimePicker = React53.forwardRef(function TimePicker2(props, ref) {
|
|
|
8646
8789
|
if (active !== i) setActive(i);
|
|
8647
8790
|
}
|
|
8648
8791
|
},
|
|
8649
|
-
/* @__PURE__ */
|
|
8650
|
-
sel ? /* @__PURE__ */
|
|
8792
|
+
/* @__PURE__ */ React54.createElement("span", { className: "aura-combo__label" }, s),
|
|
8793
|
+
sel ? /* @__PURE__ */ React54.createElement(Icon, { name: /* @__PURE__ */ React54.createElement(IconCheck, null), className: "aura-combo__check" }) : null
|
|
8651
8794
|
);
|
|
8652
8795
|
}))),
|
|
8653
8796
|
document.body
|
|
8654
8797
|
) : null;
|
|
8655
|
-
return /* @__PURE__ */
|
|
8798
|
+
return /* @__PURE__ */ React54.createElement(
|
|
8656
8799
|
Field,
|
|
8657
8800
|
{
|
|
8658
8801
|
id,
|
|
@@ -8664,7 +8807,7 @@ var TimePicker = React53.forwardRef(function TimePicker2(props, ref) {
|
|
|
8664
8807
|
disabled: props.disabled,
|
|
8665
8808
|
className: props.className
|
|
8666
8809
|
},
|
|
8667
|
-
/* @__PURE__ */
|
|
8810
|
+
/* @__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(
|
|
8668
8811
|
"input",
|
|
8669
8812
|
{
|
|
8670
8813
|
ref: inputMerged,
|
|
@@ -8704,7 +8847,7 @@ var TimePicker = React53.forwardRef(function TimePicker2(props, ref) {
|
|
|
8704
8847
|
}, 0);
|
|
8705
8848
|
}
|
|
8706
8849
|
}
|
|
8707
|
-
), props.clearable !== false && value != null && !props.disabled ? /* @__PURE__ */
|
|
8850
|
+
), props.clearable !== false && value != null && !props.disabled ? /* @__PURE__ */ React54.createElement(
|
|
8708
8851
|
"button",
|
|
8709
8852
|
{
|
|
8710
8853
|
type: "button",
|
|
@@ -8717,8 +8860,8 @@ var TimePicker = React53.forwardRef(function TimePicker2(props, ref) {
|
|
|
8717
8860
|
if (inputRef.current) inputRef.current.focus();
|
|
8718
8861
|
}
|
|
8719
8862
|
},
|
|
8720
|
-
/* @__PURE__ */
|
|
8721
|
-
) : null, /* @__PURE__ */
|
|
8863
|
+
/* @__PURE__ */ React54.createElement(Icon, { name: /* @__PURE__ */ React54.createElement(IconX, null) })
|
|
8864
|
+
) : null, /* @__PURE__ */ React54.createElement(
|
|
8722
8865
|
"button",
|
|
8723
8866
|
{
|
|
8724
8867
|
type: "button",
|
|
@@ -8736,14 +8879,14 @@ var TimePicker = React53.forwardRef(function TimePicker2(props, ref) {
|
|
|
8736
8879
|
}
|
|
8737
8880
|
}
|
|
8738
8881
|
},
|
|
8739
|
-
/* @__PURE__ */
|
|
8882
|
+
/* @__PURE__ */ React54.createElement(Icon, { name: /* @__PURE__ */ React54.createElement(IconChevronDown, null) })
|
|
8740
8883
|
)),
|
|
8741
8884
|
list
|
|
8742
8885
|
);
|
|
8743
8886
|
});
|
|
8744
8887
|
|
|
8745
8888
|
// src/FileUpload.tsx
|
|
8746
|
-
var
|
|
8889
|
+
var React55 = __toESM(require("react"), 1);
|
|
8747
8890
|
function matches(file, accept) {
|
|
8748
8891
|
if (!accept) return true;
|
|
8749
8892
|
const name = (file.name || "").toLowerCase(), type = (file.type || "").toLowerCase();
|
|
@@ -8767,24 +8910,24 @@ function describeAccept(accept, t) {
|
|
|
8767
8910
|
}).join(", ");
|
|
8768
8911
|
}
|
|
8769
8912
|
var seq = 0;
|
|
8770
|
-
var FileUpload =
|
|
8913
|
+
var FileUpload = React55.forwardRef(function FileUpload2(props, ref) {
|
|
8771
8914
|
const t = useStrings();
|
|
8772
8915
|
const auto = uid(), id = props.id || auto;
|
|
8773
8916
|
const st = useMaybeControlled(props.value, props.defaultValue || [], props.onChange);
|
|
8774
8917
|
const items2 = st[0] || [];
|
|
8775
|
-
const dragState =
|
|
8776
|
-
const inputRef =
|
|
8777
|
-
const urls =
|
|
8918
|
+
const dragState = React55.useState(false), over = dragState[0];
|
|
8919
|
+
const inputRef = React55.useRef(null), inputMerged = useMergedRef(ref, inputRef);
|
|
8920
|
+
const urls = React55.useRef({});
|
|
8778
8921
|
const maxFiles = props.multiple ? props.maxFiles : 1;
|
|
8779
8922
|
const note = t.accepts(describeAccept(props.accept, t), props.maxSize ? formatBytes(props.maxSize) : "");
|
|
8780
|
-
|
|
8923
|
+
React55.useEffect(function() {
|
|
8781
8924
|
return function() {
|
|
8782
8925
|
Object.keys(urls.current).forEach(function(k) {
|
|
8783
8926
|
URL.revokeObjectURL(urls.current[k]);
|
|
8784
8927
|
});
|
|
8785
8928
|
};
|
|
8786
8929
|
}, []);
|
|
8787
|
-
|
|
8930
|
+
React55.useEffect(
|
|
8788
8931
|
function() {
|
|
8789
8932
|
const el = inputRef.current;
|
|
8790
8933
|
if (!el || !props.name || typeof DataTransfer === "undefined") return;
|
|
@@ -8844,7 +8987,7 @@ var FileUpload = React54.forwardRef(function FileUpload2(props, ref) {
|
|
|
8844
8987
|
if (inputRef.current) inputRef.current.focus();
|
|
8845
8988
|
}
|
|
8846
8989
|
const error = props.error;
|
|
8847
|
-
return /* @__PURE__ */
|
|
8990
|
+
return /* @__PURE__ */ React55.createElement(
|
|
8848
8991
|
Field,
|
|
8849
8992
|
{
|
|
8850
8993
|
id,
|
|
@@ -8856,7 +8999,7 @@ var FileUpload = React54.forwardRef(function FileUpload2(props, ref) {
|
|
|
8856
8999
|
disabled: props.disabled,
|
|
8857
9000
|
className: props.className
|
|
8858
9001
|
},
|
|
8859
|
-
/* @__PURE__ */
|
|
9002
|
+
/* @__PURE__ */ React55.createElement(
|
|
8860
9003
|
"div",
|
|
8861
9004
|
{
|
|
8862
9005
|
className: cx("aura-upload", over && "is-over", props.disabled && "is-disabled", error && "is-invalid"),
|
|
@@ -8877,9 +9020,9 @@ var FileUpload = React54.forwardRef(function FileUpload2(props, ref) {
|
|
|
8877
9020
|
add(e.dataTransfer && e.dataTransfer.files);
|
|
8878
9021
|
}
|
|
8879
9022
|
},
|
|
8880
|
-
/* @__PURE__ */
|
|
8881
|
-
/* @__PURE__ */
|
|
8882
|
-
/* @__PURE__ */
|
|
9023
|
+
/* @__PURE__ */ React55.createElement(Icon, { name: /* @__PURE__ */ React55.createElement(IconCloudUpload, null), size: "lg", className: "aura-upload__icon" }),
|
|
9024
|
+
/* @__PURE__ */ React55.createElement("span", { className: "aura-upload__text" }, t.dropFiles, " "),
|
|
9025
|
+
/* @__PURE__ */ React55.createElement(
|
|
8883
9026
|
"input",
|
|
8884
9027
|
{
|
|
8885
9028
|
ref: inputMerged,
|
|
@@ -8901,12 +9044,12 @@ var FileUpload = React54.forwardRef(function FileUpload2(props, ref) {
|
|
|
8901
9044
|
}
|
|
8902
9045
|
}
|
|
8903
9046
|
),
|
|
8904
|
-
/* @__PURE__ */
|
|
8905
|
-
note ? /* @__PURE__ */
|
|
9047
|
+
/* @__PURE__ */ React55.createElement("span", { className: "aura-upload__browse", "aria-hidden": true }, props.multiple ? t.browse : t.browseOne),
|
|
9048
|
+
note ? /* @__PURE__ */ React55.createElement("span", { className: "aura-upload__note", id: id + "-note" }, note) : null
|
|
8906
9049
|
),
|
|
8907
|
-
items2.length ? /* @__PURE__ */
|
|
9050
|
+
items2.length ? /* @__PURE__ */ React55.createElement("ul", { className: "aura-upload__list", "aria-live": "polite" }, items2.map(function(it) {
|
|
8908
9051
|
const src = thumb(it);
|
|
8909
|
-
return /* @__PURE__ */
|
|
9052
|
+
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(
|
|
8910
9053
|
"span",
|
|
8911
9054
|
{
|
|
8912
9055
|
className: "aura-upload__bar",
|
|
@@ -8916,11 +9059,11 @@ var FileUpload = React54.forwardRef(function FileUpload2(props, ref) {
|
|
|
8916
9059
|
"aria-valuemax": 100,
|
|
8917
9060
|
"aria-valuenow": it.progress != null ? Math.round(it.progress) : void 0
|
|
8918
9061
|
},
|
|
8919
|
-
/* @__PURE__ */
|
|
8920
|
-
) : null), /* @__PURE__ */
|
|
9062
|
+
/* @__PURE__ */ React55.createElement("span", { style: { width: (it.progress || 0) + "%" } })
|
|
9063
|
+
) : null), /* @__PURE__ */ React55.createElement(
|
|
8921
9064
|
IconButton,
|
|
8922
9065
|
{
|
|
8923
|
-
icon: /* @__PURE__ */
|
|
9066
|
+
icon: /* @__PURE__ */ React55.createElement(IconX, null),
|
|
8924
9067
|
label: t.remove(it.name),
|
|
8925
9068
|
onClick: function() {
|
|
8926
9069
|
remove(it);
|
|
@@ -9236,9 +9379,9 @@ function createTheme(opts) {
|
|
|
9236
9379
|
}
|
|
9237
9380
|
|
|
9238
9381
|
// src/ThemeStyle.tsx
|
|
9239
|
-
var
|
|
9382
|
+
var React56 = __toESM(require("react"), 1);
|
|
9240
9383
|
function ThemeStyle(props) {
|
|
9241
|
-
const css =
|
|
9384
|
+
const css = React56.useMemo(
|
|
9242
9385
|
function() {
|
|
9243
9386
|
try {
|
|
9244
9387
|
return createTheme({
|
|
@@ -9255,11 +9398,11 @@ function ThemeStyle(props) {
|
|
|
9255
9398
|
[props.brand, props.signal, props.primary, props.name, props.selector]
|
|
9256
9399
|
);
|
|
9257
9400
|
if (css === null) return null;
|
|
9258
|
-
return /* @__PURE__ */
|
|
9401
|
+
return /* @__PURE__ */ React56.createElement("style", { "data-aura-theme": props.name || props.brand, dangerouslySetInnerHTML: { __html: css } });
|
|
9259
9402
|
}
|
|
9260
9403
|
|
|
9261
9404
|
// src/colorScheme.tsx
|
|
9262
|
-
var
|
|
9405
|
+
var React57 = __toESM(require("react"), 1);
|
|
9263
9406
|
|
|
9264
9407
|
// src/colorSchemeScript.ts
|
|
9265
9408
|
var DEFAULT_KEY = "aura-color-scheme";
|
|
@@ -9276,7 +9419,7 @@ function colorSchemeScript(options) {
|
|
|
9276
9419
|
|
|
9277
9420
|
// src/colorScheme.tsx
|
|
9278
9421
|
function ColorSchemeScript(props) {
|
|
9279
|
-
return /* @__PURE__ */
|
|
9422
|
+
return /* @__PURE__ */ React57.createElement(
|
|
9280
9423
|
"script",
|
|
9281
9424
|
{
|
|
9282
9425
|
"data-aura-color-scheme": "",
|
|
@@ -9301,7 +9444,7 @@ function apply(scheme) {
|
|
|
9301
9444
|
function useColorScheme(options) {
|
|
9302
9445
|
const key = options && options.storageKey || DEFAULT_KEY;
|
|
9303
9446
|
const fallback = options && options.defaultScheme || "system";
|
|
9304
|
-
const subscribe2 =
|
|
9447
|
+
const subscribe2 = React57.useCallback(
|
|
9305
9448
|
function(cb) {
|
|
9306
9449
|
const mq = window.matchMedia ? window.matchMedia("(prefers-color-scheme: dark)") : null;
|
|
9307
9450
|
function onSystem() {
|
|
@@ -9323,7 +9466,7 @@ function useColorScheme(options) {
|
|
|
9323
9466
|
},
|
|
9324
9467
|
[fallback, key]
|
|
9325
9468
|
);
|
|
9326
|
-
const snapshot =
|
|
9469
|
+
const snapshot = React57.useSyncExternalStore(
|
|
9327
9470
|
subscribe2,
|
|
9328
9471
|
function() {
|
|
9329
9472
|
const s = readScheme(fallback);
|
|
@@ -9334,7 +9477,7 @@ function useColorScheme(options) {
|
|
|
9334
9477
|
}
|
|
9335
9478
|
);
|
|
9336
9479
|
const parts = snapshot.split("|");
|
|
9337
|
-
const setScheme =
|
|
9480
|
+
const setScheme = React57.useCallback(
|
|
9338
9481
|
function(next) {
|
|
9339
9482
|
if (!valid(next)) return;
|
|
9340
9483
|
try {
|
|
@@ -9353,14 +9496,14 @@ function ColorSchemeToggle(props) {
|
|
|
9353
9496
|
const cs = useColorScheme(props);
|
|
9354
9497
|
const names = { light: t.schemeLight, dark: t.schemeDark, system: t.schemeSystem };
|
|
9355
9498
|
const label = props.label || t.colorScheme;
|
|
9356
|
-
return /* @__PURE__ */
|
|
9499
|
+
return /* @__PURE__ */ React57.createElement(
|
|
9357
9500
|
DropdownMenu,
|
|
9358
9501
|
{
|
|
9359
9502
|
label,
|
|
9360
|
-
trigger: /* @__PURE__ */
|
|
9503
|
+
trigger: /* @__PURE__ */ React57.createElement(
|
|
9361
9504
|
IconButton,
|
|
9362
9505
|
{
|
|
9363
|
-
icon: cs.resolved === "dark" ? /* @__PURE__ */
|
|
9506
|
+
icon: cs.resolved === "dark" ? /* @__PURE__ */ React57.createElement(IconMoon, null) : /* @__PURE__ */ React57.createElement(IconSun, null),
|
|
9364
9507
|
label: label + ": " + names[cs.scheme]
|
|
9365
9508
|
}
|
|
9366
9509
|
),
|
|
@@ -9378,14 +9521,14 @@ function ColorSchemeToggle(props) {
|
|
|
9378
9521
|
}
|
|
9379
9522
|
|
|
9380
9523
|
// src/Badge.tsx
|
|
9381
|
-
var
|
|
9382
|
-
var Badge =
|
|
9524
|
+
var React58 = __toESM(require("react"), 1);
|
|
9525
|
+
var Badge = React58.forwardRef(function Badge2(props, ref) {
|
|
9383
9526
|
return badgeElement(props, ref);
|
|
9384
9527
|
});
|
|
9385
9528
|
|
|
9386
9529
|
// src/Progress.tsx
|
|
9387
|
-
var
|
|
9388
|
-
var Progress =
|
|
9530
|
+
var React59 = __toESM(require("react"), 1);
|
|
9531
|
+
var Progress = React59.forwardRef(function Progress2(props, ref) {
|
|
9389
9532
|
const t = useStrings();
|
|
9390
9533
|
const auto = uid(), id = props.id || auto;
|
|
9391
9534
|
const max = props.max || 100, det = props.value != null;
|
|
@@ -9394,7 +9537,7 @@ var Progress = React58.forwardRef(function Progress2(props, ref) {
|
|
|
9394
9537
|
const spct = sec ? Math.max(0, Math.min(100 - pct, sec / max * 100)) : 0;
|
|
9395
9538
|
const valueText = props.valueText != null ? props.valueText : props.valueLabel != null ? String(props.valueLabel) : sec ? t.progressReserved(props.value, sec, max) : void 0;
|
|
9396
9539
|
const shown = props.valueLabel != null ? props.valueLabel : det ? Math.round(pct) + "%" : null;
|
|
9397
|
-
return /* @__PURE__ */
|
|
9540
|
+
return /* @__PURE__ */ React59.createElement(
|
|
9398
9541
|
"div",
|
|
9399
9542
|
{
|
|
9400
9543
|
ref,
|
|
@@ -9405,8 +9548,8 @@ var Progress = React58.forwardRef(function Progress2(props, ref) {
|
|
|
9405
9548
|
props.className
|
|
9406
9549
|
)
|
|
9407
9550
|
},
|
|
9408
|
-
props.label || props.showValue && shown ? /* @__PURE__ */
|
|
9409
|
-
/* @__PURE__ */
|
|
9551
|
+
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,
|
|
9552
|
+
/* @__PURE__ */ React59.createElement(
|
|
9410
9553
|
"div",
|
|
9411
9554
|
{
|
|
9412
9555
|
className: cx("aura-progress__track", !det && "is-indeterminate"),
|
|
@@ -9418,8 +9561,8 @@ var Progress = React58.forwardRef(function Progress2(props, ref) {
|
|
|
9418
9561
|
"aria-valuenow": det ? props.value : void 0,
|
|
9419
9562
|
"aria-valuetext": det ? valueText : void 0
|
|
9420
9563
|
},
|
|
9421
|
-
/* @__PURE__ */
|
|
9422
|
-
sec ? /* @__PURE__ */
|
|
9564
|
+
/* @__PURE__ */ React59.createElement("span", { className: "aura-progress__bar", style: det ? { width: pct + "%" } : void 0 }),
|
|
9565
|
+
sec ? /* @__PURE__ */ React59.createElement(
|
|
9423
9566
|
"span",
|
|
9424
9567
|
{
|
|
9425
9568
|
className: "aura-progress__bar aura-progress__bar--reserved",
|
|
@@ -9427,19 +9570,19 @@ var Progress = React58.forwardRef(function Progress2(props, ref) {
|
|
|
9427
9570
|
}
|
|
9428
9571
|
) : null
|
|
9429
9572
|
),
|
|
9430
|
-
props.hint ? /* @__PURE__ */
|
|
9573
|
+
props.hint ? /* @__PURE__ */ React59.createElement("p", { className: "aura-progress__hint" }, props.hint) : null
|
|
9431
9574
|
);
|
|
9432
9575
|
});
|
|
9433
9576
|
|
|
9434
9577
|
// src/Skeleton.tsx
|
|
9435
|
-
var
|
|
9436
|
-
var Skeleton =
|
|
9578
|
+
var React60 = __toESM(require("react"), 1);
|
|
9579
|
+
var Skeleton = React60.forwardRef(function Skeleton2(props, ref) {
|
|
9437
9580
|
const v = props.variant || "text";
|
|
9438
9581
|
if (v === "text" && (props.lines || 1) > 1) {
|
|
9439
9582
|
const n3 = props.lines, rows = [];
|
|
9440
9583
|
for (let i = 0; i < n3; i++)
|
|
9441
|
-
rows.push(/* @__PURE__ */
|
|
9442
|
-
return /* @__PURE__ */
|
|
9584
|
+
rows.push(/* @__PURE__ */ React60.createElement("span", { key: i, className: "aura-skel aura-skel--text", style: { width: i === n3 - 1 ? "60%" : "100%" } }));
|
|
9585
|
+
return /* @__PURE__ */ React60.createElement(
|
|
9443
9586
|
"span",
|
|
9444
9587
|
{
|
|
9445
9588
|
ref,
|
|
@@ -9457,17 +9600,17 @@ var Skeleton = React59.forwardRef(function Skeleton2(props, ref) {
|
|
|
9457
9600
|
if (v === "circle") {
|
|
9458
9601
|
style.width = style.height = props.size || props.width || 40;
|
|
9459
9602
|
}
|
|
9460
|
-
return /* @__PURE__ */
|
|
9603
|
+
return /* @__PURE__ */ React60.createElement("span", { ref, "aria-hidden": true, className: cx("aura-skel", "aura-skel--" + v, props.className), style });
|
|
9461
9604
|
});
|
|
9462
9605
|
|
|
9463
9606
|
// src/EmptyState.tsx
|
|
9464
|
-
var
|
|
9465
|
-
var EmptyState =
|
|
9607
|
+
var React61 = __toESM(require("react"), 1);
|
|
9608
|
+
var EmptyState = React61.forwardRef(function EmptyState2(props, ref) {
|
|
9466
9609
|
return emptyStateElement(props, ref);
|
|
9467
9610
|
});
|
|
9468
9611
|
|
|
9469
9612
|
// src/Pagination.tsx
|
|
9470
|
-
var
|
|
9613
|
+
var React62 = __toESM(require("react"), 1);
|
|
9471
9614
|
function pageList(page, count, sib) {
|
|
9472
9615
|
let out = [], lo = Math.max(2, page - sib), hi = Math.min(count - 1, page + sib);
|
|
9473
9616
|
if (page - sib <= 3) {
|
|
@@ -9487,7 +9630,7 @@ function pageList(page, count, sib) {
|
|
|
9487
9630
|
if (count > 1) out.push(count);
|
|
9488
9631
|
return out;
|
|
9489
9632
|
}
|
|
9490
|
-
var Pagination =
|
|
9633
|
+
var Pagination = React62.forwardRef(function Pagination2(props, ref) {
|
|
9491
9634
|
const t = useStrings();
|
|
9492
9635
|
useAutoTip();
|
|
9493
9636
|
const count = Math.max(1, props.pageCount || 1);
|
|
@@ -9507,7 +9650,7 @@ var Pagination = React61.forwardRef(function Pagination2(props, ref) {
|
|
|
9507
9650
|
},
|
|
9508
9651
|
extra
|
|
9509
9652
|
);
|
|
9510
|
-
return link ? /* @__PURE__ */
|
|
9653
|
+
return link ? /* @__PURE__ */ React62.createElement(
|
|
9511
9654
|
Link,
|
|
9512
9655
|
{
|
|
9513
9656
|
href: link(p),
|
|
@@ -9520,7 +9663,7 @@ var Pagination = React61.forwardRef(function Pagination2(props, ref) {
|
|
|
9520
9663
|
...common
|
|
9521
9664
|
},
|
|
9522
9665
|
label
|
|
9523
|
-
) : /* @__PURE__ */
|
|
9666
|
+
) : /* @__PURE__ */ React62.createElement(
|
|
9524
9667
|
"button",
|
|
9525
9668
|
{
|
|
9526
9669
|
type: "button",
|
|
@@ -9534,7 +9677,7 @@ var Pagination = React61.forwardRef(function Pagination2(props, ref) {
|
|
|
9534
9677
|
}
|
|
9535
9678
|
function arrow(p, icon, label, rel, disabled) {
|
|
9536
9679
|
if (!link || disabled)
|
|
9537
|
-
return /* @__PURE__ */
|
|
9680
|
+
return /* @__PURE__ */ React62.createElement(
|
|
9538
9681
|
IconButton,
|
|
9539
9682
|
{
|
|
9540
9683
|
icon,
|
|
@@ -9545,7 +9688,7 @@ var Pagination = React61.forwardRef(function Pagination2(props, ref) {
|
|
|
9545
9688
|
}
|
|
9546
9689
|
}
|
|
9547
9690
|
);
|
|
9548
|
-
return /* @__PURE__ */
|
|
9691
|
+
return /* @__PURE__ */ React62.createElement(
|
|
9549
9692
|
Link,
|
|
9550
9693
|
{
|
|
9551
9694
|
href: link(p),
|
|
@@ -9560,17 +9703,17 @@ var Pagination = React61.forwardRef(function Pagination2(props, ref) {
|
|
|
9560
9703
|
}
|
|
9561
9704
|
}
|
|
9562
9705
|
},
|
|
9563
|
-
/* @__PURE__ */
|
|
9706
|
+
/* @__PURE__ */ React62.createElement(Icon, { name: icon, size: "sm" })
|
|
9564
9707
|
);
|
|
9565
9708
|
}
|
|
9566
|
-
return /* @__PURE__ */
|
|
9567
|
-
return typeof p === "number" ? /* @__PURE__ */
|
|
9568
|
-
})), /* @__PURE__ */
|
|
9709
|
+
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) {
|
|
9710
|
+
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");
|
|
9711
|
+
})), /* @__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));
|
|
9569
9712
|
});
|
|
9570
9713
|
|
|
9571
9714
|
// src/Accordion.tsx
|
|
9572
|
-
var
|
|
9573
|
-
var Accordion =
|
|
9715
|
+
var React63 = __toESM(require("react"), 1);
|
|
9716
|
+
var Accordion = React63.forwardRef(function Accordion2(props, ref) {
|
|
9574
9717
|
const auto = uid(), base = props.id || auto;
|
|
9575
9718
|
const multiple = props.type === "multiple";
|
|
9576
9719
|
const st = useMaybeControlled(
|
|
@@ -9608,9 +9751,9 @@ var Accordion = React62.forwardRef(function Accordion2(props, ref) {
|
|
|
9608
9751
|
n3.focus();
|
|
9609
9752
|
}
|
|
9610
9753
|
}
|
|
9611
|
-
return /* @__PURE__ */
|
|
9754
|
+
return /* @__PURE__ */ React63.createElement("div", { ref, className: cx("aura-accordion", props.className), onKeyDown: onKey }, items2.map(function(it) {
|
|
9612
9755
|
const on = open.indexOf(it.id) >= 0, bid = base + "-btn-" + it.id, pid = base + "-panel-" + it.id;
|
|
9613
|
-
return /* @__PURE__ */
|
|
9756
|
+
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(
|
|
9614
9757
|
"button",
|
|
9615
9758
|
{
|
|
9616
9759
|
type: "button",
|
|
@@ -9623,10 +9766,10 @@ var Accordion = React62.forwardRef(function Accordion2(props, ref) {
|
|
|
9623
9766
|
toggle(it.id);
|
|
9624
9767
|
}
|
|
9625
9768
|
},
|
|
9626
|
-
it.icon ? /* @__PURE__ */
|
|
9627
|
-
/* @__PURE__ */
|
|
9628
|
-
/* @__PURE__ */
|
|
9629
|
-
)), /* @__PURE__ */
|
|
9769
|
+
it.icon ? /* @__PURE__ */ React63.createElement(Icon, { name: it.icon, className: "aura-accordion__lead" }) : null,
|
|
9770
|
+
/* @__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),
|
|
9771
|
+
/* @__PURE__ */ React63.createElement(Icon, { name: /* @__PURE__ */ React63.createElement(IconChevronDown, null), className: "aura-accordion__chevron" })
|
|
9772
|
+
)), /* @__PURE__ */ React63.createElement(
|
|
9630
9773
|
"div",
|
|
9631
9774
|
{
|
|
9632
9775
|
id: pid,
|
|
@@ -9641,7 +9784,7 @@ var Accordion = React62.forwardRef(function Accordion2(props, ref) {
|
|
|
9641
9784
|
});
|
|
9642
9785
|
|
|
9643
9786
|
// src/Popover.tsx
|
|
9644
|
-
var
|
|
9787
|
+
var React64 = __toESM(require("react"), 1);
|
|
9645
9788
|
var import_react_dom13 = require("react-dom");
|
|
9646
9789
|
function position(anchor, pop, placement) {
|
|
9647
9790
|
const r2 = anchor.getBoundingClientRect(), pw = pop.offsetWidth, ph = pop.scrollHeight, vw = window.innerWidth, vh = window.innerHeight, gap = 6;
|
|
@@ -9659,15 +9802,15 @@ function position(anchor, pop, placement) {
|
|
|
9659
9802
|
const left = align === "end" ? r2.right - pw : align === "center" ? r2.left + r2.width / 2 - pw / 2 : r2.left;
|
|
9660
9803
|
return { top: Math.max(8, top), left: Math.max(8, Math.min(left, vw - pw - 8)), side, maxHeight };
|
|
9661
9804
|
}
|
|
9662
|
-
var Popover =
|
|
9805
|
+
var Popover = React64.forwardRef(function Popover2(props, ref) {
|
|
9663
9806
|
const t = useStrings();
|
|
9664
9807
|
const density = useDensity();
|
|
9665
9808
|
const auto = uid(), id = props.id || auto;
|
|
9666
9809
|
const st = useMaybeControlled(props.open, !!props.defaultOpen, props.onOpenChange);
|
|
9667
9810
|
const open = !!st[0];
|
|
9668
|
-
const wrap =
|
|
9669
|
-
const pos =
|
|
9670
|
-
const inTree =
|
|
9811
|
+
const wrap = React64.useRef(null), pop = React64.useRef(null), popMerged = useMergedRef(ref, pop);
|
|
9812
|
+
const pos = React64.useState(null), mounted = useMounted();
|
|
9813
|
+
const inTree = React64.useRef(false);
|
|
9671
9814
|
function trigger() {
|
|
9672
9815
|
return wrap.current && (wrap.current.querySelector('button, [role="button"], a, input') || wrap.current.firstElementChild);
|
|
9673
9816
|
}
|
|
@@ -9694,7 +9837,7 @@ var Popover = React63.forwardRef(function Popover2(props, ref) {
|
|
|
9694
9837
|
},
|
|
9695
9838
|
[open, mounted, props.placement]
|
|
9696
9839
|
);
|
|
9697
|
-
|
|
9840
|
+
React64.useEffect(
|
|
9698
9841
|
function() {
|
|
9699
9842
|
if (!open || !mounted) return;
|
|
9700
9843
|
if (props.autoFocus !== false && pop.current) {
|
|
@@ -9719,9 +9862,9 @@ var Popover = React63.forwardRef(function Popover2(props, ref) {
|
|
|
9719
9862
|
},
|
|
9720
9863
|
[open, mounted]
|
|
9721
9864
|
);
|
|
9722
|
-
const child =
|
|
9865
|
+
const child = React64.Children.only(props.trigger);
|
|
9723
9866
|
const panel = open && mounted ? (0, import_react_dom13.createPortal)(
|
|
9724
|
-
/* @__PURE__ */
|
|
9867
|
+
/* @__PURE__ */ React64.createElement(
|
|
9725
9868
|
"div",
|
|
9726
9869
|
{
|
|
9727
9870
|
ref: popMerged,
|
|
@@ -9751,17 +9894,17 @@ var Popover = React63.forwardRef(function Popover2(props, ref) {
|
|
|
9751
9894
|
} else trapTab(e, pop.current);
|
|
9752
9895
|
}
|
|
9753
9896
|
},
|
|
9754
|
-
props.title ? /* @__PURE__ */
|
|
9897
|
+
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(
|
|
9755
9898
|
IconButton,
|
|
9756
9899
|
{
|
|
9757
|
-
icon: /* @__PURE__ */
|
|
9900
|
+
icon: /* @__PURE__ */ React64.createElement(IconX, null),
|
|
9758
9901
|
label: t.close,
|
|
9759
9902
|
onClick: function() {
|
|
9760
9903
|
close(true);
|
|
9761
9904
|
}
|
|
9762
9905
|
}
|
|
9763
9906
|
)) : null,
|
|
9764
|
-
/* @__PURE__ */
|
|
9907
|
+
/* @__PURE__ */ React64.createElement("div", { className: "aura-popover__body" }, typeof props.children === "function" ? props.children({
|
|
9765
9908
|
close: function() {
|
|
9766
9909
|
close(true);
|
|
9767
9910
|
}
|
|
@@ -9769,7 +9912,7 @@ var Popover = React63.forwardRef(function Popover2(props, ref) {
|
|
|
9769
9912
|
),
|
|
9770
9913
|
document.body
|
|
9771
9914
|
) : null;
|
|
9772
|
-
return /* @__PURE__ */
|
|
9915
|
+
return /* @__PURE__ */ React64.createElement("span", { ref: wrap, className: "aura-popover-anchor" }, React64.cloneElement(child, {
|
|
9773
9916
|
onClick: function(e) {
|
|
9774
9917
|
if (child.props.onClick) child.props.onClick(e);
|
|
9775
9918
|
st[1](!open);
|
|
@@ -9781,7 +9924,7 @@ var Popover = React63.forwardRef(function Popover2(props, ref) {
|
|
|
9781
9924
|
});
|
|
9782
9925
|
|
|
9783
9926
|
// src/NumberField.tsx
|
|
9784
|
-
var
|
|
9927
|
+
var React65 = __toESM(require("react"), 1);
|
|
9785
9928
|
function decimalsOf(n3) {
|
|
9786
9929
|
const s = String(n3);
|
|
9787
9930
|
const i = s.indexOf(".");
|
|
@@ -9794,7 +9937,7 @@ function parse(text2) {
|
|
|
9794
9937
|
if (!/^-?(\d+\.?\d*|\.\d+)$/.test(s)) return NaN;
|
|
9795
9938
|
return Number(s);
|
|
9796
9939
|
}
|
|
9797
|
-
var NumberField =
|
|
9940
|
+
var NumberField = React65.forwardRef(function NumberField2(props, ref) {
|
|
9798
9941
|
const t = useStrings();
|
|
9799
9942
|
const auto = uid(), id = props.id || auto;
|
|
9800
9943
|
const step = props.step || 1;
|
|
@@ -9805,7 +9948,7 @@ var NumberField = React64.forwardRef(function NumberField2(props, ref) {
|
|
|
9805
9948
|
props.onChange
|
|
9806
9949
|
);
|
|
9807
9950
|
const value = st[0], setValue = st[1];
|
|
9808
|
-
const draftState =
|
|
9951
|
+
const draftState = React65.useState(null), draft = draftState[0], setDraft = draftState[1];
|
|
9809
9952
|
function fmt2(n3) {
|
|
9810
9953
|
if (n3 == null || isNaN(n3)) return "";
|
|
9811
9954
|
return n3.toLocaleString("en", { minimumFractionDigits: decimals, maximumFractionDigits: decimals });
|
|
@@ -9854,7 +9997,7 @@ var NumberField = React64.forwardRef(function NumberField2(props, ref) {
|
|
|
9854
9997
|
};
|
|
9855
9998
|
const valueText = value == null ? void 0 : [affixText(props.prefix), fmt2(value), affixText(props.suffix)].join(" ").trim();
|
|
9856
9999
|
const stepper = props.stepper !== false && !props.readOnly;
|
|
9857
|
-
return /* @__PURE__ */
|
|
10000
|
+
return /* @__PURE__ */ React65.createElement(
|
|
9858
10001
|
Field,
|
|
9859
10002
|
{
|
|
9860
10003
|
id,
|
|
@@ -9866,7 +10009,7 @@ var NumberField = React64.forwardRef(function NumberField2(props, ref) {
|
|
|
9866
10009
|
disabled: props.disabled,
|
|
9867
10010
|
className: props.className
|
|
9868
10011
|
},
|
|
9869
|
-
/* @__PURE__ */
|
|
10012
|
+
/* @__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(
|
|
9870
10013
|
"input",
|
|
9871
10014
|
{
|
|
9872
10015
|
ref,
|
|
@@ -9913,7 +10056,7 @@ var NumberField = React64.forwardRef(function NumberField2(props, ref) {
|
|
|
9913
10056
|
},
|
|
9914
10057
|
onKeyDown
|
|
9915
10058
|
}
|
|
9916
|
-
), props.suffix != null ? /* @__PURE__ */
|
|
10059
|
+
), 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(
|
|
9917
10060
|
"button",
|
|
9918
10061
|
{
|
|
9919
10062
|
type: "button",
|
|
@@ -9929,8 +10072,8 @@ var NumberField = React64.forwardRef(function NumberField2(props, ref) {
|
|
|
9929
10072
|
nudge(-step);
|
|
9930
10073
|
}
|
|
9931
10074
|
},
|
|
9932
|
-
/* @__PURE__ */
|
|
9933
|
-
), /* @__PURE__ */
|
|
10075
|
+
/* @__PURE__ */ React65.createElement(Icon, { name: /* @__PURE__ */ React65.createElement(IconMinus, null) })
|
|
10076
|
+
), /* @__PURE__ */ React65.createElement(
|
|
9934
10077
|
"button",
|
|
9935
10078
|
{
|
|
9936
10079
|
type: "button",
|
|
@@ -9946,14 +10089,14 @@ var NumberField = React64.forwardRef(function NumberField2(props, ref) {
|
|
|
9946
10089
|
nudge(step);
|
|
9947
10090
|
}
|
|
9948
10091
|
},
|
|
9949
|
-
/* @__PURE__ */
|
|
10092
|
+
/* @__PURE__ */ React65.createElement(Icon, { name: /* @__PURE__ */ React65.createElement(IconPlus, null) })
|
|
9950
10093
|
)) : null)
|
|
9951
10094
|
);
|
|
9952
10095
|
});
|
|
9953
10096
|
|
|
9954
10097
|
// src/Stepper.tsx
|
|
9955
|
-
var
|
|
9956
|
-
var Stepper =
|
|
10098
|
+
var React66 = __toESM(require("react"), 1);
|
|
10099
|
+
var Stepper = React66.forwardRef(function Stepper2(props, ref) {
|
|
9957
10100
|
const t = useStrings();
|
|
9958
10101
|
const idBase = uid();
|
|
9959
10102
|
const steps = props.steps || [];
|
|
@@ -9964,22 +10107,22 @@ var Stepper = React65.forwardRef(function Stepper2(props, ref) {
|
|
|
9964
10107
|
if (at < 0) at = 0;
|
|
9965
10108
|
const vertical = props.orientation === "vertical";
|
|
9966
10109
|
const cur2 = steps[at];
|
|
9967
|
-
return /* @__PURE__ */
|
|
10110
|
+
return /* @__PURE__ */ React66.createElement(
|
|
9968
10111
|
"nav",
|
|
9969
10112
|
{
|
|
9970
10113
|
ref,
|
|
9971
10114
|
"aria-label": props.label,
|
|
9972
10115
|
className: cx("aura-stepper", vertical ? "aura-stepper--vertical" : "aura-stepper--horizontal", props.className)
|
|
9973
10116
|
},
|
|
9974
|
-
/* @__PURE__ */
|
|
10117
|
+
/* @__PURE__ */ React66.createElement("ol", { className: "aura-stepper__list" }, steps.map(function(s, i) {
|
|
9975
10118
|
const state = i < at ? "done" : i === at ? "current" : "upcoming";
|
|
9976
10119
|
const error = s.status === "error";
|
|
9977
|
-
const marker = /* @__PURE__ */
|
|
10120
|
+
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);
|
|
9978
10121
|
const note = error ? t.stepError : state === "done" ? t.stepDone : "";
|
|
9979
10122
|
const clickable = state === "done" && !!props.onStepClick;
|
|
9980
10123
|
const named = clickable && (typeof s.label === "string" || typeof s.label === "number") && String(s.label).trim() !== "";
|
|
9981
10124
|
const descId = idBase + "-step-" + i;
|
|
9982
|
-
const text2 = /* @__PURE__ */
|
|
10125
|
+
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(
|
|
9983
10126
|
"span",
|
|
9984
10127
|
{
|
|
9985
10128
|
className: "aura-stepper__desc",
|
|
@@ -9988,14 +10131,14 @@ var Stepper = React65.forwardRef(function Stepper2(props, ref) {
|
|
|
9988
10131
|
},
|
|
9989
10132
|
s.description
|
|
9990
10133
|
) : null);
|
|
9991
|
-
return /* @__PURE__ */
|
|
10134
|
+
return /* @__PURE__ */ React66.createElement(
|
|
9992
10135
|
"li",
|
|
9993
10136
|
{
|
|
9994
10137
|
key: s.id,
|
|
9995
10138
|
className: cx("aura-stepper__item", "is-" + state, error && "is-error"),
|
|
9996
10139
|
"aria-current": state === "current" ? "step" : void 0
|
|
9997
10140
|
},
|
|
9998
|
-
clickable ? /* @__PURE__ */
|
|
10141
|
+
clickable ? /* @__PURE__ */ React66.createElement(
|
|
9999
10142
|
"button",
|
|
10000
10143
|
{
|
|
10001
10144
|
type: "button",
|
|
@@ -10007,19 +10150,19 @@ var Stepper = React65.forwardRef(function Stepper2(props, ref) {
|
|
|
10007
10150
|
},
|
|
10008
10151
|
marker,
|
|
10009
10152
|
text2
|
|
10010
|
-
) : /* @__PURE__ */
|
|
10153
|
+
) : /* @__PURE__ */ React66.createElement("span", { className: "aura-stepper__step" }, marker, text2)
|
|
10011
10154
|
);
|
|
10012
10155
|
})),
|
|
10013
|
-
!vertical && cur2 ? /* @__PURE__ */
|
|
10156
|
+
!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
|
|
10014
10157
|
);
|
|
10015
10158
|
});
|
|
10016
10159
|
|
|
10017
10160
|
// src/SegmentedControl.tsx
|
|
10018
|
-
var
|
|
10161
|
+
var React67 = __toESM(require("react"), 1);
|
|
10019
10162
|
function toOpt2(o) {
|
|
10020
10163
|
return typeof o === "object" ? o : { value: o, label: o };
|
|
10021
10164
|
}
|
|
10022
|
-
var SegmentedControl =
|
|
10165
|
+
var SegmentedControl = React67.forwardRef(
|
|
10023
10166
|
function SegmentedControl2(props, ref) {
|
|
10024
10167
|
const options = (props.options || []).map(toOpt2);
|
|
10025
10168
|
useAutoTip();
|
|
@@ -10033,7 +10176,7 @@ var SegmentedControl = React66.forwardRef(
|
|
|
10033
10176
|
);
|
|
10034
10177
|
const value = st[0], setValue = st[1];
|
|
10035
10178
|
const auto = uid(), id = props.id || auto;
|
|
10036
|
-
const refs =
|
|
10179
|
+
const refs = React67.useRef([]);
|
|
10037
10180
|
const selIdx = options.findIndex(function(o) {
|
|
10038
10181
|
return o.value === value;
|
|
10039
10182
|
});
|
|
@@ -10066,7 +10209,7 @@ var SegmentedControl = React66.forwardRef(
|
|
|
10066
10209
|
move(options.length, -1);
|
|
10067
10210
|
}
|
|
10068
10211
|
}
|
|
10069
|
-
return /* @__PURE__ */
|
|
10212
|
+
return /* @__PURE__ */ React67.createElement(
|
|
10070
10213
|
"div",
|
|
10071
10214
|
{
|
|
10072
10215
|
ref,
|
|
@@ -10085,7 +10228,7 @@ var SegmentedControl = React66.forwardRef(
|
|
|
10085
10228
|
options.map(function(o, i) {
|
|
10086
10229
|
const on = o.value === value;
|
|
10087
10230
|
const off = props.disabled || o.disabled;
|
|
10088
|
-
return /* @__PURE__ */
|
|
10231
|
+
return /* @__PURE__ */ React67.createElement(
|
|
10089
10232
|
"button",
|
|
10090
10233
|
{
|
|
10091
10234
|
key: o.value,
|
|
@@ -10107,8 +10250,8 @@ var SegmentedControl = React66.forwardRef(
|
|
|
10107
10250
|
onKeyDown(e, i);
|
|
10108
10251
|
}
|
|
10109
10252
|
},
|
|
10110
|
-
o.icon ? /* @__PURE__ */
|
|
10111
|
-
o.iconOnly ? null : /* @__PURE__ */
|
|
10253
|
+
o.icon ? /* @__PURE__ */ React67.createElement(Icon, { name: o.icon }) : null,
|
|
10254
|
+
o.iconOnly ? null : /* @__PURE__ */ React67.createElement("span", null, o.label)
|
|
10112
10255
|
);
|
|
10113
10256
|
})
|
|
10114
10257
|
);
|