@jirawatpyk/aura-react 4.19.0 → 5.0.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 +30 -6
- package/dist/aura.bundle.js +383 -276
- package/dist/cjs/index.cjs +382 -275
- package/dist/esm/DataTable.js +119 -125
- package/dist/esm/DatePicker.js +7 -7
- package/dist/esm/Separator.js +20 -0
- package/dist/esm/Table.js +79 -0
- package/dist/esm/Tooltip.js +21 -3
- package/dist/esm/dates.js +1 -1
- package/dist/esm/index.js +10 -0
- package/dist/index.d.ts +57 -5
- package/dist/server/index.cjs +2 -9
- package/dist/server/index.d.ts +5 -4
- package/dist/server/index.js +2 -9
- package/dist/styles.css +104 -57
- package/dist/styles.layer.css +104 -57
- package/package.json +1 -1
package/dist/cjs/index.cjs
CHANGED
|
@@ -74,6 +74,7 @@ __export(index_exports, {
|
|
|
74
74
|
STRINGS: () => STRINGS,
|
|
75
75
|
SegmentedControl: () => SegmentedControl,
|
|
76
76
|
Select: () => Select,
|
|
77
|
+
Separator: () => Separator,
|
|
77
78
|
SideNav: () => SideNav,
|
|
78
79
|
Skeleton: () => Skeleton,
|
|
79
80
|
Stack: () => Stack,
|
|
@@ -82,14 +83,21 @@ __export(index_exports, {
|
|
|
82
83
|
Stepper: () => Stepper,
|
|
83
84
|
Surface: () => Surface,
|
|
84
85
|
Switch: () => Switch,
|
|
86
|
+
TBody: () => TBody,
|
|
87
|
+
TFoot: () => TFoot,
|
|
88
|
+
THead: () => THead,
|
|
89
|
+
Table: () => Table,
|
|
85
90
|
Tabs: () => Tabs,
|
|
86
91
|
Tag: () => Tag,
|
|
92
|
+
Td: () => Td,
|
|
87
93
|
TextField: () => TextField,
|
|
88
94
|
Textarea: () => Textarea,
|
|
95
|
+
Th: () => Th,
|
|
89
96
|
ThemeStyle: () => ThemeStyle,
|
|
90
97
|
TimePicker: () => TimePicker,
|
|
91
98
|
Toaster: () => Toaster,
|
|
92
99
|
Tooltip: () => Tooltip,
|
|
100
|
+
Tr: () => Tr,
|
|
93
101
|
brandScale: () => scale,
|
|
94
102
|
breakpoints: () => breakpoints,
|
|
95
103
|
colorSchemeScript: () => colorSchemeScript,
|
|
@@ -1305,13 +1313,13 @@ var Combobox = React16.forwardRef(
|
|
|
1305
1313
|
function place() {
|
|
1306
1314
|
if (!boxRef.current) return;
|
|
1307
1315
|
const r = boxRef.current.getBoundingClientRect();
|
|
1308
|
-
const maxH = 320,
|
|
1316
|
+
const maxH = 320, below2 = window.innerHeight - r.bottom - 8, up = below2 < 200 && r.top > below2;
|
|
1309
1317
|
posState[1]({
|
|
1310
1318
|
left: r.left,
|
|
1311
1319
|
width: r.width,
|
|
1312
1320
|
top: up ? void 0 : r.bottom + 4,
|
|
1313
1321
|
bottom: up ? window.innerHeight - r.top + 4 : void 0,
|
|
1314
|
-
maxHeight: Math.min(maxH, (up ? r.top :
|
|
1322
|
+
maxHeight: Math.min(maxH, (up ? r.top : below2) - 8)
|
|
1315
1323
|
});
|
|
1316
1324
|
}
|
|
1317
1325
|
useIsoLayoutEffect(
|
|
@@ -1688,7 +1696,7 @@ function formatDate(iso, opts) {
|
|
|
1688
1696
|
const o = opts || {}, d = fromISO(iso);
|
|
1689
1697
|
if (!d) return "";
|
|
1690
1698
|
const f = typeof o.format === "object" ? o.format : PRESETS[o.format || "short"];
|
|
1691
|
-
const loc = o.locale || "
|
|
1699
|
+
const loc = o.locale || "en";
|
|
1692
1700
|
return fmt(localeTag(loc, o.calendar || defaultCalendar(loc)), f, d).replace(ERA, "");
|
|
1693
1701
|
}
|
|
1694
1702
|
var MONTHS = null;
|
|
@@ -3066,9 +3074,27 @@ var Tooltip = React26.forwardRef(function Tooltip2(props, ref) {
|
|
|
3066
3074
|
function() {
|
|
3067
3075
|
if (!open || !anchor.current || !tip.current) return;
|
|
3068
3076
|
const r = anchor.current.getBoundingClientRect(), t = tip.current.getBoundingClientRect();
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3077
|
+
const vw = window.innerWidth, vh = window.innerHeight, gap = 8, m = 8;
|
|
3078
|
+
let side = props.side || "top";
|
|
3079
|
+
if (side === "top" && r.top - t.height - gap < m && r.bottom + gap + t.height <= vh - m) side = "bottom";
|
|
3080
|
+
else if (side === "bottom" && r.bottom + gap + t.height > vh - m && r.top - t.height - gap >= m) side = "top";
|
|
3081
|
+
else if (side === "left" && r.left - t.width - gap < m && r.right + gap + t.width <= vw - m) side = "right";
|
|
3082
|
+
else if (side === "right" && r.right + gap + t.width > vw - m && r.left - t.width - gap >= m) side = "left";
|
|
3083
|
+
const clampX = function(x) {
|
|
3084
|
+
return Math.max(m, Math.min(x, vw - t.width - m));
|
|
3085
|
+
};
|
|
3086
|
+
const clampY = function(y) {
|
|
3087
|
+
return Math.max(m, Math.min(y, vh - t.height - m));
|
|
3088
|
+
};
|
|
3089
|
+
let top, left;
|
|
3090
|
+
if (side === "top" || side === "bottom") {
|
|
3091
|
+
top = side === "top" ? r.top - t.height - gap : r.bottom + gap;
|
|
3092
|
+
left = clampX(r.left + r.width / 2 - t.width / 2);
|
|
3093
|
+
} else {
|
|
3094
|
+
left = side === "left" ? r.left - t.width - gap : r.right + gap;
|
|
3095
|
+
left = clampX(left);
|
|
3096
|
+
top = clampY(r.top + r.height / 2 - t.height / 2);
|
|
3097
|
+
}
|
|
3072
3098
|
pos[1]({ top, left });
|
|
3073
3099
|
},
|
|
3074
3100
|
[open]
|
|
@@ -3204,7 +3230,16 @@ var DEFAULT_COLUMNS = [
|
|
|
3204
3230
|
{ key: "owner", label: "OWNER" }
|
|
3205
3231
|
];
|
|
3206
3232
|
var SKELETON_WIDTHS = ["72%", "56%", "84%", "44%", "64%"];
|
|
3207
|
-
var
|
|
3233
|
+
var Q = 1e4;
|
|
3234
|
+
var MAX_HIDE_LEVELS = 3;
|
|
3235
|
+
function below(w, threshold) {
|
|
3236
|
+
return w < threshold * (1 - 0.5 / Q);
|
|
3237
|
+
}
|
|
3238
|
+
function hidePx(c) {
|
|
3239
|
+
if (c.hideBelow == null) return void 0;
|
|
3240
|
+
const px = typeof c.hideBelow === "number" ? c.hideBelow : BP[c.hideBelow];
|
|
3241
|
+
return px != null && px > 0 ? px : void 0;
|
|
3242
|
+
}
|
|
3208
3243
|
var ROW_H_DEFAULT = 48;
|
|
3209
3244
|
var OVERSCAN = 8;
|
|
3210
3245
|
var FLEX_MIN = 160;
|
|
@@ -3280,36 +3315,55 @@ var DataTable = React28.forwardRef(function DataTable2(props, ref) {
|
|
|
3280
3315
|
const measure = !!props.stackBelow || columns.some(function(c) {
|
|
3281
3316
|
return c.hideBelow != null;
|
|
3282
3317
|
});
|
|
3283
|
-
const dual = !!props.stackBelow && boxWidth[0] == null && STACK_WIDTHS.indexOf(props.stackBelow) >= 0;
|
|
3284
3318
|
React28.useEffect(
|
|
3285
3319
|
function() {
|
|
3286
3320
|
if (!measure || !wrapRef.current || typeof ResizeObserver === "undefined") return;
|
|
3287
3321
|
const ro = new ResizeObserver(function(en) {
|
|
3288
|
-
|
|
3322
|
+
const bb = en[0].borderBoxSize && en[0].borderBoxSize[0];
|
|
3323
|
+
boxWidth[1](bb ? bb.inlineSize : en[0].target.getBoundingClientRect().width);
|
|
3289
3324
|
});
|
|
3290
3325
|
ro.observe(wrapRef.current);
|
|
3291
3326
|
return function() {
|
|
3292
3327
|
ro.disconnect();
|
|
3293
3328
|
};
|
|
3294
3329
|
},
|
|
3295
|
-
[measure
|
|
3330
|
+
[measure]
|
|
3296
3331
|
);
|
|
3297
|
-
const stacked = !!props.stackBelow && boxWidth[0] != null && boxWidth[0]
|
|
3332
|
+
const stacked = !!props.stackBelow && boxWidth[0] != null && below(boxWidth[0], props.stackBelow);
|
|
3298
3333
|
useIsoLayoutEffect(
|
|
3299
3334
|
function() {
|
|
3300
3335
|
if (measure && boxWidth[0] == null && wrapRef.current) boxWidth[1](wrapRef.current.getBoundingClientRect().width);
|
|
3301
3336
|
},
|
|
3302
3337
|
[measure]
|
|
3303
3338
|
);
|
|
3339
|
+
const hideLevels = [];
|
|
3340
|
+
columns.forEach(function(c) {
|
|
3341
|
+
const px = hidePx(c);
|
|
3342
|
+
if (px != null && hideLevels.indexOf(px) < 0) hideLevels.push(px);
|
|
3343
|
+
});
|
|
3344
|
+
hideLevels.sort(function(a, b) {
|
|
3345
|
+
return b - a;
|
|
3346
|
+
});
|
|
3347
|
+
hideLevels.length = Math.min(hideLevels.length, MAX_HIDE_LEVELS);
|
|
3348
|
+
const levels = [];
|
|
3349
|
+
if (props.stackBelow && props.stackBelow > 0) levels.push({ name: "stack", px: props.stackBelow });
|
|
3350
|
+
hideLevels.forEach(function(px, i) {
|
|
3351
|
+
levels.push({ name: "h" + (i + 1), px });
|
|
3352
|
+
});
|
|
3353
|
+
function hideLevel(c) {
|
|
3354
|
+
const px = hidePx(c);
|
|
3355
|
+
const i = px == null ? -1 : hideLevels.indexOf(px);
|
|
3356
|
+
return i < 0 ? void 0 : i + 1;
|
|
3357
|
+
}
|
|
3304
3358
|
function tooNarrow(c) {
|
|
3305
3359
|
if (c.hideBelow == null || boxWidth[0] == null || stacked) return false;
|
|
3306
|
-
const px =
|
|
3307
|
-
return px != null && boxWidth[0]
|
|
3360
|
+
const px = hidePx(c);
|
|
3361
|
+
return px != null && below(boxWidth[0], px);
|
|
3308
3362
|
}
|
|
3309
3363
|
const scrollRef = React28.useRef(null);
|
|
3310
3364
|
const tipState = React28.useState(null), tip = tipState[0], setTip = tipState[1];
|
|
3311
3365
|
function showFull(e) {
|
|
3312
|
-
const el = e.target.closest ? e.target.closest(".aura-table__td
|
|
3366
|
+
const el = e.target.closest ? e.target.closest(".aura-table__td") : null;
|
|
3313
3367
|
if (!el || el.scrollWidth <= el.clientWidth + 1 || el.querySelector("button, input, .aura-pill"))
|
|
3314
3368
|
return setTip(null);
|
|
3315
3369
|
const r = el.getBoundingClientRect();
|
|
@@ -3341,7 +3395,7 @@ var DataTable = React28.forwardRef(function DataTable2(props, ref) {
|
|
|
3341
3395
|
const pending = React28.useRef(null);
|
|
3342
3396
|
const resizing = React28.useRef(false);
|
|
3343
3397
|
useIsoLayoutEffect(function() {
|
|
3344
|
-
if (
|
|
3398
|
+
if (!gridRef.current) return;
|
|
3345
3399
|
const els = gridRef.current.querySelectorAll(
|
|
3346
3400
|
'.aura-table__td button, .aura-table__td a[href], .aura-table__td input, .aura-table__td select, .aura-table__td textarea, .aura-table__td [tabindex="0"]'
|
|
3347
3401
|
);
|
|
@@ -3373,12 +3427,31 @@ var DataTable = React28.forwardRef(function DataTable2(props, ref) {
|
|
|
3373
3427
|
})
|
|
3374
3428
|
);
|
|
3375
3429
|
const nPinned = vis.filter(isPinned).length;
|
|
3430
|
+
const pillKey = (vis.filter(function(c, i) {
|
|
3431
|
+
return i > 0 && c.pill;
|
|
3432
|
+
})[0] || { key: "" }).key;
|
|
3433
|
+
function cardPart(c, i) {
|
|
3434
|
+
return i === 0 ? "title" : c.key === pillKey ? "pill" : c.actions ? "actions" : "field";
|
|
3435
|
+
}
|
|
3436
|
+
function cardAttrs(c, i) {
|
|
3437
|
+
const part = cardPart(c, i), lv = hideLevel(c);
|
|
3438
|
+
return {
|
|
3439
|
+
"data-card": part,
|
|
3440
|
+
"data-label": part === "field" ? c.label || void 0 : void 0,
|
|
3441
|
+
"data-hide": lv ? String(lv) : void 0
|
|
3442
|
+
};
|
|
3443
|
+
}
|
|
3444
|
+
const hasFields = vis.some(function(c, i) {
|
|
3445
|
+
return cardPart(c, i) === "field";
|
|
3446
|
+
});
|
|
3376
3447
|
const hasFlex = vis.some(function(c) {
|
|
3377
3448
|
return widthOf(c) == null;
|
|
3378
3449
|
});
|
|
3379
|
-
let fixedSum = 0;
|
|
3450
|
+
let fixedSum = 0, hideTerms = "";
|
|
3380
3451
|
vis.forEach(function(c) {
|
|
3381
|
-
|
|
3452
|
+
const w = widthOf(c) != null ? widthOf(c) : FLEX_MIN, lv = hideLevel(c);
|
|
3453
|
+
if (lv && boxWidth[0] == null) hideTerms += " + " + w + "px * var(--aura-h" + lv + "-on, 1)";
|
|
3454
|
+
else fixedSum += w;
|
|
3382
3455
|
});
|
|
3383
3456
|
let pinOffsets = {}, acc = 0;
|
|
3384
3457
|
vis.forEach(function(c) {
|
|
@@ -3389,13 +3462,17 @@ var DataTable = React28.forwardRef(function DataTable2(props, ref) {
|
|
|
3389
3462
|
});
|
|
3390
3463
|
const selW = selectable ? " + var(--aura-table-select-width)" : "";
|
|
3391
3464
|
const gutterR = controls ? "var(--aura-space-12)" : "var(--aura-space-6)";
|
|
3392
|
-
const rowMinWidth = "calc(" + fixedSum + "px + var(--aura-space-6) + " + gutterR + selW + ")";
|
|
3465
|
+
const rowMinWidth = "calc(" + fixedSum + "px" + hideTerms + " + var(--aura-space-6) + " + gutterR + selW + ")";
|
|
3393
3466
|
function cellStyle(c, i) {
|
|
3394
|
-
|
|
3395
|
-
if (w == null)
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3467
|
+
const w = widthOf(c), s = {};
|
|
3468
|
+
if (w == null) {
|
|
3469
|
+
s["--aura-cell-flex"] = "1 1 0";
|
|
3470
|
+
s["--aura-cell-min"] = (c.minWidth || FLEX_MIN) + "px";
|
|
3471
|
+
} else {
|
|
3472
|
+
s["--aura-cell-flex"] = !hasFlex && i === vis.length - 1 ? "1 0 auto" : "none";
|
|
3473
|
+
s["--aura-cell-w"] = w + "px";
|
|
3474
|
+
}
|
|
3475
|
+
if (isPinned(c)) s["--aura-cell-left"] = "calc(var(--aura-space-6)" + selW + " + " + pinOffsets[c.key] + "px)";
|
|
3399
3476
|
return s;
|
|
3400
3477
|
}
|
|
3401
3478
|
const view = React28.useMemo(
|
|
@@ -3478,7 +3555,7 @@ var DataTable = React28.forwardRef(function DataTable2(props, ref) {
|
|
|
3478
3555
|
return rowHref ? /* @__PURE__ */ React28.createElement(Link, { href: rowHref(r), className: "aura-table__row-link" }, content) : content;
|
|
3479
3556
|
}
|
|
3480
3557
|
const height = props.height || 0;
|
|
3481
|
-
const virtual = !!height && !loading && pageRows.length > 0;
|
|
3558
|
+
const virtual = !!height && !loading && pageRows.length > 0 && !stacked;
|
|
3482
3559
|
const bodyH = Math.max(ROW_H, height - ROW_H);
|
|
3483
3560
|
let start = 0, end = pageRows.length;
|
|
3484
3561
|
if (virtual) {
|
|
@@ -3833,7 +3910,8 @@ var DataTable = React28.forwardRef(function DataTable2(props, ref) {
|
|
|
3833
3910
|
label: all ? t.deselectAllRows : t.selectAllRows,
|
|
3834
3911
|
onChange: toggleAll
|
|
3835
3912
|
}
|
|
3836
|
-
) : null
|
|
3913
|
+
) : null,
|
|
3914
|
+
nRows ? /* @__PURE__ */ React28.createElement("span", { className: "aura-table__sel-text" }, nSel ? t.selectedCount(nSel) : t.selectAll) : /* @__PURE__ */ React28.createElement("span", { className: "aura-sr-only" }, t.selectRows)
|
|
3837
3915
|
)
|
|
3838
3916
|
);
|
|
3839
3917
|
vis.forEach(function(c, i) {
|
|
@@ -3851,6 +3929,7 @@ var DataTable = React28.forwardRef(function DataTable2(props, ref) {
|
|
|
3851
3929
|
"aria-sort": ariaSort,
|
|
3852
3930
|
"aria-colindex": ci + 1,
|
|
3853
3931
|
style: cellStyle(c, i),
|
|
3932
|
+
"data-hide": hideLevel(c) ? String(hideLevel(c)) : void 0,
|
|
3854
3933
|
tabIndex: tabFor(0, ci),
|
|
3855
3934
|
"data-rc": "0:" + ci,
|
|
3856
3935
|
className: cx(
|
|
@@ -4007,6 +4086,7 @@ var DataTable = React28.forwardRef(function DataTable2(props, ref) {
|
|
|
4007
4086
|
pin && j === nPinned - 1 && "is-pin-edge"
|
|
4008
4087
|
),
|
|
4009
4088
|
style: cellStyle(c, j),
|
|
4089
|
+
...cardAttrs(c, j),
|
|
4010
4090
|
onFocus: function() {
|
|
4011
4091
|
if (activeState[0].r !== ri || activeState[0].c !== ci) activeState[1]({ r: ri, c: ci });
|
|
4012
4092
|
}
|
|
@@ -4015,6 +4095,7 @@ var DataTable = React28.forwardRef(function DataTable2(props, ref) {
|
|
|
4015
4095
|
)
|
|
4016
4096
|
);
|
|
4017
4097
|
});
|
|
4098
|
+
if (hasFields) cells.push(/* @__PURE__ */ React28.createElement("span", { key: "__br", className: "aura-table__break", "aria-hidden": true }));
|
|
4018
4099
|
cells.push(
|
|
4019
4100
|
/* @__PURE__ */ React28.createElement(
|
|
4020
4101
|
"span",
|
|
@@ -4028,7 +4109,7 @@ var DataTable = React28.forwardRef(function DataTable2(props, ref) {
|
|
|
4028
4109
|
return cells;
|
|
4029
4110
|
}
|
|
4030
4111
|
let body;
|
|
4031
|
-
const rowStyle = {
|
|
4112
|
+
const rowStyle = { ["--aura-row-min"]: rowMinWidth };
|
|
4032
4113
|
if (loading) {
|
|
4033
4114
|
const n2 = pageSize || props.skeletonRows || 5;
|
|
4034
4115
|
const skRows = body = [];
|
|
@@ -4045,7 +4126,9 @@ var DataTable = React28.forwardRef(function DataTable2(props, ref) {
|
|
|
4045
4126
|
{
|
|
4046
4127
|
key: c.key,
|
|
4047
4128
|
className: cx("aura-table__td", c.align === "end" && "is-end", isPinned(c) && "is-pinned"),
|
|
4048
|
-
style: cellStyle(c, j)
|
|
4129
|
+
style: cellStyle(c, j),
|
|
4130
|
+
...cardAttrs(c, j),
|
|
4131
|
+
"data-label": void 0
|
|
4049
4132
|
},
|
|
4050
4133
|
/* @__PURE__ */ React28.createElement(
|
|
4051
4134
|
"span",
|
|
@@ -4057,6 +4140,7 @@ var DataTable = React28.forwardRef(function DataTable2(props, ref) {
|
|
|
4057
4140
|
)
|
|
4058
4141
|
);
|
|
4059
4142
|
});
|
|
4143
|
+
if (hasFields) sk.push(/* @__PURE__ */ React28.createElement("span", { key: "__br", className: "aura-table__break" }));
|
|
4060
4144
|
sk.push(
|
|
4061
4145
|
/* @__PURE__ */ React28.createElement("span", { key: "__gr", className: cx("aura-table__gutter aura-table__gutter--end", controls && "has-picker") })
|
|
4062
4146
|
);
|
|
@@ -4142,102 +4226,6 @@ var DataTable = React28.forwardRef(function DataTable2(props, ref) {
|
|
|
4142
4226
|
} else if (height && rows.length && !loading) {
|
|
4143
4227
|
foot = /* @__PURE__ */ React28.createElement("div", { className: "aura-table__foot" }, /* @__PURE__ */ React28.createElement("span", null, t.rowCount(shownTotal)), selectable && selected.length ? /* @__PURE__ */ React28.createElement("span", null, t.selectedCount(selected.length)) : /* @__PURE__ */ React28.createElement("span", null));
|
|
4144
4228
|
}
|
|
4145
|
-
function renderStacked(wrapRefArg) {
|
|
4146
|
-
const titleCol = vis[0], pillCol = vis.filter(function(c) {
|
|
4147
|
-
return c.pill && c !== titleCol;
|
|
4148
|
-
})[0];
|
|
4149
|
-
const actionCols = vis.filter(function(c) {
|
|
4150
|
-
return c.actions && c !== titleCol;
|
|
4151
|
-
});
|
|
4152
|
-
const rest = vis.filter(function(c) {
|
|
4153
|
-
return c !== titleCol && c !== pillCol && !c.actions;
|
|
4154
|
-
});
|
|
4155
|
-
let cardBody;
|
|
4156
|
-
if (loading) {
|
|
4157
|
-
cardBody = /* @__PURE__ */ React28.createElement("ul", { className: "aura-table__cards", "aria-busy": true }, [0, 1, 2].map(function(i) {
|
|
4158
|
-
return /* @__PURE__ */ React28.createElement("li", { key: i, className: "aura-table__card", "aria-hidden": true }, /* @__PURE__ */ React28.createElement("span", { className: "aura-skel", style: { width: "50%", height: "14px" } }), /* @__PURE__ */ React28.createElement("span", { className: "aura-skel", style: { width: "80%" } }), /* @__PURE__ */ React28.createElement("span", { className: "aura-skel", style: { width: "64%" } }));
|
|
4159
|
-
}));
|
|
4160
|
-
} else if (!rows.length) {
|
|
4161
|
-
const em2 = props.empty || {};
|
|
4162
|
-
cardBody = /* @__PURE__ */ React28.createElement("div", { className: "aura-table__empty" }, /* @__PURE__ */ React28.createElement("div", null, /* @__PURE__ */ React28.createElement("span", { className: "aura-table__empty-icon" }, /* @__PURE__ */ React28.createElement(Icon, { name: em2.icon || "inbox", size: "lg" })), /* @__PURE__ */ React28.createElement("p", { className: "aura-table__empty-title" }, em2.title || t.empty), em2.description ? /* @__PURE__ */ React28.createElement("p", { className: "aura-table__empty-text" }, em2.description) : null, em2.action ? /* @__PURE__ */ React28.createElement("div", { className: "aura-table__empty-action" }, em2.action) : null));
|
|
4163
|
-
} else {
|
|
4164
|
-
const cellVal = cellContent;
|
|
4165
|
-
cardBody = /* @__PURE__ */ React28.createElement("ul", { className: "aura-table__cards", "aria-label": props.label }, pageRows.map(function(r) {
|
|
4166
|
-
const k = r[rowKey], isSel = !!selSet[k];
|
|
4167
|
-
return /* @__PURE__ */ React28.createElement(
|
|
4168
|
-
"li",
|
|
4169
|
-
{
|
|
4170
|
-
key: k,
|
|
4171
|
-
className: cx(
|
|
4172
|
-
"aura-table__card",
|
|
4173
|
-
isSel && "is-selected",
|
|
4174
|
-
(props.onRowActivate || rowHref) && "is-actionable"
|
|
4175
|
-
),
|
|
4176
|
-
tabIndex: props.onRowActivate && !rowHref ? 0 : void 0,
|
|
4177
|
-
onClick: function(e) {
|
|
4178
|
-
const el = e.target;
|
|
4179
|
-
if (el.closest && el.closest(".aura-check, button, a, input")) return;
|
|
4180
|
-
if (rowHref) followRow(e.currentTarget, e);
|
|
4181
|
-
else if (props.onRowActivate) props.onRowActivate(r);
|
|
4182
|
-
},
|
|
4183
|
-
onKeyDown: function(e) {
|
|
4184
|
-
if (e.target === e.currentTarget && e.key === "Enter" && props.onRowActivate && !rowHref)
|
|
4185
|
-
props.onRowActivate(r);
|
|
4186
|
-
}
|
|
4187
|
-
},
|
|
4188
|
-
/* @__PURE__ */ React28.createElement("div", { className: "aura-table__card-head" }, selectable ? /* @__PURE__ */ React28.createElement(
|
|
4189
|
-
Checkbox,
|
|
4190
|
-
{
|
|
4191
|
-
checked: isSel,
|
|
4192
|
-
label: t.selectRow(k),
|
|
4193
|
-
onChange: function(on) {
|
|
4194
|
-
toggle(k, on);
|
|
4195
|
-
}
|
|
4196
|
-
}
|
|
4197
|
-
) : null, /* @__PURE__ */ React28.createElement("span", { className: cx("aura-table__card-title", titleCol.mono && "aura-table__mono") }, rowLinkWrap(r, cellVal(titleCol, r))), pillCol ? cellVal(pillCol, r) : null, actionCols.map(function(c) {
|
|
4198
|
-
return /* @__PURE__ */ React28.createElement("span", { key: c.key, className: "aura-table__card-actions" }, cellVal(c, r));
|
|
4199
|
-
})),
|
|
4200
|
-
rest.length ? /* @__PURE__ */ React28.createElement("dl", { className: "aura-table__card-fields" }, rest.map(function(c) {
|
|
4201
|
-
return /* @__PURE__ */ React28.createElement("div", { key: c.key }, /* @__PURE__ */ React28.createElement("dt", null, c.label), /* @__PURE__ */ React28.createElement("dd", { className: cx(c.mono && "aura-table__mono", c.align === "end" && "is-end") }, cellVal(c, r)));
|
|
4202
|
-
})) : null
|
|
4203
|
-
);
|
|
4204
|
-
}));
|
|
4205
|
-
}
|
|
4206
|
-
return /* @__PURE__ */ React28.createElement(
|
|
4207
|
-
"div",
|
|
4208
|
-
{
|
|
4209
|
-
ref: wrapRefArg,
|
|
4210
|
-
"data-density": props.density,
|
|
4211
|
-
className: cx("aura-table aura-table--stacked", refreshing && "is-refreshing", props.className),
|
|
4212
|
-
onMouseOver: showFull,
|
|
4213
|
-
onMouseLeave: hideFull,
|
|
4214
|
-
onFocus: showFull,
|
|
4215
|
-
onBlur: hideFull,
|
|
4216
|
-
role: "region",
|
|
4217
|
-
"aria-label": props.label,
|
|
4218
|
-
"aria-busy": busy || void 0
|
|
4219
|
-
},
|
|
4220
|
-
refreshing ? /* @__PURE__ */ React28.createElement("span", { className: "aura-table__busy-bar", "aria-hidden": true }) : null,
|
|
4221
|
-
selectable && pageRows.length && !busy ? /* @__PURE__ */ React28.createElement("div", { className: "aura-table__stack-bar" }, /* @__PURE__ */ React28.createElement(
|
|
4222
|
-
Checkbox,
|
|
4223
|
-
{
|
|
4224
|
-
checked: all,
|
|
4225
|
-
indeterminate: nSel > 0 && !all,
|
|
4226
|
-
label: all ? t.deselectAllRows : t.selectAllRows,
|
|
4227
|
-
onChange: toggleAll
|
|
4228
|
-
}
|
|
4229
|
-
), /* @__PURE__ */ React28.createElement("span", null, nSel ? t.selectedCount(nSel) : t.selectAll)) : null,
|
|
4230
|
-
cardBody,
|
|
4231
|
-
props.footer && rows.length && !loading ? /* @__PURE__ */ React28.createElement("div", { className: "aura-table__card aura-table__card--total", role: "group", "aria-label": t.totals }, /* @__PURE__ */ React28.createElement("dl", { className: "aura-table__card-fields" }, vis.filter(function(c) {
|
|
4232
|
-
return props.footer[c.key] != null;
|
|
4233
|
-
}).map(function(c) {
|
|
4234
|
-
return /* @__PURE__ */ React28.createElement("div", { key: c.key }, /* @__PURE__ */ React28.createElement("dt", null, c.label || t.totals), /* @__PURE__ */ React28.createElement("dd", { className: cx(c.mono && "aura-table__mono", c.align === "end" && "is-end") }, props.footer[c.key]));
|
|
4235
|
-
}))) : null,
|
|
4236
|
-
foot,
|
|
4237
|
-
tipEl
|
|
4238
|
-
);
|
|
4239
|
-
}
|
|
4240
|
-
if (stacked) return renderStacked(wrapMerged);
|
|
4241
4229
|
const totalRow = props.footer && rows.length && !loading ? /* @__PURE__ */ React28.createElement(
|
|
4242
4230
|
"div",
|
|
4243
4231
|
{
|
|
@@ -4262,13 +4250,17 @@ var DataTable = React28.forwardRef(function DataTable2(props, ref) {
|
|
|
4262
4250
|
c.mono && "aura-table__mono",
|
|
4263
4251
|
c.align === "end" && "is-end",
|
|
4264
4252
|
pin && "is-pinned",
|
|
4265
|
-
pin && j === nPinned - 1 && "is-pin-edge"
|
|
4253
|
+
pin && j === nPinned - 1 && "is-pin-edge",
|
|
4254
|
+
props.footer[c.key] == null && "is-blank"
|
|
4266
4255
|
),
|
|
4267
|
-
style: cellStyle(c, j)
|
|
4256
|
+
style: cellStyle(c, j),
|
|
4257
|
+
...cardAttrs(c, j),
|
|
4258
|
+
"data-label": j === 0 ? void 0 : c.label || t.totals
|
|
4268
4259
|
},
|
|
4269
4260
|
props.footer[c.key]
|
|
4270
4261
|
);
|
|
4271
4262
|
}),
|
|
4263
|
+
hasFields ? /* @__PURE__ */ React28.createElement("span", { className: "aura-table__break", "aria-hidden": true }) : null,
|
|
4272
4264
|
/* @__PURE__ */ React28.createElement(
|
|
4273
4265
|
"span",
|
|
4274
4266
|
{
|
|
@@ -4281,13 +4273,20 @@ var DataTable = React28.forwardRef(function DataTable2(props, ref) {
|
|
|
4281
4273
|
scrollPaddingLeft: "calc(var(--aura-space-6)" + selW + " + " + acc + "px)",
|
|
4282
4274
|
scrollPaddingTop: ROW_H + "px"
|
|
4283
4275
|
};
|
|
4284
|
-
if (height) scrollStyle
|
|
4276
|
+
if (height) scrollStyle["--aura-table-h"] = height + "px";
|
|
4285
4277
|
const gridEl = /* @__PURE__ */ React28.createElement(
|
|
4286
4278
|
"div",
|
|
4287
4279
|
{
|
|
4288
|
-
ref:
|
|
4280
|
+
ref: levels.length ? wrapRef : wrapMerged,
|
|
4289
4281
|
"data-density": props.density,
|
|
4290
|
-
className: cx(
|
|
4282
|
+
className: cx(
|
|
4283
|
+
"aura-table",
|
|
4284
|
+
stacked && "aura-table--stacked",
|
|
4285
|
+
scrolledX[0] && "is-scrolled-x",
|
|
4286
|
+
refreshing && "is-refreshing",
|
|
4287
|
+
!levels.length && props.className
|
|
4288
|
+
),
|
|
4289
|
+
style: levels.length ? { ["--aura-q-back"]: String(levels[levels.length - 1].px / Q) } : void 0
|
|
4291
4290
|
},
|
|
4292
4291
|
refreshing ? /* @__PURE__ */ React28.createElement("span", { className: "aura-table__busy-bar", "aria-hidden": true }) : null,
|
|
4293
4292
|
/* @__PURE__ */ React28.createElement(
|
|
@@ -4319,7 +4318,16 @@ var DataTable = React28.forwardRef(function DataTable2(props, ref) {
|
|
|
4319
4318
|
if (sx !== scrolledX[0]) scrolledX[1](sx);
|
|
4320
4319
|
}
|
|
4321
4320
|
},
|
|
4322
|
-
/* @__PURE__ */ React28.createElement(
|
|
4321
|
+
/* @__PURE__ */ React28.createElement(
|
|
4322
|
+
"div",
|
|
4323
|
+
{
|
|
4324
|
+
className: cx("aura-table__head", selectable && nRows > 0 && !busy && "has-select-all"),
|
|
4325
|
+
role: "row",
|
|
4326
|
+
"aria-rowindex": 1,
|
|
4327
|
+
style: rowStyle
|
|
4328
|
+
},
|
|
4329
|
+
head
|
|
4330
|
+
),
|
|
4323
4331
|
body,
|
|
4324
4332
|
totalRow
|
|
4325
4333
|
),
|
|
@@ -4347,8 +4355,20 @@ var DataTable = React28.forwardRef(function DataTable2(props, ref) {
|
|
|
4347
4355
|
) : null,
|
|
4348
4356
|
tipEl
|
|
4349
4357
|
);
|
|
4350
|
-
if (!
|
|
4351
|
-
|
|
4358
|
+
if (!levels.length) return gridEl;
|
|
4359
|
+
let out = gridEl;
|
|
4360
|
+
for (let i = levels.length - 1; i >= 0; i--) {
|
|
4361
|
+
const prev = i === 0 ? Q : levels[i - 1].px;
|
|
4362
|
+
out = /* @__PURE__ */ React28.createElement(
|
|
4363
|
+
"div",
|
|
4364
|
+
{
|
|
4365
|
+
className: cx("aura-table-q", "aura-table-q--" + levels[i].name),
|
|
4366
|
+
style: { ["--aura-q-scale"]: String(prev / levels[i].px) }
|
|
4367
|
+
},
|
|
4368
|
+
out
|
|
4369
|
+
);
|
|
4370
|
+
}
|
|
4371
|
+
return /* @__PURE__ */ React28.createElement("div", { ref, className: cx("aura-table-box", props.className) }, out);
|
|
4352
4372
|
});
|
|
4353
4373
|
|
|
4354
4374
|
// src/Card.tsx
|
|
@@ -4936,9 +4956,96 @@ var ActionBar = React39.forwardRef(function ActionBar2(props, ref) {
|
|
|
4936
4956
|
);
|
|
4937
4957
|
});
|
|
4938
4958
|
|
|
4939
|
-
// src/
|
|
4959
|
+
// src/Separator.tsx
|
|
4940
4960
|
var React40 = __toESM(require("react"), 1);
|
|
4941
|
-
var
|
|
4961
|
+
var Separator = React40.forwardRef(function Separator2(props, ref) {
|
|
4962
|
+
const vertical = props.orientation === "vertical";
|
|
4963
|
+
const decorative = props.decorative !== false;
|
|
4964
|
+
return /* @__PURE__ */ React40.createElement(
|
|
4965
|
+
"div",
|
|
4966
|
+
{
|
|
4967
|
+
ref,
|
|
4968
|
+
className: cx("aura-separator", vertical && "aura-separator--vertical", props.className),
|
|
4969
|
+
role: decorative ? "none" : "separator",
|
|
4970
|
+
"aria-orientation": !decorative && vertical ? "vertical" : void 0,
|
|
4971
|
+
style: props.spacing != null ? { ["--aura-separator-space"]: "var(--aura-space-" + props.spacing + ")" } : void 0
|
|
4972
|
+
}
|
|
4973
|
+
);
|
|
4974
|
+
});
|
|
4975
|
+
|
|
4976
|
+
// src/Table.tsx
|
|
4977
|
+
var React41 = __toESM(require("react"), 1);
|
|
4978
|
+
var Table = React41.forwardRef(function Table2(props, ref) {
|
|
4979
|
+
const { caption, captionHidden, density, className, children, ...rest } = props;
|
|
4980
|
+
const capId = uid();
|
|
4981
|
+
const wrap = React41.useRef(null);
|
|
4982
|
+
const sc = React41.useState(false), scrolls = sc[0];
|
|
4983
|
+
useIsoLayoutEffect(function() {
|
|
4984
|
+
const el = wrap.current;
|
|
4985
|
+
if (!el || typeof ResizeObserver === "undefined") return;
|
|
4986
|
+
function check() {
|
|
4987
|
+
sc[1](el.scrollWidth > el.clientWidth + 1);
|
|
4988
|
+
}
|
|
4989
|
+
check();
|
|
4990
|
+
const ro = new ResizeObserver(check);
|
|
4991
|
+
ro.observe(el);
|
|
4992
|
+
return function() {
|
|
4993
|
+
ro.disconnect();
|
|
4994
|
+
};
|
|
4995
|
+
}, []);
|
|
4996
|
+
return /* @__PURE__ */ React41.createElement(
|
|
4997
|
+
"div",
|
|
4998
|
+
{
|
|
4999
|
+
ref: wrap,
|
|
5000
|
+
className: "aura-tbl-wrap",
|
|
5001
|
+
"data-density": density,
|
|
5002
|
+
tabIndex: scrolls ? 0 : void 0,
|
|
5003
|
+
role: scrolls ? "region" : void 0,
|
|
5004
|
+
"aria-labelledby": scrolls && caption != null ? capId : void 0
|
|
5005
|
+
},
|
|
5006
|
+
/* @__PURE__ */ React41.createElement("table", { ref, className: cx("aura-tbl", className), ...rest }, caption != null ? /* @__PURE__ */ React41.createElement("caption", { id: capId, className: cx("aura-tbl__caption", captionHidden && "aura-sr-only") }, caption) : null, children)
|
|
5007
|
+
);
|
|
5008
|
+
});
|
|
5009
|
+
function section(tag, cls) {
|
|
5010
|
+
const C = React41.forwardRef(function TableSection(props, ref) {
|
|
5011
|
+
const { className, ...rest } = props;
|
|
5012
|
+
return React41.createElement(tag, Object.assign({ ref, className: cx(cls, className) }, rest));
|
|
5013
|
+
});
|
|
5014
|
+
return C;
|
|
5015
|
+
}
|
|
5016
|
+
var THead = section("thead", "aura-tbl__head");
|
|
5017
|
+
THead.displayName = "THead";
|
|
5018
|
+
var TBody = section("tbody", "aura-tbl__body");
|
|
5019
|
+
TBody.displayName = "TBody";
|
|
5020
|
+
var TFoot = section("tfoot", "aura-tbl__foot");
|
|
5021
|
+
TFoot.displayName = "TFoot";
|
|
5022
|
+
var Tr = React41.forwardRef(function Tr2(props, ref) {
|
|
5023
|
+
const { className, ...rest } = props;
|
|
5024
|
+
return /* @__PURE__ */ React41.createElement("tr", { ref, className: cx("aura-tbl__row", className), ...rest });
|
|
5025
|
+
});
|
|
5026
|
+
function cellClass(base, p) {
|
|
5027
|
+
const align = p.align || (p.numeric ? "end" : void 0);
|
|
5028
|
+
return cx(
|
|
5029
|
+
base,
|
|
5030
|
+
align === "end" && "is-end",
|
|
5031
|
+
align === "center" && "is-center",
|
|
5032
|
+
p.numeric && "is-numeric",
|
|
5033
|
+
p.mono && "aura-table__mono",
|
|
5034
|
+
p.className
|
|
5035
|
+
);
|
|
5036
|
+
}
|
|
5037
|
+
var Th = React41.forwardRef(function Th2(props, ref) {
|
|
5038
|
+
const { align, numeric, mono, className, scope, ...rest } = props;
|
|
5039
|
+
return /* @__PURE__ */ React41.createElement("th", { ref, scope: scope || "col", className: cellClass("aura-tbl__th", props), ...rest });
|
|
5040
|
+
});
|
|
5041
|
+
var Td = React41.forwardRef(function Td2(props, ref) {
|
|
5042
|
+
const { align, numeric, mono, className, scope, ...rest } = props;
|
|
5043
|
+
return /* @__PURE__ */ React41.createElement("td", { ref, className: cellClass("aura-tbl__td", props), ...rest });
|
|
5044
|
+
});
|
|
5045
|
+
|
|
5046
|
+
// src/BottomNav.tsx
|
|
5047
|
+
var React42 = __toESM(require("react"), 1);
|
|
5048
|
+
var BottomNav = React42.forwardRef(function BottomNav2(props, ref) {
|
|
4942
5049
|
const t = useStrings();
|
|
4943
5050
|
const Link = useLinkComponent(props.linkComponent);
|
|
4944
5051
|
const st = useMaybeControlled(
|
|
@@ -4948,14 +5055,14 @@ var BottomNav = React40.forwardRef(function BottomNav2(props, ref) {
|
|
|
4948
5055
|
);
|
|
4949
5056
|
const active = st[0];
|
|
4950
5057
|
const hide = props.hideFrom === false ? "always" : "below-" + (props.hideFrom || "lg");
|
|
4951
|
-
return /* @__PURE__ */
|
|
5058
|
+
return /* @__PURE__ */ React42.createElement(React42.Fragment, null, /* @__PURE__ */ React42.createElement("div", { className: cx("aura-bottomnav-spacer", "aura-bottomnav--" + hide), "aria-hidden": "true" }), /* @__PURE__ */ React42.createElement(
|
|
4952
5059
|
"nav",
|
|
4953
5060
|
{
|
|
4954
5061
|
ref,
|
|
4955
5062
|
className: cx("aura-bottomnav", "aura-bottomnav--" + hide, props.className),
|
|
4956
5063
|
"aria-label": props.label || t.mainNav
|
|
4957
5064
|
},
|
|
4958
|
-
/* @__PURE__ */
|
|
5065
|
+
/* @__PURE__ */ React42.createElement("ul", { className: "aura-bottomnav__list" }, props.items.map(function(it) {
|
|
4959
5066
|
const on = active === it.id;
|
|
4960
5067
|
const count = it.count != null && it.count > 0 ? it.count > 99 ? "99+" : String(it.count) : null;
|
|
4961
5068
|
const common = {
|
|
@@ -4967,19 +5074,19 @@ var BottomNav = React40.forwardRef(function BottomNav2(props, ref) {
|
|
|
4967
5074
|
}
|
|
4968
5075
|
};
|
|
4969
5076
|
const inner = [
|
|
4970
|
-
/* @__PURE__ */
|
|
4971
|
-
/* @__PURE__ */
|
|
4972
|
-
count || it.badge && it.badgeLabel ? /* @__PURE__ */
|
|
5077
|
+
/* @__PURE__ */ React42.createElement("span", { key: "i", className: "aura-bottomnav__icon" }, /* @__PURE__ */ React42.createElement(Icon, { name: it.icon, size: "md" }), count ? /* @__PURE__ */ React42.createElement("span", { className: "aura-bottomnav__count", "aria-hidden": "true" }, count) : it.badge ? /* @__PURE__ */ React42.createElement("span", { className: "aura-bottomnav__dot", "aria-hidden": "true" }) : null),
|
|
5078
|
+
/* @__PURE__ */ React42.createElement("span", { key: "l", className: "aura-bottomnav__label" }, it.label),
|
|
5079
|
+
count || it.badge && it.badgeLabel ? /* @__PURE__ */ React42.createElement("span", { key: "s", className: "aura-sr-only" }, " (" + (count || it.badgeLabel) + ")") : null
|
|
4973
5080
|
];
|
|
4974
|
-
return /* @__PURE__ */
|
|
5081
|
+
return /* @__PURE__ */ React42.createElement("li", { key: it.id, className: "aura-bottomnav__cell" }, it.href ? /* @__PURE__ */ React42.createElement(Link, { href: it.href, ...common }, inner) : /* @__PURE__ */ React42.createElement("button", { type: "button", ...common }, inner));
|
|
4975
5082
|
}))
|
|
4976
5083
|
));
|
|
4977
5084
|
});
|
|
4978
5085
|
|
|
4979
5086
|
// src/Surface.tsx
|
|
4980
|
-
var
|
|
4981
|
-
var h8 =
|
|
4982
|
-
var Surface =
|
|
5087
|
+
var React43 = __toESM(require("react"), 1);
|
|
5088
|
+
var h8 = React43.createElement;
|
|
5089
|
+
var Surface = React43.forwardRef(function Surface2(props, ref) {
|
|
4983
5090
|
const t = props.texture || "mesh";
|
|
4984
5091
|
const rest = omit(props, ["texture", "className", "children", "as"]);
|
|
4985
5092
|
return h8(
|
|
@@ -5000,8 +5107,8 @@ var Surface = React41.forwardRef(function Surface2(props, ref) {
|
|
|
5000
5107
|
});
|
|
5001
5108
|
|
|
5002
5109
|
// src/Stat.tsx
|
|
5003
|
-
var
|
|
5004
|
-
var Stat =
|
|
5110
|
+
var React44 = __toESM(require("react"), 1);
|
|
5111
|
+
var Stat = React44.forwardRef(function Stat2(props, ref) {
|
|
5005
5112
|
const ch = props.change;
|
|
5006
5113
|
const dir = ch && (ch.direction || "flat");
|
|
5007
5114
|
const tone2 = ch && (ch.tone || (dir === "up" ? "positive" : dir === "down" ? "negative" : "neutral"));
|
|
@@ -5010,7 +5117,7 @@ var Stat = React42.forwardRef(function Stat2(props, ref) {
|
|
|
5010
5117
|
const numeric = typeof v === "number" || typeof v === "string" && /\d/.test(v) && /^[\s\d.,:+\-\u2212%()\u0E3F$\u20AC\u00A3\u00A5kKmMbB]+$/.test(v.replace(/\b[A-Z]{3}\b/g, ""));
|
|
5011
5118
|
const Tag3 = props.href ? Link : props.onClick ? "button" : "div";
|
|
5012
5119
|
const interactive = !!(props.href || props.onClick);
|
|
5013
|
-
return /* @__PURE__ */
|
|
5120
|
+
return /* @__PURE__ */ React44.createElement(
|
|
5014
5121
|
Tag3,
|
|
5015
5122
|
{
|
|
5016
5123
|
ref,
|
|
@@ -5020,14 +5127,14 @@ var Stat = React42.forwardRef(function Stat2(props, ref) {
|
|
|
5020
5127
|
type: Tag3 === "button" ? "button" : void 0,
|
|
5021
5128
|
"aria-busy": props.loading || void 0
|
|
5022
5129
|
},
|
|
5023
|
-
/* @__PURE__ */
|
|
5024
|
-
props.loading ? /* @__PURE__ */
|
|
5025
|
-
ch && !props.loading || props.caption ? /* @__PURE__ */
|
|
5130
|
+
/* @__PURE__ */ React44.createElement("span", { className: "aura-stat__head" }, /* @__PURE__ */ React44.createElement("span", { className: "aura-stat__label" }, props.label), props.icon ? /* @__PURE__ */ React44.createElement("span", { className: "aura-stat__icon" }, /* @__PURE__ */ React44.createElement(Icon, { name: props.icon })) : null),
|
|
5131
|
+
props.loading ? /* @__PURE__ */ React44.createElement("span", { className: "aura-stat__value" }, /* @__PURE__ */ React44.createElement("span", { className: "aura-skel aura-stat__skel" })) : /* @__PURE__ */ React44.createElement("span", { className: cx("aura-stat__value", numeric && "is-numeric") }, props.value, props.unit ? /* @__PURE__ */ React44.createElement("span", { className: "aura-stat__unit" }, props.unit) : null),
|
|
5132
|
+
ch && !props.loading || props.caption ? /* @__PURE__ */ React44.createElement("span", { className: "aura-stat__foot" }, ch && !props.loading ? /* @__PURE__ */ React44.createElement("span", { className: cx("aura-stat__change", "is-" + tone2) }, /* @__PURE__ */ React44.createElement(Icon, { name: dir === "up" ? "trending-up" : dir === "down" ? "trending-down" : "minus", size: 14 }), /* @__PURE__ */ React44.createElement("span", null, ch.value)) : null, ch && ch.label && !props.loading ? /* @__PURE__ */ React44.createElement("span", { className: "aura-stat__caption" }, ch.label) : null, props.caption ? /* @__PURE__ */ React44.createElement("span", { className: "aura-stat__caption" }, props.caption) : null) : null
|
|
5026
5133
|
);
|
|
5027
5134
|
});
|
|
5028
5135
|
|
|
5029
5136
|
// src/TimePicker.tsx
|
|
5030
|
-
var
|
|
5137
|
+
var React45 = __toESM(require("react"), 1);
|
|
5031
5138
|
var import_react_dom10 = require("react-dom");
|
|
5032
5139
|
|
|
5033
5140
|
// src/text.ts
|
|
@@ -5068,7 +5175,7 @@ function toMin(t) {
|
|
|
5068
5175
|
function fromMin(n2) {
|
|
5069
5176
|
return pad3(Math.floor(n2 / 60)) + ":" + pad3(n2 % 60);
|
|
5070
5177
|
}
|
|
5071
|
-
var TimePicker =
|
|
5178
|
+
var TimePicker = React45.forwardRef(function TimePicker2(props, ref) {
|
|
5072
5179
|
const t = useStrings();
|
|
5073
5180
|
const auto = uid(), id = props.id || auto, listId = id + "-list";
|
|
5074
5181
|
const st = useMaybeControlled(
|
|
@@ -5078,7 +5185,7 @@ var TimePicker = React43.forwardRef(function TimePicker2(props, ref) {
|
|
|
5078
5185
|
);
|
|
5079
5186
|
const value = st[0];
|
|
5080
5187
|
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;
|
|
5081
|
-
const slots =
|
|
5188
|
+
const slots = React45.useMemo(
|
|
5082
5189
|
function() {
|
|
5083
5190
|
const out = [];
|
|
5084
5191
|
for (let m = lo; m <= hi; m += step) out.push(fromMin(m));
|
|
@@ -5090,12 +5197,12 @@ var TimePicker = React43.forwardRef(function TimePicker2(props, ref) {
|
|
|
5090
5197
|
const n2 = toMin(v);
|
|
5091
5198
|
return n2 == null || n2 < lo || n2 > hi || props.isTimeDisabled && props.isTimeDisabled(v);
|
|
5092
5199
|
}
|
|
5093
|
-
const openState =
|
|
5094
|
-
const editState =
|
|
5095
|
-
const aState =
|
|
5096
|
-
const errState =
|
|
5097
|
-
const pos =
|
|
5098
|
-
const boxRef =
|
|
5200
|
+
const openState = React45.useState(false), open = openState[0], setOpen = openState[1];
|
|
5201
|
+
const editState = React45.useState(null), editing = editState[0], setEditing = editState[1];
|
|
5202
|
+
const aState = React45.useState(0), active = aState[0], setActive = aState[1];
|
|
5203
|
+
const errState = React45.useState(null);
|
|
5204
|
+
const pos = React45.useState(null);
|
|
5205
|
+
const boxRef = React45.useRef(null), inputRef = React45.useRef(null), listRef = React45.useRef(null), inputMerged = useMergedRef(ref, inputRef);
|
|
5099
5206
|
const mounted = useMounted();
|
|
5100
5207
|
function nearest(v) {
|
|
5101
5208
|
const n2 = toMin(v);
|
|
@@ -5108,13 +5215,13 @@ var TimePicker = React43.forwardRef(function TimePicker2(props, ref) {
|
|
|
5108
5215
|
}
|
|
5109
5216
|
function place() {
|
|
5110
5217
|
if (!boxRef.current) return;
|
|
5111
|
-
const r = boxRef.current.getBoundingClientRect(),
|
|
5218
|
+
const r = boxRef.current.getBoundingClientRect(), below2 = window.innerHeight - r.bottom - 8, up = below2 < 200 && r.top > below2;
|
|
5112
5219
|
pos[1]({
|
|
5113
5220
|
left: r.left,
|
|
5114
5221
|
width: Math.max(r.width, 160),
|
|
5115
5222
|
top: up ? void 0 : r.bottom + 4,
|
|
5116
5223
|
bottom: up ? window.innerHeight - r.top + 4 : void 0,
|
|
5117
|
-
maxHeight: Math.min(280, (up ? r.top :
|
|
5224
|
+
maxHeight: Math.min(280, (up ? r.top : below2) - 8)
|
|
5118
5225
|
});
|
|
5119
5226
|
}
|
|
5120
5227
|
useIsoLayoutEffect(
|
|
@@ -5123,7 +5230,7 @@ var TimePicker = React43.forwardRef(function TimePicker2(props, ref) {
|
|
|
5123
5230
|
},
|
|
5124
5231
|
[open]
|
|
5125
5232
|
);
|
|
5126
|
-
|
|
5233
|
+
React45.useEffect(
|
|
5127
5234
|
function() {
|
|
5128
5235
|
if (!open) return;
|
|
5129
5236
|
function outside(e) {
|
|
@@ -5145,7 +5252,7 @@ var TimePicker = React43.forwardRef(function TimePicker2(props, ref) {
|
|
|
5145
5252
|
},
|
|
5146
5253
|
[open]
|
|
5147
5254
|
);
|
|
5148
|
-
|
|
5255
|
+
React45.useEffect(
|
|
5149
5256
|
function() {
|
|
5150
5257
|
if (!open || !listRef.current) return;
|
|
5151
5258
|
const el = listRef.current.querySelector('[data-idx="' + active + '"]');
|
|
@@ -5243,9 +5350,9 @@ var TimePicker = React43.forwardRef(function TimePicker2(props, ref) {
|
|
|
5243
5350
|
}
|
|
5244
5351
|
const error = errState[0] || props.error;
|
|
5245
5352
|
const list = open && mounted && pos[0] ? (0, import_react_dom10.createPortal)(
|
|
5246
|
-
/* @__PURE__ */
|
|
5353
|
+
/* @__PURE__ */ React45.createElement("div", { ref: listRef, className: "aura-combo__popover aura-time__popover", style: pos[0] }, /* @__PURE__ */ React45.createElement("ul", { id: listId, role: "listbox", "aria-label": props.label, className: "aura-combo__list" }, slots.map(function(s, i) {
|
|
5247
5354
|
const dis = blocked(s), sel = s === value;
|
|
5248
|
-
return /* @__PURE__ */
|
|
5355
|
+
return /* @__PURE__ */ React45.createElement(
|
|
5249
5356
|
"li",
|
|
5250
5357
|
{
|
|
5251
5358
|
key: s,
|
|
@@ -5270,13 +5377,13 @@ var TimePicker = React43.forwardRef(function TimePicker2(props, ref) {
|
|
|
5270
5377
|
if (active !== i) setActive(i);
|
|
5271
5378
|
}
|
|
5272
5379
|
},
|
|
5273
|
-
/* @__PURE__ */
|
|
5274
|
-
sel ? /* @__PURE__ */
|
|
5380
|
+
/* @__PURE__ */ React45.createElement("span", { className: "aura-combo__label" }, s),
|
|
5381
|
+
sel ? /* @__PURE__ */ React45.createElement(Icon, { name: "check", className: "aura-combo__check" }) : null
|
|
5275
5382
|
);
|
|
5276
5383
|
}))),
|
|
5277
5384
|
document.body
|
|
5278
5385
|
) : null;
|
|
5279
|
-
return /* @__PURE__ */
|
|
5386
|
+
return /* @__PURE__ */ React45.createElement(
|
|
5280
5387
|
Field,
|
|
5281
5388
|
{
|
|
5282
5389
|
id,
|
|
@@ -5288,7 +5395,7 @@ var TimePicker = React43.forwardRef(function TimePicker2(props, ref) {
|
|
|
5288
5395
|
disabled: props.disabled,
|
|
5289
5396
|
className: props.className
|
|
5290
5397
|
},
|
|
5291
|
-
/* @__PURE__ */
|
|
5398
|
+
/* @__PURE__ */ React45.createElement("div", { ref: boxRef, className: cx("aura-input aura-combo aura-time has-icon", open && "is-open") }, /* @__PURE__ */ React45.createElement(Icon, { name: "clock", className: "aura-input__icon" }), /* @__PURE__ */ React45.createElement(
|
|
5292
5399
|
"input",
|
|
5293
5400
|
{
|
|
5294
5401
|
ref: inputMerged,
|
|
@@ -5328,7 +5435,7 @@ var TimePicker = React43.forwardRef(function TimePicker2(props, ref) {
|
|
|
5328
5435
|
}, 0);
|
|
5329
5436
|
}
|
|
5330
5437
|
}
|
|
5331
|
-
), props.clearable !== false && value != null && !props.disabled ? /* @__PURE__ */
|
|
5438
|
+
), props.clearable !== false && value != null && !props.disabled ? /* @__PURE__ */ React45.createElement(
|
|
5332
5439
|
"button",
|
|
5333
5440
|
{
|
|
5334
5441
|
type: "button",
|
|
@@ -5341,8 +5448,8 @@ var TimePicker = React43.forwardRef(function TimePicker2(props, ref) {
|
|
|
5341
5448
|
if (inputRef.current) inputRef.current.focus();
|
|
5342
5449
|
}
|
|
5343
5450
|
},
|
|
5344
|
-
/* @__PURE__ */
|
|
5345
|
-
) : null, /* @__PURE__ */
|
|
5451
|
+
/* @__PURE__ */ React45.createElement(Icon, { name: "x" })
|
|
5452
|
+
) : null, /* @__PURE__ */ React45.createElement(
|
|
5346
5453
|
"button",
|
|
5347
5454
|
{
|
|
5348
5455
|
type: "button",
|
|
@@ -5360,14 +5467,14 @@ var TimePicker = React43.forwardRef(function TimePicker2(props, ref) {
|
|
|
5360
5467
|
}
|
|
5361
5468
|
}
|
|
5362
5469
|
},
|
|
5363
|
-
/* @__PURE__ */
|
|
5470
|
+
/* @__PURE__ */ React45.createElement(Icon, { name: "chevron-down" })
|
|
5364
5471
|
)),
|
|
5365
5472
|
list
|
|
5366
5473
|
);
|
|
5367
5474
|
});
|
|
5368
5475
|
|
|
5369
5476
|
// src/FileUpload.tsx
|
|
5370
|
-
var
|
|
5477
|
+
var React46 = __toESM(require("react"), 1);
|
|
5371
5478
|
function matches(file, accept) {
|
|
5372
5479
|
if (!accept) return true;
|
|
5373
5480
|
const name = (file.name || "").toLowerCase(), type = (file.type || "").toLowerCase();
|
|
@@ -5391,17 +5498,17 @@ function describeAccept(accept, t) {
|
|
|
5391
5498
|
}).join(", ");
|
|
5392
5499
|
}
|
|
5393
5500
|
var seq = 0;
|
|
5394
|
-
var FileUpload =
|
|
5501
|
+
var FileUpload = React46.forwardRef(function FileUpload2(props, ref) {
|
|
5395
5502
|
const t = useStrings();
|
|
5396
5503
|
const auto = uid(), id = props.id || auto;
|
|
5397
5504
|
const st = useMaybeControlled(props.value, props.defaultValue || [], props.onChange);
|
|
5398
5505
|
const items2 = st[0] || [];
|
|
5399
|
-
const dragState =
|
|
5400
|
-
const inputRef =
|
|
5401
|
-
const urls =
|
|
5506
|
+
const dragState = React46.useState(false), over = dragState[0];
|
|
5507
|
+
const inputRef = React46.useRef(null), inputMerged = useMergedRef(ref, inputRef);
|
|
5508
|
+
const urls = React46.useRef({});
|
|
5402
5509
|
const maxFiles = props.multiple ? props.maxFiles : 1;
|
|
5403
5510
|
const note = t.accepts(describeAccept(props.accept, t), props.maxSize ? formatBytes(props.maxSize) : "");
|
|
5404
|
-
|
|
5511
|
+
React46.useEffect(function() {
|
|
5405
5512
|
return function() {
|
|
5406
5513
|
Object.keys(urls.current).forEach(function(k) {
|
|
5407
5514
|
URL.revokeObjectURL(urls.current[k]);
|
|
@@ -5452,7 +5559,7 @@ var FileUpload = React44.forwardRef(function FileUpload2(props, ref) {
|
|
|
5452
5559
|
if (inputRef.current) inputRef.current.focus();
|
|
5453
5560
|
}
|
|
5454
5561
|
const error = props.error;
|
|
5455
|
-
return /* @__PURE__ */
|
|
5562
|
+
return /* @__PURE__ */ React46.createElement(
|
|
5456
5563
|
Field,
|
|
5457
5564
|
{
|
|
5458
5565
|
id,
|
|
@@ -5464,7 +5571,7 @@ var FileUpload = React44.forwardRef(function FileUpload2(props, ref) {
|
|
|
5464
5571
|
disabled: props.disabled,
|
|
5465
5572
|
className: props.className
|
|
5466
5573
|
},
|
|
5467
|
-
/* @__PURE__ */
|
|
5574
|
+
/* @__PURE__ */ React46.createElement(
|
|
5468
5575
|
"div",
|
|
5469
5576
|
{
|
|
5470
5577
|
className: cx("aura-upload", over && "is-over", props.disabled && "is-disabled", error && "is-invalid"),
|
|
@@ -5485,9 +5592,9 @@ var FileUpload = React44.forwardRef(function FileUpload2(props, ref) {
|
|
|
5485
5592
|
add(e.dataTransfer && e.dataTransfer.files);
|
|
5486
5593
|
}
|
|
5487
5594
|
},
|
|
5488
|
-
/* @__PURE__ */
|
|
5489
|
-
/* @__PURE__ */
|
|
5490
|
-
/* @__PURE__ */
|
|
5595
|
+
/* @__PURE__ */ React46.createElement(Icon, { name: "cloud-upload", size: "lg", className: "aura-upload__icon" }),
|
|
5596
|
+
/* @__PURE__ */ React46.createElement("span", { className: "aura-upload__text" }, t.dropFiles, " "),
|
|
5597
|
+
/* @__PURE__ */ React46.createElement(
|
|
5491
5598
|
"input",
|
|
5492
5599
|
{
|
|
5493
5600
|
ref: inputMerged,
|
|
@@ -5509,12 +5616,12 @@ var FileUpload = React44.forwardRef(function FileUpload2(props, ref) {
|
|
|
5509
5616
|
}
|
|
5510
5617
|
}
|
|
5511
5618
|
),
|
|
5512
|
-
/* @__PURE__ */
|
|
5513
|
-
note ? /* @__PURE__ */
|
|
5619
|
+
/* @__PURE__ */ React46.createElement("span", { className: "aura-upload__browse", "aria-hidden": true }, props.multiple ? t.browse : t.browseOne),
|
|
5620
|
+
note ? /* @__PURE__ */ React46.createElement("span", { className: "aura-upload__note", id: id + "-note" }, note) : null
|
|
5514
5621
|
),
|
|
5515
|
-
items2.length ? /* @__PURE__ */
|
|
5622
|
+
items2.length ? /* @__PURE__ */ React46.createElement("ul", { className: "aura-upload__list", "aria-live": "polite" }, items2.map(function(it) {
|
|
5516
5623
|
const src = thumb(it);
|
|
5517
|
-
return /* @__PURE__ */
|
|
5624
|
+
return /* @__PURE__ */ React46.createElement("li", { key: it.id, className: cx("aura-upload__item", it.error && "is-error") }, src ? /* @__PURE__ */ React46.createElement("img", { className: "aura-upload__thumb", src, alt: "" }) : /* @__PURE__ */ React46.createElement("span", { className: "aura-upload__thumb is-icon", "aria-hidden": true }, /* @__PURE__ */ React46.createElement(Icon, { name: /^image\//.test(it.type || "") ? "image" : "file", size: "md" })), /* @__PURE__ */ React46.createElement("span", { className: "aura-upload__meta" }, /* @__PURE__ */ React46.createElement("span", { className: "aura-upload__name" }, it.name), /* @__PURE__ */ React46.createElement("span", { className: "aura-upload__sub" }, it.error ? /* @__PURE__ */ React46.createElement(React46.Fragment, null, /* @__PURE__ */ React46.createElement(Icon, { name: "circle-alert", size: 12 }), it.error) : it.status === "uploading" ? t.uploading + (it.progress != null ? " " + Math.round(it.progress) + "%" : "") : it.status === "done" ? /* @__PURE__ */ React46.createElement(React46.Fragment, null, /* @__PURE__ */ React46.createElement(Icon, { name: "circle-check", size: 12 }), formatBytes(it.size)) : formatBytes(it.size)), it.status === "uploading" ? /* @__PURE__ */ React46.createElement(
|
|
5518
5625
|
"span",
|
|
5519
5626
|
{
|
|
5520
5627
|
className: "aura-upload__bar",
|
|
@@ -5524,8 +5631,8 @@ var FileUpload = React44.forwardRef(function FileUpload2(props, ref) {
|
|
|
5524
5631
|
"aria-valuemax": 100,
|
|
5525
5632
|
"aria-valuenow": it.progress != null ? Math.round(it.progress) : void 0
|
|
5526
5633
|
},
|
|
5527
|
-
/* @__PURE__ */
|
|
5528
|
-
) : null), /* @__PURE__ */
|
|
5634
|
+
/* @__PURE__ */ React46.createElement("span", { style: { width: (it.progress || 0) + "%" } })
|
|
5635
|
+
) : null), /* @__PURE__ */ React46.createElement(
|
|
5529
5636
|
IconButton,
|
|
5530
5637
|
{
|
|
5531
5638
|
icon: "x",
|
|
@@ -5811,9 +5918,9 @@ function createTheme(opts) {
|
|
|
5811
5918
|
}
|
|
5812
5919
|
|
|
5813
5920
|
// src/ThemeStyle.tsx
|
|
5814
|
-
var
|
|
5921
|
+
var React47 = __toESM(require("react"), 1);
|
|
5815
5922
|
function ThemeStyle(props) {
|
|
5816
|
-
const css =
|
|
5923
|
+
const css = React47.useMemo(
|
|
5817
5924
|
function() {
|
|
5818
5925
|
return createTheme({ brand: props.brand, signal: props.signal, primary: props.primary, name: props.name }).css(
|
|
5819
5926
|
props.selector
|
|
@@ -5821,11 +5928,11 @@ function ThemeStyle(props) {
|
|
|
5821
5928
|
},
|
|
5822
5929
|
[props.brand, props.signal, props.primary, props.name, props.selector]
|
|
5823
5930
|
);
|
|
5824
|
-
return /* @__PURE__ */
|
|
5931
|
+
return /* @__PURE__ */ React47.createElement("style", { "data-aura-theme": props.name || props.brand, dangerouslySetInnerHTML: { __html: css } });
|
|
5825
5932
|
}
|
|
5826
5933
|
|
|
5827
5934
|
// src/colorScheme.tsx
|
|
5828
|
-
var
|
|
5935
|
+
var React48 = __toESM(require("react"), 1);
|
|
5829
5936
|
|
|
5830
5937
|
// src/colorSchemeScript.ts
|
|
5831
5938
|
var DEFAULT_KEY = "aura-color-scheme";
|
|
@@ -5842,7 +5949,7 @@ function colorSchemeScript(options) {
|
|
|
5842
5949
|
|
|
5843
5950
|
// src/colorScheme.tsx
|
|
5844
5951
|
function ColorSchemeScript(props) {
|
|
5845
|
-
return /* @__PURE__ */
|
|
5952
|
+
return /* @__PURE__ */ React48.createElement(
|
|
5846
5953
|
"script",
|
|
5847
5954
|
{
|
|
5848
5955
|
"data-aura-color-scheme": "",
|
|
@@ -5867,7 +5974,7 @@ function apply(scheme) {
|
|
|
5867
5974
|
function useColorScheme(options) {
|
|
5868
5975
|
const key = options && options.storageKey || DEFAULT_KEY;
|
|
5869
5976
|
const fallback = options && options.defaultScheme || "system";
|
|
5870
|
-
const subscribe2 =
|
|
5977
|
+
const subscribe2 = React48.useCallback(
|
|
5871
5978
|
function(cb) {
|
|
5872
5979
|
const mq = window.matchMedia ? window.matchMedia("(prefers-color-scheme: dark)") : null;
|
|
5873
5980
|
function onSystem() {
|
|
@@ -5885,7 +5992,7 @@ function useColorScheme(options) {
|
|
|
5885
5992
|
},
|
|
5886
5993
|
[fallback]
|
|
5887
5994
|
);
|
|
5888
|
-
const snapshot =
|
|
5995
|
+
const snapshot = React48.useSyncExternalStore(
|
|
5889
5996
|
subscribe2,
|
|
5890
5997
|
function() {
|
|
5891
5998
|
const s = readScheme(fallback);
|
|
@@ -5896,7 +6003,7 @@ function useColorScheme(options) {
|
|
|
5896
6003
|
}
|
|
5897
6004
|
);
|
|
5898
6005
|
const parts = snapshot.split("|");
|
|
5899
|
-
const setScheme =
|
|
6006
|
+
const setScheme = React48.useCallback(
|
|
5900
6007
|
function(next) {
|
|
5901
6008
|
if (!valid(next)) return;
|
|
5902
6009
|
try {
|
|
@@ -5915,11 +6022,11 @@ function ColorSchemeToggle(props) {
|
|
|
5915
6022
|
const cs = useColorScheme(props);
|
|
5916
6023
|
const names = { light: t.schemeLight, dark: t.schemeDark, system: t.schemeSystem };
|
|
5917
6024
|
const label = props.label || t.colorScheme;
|
|
5918
|
-
return /* @__PURE__ */
|
|
6025
|
+
return /* @__PURE__ */ React48.createElement(
|
|
5919
6026
|
DropdownMenu,
|
|
5920
6027
|
{
|
|
5921
6028
|
label,
|
|
5922
|
-
trigger: /* @__PURE__ */
|
|
6029
|
+
trigger: /* @__PURE__ */ React48.createElement(IconButton, { icon: cs.resolved === "dark" ? "moon" : "sun", label: label + ": " + names[cs.scheme] }),
|
|
5923
6030
|
items: SCHEMES.map(function(s) {
|
|
5924
6031
|
return {
|
|
5925
6032
|
label: names[s],
|
|
@@ -5934,10 +6041,10 @@ function ColorSchemeToggle(props) {
|
|
|
5934
6041
|
}
|
|
5935
6042
|
|
|
5936
6043
|
// src/Badge.tsx
|
|
5937
|
-
var
|
|
5938
|
-
var Badge =
|
|
6044
|
+
var React49 = __toESM(require("react"), 1);
|
|
6045
|
+
var Badge = React49.forwardRef(function Badge2(props, ref) {
|
|
5939
6046
|
const rest = omit(props, ["tone", "variant", "icon", "className", "children"]);
|
|
5940
|
-
return /* @__PURE__ */
|
|
6047
|
+
return /* @__PURE__ */ React49.createElement(
|
|
5941
6048
|
"span",
|
|
5942
6049
|
{
|
|
5943
6050
|
...rest,
|
|
@@ -5950,19 +6057,19 @@ var Badge = React47.forwardRef(function Badge2(props, ref) {
|
|
|
5950
6057
|
props.className
|
|
5951
6058
|
)
|
|
5952
6059
|
},
|
|
5953
|
-
props.icon ? /* @__PURE__ */
|
|
6060
|
+
props.icon ? /* @__PURE__ */ React49.createElement(Icon, { name: props.icon, size: 12 }) : null,
|
|
5954
6061
|
props.children
|
|
5955
6062
|
);
|
|
5956
6063
|
});
|
|
5957
6064
|
|
|
5958
6065
|
// src/Progress.tsx
|
|
5959
|
-
var
|
|
5960
|
-
var Progress =
|
|
6066
|
+
var React50 = __toESM(require("react"), 1);
|
|
6067
|
+
var Progress = React50.forwardRef(function Progress2(props, ref) {
|
|
5961
6068
|
const auto = uid(), id = props.id || auto;
|
|
5962
6069
|
const max = props.max || 100, det = props.value != null;
|
|
5963
6070
|
const pct = det ? Math.max(0, Math.min(100, props.value / max * 100)) : 0;
|
|
5964
6071
|
const shown = props.valueLabel != null ? props.valueLabel : det ? Math.round(pct) + "%" : null;
|
|
5965
|
-
return /* @__PURE__ */
|
|
6072
|
+
return /* @__PURE__ */ React50.createElement(
|
|
5966
6073
|
"div",
|
|
5967
6074
|
{
|
|
5968
6075
|
ref,
|
|
@@ -5973,8 +6080,8 @@ var Progress = React48.forwardRef(function Progress2(props, ref) {
|
|
|
5973
6080
|
props.className
|
|
5974
6081
|
)
|
|
5975
6082
|
},
|
|
5976
|
-
props.label || props.showValue && shown ? /* @__PURE__ */
|
|
5977
|
-
/* @__PURE__ */
|
|
6083
|
+
props.label || props.showValue && shown ? /* @__PURE__ */ React50.createElement("div", { className: "aura-progress__head" }, props.label ? /* @__PURE__ */ React50.createElement("span", { className: "aura-progress__label", id: id + "-label" }, props.label) : /* @__PURE__ */ React50.createElement("span", null), props.showValue && shown ? /* @__PURE__ */ React50.createElement("span", { className: "aura-progress__value" }, shown) : null) : null,
|
|
6084
|
+
/* @__PURE__ */ React50.createElement(
|
|
5978
6085
|
"div",
|
|
5979
6086
|
{
|
|
5980
6087
|
className: cx("aura-progress__track", !det && "is-indeterminate"),
|
|
@@ -5986,21 +6093,21 @@ var Progress = React48.forwardRef(function Progress2(props, ref) {
|
|
|
5986
6093
|
"aria-valuenow": det ? props.value : void 0,
|
|
5987
6094
|
"aria-valuetext": det && props.valueLabel != null ? String(props.valueLabel) : void 0
|
|
5988
6095
|
},
|
|
5989
|
-
/* @__PURE__ */
|
|
6096
|
+
/* @__PURE__ */ React50.createElement("span", { className: "aura-progress__bar", style: det ? { width: pct + "%" } : void 0 })
|
|
5990
6097
|
),
|
|
5991
|
-
props.hint ? /* @__PURE__ */
|
|
6098
|
+
props.hint ? /* @__PURE__ */ React50.createElement("p", { className: "aura-progress__hint" }, props.hint) : null
|
|
5992
6099
|
);
|
|
5993
6100
|
});
|
|
5994
6101
|
|
|
5995
6102
|
// src/Skeleton.tsx
|
|
5996
|
-
var
|
|
5997
|
-
var Skeleton =
|
|
6103
|
+
var React51 = __toESM(require("react"), 1);
|
|
6104
|
+
var Skeleton = React51.forwardRef(function Skeleton2(props, ref) {
|
|
5998
6105
|
const v = props.variant || "text";
|
|
5999
6106
|
if (v === "text" && (props.lines || 1) > 1) {
|
|
6000
6107
|
const n2 = props.lines, rows = [];
|
|
6001
6108
|
for (let i = 0; i < n2; i++)
|
|
6002
|
-
rows.push(/* @__PURE__ */
|
|
6003
|
-
return /* @__PURE__ */
|
|
6109
|
+
rows.push(/* @__PURE__ */ React51.createElement("span", { key: i, className: "aura-skel aura-skel--text", style: { width: i === n2 - 1 ? "60%" : "100%" } }));
|
|
6110
|
+
return /* @__PURE__ */ React51.createElement(
|
|
6004
6111
|
"span",
|
|
6005
6112
|
{
|
|
6006
6113
|
ref,
|
|
@@ -6018,28 +6125,28 @@ var Skeleton = React49.forwardRef(function Skeleton2(props, ref) {
|
|
|
6018
6125
|
if (v === "circle") {
|
|
6019
6126
|
style.width = style.height = props.size || props.width || 40;
|
|
6020
6127
|
}
|
|
6021
|
-
return /* @__PURE__ */
|
|
6128
|
+
return /* @__PURE__ */ React51.createElement("span", { ref, "aria-hidden": true, className: cx("aura-skel", "aura-skel--" + v, props.className), style });
|
|
6022
6129
|
});
|
|
6023
6130
|
|
|
6024
6131
|
// src/EmptyState.tsx
|
|
6025
|
-
var
|
|
6026
|
-
var EmptyState =
|
|
6132
|
+
var React52 = __toESM(require("react"), 1);
|
|
6133
|
+
var EmptyState = React52.forwardRef(function EmptyState2(props, ref) {
|
|
6027
6134
|
const HT = "h" + (props.headingLevel || 3);
|
|
6028
|
-
return /* @__PURE__ */
|
|
6135
|
+
return /* @__PURE__ */ React52.createElement(
|
|
6029
6136
|
"div",
|
|
6030
6137
|
{
|
|
6031
6138
|
ref,
|
|
6032
6139
|
className: cx("aura-empty", props.size === "sm" && "is-sm", props.bordered && "is-bordered", props.className)
|
|
6033
6140
|
},
|
|
6034
|
-
/* @__PURE__ */
|
|
6035
|
-
/* @__PURE__ */
|
|
6036
|
-
props.description ? /* @__PURE__ */
|
|
6037
|
-
props.action ? /* @__PURE__ */
|
|
6141
|
+
/* @__PURE__ */ React52.createElement("span", { className: "aura-empty__icon", "aria-hidden": true }, /* @__PURE__ */ React52.createElement(Icon, { name: props.icon || "inbox", size: props.size === "sm" ? "md" : "lg" })),
|
|
6142
|
+
/* @__PURE__ */ React52.createElement(HT, { className: "aura-empty__title" }, props.title),
|
|
6143
|
+
props.description ? /* @__PURE__ */ React52.createElement("p", { className: "aura-empty__text" }, props.description) : null,
|
|
6144
|
+
props.action ? /* @__PURE__ */ React52.createElement("div", { className: "aura-empty__action" }, props.action) : null
|
|
6038
6145
|
);
|
|
6039
6146
|
});
|
|
6040
6147
|
|
|
6041
6148
|
// src/Pagination.tsx
|
|
6042
|
-
var
|
|
6149
|
+
var React53 = __toESM(require("react"), 1);
|
|
6043
6150
|
function pageList(page, count, sib) {
|
|
6044
6151
|
let out = [], lo = Math.max(2, page - sib), hi = Math.min(count - 1, page + sib);
|
|
6045
6152
|
if (page - sib <= 3) {
|
|
@@ -6059,7 +6166,7 @@ function pageList(page, count, sib) {
|
|
|
6059
6166
|
if (count > 1) out.push(count);
|
|
6060
6167
|
return out;
|
|
6061
6168
|
}
|
|
6062
|
-
var Pagination =
|
|
6169
|
+
var Pagination = React53.forwardRef(function Pagination2(props, ref) {
|
|
6063
6170
|
const t = useStrings();
|
|
6064
6171
|
const count = Math.max(1, props.pageCount || 1);
|
|
6065
6172
|
const st = useMaybeControlled(props.page, props.defaultPage || 1, props.onChange);
|
|
@@ -6078,7 +6185,7 @@ var Pagination = React51.forwardRef(function Pagination2(props, ref) {
|
|
|
6078
6185
|
},
|
|
6079
6186
|
extra
|
|
6080
6187
|
);
|
|
6081
|
-
return link ? /* @__PURE__ */
|
|
6188
|
+
return link ? /* @__PURE__ */ React53.createElement(
|
|
6082
6189
|
Link,
|
|
6083
6190
|
{
|
|
6084
6191
|
href: link(p),
|
|
@@ -6091,7 +6198,7 @@ var Pagination = React51.forwardRef(function Pagination2(props, ref) {
|
|
|
6091
6198
|
...common
|
|
6092
6199
|
},
|
|
6093
6200
|
label
|
|
6094
|
-
) : /* @__PURE__ */
|
|
6201
|
+
) : /* @__PURE__ */ React53.createElement(
|
|
6095
6202
|
"button",
|
|
6096
6203
|
{
|
|
6097
6204
|
type: "button",
|
|
@@ -6105,7 +6212,7 @@ var Pagination = React51.forwardRef(function Pagination2(props, ref) {
|
|
|
6105
6212
|
}
|
|
6106
6213
|
function arrow(p, icon, label, rel, disabled) {
|
|
6107
6214
|
if (!link || disabled)
|
|
6108
|
-
return /* @__PURE__ */
|
|
6215
|
+
return /* @__PURE__ */ React53.createElement(
|
|
6109
6216
|
IconButton,
|
|
6110
6217
|
{
|
|
6111
6218
|
icon,
|
|
@@ -6116,7 +6223,7 @@ var Pagination = React51.forwardRef(function Pagination2(props, ref) {
|
|
|
6116
6223
|
}
|
|
6117
6224
|
}
|
|
6118
6225
|
);
|
|
6119
|
-
return /* @__PURE__ */
|
|
6226
|
+
return /* @__PURE__ */ React53.createElement(
|
|
6120
6227
|
Link,
|
|
6121
6228
|
{
|
|
6122
6229
|
href: link(p),
|
|
@@ -6131,17 +6238,17 @@ var Pagination = React51.forwardRef(function Pagination2(props, ref) {
|
|
|
6131
6238
|
}
|
|
6132
6239
|
}
|
|
6133
6240
|
},
|
|
6134
|
-
/* @__PURE__ */
|
|
6241
|
+
/* @__PURE__ */ React53.createElement(Icon, { name: icon, size: "sm" })
|
|
6135
6242
|
);
|
|
6136
6243
|
}
|
|
6137
|
-
return /* @__PURE__ */
|
|
6138
|
-
return typeof p === "number" ? /* @__PURE__ */
|
|
6139
|
-
})), /* @__PURE__ */
|
|
6244
|
+
return /* @__PURE__ */ React53.createElement("nav", { ref, className: cx("aura-pagination", props.className), "aria-label": props.label || t.pagination }, arrow(page - 1, "chevron-left", t.prevPage, "prev", page <= 1), /* @__PURE__ */ React53.createElement("ol", { className: "aura-pagination__list" }, pageList(page, count, props.siblingCount == null ? 1 : props.siblingCount).map(function(p) {
|
|
6245
|
+
return typeof p === "number" ? /* @__PURE__ */ React53.createElement("li", { key: p }, item(p, p)) : /* @__PURE__ */ React53.createElement("li", { key: p, className: "aura-pagination__gap", "aria-hidden": true }, "\u2026");
|
|
6246
|
+
})), /* @__PURE__ */ React53.createElement("span", { className: "aura-pagination__compact", "aria-hidden": true }, t.page(page, count)), arrow(page + 1, "chevron-right", t.nextPage, "next", page >= count));
|
|
6140
6247
|
});
|
|
6141
6248
|
|
|
6142
6249
|
// src/Accordion.tsx
|
|
6143
|
-
var
|
|
6144
|
-
var Accordion =
|
|
6250
|
+
var React54 = __toESM(require("react"), 1);
|
|
6251
|
+
var Accordion = React54.forwardRef(function Accordion2(props, ref) {
|
|
6145
6252
|
const auto = uid(), base = props.id || auto;
|
|
6146
6253
|
const multiple = props.type === "multiple";
|
|
6147
6254
|
const st = useMaybeControlled(
|
|
@@ -6179,9 +6286,9 @@ var Accordion = React52.forwardRef(function Accordion2(props, ref) {
|
|
|
6179
6286
|
n2.focus();
|
|
6180
6287
|
}
|
|
6181
6288
|
}
|
|
6182
|
-
return /* @__PURE__ */
|
|
6289
|
+
return /* @__PURE__ */ React54.createElement("div", { ref, className: cx("aura-accordion", props.className), onKeyDown: onKey }, items2.map(function(it) {
|
|
6183
6290
|
const on = open.indexOf(it.id) >= 0, bid = base + "-btn-" + it.id, pid = base + "-panel-" + it.id;
|
|
6184
|
-
return /* @__PURE__ */
|
|
6291
|
+
return /* @__PURE__ */ React54.createElement("div", { key: it.id, className: cx("aura-accordion__item", on && "is-open") }, /* @__PURE__ */ React54.createElement(HT, { className: "aura-accordion__heading" }, /* @__PURE__ */ React54.createElement(
|
|
6185
6292
|
"button",
|
|
6186
6293
|
{
|
|
6187
6294
|
type: "button",
|
|
@@ -6193,15 +6300,15 @@ var Accordion = React52.forwardRef(function Accordion2(props, ref) {
|
|
|
6193
6300
|
toggle(it.id);
|
|
6194
6301
|
}
|
|
6195
6302
|
},
|
|
6196
|
-
it.icon ? /* @__PURE__ */
|
|
6197
|
-
/* @__PURE__ */
|
|
6198
|
-
/* @__PURE__ */
|
|
6199
|
-
)), /* @__PURE__ */
|
|
6303
|
+
it.icon ? /* @__PURE__ */ React54.createElement(Icon, { name: it.icon, className: "aura-accordion__lead" }) : null,
|
|
6304
|
+
/* @__PURE__ */ React54.createElement("span", { className: "aura-accordion__title" }, it.title, it.description ? /* @__PURE__ */ React54.createElement("span", { className: "aura-accordion__desc" }, it.description) : null),
|
|
6305
|
+
/* @__PURE__ */ React54.createElement(Icon, { name: "chevron-down", className: "aura-accordion__chevron" })
|
|
6306
|
+
)), /* @__PURE__ */ React54.createElement("div", { id: pid, role: "region", "aria-labelledby": bid, className: "aura-accordion__panel", hidden: !on }, it.content));
|
|
6200
6307
|
}));
|
|
6201
6308
|
});
|
|
6202
6309
|
|
|
6203
6310
|
// src/Popover.tsx
|
|
6204
|
-
var
|
|
6311
|
+
var React55 = __toESM(require("react"), 1);
|
|
6205
6312
|
var import_react_dom11 = require("react-dom");
|
|
6206
6313
|
function position(anchor, pop, placement) {
|
|
6207
6314
|
const r = anchor.getBoundingClientRect(), pw = pop.offsetWidth, ph = pop.offsetHeight, vw = window.innerWidth, vh = window.innerHeight, gap = 6;
|
|
@@ -6212,14 +6319,14 @@ function position(anchor, pop, placement) {
|
|
|
6212
6319
|
const left = align === "end" ? r.right - pw : align === "center" ? r.left + r.width / 2 - pw / 2 : r.left;
|
|
6213
6320
|
return { top: Math.max(8, top), left: Math.max(8, Math.min(left, vw - pw - 8)), side };
|
|
6214
6321
|
}
|
|
6215
|
-
var Popover =
|
|
6322
|
+
var Popover = React55.forwardRef(function Popover2(props, ref) {
|
|
6216
6323
|
const t = useStrings();
|
|
6217
6324
|
const density = useDensity();
|
|
6218
6325
|
const auto = uid(), id = props.id || auto;
|
|
6219
6326
|
const st = useMaybeControlled(props.open, !!props.defaultOpen, props.onOpenChange);
|
|
6220
6327
|
const open = !!st[0];
|
|
6221
|
-
const wrap =
|
|
6222
|
-
const pos =
|
|
6328
|
+
const wrap = React55.useRef(null), pop = React55.useRef(null), popMerged = useMergedRef(ref, pop);
|
|
6329
|
+
const pos = React55.useState(null), mounted = useMounted();
|
|
6223
6330
|
function trigger() {
|
|
6224
6331
|
return wrap.current && (wrap.current.querySelector('button, [role="button"], a, input') || wrap.current.firstElementChild);
|
|
6225
6332
|
}
|
|
@@ -6246,7 +6353,7 @@ var Popover = React53.forwardRef(function Popover2(props, ref) {
|
|
|
6246
6353
|
},
|
|
6247
6354
|
[open, mounted, props.placement]
|
|
6248
6355
|
);
|
|
6249
|
-
|
|
6356
|
+
React55.useEffect(
|
|
6250
6357
|
function() {
|
|
6251
6358
|
if (!open || !mounted) return;
|
|
6252
6359
|
if (props.autoFocus !== false && pop.current) {
|
|
@@ -6265,9 +6372,9 @@ var Popover = React53.forwardRef(function Popover2(props, ref) {
|
|
|
6265
6372
|
},
|
|
6266
6373
|
[open, mounted]
|
|
6267
6374
|
);
|
|
6268
|
-
const child =
|
|
6375
|
+
const child = React55.Children.only(props.trigger);
|
|
6269
6376
|
const panel = open && mounted ? (0, import_react_dom11.createPortal)(
|
|
6270
|
-
/* @__PURE__ */
|
|
6377
|
+
/* @__PURE__ */ React55.createElement(
|
|
6271
6378
|
"div",
|
|
6272
6379
|
{
|
|
6273
6380
|
ref: popMerged,
|
|
@@ -6290,7 +6397,7 @@ var Popover = React53.forwardRef(function Popover2(props, ref) {
|
|
|
6290
6397
|
} else trapTab(e, pop.current);
|
|
6291
6398
|
}
|
|
6292
6399
|
},
|
|
6293
|
-
props.title ? /* @__PURE__ */
|
|
6400
|
+
props.title ? /* @__PURE__ */ React55.createElement("div", { className: "aura-popover__head" }, /* @__PURE__ */ React55.createElement("p", { className: "aura-popover__title", id: id + "-title" }, props.title), /* @__PURE__ */ React55.createElement(
|
|
6294
6401
|
IconButton,
|
|
6295
6402
|
{
|
|
6296
6403
|
icon: "x",
|
|
@@ -6300,7 +6407,7 @@ var Popover = React53.forwardRef(function Popover2(props, ref) {
|
|
|
6300
6407
|
}
|
|
6301
6408
|
}
|
|
6302
6409
|
)) : null,
|
|
6303
|
-
/* @__PURE__ */
|
|
6410
|
+
/* @__PURE__ */ React55.createElement("div", { className: "aura-popover__body" }, typeof props.children === "function" ? props.children({
|
|
6304
6411
|
close: function() {
|
|
6305
6412
|
close(true);
|
|
6306
6413
|
}
|
|
@@ -6308,7 +6415,7 @@ var Popover = React53.forwardRef(function Popover2(props, ref) {
|
|
|
6308
6415
|
),
|
|
6309
6416
|
document.body
|
|
6310
6417
|
) : null;
|
|
6311
|
-
return /* @__PURE__ */
|
|
6418
|
+
return /* @__PURE__ */ React55.createElement("span", { ref: wrap, className: "aura-popover-anchor" }, React55.cloneElement(child, {
|
|
6312
6419
|
onClick: function(e) {
|
|
6313
6420
|
if (child.props.onClick) child.props.onClick(e);
|
|
6314
6421
|
st[1](!open);
|
|
@@ -6320,7 +6427,7 @@ var Popover = React53.forwardRef(function Popover2(props, ref) {
|
|
|
6320
6427
|
});
|
|
6321
6428
|
|
|
6322
6429
|
// src/NumberField.tsx
|
|
6323
|
-
var
|
|
6430
|
+
var React56 = __toESM(require("react"), 1);
|
|
6324
6431
|
function decimalsOf(n2) {
|
|
6325
6432
|
const s = String(n2);
|
|
6326
6433
|
const i = s.indexOf(".");
|
|
@@ -6331,7 +6438,7 @@ function parse(text) {
|
|
|
6331
6438
|
if (!/^-?(\d+\.?\d*|\.\d+)$/.test(s)) return NaN;
|
|
6332
6439
|
return Number(s);
|
|
6333
6440
|
}
|
|
6334
|
-
var NumberField =
|
|
6441
|
+
var NumberField = React56.forwardRef(function NumberField2(props, ref) {
|
|
6335
6442
|
const t = useStrings();
|
|
6336
6443
|
const auto = uid(), id = props.id || auto;
|
|
6337
6444
|
const step = props.step || 1;
|
|
@@ -6342,7 +6449,7 @@ var NumberField = React54.forwardRef(function NumberField2(props, ref) {
|
|
|
6342
6449
|
props.onChange
|
|
6343
6450
|
);
|
|
6344
6451
|
const value = st[0], setValue = st[1];
|
|
6345
|
-
const draftState =
|
|
6452
|
+
const draftState = React56.useState(null), draft = draftState[0], setDraft = draftState[1];
|
|
6346
6453
|
function fmt2(n2) {
|
|
6347
6454
|
if (n2 == null || isNaN(n2)) return "";
|
|
6348
6455
|
return n2.toLocaleString("en", { minimumFractionDigits: decimals, maximumFractionDigits: decimals });
|
|
@@ -6391,7 +6498,7 @@ var NumberField = React54.forwardRef(function NumberField2(props, ref) {
|
|
|
6391
6498
|
};
|
|
6392
6499
|
const valueText = value == null ? void 0 : [affixText(props.prefix), fmt2(value), affixText(props.suffix)].join(" ").trim();
|
|
6393
6500
|
const stepper = props.stepper !== false && !props.readOnly;
|
|
6394
|
-
return /* @__PURE__ */
|
|
6501
|
+
return /* @__PURE__ */ React56.createElement(
|
|
6395
6502
|
Field,
|
|
6396
6503
|
{
|
|
6397
6504
|
id,
|
|
@@ -6403,7 +6510,7 @@ var NumberField = React54.forwardRef(function NumberField2(props, ref) {
|
|
|
6403
6510
|
disabled: props.disabled,
|
|
6404
6511
|
className: props.className
|
|
6405
6512
|
},
|
|
6406
|
-
/* @__PURE__ */
|
|
6513
|
+
/* @__PURE__ */ React56.createElement("div", { className: cx("aura-input aura-number", stepper && "has-stepper") }, props.prefix != null ? /* @__PURE__ */ React56.createElement("span", { className: "aura-number__affix", "aria-hidden": true }, props.prefix) : null, /* @__PURE__ */ React56.createElement(
|
|
6407
6514
|
"input",
|
|
6408
6515
|
{
|
|
6409
6516
|
ref,
|
|
@@ -6450,7 +6557,7 @@ var NumberField = React54.forwardRef(function NumberField2(props, ref) {
|
|
|
6450
6557
|
},
|
|
6451
6558
|
onKeyDown
|
|
6452
6559
|
}
|
|
6453
|
-
), props.suffix != null ? /* @__PURE__ */
|
|
6560
|
+
), props.suffix != null ? /* @__PURE__ */ React56.createElement("span", { className: "aura-number__affix", "aria-hidden": true }, props.suffix) : null, stepper ? /* @__PURE__ */ React56.createElement("span", { className: "aura-number__steps" }, /* @__PURE__ */ React56.createElement(
|
|
6454
6561
|
"button",
|
|
6455
6562
|
{
|
|
6456
6563
|
type: "button",
|
|
@@ -6466,8 +6573,8 @@ var NumberField = React54.forwardRef(function NumberField2(props, ref) {
|
|
|
6466
6573
|
nudge(-step);
|
|
6467
6574
|
}
|
|
6468
6575
|
},
|
|
6469
|
-
/* @__PURE__ */
|
|
6470
|
-
), /* @__PURE__ */
|
|
6576
|
+
/* @__PURE__ */ React56.createElement(Icon, { name: "minus" })
|
|
6577
|
+
), /* @__PURE__ */ React56.createElement(
|
|
6471
6578
|
"button",
|
|
6472
6579
|
{
|
|
6473
6580
|
type: "button",
|
|
@@ -6483,14 +6590,14 @@ var NumberField = React54.forwardRef(function NumberField2(props, ref) {
|
|
|
6483
6590
|
nudge(step);
|
|
6484
6591
|
}
|
|
6485
6592
|
},
|
|
6486
|
-
/* @__PURE__ */
|
|
6593
|
+
/* @__PURE__ */ React56.createElement(Icon, { name: "plus" })
|
|
6487
6594
|
)) : null)
|
|
6488
6595
|
);
|
|
6489
6596
|
});
|
|
6490
6597
|
|
|
6491
6598
|
// src/Stepper.tsx
|
|
6492
|
-
var
|
|
6493
|
-
var Stepper =
|
|
6599
|
+
var React57 = __toESM(require("react"), 1);
|
|
6600
|
+
var Stepper = React57.forwardRef(function Stepper2(props, ref) {
|
|
6494
6601
|
const t = useStrings();
|
|
6495
6602
|
const steps = props.steps || [];
|
|
6496
6603
|
let at = -1;
|
|
@@ -6500,26 +6607,26 @@ var Stepper = React55.forwardRef(function Stepper2(props, ref) {
|
|
|
6500
6607
|
if (at < 0) at = 0;
|
|
6501
6608
|
const vertical = props.orientation === "vertical";
|
|
6502
6609
|
const cur = steps[at];
|
|
6503
|
-
return /* @__PURE__ */
|
|
6610
|
+
return /* @__PURE__ */ React57.createElement(
|
|
6504
6611
|
"nav",
|
|
6505
6612
|
{
|
|
6506
6613
|
ref,
|
|
6507
6614
|
"aria-label": props.label,
|
|
6508
6615
|
className: cx("aura-stepper", vertical ? "aura-stepper--vertical" : "aura-stepper--horizontal", props.className)
|
|
6509
6616
|
},
|
|
6510
|
-
/* @__PURE__ */
|
|
6617
|
+
/* @__PURE__ */ React57.createElement("ol", { className: "aura-stepper__list" }, steps.map(function(s, i) {
|
|
6511
6618
|
const state = i < at ? "done" : i === at ? "current" : "upcoming";
|
|
6512
|
-
const marker = /* @__PURE__ */
|
|
6513
|
-
const text = /* @__PURE__ */
|
|
6619
|
+
const marker = /* @__PURE__ */ React57.createElement("span", { className: "aura-stepper__marker", "aria-hidden": true }, state === "done" ? /* @__PURE__ */ React57.createElement(Icon, { name: "check" }) : i + 1);
|
|
6620
|
+
const text = /* @__PURE__ */ React57.createElement("span", { className: "aura-stepper__text" }, /* @__PURE__ */ React57.createElement("span", { className: "aura-stepper__label" }, s.label, state === "done" ? /* @__PURE__ */ React57.createElement("span", { className: "aura-sr-only" }, ", " + t.stepDone) : null), s.description ? /* @__PURE__ */ React57.createElement("span", { className: "aura-stepper__desc" }, s.description) : null);
|
|
6514
6621
|
const clickable = state === "done" && !!props.onStepClick;
|
|
6515
|
-
return /* @__PURE__ */
|
|
6622
|
+
return /* @__PURE__ */ React57.createElement(
|
|
6516
6623
|
"li",
|
|
6517
6624
|
{
|
|
6518
6625
|
key: s.id,
|
|
6519
6626
|
className: cx("aura-stepper__item", "is-" + state),
|
|
6520
6627
|
"aria-current": state === "current" ? "step" : void 0
|
|
6521
6628
|
},
|
|
6522
|
-
clickable ? /* @__PURE__ */
|
|
6629
|
+
clickable ? /* @__PURE__ */ React57.createElement(
|
|
6523
6630
|
"button",
|
|
6524
6631
|
{
|
|
6525
6632
|
type: "button",
|
|
@@ -6530,19 +6637,19 @@ var Stepper = React55.forwardRef(function Stepper2(props, ref) {
|
|
|
6530
6637
|
},
|
|
6531
6638
|
marker,
|
|
6532
6639
|
text
|
|
6533
|
-
) : /* @__PURE__ */
|
|
6640
|
+
) : /* @__PURE__ */ React57.createElement("span", { className: "aura-stepper__step" }, marker, text)
|
|
6534
6641
|
);
|
|
6535
6642
|
})),
|
|
6536
|
-
!vertical && cur ? /* @__PURE__ */
|
|
6643
|
+
!vertical && cur ? /* @__PURE__ */ React57.createElement("p", { className: "aura-stepper__compact", "aria-hidden": true }, /* @__PURE__ */ React57.createElement("span", { className: "aura-stepper__count" }, t.stepOf(at + 1, steps.length)), /* @__PURE__ */ React57.createElement("span", { className: "aura-stepper__compact-label" }, cur.label)) : null
|
|
6537
6644
|
);
|
|
6538
6645
|
});
|
|
6539
6646
|
|
|
6540
6647
|
// src/SegmentedControl.tsx
|
|
6541
|
-
var
|
|
6648
|
+
var React58 = __toESM(require("react"), 1);
|
|
6542
6649
|
function toOpt2(o) {
|
|
6543
6650
|
return typeof o === "object" ? o : { value: o, label: o };
|
|
6544
6651
|
}
|
|
6545
|
-
var SegmentedControl =
|
|
6652
|
+
var SegmentedControl = React58.forwardRef(
|
|
6546
6653
|
function SegmentedControl2(props, ref) {
|
|
6547
6654
|
const options = (props.options || []).map(toOpt2);
|
|
6548
6655
|
const firstEnabled = options.filter(function(o) {
|
|
@@ -6555,7 +6662,7 @@ var SegmentedControl = React56.forwardRef(
|
|
|
6555
6662
|
);
|
|
6556
6663
|
const value = st[0], setValue = st[1];
|
|
6557
6664
|
const auto = uid(), id = props.id || auto;
|
|
6558
|
-
const refs =
|
|
6665
|
+
const refs = React58.useRef([]);
|
|
6559
6666
|
const selIdx = options.findIndex(function(o) {
|
|
6560
6667
|
return o.value === value;
|
|
6561
6668
|
});
|
|
@@ -6588,7 +6695,7 @@ var SegmentedControl = React56.forwardRef(
|
|
|
6588
6695
|
move(options.length, -1);
|
|
6589
6696
|
}
|
|
6590
6697
|
}
|
|
6591
|
-
return /* @__PURE__ */
|
|
6698
|
+
return /* @__PURE__ */ React58.createElement(
|
|
6592
6699
|
"div",
|
|
6593
6700
|
{
|
|
6594
6701
|
ref,
|
|
@@ -6607,7 +6714,7 @@ var SegmentedControl = React56.forwardRef(
|
|
|
6607
6714
|
options.map(function(o, i) {
|
|
6608
6715
|
const on = o.value === value;
|
|
6609
6716
|
const off = props.disabled || o.disabled;
|
|
6610
|
-
return /* @__PURE__ */
|
|
6717
|
+
return /* @__PURE__ */ React58.createElement(
|
|
6611
6718
|
"button",
|
|
6612
6719
|
{
|
|
6613
6720
|
key: o.value,
|
|
@@ -6629,8 +6736,8 @@ var SegmentedControl = React56.forwardRef(
|
|
|
6629
6736
|
onKeyDown(e, i);
|
|
6630
6737
|
}
|
|
6631
6738
|
},
|
|
6632
|
-
o.icon ? /* @__PURE__ */
|
|
6633
|
-
o.iconOnly ? null : /* @__PURE__ */
|
|
6739
|
+
o.icon ? /* @__PURE__ */ React58.createElement(Icon, { name: o.icon }) : null,
|
|
6740
|
+
o.iconOnly ? null : /* @__PURE__ */ React58.createElement("span", null, o.label)
|
|
6634
6741
|
);
|
|
6635
6742
|
})
|
|
6636
6743
|
);
|