@oods/components-react 0.11.3 → 0.12.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 CHANGED
@@ -32,4 +32,4 @@ Generated apps pin the OODS release that generated them; to upgrade, regenerate
32
32
 
33
33
  ## License
34
34
 
35
- Apache License 2.0. See [LICENSE](https://cdn.jsdelivr.net/npm/@oods/components-react@0.11.3/LICENSE) and [NOTICE](https://cdn.jsdelivr.net/npm/@oods/components-react@0.11.3/NOTICE). Generated output belongs to its user; installed package dependencies retain their own licenses.
35
+ Apache License 2.0. See [LICENSE](https://cdn.jsdelivr.net/npm/@oods/components-react@0.12.0/LICENSE) and [NOTICE](https://cdn.jsdelivr.net/npm/@oods/components-react@0.12.0/NOTICE). Generated output belongs to its user; installed package dependencies retain their own licenses.
@@ -1,5 +1,5 @@
1
1
  import { getStatusPresentation, getToneTokenSet, getBannerToneTokenSet } from './chunk-2VEQWKGK.js';
2
- import { dateTimeInputValue, STATUS_ICON_SVG_ATTRS, resolveStatusIcon, currencyMinorUnits, formatDateTime, formatReadOnlyValue, STATUS_ICON_SHAPES } from '@oods/component-contracts';
2
+ import { dateTimeInputValue, STATUS_ICON_SVG_ATTRS, resolveStatusIcon, currencyMinorUnits, formatDateTime, formatReadOnlyValue, STATUS_ICON_SHAPES, historyAttribution } from '@oods/component-contracts';
3
3
  import * as React3 from 'react';
4
4
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
5
5
  import { Slot } from '@radix-ui/react-slot';
@@ -920,6 +920,7 @@ function normalizeTimelineEvents(values) {
920
920
  }
921
921
  const from = eventText(value, ["from"]);
922
922
  const to = eventText(value, ["to"]);
923
+ const attribution = historyAttribution(value);
923
924
  return [{
924
925
  id: eventText(value, ["id"]) ?? `event-${index}`,
925
926
  label: eventText(value, ["label", "title"]) ?? (eventText(value, ["event", "status", "state"]) ? humanize(eventText(value, ["event", "status", "state"])) : void 0) ?? eventText(value, ["text", "name"]) ?? (to ? from ? `${humanize(from)} \u2192 ${humanize(to)}` : humanize(to) : void 0) ?? "Event",
@@ -928,8 +929,9 @@ function normalizeTimelineEvents(values) {
928
929
  status: eventText(value, ["status"]),
929
930
  state: eventText(value, ["state"]),
930
931
  timestamp: eventText(value, ["timestamp", "datetime", "time", "at", "createdAt", "updatedAt"]),
931
- actor: eventText(value, ["actorId", "actor_id", "actor"]),
932
- actorId: eventText(value, ["actorId", "actor_id"]),
932
+ actor: attribution?.namesActor ? void 0 : eventText(value, ["actorId", "actor_id", "actor"]),
933
+ actorId: attribution?.namesActor ? void 0 : eventText(value, ["actorId", "actor_id"]),
934
+ ...attribution ? { attribution: attribution.text } : {},
933
935
  reason: eventText(value, ["reason"]),
934
936
  detail: eventText(value, ["detail", "description", "message"]) ?? (to ? from ? `${humanize(from)} \u2192 ${humanize(to)}` : humanize(to) : void 0)
935
937
  }];
@@ -997,6 +999,7 @@ var TimelinePrimitive = React3.forwardRef(
997
999
  /* @__PURE__ */ jsx("p", { className: "oods-timeline__label", "data-timeline-label": "true", children: eventLabel }),
998
1000
  timestamp ? /* @__PURE__ */ jsx("time", { "data-timeline-time": "true", dateTime: timestamp, children: formatDateTime(timestamp) }) : null,
999
1001
  detail ? /* @__PURE__ */ jsx("p", { className: "oods-timeline__detail", "data-timeline-detail": "true", children: detail }) : null,
1002
+ showActorId && event.attribution ? /* @__PURE__ */ jsx("p", { className: "oods-timeline__actor", "data-timeline-attribution": "true", children: event.attribution }) : null,
1000
1003
  showActorId && actor ? /* @__PURE__ */ jsxs("p", { className: "oods-timeline__actor", "data-timeline-actor": "true", children: [
1001
1004
  "Actor: ",
1002
1005
  actor
package/dist/index.cjs CHANGED
@@ -1496,6 +1496,7 @@ function normalizeTimelineEvents(values) {
1496
1496
  }
1497
1497
  const from = eventText(value, ["from"]);
1498
1498
  const to = eventText(value, ["to"]);
1499
+ const attribution = componentContracts.historyAttribution(value);
1499
1500
  return [{
1500
1501
  id: eventText(value, ["id"]) ?? `event-${index}`,
1501
1502
  label: eventText(value, ["label", "title"]) ?? (eventText(value, ["event", "status", "state"]) ? humanize(eventText(value, ["event", "status", "state"])) : void 0) ?? eventText(value, ["text", "name"]) ?? (to ? from ? `${humanize(from)} \u2192 ${humanize(to)}` : humanize(to) : void 0) ?? "Event",
@@ -1504,8 +1505,9 @@ function normalizeTimelineEvents(values) {
1504
1505
  status: eventText(value, ["status"]),
1505
1506
  state: eventText(value, ["state"]),
1506
1507
  timestamp: eventText(value, ["timestamp", "datetime", "time", "at", "createdAt", "updatedAt"]),
1507
- actor: eventText(value, ["actorId", "actor_id", "actor"]),
1508
- actorId: eventText(value, ["actorId", "actor_id"]),
1508
+ actor: attribution?.namesActor ? void 0 : eventText(value, ["actorId", "actor_id", "actor"]),
1509
+ actorId: attribution?.namesActor ? void 0 : eventText(value, ["actorId", "actor_id"]),
1510
+ ...attribution ? { attribution: attribution.text } : {},
1509
1511
  reason: eventText(value, ["reason"]),
1510
1512
  detail: eventText(value, ["detail", "description", "message"]) ?? (to ? from ? `${humanize(from)} \u2192 ${humanize(to)}` : humanize(to) : void 0)
1511
1513
  }];
@@ -1573,6 +1575,7 @@ var TimelinePrimitive = React9__namespace.forwardRef(
1573
1575
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "oods-timeline__label", "data-timeline-label": "true", children: eventLabel }),
1574
1576
  timestamp ? /* @__PURE__ */ jsxRuntime.jsx("time", { "data-timeline-time": "true", dateTime: timestamp, children: componentContracts.formatDateTime(timestamp) }) : null,
1575
1577
  detail ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "oods-timeline__detail", "data-timeline-detail": "true", children: detail }) : null,
1578
+ showActorId && event.attribution ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "oods-timeline__actor", "data-timeline-attribution": "true", children: event.attribution }) : null,
1576
1579
  showActorId && actor ? /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "oods-timeline__actor", "data-timeline-actor": "true", children: [
1577
1580
  "Actor: ",
1578
1581
  actor
@@ -3280,6 +3283,7 @@ function eventRecipe(id, kind, title) {
3280
3283
  /* @__PURE__ */ jsxRuntime.jsx("ol", { children: rows.map((row, index) => /* @__PURE__ */ jsxRuntime.jsxs("li", { children: [
3281
3284
  /* @__PURE__ */ jsxRuntime.jsx("strong", { children: row.title }),
3282
3285
  /* @__PURE__ */ jsxRuntime.jsx("p", { children: row.at ? /* @__PURE__ */ jsxRuntime.jsx("time", { dateTime: row.at, children: row.time }) : row.time }),
3286
+ row.attribution && /* @__PURE__ */ jsxRuntime.jsx("p", { children: row.attribution }),
3283
3287
  row.actor && /* @__PURE__ */ jsxRuntime.jsxs("p", { children: [
3284
3288
  "Actor: ",
3285
3289
  row.actor
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { Badge, StatusIcon, Select, Input, Checkbox, Text } from './chunk-ICXOX5B3.js';
2
- export { AuditTimeline, Badge, Banner, Button, CancellationSummary, Card, Checkbox, DatePicker, Dialog, Input, PaginationBar, PriceBadge, RelativeTimestamp, SearchInput, Select, StatusBadge, StatusTimeline, Switch, Text, Textarea } from './chunk-ICXOX5B3.js';
1
+ import { Badge, StatusIcon, Select, Input, Checkbox, Text } from './chunk-XSIENAMC.js';
2
+ export { AuditTimeline, Badge, Banner, Button, CancellationSummary, Card, Checkbox, DatePicker, Dialog, Input, PaginationBar, PriceBadge, RelativeTimestamp, SearchInput, Select, StatusBadge, StatusTimeline, Switch, Text, Textarea } from './chunk-XSIENAMC.js';
3
3
  export { Table } from './chunk-XEX22E24.js';
4
4
  import './chunk-2VEQWKGK.js';
5
5
  import * as React4 from 'react';
@@ -1681,6 +1681,7 @@ function eventRecipe(id, kind, title) {
1681
1681
  /* @__PURE__ */ jsx("ol", { children: rows.map((row, index) => /* @__PURE__ */ jsxs("li", { children: [
1682
1682
  /* @__PURE__ */ jsx("strong", { children: row.title }),
1683
1683
  /* @__PURE__ */ jsx("p", { children: row.at ? /* @__PURE__ */ jsx("time", { dateTime: row.at, children: row.time }) : row.time }),
1684
+ row.attribution && /* @__PURE__ */ jsx("p", { children: row.attribution }),
1684
1685
  row.actor && /* @__PURE__ */ jsxs("p", { children: [
1685
1686
  "Actor: ",
1686
1687
  row.actor
package/dist/ported.cjs CHANGED
@@ -942,6 +942,7 @@ function normalizeTimelineEvents(values) {
942
942
  }
943
943
  const from = eventText(value, ["from"]);
944
944
  const to = eventText(value, ["to"]);
945
+ const attribution = componentContracts.historyAttribution(value);
945
946
  return [{
946
947
  id: eventText(value, ["id"]) ?? `event-${index}`,
947
948
  label: eventText(value, ["label", "title"]) ?? (eventText(value, ["event", "status", "state"]) ? humanize(eventText(value, ["event", "status", "state"])) : void 0) ?? eventText(value, ["text", "name"]) ?? (to ? from ? `${humanize(from)} \u2192 ${humanize(to)}` : humanize(to) : void 0) ?? "Event",
@@ -950,8 +951,9 @@ function normalizeTimelineEvents(values) {
950
951
  status: eventText(value, ["status"]),
951
952
  state: eventText(value, ["state"]),
952
953
  timestamp: eventText(value, ["timestamp", "datetime", "time", "at", "createdAt", "updatedAt"]),
953
- actor: eventText(value, ["actorId", "actor_id", "actor"]),
954
- actorId: eventText(value, ["actorId", "actor_id"]),
954
+ actor: attribution?.namesActor ? void 0 : eventText(value, ["actorId", "actor_id", "actor"]),
955
+ actorId: attribution?.namesActor ? void 0 : eventText(value, ["actorId", "actor_id"]),
956
+ ...attribution ? { attribution: attribution.text } : {},
955
957
  reason: eventText(value, ["reason"]),
956
958
  detail: eventText(value, ["detail", "description", "message"]) ?? (to ? from ? `${humanize(from)} \u2192 ${humanize(to)}` : humanize(to) : void 0)
957
959
  }];
@@ -1019,6 +1021,7 @@ var TimelinePrimitive = React3__namespace.forwardRef(
1019
1021
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "oods-timeline__label", "data-timeline-label": "true", children: eventLabel }),
1020
1022
  timestamp ? /* @__PURE__ */ jsxRuntime.jsx("time", { "data-timeline-time": "true", dateTime: timestamp, children: componentContracts.formatDateTime(timestamp) }) : null,
1021
1023
  detail ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "oods-timeline__detail", "data-timeline-detail": "true", children: detail }) : null,
1024
+ showActorId && event.attribution ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "oods-timeline__actor", "data-timeline-attribution": "true", children: event.attribution }) : null,
1022
1025
  showActorId && actor ? /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "oods-timeline__actor", "data-timeline-actor": "true", children: [
1023
1026
  "Actor: ",
1024
1027
  actor
package/dist/ported.d.cts CHANGED
@@ -48,6 +48,8 @@ type TimelineEvent = {
48
48
  readonly actor?: string;
49
49
  readonly actorId?: string;
50
50
  readonly actor_id?: string;
51
+ /** s244-m01 (#2829): who acted, for whom and who approved, from the entry's *_name fields (historyAttribution). */
52
+ readonly attribution?: string;
51
53
  readonly reason?: React.ReactNode;
52
54
  readonly detail?: React.ReactNode;
53
55
  readonly description?: React.ReactNode;
package/dist/ported.d.ts CHANGED
@@ -48,6 +48,8 @@ type TimelineEvent = {
48
48
  readonly actor?: string;
49
49
  readonly actorId?: string;
50
50
  readonly actor_id?: string;
51
+ /** s244-m01 (#2829): who acted, for whom and who approved, from the entry's *_name fields (historyAttribution). */
52
+ readonly attribution?: string;
51
53
  readonly reason?: React.ReactNode;
52
54
  readonly detail?: React.ReactNode;
53
55
  readonly description?: React.ReactNode;
package/dist/ported.js CHANGED
@@ -1,2 +1,2 @@
1
- export { AuditTimeline, CancellationSummary, PaginationBar, PriceBadge, RelativeTimestamp, SearchInput, StatusBadge, StatusTimeline } from './chunk-ICXOX5B3.js';
1
+ export { AuditTimeline, CancellationSummary, PaginationBar, PriceBadge, RelativeTimestamp, SearchInput, StatusBadge, StatusTimeline } from './chunk-XSIENAMC.js';
2
2
  import './chunk-2VEQWKGK.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oods/components-react",
3
- "version": "0.11.3",
3
+ "version": "0.12.0",
4
4
  "description": "React components for OODS Foundry: the controls, layouts and domain views its generated screens use.",
5
5
  "homepage": "https://oods-foundry.com/",
6
6
  "bugs": {
@@ -64,8 +64,8 @@
64
64
  ],
65
65
  "dependencies": {
66
66
  "@radix-ui/react-slot": "^1.1.2",
67
- "@oods/component-contracts": "0.11.3",
68
- "@oods/component-styles": "0.11.3"
67
+ "@oods/component-contracts": "0.12.0",
68
+ "@oods/component-styles": "0.12.0"
69
69
  },
70
70
  "peerDependencies": {
71
71
  "react": ">=18 <20",