@jirawatpyk/aura-react 5.51.0 → 5.53.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 +26 -0
- package/dist/aura.bundle.js +408 -198
- package/dist/cjs/index.cjs +407 -197
- package/dist/esm/Table.js +52 -7
- package/dist/esm/TableSkeleton.js +170 -0
- package/dist/esm/display.js +3 -1
- package/dist/esm/index.js +2 -0
- package/dist/index.d.cts +62 -5
- package/dist/index.d.ts +62 -5
- package/dist/server/index.cjs +213 -49
- package/dist/server/index.d.cts +45 -3
- package/dist/server/index.d.ts +45 -3
- package/dist/server/index.js +213 -49
- package/dist/styles.css +21 -0
- package/dist/styles.layer.css +21 -0
- package/package.json +1 -1
package/dist/server/index.cjs
CHANGED
|
@@ -43,6 +43,7 @@ __export(server_exports, {
|
|
|
43
43
|
Stat: () => ServerStat,
|
|
44
44
|
StatusPill: () => ServerStatusPill,
|
|
45
45
|
StatusTile: () => ServerStatusTile,
|
|
46
|
+
TableSkeleton: () => TableSkeleton,
|
|
46
47
|
TileGrid: () => TileGrid,
|
|
47
48
|
brandScale: () => scale,
|
|
48
49
|
breakpoints: () => breakpoints,
|
|
@@ -640,14 +641,14 @@ var STRINGS = {
|
|
|
640
641
|
|
|
641
642
|
// src/theme.ts
|
|
642
643
|
function hexToRgb(hex) {
|
|
643
|
-
let
|
|
644
|
-
if (
|
|
645
|
-
|
|
644
|
+
let h7 = String(hex).trim().replace("#", "");
|
|
645
|
+
if (h7.length === 3)
|
|
646
|
+
h7 = h7.split("").map(function(c) {
|
|
646
647
|
return c + c;
|
|
647
648
|
}).join("");
|
|
648
|
-
if (!/^[0-9a-f]{6}$/i.test(
|
|
649
|
+
if (!/^[0-9a-f]{6}$/i.test(h7)) throw new Error('createTheme: "' + hex + '" is not a #rgb or #rrggbb colour');
|
|
649
650
|
return [0, 2, 4].map(function(i) {
|
|
650
|
-
return parseInt(
|
|
651
|
+
return parseInt(h7.slice(i, i + 2), 16) / 255;
|
|
651
652
|
});
|
|
652
653
|
}
|
|
653
654
|
function rgbToHex(rgb) {
|
|
@@ -1386,7 +1387,9 @@ function buttonClass(opts = {}) {
|
|
|
1386
1387
|
"aura-btn",
|
|
1387
1388
|
"aura-btn--" + (opts.variant || "primary"),
|
|
1388
1389
|
opts.size === "sm" && "aura-btn--sm",
|
|
1389
|
-
opts.fullWidth && "aura-btn--full",
|
|
1390
|
+
opts.fullWidth && opts.fullWidth !== "below-sm" && opts.fullWidth !== "below-md" && "aura-btn--full",
|
|
1391
|
+
/* 5.53 (Chamber-OS 165): full width on phones only. */
|
|
1392
|
+
(opts.fullWidth === "below-sm" || opts.fullWidth === "below-md") && "aura-btn--full-" + opts.fullWidth,
|
|
1390
1393
|
opts.touchHeight && "aura-btn--touch",
|
|
1391
1394
|
opts.loading && "is-loading",
|
|
1392
1395
|
opts.className
|
|
@@ -1439,10 +1442,171 @@ var Container = React4.forwardRef(function Container2(props, ref) {
|
|
|
1439
1442
|
);
|
|
1440
1443
|
});
|
|
1441
1444
|
|
|
1442
|
-
// src/
|
|
1445
|
+
// src/TableSkeleton.tsx
|
|
1443
1446
|
var React5 = __toESM(require("react"), 1);
|
|
1444
1447
|
var h4 = React5.createElement;
|
|
1445
|
-
|
|
1448
|
+
function inertProps() {
|
|
1449
|
+
return { inert: parseInt(React5.version, 10) >= 19 ? true : "", "aria-hidden": true };
|
|
1450
|
+
}
|
|
1451
|
+
function widthOf(w) {
|
|
1452
|
+
return w == null || w === "" ? void 0 : typeof w === "number" ? w + "px" : w;
|
|
1453
|
+
}
|
|
1454
|
+
function skeletonColgroup(cols) {
|
|
1455
|
+
return h4(
|
|
1456
|
+
"colgroup",
|
|
1457
|
+
null,
|
|
1458
|
+
cols.map(function(c, i) {
|
|
1459
|
+
const w = widthOf(c.width);
|
|
1460
|
+
return h4("col", { key: i, style: w ? { width: w } : void 0 });
|
|
1461
|
+
})
|
|
1462
|
+
);
|
|
1463
|
+
}
|
|
1464
|
+
function placeholder(c) {
|
|
1465
|
+
const s = c.skeleton || {};
|
|
1466
|
+
if (s.kind === "pill") return h4("span", { className: "aura-skel aura-skel--pill" });
|
|
1467
|
+
if (s.kind === "action") return h4("span", { className: cx("aura-skel aura-skel--action", s.touch && "is-touch") });
|
|
1468
|
+
if (s.lines === 2)
|
|
1469
|
+
return h4(
|
|
1470
|
+
"span",
|
|
1471
|
+
{ className: "aura-skel-lines" },
|
|
1472
|
+
h4("span", { className: "aura-skel aura-skel--text", style: { width: "100%" } }),
|
|
1473
|
+
h4("span", { className: "aura-skel aura-skel--text", style: { width: "60%" } })
|
|
1474
|
+
);
|
|
1475
|
+
return h4("span", { className: "aura-skel aura-skel--text", style: { width: "80%" } });
|
|
1476
|
+
}
|
|
1477
|
+
function cellCls(base, c) {
|
|
1478
|
+
const align = c.align || (c.numeric ? "end" : void 0);
|
|
1479
|
+
return cx(base, align === "end" && "is-end", align === "center" && "is-center", c.numeric && "is-numeric");
|
|
1480
|
+
}
|
|
1481
|
+
function skeletonBody(cols, n3, stacked) {
|
|
1482
|
+
const rows = [];
|
|
1483
|
+
for (let r2 = 0; r2 < n3; r2++)
|
|
1484
|
+
rows.push(
|
|
1485
|
+
h4(
|
|
1486
|
+
"tr",
|
|
1487
|
+
{ key: r2, className: "aura-tbl__row aura-tbl__row--skeleton", role: stacked ? "row" : void 0 },
|
|
1488
|
+
cols.map(function(c, i) {
|
|
1489
|
+
const slot = stacked && (c.card === "title" || c.card === "action") ? c.card : void 0;
|
|
1490
|
+
return h4(
|
|
1491
|
+
"td",
|
|
1492
|
+
{
|
|
1493
|
+
key: i,
|
|
1494
|
+
className: cellCls("aura-tbl__td", c),
|
|
1495
|
+
role: stacked ? "cell" : void 0,
|
|
1496
|
+
"data-label": stacked && !slot && c.label ? c.label : void 0,
|
|
1497
|
+
"data-card": slot
|
|
1498
|
+
},
|
|
1499
|
+
placeholder(c)
|
|
1500
|
+
);
|
|
1501
|
+
})
|
|
1502
|
+
)
|
|
1503
|
+
);
|
|
1504
|
+
return h4(
|
|
1505
|
+
"tbody",
|
|
1506
|
+
{ key: "aura-skeleton", className: "aura-tbl__body", role: stacked ? "rowgroup" : void 0 },
|
|
1507
|
+
rows
|
|
1508
|
+
);
|
|
1509
|
+
}
|
|
1510
|
+
function tableWrapClass(p) {
|
|
1511
|
+
return cx(
|
|
1512
|
+
"aura-tbl-wrap",
|
|
1513
|
+
p.stackBelow && "is-stackable",
|
|
1514
|
+
p.bordered === false && "is-flush",
|
|
1515
|
+
p.bleed && "aura-bleed-frame",
|
|
1516
|
+
p.bleed && !p.cards && "aura-bleed",
|
|
1517
|
+
p.bleed && p.bleedEnd && !p.cards && "aura-bleed-end"
|
|
1518
|
+
);
|
|
1519
|
+
}
|
|
1520
|
+
function tableClass(p) {
|
|
1521
|
+
return cx(
|
|
1522
|
+
"aura-tbl",
|
|
1523
|
+
p.stackBelow && "aura-tbl--stack-" + p.stackBelow,
|
|
1524
|
+
(p.align === "middle" || p.rowHeight === "density" && p.align !== "top") && "aura-tbl--middle",
|
|
1525
|
+
p.rowHeight === "density" && "aura-tbl--row-density",
|
|
1526
|
+
p.cards && "aura-tbl--cards",
|
|
1527
|
+
p.className
|
|
1528
|
+
);
|
|
1529
|
+
}
|
|
1530
|
+
function cardsFrame(el, p) {
|
|
1531
|
+
return p.cards ? h4(
|
|
1532
|
+
"div",
|
|
1533
|
+
{
|
|
1534
|
+
className: cx(
|
|
1535
|
+
"aura-tbl-cards aura-tbl-cards--" + p.stackBelow,
|
|
1536
|
+
p.bleed && "aura-bleed",
|
|
1537
|
+
p.bleed && p.bleedEnd && "aura-bleed-end"
|
|
1538
|
+
)
|
|
1539
|
+
},
|
|
1540
|
+
el
|
|
1541
|
+
) : el;
|
|
1542
|
+
}
|
|
1543
|
+
function TableSkeleton(props) {
|
|
1544
|
+
const cols = props.columns || [];
|
|
1545
|
+
const n3 = props.rows != null ? Math.max(0, props.rows) : 5;
|
|
1546
|
+
const stacked = !!props.stackBelow;
|
|
1547
|
+
const cards = stacked && props.stackStyle === "cards";
|
|
1548
|
+
const head = h4(
|
|
1549
|
+
"thead",
|
|
1550
|
+
{ className: "aura-tbl__head", role: stacked ? "rowgroup" : void 0 },
|
|
1551
|
+
h4(
|
|
1552
|
+
"tr",
|
|
1553
|
+
{ className: "aura-tbl__row", role: stacked ? "row" : void 0 },
|
|
1554
|
+
cols.map(function(c, i) {
|
|
1555
|
+
return h4(
|
|
1556
|
+
"th",
|
|
1557
|
+
{ key: i, scope: "col", className: cellCls("aura-tbl__th", c), role: stacked ? "columnheader" : void 0 },
|
|
1558
|
+
c.label
|
|
1559
|
+
);
|
|
1560
|
+
})
|
|
1561
|
+
)
|
|
1562
|
+
);
|
|
1563
|
+
const table = h4(
|
|
1564
|
+
"div",
|
|
1565
|
+
Object.assign(
|
|
1566
|
+
{
|
|
1567
|
+
className: tableWrapClass({
|
|
1568
|
+
stackBelow: props.stackBelow,
|
|
1569
|
+
bordered: props.bordered,
|
|
1570
|
+
bleed: props.bleed,
|
|
1571
|
+
bleedEnd: props.bleedEnd,
|
|
1572
|
+
cards
|
|
1573
|
+
}),
|
|
1574
|
+
"data-density": props.density || "comfortable"
|
|
1575
|
+
},
|
|
1576
|
+
inertProps()
|
|
1577
|
+
),
|
|
1578
|
+
h4(
|
|
1579
|
+
"table",
|
|
1580
|
+
{
|
|
1581
|
+
className: cx(
|
|
1582
|
+
tableClass({
|
|
1583
|
+
stackBelow: props.stackBelow,
|
|
1584
|
+
align: props.align,
|
|
1585
|
+
rowHeight: props.rowHeight,
|
|
1586
|
+
cards,
|
|
1587
|
+
className: props.className
|
|
1588
|
+
}),
|
|
1589
|
+
"aura-tbl--skeleton"
|
|
1590
|
+
),
|
|
1591
|
+
role: stacked ? "table" : void 0
|
|
1592
|
+
},
|
|
1593
|
+
skeletonColgroup(cols),
|
|
1594
|
+
head,
|
|
1595
|
+
skeletonBody(cols, n3, stacked)
|
|
1596
|
+
)
|
|
1597
|
+
);
|
|
1598
|
+
return cardsFrame(table, {
|
|
1599
|
+
stackBelow: props.stackBelow,
|
|
1600
|
+
bleed: props.bleed,
|
|
1601
|
+
bleedEnd: props.bleedEnd,
|
|
1602
|
+
cards
|
|
1603
|
+
});
|
|
1604
|
+
}
|
|
1605
|
+
|
|
1606
|
+
// src/PageHeader.tsx
|
|
1607
|
+
var React6 = __toESM(require("react"), 1);
|
|
1608
|
+
var h5 = React6.createElement;
|
|
1609
|
+
var PageHeader = React6.forwardRef(function PageHeader2(props, ref) {
|
|
1446
1610
|
const attrs2 = {};
|
|
1447
1611
|
Object.keys(props).forEach(function(k) {
|
|
1448
1612
|
if (k === "id" || k === "lang" || k === "dir" || k === "role" || /^(aria|data)-/.test(k))
|
|
@@ -1458,7 +1622,7 @@ var PageHeader = React5.forwardRef(function PageHeader2(props, ref) {
|
|
|
1458
1622
|
const size = props.size === "compact" || props.size === "hero" || props.size === "hero-lg" ? props.size : null;
|
|
1459
1623
|
const eyebrow = props.eyebrow;
|
|
1460
1624
|
const plainEyebrow = typeof eyebrow === "string" || typeof eyebrow === "number";
|
|
1461
|
-
const heading =
|
|
1625
|
+
const heading = h5(
|
|
1462
1626
|
"h" + level,
|
|
1463
1627
|
{
|
|
1464
1628
|
className: "aura-page-header__title",
|
|
@@ -1470,7 +1634,7 @@ var PageHeader = React5.forwardRef(function PageHeader2(props, ref) {
|
|
|
1470
1634
|
);
|
|
1471
1635
|
const hasActions = props.actions != null && props.actions !== false;
|
|
1472
1636
|
const bar = hasActions && (props.actionsBarBelow === "sm" || props.actionsBarBelow === "md") ? props.actionsBarBelow : null;
|
|
1473
|
-
return
|
|
1637
|
+
return h5(
|
|
1474
1638
|
"div",
|
|
1475
1639
|
Object.assign(attrs2, {
|
|
1476
1640
|
ref,
|
|
@@ -1487,32 +1651,32 @@ var PageHeader = React5.forwardRef(function PageHeader2(props, ref) {
|
|
|
1487
1651
|
),
|
|
1488
1652
|
style: props.style
|
|
1489
1653
|
}),
|
|
1490
|
-
|
|
1654
|
+
h5(
|
|
1491
1655
|
"div",
|
|
1492
1656
|
{ className: "aura-page-header__text" },
|
|
1493
|
-
props.breadcrumb != null && props.breadcrumb !== false ?
|
|
1494
|
-
shown(eyebrow) ? plainEyebrow ?
|
|
1495
|
-
shown(props.titleAddon) ?
|
|
1657
|
+
props.breadcrumb != null && props.breadcrumb !== false ? h5("div", { className: "aura-page-header__breadcrumb" }, props.breadcrumb) : null,
|
|
1658
|
+
shown(eyebrow) ? plainEyebrow ? h5("p", { className: "aura-page-header__eyebrow" }, eyebrow) : h5("div", { className: "aura-page-header__eyebrow aura-page-header__eyebrow--rich" }, eyebrow) : null,
|
|
1659
|
+
shown(props.titleAddon) ? h5(
|
|
1496
1660
|
"div",
|
|
1497
1661
|
{ className: "aura-page-header__title-row" },
|
|
1498
1662
|
heading,
|
|
1499
|
-
|
|
1663
|
+
h5("div", { className: "aura-page-header__title-addon" }, props.titleAddon)
|
|
1500
1664
|
) : heading,
|
|
1501
|
-
shown(props.subtitle) ?
|
|
1502
|
-
props.meta != null && props.meta !== false ?
|
|
1665
|
+
shown(props.subtitle) ? h5("div", { className: "aura-page-header__subtitle" }, props.subtitle) : null,
|
|
1666
|
+
props.meta != null && props.meta !== false ? h5("div", { className: "aura-page-header__meta" }, props.meta) : null
|
|
1503
1667
|
),
|
|
1504
|
-
props.actions != null && props.actions !== false ?
|
|
1668
|
+
props.actions != null && props.actions !== false ? h5(
|
|
1505
1669
|
"div",
|
|
1506
1670
|
{ className: "aura-page-header__actions" },
|
|
1507
|
-
bar && props.actionsStatus != null && props.actionsStatus !== false ?
|
|
1671
|
+
bar && props.actionsStatus != null && props.actionsStatus !== false ? h5("div", { className: "aura-page-header__status", role: "status" }, props.actionsStatus) : null,
|
|
1508
1672
|
props.actions
|
|
1509
1673
|
) : null
|
|
1510
1674
|
);
|
|
1511
1675
|
});
|
|
1512
1676
|
|
|
1513
1677
|
// src/tiles.tsx
|
|
1514
|
-
var
|
|
1515
|
-
var
|
|
1678
|
+
var React7 = __toESM(require("react"), 1);
|
|
1679
|
+
var h6 = React7.createElement;
|
|
1516
1680
|
var STATUS_ICON = {
|
|
1517
1681
|
down: IconCircleAlert,
|
|
1518
1682
|
problem: IconTriangleAlert,
|
|
@@ -1545,7 +1709,7 @@ function attrs(props) {
|
|
|
1545
1709
|
});
|
|
1546
1710
|
return out;
|
|
1547
1711
|
}
|
|
1548
|
-
var comma =
|
|
1712
|
+
var comma = h6("span", { className: "aura-status-tile__sep" }, ",");
|
|
1549
1713
|
function statusTileElement(props, ref, Link, t, titleRef) {
|
|
1550
1714
|
const status = STATUS_ICON[props.status] ? props.status : "unknown";
|
|
1551
1715
|
if (status !== props.status)
|
|
@@ -1561,43 +1725,43 @@ function statusTileElement(props, ref, Link, t, titleRef) {
|
|
|
1561
1725
|
};
|
|
1562
1726
|
const hasValue = has(props.value), hasMeta = has(props.meta);
|
|
1563
1727
|
const Tag = props.href ? Link : "div";
|
|
1564
|
-
return
|
|
1728
|
+
return h6(
|
|
1565
1729
|
Tag,
|
|
1566
1730
|
Object.assign(attrs(props), {
|
|
1567
1731
|
ref,
|
|
1568
1732
|
href: props.href,
|
|
1569
1733
|
className: cx("aura-status-tile", "aura-status-tile--" + status, props.href && "is-interactive", props.className)
|
|
1570
1734
|
}),
|
|
1571
|
-
|
|
1735
|
+
h6(
|
|
1572
1736
|
"span",
|
|
1573
1737
|
{ className: "aura-status-tile__head" },
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
hasValue ?
|
|
1738
|
+
h6(Icon, { name: h6(STATUS_ICON[status]), size: 16, className: "aura-status-tile__icon" }),
|
|
1739
|
+
h6("span", { className: "aura-status-tile__title", ref: titleRef }, props.title, comma),
|
|
1740
|
+
h6("span", { className: "aura-sr-only" }, word + (hasValue || hasMeta || markers.length ? "," : "")),
|
|
1741
|
+
hasValue ? h6(
|
|
1578
1742
|
"span",
|
|
1579
1743
|
{ className: cx("aura-status-tile__value", "is-" + valueTone) },
|
|
1580
1744
|
props.value,
|
|
1581
1745
|
hasMeta || markers.length ? comma : null
|
|
1582
1746
|
) : null
|
|
1583
1747
|
),
|
|
1584
|
-
hasMeta || markers.length ?
|
|
1748
|
+
hasMeta || markers.length ? h6(
|
|
1585
1749
|
"span",
|
|
1586
1750
|
{ className: "aura-status-tile__foot" },
|
|
1587
|
-
hasMeta ?
|
|
1588
|
-
markers.length ?
|
|
1751
|
+
hasMeta ? h6("span", { className: "aura-status-tile__meta" }, props.meta, markers.length ? comma : null) : null,
|
|
1752
|
+
markers.length ? h6(
|
|
1589
1753
|
"span",
|
|
1590
1754
|
{ className: "aura-status-tile__markers" },
|
|
1591
1755
|
markers.map(function(m, i) {
|
|
1592
|
-
return
|
|
1756
|
+
return h6(
|
|
1593
1757
|
"span",
|
|
1594
1758
|
{
|
|
1595
1759
|
key: i,
|
|
1596
1760
|
className: cx("aura-status-tile__marker", "is-" + (m.tone || "neutral")),
|
|
1597
1761
|
"data-aura-tip": m.label
|
|
1598
1762
|
},
|
|
1599
|
-
|
|
1600
|
-
|
|
1763
|
+
h6(Icon, { name: m.icon, size: 14 }),
|
|
1764
|
+
h6("span", { className: "aura-sr-only" }, m.label + (i < markers.length - 1 ? "," : ""))
|
|
1601
1765
|
);
|
|
1602
1766
|
})
|
|
1603
1767
|
) : null
|
|
@@ -1607,13 +1771,13 @@ function statusTileElement(props, ref, Link, t, titleRef) {
|
|
|
1607
1771
|
function ServerStatusTile(props) {
|
|
1608
1772
|
return statusTileElement(props, void 0, props.linkComponent || "a", STRINGS.en);
|
|
1609
1773
|
}
|
|
1610
|
-
var TileGrid =
|
|
1774
|
+
var TileGrid = React7.forwardRef(function TileGrid2(props, ref) {
|
|
1611
1775
|
const style = Object.assign(
|
|
1612
1776
|
{},
|
|
1613
1777
|
respVars("aura-grid-cols", props.columns == null ? { base: 2, md: 3 } : props.columns),
|
|
1614
1778
|
props.style
|
|
1615
1779
|
);
|
|
1616
|
-
return
|
|
1780
|
+
return h6(
|
|
1617
1781
|
"ul",
|
|
1618
1782
|
Object.assign(attrs(props), {
|
|
1619
1783
|
ref,
|
|
@@ -1623,16 +1787,16 @@ var TileGrid = React6.forwardRef(function TileGrid2(props, ref) {
|
|
|
1623
1787
|
}),
|
|
1624
1788
|
/* toArray drops null and booleans and keys each element; a Fragment's children are items too. */
|
|
1625
1789
|
flat(props.children).map(function(c, i) {
|
|
1626
|
-
return
|
|
1790
|
+
return h6("li", { key: React7.isValidElement(c) && c.key != null ? c.key : i }, c);
|
|
1627
1791
|
})
|
|
1628
1792
|
);
|
|
1629
1793
|
});
|
|
1630
1794
|
function flat(children) {
|
|
1631
1795
|
const out = [];
|
|
1632
|
-
|
|
1633
|
-
if (
|
|
1796
|
+
React7.Children.toArray(children).forEach(function(c) {
|
|
1797
|
+
if (React7.isValidElement(c) && c.type === React7.Fragment)
|
|
1634
1798
|
flat(c.props.children).forEach(function(x) {
|
|
1635
|
-
out.push(
|
|
1799
|
+
out.push(React7.isValidElement(x) ? React7.cloneElement(x, { key: String(c.key) + "/" + String(x.key) }) : x);
|
|
1636
1800
|
});
|
|
1637
1801
|
else if (c !== "") out.push(c);
|
|
1638
1802
|
});
|
|
@@ -1646,7 +1810,7 @@ function r(n3) {
|
|
|
1646
1810
|
function num(v) {
|
|
1647
1811
|
return typeof v === "number" && isFinite(v) ? v : null;
|
|
1648
1812
|
}
|
|
1649
|
-
var Sparkline =
|
|
1813
|
+
var Sparkline = React7.forwardRef(function Sparkline2(props, ref) {
|
|
1650
1814
|
const wh = SIZES2[props.size || "sm"] || SIZES2.sm;
|
|
1651
1815
|
const W = wh[0], H = wh[1];
|
|
1652
1816
|
const data = (props.data || []).map(num);
|
|
@@ -1676,7 +1840,7 @@ var Sparkline = React6.forwardRef(function Sparkline2(props, ref) {
|
|
|
1676
1840
|
data.forEach(function(v, i) {
|
|
1677
1841
|
if (v == null) return;
|
|
1678
1842
|
const prev = i > 0 && data[i - 1] != null, next = i < n3 - 1 && data[i + 1] != null;
|
|
1679
|
-
if (!prev && !next) dots.push(
|
|
1843
|
+
if (!prev && !next) dots.push(h6("circle", { key: "d" + i, cx: r(x(i)), cy: r(y(v)), r: 1.5 }));
|
|
1680
1844
|
else d += (prev ? "L" : "M") + r(x(i)) + " " + r(y(v));
|
|
1681
1845
|
});
|
|
1682
1846
|
const mode = props.failures || "none";
|
|
@@ -1686,10 +1850,10 @@ var Sparkline = React6.forwardRef(function Sparkline2(props, ref) {
|
|
|
1686
1850
|
if (!props.failed[i]) return;
|
|
1687
1851
|
if (mode === "band") {
|
|
1688
1852
|
const w = Math.max(2, step || W), left = Math.max(0, x(i) - w / 2), right = Math.min(W, x(i) + w / 2);
|
|
1689
|
-
fails.push(
|
|
1853
|
+
fails.push(h6("rect", { key: "f" + i, x: r(left), y: 0, width: r(right - left), height: H }));
|
|
1690
1854
|
} else
|
|
1691
1855
|
fails.push(
|
|
1692
|
-
|
|
1856
|
+
h6("rect", {
|
|
1693
1857
|
key: "f" + i,
|
|
1694
1858
|
x: r(Math.max(0, Math.min(W - 1.5, x(i) - 0.75))),
|
|
1695
1859
|
y: H - 6,
|
|
@@ -1699,7 +1863,7 @@ var Sparkline = React6.forwardRef(function Sparkline2(props, ref) {
|
|
|
1699
1863
|
);
|
|
1700
1864
|
});
|
|
1701
1865
|
const named = !!props.label;
|
|
1702
|
-
return
|
|
1866
|
+
return h6(
|
|
1703
1867
|
"svg",
|
|
1704
1868
|
Object.assign(attrs(props), {
|
|
1705
1869
|
ref,
|
|
@@ -1712,9 +1876,9 @@ var Sparkline = React6.forwardRef(function Sparkline2(props, ref) {
|
|
|
1712
1876
|
"aria-hidden": named ? void 0 : true,
|
|
1713
1877
|
focusable: "false"
|
|
1714
1878
|
}),
|
|
1715
|
-
fails.length && mode === "band" ?
|
|
1716
|
-
d ?
|
|
1717
|
-
dots.length ?
|
|
1718
|
-
fails.length && mode === "ticks" ?
|
|
1879
|
+
fails.length && mode === "band" ? h6("g", { className: "aura-sparkline__band" }, fails) : null,
|
|
1880
|
+
d ? h6("path", { className: "aura-sparkline__line", d }) : null,
|
|
1881
|
+
dots.length ? h6("g", { className: "aura-sparkline__dots" }, dots) : null,
|
|
1882
|
+
fails.length && mode === "ticks" ? h6("g", { className: "aura-sparkline__ticks" }, fails) : null
|
|
1719
1883
|
);
|
|
1720
1884
|
});
|
package/dist/server/index.d.cts
CHANGED
|
@@ -16,8 +16,10 @@ export interface ButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElem
|
|
|
16
16
|
iconRight?: IconInput | undefined;
|
|
17
17
|
/** Shows a spinner in place of the leading icon, sets aria-busy and swallows clicks. Keeps the label and width. */
|
|
18
18
|
loading?: boolean | undefined;
|
|
19
|
-
/** Fills its container and lets a long label wrap onto more lines (at least 44px tall) — phones, Thai and Swedish labels.
|
|
20
|
-
|
|
19
|
+
/** Fills its container and lets a long label wrap onto more lines (at least 44px tall) — phones, Thai and Swedish labels.
|
|
20
|
+
* `'below-sm'` / `'below-md'` (5.53, Chamber-OS 165): only below 640px / 768px (the viewport's), at least 44px tall
|
|
21
|
+
* there whatever the density, its natural width above — for action rows that stack on phones and sit inline above. */
|
|
22
|
+
fullWidth?: boolean | "below-sm" | "below-md" | undefined;
|
|
21
23
|
/** `sm` is 32px with tighter padding, for toolbars, table rows and card footers. Default `md` (44px). */
|
|
22
24
|
size?: ButtonSize | undefined;
|
|
23
25
|
/** 44px tall below 640px (the viewport's) or wherever the primary pointer is coarse (a tablet, 5.24), whatever
|
|
@@ -117,6 +119,43 @@ export type DataAttributes = {
|
|
|
117
119
|
};
|
|
118
120
|
export type Breakpoint = "base" | "sm" | "md" | "lg" | "xl";
|
|
119
121
|
export type Responsive<T> = T | Partial<Record<Breakpoint, T>>;
|
|
122
|
+
/** 5.52 (Chamber-OS 164): what a loading column's placeholder cell looks like. */
|
|
123
|
+
export interface TableSkeletonHint {
|
|
124
|
+
/** Text lines: 2 for a value over its caption. Default 1. */
|
|
125
|
+
lines?: 1 | 2 | undefined;
|
|
126
|
+
/** `text` (default) bars, a status `pill`, or an `action` block as tall as a small Button (44px on a phone card or a
|
|
127
|
+
* touch screen with `touch`). */
|
|
128
|
+
kind?: "text" | "pill" | "action" | undefined;
|
|
129
|
+
/** An `action` block 44px below 640px and on a coarse pointer, as `touchHeight` buttons are. */
|
|
130
|
+
touch?: boolean | undefined;
|
|
131
|
+
}
|
|
132
|
+
/** 5.52 (Chamber-OS 164): one column of a `TableSkeleton` — the same facts a header cell gives a loading Table. */
|
|
133
|
+
export interface TableSkeletonColumn {
|
|
134
|
+
/** Header text (and the stacked card's field label). */
|
|
135
|
+
label?: string | undefined;
|
|
136
|
+
/** Column width: a share such as `'22%'`, or px. Columns without one split what is left evenly. */
|
|
137
|
+
width?: string | number | undefined;
|
|
138
|
+
align?: "start" | "center" | "end" | undefined;
|
|
139
|
+
numeric?: boolean | undefined;
|
|
140
|
+
/** Its place in a stacked row: `title`, `action` or `field` (default), as on a Td. */
|
|
141
|
+
card?: "title" | "action" | "field" | undefined;
|
|
142
|
+
skeleton?: TableSkeletonHint | undefined;
|
|
143
|
+
}
|
|
144
|
+
/** 5.52 (Chamber-OS 164): a loading Table for Server Components. Same frame, density, stacking and cards as Table. */
|
|
145
|
+
export interface TableSkeletonProps {
|
|
146
|
+
columns: TableSkeletonColumn[];
|
|
147
|
+
/** Placeholder rows (default 5). */
|
|
148
|
+
rows?: number | undefined;
|
|
149
|
+
density?: "comfortable" | "compact" | undefined;
|
|
150
|
+
stackBelow?: "sm" | "md" | undefined;
|
|
151
|
+
stackStyle?: "list" | "cards" | undefined;
|
|
152
|
+
bordered?: boolean | undefined;
|
|
153
|
+
bleed?: boolean | undefined;
|
|
154
|
+
bleedEnd?: boolean | undefined;
|
|
155
|
+
rowHeight?: "density" | undefined;
|
|
156
|
+
align?: "top" | "middle" | undefined;
|
|
157
|
+
className?: string | undefined;
|
|
158
|
+
}
|
|
120
159
|
export interface StatChange {
|
|
121
160
|
/** Shown as written, e.g. "+12%" or "−3". */
|
|
122
161
|
value: React$1.ReactNode;
|
|
@@ -447,7 +486,7 @@ export type AuraIcon = React$1.ForwardRefExoticComponent<Omit<IconProps, "name">
|
|
|
447
486
|
export declare function buttonClass(opts?: {
|
|
448
487
|
variant?: ButtonProps["variant"];
|
|
449
488
|
size?: ButtonProps["size"];
|
|
450
|
-
fullWidth?: boolean | undefined;
|
|
489
|
+
fullWidth?: boolean | "below-sm" | "below-md" | undefined;
|
|
451
490
|
loading?: boolean | undefined;
|
|
452
491
|
touchHeight?: boolean | undefined;
|
|
453
492
|
className?: string | undefined;
|
|
@@ -487,6 +526,9 @@ export interface ContainerProps extends Pick<React$1.HTMLAttributes<HTMLElement>
|
|
|
487
526
|
}
|
|
488
527
|
/** Container — centres content up to aura-container-max (1280px) with responsive side padding. */
|
|
489
528
|
export declare const Container: React$1.ForwardRefExoticComponent<ContainerProps & React$1.RefAttributes<HTMLElement>>;
|
|
529
|
+
/** A loading Table (5.52, Chamber-OS 164), for Server Components — e.g. a route's loading.tsx. `aria-hidden` and
|
|
530
|
+
* `inert`: announce the load in the page's own status line. */
|
|
531
|
+
export declare function TableSkeleton(props: TableSkeletonProps): React$1.ReactElement;
|
|
490
532
|
/** PageHeader (5.32, DxT Monitor request 3): the top of a page — an eyebrow, the page's heading, a meta line and the
|
|
491
533
|
* page's actions. It has no outer padding: inside AppShell, the content padding is the page margin (16px at the sides
|
|
492
534
|
* and 24px top and bottom on phones, 24px from 640px, 32px from 1024px). Stateless, so it is also exported from
|
package/dist/server/index.d.ts
CHANGED
|
@@ -16,8 +16,10 @@ export interface ButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElem
|
|
|
16
16
|
iconRight?: IconInput | undefined;
|
|
17
17
|
/** Shows a spinner in place of the leading icon, sets aria-busy and swallows clicks. Keeps the label and width. */
|
|
18
18
|
loading?: boolean | undefined;
|
|
19
|
-
/** Fills its container and lets a long label wrap onto more lines (at least 44px tall) — phones, Thai and Swedish labels.
|
|
20
|
-
|
|
19
|
+
/** Fills its container and lets a long label wrap onto more lines (at least 44px tall) — phones, Thai and Swedish labels.
|
|
20
|
+
* `'below-sm'` / `'below-md'` (5.53, Chamber-OS 165): only below 640px / 768px (the viewport's), at least 44px tall
|
|
21
|
+
* there whatever the density, its natural width above — for action rows that stack on phones and sit inline above. */
|
|
22
|
+
fullWidth?: boolean | "below-sm" | "below-md" | undefined;
|
|
21
23
|
/** `sm` is 32px with tighter padding, for toolbars, table rows and card footers. Default `md` (44px). */
|
|
22
24
|
size?: ButtonSize | undefined;
|
|
23
25
|
/** 44px tall below 640px (the viewport's) or wherever the primary pointer is coarse (a tablet, 5.24), whatever
|
|
@@ -117,6 +119,43 @@ export type DataAttributes = {
|
|
|
117
119
|
};
|
|
118
120
|
export type Breakpoint = "base" | "sm" | "md" | "lg" | "xl";
|
|
119
121
|
export type Responsive<T> = T | Partial<Record<Breakpoint, T>>;
|
|
122
|
+
/** 5.52 (Chamber-OS 164): what a loading column's placeholder cell looks like. */
|
|
123
|
+
export interface TableSkeletonHint {
|
|
124
|
+
/** Text lines: 2 for a value over its caption. Default 1. */
|
|
125
|
+
lines?: 1 | 2 | undefined;
|
|
126
|
+
/** `text` (default) bars, a status `pill`, or an `action` block as tall as a small Button (44px on a phone card or a
|
|
127
|
+
* touch screen with `touch`). */
|
|
128
|
+
kind?: "text" | "pill" | "action" | undefined;
|
|
129
|
+
/** An `action` block 44px below 640px and on a coarse pointer, as `touchHeight` buttons are. */
|
|
130
|
+
touch?: boolean | undefined;
|
|
131
|
+
}
|
|
132
|
+
/** 5.52 (Chamber-OS 164): one column of a `TableSkeleton` — the same facts a header cell gives a loading Table. */
|
|
133
|
+
export interface TableSkeletonColumn {
|
|
134
|
+
/** Header text (and the stacked card's field label). */
|
|
135
|
+
label?: string | undefined;
|
|
136
|
+
/** Column width: a share such as `'22%'`, or px. Columns without one split what is left evenly. */
|
|
137
|
+
width?: string | number | undefined;
|
|
138
|
+
align?: "start" | "center" | "end" | undefined;
|
|
139
|
+
numeric?: boolean | undefined;
|
|
140
|
+
/** Its place in a stacked row: `title`, `action` or `field` (default), as on a Td. */
|
|
141
|
+
card?: "title" | "action" | "field" | undefined;
|
|
142
|
+
skeleton?: TableSkeletonHint | undefined;
|
|
143
|
+
}
|
|
144
|
+
/** 5.52 (Chamber-OS 164): a loading Table for Server Components. Same frame, density, stacking and cards as Table. */
|
|
145
|
+
export interface TableSkeletonProps {
|
|
146
|
+
columns: TableSkeletonColumn[];
|
|
147
|
+
/** Placeholder rows (default 5). */
|
|
148
|
+
rows?: number | undefined;
|
|
149
|
+
density?: "comfortable" | "compact" | undefined;
|
|
150
|
+
stackBelow?: "sm" | "md" | undefined;
|
|
151
|
+
stackStyle?: "list" | "cards" | undefined;
|
|
152
|
+
bordered?: boolean | undefined;
|
|
153
|
+
bleed?: boolean | undefined;
|
|
154
|
+
bleedEnd?: boolean | undefined;
|
|
155
|
+
rowHeight?: "density" | undefined;
|
|
156
|
+
align?: "top" | "middle" | undefined;
|
|
157
|
+
className?: string | undefined;
|
|
158
|
+
}
|
|
120
159
|
export interface StatChange {
|
|
121
160
|
/** Shown as written, e.g. "+12%" or "−3". */
|
|
122
161
|
value: React$1.ReactNode;
|
|
@@ -447,7 +486,7 @@ export type AuraIcon = React$1.ForwardRefExoticComponent<Omit<IconProps, "name">
|
|
|
447
486
|
export declare function buttonClass(opts?: {
|
|
448
487
|
variant?: ButtonProps["variant"];
|
|
449
488
|
size?: ButtonProps["size"];
|
|
450
|
-
fullWidth?: boolean | undefined;
|
|
489
|
+
fullWidth?: boolean | "below-sm" | "below-md" | undefined;
|
|
451
490
|
loading?: boolean | undefined;
|
|
452
491
|
touchHeight?: boolean | undefined;
|
|
453
492
|
className?: string | undefined;
|
|
@@ -487,6 +526,9 @@ export interface ContainerProps extends Pick<React$1.HTMLAttributes<HTMLElement>
|
|
|
487
526
|
}
|
|
488
527
|
/** Container — centres content up to aura-container-max (1280px) with responsive side padding. */
|
|
489
528
|
export declare const Container: React$1.ForwardRefExoticComponent<ContainerProps & React$1.RefAttributes<HTMLElement>>;
|
|
529
|
+
/** A loading Table (5.52, Chamber-OS 164), for Server Components — e.g. a route's loading.tsx. `aria-hidden` and
|
|
530
|
+
* `inert`: announce the load in the page's own status line. */
|
|
531
|
+
export declare function TableSkeleton(props: TableSkeletonProps): React$1.ReactElement;
|
|
490
532
|
/** PageHeader (5.32, DxT Monitor request 3): the top of a page — an eyebrow, the page's heading, a meta line and the
|
|
491
533
|
* page's actions. It has no outer padding: inside AppShell, the content padding is the page margin (16px at the sides
|
|
492
534
|
* and 24px top and bottom on phones, 24px from 640px, 32px from 1024px). Stateless, so it is also exported from
|