@jirawatpyk/aura-react 5.44.0 → 5.45.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 +20 -0
- package/dist/aura.bundle.js +293 -225
- package/dist/cjs/index.cjs +293 -225
- package/dist/esm/PageHeader.js +9 -1
- package/dist/esm/PageHeaderClient.js +62 -0
- package/dist/esm/index.js +1 -1
- package/dist/index.d.cts +13 -0
- package/dist/index.d.ts +13 -0
- package/dist/server/index.cjs +9 -1
- package/dist/server/index.d.cts +13 -0
- package/dist/server/index.d.ts +13 -0
- package/dist/server/index.js +9 -1
- package/dist/styles.css +39 -0
- package/dist/styles.layer.css +39 -0
- 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;
|
|
@@ -7833,6 +7836,8 @@ window.Aura = (() => {
|
|
|
7833
7836
|
const below2 = props.actionsFullWidthBelow;
|
|
7834
7837
|
const hide2 = props.titleHideBelow;
|
|
7835
7838
|
const hasMeta = props.meta != null && props.meta !== false;
|
|
7839
|
+
const hasActions = props.actions != null && props.actions !== false;
|
|
7840
|
+
const bar = hasActions && (props.actionsBarBelow === "sm" || props.actionsBarBelow === "md") ? props.actionsBarBelow : null;
|
|
7836
7841
|
return h8(
|
|
7837
7842
|
"div",
|
|
7838
7843
|
Object.assign(attrs2, {
|
|
@@ -7842,6 +7847,7 @@ window.Aura = (() => {
|
|
|
7842
7847
|
(below2 === "sm" || below2 === "md" || below2 === "lg") && "aura-page-header--actions-full-below-" + below2,
|
|
7843
7848
|
(hide2 === "sm" || hide2 === "md" || hide2 === "lg") && "aura-page-header--title-hide-below-" + hide2,
|
|
7844
7849
|
(hide2 === "sm" || hide2 === "md" || hide2 === "lg") && !hasMeta && "has-no-meta",
|
|
7850
|
+
bar && "aura-page-header--actions-bar-below-" + bar,
|
|
7845
7851
|
props.className
|
|
7846
7852
|
),
|
|
7847
7853
|
style: props.style
|
|
@@ -7854,16 +7860,78 @@ window.Aura = (() => {
|
|
|
7854
7860
|
h8("h" + level, { className: "aura-page-header__title", id: props.titleId }, props.title),
|
|
7855
7861
|
props.meta != null && props.meta !== false ? h8("div", { className: "aura-page-header__meta" }, props.meta) : null
|
|
7856
7862
|
),
|
|
7857
|
-
props.actions != null && props.actions !== false ? h8(
|
|
7863
|
+
props.actions != null && props.actions !== false ? h8(
|
|
7864
|
+
"div",
|
|
7865
|
+
{ className: "aura-page-header__actions" },
|
|
7866
|
+
bar && props.actionsStatus != null && props.actionsStatus !== false ? h8("div", { className: "aura-page-header__status", role: "status" }, props.actionsStatus) : null,
|
|
7867
|
+
props.actions
|
|
7868
|
+
) : null
|
|
7869
|
+
);
|
|
7870
|
+
});
|
|
7871
|
+
|
|
7872
|
+
// src/PageHeaderClient.tsx
|
|
7873
|
+
var NAME = "--aura-page-actions-height";
|
|
7874
|
+
var bars = [];
|
|
7875
|
+
function trapped(el) {
|
|
7876
|
+
for (let p = el.parentElement; p && p !== document.documentElement; p = p.parentElement) {
|
|
7877
|
+
const s = getComputedStyle(p);
|
|
7878
|
+
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))
|
|
7879
|
+
return true;
|
|
7880
|
+
}
|
|
7881
|
+
return false;
|
|
7882
|
+
}
|
|
7883
|
+
var PageHeader3 = React44.forwardRef(function PageHeader4(props, ref) {
|
|
7884
|
+
const own = React44.useRef(null);
|
|
7885
|
+
const merged = useMergedRef(ref, own);
|
|
7886
|
+
const bar = props.actionsBarBelow;
|
|
7887
|
+
const hasActions = props.actions != null && props.actions !== false;
|
|
7888
|
+
React44.useEffect(
|
|
7889
|
+
function() {
|
|
7890
|
+
if (bar !== "sm" && bar !== "md" || !hasActions || !own.current) return;
|
|
7891
|
+
const el = own.current.querySelector(":scope > .aura-page-header__actions");
|
|
7892
|
+
if (!el) return;
|
|
7893
|
+
const root = document.documentElement;
|
|
7894
|
+
let checked = false;
|
|
7895
|
+
function sync() {
|
|
7896
|
+
if (bars[bars.length - 1] !== sync) return;
|
|
7897
|
+
if (getComputedStyle(el).position === "fixed") {
|
|
7898
|
+
root.style.setProperty(NAME, el.offsetHeight + "px");
|
|
7899
|
+
if (!checked && (checked = true, trapped(el)))
|
|
7900
|
+
devWarnOnce(
|
|
7901
|
+
"pageheader-bar-trapped",
|
|
7902
|
+
"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."
|
|
7903
|
+
);
|
|
7904
|
+
} else root.style.removeProperty(NAME);
|
|
7905
|
+
}
|
|
7906
|
+
if (bars.length)
|
|
7907
|
+
devWarnOnce(
|
|
7908
|
+
"pageheader-bar-twice",
|
|
7909
|
+
"PageHeader actionsBarBelow: two bars on one page overlap at the bottom of the screen. Give it to one PageHeader per page."
|
|
7910
|
+
);
|
|
7911
|
+
bars.push(sync);
|
|
7912
|
+
const ro = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(sync);
|
|
7913
|
+
if (ro) ro.observe(el);
|
|
7914
|
+
window.addEventListener("resize", sync);
|
|
7915
|
+
sync();
|
|
7916
|
+
return function() {
|
|
7917
|
+
if (ro) ro.disconnect();
|
|
7918
|
+
window.removeEventListener("resize", sync);
|
|
7919
|
+
bars.splice(bars.indexOf(sync), 1);
|
|
7920
|
+
if (bars.length) bars[bars.length - 1]();
|
|
7921
|
+
else root.style.removeProperty(NAME);
|
|
7922
|
+
};
|
|
7923
|
+
},
|
|
7924
|
+
[bar, hasActions]
|
|
7858
7925
|
);
|
|
7926
|
+
return /* @__PURE__ */ React44.createElement(PageHeader, { ...props, ref: merged });
|
|
7859
7927
|
});
|
|
7860
7928
|
|
|
7861
7929
|
// src/StatusTile.tsx
|
|
7862
|
-
var
|
|
7930
|
+
var React46 = __toESM(require_react(), 1);
|
|
7863
7931
|
|
|
7864
7932
|
// src/tiles.tsx
|
|
7865
|
-
var
|
|
7866
|
-
var h9 =
|
|
7933
|
+
var React45 = __toESM(require_react(), 1);
|
|
7934
|
+
var h9 = React45.createElement;
|
|
7867
7935
|
var STATUS_ICON = {
|
|
7868
7936
|
down: IconCircleAlert,
|
|
7869
7937
|
problem: IconTriangleAlert,
|
|
@@ -7955,7 +8023,7 @@ window.Aura = (() => {
|
|
|
7955
8023
|
) : null
|
|
7956
8024
|
);
|
|
7957
8025
|
}
|
|
7958
|
-
var TileGrid =
|
|
8026
|
+
var TileGrid = React45.forwardRef(function TileGrid2(props, ref) {
|
|
7959
8027
|
const style = Object.assign(
|
|
7960
8028
|
{},
|
|
7961
8029
|
respVars("aura-grid-cols", props.columns == null ? { base: 2, md: 3 } : props.columns),
|
|
@@ -7971,16 +8039,16 @@ window.Aura = (() => {
|
|
|
7971
8039
|
}),
|
|
7972
8040
|
/* toArray drops null and booleans and keys each element; a Fragment's children are items too. */
|
|
7973
8041
|
flat(props.children).map(function(c, i) {
|
|
7974
|
-
return h9("li", { key:
|
|
8042
|
+
return h9("li", { key: React45.isValidElement(c) && c.key != null ? c.key : i }, c);
|
|
7975
8043
|
})
|
|
7976
8044
|
);
|
|
7977
8045
|
});
|
|
7978
8046
|
function flat(children) {
|
|
7979
8047
|
const out = [];
|
|
7980
|
-
|
|
7981
|
-
if (
|
|
8048
|
+
React45.Children.toArray(children).forEach(function(c) {
|
|
8049
|
+
if (React45.isValidElement(c) && c.type === React45.Fragment)
|
|
7982
8050
|
flat(c.props.children).forEach(function(x) {
|
|
7983
|
-
out.push(
|
|
8051
|
+
out.push(React45.isValidElement(x) ? React45.cloneElement(x, { key: String(c.key) + "/" + String(x.key) }) : x);
|
|
7984
8052
|
});
|
|
7985
8053
|
else if (c !== "") out.push(c);
|
|
7986
8054
|
});
|
|
@@ -7994,7 +8062,7 @@ window.Aura = (() => {
|
|
|
7994
8062
|
function num(v) {
|
|
7995
8063
|
return typeof v === "number" && isFinite(v) ? v : null;
|
|
7996
8064
|
}
|
|
7997
|
-
var Sparkline =
|
|
8065
|
+
var Sparkline = React45.forwardRef(function Sparkline2(props, ref) {
|
|
7998
8066
|
const wh = SIZES2[props.size || "sm"] || SIZES2.sm;
|
|
7999
8067
|
const W = wh[0], H = wh[1];
|
|
8000
8068
|
const data = (props.data || []).map(num);
|
|
@@ -8068,8 +8136,8 @@ window.Aura = (() => {
|
|
|
8068
8136
|
});
|
|
8069
8137
|
|
|
8070
8138
|
// src/StatusTile.tsx
|
|
8071
|
-
var useIsoLayoutEffect2 = typeof window !== "undefined" ?
|
|
8072
|
-
var StatusTile =
|
|
8139
|
+
var useIsoLayoutEffect2 = typeof window !== "undefined" ? React46.useLayoutEffect : React46.useEffect;
|
|
8140
|
+
var StatusTile = React46.forwardRef(function StatusTile2(props, ref) {
|
|
8073
8141
|
const Link = useLinkComponent(props.linkComponent);
|
|
8074
8142
|
const t = useStrings();
|
|
8075
8143
|
useAutoTip();
|
|
@@ -8078,8 +8146,8 @@ window.Aura = (() => {
|
|
|
8078
8146
|
"status-tile-label",
|
|
8079
8147
|
"StatusTile `aria-label` needs `href`: without a link the tile is a plain box, where a name is not allowed."
|
|
8080
8148
|
);
|
|
8081
|
-
const titleRef =
|
|
8082
|
-
const check =
|
|
8149
|
+
const titleRef = React46.useRef(null);
|
|
8150
|
+
const check = React46.useCallback(function() {
|
|
8083
8151
|
const el = titleRef.current;
|
|
8084
8152
|
if (!el) return;
|
|
8085
8153
|
const cut = el.scrollHeight > el.clientHeight + 1;
|
|
@@ -8089,7 +8157,7 @@ window.Aura = (() => {
|
|
|
8089
8157
|
}, []);
|
|
8090
8158
|
useIsoLayoutEffect2(check, [props.title, check]);
|
|
8091
8159
|
const linked = !!props.href;
|
|
8092
|
-
|
|
8160
|
+
React46.useEffect(
|
|
8093
8161
|
function() {
|
|
8094
8162
|
const el = titleRef.current;
|
|
8095
8163
|
if (!el) return;
|
|
@@ -8114,14 +8182,14 @@ window.Aura = (() => {
|
|
|
8114
8182
|
});
|
|
8115
8183
|
|
|
8116
8184
|
// src/AppShell.tsx
|
|
8117
|
-
var
|
|
8185
|
+
var React48 = __toESM(require_react(), 1);
|
|
8118
8186
|
|
|
8119
8187
|
// src/scrollHide.ts
|
|
8120
|
-
var
|
|
8188
|
+
var React47 = __toESM(require_react(), 1);
|
|
8121
8189
|
var STEP = 8;
|
|
8122
8190
|
function useHideOnScroll(enabled, el, media, from) {
|
|
8123
|
-
const st =
|
|
8124
|
-
|
|
8191
|
+
const st = React47.useState(false), hidden = st[0], setHidden = st[1];
|
|
8192
|
+
React47.useEffect(
|
|
8125
8193
|
function() {
|
|
8126
8194
|
if (!enabled || typeof window === "undefined") {
|
|
8127
8195
|
setHidden(false);
|
|
@@ -8211,31 +8279,31 @@ window.Aura = (() => {
|
|
|
8211
8279
|
}
|
|
8212
8280
|
|
|
8213
8281
|
// src/AppShell.tsx
|
|
8214
|
-
var AppShell =
|
|
8282
|
+
var AppShell = React48.forwardRef(function AppShell2(props, ref) {
|
|
8215
8283
|
const t = useStrings();
|
|
8216
8284
|
const bp = useBreakpoint();
|
|
8217
8285
|
const wide = bp === "lg" || bp === "xl";
|
|
8218
|
-
const st =
|
|
8219
|
-
|
|
8286
|
+
const st = React48.useState(false), open = st[0], setOpen = st[1];
|
|
8287
|
+
React48.useEffect(
|
|
8220
8288
|
function() {
|
|
8221
8289
|
if (wide) setOpen(false);
|
|
8222
8290
|
},
|
|
8223
8291
|
[wide]
|
|
8224
8292
|
);
|
|
8225
|
-
const navEl = props.nav &&
|
|
8293
|
+
const navEl = props.nav && React48.isValidElement(props.nav) ? props.nav : null;
|
|
8226
8294
|
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 =
|
|
8295
|
+
const navState = React48.useState(navEl ? navEl.props.defaultValue : void 0);
|
|
8228
8296
|
function onNav(id) {
|
|
8229
8297
|
if (shared) navState[1](id);
|
|
8230
8298
|
if (navEl && navEl.props.onChange) navEl.props.onChange(id);
|
|
8231
8299
|
}
|
|
8232
|
-
const rootRef =
|
|
8233
|
-
const barRef =
|
|
8300
|
+
const rootRef = React48.useRef(null);
|
|
8301
|
+
const barRef = React48.useRef(null);
|
|
8234
8302
|
const mergedRef = useMergedRef(ref, rootRef);
|
|
8235
8303
|
const hasBar = !!(props.header || props.nav);
|
|
8236
|
-
const barH =
|
|
8304
|
+
const barH = React48.useState(null);
|
|
8237
8305
|
const away = useHideOnScroll(!!props.headerHideOnScroll && hasBar, barRef, "(max-width: 1023.98px)", barH[0] || 56);
|
|
8238
|
-
const awayRef =
|
|
8306
|
+
const awayRef = React48.useRef(away);
|
|
8239
8307
|
awayRef.current = away;
|
|
8240
8308
|
useIsoLayoutEffect(
|
|
8241
8309
|
function() {
|
|
@@ -8264,8 +8332,8 @@ window.Aura = (() => {
|
|
|
8264
8332
|
},
|
|
8265
8333
|
[hasBar]
|
|
8266
8334
|
);
|
|
8267
|
-
const deskNav = navEl && shared ?
|
|
8268
|
-
const drawerNav = navEl ?
|
|
8335
|
+
const deskNav = navEl && shared ? React48.cloneElement(navEl, { value: navState[0], onChange: onNav }) : props.nav;
|
|
8336
|
+
const drawerNav = navEl ? React48.cloneElement(navEl, {
|
|
8269
8337
|
value: shared ? navState[0] : navEl.props.value,
|
|
8270
8338
|
onChange: function(id) {
|
|
8271
8339
|
onNav(id);
|
|
@@ -8280,7 +8348,7 @@ window.Aura = (() => {
|
|
|
8280
8348
|
collapsed: false,
|
|
8281
8349
|
collapsible: false
|
|
8282
8350
|
}) : props.nav;
|
|
8283
|
-
return /* @__PURE__ */
|
|
8351
|
+
return /* @__PURE__ */ React48.createElement(
|
|
8284
8352
|
"div",
|
|
8285
8353
|
{
|
|
8286
8354
|
ref: mergedRef,
|
|
@@ -8295,8 +8363,8 @@ window.Aura = (() => {
|
|
|
8295
8363
|
props.className
|
|
8296
8364
|
)
|
|
8297
8365
|
},
|
|
8298
|
-
props.nav ? /* @__PURE__ */
|
|
8299
|
-
props.nav ? /* @__PURE__ */
|
|
8366
|
+
props.nav ? /* @__PURE__ */ React48.createElement("div", { className: "aura-shell__nav" }, deskNav) : null,
|
|
8367
|
+
props.nav ? /* @__PURE__ */ React48.createElement(
|
|
8300
8368
|
Drawer,
|
|
8301
8369
|
{
|
|
8302
8370
|
open,
|
|
@@ -8313,7 +8381,7 @@ window.Aura = (() => {
|
|
|
8313
8381
|
},
|
|
8314
8382
|
drawerNav
|
|
8315
8383
|
) : null,
|
|
8316
|
-
/* @__PURE__ */
|
|
8384
|
+
/* @__PURE__ */ React48.createElement("div", { className: "aura-shell__main" }, props.header || props.nav ? /* @__PURE__ */ React48.createElement(
|
|
8317
8385
|
"header",
|
|
8318
8386
|
{
|
|
8319
8387
|
ref: barRef,
|
|
@@ -8325,11 +8393,11 @@ window.Aura = (() => {
|
|
|
8325
8393
|
away && "is-away"
|
|
8326
8394
|
)
|
|
8327
8395
|
},
|
|
8328
|
-
props.nav ? /* @__PURE__ */
|
|
8396
|
+
props.nav ? /* @__PURE__ */ React48.createElement(
|
|
8329
8397
|
IconButton,
|
|
8330
8398
|
{
|
|
8331
8399
|
className: "aura-shell__menu",
|
|
8332
|
-
icon: /* @__PURE__ */
|
|
8400
|
+
icon: /* @__PURE__ */ React48.createElement(IconMenu, null),
|
|
8333
8401
|
label: props.menuLabel || t.openNav,
|
|
8334
8402
|
size: "md",
|
|
8335
8403
|
onClick: function() {
|
|
@@ -8338,8 +8406,8 @@ window.Aura = (() => {
|
|
|
8338
8406
|
"aria-expanded": open
|
|
8339
8407
|
}
|
|
8340
8408
|
) : null,
|
|
8341
|
-
/* @__PURE__ */
|
|
8342
|
-
) : null, /* @__PURE__ */
|
|
8409
|
+
/* @__PURE__ */ React48.createElement("div", { className: "aura-shell__bar-content" }, props.header)
|
|
8410
|
+
) : null, /* @__PURE__ */ React48.createElement(
|
|
8343
8411
|
"main",
|
|
8344
8412
|
{
|
|
8345
8413
|
className: cx("aura-shell__content", props.contentPadding === false && "is-flush"),
|
|
@@ -8352,17 +8420,17 @@ window.Aura = (() => {
|
|
|
8352
8420
|
});
|
|
8353
8421
|
|
|
8354
8422
|
// src/ActionBar.tsx
|
|
8355
|
-
var
|
|
8356
|
-
var ActionBar =
|
|
8423
|
+
var React49 = __toESM(require_react(), 1);
|
|
8424
|
+
var ActionBar = React49.forwardRef(function ActionBar2(props, ref) {
|
|
8357
8425
|
const t = useStrings();
|
|
8358
8426
|
const bulk = props.selected != null;
|
|
8359
8427
|
const idle = bulk && !props.selected;
|
|
8360
8428
|
const count = bulk && props.selected ? t.selectedCount(props.selected) : null;
|
|
8361
|
-
const hasStart =
|
|
8429
|
+
const hasStart = React49.Children.toArray(props.start).some(function(c) {
|
|
8362
8430
|
return c !== "";
|
|
8363
8431
|
});
|
|
8364
|
-
const cameFrom =
|
|
8365
|
-
const own =
|
|
8432
|
+
const cameFrom = React49.useRef(null);
|
|
8433
|
+
const own = React49.useRef(null);
|
|
8366
8434
|
function clear() {
|
|
8367
8435
|
props.onClearSelection();
|
|
8368
8436
|
setTimeout(function() {
|
|
@@ -8371,7 +8439,7 @@ window.Aura = (() => {
|
|
|
8371
8439
|
if ((!a || a === document.body || !a.isConnected) && back && back.isConnected) back.focus();
|
|
8372
8440
|
}, 0);
|
|
8373
8441
|
}
|
|
8374
|
-
return /* @__PURE__ */
|
|
8442
|
+
return /* @__PURE__ */ React49.createElement(
|
|
8375
8443
|
"div",
|
|
8376
8444
|
{
|
|
8377
8445
|
ref: function(el) {
|
|
@@ -8393,16 +8461,16 @@ window.Aura = (() => {
|
|
|
8393
8461
|
props.className
|
|
8394
8462
|
)
|
|
8395
8463
|
},
|
|
8396
|
-
/* @__PURE__ */
|
|
8464
|
+
/* @__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
8465
|
);
|
|
8398
8466
|
});
|
|
8399
8467
|
|
|
8400
8468
|
// src/Separator.tsx
|
|
8401
|
-
var
|
|
8402
|
-
var Separator =
|
|
8469
|
+
var React50 = __toESM(require_react(), 1);
|
|
8470
|
+
var Separator = React50.forwardRef(function Separator2(props, ref) {
|
|
8403
8471
|
const vertical = props.orientation === "vertical";
|
|
8404
8472
|
const decorative = props.decorative !== false;
|
|
8405
|
-
return /* @__PURE__ */
|
|
8473
|
+
return /* @__PURE__ */ React50.createElement(
|
|
8406
8474
|
"div",
|
|
8407
8475
|
{
|
|
8408
8476
|
ref,
|
|
@@ -8415,13 +8483,13 @@ window.Aura = (() => {
|
|
|
8415
8483
|
});
|
|
8416
8484
|
|
|
8417
8485
|
// src/Table.tsx
|
|
8418
|
-
var
|
|
8419
|
-
var StackLabels =
|
|
8420
|
-
var ColumnIndex =
|
|
8486
|
+
var React51 = __toESM(require_react(), 1);
|
|
8487
|
+
var StackLabels = React51.createContext(null);
|
|
8488
|
+
var ColumnIndex = React51.createContext(-1);
|
|
8421
8489
|
function flat2(children) {
|
|
8422
8490
|
const out = [];
|
|
8423
|
-
|
|
8424
|
-
if (
|
|
8491
|
+
React51.Children.toArray(children).forEach(function(c) {
|
|
8492
|
+
if (React51.isValidElement(c) && c.type === React51.Fragment)
|
|
8425
8493
|
out.push.apply(out, flat2(c.props.children));
|
|
8426
8494
|
else out.push(c);
|
|
8427
8495
|
});
|
|
@@ -8435,7 +8503,7 @@ window.Aura = (() => {
|
|
|
8435
8503
|
});
|
|
8436
8504
|
return parts.length ? parts.join("") : void 0;
|
|
8437
8505
|
}
|
|
8438
|
-
if (
|
|
8506
|
+
if (React51.isValidElement(node)) {
|
|
8439
8507
|
const p = node.props;
|
|
8440
8508
|
if (p["aria-hidden"] === true || p["aria-hidden"] === "true") return void 0;
|
|
8441
8509
|
return text(p.children);
|
|
@@ -8445,13 +8513,13 @@ window.Aura = (() => {
|
|
|
8445
8513
|
function headerLabels(children) {
|
|
8446
8514
|
let out = [];
|
|
8447
8515
|
flat2(children).forEach(function(c) {
|
|
8448
|
-
if (out.length || !
|
|
8516
|
+
if (out.length || !React51.isValidElement(c) || c.type !== THead) return;
|
|
8449
8517
|
const row = flat2(c.props.children).find(function(r2) {
|
|
8450
|
-
return
|
|
8518
|
+
return React51.isValidElement(r2);
|
|
8451
8519
|
});
|
|
8452
8520
|
if (!row) return;
|
|
8453
8521
|
flat2(row.props.children).forEach(function(cell) {
|
|
8454
|
-
if (!
|
|
8522
|
+
if (!React51.isValidElement(cell)) return;
|
|
8455
8523
|
const p = cell.props;
|
|
8456
8524
|
const t = text(p.children);
|
|
8457
8525
|
const label = p.label != null ? p.label : t != null ? t.replace(/\s+/g, " ").trim() || void 0 : void 0;
|
|
@@ -8461,7 +8529,7 @@ window.Aura = (() => {
|
|
|
8461
8529
|
});
|
|
8462
8530
|
return out;
|
|
8463
8531
|
}
|
|
8464
|
-
var Table =
|
|
8532
|
+
var Table = React51.forwardRef(function Table2(props, ref) {
|
|
8465
8533
|
const {
|
|
8466
8534
|
caption,
|
|
8467
8535
|
captionHidden,
|
|
@@ -8491,12 +8559,12 @@ window.Aura = (() => {
|
|
|
8491
8559
|
"tbl-stack-labels",
|
|
8492
8560
|
"Table stackBelow: no THead > Tr > Th found among its children, so cells have no labels. Pass `label` on each Td."
|
|
8493
8561
|
);
|
|
8494
|
-
const outer =
|
|
8562
|
+
const outer = React51.useContext(StackLabels);
|
|
8495
8563
|
const pageDensity = useDensity();
|
|
8496
8564
|
const capId = uid();
|
|
8497
|
-
const wrap =
|
|
8498
|
-
const sc =
|
|
8499
|
-
const wide =
|
|
8565
|
+
const wrap = React51.useRef(null);
|
|
8566
|
+
const sc = React51.useState(false), scrolls = sc[0];
|
|
8567
|
+
const wide = React51.useState(false);
|
|
8500
8568
|
useIsoLayoutEffect(function() {
|
|
8501
8569
|
const el = wrap.current;
|
|
8502
8570
|
if (!el || typeof ResizeObserver === "undefined") return;
|
|
@@ -8513,7 +8581,7 @@ window.Aura = (() => {
|
|
|
8513
8581
|
ro.disconnect();
|
|
8514
8582
|
};
|
|
8515
8583
|
}, []);
|
|
8516
|
-
const table = /* @__PURE__ */
|
|
8584
|
+
const table = /* @__PURE__ */ React51.createElement(
|
|
8517
8585
|
"div",
|
|
8518
8586
|
{
|
|
8519
8587
|
ref: wrap,
|
|
@@ -8537,7 +8605,7 @@ window.Aura = (() => {
|
|
|
8537
8605
|
"aria-labelledby": scrolls ? caption != null ? capId : rest["aria-labelledby"] : void 0,
|
|
8538
8606
|
"aria-label": scrolls && caption == null ? rest["aria-label"] : void 0
|
|
8539
8607
|
},
|
|
8540
|
-
/* @__PURE__ */
|
|
8608
|
+
/* @__PURE__ */ React51.createElement(
|
|
8541
8609
|
"table",
|
|
8542
8610
|
{
|
|
8543
8611
|
ref,
|
|
@@ -8553,11 +8621,11 @@ window.Aura = (() => {
|
|
|
8553
8621
|
role: stackBelow ? "table" : void 0,
|
|
8554
8622
|
...rest
|
|
8555
8623
|
},
|
|
8556
|
-
caption != null ? /* @__PURE__ */
|
|
8557
|
-
labels ? /* @__PURE__ */
|
|
8624
|
+
caption != null ? /* @__PURE__ */ React51.createElement("caption", { id: capId, className: cx("aura-tbl__caption", captionHidden && "aura-sr-only") }, caption) : null,
|
|
8625
|
+
labels ? /* @__PURE__ */ React51.createElement(StackLabels.Provider, { value: labels }, children) : outer ? /* @__PURE__ */ React51.createElement(StackLabels.Provider, { value: null }, children) : children
|
|
8558
8626
|
)
|
|
8559
8627
|
);
|
|
8560
|
-
return cards ? /* @__PURE__ */
|
|
8628
|
+
return cards ? /* @__PURE__ */ React51.createElement(
|
|
8561
8629
|
"div",
|
|
8562
8630
|
{
|
|
8563
8631
|
className: cx(
|
|
@@ -8570,10 +8638,10 @@ window.Aura = (() => {
|
|
|
8570
8638
|
) : table;
|
|
8571
8639
|
});
|
|
8572
8640
|
function section(tag, cls) {
|
|
8573
|
-
const C =
|
|
8641
|
+
const C = React51.forwardRef(function TableSection(props, ref) {
|
|
8574
8642
|
const { className, ...rest } = props;
|
|
8575
|
-
const stacked =
|
|
8576
|
-
return
|
|
8643
|
+
const stacked = React51.useContext(StackLabels) != null;
|
|
8644
|
+
return React51.createElement(
|
|
8577
8645
|
tag,
|
|
8578
8646
|
Object.assign({ ref, className: cx(cls, className), role: stacked ? "rowgroup" : void 0 }, rest)
|
|
8579
8647
|
);
|
|
@@ -8586,14 +8654,14 @@ window.Aura = (() => {
|
|
|
8586
8654
|
TBody.displayName = "TBody";
|
|
8587
8655
|
var TFoot = section("tfoot", "aura-tbl__foot");
|
|
8588
8656
|
TFoot.displayName = "TFoot";
|
|
8589
|
-
var Tr =
|
|
8657
|
+
var Tr = React51.forwardRef(function Tr2(props, ref) {
|
|
8590
8658
|
const { className, children, ...rest } = props;
|
|
8591
|
-
const stacked =
|
|
8659
|
+
const stacked = React51.useContext(StackLabels) != null;
|
|
8592
8660
|
let col = 0;
|
|
8593
|
-
return /* @__PURE__ */
|
|
8661
|
+
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
8662
|
const at = col;
|
|
8595
|
-
if (
|
|
8596
|
-
return /* @__PURE__ */
|
|
8663
|
+
if (React51.isValidElement(c)) col += Math.max(1, Number(c.props.colSpan) || 1);
|
|
8664
|
+
return /* @__PURE__ */ React51.createElement(ColumnIndex.Provider, { key: React51.isValidElement(c) && c.key != null ? c.key : at, value: at }, c);
|
|
8597
8665
|
}) : children);
|
|
8598
8666
|
});
|
|
8599
8667
|
function cellClass(base, p) {
|
|
@@ -8607,10 +8675,10 @@ window.Aura = (() => {
|
|
|
8607
8675
|
p.className
|
|
8608
8676
|
);
|
|
8609
8677
|
}
|
|
8610
|
-
var Th =
|
|
8678
|
+
var Th = React51.forwardRef(function Th2(props, ref) {
|
|
8611
8679
|
const { align, numeric, mono, className, scope, label, card, ...rest } = props;
|
|
8612
|
-
const stacked =
|
|
8613
|
-
return /* @__PURE__ */
|
|
8680
|
+
const stacked = React51.useContext(StackLabels) != null;
|
|
8681
|
+
return /* @__PURE__ */ React51.createElement(
|
|
8614
8682
|
"th",
|
|
8615
8683
|
{
|
|
8616
8684
|
ref,
|
|
@@ -8622,12 +8690,12 @@ window.Aura = (() => {
|
|
|
8622
8690
|
}
|
|
8623
8691
|
);
|
|
8624
8692
|
});
|
|
8625
|
-
var Td =
|
|
8693
|
+
var Td = React51.forwardRef(function Td2(props, ref) {
|
|
8626
8694
|
const { align, numeric, mono, className, scope, label, card, ...rest } = props;
|
|
8627
|
-
const labels =
|
|
8695
|
+
const labels = React51.useContext(StackLabels), col = React51.useContext(ColumnIndex);
|
|
8628
8696
|
const slot = labels && (card === "title" || card === "action") ? card : void 0;
|
|
8629
8697
|
const shown = labels && !slot ? label != null ? label : col >= 0 ? labels[col] : void 0 : void 0;
|
|
8630
|
-
return /* @__PURE__ */
|
|
8698
|
+
return /* @__PURE__ */ React51.createElement(
|
|
8631
8699
|
"td",
|
|
8632
8700
|
{
|
|
8633
8701
|
ref,
|
|
@@ -8641,8 +8709,8 @@ window.Aura = (() => {
|
|
|
8641
8709
|
});
|
|
8642
8710
|
|
|
8643
8711
|
// src/BottomNav.tsx
|
|
8644
|
-
var
|
|
8645
|
-
var BottomNav =
|
|
8712
|
+
var React52 = __toESM(require_react(), 1);
|
|
8713
|
+
var BottomNav = React52.forwardRef(function BottomNav2(props, ref) {
|
|
8646
8714
|
const t = useStrings();
|
|
8647
8715
|
const Link = useLinkComponent(props.linkComponent);
|
|
8648
8716
|
const st = useMaybeControlled(
|
|
@@ -8652,7 +8720,7 @@ window.Aura = (() => {
|
|
|
8652
8720
|
);
|
|
8653
8721
|
const active = st[0];
|
|
8654
8722
|
const hide2 = props.hideFrom === false ? "always" : "below-" + (props.hideFrom || "lg");
|
|
8655
|
-
const own =
|
|
8723
|
+
const own = React52.useRef(null);
|
|
8656
8724
|
const hf = props.hideFrom === false ? null : props.hideFrom || "lg";
|
|
8657
8725
|
const away = useHideOnScroll(
|
|
8658
8726
|
!!props.hideOnScroll,
|
|
@@ -8660,7 +8728,7 @@ window.Aura = (() => {
|
|
|
8660
8728
|
hf ? "(max-width: " + (breakpoints[hf] - 0.02) + "px)" : "all",
|
|
8661
8729
|
64
|
|
8662
8730
|
);
|
|
8663
|
-
const setRef =
|
|
8731
|
+
const setRef = React52.useCallback(
|
|
8664
8732
|
function(el) {
|
|
8665
8733
|
own.current = el;
|
|
8666
8734
|
if (typeof ref === "function") ref(el);
|
|
@@ -8668,7 +8736,7 @@ window.Aura = (() => {
|
|
|
8668
8736
|
},
|
|
8669
8737
|
[ref]
|
|
8670
8738
|
);
|
|
8671
|
-
return /* @__PURE__ */
|
|
8739
|
+
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
8740
|
"nav",
|
|
8673
8741
|
{
|
|
8674
8742
|
ref: setRef,
|
|
@@ -8681,7 +8749,7 @@ window.Aura = (() => {
|
|
|
8681
8749
|
),
|
|
8682
8750
|
"aria-label": props.label || t.mainNav
|
|
8683
8751
|
},
|
|
8684
|
-
/* @__PURE__ */
|
|
8752
|
+
/* @__PURE__ */ React52.createElement("ul", { className: "aura-bottomnav__list" }, props.items.map(function(it) {
|
|
8685
8753
|
if (it.ariaLabel && typeof it.label === "string" && it.ariaLabel.toLowerCase().indexOf(it.label.toLowerCase()) < 0)
|
|
8686
8754
|
devWarnOnce(
|
|
8687
8755
|
"bottomnav-label-" + it.id,
|
|
@@ -8702,20 +8770,20 @@ window.Aura = (() => {
|
|
|
8702
8770
|
}
|
|
8703
8771
|
};
|
|
8704
8772
|
const inner = [
|
|
8705
|
-
/* @__PURE__ */
|
|
8706
|
-
it.ariaLabel ? /* @__PURE__ */
|
|
8707
|
-
/* @__PURE__ */
|
|
8708
|
-
suffix && !it.ariaLabel ? /* @__PURE__ */
|
|
8773
|
+
/* @__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),
|
|
8774
|
+
it.ariaLabel ? /* @__PURE__ */ React52.createElement("span", { key: "n", className: "aura-sr-only" }, it.ariaLabel + suffix) : null,
|
|
8775
|
+
/* @__PURE__ */ React52.createElement("span", { key: "l", className: "aura-bottomnav__label", "aria-hidden": it.ariaLabel ? true : void 0 }, it.label),
|
|
8776
|
+
suffix && !it.ariaLabel ? /* @__PURE__ */ React52.createElement("span", { key: "s", className: "aura-sr-only" }, suffix) : null
|
|
8709
8777
|
];
|
|
8710
|
-
return /* @__PURE__ */
|
|
8778
|
+
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
8779
|
}))
|
|
8712
8780
|
));
|
|
8713
8781
|
});
|
|
8714
8782
|
|
|
8715
8783
|
// src/Surface.tsx
|
|
8716
|
-
var
|
|
8717
|
-
var h10 =
|
|
8718
|
-
var Surface =
|
|
8784
|
+
var React53 = __toESM(require_react(), 1);
|
|
8785
|
+
var h10 = React53.createElement;
|
|
8786
|
+
var Surface = React53.forwardRef(function Surface2(props, ref) {
|
|
8719
8787
|
const t = props.texture || "mesh";
|
|
8720
8788
|
const rest = omit(props, ["texture", "className", "children", "as"]);
|
|
8721
8789
|
return h10(
|
|
@@ -8736,14 +8804,14 @@ window.Aura = (() => {
|
|
|
8736
8804
|
});
|
|
8737
8805
|
|
|
8738
8806
|
// src/Stat.tsx
|
|
8739
|
-
var
|
|
8740
|
-
var Stat =
|
|
8807
|
+
var React54 = __toESM(require_react(), 1);
|
|
8808
|
+
var Stat = React54.forwardRef(function Stat2(props, ref) {
|
|
8741
8809
|
const Link = useLinkComponent(props.linkComponent);
|
|
8742
8810
|
return statElement(props, ref, Link);
|
|
8743
8811
|
});
|
|
8744
8812
|
|
|
8745
8813
|
// src/TimePicker.tsx
|
|
8746
|
-
var
|
|
8814
|
+
var React55 = __toESM(require_react(), 1);
|
|
8747
8815
|
var import_react_dom12 = __toESM(require_react_dom(), 1);
|
|
8748
8816
|
|
|
8749
8817
|
// src/text.ts
|
|
@@ -8785,7 +8853,7 @@ window.Aura = (() => {
|
|
|
8785
8853
|
function fromMin(n3) {
|
|
8786
8854
|
return pad3(Math.floor(n3 / 60)) + ":" + pad3(n3 % 60);
|
|
8787
8855
|
}
|
|
8788
|
-
var TimePicker =
|
|
8856
|
+
var TimePicker = React55.forwardRef(function TimePicker2(props, ref) {
|
|
8789
8857
|
const t = useStrings();
|
|
8790
8858
|
const auto = uid(), id = props.id || auto, listId = id + "-list";
|
|
8791
8859
|
const st = useMaybeControlled(
|
|
@@ -8795,7 +8863,7 @@ window.Aura = (() => {
|
|
|
8795
8863
|
);
|
|
8796
8864
|
const value = st[0];
|
|
8797
8865
|
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 =
|
|
8866
|
+
const slots = React55.useMemo(
|
|
8799
8867
|
function() {
|
|
8800
8868
|
const out = [];
|
|
8801
8869
|
for (let m = lo; m <= hi; m += step) out.push(fromMin(m));
|
|
@@ -8807,12 +8875,12 @@ window.Aura = (() => {
|
|
|
8807
8875
|
const n3 = toMin(v);
|
|
8808
8876
|
return n3 == null || n3 < lo || n3 > hi || props.isTimeDisabled && props.isTimeDisabled(v);
|
|
8809
8877
|
}
|
|
8810
|
-
const openState =
|
|
8811
|
-
const editState =
|
|
8812
|
-
const aState =
|
|
8813
|
-
const errState =
|
|
8814
|
-
const pos =
|
|
8815
|
-
const boxRef =
|
|
8878
|
+
const openState = React55.useState(false), open = openState[0], setOpen = openState[1];
|
|
8879
|
+
const editState = React55.useState(null), editing = editState[0], setEditing = editState[1];
|
|
8880
|
+
const aState = React55.useState(0), active = aState[0], setActive = aState[1];
|
|
8881
|
+
const errState = React55.useState(null);
|
|
8882
|
+
const pos = React55.useState(null);
|
|
8883
|
+
const boxRef = React55.useRef(null), inputRef = React55.useRef(null), listRef = React55.useRef(null), inputMerged = useMergedRef(ref, inputRef);
|
|
8816
8884
|
const mounted = useMounted();
|
|
8817
8885
|
function nearest(v) {
|
|
8818
8886
|
const n3 = toMin(v);
|
|
@@ -8840,7 +8908,7 @@ window.Aura = (() => {
|
|
|
8840
8908
|
},
|
|
8841
8909
|
[open]
|
|
8842
8910
|
);
|
|
8843
|
-
|
|
8911
|
+
React55.useEffect(
|
|
8844
8912
|
function() {
|
|
8845
8913
|
if (!open) return;
|
|
8846
8914
|
function outside(e) {
|
|
@@ -8862,7 +8930,7 @@ window.Aura = (() => {
|
|
|
8862
8930
|
},
|
|
8863
8931
|
[open]
|
|
8864
8932
|
);
|
|
8865
|
-
|
|
8933
|
+
React55.useEffect(
|
|
8866
8934
|
function() {
|
|
8867
8935
|
if (!open || !listRef.current) return;
|
|
8868
8936
|
const el = listRef.current.querySelector('[data-idx="' + active + '"]');
|
|
@@ -8961,9 +9029,9 @@ window.Aura = (() => {
|
|
|
8961
9029
|
}
|
|
8962
9030
|
const error = errState[0] || props.error;
|
|
8963
9031
|
const list = open && mounted && pos[0] ? (0, import_react_dom12.createPortal)(
|
|
8964
|
-
/* @__PURE__ */
|
|
9032
|
+
/* @__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
9033
|
const dis = blocked(s), sel = s === value;
|
|
8966
|
-
return /* @__PURE__ */
|
|
9034
|
+
return /* @__PURE__ */ React55.createElement(
|
|
8967
9035
|
"li",
|
|
8968
9036
|
{
|
|
8969
9037
|
key: s,
|
|
@@ -8988,13 +9056,13 @@ window.Aura = (() => {
|
|
|
8988
9056
|
if (active !== i) setActive(i);
|
|
8989
9057
|
}
|
|
8990
9058
|
},
|
|
8991
|
-
/* @__PURE__ */
|
|
8992
|
-
sel ? /* @__PURE__ */
|
|
9059
|
+
/* @__PURE__ */ React55.createElement("span", { className: "aura-combo__label" }, s),
|
|
9060
|
+
sel ? /* @__PURE__ */ React55.createElement(Icon, { name: /* @__PURE__ */ React55.createElement(IconCheck, null), className: "aura-combo__check" }) : null
|
|
8993
9061
|
);
|
|
8994
9062
|
}))),
|
|
8995
9063
|
document.body
|
|
8996
9064
|
) : null;
|
|
8997
|
-
return /* @__PURE__ */
|
|
9065
|
+
return /* @__PURE__ */ React55.createElement(
|
|
8998
9066
|
Field,
|
|
8999
9067
|
{
|
|
9000
9068
|
id,
|
|
@@ -9006,7 +9074,7 @@ window.Aura = (() => {
|
|
|
9006
9074
|
disabled: props.disabled,
|
|
9007
9075
|
className: cx(touchClass(props.touchHeight), props.className)
|
|
9008
9076
|
},
|
|
9009
|
-
/* @__PURE__ */
|
|
9077
|
+
/* @__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
9078
|
"input",
|
|
9011
9079
|
{
|
|
9012
9080
|
ref: inputMerged,
|
|
@@ -9046,7 +9114,7 @@ window.Aura = (() => {
|
|
|
9046
9114
|
}, 0);
|
|
9047
9115
|
}
|
|
9048
9116
|
}
|
|
9049
|
-
), props.clearable !== false && value != null && !props.disabled ? /* @__PURE__ */
|
|
9117
|
+
), props.clearable !== false && value != null && !props.disabled ? /* @__PURE__ */ React55.createElement(
|
|
9050
9118
|
"button",
|
|
9051
9119
|
{
|
|
9052
9120
|
type: "button",
|
|
@@ -9059,8 +9127,8 @@ window.Aura = (() => {
|
|
|
9059
9127
|
if (inputRef.current) inputRef.current.focus();
|
|
9060
9128
|
}
|
|
9061
9129
|
},
|
|
9062
|
-
/* @__PURE__ */
|
|
9063
|
-
) : null, /* @__PURE__ */
|
|
9130
|
+
/* @__PURE__ */ React55.createElement(Icon, { name: /* @__PURE__ */ React55.createElement(IconX, null) })
|
|
9131
|
+
) : null, /* @__PURE__ */ React55.createElement(
|
|
9064
9132
|
"button",
|
|
9065
9133
|
{
|
|
9066
9134
|
type: "button",
|
|
@@ -9078,14 +9146,14 @@ window.Aura = (() => {
|
|
|
9078
9146
|
}
|
|
9079
9147
|
}
|
|
9080
9148
|
},
|
|
9081
|
-
/* @__PURE__ */
|
|
9149
|
+
/* @__PURE__ */ React55.createElement(Icon, { name: /* @__PURE__ */ React55.createElement(IconChevronDown, null) })
|
|
9082
9150
|
)),
|
|
9083
9151
|
list
|
|
9084
9152
|
);
|
|
9085
9153
|
});
|
|
9086
9154
|
|
|
9087
9155
|
// src/FileUpload.tsx
|
|
9088
|
-
var
|
|
9156
|
+
var React56 = __toESM(require_react(), 1);
|
|
9089
9157
|
function matches(file, accept) {
|
|
9090
9158
|
if (!accept) return true;
|
|
9091
9159
|
const name = (file.name || "").toLowerCase(), type = (file.type || "").toLowerCase();
|
|
@@ -9109,24 +9177,24 @@ window.Aura = (() => {
|
|
|
9109
9177
|
}).join(", ");
|
|
9110
9178
|
}
|
|
9111
9179
|
var seq = 0;
|
|
9112
|
-
var FileUpload =
|
|
9180
|
+
var FileUpload = React56.forwardRef(function FileUpload2(props, ref) {
|
|
9113
9181
|
const t = useStrings();
|
|
9114
9182
|
const auto = uid(), id = props.id || auto;
|
|
9115
9183
|
const st = useMaybeControlled(props.value, props.defaultValue || [], props.onChange);
|
|
9116
9184
|
const items2 = st[0] || [];
|
|
9117
|
-
const dragState =
|
|
9118
|
-
const inputRef =
|
|
9119
|
-
const urls =
|
|
9185
|
+
const dragState = React56.useState(false), over = dragState[0];
|
|
9186
|
+
const inputRef = React56.useRef(null), inputMerged = useMergedRef(ref, inputRef);
|
|
9187
|
+
const urls = React56.useRef({});
|
|
9120
9188
|
const maxFiles = props.multiple ? props.maxFiles : 1;
|
|
9121
9189
|
const note = t.accepts(describeAccept(props.accept, t), props.maxSize ? formatBytes(props.maxSize) : "");
|
|
9122
|
-
|
|
9190
|
+
React56.useEffect(function() {
|
|
9123
9191
|
return function() {
|
|
9124
9192
|
Object.keys(urls.current).forEach(function(k) {
|
|
9125
9193
|
URL.revokeObjectURL(urls.current[k]);
|
|
9126
9194
|
});
|
|
9127
9195
|
};
|
|
9128
9196
|
}, []);
|
|
9129
|
-
|
|
9197
|
+
React56.useEffect(
|
|
9130
9198
|
function() {
|
|
9131
9199
|
const el = inputRef.current;
|
|
9132
9200
|
if (!el || !props.name || typeof DataTransfer === "undefined") return;
|
|
@@ -9186,7 +9254,7 @@ window.Aura = (() => {
|
|
|
9186
9254
|
if (inputRef.current) inputRef.current.focus();
|
|
9187
9255
|
}
|
|
9188
9256
|
const error = props.error;
|
|
9189
|
-
return /* @__PURE__ */
|
|
9257
|
+
return /* @__PURE__ */ React56.createElement(
|
|
9190
9258
|
Field,
|
|
9191
9259
|
{
|
|
9192
9260
|
id,
|
|
@@ -9198,7 +9266,7 @@ window.Aura = (() => {
|
|
|
9198
9266
|
disabled: props.disabled,
|
|
9199
9267
|
className: props.className
|
|
9200
9268
|
},
|
|
9201
|
-
/* @__PURE__ */
|
|
9269
|
+
/* @__PURE__ */ React56.createElement(
|
|
9202
9270
|
"div",
|
|
9203
9271
|
{
|
|
9204
9272
|
className: cx("aura-upload", over && "is-over", props.disabled && "is-disabled", error && "is-invalid"),
|
|
@@ -9219,9 +9287,9 @@ window.Aura = (() => {
|
|
|
9219
9287
|
add(e.dataTransfer && e.dataTransfer.files);
|
|
9220
9288
|
}
|
|
9221
9289
|
},
|
|
9222
|
-
/* @__PURE__ */
|
|
9223
|
-
/* @__PURE__ */
|
|
9224
|
-
/* @__PURE__ */
|
|
9290
|
+
/* @__PURE__ */ React56.createElement(Icon, { name: /* @__PURE__ */ React56.createElement(IconCloudUpload, null), size: "lg", className: "aura-upload__icon" }),
|
|
9291
|
+
/* @__PURE__ */ React56.createElement("span", { className: "aura-upload__text" }, t.dropFiles, " "),
|
|
9292
|
+
/* @__PURE__ */ React56.createElement(
|
|
9225
9293
|
"input",
|
|
9226
9294
|
{
|
|
9227
9295
|
ref: inputMerged,
|
|
@@ -9243,12 +9311,12 @@ window.Aura = (() => {
|
|
|
9243
9311
|
}
|
|
9244
9312
|
}
|
|
9245
9313
|
),
|
|
9246
|
-
/* @__PURE__ */
|
|
9247
|
-
note ? /* @__PURE__ */
|
|
9314
|
+
/* @__PURE__ */ React56.createElement("span", { className: "aura-upload__browse", "aria-hidden": true }, props.multiple ? t.browse : t.browseOne),
|
|
9315
|
+
note ? /* @__PURE__ */ React56.createElement("span", { className: "aura-upload__note", id: id + "-note" }, note) : null
|
|
9248
9316
|
),
|
|
9249
|
-
items2.length ? /* @__PURE__ */
|
|
9317
|
+
items2.length ? /* @__PURE__ */ React56.createElement("ul", { className: "aura-upload__list", "aria-live": "polite" }, items2.map(function(it) {
|
|
9250
9318
|
const src = thumb(it);
|
|
9251
|
-
return /* @__PURE__ */
|
|
9319
|
+
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
9320
|
"span",
|
|
9253
9321
|
{
|
|
9254
9322
|
className: "aura-upload__bar",
|
|
@@ -9258,11 +9326,11 @@ window.Aura = (() => {
|
|
|
9258
9326
|
"aria-valuemax": 100,
|
|
9259
9327
|
"aria-valuenow": it.progress != null ? Math.round(it.progress) : void 0
|
|
9260
9328
|
},
|
|
9261
|
-
/* @__PURE__ */
|
|
9262
|
-
) : null), /* @__PURE__ */
|
|
9329
|
+
/* @__PURE__ */ React56.createElement("span", { style: { width: (it.progress || 0) + "%" } })
|
|
9330
|
+
) : null), /* @__PURE__ */ React56.createElement(
|
|
9263
9331
|
IconButton,
|
|
9264
9332
|
{
|
|
9265
|
-
icon: /* @__PURE__ */
|
|
9333
|
+
icon: /* @__PURE__ */ React56.createElement(IconX, null),
|
|
9266
9334
|
label: t.remove(it.name),
|
|
9267
9335
|
onClick: function() {
|
|
9268
9336
|
remove(it);
|
|
@@ -9578,9 +9646,9 @@ window.Aura = (() => {
|
|
|
9578
9646
|
}
|
|
9579
9647
|
|
|
9580
9648
|
// src/ThemeStyle.tsx
|
|
9581
|
-
var
|
|
9649
|
+
var React57 = __toESM(require_react(), 1);
|
|
9582
9650
|
function ThemeStyle(props) {
|
|
9583
|
-
const css =
|
|
9651
|
+
const css = React57.useMemo(
|
|
9584
9652
|
function() {
|
|
9585
9653
|
try {
|
|
9586
9654
|
return createTheme({
|
|
@@ -9597,11 +9665,11 @@ window.Aura = (() => {
|
|
|
9597
9665
|
[props.brand, props.signal, props.primary, props.name, props.selector]
|
|
9598
9666
|
);
|
|
9599
9667
|
if (css === null) return null;
|
|
9600
|
-
return /* @__PURE__ */
|
|
9668
|
+
return /* @__PURE__ */ React57.createElement("style", { "data-aura-theme": props.name || props.brand, dangerouslySetInnerHTML: { __html: css } });
|
|
9601
9669
|
}
|
|
9602
9670
|
|
|
9603
9671
|
// src/colorScheme.tsx
|
|
9604
|
-
var
|
|
9672
|
+
var React58 = __toESM(require_react(), 1);
|
|
9605
9673
|
|
|
9606
9674
|
// src/colorSchemeScript.ts
|
|
9607
9675
|
var DEFAULT_KEY = "aura-color-scheme";
|
|
@@ -9618,7 +9686,7 @@ window.Aura = (() => {
|
|
|
9618
9686
|
|
|
9619
9687
|
// src/colorScheme.tsx
|
|
9620
9688
|
function ColorSchemeScript(props) {
|
|
9621
|
-
return /* @__PURE__ */
|
|
9689
|
+
return /* @__PURE__ */ React58.createElement(
|
|
9622
9690
|
"script",
|
|
9623
9691
|
{
|
|
9624
9692
|
"data-aura-color-scheme": "",
|
|
@@ -9643,7 +9711,7 @@ window.Aura = (() => {
|
|
|
9643
9711
|
function useColorScheme(options) {
|
|
9644
9712
|
const key = options && options.storageKey || DEFAULT_KEY;
|
|
9645
9713
|
const fallback = options && options.defaultScheme || "system";
|
|
9646
|
-
const subscribe2 =
|
|
9714
|
+
const subscribe2 = React58.useCallback(
|
|
9647
9715
|
function(cb) {
|
|
9648
9716
|
const mq = window.matchMedia ? window.matchMedia("(prefers-color-scheme: dark)") : null;
|
|
9649
9717
|
function onSystem() {
|
|
@@ -9665,7 +9733,7 @@ window.Aura = (() => {
|
|
|
9665
9733
|
},
|
|
9666
9734
|
[fallback, key]
|
|
9667
9735
|
);
|
|
9668
|
-
const snapshot =
|
|
9736
|
+
const snapshot = React58.useSyncExternalStore(
|
|
9669
9737
|
subscribe2,
|
|
9670
9738
|
function() {
|
|
9671
9739
|
const s = readScheme(fallback);
|
|
@@ -9676,7 +9744,7 @@ window.Aura = (() => {
|
|
|
9676
9744
|
}
|
|
9677
9745
|
);
|
|
9678
9746
|
const parts = snapshot.split("|");
|
|
9679
|
-
const setScheme =
|
|
9747
|
+
const setScheme = React58.useCallback(
|
|
9680
9748
|
function(next) {
|
|
9681
9749
|
if (!valid(next)) return;
|
|
9682
9750
|
try {
|
|
@@ -9695,14 +9763,14 @@ window.Aura = (() => {
|
|
|
9695
9763
|
const cs = useColorScheme(props);
|
|
9696
9764
|
const names = { light: t.schemeLight, dark: t.schemeDark, system: t.schemeSystem };
|
|
9697
9765
|
const label = props.label || t.colorScheme;
|
|
9698
|
-
return /* @__PURE__ */
|
|
9766
|
+
return /* @__PURE__ */ React58.createElement(
|
|
9699
9767
|
DropdownMenu,
|
|
9700
9768
|
{
|
|
9701
9769
|
label,
|
|
9702
|
-
trigger: /* @__PURE__ */
|
|
9770
|
+
trigger: /* @__PURE__ */ React58.createElement(
|
|
9703
9771
|
IconButton,
|
|
9704
9772
|
{
|
|
9705
|
-
icon: cs.resolved === "dark" ? /* @__PURE__ */
|
|
9773
|
+
icon: cs.resolved === "dark" ? /* @__PURE__ */ React58.createElement(IconMoon, null) : /* @__PURE__ */ React58.createElement(IconSun, null),
|
|
9706
9774
|
label: label + ": " + names[cs.scheme]
|
|
9707
9775
|
}
|
|
9708
9776
|
),
|
|
@@ -9720,14 +9788,14 @@ window.Aura = (() => {
|
|
|
9720
9788
|
}
|
|
9721
9789
|
|
|
9722
9790
|
// src/Badge.tsx
|
|
9723
|
-
var
|
|
9724
|
-
var Badge =
|
|
9791
|
+
var React59 = __toESM(require_react(), 1);
|
|
9792
|
+
var Badge = React59.forwardRef(function Badge2(props, ref) {
|
|
9725
9793
|
return badgeElement(props, ref);
|
|
9726
9794
|
});
|
|
9727
9795
|
|
|
9728
9796
|
// src/Progress.tsx
|
|
9729
|
-
var
|
|
9730
|
-
var Progress =
|
|
9797
|
+
var React60 = __toESM(require_react(), 1);
|
|
9798
|
+
var Progress = React60.forwardRef(function Progress2(props, ref) {
|
|
9731
9799
|
const t = useStrings();
|
|
9732
9800
|
const auto = uid(), id = props.id || auto;
|
|
9733
9801
|
const max = props.max || 100, det = props.value != null;
|
|
@@ -9736,7 +9804,7 @@ window.Aura = (() => {
|
|
|
9736
9804
|
const spct = sec ? Math.max(0, Math.min(100 - pct, sec / max * 100)) : 0;
|
|
9737
9805
|
const valueText = props.valueText != null ? props.valueText : props.valueLabel != null ? String(props.valueLabel) : sec ? t.progressReserved(props.value, sec, max) : void 0;
|
|
9738
9806
|
const shown = props.valueLabel != null ? props.valueLabel : det ? Math.round(pct) + "%" : null;
|
|
9739
|
-
return /* @__PURE__ */
|
|
9807
|
+
return /* @__PURE__ */ React60.createElement(
|
|
9740
9808
|
"div",
|
|
9741
9809
|
{
|
|
9742
9810
|
ref,
|
|
@@ -9747,8 +9815,8 @@ window.Aura = (() => {
|
|
|
9747
9815
|
props.className
|
|
9748
9816
|
)
|
|
9749
9817
|
},
|
|
9750
|
-
props.label || props.showValue && shown ? /* @__PURE__ */
|
|
9751
|
-
/* @__PURE__ */
|
|
9818
|
+
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,
|
|
9819
|
+
/* @__PURE__ */ React60.createElement(
|
|
9752
9820
|
"div",
|
|
9753
9821
|
{
|
|
9754
9822
|
className: cx("aura-progress__track", !det && "is-indeterminate"),
|
|
@@ -9760,8 +9828,8 @@ window.Aura = (() => {
|
|
|
9760
9828
|
"aria-valuenow": det ? props.value : void 0,
|
|
9761
9829
|
"aria-valuetext": det ? valueText : void 0
|
|
9762
9830
|
},
|
|
9763
|
-
/* @__PURE__ */
|
|
9764
|
-
sec ? /* @__PURE__ */
|
|
9831
|
+
/* @__PURE__ */ React60.createElement("span", { className: "aura-progress__bar", style: det ? { width: pct + "%" } : void 0 }),
|
|
9832
|
+
sec ? /* @__PURE__ */ React60.createElement(
|
|
9765
9833
|
"span",
|
|
9766
9834
|
{
|
|
9767
9835
|
className: "aura-progress__bar aura-progress__bar--reserved",
|
|
@@ -9769,19 +9837,19 @@ window.Aura = (() => {
|
|
|
9769
9837
|
}
|
|
9770
9838
|
) : null
|
|
9771
9839
|
),
|
|
9772
|
-
props.hint ? /* @__PURE__ */
|
|
9840
|
+
props.hint ? /* @__PURE__ */ React60.createElement("p", { className: "aura-progress__hint" }, props.hint) : null
|
|
9773
9841
|
);
|
|
9774
9842
|
});
|
|
9775
9843
|
|
|
9776
9844
|
// src/Skeleton.tsx
|
|
9777
|
-
var
|
|
9778
|
-
var Skeleton =
|
|
9845
|
+
var React61 = __toESM(require_react(), 1);
|
|
9846
|
+
var Skeleton = React61.forwardRef(function Skeleton2(props, ref) {
|
|
9779
9847
|
const v = props.variant || "text";
|
|
9780
9848
|
if (v === "text" && (props.lines || 1) > 1) {
|
|
9781
9849
|
const n3 = props.lines, rows = [];
|
|
9782
9850
|
for (let i = 0; i < n3; i++)
|
|
9783
|
-
rows.push(/* @__PURE__ */
|
|
9784
|
-
return /* @__PURE__ */
|
|
9851
|
+
rows.push(/* @__PURE__ */ React61.createElement("span", { key: i, className: "aura-skel aura-skel--text", style: { width: i === n3 - 1 ? "60%" : "100%" } }));
|
|
9852
|
+
return /* @__PURE__ */ React61.createElement(
|
|
9785
9853
|
"span",
|
|
9786
9854
|
{
|
|
9787
9855
|
ref,
|
|
@@ -9799,17 +9867,17 @@ window.Aura = (() => {
|
|
|
9799
9867
|
if (v === "circle") {
|
|
9800
9868
|
style.width = style.height = props.size || props.width || 40;
|
|
9801
9869
|
}
|
|
9802
|
-
return /* @__PURE__ */
|
|
9870
|
+
return /* @__PURE__ */ React61.createElement("span", { ref, "aria-hidden": true, className: cx("aura-skel", "aura-skel--" + v, props.className), style });
|
|
9803
9871
|
});
|
|
9804
9872
|
|
|
9805
9873
|
// src/EmptyState.tsx
|
|
9806
|
-
var
|
|
9807
|
-
var EmptyState =
|
|
9874
|
+
var React62 = __toESM(require_react(), 1);
|
|
9875
|
+
var EmptyState = React62.forwardRef(function EmptyState2(props, ref) {
|
|
9808
9876
|
return emptyStateElement(props, ref);
|
|
9809
9877
|
});
|
|
9810
9878
|
|
|
9811
9879
|
// src/Pagination.tsx
|
|
9812
|
-
var
|
|
9880
|
+
var React63 = __toESM(require_react(), 1);
|
|
9813
9881
|
function pageList(page, count, sib) {
|
|
9814
9882
|
let out = [], lo = Math.max(2, page - sib), hi = Math.min(count - 1, page + sib);
|
|
9815
9883
|
if (page - sib <= 3) {
|
|
@@ -9829,7 +9897,7 @@ window.Aura = (() => {
|
|
|
9829
9897
|
if (count > 1) out.push(count);
|
|
9830
9898
|
return out;
|
|
9831
9899
|
}
|
|
9832
|
-
var Pagination =
|
|
9900
|
+
var Pagination = React63.forwardRef(function Pagination2(props, ref) {
|
|
9833
9901
|
const t = useStrings();
|
|
9834
9902
|
useAutoTip();
|
|
9835
9903
|
const count = Math.max(1, props.pageCount || 1);
|
|
@@ -9849,7 +9917,7 @@ window.Aura = (() => {
|
|
|
9849
9917
|
},
|
|
9850
9918
|
extra
|
|
9851
9919
|
);
|
|
9852
|
-
return link ? /* @__PURE__ */
|
|
9920
|
+
return link ? /* @__PURE__ */ React63.createElement(
|
|
9853
9921
|
Link,
|
|
9854
9922
|
{
|
|
9855
9923
|
href: link(p),
|
|
@@ -9862,7 +9930,7 @@ window.Aura = (() => {
|
|
|
9862
9930
|
...common
|
|
9863
9931
|
},
|
|
9864
9932
|
label
|
|
9865
|
-
) : /* @__PURE__ */
|
|
9933
|
+
) : /* @__PURE__ */ React63.createElement(
|
|
9866
9934
|
"button",
|
|
9867
9935
|
{
|
|
9868
9936
|
type: "button",
|
|
@@ -9876,7 +9944,7 @@ window.Aura = (() => {
|
|
|
9876
9944
|
}
|
|
9877
9945
|
function arrow(p, icon, label, rel, disabled) {
|
|
9878
9946
|
if (!link || disabled)
|
|
9879
|
-
return /* @__PURE__ */
|
|
9947
|
+
return /* @__PURE__ */ React63.createElement(
|
|
9880
9948
|
IconButton,
|
|
9881
9949
|
{
|
|
9882
9950
|
icon,
|
|
@@ -9887,7 +9955,7 @@ window.Aura = (() => {
|
|
|
9887
9955
|
}
|
|
9888
9956
|
}
|
|
9889
9957
|
);
|
|
9890
|
-
return /* @__PURE__ */
|
|
9958
|
+
return /* @__PURE__ */ React63.createElement(
|
|
9891
9959
|
Link,
|
|
9892
9960
|
{
|
|
9893
9961
|
href: link(p),
|
|
@@ -9902,17 +9970,17 @@ window.Aura = (() => {
|
|
|
9902
9970
|
}
|
|
9903
9971
|
}
|
|
9904
9972
|
},
|
|
9905
|
-
/* @__PURE__ */
|
|
9973
|
+
/* @__PURE__ */ React63.createElement(Icon, { name: icon, size: "sm" })
|
|
9906
9974
|
);
|
|
9907
9975
|
}
|
|
9908
|
-
return /* @__PURE__ */
|
|
9909
|
-
return typeof p === "number" ? /* @__PURE__ */
|
|
9910
|
-
})), /* @__PURE__ */
|
|
9976
|
+
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) {
|
|
9977
|
+
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");
|
|
9978
|
+
})), /* @__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
9979
|
});
|
|
9912
9980
|
|
|
9913
9981
|
// src/Accordion.tsx
|
|
9914
|
-
var
|
|
9915
|
-
var Accordion =
|
|
9982
|
+
var React64 = __toESM(require_react(), 1);
|
|
9983
|
+
var Accordion = React64.forwardRef(function Accordion2(props, ref) {
|
|
9916
9984
|
const auto = uid(), base = props.id || auto;
|
|
9917
9985
|
const multiple = props.type === "multiple";
|
|
9918
9986
|
const st = useMaybeControlled(
|
|
@@ -9950,9 +10018,9 @@ window.Aura = (() => {
|
|
|
9950
10018
|
n3.focus();
|
|
9951
10019
|
}
|
|
9952
10020
|
}
|
|
9953
|
-
return /* @__PURE__ */
|
|
10021
|
+
return /* @__PURE__ */ React64.createElement("div", { ref, className: cx("aura-accordion", props.className), onKeyDown: onKey }, items2.map(function(it) {
|
|
9954
10022
|
const on = open.indexOf(it.id) >= 0, bid = base + "-btn-" + it.id, pid = base + "-panel-" + it.id;
|
|
9955
|
-
return /* @__PURE__ */
|
|
10023
|
+
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
10024
|
"button",
|
|
9957
10025
|
{
|
|
9958
10026
|
type: "button",
|
|
@@ -9965,10 +10033,10 @@ window.Aura = (() => {
|
|
|
9965
10033
|
toggle(it.id);
|
|
9966
10034
|
}
|
|
9967
10035
|
},
|
|
9968
|
-
it.icon ? /* @__PURE__ */
|
|
9969
|
-
/* @__PURE__ */
|
|
9970
|
-
/* @__PURE__ */
|
|
9971
|
-
)), /* @__PURE__ */
|
|
10036
|
+
it.icon ? /* @__PURE__ */ React64.createElement(Icon, { name: it.icon, className: "aura-accordion__lead" }) : null,
|
|
10037
|
+
/* @__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),
|
|
10038
|
+
/* @__PURE__ */ React64.createElement(Icon, { name: /* @__PURE__ */ React64.createElement(IconChevronDown, null), className: "aura-accordion__chevron" })
|
|
10039
|
+
)), /* @__PURE__ */ React64.createElement(
|
|
9972
10040
|
"div",
|
|
9973
10041
|
{
|
|
9974
10042
|
id: pid,
|
|
@@ -9983,7 +10051,7 @@ window.Aura = (() => {
|
|
|
9983
10051
|
});
|
|
9984
10052
|
|
|
9985
10053
|
// src/Popover.tsx
|
|
9986
|
-
var
|
|
10054
|
+
var React65 = __toESM(require_react(), 1);
|
|
9987
10055
|
var import_react_dom13 = __toESM(require_react_dom(), 1);
|
|
9988
10056
|
function position(anchor, pop, placement) {
|
|
9989
10057
|
const r2 = anchor.getBoundingClientRect(), pw = pop.offsetWidth, ph = pop.scrollHeight, vw = window.innerWidth, vh = window.innerHeight, gap = 6;
|
|
@@ -10001,15 +10069,15 @@ window.Aura = (() => {
|
|
|
10001
10069
|
const left = align === "end" ? r2.right - pw : align === "center" ? r2.left + r2.width / 2 - pw / 2 : r2.left;
|
|
10002
10070
|
return { top: Math.max(8, top), left: Math.max(8, Math.min(left, vw - pw - 8)), side, maxHeight };
|
|
10003
10071
|
}
|
|
10004
|
-
var Popover =
|
|
10072
|
+
var Popover = React65.forwardRef(function Popover2(props, ref) {
|
|
10005
10073
|
const t = useStrings();
|
|
10006
10074
|
const density = useDensity();
|
|
10007
10075
|
const auto = uid(), id = props.id || auto;
|
|
10008
10076
|
const st = useMaybeControlled(props.open, !!props.defaultOpen, props.onOpenChange);
|
|
10009
10077
|
const open = !!st[0];
|
|
10010
|
-
const wrap =
|
|
10011
|
-
const pos =
|
|
10012
|
-
const inTree =
|
|
10078
|
+
const wrap = React65.useRef(null), pop = React65.useRef(null), popMerged = useMergedRef(ref, pop);
|
|
10079
|
+
const pos = React65.useState(null), mounted = useMounted();
|
|
10080
|
+
const inTree = React65.useRef(false);
|
|
10013
10081
|
function trigger() {
|
|
10014
10082
|
return wrap.current && (wrap.current.querySelector('button, [role="button"], a, input') || wrap.current.firstElementChild);
|
|
10015
10083
|
}
|
|
@@ -10036,7 +10104,7 @@ window.Aura = (() => {
|
|
|
10036
10104
|
},
|
|
10037
10105
|
[open, mounted, props.placement]
|
|
10038
10106
|
);
|
|
10039
|
-
|
|
10107
|
+
React65.useEffect(
|
|
10040
10108
|
function() {
|
|
10041
10109
|
if (!open || !mounted) return;
|
|
10042
10110
|
if (props.autoFocus !== false && pop.current) {
|
|
@@ -10061,9 +10129,9 @@ window.Aura = (() => {
|
|
|
10061
10129
|
},
|
|
10062
10130
|
[open, mounted]
|
|
10063
10131
|
);
|
|
10064
|
-
const child =
|
|
10132
|
+
const child = React65.Children.only(props.trigger);
|
|
10065
10133
|
const panel = open && mounted ? (0, import_react_dom13.createPortal)(
|
|
10066
|
-
/* @__PURE__ */
|
|
10134
|
+
/* @__PURE__ */ React65.createElement(
|
|
10067
10135
|
"div",
|
|
10068
10136
|
{
|
|
10069
10137
|
ref: popMerged,
|
|
@@ -10093,17 +10161,17 @@ window.Aura = (() => {
|
|
|
10093
10161
|
} else trapTab(e, pop.current);
|
|
10094
10162
|
}
|
|
10095
10163
|
},
|
|
10096
|
-
props.title ? /* @__PURE__ */
|
|
10164
|
+
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
10165
|
IconButton,
|
|
10098
10166
|
{
|
|
10099
|
-
icon: /* @__PURE__ */
|
|
10167
|
+
icon: /* @__PURE__ */ React65.createElement(IconX, null),
|
|
10100
10168
|
label: t.close,
|
|
10101
10169
|
onClick: function() {
|
|
10102
10170
|
close(true);
|
|
10103
10171
|
}
|
|
10104
10172
|
}
|
|
10105
10173
|
)) : null,
|
|
10106
|
-
/* @__PURE__ */
|
|
10174
|
+
/* @__PURE__ */ React65.createElement("div", { className: "aura-popover__body" }, typeof props.children === "function" ? props.children({
|
|
10107
10175
|
close: function() {
|
|
10108
10176
|
close(true);
|
|
10109
10177
|
}
|
|
@@ -10111,7 +10179,7 @@ window.Aura = (() => {
|
|
|
10111
10179
|
),
|
|
10112
10180
|
document.body
|
|
10113
10181
|
) : null;
|
|
10114
|
-
return /* @__PURE__ */
|
|
10182
|
+
return /* @__PURE__ */ React65.createElement("span", { ref: wrap, className: "aura-popover-anchor" }, React65.cloneElement(child, {
|
|
10115
10183
|
onClick: function(e) {
|
|
10116
10184
|
if (child.props.onClick) child.props.onClick(e);
|
|
10117
10185
|
st[1](!open);
|
|
@@ -10123,7 +10191,7 @@ window.Aura = (() => {
|
|
|
10123
10191
|
});
|
|
10124
10192
|
|
|
10125
10193
|
// src/NumberField.tsx
|
|
10126
|
-
var
|
|
10194
|
+
var React66 = __toESM(require_react(), 1);
|
|
10127
10195
|
function decimalsOf(n3) {
|
|
10128
10196
|
const s = String(n3);
|
|
10129
10197
|
const i = s.indexOf(".");
|
|
@@ -10136,7 +10204,7 @@ window.Aura = (() => {
|
|
|
10136
10204
|
if (!/^-?(\d+\.?\d*|\.\d+)$/.test(s)) return NaN;
|
|
10137
10205
|
return Number(s);
|
|
10138
10206
|
}
|
|
10139
|
-
var NumberField =
|
|
10207
|
+
var NumberField = React66.forwardRef(function NumberField2(props, ref) {
|
|
10140
10208
|
const t = useStrings();
|
|
10141
10209
|
const auto = uid(), id = props.id || auto;
|
|
10142
10210
|
const step = props.step || 1;
|
|
@@ -10147,7 +10215,7 @@ window.Aura = (() => {
|
|
|
10147
10215
|
props.onChange
|
|
10148
10216
|
);
|
|
10149
10217
|
const value = st[0], setValue = st[1];
|
|
10150
|
-
const draftState =
|
|
10218
|
+
const draftState = React66.useState(null), draft = draftState[0], setDraft = draftState[1];
|
|
10151
10219
|
function fmt2(n3) {
|
|
10152
10220
|
if (n3 == null || isNaN(n3)) return "";
|
|
10153
10221
|
return n3.toLocaleString("en", { minimumFractionDigits: decimals, maximumFractionDigits: decimals });
|
|
@@ -10196,7 +10264,7 @@ window.Aura = (() => {
|
|
|
10196
10264
|
};
|
|
10197
10265
|
const valueText = value == null ? void 0 : [affixText(props.prefix), fmt2(value), affixText(props.suffix)].join(" ").trim();
|
|
10198
10266
|
const stepper = props.stepper !== false && !props.readOnly;
|
|
10199
|
-
return /* @__PURE__ */
|
|
10267
|
+
return /* @__PURE__ */ React66.createElement(
|
|
10200
10268
|
Field,
|
|
10201
10269
|
{
|
|
10202
10270
|
id,
|
|
@@ -10208,7 +10276,7 @@ window.Aura = (() => {
|
|
|
10208
10276
|
disabled: props.disabled,
|
|
10209
10277
|
className: cx(touchClass(props.touchHeight), props.className)
|
|
10210
10278
|
},
|
|
10211
|
-
/* @__PURE__ */
|
|
10279
|
+
/* @__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
10280
|
"input",
|
|
10213
10281
|
{
|
|
10214
10282
|
ref,
|
|
@@ -10255,7 +10323,7 @@ window.Aura = (() => {
|
|
|
10255
10323
|
},
|
|
10256
10324
|
onKeyDown
|
|
10257
10325
|
}
|
|
10258
|
-
), props.suffix != null ? /* @__PURE__ */
|
|
10326
|
+
), 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
10327
|
"button",
|
|
10260
10328
|
{
|
|
10261
10329
|
type: "button",
|
|
@@ -10271,8 +10339,8 @@ window.Aura = (() => {
|
|
|
10271
10339
|
nudge(-step);
|
|
10272
10340
|
}
|
|
10273
10341
|
},
|
|
10274
|
-
/* @__PURE__ */
|
|
10275
|
-
), /* @__PURE__ */
|
|
10342
|
+
/* @__PURE__ */ React66.createElement(Icon, { name: /* @__PURE__ */ React66.createElement(IconMinus, null) })
|
|
10343
|
+
), /* @__PURE__ */ React66.createElement(
|
|
10276
10344
|
"button",
|
|
10277
10345
|
{
|
|
10278
10346
|
type: "button",
|
|
@@ -10288,14 +10356,14 @@ window.Aura = (() => {
|
|
|
10288
10356
|
nudge(step);
|
|
10289
10357
|
}
|
|
10290
10358
|
},
|
|
10291
|
-
/* @__PURE__ */
|
|
10359
|
+
/* @__PURE__ */ React66.createElement(Icon, { name: /* @__PURE__ */ React66.createElement(IconPlus, null) })
|
|
10292
10360
|
)) : null)
|
|
10293
10361
|
);
|
|
10294
10362
|
});
|
|
10295
10363
|
|
|
10296
10364
|
// src/Stepper.tsx
|
|
10297
|
-
var
|
|
10298
|
-
var Stepper =
|
|
10365
|
+
var React67 = __toESM(require_react(), 1);
|
|
10366
|
+
var Stepper = React67.forwardRef(function Stepper2(props, ref) {
|
|
10299
10367
|
const t = useStrings();
|
|
10300
10368
|
const idBase = uid();
|
|
10301
10369
|
const steps = props.steps || [];
|
|
@@ -10306,22 +10374,22 @@ window.Aura = (() => {
|
|
|
10306
10374
|
if (at < 0) at = 0;
|
|
10307
10375
|
const vertical = props.orientation === "vertical";
|
|
10308
10376
|
const cur2 = steps[at];
|
|
10309
|
-
return /* @__PURE__ */
|
|
10377
|
+
return /* @__PURE__ */ React67.createElement(
|
|
10310
10378
|
"nav",
|
|
10311
10379
|
{
|
|
10312
10380
|
ref,
|
|
10313
10381
|
"aria-label": props.label,
|
|
10314
10382
|
className: cx("aura-stepper", vertical ? "aura-stepper--vertical" : "aura-stepper--horizontal", props.className)
|
|
10315
10383
|
},
|
|
10316
|
-
/* @__PURE__ */
|
|
10384
|
+
/* @__PURE__ */ React67.createElement("ol", { className: "aura-stepper__list" }, steps.map(function(s, i) {
|
|
10317
10385
|
const state = i < at ? "done" : i === at ? "current" : "upcoming";
|
|
10318
10386
|
const error = s.status === "error";
|
|
10319
|
-
const marker = /* @__PURE__ */
|
|
10387
|
+
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
10388
|
const note = error ? t.stepError : state === "done" ? t.stepDone : "";
|
|
10321
10389
|
const clickable = state === "done" && !!props.onStepClick;
|
|
10322
10390
|
const named = clickable && (typeof s.label === "string" || typeof s.label === "number") && String(s.label).trim() !== "";
|
|
10323
10391
|
const descId = idBase + "-step-" + i;
|
|
10324
|
-
const text2 = /* @__PURE__ */
|
|
10392
|
+
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
10393
|
"span",
|
|
10326
10394
|
{
|
|
10327
10395
|
className: "aura-stepper__desc",
|
|
@@ -10330,14 +10398,14 @@ window.Aura = (() => {
|
|
|
10330
10398
|
},
|
|
10331
10399
|
s.description
|
|
10332
10400
|
) : null);
|
|
10333
|
-
return /* @__PURE__ */
|
|
10401
|
+
return /* @__PURE__ */ React67.createElement(
|
|
10334
10402
|
"li",
|
|
10335
10403
|
{
|
|
10336
10404
|
key: s.id,
|
|
10337
10405
|
className: cx("aura-stepper__item", "is-" + state, error && "is-error"),
|
|
10338
10406
|
"aria-current": state === "current" ? "step" : void 0
|
|
10339
10407
|
},
|
|
10340
|
-
clickable ? /* @__PURE__ */
|
|
10408
|
+
clickable ? /* @__PURE__ */ React67.createElement(
|
|
10341
10409
|
"button",
|
|
10342
10410
|
{
|
|
10343
10411
|
type: "button",
|
|
@@ -10349,19 +10417,19 @@ window.Aura = (() => {
|
|
|
10349
10417
|
},
|
|
10350
10418
|
marker,
|
|
10351
10419
|
text2
|
|
10352
|
-
) : /* @__PURE__ */
|
|
10420
|
+
) : /* @__PURE__ */ React67.createElement("span", { className: "aura-stepper__step" }, marker, text2)
|
|
10353
10421
|
);
|
|
10354
10422
|
})),
|
|
10355
|
-
!vertical && cur2 ? /* @__PURE__ */
|
|
10423
|
+
!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
10424
|
);
|
|
10357
10425
|
});
|
|
10358
10426
|
|
|
10359
10427
|
// src/SegmentedControl.tsx
|
|
10360
|
-
var
|
|
10428
|
+
var React68 = __toESM(require_react(), 1);
|
|
10361
10429
|
function toOpt2(o) {
|
|
10362
10430
|
return typeof o === "object" ? o : { value: o, label: o };
|
|
10363
10431
|
}
|
|
10364
|
-
var SegmentedControl =
|
|
10432
|
+
var SegmentedControl = React68.forwardRef(
|
|
10365
10433
|
function SegmentedControl2(props, ref) {
|
|
10366
10434
|
const options = (props.options || []).map(toOpt2);
|
|
10367
10435
|
useAutoTip();
|
|
@@ -10375,7 +10443,7 @@ window.Aura = (() => {
|
|
|
10375
10443
|
);
|
|
10376
10444
|
const value = st[0], setValue = st[1];
|
|
10377
10445
|
const auto = uid(), id = props.id || auto;
|
|
10378
|
-
const refs =
|
|
10446
|
+
const refs = React68.useRef([]);
|
|
10379
10447
|
const selIdx = options.findIndex(function(o) {
|
|
10380
10448
|
return o.value === value;
|
|
10381
10449
|
});
|
|
@@ -10408,7 +10476,7 @@ window.Aura = (() => {
|
|
|
10408
10476
|
move(options.length, -1);
|
|
10409
10477
|
}
|
|
10410
10478
|
}
|
|
10411
|
-
return /* @__PURE__ */
|
|
10479
|
+
return /* @__PURE__ */ React68.createElement(
|
|
10412
10480
|
"div",
|
|
10413
10481
|
{
|
|
10414
10482
|
ref,
|
|
@@ -10428,7 +10496,7 @@ window.Aura = (() => {
|
|
|
10428
10496
|
options.map(function(o, i) {
|
|
10429
10497
|
const on = o.value === value;
|
|
10430
10498
|
const off = props.disabled || o.disabled;
|
|
10431
|
-
return /* @__PURE__ */
|
|
10499
|
+
return /* @__PURE__ */ React68.createElement(
|
|
10432
10500
|
"button",
|
|
10433
10501
|
{
|
|
10434
10502
|
key: o.value,
|
|
@@ -10450,8 +10518,8 @@ window.Aura = (() => {
|
|
|
10450
10518
|
onKeyDown(e, i);
|
|
10451
10519
|
}
|
|
10452
10520
|
},
|
|
10453
|
-
o.icon ? /* @__PURE__ */
|
|
10454
|
-
o.iconOnly ? null : /* @__PURE__ */
|
|
10521
|
+
o.icon ? /* @__PURE__ */ React68.createElement(Icon, { name: o.icon }) : null,
|
|
10522
|
+
o.iconOnly ? null : /* @__PURE__ */ React68.createElement("span", null, o.label)
|
|
10455
10523
|
);
|
|
10456
10524
|
})
|
|
10457
10525
|
);
|