@jirawatpyk/aura-react 5.44.0 → 5.46.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 +33 -0
- package/dist/aura.bundle.js +326 -228
- package/dist/cjs/index.cjs +326 -228
- package/dist/esm/PageHeader.js +36 -4
- package/dist/esm/PageHeaderClient.js +68 -0
- package/dist/esm/index.js +1 -1
- package/dist/index.d.cts +32 -1
- package/dist/index.d.ts +32 -1
- package/dist/server/index.cjs +36 -4
- package/dist/server/index.d.cts +32 -1
- package/dist/server/index.d.ts +32 -1
- package/dist/server/index.js +36 -4
- package/dist/styles.css +56 -5
- package/dist/styles.layer.css +56 -5
- package/package.json +1 -1
package/dist/aura.bundle.js
CHANGED
|
@@ -87,7 +87,7 @@ window.Aura = (() => {
|
|
|
87
87
|
IconButton: () => IconButton,
|
|
88
88
|
Menu: () => Menu,
|
|
89
89
|
NumberField: () => NumberField,
|
|
90
|
-
PageHeader: () =>
|
|
90
|
+
PageHeader: () => PageHeader3,
|
|
91
91
|
Pagination: () => Pagination,
|
|
92
92
|
PasswordField: () => PasswordField,
|
|
93
93
|
Popover: () => Popover,
|
|
@@ -6853,8 +6853,8 @@ window.Aura = (() => {
|
|
|
6853
6853
|
}
|
|
6854
6854
|
);
|
|
6855
6855
|
};
|
|
6856
|
-
const
|
|
6857
|
-
for (let b = 0; b < lines; b++)
|
|
6856
|
+
const bars2 = [];
|
|
6857
|
+
for (let b = 0; b < lines; b++) bars2.push(bar(b));
|
|
6858
6858
|
sk.push(
|
|
6859
6859
|
/* @__PURE__ */ React33.createElement(
|
|
6860
6860
|
"span",
|
|
@@ -6878,7 +6878,7 @@ window.Aura = (() => {
|
|
|
6878
6878
|
c.skeletonTouch && "is-touch"
|
|
6879
6879
|
)
|
|
6880
6880
|
}
|
|
6881
|
-
) : lines > 1 ? /* @__PURE__ */ React33.createElement("span", { className: "aura-skel-lines" },
|
|
6881
|
+
) : lines > 1 ? /* @__PURE__ */ React33.createElement("span", { className: "aura-skel-lines" }, bars2) : bars2[0]
|
|
6882
6882
|
)
|
|
6883
6883
|
);
|
|
6884
6884
|
});
|
|
@@ -7820,6 +7820,9 @@ window.Aura = (() => {
|
|
|
7820
7820
|
);
|
|
7821
7821
|
});
|
|
7822
7822
|
|
|
7823
|
+
// src/PageHeaderClient.tsx
|
|
7824
|
+
var React44 = __toESM(require_react(), 1);
|
|
7825
|
+
|
|
7823
7826
|
// src/PageHeader.tsx
|
|
7824
7827
|
var React43 = __toESM(require_react(), 1);
|
|
7825
7828
|
var h8 = React43.createElement;
|
|
@@ -7832,7 +7835,25 @@ window.Aura = (() => {
|
|
|
7832
7835
|
const level = props.headingLevel || 1;
|
|
7833
7836
|
const below2 = props.actionsFullWidthBelow;
|
|
7834
7837
|
const hide2 = props.titleHideBelow;
|
|
7835
|
-
const
|
|
7838
|
+
const shown = function(n3) {
|
|
7839
|
+
return n3 != null && n3 !== false && n3 !== "";
|
|
7840
|
+
};
|
|
7841
|
+
const hasMeta = shown(props.meta) || shown(props.subtitle) || shown(props.titleAddon);
|
|
7842
|
+
const size = props.size === "hero" || props.size === "hero-lg" ? props.size : null;
|
|
7843
|
+
const eyebrow = props.eyebrow;
|
|
7844
|
+
const plainEyebrow = typeof eyebrow === "string" || typeof eyebrow === "number";
|
|
7845
|
+
const heading = h8(
|
|
7846
|
+
"h" + level,
|
|
7847
|
+
{
|
|
7848
|
+
className: "aura-page-header__title",
|
|
7849
|
+
id: props.titleId,
|
|
7850
|
+
tabIndex: props.focusTitleOnMount ? -1 : void 0,
|
|
7851
|
+
"data-aura-focus-on-mount": props.focusTitleOnMount ? "" : void 0
|
|
7852
|
+
},
|
|
7853
|
+
props.title
|
|
7854
|
+
);
|
|
7855
|
+
const hasActions = props.actions != null && props.actions !== false;
|
|
7856
|
+
const bar = hasActions && (props.actionsBarBelow === "sm" || props.actionsBarBelow === "md") ? props.actionsBarBelow : null;
|
|
7836
7857
|
return h8(
|
|
7837
7858
|
"div",
|
|
7838
7859
|
Object.assign(attrs2, {
|
|
@@ -7842,6 +7863,9 @@ window.Aura = (() => {
|
|
|
7842
7863
|
(below2 === "sm" || below2 === "md" || below2 === "lg") && "aura-page-header--actions-full-below-" + below2,
|
|
7843
7864
|
(hide2 === "sm" || hide2 === "md" || hide2 === "lg") && "aura-page-header--title-hide-below-" + hide2,
|
|
7844
7865
|
(hide2 === "sm" || hide2 === "md" || hide2 === "lg") && !hasMeta && "has-no-meta",
|
|
7866
|
+
bar && "aura-page-header--actions-bar-below-" + bar,
|
|
7867
|
+
size && "aura-page-header--" + size,
|
|
7868
|
+
props.actionsAlign === "start" && "aura-page-header--actions-start",
|
|
7845
7869
|
props.className
|
|
7846
7870
|
),
|
|
7847
7871
|
style: props.style
|
|
@@ -7850,20 +7874,94 @@ window.Aura = (() => {
|
|
|
7850
7874
|
"div",
|
|
7851
7875
|
{ className: "aura-page-header__text" },
|
|
7852
7876
|
props.breadcrumb != null && props.breadcrumb !== false ? h8("div", { className: "aura-page-header__breadcrumb" }, props.breadcrumb) : null,
|
|
7853
|
-
|
|
7854
|
-
|
|
7877
|
+
shown(eyebrow) ? plainEyebrow ? h8("p", { className: "aura-page-header__eyebrow" }, eyebrow) : h8("div", { className: "aura-page-header__eyebrow aura-page-header__eyebrow--rich" }, eyebrow) : null,
|
|
7878
|
+
shown(props.titleAddon) ? h8(
|
|
7879
|
+
"div",
|
|
7880
|
+
{ className: "aura-page-header__title-row" },
|
|
7881
|
+
heading,
|
|
7882
|
+
h8("div", { className: "aura-page-header__title-addon" }, props.titleAddon)
|
|
7883
|
+
) : heading,
|
|
7884
|
+
shown(props.subtitle) ? h8("div", { className: "aura-page-header__subtitle" }, props.subtitle) : null,
|
|
7855
7885
|
props.meta != null && props.meta !== false ? h8("div", { className: "aura-page-header__meta" }, props.meta) : null
|
|
7856
7886
|
),
|
|
7857
|
-
props.actions != null && props.actions !== false ? h8(
|
|
7887
|
+
props.actions != null && props.actions !== false ? h8(
|
|
7888
|
+
"div",
|
|
7889
|
+
{ className: "aura-page-header__actions" },
|
|
7890
|
+
bar && props.actionsStatus != null && props.actionsStatus !== false ? h8("div", { className: "aura-page-header__status", role: "status" }, props.actionsStatus) : null,
|
|
7891
|
+
props.actions
|
|
7892
|
+
) : null
|
|
7858
7893
|
);
|
|
7859
7894
|
});
|
|
7860
7895
|
|
|
7896
|
+
// src/PageHeaderClient.tsx
|
|
7897
|
+
var NAME = "--aura-page-actions-height";
|
|
7898
|
+
var bars = [];
|
|
7899
|
+
function trapped(el) {
|
|
7900
|
+
for (let p = el.parentElement; p && p !== document.documentElement; p = p.parentElement) {
|
|
7901
|
+
const s = getComputedStyle(p);
|
|
7902
|
+
if (s.transform !== "none" || s.filter !== "none" || (s.backdropFilter || "none") !== "none" || s.contentVisibility === "auto" || s.perspective !== "none" || /transform|filter|perspective/.test(s.willChange) || /paint|layout|strict|content/.test(s.contain))
|
|
7903
|
+
return true;
|
|
7904
|
+
}
|
|
7905
|
+
return false;
|
|
7906
|
+
}
|
|
7907
|
+
var PageHeader3 = React44.forwardRef(function PageHeader4(props, ref) {
|
|
7908
|
+
const own = React44.useRef(null);
|
|
7909
|
+
const merged = useMergedRef(ref, own);
|
|
7910
|
+
const bar = props.actionsBarBelow;
|
|
7911
|
+
const hasActions = props.actions != null && props.actions !== false;
|
|
7912
|
+
React44.useEffect(
|
|
7913
|
+
function() {
|
|
7914
|
+
if (bar !== "sm" && bar !== "md" || !hasActions || !own.current) return;
|
|
7915
|
+
const el = own.current.querySelector(":scope > .aura-page-header__actions");
|
|
7916
|
+
if (!el) return;
|
|
7917
|
+
const root = document.documentElement;
|
|
7918
|
+
let checked = false;
|
|
7919
|
+
function sync() {
|
|
7920
|
+
if (bars[bars.length - 1] !== sync) return;
|
|
7921
|
+
if (getComputedStyle(el).position === "fixed") {
|
|
7922
|
+
root.style.setProperty(NAME, el.offsetHeight + "px");
|
|
7923
|
+
if (!checked && (checked = true, trapped(el)))
|
|
7924
|
+
devWarnOnce(
|
|
7925
|
+
"pageheader-bar-trapped",
|
|
7926
|
+
"PageHeader actionsBarBelow: an ancestor has a transform, filter, will-change or paint containment, so the fixed bar is placed against it instead of the screen. Remove it from the page header's ancestors."
|
|
7927
|
+
);
|
|
7928
|
+
} else root.style.removeProperty(NAME);
|
|
7929
|
+
}
|
|
7930
|
+
if (bars.length)
|
|
7931
|
+
devWarnOnce(
|
|
7932
|
+
"pageheader-bar-twice",
|
|
7933
|
+
"PageHeader actionsBarBelow: two bars on one page overlap at the bottom of the screen. Give it to one PageHeader per page."
|
|
7934
|
+
);
|
|
7935
|
+
bars.push(sync);
|
|
7936
|
+
const ro = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(sync);
|
|
7937
|
+
if (ro) ro.observe(el);
|
|
7938
|
+
window.addEventListener("resize", sync);
|
|
7939
|
+
sync();
|
|
7940
|
+
return function() {
|
|
7941
|
+
if (ro) ro.disconnect();
|
|
7942
|
+
window.removeEventListener("resize", sync);
|
|
7943
|
+
bars.splice(bars.indexOf(sync), 1);
|
|
7944
|
+
if (bars.length) bars[bars.length - 1]();
|
|
7945
|
+
else root.style.removeProperty(NAME);
|
|
7946
|
+
};
|
|
7947
|
+
},
|
|
7948
|
+
[bar, hasActions]
|
|
7949
|
+
);
|
|
7950
|
+
const focusTitle = !!props.focusTitleOnMount;
|
|
7951
|
+
React44.useEffect(function() {
|
|
7952
|
+
if (!focusTitle || !own.current) return;
|
|
7953
|
+
const t = own.current.querySelector(".aura-page-header__title");
|
|
7954
|
+
if (t) t.focus({ preventScroll: true });
|
|
7955
|
+
}, []);
|
|
7956
|
+
return /* @__PURE__ */ React44.createElement(PageHeader, { ...props, ref: merged });
|
|
7957
|
+
});
|
|
7958
|
+
|
|
7861
7959
|
// src/StatusTile.tsx
|
|
7862
|
-
var
|
|
7960
|
+
var React46 = __toESM(require_react(), 1);
|
|
7863
7961
|
|
|
7864
7962
|
// src/tiles.tsx
|
|
7865
|
-
var
|
|
7866
|
-
var h9 =
|
|
7963
|
+
var React45 = __toESM(require_react(), 1);
|
|
7964
|
+
var h9 = React45.createElement;
|
|
7867
7965
|
var STATUS_ICON = {
|
|
7868
7966
|
down: IconCircleAlert,
|
|
7869
7967
|
problem: IconTriangleAlert,
|
|
@@ -7955,7 +8053,7 @@ window.Aura = (() => {
|
|
|
7955
8053
|
) : null
|
|
7956
8054
|
);
|
|
7957
8055
|
}
|
|
7958
|
-
var TileGrid =
|
|
8056
|
+
var TileGrid = React45.forwardRef(function TileGrid2(props, ref) {
|
|
7959
8057
|
const style = Object.assign(
|
|
7960
8058
|
{},
|
|
7961
8059
|
respVars("aura-grid-cols", props.columns == null ? { base: 2, md: 3 } : props.columns),
|
|
@@ -7971,16 +8069,16 @@ window.Aura = (() => {
|
|
|
7971
8069
|
}),
|
|
7972
8070
|
/* toArray drops null and booleans and keys each element; a Fragment's children are items too. */
|
|
7973
8071
|
flat(props.children).map(function(c, i) {
|
|
7974
|
-
return h9("li", { key:
|
|
8072
|
+
return h9("li", { key: React45.isValidElement(c) && c.key != null ? c.key : i }, c);
|
|
7975
8073
|
})
|
|
7976
8074
|
);
|
|
7977
8075
|
});
|
|
7978
8076
|
function flat(children) {
|
|
7979
8077
|
const out = [];
|
|
7980
|
-
|
|
7981
|
-
if (
|
|
8078
|
+
React45.Children.toArray(children).forEach(function(c) {
|
|
8079
|
+
if (React45.isValidElement(c) && c.type === React45.Fragment)
|
|
7982
8080
|
flat(c.props.children).forEach(function(x) {
|
|
7983
|
-
out.push(
|
|
8081
|
+
out.push(React45.isValidElement(x) ? React45.cloneElement(x, { key: String(c.key) + "/" + String(x.key) }) : x);
|
|
7984
8082
|
});
|
|
7985
8083
|
else if (c !== "") out.push(c);
|
|
7986
8084
|
});
|
|
@@ -7994,7 +8092,7 @@ window.Aura = (() => {
|
|
|
7994
8092
|
function num(v) {
|
|
7995
8093
|
return typeof v === "number" && isFinite(v) ? v : null;
|
|
7996
8094
|
}
|
|
7997
|
-
var Sparkline =
|
|
8095
|
+
var Sparkline = React45.forwardRef(function Sparkline2(props, ref) {
|
|
7998
8096
|
const wh = SIZES2[props.size || "sm"] || SIZES2.sm;
|
|
7999
8097
|
const W = wh[0], H = wh[1];
|
|
8000
8098
|
const data = (props.data || []).map(num);
|
|
@@ -8068,8 +8166,8 @@ window.Aura = (() => {
|
|
|
8068
8166
|
});
|
|
8069
8167
|
|
|
8070
8168
|
// src/StatusTile.tsx
|
|
8071
|
-
var useIsoLayoutEffect2 = typeof window !== "undefined" ?
|
|
8072
|
-
var StatusTile =
|
|
8169
|
+
var useIsoLayoutEffect2 = typeof window !== "undefined" ? React46.useLayoutEffect : React46.useEffect;
|
|
8170
|
+
var StatusTile = React46.forwardRef(function StatusTile2(props, ref) {
|
|
8073
8171
|
const Link = useLinkComponent(props.linkComponent);
|
|
8074
8172
|
const t = useStrings();
|
|
8075
8173
|
useAutoTip();
|
|
@@ -8078,8 +8176,8 @@ window.Aura = (() => {
|
|
|
8078
8176
|
"status-tile-label",
|
|
8079
8177
|
"StatusTile `aria-label` needs `href`: without a link the tile is a plain box, where a name is not allowed."
|
|
8080
8178
|
);
|
|
8081
|
-
const titleRef =
|
|
8082
|
-
const check =
|
|
8179
|
+
const titleRef = React46.useRef(null);
|
|
8180
|
+
const check = React46.useCallback(function() {
|
|
8083
8181
|
const el = titleRef.current;
|
|
8084
8182
|
if (!el) return;
|
|
8085
8183
|
const cut = el.scrollHeight > el.clientHeight + 1;
|
|
@@ -8089,7 +8187,7 @@ window.Aura = (() => {
|
|
|
8089
8187
|
}, []);
|
|
8090
8188
|
useIsoLayoutEffect2(check, [props.title, check]);
|
|
8091
8189
|
const linked = !!props.href;
|
|
8092
|
-
|
|
8190
|
+
React46.useEffect(
|
|
8093
8191
|
function() {
|
|
8094
8192
|
const el = titleRef.current;
|
|
8095
8193
|
if (!el) return;
|
|
@@ -8114,14 +8212,14 @@ window.Aura = (() => {
|
|
|
8114
8212
|
});
|
|
8115
8213
|
|
|
8116
8214
|
// src/AppShell.tsx
|
|
8117
|
-
var
|
|
8215
|
+
var React48 = __toESM(require_react(), 1);
|
|
8118
8216
|
|
|
8119
8217
|
// src/scrollHide.ts
|
|
8120
|
-
var
|
|
8218
|
+
var React47 = __toESM(require_react(), 1);
|
|
8121
8219
|
var STEP = 8;
|
|
8122
8220
|
function useHideOnScroll(enabled, el, media, from) {
|
|
8123
|
-
const st =
|
|
8124
|
-
|
|
8221
|
+
const st = React47.useState(false), hidden = st[0], setHidden = st[1];
|
|
8222
|
+
React47.useEffect(
|
|
8125
8223
|
function() {
|
|
8126
8224
|
if (!enabled || typeof window === "undefined") {
|
|
8127
8225
|
setHidden(false);
|
|
@@ -8211,31 +8309,31 @@ window.Aura = (() => {
|
|
|
8211
8309
|
}
|
|
8212
8310
|
|
|
8213
8311
|
// src/AppShell.tsx
|
|
8214
|
-
var AppShell =
|
|
8312
|
+
var AppShell = React48.forwardRef(function AppShell2(props, ref) {
|
|
8215
8313
|
const t = useStrings();
|
|
8216
8314
|
const bp = useBreakpoint();
|
|
8217
8315
|
const wide = bp === "lg" || bp === "xl";
|
|
8218
|
-
const st =
|
|
8219
|
-
|
|
8316
|
+
const st = React48.useState(false), open = st[0], setOpen = st[1];
|
|
8317
|
+
React48.useEffect(
|
|
8220
8318
|
function() {
|
|
8221
8319
|
if (wide) setOpen(false);
|
|
8222
8320
|
},
|
|
8223
8321
|
[wide]
|
|
8224
8322
|
);
|
|
8225
|
-
const navEl = props.nav &&
|
|
8323
|
+
const navEl = props.nav && React48.isValidElement(props.nav) ? props.nav : null;
|
|
8226
8324
|
const shared = !!navEl && navEl.props.value === void 0 && (navEl.props.defaultValue !== void 0 || navEl.props.sections !== void 0 || navEl.props.items !== void 0);
|
|
8227
|
-
const navState =
|
|
8325
|
+
const navState = React48.useState(navEl ? navEl.props.defaultValue : void 0);
|
|
8228
8326
|
function onNav(id) {
|
|
8229
8327
|
if (shared) navState[1](id);
|
|
8230
8328
|
if (navEl && navEl.props.onChange) navEl.props.onChange(id);
|
|
8231
8329
|
}
|
|
8232
|
-
const rootRef =
|
|
8233
|
-
const barRef =
|
|
8330
|
+
const rootRef = React48.useRef(null);
|
|
8331
|
+
const barRef = React48.useRef(null);
|
|
8234
8332
|
const mergedRef = useMergedRef(ref, rootRef);
|
|
8235
8333
|
const hasBar = !!(props.header || props.nav);
|
|
8236
|
-
const barH =
|
|
8334
|
+
const barH = React48.useState(null);
|
|
8237
8335
|
const away = useHideOnScroll(!!props.headerHideOnScroll && hasBar, barRef, "(max-width: 1023.98px)", barH[0] || 56);
|
|
8238
|
-
const awayRef =
|
|
8336
|
+
const awayRef = React48.useRef(away);
|
|
8239
8337
|
awayRef.current = away;
|
|
8240
8338
|
useIsoLayoutEffect(
|
|
8241
8339
|
function() {
|
|
@@ -8264,8 +8362,8 @@ window.Aura = (() => {
|
|
|
8264
8362
|
},
|
|
8265
8363
|
[hasBar]
|
|
8266
8364
|
);
|
|
8267
|
-
const deskNav = navEl && shared ?
|
|
8268
|
-
const drawerNav = navEl ?
|
|
8365
|
+
const deskNav = navEl && shared ? React48.cloneElement(navEl, { value: navState[0], onChange: onNav }) : props.nav;
|
|
8366
|
+
const drawerNav = navEl ? React48.cloneElement(navEl, {
|
|
8269
8367
|
value: shared ? navState[0] : navEl.props.value,
|
|
8270
8368
|
onChange: function(id) {
|
|
8271
8369
|
onNav(id);
|
|
@@ -8280,7 +8378,7 @@ window.Aura = (() => {
|
|
|
8280
8378
|
collapsed: false,
|
|
8281
8379
|
collapsible: false
|
|
8282
8380
|
}) : props.nav;
|
|
8283
|
-
return /* @__PURE__ */
|
|
8381
|
+
return /* @__PURE__ */ React48.createElement(
|
|
8284
8382
|
"div",
|
|
8285
8383
|
{
|
|
8286
8384
|
ref: mergedRef,
|
|
@@ -8295,8 +8393,8 @@ window.Aura = (() => {
|
|
|
8295
8393
|
props.className
|
|
8296
8394
|
)
|
|
8297
8395
|
},
|
|
8298
|
-
props.nav ? /* @__PURE__ */
|
|
8299
|
-
props.nav ? /* @__PURE__ */
|
|
8396
|
+
props.nav ? /* @__PURE__ */ React48.createElement("div", { className: "aura-shell__nav" }, deskNav) : null,
|
|
8397
|
+
props.nav ? /* @__PURE__ */ React48.createElement(
|
|
8300
8398
|
Drawer,
|
|
8301
8399
|
{
|
|
8302
8400
|
open,
|
|
@@ -8313,7 +8411,7 @@ window.Aura = (() => {
|
|
|
8313
8411
|
},
|
|
8314
8412
|
drawerNav
|
|
8315
8413
|
) : null,
|
|
8316
|
-
/* @__PURE__ */
|
|
8414
|
+
/* @__PURE__ */ React48.createElement("div", { className: "aura-shell__main" }, props.header || props.nav ? /* @__PURE__ */ React48.createElement(
|
|
8317
8415
|
"header",
|
|
8318
8416
|
{
|
|
8319
8417
|
ref: barRef,
|
|
@@ -8325,11 +8423,11 @@ window.Aura = (() => {
|
|
|
8325
8423
|
away && "is-away"
|
|
8326
8424
|
)
|
|
8327
8425
|
},
|
|
8328
|
-
props.nav ? /* @__PURE__ */
|
|
8426
|
+
props.nav ? /* @__PURE__ */ React48.createElement(
|
|
8329
8427
|
IconButton,
|
|
8330
8428
|
{
|
|
8331
8429
|
className: "aura-shell__menu",
|
|
8332
|
-
icon: /* @__PURE__ */
|
|
8430
|
+
icon: /* @__PURE__ */ React48.createElement(IconMenu, null),
|
|
8333
8431
|
label: props.menuLabel || t.openNav,
|
|
8334
8432
|
size: "md",
|
|
8335
8433
|
onClick: function() {
|
|
@@ -8338,8 +8436,8 @@ window.Aura = (() => {
|
|
|
8338
8436
|
"aria-expanded": open
|
|
8339
8437
|
}
|
|
8340
8438
|
) : null,
|
|
8341
|
-
/* @__PURE__ */
|
|
8342
|
-
) : null, /* @__PURE__ */
|
|
8439
|
+
/* @__PURE__ */ React48.createElement("div", { className: "aura-shell__bar-content" }, props.header)
|
|
8440
|
+
) : null, /* @__PURE__ */ React48.createElement(
|
|
8343
8441
|
"main",
|
|
8344
8442
|
{
|
|
8345
8443
|
className: cx("aura-shell__content", props.contentPadding === false && "is-flush"),
|
|
@@ -8352,17 +8450,17 @@ window.Aura = (() => {
|
|
|
8352
8450
|
});
|
|
8353
8451
|
|
|
8354
8452
|
// src/ActionBar.tsx
|
|
8355
|
-
var
|
|
8356
|
-
var ActionBar =
|
|
8453
|
+
var React49 = __toESM(require_react(), 1);
|
|
8454
|
+
var ActionBar = React49.forwardRef(function ActionBar2(props, ref) {
|
|
8357
8455
|
const t = useStrings();
|
|
8358
8456
|
const bulk = props.selected != null;
|
|
8359
8457
|
const idle = bulk && !props.selected;
|
|
8360
8458
|
const count = bulk && props.selected ? t.selectedCount(props.selected) : null;
|
|
8361
|
-
const hasStart =
|
|
8459
|
+
const hasStart = React49.Children.toArray(props.start).some(function(c) {
|
|
8362
8460
|
return c !== "";
|
|
8363
8461
|
});
|
|
8364
|
-
const cameFrom =
|
|
8365
|
-
const own =
|
|
8462
|
+
const cameFrom = React49.useRef(null);
|
|
8463
|
+
const own = React49.useRef(null);
|
|
8366
8464
|
function clear() {
|
|
8367
8465
|
props.onClearSelection();
|
|
8368
8466
|
setTimeout(function() {
|
|
@@ -8371,7 +8469,7 @@ window.Aura = (() => {
|
|
|
8371
8469
|
if ((!a || a === document.body || !a.isConnected) && back && back.isConnected) back.focus();
|
|
8372
8470
|
}, 0);
|
|
8373
8471
|
}
|
|
8374
|
-
return /* @__PURE__ */
|
|
8472
|
+
return /* @__PURE__ */ React49.createElement(
|
|
8375
8473
|
"div",
|
|
8376
8474
|
{
|
|
8377
8475
|
ref: function(el) {
|
|
@@ -8393,16 +8491,16 @@ window.Aura = (() => {
|
|
|
8393
8491
|
props.className
|
|
8394
8492
|
)
|
|
8395
8493
|
},
|
|
8396
|
-
/* @__PURE__ */
|
|
8494
|
+
/* @__PURE__ */ React49.createElement("div", { className: cx("aura-actionbar__inner", hasStart && "has-start") }, /* @__PURE__ */ React49.createElement("div", { className: "aura-actionbar__status", role: "status" }, count, count && props.status ? " \xB7 " : null, props.status), !idle && hasStart ? /* @__PURE__ */ React49.createElement("div", { className: "aura-actionbar__start" }, props.start) : null, !idle ? /* @__PURE__ */ React49.createElement("div", { className: "aura-actionbar__actions" }, count && props.onClearSelection ? /* @__PURE__ */ React49.createElement(Button, { variant: "ghost", size: "sm", touchHeight: props.touchHeight, onClick: clear }, t.clear()) : null, props.children) : null)
|
|
8397
8495
|
);
|
|
8398
8496
|
});
|
|
8399
8497
|
|
|
8400
8498
|
// src/Separator.tsx
|
|
8401
|
-
var
|
|
8402
|
-
var Separator =
|
|
8499
|
+
var React50 = __toESM(require_react(), 1);
|
|
8500
|
+
var Separator = React50.forwardRef(function Separator2(props, ref) {
|
|
8403
8501
|
const vertical = props.orientation === "vertical";
|
|
8404
8502
|
const decorative = props.decorative !== false;
|
|
8405
|
-
return /* @__PURE__ */
|
|
8503
|
+
return /* @__PURE__ */ React50.createElement(
|
|
8406
8504
|
"div",
|
|
8407
8505
|
{
|
|
8408
8506
|
ref,
|
|
@@ -8415,13 +8513,13 @@ window.Aura = (() => {
|
|
|
8415
8513
|
});
|
|
8416
8514
|
|
|
8417
8515
|
// src/Table.tsx
|
|
8418
|
-
var
|
|
8419
|
-
var StackLabels =
|
|
8420
|
-
var ColumnIndex =
|
|
8516
|
+
var React51 = __toESM(require_react(), 1);
|
|
8517
|
+
var StackLabels = React51.createContext(null);
|
|
8518
|
+
var ColumnIndex = React51.createContext(-1);
|
|
8421
8519
|
function flat2(children) {
|
|
8422
8520
|
const out = [];
|
|
8423
|
-
|
|
8424
|
-
if (
|
|
8521
|
+
React51.Children.toArray(children).forEach(function(c) {
|
|
8522
|
+
if (React51.isValidElement(c) && c.type === React51.Fragment)
|
|
8425
8523
|
out.push.apply(out, flat2(c.props.children));
|
|
8426
8524
|
else out.push(c);
|
|
8427
8525
|
});
|
|
@@ -8435,7 +8533,7 @@ window.Aura = (() => {
|
|
|
8435
8533
|
});
|
|
8436
8534
|
return parts.length ? parts.join("") : void 0;
|
|
8437
8535
|
}
|
|
8438
|
-
if (
|
|
8536
|
+
if (React51.isValidElement(node)) {
|
|
8439
8537
|
const p = node.props;
|
|
8440
8538
|
if (p["aria-hidden"] === true || p["aria-hidden"] === "true") return void 0;
|
|
8441
8539
|
return text(p.children);
|
|
@@ -8445,13 +8543,13 @@ window.Aura = (() => {
|
|
|
8445
8543
|
function headerLabels(children) {
|
|
8446
8544
|
let out = [];
|
|
8447
8545
|
flat2(children).forEach(function(c) {
|
|
8448
|
-
if (out.length || !
|
|
8546
|
+
if (out.length || !React51.isValidElement(c) || c.type !== THead) return;
|
|
8449
8547
|
const row = flat2(c.props.children).find(function(r2) {
|
|
8450
|
-
return
|
|
8548
|
+
return React51.isValidElement(r2);
|
|
8451
8549
|
});
|
|
8452
8550
|
if (!row) return;
|
|
8453
8551
|
flat2(row.props.children).forEach(function(cell) {
|
|
8454
|
-
if (!
|
|
8552
|
+
if (!React51.isValidElement(cell)) return;
|
|
8455
8553
|
const p = cell.props;
|
|
8456
8554
|
const t = text(p.children);
|
|
8457
8555
|
const label = p.label != null ? p.label : t != null ? t.replace(/\s+/g, " ").trim() || void 0 : void 0;
|
|
@@ -8461,7 +8559,7 @@ window.Aura = (() => {
|
|
|
8461
8559
|
});
|
|
8462
8560
|
return out;
|
|
8463
8561
|
}
|
|
8464
|
-
var Table =
|
|
8562
|
+
var Table = React51.forwardRef(function Table2(props, ref) {
|
|
8465
8563
|
const {
|
|
8466
8564
|
caption,
|
|
8467
8565
|
captionHidden,
|
|
@@ -8491,12 +8589,12 @@ window.Aura = (() => {
|
|
|
8491
8589
|
"tbl-stack-labels",
|
|
8492
8590
|
"Table stackBelow: no THead > Tr > Th found among its children, so cells have no labels. Pass `label` on each Td."
|
|
8493
8591
|
);
|
|
8494
|
-
const outer =
|
|
8592
|
+
const outer = React51.useContext(StackLabels);
|
|
8495
8593
|
const pageDensity = useDensity();
|
|
8496
8594
|
const capId = uid();
|
|
8497
|
-
const wrap =
|
|
8498
|
-
const sc =
|
|
8499
|
-
const wide =
|
|
8595
|
+
const wrap = React51.useRef(null);
|
|
8596
|
+
const sc = React51.useState(false), scrolls = sc[0];
|
|
8597
|
+
const wide = React51.useState(false);
|
|
8500
8598
|
useIsoLayoutEffect(function() {
|
|
8501
8599
|
const el = wrap.current;
|
|
8502
8600
|
if (!el || typeof ResizeObserver === "undefined") return;
|
|
@@ -8513,7 +8611,7 @@ window.Aura = (() => {
|
|
|
8513
8611
|
ro.disconnect();
|
|
8514
8612
|
};
|
|
8515
8613
|
}, []);
|
|
8516
|
-
const table = /* @__PURE__ */
|
|
8614
|
+
const table = /* @__PURE__ */ React51.createElement(
|
|
8517
8615
|
"div",
|
|
8518
8616
|
{
|
|
8519
8617
|
ref: wrap,
|
|
@@ -8537,7 +8635,7 @@ window.Aura = (() => {
|
|
|
8537
8635
|
"aria-labelledby": scrolls ? caption != null ? capId : rest["aria-labelledby"] : void 0,
|
|
8538
8636
|
"aria-label": scrolls && caption == null ? rest["aria-label"] : void 0
|
|
8539
8637
|
},
|
|
8540
|
-
/* @__PURE__ */
|
|
8638
|
+
/* @__PURE__ */ React51.createElement(
|
|
8541
8639
|
"table",
|
|
8542
8640
|
{
|
|
8543
8641
|
ref,
|
|
@@ -8553,11 +8651,11 @@ window.Aura = (() => {
|
|
|
8553
8651
|
role: stackBelow ? "table" : void 0,
|
|
8554
8652
|
...rest
|
|
8555
8653
|
},
|
|
8556
|
-
caption != null ? /* @__PURE__ */
|
|
8557
|
-
labels ? /* @__PURE__ */
|
|
8654
|
+
caption != null ? /* @__PURE__ */ React51.createElement("caption", { id: capId, className: cx("aura-tbl__caption", captionHidden && "aura-sr-only") }, caption) : null,
|
|
8655
|
+
labels ? /* @__PURE__ */ React51.createElement(StackLabels.Provider, { value: labels }, children) : outer ? /* @__PURE__ */ React51.createElement(StackLabels.Provider, { value: null }, children) : children
|
|
8558
8656
|
)
|
|
8559
8657
|
);
|
|
8560
|
-
return cards ? /* @__PURE__ */
|
|
8658
|
+
return cards ? /* @__PURE__ */ React51.createElement(
|
|
8561
8659
|
"div",
|
|
8562
8660
|
{
|
|
8563
8661
|
className: cx(
|
|
@@ -8570,10 +8668,10 @@ window.Aura = (() => {
|
|
|
8570
8668
|
) : table;
|
|
8571
8669
|
});
|
|
8572
8670
|
function section(tag, cls) {
|
|
8573
|
-
const C =
|
|
8671
|
+
const C = React51.forwardRef(function TableSection(props, ref) {
|
|
8574
8672
|
const { className, ...rest } = props;
|
|
8575
|
-
const stacked =
|
|
8576
|
-
return
|
|
8673
|
+
const stacked = React51.useContext(StackLabels) != null;
|
|
8674
|
+
return React51.createElement(
|
|
8577
8675
|
tag,
|
|
8578
8676
|
Object.assign({ ref, className: cx(cls, className), role: stacked ? "rowgroup" : void 0 }, rest)
|
|
8579
8677
|
);
|
|
@@ -8586,14 +8684,14 @@ window.Aura = (() => {
|
|
|
8586
8684
|
TBody.displayName = "TBody";
|
|
8587
8685
|
var TFoot = section("tfoot", "aura-tbl__foot");
|
|
8588
8686
|
TFoot.displayName = "TFoot";
|
|
8589
|
-
var Tr =
|
|
8687
|
+
var Tr = React51.forwardRef(function Tr2(props, ref) {
|
|
8590
8688
|
const { className, children, ...rest } = props;
|
|
8591
|
-
const stacked =
|
|
8689
|
+
const stacked = React51.useContext(StackLabels) != null;
|
|
8592
8690
|
let col = 0;
|
|
8593
|
-
return /* @__PURE__ */
|
|
8691
|
+
return /* @__PURE__ */ React51.createElement("tr", { ref, className: cx("aura-tbl__row", className), role: stacked ? "row" : void 0, ...rest }, stacked ? flat2(children).map(function(c) {
|
|
8594
8692
|
const at = col;
|
|
8595
|
-
if (
|
|
8596
|
-
return /* @__PURE__ */
|
|
8693
|
+
if (React51.isValidElement(c)) col += Math.max(1, Number(c.props.colSpan) || 1);
|
|
8694
|
+
return /* @__PURE__ */ React51.createElement(ColumnIndex.Provider, { key: React51.isValidElement(c) && c.key != null ? c.key : at, value: at }, c);
|
|
8597
8695
|
}) : children);
|
|
8598
8696
|
});
|
|
8599
8697
|
function cellClass(base, p) {
|
|
@@ -8607,10 +8705,10 @@ window.Aura = (() => {
|
|
|
8607
8705
|
p.className
|
|
8608
8706
|
);
|
|
8609
8707
|
}
|
|
8610
|
-
var Th =
|
|
8708
|
+
var Th = React51.forwardRef(function Th2(props, ref) {
|
|
8611
8709
|
const { align, numeric, mono, className, scope, label, card, ...rest } = props;
|
|
8612
|
-
const stacked =
|
|
8613
|
-
return /* @__PURE__ */
|
|
8710
|
+
const stacked = React51.useContext(StackLabels) != null;
|
|
8711
|
+
return /* @__PURE__ */ React51.createElement(
|
|
8614
8712
|
"th",
|
|
8615
8713
|
{
|
|
8616
8714
|
ref,
|
|
@@ -8622,12 +8720,12 @@ window.Aura = (() => {
|
|
|
8622
8720
|
}
|
|
8623
8721
|
);
|
|
8624
8722
|
});
|
|
8625
|
-
var Td =
|
|
8723
|
+
var Td = React51.forwardRef(function Td2(props, ref) {
|
|
8626
8724
|
const { align, numeric, mono, className, scope, label, card, ...rest } = props;
|
|
8627
|
-
const labels =
|
|
8725
|
+
const labels = React51.useContext(StackLabels), col = React51.useContext(ColumnIndex);
|
|
8628
8726
|
const slot = labels && (card === "title" || card === "action") ? card : void 0;
|
|
8629
8727
|
const shown = labels && !slot ? label != null ? label : col >= 0 ? labels[col] : void 0 : void 0;
|
|
8630
|
-
return /* @__PURE__ */
|
|
8728
|
+
return /* @__PURE__ */ React51.createElement(
|
|
8631
8729
|
"td",
|
|
8632
8730
|
{
|
|
8633
8731
|
ref,
|
|
@@ -8641,8 +8739,8 @@ window.Aura = (() => {
|
|
|
8641
8739
|
});
|
|
8642
8740
|
|
|
8643
8741
|
// src/BottomNav.tsx
|
|
8644
|
-
var
|
|
8645
|
-
var BottomNav =
|
|
8742
|
+
var React52 = __toESM(require_react(), 1);
|
|
8743
|
+
var BottomNav = React52.forwardRef(function BottomNav2(props, ref) {
|
|
8646
8744
|
const t = useStrings();
|
|
8647
8745
|
const Link = useLinkComponent(props.linkComponent);
|
|
8648
8746
|
const st = useMaybeControlled(
|
|
@@ -8652,7 +8750,7 @@ window.Aura = (() => {
|
|
|
8652
8750
|
);
|
|
8653
8751
|
const active = st[0];
|
|
8654
8752
|
const hide2 = props.hideFrom === false ? "always" : "below-" + (props.hideFrom || "lg");
|
|
8655
|
-
const own =
|
|
8753
|
+
const own = React52.useRef(null);
|
|
8656
8754
|
const hf = props.hideFrom === false ? null : props.hideFrom || "lg";
|
|
8657
8755
|
const away = useHideOnScroll(
|
|
8658
8756
|
!!props.hideOnScroll,
|
|
@@ -8660,7 +8758,7 @@ window.Aura = (() => {
|
|
|
8660
8758
|
hf ? "(max-width: " + (breakpoints[hf] - 0.02) + "px)" : "all",
|
|
8661
8759
|
64
|
|
8662
8760
|
);
|
|
8663
|
-
const setRef =
|
|
8761
|
+
const setRef = React52.useCallback(
|
|
8664
8762
|
function(el) {
|
|
8665
8763
|
own.current = el;
|
|
8666
8764
|
if (typeof ref === "function") ref(el);
|
|
@@ -8668,7 +8766,7 @@ window.Aura = (() => {
|
|
|
8668
8766
|
},
|
|
8669
8767
|
[ref]
|
|
8670
8768
|
);
|
|
8671
|
-
return /* @__PURE__ */
|
|
8769
|
+
return /* @__PURE__ */ React52.createElement(React52.Fragment, null, /* @__PURE__ */ React52.createElement("div", { className: cx("aura-bottomnav-spacer", "aura-bottomnav--" + hide2), "aria-hidden": "true" }), /* @__PURE__ */ React52.createElement(
|
|
8672
8770
|
"nav",
|
|
8673
8771
|
{
|
|
8674
8772
|
ref: setRef,
|
|
@@ -8681,7 +8779,7 @@ window.Aura = (() => {
|
|
|
8681
8779
|
),
|
|
8682
8780
|
"aria-label": props.label || t.mainNav
|
|
8683
8781
|
},
|
|
8684
|
-
/* @__PURE__ */
|
|
8782
|
+
/* @__PURE__ */ React52.createElement("ul", { className: "aura-bottomnav__list" }, props.items.map(function(it) {
|
|
8685
8783
|
if (it.ariaLabel && typeof it.label === "string" && it.ariaLabel.toLowerCase().indexOf(it.label.toLowerCase()) < 0)
|
|
8686
8784
|
devWarnOnce(
|
|
8687
8785
|
"bottomnav-label-" + it.id,
|
|
@@ -8702,20 +8800,20 @@ window.Aura = (() => {
|
|
|
8702
8800
|
}
|
|
8703
8801
|
};
|
|
8704
8802
|
const inner = [
|
|
8705
|
-
/* @__PURE__ */
|
|
8706
|
-
it.ariaLabel ? /* @__PURE__ */
|
|
8707
|
-
/* @__PURE__ */
|
|
8708
|
-
suffix && !it.ariaLabel ? /* @__PURE__ */
|
|
8803
|
+
/* @__PURE__ */ React52.createElement("span", { key: "i", className: "aura-bottomnav__icon" }, /* @__PURE__ */ React52.createElement(Icon, { name: it.icon, size: "md" }), count ? /* @__PURE__ */ React52.createElement("span", { className: "aura-bottomnav__count", "aria-hidden": "true" }, count) : it.badge ? /* @__PURE__ */ React52.createElement("span", { className: "aura-bottomnav__dot", "aria-hidden": "true" }) : null),
|
|
8804
|
+
it.ariaLabel ? /* @__PURE__ */ React52.createElement("span", { key: "n", className: "aura-sr-only" }, it.ariaLabel + suffix) : null,
|
|
8805
|
+
/* @__PURE__ */ React52.createElement("span", { key: "l", className: "aura-bottomnav__label", "aria-hidden": it.ariaLabel ? true : void 0 }, it.label),
|
|
8806
|
+
suffix && !it.ariaLabel ? /* @__PURE__ */ React52.createElement("span", { key: "s", className: "aura-sr-only" }, suffix) : null
|
|
8709
8807
|
];
|
|
8710
|
-
return /* @__PURE__ */
|
|
8808
|
+
return /* @__PURE__ */ React52.createElement("li", { key: it.id, className: "aura-bottomnav__cell" }, it.href ? /* @__PURE__ */ React52.createElement(Link, { href: it.href, ...common }, inner) : /* @__PURE__ */ React52.createElement("button", { type: "button", ...common }, inner));
|
|
8711
8809
|
}))
|
|
8712
8810
|
));
|
|
8713
8811
|
});
|
|
8714
8812
|
|
|
8715
8813
|
// src/Surface.tsx
|
|
8716
|
-
var
|
|
8717
|
-
var h10 =
|
|
8718
|
-
var Surface =
|
|
8814
|
+
var React53 = __toESM(require_react(), 1);
|
|
8815
|
+
var h10 = React53.createElement;
|
|
8816
|
+
var Surface = React53.forwardRef(function Surface2(props, ref) {
|
|
8719
8817
|
const t = props.texture || "mesh";
|
|
8720
8818
|
const rest = omit(props, ["texture", "className", "children", "as"]);
|
|
8721
8819
|
return h10(
|
|
@@ -8736,14 +8834,14 @@ window.Aura = (() => {
|
|
|
8736
8834
|
});
|
|
8737
8835
|
|
|
8738
8836
|
// src/Stat.tsx
|
|
8739
|
-
var
|
|
8740
|
-
var Stat =
|
|
8837
|
+
var React54 = __toESM(require_react(), 1);
|
|
8838
|
+
var Stat = React54.forwardRef(function Stat2(props, ref) {
|
|
8741
8839
|
const Link = useLinkComponent(props.linkComponent);
|
|
8742
8840
|
return statElement(props, ref, Link);
|
|
8743
8841
|
});
|
|
8744
8842
|
|
|
8745
8843
|
// src/TimePicker.tsx
|
|
8746
|
-
var
|
|
8844
|
+
var React55 = __toESM(require_react(), 1);
|
|
8747
8845
|
var import_react_dom12 = __toESM(require_react_dom(), 1);
|
|
8748
8846
|
|
|
8749
8847
|
// src/text.ts
|
|
@@ -8785,7 +8883,7 @@ window.Aura = (() => {
|
|
|
8785
8883
|
function fromMin(n3) {
|
|
8786
8884
|
return pad3(Math.floor(n3 / 60)) + ":" + pad3(n3 % 60);
|
|
8787
8885
|
}
|
|
8788
|
-
var TimePicker =
|
|
8886
|
+
var TimePicker = React55.forwardRef(function TimePicker2(props, ref) {
|
|
8789
8887
|
const t = useStrings();
|
|
8790
8888
|
const auto = uid(), id = props.id || auto, listId = id + "-list";
|
|
8791
8889
|
const st = useMaybeControlled(
|
|
@@ -8795,7 +8893,7 @@ window.Aura = (() => {
|
|
|
8795
8893
|
);
|
|
8796
8894
|
const value = st[0];
|
|
8797
8895
|
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;
|
|
8798
|
-
const slots =
|
|
8896
|
+
const slots = React55.useMemo(
|
|
8799
8897
|
function() {
|
|
8800
8898
|
const out = [];
|
|
8801
8899
|
for (let m = lo; m <= hi; m += step) out.push(fromMin(m));
|
|
@@ -8807,12 +8905,12 @@ window.Aura = (() => {
|
|
|
8807
8905
|
const n3 = toMin(v);
|
|
8808
8906
|
return n3 == null || n3 < lo || n3 > hi || props.isTimeDisabled && props.isTimeDisabled(v);
|
|
8809
8907
|
}
|
|
8810
|
-
const openState =
|
|
8811
|
-
const editState =
|
|
8812
|
-
const aState =
|
|
8813
|
-
const errState =
|
|
8814
|
-
const pos =
|
|
8815
|
-
const boxRef =
|
|
8908
|
+
const openState = React55.useState(false), open = openState[0], setOpen = openState[1];
|
|
8909
|
+
const editState = React55.useState(null), editing = editState[0], setEditing = editState[1];
|
|
8910
|
+
const aState = React55.useState(0), active = aState[0], setActive = aState[1];
|
|
8911
|
+
const errState = React55.useState(null);
|
|
8912
|
+
const pos = React55.useState(null);
|
|
8913
|
+
const boxRef = React55.useRef(null), inputRef = React55.useRef(null), listRef = React55.useRef(null), inputMerged = useMergedRef(ref, inputRef);
|
|
8816
8914
|
const mounted = useMounted();
|
|
8817
8915
|
function nearest(v) {
|
|
8818
8916
|
const n3 = toMin(v);
|
|
@@ -8840,7 +8938,7 @@ window.Aura = (() => {
|
|
|
8840
8938
|
},
|
|
8841
8939
|
[open]
|
|
8842
8940
|
);
|
|
8843
|
-
|
|
8941
|
+
React55.useEffect(
|
|
8844
8942
|
function() {
|
|
8845
8943
|
if (!open) return;
|
|
8846
8944
|
function outside(e) {
|
|
@@ -8862,7 +8960,7 @@ window.Aura = (() => {
|
|
|
8862
8960
|
},
|
|
8863
8961
|
[open]
|
|
8864
8962
|
);
|
|
8865
|
-
|
|
8963
|
+
React55.useEffect(
|
|
8866
8964
|
function() {
|
|
8867
8965
|
if (!open || !listRef.current) return;
|
|
8868
8966
|
const el = listRef.current.querySelector('[data-idx="' + active + '"]');
|
|
@@ -8961,9 +9059,9 @@ window.Aura = (() => {
|
|
|
8961
9059
|
}
|
|
8962
9060
|
const error = errState[0] || props.error;
|
|
8963
9061
|
const list = open && mounted && pos[0] ? (0, import_react_dom12.createPortal)(
|
|
8964
|
-
/* @__PURE__ */
|
|
9062
|
+
/* @__PURE__ */ React55.createElement("div", { ref: listRef, className: "aura-combo__popover aura-time__popover", style: pos[0] }, /* @__PURE__ */ React55.createElement("ul", { id: listId, role: "listbox", "aria-label": props.label, className: "aura-combo__list" }, slots.map(function(s, i) {
|
|
8965
9063
|
const dis = blocked(s), sel = s === value;
|
|
8966
|
-
return /* @__PURE__ */
|
|
9064
|
+
return /* @__PURE__ */ React55.createElement(
|
|
8967
9065
|
"li",
|
|
8968
9066
|
{
|
|
8969
9067
|
key: s,
|
|
@@ -8988,13 +9086,13 @@ window.Aura = (() => {
|
|
|
8988
9086
|
if (active !== i) setActive(i);
|
|
8989
9087
|
}
|
|
8990
9088
|
},
|
|
8991
|
-
/* @__PURE__ */
|
|
8992
|
-
sel ? /* @__PURE__ */
|
|
9089
|
+
/* @__PURE__ */ React55.createElement("span", { className: "aura-combo__label" }, s),
|
|
9090
|
+
sel ? /* @__PURE__ */ React55.createElement(Icon, { name: /* @__PURE__ */ React55.createElement(IconCheck, null), className: "aura-combo__check" }) : null
|
|
8993
9091
|
);
|
|
8994
9092
|
}))),
|
|
8995
9093
|
document.body
|
|
8996
9094
|
) : null;
|
|
8997
|
-
return /* @__PURE__ */
|
|
9095
|
+
return /* @__PURE__ */ React55.createElement(
|
|
8998
9096
|
Field,
|
|
8999
9097
|
{
|
|
9000
9098
|
id,
|
|
@@ -9006,7 +9104,7 @@ window.Aura = (() => {
|
|
|
9006
9104
|
disabled: props.disabled,
|
|
9007
9105
|
className: cx(touchClass(props.touchHeight), props.className)
|
|
9008
9106
|
},
|
|
9009
|
-
/* @__PURE__ */
|
|
9107
|
+
/* @__PURE__ */ React55.createElement("div", { ref: boxRef, className: cx("aura-input aura-combo aura-time has-icon", open && "is-open") }, /* @__PURE__ */ React55.createElement(Icon, { name: /* @__PURE__ */ React55.createElement(IconClock, null), className: "aura-input__icon" }), /* @__PURE__ */ React55.createElement(
|
|
9010
9108
|
"input",
|
|
9011
9109
|
{
|
|
9012
9110
|
ref: inputMerged,
|
|
@@ -9046,7 +9144,7 @@ window.Aura = (() => {
|
|
|
9046
9144
|
}, 0);
|
|
9047
9145
|
}
|
|
9048
9146
|
}
|
|
9049
|
-
), props.clearable !== false && value != null && !props.disabled ? /* @__PURE__ */
|
|
9147
|
+
), props.clearable !== false && value != null && !props.disabled ? /* @__PURE__ */ React55.createElement(
|
|
9050
9148
|
"button",
|
|
9051
9149
|
{
|
|
9052
9150
|
type: "button",
|
|
@@ -9059,8 +9157,8 @@ window.Aura = (() => {
|
|
|
9059
9157
|
if (inputRef.current) inputRef.current.focus();
|
|
9060
9158
|
}
|
|
9061
9159
|
},
|
|
9062
|
-
/* @__PURE__ */
|
|
9063
|
-
) : null, /* @__PURE__ */
|
|
9160
|
+
/* @__PURE__ */ React55.createElement(Icon, { name: /* @__PURE__ */ React55.createElement(IconX, null) })
|
|
9161
|
+
) : null, /* @__PURE__ */ React55.createElement(
|
|
9064
9162
|
"button",
|
|
9065
9163
|
{
|
|
9066
9164
|
type: "button",
|
|
@@ -9078,14 +9176,14 @@ window.Aura = (() => {
|
|
|
9078
9176
|
}
|
|
9079
9177
|
}
|
|
9080
9178
|
},
|
|
9081
|
-
/* @__PURE__ */
|
|
9179
|
+
/* @__PURE__ */ React55.createElement(Icon, { name: /* @__PURE__ */ React55.createElement(IconChevronDown, null) })
|
|
9082
9180
|
)),
|
|
9083
9181
|
list
|
|
9084
9182
|
);
|
|
9085
9183
|
});
|
|
9086
9184
|
|
|
9087
9185
|
// src/FileUpload.tsx
|
|
9088
|
-
var
|
|
9186
|
+
var React56 = __toESM(require_react(), 1);
|
|
9089
9187
|
function matches(file, accept) {
|
|
9090
9188
|
if (!accept) return true;
|
|
9091
9189
|
const name = (file.name || "").toLowerCase(), type = (file.type || "").toLowerCase();
|
|
@@ -9109,24 +9207,24 @@ window.Aura = (() => {
|
|
|
9109
9207
|
}).join(", ");
|
|
9110
9208
|
}
|
|
9111
9209
|
var seq = 0;
|
|
9112
|
-
var FileUpload =
|
|
9210
|
+
var FileUpload = React56.forwardRef(function FileUpload2(props, ref) {
|
|
9113
9211
|
const t = useStrings();
|
|
9114
9212
|
const auto = uid(), id = props.id || auto;
|
|
9115
9213
|
const st = useMaybeControlled(props.value, props.defaultValue || [], props.onChange);
|
|
9116
9214
|
const items2 = st[0] || [];
|
|
9117
|
-
const dragState =
|
|
9118
|
-
const inputRef =
|
|
9119
|
-
const urls =
|
|
9215
|
+
const dragState = React56.useState(false), over = dragState[0];
|
|
9216
|
+
const inputRef = React56.useRef(null), inputMerged = useMergedRef(ref, inputRef);
|
|
9217
|
+
const urls = React56.useRef({});
|
|
9120
9218
|
const maxFiles = props.multiple ? props.maxFiles : 1;
|
|
9121
9219
|
const note = t.accepts(describeAccept(props.accept, t), props.maxSize ? formatBytes(props.maxSize) : "");
|
|
9122
|
-
|
|
9220
|
+
React56.useEffect(function() {
|
|
9123
9221
|
return function() {
|
|
9124
9222
|
Object.keys(urls.current).forEach(function(k) {
|
|
9125
9223
|
URL.revokeObjectURL(urls.current[k]);
|
|
9126
9224
|
});
|
|
9127
9225
|
};
|
|
9128
9226
|
}, []);
|
|
9129
|
-
|
|
9227
|
+
React56.useEffect(
|
|
9130
9228
|
function() {
|
|
9131
9229
|
const el = inputRef.current;
|
|
9132
9230
|
if (!el || !props.name || typeof DataTransfer === "undefined") return;
|
|
@@ -9186,7 +9284,7 @@ window.Aura = (() => {
|
|
|
9186
9284
|
if (inputRef.current) inputRef.current.focus();
|
|
9187
9285
|
}
|
|
9188
9286
|
const error = props.error;
|
|
9189
|
-
return /* @__PURE__ */
|
|
9287
|
+
return /* @__PURE__ */ React56.createElement(
|
|
9190
9288
|
Field,
|
|
9191
9289
|
{
|
|
9192
9290
|
id,
|
|
@@ -9198,7 +9296,7 @@ window.Aura = (() => {
|
|
|
9198
9296
|
disabled: props.disabled,
|
|
9199
9297
|
className: props.className
|
|
9200
9298
|
},
|
|
9201
|
-
/* @__PURE__ */
|
|
9299
|
+
/* @__PURE__ */ React56.createElement(
|
|
9202
9300
|
"div",
|
|
9203
9301
|
{
|
|
9204
9302
|
className: cx("aura-upload", over && "is-over", props.disabled && "is-disabled", error && "is-invalid"),
|
|
@@ -9219,9 +9317,9 @@ window.Aura = (() => {
|
|
|
9219
9317
|
add(e.dataTransfer && e.dataTransfer.files);
|
|
9220
9318
|
}
|
|
9221
9319
|
},
|
|
9222
|
-
/* @__PURE__ */
|
|
9223
|
-
/* @__PURE__ */
|
|
9224
|
-
/* @__PURE__ */
|
|
9320
|
+
/* @__PURE__ */ React56.createElement(Icon, { name: /* @__PURE__ */ React56.createElement(IconCloudUpload, null), size: "lg", className: "aura-upload__icon" }),
|
|
9321
|
+
/* @__PURE__ */ React56.createElement("span", { className: "aura-upload__text" }, t.dropFiles, " "),
|
|
9322
|
+
/* @__PURE__ */ React56.createElement(
|
|
9225
9323
|
"input",
|
|
9226
9324
|
{
|
|
9227
9325
|
ref: inputMerged,
|
|
@@ -9243,12 +9341,12 @@ window.Aura = (() => {
|
|
|
9243
9341
|
}
|
|
9244
9342
|
}
|
|
9245
9343
|
),
|
|
9246
|
-
/* @__PURE__ */
|
|
9247
|
-
note ? /* @__PURE__ */
|
|
9344
|
+
/* @__PURE__ */ React56.createElement("span", { className: "aura-upload__browse", "aria-hidden": true }, props.multiple ? t.browse : t.browseOne),
|
|
9345
|
+
note ? /* @__PURE__ */ React56.createElement("span", { className: "aura-upload__note", id: id + "-note" }, note) : null
|
|
9248
9346
|
),
|
|
9249
|
-
items2.length ? /* @__PURE__ */
|
|
9347
|
+
items2.length ? /* @__PURE__ */ React56.createElement("ul", { className: "aura-upload__list", "aria-live": "polite" }, items2.map(function(it) {
|
|
9250
9348
|
const src = thumb(it);
|
|
9251
|
-
return /* @__PURE__ */
|
|
9349
|
+
return /* @__PURE__ */ React56.createElement("li", { key: it.id, className: cx("aura-upload__item", it.error && "is-error") }, src ? /* @__PURE__ */ React56.createElement("img", { className: "aura-upload__thumb", src, alt: "" }) : /* @__PURE__ */ React56.createElement("span", { className: "aura-upload__thumb is-icon", "aria-hidden": true }, /* @__PURE__ */ React56.createElement(Icon, { name: /^image\//.test(it.type || "") ? /* @__PURE__ */ React56.createElement(IconImage, null) : /* @__PURE__ */ React56.createElement(IconFile, null), size: "md" })), /* @__PURE__ */ React56.createElement("span", { className: "aura-upload__meta" }, it.url && !it.error ? /* @__PURE__ */ React56.createElement("a", { className: "aura-upload__name", href: it.url, target: "_blank", rel: "noreferrer" }, it.name) : /* @__PURE__ */ React56.createElement("span", { className: "aura-upload__name" }, it.name), /* @__PURE__ */ React56.createElement("span", { className: "aura-upload__sub" }, it.error ? /* @__PURE__ */ React56.createElement(React56.Fragment, null, /* @__PURE__ */ React56.createElement(Icon, { name: /* @__PURE__ */ React56.createElement(IconCircleAlert, null), size: 12 }), it.error) : it.status === "uploading" ? t.uploading + (it.progress != null ? " " + Math.round(it.progress) + "%" : "") : it.status === "done" ? /* @__PURE__ */ React56.createElement(React56.Fragment, null, /* @__PURE__ */ React56.createElement(Icon, { name: /* @__PURE__ */ React56.createElement(IconCircleCheck, null), size: 12 }), formatBytes(it.size)) : formatBytes(it.size)), it.status === "uploading" ? /* @__PURE__ */ React56.createElement(
|
|
9252
9350
|
"span",
|
|
9253
9351
|
{
|
|
9254
9352
|
className: "aura-upload__bar",
|
|
@@ -9258,11 +9356,11 @@ window.Aura = (() => {
|
|
|
9258
9356
|
"aria-valuemax": 100,
|
|
9259
9357
|
"aria-valuenow": it.progress != null ? Math.round(it.progress) : void 0
|
|
9260
9358
|
},
|
|
9261
|
-
/* @__PURE__ */
|
|
9262
|
-
) : null), /* @__PURE__ */
|
|
9359
|
+
/* @__PURE__ */ React56.createElement("span", { style: { width: (it.progress || 0) + "%" } })
|
|
9360
|
+
) : null), /* @__PURE__ */ React56.createElement(
|
|
9263
9361
|
IconButton,
|
|
9264
9362
|
{
|
|
9265
|
-
icon: /* @__PURE__ */
|
|
9363
|
+
icon: /* @__PURE__ */ React56.createElement(IconX, null),
|
|
9266
9364
|
label: t.remove(it.name),
|
|
9267
9365
|
onClick: function() {
|
|
9268
9366
|
remove(it);
|
|
@@ -9578,9 +9676,9 @@ window.Aura = (() => {
|
|
|
9578
9676
|
}
|
|
9579
9677
|
|
|
9580
9678
|
// src/ThemeStyle.tsx
|
|
9581
|
-
var
|
|
9679
|
+
var React57 = __toESM(require_react(), 1);
|
|
9582
9680
|
function ThemeStyle(props) {
|
|
9583
|
-
const css =
|
|
9681
|
+
const css = React57.useMemo(
|
|
9584
9682
|
function() {
|
|
9585
9683
|
try {
|
|
9586
9684
|
return createTheme({
|
|
@@ -9597,11 +9695,11 @@ window.Aura = (() => {
|
|
|
9597
9695
|
[props.brand, props.signal, props.primary, props.name, props.selector]
|
|
9598
9696
|
);
|
|
9599
9697
|
if (css === null) return null;
|
|
9600
|
-
return /* @__PURE__ */
|
|
9698
|
+
return /* @__PURE__ */ React57.createElement("style", { "data-aura-theme": props.name || props.brand, dangerouslySetInnerHTML: { __html: css } });
|
|
9601
9699
|
}
|
|
9602
9700
|
|
|
9603
9701
|
// src/colorScheme.tsx
|
|
9604
|
-
var
|
|
9702
|
+
var React58 = __toESM(require_react(), 1);
|
|
9605
9703
|
|
|
9606
9704
|
// src/colorSchemeScript.ts
|
|
9607
9705
|
var DEFAULT_KEY = "aura-color-scheme";
|
|
@@ -9618,7 +9716,7 @@ window.Aura = (() => {
|
|
|
9618
9716
|
|
|
9619
9717
|
// src/colorScheme.tsx
|
|
9620
9718
|
function ColorSchemeScript(props) {
|
|
9621
|
-
return /* @__PURE__ */
|
|
9719
|
+
return /* @__PURE__ */ React58.createElement(
|
|
9622
9720
|
"script",
|
|
9623
9721
|
{
|
|
9624
9722
|
"data-aura-color-scheme": "",
|
|
@@ -9643,7 +9741,7 @@ window.Aura = (() => {
|
|
|
9643
9741
|
function useColorScheme(options) {
|
|
9644
9742
|
const key = options && options.storageKey || DEFAULT_KEY;
|
|
9645
9743
|
const fallback = options && options.defaultScheme || "system";
|
|
9646
|
-
const subscribe2 =
|
|
9744
|
+
const subscribe2 = React58.useCallback(
|
|
9647
9745
|
function(cb) {
|
|
9648
9746
|
const mq = window.matchMedia ? window.matchMedia("(prefers-color-scheme: dark)") : null;
|
|
9649
9747
|
function onSystem() {
|
|
@@ -9665,7 +9763,7 @@ window.Aura = (() => {
|
|
|
9665
9763
|
},
|
|
9666
9764
|
[fallback, key]
|
|
9667
9765
|
);
|
|
9668
|
-
const snapshot =
|
|
9766
|
+
const snapshot = React58.useSyncExternalStore(
|
|
9669
9767
|
subscribe2,
|
|
9670
9768
|
function() {
|
|
9671
9769
|
const s = readScheme(fallback);
|
|
@@ -9676,7 +9774,7 @@ window.Aura = (() => {
|
|
|
9676
9774
|
}
|
|
9677
9775
|
);
|
|
9678
9776
|
const parts = snapshot.split("|");
|
|
9679
|
-
const setScheme =
|
|
9777
|
+
const setScheme = React58.useCallback(
|
|
9680
9778
|
function(next) {
|
|
9681
9779
|
if (!valid(next)) return;
|
|
9682
9780
|
try {
|
|
@@ -9695,14 +9793,14 @@ window.Aura = (() => {
|
|
|
9695
9793
|
const cs = useColorScheme(props);
|
|
9696
9794
|
const names = { light: t.schemeLight, dark: t.schemeDark, system: t.schemeSystem };
|
|
9697
9795
|
const label = props.label || t.colorScheme;
|
|
9698
|
-
return /* @__PURE__ */
|
|
9796
|
+
return /* @__PURE__ */ React58.createElement(
|
|
9699
9797
|
DropdownMenu,
|
|
9700
9798
|
{
|
|
9701
9799
|
label,
|
|
9702
|
-
trigger: /* @__PURE__ */
|
|
9800
|
+
trigger: /* @__PURE__ */ React58.createElement(
|
|
9703
9801
|
IconButton,
|
|
9704
9802
|
{
|
|
9705
|
-
icon: cs.resolved === "dark" ? /* @__PURE__ */
|
|
9803
|
+
icon: cs.resolved === "dark" ? /* @__PURE__ */ React58.createElement(IconMoon, null) : /* @__PURE__ */ React58.createElement(IconSun, null),
|
|
9706
9804
|
label: label + ": " + names[cs.scheme]
|
|
9707
9805
|
}
|
|
9708
9806
|
),
|
|
@@ -9720,14 +9818,14 @@ window.Aura = (() => {
|
|
|
9720
9818
|
}
|
|
9721
9819
|
|
|
9722
9820
|
// src/Badge.tsx
|
|
9723
|
-
var
|
|
9724
|
-
var Badge =
|
|
9821
|
+
var React59 = __toESM(require_react(), 1);
|
|
9822
|
+
var Badge = React59.forwardRef(function Badge2(props, ref) {
|
|
9725
9823
|
return badgeElement(props, ref);
|
|
9726
9824
|
});
|
|
9727
9825
|
|
|
9728
9826
|
// src/Progress.tsx
|
|
9729
|
-
var
|
|
9730
|
-
var Progress =
|
|
9827
|
+
var React60 = __toESM(require_react(), 1);
|
|
9828
|
+
var Progress = React60.forwardRef(function Progress2(props, ref) {
|
|
9731
9829
|
const t = useStrings();
|
|
9732
9830
|
const auto = uid(), id = props.id || auto;
|
|
9733
9831
|
const max = props.max || 100, det = props.value != null;
|
|
@@ -9736,7 +9834,7 @@ window.Aura = (() => {
|
|
|
9736
9834
|
const spct = sec ? Math.max(0, Math.min(100 - pct, sec / max * 100)) : 0;
|
|
9737
9835
|
const valueText = props.valueText != null ? props.valueText : props.valueLabel != null ? String(props.valueLabel) : sec ? t.progressReserved(props.value, sec, max) : void 0;
|
|
9738
9836
|
const shown = props.valueLabel != null ? props.valueLabel : det ? Math.round(pct) + "%" : null;
|
|
9739
|
-
return /* @__PURE__ */
|
|
9837
|
+
return /* @__PURE__ */ React60.createElement(
|
|
9740
9838
|
"div",
|
|
9741
9839
|
{
|
|
9742
9840
|
ref,
|
|
@@ -9747,8 +9845,8 @@ window.Aura = (() => {
|
|
|
9747
9845
|
props.className
|
|
9748
9846
|
)
|
|
9749
9847
|
},
|
|
9750
|
-
props.label || props.showValue && shown ? /* @__PURE__ */
|
|
9751
|
-
/* @__PURE__ */
|
|
9848
|
+
props.label || props.showValue && shown ? /* @__PURE__ */ React60.createElement("div", { className: "aura-progress__head" }, props.label ? /* @__PURE__ */ React60.createElement("span", { className: "aura-progress__label", id: id + "-label" }, props.label) : /* @__PURE__ */ React60.createElement("span", null), props.showValue && shown ? /* @__PURE__ */ React60.createElement("span", { className: "aura-progress__value" }, shown) : null) : null,
|
|
9849
|
+
/* @__PURE__ */ React60.createElement(
|
|
9752
9850
|
"div",
|
|
9753
9851
|
{
|
|
9754
9852
|
className: cx("aura-progress__track", !det && "is-indeterminate"),
|
|
@@ -9760,8 +9858,8 @@ window.Aura = (() => {
|
|
|
9760
9858
|
"aria-valuenow": det ? props.value : void 0,
|
|
9761
9859
|
"aria-valuetext": det ? valueText : void 0
|
|
9762
9860
|
},
|
|
9763
|
-
/* @__PURE__ */
|
|
9764
|
-
sec ? /* @__PURE__ */
|
|
9861
|
+
/* @__PURE__ */ React60.createElement("span", { className: "aura-progress__bar", style: det ? { width: pct + "%" } : void 0 }),
|
|
9862
|
+
sec ? /* @__PURE__ */ React60.createElement(
|
|
9765
9863
|
"span",
|
|
9766
9864
|
{
|
|
9767
9865
|
className: "aura-progress__bar aura-progress__bar--reserved",
|
|
@@ -9769,19 +9867,19 @@ window.Aura = (() => {
|
|
|
9769
9867
|
}
|
|
9770
9868
|
) : null
|
|
9771
9869
|
),
|
|
9772
|
-
props.hint ? /* @__PURE__ */
|
|
9870
|
+
props.hint ? /* @__PURE__ */ React60.createElement("p", { className: "aura-progress__hint" }, props.hint) : null
|
|
9773
9871
|
);
|
|
9774
9872
|
});
|
|
9775
9873
|
|
|
9776
9874
|
// src/Skeleton.tsx
|
|
9777
|
-
var
|
|
9778
|
-
var Skeleton =
|
|
9875
|
+
var React61 = __toESM(require_react(), 1);
|
|
9876
|
+
var Skeleton = React61.forwardRef(function Skeleton2(props, ref) {
|
|
9779
9877
|
const v = props.variant || "text";
|
|
9780
9878
|
if (v === "text" && (props.lines || 1) > 1) {
|
|
9781
9879
|
const n3 = props.lines, rows = [];
|
|
9782
9880
|
for (let i = 0; i < n3; i++)
|
|
9783
|
-
rows.push(/* @__PURE__ */
|
|
9784
|
-
return /* @__PURE__ */
|
|
9881
|
+
rows.push(/* @__PURE__ */ React61.createElement("span", { key: i, className: "aura-skel aura-skel--text", style: { width: i === n3 - 1 ? "60%" : "100%" } }));
|
|
9882
|
+
return /* @__PURE__ */ React61.createElement(
|
|
9785
9883
|
"span",
|
|
9786
9884
|
{
|
|
9787
9885
|
ref,
|
|
@@ -9799,17 +9897,17 @@ window.Aura = (() => {
|
|
|
9799
9897
|
if (v === "circle") {
|
|
9800
9898
|
style.width = style.height = props.size || props.width || 40;
|
|
9801
9899
|
}
|
|
9802
|
-
return /* @__PURE__ */
|
|
9900
|
+
return /* @__PURE__ */ React61.createElement("span", { ref, "aria-hidden": true, className: cx("aura-skel", "aura-skel--" + v, props.className), style });
|
|
9803
9901
|
});
|
|
9804
9902
|
|
|
9805
9903
|
// src/EmptyState.tsx
|
|
9806
|
-
var
|
|
9807
|
-
var EmptyState =
|
|
9904
|
+
var React62 = __toESM(require_react(), 1);
|
|
9905
|
+
var EmptyState = React62.forwardRef(function EmptyState2(props, ref) {
|
|
9808
9906
|
return emptyStateElement(props, ref);
|
|
9809
9907
|
});
|
|
9810
9908
|
|
|
9811
9909
|
// src/Pagination.tsx
|
|
9812
|
-
var
|
|
9910
|
+
var React63 = __toESM(require_react(), 1);
|
|
9813
9911
|
function pageList(page, count, sib) {
|
|
9814
9912
|
let out = [], lo = Math.max(2, page - sib), hi = Math.min(count - 1, page + sib);
|
|
9815
9913
|
if (page - sib <= 3) {
|
|
@@ -9829,7 +9927,7 @@ window.Aura = (() => {
|
|
|
9829
9927
|
if (count > 1) out.push(count);
|
|
9830
9928
|
return out;
|
|
9831
9929
|
}
|
|
9832
|
-
var Pagination =
|
|
9930
|
+
var Pagination = React63.forwardRef(function Pagination2(props, ref) {
|
|
9833
9931
|
const t = useStrings();
|
|
9834
9932
|
useAutoTip();
|
|
9835
9933
|
const count = Math.max(1, props.pageCount || 1);
|
|
@@ -9849,7 +9947,7 @@ window.Aura = (() => {
|
|
|
9849
9947
|
},
|
|
9850
9948
|
extra
|
|
9851
9949
|
);
|
|
9852
|
-
return link ? /* @__PURE__ */
|
|
9950
|
+
return link ? /* @__PURE__ */ React63.createElement(
|
|
9853
9951
|
Link,
|
|
9854
9952
|
{
|
|
9855
9953
|
href: link(p),
|
|
@@ -9862,7 +9960,7 @@ window.Aura = (() => {
|
|
|
9862
9960
|
...common
|
|
9863
9961
|
},
|
|
9864
9962
|
label
|
|
9865
|
-
) : /* @__PURE__ */
|
|
9963
|
+
) : /* @__PURE__ */ React63.createElement(
|
|
9866
9964
|
"button",
|
|
9867
9965
|
{
|
|
9868
9966
|
type: "button",
|
|
@@ -9876,7 +9974,7 @@ window.Aura = (() => {
|
|
|
9876
9974
|
}
|
|
9877
9975
|
function arrow(p, icon, label, rel, disabled) {
|
|
9878
9976
|
if (!link || disabled)
|
|
9879
|
-
return /* @__PURE__ */
|
|
9977
|
+
return /* @__PURE__ */ React63.createElement(
|
|
9880
9978
|
IconButton,
|
|
9881
9979
|
{
|
|
9882
9980
|
icon,
|
|
@@ -9887,7 +9985,7 @@ window.Aura = (() => {
|
|
|
9887
9985
|
}
|
|
9888
9986
|
}
|
|
9889
9987
|
);
|
|
9890
|
-
return /* @__PURE__ */
|
|
9988
|
+
return /* @__PURE__ */ React63.createElement(
|
|
9891
9989
|
Link,
|
|
9892
9990
|
{
|
|
9893
9991
|
href: link(p),
|
|
@@ -9902,17 +10000,17 @@ window.Aura = (() => {
|
|
|
9902
10000
|
}
|
|
9903
10001
|
}
|
|
9904
10002
|
},
|
|
9905
|
-
/* @__PURE__ */
|
|
10003
|
+
/* @__PURE__ */ React63.createElement(Icon, { name: icon, size: "sm" })
|
|
9906
10004
|
);
|
|
9907
10005
|
}
|
|
9908
|
-
return /* @__PURE__ */
|
|
9909
|
-
return typeof p === "number" ? /* @__PURE__ */
|
|
9910
|
-
})), /* @__PURE__ */
|
|
10006
|
+
return /* @__PURE__ */ React63.createElement("nav", { ref, className: cx("aura-pagination", props.className), "aria-label": props.label || t.pagination }, arrow(page - 1, /* @__PURE__ */ React63.createElement(IconChevronLeft, null), t.prevPage, "prev", page <= 1), /* @__PURE__ */ React63.createElement("ol", { className: "aura-pagination__list" }, pageList(page, count, props.siblingCount == null ? 1 : props.siblingCount).map(function(p) {
|
|
10007
|
+
return typeof p === "number" ? /* @__PURE__ */ React63.createElement("li", { key: p }, item(p, p)) : /* @__PURE__ */ React63.createElement("li", { key: p, className: "aura-pagination__gap", "aria-hidden": true }, "\u2026");
|
|
10008
|
+
})), /* @__PURE__ */ React63.createElement("span", { className: "aura-pagination__compact", "aria-hidden": true }, t.page(page, count)), arrow(page + 1, /* @__PURE__ */ React63.createElement(IconChevronRight, null), t.nextPage, "next", page >= count));
|
|
9911
10009
|
});
|
|
9912
10010
|
|
|
9913
10011
|
// src/Accordion.tsx
|
|
9914
|
-
var
|
|
9915
|
-
var Accordion =
|
|
10012
|
+
var React64 = __toESM(require_react(), 1);
|
|
10013
|
+
var Accordion = React64.forwardRef(function Accordion2(props, ref) {
|
|
9916
10014
|
const auto = uid(), base = props.id || auto;
|
|
9917
10015
|
const multiple = props.type === "multiple";
|
|
9918
10016
|
const st = useMaybeControlled(
|
|
@@ -9950,9 +10048,9 @@ window.Aura = (() => {
|
|
|
9950
10048
|
n3.focus();
|
|
9951
10049
|
}
|
|
9952
10050
|
}
|
|
9953
|
-
return /* @__PURE__ */
|
|
10051
|
+
return /* @__PURE__ */ React64.createElement("div", { ref, className: cx("aura-accordion", props.className), onKeyDown: onKey }, items2.map(function(it) {
|
|
9954
10052
|
const on = open.indexOf(it.id) >= 0, bid = base + "-btn-" + it.id, pid = base + "-panel-" + it.id;
|
|
9955
|
-
return /* @__PURE__ */
|
|
10053
|
+
return /* @__PURE__ */ React64.createElement("div", { key: it.id, className: cx("aura-accordion__item", on && "is-open") }, /* @__PURE__ */ React64.createElement(HT, { className: "aura-accordion__heading" }, /* @__PURE__ */ React64.createElement(
|
|
9956
10054
|
"button",
|
|
9957
10055
|
{
|
|
9958
10056
|
type: "button",
|
|
@@ -9965,10 +10063,10 @@ window.Aura = (() => {
|
|
|
9965
10063
|
toggle(it.id);
|
|
9966
10064
|
}
|
|
9967
10065
|
},
|
|
9968
|
-
it.icon ? /* @__PURE__ */
|
|
9969
|
-
/* @__PURE__ */
|
|
9970
|
-
/* @__PURE__ */
|
|
9971
|
-
)), /* @__PURE__ */
|
|
10066
|
+
it.icon ? /* @__PURE__ */ React64.createElement(Icon, { name: it.icon, className: "aura-accordion__lead" }) : null,
|
|
10067
|
+
/* @__PURE__ */ React64.createElement("span", { className: "aura-accordion__title" }, /* @__PURE__ */ React64.createElement("span", { id: it.description ? bid + "-title" : void 0 }, it.title), it.description ? /* @__PURE__ */ React64.createElement("span", { className: "aura-accordion__desc", id: bid + "-desc", "aria-hidden": true }, it.description) : null),
|
|
10068
|
+
/* @__PURE__ */ React64.createElement(Icon, { name: /* @__PURE__ */ React64.createElement(IconChevronDown, null), className: "aura-accordion__chevron" })
|
|
10069
|
+
)), /* @__PURE__ */ React64.createElement(
|
|
9972
10070
|
"div",
|
|
9973
10071
|
{
|
|
9974
10072
|
id: pid,
|
|
@@ -9983,7 +10081,7 @@ window.Aura = (() => {
|
|
|
9983
10081
|
});
|
|
9984
10082
|
|
|
9985
10083
|
// src/Popover.tsx
|
|
9986
|
-
var
|
|
10084
|
+
var React65 = __toESM(require_react(), 1);
|
|
9987
10085
|
var import_react_dom13 = __toESM(require_react_dom(), 1);
|
|
9988
10086
|
function position(anchor, pop, placement) {
|
|
9989
10087
|
const r2 = anchor.getBoundingClientRect(), pw = pop.offsetWidth, ph = pop.scrollHeight, vw = window.innerWidth, vh = window.innerHeight, gap = 6;
|
|
@@ -10001,15 +10099,15 @@ window.Aura = (() => {
|
|
|
10001
10099
|
const left = align === "end" ? r2.right - pw : align === "center" ? r2.left + r2.width / 2 - pw / 2 : r2.left;
|
|
10002
10100
|
return { top: Math.max(8, top), left: Math.max(8, Math.min(left, vw - pw - 8)), side, maxHeight };
|
|
10003
10101
|
}
|
|
10004
|
-
var Popover =
|
|
10102
|
+
var Popover = React65.forwardRef(function Popover2(props, ref) {
|
|
10005
10103
|
const t = useStrings();
|
|
10006
10104
|
const density = useDensity();
|
|
10007
10105
|
const auto = uid(), id = props.id || auto;
|
|
10008
10106
|
const st = useMaybeControlled(props.open, !!props.defaultOpen, props.onOpenChange);
|
|
10009
10107
|
const open = !!st[0];
|
|
10010
|
-
const wrap =
|
|
10011
|
-
const pos =
|
|
10012
|
-
const inTree =
|
|
10108
|
+
const wrap = React65.useRef(null), pop = React65.useRef(null), popMerged = useMergedRef(ref, pop);
|
|
10109
|
+
const pos = React65.useState(null), mounted = useMounted();
|
|
10110
|
+
const inTree = React65.useRef(false);
|
|
10013
10111
|
function trigger() {
|
|
10014
10112
|
return wrap.current && (wrap.current.querySelector('button, [role="button"], a, input') || wrap.current.firstElementChild);
|
|
10015
10113
|
}
|
|
@@ -10036,7 +10134,7 @@ window.Aura = (() => {
|
|
|
10036
10134
|
},
|
|
10037
10135
|
[open, mounted, props.placement]
|
|
10038
10136
|
);
|
|
10039
|
-
|
|
10137
|
+
React65.useEffect(
|
|
10040
10138
|
function() {
|
|
10041
10139
|
if (!open || !mounted) return;
|
|
10042
10140
|
if (props.autoFocus !== false && pop.current) {
|
|
@@ -10061,9 +10159,9 @@ window.Aura = (() => {
|
|
|
10061
10159
|
},
|
|
10062
10160
|
[open, mounted]
|
|
10063
10161
|
);
|
|
10064
|
-
const child =
|
|
10162
|
+
const child = React65.Children.only(props.trigger);
|
|
10065
10163
|
const panel = open && mounted ? (0, import_react_dom13.createPortal)(
|
|
10066
|
-
/* @__PURE__ */
|
|
10164
|
+
/* @__PURE__ */ React65.createElement(
|
|
10067
10165
|
"div",
|
|
10068
10166
|
{
|
|
10069
10167
|
ref: popMerged,
|
|
@@ -10093,17 +10191,17 @@ window.Aura = (() => {
|
|
|
10093
10191
|
} else trapTab(e, pop.current);
|
|
10094
10192
|
}
|
|
10095
10193
|
},
|
|
10096
|
-
props.title ? /* @__PURE__ */
|
|
10194
|
+
props.title ? /* @__PURE__ */ React65.createElement("div", { className: "aura-popover__head" }, /* @__PURE__ */ React65.createElement("p", { className: "aura-popover__title", id: id + "-title" }, props.title), /* @__PURE__ */ React65.createElement(
|
|
10097
10195
|
IconButton,
|
|
10098
10196
|
{
|
|
10099
|
-
icon: /* @__PURE__ */
|
|
10197
|
+
icon: /* @__PURE__ */ React65.createElement(IconX, null),
|
|
10100
10198
|
label: t.close,
|
|
10101
10199
|
onClick: function() {
|
|
10102
10200
|
close(true);
|
|
10103
10201
|
}
|
|
10104
10202
|
}
|
|
10105
10203
|
)) : null,
|
|
10106
|
-
/* @__PURE__ */
|
|
10204
|
+
/* @__PURE__ */ React65.createElement("div", { className: "aura-popover__body" }, typeof props.children === "function" ? props.children({
|
|
10107
10205
|
close: function() {
|
|
10108
10206
|
close(true);
|
|
10109
10207
|
}
|
|
@@ -10111,7 +10209,7 @@ window.Aura = (() => {
|
|
|
10111
10209
|
),
|
|
10112
10210
|
document.body
|
|
10113
10211
|
) : null;
|
|
10114
|
-
return /* @__PURE__ */
|
|
10212
|
+
return /* @__PURE__ */ React65.createElement("span", { ref: wrap, className: "aura-popover-anchor" }, React65.cloneElement(child, {
|
|
10115
10213
|
onClick: function(e) {
|
|
10116
10214
|
if (child.props.onClick) child.props.onClick(e);
|
|
10117
10215
|
st[1](!open);
|
|
@@ -10123,7 +10221,7 @@ window.Aura = (() => {
|
|
|
10123
10221
|
});
|
|
10124
10222
|
|
|
10125
10223
|
// src/NumberField.tsx
|
|
10126
|
-
var
|
|
10224
|
+
var React66 = __toESM(require_react(), 1);
|
|
10127
10225
|
function decimalsOf(n3) {
|
|
10128
10226
|
const s = String(n3);
|
|
10129
10227
|
const i = s.indexOf(".");
|
|
@@ -10136,7 +10234,7 @@ window.Aura = (() => {
|
|
|
10136
10234
|
if (!/^-?(\d+\.?\d*|\.\d+)$/.test(s)) return NaN;
|
|
10137
10235
|
return Number(s);
|
|
10138
10236
|
}
|
|
10139
|
-
var NumberField =
|
|
10237
|
+
var NumberField = React66.forwardRef(function NumberField2(props, ref) {
|
|
10140
10238
|
const t = useStrings();
|
|
10141
10239
|
const auto = uid(), id = props.id || auto;
|
|
10142
10240
|
const step = props.step || 1;
|
|
@@ -10147,7 +10245,7 @@ window.Aura = (() => {
|
|
|
10147
10245
|
props.onChange
|
|
10148
10246
|
);
|
|
10149
10247
|
const value = st[0], setValue = st[1];
|
|
10150
|
-
const draftState =
|
|
10248
|
+
const draftState = React66.useState(null), draft = draftState[0], setDraft = draftState[1];
|
|
10151
10249
|
function fmt2(n3) {
|
|
10152
10250
|
if (n3 == null || isNaN(n3)) return "";
|
|
10153
10251
|
return n3.toLocaleString("en", { minimumFractionDigits: decimals, maximumFractionDigits: decimals });
|
|
@@ -10196,7 +10294,7 @@ window.Aura = (() => {
|
|
|
10196
10294
|
};
|
|
10197
10295
|
const valueText = value == null ? void 0 : [affixText(props.prefix), fmt2(value), affixText(props.suffix)].join(" ").trim();
|
|
10198
10296
|
const stepper = props.stepper !== false && !props.readOnly;
|
|
10199
|
-
return /* @__PURE__ */
|
|
10297
|
+
return /* @__PURE__ */ React66.createElement(
|
|
10200
10298
|
Field,
|
|
10201
10299
|
{
|
|
10202
10300
|
id,
|
|
@@ -10208,7 +10306,7 @@ window.Aura = (() => {
|
|
|
10208
10306
|
disabled: props.disabled,
|
|
10209
10307
|
className: cx(touchClass(props.touchHeight), props.className)
|
|
10210
10308
|
},
|
|
10211
|
-
/* @__PURE__ */
|
|
10309
|
+
/* @__PURE__ */ React66.createElement("div", { className: cx("aura-input aura-number", stepper && "has-stepper") }, props.prefix != null ? /* @__PURE__ */ React66.createElement("span", { className: "aura-number__affix", "aria-hidden": true }, props.prefix) : null, /* @__PURE__ */ React66.createElement(
|
|
10212
10310
|
"input",
|
|
10213
10311
|
{
|
|
10214
10312
|
ref,
|
|
@@ -10255,7 +10353,7 @@ window.Aura = (() => {
|
|
|
10255
10353
|
},
|
|
10256
10354
|
onKeyDown
|
|
10257
10355
|
}
|
|
10258
|
-
), props.suffix != null ? /* @__PURE__ */
|
|
10356
|
+
), props.suffix != null ? /* @__PURE__ */ React66.createElement("span", { className: "aura-number__affix", "aria-hidden": true }, props.suffix) : null, stepper ? /* @__PURE__ */ React66.createElement("span", { className: "aura-number__steps" }, /* @__PURE__ */ React66.createElement(
|
|
10259
10357
|
"button",
|
|
10260
10358
|
{
|
|
10261
10359
|
type: "button",
|
|
@@ -10271,8 +10369,8 @@ window.Aura = (() => {
|
|
|
10271
10369
|
nudge(-step);
|
|
10272
10370
|
}
|
|
10273
10371
|
},
|
|
10274
|
-
/* @__PURE__ */
|
|
10275
|
-
), /* @__PURE__ */
|
|
10372
|
+
/* @__PURE__ */ React66.createElement(Icon, { name: /* @__PURE__ */ React66.createElement(IconMinus, null) })
|
|
10373
|
+
), /* @__PURE__ */ React66.createElement(
|
|
10276
10374
|
"button",
|
|
10277
10375
|
{
|
|
10278
10376
|
type: "button",
|
|
@@ -10288,14 +10386,14 @@ window.Aura = (() => {
|
|
|
10288
10386
|
nudge(step);
|
|
10289
10387
|
}
|
|
10290
10388
|
},
|
|
10291
|
-
/* @__PURE__ */
|
|
10389
|
+
/* @__PURE__ */ React66.createElement(Icon, { name: /* @__PURE__ */ React66.createElement(IconPlus, null) })
|
|
10292
10390
|
)) : null)
|
|
10293
10391
|
);
|
|
10294
10392
|
});
|
|
10295
10393
|
|
|
10296
10394
|
// src/Stepper.tsx
|
|
10297
|
-
var
|
|
10298
|
-
var Stepper =
|
|
10395
|
+
var React67 = __toESM(require_react(), 1);
|
|
10396
|
+
var Stepper = React67.forwardRef(function Stepper2(props, ref) {
|
|
10299
10397
|
const t = useStrings();
|
|
10300
10398
|
const idBase = uid();
|
|
10301
10399
|
const steps = props.steps || [];
|
|
@@ -10306,22 +10404,22 @@ window.Aura = (() => {
|
|
|
10306
10404
|
if (at < 0) at = 0;
|
|
10307
10405
|
const vertical = props.orientation === "vertical";
|
|
10308
10406
|
const cur2 = steps[at];
|
|
10309
|
-
return /* @__PURE__ */
|
|
10407
|
+
return /* @__PURE__ */ React67.createElement(
|
|
10310
10408
|
"nav",
|
|
10311
10409
|
{
|
|
10312
10410
|
ref,
|
|
10313
10411
|
"aria-label": props.label,
|
|
10314
10412
|
className: cx("aura-stepper", vertical ? "aura-stepper--vertical" : "aura-stepper--horizontal", props.className)
|
|
10315
10413
|
},
|
|
10316
|
-
/* @__PURE__ */
|
|
10414
|
+
/* @__PURE__ */ React67.createElement("ol", { className: "aura-stepper__list" }, steps.map(function(s, i) {
|
|
10317
10415
|
const state = i < at ? "done" : i === at ? "current" : "upcoming";
|
|
10318
10416
|
const error = s.status === "error";
|
|
10319
|
-
const marker = /* @__PURE__ */
|
|
10417
|
+
const marker = /* @__PURE__ */ React67.createElement("span", { className: "aura-stepper__marker", "aria-hidden": true }, error ? /* @__PURE__ */ React67.createElement(Icon, { name: /* @__PURE__ */ React67.createElement(IconCircleAlert, null) }) : state === "done" ? /* @__PURE__ */ React67.createElement(Icon, { name: /* @__PURE__ */ React67.createElement(IconCheck, null) }) : i + 1);
|
|
10320
10418
|
const note = error ? t.stepError : state === "done" ? t.stepDone : "";
|
|
10321
10419
|
const clickable = state === "done" && !!props.onStepClick;
|
|
10322
10420
|
const named = clickable && (typeof s.label === "string" || typeof s.label === "number") && String(s.label).trim() !== "";
|
|
10323
10421
|
const descId = idBase + "-step-" + i;
|
|
10324
|
-
const text2 = /* @__PURE__ */
|
|
10422
|
+
const text2 = /* @__PURE__ */ React67.createElement("span", { className: "aura-stepper__text" }, named ? /* @__PURE__ */ React67.createElement("span", { className: "aura-sr-only" }, String(s.label) + (note ? ", " + note : "")) : null, /* @__PURE__ */ React67.createElement("span", { className: "aura-stepper__label", "aria-hidden": named ? true : void 0 }, s.label, note && !named ? /* @__PURE__ */ React67.createElement("span", { className: "aura-sr-only" }, ", " + note) : null), s.description ? /* @__PURE__ */ React67.createElement(
|
|
10325
10423
|
"span",
|
|
10326
10424
|
{
|
|
10327
10425
|
className: "aura-stepper__desc",
|
|
@@ -10330,14 +10428,14 @@ window.Aura = (() => {
|
|
|
10330
10428
|
},
|
|
10331
10429
|
s.description
|
|
10332
10430
|
) : null);
|
|
10333
|
-
return /* @__PURE__ */
|
|
10431
|
+
return /* @__PURE__ */ React67.createElement(
|
|
10334
10432
|
"li",
|
|
10335
10433
|
{
|
|
10336
10434
|
key: s.id,
|
|
10337
10435
|
className: cx("aura-stepper__item", "is-" + state, error && "is-error"),
|
|
10338
10436
|
"aria-current": state === "current" ? "step" : void 0
|
|
10339
10437
|
},
|
|
10340
|
-
clickable ? /* @__PURE__ */
|
|
10438
|
+
clickable ? /* @__PURE__ */ React67.createElement(
|
|
10341
10439
|
"button",
|
|
10342
10440
|
{
|
|
10343
10441
|
type: "button",
|
|
@@ -10349,19 +10447,19 @@ window.Aura = (() => {
|
|
|
10349
10447
|
},
|
|
10350
10448
|
marker,
|
|
10351
10449
|
text2
|
|
10352
|
-
) : /* @__PURE__ */
|
|
10450
|
+
) : /* @__PURE__ */ React67.createElement("span", { className: "aura-stepper__step" }, marker, text2)
|
|
10353
10451
|
);
|
|
10354
10452
|
})),
|
|
10355
|
-
!vertical && cur2 ? /* @__PURE__ */
|
|
10453
|
+
!vertical && cur2 ? /* @__PURE__ */ React67.createElement("p", { className: "aura-stepper__compact", "aria-hidden": true }, /* @__PURE__ */ React67.createElement("span", { className: "aura-stepper__count" }, t.stepOf(at + 1, steps.length), cur2.status === "error" ? /* @__PURE__ */ React67.createElement("span", { className: "aura-stepper__count-error" }, " \u2014 " + t.stepError) : null), /* @__PURE__ */ React67.createElement("span", { className: "aura-stepper__compact-label" }, cur2.label)) : null
|
|
10356
10454
|
);
|
|
10357
10455
|
});
|
|
10358
10456
|
|
|
10359
10457
|
// src/SegmentedControl.tsx
|
|
10360
|
-
var
|
|
10458
|
+
var React68 = __toESM(require_react(), 1);
|
|
10361
10459
|
function toOpt2(o) {
|
|
10362
10460
|
return typeof o === "object" ? o : { value: o, label: o };
|
|
10363
10461
|
}
|
|
10364
|
-
var SegmentedControl =
|
|
10462
|
+
var SegmentedControl = React68.forwardRef(
|
|
10365
10463
|
function SegmentedControl2(props, ref) {
|
|
10366
10464
|
const options = (props.options || []).map(toOpt2);
|
|
10367
10465
|
useAutoTip();
|
|
@@ -10375,7 +10473,7 @@ window.Aura = (() => {
|
|
|
10375
10473
|
);
|
|
10376
10474
|
const value = st[0], setValue = st[1];
|
|
10377
10475
|
const auto = uid(), id = props.id || auto;
|
|
10378
|
-
const refs =
|
|
10476
|
+
const refs = React68.useRef([]);
|
|
10379
10477
|
const selIdx = options.findIndex(function(o) {
|
|
10380
10478
|
return o.value === value;
|
|
10381
10479
|
});
|
|
@@ -10408,7 +10506,7 @@ window.Aura = (() => {
|
|
|
10408
10506
|
move(options.length, -1);
|
|
10409
10507
|
}
|
|
10410
10508
|
}
|
|
10411
|
-
return /* @__PURE__ */
|
|
10509
|
+
return /* @__PURE__ */ React68.createElement(
|
|
10412
10510
|
"div",
|
|
10413
10511
|
{
|
|
10414
10512
|
ref,
|
|
@@ -10428,7 +10526,7 @@ window.Aura = (() => {
|
|
|
10428
10526
|
options.map(function(o, i) {
|
|
10429
10527
|
const on = o.value === value;
|
|
10430
10528
|
const off = props.disabled || o.disabled;
|
|
10431
|
-
return /* @__PURE__ */
|
|
10529
|
+
return /* @__PURE__ */ React68.createElement(
|
|
10432
10530
|
"button",
|
|
10433
10531
|
{
|
|
10434
10532
|
key: o.value,
|
|
@@ -10450,8 +10548,8 @@ window.Aura = (() => {
|
|
|
10450
10548
|
onKeyDown(e, i);
|
|
10451
10549
|
}
|
|
10452
10550
|
},
|
|
10453
|
-
o.icon ? /* @__PURE__ */
|
|
10454
|
-
o.iconOnly ? null : /* @__PURE__ */
|
|
10551
|
+
o.icon ? /* @__PURE__ */ React68.createElement(Icon, { name: o.icon }) : null,
|
|
10552
|
+
o.iconOnly ? null : /* @__PURE__ */ React68.createElement("span", null, o.label)
|
|
10455
10553
|
);
|
|
10456
10554
|
})
|
|
10457
10555
|
);
|