@jirawatpyk/aura-react 5.31.0 → 5.33.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 +23 -0
- package/dist/aura.bundle.js +1125 -881
- package/dist/cjs/index.cjs +1124 -880
- package/dist/esm/Accordion.js +1 -2
- package/dist/esm/AppShell.js +33 -14
- package/dist/esm/BottomNav.js +10 -4
- package/dist/esm/Combobox.js +1 -2
- package/dist/esm/Command.js +1 -2
- package/dist/esm/FilterDateRange.js +5 -3
- package/dist/esm/IconButton.js +4 -1
- package/dist/esm/PageHeader.js +28 -0
- package/dist/esm/Pagination.js +3 -1
- package/dist/esm/SegmentedControl.js +3 -1
- package/dist/esm/SideNav.js +1 -0
- package/dist/esm/Stepper.js +9 -2
- package/dist/esm/Tag.js +3 -1
- package/dist/esm/autoTip.js +182 -0
- package/dist/esm/index.js +2 -0
- package/dist/index.d.cts +45 -4
- package/dist/index.d.ts +45 -4
- package/dist/server/index.cjs +31 -5
- package/dist/server/index.d.cts +26 -0
- package/dist/server/index.d.ts +26 -0
- package/dist/server/index.js +31 -5
- package/dist/styles.css +68 -25
- package/dist/styles.layer.css +68 -25
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -344,7 +344,8 @@ export interface IconButtonProps extends React$1.ButtonHTMLAttributes<HTMLButton
|
|
|
344
344
|
icon: IconInput;
|
|
345
345
|
/** `danger` colours the icon and hover for a destructive action (Delete, Revoke). */
|
|
346
346
|
tone?: "neutral" | "danger" | undefined;
|
|
347
|
-
/** Accessible name and tooltip (required).
|
|
347
|
+
/** Accessible name and tooltip (required). Since 5.32 the tooltip is AURA's own (hover and keyboard focus), not a
|
|
348
|
+
* native `title`; pass `title` yourself to keep a native one instead. */
|
|
348
349
|
label: string;
|
|
349
350
|
/** Icon size. Default `sm` (16). */
|
|
350
351
|
size?: "sm" | "md" | undefined;
|
|
@@ -828,6 +829,10 @@ export interface SideNavProps {
|
|
|
828
829
|
defaultValue?: string | undefined;
|
|
829
830
|
onChange?: ((id: string) => void) | undefined;
|
|
830
831
|
header?: React$1.ReactNode | undefined;
|
|
832
|
+
/** 5.32 (DxT Monitor request 1): a full-width 1px aura-border-default line under `header`, with the board's metrics:
|
|
833
|
+
* the header at least 72px tall with its content 20px from the top and start, the line at its foot, and 16px
|
|
834
|
+
* before the first item. Default `false`. */
|
|
835
|
+
headerDivider?: boolean | undefined;
|
|
831
836
|
footer?: React$1.ReactNode | undefined;
|
|
832
837
|
/** Default "Main". */
|
|
833
838
|
label?: string | undefined;
|
|
@@ -1205,6 +1210,10 @@ export interface AppShellProps {
|
|
|
1205
1210
|
nav?: React$1.ReactElement | undefined;
|
|
1206
1211
|
/** Top bar content (title, search, account menu). */
|
|
1207
1212
|
header?: React$1.ReactNode | undefined;
|
|
1213
|
+
/** 5.33 (DxT Monitor #6): `'lg'` shows the top bar, `header` and all, only below 1024px — where the menu button is —
|
|
1214
|
+
* as when there is no `header`: from lg up it is hidden and `--aura-shell-bar-height` is 0. For apps whose phone
|
|
1215
|
+
* pages have a top bar (brand, avatar) and whose desktop pages don't. Default: the bar shows at every width. */
|
|
1216
|
+
headerHideFrom?: "lg" | undefined;
|
|
1208
1217
|
children?: React$1.ReactNode | undefined;
|
|
1209
1218
|
navLabel?: string | undefined;
|
|
1210
1219
|
menuLabel?: string | undefined;
|
|
@@ -1214,7 +1223,9 @@ export interface AppShellProps {
|
|
|
1214
1223
|
/** A BottomNav for phones (4.19). Shown below its `hideFrom` breakpoint; the content keeps room for it, and a
|
|
1215
1224
|
* viewport ActionBar sits on top of it. With a `bottomNav` and no `nav`, there is no menu button. */
|
|
1216
1225
|
bottomNav?: React$1.ReactElement | undefined;
|
|
1217
|
-
/**
|
|
1226
|
+
/** The content padding is the page margin: 16px at the sides and 24px top and bottom on phones, 24px from 640px,
|
|
1227
|
+
* 32px from 1024px. Pages don't add their own (a PageHeader has none, 5.32). `false` (5.14): `<main>` has no
|
|
1228
|
+
* padding, for pages whose containers own the page padding and column. */
|
|
1218
1229
|
contentPadding?: boolean | undefined;
|
|
1219
1230
|
className?: string | undefined;
|
|
1220
1231
|
}
|
|
@@ -1338,7 +1349,8 @@ export interface BottomNavItem {
|
|
|
1338
1349
|
/** Read after the label when `badge` is set, e.g. "new". */
|
|
1339
1350
|
badgeLabel?: string | undefined;
|
|
1340
1351
|
/** The full name for screen readers when `label` is shortened to fit (5.7), e.g. label "Konto", ariaLabel
|
|
1341
|
-
* "Mitt konto". Include the visible label in it (WCAG 2.5.3). The count or badge is
|
|
1352
|
+
* "Mitt konto". Include the visible label in it (WCAG 2.5.3); a dev warning says when it doesn't (5.32). The count or badge is
|
|
1353
|
+
* still appended. */
|
|
1342
1354
|
ariaLabel?: string | undefined;
|
|
1343
1355
|
}
|
|
1344
1356
|
export interface BottomNavProps {
|
|
@@ -1490,7 +1502,10 @@ export interface ProgressProps {
|
|
|
1490
1502
|
className?: string | undefined;
|
|
1491
1503
|
}
|
|
1492
1504
|
export interface SkeletonProps {
|
|
1493
|
-
|
|
1505
|
+
/** 5.32 (DxT Monitor request 4): `pill` is a StatusPill's size (20px tall, 22px under `lang="th"`, 72px wide) and
|
|
1506
|
+
* `badge` a Badge's (20px, 56px wide), both fully rounded, so the row doesn't move when the real one arrives.
|
|
1507
|
+
* `width` overrides the width. */
|
|
1508
|
+
variant?: "text" | "rect" | "circle" | "pill" | "badge" | undefined;
|
|
1494
1509
|
/** text only: number of lines (the last is shorter). */
|
|
1495
1510
|
lines?: number | undefined;
|
|
1496
1511
|
width?: number | string | undefined;
|
|
@@ -1783,6 +1798,32 @@ export interface ContainerProps extends Pick<React$1.HTMLAttributes<HTMLElement>
|
|
|
1783
1798
|
}
|
|
1784
1799
|
/** Container — centres content up to aura-container-max (1280px) with responsive side padding. */
|
|
1785
1800
|
export declare const Container: React$1.ForwardRefExoticComponent<ContainerProps & React$1.RefAttributes<HTMLElement>>;
|
|
1801
|
+
/** PageHeader (5.32, DxT Monitor request 3): the top of a page — an eyebrow, the page's heading, a meta line and the
|
|
1802
|
+
* page's actions. It has no outer padding: inside AppShell, the content padding is the page margin (16px at the sides
|
|
1803
|
+
* and 24px top and bottom on phones, 24px from 640px, 32px from 1024px). Stateless, so it is also exported from
|
|
1804
|
+
* `/server`. It renders a plain `div`: to name a region by its title, put `aria-labelledby={titleId}` on your own
|
|
1805
|
+
* `<section>`, or pass `role="region"` with it. */
|
|
1806
|
+
export interface PageHeaderProps extends Pick<React$1.HTMLAttributes<HTMLElement>, "id" | "lang" | "dir" | "role">, React$1.AriaAttributes, DataAttributes {
|
|
1807
|
+
/** Small mono line above the title — a section or breadcrumb-like context ("Monitor / Sites"). */
|
|
1808
|
+
eyebrow?: React$1.ReactNode | undefined;
|
|
1809
|
+
/** 5.33 (DxT Monitor #7): a `<Breadcrumb>` above the title, 4px from it like the eyebrow, in its own `div` (a `nav`
|
|
1810
|
+
* can't sit in the eyebrow's `p`) and its own 13px sans. Detail pages show a breadcrumb or an eyebrow; with both,
|
|
1811
|
+
* the breadcrumb comes first. */
|
|
1812
|
+
breadcrumb?: React$1.ReactNode | undefined;
|
|
1813
|
+
/** The page's heading. */
|
|
1814
|
+
title: React$1.ReactNode;
|
|
1815
|
+
/** A line under the title — counts, last update, owner. */
|
|
1816
|
+
meta?: React$1.ReactNode | undefined;
|
|
1817
|
+
/** Buttons for the page, bottom-aligned at the end; they wrap below the text on a narrow screen. */
|
|
1818
|
+
actions?: React$1.ReactNode | undefined;
|
|
1819
|
+
/** Default 1. Use 2 when the page already has an h1 (e.g. in the AppShell bar). */
|
|
1820
|
+
headingLevel?: 1 | 2 | 3 | undefined;
|
|
1821
|
+
/** The heading's id, for `aria-labelledby` on the page's region. */
|
|
1822
|
+
titleId?: string | undefined;
|
|
1823
|
+
className?: string | undefined;
|
|
1824
|
+
style?: React$1.CSSProperties | undefined;
|
|
1825
|
+
}
|
|
1826
|
+
export declare const PageHeader: React$1.ForwardRefExoticComponent<PageHeaderProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
1786
1827
|
/** AppShell — side navigation + top bar + content. The nav is fixed from lg (1024px) up and a Drawer below it.
|
|
1787
1828
|
* Which one shows is decided in CSS (4.16), so the server's HTML is already right on a phone and nothing shifts on
|
|
1788
1829
|
* hydration; JavaScript only opens and closes the drawer. */
|
package/dist/index.d.ts
CHANGED
|
@@ -344,7 +344,8 @@ export interface IconButtonProps extends React$1.ButtonHTMLAttributes<HTMLButton
|
|
|
344
344
|
icon: IconInput;
|
|
345
345
|
/** `danger` colours the icon and hover for a destructive action (Delete, Revoke). */
|
|
346
346
|
tone?: "neutral" | "danger" | undefined;
|
|
347
|
-
/** Accessible name and tooltip (required).
|
|
347
|
+
/** Accessible name and tooltip (required). Since 5.32 the tooltip is AURA's own (hover and keyboard focus), not a
|
|
348
|
+
* native `title`; pass `title` yourself to keep a native one instead. */
|
|
348
349
|
label: string;
|
|
349
350
|
/** Icon size. Default `sm` (16). */
|
|
350
351
|
size?: "sm" | "md" | undefined;
|
|
@@ -828,6 +829,10 @@ export interface SideNavProps {
|
|
|
828
829
|
defaultValue?: string | undefined;
|
|
829
830
|
onChange?: ((id: string) => void) | undefined;
|
|
830
831
|
header?: React$1.ReactNode | undefined;
|
|
832
|
+
/** 5.32 (DxT Monitor request 1): a full-width 1px aura-border-default line under `header`, with the board's metrics:
|
|
833
|
+
* the header at least 72px tall with its content 20px from the top and start, the line at its foot, and 16px
|
|
834
|
+
* before the first item. Default `false`. */
|
|
835
|
+
headerDivider?: boolean | undefined;
|
|
831
836
|
footer?: React$1.ReactNode | undefined;
|
|
832
837
|
/** Default "Main". */
|
|
833
838
|
label?: string | undefined;
|
|
@@ -1205,6 +1210,10 @@ export interface AppShellProps {
|
|
|
1205
1210
|
nav?: React$1.ReactElement | undefined;
|
|
1206
1211
|
/** Top bar content (title, search, account menu). */
|
|
1207
1212
|
header?: React$1.ReactNode | undefined;
|
|
1213
|
+
/** 5.33 (DxT Monitor #6): `'lg'` shows the top bar, `header` and all, only below 1024px — where the menu button is —
|
|
1214
|
+
* as when there is no `header`: from lg up it is hidden and `--aura-shell-bar-height` is 0. For apps whose phone
|
|
1215
|
+
* pages have a top bar (brand, avatar) and whose desktop pages don't. Default: the bar shows at every width. */
|
|
1216
|
+
headerHideFrom?: "lg" | undefined;
|
|
1208
1217
|
children?: React$1.ReactNode | undefined;
|
|
1209
1218
|
navLabel?: string | undefined;
|
|
1210
1219
|
menuLabel?: string | undefined;
|
|
@@ -1214,7 +1223,9 @@ export interface AppShellProps {
|
|
|
1214
1223
|
/** A BottomNav for phones (4.19). Shown below its `hideFrom` breakpoint; the content keeps room for it, and a
|
|
1215
1224
|
* viewport ActionBar sits on top of it. With a `bottomNav` and no `nav`, there is no menu button. */
|
|
1216
1225
|
bottomNav?: React$1.ReactElement | undefined;
|
|
1217
|
-
/**
|
|
1226
|
+
/** The content padding is the page margin: 16px at the sides and 24px top and bottom on phones, 24px from 640px,
|
|
1227
|
+
* 32px from 1024px. Pages don't add their own (a PageHeader has none, 5.32). `false` (5.14): `<main>` has no
|
|
1228
|
+
* padding, for pages whose containers own the page padding and column. */
|
|
1218
1229
|
contentPadding?: boolean | undefined;
|
|
1219
1230
|
className?: string | undefined;
|
|
1220
1231
|
}
|
|
@@ -1338,7 +1349,8 @@ export interface BottomNavItem {
|
|
|
1338
1349
|
/** Read after the label when `badge` is set, e.g. "new". */
|
|
1339
1350
|
badgeLabel?: string | undefined;
|
|
1340
1351
|
/** The full name for screen readers when `label` is shortened to fit (5.7), e.g. label "Konto", ariaLabel
|
|
1341
|
-
* "Mitt konto". Include the visible label in it (WCAG 2.5.3). The count or badge is
|
|
1352
|
+
* "Mitt konto". Include the visible label in it (WCAG 2.5.3); a dev warning says when it doesn't (5.32). The count or badge is
|
|
1353
|
+
* still appended. */
|
|
1342
1354
|
ariaLabel?: string | undefined;
|
|
1343
1355
|
}
|
|
1344
1356
|
export interface BottomNavProps {
|
|
@@ -1490,7 +1502,10 @@ export interface ProgressProps {
|
|
|
1490
1502
|
className?: string | undefined;
|
|
1491
1503
|
}
|
|
1492
1504
|
export interface SkeletonProps {
|
|
1493
|
-
|
|
1505
|
+
/** 5.32 (DxT Monitor request 4): `pill` is a StatusPill's size (20px tall, 22px under `lang="th"`, 72px wide) and
|
|
1506
|
+
* `badge` a Badge's (20px, 56px wide), both fully rounded, so the row doesn't move when the real one arrives.
|
|
1507
|
+
* `width` overrides the width. */
|
|
1508
|
+
variant?: "text" | "rect" | "circle" | "pill" | "badge" | undefined;
|
|
1494
1509
|
/** text only: number of lines (the last is shorter). */
|
|
1495
1510
|
lines?: number | undefined;
|
|
1496
1511
|
width?: number | string | undefined;
|
|
@@ -1783,6 +1798,32 @@ export interface ContainerProps extends Pick<React$1.HTMLAttributes<HTMLElement>
|
|
|
1783
1798
|
}
|
|
1784
1799
|
/** Container — centres content up to aura-container-max (1280px) with responsive side padding. */
|
|
1785
1800
|
export declare const Container: React$1.ForwardRefExoticComponent<ContainerProps & React$1.RefAttributes<HTMLElement>>;
|
|
1801
|
+
/** PageHeader (5.32, DxT Monitor request 3): the top of a page — an eyebrow, the page's heading, a meta line and the
|
|
1802
|
+
* page's actions. It has no outer padding: inside AppShell, the content padding is the page margin (16px at the sides
|
|
1803
|
+
* and 24px top and bottom on phones, 24px from 640px, 32px from 1024px). Stateless, so it is also exported from
|
|
1804
|
+
* `/server`. It renders a plain `div`: to name a region by its title, put `aria-labelledby={titleId}` on your own
|
|
1805
|
+
* `<section>`, or pass `role="region"` with it. */
|
|
1806
|
+
export interface PageHeaderProps extends Pick<React$1.HTMLAttributes<HTMLElement>, "id" | "lang" | "dir" | "role">, React$1.AriaAttributes, DataAttributes {
|
|
1807
|
+
/** Small mono line above the title — a section or breadcrumb-like context ("Monitor / Sites"). */
|
|
1808
|
+
eyebrow?: React$1.ReactNode | undefined;
|
|
1809
|
+
/** 5.33 (DxT Monitor #7): a `<Breadcrumb>` above the title, 4px from it like the eyebrow, in its own `div` (a `nav`
|
|
1810
|
+
* can't sit in the eyebrow's `p`) and its own 13px sans. Detail pages show a breadcrumb or an eyebrow; with both,
|
|
1811
|
+
* the breadcrumb comes first. */
|
|
1812
|
+
breadcrumb?: React$1.ReactNode | undefined;
|
|
1813
|
+
/** The page's heading. */
|
|
1814
|
+
title: React$1.ReactNode;
|
|
1815
|
+
/** A line under the title — counts, last update, owner. */
|
|
1816
|
+
meta?: React$1.ReactNode | undefined;
|
|
1817
|
+
/** Buttons for the page, bottom-aligned at the end; they wrap below the text on a narrow screen. */
|
|
1818
|
+
actions?: React$1.ReactNode | undefined;
|
|
1819
|
+
/** Default 1. Use 2 when the page already has an h1 (e.g. in the AppShell bar). */
|
|
1820
|
+
headingLevel?: 1 | 2 | 3 | undefined;
|
|
1821
|
+
/** The heading's id, for `aria-labelledby` on the page's region. */
|
|
1822
|
+
titleId?: string | undefined;
|
|
1823
|
+
className?: string | undefined;
|
|
1824
|
+
style?: React$1.CSSProperties | undefined;
|
|
1825
|
+
}
|
|
1826
|
+
export declare const PageHeader: React$1.ForwardRefExoticComponent<PageHeaderProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
1786
1827
|
/** AppShell — side navigation + top bar + content. The nav is fixed from lg (1024px) up and a Drawer below it.
|
|
1787
1828
|
* Which one shows is decided in CSS (4.16), so the server's HTML is already right on a phone and nothing shifts on
|
|
1788
1829
|
* hydration; JavaScript only opens and closes the drawer. */
|
package/dist/server/index.cjs
CHANGED
|
@@ -37,6 +37,7 @@ __export(server_exports, {
|
|
|
37
37
|
Container: () => Container,
|
|
38
38
|
EmptyState: () => ServerEmptyState,
|
|
39
39
|
Icon: () => Icon,
|
|
40
|
+
PageHeader: () => PageHeader,
|
|
40
41
|
STRINGS: () => STRINGS,
|
|
41
42
|
Stat: () => ServerStat,
|
|
42
43
|
StatusPill: () => ServerStatusPill,
|
|
@@ -606,14 +607,14 @@ var STRINGS = {
|
|
|
606
607
|
|
|
607
608
|
// src/theme.ts
|
|
608
609
|
function hexToRgb(hex) {
|
|
609
|
-
let
|
|
610
|
-
if (
|
|
611
|
-
|
|
610
|
+
let h5 = String(hex).trim().replace("#", "");
|
|
611
|
+
if (h5.length === 3)
|
|
612
|
+
h5 = h5.split("").map(function(c) {
|
|
612
613
|
return c + c;
|
|
613
614
|
}).join("");
|
|
614
|
-
if (!/^[0-9a-f]{6}$/i.test(
|
|
615
|
+
if (!/^[0-9a-f]{6}$/i.test(h5)) throw new Error('createTheme: "' + hex + '" is not a #rgb or #rrggbb colour');
|
|
615
616
|
return [0, 2, 4].map(function(i) {
|
|
616
|
-
return parseInt(
|
|
617
|
+
return parseInt(h5.slice(i, i + 2), 16) / 255;
|
|
617
618
|
});
|
|
618
619
|
}
|
|
619
620
|
function rgbToHex(rgb) {
|
|
@@ -1375,3 +1376,28 @@ var Container = React4.forwardRef(function Container2(props, ref) {
|
|
|
1375
1376
|
props.children
|
|
1376
1377
|
);
|
|
1377
1378
|
});
|
|
1379
|
+
|
|
1380
|
+
// src/PageHeader.tsx
|
|
1381
|
+
var React5 = __toESM(require("react"), 1);
|
|
1382
|
+
var h4 = React5.createElement;
|
|
1383
|
+
var PageHeader = React5.forwardRef(function PageHeader2(props, ref) {
|
|
1384
|
+
const attrs = {};
|
|
1385
|
+
Object.keys(props).forEach(function(k) {
|
|
1386
|
+
if (k === "id" || k === "lang" || k === "dir" || k === "role" || /^(aria|data)-/.test(k))
|
|
1387
|
+
attrs[k] = props[k];
|
|
1388
|
+
});
|
|
1389
|
+
const level = props.headingLevel || 1;
|
|
1390
|
+
return h4(
|
|
1391
|
+
"div",
|
|
1392
|
+
Object.assign(attrs, { ref, className: cx("aura-page-header", props.className), style: props.style }),
|
|
1393
|
+
h4(
|
|
1394
|
+
"div",
|
|
1395
|
+
{ className: "aura-page-header__text" },
|
|
1396
|
+
props.breadcrumb != null && props.breadcrumb !== false ? h4("div", { className: "aura-page-header__breadcrumb" }, props.breadcrumb) : null,
|
|
1397
|
+
props.eyebrow != null && props.eyebrow !== false ? h4("p", { className: "aura-page-header__eyebrow" }, props.eyebrow) : null,
|
|
1398
|
+
h4("h" + level, { className: "aura-page-header__title", id: props.titleId }, props.title),
|
|
1399
|
+
props.meta != null && props.meta !== false ? h4("div", { className: "aura-page-header__meta" }, props.meta) : null
|
|
1400
|
+
),
|
|
1401
|
+
props.actions != null && props.actions !== false ? h4("div", { className: "aura-page-header__actions" }, props.actions) : null
|
|
1402
|
+
);
|
|
1403
|
+
});
|
package/dist/server/index.d.cts
CHANGED
|
@@ -404,6 +404,32 @@ export interface ContainerProps extends Pick<React$1.HTMLAttributes<HTMLElement>
|
|
|
404
404
|
}
|
|
405
405
|
/** Container — centres content up to aura-container-max (1280px) with responsive side padding. */
|
|
406
406
|
export declare const Container: React$1.ForwardRefExoticComponent<ContainerProps & React$1.RefAttributes<HTMLElement>>;
|
|
407
|
+
/** PageHeader (5.32, DxT Monitor request 3): the top of a page — an eyebrow, the page's heading, a meta line and the
|
|
408
|
+
* page's actions. It has no outer padding: inside AppShell, the content padding is the page margin (16px at the sides
|
|
409
|
+
* and 24px top and bottom on phones, 24px from 640px, 32px from 1024px). Stateless, so it is also exported from
|
|
410
|
+
* `/server`. It renders a plain `div`: to name a region by its title, put `aria-labelledby={titleId}` on your own
|
|
411
|
+
* `<section>`, or pass `role="region"` with it. */
|
|
412
|
+
export interface PageHeaderProps extends Pick<React$1.HTMLAttributes<HTMLElement>, "id" | "lang" | "dir" | "role">, React$1.AriaAttributes, DataAttributes {
|
|
413
|
+
/** Small mono line above the title — a section or breadcrumb-like context ("Monitor / Sites"). */
|
|
414
|
+
eyebrow?: React$1.ReactNode | undefined;
|
|
415
|
+
/** 5.33 (DxT Monitor #7): a `<Breadcrumb>` above the title, 4px from it like the eyebrow, in its own `div` (a `nav`
|
|
416
|
+
* can't sit in the eyebrow's `p`) and its own 13px sans. Detail pages show a breadcrumb or an eyebrow; with both,
|
|
417
|
+
* the breadcrumb comes first. */
|
|
418
|
+
breadcrumb?: React$1.ReactNode | undefined;
|
|
419
|
+
/** The page's heading. */
|
|
420
|
+
title: React$1.ReactNode;
|
|
421
|
+
/** A line under the title — counts, last update, owner. */
|
|
422
|
+
meta?: React$1.ReactNode | undefined;
|
|
423
|
+
/** Buttons for the page, bottom-aligned at the end; they wrap below the text on a narrow screen. */
|
|
424
|
+
actions?: React$1.ReactNode | undefined;
|
|
425
|
+
/** Default 1. Use 2 when the page already has an h1 (e.g. in the AppShell bar). */
|
|
426
|
+
headingLevel?: 1 | 2 | 3 | undefined;
|
|
427
|
+
/** The heading's id, for `aria-labelledby` on the page's region. */
|
|
428
|
+
titleId?: string | undefined;
|
|
429
|
+
className?: string | undefined;
|
|
430
|
+
style?: React$1.CSSProperties | undefined;
|
|
431
|
+
}
|
|
432
|
+
export declare const PageHeader: React$1.ForwardRefExoticComponent<PageHeaderProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
407
433
|
|
|
408
434
|
export {
|
|
409
435
|
ServerAlert as Alert,
|
package/dist/server/index.d.ts
CHANGED
|
@@ -404,6 +404,32 @@ export interface ContainerProps extends Pick<React$1.HTMLAttributes<HTMLElement>
|
|
|
404
404
|
}
|
|
405
405
|
/** Container — centres content up to aura-container-max (1280px) with responsive side padding. */
|
|
406
406
|
export declare const Container: React$1.ForwardRefExoticComponent<ContainerProps & React$1.RefAttributes<HTMLElement>>;
|
|
407
|
+
/** PageHeader (5.32, DxT Monitor request 3): the top of a page — an eyebrow, the page's heading, a meta line and the
|
|
408
|
+
* page's actions. It has no outer padding: inside AppShell, the content padding is the page margin (16px at the sides
|
|
409
|
+
* and 24px top and bottom on phones, 24px from 640px, 32px from 1024px). Stateless, so it is also exported from
|
|
410
|
+
* `/server`. It renders a plain `div`: to name a region by its title, put `aria-labelledby={titleId}` on your own
|
|
411
|
+
* `<section>`, or pass `role="region"` with it. */
|
|
412
|
+
export interface PageHeaderProps extends Pick<React$1.HTMLAttributes<HTMLElement>, "id" | "lang" | "dir" | "role">, React$1.AriaAttributes, DataAttributes {
|
|
413
|
+
/** Small mono line above the title — a section or breadcrumb-like context ("Monitor / Sites"). */
|
|
414
|
+
eyebrow?: React$1.ReactNode | undefined;
|
|
415
|
+
/** 5.33 (DxT Monitor #7): a `<Breadcrumb>` above the title, 4px from it like the eyebrow, in its own `div` (a `nav`
|
|
416
|
+
* can't sit in the eyebrow's `p`) and its own 13px sans. Detail pages show a breadcrumb or an eyebrow; with both,
|
|
417
|
+
* the breadcrumb comes first. */
|
|
418
|
+
breadcrumb?: React$1.ReactNode | undefined;
|
|
419
|
+
/** The page's heading. */
|
|
420
|
+
title: React$1.ReactNode;
|
|
421
|
+
/** A line under the title — counts, last update, owner. */
|
|
422
|
+
meta?: React$1.ReactNode | undefined;
|
|
423
|
+
/** Buttons for the page, bottom-aligned at the end; they wrap below the text on a narrow screen. */
|
|
424
|
+
actions?: React$1.ReactNode | undefined;
|
|
425
|
+
/** Default 1. Use 2 when the page already has an h1 (e.g. in the AppShell bar). */
|
|
426
|
+
headingLevel?: 1 | 2 | 3 | undefined;
|
|
427
|
+
/** The heading's id, for `aria-labelledby` on the page's region. */
|
|
428
|
+
titleId?: string | undefined;
|
|
429
|
+
className?: string | undefined;
|
|
430
|
+
style?: React$1.CSSProperties | undefined;
|
|
431
|
+
}
|
|
432
|
+
export declare const PageHeader: React$1.ForwardRefExoticComponent<PageHeaderProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
407
433
|
|
|
408
434
|
export {
|
|
409
435
|
ServerAlert as Alert,
|
package/dist/server/index.js
CHANGED
|
@@ -546,14 +546,14 @@ var STRINGS = {
|
|
|
546
546
|
|
|
547
547
|
// src/theme.ts
|
|
548
548
|
function hexToRgb(hex) {
|
|
549
|
-
let
|
|
550
|
-
if (
|
|
551
|
-
|
|
549
|
+
let h5 = String(hex).trim().replace("#", "");
|
|
550
|
+
if (h5.length === 3)
|
|
551
|
+
h5 = h5.split("").map(function(c) {
|
|
552
552
|
return c + c;
|
|
553
553
|
}).join("");
|
|
554
|
-
if (!/^[0-9a-f]{6}$/i.test(
|
|
554
|
+
if (!/^[0-9a-f]{6}$/i.test(h5)) throw new Error('createTheme: "' + hex + '" is not a #rgb or #rrggbb colour');
|
|
555
555
|
return [0, 2, 4].map(function(i) {
|
|
556
|
-
return parseInt(
|
|
556
|
+
return parseInt(h5.slice(i, i + 2), 16) / 255;
|
|
557
557
|
});
|
|
558
558
|
}
|
|
559
559
|
function rgbToHex(rgb) {
|
|
@@ -1315,6 +1315,31 @@ var Container = React4.forwardRef(function Container2(props, ref) {
|
|
|
1315
1315
|
props.children
|
|
1316
1316
|
);
|
|
1317
1317
|
});
|
|
1318
|
+
|
|
1319
|
+
// src/PageHeader.tsx
|
|
1320
|
+
import * as React5 from "react";
|
|
1321
|
+
var h4 = React5.createElement;
|
|
1322
|
+
var PageHeader = React5.forwardRef(function PageHeader2(props, ref) {
|
|
1323
|
+
const attrs = {};
|
|
1324
|
+
Object.keys(props).forEach(function(k) {
|
|
1325
|
+
if (k === "id" || k === "lang" || k === "dir" || k === "role" || /^(aria|data)-/.test(k))
|
|
1326
|
+
attrs[k] = props[k];
|
|
1327
|
+
});
|
|
1328
|
+
const level = props.headingLevel || 1;
|
|
1329
|
+
return h4(
|
|
1330
|
+
"div",
|
|
1331
|
+
Object.assign(attrs, { ref, className: cx("aura-page-header", props.className), style: props.style }),
|
|
1332
|
+
h4(
|
|
1333
|
+
"div",
|
|
1334
|
+
{ className: "aura-page-header__text" },
|
|
1335
|
+
props.breadcrumb != null && props.breadcrumb !== false ? h4("div", { className: "aura-page-header__breadcrumb" }, props.breadcrumb) : null,
|
|
1336
|
+
props.eyebrow != null && props.eyebrow !== false ? h4("p", { className: "aura-page-header__eyebrow" }, props.eyebrow) : null,
|
|
1337
|
+
h4("h" + level, { className: "aura-page-header__title", id: props.titleId }, props.title),
|
|
1338
|
+
props.meta != null && props.meta !== false ? h4("div", { className: "aura-page-header__meta" }, props.meta) : null
|
|
1339
|
+
),
|
|
1340
|
+
props.actions != null && props.actions !== false ? h4("div", { className: "aura-page-header__actions" }, props.actions) : null
|
|
1341
|
+
);
|
|
1342
|
+
});
|
|
1318
1343
|
export {
|
|
1319
1344
|
ServerAlert as Alert,
|
|
1320
1345
|
ServerAvatar as Avatar,
|
|
@@ -1323,6 +1348,7 @@ export {
|
|
|
1323
1348
|
Container,
|
|
1324
1349
|
ServerEmptyState as EmptyState,
|
|
1325
1350
|
Icon,
|
|
1351
|
+
PageHeader,
|
|
1326
1352
|
STRINGS,
|
|
1327
1353
|
ServerStat as Stat,
|
|
1328
1354
|
ServerStatusPill as StatusPill,
|