@jirawatpyk/aura-react 5.43.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 +25 -0
- package/dist/aura.bundle.js +295 -226
- package/dist/cjs/index.cjs +295 -226
- package/dist/esm/IconButton.js +2 -1
- 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 +16 -0
- package/dist/index.d.ts +16 -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 +55 -1
- package/dist/styles.layer.css +55 -1
- 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,
|
|
@@ -1565,7 +1565,7 @@ function useAutoTip() {
|
|
|
1565
1565
|
|
|
1566
1566
|
// src/IconButton.tsx
|
|
1567
1567
|
var IconButton = React8.forwardRef(function IconButton2(props, ref) {
|
|
1568
|
-
const rest = omit(props, ["icon", "label", "className", "size", "tone", "touchHeight"]);
|
|
1568
|
+
const rest = omit(props, ["icon", "label", "className", "size", "tone", "touchHeight", "variant"]);
|
|
1569
1569
|
useAutoTip();
|
|
1570
1570
|
const own = props.title !== void 0;
|
|
1571
1571
|
return /* @__PURE__ */ React8.createElement(
|
|
@@ -1579,6 +1579,7 @@ var IconButton = React8.forwardRef(function IconButton2(props, ref) {
|
|
|
1579
1579
|
className: cx(
|
|
1580
1580
|
"aura-icon-btn",
|
|
1581
1581
|
props.tone === "danger" && "aura-icon-btn--danger",
|
|
1582
|
+
props.variant === "outline" && "aura-icon-btn--outline",
|
|
1582
1583
|
props.touchHeight && "aura-icon-btn--touch",
|
|
1583
1584
|
props.className
|
|
1584
1585
|
)
|
|
@@ -6834,8 +6835,8 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6834
6835
|
}
|
|
6835
6836
|
);
|
|
6836
6837
|
};
|
|
6837
|
-
const
|
|
6838
|
-
for (let b = 0; b < lines; b++)
|
|
6838
|
+
const bars2 = [];
|
|
6839
|
+
for (let b = 0; b < lines; b++) bars2.push(bar(b));
|
|
6839
6840
|
sk.push(
|
|
6840
6841
|
/* @__PURE__ */ React33.createElement(
|
|
6841
6842
|
"span",
|
|
@@ -6859,7 +6860,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6859
6860
|
c.skeletonTouch && "is-touch"
|
|
6860
6861
|
)
|
|
6861
6862
|
}
|
|
6862
|
-
) : lines > 1 ? /* @__PURE__ */ React33.createElement("span", { className: "aura-skel-lines" },
|
|
6863
|
+
) : lines > 1 ? /* @__PURE__ */ React33.createElement("span", { className: "aura-skel-lines" }, bars2) : bars2[0]
|
|
6863
6864
|
)
|
|
6864
6865
|
);
|
|
6865
6866
|
});
|
|
@@ -7801,6 +7802,9 @@ var Container = React42.forwardRef(function Container2(props, ref) {
|
|
|
7801
7802
|
);
|
|
7802
7803
|
});
|
|
7803
7804
|
|
|
7805
|
+
// src/PageHeaderClient.tsx
|
|
7806
|
+
var React44 = __toESM(require("react"), 1);
|
|
7807
|
+
|
|
7804
7808
|
// src/PageHeader.tsx
|
|
7805
7809
|
var React43 = __toESM(require("react"), 1);
|
|
7806
7810
|
var h8 = React43.createElement;
|
|
@@ -7814,6 +7818,8 @@ var PageHeader = React43.forwardRef(function PageHeader2(props, ref) {
|
|
|
7814
7818
|
const below2 = props.actionsFullWidthBelow;
|
|
7815
7819
|
const hide2 = props.titleHideBelow;
|
|
7816
7820
|
const hasMeta = props.meta != null && props.meta !== false;
|
|
7821
|
+
const hasActions = props.actions != null && props.actions !== false;
|
|
7822
|
+
const bar = hasActions && (props.actionsBarBelow === "sm" || props.actionsBarBelow === "md") ? props.actionsBarBelow : null;
|
|
7817
7823
|
return h8(
|
|
7818
7824
|
"div",
|
|
7819
7825
|
Object.assign(attrs2, {
|
|
@@ -7823,6 +7829,7 @@ var PageHeader = React43.forwardRef(function PageHeader2(props, ref) {
|
|
|
7823
7829
|
(below2 === "sm" || below2 === "md" || below2 === "lg") && "aura-page-header--actions-full-below-" + below2,
|
|
7824
7830
|
(hide2 === "sm" || hide2 === "md" || hide2 === "lg") && "aura-page-header--title-hide-below-" + hide2,
|
|
7825
7831
|
(hide2 === "sm" || hide2 === "md" || hide2 === "lg") && !hasMeta && "has-no-meta",
|
|
7832
|
+
bar && "aura-page-header--actions-bar-below-" + bar,
|
|
7826
7833
|
props.className
|
|
7827
7834
|
),
|
|
7828
7835
|
style: props.style
|
|
@@ -7835,16 +7842,78 @@ var PageHeader = React43.forwardRef(function PageHeader2(props, ref) {
|
|
|
7835
7842
|
h8("h" + level, { className: "aura-page-header__title", id: props.titleId }, props.title),
|
|
7836
7843
|
props.meta != null && props.meta !== false ? h8("div", { className: "aura-page-header__meta" }, props.meta) : null
|
|
7837
7844
|
),
|
|
7838
|
-
props.actions != null && props.actions !== false ? h8(
|
|
7845
|
+
props.actions != null && props.actions !== false ? h8(
|
|
7846
|
+
"div",
|
|
7847
|
+
{ className: "aura-page-header__actions" },
|
|
7848
|
+
bar && props.actionsStatus != null && props.actionsStatus !== false ? h8("div", { className: "aura-page-header__status", role: "status" }, props.actionsStatus) : null,
|
|
7849
|
+
props.actions
|
|
7850
|
+
) : null
|
|
7851
|
+
);
|
|
7852
|
+
});
|
|
7853
|
+
|
|
7854
|
+
// src/PageHeaderClient.tsx
|
|
7855
|
+
var NAME = "--aura-page-actions-height";
|
|
7856
|
+
var bars = [];
|
|
7857
|
+
function trapped(el) {
|
|
7858
|
+
for (let p = el.parentElement; p && p !== document.documentElement; p = p.parentElement) {
|
|
7859
|
+
const s = getComputedStyle(p);
|
|
7860
|
+
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))
|
|
7861
|
+
return true;
|
|
7862
|
+
}
|
|
7863
|
+
return false;
|
|
7864
|
+
}
|
|
7865
|
+
var PageHeader3 = React44.forwardRef(function PageHeader4(props, ref) {
|
|
7866
|
+
const own = React44.useRef(null);
|
|
7867
|
+
const merged = useMergedRef(ref, own);
|
|
7868
|
+
const bar = props.actionsBarBelow;
|
|
7869
|
+
const hasActions = props.actions != null && props.actions !== false;
|
|
7870
|
+
React44.useEffect(
|
|
7871
|
+
function() {
|
|
7872
|
+
if (bar !== "sm" && bar !== "md" || !hasActions || !own.current) return;
|
|
7873
|
+
const el = own.current.querySelector(":scope > .aura-page-header__actions");
|
|
7874
|
+
if (!el) return;
|
|
7875
|
+
const root = document.documentElement;
|
|
7876
|
+
let checked = false;
|
|
7877
|
+
function sync() {
|
|
7878
|
+
if (bars[bars.length - 1] !== sync) return;
|
|
7879
|
+
if (getComputedStyle(el).position === "fixed") {
|
|
7880
|
+
root.style.setProperty(NAME, el.offsetHeight + "px");
|
|
7881
|
+
if (!checked && (checked = true, trapped(el)))
|
|
7882
|
+
devWarnOnce(
|
|
7883
|
+
"pageheader-bar-trapped",
|
|
7884
|
+
"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."
|
|
7885
|
+
);
|
|
7886
|
+
} else root.style.removeProperty(NAME);
|
|
7887
|
+
}
|
|
7888
|
+
if (bars.length)
|
|
7889
|
+
devWarnOnce(
|
|
7890
|
+
"pageheader-bar-twice",
|
|
7891
|
+
"PageHeader actionsBarBelow: two bars on one page overlap at the bottom of the screen. Give it to one PageHeader per page."
|
|
7892
|
+
);
|
|
7893
|
+
bars.push(sync);
|
|
7894
|
+
const ro = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(sync);
|
|
7895
|
+
if (ro) ro.observe(el);
|
|
7896
|
+
window.addEventListener("resize", sync);
|
|
7897
|
+
sync();
|
|
7898
|
+
return function() {
|
|
7899
|
+
if (ro) ro.disconnect();
|
|
7900
|
+
window.removeEventListener("resize", sync);
|
|
7901
|
+
bars.splice(bars.indexOf(sync), 1);
|
|
7902
|
+
if (bars.length) bars[bars.length - 1]();
|
|
7903
|
+
else root.style.removeProperty(NAME);
|
|
7904
|
+
};
|
|
7905
|
+
},
|
|
7906
|
+
[bar, hasActions]
|
|
7839
7907
|
);
|
|
7908
|
+
return /* @__PURE__ */ React44.createElement(PageHeader, { ...props, ref: merged });
|
|
7840
7909
|
});
|
|
7841
7910
|
|
|
7842
7911
|
// src/StatusTile.tsx
|
|
7843
|
-
var
|
|
7912
|
+
var React46 = __toESM(require("react"), 1);
|
|
7844
7913
|
|
|
7845
7914
|
// src/tiles.tsx
|
|
7846
|
-
var
|
|
7847
|
-
var h9 =
|
|
7915
|
+
var React45 = __toESM(require("react"), 1);
|
|
7916
|
+
var h9 = React45.createElement;
|
|
7848
7917
|
var STATUS_ICON = {
|
|
7849
7918
|
down: IconCircleAlert,
|
|
7850
7919
|
problem: IconTriangleAlert,
|
|
@@ -7936,7 +8005,7 @@ function statusTileElement(props, ref, Link, t, titleRef) {
|
|
|
7936
8005
|
) : null
|
|
7937
8006
|
);
|
|
7938
8007
|
}
|
|
7939
|
-
var TileGrid =
|
|
8008
|
+
var TileGrid = React45.forwardRef(function TileGrid2(props, ref) {
|
|
7940
8009
|
const style = Object.assign(
|
|
7941
8010
|
{},
|
|
7942
8011
|
respVars("aura-grid-cols", props.columns == null ? { base: 2, md: 3 } : props.columns),
|
|
@@ -7952,16 +8021,16 @@ var TileGrid = React44.forwardRef(function TileGrid2(props, ref) {
|
|
|
7952
8021
|
}),
|
|
7953
8022
|
/* toArray drops null and booleans and keys each element; a Fragment's children are items too. */
|
|
7954
8023
|
flat(props.children).map(function(c, i) {
|
|
7955
|
-
return h9("li", { key:
|
|
8024
|
+
return h9("li", { key: React45.isValidElement(c) && c.key != null ? c.key : i }, c);
|
|
7956
8025
|
})
|
|
7957
8026
|
);
|
|
7958
8027
|
});
|
|
7959
8028
|
function flat(children) {
|
|
7960
8029
|
const out = [];
|
|
7961
|
-
|
|
7962
|
-
if (
|
|
8030
|
+
React45.Children.toArray(children).forEach(function(c) {
|
|
8031
|
+
if (React45.isValidElement(c) && c.type === React45.Fragment)
|
|
7963
8032
|
flat(c.props.children).forEach(function(x) {
|
|
7964
|
-
out.push(
|
|
8033
|
+
out.push(React45.isValidElement(x) ? React45.cloneElement(x, { key: String(c.key) + "/" + String(x.key) }) : x);
|
|
7965
8034
|
});
|
|
7966
8035
|
else if (c !== "") out.push(c);
|
|
7967
8036
|
});
|
|
@@ -7975,7 +8044,7 @@ function r(n3) {
|
|
|
7975
8044
|
function num(v) {
|
|
7976
8045
|
return typeof v === "number" && isFinite(v) ? v : null;
|
|
7977
8046
|
}
|
|
7978
|
-
var Sparkline =
|
|
8047
|
+
var Sparkline = React45.forwardRef(function Sparkline2(props, ref) {
|
|
7979
8048
|
const wh = SIZES2[props.size || "sm"] || SIZES2.sm;
|
|
7980
8049
|
const W = wh[0], H = wh[1];
|
|
7981
8050
|
const data = (props.data || []).map(num);
|
|
@@ -8049,8 +8118,8 @@ var Sparkline = React44.forwardRef(function Sparkline2(props, ref) {
|
|
|
8049
8118
|
});
|
|
8050
8119
|
|
|
8051
8120
|
// src/StatusTile.tsx
|
|
8052
|
-
var useIsoLayoutEffect2 = typeof window !== "undefined" ?
|
|
8053
|
-
var StatusTile =
|
|
8121
|
+
var useIsoLayoutEffect2 = typeof window !== "undefined" ? React46.useLayoutEffect : React46.useEffect;
|
|
8122
|
+
var StatusTile = React46.forwardRef(function StatusTile2(props, ref) {
|
|
8054
8123
|
const Link = useLinkComponent(props.linkComponent);
|
|
8055
8124
|
const t = useStrings();
|
|
8056
8125
|
useAutoTip();
|
|
@@ -8059,8 +8128,8 @@ var StatusTile = React45.forwardRef(function StatusTile2(props, ref) {
|
|
|
8059
8128
|
"status-tile-label",
|
|
8060
8129
|
"StatusTile `aria-label` needs `href`: without a link the tile is a plain box, where a name is not allowed."
|
|
8061
8130
|
);
|
|
8062
|
-
const titleRef =
|
|
8063
|
-
const check =
|
|
8131
|
+
const titleRef = React46.useRef(null);
|
|
8132
|
+
const check = React46.useCallback(function() {
|
|
8064
8133
|
const el = titleRef.current;
|
|
8065
8134
|
if (!el) return;
|
|
8066
8135
|
const cut = el.scrollHeight > el.clientHeight + 1;
|
|
@@ -8070,7 +8139,7 @@ var StatusTile = React45.forwardRef(function StatusTile2(props, ref) {
|
|
|
8070
8139
|
}, []);
|
|
8071
8140
|
useIsoLayoutEffect2(check, [props.title, check]);
|
|
8072
8141
|
const linked = !!props.href;
|
|
8073
|
-
|
|
8142
|
+
React46.useEffect(
|
|
8074
8143
|
function() {
|
|
8075
8144
|
const el = titleRef.current;
|
|
8076
8145
|
if (!el) return;
|
|
@@ -8095,14 +8164,14 @@ var StatusTile = React45.forwardRef(function StatusTile2(props, ref) {
|
|
|
8095
8164
|
});
|
|
8096
8165
|
|
|
8097
8166
|
// src/AppShell.tsx
|
|
8098
|
-
var
|
|
8167
|
+
var React48 = __toESM(require("react"), 1);
|
|
8099
8168
|
|
|
8100
8169
|
// src/scrollHide.ts
|
|
8101
|
-
var
|
|
8170
|
+
var React47 = __toESM(require("react"), 1);
|
|
8102
8171
|
var STEP = 8;
|
|
8103
8172
|
function useHideOnScroll(enabled, el, media, from) {
|
|
8104
|
-
const st =
|
|
8105
|
-
|
|
8173
|
+
const st = React47.useState(false), hidden = st[0], setHidden = st[1];
|
|
8174
|
+
React47.useEffect(
|
|
8106
8175
|
function() {
|
|
8107
8176
|
if (!enabled || typeof window === "undefined") {
|
|
8108
8177
|
setHidden(false);
|
|
@@ -8192,31 +8261,31 @@ function useHideOnScroll(enabled, el, media, from) {
|
|
|
8192
8261
|
}
|
|
8193
8262
|
|
|
8194
8263
|
// src/AppShell.tsx
|
|
8195
|
-
var AppShell =
|
|
8264
|
+
var AppShell = React48.forwardRef(function AppShell2(props, ref) {
|
|
8196
8265
|
const t = useStrings();
|
|
8197
8266
|
const bp = useBreakpoint();
|
|
8198
8267
|
const wide = bp === "lg" || bp === "xl";
|
|
8199
|
-
const st =
|
|
8200
|
-
|
|
8268
|
+
const st = React48.useState(false), open = st[0], setOpen = st[1];
|
|
8269
|
+
React48.useEffect(
|
|
8201
8270
|
function() {
|
|
8202
8271
|
if (wide) setOpen(false);
|
|
8203
8272
|
},
|
|
8204
8273
|
[wide]
|
|
8205
8274
|
);
|
|
8206
|
-
const navEl = props.nav &&
|
|
8275
|
+
const navEl = props.nav && React48.isValidElement(props.nav) ? props.nav : null;
|
|
8207
8276
|
const shared = !!navEl && navEl.props.value === void 0 && (navEl.props.defaultValue !== void 0 || navEl.props.sections !== void 0 || navEl.props.items !== void 0);
|
|
8208
|
-
const navState =
|
|
8277
|
+
const navState = React48.useState(navEl ? navEl.props.defaultValue : void 0);
|
|
8209
8278
|
function onNav(id) {
|
|
8210
8279
|
if (shared) navState[1](id);
|
|
8211
8280
|
if (navEl && navEl.props.onChange) navEl.props.onChange(id);
|
|
8212
8281
|
}
|
|
8213
|
-
const rootRef =
|
|
8214
|
-
const barRef =
|
|
8282
|
+
const rootRef = React48.useRef(null);
|
|
8283
|
+
const barRef = React48.useRef(null);
|
|
8215
8284
|
const mergedRef = useMergedRef(ref, rootRef);
|
|
8216
8285
|
const hasBar = !!(props.header || props.nav);
|
|
8217
|
-
const barH =
|
|
8286
|
+
const barH = React48.useState(null);
|
|
8218
8287
|
const away = useHideOnScroll(!!props.headerHideOnScroll && hasBar, barRef, "(max-width: 1023.98px)", barH[0] || 56);
|
|
8219
|
-
const awayRef =
|
|
8288
|
+
const awayRef = React48.useRef(away);
|
|
8220
8289
|
awayRef.current = away;
|
|
8221
8290
|
useIsoLayoutEffect(
|
|
8222
8291
|
function() {
|
|
@@ -8245,8 +8314,8 @@ var AppShell = React47.forwardRef(function AppShell2(props, ref) {
|
|
|
8245
8314
|
},
|
|
8246
8315
|
[hasBar]
|
|
8247
8316
|
);
|
|
8248
|
-
const deskNav = navEl && shared ?
|
|
8249
|
-
const drawerNav = navEl ?
|
|
8317
|
+
const deskNav = navEl && shared ? React48.cloneElement(navEl, { value: navState[0], onChange: onNav }) : props.nav;
|
|
8318
|
+
const drawerNav = navEl ? React48.cloneElement(navEl, {
|
|
8250
8319
|
value: shared ? navState[0] : navEl.props.value,
|
|
8251
8320
|
onChange: function(id) {
|
|
8252
8321
|
onNav(id);
|
|
@@ -8261,7 +8330,7 @@ var AppShell = React47.forwardRef(function AppShell2(props, ref) {
|
|
|
8261
8330
|
collapsed: false,
|
|
8262
8331
|
collapsible: false
|
|
8263
8332
|
}) : props.nav;
|
|
8264
|
-
return /* @__PURE__ */
|
|
8333
|
+
return /* @__PURE__ */ React48.createElement(
|
|
8265
8334
|
"div",
|
|
8266
8335
|
{
|
|
8267
8336
|
ref: mergedRef,
|
|
@@ -8276,8 +8345,8 @@ var AppShell = React47.forwardRef(function AppShell2(props, ref) {
|
|
|
8276
8345
|
props.className
|
|
8277
8346
|
)
|
|
8278
8347
|
},
|
|
8279
|
-
props.nav ? /* @__PURE__ */
|
|
8280
|
-
props.nav ? /* @__PURE__ */
|
|
8348
|
+
props.nav ? /* @__PURE__ */ React48.createElement("div", { className: "aura-shell__nav" }, deskNav) : null,
|
|
8349
|
+
props.nav ? /* @__PURE__ */ React48.createElement(
|
|
8281
8350
|
Drawer,
|
|
8282
8351
|
{
|
|
8283
8352
|
open,
|
|
@@ -8294,7 +8363,7 @@ var AppShell = React47.forwardRef(function AppShell2(props, ref) {
|
|
|
8294
8363
|
},
|
|
8295
8364
|
drawerNav
|
|
8296
8365
|
) : null,
|
|
8297
|
-
/* @__PURE__ */
|
|
8366
|
+
/* @__PURE__ */ React48.createElement("div", { className: "aura-shell__main" }, props.header || props.nav ? /* @__PURE__ */ React48.createElement(
|
|
8298
8367
|
"header",
|
|
8299
8368
|
{
|
|
8300
8369
|
ref: barRef,
|
|
@@ -8306,11 +8375,11 @@ var AppShell = React47.forwardRef(function AppShell2(props, ref) {
|
|
|
8306
8375
|
away && "is-away"
|
|
8307
8376
|
)
|
|
8308
8377
|
},
|
|
8309
|
-
props.nav ? /* @__PURE__ */
|
|
8378
|
+
props.nav ? /* @__PURE__ */ React48.createElement(
|
|
8310
8379
|
IconButton,
|
|
8311
8380
|
{
|
|
8312
8381
|
className: "aura-shell__menu",
|
|
8313
|
-
icon: /* @__PURE__ */
|
|
8382
|
+
icon: /* @__PURE__ */ React48.createElement(IconMenu, null),
|
|
8314
8383
|
label: props.menuLabel || t.openNav,
|
|
8315
8384
|
size: "md",
|
|
8316
8385
|
onClick: function() {
|
|
@@ -8319,8 +8388,8 @@ var AppShell = React47.forwardRef(function AppShell2(props, ref) {
|
|
|
8319
8388
|
"aria-expanded": open
|
|
8320
8389
|
}
|
|
8321
8390
|
) : null,
|
|
8322
|
-
/* @__PURE__ */
|
|
8323
|
-
) : null, /* @__PURE__ */
|
|
8391
|
+
/* @__PURE__ */ React48.createElement("div", { className: "aura-shell__bar-content" }, props.header)
|
|
8392
|
+
) : null, /* @__PURE__ */ React48.createElement(
|
|
8324
8393
|
"main",
|
|
8325
8394
|
{
|
|
8326
8395
|
className: cx("aura-shell__content", props.contentPadding === false && "is-flush"),
|
|
@@ -8333,17 +8402,17 @@ var AppShell = React47.forwardRef(function AppShell2(props, ref) {
|
|
|
8333
8402
|
});
|
|
8334
8403
|
|
|
8335
8404
|
// src/ActionBar.tsx
|
|
8336
|
-
var
|
|
8337
|
-
var ActionBar =
|
|
8405
|
+
var React49 = __toESM(require("react"), 1);
|
|
8406
|
+
var ActionBar = React49.forwardRef(function ActionBar2(props, ref) {
|
|
8338
8407
|
const t = useStrings();
|
|
8339
8408
|
const bulk = props.selected != null;
|
|
8340
8409
|
const idle = bulk && !props.selected;
|
|
8341
8410
|
const count = bulk && props.selected ? t.selectedCount(props.selected) : null;
|
|
8342
|
-
const hasStart =
|
|
8411
|
+
const hasStart = React49.Children.toArray(props.start).some(function(c) {
|
|
8343
8412
|
return c !== "";
|
|
8344
8413
|
});
|
|
8345
|
-
const cameFrom =
|
|
8346
|
-
const own =
|
|
8414
|
+
const cameFrom = React49.useRef(null);
|
|
8415
|
+
const own = React49.useRef(null);
|
|
8347
8416
|
function clear() {
|
|
8348
8417
|
props.onClearSelection();
|
|
8349
8418
|
setTimeout(function() {
|
|
@@ -8352,7 +8421,7 @@ var ActionBar = React48.forwardRef(function ActionBar2(props, ref) {
|
|
|
8352
8421
|
if ((!a || a === document.body || !a.isConnected) && back && back.isConnected) back.focus();
|
|
8353
8422
|
}, 0);
|
|
8354
8423
|
}
|
|
8355
|
-
return /* @__PURE__ */
|
|
8424
|
+
return /* @__PURE__ */ React49.createElement(
|
|
8356
8425
|
"div",
|
|
8357
8426
|
{
|
|
8358
8427
|
ref: function(el) {
|
|
@@ -8374,16 +8443,16 @@ var ActionBar = React48.forwardRef(function ActionBar2(props, ref) {
|
|
|
8374
8443
|
props.className
|
|
8375
8444
|
)
|
|
8376
8445
|
},
|
|
8377
|
-
/* @__PURE__ */
|
|
8446
|
+
/* @__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)
|
|
8378
8447
|
);
|
|
8379
8448
|
});
|
|
8380
8449
|
|
|
8381
8450
|
// src/Separator.tsx
|
|
8382
|
-
var
|
|
8383
|
-
var Separator =
|
|
8451
|
+
var React50 = __toESM(require("react"), 1);
|
|
8452
|
+
var Separator = React50.forwardRef(function Separator2(props, ref) {
|
|
8384
8453
|
const vertical = props.orientation === "vertical";
|
|
8385
8454
|
const decorative = props.decorative !== false;
|
|
8386
|
-
return /* @__PURE__ */
|
|
8455
|
+
return /* @__PURE__ */ React50.createElement(
|
|
8387
8456
|
"div",
|
|
8388
8457
|
{
|
|
8389
8458
|
ref,
|
|
@@ -8396,13 +8465,13 @@ var Separator = React49.forwardRef(function Separator2(props, ref) {
|
|
|
8396
8465
|
});
|
|
8397
8466
|
|
|
8398
8467
|
// src/Table.tsx
|
|
8399
|
-
var
|
|
8400
|
-
var StackLabels =
|
|
8401
|
-
var ColumnIndex =
|
|
8468
|
+
var React51 = __toESM(require("react"), 1);
|
|
8469
|
+
var StackLabels = React51.createContext(null);
|
|
8470
|
+
var ColumnIndex = React51.createContext(-1);
|
|
8402
8471
|
function flat2(children) {
|
|
8403
8472
|
const out = [];
|
|
8404
|
-
|
|
8405
|
-
if (
|
|
8473
|
+
React51.Children.toArray(children).forEach(function(c) {
|
|
8474
|
+
if (React51.isValidElement(c) && c.type === React51.Fragment)
|
|
8406
8475
|
out.push.apply(out, flat2(c.props.children));
|
|
8407
8476
|
else out.push(c);
|
|
8408
8477
|
});
|
|
@@ -8416,7 +8485,7 @@ function text(node) {
|
|
|
8416
8485
|
});
|
|
8417
8486
|
return parts.length ? parts.join("") : void 0;
|
|
8418
8487
|
}
|
|
8419
|
-
if (
|
|
8488
|
+
if (React51.isValidElement(node)) {
|
|
8420
8489
|
const p = node.props;
|
|
8421
8490
|
if (p["aria-hidden"] === true || p["aria-hidden"] === "true") return void 0;
|
|
8422
8491
|
return text(p.children);
|
|
@@ -8426,13 +8495,13 @@ function text(node) {
|
|
|
8426
8495
|
function headerLabels(children) {
|
|
8427
8496
|
let out = [];
|
|
8428
8497
|
flat2(children).forEach(function(c) {
|
|
8429
|
-
if (out.length || !
|
|
8498
|
+
if (out.length || !React51.isValidElement(c) || c.type !== THead) return;
|
|
8430
8499
|
const row = flat2(c.props.children).find(function(r2) {
|
|
8431
|
-
return
|
|
8500
|
+
return React51.isValidElement(r2);
|
|
8432
8501
|
});
|
|
8433
8502
|
if (!row) return;
|
|
8434
8503
|
flat2(row.props.children).forEach(function(cell) {
|
|
8435
|
-
if (!
|
|
8504
|
+
if (!React51.isValidElement(cell)) return;
|
|
8436
8505
|
const p = cell.props;
|
|
8437
8506
|
const t = text(p.children);
|
|
8438
8507
|
const label = p.label != null ? p.label : t != null ? t.replace(/\s+/g, " ").trim() || void 0 : void 0;
|
|
@@ -8442,7 +8511,7 @@ function headerLabels(children) {
|
|
|
8442
8511
|
});
|
|
8443
8512
|
return out;
|
|
8444
8513
|
}
|
|
8445
|
-
var Table =
|
|
8514
|
+
var Table = React51.forwardRef(function Table2(props, ref) {
|
|
8446
8515
|
const {
|
|
8447
8516
|
caption,
|
|
8448
8517
|
captionHidden,
|
|
@@ -8472,12 +8541,12 @@ var Table = React50.forwardRef(function Table2(props, ref) {
|
|
|
8472
8541
|
"tbl-stack-labels",
|
|
8473
8542
|
"Table stackBelow: no THead > Tr > Th found among its children, so cells have no labels. Pass `label` on each Td."
|
|
8474
8543
|
);
|
|
8475
|
-
const outer =
|
|
8544
|
+
const outer = React51.useContext(StackLabels);
|
|
8476
8545
|
const pageDensity = useDensity();
|
|
8477
8546
|
const capId = uid();
|
|
8478
|
-
const wrap =
|
|
8479
|
-
const sc =
|
|
8480
|
-
const wide =
|
|
8547
|
+
const wrap = React51.useRef(null);
|
|
8548
|
+
const sc = React51.useState(false), scrolls = sc[0];
|
|
8549
|
+
const wide = React51.useState(false);
|
|
8481
8550
|
useIsoLayoutEffect(function() {
|
|
8482
8551
|
const el = wrap.current;
|
|
8483
8552
|
if (!el || typeof ResizeObserver === "undefined") return;
|
|
@@ -8494,7 +8563,7 @@ var Table = React50.forwardRef(function Table2(props, ref) {
|
|
|
8494
8563
|
ro.disconnect();
|
|
8495
8564
|
};
|
|
8496
8565
|
}, []);
|
|
8497
|
-
const table = /* @__PURE__ */
|
|
8566
|
+
const table = /* @__PURE__ */ React51.createElement(
|
|
8498
8567
|
"div",
|
|
8499
8568
|
{
|
|
8500
8569
|
ref: wrap,
|
|
@@ -8518,7 +8587,7 @@ var Table = React50.forwardRef(function Table2(props, ref) {
|
|
|
8518
8587
|
"aria-labelledby": scrolls ? caption != null ? capId : rest["aria-labelledby"] : void 0,
|
|
8519
8588
|
"aria-label": scrolls && caption == null ? rest["aria-label"] : void 0
|
|
8520
8589
|
},
|
|
8521
|
-
/* @__PURE__ */
|
|
8590
|
+
/* @__PURE__ */ React51.createElement(
|
|
8522
8591
|
"table",
|
|
8523
8592
|
{
|
|
8524
8593
|
ref,
|
|
@@ -8534,11 +8603,11 @@ var Table = React50.forwardRef(function Table2(props, ref) {
|
|
|
8534
8603
|
role: stackBelow ? "table" : void 0,
|
|
8535
8604
|
...rest
|
|
8536
8605
|
},
|
|
8537
|
-
caption != null ? /* @__PURE__ */
|
|
8538
|
-
labels ? /* @__PURE__ */
|
|
8606
|
+
caption != null ? /* @__PURE__ */ React51.createElement("caption", { id: capId, className: cx("aura-tbl__caption", captionHidden && "aura-sr-only") }, caption) : null,
|
|
8607
|
+
labels ? /* @__PURE__ */ React51.createElement(StackLabels.Provider, { value: labels }, children) : outer ? /* @__PURE__ */ React51.createElement(StackLabels.Provider, { value: null }, children) : children
|
|
8539
8608
|
)
|
|
8540
8609
|
);
|
|
8541
|
-
return cards ? /* @__PURE__ */
|
|
8610
|
+
return cards ? /* @__PURE__ */ React51.createElement(
|
|
8542
8611
|
"div",
|
|
8543
8612
|
{
|
|
8544
8613
|
className: cx(
|
|
@@ -8551,10 +8620,10 @@ var Table = React50.forwardRef(function Table2(props, ref) {
|
|
|
8551
8620
|
) : table;
|
|
8552
8621
|
});
|
|
8553
8622
|
function section(tag, cls) {
|
|
8554
|
-
const C =
|
|
8623
|
+
const C = React51.forwardRef(function TableSection(props, ref) {
|
|
8555
8624
|
const { className, ...rest } = props;
|
|
8556
|
-
const stacked =
|
|
8557
|
-
return
|
|
8625
|
+
const stacked = React51.useContext(StackLabels) != null;
|
|
8626
|
+
return React51.createElement(
|
|
8558
8627
|
tag,
|
|
8559
8628
|
Object.assign({ ref, className: cx(cls, className), role: stacked ? "rowgroup" : void 0 }, rest)
|
|
8560
8629
|
);
|
|
@@ -8567,14 +8636,14 @@ var TBody = section("tbody", "aura-tbl__body");
|
|
|
8567
8636
|
TBody.displayName = "TBody";
|
|
8568
8637
|
var TFoot = section("tfoot", "aura-tbl__foot");
|
|
8569
8638
|
TFoot.displayName = "TFoot";
|
|
8570
|
-
var Tr =
|
|
8639
|
+
var Tr = React51.forwardRef(function Tr2(props, ref) {
|
|
8571
8640
|
const { className, children, ...rest } = props;
|
|
8572
|
-
const stacked =
|
|
8641
|
+
const stacked = React51.useContext(StackLabels) != null;
|
|
8573
8642
|
let col = 0;
|
|
8574
|
-
return /* @__PURE__ */
|
|
8643
|
+
return /* @__PURE__ */ React51.createElement("tr", { ref, className: cx("aura-tbl__row", className), role: stacked ? "row" : void 0, ...rest }, stacked ? flat2(children).map(function(c) {
|
|
8575
8644
|
const at = col;
|
|
8576
|
-
if (
|
|
8577
|
-
return /* @__PURE__ */
|
|
8645
|
+
if (React51.isValidElement(c)) col += Math.max(1, Number(c.props.colSpan) || 1);
|
|
8646
|
+
return /* @__PURE__ */ React51.createElement(ColumnIndex.Provider, { key: React51.isValidElement(c) && c.key != null ? c.key : at, value: at }, c);
|
|
8578
8647
|
}) : children);
|
|
8579
8648
|
});
|
|
8580
8649
|
function cellClass(base, p) {
|
|
@@ -8588,10 +8657,10 @@ function cellClass(base, p) {
|
|
|
8588
8657
|
p.className
|
|
8589
8658
|
);
|
|
8590
8659
|
}
|
|
8591
|
-
var Th =
|
|
8660
|
+
var Th = React51.forwardRef(function Th2(props, ref) {
|
|
8592
8661
|
const { align, numeric, mono, className, scope, label, card, ...rest } = props;
|
|
8593
|
-
const stacked =
|
|
8594
|
-
return /* @__PURE__ */
|
|
8662
|
+
const stacked = React51.useContext(StackLabels) != null;
|
|
8663
|
+
return /* @__PURE__ */ React51.createElement(
|
|
8595
8664
|
"th",
|
|
8596
8665
|
{
|
|
8597
8666
|
ref,
|
|
@@ -8603,12 +8672,12 @@ var Th = React50.forwardRef(function Th2(props, ref) {
|
|
|
8603
8672
|
}
|
|
8604
8673
|
);
|
|
8605
8674
|
});
|
|
8606
|
-
var Td =
|
|
8675
|
+
var Td = React51.forwardRef(function Td2(props, ref) {
|
|
8607
8676
|
const { align, numeric, mono, className, scope, label, card, ...rest } = props;
|
|
8608
|
-
const labels =
|
|
8677
|
+
const labels = React51.useContext(StackLabels), col = React51.useContext(ColumnIndex);
|
|
8609
8678
|
const slot = labels && (card === "title" || card === "action") ? card : void 0;
|
|
8610
8679
|
const shown = labels && !slot ? label != null ? label : col >= 0 ? labels[col] : void 0 : void 0;
|
|
8611
|
-
return /* @__PURE__ */
|
|
8680
|
+
return /* @__PURE__ */ React51.createElement(
|
|
8612
8681
|
"td",
|
|
8613
8682
|
{
|
|
8614
8683
|
ref,
|
|
@@ -8622,8 +8691,8 @@ var Td = React50.forwardRef(function Td2(props, ref) {
|
|
|
8622
8691
|
});
|
|
8623
8692
|
|
|
8624
8693
|
// src/BottomNav.tsx
|
|
8625
|
-
var
|
|
8626
|
-
var BottomNav =
|
|
8694
|
+
var React52 = __toESM(require("react"), 1);
|
|
8695
|
+
var BottomNav = React52.forwardRef(function BottomNav2(props, ref) {
|
|
8627
8696
|
const t = useStrings();
|
|
8628
8697
|
const Link = useLinkComponent(props.linkComponent);
|
|
8629
8698
|
const st = useMaybeControlled(
|
|
@@ -8633,7 +8702,7 @@ var BottomNav = React51.forwardRef(function BottomNav2(props, ref) {
|
|
|
8633
8702
|
);
|
|
8634
8703
|
const active = st[0];
|
|
8635
8704
|
const hide2 = props.hideFrom === false ? "always" : "below-" + (props.hideFrom || "lg");
|
|
8636
|
-
const own =
|
|
8705
|
+
const own = React52.useRef(null);
|
|
8637
8706
|
const hf = props.hideFrom === false ? null : props.hideFrom || "lg";
|
|
8638
8707
|
const away = useHideOnScroll(
|
|
8639
8708
|
!!props.hideOnScroll,
|
|
@@ -8641,7 +8710,7 @@ var BottomNav = React51.forwardRef(function BottomNav2(props, ref) {
|
|
|
8641
8710
|
hf ? "(max-width: " + (breakpoints[hf] - 0.02) + "px)" : "all",
|
|
8642
8711
|
64
|
|
8643
8712
|
);
|
|
8644
|
-
const setRef =
|
|
8713
|
+
const setRef = React52.useCallback(
|
|
8645
8714
|
function(el) {
|
|
8646
8715
|
own.current = el;
|
|
8647
8716
|
if (typeof ref === "function") ref(el);
|
|
@@ -8649,7 +8718,7 @@ var BottomNav = React51.forwardRef(function BottomNav2(props, ref) {
|
|
|
8649
8718
|
},
|
|
8650
8719
|
[ref]
|
|
8651
8720
|
);
|
|
8652
|
-
return /* @__PURE__ */
|
|
8721
|
+
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(
|
|
8653
8722
|
"nav",
|
|
8654
8723
|
{
|
|
8655
8724
|
ref: setRef,
|
|
@@ -8662,7 +8731,7 @@ var BottomNav = React51.forwardRef(function BottomNav2(props, ref) {
|
|
|
8662
8731
|
),
|
|
8663
8732
|
"aria-label": props.label || t.mainNav
|
|
8664
8733
|
},
|
|
8665
|
-
/* @__PURE__ */
|
|
8734
|
+
/* @__PURE__ */ React52.createElement("ul", { className: "aura-bottomnav__list" }, props.items.map(function(it) {
|
|
8666
8735
|
if (it.ariaLabel && typeof it.label === "string" && it.ariaLabel.toLowerCase().indexOf(it.label.toLowerCase()) < 0)
|
|
8667
8736
|
devWarnOnce(
|
|
8668
8737
|
"bottomnav-label-" + it.id,
|
|
@@ -8683,20 +8752,20 @@ var BottomNav = React51.forwardRef(function BottomNav2(props, ref) {
|
|
|
8683
8752
|
}
|
|
8684
8753
|
};
|
|
8685
8754
|
const inner = [
|
|
8686
|
-
/* @__PURE__ */
|
|
8687
|
-
it.ariaLabel ? /* @__PURE__ */
|
|
8688
|
-
/* @__PURE__ */
|
|
8689
|
-
suffix && !it.ariaLabel ? /* @__PURE__ */
|
|
8755
|
+
/* @__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),
|
|
8756
|
+
it.ariaLabel ? /* @__PURE__ */ React52.createElement("span", { key: "n", className: "aura-sr-only" }, it.ariaLabel + suffix) : null,
|
|
8757
|
+
/* @__PURE__ */ React52.createElement("span", { key: "l", className: "aura-bottomnav__label", "aria-hidden": it.ariaLabel ? true : void 0 }, it.label),
|
|
8758
|
+
suffix && !it.ariaLabel ? /* @__PURE__ */ React52.createElement("span", { key: "s", className: "aura-sr-only" }, suffix) : null
|
|
8690
8759
|
];
|
|
8691
|
-
return /* @__PURE__ */
|
|
8760
|
+
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));
|
|
8692
8761
|
}))
|
|
8693
8762
|
));
|
|
8694
8763
|
});
|
|
8695
8764
|
|
|
8696
8765
|
// src/Surface.tsx
|
|
8697
|
-
var
|
|
8698
|
-
var h10 =
|
|
8699
|
-
var Surface =
|
|
8766
|
+
var React53 = __toESM(require("react"), 1);
|
|
8767
|
+
var h10 = React53.createElement;
|
|
8768
|
+
var Surface = React53.forwardRef(function Surface2(props, ref) {
|
|
8700
8769
|
const t = props.texture || "mesh";
|
|
8701
8770
|
const rest = omit(props, ["texture", "className", "children", "as"]);
|
|
8702
8771
|
return h10(
|
|
@@ -8717,14 +8786,14 @@ var Surface = React52.forwardRef(function Surface2(props, ref) {
|
|
|
8717
8786
|
});
|
|
8718
8787
|
|
|
8719
8788
|
// src/Stat.tsx
|
|
8720
|
-
var
|
|
8721
|
-
var Stat =
|
|
8789
|
+
var React54 = __toESM(require("react"), 1);
|
|
8790
|
+
var Stat = React54.forwardRef(function Stat2(props, ref) {
|
|
8722
8791
|
const Link = useLinkComponent(props.linkComponent);
|
|
8723
8792
|
return statElement(props, ref, Link);
|
|
8724
8793
|
});
|
|
8725
8794
|
|
|
8726
8795
|
// src/TimePicker.tsx
|
|
8727
|
-
var
|
|
8796
|
+
var React55 = __toESM(require("react"), 1);
|
|
8728
8797
|
var import_react_dom12 = require("react-dom");
|
|
8729
8798
|
|
|
8730
8799
|
// src/text.ts
|
|
@@ -8766,7 +8835,7 @@ function toMin(t) {
|
|
|
8766
8835
|
function fromMin(n3) {
|
|
8767
8836
|
return pad3(Math.floor(n3 / 60)) + ":" + pad3(n3 % 60);
|
|
8768
8837
|
}
|
|
8769
|
-
var TimePicker =
|
|
8838
|
+
var TimePicker = React55.forwardRef(function TimePicker2(props, ref) {
|
|
8770
8839
|
const t = useStrings();
|
|
8771
8840
|
const auto = uid(), id = props.id || auto, listId = id + "-list";
|
|
8772
8841
|
const st = useMaybeControlled(
|
|
@@ -8776,7 +8845,7 @@ var TimePicker = React54.forwardRef(function TimePicker2(props, ref) {
|
|
|
8776
8845
|
);
|
|
8777
8846
|
const value = st[0];
|
|
8778
8847
|
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;
|
|
8779
|
-
const slots =
|
|
8848
|
+
const slots = React55.useMemo(
|
|
8780
8849
|
function() {
|
|
8781
8850
|
const out = [];
|
|
8782
8851
|
for (let m = lo; m <= hi; m += step) out.push(fromMin(m));
|
|
@@ -8788,12 +8857,12 @@ var TimePicker = React54.forwardRef(function TimePicker2(props, ref) {
|
|
|
8788
8857
|
const n3 = toMin(v);
|
|
8789
8858
|
return n3 == null || n3 < lo || n3 > hi || props.isTimeDisabled && props.isTimeDisabled(v);
|
|
8790
8859
|
}
|
|
8791
|
-
const openState =
|
|
8792
|
-
const editState =
|
|
8793
|
-
const aState =
|
|
8794
|
-
const errState =
|
|
8795
|
-
const pos =
|
|
8796
|
-
const boxRef =
|
|
8860
|
+
const openState = React55.useState(false), open = openState[0], setOpen = openState[1];
|
|
8861
|
+
const editState = React55.useState(null), editing = editState[0], setEditing = editState[1];
|
|
8862
|
+
const aState = React55.useState(0), active = aState[0], setActive = aState[1];
|
|
8863
|
+
const errState = React55.useState(null);
|
|
8864
|
+
const pos = React55.useState(null);
|
|
8865
|
+
const boxRef = React55.useRef(null), inputRef = React55.useRef(null), listRef = React55.useRef(null), inputMerged = useMergedRef(ref, inputRef);
|
|
8797
8866
|
const mounted = useMounted();
|
|
8798
8867
|
function nearest(v) {
|
|
8799
8868
|
const n3 = toMin(v);
|
|
@@ -8821,7 +8890,7 @@ var TimePicker = React54.forwardRef(function TimePicker2(props, ref) {
|
|
|
8821
8890
|
},
|
|
8822
8891
|
[open]
|
|
8823
8892
|
);
|
|
8824
|
-
|
|
8893
|
+
React55.useEffect(
|
|
8825
8894
|
function() {
|
|
8826
8895
|
if (!open) return;
|
|
8827
8896
|
function outside(e) {
|
|
@@ -8843,7 +8912,7 @@ var TimePicker = React54.forwardRef(function TimePicker2(props, ref) {
|
|
|
8843
8912
|
},
|
|
8844
8913
|
[open]
|
|
8845
8914
|
);
|
|
8846
|
-
|
|
8915
|
+
React55.useEffect(
|
|
8847
8916
|
function() {
|
|
8848
8917
|
if (!open || !listRef.current) return;
|
|
8849
8918
|
const el = listRef.current.querySelector('[data-idx="' + active + '"]');
|
|
@@ -8942,9 +9011,9 @@ var TimePicker = React54.forwardRef(function TimePicker2(props, ref) {
|
|
|
8942
9011
|
}
|
|
8943
9012
|
const error = errState[0] || props.error;
|
|
8944
9013
|
const list = open && mounted && pos[0] ? (0, import_react_dom12.createPortal)(
|
|
8945
|
-
/* @__PURE__ */
|
|
9014
|
+
/* @__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) {
|
|
8946
9015
|
const dis = blocked(s), sel = s === value;
|
|
8947
|
-
return /* @__PURE__ */
|
|
9016
|
+
return /* @__PURE__ */ React55.createElement(
|
|
8948
9017
|
"li",
|
|
8949
9018
|
{
|
|
8950
9019
|
key: s,
|
|
@@ -8969,13 +9038,13 @@ var TimePicker = React54.forwardRef(function TimePicker2(props, ref) {
|
|
|
8969
9038
|
if (active !== i) setActive(i);
|
|
8970
9039
|
}
|
|
8971
9040
|
},
|
|
8972
|
-
/* @__PURE__ */
|
|
8973
|
-
sel ? /* @__PURE__ */
|
|
9041
|
+
/* @__PURE__ */ React55.createElement("span", { className: "aura-combo__label" }, s),
|
|
9042
|
+
sel ? /* @__PURE__ */ React55.createElement(Icon, { name: /* @__PURE__ */ React55.createElement(IconCheck, null), className: "aura-combo__check" }) : null
|
|
8974
9043
|
);
|
|
8975
9044
|
}))),
|
|
8976
9045
|
document.body
|
|
8977
9046
|
) : null;
|
|
8978
|
-
return /* @__PURE__ */
|
|
9047
|
+
return /* @__PURE__ */ React55.createElement(
|
|
8979
9048
|
Field,
|
|
8980
9049
|
{
|
|
8981
9050
|
id,
|
|
@@ -8987,7 +9056,7 @@ var TimePicker = React54.forwardRef(function TimePicker2(props, ref) {
|
|
|
8987
9056
|
disabled: props.disabled,
|
|
8988
9057
|
className: cx(touchClass(props.touchHeight), props.className)
|
|
8989
9058
|
},
|
|
8990
|
-
/* @__PURE__ */
|
|
9059
|
+
/* @__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(
|
|
8991
9060
|
"input",
|
|
8992
9061
|
{
|
|
8993
9062
|
ref: inputMerged,
|
|
@@ -9027,7 +9096,7 @@ var TimePicker = React54.forwardRef(function TimePicker2(props, ref) {
|
|
|
9027
9096
|
}, 0);
|
|
9028
9097
|
}
|
|
9029
9098
|
}
|
|
9030
|
-
), props.clearable !== false && value != null && !props.disabled ? /* @__PURE__ */
|
|
9099
|
+
), props.clearable !== false && value != null && !props.disabled ? /* @__PURE__ */ React55.createElement(
|
|
9031
9100
|
"button",
|
|
9032
9101
|
{
|
|
9033
9102
|
type: "button",
|
|
@@ -9040,8 +9109,8 @@ var TimePicker = React54.forwardRef(function TimePicker2(props, ref) {
|
|
|
9040
9109
|
if (inputRef.current) inputRef.current.focus();
|
|
9041
9110
|
}
|
|
9042
9111
|
},
|
|
9043
|
-
/* @__PURE__ */
|
|
9044
|
-
) : null, /* @__PURE__ */
|
|
9112
|
+
/* @__PURE__ */ React55.createElement(Icon, { name: /* @__PURE__ */ React55.createElement(IconX, null) })
|
|
9113
|
+
) : null, /* @__PURE__ */ React55.createElement(
|
|
9045
9114
|
"button",
|
|
9046
9115
|
{
|
|
9047
9116
|
type: "button",
|
|
@@ -9059,14 +9128,14 @@ var TimePicker = React54.forwardRef(function TimePicker2(props, ref) {
|
|
|
9059
9128
|
}
|
|
9060
9129
|
}
|
|
9061
9130
|
},
|
|
9062
|
-
/* @__PURE__ */
|
|
9131
|
+
/* @__PURE__ */ React55.createElement(Icon, { name: /* @__PURE__ */ React55.createElement(IconChevronDown, null) })
|
|
9063
9132
|
)),
|
|
9064
9133
|
list
|
|
9065
9134
|
);
|
|
9066
9135
|
});
|
|
9067
9136
|
|
|
9068
9137
|
// src/FileUpload.tsx
|
|
9069
|
-
var
|
|
9138
|
+
var React56 = __toESM(require("react"), 1);
|
|
9070
9139
|
function matches(file, accept) {
|
|
9071
9140
|
if (!accept) return true;
|
|
9072
9141
|
const name = (file.name || "").toLowerCase(), type = (file.type || "").toLowerCase();
|
|
@@ -9090,24 +9159,24 @@ function describeAccept(accept, t) {
|
|
|
9090
9159
|
}).join(", ");
|
|
9091
9160
|
}
|
|
9092
9161
|
var seq = 0;
|
|
9093
|
-
var FileUpload =
|
|
9162
|
+
var FileUpload = React56.forwardRef(function FileUpload2(props, ref) {
|
|
9094
9163
|
const t = useStrings();
|
|
9095
9164
|
const auto = uid(), id = props.id || auto;
|
|
9096
9165
|
const st = useMaybeControlled(props.value, props.defaultValue || [], props.onChange);
|
|
9097
9166
|
const items2 = st[0] || [];
|
|
9098
|
-
const dragState =
|
|
9099
|
-
const inputRef =
|
|
9100
|
-
const urls =
|
|
9167
|
+
const dragState = React56.useState(false), over = dragState[0];
|
|
9168
|
+
const inputRef = React56.useRef(null), inputMerged = useMergedRef(ref, inputRef);
|
|
9169
|
+
const urls = React56.useRef({});
|
|
9101
9170
|
const maxFiles = props.multiple ? props.maxFiles : 1;
|
|
9102
9171
|
const note = t.accepts(describeAccept(props.accept, t), props.maxSize ? formatBytes(props.maxSize) : "");
|
|
9103
|
-
|
|
9172
|
+
React56.useEffect(function() {
|
|
9104
9173
|
return function() {
|
|
9105
9174
|
Object.keys(urls.current).forEach(function(k) {
|
|
9106
9175
|
URL.revokeObjectURL(urls.current[k]);
|
|
9107
9176
|
});
|
|
9108
9177
|
};
|
|
9109
9178
|
}, []);
|
|
9110
|
-
|
|
9179
|
+
React56.useEffect(
|
|
9111
9180
|
function() {
|
|
9112
9181
|
const el = inputRef.current;
|
|
9113
9182
|
if (!el || !props.name || typeof DataTransfer === "undefined") return;
|
|
@@ -9167,7 +9236,7 @@ var FileUpload = React55.forwardRef(function FileUpload2(props, ref) {
|
|
|
9167
9236
|
if (inputRef.current) inputRef.current.focus();
|
|
9168
9237
|
}
|
|
9169
9238
|
const error = props.error;
|
|
9170
|
-
return /* @__PURE__ */
|
|
9239
|
+
return /* @__PURE__ */ React56.createElement(
|
|
9171
9240
|
Field,
|
|
9172
9241
|
{
|
|
9173
9242
|
id,
|
|
@@ -9179,7 +9248,7 @@ var FileUpload = React55.forwardRef(function FileUpload2(props, ref) {
|
|
|
9179
9248
|
disabled: props.disabled,
|
|
9180
9249
|
className: props.className
|
|
9181
9250
|
},
|
|
9182
|
-
/* @__PURE__ */
|
|
9251
|
+
/* @__PURE__ */ React56.createElement(
|
|
9183
9252
|
"div",
|
|
9184
9253
|
{
|
|
9185
9254
|
className: cx("aura-upload", over && "is-over", props.disabled && "is-disabled", error && "is-invalid"),
|
|
@@ -9200,9 +9269,9 @@ var FileUpload = React55.forwardRef(function FileUpload2(props, ref) {
|
|
|
9200
9269
|
add(e.dataTransfer && e.dataTransfer.files);
|
|
9201
9270
|
}
|
|
9202
9271
|
},
|
|
9203
|
-
/* @__PURE__ */
|
|
9204
|
-
/* @__PURE__ */
|
|
9205
|
-
/* @__PURE__ */
|
|
9272
|
+
/* @__PURE__ */ React56.createElement(Icon, { name: /* @__PURE__ */ React56.createElement(IconCloudUpload, null), size: "lg", className: "aura-upload__icon" }),
|
|
9273
|
+
/* @__PURE__ */ React56.createElement("span", { className: "aura-upload__text" }, t.dropFiles, " "),
|
|
9274
|
+
/* @__PURE__ */ React56.createElement(
|
|
9206
9275
|
"input",
|
|
9207
9276
|
{
|
|
9208
9277
|
ref: inputMerged,
|
|
@@ -9224,12 +9293,12 @@ var FileUpload = React55.forwardRef(function FileUpload2(props, ref) {
|
|
|
9224
9293
|
}
|
|
9225
9294
|
}
|
|
9226
9295
|
),
|
|
9227
|
-
/* @__PURE__ */
|
|
9228
|
-
note ? /* @__PURE__ */
|
|
9296
|
+
/* @__PURE__ */ React56.createElement("span", { className: "aura-upload__browse", "aria-hidden": true }, props.multiple ? t.browse : t.browseOne),
|
|
9297
|
+
note ? /* @__PURE__ */ React56.createElement("span", { className: "aura-upload__note", id: id + "-note" }, note) : null
|
|
9229
9298
|
),
|
|
9230
|
-
items2.length ? /* @__PURE__ */
|
|
9299
|
+
items2.length ? /* @__PURE__ */ React56.createElement("ul", { className: "aura-upload__list", "aria-live": "polite" }, items2.map(function(it) {
|
|
9231
9300
|
const src = thumb(it);
|
|
9232
|
-
return /* @__PURE__ */
|
|
9301
|
+
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(
|
|
9233
9302
|
"span",
|
|
9234
9303
|
{
|
|
9235
9304
|
className: "aura-upload__bar",
|
|
@@ -9239,11 +9308,11 @@ var FileUpload = React55.forwardRef(function FileUpload2(props, ref) {
|
|
|
9239
9308
|
"aria-valuemax": 100,
|
|
9240
9309
|
"aria-valuenow": it.progress != null ? Math.round(it.progress) : void 0
|
|
9241
9310
|
},
|
|
9242
|
-
/* @__PURE__ */
|
|
9243
|
-
) : null), /* @__PURE__ */
|
|
9311
|
+
/* @__PURE__ */ React56.createElement("span", { style: { width: (it.progress || 0) + "%" } })
|
|
9312
|
+
) : null), /* @__PURE__ */ React56.createElement(
|
|
9244
9313
|
IconButton,
|
|
9245
9314
|
{
|
|
9246
|
-
icon: /* @__PURE__ */
|
|
9315
|
+
icon: /* @__PURE__ */ React56.createElement(IconX, null),
|
|
9247
9316
|
label: t.remove(it.name),
|
|
9248
9317
|
onClick: function() {
|
|
9249
9318
|
remove(it);
|
|
@@ -9559,9 +9628,9 @@ function createTheme(opts) {
|
|
|
9559
9628
|
}
|
|
9560
9629
|
|
|
9561
9630
|
// src/ThemeStyle.tsx
|
|
9562
|
-
var
|
|
9631
|
+
var React57 = __toESM(require("react"), 1);
|
|
9563
9632
|
function ThemeStyle(props) {
|
|
9564
|
-
const css =
|
|
9633
|
+
const css = React57.useMemo(
|
|
9565
9634
|
function() {
|
|
9566
9635
|
try {
|
|
9567
9636
|
return createTheme({
|
|
@@ -9578,11 +9647,11 @@ function ThemeStyle(props) {
|
|
|
9578
9647
|
[props.brand, props.signal, props.primary, props.name, props.selector]
|
|
9579
9648
|
);
|
|
9580
9649
|
if (css === null) return null;
|
|
9581
|
-
return /* @__PURE__ */
|
|
9650
|
+
return /* @__PURE__ */ React57.createElement("style", { "data-aura-theme": props.name || props.brand, dangerouslySetInnerHTML: { __html: css } });
|
|
9582
9651
|
}
|
|
9583
9652
|
|
|
9584
9653
|
// src/colorScheme.tsx
|
|
9585
|
-
var
|
|
9654
|
+
var React58 = __toESM(require("react"), 1);
|
|
9586
9655
|
|
|
9587
9656
|
// src/colorSchemeScript.ts
|
|
9588
9657
|
var DEFAULT_KEY = "aura-color-scheme";
|
|
@@ -9599,7 +9668,7 @@ function colorSchemeScript(options) {
|
|
|
9599
9668
|
|
|
9600
9669
|
// src/colorScheme.tsx
|
|
9601
9670
|
function ColorSchemeScript(props) {
|
|
9602
|
-
return /* @__PURE__ */
|
|
9671
|
+
return /* @__PURE__ */ React58.createElement(
|
|
9603
9672
|
"script",
|
|
9604
9673
|
{
|
|
9605
9674
|
"data-aura-color-scheme": "",
|
|
@@ -9624,7 +9693,7 @@ function apply(scheme) {
|
|
|
9624
9693
|
function useColorScheme(options) {
|
|
9625
9694
|
const key = options && options.storageKey || DEFAULT_KEY;
|
|
9626
9695
|
const fallback = options && options.defaultScheme || "system";
|
|
9627
|
-
const subscribe2 =
|
|
9696
|
+
const subscribe2 = React58.useCallback(
|
|
9628
9697
|
function(cb) {
|
|
9629
9698
|
const mq = window.matchMedia ? window.matchMedia("(prefers-color-scheme: dark)") : null;
|
|
9630
9699
|
function onSystem() {
|
|
@@ -9646,7 +9715,7 @@ function useColorScheme(options) {
|
|
|
9646
9715
|
},
|
|
9647
9716
|
[fallback, key]
|
|
9648
9717
|
);
|
|
9649
|
-
const snapshot =
|
|
9718
|
+
const snapshot = React58.useSyncExternalStore(
|
|
9650
9719
|
subscribe2,
|
|
9651
9720
|
function() {
|
|
9652
9721
|
const s = readScheme(fallback);
|
|
@@ -9657,7 +9726,7 @@ function useColorScheme(options) {
|
|
|
9657
9726
|
}
|
|
9658
9727
|
);
|
|
9659
9728
|
const parts = snapshot.split("|");
|
|
9660
|
-
const setScheme =
|
|
9729
|
+
const setScheme = React58.useCallback(
|
|
9661
9730
|
function(next) {
|
|
9662
9731
|
if (!valid(next)) return;
|
|
9663
9732
|
try {
|
|
@@ -9676,14 +9745,14 @@ function ColorSchemeToggle(props) {
|
|
|
9676
9745
|
const cs = useColorScheme(props);
|
|
9677
9746
|
const names = { light: t.schemeLight, dark: t.schemeDark, system: t.schemeSystem };
|
|
9678
9747
|
const label = props.label || t.colorScheme;
|
|
9679
|
-
return /* @__PURE__ */
|
|
9748
|
+
return /* @__PURE__ */ React58.createElement(
|
|
9680
9749
|
DropdownMenu,
|
|
9681
9750
|
{
|
|
9682
9751
|
label,
|
|
9683
|
-
trigger: /* @__PURE__ */
|
|
9752
|
+
trigger: /* @__PURE__ */ React58.createElement(
|
|
9684
9753
|
IconButton,
|
|
9685
9754
|
{
|
|
9686
|
-
icon: cs.resolved === "dark" ? /* @__PURE__ */
|
|
9755
|
+
icon: cs.resolved === "dark" ? /* @__PURE__ */ React58.createElement(IconMoon, null) : /* @__PURE__ */ React58.createElement(IconSun, null),
|
|
9687
9756
|
label: label + ": " + names[cs.scheme]
|
|
9688
9757
|
}
|
|
9689
9758
|
),
|
|
@@ -9701,14 +9770,14 @@ function ColorSchemeToggle(props) {
|
|
|
9701
9770
|
}
|
|
9702
9771
|
|
|
9703
9772
|
// src/Badge.tsx
|
|
9704
|
-
var
|
|
9705
|
-
var Badge =
|
|
9773
|
+
var React59 = __toESM(require("react"), 1);
|
|
9774
|
+
var Badge = React59.forwardRef(function Badge2(props, ref) {
|
|
9706
9775
|
return badgeElement(props, ref);
|
|
9707
9776
|
});
|
|
9708
9777
|
|
|
9709
9778
|
// src/Progress.tsx
|
|
9710
|
-
var
|
|
9711
|
-
var Progress =
|
|
9779
|
+
var React60 = __toESM(require("react"), 1);
|
|
9780
|
+
var Progress = React60.forwardRef(function Progress2(props, ref) {
|
|
9712
9781
|
const t = useStrings();
|
|
9713
9782
|
const auto = uid(), id = props.id || auto;
|
|
9714
9783
|
const max = props.max || 100, det = props.value != null;
|
|
@@ -9717,7 +9786,7 @@ var Progress = React59.forwardRef(function Progress2(props, ref) {
|
|
|
9717
9786
|
const spct = sec ? Math.max(0, Math.min(100 - pct, sec / max * 100)) : 0;
|
|
9718
9787
|
const valueText = props.valueText != null ? props.valueText : props.valueLabel != null ? String(props.valueLabel) : sec ? t.progressReserved(props.value, sec, max) : void 0;
|
|
9719
9788
|
const shown = props.valueLabel != null ? props.valueLabel : det ? Math.round(pct) + "%" : null;
|
|
9720
|
-
return /* @__PURE__ */
|
|
9789
|
+
return /* @__PURE__ */ React60.createElement(
|
|
9721
9790
|
"div",
|
|
9722
9791
|
{
|
|
9723
9792
|
ref,
|
|
@@ -9728,8 +9797,8 @@ var Progress = React59.forwardRef(function Progress2(props, ref) {
|
|
|
9728
9797
|
props.className
|
|
9729
9798
|
)
|
|
9730
9799
|
},
|
|
9731
|
-
props.label || props.showValue && shown ? /* @__PURE__ */
|
|
9732
|
-
/* @__PURE__ */
|
|
9800
|
+
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,
|
|
9801
|
+
/* @__PURE__ */ React60.createElement(
|
|
9733
9802
|
"div",
|
|
9734
9803
|
{
|
|
9735
9804
|
className: cx("aura-progress__track", !det && "is-indeterminate"),
|
|
@@ -9741,8 +9810,8 @@ var Progress = React59.forwardRef(function Progress2(props, ref) {
|
|
|
9741
9810
|
"aria-valuenow": det ? props.value : void 0,
|
|
9742
9811
|
"aria-valuetext": det ? valueText : void 0
|
|
9743
9812
|
},
|
|
9744
|
-
/* @__PURE__ */
|
|
9745
|
-
sec ? /* @__PURE__ */
|
|
9813
|
+
/* @__PURE__ */ React60.createElement("span", { className: "aura-progress__bar", style: det ? { width: pct + "%" } : void 0 }),
|
|
9814
|
+
sec ? /* @__PURE__ */ React60.createElement(
|
|
9746
9815
|
"span",
|
|
9747
9816
|
{
|
|
9748
9817
|
className: "aura-progress__bar aura-progress__bar--reserved",
|
|
@@ -9750,19 +9819,19 @@ var Progress = React59.forwardRef(function Progress2(props, ref) {
|
|
|
9750
9819
|
}
|
|
9751
9820
|
) : null
|
|
9752
9821
|
),
|
|
9753
|
-
props.hint ? /* @__PURE__ */
|
|
9822
|
+
props.hint ? /* @__PURE__ */ React60.createElement("p", { className: "aura-progress__hint" }, props.hint) : null
|
|
9754
9823
|
);
|
|
9755
9824
|
});
|
|
9756
9825
|
|
|
9757
9826
|
// src/Skeleton.tsx
|
|
9758
|
-
var
|
|
9759
|
-
var Skeleton =
|
|
9827
|
+
var React61 = __toESM(require("react"), 1);
|
|
9828
|
+
var Skeleton = React61.forwardRef(function Skeleton2(props, ref) {
|
|
9760
9829
|
const v = props.variant || "text";
|
|
9761
9830
|
if (v === "text" && (props.lines || 1) > 1) {
|
|
9762
9831
|
const n3 = props.lines, rows = [];
|
|
9763
9832
|
for (let i = 0; i < n3; i++)
|
|
9764
|
-
rows.push(/* @__PURE__ */
|
|
9765
|
-
return /* @__PURE__ */
|
|
9833
|
+
rows.push(/* @__PURE__ */ React61.createElement("span", { key: i, className: "aura-skel aura-skel--text", style: { width: i === n3 - 1 ? "60%" : "100%" } }));
|
|
9834
|
+
return /* @__PURE__ */ React61.createElement(
|
|
9766
9835
|
"span",
|
|
9767
9836
|
{
|
|
9768
9837
|
ref,
|
|
@@ -9780,17 +9849,17 @@ var Skeleton = React60.forwardRef(function Skeleton2(props, ref) {
|
|
|
9780
9849
|
if (v === "circle") {
|
|
9781
9850
|
style.width = style.height = props.size || props.width || 40;
|
|
9782
9851
|
}
|
|
9783
|
-
return /* @__PURE__ */
|
|
9852
|
+
return /* @__PURE__ */ React61.createElement("span", { ref, "aria-hidden": true, className: cx("aura-skel", "aura-skel--" + v, props.className), style });
|
|
9784
9853
|
});
|
|
9785
9854
|
|
|
9786
9855
|
// src/EmptyState.tsx
|
|
9787
|
-
var
|
|
9788
|
-
var EmptyState =
|
|
9856
|
+
var React62 = __toESM(require("react"), 1);
|
|
9857
|
+
var EmptyState = React62.forwardRef(function EmptyState2(props, ref) {
|
|
9789
9858
|
return emptyStateElement(props, ref);
|
|
9790
9859
|
});
|
|
9791
9860
|
|
|
9792
9861
|
// src/Pagination.tsx
|
|
9793
|
-
var
|
|
9862
|
+
var React63 = __toESM(require("react"), 1);
|
|
9794
9863
|
function pageList(page, count, sib) {
|
|
9795
9864
|
let out = [], lo = Math.max(2, page - sib), hi = Math.min(count - 1, page + sib);
|
|
9796
9865
|
if (page - sib <= 3) {
|
|
@@ -9810,7 +9879,7 @@ function pageList(page, count, sib) {
|
|
|
9810
9879
|
if (count > 1) out.push(count);
|
|
9811
9880
|
return out;
|
|
9812
9881
|
}
|
|
9813
|
-
var Pagination =
|
|
9882
|
+
var Pagination = React63.forwardRef(function Pagination2(props, ref) {
|
|
9814
9883
|
const t = useStrings();
|
|
9815
9884
|
useAutoTip();
|
|
9816
9885
|
const count = Math.max(1, props.pageCount || 1);
|
|
@@ -9830,7 +9899,7 @@ var Pagination = React62.forwardRef(function Pagination2(props, ref) {
|
|
|
9830
9899
|
},
|
|
9831
9900
|
extra
|
|
9832
9901
|
);
|
|
9833
|
-
return link ? /* @__PURE__ */
|
|
9902
|
+
return link ? /* @__PURE__ */ React63.createElement(
|
|
9834
9903
|
Link,
|
|
9835
9904
|
{
|
|
9836
9905
|
href: link(p),
|
|
@@ -9843,7 +9912,7 @@ var Pagination = React62.forwardRef(function Pagination2(props, ref) {
|
|
|
9843
9912
|
...common
|
|
9844
9913
|
},
|
|
9845
9914
|
label
|
|
9846
|
-
) : /* @__PURE__ */
|
|
9915
|
+
) : /* @__PURE__ */ React63.createElement(
|
|
9847
9916
|
"button",
|
|
9848
9917
|
{
|
|
9849
9918
|
type: "button",
|
|
@@ -9857,7 +9926,7 @@ var Pagination = React62.forwardRef(function Pagination2(props, ref) {
|
|
|
9857
9926
|
}
|
|
9858
9927
|
function arrow(p, icon, label, rel, disabled) {
|
|
9859
9928
|
if (!link || disabled)
|
|
9860
|
-
return /* @__PURE__ */
|
|
9929
|
+
return /* @__PURE__ */ React63.createElement(
|
|
9861
9930
|
IconButton,
|
|
9862
9931
|
{
|
|
9863
9932
|
icon,
|
|
@@ -9868,7 +9937,7 @@ var Pagination = React62.forwardRef(function Pagination2(props, ref) {
|
|
|
9868
9937
|
}
|
|
9869
9938
|
}
|
|
9870
9939
|
);
|
|
9871
|
-
return /* @__PURE__ */
|
|
9940
|
+
return /* @__PURE__ */ React63.createElement(
|
|
9872
9941
|
Link,
|
|
9873
9942
|
{
|
|
9874
9943
|
href: link(p),
|
|
@@ -9883,17 +9952,17 @@ var Pagination = React62.forwardRef(function Pagination2(props, ref) {
|
|
|
9883
9952
|
}
|
|
9884
9953
|
}
|
|
9885
9954
|
},
|
|
9886
|
-
/* @__PURE__ */
|
|
9955
|
+
/* @__PURE__ */ React63.createElement(Icon, { name: icon, size: "sm" })
|
|
9887
9956
|
);
|
|
9888
9957
|
}
|
|
9889
|
-
return /* @__PURE__ */
|
|
9890
|
-
return typeof p === "number" ? /* @__PURE__ */
|
|
9891
|
-
})), /* @__PURE__ */
|
|
9958
|
+
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) {
|
|
9959
|
+
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");
|
|
9960
|
+
})), /* @__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));
|
|
9892
9961
|
});
|
|
9893
9962
|
|
|
9894
9963
|
// src/Accordion.tsx
|
|
9895
|
-
var
|
|
9896
|
-
var Accordion =
|
|
9964
|
+
var React64 = __toESM(require("react"), 1);
|
|
9965
|
+
var Accordion = React64.forwardRef(function Accordion2(props, ref) {
|
|
9897
9966
|
const auto = uid(), base = props.id || auto;
|
|
9898
9967
|
const multiple = props.type === "multiple";
|
|
9899
9968
|
const st = useMaybeControlled(
|
|
@@ -9931,9 +10000,9 @@ var Accordion = React63.forwardRef(function Accordion2(props, ref) {
|
|
|
9931
10000
|
n3.focus();
|
|
9932
10001
|
}
|
|
9933
10002
|
}
|
|
9934
|
-
return /* @__PURE__ */
|
|
10003
|
+
return /* @__PURE__ */ React64.createElement("div", { ref, className: cx("aura-accordion", props.className), onKeyDown: onKey }, items2.map(function(it) {
|
|
9935
10004
|
const on = open.indexOf(it.id) >= 0, bid = base + "-btn-" + it.id, pid = base + "-panel-" + it.id;
|
|
9936
|
-
return /* @__PURE__ */
|
|
10005
|
+
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(
|
|
9937
10006
|
"button",
|
|
9938
10007
|
{
|
|
9939
10008
|
type: "button",
|
|
@@ -9946,10 +10015,10 @@ var Accordion = React63.forwardRef(function Accordion2(props, ref) {
|
|
|
9946
10015
|
toggle(it.id);
|
|
9947
10016
|
}
|
|
9948
10017
|
},
|
|
9949
|
-
it.icon ? /* @__PURE__ */
|
|
9950
|
-
/* @__PURE__ */
|
|
9951
|
-
/* @__PURE__ */
|
|
9952
|
-
)), /* @__PURE__ */
|
|
10018
|
+
it.icon ? /* @__PURE__ */ React64.createElement(Icon, { name: it.icon, className: "aura-accordion__lead" }) : null,
|
|
10019
|
+
/* @__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),
|
|
10020
|
+
/* @__PURE__ */ React64.createElement(Icon, { name: /* @__PURE__ */ React64.createElement(IconChevronDown, null), className: "aura-accordion__chevron" })
|
|
10021
|
+
)), /* @__PURE__ */ React64.createElement(
|
|
9953
10022
|
"div",
|
|
9954
10023
|
{
|
|
9955
10024
|
id: pid,
|
|
@@ -9964,7 +10033,7 @@ var Accordion = React63.forwardRef(function Accordion2(props, ref) {
|
|
|
9964
10033
|
});
|
|
9965
10034
|
|
|
9966
10035
|
// src/Popover.tsx
|
|
9967
|
-
var
|
|
10036
|
+
var React65 = __toESM(require("react"), 1);
|
|
9968
10037
|
var import_react_dom13 = require("react-dom");
|
|
9969
10038
|
function position(anchor, pop, placement) {
|
|
9970
10039
|
const r2 = anchor.getBoundingClientRect(), pw = pop.offsetWidth, ph = pop.scrollHeight, vw = window.innerWidth, vh = window.innerHeight, gap = 6;
|
|
@@ -9982,15 +10051,15 @@ function position(anchor, pop, placement) {
|
|
|
9982
10051
|
const left = align === "end" ? r2.right - pw : align === "center" ? r2.left + r2.width / 2 - pw / 2 : r2.left;
|
|
9983
10052
|
return { top: Math.max(8, top), left: Math.max(8, Math.min(left, vw - pw - 8)), side, maxHeight };
|
|
9984
10053
|
}
|
|
9985
|
-
var Popover =
|
|
10054
|
+
var Popover = React65.forwardRef(function Popover2(props, ref) {
|
|
9986
10055
|
const t = useStrings();
|
|
9987
10056
|
const density = useDensity();
|
|
9988
10057
|
const auto = uid(), id = props.id || auto;
|
|
9989
10058
|
const st = useMaybeControlled(props.open, !!props.defaultOpen, props.onOpenChange);
|
|
9990
10059
|
const open = !!st[0];
|
|
9991
|
-
const wrap =
|
|
9992
|
-
const pos =
|
|
9993
|
-
const inTree =
|
|
10060
|
+
const wrap = React65.useRef(null), pop = React65.useRef(null), popMerged = useMergedRef(ref, pop);
|
|
10061
|
+
const pos = React65.useState(null), mounted = useMounted();
|
|
10062
|
+
const inTree = React65.useRef(false);
|
|
9994
10063
|
function trigger() {
|
|
9995
10064
|
return wrap.current && (wrap.current.querySelector('button, [role="button"], a, input') || wrap.current.firstElementChild);
|
|
9996
10065
|
}
|
|
@@ -10017,7 +10086,7 @@ var Popover = React64.forwardRef(function Popover2(props, ref) {
|
|
|
10017
10086
|
},
|
|
10018
10087
|
[open, mounted, props.placement]
|
|
10019
10088
|
);
|
|
10020
|
-
|
|
10089
|
+
React65.useEffect(
|
|
10021
10090
|
function() {
|
|
10022
10091
|
if (!open || !mounted) return;
|
|
10023
10092
|
if (props.autoFocus !== false && pop.current) {
|
|
@@ -10042,9 +10111,9 @@ var Popover = React64.forwardRef(function Popover2(props, ref) {
|
|
|
10042
10111
|
},
|
|
10043
10112
|
[open, mounted]
|
|
10044
10113
|
);
|
|
10045
|
-
const child =
|
|
10114
|
+
const child = React65.Children.only(props.trigger);
|
|
10046
10115
|
const panel = open && mounted ? (0, import_react_dom13.createPortal)(
|
|
10047
|
-
/* @__PURE__ */
|
|
10116
|
+
/* @__PURE__ */ React65.createElement(
|
|
10048
10117
|
"div",
|
|
10049
10118
|
{
|
|
10050
10119
|
ref: popMerged,
|
|
@@ -10074,17 +10143,17 @@ var Popover = React64.forwardRef(function Popover2(props, ref) {
|
|
|
10074
10143
|
} else trapTab(e, pop.current);
|
|
10075
10144
|
}
|
|
10076
10145
|
},
|
|
10077
|
-
props.title ? /* @__PURE__ */
|
|
10146
|
+
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(
|
|
10078
10147
|
IconButton,
|
|
10079
10148
|
{
|
|
10080
|
-
icon: /* @__PURE__ */
|
|
10149
|
+
icon: /* @__PURE__ */ React65.createElement(IconX, null),
|
|
10081
10150
|
label: t.close,
|
|
10082
10151
|
onClick: function() {
|
|
10083
10152
|
close(true);
|
|
10084
10153
|
}
|
|
10085
10154
|
}
|
|
10086
10155
|
)) : null,
|
|
10087
|
-
/* @__PURE__ */
|
|
10156
|
+
/* @__PURE__ */ React65.createElement("div", { className: "aura-popover__body" }, typeof props.children === "function" ? props.children({
|
|
10088
10157
|
close: function() {
|
|
10089
10158
|
close(true);
|
|
10090
10159
|
}
|
|
@@ -10092,7 +10161,7 @@ var Popover = React64.forwardRef(function Popover2(props, ref) {
|
|
|
10092
10161
|
),
|
|
10093
10162
|
document.body
|
|
10094
10163
|
) : null;
|
|
10095
|
-
return /* @__PURE__ */
|
|
10164
|
+
return /* @__PURE__ */ React65.createElement("span", { ref: wrap, className: "aura-popover-anchor" }, React65.cloneElement(child, {
|
|
10096
10165
|
onClick: function(e) {
|
|
10097
10166
|
if (child.props.onClick) child.props.onClick(e);
|
|
10098
10167
|
st[1](!open);
|
|
@@ -10104,7 +10173,7 @@ var Popover = React64.forwardRef(function Popover2(props, ref) {
|
|
|
10104
10173
|
});
|
|
10105
10174
|
|
|
10106
10175
|
// src/NumberField.tsx
|
|
10107
|
-
var
|
|
10176
|
+
var React66 = __toESM(require("react"), 1);
|
|
10108
10177
|
function decimalsOf(n3) {
|
|
10109
10178
|
const s = String(n3);
|
|
10110
10179
|
const i = s.indexOf(".");
|
|
@@ -10117,7 +10186,7 @@ function parse(text2) {
|
|
|
10117
10186
|
if (!/^-?(\d+\.?\d*|\.\d+)$/.test(s)) return NaN;
|
|
10118
10187
|
return Number(s);
|
|
10119
10188
|
}
|
|
10120
|
-
var NumberField =
|
|
10189
|
+
var NumberField = React66.forwardRef(function NumberField2(props, ref) {
|
|
10121
10190
|
const t = useStrings();
|
|
10122
10191
|
const auto = uid(), id = props.id || auto;
|
|
10123
10192
|
const step = props.step || 1;
|
|
@@ -10128,7 +10197,7 @@ var NumberField = React65.forwardRef(function NumberField2(props, ref) {
|
|
|
10128
10197
|
props.onChange
|
|
10129
10198
|
);
|
|
10130
10199
|
const value = st[0], setValue = st[1];
|
|
10131
|
-
const draftState =
|
|
10200
|
+
const draftState = React66.useState(null), draft = draftState[0], setDraft = draftState[1];
|
|
10132
10201
|
function fmt2(n3) {
|
|
10133
10202
|
if (n3 == null || isNaN(n3)) return "";
|
|
10134
10203
|
return n3.toLocaleString("en", { minimumFractionDigits: decimals, maximumFractionDigits: decimals });
|
|
@@ -10177,7 +10246,7 @@ var NumberField = React65.forwardRef(function NumberField2(props, ref) {
|
|
|
10177
10246
|
};
|
|
10178
10247
|
const valueText = value == null ? void 0 : [affixText(props.prefix), fmt2(value), affixText(props.suffix)].join(" ").trim();
|
|
10179
10248
|
const stepper = props.stepper !== false && !props.readOnly;
|
|
10180
|
-
return /* @__PURE__ */
|
|
10249
|
+
return /* @__PURE__ */ React66.createElement(
|
|
10181
10250
|
Field,
|
|
10182
10251
|
{
|
|
10183
10252
|
id,
|
|
@@ -10189,7 +10258,7 @@ var NumberField = React65.forwardRef(function NumberField2(props, ref) {
|
|
|
10189
10258
|
disabled: props.disabled,
|
|
10190
10259
|
className: cx(touchClass(props.touchHeight), props.className)
|
|
10191
10260
|
},
|
|
10192
|
-
/* @__PURE__ */
|
|
10261
|
+
/* @__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(
|
|
10193
10262
|
"input",
|
|
10194
10263
|
{
|
|
10195
10264
|
ref,
|
|
@@ -10236,7 +10305,7 @@ var NumberField = React65.forwardRef(function NumberField2(props, ref) {
|
|
|
10236
10305
|
},
|
|
10237
10306
|
onKeyDown
|
|
10238
10307
|
}
|
|
10239
|
-
), props.suffix != null ? /* @__PURE__ */
|
|
10308
|
+
), 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(
|
|
10240
10309
|
"button",
|
|
10241
10310
|
{
|
|
10242
10311
|
type: "button",
|
|
@@ -10252,8 +10321,8 @@ var NumberField = React65.forwardRef(function NumberField2(props, ref) {
|
|
|
10252
10321
|
nudge(-step);
|
|
10253
10322
|
}
|
|
10254
10323
|
},
|
|
10255
|
-
/* @__PURE__ */
|
|
10256
|
-
), /* @__PURE__ */
|
|
10324
|
+
/* @__PURE__ */ React66.createElement(Icon, { name: /* @__PURE__ */ React66.createElement(IconMinus, null) })
|
|
10325
|
+
), /* @__PURE__ */ React66.createElement(
|
|
10257
10326
|
"button",
|
|
10258
10327
|
{
|
|
10259
10328
|
type: "button",
|
|
@@ -10269,14 +10338,14 @@ var NumberField = React65.forwardRef(function NumberField2(props, ref) {
|
|
|
10269
10338
|
nudge(step);
|
|
10270
10339
|
}
|
|
10271
10340
|
},
|
|
10272
|
-
/* @__PURE__ */
|
|
10341
|
+
/* @__PURE__ */ React66.createElement(Icon, { name: /* @__PURE__ */ React66.createElement(IconPlus, null) })
|
|
10273
10342
|
)) : null)
|
|
10274
10343
|
);
|
|
10275
10344
|
});
|
|
10276
10345
|
|
|
10277
10346
|
// src/Stepper.tsx
|
|
10278
|
-
var
|
|
10279
|
-
var Stepper =
|
|
10347
|
+
var React67 = __toESM(require("react"), 1);
|
|
10348
|
+
var Stepper = React67.forwardRef(function Stepper2(props, ref) {
|
|
10280
10349
|
const t = useStrings();
|
|
10281
10350
|
const idBase = uid();
|
|
10282
10351
|
const steps = props.steps || [];
|
|
@@ -10287,22 +10356,22 @@ var Stepper = React66.forwardRef(function Stepper2(props, ref) {
|
|
|
10287
10356
|
if (at < 0) at = 0;
|
|
10288
10357
|
const vertical = props.orientation === "vertical";
|
|
10289
10358
|
const cur2 = steps[at];
|
|
10290
|
-
return /* @__PURE__ */
|
|
10359
|
+
return /* @__PURE__ */ React67.createElement(
|
|
10291
10360
|
"nav",
|
|
10292
10361
|
{
|
|
10293
10362
|
ref,
|
|
10294
10363
|
"aria-label": props.label,
|
|
10295
10364
|
className: cx("aura-stepper", vertical ? "aura-stepper--vertical" : "aura-stepper--horizontal", props.className)
|
|
10296
10365
|
},
|
|
10297
|
-
/* @__PURE__ */
|
|
10366
|
+
/* @__PURE__ */ React67.createElement("ol", { className: "aura-stepper__list" }, steps.map(function(s, i) {
|
|
10298
10367
|
const state = i < at ? "done" : i === at ? "current" : "upcoming";
|
|
10299
10368
|
const error = s.status === "error";
|
|
10300
|
-
const marker = /* @__PURE__ */
|
|
10369
|
+
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);
|
|
10301
10370
|
const note = error ? t.stepError : state === "done" ? t.stepDone : "";
|
|
10302
10371
|
const clickable = state === "done" && !!props.onStepClick;
|
|
10303
10372
|
const named = clickable && (typeof s.label === "string" || typeof s.label === "number") && String(s.label).trim() !== "";
|
|
10304
10373
|
const descId = idBase + "-step-" + i;
|
|
10305
|
-
const text2 = /* @__PURE__ */
|
|
10374
|
+
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(
|
|
10306
10375
|
"span",
|
|
10307
10376
|
{
|
|
10308
10377
|
className: "aura-stepper__desc",
|
|
@@ -10311,14 +10380,14 @@ var Stepper = React66.forwardRef(function Stepper2(props, ref) {
|
|
|
10311
10380
|
},
|
|
10312
10381
|
s.description
|
|
10313
10382
|
) : null);
|
|
10314
|
-
return /* @__PURE__ */
|
|
10383
|
+
return /* @__PURE__ */ React67.createElement(
|
|
10315
10384
|
"li",
|
|
10316
10385
|
{
|
|
10317
10386
|
key: s.id,
|
|
10318
10387
|
className: cx("aura-stepper__item", "is-" + state, error && "is-error"),
|
|
10319
10388
|
"aria-current": state === "current" ? "step" : void 0
|
|
10320
10389
|
},
|
|
10321
|
-
clickable ? /* @__PURE__ */
|
|
10390
|
+
clickable ? /* @__PURE__ */ React67.createElement(
|
|
10322
10391
|
"button",
|
|
10323
10392
|
{
|
|
10324
10393
|
type: "button",
|
|
@@ -10330,19 +10399,19 @@ var Stepper = React66.forwardRef(function Stepper2(props, ref) {
|
|
|
10330
10399
|
},
|
|
10331
10400
|
marker,
|
|
10332
10401
|
text2
|
|
10333
|
-
) : /* @__PURE__ */
|
|
10402
|
+
) : /* @__PURE__ */ React67.createElement("span", { className: "aura-stepper__step" }, marker, text2)
|
|
10334
10403
|
);
|
|
10335
10404
|
})),
|
|
10336
|
-
!vertical && cur2 ? /* @__PURE__ */
|
|
10405
|
+
!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
|
|
10337
10406
|
);
|
|
10338
10407
|
});
|
|
10339
10408
|
|
|
10340
10409
|
// src/SegmentedControl.tsx
|
|
10341
|
-
var
|
|
10410
|
+
var React68 = __toESM(require("react"), 1);
|
|
10342
10411
|
function toOpt2(o) {
|
|
10343
10412
|
return typeof o === "object" ? o : { value: o, label: o };
|
|
10344
10413
|
}
|
|
10345
|
-
var SegmentedControl =
|
|
10414
|
+
var SegmentedControl = React68.forwardRef(
|
|
10346
10415
|
function SegmentedControl2(props, ref) {
|
|
10347
10416
|
const options = (props.options || []).map(toOpt2);
|
|
10348
10417
|
useAutoTip();
|
|
@@ -10356,7 +10425,7 @@ var SegmentedControl = React67.forwardRef(
|
|
|
10356
10425
|
);
|
|
10357
10426
|
const value = st[0], setValue = st[1];
|
|
10358
10427
|
const auto = uid(), id = props.id || auto;
|
|
10359
|
-
const refs =
|
|
10428
|
+
const refs = React68.useRef([]);
|
|
10360
10429
|
const selIdx = options.findIndex(function(o) {
|
|
10361
10430
|
return o.value === value;
|
|
10362
10431
|
});
|
|
@@ -10389,7 +10458,7 @@ var SegmentedControl = React67.forwardRef(
|
|
|
10389
10458
|
move(options.length, -1);
|
|
10390
10459
|
}
|
|
10391
10460
|
}
|
|
10392
|
-
return /* @__PURE__ */
|
|
10461
|
+
return /* @__PURE__ */ React68.createElement(
|
|
10393
10462
|
"div",
|
|
10394
10463
|
{
|
|
10395
10464
|
ref,
|
|
@@ -10409,7 +10478,7 @@ var SegmentedControl = React67.forwardRef(
|
|
|
10409
10478
|
options.map(function(o, i) {
|
|
10410
10479
|
const on = o.value === value;
|
|
10411
10480
|
const off = props.disabled || o.disabled;
|
|
10412
|
-
return /* @__PURE__ */
|
|
10481
|
+
return /* @__PURE__ */ React68.createElement(
|
|
10413
10482
|
"button",
|
|
10414
10483
|
{
|
|
10415
10484
|
key: o.value,
|
|
@@ -10431,8 +10500,8 @@ var SegmentedControl = React67.forwardRef(
|
|
|
10431
10500
|
onKeyDown(e, i);
|
|
10432
10501
|
}
|
|
10433
10502
|
},
|
|
10434
|
-
o.icon ? /* @__PURE__ */
|
|
10435
|
-
o.iconOnly ? null : /* @__PURE__ */
|
|
10503
|
+
o.icon ? /* @__PURE__ */ React68.createElement(Icon, { name: o.icon }) : null,
|
|
10504
|
+
o.iconOnly ? null : /* @__PURE__ */ React68.createElement("span", null, o.label)
|
|
10436
10505
|
);
|
|
10437
10506
|
})
|
|
10438
10507
|
);
|