@lincyaw/aegis-ui 0.18.0 → 0.20.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/dist/components/ui/AnchoredPopover.cjs +1 -1
- package/dist/components/ui/AnchoredPopover.cjs.map +1 -1
- package/dist/components/ui/AnchoredPopover.d.ts +21 -1
- package/dist/components/ui/AnchoredPopover.js +106 -78
- package/dist/components/ui/AnchoredPopover.js.map +1 -1
- package/dist/components/ui/CodeBlock.cjs +2 -2
- package/dist/components/ui/CodeBlock.cjs.map +1 -1
- package/dist/components/ui/CodeBlock.d.ts +10 -1
- package/dist/components/ui/CodeBlock.js +65 -57
- package/dist/components/ui/CodeBlock.js.map +1 -1
- package/dist/components/ui/DataTable.cjs +1 -1
- package/dist/components/ui/DataTable.cjs.map +1 -1
- package/dist/components/ui/DataTable.d.ts +11 -1
- package/dist/components/ui/DataTable.js +78 -74
- package/dist/components/ui/DataTable.js.map +1 -1
- package/dist/components/ui/DetailBeside.cjs +1 -1
- package/dist/components/ui/DetailBeside.cjs.map +1 -1
- package/dist/components/ui/DetailBeside.d.ts +45 -11
- package/dist/components/ui/DetailBeside.js +118 -85
- package/dist/components/ui/DetailBeside.js.map +1 -1
- package/dist/components/ui/IdentityCell.cjs +1 -1
- package/dist/components/ui/IdentityCell.cjs.map +1 -1
- package/dist/components/ui/IdentityCell.d.ts +6 -1
- package/dist/components/ui/IdentityCell.js +17 -15
- package/dist/components/ui/IdentityCell.js.map +1 -1
- package/dist/components/ui/PaneLayout.cjs +1 -1
- package/dist/components/ui/PaneLayout.cjs.map +1 -1
- package/dist/components/ui/PaneLayout.d.ts +7 -2
- package/dist/components/ui/PaneLayout.js +20 -22
- package/dist/components/ui/PaneLayout.js.map +1 -1
- package/dist/components/ui/Select.cjs +1 -1
- package/dist/components/ui/Select.cjs.map +1 -1
- package/dist/components/ui/Select.d.ts +8 -2
- package/dist/components/ui/Select.js +44 -38
- package/dist/components/ui/Select.js.map +1 -1
- package/dist/components/ui/TimeDisplay.cjs +1 -1
- package/dist/components/ui/TimeDisplay.cjs.map +1 -1
- package/dist/components/ui/TimeDisplay.d.ts +11 -3
- package/dist/components/ui/TimeDisplay.js +39 -34
- package/dist/components/ui/TimeDisplay.js.map +1 -1
- package/dist/components/ui/Timeline.cjs +1 -1
- package/dist/components/ui/Timeline.cjs.map +1 -1
- package/dist/components/ui/Timeline.d.ts +17 -4
- package/dist/components/ui/Timeline.js +88 -67
- package/dist/components/ui/Timeline.js.map +1 -1
- package/dist/components/ui/Toolbar.cjs.map +1 -1
- package/dist/components/ui/Toolbar.d.ts +2 -1
- package/dist/components/ui/Toolbar.js.map +1 -1
- package/dist/components/ui/TraceTree.cjs +1 -1
- package/dist/components/ui/TraceTree.cjs.map +1 -1
- package/dist/components/ui/TraceTree.d.ts +7 -1
- package/dist/components/ui/TraceTree.js +127 -119
- package/dist/components/ui/TraceTree.js.map +1 -1
- package/dist/components/ui/index.d.ts +1 -1
- package/dist/components/ui/linkComponent.cjs +1 -1
- package/dist/components/ui/linkComponent.cjs.map +1 -1
- package/dist/components/ui/linkComponent.d.ts +6 -4
- package/dist/components/ui/linkComponent.js +12 -10
- package/dist/components/ui/linkComponent.js.map +1 -1
- package/dist/layouts/shell/AegisShell.cjs +1 -1
- package/dist/layouts/shell/AegisShell.cjs.map +1 -1
- package/dist/layouts/shell/AegisShell.js +24 -24
- package/dist/layouts/shell/AegisShell.js.map +1 -1
- package/dist/layouts/shell/RouterLink.cjs +1 -1
- package/dist/layouts/shell/RouterLink.cjs.map +1 -1
- package/dist/layouts/shell/RouterLink.js +14 -12
- package/dist/layouts/shell/RouterLink.js.map +1 -1
- package/dist/layouts/shell/types.d.ts +6 -0
- package/dist/lib/scrollView.cjs +1 -1
- package/dist/lib/scrollView.cjs.map +1 -1
- package/dist/lib/scrollView.d.ts +6 -0
- package/dist/lib/scrollView.js +26 -17
- package/dist/lib/scrollView.js.map +1 -1
- package/dist/locale/strings.cjs +1 -1
- package/dist/locale/strings.cjs.map +1 -1
- package/dist/locale/strings.d.ts +2 -0
- package/dist/locale/strings.js +7 -5
- package/dist/locale/strings.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -12,6 +12,11 @@ interface IdentityCellProps {
|
|
|
12
12
|
colorSlot?: AvatarColorSlot;
|
|
13
13
|
/** Makes the name a link to this destination. */
|
|
14
14
|
to?: string;
|
|
15
|
+
/**
|
|
16
|
+
* The link's accessible name when the name shown is short, e.g. "Expand
|
|
17
|
+
* trace" for a link that shows "Expand".
|
|
18
|
+
*/
|
|
19
|
+
ariaLabel?: string;
|
|
15
20
|
/** Renders the link. Defaults to an `<a href>`; routed apps pass their Link adapter. */
|
|
16
21
|
linkComponent?: LinkComponent;
|
|
17
22
|
/** Puts the secondary text beside the name on one line. */
|
|
@@ -21,5 +26,5 @@ interface IdentityCellProps {
|
|
|
21
26
|
wrap?: boolean;
|
|
22
27
|
className?: string;
|
|
23
28
|
}
|
|
24
|
-
export declare function IdentityCell({ name, secondary, avatar, colorSlot, to, linkComponent, inline, wrap, className, }: IdentityCellProps): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export declare function IdentityCell({ name, secondary, avatar, colorSlot, to, ariaLabel, linkComponent, inline, wrap, className, }: IdentityCellProps): import("react/jsx-runtime").JSX.Element;
|
|
25
30
|
export {};
|
|
@@ -1,32 +1,34 @@
|
|
|
1
1
|
import { jsxs as a, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { Avatar as
|
|
2
|
+
import { Avatar as f } from "./Avatar.js";
|
|
3
3
|
/* empty css */
|
|
4
|
-
import { DefaultLink as
|
|
5
|
-
function
|
|
4
|
+
import { DefaultLink as g } from "./linkComponent.js";
|
|
5
|
+
function v({
|
|
6
6
|
name: i,
|
|
7
7
|
secondary: l,
|
|
8
8
|
avatar: s = !1,
|
|
9
9
|
colorSlot: n,
|
|
10
10
|
to: t,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
ariaLabel: c,
|
|
12
|
+
linkComponent: r,
|
|
13
|
+
inline: d = !1,
|
|
14
|
+
wrap: m = !1,
|
|
15
|
+
className: o
|
|
15
16
|
}) {
|
|
16
|
-
const
|
|
17
|
+
const p = r ?? g, _ = [
|
|
17
18
|
"aegis-identity-cell",
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
d ? "aegis-identity-cell--inline" : "",
|
|
20
|
+
m ? "aegis-identity-cell--wrap" : "",
|
|
21
|
+
o ?? ""
|
|
21
22
|
].filter(Boolean).join(" ");
|
|
22
|
-
return /* @__PURE__ */ a("span", { className:
|
|
23
|
-
s ? /* @__PURE__ */ e("span", { className: "aegis-identity-cell__avatar", "aria-hidden": "true", children: /* @__PURE__ */ e(
|
|
23
|
+
return /* @__PURE__ */ a("span", { className: _, children: [
|
|
24
|
+
s ? /* @__PURE__ */ e("span", { className: "aegis-identity-cell__avatar", "aria-hidden": "true", children: /* @__PURE__ */ e(f, { name: i, size: "sm", colorSlot: n }) }) : null,
|
|
24
25
|
/* @__PURE__ */ a("span", { className: "aegis-identity-cell__text", title: i, children: [
|
|
25
26
|
t === void 0 ? /* @__PURE__ */ e("span", { className: "aegis-identity-cell__name", children: i }) : /* @__PURE__ */ e(
|
|
26
|
-
|
|
27
|
+
p,
|
|
27
28
|
{
|
|
28
29
|
to: t,
|
|
29
30
|
className: "aegis-identity-cell__name aegis-identity-cell__name--link",
|
|
31
|
+
"aria-label": c,
|
|
30
32
|
children: i
|
|
31
33
|
}
|
|
32
34
|
),
|
|
@@ -42,6 +44,6 @@ function N({
|
|
|
42
44
|
] });
|
|
43
45
|
}
|
|
44
46
|
export {
|
|
45
|
-
|
|
47
|
+
v as IdentityCell
|
|
46
48
|
};
|
|
47
49
|
//# sourceMappingURL=IdentityCell.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IdentityCell.js","sources":["../../../src/components/ui/IdentityCell.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\n\nimport { Avatar, type AvatarColorSlot } from './Avatar';\nimport './IdentityCell.css';\nimport { DefaultLink, type LinkComponent } from './linkComponent';\n\ninterface IdentityCellProps {\n /** Primary line, e.g. a model or task name. Truncates; the full name shows on hover. */\n name: string;\n /** Muted `--font-mono` line under the name for an id or path, e.g. `source / task`; a string shows in full on hover. */\n secondary?: ReactNode;\n /** Leads with an Avatar of the name's initials. */\n avatar?: boolean;\n /** Avatar colour from the chart series colours, so it matches that series. */\n colorSlot?: AvatarColorSlot;\n /** Makes the name a link to this destination. */\n to?: string;\n /** Renders the link. Defaults to an `<a href>`; routed apps pass their Link adapter. */\n linkComponent?: LinkComponent;\n /** Puts the secondary text beside the name on one line. */\n inline?: boolean;\n /** Wraps the name and the secondary text, breaking anywhere, instead of truncating, so a long\n * name never widens the card or list it sits in. */\n wrap?: boolean;\n className?: string;\n}\n\nexport function IdentityCell({\n name,\n secondary,\n avatar = false,\n colorSlot,\n to,\n linkComponent,\n inline = false,\n wrap = false,\n className,\n}: IdentityCellProps) {\n const LinkImpl = linkComponent ?? DefaultLink;\n const cls = [\n 'aegis-identity-cell',\n inline ? 'aegis-identity-cell--inline' : '',\n wrap ? 'aegis-identity-cell--wrap' : '',\n className ?? '',\n ]\n .filter(Boolean)\n .join(' ');\n\n return (\n <span className={cls}>\n {avatar ? (\n <span className=\"aegis-identity-cell__avatar\" aria-hidden=\"true\">\n <Avatar name={name} size=\"sm\" colorSlot={colorSlot} />\n </span>\n ) : null}\n <span className=\"aegis-identity-cell__text\" title={name}>\n {to === undefined ? (\n <span className=\"aegis-identity-cell__name\">{name}</span>\n ) : (\n <LinkImpl\n to={to}\n className=\"aegis-identity-cell__name aegis-identity-cell__name--link\"\n >\n {name}\n </LinkImpl>\n )}\n {secondary ? (\n <span\n className=\"aegis-identity-cell__secondary\"\n title={typeof secondary === 'string' ? secondary : undefined}\n >\n {secondary}\n </span>\n ) : null}\n </span>\n </span>\n );\n}\n"],"names":["IdentityCell","name","secondary","avatar","colorSlot","to","linkComponent","inline","wrap","className","LinkImpl","DefaultLink","cls","jsxs","jsx","Avatar"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"IdentityCell.js","sources":["../../../src/components/ui/IdentityCell.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\n\nimport { Avatar, type AvatarColorSlot } from './Avatar';\nimport './IdentityCell.css';\nimport { DefaultLink, type LinkComponent } from './linkComponent';\n\ninterface IdentityCellProps {\n /** Primary line, e.g. a model or task name. Truncates; the full name shows on hover. */\n name: string;\n /** Muted `--font-mono` line under the name for an id or path, e.g. `source / task`; a string shows in full on hover. */\n secondary?: ReactNode;\n /** Leads with an Avatar of the name's initials. */\n avatar?: boolean;\n /** Avatar colour from the chart series colours, so it matches that series. */\n colorSlot?: AvatarColorSlot;\n /** Makes the name a link to this destination. */\n to?: string;\n /**\n * The link's accessible name when the name shown is short, e.g. \"Expand\n * trace\" for a link that shows \"Expand\".\n */\n ariaLabel?: string;\n /** Renders the link. Defaults to an `<a href>`; routed apps pass their Link adapter. */\n linkComponent?: LinkComponent;\n /** Puts the secondary text beside the name on one line. */\n inline?: boolean;\n /** Wraps the name and the secondary text, breaking anywhere, instead of truncating, so a long\n * name never widens the card or list it sits in. */\n wrap?: boolean;\n className?: string;\n}\n\nexport function IdentityCell({\n name,\n secondary,\n avatar = false,\n colorSlot,\n to,\n ariaLabel,\n linkComponent,\n inline = false,\n wrap = false,\n className,\n}: IdentityCellProps) {\n const LinkImpl = linkComponent ?? DefaultLink;\n const cls = [\n 'aegis-identity-cell',\n inline ? 'aegis-identity-cell--inline' : '',\n wrap ? 'aegis-identity-cell--wrap' : '',\n className ?? '',\n ]\n .filter(Boolean)\n .join(' ');\n\n return (\n <span className={cls}>\n {avatar ? (\n <span className=\"aegis-identity-cell__avatar\" aria-hidden=\"true\">\n <Avatar name={name} size=\"sm\" colorSlot={colorSlot} />\n </span>\n ) : null}\n <span className=\"aegis-identity-cell__text\" title={name}>\n {to === undefined ? (\n <span className=\"aegis-identity-cell__name\">{name}</span>\n ) : (\n <LinkImpl\n to={to}\n className=\"aegis-identity-cell__name aegis-identity-cell__name--link\"\n aria-label={ariaLabel}\n >\n {name}\n </LinkImpl>\n )}\n {secondary ? (\n <span\n className=\"aegis-identity-cell__secondary\"\n title={typeof secondary === 'string' ? secondary : undefined}\n >\n {secondary}\n </span>\n ) : null}\n </span>\n </span>\n );\n}\n"],"names":["IdentityCell","name","secondary","avatar","colorSlot","to","ariaLabel","linkComponent","inline","wrap","className","LinkImpl","DefaultLink","cls","jsxs","jsx","Avatar"],"mappings":";;;;AAgCO,SAASA,EAAa;AAAA,EAC3B,MAAAC;AAAA,EACA,WAAAC;AAAA,EACA,QAAAC,IAAS;AAAA,EACT,WAAAC;AAAA,EACA,IAAAC;AAAA,EACA,WAAAC;AAAA,EACA,eAAAC;AAAA,EACA,QAAAC,IAAS;AAAA,EACT,MAAAC,IAAO;AAAA,EACP,WAAAC;AACF,GAAsB;AACpB,QAAMC,IAAWJ,KAAiBK,GAC5BC,IAAM;AAAA,IACV;AAAA,IACAL,IAAS,gCAAgC;AAAA,IACzCC,IAAO,8BAA8B;AAAA,IACrCC,KAAa;AAAA,EAAA,EAEZ,OAAO,OAAO,EACd,KAAK,GAAG;AAEX,SACE,gBAAAI,EAAC,QAAA,EAAK,WAAWD,GACd,UAAA;AAAA,IAAAV,IACC,gBAAAY,EAAC,QAAA,EAAK,WAAU,+BAA8B,eAAY,QACxD,UAAA,gBAAAA,EAACC,GAAA,EAAO,MAAAf,GAAY,MAAK,MAAK,WAAAG,EAAA,CAAsB,GACtD,IACE;AAAA,IACJ,gBAAAU,EAAC,QAAA,EAAK,WAAU,6BAA4B,OAAOb,GAChD,UAAA;AAAA,MAAAI,MAAO,SACN,gBAAAU,EAAC,QAAA,EAAK,WAAU,6BAA6B,aAAK,IAElD,gBAAAA;AAAA,QAACJ;AAAA,QAAA;AAAA,UACC,IAAAN;AAAA,UACA,WAAU;AAAA,UACV,cAAYC;AAAA,UAEX,UAAAL;AAAA,QAAA;AAAA,MAAA;AAAA,MAGJC,IACC,gBAAAa;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAU;AAAA,UACV,OAAO,OAAOb,KAAc,WAAWA,IAAY;AAAA,UAElD,UAAAA;AAAA,QAAA;AAAA,MAAA,IAED;AAAA,IAAA,EAAA,CACN;AAAA,EAAA,GACF;AAEJ;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),c=require("react");;/* empty css */function u({direction:n="row",children:s,className:e}){const a=["aegis-pane-layout",`aegis-pane-layout--${n}`,e??""].filter(Boolean).join(" ");return i.jsx("div",{className:a,children:s})}const r=c.forwardRef(({size:n="fill",padding:s="md",label:e,children:a,className:l},o)=>{const t=["aegis-pane",`aegis-pane--${n}`,`aegis-pane--padding-${s}`,l??""].filter(Boolean).join(" ");return e===void 0?i.jsx("div",{ref:o,className:t,children:a}):i.jsx("section",{ref:o,className:t,"aria-label":e,children:a})});r.displayName="Pane";exports.Pane=r;exports.PaneLayout=u;
|
|
2
2
|
//# sourceMappingURL=PaneLayout.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaneLayout.cjs","sources":["../../../src/components/ui/PaneLayout.tsx"],"sourcesContent":["import type
|
|
1
|
+
{"version":3,"file":"PaneLayout.cjs","sources":["../../../src/components/ui/PaneLayout.tsx"],"sourcesContent":["import { type ReactNode, type Ref, forwardRef } from 'react';\n\nimport './PaneLayout.css';\n\nexport interface PaneLayoutProps {\n /** `row` sets the panes side by side, `column` stacks them. */\n direction?: 'row' | 'column';\n /**\n * `Pane`s, or nested `PaneLayout`s set directly in place of a pane: a\n * nested layout fills its share as a pane does, and is not wrapped in one.\n */\n children: ReactNode;\n className?: string;\n}\n\n/**\n * A region filled edge to edge by panes, each divided from the next by a\n * hairline, with no gap and no card around them. It grows to fill a flex\n * parent such as a bleed `PageWrapper`; at 768 px or narrower a row stacks\n * and the whole layout scrolls as one.\n */\nexport function PaneLayout({\n direction = 'row',\n children,\n className,\n}: PaneLayoutProps) {\n const cls = [\n 'aegis-pane-layout',\n `aegis-pane-layout--${direction}`,\n className ?? '',\n ]\n .filter(Boolean)\n .join(' ');\n return <div className={cls}>{children}</div>;\n}\n\nexport interface PaneProps {\n /**\n * `fill` shares the room left by the others; `sm`, `md` and `lg` are the\n * fixed `--pane-width-*` widths of a row; `auto` takes its content's size.\n */\n size?: 'fill' | 'sm' | 'md' | 'lg' | 'auto';\n /** `md` insets the content by `--space-6` (`--space-4` at ≤768 px). */\n padding?: 'none' | 'md';\n /** Names the pane for assistive technology, making it a region. */\n label?: string;\n children: ReactNode;\n className?: string;\n}\n\n/**\n * One pane of a `PaneLayout`; it scrolls its own content. Its ref is that\n * scrolling element, so a host can pass it on as a `scrollContainer`, e.g.\n * to a `DetailBeside` in the pane, whose selected row then comes into view\n * inside the pane.\n */\nexport const Pane = forwardRef<HTMLElement, PaneProps>(\n ({ size = 'fill', padding = 'md', label, children, className }, ref) => {\n const cls = [\n 'aegis-pane',\n `aegis-pane--${size}`,\n `aegis-pane--padding-${padding}`,\n className ?? '',\n ]\n .filter(Boolean)\n .join(' ');\n return label === undefined ? (\n <div ref={ref as Ref<HTMLDivElement>} className={cls}>\n {children}\n </div>\n ) : (\n <section ref={ref} className={cls} aria-label={label}>\n {children}\n </section>\n );\n },\n);\n\nPane.displayName = 'Pane';\n"],"names":["PaneLayout","direction","children","className","cls","jsx","Pane","forwardRef","size","padding","label","ref"],"mappings":"wKAqBO,SAASA,EAAW,CACzB,UAAAC,EAAY,MACZ,SAAAC,EACA,UAAAC,CACF,EAAoB,CAClB,MAAMC,EAAM,CACV,oBACA,sBAAsBH,CAAS,GAC/BE,GAAa,EAAA,EAEZ,OAAO,OAAO,EACd,KAAK,GAAG,EACX,OAAOE,EAAAA,IAAC,MAAA,CAAI,UAAWD,EAAM,SAAAF,CAAA,CAAS,CACxC,CAsBO,MAAMI,EAAOC,EAAAA,WAClB,CAAC,CAAE,KAAAC,EAAO,OAAQ,QAAAC,EAAU,KAAM,MAAAC,EAAO,SAAAR,EAAU,UAAAC,CAAA,EAAaQ,IAAQ,CACtE,MAAMP,EAAM,CACV,aACA,eAAeI,CAAI,GACnB,uBAAuBC,CAAO,GAC9BN,GAAa,EAAA,EAEZ,OAAO,OAAO,EACd,KAAK,GAAG,EACX,OAAOO,IAAU,OACfL,MAAC,MAAA,CAAI,IAAAM,EAAiC,UAAWP,EAC9C,SAAAF,CAAA,CACH,EAEAG,MAAC,WAAQ,IAAAM,EAAU,UAAWP,EAAK,aAAYM,EAC5C,SAAAR,EACH,CAEJ,CACF,EAEAI,EAAK,YAAc"}
|
|
@@ -29,5 +29,10 @@ export interface PaneProps {
|
|
|
29
29
|
children: ReactNode;
|
|
30
30
|
className?: string;
|
|
31
31
|
}
|
|
32
|
-
/**
|
|
33
|
-
|
|
32
|
+
/**
|
|
33
|
+
* One pane of a `PaneLayout`; it scrolls its own content. Its ref is that
|
|
34
|
+
* scrolling element, so a host can pass it on as a `scrollContainer`, e.g.
|
|
35
|
+
* to a `DetailBeside` in the pane, whose selected row then comes into view
|
|
36
|
+
* inside the pane.
|
|
37
|
+
*/
|
|
38
|
+
export declare const Pane: import('react').ForwardRefExoticComponent<PaneProps & import('react').RefAttributes<HTMLElement>>;
|
|
@@ -1,34 +1,32 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as l } from "react";
|
|
2
3
|
/* empty css */
|
|
3
|
-
function
|
|
4
|
-
direction:
|
|
5
|
-
children:
|
|
4
|
+
function f({
|
|
5
|
+
direction: o = "row",
|
|
6
|
+
children: i,
|
|
6
7
|
className: a
|
|
7
8
|
}) {
|
|
8
9
|
const e = [
|
|
9
10
|
"aegis-pane-layout",
|
|
10
|
-
`aegis-pane-layout--${
|
|
11
|
+
`aegis-pane-layout--${o}`,
|
|
11
12
|
a ?? ""
|
|
12
13
|
].filter(Boolean).join(" ");
|
|
13
|
-
return /* @__PURE__ */
|
|
14
|
-
}
|
|
15
|
-
function p({
|
|
16
|
-
size: n = "fill",
|
|
17
|
-
padding: o = "md",
|
|
18
|
-
label: a,
|
|
19
|
-
children: e,
|
|
20
|
-
className: t
|
|
21
|
-
}) {
|
|
22
|
-
const s = [
|
|
23
|
-
"aegis-pane",
|
|
24
|
-
`aegis-pane--${n}`,
|
|
25
|
-
`aegis-pane--padding-${o}`,
|
|
26
|
-
t ?? ""
|
|
27
|
-
].filter(Boolean).join(" ");
|
|
28
|
-
return a === void 0 ? /* @__PURE__ */ i("div", { className: s, children: e }) : /* @__PURE__ */ i("section", { className: s, "aria-label": a, children: e });
|
|
14
|
+
return /* @__PURE__ */ n("div", { className: e, children: i });
|
|
29
15
|
}
|
|
16
|
+
const p = l(
|
|
17
|
+
({ size: o = "fill", padding: i = "md", label: a, children: e, className: r }, s) => {
|
|
18
|
+
const t = [
|
|
19
|
+
"aegis-pane",
|
|
20
|
+
`aegis-pane--${o}`,
|
|
21
|
+
`aegis-pane--padding-${i}`,
|
|
22
|
+
r ?? ""
|
|
23
|
+
].filter(Boolean).join(" ");
|
|
24
|
+
return a === void 0 ? /* @__PURE__ */ n("div", { ref: s, className: t, children: e }) : /* @__PURE__ */ n("section", { ref: s, className: t, "aria-label": a, children: e });
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
p.displayName = "Pane";
|
|
30
28
|
export {
|
|
31
29
|
p as Pane,
|
|
32
|
-
|
|
30
|
+
f as PaneLayout
|
|
33
31
|
};
|
|
34
32
|
//# sourceMappingURL=PaneLayout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaneLayout.js","sources":["../../../src/components/ui/PaneLayout.tsx"],"sourcesContent":["import type
|
|
1
|
+
{"version":3,"file":"PaneLayout.js","sources":["../../../src/components/ui/PaneLayout.tsx"],"sourcesContent":["import { type ReactNode, type Ref, forwardRef } from 'react';\n\nimport './PaneLayout.css';\n\nexport interface PaneLayoutProps {\n /** `row` sets the panes side by side, `column` stacks them. */\n direction?: 'row' | 'column';\n /**\n * `Pane`s, or nested `PaneLayout`s set directly in place of a pane: a\n * nested layout fills its share as a pane does, and is not wrapped in one.\n */\n children: ReactNode;\n className?: string;\n}\n\n/**\n * A region filled edge to edge by panes, each divided from the next by a\n * hairline, with no gap and no card around them. It grows to fill a flex\n * parent such as a bleed `PageWrapper`; at 768 px or narrower a row stacks\n * and the whole layout scrolls as one.\n */\nexport function PaneLayout({\n direction = 'row',\n children,\n className,\n}: PaneLayoutProps) {\n const cls = [\n 'aegis-pane-layout',\n `aegis-pane-layout--${direction}`,\n className ?? '',\n ]\n .filter(Boolean)\n .join(' ');\n return <div className={cls}>{children}</div>;\n}\n\nexport interface PaneProps {\n /**\n * `fill` shares the room left by the others; `sm`, `md` and `lg` are the\n * fixed `--pane-width-*` widths of a row; `auto` takes its content's size.\n */\n size?: 'fill' | 'sm' | 'md' | 'lg' | 'auto';\n /** `md` insets the content by `--space-6` (`--space-4` at ≤768 px). */\n padding?: 'none' | 'md';\n /** Names the pane for assistive technology, making it a region. */\n label?: string;\n children: ReactNode;\n className?: string;\n}\n\n/**\n * One pane of a `PaneLayout`; it scrolls its own content. Its ref is that\n * scrolling element, so a host can pass it on as a `scrollContainer`, e.g.\n * to a `DetailBeside` in the pane, whose selected row then comes into view\n * inside the pane.\n */\nexport const Pane = forwardRef<HTMLElement, PaneProps>(\n ({ size = 'fill', padding = 'md', label, children, className }, ref) => {\n const cls = [\n 'aegis-pane',\n `aegis-pane--${size}`,\n `aegis-pane--padding-${padding}`,\n className ?? '',\n ]\n .filter(Boolean)\n .join(' ');\n return label === undefined ? (\n <div ref={ref as Ref<HTMLDivElement>} className={cls}>\n {children}\n </div>\n ) : (\n <section ref={ref} className={cls} aria-label={label}>\n {children}\n </section>\n );\n },\n);\n\nPane.displayName = 'Pane';\n"],"names":["PaneLayout","direction","children","className","cls","jsx","Pane","forwardRef","size","padding","label","ref"],"mappings":";;;AAqBO,SAASA,EAAW;AAAA,EACzB,WAAAC,IAAY;AAAA,EACZ,UAAAC;AAAA,EACA,WAAAC;AACF,GAAoB;AAClB,QAAMC,IAAM;AAAA,IACV;AAAA,IACA,sBAAsBH,CAAS;AAAA,IAC/BE,KAAa;AAAA,EAAA,EAEZ,OAAO,OAAO,EACd,KAAK,GAAG;AACX,SAAO,gBAAAE,EAAC,OAAA,EAAI,WAAWD,GAAM,UAAAF,EAAA,CAAS;AACxC;AAsBO,MAAMI,IAAOC;AAAA,EAClB,CAAC,EAAE,MAAAC,IAAO,QAAQ,SAAAC,IAAU,MAAM,OAAAC,GAAO,UAAAR,GAAU,WAAAC,EAAA,GAAaQ,MAAQ;AACtE,UAAMP,IAAM;AAAA,MACV;AAAA,MACA,eAAeI,CAAI;AAAA,MACnB,uBAAuBC,CAAO;AAAA,MAC9BN,KAAa;AAAA,IAAA,EAEZ,OAAO,OAAO,EACd,KAAK,GAAG;AACX,WAAOO,MAAU,SACf,gBAAAL,EAAC,OAAA,EAAI,KAAAM,GAAiC,WAAWP,GAC9C,UAAAF,EAAA,CACH,IAEA,gBAAAG,EAAC,aAAQ,KAAAM,GAAU,WAAWP,GAAK,cAAYM,GAC5C,UAAAR,GACH;AAAA,EAEJ;AACF;AAEAI,EAAK,cAAc;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),q=require("react"),b=require("@ant-design/icons");;/* empty css */const y=require("../../locale/useStrings.cjs");function p({value:i,options:g,onChange:c,label:l,labelPlacement:h="above",ariaLabel:j,placeholder:t,allowClear:v=!1,disabled:n=!1,id:x,"aria-describedby":m,className:_}){const r=y.useStrings(),S=q.useId(),d=x??S,o=v&&i!==""&&!n,f=t!==void 0&&i==="",a=l!==void 0&&h==="inline",u=e.jsxs("label",{className:"aegis-select__label",htmlFor:d,children:[l,a&&e.jsx("span",{"aria-hidden":!0,children:r.labelSeparator})]}),N=["aegis-select",o?"aegis-select--clearable":"",f?"aegis-select--placeholder":"",a?"aegis-select--inline":"",_??""].filter(Boolean).join(" ");return e.jsxs("div",{className:N,"data-aegis-field":!0,children:[l!==void 0&&!a&&u,e.jsxs("div",{className:"aegis-select__control",children:[a&&u,e.jsxs("select",{className:"aegis-select__native",id:d,value:i,disabled:n,"aria-label":j,"aria-describedby":m,onChange:s=>{c(s.target.value)},children:[t!==void 0&&e.jsx("option",{value:"",disabled:!0,children:t}),g.map(s=>e.jsx("option",{value:s.value,disabled:s.disabled,children:s.label},s.value))]}),e.jsx(b.DownOutlined,{className:"aegis-select__chevron","aria-hidden":!0}),o&&e.jsx("button",{type:"button",className:"aegis-select__clear","aria-label":r.clearSelection,onClick:()=>{c("")},children:e.jsx(b.CloseOutlined,{"aria-hidden":!0})})]})]})}exports.Select=p;
|
|
2
2
|
//# sourceMappingURL=Select.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.cjs","sources":["../../../src/components/ui/Select.tsx"],"sourcesContent":["import { type ReactNode, useId } from 'react';\n\nimport { CloseOutlined, DownOutlined } from '@ant-design/icons';\n\nimport { useStrings } from '../../locale';\nimport './Select.css';\n\nexport interface SelectOption {\n value: string;\n label: string;\n disabled?: boolean;\n}\n\ninterface SelectProps {\n value: string;\n options: SelectOption[];\n onChange: (value: string) => void;\n /** Caption
|
|
1
|
+
{"version":3,"file":"Select.cjs","sources":["../../../src/components/ui/Select.tsx"],"sourcesContent":["import { type ReactNode, useId } from 'react';\n\nimport { CloseOutlined, DownOutlined } from '@ant-design/icons';\n\nimport { useStrings } from '../../locale';\nimport './Select.css';\n\nexport interface SelectOption {\n value: string;\n label: string;\n disabled?: boolean;\n}\n\ninterface SelectProps {\n value: string;\n options: SelectOption[];\n onChange: (value: string) => void;\n /** Caption of the control, as its `<label>`, so it names the select. */\n label?: ReactNode;\n /**\n * `above` (default) sets the caption over the control. `inline` sets it\n * inside the control before the value, followed by the locale's label\n * separator (\"Run: e3b0aa32\"), for a compact selector in a bar.\n */\n labelPlacement?: 'above' | 'inline';\n /** Accessible name for a select shown without a visible caption, e.g. a compact filter. */\n ariaLabel?: string;\n /** Rendered as a disabled first option when `value` is empty. */\n placeholder?: string;\n /** Shows a clear control once a value is set. */\n allowClear?: boolean;\n disabled?: boolean;\n /** Lets a caller's `<label htmlFor>` point at the control. */\n id?: string;\n /** Ids of the text that describes the select, such as a FormRow's description. */\n 'aria-describedby'?: string;\n className?: string;\n}\n\nexport function Select({\n value,\n options,\n onChange,\n label,\n labelPlacement = 'above',\n ariaLabel,\n placeholder,\n allowClear = false,\n disabled = false,\n id,\n 'aria-describedby': describedBy,\n className,\n}: SelectProps) {\n const strings = useStrings();\n const ownId = useId();\n const selectId = id ?? ownId;\n const clearable = allowClear && value !== '' && !disabled;\n const showsPlaceholder = placeholder !== undefined && value === '';\n const inline = label !== undefined && labelPlacement === 'inline';\n const caption = (\n <label className=\"aegis-select__label\" htmlFor={selectId}>\n {label}\n {inline && <span aria-hidden>{strings.labelSeparator}</span>}\n </label>\n );\n const cls = [\n 'aegis-select',\n clearable ? 'aegis-select--clearable' : '',\n showsPlaceholder ? 'aegis-select--placeholder' : '',\n inline ? 'aegis-select--inline' : '',\n className ?? '',\n ]\n .filter(Boolean)\n .join(' ');\n return (\n <div className={cls} data-aegis-field>\n {label !== undefined && !inline && caption}\n <div className=\"aegis-select__control\">\n {inline && caption}\n <select\n className=\"aegis-select__native\"\n id={selectId}\n value={value}\n disabled={disabled}\n aria-label={ariaLabel}\n aria-describedby={describedBy}\n onChange={(event) => {\n onChange(event.target.value);\n }}\n >\n {placeholder !== undefined && (\n <option value=\"\" disabled>\n {placeholder}\n </option>\n )}\n {options.map((option) => (\n <option\n key={option.value}\n value={option.value}\n disabled={option.disabled}\n >\n {option.label}\n </option>\n ))}\n </select>\n <DownOutlined className=\"aegis-select__chevron\" aria-hidden />\n {clearable && (\n <button\n type=\"button\"\n className=\"aegis-select__clear\"\n aria-label={strings.clearSelection}\n onClick={() => {\n onChange('');\n }}\n >\n <CloseOutlined aria-hidden />\n </button>\n )}\n </div>\n </div>\n );\n}\n"],"names":["Select","value","options","onChange","label","labelPlacement","ariaLabel","placeholder","allowClear","disabled","id","describedBy","className","strings","useStrings","ownId","useId","selectId","clearable","showsPlaceholder","inline","caption","jsxs","jsx","cls","event","option","DownOutlined","CloseOutlined"],"mappings":"kPAuCO,SAASA,EAAO,CACrB,MAAAC,EACA,QAAAC,EACA,SAAAC,EACA,MAAAC,EACA,eAAAC,EAAiB,QACjB,UAAAC,EACA,YAAAC,EACA,WAAAC,EAAa,GACb,SAAAC,EAAW,GACX,GAAAC,EACA,mBAAoBC,EACpB,UAAAC,CACF,EAAgB,CACd,MAAMC,EAAUC,EAAAA,WAAA,EACVC,EAAQC,EAAAA,MAAA,EACRC,EAAWP,GAAMK,EACjBG,EAAYV,GAAcP,IAAU,IAAM,CAACQ,EAC3CU,EAAmBZ,IAAgB,QAAaN,IAAU,GAC1DmB,EAAShB,IAAU,QAAaC,IAAmB,SACnDgB,EACJC,EAAAA,KAAC,QAAA,CAAM,UAAU,sBAAsB,QAASL,EAC7C,SAAA,CAAAb,EACAgB,GAAUG,EAAAA,IAAC,OAAA,CAAK,cAAW,GAAE,WAAQ,cAAA,CAAe,CAAA,EACvD,EAEIC,EAAM,CACV,eACAN,EAAY,0BAA4B,GACxCC,EAAmB,4BAA8B,GACjDC,EAAS,uBAAyB,GAClCR,GAAa,EAAA,EAEZ,OAAO,OAAO,EACd,KAAK,GAAG,EACX,OACEU,EAAAA,KAAC,MAAA,CAAI,UAAWE,EAAK,mBAAgB,GAClC,SAAA,CAAApB,IAAU,QAAa,CAACgB,GAAUC,EACnCC,EAAAA,KAAC,MAAA,CAAI,UAAU,wBACZ,SAAA,CAAAF,GAAUC,EACXC,EAAAA,KAAC,SAAA,CACC,UAAU,uBACV,GAAIL,EACJ,MAAAhB,EACA,SAAAQ,EACA,aAAYH,EACZ,mBAAkBK,EAClB,SAAWc,GAAU,CACnBtB,EAASsB,EAAM,OAAO,KAAK,CAC7B,EAEC,SAAA,CAAAlB,IAAgB,QACfgB,MAAC,SAAA,CAAO,MAAM,GAAG,SAAQ,GACtB,SAAAhB,CAAA,CACH,EAEDL,EAAQ,IAAKwB,GACZH,EAAAA,IAAC,SAAA,CAEC,MAAOG,EAAO,MACd,SAAUA,EAAO,SAEhB,SAAAA,EAAO,KAAA,EAJHA,EAAO,KAAA,CAMf,CAAA,CAAA,CAAA,EAEHH,EAAAA,IAACI,EAAAA,aAAA,CAAa,UAAU,wBAAwB,cAAW,GAAC,EAC3DT,GACCK,EAAAA,IAAC,SAAA,CACC,KAAK,SACL,UAAU,sBACV,aAAYV,EAAQ,eACpB,QAAS,IAAM,CACbV,EAAS,EAAE,CACb,EAEA,SAAAoB,EAAAA,IAACK,EAAAA,cAAA,CAAc,cAAW,EAAA,CAAC,CAAA,CAAA,CAC7B,CAAA,CAEJ,CAAA,EACF,CAEJ"}
|
|
@@ -8,8 +8,14 @@ interface SelectProps {
|
|
|
8
8
|
value: string;
|
|
9
9
|
options: SelectOption[];
|
|
10
10
|
onChange: (value: string) => void;
|
|
11
|
-
/** Caption
|
|
11
|
+
/** Caption of the control, as its `<label>`, so it names the select. */
|
|
12
12
|
label?: ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* `above` (default) sets the caption over the control. `inline` sets it
|
|
15
|
+
* inside the control before the value, followed by the locale's label
|
|
16
|
+
* separator ("Run: e3b0aa32"), for a compact selector in a bar.
|
|
17
|
+
*/
|
|
18
|
+
labelPlacement?: 'above' | 'inline';
|
|
13
19
|
/** Accessible name for a select shown without a visible caption, e.g. a compact filter. */
|
|
14
20
|
ariaLabel?: string;
|
|
15
21
|
/** Rendered as a disabled first option when `value` is empty. */
|
|
@@ -23,5 +29,5 @@ interface SelectProps {
|
|
|
23
29
|
'aria-describedby'?: string;
|
|
24
30
|
className?: string;
|
|
25
31
|
}
|
|
26
|
-
export declare function Select({ value, options, onChange, label, ariaLabel, placeholder, allowClear, disabled, id, 'aria-describedby': describedBy, className, }: SelectProps): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
export declare function Select({ value, options, onChange, label, labelPlacement, ariaLabel, placeholder, allowClear, disabled, id, 'aria-describedby': describedBy, className, }: SelectProps): import("react/jsx-runtime").JSX.Element;
|
|
27
33
|
export {};
|
|
@@ -1,45 +1,51 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useId as
|
|
3
|
-
import { DownOutlined as
|
|
1
|
+
import { jsxs as l, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { useId as w } from "react";
|
|
3
|
+
import { DownOutlined as x, CloseOutlined as y } from "@ant-design/icons";
|
|
4
4
|
/* empty css */
|
|
5
|
-
import { useStrings as
|
|
6
|
-
function
|
|
7
|
-
value:
|
|
8
|
-
options:
|
|
9
|
-
onChange:
|
|
10
|
-
label:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
5
|
+
import { useStrings as I } from "../../locale/useStrings.js";
|
|
6
|
+
function F({
|
|
7
|
+
value: s,
|
|
8
|
+
options: b,
|
|
9
|
+
onChange: r,
|
|
10
|
+
label: t,
|
|
11
|
+
labelPlacement: h = "above",
|
|
12
|
+
ariaLabel: g,
|
|
13
|
+
placeholder: c,
|
|
14
|
+
allowClear: v = !1,
|
|
15
|
+
disabled: n = !1,
|
|
16
|
+
id: _,
|
|
17
|
+
"aria-describedby": f,
|
|
18
|
+
className: p
|
|
18
19
|
}) {
|
|
19
|
-
const
|
|
20
|
+
const o = I(), N = w(), d = _ ?? N, m = v && s !== "" && !n, S = c !== void 0 && s === "", i = t !== void 0 && h === "inline", u = /* @__PURE__ */ l("label", { className: "aegis-select__label", htmlFor: d, children: [
|
|
21
|
+
t,
|
|
22
|
+
i && /* @__PURE__ */ a("span", { "aria-hidden": !0, children: o.labelSeparator })
|
|
23
|
+
] }), j = [
|
|
20
24
|
"aegis-select",
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
25
|
+
m ? "aegis-select--clearable" : "",
|
|
26
|
+
S ? "aegis-select--placeholder" : "",
|
|
27
|
+
i ? "aegis-select--inline" : "",
|
|
28
|
+
p ?? ""
|
|
24
29
|
].filter(Boolean).join(" ");
|
|
25
|
-
return /* @__PURE__ */
|
|
26
|
-
|
|
27
|
-
/* @__PURE__ */
|
|
28
|
-
|
|
30
|
+
return /* @__PURE__ */ l("div", { className: j, "data-aegis-field": !0, children: [
|
|
31
|
+
t !== void 0 && !i && u,
|
|
32
|
+
/* @__PURE__ */ l("div", { className: "aegis-select__control", children: [
|
|
33
|
+
i && u,
|
|
34
|
+
/* @__PURE__ */ l(
|
|
29
35
|
"select",
|
|
30
36
|
{
|
|
31
37
|
className: "aegis-select__native",
|
|
32
|
-
id:
|
|
33
|
-
value:
|
|
34
|
-
disabled:
|
|
35
|
-
"aria-label":
|
|
36
|
-
"aria-describedby":
|
|
38
|
+
id: d,
|
|
39
|
+
value: s,
|
|
40
|
+
disabled: n,
|
|
41
|
+
"aria-label": g,
|
|
42
|
+
"aria-describedby": f,
|
|
37
43
|
onChange: (e) => {
|
|
38
|
-
|
|
44
|
+
r(e.target.value);
|
|
39
45
|
},
|
|
40
46
|
children: [
|
|
41
|
-
|
|
42
|
-
|
|
47
|
+
c !== void 0 && /* @__PURE__ */ a("option", { value: "", disabled: !0, children: c }),
|
|
48
|
+
b.map((e) => /* @__PURE__ */ a(
|
|
43
49
|
"option",
|
|
44
50
|
{
|
|
45
51
|
value: e.value,
|
|
@@ -51,23 +57,23 @@ function P({
|
|
|
51
57
|
]
|
|
52
58
|
}
|
|
53
59
|
),
|
|
54
|
-
/* @__PURE__ */
|
|
55
|
-
|
|
60
|
+
/* @__PURE__ */ a(x, { className: "aegis-select__chevron", "aria-hidden": !0 }),
|
|
61
|
+
m && /* @__PURE__ */ a(
|
|
56
62
|
"button",
|
|
57
63
|
{
|
|
58
64
|
type: "button",
|
|
59
65
|
className: "aegis-select__clear",
|
|
60
|
-
"aria-label":
|
|
66
|
+
"aria-label": o.clearSelection,
|
|
61
67
|
onClick: () => {
|
|
62
|
-
|
|
68
|
+
r("");
|
|
63
69
|
},
|
|
64
|
-
children: /* @__PURE__ */
|
|
70
|
+
children: /* @__PURE__ */ a(y, { "aria-hidden": !0 })
|
|
65
71
|
}
|
|
66
72
|
)
|
|
67
73
|
] })
|
|
68
74
|
] });
|
|
69
75
|
}
|
|
70
76
|
export {
|
|
71
|
-
|
|
77
|
+
F as Select
|
|
72
78
|
};
|
|
73
79
|
//# sourceMappingURL=Select.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.js","sources":["../../../src/components/ui/Select.tsx"],"sourcesContent":["import { type ReactNode, useId } from 'react';\n\nimport { CloseOutlined, DownOutlined } from '@ant-design/icons';\n\nimport { useStrings } from '../../locale';\nimport './Select.css';\n\nexport interface SelectOption {\n value: string;\n label: string;\n disabled?: boolean;\n}\n\ninterface SelectProps {\n value: string;\n options: SelectOption[];\n onChange: (value: string) => void;\n /** Caption
|
|
1
|
+
{"version":3,"file":"Select.js","sources":["../../../src/components/ui/Select.tsx"],"sourcesContent":["import { type ReactNode, useId } from 'react';\n\nimport { CloseOutlined, DownOutlined } from '@ant-design/icons';\n\nimport { useStrings } from '../../locale';\nimport './Select.css';\n\nexport interface SelectOption {\n value: string;\n label: string;\n disabled?: boolean;\n}\n\ninterface SelectProps {\n value: string;\n options: SelectOption[];\n onChange: (value: string) => void;\n /** Caption of the control, as its `<label>`, so it names the select. */\n label?: ReactNode;\n /**\n * `above` (default) sets the caption over the control. `inline` sets it\n * inside the control before the value, followed by the locale's label\n * separator (\"Run: e3b0aa32\"), for a compact selector in a bar.\n */\n labelPlacement?: 'above' | 'inline';\n /** Accessible name for a select shown without a visible caption, e.g. a compact filter. */\n ariaLabel?: string;\n /** Rendered as a disabled first option when `value` is empty. */\n placeholder?: string;\n /** Shows a clear control once a value is set. */\n allowClear?: boolean;\n disabled?: boolean;\n /** Lets a caller's `<label htmlFor>` point at the control. */\n id?: string;\n /** Ids of the text that describes the select, such as a FormRow's description. */\n 'aria-describedby'?: string;\n className?: string;\n}\n\nexport function Select({\n value,\n options,\n onChange,\n label,\n labelPlacement = 'above',\n ariaLabel,\n placeholder,\n allowClear = false,\n disabled = false,\n id,\n 'aria-describedby': describedBy,\n className,\n}: SelectProps) {\n const strings = useStrings();\n const ownId = useId();\n const selectId = id ?? ownId;\n const clearable = allowClear && value !== '' && !disabled;\n const showsPlaceholder = placeholder !== undefined && value === '';\n const inline = label !== undefined && labelPlacement === 'inline';\n const caption = (\n <label className=\"aegis-select__label\" htmlFor={selectId}>\n {label}\n {inline && <span aria-hidden>{strings.labelSeparator}</span>}\n </label>\n );\n const cls = [\n 'aegis-select',\n clearable ? 'aegis-select--clearable' : '',\n showsPlaceholder ? 'aegis-select--placeholder' : '',\n inline ? 'aegis-select--inline' : '',\n className ?? '',\n ]\n .filter(Boolean)\n .join(' ');\n return (\n <div className={cls} data-aegis-field>\n {label !== undefined && !inline && caption}\n <div className=\"aegis-select__control\">\n {inline && caption}\n <select\n className=\"aegis-select__native\"\n id={selectId}\n value={value}\n disabled={disabled}\n aria-label={ariaLabel}\n aria-describedby={describedBy}\n onChange={(event) => {\n onChange(event.target.value);\n }}\n >\n {placeholder !== undefined && (\n <option value=\"\" disabled>\n {placeholder}\n </option>\n )}\n {options.map((option) => (\n <option\n key={option.value}\n value={option.value}\n disabled={option.disabled}\n >\n {option.label}\n </option>\n ))}\n </select>\n <DownOutlined className=\"aegis-select__chevron\" aria-hidden />\n {clearable && (\n <button\n type=\"button\"\n className=\"aegis-select__clear\"\n aria-label={strings.clearSelection}\n onClick={() => {\n onChange('');\n }}\n >\n <CloseOutlined aria-hidden />\n </button>\n )}\n </div>\n </div>\n );\n}\n"],"names":["Select","value","options","onChange","label","labelPlacement","ariaLabel","placeholder","allowClear","disabled","id","describedBy","className","strings","useStrings","ownId","useId","selectId","clearable","showsPlaceholder","inline","caption","jsxs","jsx","cls","event","option","DownOutlined","CloseOutlined"],"mappings":";;;;;AAuCO,SAASA,EAAO;AAAA,EACrB,OAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,gBAAAC,IAAiB;AAAA,EACjB,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,YAAAC,IAAa;AAAA,EACb,UAAAC,IAAW;AAAA,EACX,IAAAC;AAAA,EACA,oBAAoBC;AAAA,EACpB,WAAAC;AACF,GAAgB;AACd,QAAMC,IAAUC,EAAA,GACVC,IAAQC,EAAA,GACRC,IAAWP,KAAMK,GACjBG,IAAYV,KAAcP,MAAU,MAAM,CAACQ,GAC3CU,IAAmBZ,MAAgB,UAAaN,MAAU,IAC1DmB,IAAShB,MAAU,UAAaC,MAAmB,UACnDgB,IACJ,gBAAAC,EAAC,SAAA,EAAM,WAAU,uBAAsB,SAASL,GAC7C,UAAA;AAAA,IAAAb;AAAA,IACAgB,KAAU,gBAAAG,EAAC,QAAA,EAAK,eAAW,IAAE,YAAQ,eAAA,CAAe;AAAA,EAAA,GACvD,GAEIC,IAAM;AAAA,IACV;AAAA,IACAN,IAAY,4BAA4B;AAAA,IACxCC,IAAmB,8BAA8B;AAAA,IACjDC,IAAS,yBAAyB;AAAA,IAClCR,KAAa;AAAA,EAAA,EAEZ,OAAO,OAAO,EACd,KAAK,GAAG;AACX,SACE,gBAAAU,EAAC,OAAA,EAAI,WAAWE,GAAK,oBAAgB,IAClC,UAAA;AAAA,IAAApB,MAAU,UAAa,CAACgB,KAAUC;AAAA,IACnC,gBAAAC,EAAC,OAAA,EAAI,WAAU,yBACZ,UAAA;AAAA,MAAAF,KAAUC;AAAA,MACX,gBAAAC;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAU;AAAA,UACV,IAAIL;AAAA,UACJ,OAAAhB;AAAA,UACA,UAAAQ;AAAA,UACA,cAAYH;AAAA,UACZ,oBAAkBK;AAAA,UAClB,UAAU,CAACc,MAAU;AACnB,YAAAtB,EAASsB,EAAM,OAAO,KAAK;AAAA,UAC7B;AAAA,UAEC,UAAA;AAAA,YAAAlB,MAAgB,UACf,gBAAAgB,EAAC,UAAA,EAAO,OAAM,IAAG,UAAQ,IACtB,UAAAhB,EAAA,CACH;AAAA,YAEDL,EAAQ,IAAI,CAACwB,MACZ,gBAAAH;AAAA,cAAC;AAAA,cAAA;AAAA,gBAEC,OAAOG,EAAO;AAAA,gBACd,UAAUA,EAAO;AAAA,gBAEhB,UAAAA,EAAO;AAAA,cAAA;AAAA,cAJHA,EAAO;AAAA,YAAA,CAMf;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,MAEH,gBAAAH,EAACI,GAAA,EAAa,WAAU,yBAAwB,eAAW,IAAC;AAAA,MAC3DT,KACC,gBAAAK;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,WAAU;AAAA,UACV,cAAYV,EAAQ;AAAA,UACpB,SAAS,MAAM;AACb,YAAAV,EAAS,EAAE;AAAA,UACb;AAAA,UAEA,UAAA,gBAAAoB,EAACK,GAAA,EAAc,eAAW,GAAA,CAAC;AAAA,QAAA;AAAA,MAAA;AAAA,IAC7B,EAAA,CAEJ;AAAA,EAAA,GACF;AAEJ;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),o=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),o=require("react"),C=require("../../lib/format.cjs");;/* empty css */const p=require("./relativeTime.cjs"),y=require("../../locale/useStrings.cjs"),n=t=>String(t).padStart(2,"0");function w(t){const e=Math.floor(t/1e3);return`${String(Math.floor(e/3600))}:${n(Math.floor(e/60)%60)}:${n(e%60)}`}function $(t){return`${String(t.getUTCFullYear())}-${n(t.getUTCMonth()+1)}-${n(t.getUTCDate())} ${n(t.getUTCHours())}:${n(t.getUTCMinutes())}:${n(t.getUTCSeconds())}`}function S(t,e){const i=`${n(t.getUTCHours())}:${n(t.getUTCMinutes())}`;return t.getUTCFullYear()===e.getUTCFullYear()&&t.getUTCMonth()===e.getUTCMonth()&&t.getUTCDate()===e.getUTCDate()?i:`${n(t.getUTCMonth()+1)}-${n(t.getUTCDate())} ${i}`}function m(t){const e=new Date,i=t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate(),a=`${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}`;return i?a:`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())} ${a}`}function b({value:t,mode:e="absolute",refreshMs:i=6e4,now:a,className:U}){const g=y.useStrings(),r=o.useMemo(()=>{if(t==null||t==="")return null;const l=t instanceof Date?t:new Date(t);return Number.isNaN(l.getTime())?null:l},[t]),[f,h]=o.useState(()=>Date.now());o.useEffect(()=>{if(e!=="relative")return;const l=window.setInterval(()=>{h(Date.now())},i);return()=>{window.clearInterval(l)}},[e,i]);const s=typeof t=="number"?t:r?.getTime(),u=s!==void 0&&Number.isFinite(s),T=o.useMemo(()=>e==="duration"?u?C.formatDuration(s):null:e==="hms"?u?w(s):null:r===null?null:e==="relative"?p.relativeTime(r,g,f):e==="utc"?$(r):e==="utc-day"?S(r,new Date(a??Date.now())):m(r),[r,e,s,u,f,a,g]),M=o.useMemo(()=>{if(e==="duration"||e==="hms")return u?`${String(s)} ms`:void 0;if(!(e==="absolute"||e==="utc"||r===null))return e==="utc-day"?$(r):m(r)},[r,e,s,u]),D=["aegis-time-display",U??""].filter(Boolean).join(" ");return T===null?c.jsxs("span",{className:D,children:[c.jsx("span",{"aria-hidden":"true",children:"—"}),c.jsx("span",{className:"aegis-time-display__no-value",children:g.noValue})]}):c.jsx("span",{className:D,title:M,children:T})}exports.TimeDisplay=b;
|
|
2
2
|
//# sourceMappingURL=TimeDisplay.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimeDisplay.cjs","sources":["../../../src/components/ui/TimeDisplay.tsx"],"sourcesContent":["import { useEffect, useMemo, useState } from 'react';\n\nimport { formatDuration } from '../../lib/format';\nimport { useStrings } from '../../locale';\nimport './TimeDisplay.css';\nimport { relativeTime } from './relativeTime';\n\ninterface TimeDisplayProps {\n /**\n * ISO string, timestamp ms, or Date object. An empty or unreadable value\n * shows an em dash, read out as the locale's `noValue`.\n */\n value: string | number | Date | null | undefined;\n /**\n * 'absolute' = full timestamp, 'relative' = \"2m ago\" with the timestamp as\n * its tooltip, 'duration' = elapsed time with the exact milliseconds as its\n * tooltip, 'utc' = `YYYY-MM-DD HH:MM:SS` in UTC, the same text in every\n * time zone and on every day, 'hms' = elapsed time as `H:MM:SS` in whole\n * seconds, the hours neither padded nor capped (`0:00:05`, `27:03:09`),\n * with the exact milliseconds as its tooltip.\n */\n mode?: 'absolute' | 'relative' | 'duration' | 'utc' | 'hms';\n /** For relative mode: refresh interval in ms (default 60 000). */\n refreshMs?: number;\n className?: string;\n}\n\nconst pad = (n: number): string => String(n).padStart(2, '0');\n\nfunction formatHms(ms: number): string {\n const seconds = Math.floor(ms / 1000);\n return `${String(Math.floor(seconds / 3600))}:${pad(Math.floor(seconds / 60) % 60)}:${pad(seconds % 60)}`;\n}\n\nfunction formatUtc(d: Date): string {\n return `${String(d.getUTCFullYear())}-${pad(d.getUTCMonth() + 1)}-${pad(d.getUTCDate())} ${pad(d.getUTCHours())}:${pad(d.getUTCMinutes())}:${pad(d.getUTCSeconds())}`;\n}\n\nfunction formatAbsolute(d: Date): string {\n const now = new Date();\n const sameDay =\n d.getFullYear() === now.getFullYear() &&\n d.getMonth() === now.getMonth() &&\n d.getDate() === now.getDate();\n\n const time = `${pad(d.getHours())}:${pad(d.getMinutes())}:${pad(d.getSeconds())}`;\n\n if (sameDay) {\n return time;\n }\n return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())} ${time}`;\n}\n\nexport function TimeDisplay({\n value,\n mode = 'absolute',\n refreshMs = 60_000,\n className,\n}: TimeDisplayProps) {\n const strings = useStrings();\n const d = useMemo(() => {\n if (value === null || value === undefined || value === '') {\n return null;\n }\n const date = value instanceof Date ? value : new Date(value);\n return Number.isNaN(date.getTime()) ? null : date;\n }, [value]);\n\n const [now, setNow] = useState(() => Date.now());\n useEffect(() => {\n if (mode !== 'relative') {\n return;\n }\n const id = window.setInterval(() => {\n setNow(Date.now());\n }, refreshMs);\n return () => {\n window.clearInterval(id);\n };\n }, [mode, refreshMs]);\n\n const durationMs = typeof value === 'number' ? value : d?.getTime();\n const hasDuration = durationMs !== undefined && Number.isFinite(durationMs);\n\n const display = useMemo(() => {\n if (mode === 'duration') {\n return hasDuration ? formatDuration(durationMs) : null;\n }\n if (mode === 'hms') {\n return hasDuration ? formatHms(durationMs) : null;\n }\n if (d === null) {\n return null;\n }\n if (mode === 'relative') {\n return relativeTime(d, strings, now);\n }\n if (mode === 'utc') {\n return formatUtc(d);\n }\n return formatAbsolute(d);\n }, [d, mode, durationMs, hasDuration, now, strings]);\n\n const tooltip = useMemo(() => {\n if (mode === 'duration' || mode === 'hms') {\n return hasDuration ? `${String(durationMs)} ms` : undefined;\n }\n if (mode === 'absolute' || mode === 'utc' || d === null) {\n return undefined;\n }\n return formatAbsolute(d);\n }, [d, mode, durationMs, hasDuration]);\n\n const cls = ['aegis-time-display', className ?? ''].filter(Boolean).join(' ');\n\n if (display === null) {\n return (\n <span className={cls}>\n <span aria-hidden=\"true\">—</span>\n <span className=\"aegis-time-display__no-value\">{strings.noValue}</span>\n </span>\n );\n }\n\n return (\n <span className={cls} title={tooltip}>\n {display}\n </span>\n );\n}\n"],"names":["pad","n","formatHms","ms","seconds","formatUtc","d","
|
|
1
|
+
{"version":3,"file":"TimeDisplay.cjs","sources":["../../../src/components/ui/TimeDisplay.tsx"],"sourcesContent":["import { useEffect, useMemo, useState } from 'react';\n\nimport { formatDuration } from '../../lib/format';\nimport { useStrings } from '../../locale';\nimport './TimeDisplay.css';\nimport { relativeTime } from './relativeTime';\n\ninterface TimeDisplayProps {\n /**\n * ISO string, timestamp ms, or Date object. An empty or unreadable value\n * shows an em dash, read out as the locale's `noValue`.\n */\n value: string | number | Date | null | undefined;\n /**\n * 'absolute' = full timestamp, 'relative' = \"2m ago\" with the timestamp as\n * its tooltip, 'duration' = elapsed time with the exact milliseconds as its\n * tooltip, 'utc' = `YYYY-MM-DD HH:MM:SS` in UTC, the same text in every\n * time zone and on every day, 'hms' = elapsed time as `H:MM:SS` in whole\n * seconds, the hours neither padded nor capped (`0:00:05`, `27:03:09`),\n * with the exact milliseconds as its tooltip, 'utc-day' = `HH:MM` in UTC\n * when the moment falls on the same UTC day as `now`, else `MM-DD HH:MM`,\n * with the `utc` text as its tooltip.\n */\n mode?: 'absolute' | 'relative' | 'duration' | 'utc' | 'hms' | 'utc-day';\n /** For relative mode: refresh interval in ms (default 60 000). */\n refreshMs?: number;\n /**\n * For utc-day mode: the moment whose UTC day counts as today, from the\n * host's clock (ISO string, timestamp ms or Date). Defaults to the\n * browser's clock at render.\n */\n now?: string | number | Date;\n className?: string;\n}\n\nconst pad = (n: number): string => String(n).padStart(2, '0');\n\nfunction formatHms(ms: number): string {\n const seconds = Math.floor(ms / 1000);\n return `${String(Math.floor(seconds / 3600))}:${pad(Math.floor(seconds / 60) % 60)}:${pad(seconds % 60)}`;\n}\n\nfunction formatUtc(d: Date): string {\n return `${String(d.getUTCFullYear())}-${pad(d.getUTCMonth() + 1)}-${pad(d.getUTCDate())} ${pad(d.getUTCHours())}:${pad(d.getUTCMinutes())}:${pad(d.getUTCSeconds())}`;\n}\n\nfunction formatUtcDay(d: Date, now: Date): string {\n const time = `${pad(d.getUTCHours())}:${pad(d.getUTCMinutes())}`;\n const sameDay =\n d.getUTCFullYear() === now.getUTCFullYear() &&\n d.getUTCMonth() === now.getUTCMonth() &&\n d.getUTCDate() === now.getUTCDate();\n return sameDay\n ? time\n : `${pad(d.getUTCMonth() + 1)}-${pad(d.getUTCDate())} ${time}`;\n}\n\nfunction formatAbsolute(d: Date): string {\n const now = new Date();\n const sameDay =\n d.getFullYear() === now.getFullYear() &&\n d.getMonth() === now.getMonth() &&\n d.getDate() === now.getDate();\n\n const time = `${pad(d.getHours())}:${pad(d.getMinutes())}:${pad(d.getSeconds())}`;\n\n if (sameDay) {\n return time;\n }\n return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())} ${time}`;\n}\n\nexport function TimeDisplay({\n value,\n mode = 'absolute',\n refreshMs = 60_000,\n now: today,\n className,\n}: TimeDisplayProps) {\n const strings = useStrings();\n const d = useMemo(() => {\n if (value === null || value === undefined || value === '') {\n return null;\n }\n const date = value instanceof Date ? value : new Date(value);\n return Number.isNaN(date.getTime()) ? null : date;\n }, [value]);\n\n const [now, setNow] = useState(() => Date.now());\n useEffect(() => {\n if (mode !== 'relative') {\n return;\n }\n const id = window.setInterval(() => {\n setNow(Date.now());\n }, refreshMs);\n return () => {\n window.clearInterval(id);\n };\n }, [mode, refreshMs]);\n\n const durationMs = typeof value === 'number' ? value : d?.getTime();\n const hasDuration = durationMs !== undefined && Number.isFinite(durationMs);\n\n const display = useMemo(() => {\n if (mode === 'duration') {\n return hasDuration ? formatDuration(durationMs) : null;\n }\n if (mode === 'hms') {\n return hasDuration ? formatHms(durationMs) : null;\n }\n if (d === null) {\n return null;\n }\n if (mode === 'relative') {\n return relativeTime(d, strings, now);\n }\n if (mode === 'utc') {\n return formatUtc(d);\n }\n if (mode === 'utc-day') {\n return formatUtcDay(d, new Date(today ?? Date.now()));\n }\n return formatAbsolute(d);\n }, [d, mode, durationMs, hasDuration, now, today, strings]);\n\n const tooltip = useMemo(() => {\n if (mode === 'duration' || mode === 'hms') {\n return hasDuration ? `${String(durationMs)} ms` : undefined;\n }\n if (mode === 'absolute' || mode === 'utc' || d === null) {\n return undefined;\n }\n if (mode === 'utc-day') {\n return formatUtc(d);\n }\n return formatAbsolute(d);\n }, [d, mode, durationMs, hasDuration]);\n\n const cls = ['aegis-time-display', className ?? ''].filter(Boolean).join(' ');\n\n if (display === null) {\n return (\n <span className={cls}>\n <span aria-hidden=\"true\">—</span>\n <span className=\"aegis-time-display__no-value\">{strings.noValue}</span>\n </span>\n );\n }\n\n return (\n <span className={cls} title={tooltip}>\n {display}\n </span>\n );\n}\n"],"names":["pad","n","formatHms","ms","seconds","formatUtc","d","formatUtcDay","now","time","formatAbsolute","sameDay","TimeDisplay","value","mode","refreshMs","today","className","strings","useStrings","useMemo","date","setNow","useState","useEffect","id","durationMs","hasDuration","display","formatDuration","relativeTime","tooltip","cls","jsxs","jsx"],"mappings":"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"}
|
|
@@ -10,12 +10,20 @@ interface TimeDisplayProps {
|
|
|
10
10
|
* tooltip, 'utc' = `YYYY-MM-DD HH:MM:SS` in UTC, the same text in every
|
|
11
11
|
* time zone and on every day, 'hms' = elapsed time as `H:MM:SS` in whole
|
|
12
12
|
* seconds, the hours neither padded nor capped (`0:00:05`, `27:03:09`),
|
|
13
|
-
* with the exact milliseconds as its tooltip
|
|
13
|
+
* with the exact milliseconds as its tooltip, 'utc-day' = `HH:MM` in UTC
|
|
14
|
+
* when the moment falls on the same UTC day as `now`, else `MM-DD HH:MM`,
|
|
15
|
+
* with the `utc` text as its tooltip.
|
|
14
16
|
*/
|
|
15
|
-
mode?: 'absolute' | 'relative' | 'duration' | 'utc' | 'hms';
|
|
17
|
+
mode?: 'absolute' | 'relative' | 'duration' | 'utc' | 'hms' | 'utc-day';
|
|
16
18
|
/** For relative mode: refresh interval in ms (default 60 000). */
|
|
17
19
|
refreshMs?: number;
|
|
20
|
+
/**
|
|
21
|
+
* For utc-day mode: the moment whose UTC day counts as today, from the
|
|
22
|
+
* host's clock (ISO string, timestamp ms or Date). Defaults to the
|
|
23
|
+
* browser's clock at render.
|
|
24
|
+
*/
|
|
25
|
+
now?: string | number | Date;
|
|
18
26
|
className?: string;
|
|
19
27
|
}
|
|
20
|
-
export declare function TimeDisplay({ value, mode, refreshMs, className, }: TimeDisplayProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export declare function TimeDisplay({ value, mode, refreshMs, now: today, className, }: TimeDisplayProps): import("react/jsx-runtime").JSX.Element;
|
|
21
29
|
export {};
|