@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/aura.bundle.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @ds-bundle: {"format":4,"namespace":"Aura","components":[{"name":"Icon"},{"name":"Button"},{"name":"IconButton"},{"name":"Menu"},{"name":"DropdownMenu"},{"name":"Checkbox"},{"name":"StatusPill"},{"name":"TextField"},{"name":"Textarea"},{"name":"Select"},{"name":"RadioGroup"},{"name":"Switch"},{"name":"Combobox"},{"name":"DatePicker"},{"name":"DateRangePicker"},{"name":"Calendar"},{"name":"Alert"},{"name":"Toaster"},{"name":"PasswordField"},{"name":"FormErrorSummary"},{"name":"FilterBar"},{"name":"Command"},{"name":"Tooltip"},{"name":"Dialog"},{"name":"Drawer"},{"name":"DataTable"},{"name":"Card"},{"name":"Tabs"},{"name":"SideNav"},{"name":"Breadcrumb"},{"name":"Avatar"},{"name":"Stack"},{"name":"Grid"},{"name":"Container"},{"name":"AppShell"},{"name":"ActionBar"},{"name":"BottomNav"},{"name":"Surface"},{"name":"Stat"},{"name":"TimePicker"},{"name":"FileUpload"},{"name":"ColorSchemeScript"},{"name":"ColorSchemeToggle"},{"name":"Badge"},{"name":"Tag"},{"name":"Progress"},{"name":"Skeleton"},{"name":"EmptyState"},{"name":"Pagination"},{"name":"Accordion"},{"name":"Popover"},{"name":"NumberField"},{"name":"Stepper"},{"name":"SegmentedControl"}]} */
|
|
1
|
+
/* @ds-bundle: {"format":4,"namespace":"Aura","components":[{"name":"Icon"},{"name":"Button"},{"name":"IconButton"},{"name":"Menu"},{"name":"DropdownMenu"},{"name":"Checkbox"},{"name":"StatusPill"},{"name":"TextField"},{"name":"Textarea"},{"name":"Select"},{"name":"RadioGroup"},{"name":"Switch"},{"name":"Combobox"},{"name":"DatePicker"},{"name":"DateRangePicker"},{"name":"Calendar"},{"name":"Alert"},{"name":"Toaster"},{"name":"PasswordField"},{"name":"FormErrorSummary"},{"name":"FilterBar"},{"name":"Command"},{"name":"Tooltip"},{"name":"Dialog"},{"name":"Drawer"},{"name":"DataTable"},{"name":"Card"},{"name":"Tabs"},{"name":"SideNav"},{"name":"Breadcrumb"},{"name":"Avatar"},{"name":"Stack"},{"name":"Grid"},{"name":"Container"},{"name":"AppShell"},{"name":"ActionBar"},{"name":"Separator"},{"name":"Table"},{"name":"Tr"},{"name":"Th"},{"name":"Td"},{"name":"BottomNav"},{"name":"Surface"},{"name":"Stat"},{"name":"TimePicker"},{"name":"FileUpload"},{"name":"ColorSchemeScript"},{"name":"ColorSchemeToggle"},{"name":"Badge"},{"name":"Tag"},{"name":"Progress"},{"name":"Skeleton"},{"name":"EmptyState"},{"name":"Pagination"},{"name":"Accordion"},{"name":"Popover"},{"name":"NumberField"},{"name":"Stepper"},{"name":"SegmentedControl"}]} */
|
|
2
2
|
window.Aura = (() => {
|
|
3
3
|
var __create = Object.create;
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -93,6 +93,7 @@ window.Aura = (() => {
|
|
|
93
93
|
STRINGS: () => STRINGS,
|
|
94
94
|
SegmentedControl: () => SegmentedControl,
|
|
95
95
|
Select: () => Select,
|
|
96
|
+
Separator: () => Separator,
|
|
96
97
|
SideNav: () => SideNav,
|
|
97
98
|
Skeleton: () => Skeleton,
|
|
98
99
|
Stack: () => Stack,
|
|
@@ -101,14 +102,21 @@ window.Aura = (() => {
|
|
|
101
102
|
Stepper: () => Stepper,
|
|
102
103
|
Surface: () => Surface,
|
|
103
104
|
Switch: () => Switch,
|
|
105
|
+
TBody: () => TBody,
|
|
106
|
+
TFoot: () => TFoot,
|
|
107
|
+
THead: () => THead,
|
|
108
|
+
Table: () => Table,
|
|
104
109
|
Tabs: () => Tabs,
|
|
105
110
|
Tag: () => Tag,
|
|
111
|
+
Td: () => Td,
|
|
106
112
|
TextField: () => TextField,
|
|
107
113
|
Textarea: () => Textarea,
|
|
114
|
+
Th: () => Th,
|
|
108
115
|
ThemeStyle: () => ThemeStyle,
|
|
109
116
|
TimePicker: () => TimePicker,
|
|
110
117
|
Toaster: () => Toaster,
|
|
111
118
|
Tooltip: () => Tooltip,
|
|
119
|
+
Tr: () => Tr,
|
|
112
120
|
brandScale: () => scale,
|
|
113
121
|
breakpoints: () => breakpoints,
|
|
114
122
|
colorSchemeScript: () => colorSchemeScript,
|
|
@@ -1323,13 +1331,13 @@ window.Aura = (() => {
|
|
|
1323
1331
|
function place() {
|
|
1324
1332
|
if (!boxRef.current) return;
|
|
1325
1333
|
const r = boxRef.current.getBoundingClientRect();
|
|
1326
|
-
const maxH = 320,
|
|
1334
|
+
const maxH = 320, below2 = window.innerHeight - r.bottom - 8, up = below2 < 200 && r.top > below2;
|
|
1327
1335
|
posState[1]({
|
|
1328
1336
|
left: r.left,
|
|
1329
1337
|
width: r.width,
|
|
1330
1338
|
top: up ? void 0 : r.bottom + 4,
|
|
1331
1339
|
bottom: up ? window.innerHeight - r.top + 4 : void 0,
|
|
1332
|
-
maxHeight: Math.min(maxH, (up ? r.top :
|
|
1340
|
+
maxHeight: Math.min(maxH, (up ? r.top : below2) - 8)
|
|
1333
1341
|
});
|
|
1334
1342
|
}
|
|
1335
1343
|
useIsoLayoutEffect(
|
|
@@ -1706,7 +1714,7 @@ window.Aura = (() => {
|
|
|
1706
1714
|
const o = opts || {}, d = fromISO(iso);
|
|
1707
1715
|
if (!d) return "";
|
|
1708
1716
|
const f = typeof o.format === "object" ? o.format : PRESETS[o.format || "short"];
|
|
1709
|
-
const loc = o.locale || "
|
|
1717
|
+
const loc = o.locale || "en";
|
|
1710
1718
|
return fmt(localeTag(loc, o.calendar || defaultCalendar(loc)), f, d).replace(ERA, "");
|
|
1711
1719
|
}
|
|
1712
1720
|
var MONTHS = null;
|
|
@@ -3084,9 +3092,27 @@ window.Aura = (() => {
|
|
|
3084
3092
|
function() {
|
|
3085
3093
|
if (!open || !anchor.current || !tip.current) return;
|
|
3086
3094
|
const r = anchor.current.getBoundingClientRect(), t = tip.current.getBoundingClientRect();
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3095
|
+
const vw = window.innerWidth, vh = window.innerHeight, gap = 8, m = 8;
|
|
3096
|
+
let side = props.side || "top";
|
|
3097
|
+
if (side === "top" && r.top - t.height - gap < m && r.bottom + gap + t.height <= vh - m) side = "bottom";
|
|
3098
|
+
else if (side === "bottom" && r.bottom + gap + t.height > vh - m && r.top - t.height - gap >= m) side = "top";
|
|
3099
|
+
else if (side === "left" && r.left - t.width - gap < m && r.right + gap + t.width <= vw - m) side = "right";
|
|
3100
|
+
else if (side === "right" && r.right + gap + t.width > vw - m && r.left - t.width - gap >= m) side = "left";
|
|
3101
|
+
const clampX = function(x) {
|
|
3102
|
+
return Math.max(m, Math.min(x, vw - t.width - m));
|
|
3103
|
+
};
|
|
3104
|
+
const clampY = function(y) {
|
|
3105
|
+
return Math.max(m, Math.min(y, vh - t.height - m));
|
|
3106
|
+
};
|
|
3107
|
+
let top, left;
|
|
3108
|
+
if (side === "top" || side === "bottom") {
|
|
3109
|
+
top = side === "top" ? r.top - t.height - gap : r.bottom + gap;
|
|
3110
|
+
left = clampX(r.left + r.width / 2 - t.width / 2);
|
|
3111
|
+
} else {
|
|
3112
|
+
left = side === "left" ? r.left - t.width - gap : r.right + gap;
|
|
3113
|
+
left = clampX(left);
|
|
3114
|
+
top = clampY(r.top + r.height / 2 - t.height / 2);
|
|
3115
|
+
}
|
|
3090
3116
|
pos[1]({ top, left });
|
|
3091
3117
|
},
|
|
3092
3118
|
[open]
|
|
@@ -3222,7 +3248,16 @@ window.Aura = (() => {
|
|
|
3222
3248
|
{ key: "owner", label: "OWNER" }
|
|
3223
3249
|
];
|
|
3224
3250
|
var SKELETON_WIDTHS = ["72%", "56%", "84%", "44%", "64%"];
|
|
3225
|
-
var
|
|
3251
|
+
var Q = 1e4;
|
|
3252
|
+
var MAX_HIDE_LEVELS = 3;
|
|
3253
|
+
function below(w, threshold) {
|
|
3254
|
+
return w < threshold * (1 - 0.5 / Q);
|
|
3255
|
+
}
|
|
3256
|
+
function hidePx(c) {
|
|
3257
|
+
if (c.hideBelow == null) return void 0;
|
|
3258
|
+
const px = typeof c.hideBelow === "number" ? c.hideBelow : BP[c.hideBelow];
|
|
3259
|
+
return px != null && px > 0 ? px : void 0;
|
|
3260
|
+
}
|
|
3226
3261
|
var ROW_H_DEFAULT = 48;
|
|
3227
3262
|
var OVERSCAN = 8;
|
|
3228
3263
|
var FLEX_MIN = 160;
|
|
@@ -3298,36 +3333,55 @@ window.Aura = (() => {
|
|
|
3298
3333
|
const measure = !!props.stackBelow || columns.some(function(c) {
|
|
3299
3334
|
return c.hideBelow != null;
|
|
3300
3335
|
});
|
|
3301
|
-
const dual = !!props.stackBelow && boxWidth[0] == null && STACK_WIDTHS.indexOf(props.stackBelow) >= 0;
|
|
3302
3336
|
React28.useEffect(
|
|
3303
3337
|
function() {
|
|
3304
3338
|
if (!measure || !wrapRef.current || typeof ResizeObserver === "undefined") return;
|
|
3305
3339
|
const ro = new ResizeObserver(function(en) {
|
|
3306
|
-
|
|
3340
|
+
const bb = en[0].borderBoxSize && en[0].borderBoxSize[0];
|
|
3341
|
+
boxWidth[1](bb ? bb.inlineSize : en[0].target.getBoundingClientRect().width);
|
|
3307
3342
|
});
|
|
3308
3343
|
ro.observe(wrapRef.current);
|
|
3309
3344
|
return function() {
|
|
3310
3345
|
ro.disconnect();
|
|
3311
3346
|
};
|
|
3312
3347
|
},
|
|
3313
|
-
[measure
|
|
3348
|
+
[measure]
|
|
3314
3349
|
);
|
|
3315
|
-
const stacked = !!props.stackBelow && boxWidth[0] != null && boxWidth[0]
|
|
3350
|
+
const stacked = !!props.stackBelow && boxWidth[0] != null && below(boxWidth[0], props.stackBelow);
|
|
3316
3351
|
useIsoLayoutEffect(
|
|
3317
3352
|
function() {
|
|
3318
3353
|
if (measure && boxWidth[0] == null && wrapRef.current) boxWidth[1](wrapRef.current.getBoundingClientRect().width);
|
|
3319
3354
|
},
|
|
3320
3355
|
[measure]
|
|
3321
3356
|
);
|
|
3357
|
+
const hideLevels = [];
|
|
3358
|
+
columns.forEach(function(c) {
|
|
3359
|
+
const px = hidePx(c);
|
|
3360
|
+
if (px != null && hideLevels.indexOf(px) < 0) hideLevels.push(px);
|
|
3361
|
+
});
|
|
3362
|
+
hideLevels.sort(function(a, b) {
|
|
3363
|
+
return b - a;
|
|
3364
|
+
});
|
|
3365
|
+
hideLevels.length = Math.min(hideLevels.length, MAX_HIDE_LEVELS);
|
|
3366
|
+
const levels = [];
|
|
3367
|
+
if (props.stackBelow && props.stackBelow > 0) levels.push({ name: "stack", px: props.stackBelow });
|
|
3368
|
+
hideLevels.forEach(function(px, i) {
|
|
3369
|
+
levels.push({ name: "h" + (i + 1), px });
|
|
3370
|
+
});
|
|
3371
|
+
function hideLevel(c) {
|
|
3372
|
+
const px = hidePx(c);
|
|
3373
|
+
const i = px == null ? -1 : hideLevels.indexOf(px);
|
|
3374
|
+
return i < 0 ? void 0 : i + 1;
|
|
3375
|
+
}
|
|
3322
3376
|
function tooNarrow(c) {
|
|
3323
3377
|
if (c.hideBelow == null || boxWidth[0] == null || stacked) return false;
|
|
3324
|
-
const px =
|
|
3325
|
-
return px != null && boxWidth[0]
|
|
3378
|
+
const px = hidePx(c);
|
|
3379
|
+
return px != null && below(boxWidth[0], px);
|
|
3326
3380
|
}
|
|
3327
3381
|
const scrollRef = React28.useRef(null);
|
|
3328
3382
|
const tipState = React28.useState(null), tip = tipState[0], setTip = tipState[1];
|
|
3329
3383
|
function showFull(e) {
|
|
3330
|
-
const el = e.target.closest ? e.target.closest(".aura-table__td
|
|
3384
|
+
const el = e.target.closest ? e.target.closest(".aura-table__td") : null;
|
|
3331
3385
|
if (!el || el.scrollWidth <= el.clientWidth + 1 || el.querySelector("button, input, .aura-pill"))
|
|
3332
3386
|
return setTip(null);
|
|
3333
3387
|
const r = el.getBoundingClientRect();
|
|
@@ -3359,7 +3413,7 @@ window.Aura = (() => {
|
|
|
3359
3413
|
const pending = React28.useRef(null);
|
|
3360
3414
|
const resizing = React28.useRef(false);
|
|
3361
3415
|
useIsoLayoutEffect(function() {
|
|
3362
|
-
if (
|
|
3416
|
+
if (!gridRef.current) return;
|
|
3363
3417
|
const els = gridRef.current.querySelectorAll(
|
|
3364
3418
|
'.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"]'
|
|
3365
3419
|
);
|
|
@@ -3391,12 +3445,31 @@ window.Aura = (() => {
|
|
|
3391
3445
|
})
|
|
3392
3446
|
);
|
|
3393
3447
|
const nPinned = vis.filter(isPinned).length;
|
|
3448
|
+
const pillKey = (vis.filter(function(c, i) {
|
|
3449
|
+
return i > 0 && c.pill;
|
|
3450
|
+
})[0] || { key: "" }).key;
|
|
3451
|
+
function cardPart(c, i) {
|
|
3452
|
+
return i === 0 ? "title" : c.key === pillKey ? "pill" : c.actions ? "actions" : "field";
|
|
3453
|
+
}
|
|
3454
|
+
function cardAttrs(c, i) {
|
|
3455
|
+
const part = cardPart(c, i), lv = hideLevel(c);
|
|
3456
|
+
return {
|
|
3457
|
+
"data-card": part,
|
|
3458
|
+
"data-label": part === "field" ? c.label || void 0 : void 0,
|
|
3459
|
+
"data-hide": lv ? String(lv) : void 0
|
|
3460
|
+
};
|
|
3461
|
+
}
|
|
3462
|
+
const hasFields = vis.some(function(c, i) {
|
|
3463
|
+
return cardPart(c, i) === "field";
|
|
3464
|
+
});
|
|
3394
3465
|
const hasFlex = vis.some(function(c) {
|
|
3395
3466
|
return widthOf(c) == null;
|
|
3396
3467
|
});
|
|
3397
|
-
let fixedSum = 0;
|
|
3468
|
+
let fixedSum = 0, hideTerms = "";
|
|
3398
3469
|
vis.forEach(function(c) {
|
|
3399
|
-
|
|
3470
|
+
const w = widthOf(c) != null ? widthOf(c) : FLEX_MIN, lv = hideLevel(c);
|
|
3471
|
+
if (lv && boxWidth[0] == null) hideTerms += " + " + w + "px * var(--aura-h" + lv + "-on, 1)";
|
|
3472
|
+
else fixedSum += w;
|
|
3400
3473
|
});
|
|
3401
3474
|
let pinOffsets = {}, acc = 0;
|
|
3402
3475
|
vis.forEach(function(c) {
|
|
@@ -3407,13 +3480,17 @@ window.Aura = (() => {
|
|
|
3407
3480
|
});
|
|
3408
3481
|
const selW = selectable ? " + var(--aura-table-select-width)" : "";
|
|
3409
3482
|
const gutterR = controls ? "var(--aura-space-12)" : "var(--aura-space-6)";
|
|
3410
|
-
const rowMinWidth = "calc(" + fixedSum + "px + var(--aura-space-6) + " + gutterR + selW + ")";
|
|
3483
|
+
const rowMinWidth = "calc(" + fixedSum + "px" + hideTerms + " + var(--aura-space-6) + " + gutterR + selW + ")";
|
|
3411
3484
|
function cellStyle(c, i) {
|
|
3412
|
-
|
|
3413
|
-
if (w == null)
|
|
3414
|
-
|
|
3415
|
-
|
|
3416
|
-
|
|
3485
|
+
const w = widthOf(c), s = {};
|
|
3486
|
+
if (w == null) {
|
|
3487
|
+
s["--aura-cell-flex"] = "1 1 0";
|
|
3488
|
+
s["--aura-cell-min"] = (c.minWidth || FLEX_MIN) + "px";
|
|
3489
|
+
} else {
|
|
3490
|
+
s["--aura-cell-flex"] = !hasFlex && i === vis.length - 1 ? "1 0 auto" : "none";
|
|
3491
|
+
s["--aura-cell-w"] = w + "px";
|
|
3492
|
+
}
|
|
3493
|
+
if (isPinned(c)) s["--aura-cell-left"] = "calc(var(--aura-space-6)" + selW + " + " + pinOffsets[c.key] + "px)";
|
|
3417
3494
|
return s;
|
|
3418
3495
|
}
|
|
3419
3496
|
const view = React28.useMemo(
|
|
@@ -3496,7 +3573,7 @@ window.Aura = (() => {
|
|
|
3496
3573
|
return rowHref ? /* @__PURE__ */ React28.createElement(Link, { href: rowHref(r), className: "aura-table__row-link" }, content) : content;
|
|
3497
3574
|
}
|
|
3498
3575
|
const height = props.height || 0;
|
|
3499
|
-
const virtual = !!height && !loading && pageRows.length > 0;
|
|
3576
|
+
const virtual = !!height && !loading && pageRows.length > 0 && !stacked;
|
|
3500
3577
|
const bodyH = Math.max(ROW_H, height - ROW_H);
|
|
3501
3578
|
let start = 0, end = pageRows.length;
|
|
3502
3579
|
if (virtual) {
|
|
@@ -3851,7 +3928,8 @@ window.Aura = (() => {
|
|
|
3851
3928
|
label: all ? t.deselectAllRows : t.selectAllRows,
|
|
3852
3929
|
onChange: toggleAll
|
|
3853
3930
|
}
|
|
3854
|
-
) : null
|
|
3931
|
+
) : null,
|
|
3932
|
+
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)
|
|
3855
3933
|
)
|
|
3856
3934
|
);
|
|
3857
3935
|
vis.forEach(function(c, i) {
|
|
@@ -3869,6 +3947,7 @@ window.Aura = (() => {
|
|
|
3869
3947
|
"aria-sort": ariaSort,
|
|
3870
3948
|
"aria-colindex": ci + 1,
|
|
3871
3949
|
style: cellStyle(c, i),
|
|
3950
|
+
"data-hide": hideLevel(c) ? String(hideLevel(c)) : void 0,
|
|
3872
3951
|
tabIndex: tabFor(0, ci),
|
|
3873
3952
|
"data-rc": "0:" + ci,
|
|
3874
3953
|
className: cx(
|
|
@@ -4025,6 +4104,7 @@ window.Aura = (() => {
|
|
|
4025
4104
|
pin && j === nPinned - 1 && "is-pin-edge"
|
|
4026
4105
|
),
|
|
4027
4106
|
style: cellStyle(c, j),
|
|
4107
|
+
...cardAttrs(c, j),
|
|
4028
4108
|
onFocus: function() {
|
|
4029
4109
|
if (activeState[0].r !== ri || activeState[0].c !== ci) activeState[1]({ r: ri, c: ci });
|
|
4030
4110
|
}
|
|
@@ -4033,6 +4113,7 @@ window.Aura = (() => {
|
|
|
4033
4113
|
)
|
|
4034
4114
|
);
|
|
4035
4115
|
});
|
|
4116
|
+
if (hasFields) cells.push(/* @__PURE__ */ React28.createElement("span", { key: "__br", className: "aura-table__break", "aria-hidden": true }));
|
|
4036
4117
|
cells.push(
|
|
4037
4118
|
/* @__PURE__ */ React28.createElement(
|
|
4038
4119
|
"span",
|
|
@@ -4046,7 +4127,7 @@ window.Aura = (() => {
|
|
|
4046
4127
|
return cells;
|
|
4047
4128
|
}
|
|
4048
4129
|
let body;
|
|
4049
|
-
const rowStyle = {
|
|
4130
|
+
const rowStyle = { ["--aura-row-min"]: rowMinWidth };
|
|
4050
4131
|
if (loading) {
|
|
4051
4132
|
const n2 = pageSize || props.skeletonRows || 5;
|
|
4052
4133
|
const skRows = body = [];
|
|
@@ -4063,7 +4144,9 @@ window.Aura = (() => {
|
|
|
4063
4144
|
{
|
|
4064
4145
|
key: c.key,
|
|
4065
4146
|
className: cx("aura-table__td", c.align === "end" && "is-end", isPinned(c) && "is-pinned"),
|
|
4066
|
-
style: cellStyle(c, j)
|
|
4147
|
+
style: cellStyle(c, j),
|
|
4148
|
+
...cardAttrs(c, j),
|
|
4149
|
+
"data-label": void 0
|
|
4067
4150
|
},
|
|
4068
4151
|
/* @__PURE__ */ React28.createElement(
|
|
4069
4152
|
"span",
|
|
@@ -4075,6 +4158,7 @@ window.Aura = (() => {
|
|
|
4075
4158
|
)
|
|
4076
4159
|
);
|
|
4077
4160
|
});
|
|
4161
|
+
if (hasFields) sk.push(/* @__PURE__ */ React28.createElement("span", { key: "__br", className: "aura-table__break" }));
|
|
4078
4162
|
sk.push(
|
|
4079
4163
|
/* @__PURE__ */ React28.createElement("span", { key: "__gr", className: cx("aura-table__gutter aura-table__gutter--end", controls && "has-picker") })
|
|
4080
4164
|
);
|
|
@@ -4160,102 +4244,6 @@ window.Aura = (() => {
|
|
|
4160
4244
|
} else if (height && rows.length && !loading) {
|
|
4161
4245
|
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));
|
|
4162
4246
|
}
|
|
4163
|
-
function renderStacked(wrapRefArg) {
|
|
4164
|
-
const titleCol = vis[0], pillCol = vis.filter(function(c) {
|
|
4165
|
-
return c.pill && c !== titleCol;
|
|
4166
|
-
})[0];
|
|
4167
|
-
const actionCols = vis.filter(function(c) {
|
|
4168
|
-
return c.actions && c !== titleCol;
|
|
4169
|
-
});
|
|
4170
|
-
const rest = vis.filter(function(c) {
|
|
4171
|
-
return c !== titleCol && c !== pillCol && !c.actions;
|
|
4172
|
-
});
|
|
4173
|
-
let cardBody;
|
|
4174
|
-
if (loading) {
|
|
4175
|
-
cardBody = /* @__PURE__ */ React28.createElement("ul", { className: "aura-table__cards", "aria-busy": true }, [0, 1, 2].map(function(i) {
|
|
4176
|
-
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%" } }));
|
|
4177
|
-
}));
|
|
4178
|
-
} else if (!rows.length) {
|
|
4179
|
-
const em2 = props.empty || {};
|
|
4180
|
-
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));
|
|
4181
|
-
} else {
|
|
4182
|
-
const cellVal = cellContent;
|
|
4183
|
-
cardBody = /* @__PURE__ */ React28.createElement("ul", { className: "aura-table__cards", "aria-label": props.label }, pageRows.map(function(r) {
|
|
4184
|
-
const k = r[rowKey], isSel = !!selSet[k];
|
|
4185
|
-
return /* @__PURE__ */ React28.createElement(
|
|
4186
|
-
"li",
|
|
4187
|
-
{
|
|
4188
|
-
key: k,
|
|
4189
|
-
className: cx(
|
|
4190
|
-
"aura-table__card",
|
|
4191
|
-
isSel && "is-selected",
|
|
4192
|
-
(props.onRowActivate || rowHref) && "is-actionable"
|
|
4193
|
-
),
|
|
4194
|
-
tabIndex: props.onRowActivate && !rowHref ? 0 : void 0,
|
|
4195
|
-
onClick: function(e) {
|
|
4196
|
-
const el = e.target;
|
|
4197
|
-
if (el.closest && el.closest(".aura-check, button, a, input")) return;
|
|
4198
|
-
if (rowHref) followRow(e.currentTarget, e);
|
|
4199
|
-
else if (props.onRowActivate) props.onRowActivate(r);
|
|
4200
|
-
},
|
|
4201
|
-
onKeyDown: function(e) {
|
|
4202
|
-
if (e.target === e.currentTarget && e.key === "Enter" && props.onRowActivate && !rowHref)
|
|
4203
|
-
props.onRowActivate(r);
|
|
4204
|
-
}
|
|
4205
|
-
},
|
|
4206
|
-
/* @__PURE__ */ React28.createElement("div", { className: "aura-table__card-head" }, selectable ? /* @__PURE__ */ React28.createElement(
|
|
4207
|
-
Checkbox,
|
|
4208
|
-
{
|
|
4209
|
-
checked: isSel,
|
|
4210
|
-
label: t.selectRow(k),
|
|
4211
|
-
onChange: function(on) {
|
|
4212
|
-
toggle(k, on);
|
|
4213
|
-
}
|
|
4214
|
-
}
|
|
4215
|
-
) : 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) {
|
|
4216
|
-
return /* @__PURE__ */ React28.createElement("span", { key: c.key, className: "aura-table__card-actions" }, cellVal(c, r));
|
|
4217
|
-
})),
|
|
4218
|
-
rest.length ? /* @__PURE__ */ React28.createElement("dl", { className: "aura-table__card-fields" }, rest.map(function(c) {
|
|
4219
|
-
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)));
|
|
4220
|
-
})) : null
|
|
4221
|
-
);
|
|
4222
|
-
}));
|
|
4223
|
-
}
|
|
4224
|
-
return /* @__PURE__ */ React28.createElement(
|
|
4225
|
-
"div",
|
|
4226
|
-
{
|
|
4227
|
-
ref: wrapRefArg,
|
|
4228
|
-
"data-density": props.density,
|
|
4229
|
-
className: cx("aura-table aura-table--stacked", refreshing && "is-refreshing", props.className),
|
|
4230
|
-
onMouseOver: showFull,
|
|
4231
|
-
onMouseLeave: hideFull,
|
|
4232
|
-
onFocus: showFull,
|
|
4233
|
-
onBlur: hideFull,
|
|
4234
|
-
role: "region",
|
|
4235
|
-
"aria-label": props.label,
|
|
4236
|
-
"aria-busy": busy || void 0
|
|
4237
|
-
},
|
|
4238
|
-
refreshing ? /* @__PURE__ */ React28.createElement("span", { className: "aura-table__busy-bar", "aria-hidden": true }) : null,
|
|
4239
|
-
selectable && pageRows.length && !busy ? /* @__PURE__ */ React28.createElement("div", { className: "aura-table__stack-bar" }, /* @__PURE__ */ React28.createElement(
|
|
4240
|
-
Checkbox,
|
|
4241
|
-
{
|
|
4242
|
-
checked: all,
|
|
4243
|
-
indeterminate: nSel > 0 && !all,
|
|
4244
|
-
label: all ? t.deselectAllRows : t.selectAllRows,
|
|
4245
|
-
onChange: toggleAll
|
|
4246
|
-
}
|
|
4247
|
-
), /* @__PURE__ */ React28.createElement("span", null, nSel ? t.selectedCount(nSel) : t.selectAll)) : null,
|
|
4248
|
-
cardBody,
|
|
4249
|
-
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) {
|
|
4250
|
-
return props.footer[c.key] != null;
|
|
4251
|
-
}).map(function(c) {
|
|
4252
|
-
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]));
|
|
4253
|
-
}))) : null,
|
|
4254
|
-
foot,
|
|
4255
|
-
tipEl
|
|
4256
|
-
);
|
|
4257
|
-
}
|
|
4258
|
-
if (stacked) return renderStacked(wrapMerged);
|
|
4259
4247
|
const totalRow = props.footer && rows.length && !loading ? /* @__PURE__ */ React28.createElement(
|
|
4260
4248
|
"div",
|
|
4261
4249
|
{
|
|
@@ -4280,13 +4268,17 @@ window.Aura = (() => {
|
|
|
4280
4268
|
c.mono && "aura-table__mono",
|
|
4281
4269
|
c.align === "end" && "is-end",
|
|
4282
4270
|
pin && "is-pinned",
|
|
4283
|
-
pin && j === nPinned - 1 && "is-pin-edge"
|
|
4271
|
+
pin && j === nPinned - 1 && "is-pin-edge",
|
|
4272
|
+
props.footer[c.key] == null && "is-blank"
|
|
4284
4273
|
),
|
|
4285
|
-
style: cellStyle(c, j)
|
|
4274
|
+
style: cellStyle(c, j),
|
|
4275
|
+
...cardAttrs(c, j),
|
|
4276
|
+
"data-label": j === 0 ? void 0 : c.label || t.totals
|
|
4286
4277
|
},
|
|
4287
4278
|
props.footer[c.key]
|
|
4288
4279
|
);
|
|
4289
4280
|
}),
|
|
4281
|
+
hasFields ? /* @__PURE__ */ React28.createElement("span", { className: "aura-table__break", "aria-hidden": true }) : null,
|
|
4290
4282
|
/* @__PURE__ */ React28.createElement(
|
|
4291
4283
|
"span",
|
|
4292
4284
|
{
|
|
@@ -4299,13 +4291,20 @@ window.Aura = (() => {
|
|
|
4299
4291
|
scrollPaddingLeft: "calc(var(--aura-space-6)" + selW + " + " + acc + "px)",
|
|
4300
4292
|
scrollPaddingTop: ROW_H + "px"
|
|
4301
4293
|
};
|
|
4302
|
-
if (height) scrollStyle
|
|
4294
|
+
if (height) scrollStyle["--aura-table-h"] = height + "px";
|
|
4303
4295
|
const gridEl = /* @__PURE__ */ React28.createElement(
|
|
4304
4296
|
"div",
|
|
4305
4297
|
{
|
|
4306
|
-
ref:
|
|
4298
|
+
ref: levels.length ? wrapRef : wrapMerged,
|
|
4307
4299
|
"data-density": props.density,
|
|
4308
|
-
className: cx(
|
|
4300
|
+
className: cx(
|
|
4301
|
+
"aura-table",
|
|
4302
|
+
stacked && "aura-table--stacked",
|
|
4303
|
+
scrolledX[0] && "is-scrolled-x",
|
|
4304
|
+
refreshing && "is-refreshing",
|
|
4305
|
+
!levels.length && props.className
|
|
4306
|
+
),
|
|
4307
|
+
style: levels.length ? { ["--aura-q-back"]: String(levels[levels.length - 1].px / Q) } : void 0
|
|
4309
4308
|
},
|
|
4310
4309
|
refreshing ? /* @__PURE__ */ React28.createElement("span", { className: "aura-table__busy-bar", "aria-hidden": true }) : null,
|
|
4311
4310
|
/* @__PURE__ */ React28.createElement(
|
|
@@ -4337,7 +4336,16 @@ window.Aura = (() => {
|
|
|
4337
4336
|
if (sx !== scrolledX[0]) scrolledX[1](sx);
|
|
4338
4337
|
}
|
|
4339
4338
|
},
|
|
4340
|
-
/* @__PURE__ */ React28.createElement(
|
|
4339
|
+
/* @__PURE__ */ React28.createElement(
|
|
4340
|
+
"div",
|
|
4341
|
+
{
|
|
4342
|
+
className: cx("aura-table__head", selectable && nRows > 0 && !busy && "has-select-all"),
|
|
4343
|
+
role: "row",
|
|
4344
|
+
"aria-rowindex": 1,
|
|
4345
|
+
style: rowStyle
|
|
4346
|
+
},
|
|
4347
|
+
head
|
|
4348
|
+
),
|
|
4341
4349
|
body,
|
|
4342
4350
|
totalRow
|
|
4343
4351
|
),
|
|
@@ -4365,8 +4373,20 @@ window.Aura = (() => {
|
|
|
4365
4373
|
) : null,
|
|
4366
4374
|
tipEl
|
|
4367
4375
|
);
|
|
4368
|
-
if (!
|
|
4369
|
-
|
|
4376
|
+
if (!levels.length) return gridEl;
|
|
4377
|
+
let out = gridEl;
|
|
4378
|
+
for (let i = levels.length - 1; i >= 0; i--) {
|
|
4379
|
+
const prev = i === 0 ? Q : levels[i - 1].px;
|
|
4380
|
+
out = /* @__PURE__ */ React28.createElement(
|
|
4381
|
+
"div",
|
|
4382
|
+
{
|
|
4383
|
+
className: cx("aura-table-q", "aura-table-q--" + levels[i].name),
|
|
4384
|
+
style: { ["--aura-q-scale"]: String(prev / levels[i].px) }
|
|
4385
|
+
},
|
|
4386
|
+
out
|
|
4387
|
+
);
|
|
4388
|
+
}
|
|
4389
|
+
return /* @__PURE__ */ React28.createElement("div", { ref, className: cx("aura-table-box", props.className) }, out);
|
|
4370
4390
|
});
|
|
4371
4391
|
|
|
4372
4392
|
// src/Card.tsx
|
|
@@ -4954,9 +4974,96 @@ window.Aura = (() => {
|
|
|
4954
4974
|
);
|
|
4955
4975
|
});
|
|
4956
4976
|
|
|
4957
|
-
// src/
|
|
4977
|
+
// src/Separator.tsx
|
|
4958
4978
|
var React40 = __toESM(require_react(), 1);
|
|
4959
|
-
var
|
|
4979
|
+
var Separator = React40.forwardRef(function Separator2(props, ref) {
|
|
4980
|
+
const vertical = props.orientation === "vertical";
|
|
4981
|
+
const decorative = props.decorative !== false;
|
|
4982
|
+
return /* @__PURE__ */ React40.createElement(
|
|
4983
|
+
"div",
|
|
4984
|
+
{
|
|
4985
|
+
ref,
|
|
4986
|
+
className: cx("aura-separator", vertical && "aura-separator--vertical", props.className),
|
|
4987
|
+
role: decorative ? "none" : "separator",
|
|
4988
|
+
"aria-orientation": !decorative && vertical ? "vertical" : void 0,
|
|
4989
|
+
style: props.spacing != null ? { ["--aura-separator-space"]: "var(--aura-space-" + props.spacing + ")" } : void 0
|
|
4990
|
+
}
|
|
4991
|
+
);
|
|
4992
|
+
});
|
|
4993
|
+
|
|
4994
|
+
// src/Table.tsx
|
|
4995
|
+
var React41 = __toESM(require_react(), 1);
|
|
4996
|
+
var Table = React41.forwardRef(function Table2(props, ref) {
|
|
4997
|
+
const { caption, captionHidden, density, className, children, ...rest } = props;
|
|
4998
|
+
const capId = uid();
|
|
4999
|
+
const wrap = React41.useRef(null);
|
|
5000
|
+
const sc = React41.useState(false), scrolls = sc[0];
|
|
5001
|
+
useIsoLayoutEffect(function() {
|
|
5002
|
+
const el = wrap.current;
|
|
5003
|
+
if (!el || typeof ResizeObserver === "undefined") return;
|
|
5004
|
+
function check() {
|
|
5005
|
+
sc[1](el.scrollWidth > el.clientWidth + 1);
|
|
5006
|
+
}
|
|
5007
|
+
check();
|
|
5008
|
+
const ro = new ResizeObserver(check);
|
|
5009
|
+
ro.observe(el);
|
|
5010
|
+
return function() {
|
|
5011
|
+
ro.disconnect();
|
|
5012
|
+
};
|
|
5013
|
+
}, []);
|
|
5014
|
+
return /* @__PURE__ */ React41.createElement(
|
|
5015
|
+
"div",
|
|
5016
|
+
{
|
|
5017
|
+
ref: wrap,
|
|
5018
|
+
className: "aura-tbl-wrap",
|
|
5019
|
+
"data-density": density,
|
|
5020
|
+
tabIndex: scrolls ? 0 : void 0,
|
|
5021
|
+
role: scrolls ? "region" : void 0,
|
|
5022
|
+
"aria-labelledby": scrolls && caption != null ? capId : void 0
|
|
5023
|
+
},
|
|
5024
|
+
/* @__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)
|
|
5025
|
+
);
|
|
5026
|
+
});
|
|
5027
|
+
function section(tag, cls) {
|
|
5028
|
+
const C = React41.forwardRef(function TableSection(props, ref) {
|
|
5029
|
+
const { className, ...rest } = props;
|
|
5030
|
+
return React41.createElement(tag, Object.assign({ ref, className: cx(cls, className) }, rest));
|
|
5031
|
+
});
|
|
5032
|
+
return C;
|
|
5033
|
+
}
|
|
5034
|
+
var THead = section("thead", "aura-tbl__head");
|
|
5035
|
+
THead.displayName = "THead";
|
|
5036
|
+
var TBody = section("tbody", "aura-tbl__body");
|
|
5037
|
+
TBody.displayName = "TBody";
|
|
5038
|
+
var TFoot = section("tfoot", "aura-tbl__foot");
|
|
5039
|
+
TFoot.displayName = "TFoot";
|
|
5040
|
+
var Tr = React41.forwardRef(function Tr2(props, ref) {
|
|
5041
|
+
const { className, ...rest } = props;
|
|
5042
|
+
return /* @__PURE__ */ React41.createElement("tr", { ref, className: cx("aura-tbl__row", className), ...rest });
|
|
5043
|
+
});
|
|
5044
|
+
function cellClass(base, p) {
|
|
5045
|
+
const align = p.align || (p.numeric ? "end" : void 0);
|
|
5046
|
+
return cx(
|
|
5047
|
+
base,
|
|
5048
|
+
align === "end" && "is-end",
|
|
5049
|
+
align === "center" && "is-center",
|
|
5050
|
+
p.numeric && "is-numeric",
|
|
5051
|
+
p.mono && "aura-table__mono",
|
|
5052
|
+
p.className
|
|
5053
|
+
);
|
|
5054
|
+
}
|
|
5055
|
+
var Th = React41.forwardRef(function Th2(props, ref) {
|
|
5056
|
+
const { align, numeric, mono, className, scope, ...rest } = props;
|
|
5057
|
+
return /* @__PURE__ */ React41.createElement("th", { ref, scope: scope || "col", className: cellClass("aura-tbl__th", props), ...rest });
|
|
5058
|
+
});
|
|
5059
|
+
var Td = React41.forwardRef(function Td2(props, ref) {
|
|
5060
|
+
const { align, numeric, mono, className, scope, ...rest } = props;
|
|
5061
|
+
return /* @__PURE__ */ React41.createElement("td", { ref, className: cellClass("aura-tbl__td", props), ...rest });
|
|
5062
|
+
});
|
|
5063
|
+
|
|
5064
|
+
// src/BottomNav.tsx
|
|
5065
|
+
var React42 = __toESM(require_react(), 1);
|
|
5066
|
+
var BottomNav = React42.forwardRef(function BottomNav2(props, ref) {
|
|
4960
5067
|
const t = useStrings();
|
|
4961
5068
|
const Link = useLinkComponent(props.linkComponent);
|
|
4962
5069
|
const st = useMaybeControlled(
|
|
@@ -4966,14 +5073,14 @@ window.Aura = (() => {
|
|
|
4966
5073
|
);
|
|
4967
5074
|
const active = st[0];
|
|
4968
5075
|
const hide = props.hideFrom === false ? "always" : "below-" + (props.hideFrom || "lg");
|
|
4969
|
-
return /* @__PURE__ */
|
|
5076
|
+
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(
|
|
4970
5077
|
"nav",
|
|
4971
5078
|
{
|
|
4972
5079
|
ref,
|
|
4973
5080
|
className: cx("aura-bottomnav", "aura-bottomnav--" + hide, props.className),
|
|
4974
5081
|
"aria-label": props.label || t.mainNav
|
|
4975
5082
|
},
|
|
4976
|
-
/* @__PURE__ */
|
|
5083
|
+
/* @__PURE__ */ React42.createElement("ul", { className: "aura-bottomnav__list" }, props.items.map(function(it) {
|
|
4977
5084
|
const on = active === it.id;
|
|
4978
5085
|
const count = it.count != null && it.count > 0 ? it.count > 99 ? "99+" : String(it.count) : null;
|
|
4979
5086
|
const common = {
|
|
@@ -4985,19 +5092,19 @@ window.Aura = (() => {
|
|
|
4985
5092
|
}
|
|
4986
5093
|
};
|
|
4987
5094
|
const inner = [
|
|
4988
|
-
/* @__PURE__ */
|
|
4989
|
-
/* @__PURE__ */
|
|
4990
|
-
count || it.badge && it.badgeLabel ? /* @__PURE__ */
|
|
5095
|
+
/* @__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),
|
|
5096
|
+
/* @__PURE__ */ React42.createElement("span", { key: "l", className: "aura-bottomnav__label" }, it.label),
|
|
5097
|
+
count || it.badge && it.badgeLabel ? /* @__PURE__ */ React42.createElement("span", { key: "s", className: "aura-sr-only" }, " (" + (count || it.badgeLabel) + ")") : null
|
|
4991
5098
|
];
|
|
4992
|
-
return /* @__PURE__ */
|
|
5099
|
+
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));
|
|
4993
5100
|
}))
|
|
4994
5101
|
));
|
|
4995
5102
|
});
|
|
4996
5103
|
|
|
4997
5104
|
// src/Surface.tsx
|
|
4998
|
-
var
|
|
4999
|
-
var h8 =
|
|
5000
|
-
var Surface =
|
|
5105
|
+
var React43 = __toESM(require_react(), 1);
|
|
5106
|
+
var h8 = React43.createElement;
|
|
5107
|
+
var Surface = React43.forwardRef(function Surface2(props, ref) {
|
|
5001
5108
|
const t = props.texture || "mesh";
|
|
5002
5109
|
const rest = omit(props, ["texture", "className", "children", "as"]);
|
|
5003
5110
|
return h8(
|
|
@@ -5018,8 +5125,8 @@ window.Aura = (() => {
|
|
|
5018
5125
|
});
|
|
5019
5126
|
|
|
5020
5127
|
// src/Stat.tsx
|
|
5021
|
-
var
|
|
5022
|
-
var Stat =
|
|
5128
|
+
var React44 = __toESM(require_react(), 1);
|
|
5129
|
+
var Stat = React44.forwardRef(function Stat2(props, ref) {
|
|
5023
5130
|
const ch = props.change;
|
|
5024
5131
|
const dir = ch && (ch.direction || "flat");
|
|
5025
5132
|
const tone2 = ch && (ch.tone || (dir === "up" ? "positive" : dir === "down" ? "negative" : "neutral"));
|
|
@@ -5028,7 +5135,7 @@ window.Aura = (() => {
|
|
|
5028
5135
|
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, ""));
|
|
5029
5136
|
const Tag3 = props.href ? Link : props.onClick ? "button" : "div";
|
|
5030
5137
|
const interactive = !!(props.href || props.onClick);
|
|
5031
|
-
return /* @__PURE__ */
|
|
5138
|
+
return /* @__PURE__ */ React44.createElement(
|
|
5032
5139
|
Tag3,
|
|
5033
5140
|
{
|
|
5034
5141
|
ref,
|
|
@@ -5038,14 +5145,14 @@ window.Aura = (() => {
|
|
|
5038
5145
|
type: Tag3 === "button" ? "button" : void 0,
|
|
5039
5146
|
"aria-busy": props.loading || void 0
|
|
5040
5147
|
},
|
|
5041
|
-
/* @__PURE__ */
|
|
5042
|
-
props.loading ? /* @__PURE__ */
|
|
5043
|
-
ch && !props.loading || props.caption ? /* @__PURE__ */
|
|
5148
|
+
/* @__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),
|
|
5149
|
+
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),
|
|
5150
|
+
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
|
|
5044
5151
|
);
|
|
5045
5152
|
});
|
|
5046
5153
|
|
|
5047
5154
|
// src/TimePicker.tsx
|
|
5048
|
-
var
|
|
5155
|
+
var React45 = __toESM(require_react(), 1);
|
|
5049
5156
|
var import_react_dom10 = __toESM(require_react_dom(), 1);
|
|
5050
5157
|
|
|
5051
5158
|
// src/text.ts
|
|
@@ -5086,7 +5193,7 @@ window.Aura = (() => {
|
|
|
5086
5193
|
function fromMin(n2) {
|
|
5087
5194
|
return pad3(Math.floor(n2 / 60)) + ":" + pad3(n2 % 60);
|
|
5088
5195
|
}
|
|
5089
|
-
var TimePicker =
|
|
5196
|
+
var TimePicker = React45.forwardRef(function TimePicker2(props, ref) {
|
|
5090
5197
|
const t = useStrings();
|
|
5091
5198
|
const auto = uid(), id = props.id || auto, listId = id + "-list";
|
|
5092
5199
|
const st = useMaybeControlled(
|
|
@@ -5096,7 +5203,7 @@ window.Aura = (() => {
|
|
|
5096
5203
|
);
|
|
5097
5204
|
const value = st[0];
|
|
5098
5205
|
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;
|
|
5099
|
-
const slots =
|
|
5206
|
+
const slots = React45.useMemo(
|
|
5100
5207
|
function() {
|
|
5101
5208
|
const out = [];
|
|
5102
5209
|
for (let m = lo; m <= hi; m += step) out.push(fromMin(m));
|
|
@@ -5108,12 +5215,12 @@ window.Aura = (() => {
|
|
|
5108
5215
|
const n2 = toMin(v);
|
|
5109
5216
|
return n2 == null || n2 < lo || n2 > hi || props.isTimeDisabled && props.isTimeDisabled(v);
|
|
5110
5217
|
}
|
|
5111
|
-
const openState =
|
|
5112
|
-
const editState =
|
|
5113
|
-
const aState =
|
|
5114
|
-
const errState =
|
|
5115
|
-
const pos =
|
|
5116
|
-
const boxRef =
|
|
5218
|
+
const openState = React45.useState(false), open = openState[0], setOpen = openState[1];
|
|
5219
|
+
const editState = React45.useState(null), editing = editState[0], setEditing = editState[1];
|
|
5220
|
+
const aState = React45.useState(0), active = aState[0], setActive = aState[1];
|
|
5221
|
+
const errState = React45.useState(null);
|
|
5222
|
+
const pos = React45.useState(null);
|
|
5223
|
+
const boxRef = React45.useRef(null), inputRef = React45.useRef(null), listRef = React45.useRef(null), inputMerged = useMergedRef(ref, inputRef);
|
|
5117
5224
|
const mounted = useMounted();
|
|
5118
5225
|
function nearest(v) {
|
|
5119
5226
|
const n2 = toMin(v);
|
|
@@ -5126,13 +5233,13 @@ window.Aura = (() => {
|
|
|
5126
5233
|
}
|
|
5127
5234
|
function place() {
|
|
5128
5235
|
if (!boxRef.current) return;
|
|
5129
|
-
const r = boxRef.current.getBoundingClientRect(),
|
|
5236
|
+
const r = boxRef.current.getBoundingClientRect(), below2 = window.innerHeight - r.bottom - 8, up = below2 < 200 && r.top > below2;
|
|
5130
5237
|
pos[1]({
|
|
5131
5238
|
left: r.left,
|
|
5132
5239
|
width: Math.max(r.width, 160),
|
|
5133
5240
|
top: up ? void 0 : r.bottom + 4,
|
|
5134
5241
|
bottom: up ? window.innerHeight - r.top + 4 : void 0,
|
|
5135
|
-
maxHeight: Math.min(280, (up ? r.top :
|
|
5242
|
+
maxHeight: Math.min(280, (up ? r.top : below2) - 8)
|
|
5136
5243
|
});
|
|
5137
5244
|
}
|
|
5138
5245
|
useIsoLayoutEffect(
|
|
@@ -5141,7 +5248,7 @@ window.Aura = (() => {
|
|
|
5141
5248
|
},
|
|
5142
5249
|
[open]
|
|
5143
5250
|
);
|
|
5144
|
-
|
|
5251
|
+
React45.useEffect(
|
|
5145
5252
|
function() {
|
|
5146
5253
|
if (!open) return;
|
|
5147
5254
|
function outside(e) {
|
|
@@ -5163,7 +5270,7 @@ window.Aura = (() => {
|
|
|
5163
5270
|
},
|
|
5164
5271
|
[open]
|
|
5165
5272
|
);
|
|
5166
|
-
|
|
5273
|
+
React45.useEffect(
|
|
5167
5274
|
function() {
|
|
5168
5275
|
if (!open || !listRef.current) return;
|
|
5169
5276
|
const el = listRef.current.querySelector('[data-idx="' + active + '"]');
|
|
@@ -5261,9 +5368,9 @@ window.Aura = (() => {
|
|
|
5261
5368
|
}
|
|
5262
5369
|
const error = errState[0] || props.error;
|
|
5263
5370
|
const list = open && mounted && pos[0] ? (0, import_react_dom10.createPortal)(
|
|
5264
|
-
/* @__PURE__ */
|
|
5371
|
+
/* @__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) {
|
|
5265
5372
|
const dis = blocked(s), sel = s === value;
|
|
5266
|
-
return /* @__PURE__ */
|
|
5373
|
+
return /* @__PURE__ */ React45.createElement(
|
|
5267
5374
|
"li",
|
|
5268
5375
|
{
|
|
5269
5376
|
key: s,
|
|
@@ -5288,13 +5395,13 @@ window.Aura = (() => {
|
|
|
5288
5395
|
if (active !== i) setActive(i);
|
|
5289
5396
|
}
|
|
5290
5397
|
},
|
|
5291
|
-
/* @__PURE__ */
|
|
5292
|
-
sel ? /* @__PURE__ */
|
|
5398
|
+
/* @__PURE__ */ React45.createElement("span", { className: "aura-combo__label" }, s),
|
|
5399
|
+
sel ? /* @__PURE__ */ React45.createElement(Icon, { name: "check", className: "aura-combo__check" }) : null
|
|
5293
5400
|
);
|
|
5294
5401
|
}))),
|
|
5295
5402
|
document.body
|
|
5296
5403
|
) : null;
|
|
5297
|
-
return /* @__PURE__ */
|
|
5404
|
+
return /* @__PURE__ */ React45.createElement(
|
|
5298
5405
|
Field,
|
|
5299
5406
|
{
|
|
5300
5407
|
id,
|
|
@@ -5306,7 +5413,7 @@ window.Aura = (() => {
|
|
|
5306
5413
|
disabled: props.disabled,
|
|
5307
5414
|
className: props.className
|
|
5308
5415
|
},
|
|
5309
|
-
/* @__PURE__ */
|
|
5416
|
+
/* @__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(
|
|
5310
5417
|
"input",
|
|
5311
5418
|
{
|
|
5312
5419
|
ref: inputMerged,
|
|
@@ -5346,7 +5453,7 @@ window.Aura = (() => {
|
|
|
5346
5453
|
}, 0);
|
|
5347
5454
|
}
|
|
5348
5455
|
}
|
|
5349
|
-
), props.clearable !== false && value != null && !props.disabled ? /* @__PURE__ */
|
|
5456
|
+
), props.clearable !== false && value != null && !props.disabled ? /* @__PURE__ */ React45.createElement(
|
|
5350
5457
|
"button",
|
|
5351
5458
|
{
|
|
5352
5459
|
type: "button",
|
|
@@ -5359,8 +5466,8 @@ window.Aura = (() => {
|
|
|
5359
5466
|
if (inputRef.current) inputRef.current.focus();
|
|
5360
5467
|
}
|
|
5361
5468
|
},
|
|
5362
|
-
/* @__PURE__ */
|
|
5363
|
-
) : null, /* @__PURE__ */
|
|
5469
|
+
/* @__PURE__ */ React45.createElement(Icon, { name: "x" })
|
|
5470
|
+
) : null, /* @__PURE__ */ React45.createElement(
|
|
5364
5471
|
"button",
|
|
5365
5472
|
{
|
|
5366
5473
|
type: "button",
|
|
@@ -5378,14 +5485,14 @@ window.Aura = (() => {
|
|
|
5378
5485
|
}
|
|
5379
5486
|
}
|
|
5380
5487
|
},
|
|
5381
|
-
/* @__PURE__ */
|
|
5488
|
+
/* @__PURE__ */ React45.createElement(Icon, { name: "chevron-down" })
|
|
5382
5489
|
)),
|
|
5383
5490
|
list
|
|
5384
5491
|
);
|
|
5385
5492
|
});
|
|
5386
5493
|
|
|
5387
5494
|
// src/FileUpload.tsx
|
|
5388
|
-
var
|
|
5495
|
+
var React46 = __toESM(require_react(), 1);
|
|
5389
5496
|
function matches(file, accept) {
|
|
5390
5497
|
if (!accept) return true;
|
|
5391
5498
|
const name = (file.name || "").toLowerCase(), type = (file.type || "").toLowerCase();
|
|
@@ -5409,17 +5516,17 @@ window.Aura = (() => {
|
|
|
5409
5516
|
}).join(", ");
|
|
5410
5517
|
}
|
|
5411
5518
|
var seq = 0;
|
|
5412
|
-
var FileUpload =
|
|
5519
|
+
var FileUpload = React46.forwardRef(function FileUpload2(props, ref) {
|
|
5413
5520
|
const t = useStrings();
|
|
5414
5521
|
const auto = uid(), id = props.id || auto;
|
|
5415
5522
|
const st = useMaybeControlled(props.value, props.defaultValue || [], props.onChange);
|
|
5416
5523
|
const items2 = st[0] || [];
|
|
5417
|
-
const dragState =
|
|
5418
|
-
const inputRef =
|
|
5419
|
-
const urls =
|
|
5524
|
+
const dragState = React46.useState(false), over = dragState[0];
|
|
5525
|
+
const inputRef = React46.useRef(null), inputMerged = useMergedRef(ref, inputRef);
|
|
5526
|
+
const urls = React46.useRef({});
|
|
5420
5527
|
const maxFiles = props.multiple ? props.maxFiles : 1;
|
|
5421
5528
|
const note = t.accepts(describeAccept(props.accept, t), props.maxSize ? formatBytes(props.maxSize) : "");
|
|
5422
|
-
|
|
5529
|
+
React46.useEffect(function() {
|
|
5423
5530
|
return function() {
|
|
5424
5531
|
Object.keys(urls.current).forEach(function(k) {
|
|
5425
5532
|
URL.revokeObjectURL(urls.current[k]);
|
|
@@ -5470,7 +5577,7 @@ window.Aura = (() => {
|
|
|
5470
5577
|
if (inputRef.current) inputRef.current.focus();
|
|
5471
5578
|
}
|
|
5472
5579
|
const error = props.error;
|
|
5473
|
-
return /* @__PURE__ */
|
|
5580
|
+
return /* @__PURE__ */ React46.createElement(
|
|
5474
5581
|
Field,
|
|
5475
5582
|
{
|
|
5476
5583
|
id,
|
|
@@ -5482,7 +5589,7 @@ window.Aura = (() => {
|
|
|
5482
5589
|
disabled: props.disabled,
|
|
5483
5590
|
className: props.className
|
|
5484
5591
|
},
|
|
5485
|
-
/* @__PURE__ */
|
|
5592
|
+
/* @__PURE__ */ React46.createElement(
|
|
5486
5593
|
"div",
|
|
5487
5594
|
{
|
|
5488
5595
|
className: cx("aura-upload", over && "is-over", props.disabled && "is-disabled", error && "is-invalid"),
|
|
@@ -5503,9 +5610,9 @@ window.Aura = (() => {
|
|
|
5503
5610
|
add(e.dataTransfer && e.dataTransfer.files);
|
|
5504
5611
|
}
|
|
5505
5612
|
},
|
|
5506
|
-
/* @__PURE__ */
|
|
5507
|
-
/* @__PURE__ */
|
|
5508
|
-
/* @__PURE__ */
|
|
5613
|
+
/* @__PURE__ */ React46.createElement(Icon, { name: "cloud-upload", size: "lg", className: "aura-upload__icon" }),
|
|
5614
|
+
/* @__PURE__ */ React46.createElement("span", { className: "aura-upload__text" }, t.dropFiles, " "),
|
|
5615
|
+
/* @__PURE__ */ React46.createElement(
|
|
5509
5616
|
"input",
|
|
5510
5617
|
{
|
|
5511
5618
|
ref: inputMerged,
|
|
@@ -5527,12 +5634,12 @@ window.Aura = (() => {
|
|
|
5527
5634
|
}
|
|
5528
5635
|
}
|
|
5529
5636
|
),
|
|
5530
|
-
/* @__PURE__ */
|
|
5531
|
-
note ? /* @__PURE__ */
|
|
5637
|
+
/* @__PURE__ */ React46.createElement("span", { className: "aura-upload__browse", "aria-hidden": true }, props.multiple ? t.browse : t.browseOne),
|
|
5638
|
+
note ? /* @__PURE__ */ React46.createElement("span", { className: "aura-upload__note", id: id + "-note" }, note) : null
|
|
5532
5639
|
),
|
|
5533
|
-
items2.length ? /* @__PURE__ */
|
|
5640
|
+
items2.length ? /* @__PURE__ */ React46.createElement("ul", { className: "aura-upload__list", "aria-live": "polite" }, items2.map(function(it) {
|
|
5534
5641
|
const src = thumb(it);
|
|
5535
|
-
return /* @__PURE__ */
|
|
5642
|
+
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(
|
|
5536
5643
|
"span",
|
|
5537
5644
|
{
|
|
5538
5645
|
className: "aura-upload__bar",
|
|
@@ -5542,8 +5649,8 @@ window.Aura = (() => {
|
|
|
5542
5649
|
"aria-valuemax": 100,
|
|
5543
5650
|
"aria-valuenow": it.progress != null ? Math.round(it.progress) : void 0
|
|
5544
5651
|
},
|
|
5545
|
-
/* @__PURE__ */
|
|
5546
|
-
) : null), /* @__PURE__ */
|
|
5652
|
+
/* @__PURE__ */ React46.createElement("span", { style: { width: (it.progress || 0) + "%" } })
|
|
5653
|
+
) : null), /* @__PURE__ */ React46.createElement(
|
|
5547
5654
|
IconButton,
|
|
5548
5655
|
{
|
|
5549
5656
|
icon: "x",
|
|
@@ -5829,9 +5936,9 @@ window.Aura = (() => {
|
|
|
5829
5936
|
}
|
|
5830
5937
|
|
|
5831
5938
|
// src/ThemeStyle.tsx
|
|
5832
|
-
var
|
|
5939
|
+
var React47 = __toESM(require_react(), 1);
|
|
5833
5940
|
function ThemeStyle(props) {
|
|
5834
|
-
const css =
|
|
5941
|
+
const css = React47.useMemo(
|
|
5835
5942
|
function() {
|
|
5836
5943
|
return createTheme({ brand: props.brand, signal: props.signal, primary: props.primary, name: props.name }).css(
|
|
5837
5944
|
props.selector
|
|
@@ -5839,11 +5946,11 @@ window.Aura = (() => {
|
|
|
5839
5946
|
},
|
|
5840
5947
|
[props.brand, props.signal, props.primary, props.name, props.selector]
|
|
5841
5948
|
);
|
|
5842
|
-
return /* @__PURE__ */
|
|
5949
|
+
return /* @__PURE__ */ React47.createElement("style", { "data-aura-theme": props.name || props.brand, dangerouslySetInnerHTML: { __html: css } });
|
|
5843
5950
|
}
|
|
5844
5951
|
|
|
5845
5952
|
// src/colorScheme.tsx
|
|
5846
|
-
var
|
|
5953
|
+
var React48 = __toESM(require_react(), 1);
|
|
5847
5954
|
|
|
5848
5955
|
// src/colorSchemeScript.ts
|
|
5849
5956
|
var DEFAULT_KEY = "aura-color-scheme";
|
|
@@ -5860,7 +5967,7 @@ window.Aura = (() => {
|
|
|
5860
5967
|
|
|
5861
5968
|
// src/colorScheme.tsx
|
|
5862
5969
|
function ColorSchemeScript(props) {
|
|
5863
|
-
return /* @__PURE__ */
|
|
5970
|
+
return /* @__PURE__ */ React48.createElement(
|
|
5864
5971
|
"script",
|
|
5865
5972
|
{
|
|
5866
5973
|
"data-aura-color-scheme": "",
|
|
@@ -5885,7 +5992,7 @@ window.Aura = (() => {
|
|
|
5885
5992
|
function useColorScheme(options) {
|
|
5886
5993
|
const key = options && options.storageKey || DEFAULT_KEY;
|
|
5887
5994
|
const fallback = options && options.defaultScheme || "system";
|
|
5888
|
-
const subscribe2 =
|
|
5995
|
+
const subscribe2 = React48.useCallback(
|
|
5889
5996
|
function(cb) {
|
|
5890
5997
|
const mq = window.matchMedia ? window.matchMedia("(prefers-color-scheme: dark)") : null;
|
|
5891
5998
|
function onSystem() {
|
|
@@ -5903,7 +6010,7 @@ window.Aura = (() => {
|
|
|
5903
6010
|
},
|
|
5904
6011
|
[fallback]
|
|
5905
6012
|
);
|
|
5906
|
-
const snapshot =
|
|
6013
|
+
const snapshot = React48.useSyncExternalStore(
|
|
5907
6014
|
subscribe2,
|
|
5908
6015
|
function() {
|
|
5909
6016
|
const s = readScheme(fallback);
|
|
@@ -5914,7 +6021,7 @@ window.Aura = (() => {
|
|
|
5914
6021
|
}
|
|
5915
6022
|
);
|
|
5916
6023
|
const parts = snapshot.split("|");
|
|
5917
|
-
const setScheme =
|
|
6024
|
+
const setScheme = React48.useCallback(
|
|
5918
6025
|
function(next) {
|
|
5919
6026
|
if (!valid(next)) return;
|
|
5920
6027
|
try {
|
|
@@ -5933,11 +6040,11 @@ window.Aura = (() => {
|
|
|
5933
6040
|
const cs = useColorScheme(props);
|
|
5934
6041
|
const names = { light: t.schemeLight, dark: t.schemeDark, system: t.schemeSystem };
|
|
5935
6042
|
const label = props.label || t.colorScheme;
|
|
5936
|
-
return /* @__PURE__ */
|
|
6043
|
+
return /* @__PURE__ */ React48.createElement(
|
|
5937
6044
|
DropdownMenu,
|
|
5938
6045
|
{
|
|
5939
6046
|
label,
|
|
5940
|
-
trigger: /* @__PURE__ */
|
|
6047
|
+
trigger: /* @__PURE__ */ React48.createElement(IconButton, { icon: cs.resolved === "dark" ? "moon" : "sun", label: label + ": " + names[cs.scheme] }),
|
|
5941
6048
|
items: SCHEMES.map(function(s) {
|
|
5942
6049
|
return {
|
|
5943
6050
|
label: names[s],
|
|
@@ -5952,10 +6059,10 @@ window.Aura = (() => {
|
|
|
5952
6059
|
}
|
|
5953
6060
|
|
|
5954
6061
|
// src/Badge.tsx
|
|
5955
|
-
var
|
|
5956
|
-
var Badge =
|
|
6062
|
+
var React49 = __toESM(require_react(), 1);
|
|
6063
|
+
var Badge = React49.forwardRef(function Badge2(props, ref) {
|
|
5957
6064
|
const rest = omit(props, ["tone", "variant", "icon", "className", "children"]);
|
|
5958
|
-
return /* @__PURE__ */
|
|
6065
|
+
return /* @__PURE__ */ React49.createElement(
|
|
5959
6066
|
"span",
|
|
5960
6067
|
{
|
|
5961
6068
|
...rest,
|
|
@@ -5968,19 +6075,19 @@ window.Aura = (() => {
|
|
|
5968
6075
|
props.className
|
|
5969
6076
|
)
|
|
5970
6077
|
},
|
|
5971
|
-
props.icon ? /* @__PURE__ */
|
|
6078
|
+
props.icon ? /* @__PURE__ */ React49.createElement(Icon, { name: props.icon, size: 12 }) : null,
|
|
5972
6079
|
props.children
|
|
5973
6080
|
);
|
|
5974
6081
|
});
|
|
5975
6082
|
|
|
5976
6083
|
// src/Progress.tsx
|
|
5977
|
-
var
|
|
5978
|
-
var Progress =
|
|
6084
|
+
var React50 = __toESM(require_react(), 1);
|
|
6085
|
+
var Progress = React50.forwardRef(function Progress2(props, ref) {
|
|
5979
6086
|
const auto = uid(), id = props.id || auto;
|
|
5980
6087
|
const max = props.max || 100, det = props.value != null;
|
|
5981
6088
|
const pct = det ? Math.max(0, Math.min(100, props.value / max * 100)) : 0;
|
|
5982
6089
|
const shown = props.valueLabel != null ? props.valueLabel : det ? Math.round(pct) + "%" : null;
|
|
5983
|
-
return /* @__PURE__ */
|
|
6090
|
+
return /* @__PURE__ */ React50.createElement(
|
|
5984
6091
|
"div",
|
|
5985
6092
|
{
|
|
5986
6093
|
ref,
|
|
@@ -5991,8 +6098,8 @@ window.Aura = (() => {
|
|
|
5991
6098
|
props.className
|
|
5992
6099
|
)
|
|
5993
6100
|
},
|
|
5994
|
-
props.label || props.showValue && shown ? /* @__PURE__ */
|
|
5995
|
-
/* @__PURE__ */
|
|
6101
|
+
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,
|
|
6102
|
+
/* @__PURE__ */ React50.createElement(
|
|
5996
6103
|
"div",
|
|
5997
6104
|
{
|
|
5998
6105
|
className: cx("aura-progress__track", !det && "is-indeterminate"),
|
|
@@ -6004,21 +6111,21 @@ window.Aura = (() => {
|
|
|
6004
6111
|
"aria-valuenow": det ? props.value : void 0,
|
|
6005
6112
|
"aria-valuetext": det && props.valueLabel != null ? String(props.valueLabel) : void 0
|
|
6006
6113
|
},
|
|
6007
|
-
/* @__PURE__ */
|
|
6114
|
+
/* @__PURE__ */ React50.createElement("span", { className: "aura-progress__bar", style: det ? { width: pct + "%" } : void 0 })
|
|
6008
6115
|
),
|
|
6009
|
-
props.hint ? /* @__PURE__ */
|
|
6116
|
+
props.hint ? /* @__PURE__ */ React50.createElement("p", { className: "aura-progress__hint" }, props.hint) : null
|
|
6010
6117
|
);
|
|
6011
6118
|
});
|
|
6012
6119
|
|
|
6013
6120
|
// src/Skeleton.tsx
|
|
6014
|
-
var
|
|
6015
|
-
var Skeleton =
|
|
6121
|
+
var React51 = __toESM(require_react(), 1);
|
|
6122
|
+
var Skeleton = React51.forwardRef(function Skeleton2(props, ref) {
|
|
6016
6123
|
const v = props.variant || "text";
|
|
6017
6124
|
if (v === "text" && (props.lines || 1) > 1) {
|
|
6018
6125
|
const n2 = props.lines, rows = [];
|
|
6019
6126
|
for (let i = 0; i < n2; i++)
|
|
6020
|
-
rows.push(/* @__PURE__ */
|
|
6021
|
-
return /* @__PURE__ */
|
|
6127
|
+
rows.push(/* @__PURE__ */ React51.createElement("span", { key: i, className: "aura-skel aura-skel--text", style: { width: i === n2 - 1 ? "60%" : "100%" } }));
|
|
6128
|
+
return /* @__PURE__ */ React51.createElement(
|
|
6022
6129
|
"span",
|
|
6023
6130
|
{
|
|
6024
6131
|
ref,
|
|
@@ -6036,28 +6143,28 @@ window.Aura = (() => {
|
|
|
6036
6143
|
if (v === "circle") {
|
|
6037
6144
|
style.width = style.height = props.size || props.width || 40;
|
|
6038
6145
|
}
|
|
6039
|
-
return /* @__PURE__ */
|
|
6146
|
+
return /* @__PURE__ */ React51.createElement("span", { ref, "aria-hidden": true, className: cx("aura-skel", "aura-skel--" + v, props.className), style });
|
|
6040
6147
|
});
|
|
6041
6148
|
|
|
6042
6149
|
// src/EmptyState.tsx
|
|
6043
|
-
var
|
|
6044
|
-
var EmptyState =
|
|
6150
|
+
var React52 = __toESM(require_react(), 1);
|
|
6151
|
+
var EmptyState = React52.forwardRef(function EmptyState2(props, ref) {
|
|
6045
6152
|
const HT = "h" + (props.headingLevel || 3);
|
|
6046
|
-
return /* @__PURE__ */
|
|
6153
|
+
return /* @__PURE__ */ React52.createElement(
|
|
6047
6154
|
"div",
|
|
6048
6155
|
{
|
|
6049
6156
|
ref,
|
|
6050
6157
|
className: cx("aura-empty", props.size === "sm" && "is-sm", props.bordered && "is-bordered", props.className)
|
|
6051
6158
|
},
|
|
6052
|
-
/* @__PURE__ */
|
|
6053
|
-
/* @__PURE__ */
|
|
6054
|
-
props.description ? /* @__PURE__ */
|
|
6055
|
-
props.action ? /* @__PURE__ */
|
|
6159
|
+
/* @__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" })),
|
|
6160
|
+
/* @__PURE__ */ React52.createElement(HT, { className: "aura-empty__title" }, props.title),
|
|
6161
|
+
props.description ? /* @__PURE__ */ React52.createElement("p", { className: "aura-empty__text" }, props.description) : null,
|
|
6162
|
+
props.action ? /* @__PURE__ */ React52.createElement("div", { className: "aura-empty__action" }, props.action) : null
|
|
6056
6163
|
);
|
|
6057
6164
|
});
|
|
6058
6165
|
|
|
6059
6166
|
// src/Pagination.tsx
|
|
6060
|
-
var
|
|
6167
|
+
var React53 = __toESM(require_react(), 1);
|
|
6061
6168
|
function pageList(page, count, sib) {
|
|
6062
6169
|
let out = [], lo = Math.max(2, page - sib), hi = Math.min(count - 1, page + sib);
|
|
6063
6170
|
if (page - sib <= 3) {
|
|
@@ -6077,7 +6184,7 @@ window.Aura = (() => {
|
|
|
6077
6184
|
if (count > 1) out.push(count);
|
|
6078
6185
|
return out;
|
|
6079
6186
|
}
|
|
6080
|
-
var Pagination =
|
|
6187
|
+
var Pagination = React53.forwardRef(function Pagination2(props, ref) {
|
|
6081
6188
|
const t = useStrings();
|
|
6082
6189
|
const count = Math.max(1, props.pageCount || 1);
|
|
6083
6190
|
const st = useMaybeControlled(props.page, props.defaultPage || 1, props.onChange);
|
|
@@ -6096,7 +6203,7 @@ window.Aura = (() => {
|
|
|
6096
6203
|
},
|
|
6097
6204
|
extra
|
|
6098
6205
|
);
|
|
6099
|
-
return link ? /* @__PURE__ */
|
|
6206
|
+
return link ? /* @__PURE__ */ React53.createElement(
|
|
6100
6207
|
Link,
|
|
6101
6208
|
{
|
|
6102
6209
|
href: link(p),
|
|
@@ -6109,7 +6216,7 @@ window.Aura = (() => {
|
|
|
6109
6216
|
...common
|
|
6110
6217
|
},
|
|
6111
6218
|
label
|
|
6112
|
-
) : /* @__PURE__ */
|
|
6219
|
+
) : /* @__PURE__ */ React53.createElement(
|
|
6113
6220
|
"button",
|
|
6114
6221
|
{
|
|
6115
6222
|
type: "button",
|
|
@@ -6123,7 +6230,7 @@ window.Aura = (() => {
|
|
|
6123
6230
|
}
|
|
6124
6231
|
function arrow(p, icon, label, rel, disabled) {
|
|
6125
6232
|
if (!link || disabled)
|
|
6126
|
-
return /* @__PURE__ */
|
|
6233
|
+
return /* @__PURE__ */ React53.createElement(
|
|
6127
6234
|
IconButton,
|
|
6128
6235
|
{
|
|
6129
6236
|
icon,
|
|
@@ -6134,7 +6241,7 @@ window.Aura = (() => {
|
|
|
6134
6241
|
}
|
|
6135
6242
|
}
|
|
6136
6243
|
);
|
|
6137
|
-
return /* @__PURE__ */
|
|
6244
|
+
return /* @__PURE__ */ React53.createElement(
|
|
6138
6245
|
Link,
|
|
6139
6246
|
{
|
|
6140
6247
|
href: link(p),
|
|
@@ -6149,17 +6256,17 @@ window.Aura = (() => {
|
|
|
6149
6256
|
}
|
|
6150
6257
|
}
|
|
6151
6258
|
},
|
|
6152
|
-
/* @__PURE__ */
|
|
6259
|
+
/* @__PURE__ */ React53.createElement(Icon, { name: icon, size: "sm" })
|
|
6153
6260
|
);
|
|
6154
6261
|
}
|
|
6155
|
-
return /* @__PURE__ */
|
|
6156
|
-
return typeof p === "number" ? /* @__PURE__ */
|
|
6157
|
-
})), /* @__PURE__ */
|
|
6262
|
+
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) {
|
|
6263
|
+
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");
|
|
6264
|
+
})), /* @__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));
|
|
6158
6265
|
});
|
|
6159
6266
|
|
|
6160
6267
|
// src/Accordion.tsx
|
|
6161
|
-
var
|
|
6162
|
-
var Accordion =
|
|
6268
|
+
var React54 = __toESM(require_react(), 1);
|
|
6269
|
+
var Accordion = React54.forwardRef(function Accordion2(props, ref) {
|
|
6163
6270
|
const auto = uid(), base = props.id || auto;
|
|
6164
6271
|
const multiple = props.type === "multiple";
|
|
6165
6272
|
const st = useMaybeControlled(
|
|
@@ -6197,9 +6304,9 @@ window.Aura = (() => {
|
|
|
6197
6304
|
n2.focus();
|
|
6198
6305
|
}
|
|
6199
6306
|
}
|
|
6200
|
-
return /* @__PURE__ */
|
|
6307
|
+
return /* @__PURE__ */ React54.createElement("div", { ref, className: cx("aura-accordion", props.className), onKeyDown: onKey }, items2.map(function(it) {
|
|
6201
6308
|
const on = open.indexOf(it.id) >= 0, bid = base + "-btn-" + it.id, pid = base + "-panel-" + it.id;
|
|
6202
|
-
return /* @__PURE__ */
|
|
6309
|
+
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(
|
|
6203
6310
|
"button",
|
|
6204
6311
|
{
|
|
6205
6312
|
type: "button",
|
|
@@ -6211,15 +6318,15 @@ window.Aura = (() => {
|
|
|
6211
6318
|
toggle(it.id);
|
|
6212
6319
|
}
|
|
6213
6320
|
},
|
|
6214
|
-
it.icon ? /* @__PURE__ */
|
|
6215
|
-
/* @__PURE__ */
|
|
6216
|
-
/* @__PURE__ */
|
|
6217
|
-
)), /* @__PURE__ */
|
|
6321
|
+
it.icon ? /* @__PURE__ */ React54.createElement(Icon, { name: it.icon, className: "aura-accordion__lead" }) : null,
|
|
6322
|
+
/* @__PURE__ */ React54.createElement("span", { className: "aura-accordion__title" }, it.title, it.description ? /* @__PURE__ */ React54.createElement("span", { className: "aura-accordion__desc" }, it.description) : null),
|
|
6323
|
+
/* @__PURE__ */ React54.createElement(Icon, { name: "chevron-down", className: "aura-accordion__chevron" })
|
|
6324
|
+
)), /* @__PURE__ */ React54.createElement("div", { id: pid, role: "region", "aria-labelledby": bid, className: "aura-accordion__panel", hidden: !on }, it.content));
|
|
6218
6325
|
}));
|
|
6219
6326
|
});
|
|
6220
6327
|
|
|
6221
6328
|
// src/Popover.tsx
|
|
6222
|
-
var
|
|
6329
|
+
var React55 = __toESM(require_react(), 1);
|
|
6223
6330
|
var import_react_dom11 = __toESM(require_react_dom(), 1);
|
|
6224
6331
|
function position(anchor, pop, placement) {
|
|
6225
6332
|
const r = anchor.getBoundingClientRect(), pw = pop.offsetWidth, ph = pop.offsetHeight, vw = window.innerWidth, vh = window.innerHeight, gap = 6;
|
|
@@ -6230,14 +6337,14 @@ window.Aura = (() => {
|
|
|
6230
6337
|
const left = align === "end" ? r.right - pw : align === "center" ? r.left + r.width / 2 - pw / 2 : r.left;
|
|
6231
6338
|
return { top: Math.max(8, top), left: Math.max(8, Math.min(left, vw - pw - 8)), side };
|
|
6232
6339
|
}
|
|
6233
|
-
var Popover =
|
|
6340
|
+
var Popover = React55.forwardRef(function Popover2(props, ref) {
|
|
6234
6341
|
const t = useStrings();
|
|
6235
6342
|
const density = useDensity();
|
|
6236
6343
|
const auto = uid(), id = props.id || auto;
|
|
6237
6344
|
const st = useMaybeControlled(props.open, !!props.defaultOpen, props.onOpenChange);
|
|
6238
6345
|
const open = !!st[0];
|
|
6239
|
-
const wrap =
|
|
6240
|
-
const pos =
|
|
6346
|
+
const wrap = React55.useRef(null), pop = React55.useRef(null), popMerged = useMergedRef(ref, pop);
|
|
6347
|
+
const pos = React55.useState(null), mounted = useMounted();
|
|
6241
6348
|
function trigger() {
|
|
6242
6349
|
return wrap.current && (wrap.current.querySelector('button, [role="button"], a, input') || wrap.current.firstElementChild);
|
|
6243
6350
|
}
|
|
@@ -6264,7 +6371,7 @@ window.Aura = (() => {
|
|
|
6264
6371
|
},
|
|
6265
6372
|
[open, mounted, props.placement]
|
|
6266
6373
|
);
|
|
6267
|
-
|
|
6374
|
+
React55.useEffect(
|
|
6268
6375
|
function() {
|
|
6269
6376
|
if (!open || !mounted) return;
|
|
6270
6377
|
if (props.autoFocus !== false && pop.current) {
|
|
@@ -6283,9 +6390,9 @@ window.Aura = (() => {
|
|
|
6283
6390
|
},
|
|
6284
6391
|
[open, mounted]
|
|
6285
6392
|
);
|
|
6286
|
-
const child =
|
|
6393
|
+
const child = React55.Children.only(props.trigger);
|
|
6287
6394
|
const panel = open && mounted ? (0, import_react_dom11.createPortal)(
|
|
6288
|
-
/* @__PURE__ */
|
|
6395
|
+
/* @__PURE__ */ React55.createElement(
|
|
6289
6396
|
"div",
|
|
6290
6397
|
{
|
|
6291
6398
|
ref: popMerged,
|
|
@@ -6308,7 +6415,7 @@ window.Aura = (() => {
|
|
|
6308
6415
|
} else trapTab(e, pop.current);
|
|
6309
6416
|
}
|
|
6310
6417
|
},
|
|
6311
|
-
props.title ? /* @__PURE__ */
|
|
6418
|
+
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(
|
|
6312
6419
|
IconButton,
|
|
6313
6420
|
{
|
|
6314
6421
|
icon: "x",
|
|
@@ -6318,7 +6425,7 @@ window.Aura = (() => {
|
|
|
6318
6425
|
}
|
|
6319
6426
|
}
|
|
6320
6427
|
)) : null,
|
|
6321
|
-
/* @__PURE__ */
|
|
6428
|
+
/* @__PURE__ */ React55.createElement("div", { className: "aura-popover__body" }, typeof props.children === "function" ? props.children({
|
|
6322
6429
|
close: function() {
|
|
6323
6430
|
close(true);
|
|
6324
6431
|
}
|
|
@@ -6326,7 +6433,7 @@ window.Aura = (() => {
|
|
|
6326
6433
|
),
|
|
6327
6434
|
document.body
|
|
6328
6435
|
) : null;
|
|
6329
|
-
return /* @__PURE__ */
|
|
6436
|
+
return /* @__PURE__ */ React55.createElement("span", { ref: wrap, className: "aura-popover-anchor" }, React55.cloneElement(child, {
|
|
6330
6437
|
onClick: function(e) {
|
|
6331
6438
|
if (child.props.onClick) child.props.onClick(e);
|
|
6332
6439
|
st[1](!open);
|
|
@@ -6338,7 +6445,7 @@ window.Aura = (() => {
|
|
|
6338
6445
|
});
|
|
6339
6446
|
|
|
6340
6447
|
// src/NumberField.tsx
|
|
6341
|
-
var
|
|
6448
|
+
var React56 = __toESM(require_react(), 1);
|
|
6342
6449
|
function decimalsOf(n2) {
|
|
6343
6450
|
const s = String(n2);
|
|
6344
6451
|
const i = s.indexOf(".");
|
|
@@ -6349,7 +6456,7 @@ window.Aura = (() => {
|
|
|
6349
6456
|
if (!/^-?(\d+\.?\d*|\.\d+)$/.test(s)) return NaN;
|
|
6350
6457
|
return Number(s);
|
|
6351
6458
|
}
|
|
6352
|
-
var NumberField =
|
|
6459
|
+
var NumberField = React56.forwardRef(function NumberField2(props, ref) {
|
|
6353
6460
|
const t = useStrings();
|
|
6354
6461
|
const auto = uid(), id = props.id || auto;
|
|
6355
6462
|
const step = props.step || 1;
|
|
@@ -6360,7 +6467,7 @@ window.Aura = (() => {
|
|
|
6360
6467
|
props.onChange
|
|
6361
6468
|
);
|
|
6362
6469
|
const value = st[0], setValue = st[1];
|
|
6363
|
-
const draftState =
|
|
6470
|
+
const draftState = React56.useState(null), draft = draftState[0], setDraft = draftState[1];
|
|
6364
6471
|
function fmt2(n2) {
|
|
6365
6472
|
if (n2 == null || isNaN(n2)) return "";
|
|
6366
6473
|
return n2.toLocaleString("en", { minimumFractionDigits: decimals, maximumFractionDigits: decimals });
|
|
@@ -6409,7 +6516,7 @@ window.Aura = (() => {
|
|
|
6409
6516
|
};
|
|
6410
6517
|
const valueText = value == null ? void 0 : [affixText(props.prefix), fmt2(value), affixText(props.suffix)].join(" ").trim();
|
|
6411
6518
|
const stepper = props.stepper !== false && !props.readOnly;
|
|
6412
|
-
return /* @__PURE__ */
|
|
6519
|
+
return /* @__PURE__ */ React56.createElement(
|
|
6413
6520
|
Field,
|
|
6414
6521
|
{
|
|
6415
6522
|
id,
|
|
@@ -6421,7 +6528,7 @@ window.Aura = (() => {
|
|
|
6421
6528
|
disabled: props.disabled,
|
|
6422
6529
|
className: props.className
|
|
6423
6530
|
},
|
|
6424
|
-
/* @__PURE__ */
|
|
6531
|
+
/* @__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(
|
|
6425
6532
|
"input",
|
|
6426
6533
|
{
|
|
6427
6534
|
ref,
|
|
@@ -6468,7 +6575,7 @@ window.Aura = (() => {
|
|
|
6468
6575
|
},
|
|
6469
6576
|
onKeyDown
|
|
6470
6577
|
}
|
|
6471
|
-
), props.suffix != null ? /* @__PURE__ */
|
|
6578
|
+
), 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(
|
|
6472
6579
|
"button",
|
|
6473
6580
|
{
|
|
6474
6581
|
type: "button",
|
|
@@ -6484,8 +6591,8 @@ window.Aura = (() => {
|
|
|
6484
6591
|
nudge(-step);
|
|
6485
6592
|
}
|
|
6486
6593
|
},
|
|
6487
|
-
/* @__PURE__ */
|
|
6488
|
-
), /* @__PURE__ */
|
|
6594
|
+
/* @__PURE__ */ React56.createElement(Icon, { name: "minus" })
|
|
6595
|
+
), /* @__PURE__ */ React56.createElement(
|
|
6489
6596
|
"button",
|
|
6490
6597
|
{
|
|
6491
6598
|
type: "button",
|
|
@@ -6501,14 +6608,14 @@ window.Aura = (() => {
|
|
|
6501
6608
|
nudge(step);
|
|
6502
6609
|
}
|
|
6503
6610
|
},
|
|
6504
|
-
/* @__PURE__ */
|
|
6611
|
+
/* @__PURE__ */ React56.createElement(Icon, { name: "plus" })
|
|
6505
6612
|
)) : null)
|
|
6506
6613
|
);
|
|
6507
6614
|
});
|
|
6508
6615
|
|
|
6509
6616
|
// src/Stepper.tsx
|
|
6510
|
-
var
|
|
6511
|
-
var Stepper =
|
|
6617
|
+
var React57 = __toESM(require_react(), 1);
|
|
6618
|
+
var Stepper = React57.forwardRef(function Stepper2(props, ref) {
|
|
6512
6619
|
const t = useStrings();
|
|
6513
6620
|
const steps = props.steps || [];
|
|
6514
6621
|
let at = -1;
|
|
@@ -6518,26 +6625,26 @@ window.Aura = (() => {
|
|
|
6518
6625
|
if (at < 0) at = 0;
|
|
6519
6626
|
const vertical = props.orientation === "vertical";
|
|
6520
6627
|
const cur = steps[at];
|
|
6521
|
-
return /* @__PURE__ */
|
|
6628
|
+
return /* @__PURE__ */ React57.createElement(
|
|
6522
6629
|
"nav",
|
|
6523
6630
|
{
|
|
6524
6631
|
ref,
|
|
6525
6632
|
"aria-label": props.label,
|
|
6526
6633
|
className: cx("aura-stepper", vertical ? "aura-stepper--vertical" : "aura-stepper--horizontal", props.className)
|
|
6527
6634
|
},
|
|
6528
|
-
/* @__PURE__ */
|
|
6635
|
+
/* @__PURE__ */ React57.createElement("ol", { className: "aura-stepper__list" }, steps.map(function(s, i) {
|
|
6529
6636
|
const state = i < at ? "done" : i === at ? "current" : "upcoming";
|
|
6530
|
-
const marker = /* @__PURE__ */
|
|
6531
|
-
const text = /* @__PURE__ */
|
|
6637
|
+
const marker = /* @__PURE__ */ React57.createElement("span", { className: "aura-stepper__marker", "aria-hidden": true }, state === "done" ? /* @__PURE__ */ React57.createElement(Icon, { name: "check" }) : i + 1);
|
|
6638
|
+
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);
|
|
6532
6639
|
const clickable = state === "done" && !!props.onStepClick;
|
|
6533
|
-
return /* @__PURE__ */
|
|
6640
|
+
return /* @__PURE__ */ React57.createElement(
|
|
6534
6641
|
"li",
|
|
6535
6642
|
{
|
|
6536
6643
|
key: s.id,
|
|
6537
6644
|
className: cx("aura-stepper__item", "is-" + state),
|
|
6538
6645
|
"aria-current": state === "current" ? "step" : void 0
|
|
6539
6646
|
},
|
|
6540
|
-
clickable ? /* @__PURE__ */
|
|
6647
|
+
clickable ? /* @__PURE__ */ React57.createElement(
|
|
6541
6648
|
"button",
|
|
6542
6649
|
{
|
|
6543
6650
|
type: "button",
|
|
@@ -6548,19 +6655,19 @@ window.Aura = (() => {
|
|
|
6548
6655
|
},
|
|
6549
6656
|
marker,
|
|
6550
6657
|
text
|
|
6551
|
-
) : /* @__PURE__ */
|
|
6658
|
+
) : /* @__PURE__ */ React57.createElement("span", { className: "aura-stepper__step" }, marker, text)
|
|
6552
6659
|
);
|
|
6553
6660
|
})),
|
|
6554
|
-
!vertical && cur ? /* @__PURE__ */
|
|
6661
|
+
!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
|
|
6555
6662
|
);
|
|
6556
6663
|
});
|
|
6557
6664
|
|
|
6558
6665
|
// src/SegmentedControl.tsx
|
|
6559
|
-
var
|
|
6666
|
+
var React58 = __toESM(require_react(), 1);
|
|
6560
6667
|
function toOpt2(o) {
|
|
6561
6668
|
return typeof o === "object" ? o : { value: o, label: o };
|
|
6562
6669
|
}
|
|
6563
|
-
var SegmentedControl =
|
|
6670
|
+
var SegmentedControl = React58.forwardRef(
|
|
6564
6671
|
function SegmentedControl2(props, ref) {
|
|
6565
6672
|
const options = (props.options || []).map(toOpt2);
|
|
6566
6673
|
const firstEnabled = options.filter(function(o) {
|
|
@@ -6573,7 +6680,7 @@ window.Aura = (() => {
|
|
|
6573
6680
|
);
|
|
6574
6681
|
const value = st[0], setValue = st[1];
|
|
6575
6682
|
const auto = uid(), id = props.id || auto;
|
|
6576
|
-
const refs =
|
|
6683
|
+
const refs = React58.useRef([]);
|
|
6577
6684
|
const selIdx = options.findIndex(function(o) {
|
|
6578
6685
|
return o.value === value;
|
|
6579
6686
|
});
|
|
@@ -6606,7 +6713,7 @@ window.Aura = (() => {
|
|
|
6606
6713
|
move(options.length, -1);
|
|
6607
6714
|
}
|
|
6608
6715
|
}
|
|
6609
|
-
return /* @__PURE__ */
|
|
6716
|
+
return /* @__PURE__ */ React58.createElement(
|
|
6610
6717
|
"div",
|
|
6611
6718
|
{
|
|
6612
6719
|
ref,
|
|
@@ -6625,7 +6732,7 @@ window.Aura = (() => {
|
|
|
6625
6732
|
options.map(function(o, i) {
|
|
6626
6733
|
const on = o.value === value;
|
|
6627
6734
|
const off = props.disabled || o.disabled;
|
|
6628
|
-
return /* @__PURE__ */
|
|
6735
|
+
return /* @__PURE__ */ React58.createElement(
|
|
6629
6736
|
"button",
|
|
6630
6737
|
{
|
|
6631
6738
|
key: o.value,
|
|
@@ -6647,8 +6754,8 @@ window.Aura = (() => {
|
|
|
6647
6754
|
onKeyDown(e, i);
|
|
6648
6755
|
}
|
|
6649
6756
|
},
|
|
6650
|
-
o.icon ? /* @__PURE__ */
|
|
6651
|
-
o.iconOnly ? null : /* @__PURE__ */
|
|
6757
|
+
o.icon ? /* @__PURE__ */ React58.createElement(Icon, { name: o.icon }) : null,
|
|
6758
|
+
o.iconOnly ? null : /* @__PURE__ */ React58.createElement("span", null, o.label)
|
|
6652
6759
|
);
|
|
6653
6760
|
})
|
|
6654
6761
|
);
|