@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/cjs/index.cjs
CHANGED
|
@@ -68,7 +68,7 @@ __export(index_exports, {
|
|
|
68
68
|
IconButton: () => IconButton,
|
|
69
69
|
Menu: () => Menu,
|
|
70
70
|
NumberField: () => NumberField,
|
|
71
|
-
PageHeader: () =>
|
|
71
|
+
PageHeader: () => PageHeader3,
|
|
72
72
|
Pagination: () => Pagination,
|
|
73
73
|
PasswordField: () => PasswordField,
|
|
74
74
|
Popover: () => Popover,
|
|
@@ -6835,8 +6835,8 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6835
6835
|
}
|
|
6836
6836
|
);
|
|
6837
6837
|
};
|
|
6838
|
-
const
|
|
6839
|
-
for (let b = 0; b < lines; b++)
|
|
6838
|
+
const bars2 = [];
|
|
6839
|
+
for (let b = 0; b < lines; b++) bars2.push(bar(b));
|
|
6840
6840
|
sk.push(
|
|
6841
6841
|
/* @__PURE__ */ React33.createElement(
|
|
6842
6842
|
"span",
|
|
@@ -6860,7 +6860,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6860
6860
|
c.skeletonTouch && "is-touch"
|
|
6861
6861
|
)
|
|
6862
6862
|
}
|
|
6863
|
-
) : lines > 1 ? /* @__PURE__ */ React33.createElement("span", { className: "aura-skel-lines" },
|
|
6863
|
+
) : lines > 1 ? /* @__PURE__ */ React33.createElement("span", { className: "aura-skel-lines" }, bars2) : bars2[0]
|
|
6864
6864
|
)
|
|
6865
6865
|
);
|
|
6866
6866
|
});
|
|
@@ -7802,6 +7802,9 @@ var Container = React42.forwardRef(function Container2(props, ref) {
|
|
|
7802
7802
|
);
|
|
7803
7803
|
});
|
|
7804
7804
|
|
|
7805
|
+
// src/PageHeaderClient.tsx
|
|
7806
|
+
var React44 = __toESM(require("react"), 1);
|
|
7807
|
+
|
|
7805
7808
|
// src/PageHeader.tsx
|
|
7806
7809
|
var React43 = __toESM(require("react"), 1);
|
|
7807
7810
|
var h8 = React43.createElement;
|
|
@@ -7814,7 +7817,25 @@ var PageHeader = React43.forwardRef(function PageHeader2(props, ref) {
|
|
|
7814
7817
|
const level = props.headingLevel || 1;
|
|
7815
7818
|
const below2 = props.actionsFullWidthBelow;
|
|
7816
7819
|
const hide2 = props.titleHideBelow;
|
|
7817
|
-
const
|
|
7820
|
+
const shown = function(n3) {
|
|
7821
|
+
return n3 != null && n3 !== false && n3 !== "";
|
|
7822
|
+
};
|
|
7823
|
+
const hasMeta = shown(props.meta) || shown(props.subtitle) || shown(props.titleAddon);
|
|
7824
|
+
const size = props.size === "hero" || props.size === "hero-lg" ? props.size : null;
|
|
7825
|
+
const eyebrow = props.eyebrow;
|
|
7826
|
+
const plainEyebrow = typeof eyebrow === "string" || typeof eyebrow === "number";
|
|
7827
|
+
const heading = h8(
|
|
7828
|
+
"h" + level,
|
|
7829
|
+
{
|
|
7830
|
+
className: "aura-page-header__title",
|
|
7831
|
+
id: props.titleId,
|
|
7832
|
+
tabIndex: props.focusTitleOnMount ? -1 : void 0,
|
|
7833
|
+
"data-aura-focus-on-mount": props.focusTitleOnMount ? "" : void 0
|
|
7834
|
+
},
|
|
7835
|
+
props.title
|
|
7836
|
+
);
|
|
7837
|
+
const hasActions = props.actions != null && props.actions !== false;
|
|
7838
|
+
const bar = hasActions && (props.actionsBarBelow === "sm" || props.actionsBarBelow === "md") ? props.actionsBarBelow : null;
|
|
7818
7839
|
return h8(
|
|
7819
7840
|
"div",
|
|
7820
7841
|
Object.assign(attrs2, {
|
|
@@ -7824,6 +7845,9 @@ var PageHeader = React43.forwardRef(function PageHeader2(props, ref) {
|
|
|
7824
7845
|
(below2 === "sm" || below2 === "md" || below2 === "lg") && "aura-page-header--actions-full-below-" + below2,
|
|
7825
7846
|
(hide2 === "sm" || hide2 === "md" || hide2 === "lg") && "aura-page-header--title-hide-below-" + hide2,
|
|
7826
7847
|
(hide2 === "sm" || hide2 === "md" || hide2 === "lg") && !hasMeta && "has-no-meta",
|
|
7848
|
+
bar && "aura-page-header--actions-bar-below-" + bar,
|
|
7849
|
+
size && "aura-page-header--" + size,
|
|
7850
|
+
props.actionsAlign === "start" && "aura-page-header--actions-start",
|
|
7827
7851
|
props.className
|
|
7828
7852
|
),
|
|
7829
7853
|
style: props.style
|
|
@@ -7832,20 +7856,94 @@ var PageHeader = React43.forwardRef(function PageHeader2(props, ref) {
|
|
|
7832
7856
|
"div",
|
|
7833
7857
|
{ className: "aura-page-header__text" },
|
|
7834
7858
|
props.breadcrumb != null && props.breadcrumb !== false ? h8("div", { className: "aura-page-header__breadcrumb" }, props.breadcrumb) : null,
|
|
7835
|
-
|
|
7836
|
-
|
|
7859
|
+
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,
|
|
7860
|
+
shown(props.titleAddon) ? h8(
|
|
7861
|
+
"div",
|
|
7862
|
+
{ className: "aura-page-header__title-row" },
|
|
7863
|
+
heading,
|
|
7864
|
+
h8("div", { className: "aura-page-header__title-addon" }, props.titleAddon)
|
|
7865
|
+
) : heading,
|
|
7866
|
+
shown(props.subtitle) ? h8("div", { className: "aura-page-header__subtitle" }, props.subtitle) : null,
|
|
7837
7867
|
props.meta != null && props.meta !== false ? h8("div", { className: "aura-page-header__meta" }, props.meta) : null
|
|
7838
7868
|
),
|
|
7839
|
-
props.actions != null && props.actions !== false ? h8(
|
|
7869
|
+
props.actions != null && props.actions !== false ? h8(
|
|
7870
|
+
"div",
|
|
7871
|
+
{ className: "aura-page-header__actions" },
|
|
7872
|
+
bar && props.actionsStatus != null && props.actionsStatus !== false ? h8("div", { className: "aura-page-header__status", role: "status" }, props.actionsStatus) : null,
|
|
7873
|
+
props.actions
|
|
7874
|
+
) : null
|
|
7840
7875
|
);
|
|
7841
7876
|
});
|
|
7842
7877
|
|
|
7878
|
+
// src/PageHeaderClient.tsx
|
|
7879
|
+
var NAME = "--aura-page-actions-height";
|
|
7880
|
+
var bars = [];
|
|
7881
|
+
function trapped(el) {
|
|
7882
|
+
for (let p = el.parentElement; p && p !== document.documentElement; p = p.parentElement) {
|
|
7883
|
+
const s = getComputedStyle(p);
|
|
7884
|
+
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))
|
|
7885
|
+
return true;
|
|
7886
|
+
}
|
|
7887
|
+
return false;
|
|
7888
|
+
}
|
|
7889
|
+
var PageHeader3 = React44.forwardRef(function PageHeader4(props, ref) {
|
|
7890
|
+
const own = React44.useRef(null);
|
|
7891
|
+
const merged = useMergedRef(ref, own);
|
|
7892
|
+
const bar = props.actionsBarBelow;
|
|
7893
|
+
const hasActions = props.actions != null && props.actions !== false;
|
|
7894
|
+
React44.useEffect(
|
|
7895
|
+
function() {
|
|
7896
|
+
if (bar !== "sm" && bar !== "md" || !hasActions || !own.current) return;
|
|
7897
|
+
const el = own.current.querySelector(":scope > .aura-page-header__actions");
|
|
7898
|
+
if (!el) return;
|
|
7899
|
+
const root = document.documentElement;
|
|
7900
|
+
let checked = false;
|
|
7901
|
+
function sync() {
|
|
7902
|
+
if (bars[bars.length - 1] !== sync) return;
|
|
7903
|
+
if (getComputedStyle(el).position === "fixed") {
|
|
7904
|
+
root.style.setProperty(NAME, el.offsetHeight + "px");
|
|
7905
|
+
if (!checked && (checked = true, trapped(el)))
|
|
7906
|
+
devWarnOnce(
|
|
7907
|
+
"pageheader-bar-trapped",
|
|
7908
|
+
"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."
|
|
7909
|
+
);
|
|
7910
|
+
} else root.style.removeProperty(NAME);
|
|
7911
|
+
}
|
|
7912
|
+
if (bars.length)
|
|
7913
|
+
devWarnOnce(
|
|
7914
|
+
"pageheader-bar-twice",
|
|
7915
|
+
"PageHeader actionsBarBelow: two bars on one page overlap at the bottom of the screen. Give it to one PageHeader per page."
|
|
7916
|
+
);
|
|
7917
|
+
bars.push(sync);
|
|
7918
|
+
const ro = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(sync);
|
|
7919
|
+
if (ro) ro.observe(el);
|
|
7920
|
+
window.addEventListener("resize", sync);
|
|
7921
|
+
sync();
|
|
7922
|
+
return function() {
|
|
7923
|
+
if (ro) ro.disconnect();
|
|
7924
|
+
window.removeEventListener("resize", sync);
|
|
7925
|
+
bars.splice(bars.indexOf(sync), 1);
|
|
7926
|
+
if (bars.length) bars[bars.length - 1]();
|
|
7927
|
+
else root.style.removeProperty(NAME);
|
|
7928
|
+
};
|
|
7929
|
+
},
|
|
7930
|
+
[bar, hasActions]
|
|
7931
|
+
);
|
|
7932
|
+
const focusTitle = !!props.focusTitleOnMount;
|
|
7933
|
+
React44.useEffect(function() {
|
|
7934
|
+
if (!focusTitle || !own.current) return;
|
|
7935
|
+
const t = own.current.querySelector(".aura-page-header__title");
|
|
7936
|
+
if (t) t.focus({ preventScroll: true });
|
|
7937
|
+
}, []);
|
|
7938
|
+
return /* @__PURE__ */ React44.createElement(PageHeader, { ...props, ref: merged });
|
|
7939
|
+
});
|
|
7940
|
+
|
|
7843
7941
|
// src/StatusTile.tsx
|
|
7844
|
-
var
|
|
7942
|
+
var React46 = __toESM(require("react"), 1);
|
|
7845
7943
|
|
|
7846
7944
|
// src/tiles.tsx
|
|
7847
|
-
var
|
|
7848
|
-
var h9 =
|
|
7945
|
+
var React45 = __toESM(require("react"), 1);
|
|
7946
|
+
var h9 = React45.createElement;
|
|
7849
7947
|
var STATUS_ICON = {
|
|
7850
7948
|
down: IconCircleAlert,
|
|
7851
7949
|
problem: IconTriangleAlert,
|
|
@@ -7937,7 +8035,7 @@ function statusTileElement(props, ref, Link, t, titleRef) {
|
|
|
7937
8035
|
) : null
|
|
7938
8036
|
);
|
|
7939
8037
|
}
|
|
7940
|
-
var TileGrid =
|
|
8038
|
+
var TileGrid = React45.forwardRef(function TileGrid2(props, ref) {
|
|
7941
8039
|
const style = Object.assign(
|
|
7942
8040
|
{},
|
|
7943
8041
|
respVars("aura-grid-cols", props.columns == null ? { base: 2, md: 3 } : props.columns),
|
|
@@ -7953,16 +8051,16 @@ var TileGrid = React44.forwardRef(function TileGrid2(props, ref) {
|
|
|
7953
8051
|
}),
|
|
7954
8052
|
/* toArray drops null and booleans and keys each element; a Fragment's children are items too. */
|
|
7955
8053
|
flat(props.children).map(function(c, i) {
|
|
7956
|
-
return h9("li", { key:
|
|
8054
|
+
return h9("li", { key: React45.isValidElement(c) && c.key != null ? c.key : i }, c);
|
|
7957
8055
|
})
|
|
7958
8056
|
);
|
|
7959
8057
|
});
|
|
7960
8058
|
function flat(children) {
|
|
7961
8059
|
const out = [];
|
|
7962
|
-
|
|
7963
|
-
if (
|
|
8060
|
+
React45.Children.toArray(children).forEach(function(c) {
|
|
8061
|
+
if (React45.isValidElement(c) && c.type === React45.Fragment)
|
|
7964
8062
|
flat(c.props.children).forEach(function(x) {
|
|
7965
|
-
out.push(
|
|
8063
|
+
out.push(React45.isValidElement(x) ? React45.cloneElement(x, { key: String(c.key) + "/" + String(x.key) }) : x);
|
|
7966
8064
|
});
|
|
7967
8065
|
else if (c !== "") out.push(c);
|
|
7968
8066
|
});
|
|
@@ -7976,7 +8074,7 @@ function r(n3) {
|
|
|
7976
8074
|
function num(v) {
|
|
7977
8075
|
return typeof v === "number" && isFinite(v) ? v : null;
|
|
7978
8076
|
}
|
|
7979
|
-
var Sparkline =
|
|
8077
|
+
var Sparkline = React45.forwardRef(function Sparkline2(props, ref) {
|
|
7980
8078
|
const wh = SIZES2[props.size || "sm"] || SIZES2.sm;
|
|
7981
8079
|
const W = wh[0], H = wh[1];
|
|
7982
8080
|
const data = (props.data || []).map(num);
|
|
@@ -8050,8 +8148,8 @@ var Sparkline = React44.forwardRef(function Sparkline2(props, ref) {
|
|
|
8050
8148
|
});
|
|
8051
8149
|
|
|
8052
8150
|
// src/StatusTile.tsx
|
|
8053
|
-
var useIsoLayoutEffect2 = typeof window !== "undefined" ?
|
|
8054
|
-
var StatusTile =
|
|
8151
|
+
var useIsoLayoutEffect2 = typeof window !== "undefined" ? React46.useLayoutEffect : React46.useEffect;
|
|
8152
|
+
var StatusTile = React46.forwardRef(function StatusTile2(props, ref) {
|
|
8055
8153
|
const Link = useLinkComponent(props.linkComponent);
|
|
8056
8154
|
const t = useStrings();
|
|
8057
8155
|
useAutoTip();
|
|
@@ -8060,8 +8158,8 @@ var StatusTile = React45.forwardRef(function StatusTile2(props, ref) {
|
|
|
8060
8158
|
"status-tile-label",
|
|
8061
8159
|
"StatusTile `aria-label` needs `href`: without a link the tile is a plain box, where a name is not allowed."
|
|
8062
8160
|
);
|
|
8063
|
-
const titleRef =
|
|
8064
|
-
const check =
|
|
8161
|
+
const titleRef = React46.useRef(null);
|
|
8162
|
+
const check = React46.useCallback(function() {
|
|
8065
8163
|
const el = titleRef.current;
|
|
8066
8164
|
if (!el) return;
|
|
8067
8165
|
const cut = el.scrollHeight > el.clientHeight + 1;
|
|
@@ -8071,7 +8169,7 @@ var StatusTile = React45.forwardRef(function StatusTile2(props, ref) {
|
|
|
8071
8169
|
}, []);
|
|
8072
8170
|
useIsoLayoutEffect2(check, [props.title, check]);
|
|
8073
8171
|
const linked = !!props.href;
|
|
8074
|
-
|
|
8172
|
+
React46.useEffect(
|
|
8075
8173
|
function() {
|
|
8076
8174
|
const el = titleRef.current;
|
|
8077
8175
|
if (!el) return;
|
|
@@ -8096,14 +8194,14 @@ var StatusTile = React45.forwardRef(function StatusTile2(props, ref) {
|
|
|
8096
8194
|
});
|
|
8097
8195
|
|
|
8098
8196
|
// src/AppShell.tsx
|
|
8099
|
-
var
|
|
8197
|
+
var React48 = __toESM(require("react"), 1);
|
|
8100
8198
|
|
|
8101
8199
|
// src/scrollHide.ts
|
|
8102
|
-
var
|
|
8200
|
+
var React47 = __toESM(require("react"), 1);
|
|
8103
8201
|
var STEP = 8;
|
|
8104
8202
|
function useHideOnScroll(enabled, el, media, from) {
|
|
8105
|
-
const st =
|
|
8106
|
-
|
|
8203
|
+
const st = React47.useState(false), hidden = st[0], setHidden = st[1];
|
|
8204
|
+
React47.useEffect(
|
|
8107
8205
|
function() {
|
|
8108
8206
|
if (!enabled || typeof window === "undefined") {
|
|
8109
8207
|
setHidden(false);
|
|
@@ -8193,31 +8291,31 @@ function useHideOnScroll(enabled, el, media, from) {
|
|
|
8193
8291
|
}
|
|
8194
8292
|
|
|
8195
8293
|
// src/AppShell.tsx
|
|
8196
|
-
var AppShell =
|
|
8294
|
+
var AppShell = React48.forwardRef(function AppShell2(props, ref) {
|
|
8197
8295
|
const t = useStrings();
|
|
8198
8296
|
const bp = useBreakpoint();
|
|
8199
8297
|
const wide = bp === "lg" || bp === "xl";
|
|
8200
|
-
const st =
|
|
8201
|
-
|
|
8298
|
+
const st = React48.useState(false), open = st[0], setOpen = st[1];
|
|
8299
|
+
React48.useEffect(
|
|
8202
8300
|
function() {
|
|
8203
8301
|
if (wide) setOpen(false);
|
|
8204
8302
|
},
|
|
8205
8303
|
[wide]
|
|
8206
8304
|
);
|
|
8207
|
-
const navEl = props.nav &&
|
|
8305
|
+
const navEl = props.nav && React48.isValidElement(props.nav) ? props.nav : null;
|
|
8208
8306
|
const shared = !!navEl && navEl.props.value === void 0 && (navEl.props.defaultValue !== void 0 || navEl.props.sections !== void 0 || navEl.props.items !== void 0);
|
|
8209
|
-
const navState =
|
|
8307
|
+
const navState = React48.useState(navEl ? navEl.props.defaultValue : void 0);
|
|
8210
8308
|
function onNav(id) {
|
|
8211
8309
|
if (shared) navState[1](id);
|
|
8212
8310
|
if (navEl && navEl.props.onChange) navEl.props.onChange(id);
|
|
8213
8311
|
}
|
|
8214
|
-
const rootRef =
|
|
8215
|
-
const barRef =
|
|
8312
|
+
const rootRef = React48.useRef(null);
|
|
8313
|
+
const barRef = React48.useRef(null);
|
|
8216
8314
|
const mergedRef = useMergedRef(ref, rootRef);
|
|
8217
8315
|
const hasBar = !!(props.header || props.nav);
|
|
8218
|
-
const barH =
|
|
8316
|
+
const barH = React48.useState(null);
|
|
8219
8317
|
const away = useHideOnScroll(!!props.headerHideOnScroll && hasBar, barRef, "(max-width: 1023.98px)", barH[0] || 56);
|
|
8220
|
-
const awayRef =
|
|
8318
|
+
const awayRef = React48.useRef(away);
|
|
8221
8319
|
awayRef.current = away;
|
|
8222
8320
|
useIsoLayoutEffect(
|
|
8223
8321
|
function() {
|
|
@@ -8246,8 +8344,8 @@ var AppShell = React47.forwardRef(function AppShell2(props, ref) {
|
|
|
8246
8344
|
},
|
|
8247
8345
|
[hasBar]
|
|
8248
8346
|
);
|
|
8249
|
-
const deskNav = navEl && shared ?
|
|
8250
|
-
const drawerNav = navEl ?
|
|
8347
|
+
const deskNav = navEl && shared ? React48.cloneElement(navEl, { value: navState[0], onChange: onNav }) : props.nav;
|
|
8348
|
+
const drawerNav = navEl ? React48.cloneElement(navEl, {
|
|
8251
8349
|
value: shared ? navState[0] : navEl.props.value,
|
|
8252
8350
|
onChange: function(id) {
|
|
8253
8351
|
onNav(id);
|
|
@@ -8262,7 +8360,7 @@ var AppShell = React47.forwardRef(function AppShell2(props, ref) {
|
|
|
8262
8360
|
collapsed: false,
|
|
8263
8361
|
collapsible: false
|
|
8264
8362
|
}) : props.nav;
|
|
8265
|
-
return /* @__PURE__ */
|
|
8363
|
+
return /* @__PURE__ */ React48.createElement(
|
|
8266
8364
|
"div",
|
|
8267
8365
|
{
|
|
8268
8366
|
ref: mergedRef,
|
|
@@ -8277,8 +8375,8 @@ var AppShell = React47.forwardRef(function AppShell2(props, ref) {
|
|
|
8277
8375
|
props.className
|
|
8278
8376
|
)
|
|
8279
8377
|
},
|
|
8280
|
-
props.nav ? /* @__PURE__ */
|
|
8281
|
-
props.nav ? /* @__PURE__ */
|
|
8378
|
+
props.nav ? /* @__PURE__ */ React48.createElement("div", { className: "aura-shell__nav" }, deskNav) : null,
|
|
8379
|
+
props.nav ? /* @__PURE__ */ React48.createElement(
|
|
8282
8380
|
Drawer,
|
|
8283
8381
|
{
|
|
8284
8382
|
open,
|
|
@@ -8295,7 +8393,7 @@ var AppShell = React47.forwardRef(function AppShell2(props, ref) {
|
|
|
8295
8393
|
},
|
|
8296
8394
|
drawerNav
|
|
8297
8395
|
) : null,
|
|
8298
|
-
/* @__PURE__ */
|
|
8396
|
+
/* @__PURE__ */ React48.createElement("div", { className: "aura-shell__main" }, props.header || props.nav ? /* @__PURE__ */ React48.createElement(
|
|
8299
8397
|
"header",
|
|
8300
8398
|
{
|
|
8301
8399
|
ref: barRef,
|
|
@@ -8307,11 +8405,11 @@ var AppShell = React47.forwardRef(function AppShell2(props, ref) {
|
|
|
8307
8405
|
away && "is-away"
|
|
8308
8406
|
)
|
|
8309
8407
|
},
|
|
8310
|
-
props.nav ? /* @__PURE__ */
|
|
8408
|
+
props.nav ? /* @__PURE__ */ React48.createElement(
|
|
8311
8409
|
IconButton,
|
|
8312
8410
|
{
|
|
8313
8411
|
className: "aura-shell__menu",
|
|
8314
|
-
icon: /* @__PURE__ */
|
|
8412
|
+
icon: /* @__PURE__ */ React48.createElement(IconMenu, null),
|
|
8315
8413
|
label: props.menuLabel || t.openNav,
|
|
8316
8414
|
size: "md",
|
|
8317
8415
|
onClick: function() {
|
|
@@ -8320,8 +8418,8 @@ var AppShell = React47.forwardRef(function AppShell2(props, ref) {
|
|
|
8320
8418
|
"aria-expanded": open
|
|
8321
8419
|
}
|
|
8322
8420
|
) : null,
|
|
8323
|
-
/* @__PURE__ */
|
|
8324
|
-
) : null, /* @__PURE__ */
|
|
8421
|
+
/* @__PURE__ */ React48.createElement("div", { className: "aura-shell__bar-content" }, props.header)
|
|
8422
|
+
) : null, /* @__PURE__ */ React48.createElement(
|
|
8325
8423
|
"main",
|
|
8326
8424
|
{
|
|
8327
8425
|
className: cx("aura-shell__content", props.contentPadding === false && "is-flush"),
|
|
@@ -8334,17 +8432,17 @@ var AppShell = React47.forwardRef(function AppShell2(props, ref) {
|
|
|
8334
8432
|
});
|
|
8335
8433
|
|
|
8336
8434
|
// src/ActionBar.tsx
|
|
8337
|
-
var
|
|
8338
|
-
var ActionBar =
|
|
8435
|
+
var React49 = __toESM(require("react"), 1);
|
|
8436
|
+
var ActionBar = React49.forwardRef(function ActionBar2(props, ref) {
|
|
8339
8437
|
const t = useStrings();
|
|
8340
8438
|
const bulk = props.selected != null;
|
|
8341
8439
|
const idle = bulk && !props.selected;
|
|
8342
8440
|
const count = bulk && props.selected ? t.selectedCount(props.selected) : null;
|
|
8343
|
-
const hasStart =
|
|
8441
|
+
const hasStart = React49.Children.toArray(props.start).some(function(c) {
|
|
8344
8442
|
return c !== "";
|
|
8345
8443
|
});
|
|
8346
|
-
const cameFrom =
|
|
8347
|
-
const own =
|
|
8444
|
+
const cameFrom = React49.useRef(null);
|
|
8445
|
+
const own = React49.useRef(null);
|
|
8348
8446
|
function clear() {
|
|
8349
8447
|
props.onClearSelection();
|
|
8350
8448
|
setTimeout(function() {
|
|
@@ -8353,7 +8451,7 @@ var ActionBar = React48.forwardRef(function ActionBar2(props, ref) {
|
|
|
8353
8451
|
if ((!a || a === document.body || !a.isConnected) && back && back.isConnected) back.focus();
|
|
8354
8452
|
}, 0);
|
|
8355
8453
|
}
|
|
8356
|
-
return /* @__PURE__ */
|
|
8454
|
+
return /* @__PURE__ */ React49.createElement(
|
|
8357
8455
|
"div",
|
|
8358
8456
|
{
|
|
8359
8457
|
ref: function(el) {
|
|
@@ -8375,16 +8473,16 @@ var ActionBar = React48.forwardRef(function ActionBar2(props, ref) {
|
|
|
8375
8473
|
props.className
|
|
8376
8474
|
)
|
|
8377
8475
|
},
|
|
8378
|
-
/* @__PURE__ */
|
|
8476
|
+
/* @__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)
|
|
8379
8477
|
);
|
|
8380
8478
|
});
|
|
8381
8479
|
|
|
8382
8480
|
// src/Separator.tsx
|
|
8383
|
-
var
|
|
8384
|
-
var Separator =
|
|
8481
|
+
var React50 = __toESM(require("react"), 1);
|
|
8482
|
+
var Separator = React50.forwardRef(function Separator2(props, ref) {
|
|
8385
8483
|
const vertical = props.orientation === "vertical";
|
|
8386
8484
|
const decorative = props.decorative !== false;
|
|
8387
|
-
return /* @__PURE__ */
|
|
8485
|
+
return /* @__PURE__ */ React50.createElement(
|
|
8388
8486
|
"div",
|
|
8389
8487
|
{
|
|
8390
8488
|
ref,
|
|
@@ -8397,13 +8495,13 @@ var Separator = React49.forwardRef(function Separator2(props, ref) {
|
|
|
8397
8495
|
});
|
|
8398
8496
|
|
|
8399
8497
|
// src/Table.tsx
|
|
8400
|
-
var
|
|
8401
|
-
var StackLabels =
|
|
8402
|
-
var ColumnIndex =
|
|
8498
|
+
var React51 = __toESM(require("react"), 1);
|
|
8499
|
+
var StackLabels = React51.createContext(null);
|
|
8500
|
+
var ColumnIndex = React51.createContext(-1);
|
|
8403
8501
|
function flat2(children) {
|
|
8404
8502
|
const out = [];
|
|
8405
|
-
|
|
8406
|
-
if (
|
|
8503
|
+
React51.Children.toArray(children).forEach(function(c) {
|
|
8504
|
+
if (React51.isValidElement(c) && c.type === React51.Fragment)
|
|
8407
8505
|
out.push.apply(out, flat2(c.props.children));
|
|
8408
8506
|
else out.push(c);
|
|
8409
8507
|
});
|
|
@@ -8417,7 +8515,7 @@ function text(node) {
|
|
|
8417
8515
|
});
|
|
8418
8516
|
return parts.length ? parts.join("") : void 0;
|
|
8419
8517
|
}
|
|
8420
|
-
if (
|
|
8518
|
+
if (React51.isValidElement(node)) {
|
|
8421
8519
|
const p = node.props;
|
|
8422
8520
|
if (p["aria-hidden"] === true || p["aria-hidden"] === "true") return void 0;
|
|
8423
8521
|
return text(p.children);
|
|
@@ -8427,13 +8525,13 @@ function text(node) {
|
|
|
8427
8525
|
function headerLabels(children) {
|
|
8428
8526
|
let out = [];
|
|
8429
8527
|
flat2(children).forEach(function(c) {
|
|
8430
|
-
if (out.length || !
|
|
8528
|
+
if (out.length || !React51.isValidElement(c) || c.type !== THead) return;
|
|
8431
8529
|
const row = flat2(c.props.children).find(function(r2) {
|
|
8432
|
-
return
|
|
8530
|
+
return React51.isValidElement(r2);
|
|
8433
8531
|
});
|
|
8434
8532
|
if (!row) return;
|
|
8435
8533
|
flat2(row.props.children).forEach(function(cell) {
|
|
8436
|
-
if (!
|
|
8534
|
+
if (!React51.isValidElement(cell)) return;
|
|
8437
8535
|
const p = cell.props;
|
|
8438
8536
|
const t = text(p.children);
|
|
8439
8537
|
const label = p.label != null ? p.label : t != null ? t.replace(/\s+/g, " ").trim() || void 0 : void 0;
|
|
@@ -8443,7 +8541,7 @@ function headerLabels(children) {
|
|
|
8443
8541
|
});
|
|
8444
8542
|
return out;
|
|
8445
8543
|
}
|
|
8446
|
-
var Table =
|
|
8544
|
+
var Table = React51.forwardRef(function Table2(props, ref) {
|
|
8447
8545
|
const {
|
|
8448
8546
|
caption,
|
|
8449
8547
|
captionHidden,
|
|
@@ -8473,12 +8571,12 @@ var Table = React50.forwardRef(function Table2(props, ref) {
|
|
|
8473
8571
|
"tbl-stack-labels",
|
|
8474
8572
|
"Table stackBelow: no THead > Tr > Th found among its children, so cells have no labels. Pass `label` on each Td."
|
|
8475
8573
|
);
|
|
8476
|
-
const outer =
|
|
8574
|
+
const outer = React51.useContext(StackLabels);
|
|
8477
8575
|
const pageDensity = useDensity();
|
|
8478
8576
|
const capId = uid();
|
|
8479
|
-
const wrap =
|
|
8480
|
-
const sc =
|
|
8481
|
-
const wide =
|
|
8577
|
+
const wrap = React51.useRef(null);
|
|
8578
|
+
const sc = React51.useState(false), scrolls = sc[0];
|
|
8579
|
+
const wide = React51.useState(false);
|
|
8482
8580
|
useIsoLayoutEffect(function() {
|
|
8483
8581
|
const el = wrap.current;
|
|
8484
8582
|
if (!el || typeof ResizeObserver === "undefined") return;
|
|
@@ -8495,7 +8593,7 @@ var Table = React50.forwardRef(function Table2(props, ref) {
|
|
|
8495
8593
|
ro.disconnect();
|
|
8496
8594
|
};
|
|
8497
8595
|
}, []);
|
|
8498
|
-
const table = /* @__PURE__ */
|
|
8596
|
+
const table = /* @__PURE__ */ React51.createElement(
|
|
8499
8597
|
"div",
|
|
8500
8598
|
{
|
|
8501
8599
|
ref: wrap,
|
|
@@ -8519,7 +8617,7 @@ var Table = React50.forwardRef(function Table2(props, ref) {
|
|
|
8519
8617
|
"aria-labelledby": scrolls ? caption != null ? capId : rest["aria-labelledby"] : void 0,
|
|
8520
8618
|
"aria-label": scrolls && caption == null ? rest["aria-label"] : void 0
|
|
8521
8619
|
},
|
|
8522
|
-
/* @__PURE__ */
|
|
8620
|
+
/* @__PURE__ */ React51.createElement(
|
|
8523
8621
|
"table",
|
|
8524
8622
|
{
|
|
8525
8623
|
ref,
|
|
@@ -8535,11 +8633,11 @@ var Table = React50.forwardRef(function Table2(props, ref) {
|
|
|
8535
8633
|
role: stackBelow ? "table" : void 0,
|
|
8536
8634
|
...rest
|
|
8537
8635
|
},
|
|
8538
|
-
caption != null ? /* @__PURE__ */
|
|
8539
|
-
labels ? /* @__PURE__ */
|
|
8636
|
+
caption != null ? /* @__PURE__ */ React51.createElement("caption", { id: capId, className: cx("aura-tbl__caption", captionHidden && "aura-sr-only") }, caption) : null,
|
|
8637
|
+
labels ? /* @__PURE__ */ React51.createElement(StackLabels.Provider, { value: labels }, children) : outer ? /* @__PURE__ */ React51.createElement(StackLabels.Provider, { value: null }, children) : children
|
|
8540
8638
|
)
|
|
8541
8639
|
);
|
|
8542
|
-
return cards ? /* @__PURE__ */
|
|
8640
|
+
return cards ? /* @__PURE__ */ React51.createElement(
|
|
8543
8641
|
"div",
|
|
8544
8642
|
{
|
|
8545
8643
|
className: cx(
|
|
@@ -8552,10 +8650,10 @@ var Table = React50.forwardRef(function Table2(props, ref) {
|
|
|
8552
8650
|
) : table;
|
|
8553
8651
|
});
|
|
8554
8652
|
function section(tag, cls) {
|
|
8555
|
-
const C =
|
|
8653
|
+
const C = React51.forwardRef(function TableSection(props, ref) {
|
|
8556
8654
|
const { className, ...rest } = props;
|
|
8557
|
-
const stacked =
|
|
8558
|
-
return
|
|
8655
|
+
const stacked = React51.useContext(StackLabels) != null;
|
|
8656
|
+
return React51.createElement(
|
|
8559
8657
|
tag,
|
|
8560
8658
|
Object.assign({ ref, className: cx(cls, className), role: stacked ? "rowgroup" : void 0 }, rest)
|
|
8561
8659
|
);
|
|
@@ -8568,14 +8666,14 @@ var TBody = section("tbody", "aura-tbl__body");
|
|
|
8568
8666
|
TBody.displayName = "TBody";
|
|
8569
8667
|
var TFoot = section("tfoot", "aura-tbl__foot");
|
|
8570
8668
|
TFoot.displayName = "TFoot";
|
|
8571
|
-
var Tr =
|
|
8669
|
+
var Tr = React51.forwardRef(function Tr2(props, ref) {
|
|
8572
8670
|
const { className, children, ...rest } = props;
|
|
8573
|
-
const stacked =
|
|
8671
|
+
const stacked = React51.useContext(StackLabels) != null;
|
|
8574
8672
|
let col = 0;
|
|
8575
|
-
return /* @__PURE__ */
|
|
8673
|
+
return /* @__PURE__ */ React51.createElement("tr", { ref, className: cx("aura-tbl__row", className), role: stacked ? "row" : void 0, ...rest }, stacked ? flat2(children).map(function(c) {
|
|
8576
8674
|
const at = col;
|
|
8577
|
-
if (
|
|
8578
|
-
return /* @__PURE__ */
|
|
8675
|
+
if (React51.isValidElement(c)) col += Math.max(1, Number(c.props.colSpan) || 1);
|
|
8676
|
+
return /* @__PURE__ */ React51.createElement(ColumnIndex.Provider, { key: React51.isValidElement(c) && c.key != null ? c.key : at, value: at }, c);
|
|
8579
8677
|
}) : children);
|
|
8580
8678
|
});
|
|
8581
8679
|
function cellClass(base, p) {
|
|
@@ -8589,10 +8687,10 @@ function cellClass(base, p) {
|
|
|
8589
8687
|
p.className
|
|
8590
8688
|
);
|
|
8591
8689
|
}
|
|
8592
|
-
var Th =
|
|
8690
|
+
var Th = React51.forwardRef(function Th2(props, ref) {
|
|
8593
8691
|
const { align, numeric, mono, className, scope, label, card, ...rest } = props;
|
|
8594
|
-
const stacked =
|
|
8595
|
-
return /* @__PURE__ */
|
|
8692
|
+
const stacked = React51.useContext(StackLabels) != null;
|
|
8693
|
+
return /* @__PURE__ */ React51.createElement(
|
|
8596
8694
|
"th",
|
|
8597
8695
|
{
|
|
8598
8696
|
ref,
|
|
@@ -8604,12 +8702,12 @@ var Th = React50.forwardRef(function Th2(props, ref) {
|
|
|
8604
8702
|
}
|
|
8605
8703
|
);
|
|
8606
8704
|
});
|
|
8607
|
-
var Td =
|
|
8705
|
+
var Td = React51.forwardRef(function Td2(props, ref) {
|
|
8608
8706
|
const { align, numeric, mono, className, scope, label, card, ...rest } = props;
|
|
8609
|
-
const labels =
|
|
8707
|
+
const labels = React51.useContext(StackLabels), col = React51.useContext(ColumnIndex);
|
|
8610
8708
|
const slot = labels && (card === "title" || card === "action") ? card : void 0;
|
|
8611
8709
|
const shown = labels && !slot ? label != null ? label : col >= 0 ? labels[col] : void 0 : void 0;
|
|
8612
|
-
return /* @__PURE__ */
|
|
8710
|
+
return /* @__PURE__ */ React51.createElement(
|
|
8613
8711
|
"td",
|
|
8614
8712
|
{
|
|
8615
8713
|
ref,
|
|
@@ -8623,8 +8721,8 @@ var Td = React50.forwardRef(function Td2(props, ref) {
|
|
|
8623
8721
|
});
|
|
8624
8722
|
|
|
8625
8723
|
// src/BottomNav.tsx
|
|
8626
|
-
var
|
|
8627
|
-
var BottomNav =
|
|
8724
|
+
var React52 = __toESM(require("react"), 1);
|
|
8725
|
+
var BottomNav = React52.forwardRef(function BottomNav2(props, ref) {
|
|
8628
8726
|
const t = useStrings();
|
|
8629
8727
|
const Link = useLinkComponent(props.linkComponent);
|
|
8630
8728
|
const st = useMaybeControlled(
|
|
@@ -8634,7 +8732,7 @@ var BottomNav = React51.forwardRef(function BottomNav2(props, ref) {
|
|
|
8634
8732
|
);
|
|
8635
8733
|
const active = st[0];
|
|
8636
8734
|
const hide2 = props.hideFrom === false ? "always" : "below-" + (props.hideFrom || "lg");
|
|
8637
|
-
const own =
|
|
8735
|
+
const own = React52.useRef(null);
|
|
8638
8736
|
const hf = props.hideFrom === false ? null : props.hideFrom || "lg";
|
|
8639
8737
|
const away = useHideOnScroll(
|
|
8640
8738
|
!!props.hideOnScroll,
|
|
@@ -8642,7 +8740,7 @@ var BottomNav = React51.forwardRef(function BottomNav2(props, ref) {
|
|
|
8642
8740
|
hf ? "(max-width: " + (breakpoints[hf] - 0.02) + "px)" : "all",
|
|
8643
8741
|
64
|
|
8644
8742
|
);
|
|
8645
|
-
const setRef =
|
|
8743
|
+
const setRef = React52.useCallback(
|
|
8646
8744
|
function(el) {
|
|
8647
8745
|
own.current = el;
|
|
8648
8746
|
if (typeof ref === "function") ref(el);
|
|
@@ -8650,7 +8748,7 @@ var BottomNav = React51.forwardRef(function BottomNav2(props, ref) {
|
|
|
8650
8748
|
},
|
|
8651
8749
|
[ref]
|
|
8652
8750
|
);
|
|
8653
|
-
return /* @__PURE__ */
|
|
8751
|
+
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(
|
|
8654
8752
|
"nav",
|
|
8655
8753
|
{
|
|
8656
8754
|
ref: setRef,
|
|
@@ -8663,7 +8761,7 @@ var BottomNav = React51.forwardRef(function BottomNav2(props, ref) {
|
|
|
8663
8761
|
),
|
|
8664
8762
|
"aria-label": props.label || t.mainNav
|
|
8665
8763
|
},
|
|
8666
|
-
/* @__PURE__ */
|
|
8764
|
+
/* @__PURE__ */ React52.createElement("ul", { className: "aura-bottomnav__list" }, props.items.map(function(it) {
|
|
8667
8765
|
if (it.ariaLabel && typeof it.label === "string" && it.ariaLabel.toLowerCase().indexOf(it.label.toLowerCase()) < 0)
|
|
8668
8766
|
devWarnOnce(
|
|
8669
8767
|
"bottomnav-label-" + it.id,
|
|
@@ -8684,20 +8782,20 @@ var BottomNav = React51.forwardRef(function BottomNav2(props, ref) {
|
|
|
8684
8782
|
}
|
|
8685
8783
|
};
|
|
8686
8784
|
const inner = [
|
|
8687
|
-
/* @__PURE__ */
|
|
8688
|
-
it.ariaLabel ? /* @__PURE__ */
|
|
8689
|
-
/* @__PURE__ */
|
|
8690
|
-
suffix && !it.ariaLabel ? /* @__PURE__ */
|
|
8785
|
+
/* @__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),
|
|
8786
|
+
it.ariaLabel ? /* @__PURE__ */ React52.createElement("span", { key: "n", className: "aura-sr-only" }, it.ariaLabel + suffix) : null,
|
|
8787
|
+
/* @__PURE__ */ React52.createElement("span", { key: "l", className: "aura-bottomnav__label", "aria-hidden": it.ariaLabel ? true : void 0 }, it.label),
|
|
8788
|
+
suffix && !it.ariaLabel ? /* @__PURE__ */ React52.createElement("span", { key: "s", className: "aura-sr-only" }, suffix) : null
|
|
8691
8789
|
];
|
|
8692
|
-
return /* @__PURE__ */
|
|
8790
|
+
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));
|
|
8693
8791
|
}))
|
|
8694
8792
|
));
|
|
8695
8793
|
});
|
|
8696
8794
|
|
|
8697
8795
|
// src/Surface.tsx
|
|
8698
|
-
var
|
|
8699
|
-
var h10 =
|
|
8700
|
-
var Surface =
|
|
8796
|
+
var React53 = __toESM(require("react"), 1);
|
|
8797
|
+
var h10 = React53.createElement;
|
|
8798
|
+
var Surface = React53.forwardRef(function Surface2(props, ref) {
|
|
8701
8799
|
const t = props.texture || "mesh";
|
|
8702
8800
|
const rest = omit(props, ["texture", "className", "children", "as"]);
|
|
8703
8801
|
return h10(
|
|
@@ -8718,14 +8816,14 @@ var Surface = React52.forwardRef(function Surface2(props, ref) {
|
|
|
8718
8816
|
});
|
|
8719
8817
|
|
|
8720
8818
|
// src/Stat.tsx
|
|
8721
|
-
var
|
|
8722
|
-
var Stat =
|
|
8819
|
+
var React54 = __toESM(require("react"), 1);
|
|
8820
|
+
var Stat = React54.forwardRef(function Stat2(props, ref) {
|
|
8723
8821
|
const Link = useLinkComponent(props.linkComponent);
|
|
8724
8822
|
return statElement(props, ref, Link);
|
|
8725
8823
|
});
|
|
8726
8824
|
|
|
8727
8825
|
// src/TimePicker.tsx
|
|
8728
|
-
var
|
|
8826
|
+
var React55 = __toESM(require("react"), 1);
|
|
8729
8827
|
var import_react_dom12 = require("react-dom");
|
|
8730
8828
|
|
|
8731
8829
|
// src/text.ts
|
|
@@ -8767,7 +8865,7 @@ function toMin(t) {
|
|
|
8767
8865
|
function fromMin(n3) {
|
|
8768
8866
|
return pad3(Math.floor(n3 / 60)) + ":" + pad3(n3 % 60);
|
|
8769
8867
|
}
|
|
8770
|
-
var TimePicker =
|
|
8868
|
+
var TimePicker = React55.forwardRef(function TimePicker2(props, ref) {
|
|
8771
8869
|
const t = useStrings();
|
|
8772
8870
|
const auto = uid(), id = props.id || auto, listId = id + "-list";
|
|
8773
8871
|
const st = useMaybeControlled(
|
|
@@ -8777,7 +8875,7 @@ var TimePicker = React54.forwardRef(function TimePicker2(props, ref) {
|
|
|
8777
8875
|
);
|
|
8778
8876
|
const value = st[0];
|
|
8779
8877
|
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;
|
|
8780
|
-
const slots =
|
|
8878
|
+
const slots = React55.useMemo(
|
|
8781
8879
|
function() {
|
|
8782
8880
|
const out = [];
|
|
8783
8881
|
for (let m = lo; m <= hi; m += step) out.push(fromMin(m));
|
|
@@ -8789,12 +8887,12 @@ var TimePicker = React54.forwardRef(function TimePicker2(props, ref) {
|
|
|
8789
8887
|
const n3 = toMin(v);
|
|
8790
8888
|
return n3 == null || n3 < lo || n3 > hi || props.isTimeDisabled && props.isTimeDisabled(v);
|
|
8791
8889
|
}
|
|
8792
|
-
const openState =
|
|
8793
|
-
const editState =
|
|
8794
|
-
const aState =
|
|
8795
|
-
const errState =
|
|
8796
|
-
const pos =
|
|
8797
|
-
const boxRef =
|
|
8890
|
+
const openState = React55.useState(false), open = openState[0], setOpen = openState[1];
|
|
8891
|
+
const editState = React55.useState(null), editing = editState[0], setEditing = editState[1];
|
|
8892
|
+
const aState = React55.useState(0), active = aState[0], setActive = aState[1];
|
|
8893
|
+
const errState = React55.useState(null);
|
|
8894
|
+
const pos = React55.useState(null);
|
|
8895
|
+
const boxRef = React55.useRef(null), inputRef = React55.useRef(null), listRef = React55.useRef(null), inputMerged = useMergedRef(ref, inputRef);
|
|
8798
8896
|
const mounted = useMounted();
|
|
8799
8897
|
function nearest(v) {
|
|
8800
8898
|
const n3 = toMin(v);
|
|
@@ -8822,7 +8920,7 @@ var TimePicker = React54.forwardRef(function TimePicker2(props, ref) {
|
|
|
8822
8920
|
},
|
|
8823
8921
|
[open]
|
|
8824
8922
|
);
|
|
8825
|
-
|
|
8923
|
+
React55.useEffect(
|
|
8826
8924
|
function() {
|
|
8827
8925
|
if (!open) return;
|
|
8828
8926
|
function outside(e) {
|
|
@@ -8844,7 +8942,7 @@ var TimePicker = React54.forwardRef(function TimePicker2(props, ref) {
|
|
|
8844
8942
|
},
|
|
8845
8943
|
[open]
|
|
8846
8944
|
);
|
|
8847
|
-
|
|
8945
|
+
React55.useEffect(
|
|
8848
8946
|
function() {
|
|
8849
8947
|
if (!open || !listRef.current) return;
|
|
8850
8948
|
const el = listRef.current.querySelector('[data-idx="' + active + '"]');
|
|
@@ -8943,9 +9041,9 @@ var TimePicker = React54.forwardRef(function TimePicker2(props, ref) {
|
|
|
8943
9041
|
}
|
|
8944
9042
|
const error = errState[0] || props.error;
|
|
8945
9043
|
const list = open && mounted && pos[0] ? (0, import_react_dom12.createPortal)(
|
|
8946
|
-
/* @__PURE__ */
|
|
9044
|
+
/* @__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) {
|
|
8947
9045
|
const dis = blocked(s), sel = s === value;
|
|
8948
|
-
return /* @__PURE__ */
|
|
9046
|
+
return /* @__PURE__ */ React55.createElement(
|
|
8949
9047
|
"li",
|
|
8950
9048
|
{
|
|
8951
9049
|
key: s,
|
|
@@ -8970,13 +9068,13 @@ var TimePicker = React54.forwardRef(function TimePicker2(props, ref) {
|
|
|
8970
9068
|
if (active !== i) setActive(i);
|
|
8971
9069
|
}
|
|
8972
9070
|
},
|
|
8973
|
-
/* @__PURE__ */
|
|
8974
|
-
sel ? /* @__PURE__ */
|
|
9071
|
+
/* @__PURE__ */ React55.createElement("span", { className: "aura-combo__label" }, s),
|
|
9072
|
+
sel ? /* @__PURE__ */ React55.createElement(Icon, { name: /* @__PURE__ */ React55.createElement(IconCheck, null), className: "aura-combo__check" }) : null
|
|
8975
9073
|
);
|
|
8976
9074
|
}))),
|
|
8977
9075
|
document.body
|
|
8978
9076
|
) : null;
|
|
8979
|
-
return /* @__PURE__ */
|
|
9077
|
+
return /* @__PURE__ */ React55.createElement(
|
|
8980
9078
|
Field,
|
|
8981
9079
|
{
|
|
8982
9080
|
id,
|
|
@@ -8988,7 +9086,7 @@ var TimePicker = React54.forwardRef(function TimePicker2(props, ref) {
|
|
|
8988
9086
|
disabled: props.disabled,
|
|
8989
9087
|
className: cx(touchClass(props.touchHeight), props.className)
|
|
8990
9088
|
},
|
|
8991
|
-
/* @__PURE__ */
|
|
9089
|
+
/* @__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(
|
|
8992
9090
|
"input",
|
|
8993
9091
|
{
|
|
8994
9092
|
ref: inputMerged,
|
|
@@ -9028,7 +9126,7 @@ var TimePicker = React54.forwardRef(function TimePicker2(props, ref) {
|
|
|
9028
9126
|
}, 0);
|
|
9029
9127
|
}
|
|
9030
9128
|
}
|
|
9031
|
-
), props.clearable !== false && value != null && !props.disabled ? /* @__PURE__ */
|
|
9129
|
+
), props.clearable !== false && value != null && !props.disabled ? /* @__PURE__ */ React55.createElement(
|
|
9032
9130
|
"button",
|
|
9033
9131
|
{
|
|
9034
9132
|
type: "button",
|
|
@@ -9041,8 +9139,8 @@ var TimePicker = React54.forwardRef(function TimePicker2(props, ref) {
|
|
|
9041
9139
|
if (inputRef.current) inputRef.current.focus();
|
|
9042
9140
|
}
|
|
9043
9141
|
},
|
|
9044
|
-
/* @__PURE__ */
|
|
9045
|
-
) : null, /* @__PURE__ */
|
|
9142
|
+
/* @__PURE__ */ React55.createElement(Icon, { name: /* @__PURE__ */ React55.createElement(IconX, null) })
|
|
9143
|
+
) : null, /* @__PURE__ */ React55.createElement(
|
|
9046
9144
|
"button",
|
|
9047
9145
|
{
|
|
9048
9146
|
type: "button",
|
|
@@ -9060,14 +9158,14 @@ var TimePicker = React54.forwardRef(function TimePicker2(props, ref) {
|
|
|
9060
9158
|
}
|
|
9061
9159
|
}
|
|
9062
9160
|
},
|
|
9063
|
-
/* @__PURE__ */
|
|
9161
|
+
/* @__PURE__ */ React55.createElement(Icon, { name: /* @__PURE__ */ React55.createElement(IconChevronDown, null) })
|
|
9064
9162
|
)),
|
|
9065
9163
|
list
|
|
9066
9164
|
);
|
|
9067
9165
|
});
|
|
9068
9166
|
|
|
9069
9167
|
// src/FileUpload.tsx
|
|
9070
|
-
var
|
|
9168
|
+
var React56 = __toESM(require("react"), 1);
|
|
9071
9169
|
function matches(file, accept) {
|
|
9072
9170
|
if (!accept) return true;
|
|
9073
9171
|
const name = (file.name || "").toLowerCase(), type = (file.type || "").toLowerCase();
|
|
@@ -9091,24 +9189,24 @@ function describeAccept(accept, t) {
|
|
|
9091
9189
|
}).join(", ");
|
|
9092
9190
|
}
|
|
9093
9191
|
var seq = 0;
|
|
9094
|
-
var FileUpload =
|
|
9192
|
+
var FileUpload = React56.forwardRef(function FileUpload2(props, ref) {
|
|
9095
9193
|
const t = useStrings();
|
|
9096
9194
|
const auto = uid(), id = props.id || auto;
|
|
9097
9195
|
const st = useMaybeControlled(props.value, props.defaultValue || [], props.onChange);
|
|
9098
9196
|
const items2 = st[0] || [];
|
|
9099
|
-
const dragState =
|
|
9100
|
-
const inputRef =
|
|
9101
|
-
const urls =
|
|
9197
|
+
const dragState = React56.useState(false), over = dragState[0];
|
|
9198
|
+
const inputRef = React56.useRef(null), inputMerged = useMergedRef(ref, inputRef);
|
|
9199
|
+
const urls = React56.useRef({});
|
|
9102
9200
|
const maxFiles = props.multiple ? props.maxFiles : 1;
|
|
9103
9201
|
const note = t.accepts(describeAccept(props.accept, t), props.maxSize ? formatBytes(props.maxSize) : "");
|
|
9104
|
-
|
|
9202
|
+
React56.useEffect(function() {
|
|
9105
9203
|
return function() {
|
|
9106
9204
|
Object.keys(urls.current).forEach(function(k) {
|
|
9107
9205
|
URL.revokeObjectURL(urls.current[k]);
|
|
9108
9206
|
});
|
|
9109
9207
|
};
|
|
9110
9208
|
}, []);
|
|
9111
|
-
|
|
9209
|
+
React56.useEffect(
|
|
9112
9210
|
function() {
|
|
9113
9211
|
const el = inputRef.current;
|
|
9114
9212
|
if (!el || !props.name || typeof DataTransfer === "undefined") return;
|
|
@@ -9168,7 +9266,7 @@ var FileUpload = React55.forwardRef(function FileUpload2(props, ref) {
|
|
|
9168
9266
|
if (inputRef.current) inputRef.current.focus();
|
|
9169
9267
|
}
|
|
9170
9268
|
const error = props.error;
|
|
9171
|
-
return /* @__PURE__ */
|
|
9269
|
+
return /* @__PURE__ */ React56.createElement(
|
|
9172
9270
|
Field,
|
|
9173
9271
|
{
|
|
9174
9272
|
id,
|
|
@@ -9180,7 +9278,7 @@ var FileUpload = React55.forwardRef(function FileUpload2(props, ref) {
|
|
|
9180
9278
|
disabled: props.disabled,
|
|
9181
9279
|
className: props.className
|
|
9182
9280
|
},
|
|
9183
|
-
/* @__PURE__ */
|
|
9281
|
+
/* @__PURE__ */ React56.createElement(
|
|
9184
9282
|
"div",
|
|
9185
9283
|
{
|
|
9186
9284
|
className: cx("aura-upload", over && "is-over", props.disabled && "is-disabled", error && "is-invalid"),
|
|
@@ -9201,9 +9299,9 @@ var FileUpload = React55.forwardRef(function FileUpload2(props, ref) {
|
|
|
9201
9299
|
add(e.dataTransfer && e.dataTransfer.files);
|
|
9202
9300
|
}
|
|
9203
9301
|
},
|
|
9204
|
-
/* @__PURE__ */
|
|
9205
|
-
/* @__PURE__ */
|
|
9206
|
-
/* @__PURE__ */
|
|
9302
|
+
/* @__PURE__ */ React56.createElement(Icon, { name: /* @__PURE__ */ React56.createElement(IconCloudUpload, null), size: "lg", className: "aura-upload__icon" }),
|
|
9303
|
+
/* @__PURE__ */ React56.createElement("span", { className: "aura-upload__text" }, t.dropFiles, " "),
|
|
9304
|
+
/* @__PURE__ */ React56.createElement(
|
|
9207
9305
|
"input",
|
|
9208
9306
|
{
|
|
9209
9307
|
ref: inputMerged,
|
|
@@ -9225,12 +9323,12 @@ var FileUpload = React55.forwardRef(function FileUpload2(props, ref) {
|
|
|
9225
9323
|
}
|
|
9226
9324
|
}
|
|
9227
9325
|
),
|
|
9228
|
-
/* @__PURE__ */
|
|
9229
|
-
note ? /* @__PURE__ */
|
|
9326
|
+
/* @__PURE__ */ React56.createElement("span", { className: "aura-upload__browse", "aria-hidden": true }, props.multiple ? t.browse : t.browseOne),
|
|
9327
|
+
note ? /* @__PURE__ */ React56.createElement("span", { className: "aura-upload__note", id: id + "-note" }, note) : null
|
|
9230
9328
|
),
|
|
9231
|
-
items2.length ? /* @__PURE__ */
|
|
9329
|
+
items2.length ? /* @__PURE__ */ React56.createElement("ul", { className: "aura-upload__list", "aria-live": "polite" }, items2.map(function(it) {
|
|
9232
9330
|
const src = thumb(it);
|
|
9233
|
-
return /* @__PURE__ */
|
|
9331
|
+
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(
|
|
9234
9332
|
"span",
|
|
9235
9333
|
{
|
|
9236
9334
|
className: "aura-upload__bar",
|
|
@@ -9240,11 +9338,11 @@ var FileUpload = React55.forwardRef(function FileUpload2(props, ref) {
|
|
|
9240
9338
|
"aria-valuemax": 100,
|
|
9241
9339
|
"aria-valuenow": it.progress != null ? Math.round(it.progress) : void 0
|
|
9242
9340
|
},
|
|
9243
|
-
/* @__PURE__ */
|
|
9244
|
-
) : null), /* @__PURE__ */
|
|
9341
|
+
/* @__PURE__ */ React56.createElement("span", { style: { width: (it.progress || 0) + "%" } })
|
|
9342
|
+
) : null), /* @__PURE__ */ React56.createElement(
|
|
9245
9343
|
IconButton,
|
|
9246
9344
|
{
|
|
9247
|
-
icon: /* @__PURE__ */
|
|
9345
|
+
icon: /* @__PURE__ */ React56.createElement(IconX, null),
|
|
9248
9346
|
label: t.remove(it.name),
|
|
9249
9347
|
onClick: function() {
|
|
9250
9348
|
remove(it);
|
|
@@ -9560,9 +9658,9 @@ function createTheme(opts) {
|
|
|
9560
9658
|
}
|
|
9561
9659
|
|
|
9562
9660
|
// src/ThemeStyle.tsx
|
|
9563
|
-
var
|
|
9661
|
+
var React57 = __toESM(require("react"), 1);
|
|
9564
9662
|
function ThemeStyle(props) {
|
|
9565
|
-
const css =
|
|
9663
|
+
const css = React57.useMemo(
|
|
9566
9664
|
function() {
|
|
9567
9665
|
try {
|
|
9568
9666
|
return createTheme({
|
|
@@ -9579,11 +9677,11 @@ function ThemeStyle(props) {
|
|
|
9579
9677
|
[props.brand, props.signal, props.primary, props.name, props.selector]
|
|
9580
9678
|
);
|
|
9581
9679
|
if (css === null) return null;
|
|
9582
|
-
return /* @__PURE__ */
|
|
9680
|
+
return /* @__PURE__ */ React57.createElement("style", { "data-aura-theme": props.name || props.brand, dangerouslySetInnerHTML: { __html: css } });
|
|
9583
9681
|
}
|
|
9584
9682
|
|
|
9585
9683
|
// src/colorScheme.tsx
|
|
9586
|
-
var
|
|
9684
|
+
var React58 = __toESM(require("react"), 1);
|
|
9587
9685
|
|
|
9588
9686
|
// src/colorSchemeScript.ts
|
|
9589
9687
|
var DEFAULT_KEY = "aura-color-scheme";
|
|
@@ -9600,7 +9698,7 @@ function colorSchemeScript(options) {
|
|
|
9600
9698
|
|
|
9601
9699
|
// src/colorScheme.tsx
|
|
9602
9700
|
function ColorSchemeScript(props) {
|
|
9603
|
-
return /* @__PURE__ */
|
|
9701
|
+
return /* @__PURE__ */ React58.createElement(
|
|
9604
9702
|
"script",
|
|
9605
9703
|
{
|
|
9606
9704
|
"data-aura-color-scheme": "",
|
|
@@ -9625,7 +9723,7 @@ function apply(scheme) {
|
|
|
9625
9723
|
function useColorScheme(options) {
|
|
9626
9724
|
const key = options && options.storageKey || DEFAULT_KEY;
|
|
9627
9725
|
const fallback = options && options.defaultScheme || "system";
|
|
9628
|
-
const subscribe2 =
|
|
9726
|
+
const subscribe2 = React58.useCallback(
|
|
9629
9727
|
function(cb) {
|
|
9630
9728
|
const mq = window.matchMedia ? window.matchMedia("(prefers-color-scheme: dark)") : null;
|
|
9631
9729
|
function onSystem() {
|
|
@@ -9647,7 +9745,7 @@ function useColorScheme(options) {
|
|
|
9647
9745
|
},
|
|
9648
9746
|
[fallback, key]
|
|
9649
9747
|
);
|
|
9650
|
-
const snapshot =
|
|
9748
|
+
const snapshot = React58.useSyncExternalStore(
|
|
9651
9749
|
subscribe2,
|
|
9652
9750
|
function() {
|
|
9653
9751
|
const s = readScheme(fallback);
|
|
@@ -9658,7 +9756,7 @@ function useColorScheme(options) {
|
|
|
9658
9756
|
}
|
|
9659
9757
|
);
|
|
9660
9758
|
const parts = snapshot.split("|");
|
|
9661
|
-
const setScheme =
|
|
9759
|
+
const setScheme = React58.useCallback(
|
|
9662
9760
|
function(next) {
|
|
9663
9761
|
if (!valid(next)) return;
|
|
9664
9762
|
try {
|
|
@@ -9677,14 +9775,14 @@ function ColorSchemeToggle(props) {
|
|
|
9677
9775
|
const cs = useColorScheme(props);
|
|
9678
9776
|
const names = { light: t.schemeLight, dark: t.schemeDark, system: t.schemeSystem };
|
|
9679
9777
|
const label = props.label || t.colorScheme;
|
|
9680
|
-
return /* @__PURE__ */
|
|
9778
|
+
return /* @__PURE__ */ React58.createElement(
|
|
9681
9779
|
DropdownMenu,
|
|
9682
9780
|
{
|
|
9683
9781
|
label,
|
|
9684
|
-
trigger: /* @__PURE__ */
|
|
9782
|
+
trigger: /* @__PURE__ */ React58.createElement(
|
|
9685
9783
|
IconButton,
|
|
9686
9784
|
{
|
|
9687
|
-
icon: cs.resolved === "dark" ? /* @__PURE__ */
|
|
9785
|
+
icon: cs.resolved === "dark" ? /* @__PURE__ */ React58.createElement(IconMoon, null) : /* @__PURE__ */ React58.createElement(IconSun, null),
|
|
9688
9786
|
label: label + ": " + names[cs.scheme]
|
|
9689
9787
|
}
|
|
9690
9788
|
),
|
|
@@ -9702,14 +9800,14 @@ function ColorSchemeToggle(props) {
|
|
|
9702
9800
|
}
|
|
9703
9801
|
|
|
9704
9802
|
// src/Badge.tsx
|
|
9705
|
-
var
|
|
9706
|
-
var Badge =
|
|
9803
|
+
var React59 = __toESM(require("react"), 1);
|
|
9804
|
+
var Badge = React59.forwardRef(function Badge2(props, ref) {
|
|
9707
9805
|
return badgeElement(props, ref);
|
|
9708
9806
|
});
|
|
9709
9807
|
|
|
9710
9808
|
// src/Progress.tsx
|
|
9711
|
-
var
|
|
9712
|
-
var Progress =
|
|
9809
|
+
var React60 = __toESM(require("react"), 1);
|
|
9810
|
+
var Progress = React60.forwardRef(function Progress2(props, ref) {
|
|
9713
9811
|
const t = useStrings();
|
|
9714
9812
|
const auto = uid(), id = props.id || auto;
|
|
9715
9813
|
const max = props.max || 100, det = props.value != null;
|
|
@@ -9718,7 +9816,7 @@ var Progress = React59.forwardRef(function Progress2(props, ref) {
|
|
|
9718
9816
|
const spct = sec ? Math.max(0, Math.min(100 - pct, sec / max * 100)) : 0;
|
|
9719
9817
|
const valueText = props.valueText != null ? props.valueText : props.valueLabel != null ? String(props.valueLabel) : sec ? t.progressReserved(props.value, sec, max) : void 0;
|
|
9720
9818
|
const shown = props.valueLabel != null ? props.valueLabel : det ? Math.round(pct) + "%" : null;
|
|
9721
|
-
return /* @__PURE__ */
|
|
9819
|
+
return /* @__PURE__ */ React60.createElement(
|
|
9722
9820
|
"div",
|
|
9723
9821
|
{
|
|
9724
9822
|
ref,
|
|
@@ -9729,8 +9827,8 @@ var Progress = React59.forwardRef(function Progress2(props, ref) {
|
|
|
9729
9827
|
props.className
|
|
9730
9828
|
)
|
|
9731
9829
|
},
|
|
9732
|
-
props.label || props.showValue && shown ? /* @__PURE__ */
|
|
9733
|
-
/* @__PURE__ */
|
|
9830
|
+
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,
|
|
9831
|
+
/* @__PURE__ */ React60.createElement(
|
|
9734
9832
|
"div",
|
|
9735
9833
|
{
|
|
9736
9834
|
className: cx("aura-progress__track", !det && "is-indeterminate"),
|
|
@@ -9742,8 +9840,8 @@ var Progress = React59.forwardRef(function Progress2(props, ref) {
|
|
|
9742
9840
|
"aria-valuenow": det ? props.value : void 0,
|
|
9743
9841
|
"aria-valuetext": det ? valueText : void 0
|
|
9744
9842
|
},
|
|
9745
|
-
/* @__PURE__ */
|
|
9746
|
-
sec ? /* @__PURE__ */
|
|
9843
|
+
/* @__PURE__ */ React60.createElement("span", { className: "aura-progress__bar", style: det ? { width: pct + "%" } : void 0 }),
|
|
9844
|
+
sec ? /* @__PURE__ */ React60.createElement(
|
|
9747
9845
|
"span",
|
|
9748
9846
|
{
|
|
9749
9847
|
className: "aura-progress__bar aura-progress__bar--reserved",
|
|
@@ -9751,19 +9849,19 @@ var Progress = React59.forwardRef(function Progress2(props, ref) {
|
|
|
9751
9849
|
}
|
|
9752
9850
|
) : null
|
|
9753
9851
|
),
|
|
9754
|
-
props.hint ? /* @__PURE__ */
|
|
9852
|
+
props.hint ? /* @__PURE__ */ React60.createElement("p", { className: "aura-progress__hint" }, props.hint) : null
|
|
9755
9853
|
);
|
|
9756
9854
|
});
|
|
9757
9855
|
|
|
9758
9856
|
// src/Skeleton.tsx
|
|
9759
|
-
var
|
|
9760
|
-
var Skeleton =
|
|
9857
|
+
var React61 = __toESM(require("react"), 1);
|
|
9858
|
+
var Skeleton = React61.forwardRef(function Skeleton2(props, ref) {
|
|
9761
9859
|
const v = props.variant || "text";
|
|
9762
9860
|
if (v === "text" && (props.lines || 1) > 1) {
|
|
9763
9861
|
const n3 = props.lines, rows = [];
|
|
9764
9862
|
for (let i = 0; i < n3; i++)
|
|
9765
|
-
rows.push(/* @__PURE__ */
|
|
9766
|
-
return /* @__PURE__ */
|
|
9863
|
+
rows.push(/* @__PURE__ */ React61.createElement("span", { key: i, className: "aura-skel aura-skel--text", style: { width: i === n3 - 1 ? "60%" : "100%" } }));
|
|
9864
|
+
return /* @__PURE__ */ React61.createElement(
|
|
9767
9865
|
"span",
|
|
9768
9866
|
{
|
|
9769
9867
|
ref,
|
|
@@ -9781,17 +9879,17 @@ var Skeleton = React60.forwardRef(function Skeleton2(props, ref) {
|
|
|
9781
9879
|
if (v === "circle") {
|
|
9782
9880
|
style.width = style.height = props.size || props.width || 40;
|
|
9783
9881
|
}
|
|
9784
|
-
return /* @__PURE__ */
|
|
9882
|
+
return /* @__PURE__ */ React61.createElement("span", { ref, "aria-hidden": true, className: cx("aura-skel", "aura-skel--" + v, props.className), style });
|
|
9785
9883
|
});
|
|
9786
9884
|
|
|
9787
9885
|
// src/EmptyState.tsx
|
|
9788
|
-
var
|
|
9789
|
-
var EmptyState =
|
|
9886
|
+
var React62 = __toESM(require("react"), 1);
|
|
9887
|
+
var EmptyState = React62.forwardRef(function EmptyState2(props, ref) {
|
|
9790
9888
|
return emptyStateElement(props, ref);
|
|
9791
9889
|
});
|
|
9792
9890
|
|
|
9793
9891
|
// src/Pagination.tsx
|
|
9794
|
-
var
|
|
9892
|
+
var React63 = __toESM(require("react"), 1);
|
|
9795
9893
|
function pageList(page, count, sib) {
|
|
9796
9894
|
let out = [], lo = Math.max(2, page - sib), hi = Math.min(count - 1, page + sib);
|
|
9797
9895
|
if (page - sib <= 3) {
|
|
@@ -9811,7 +9909,7 @@ function pageList(page, count, sib) {
|
|
|
9811
9909
|
if (count > 1) out.push(count);
|
|
9812
9910
|
return out;
|
|
9813
9911
|
}
|
|
9814
|
-
var Pagination =
|
|
9912
|
+
var Pagination = React63.forwardRef(function Pagination2(props, ref) {
|
|
9815
9913
|
const t = useStrings();
|
|
9816
9914
|
useAutoTip();
|
|
9817
9915
|
const count = Math.max(1, props.pageCount || 1);
|
|
@@ -9831,7 +9929,7 @@ var Pagination = React62.forwardRef(function Pagination2(props, ref) {
|
|
|
9831
9929
|
},
|
|
9832
9930
|
extra
|
|
9833
9931
|
);
|
|
9834
|
-
return link ? /* @__PURE__ */
|
|
9932
|
+
return link ? /* @__PURE__ */ React63.createElement(
|
|
9835
9933
|
Link,
|
|
9836
9934
|
{
|
|
9837
9935
|
href: link(p),
|
|
@@ -9844,7 +9942,7 @@ var Pagination = React62.forwardRef(function Pagination2(props, ref) {
|
|
|
9844
9942
|
...common
|
|
9845
9943
|
},
|
|
9846
9944
|
label
|
|
9847
|
-
) : /* @__PURE__ */
|
|
9945
|
+
) : /* @__PURE__ */ React63.createElement(
|
|
9848
9946
|
"button",
|
|
9849
9947
|
{
|
|
9850
9948
|
type: "button",
|
|
@@ -9858,7 +9956,7 @@ var Pagination = React62.forwardRef(function Pagination2(props, ref) {
|
|
|
9858
9956
|
}
|
|
9859
9957
|
function arrow(p, icon, label, rel, disabled) {
|
|
9860
9958
|
if (!link || disabled)
|
|
9861
|
-
return /* @__PURE__ */
|
|
9959
|
+
return /* @__PURE__ */ React63.createElement(
|
|
9862
9960
|
IconButton,
|
|
9863
9961
|
{
|
|
9864
9962
|
icon,
|
|
@@ -9869,7 +9967,7 @@ var Pagination = React62.forwardRef(function Pagination2(props, ref) {
|
|
|
9869
9967
|
}
|
|
9870
9968
|
}
|
|
9871
9969
|
);
|
|
9872
|
-
return /* @__PURE__ */
|
|
9970
|
+
return /* @__PURE__ */ React63.createElement(
|
|
9873
9971
|
Link,
|
|
9874
9972
|
{
|
|
9875
9973
|
href: link(p),
|
|
@@ -9884,17 +9982,17 @@ var Pagination = React62.forwardRef(function Pagination2(props, ref) {
|
|
|
9884
9982
|
}
|
|
9885
9983
|
}
|
|
9886
9984
|
},
|
|
9887
|
-
/* @__PURE__ */
|
|
9985
|
+
/* @__PURE__ */ React63.createElement(Icon, { name: icon, size: "sm" })
|
|
9888
9986
|
);
|
|
9889
9987
|
}
|
|
9890
|
-
return /* @__PURE__ */
|
|
9891
|
-
return typeof p === "number" ? /* @__PURE__ */
|
|
9892
|
-
})), /* @__PURE__ */
|
|
9988
|
+
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) {
|
|
9989
|
+
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");
|
|
9990
|
+
})), /* @__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));
|
|
9893
9991
|
});
|
|
9894
9992
|
|
|
9895
9993
|
// src/Accordion.tsx
|
|
9896
|
-
var
|
|
9897
|
-
var Accordion =
|
|
9994
|
+
var React64 = __toESM(require("react"), 1);
|
|
9995
|
+
var Accordion = React64.forwardRef(function Accordion2(props, ref) {
|
|
9898
9996
|
const auto = uid(), base = props.id || auto;
|
|
9899
9997
|
const multiple = props.type === "multiple";
|
|
9900
9998
|
const st = useMaybeControlled(
|
|
@@ -9932,9 +10030,9 @@ var Accordion = React63.forwardRef(function Accordion2(props, ref) {
|
|
|
9932
10030
|
n3.focus();
|
|
9933
10031
|
}
|
|
9934
10032
|
}
|
|
9935
|
-
return /* @__PURE__ */
|
|
10033
|
+
return /* @__PURE__ */ React64.createElement("div", { ref, className: cx("aura-accordion", props.className), onKeyDown: onKey }, items2.map(function(it) {
|
|
9936
10034
|
const on = open.indexOf(it.id) >= 0, bid = base + "-btn-" + it.id, pid = base + "-panel-" + it.id;
|
|
9937
|
-
return /* @__PURE__ */
|
|
10035
|
+
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(
|
|
9938
10036
|
"button",
|
|
9939
10037
|
{
|
|
9940
10038
|
type: "button",
|
|
@@ -9947,10 +10045,10 @@ var Accordion = React63.forwardRef(function Accordion2(props, ref) {
|
|
|
9947
10045
|
toggle(it.id);
|
|
9948
10046
|
}
|
|
9949
10047
|
},
|
|
9950
|
-
it.icon ? /* @__PURE__ */
|
|
9951
|
-
/* @__PURE__ */
|
|
9952
|
-
/* @__PURE__ */
|
|
9953
|
-
)), /* @__PURE__ */
|
|
10048
|
+
it.icon ? /* @__PURE__ */ React64.createElement(Icon, { name: it.icon, className: "aura-accordion__lead" }) : null,
|
|
10049
|
+
/* @__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),
|
|
10050
|
+
/* @__PURE__ */ React64.createElement(Icon, { name: /* @__PURE__ */ React64.createElement(IconChevronDown, null), className: "aura-accordion__chevron" })
|
|
10051
|
+
)), /* @__PURE__ */ React64.createElement(
|
|
9954
10052
|
"div",
|
|
9955
10053
|
{
|
|
9956
10054
|
id: pid,
|
|
@@ -9965,7 +10063,7 @@ var Accordion = React63.forwardRef(function Accordion2(props, ref) {
|
|
|
9965
10063
|
});
|
|
9966
10064
|
|
|
9967
10065
|
// src/Popover.tsx
|
|
9968
|
-
var
|
|
10066
|
+
var React65 = __toESM(require("react"), 1);
|
|
9969
10067
|
var import_react_dom13 = require("react-dom");
|
|
9970
10068
|
function position(anchor, pop, placement) {
|
|
9971
10069
|
const r2 = anchor.getBoundingClientRect(), pw = pop.offsetWidth, ph = pop.scrollHeight, vw = window.innerWidth, vh = window.innerHeight, gap = 6;
|
|
@@ -9983,15 +10081,15 @@ function position(anchor, pop, placement) {
|
|
|
9983
10081
|
const left = align === "end" ? r2.right - pw : align === "center" ? r2.left + r2.width / 2 - pw / 2 : r2.left;
|
|
9984
10082
|
return { top: Math.max(8, top), left: Math.max(8, Math.min(left, vw - pw - 8)), side, maxHeight };
|
|
9985
10083
|
}
|
|
9986
|
-
var Popover =
|
|
10084
|
+
var Popover = React65.forwardRef(function Popover2(props, ref) {
|
|
9987
10085
|
const t = useStrings();
|
|
9988
10086
|
const density = useDensity();
|
|
9989
10087
|
const auto = uid(), id = props.id || auto;
|
|
9990
10088
|
const st = useMaybeControlled(props.open, !!props.defaultOpen, props.onOpenChange);
|
|
9991
10089
|
const open = !!st[0];
|
|
9992
|
-
const wrap =
|
|
9993
|
-
const pos =
|
|
9994
|
-
const inTree =
|
|
10090
|
+
const wrap = React65.useRef(null), pop = React65.useRef(null), popMerged = useMergedRef(ref, pop);
|
|
10091
|
+
const pos = React65.useState(null), mounted = useMounted();
|
|
10092
|
+
const inTree = React65.useRef(false);
|
|
9995
10093
|
function trigger() {
|
|
9996
10094
|
return wrap.current && (wrap.current.querySelector('button, [role="button"], a, input') || wrap.current.firstElementChild);
|
|
9997
10095
|
}
|
|
@@ -10018,7 +10116,7 @@ var Popover = React64.forwardRef(function Popover2(props, ref) {
|
|
|
10018
10116
|
},
|
|
10019
10117
|
[open, mounted, props.placement]
|
|
10020
10118
|
);
|
|
10021
|
-
|
|
10119
|
+
React65.useEffect(
|
|
10022
10120
|
function() {
|
|
10023
10121
|
if (!open || !mounted) return;
|
|
10024
10122
|
if (props.autoFocus !== false && pop.current) {
|
|
@@ -10043,9 +10141,9 @@ var Popover = React64.forwardRef(function Popover2(props, ref) {
|
|
|
10043
10141
|
},
|
|
10044
10142
|
[open, mounted]
|
|
10045
10143
|
);
|
|
10046
|
-
const child =
|
|
10144
|
+
const child = React65.Children.only(props.trigger);
|
|
10047
10145
|
const panel = open && mounted ? (0, import_react_dom13.createPortal)(
|
|
10048
|
-
/* @__PURE__ */
|
|
10146
|
+
/* @__PURE__ */ React65.createElement(
|
|
10049
10147
|
"div",
|
|
10050
10148
|
{
|
|
10051
10149
|
ref: popMerged,
|
|
@@ -10075,17 +10173,17 @@ var Popover = React64.forwardRef(function Popover2(props, ref) {
|
|
|
10075
10173
|
} else trapTab(e, pop.current);
|
|
10076
10174
|
}
|
|
10077
10175
|
},
|
|
10078
|
-
props.title ? /* @__PURE__ */
|
|
10176
|
+
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(
|
|
10079
10177
|
IconButton,
|
|
10080
10178
|
{
|
|
10081
|
-
icon: /* @__PURE__ */
|
|
10179
|
+
icon: /* @__PURE__ */ React65.createElement(IconX, null),
|
|
10082
10180
|
label: t.close,
|
|
10083
10181
|
onClick: function() {
|
|
10084
10182
|
close(true);
|
|
10085
10183
|
}
|
|
10086
10184
|
}
|
|
10087
10185
|
)) : null,
|
|
10088
|
-
/* @__PURE__ */
|
|
10186
|
+
/* @__PURE__ */ React65.createElement("div", { className: "aura-popover__body" }, typeof props.children === "function" ? props.children({
|
|
10089
10187
|
close: function() {
|
|
10090
10188
|
close(true);
|
|
10091
10189
|
}
|
|
@@ -10093,7 +10191,7 @@ var Popover = React64.forwardRef(function Popover2(props, ref) {
|
|
|
10093
10191
|
),
|
|
10094
10192
|
document.body
|
|
10095
10193
|
) : null;
|
|
10096
|
-
return /* @__PURE__ */
|
|
10194
|
+
return /* @__PURE__ */ React65.createElement("span", { ref: wrap, className: "aura-popover-anchor" }, React65.cloneElement(child, {
|
|
10097
10195
|
onClick: function(e) {
|
|
10098
10196
|
if (child.props.onClick) child.props.onClick(e);
|
|
10099
10197
|
st[1](!open);
|
|
@@ -10105,7 +10203,7 @@ var Popover = React64.forwardRef(function Popover2(props, ref) {
|
|
|
10105
10203
|
});
|
|
10106
10204
|
|
|
10107
10205
|
// src/NumberField.tsx
|
|
10108
|
-
var
|
|
10206
|
+
var React66 = __toESM(require("react"), 1);
|
|
10109
10207
|
function decimalsOf(n3) {
|
|
10110
10208
|
const s = String(n3);
|
|
10111
10209
|
const i = s.indexOf(".");
|
|
@@ -10118,7 +10216,7 @@ function parse(text2) {
|
|
|
10118
10216
|
if (!/^-?(\d+\.?\d*|\.\d+)$/.test(s)) return NaN;
|
|
10119
10217
|
return Number(s);
|
|
10120
10218
|
}
|
|
10121
|
-
var NumberField =
|
|
10219
|
+
var NumberField = React66.forwardRef(function NumberField2(props, ref) {
|
|
10122
10220
|
const t = useStrings();
|
|
10123
10221
|
const auto = uid(), id = props.id || auto;
|
|
10124
10222
|
const step = props.step || 1;
|
|
@@ -10129,7 +10227,7 @@ var NumberField = React65.forwardRef(function NumberField2(props, ref) {
|
|
|
10129
10227
|
props.onChange
|
|
10130
10228
|
);
|
|
10131
10229
|
const value = st[0], setValue = st[1];
|
|
10132
|
-
const draftState =
|
|
10230
|
+
const draftState = React66.useState(null), draft = draftState[0], setDraft = draftState[1];
|
|
10133
10231
|
function fmt2(n3) {
|
|
10134
10232
|
if (n3 == null || isNaN(n3)) return "";
|
|
10135
10233
|
return n3.toLocaleString("en", { minimumFractionDigits: decimals, maximumFractionDigits: decimals });
|
|
@@ -10178,7 +10276,7 @@ var NumberField = React65.forwardRef(function NumberField2(props, ref) {
|
|
|
10178
10276
|
};
|
|
10179
10277
|
const valueText = value == null ? void 0 : [affixText(props.prefix), fmt2(value), affixText(props.suffix)].join(" ").trim();
|
|
10180
10278
|
const stepper = props.stepper !== false && !props.readOnly;
|
|
10181
|
-
return /* @__PURE__ */
|
|
10279
|
+
return /* @__PURE__ */ React66.createElement(
|
|
10182
10280
|
Field,
|
|
10183
10281
|
{
|
|
10184
10282
|
id,
|
|
@@ -10190,7 +10288,7 @@ var NumberField = React65.forwardRef(function NumberField2(props, ref) {
|
|
|
10190
10288
|
disabled: props.disabled,
|
|
10191
10289
|
className: cx(touchClass(props.touchHeight), props.className)
|
|
10192
10290
|
},
|
|
10193
|
-
/* @__PURE__ */
|
|
10291
|
+
/* @__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(
|
|
10194
10292
|
"input",
|
|
10195
10293
|
{
|
|
10196
10294
|
ref,
|
|
@@ -10237,7 +10335,7 @@ var NumberField = React65.forwardRef(function NumberField2(props, ref) {
|
|
|
10237
10335
|
},
|
|
10238
10336
|
onKeyDown
|
|
10239
10337
|
}
|
|
10240
|
-
), props.suffix != null ? /* @__PURE__ */
|
|
10338
|
+
), 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(
|
|
10241
10339
|
"button",
|
|
10242
10340
|
{
|
|
10243
10341
|
type: "button",
|
|
@@ -10253,8 +10351,8 @@ var NumberField = React65.forwardRef(function NumberField2(props, ref) {
|
|
|
10253
10351
|
nudge(-step);
|
|
10254
10352
|
}
|
|
10255
10353
|
},
|
|
10256
|
-
/* @__PURE__ */
|
|
10257
|
-
), /* @__PURE__ */
|
|
10354
|
+
/* @__PURE__ */ React66.createElement(Icon, { name: /* @__PURE__ */ React66.createElement(IconMinus, null) })
|
|
10355
|
+
), /* @__PURE__ */ React66.createElement(
|
|
10258
10356
|
"button",
|
|
10259
10357
|
{
|
|
10260
10358
|
type: "button",
|
|
@@ -10270,14 +10368,14 @@ var NumberField = React65.forwardRef(function NumberField2(props, ref) {
|
|
|
10270
10368
|
nudge(step);
|
|
10271
10369
|
}
|
|
10272
10370
|
},
|
|
10273
|
-
/* @__PURE__ */
|
|
10371
|
+
/* @__PURE__ */ React66.createElement(Icon, { name: /* @__PURE__ */ React66.createElement(IconPlus, null) })
|
|
10274
10372
|
)) : null)
|
|
10275
10373
|
);
|
|
10276
10374
|
});
|
|
10277
10375
|
|
|
10278
10376
|
// src/Stepper.tsx
|
|
10279
|
-
var
|
|
10280
|
-
var Stepper =
|
|
10377
|
+
var React67 = __toESM(require("react"), 1);
|
|
10378
|
+
var Stepper = React67.forwardRef(function Stepper2(props, ref) {
|
|
10281
10379
|
const t = useStrings();
|
|
10282
10380
|
const idBase = uid();
|
|
10283
10381
|
const steps = props.steps || [];
|
|
@@ -10288,22 +10386,22 @@ var Stepper = React66.forwardRef(function Stepper2(props, ref) {
|
|
|
10288
10386
|
if (at < 0) at = 0;
|
|
10289
10387
|
const vertical = props.orientation === "vertical";
|
|
10290
10388
|
const cur2 = steps[at];
|
|
10291
|
-
return /* @__PURE__ */
|
|
10389
|
+
return /* @__PURE__ */ React67.createElement(
|
|
10292
10390
|
"nav",
|
|
10293
10391
|
{
|
|
10294
10392
|
ref,
|
|
10295
10393
|
"aria-label": props.label,
|
|
10296
10394
|
className: cx("aura-stepper", vertical ? "aura-stepper--vertical" : "aura-stepper--horizontal", props.className)
|
|
10297
10395
|
},
|
|
10298
|
-
/* @__PURE__ */
|
|
10396
|
+
/* @__PURE__ */ React67.createElement("ol", { className: "aura-stepper__list" }, steps.map(function(s, i) {
|
|
10299
10397
|
const state = i < at ? "done" : i === at ? "current" : "upcoming";
|
|
10300
10398
|
const error = s.status === "error";
|
|
10301
|
-
const marker = /* @__PURE__ */
|
|
10399
|
+
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);
|
|
10302
10400
|
const note = error ? t.stepError : state === "done" ? t.stepDone : "";
|
|
10303
10401
|
const clickable = state === "done" && !!props.onStepClick;
|
|
10304
10402
|
const named = clickable && (typeof s.label === "string" || typeof s.label === "number") && String(s.label).trim() !== "";
|
|
10305
10403
|
const descId = idBase + "-step-" + i;
|
|
10306
|
-
const text2 = /* @__PURE__ */
|
|
10404
|
+
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(
|
|
10307
10405
|
"span",
|
|
10308
10406
|
{
|
|
10309
10407
|
className: "aura-stepper__desc",
|
|
@@ -10312,14 +10410,14 @@ var Stepper = React66.forwardRef(function Stepper2(props, ref) {
|
|
|
10312
10410
|
},
|
|
10313
10411
|
s.description
|
|
10314
10412
|
) : null);
|
|
10315
|
-
return /* @__PURE__ */
|
|
10413
|
+
return /* @__PURE__ */ React67.createElement(
|
|
10316
10414
|
"li",
|
|
10317
10415
|
{
|
|
10318
10416
|
key: s.id,
|
|
10319
10417
|
className: cx("aura-stepper__item", "is-" + state, error && "is-error"),
|
|
10320
10418
|
"aria-current": state === "current" ? "step" : void 0
|
|
10321
10419
|
},
|
|
10322
|
-
clickable ? /* @__PURE__ */
|
|
10420
|
+
clickable ? /* @__PURE__ */ React67.createElement(
|
|
10323
10421
|
"button",
|
|
10324
10422
|
{
|
|
10325
10423
|
type: "button",
|
|
@@ -10331,19 +10429,19 @@ var Stepper = React66.forwardRef(function Stepper2(props, ref) {
|
|
|
10331
10429
|
},
|
|
10332
10430
|
marker,
|
|
10333
10431
|
text2
|
|
10334
|
-
) : /* @__PURE__ */
|
|
10432
|
+
) : /* @__PURE__ */ React67.createElement("span", { className: "aura-stepper__step" }, marker, text2)
|
|
10335
10433
|
);
|
|
10336
10434
|
})),
|
|
10337
|
-
!vertical && cur2 ? /* @__PURE__ */
|
|
10435
|
+
!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
|
|
10338
10436
|
);
|
|
10339
10437
|
});
|
|
10340
10438
|
|
|
10341
10439
|
// src/SegmentedControl.tsx
|
|
10342
|
-
var
|
|
10440
|
+
var React68 = __toESM(require("react"), 1);
|
|
10343
10441
|
function toOpt2(o) {
|
|
10344
10442
|
return typeof o === "object" ? o : { value: o, label: o };
|
|
10345
10443
|
}
|
|
10346
|
-
var SegmentedControl =
|
|
10444
|
+
var SegmentedControl = React68.forwardRef(
|
|
10347
10445
|
function SegmentedControl2(props, ref) {
|
|
10348
10446
|
const options = (props.options || []).map(toOpt2);
|
|
10349
10447
|
useAutoTip();
|
|
@@ -10357,7 +10455,7 @@ var SegmentedControl = React67.forwardRef(
|
|
|
10357
10455
|
);
|
|
10358
10456
|
const value = st[0], setValue = st[1];
|
|
10359
10457
|
const auto = uid(), id = props.id || auto;
|
|
10360
|
-
const refs =
|
|
10458
|
+
const refs = React68.useRef([]);
|
|
10361
10459
|
const selIdx = options.findIndex(function(o) {
|
|
10362
10460
|
return o.value === value;
|
|
10363
10461
|
});
|
|
@@ -10390,7 +10488,7 @@ var SegmentedControl = React67.forwardRef(
|
|
|
10390
10488
|
move(options.length, -1);
|
|
10391
10489
|
}
|
|
10392
10490
|
}
|
|
10393
|
-
return /* @__PURE__ */
|
|
10491
|
+
return /* @__PURE__ */ React68.createElement(
|
|
10394
10492
|
"div",
|
|
10395
10493
|
{
|
|
10396
10494
|
ref,
|
|
@@ -10410,7 +10508,7 @@ var SegmentedControl = React67.forwardRef(
|
|
|
10410
10508
|
options.map(function(o, i) {
|
|
10411
10509
|
const on = o.value === value;
|
|
10412
10510
|
const off = props.disabled || o.disabled;
|
|
10413
|
-
return /* @__PURE__ */
|
|
10511
|
+
return /* @__PURE__ */ React68.createElement(
|
|
10414
10512
|
"button",
|
|
10415
10513
|
{
|
|
10416
10514
|
key: o.value,
|
|
@@ -10432,8 +10530,8 @@ var SegmentedControl = React67.forwardRef(
|
|
|
10432
10530
|
onKeyDown(e, i);
|
|
10433
10531
|
}
|
|
10434
10532
|
},
|
|
10435
|
-
o.icon ? /* @__PURE__ */
|
|
10436
|
-
o.iconOnly ? null : /* @__PURE__ */
|
|
10533
|
+
o.icon ? /* @__PURE__ */ React68.createElement(Icon, { name: o.icon }) : null,
|
|
10534
|
+
o.iconOnly ? null : /* @__PURE__ */ React68.createElement("span", null, o.label)
|
|
10437
10535
|
);
|
|
10438
10536
|
})
|
|
10439
10537
|
);
|