@oods/components-react 0.3.1 → 0.3.3
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 +3 -3
- package/dist/{chunk-A4T7OOIY.js → chunk-BPEHI36W.js} +22 -29
- package/dist/{chunk-YCI5AEWL.js → chunk-XAWAMZUQ.js} +1 -1
- package/dist/index.cjs +29 -34
- package/dist/index.js +9 -7
- package/dist/ported.cjs +22 -29
- package/dist/ported.js +1 -1
- package/dist/table.cjs +1 -1
- package/dist/table.js +1 -1
- package/package.json +17 -5
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ React components used by screens generated with OODS Foundry. The package export
|
|
|
8
8
|
npm install @oods/components-react @oods/component-styles @oods/tokens @oods/component-contracts react react-dom
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
Use React and React DOM 18 or 19. Bring your existing React app or use
|
|
11
|
+
Use React and React DOM 18 or 19. Bring your existing React app or use OODS Foundry's `code_generate` with `options.output: "application"` for an app entry and Vite configuration.
|
|
12
12
|
|
|
13
13
|
## First result
|
|
14
14
|
|
|
@@ -24,7 +24,7 @@ export function App() {
|
|
|
24
24
|
|
|
25
25
|
Set `data-brand="A"` and `data-theme="light"` on the root HTML element. The result is a button labelled “Review stock” that invokes the supplied handler. Set the theme to `dark` or `hc` for those scopes.
|
|
26
26
|
|
|
27
|
-
Generated sample screens identify their sample data. A workflow's local store is not a production database; supply your data, navigation and persistence handlers. Retained component evidence covers named scenarios and themes, not every application you build. For your own implementation of a shipped component, use
|
|
27
|
+
Generated sample screens identify their sample data. A workflow's local store is not a production database; supply your data, navigation and persistence handlers. Retained component evidence covers named scenarios and themes, not every application you build. For your own implementation of a shipped component, use OODS Foundry's substitution mapping and inspect its advisory contract report.
|
|
28
28
|
|
|
29
29
|
## Limits
|
|
30
30
|
|
|
@@ -32,4 +32,4 @@ Use matching versions of the OODS packages. These packages are separate from the
|
|
|
32
32
|
|
|
33
33
|
## License
|
|
34
34
|
|
|
35
|
-
Apache License 2.0. See [LICENSE](LICENSE) and [NOTICE](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.3.3/LICENSE) and [NOTICE](https://cdn.jsdelivr.net/npm/@oods/components-react@0.3.3/NOTICE). Generated output belongs to its user; installed package dependencies retain their own licenses.
|
|
@@ -155,17 +155,16 @@ var InputPrimitive = React3.forwardRef(
|
|
|
155
155
|
InputPrimitive.displayName = "OODS.Input";
|
|
156
156
|
var Input = InputPrimitive;
|
|
157
157
|
var DatePicker = React3.forwardRef(
|
|
158
|
-
({ pickerClassName, pickerStyle, inputClassName, inputStyle, ...rest }, ref) => /* @__PURE__ */ jsx(
|
|
158
|
+
({ pickerClassName, pickerStyle, inputClassName, inputStyle, className, style, ...rest }, ref) => /* @__PURE__ */ jsx("div", { className: classes("oods-date-picker", className), style, "data-oods-component": "DatePicker", children: /* @__PURE__ */ jsx(
|
|
159
159
|
Input,
|
|
160
160
|
{
|
|
161
161
|
ref,
|
|
162
162
|
type: "date",
|
|
163
|
-
"data-oods-component": "DatePicker",
|
|
164
163
|
inputClassName: classes("form-field__date-picker", inputClassName, pickerClassName),
|
|
165
164
|
inputStyle: { ...inputStyle, ...pickerStyle },
|
|
166
165
|
...rest
|
|
167
166
|
}
|
|
168
|
-
)
|
|
167
|
+
) })
|
|
169
168
|
);
|
|
170
169
|
DatePicker.displayName = "OODS.DatePicker";
|
|
171
170
|
var Checkbox = React3.forwardRef(
|
|
@@ -393,12 +392,12 @@ var Badge = React3.forwardRef(
|
|
|
393
392
|
const resolvedContent = children ?? content ?? presentation?.label ?? status;
|
|
394
393
|
const resolvedIcon = icon ?? resolveStatusGlyph(presentation?.iconName);
|
|
395
394
|
const resolvedShowIcon = showIcon ?? resolvedIcon !== void 0;
|
|
396
|
-
const iconNode = resolvedShowIcon && resolvedIcon ? /* @__PURE__ */ jsx("span", { className: "oods-badge__icon
|
|
395
|
+
const iconNode = resolvedShowIcon && resolvedIcon ? /* @__PURE__ */ jsx("span", { className: "oods-badge__icon", "aria-hidden": "true", children: resolvedIcon }) : null;
|
|
397
396
|
return /* @__PURE__ */ jsxs(
|
|
398
397
|
"span",
|
|
399
398
|
{
|
|
400
399
|
ref,
|
|
401
|
-
className: classes2("oods-badge",
|
|
400
|
+
className: classes2("oods-badge", className),
|
|
402
401
|
"data-oods-component": "Badge",
|
|
403
402
|
"data-status": status,
|
|
404
403
|
"data-domain": domain,
|
|
@@ -410,16 +409,12 @@ var Badge = React3.forwardRef(
|
|
|
410
409
|
"--cmp-badge-background": tokenSet.background,
|
|
411
410
|
"--cmp-badge-border": tokenSet.border,
|
|
412
411
|
"--cmp-badge-text": tokenSet.foreground,
|
|
413
|
-
"--statusable-badge-background": tokenSet.background,
|
|
414
|
-
"--statusable-badge-border": tokenSet.border,
|
|
415
|
-
"--statusable-badge-foreground": tokenSet.foreground,
|
|
416
|
-
"--statusable-badge-icon-color": tokenSet.foreground,
|
|
417
412
|
...style
|
|
418
413
|
},
|
|
419
414
|
...rest,
|
|
420
415
|
children: [
|
|
421
416
|
iconPosition === "start" ? iconNode : null,
|
|
422
|
-
/* @__PURE__ */ jsx("span", { className: "oods-badge__label
|
|
417
|
+
/* @__PURE__ */ jsx("span", { className: "oods-badge__label", children: resolvedContent }),
|
|
423
418
|
iconPosition === "end" ? iconNode : null
|
|
424
419
|
]
|
|
425
420
|
}
|
|
@@ -461,7 +456,7 @@ var Banner = React3.forwardRef(
|
|
|
461
456
|
ref,
|
|
462
457
|
role,
|
|
463
458
|
"aria-live": role === "alert" ? "assertive" : "polite",
|
|
464
|
-
className: classes2("oods-banner",
|
|
459
|
+
className: classes2("oods-banner", className),
|
|
465
460
|
"data-oods-component": "Banner",
|
|
466
461
|
"data-status": status,
|
|
467
462
|
"data-domain": domain,
|
|
@@ -471,25 +466,21 @@ var Banner = React3.forwardRef(
|
|
|
471
466
|
"--cmp-banner-background": tokenSet.background,
|
|
472
467
|
"--cmp-banner-border": tokenSet.border,
|
|
473
468
|
"--cmp-banner-text": tokenSet.foreground,
|
|
474
|
-
"--statusable-banner-background": tokenSet.background,
|
|
475
|
-
"--statusable-banner-border": tokenSet.border,
|
|
476
|
-
"--statusable-banner-foreground": tokenSet.foreground,
|
|
477
|
-
"--statusable-banner-icon-color": tokenSet.foreground,
|
|
478
469
|
...style
|
|
479
470
|
},
|
|
480
471
|
...rest,
|
|
481
472
|
children: [
|
|
482
|
-
resolvedShowIcon && resolvedIcon ? /* @__PURE__ */ jsx("span", { className: "oods-banner__icon
|
|
483
|
-
/* @__PURE__ */ jsxs("div", { className: "oods-banner__content
|
|
484
|
-
heading ? /* @__PURE__ */ jsx("strong", { className: "oods-banner__title
|
|
485
|
-
body ? /* @__PURE__ */ jsx("p", { className: "oods-banner__detail
|
|
486
|
-
actions ? /* @__PURE__ */ jsx("div", { className: "oods-banner__actions
|
|
473
|
+
resolvedShowIcon && resolvedIcon ? /* @__PURE__ */ jsx("span", { className: "oods-banner__icon", "aria-hidden": "true", children: resolvedIcon }) : null,
|
|
474
|
+
/* @__PURE__ */ jsxs("div", { className: "oods-banner__content", children: [
|
|
475
|
+
heading ? /* @__PURE__ */ jsx("strong", { className: "oods-banner__title", children: heading }) : null,
|
|
476
|
+
body ? /* @__PURE__ */ jsx("p", { className: "oods-banner__detail", children: body }) : null,
|
|
477
|
+
actions ? /* @__PURE__ */ jsx("div", { className: "oods-banner__actions", children: actions }) : null
|
|
487
478
|
] }),
|
|
488
479
|
onDismiss ? /* @__PURE__ */ jsx(
|
|
489
480
|
"button",
|
|
490
481
|
{
|
|
491
482
|
type: "button",
|
|
492
|
-
className: "oods-banner-dismiss oods-banner__dismiss
|
|
483
|
+
className: "oods-banner-dismiss oods-banner__dismiss",
|
|
493
484
|
"aria-label": dismissLabel,
|
|
494
485
|
onClick: () => onDismiss(),
|
|
495
486
|
children: /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: "\xD7" })
|
|
@@ -612,6 +603,7 @@ var StatusBadge = React3.forwardRef(
|
|
|
612
603
|
compact,
|
|
613
604
|
variant,
|
|
614
605
|
title,
|
|
606
|
+
className,
|
|
615
607
|
"aria-label": ariaLabel,
|
|
616
608
|
...rest
|
|
617
609
|
}, ref) => {
|
|
@@ -629,6 +621,7 @@ var StatusBadge = React3.forwardRef(
|
|
|
629
621
|
content: children ?? content,
|
|
630
622
|
title: title ?? presentation.description,
|
|
631
623
|
"aria-label": ariaLabel ?? label ?? `Status: ${presentation.label}`,
|
|
624
|
+
className: classes3("oods-status-badge", className),
|
|
632
625
|
"data-oods-component": "StatusBadge",
|
|
633
626
|
...rest
|
|
634
627
|
}
|
|
@@ -767,29 +760,29 @@ var TimelinePrimitive = React3.forwardRef(
|
|
|
767
760
|
"data-timeline-type": kind,
|
|
768
761
|
...rest,
|
|
769
762
|
children: [
|
|
770
|
-
/* @__PURE__ */ jsx("h2", { className: "oods-timeline__title", children: title }),
|
|
763
|
+
/* @__PURE__ */ jsx("h2", { className: "oods-timeline__title", "data-timeline-title": "true", children: title }),
|
|
771
764
|
kind === "status" && status ? /* @__PURE__ */ jsxs("p", { className: "oods-timeline__current", "data-timeline-current": "true", children: [
|
|
772
765
|
"Current status: ",
|
|
773
766
|
humanize(status)
|
|
774
767
|
] }) : null,
|
|
775
|
-
transitionCount > 0 ? /* @__PURE__ */ jsxs("p", { children: [
|
|
768
|
+
transitionCount > 0 ? /* @__PURE__ */ jsxs("p", { "data-timeline-transitions": "true", children: [
|
|
776
769
|
"Allowed transitions: ",
|
|
777
770
|
allowedTransitions?.join(", ")
|
|
778
771
|
] }) : null,
|
|
779
|
-
children ?? /* @__PURE__ */ jsx("ol", { className: "oods-timeline__events", children: visibleEvents.length === 0 ? /* @__PURE__ */ jsx("li", { "data-timeline-empty": "true", children: "No events" }) : visibleEvents.map((event, index) => {
|
|
772
|
+
children ?? /* @__PURE__ */ jsx("ol", { className: "oods-timeline__events", "data-timeline-events": "true", children: visibleEvents.length === 0 ? /* @__PURE__ */ jsx("li", { "data-timeline-empty": "true", children: "No events" }) : visibleEvents.map((event, index) => {
|
|
780
773
|
const timestamp = event.timestamp ?? event.datetime;
|
|
781
774
|
const actor = event.actor ?? event.actorId ?? event.actor_id;
|
|
782
775
|
const eventLabel = event.label ?? event.title ?? (event.from && event.to ? `${humanize(event.from)} \u2192 ${humanize(event.to)}` : void 0) ?? (event.status ? humanize(event.status) : void 0) ?? (event.state ? humanize(event.state) : void 0) ?? "Event";
|
|
783
776
|
const detail = event.detail ?? event.description;
|
|
784
777
|
return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs("article", { className: "oods-timeline__event", "data-timeline-event": "true", children: [
|
|
785
|
-
/* @__PURE__ */ jsx("p", { className: "oods-timeline__label", children: eventLabel }),
|
|
786
|
-
timestamp ? /* @__PURE__ */ jsx("time", { dateTime: timestamp, children: formatDateTime(timestamp) }) : null,
|
|
787
|
-
detail ? /* @__PURE__ */ jsx("p", { className: "oods-timeline__detail", children: detail }) : null,
|
|
788
|
-
showActorId && actor ? /* @__PURE__ */ jsxs("p", { className: "oods-timeline__actor", children: [
|
|
778
|
+
/* @__PURE__ */ jsx("p", { className: "oods-timeline__label", "data-timeline-label": "true", children: eventLabel }),
|
|
779
|
+
timestamp ? /* @__PURE__ */ jsx("time", { "data-timeline-time": "true", dateTime: timestamp, children: formatDateTime(timestamp) }) : null,
|
|
780
|
+
detail ? /* @__PURE__ */ jsx("p", { className: "oods-timeline__detail", "data-timeline-detail": "true", children: detail }) : null,
|
|
781
|
+
showActorId && actor ? /* @__PURE__ */ jsxs("p", { className: "oods-timeline__actor", "data-timeline-actor": "true", children: [
|
|
789
782
|
"Actor: ",
|
|
790
783
|
actor
|
|
791
784
|
] }) : null,
|
|
792
|
-
showReason && event.reason ? /* @__PURE__ */ jsxs("p", { className: "oods-timeline__reason", children: [
|
|
785
|
+
showReason && event.reason ? /* @__PURE__ */ jsxs("p", { className: "oods-timeline__reason", "data-timeline-reason": "true", children: [
|
|
793
786
|
"Reason: ",
|
|
794
787
|
event.reason
|
|
795
788
|
] }) : null
|
|
@@ -146,7 +146,7 @@ var TableRoot = React.forwardRef(
|
|
|
146
146
|
...rest,
|
|
147
147
|
children: children ?? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
148
148
|
caption ? /* @__PURE__ */ jsx(TableCaption, { children: caption }) : null,
|
|
149
|
-
/* @__PURE__ */ jsx(TableHead, { children: /* @__PURE__ */ jsx("tr", { children: columns?.map((column) => /* @__PURE__ */ jsx(TableHeaderCell, { numeric: column.numeric, children: column.label }, column.key)) }) }),
|
|
149
|
+
/* @__PURE__ */ jsx(TableHead, { children: /* @__PURE__ */ jsx("tr", { className: "oods-table__row", children: columns?.map((column) => /* @__PURE__ */ jsx(TableHeaderCell, { numeric: column.numeric, children: column.label }, column.key)) }) }),
|
|
150
150
|
/* @__PURE__ */ jsx(TableBody, { children: (rows?.length ?? 0) === 0 ? /* @__PURE__ */ jsx("tr", { className: "oods-table__row", children: /* @__PURE__ */ jsx(TableCell, { colSpan: Math.max(columns?.length ?? 0, 1), children: "No rows available." }) }) : rows?.map((row) => /* @__PURE__ */ jsx(
|
|
151
151
|
"tr",
|
|
152
152
|
{
|
package/dist/index.cjs
CHANGED
|
@@ -381,12 +381,12 @@ var Badge = React7__namespace.forwardRef(
|
|
|
381
381
|
const resolvedContent = children ?? content ?? presentation?.label ?? status;
|
|
382
382
|
const resolvedIcon = icon ?? resolveStatusGlyph(presentation?.iconName);
|
|
383
383
|
const resolvedShowIcon = showIcon ?? resolvedIcon !== void 0;
|
|
384
|
-
const iconNode = resolvedShowIcon && resolvedIcon ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "oods-badge__icon
|
|
384
|
+
const iconNode = resolvedShowIcon && resolvedIcon ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "oods-badge__icon", "aria-hidden": "true", children: resolvedIcon }) : null;
|
|
385
385
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
386
386
|
"span",
|
|
387
387
|
{
|
|
388
388
|
ref,
|
|
389
|
-
className: classes("oods-badge",
|
|
389
|
+
className: classes("oods-badge", className),
|
|
390
390
|
"data-oods-component": "Badge",
|
|
391
391
|
"data-status": status,
|
|
392
392
|
"data-domain": domain,
|
|
@@ -398,16 +398,12 @@ var Badge = React7__namespace.forwardRef(
|
|
|
398
398
|
"--cmp-badge-background": tokenSet.background,
|
|
399
399
|
"--cmp-badge-border": tokenSet.border,
|
|
400
400
|
"--cmp-badge-text": tokenSet.foreground,
|
|
401
|
-
"--statusable-badge-background": tokenSet.background,
|
|
402
|
-
"--statusable-badge-border": tokenSet.border,
|
|
403
|
-
"--statusable-badge-foreground": tokenSet.foreground,
|
|
404
|
-
"--statusable-badge-icon-color": tokenSet.foreground,
|
|
405
401
|
...style
|
|
406
402
|
},
|
|
407
403
|
...rest,
|
|
408
404
|
children: [
|
|
409
405
|
iconPosition === "start" ? iconNode : null,
|
|
410
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "oods-badge__label
|
|
406
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "oods-badge__label", children: resolvedContent }),
|
|
411
407
|
iconPosition === "end" ? iconNode : null
|
|
412
408
|
]
|
|
413
409
|
}
|
|
@@ -449,7 +445,7 @@ var Banner = React7__namespace.forwardRef(
|
|
|
449
445
|
ref,
|
|
450
446
|
role,
|
|
451
447
|
"aria-live": role === "alert" ? "assertive" : "polite",
|
|
452
|
-
className: classes("oods-banner",
|
|
448
|
+
className: classes("oods-banner", className),
|
|
453
449
|
"data-oods-component": "Banner",
|
|
454
450
|
"data-status": status,
|
|
455
451
|
"data-domain": domain,
|
|
@@ -459,25 +455,21 @@ var Banner = React7__namespace.forwardRef(
|
|
|
459
455
|
"--cmp-banner-background": tokenSet.background,
|
|
460
456
|
"--cmp-banner-border": tokenSet.border,
|
|
461
457
|
"--cmp-banner-text": tokenSet.foreground,
|
|
462
|
-
"--statusable-banner-background": tokenSet.background,
|
|
463
|
-
"--statusable-banner-border": tokenSet.border,
|
|
464
|
-
"--statusable-banner-foreground": tokenSet.foreground,
|
|
465
|
-
"--statusable-banner-icon-color": tokenSet.foreground,
|
|
466
458
|
...style
|
|
467
459
|
},
|
|
468
460
|
...rest,
|
|
469
461
|
children: [
|
|
470
|
-
resolvedShowIcon && resolvedIcon ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "oods-banner__icon
|
|
471
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "oods-banner__content
|
|
472
|
-
heading ? /* @__PURE__ */ jsxRuntime.jsx("strong", { className: "oods-banner__title
|
|
473
|
-
body ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "oods-banner__detail
|
|
474
|
-
actions ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "oods-banner__actions
|
|
462
|
+
resolvedShowIcon && resolvedIcon ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "oods-banner__icon", "aria-hidden": "true", children: resolvedIcon }) : null,
|
|
463
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "oods-banner__content", children: [
|
|
464
|
+
heading ? /* @__PURE__ */ jsxRuntime.jsx("strong", { className: "oods-banner__title", children: heading }) : null,
|
|
465
|
+
body ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "oods-banner__detail", children: body }) : null,
|
|
466
|
+
actions ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "oods-banner__actions", children: actions }) : null
|
|
475
467
|
] }),
|
|
476
468
|
onDismiss ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
477
469
|
"button",
|
|
478
470
|
{
|
|
479
471
|
type: "button",
|
|
480
|
-
className: "oods-banner-dismiss oods-banner__dismiss
|
|
472
|
+
className: "oods-banner-dismiss oods-banner__dismiss",
|
|
481
473
|
"aria-label": dismissLabel,
|
|
482
474
|
onClick: () => onDismiss(),
|
|
483
475
|
children: /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", children: "\xD7" })
|
|
@@ -731,17 +723,16 @@ var InputPrimitive = React7__namespace.forwardRef(
|
|
|
731
723
|
InputPrimitive.displayName = "OODS.Input";
|
|
732
724
|
var Input = InputPrimitive;
|
|
733
725
|
var DatePicker = React7__namespace.forwardRef(
|
|
734
|
-
({ pickerClassName, pickerStyle, inputClassName, inputStyle, ...rest }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
726
|
+
({ pickerClassName, pickerStyle, inputClassName, inputStyle, className, style, ...rest }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes2("oods-date-picker", className), style, "data-oods-component": "DatePicker", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
735
727
|
Input,
|
|
736
728
|
{
|
|
737
729
|
ref,
|
|
738
730
|
type: "date",
|
|
739
|
-
"data-oods-component": "DatePicker",
|
|
740
731
|
inputClassName: classes2("form-field__date-picker", inputClassName, pickerClassName),
|
|
741
732
|
inputStyle: { ...inputStyle, ...pickerStyle },
|
|
742
733
|
...rest
|
|
743
734
|
}
|
|
744
|
-
)
|
|
735
|
+
) })
|
|
745
736
|
);
|
|
746
737
|
DatePicker.displayName = "OODS.DatePicker";
|
|
747
738
|
var Checkbox = React7__namespace.forwardRef(
|
|
@@ -1163,7 +1154,7 @@ var TableRoot = React7__namespace.forwardRef(
|
|
|
1163
1154
|
...rest,
|
|
1164
1155
|
children: children ?? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1165
1156
|
caption ? /* @__PURE__ */ jsxRuntime.jsx(TableCaption, { children: caption }) : null,
|
|
1166
|
-
/* @__PURE__ */ jsxRuntime.jsx(TableHead, { children: /* @__PURE__ */ jsxRuntime.jsx("tr", { children: columns?.map((column) => /* @__PURE__ */ jsxRuntime.jsx(TableHeaderCell, { numeric: column.numeric, children: column.label }, column.key)) }) }),
|
|
1157
|
+
/* @__PURE__ */ jsxRuntime.jsx(TableHead, { children: /* @__PURE__ */ jsxRuntime.jsx("tr", { className: "oods-table__row", children: columns?.map((column) => /* @__PURE__ */ jsxRuntime.jsx(TableHeaderCell, { numeric: column.numeric, children: column.label }, column.key)) }) }),
|
|
1167
1158
|
/* @__PURE__ */ jsxRuntime.jsx(TableBody, { children: (rows?.length ?? 0) === 0 ? /* @__PURE__ */ jsxRuntime.jsx("tr", { className: "oods-table__row", children: /* @__PURE__ */ jsxRuntime.jsx(TableCell, { colSpan: Math.max(columns?.length ?? 0, 1), children: "No rows available." }) }) : rows?.map((row) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1168
1159
|
"tr",
|
|
1169
1160
|
{
|
|
@@ -1450,6 +1441,7 @@ var StatusBadge = React7__namespace.forwardRef(
|
|
|
1450
1441
|
compact,
|
|
1451
1442
|
variant,
|
|
1452
1443
|
title,
|
|
1444
|
+
className,
|
|
1453
1445
|
"aria-label": ariaLabel,
|
|
1454
1446
|
...rest
|
|
1455
1447
|
}, ref) => {
|
|
@@ -1467,6 +1459,7 @@ var StatusBadge = React7__namespace.forwardRef(
|
|
|
1467
1459
|
content: children ?? content,
|
|
1468
1460
|
title: title ?? presentation.description,
|
|
1469
1461
|
"aria-label": ariaLabel ?? label ?? `Status: ${presentation.label}`,
|
|
1462
|
+
className: classes6("oods-status-badge", className),
|
|
1470
1463
|
"data-oods-component": "StatusBadge",
|
|
1471
1464
|
...rest
|
|
1472
1465
|
}
|
|
@@ -1605,29 +1598,29 @@ var TimelinePrimitive = React7__namespace.forwardRef(
|
|
|
1605
1598
|
"data-timeline-type": kind,
|
|
1606
1599
|
...rest,
|
|
1607
1600
|
children: [
|
|
1608
|
-
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "oods-timeline__title", children: title }),
|
|
1601
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "oods-timeline__title", "data-timeline-title": "true", children: title }),
|
|
1609
1602
|
kind === "status" && status ? /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "oods-timeline__current", "data-timeline-current": "true", children: [
|
|
1610
1603
|
"Current status: ",
|
|
1611
1604
|
humanize(status)
|
|
1612
1605
|
] }) : null,
|
|
1613
|
-
transitionCount > 0 ? /* @__PURE__ */ jsxRuntime.jsxs("p", { children: [
|
|
1606
|
+
transitionCount > 0 ? /* @__PURE__ */ jsxRuntime.jsxs("p", { "data-timeline-transitions": "true", children: [
|
|
1614
1607
|
"Allowed transitions: ",
|
|
1615
1608
|
allowedTransitions?.join(", ")
|
|
1616
1609
|
] }) : null,
|
|
1617
|
-
children ?? /* @__PURE__ */ jsxRuntime.jsx("ol", { className: "oods-timeline__events", children: visibleEvents.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("li", { "data-timeline-empty": "true", children: "No events" }) : visibleEvents.map((event, index) => {
|
|
1610
|
+
children ?? /* @__PURE__ */ jsxRuntime.jsx("ol", { className: "oods-timeline__events", "data-timeline-events": "true", children: visibleEvents.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("li", { "data-timeline-empty": "true", children: "No events" }) : visibleEvents.map((event, index) => {
|
|
1618
1611
|
const timestamp = event.timestamp ?? event.datetime;
|
|
1619
1612
|
const actor = event.actor ?? event.actorId ?? event.actor_id;
|
|
1620
1613
|
const eventLabel = event.label ?? event.title ?? (event.from && event.to ? `${humanize(event.from)} \u2192 ${humanize(event.to)}` : void 0) ?? (event.status ? humanize(event.status) : void 0) ?? (event.state ? humanize(event.state) : void 0) ?? "Event";
|
|
1621
1614
|
const detail = event.detail ?? event.description;
|
|
1622
1615
|
return /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsxs("article", { className: "oods-timeline__event", "data-timeline-event": "true", children: [
|
|
1623
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "oods-timeline__label", children: eventLabel }),
|
|
1624
|
-
timestamp ? /* @__PURE__ */ jsxRuntime.jsx("time", { dateTime: timestamp, children: componentContracts.formatDateTime(timestamp) }) : null,
|
|
1625
|
-
detail ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "oods-timeline__detail", children: detail }) : null,
|
|
1626
|
-
showActorId && actor ? /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "oods-timeline__actor", children: [
|
|
1616
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "oods-timeline__label", "data-timeline-label": "true", children: eventLabel }),
|
|
1617
|
+
timestamp ? /* @__PURE__ */ jsxRuntime.jsx("time", { "data-timeline-time": "true", dateTime: timestamp, children: componentContracts.formatDateTime(timestamp) }) : null,
|
|
1618
|
+
detail ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "oods-timeline__detail", "data-timeline-detail": "true", children: detail }) : null,
|
|
1619
|
+
showActorId && actor ? /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "oods-timeline__actor", "data-timeline-actor": "true", children: [
|
|
1627
1620
|
"Actor: ",
|
|
1628
1621
|
actor
|
|
1629
1622
|
] }) : null,
|
|
1630
|
-
showReason && event.reason ? /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "oods-timeline__reason", children: [
|
|
1623
|
+
showReason && event.reason ? /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "oods-timeline__reason", "data-timeline-reason": "true", children: [
|
|
1631
1624
|
"Reason: ",
|
|
1632
1625
|
event.reason
|
|
1633
1626
|
] }) : null
|
|
@@ -2398,7 +2391,7 @@ function createBadgeFamily(options) {
|
|
|
2398
2391
|
return typeof value === "string" && value.trim().length > 0 ? value : void 0;
|
|
2399
2392
|
};
|
|
2400
2393
|
const content = childContent(children);
|
|
2401
|
-
const label = content.scalar ?? firstText(...options.labelKeys.map((key) => options.
|
|
2394
|
+
const label = content.scalar ?? firstText(...options.labelKeys.map((key) => options.booleanLabels && typeof record[key] === "boolean" && options.booleanProps?.includes(key) ? options.booleanLabels[record[key] ? 0 : 1] : scalar(key))) ?? options.defaultLabel;
|
|
2402
2395
|
const status = firstText(...options.statusKeys.map(scalar));
|
|
2403
2396
|
const variant = scalar("variant") ?? options.defaultVariant;
|
|
2404
2397
|
const tone = record.tone;
|
|
@@ -3072,7 +3065,8 @@ var ArchivePill = createBadgeFamily({
|
|
|
3072
3065
|
defaultVariant: "archive",
|
|
3073
3066
|
labelKeys: ["label", "text", "status", "state", "isArchived", "value"],
|
|
3074
3067
|
statusKeys: ["status", "state", "isArchived", "value"],
|
|
3075
|
-
booleanProps: ["isArchived", "value"]
|
|
3068
|
+
booleanProps: ["isArchived", "value"],
|
|
3069
|
+
booleanLabels: ["Archived", "Not archived"]
|
|
3076
3070
|
});
|
|
3077
3071
|
var CancellationBadge = createBadgeFamily({
|
|
3078
3072
|
component: "CancellationBadge",
|
|
@@ -3081,7 +3075,8 @@ var CancellationBadge = createBadgeFamily({
|
|
|
3081
3075
|
defaultVariant: "cancellation",
|
|
3082
3076
|
labelKeys: ["label", "text", "status", "state", "cancelAtPeriodEnd", "value"],
|
|
3083
3077
|
statusKeys: ["status", "state", "cancelAtPeriodEnd", "isCancelled", "value"],
|
|
3084
|
-
booleanProps: ["cancelAtPeriodEnd", "isCancelled", "value"]
|
|
3078
|
+
booleanProps: ["cancelAtPeriodEnd", "isCancelled", "value"],
|
|
3079
|
+
booleanLabels: ["Cancellation scheduled", "No cancellation scheduled"]
|
|
3085
3080
|
});
|
|
3086
3081
|
var ArchiveSummary = React7__namespace.forwardRef(
|
|
3087
3082
|
({ title, label, heading, name, isArchived, archived, status, archivedAt, reason, archiveReason, summary: summary2, text, description, children, className, ...rest }, ref) => {
|
|
@@ -3101,7 +3096,7 @@ ArchiveSummary.displayName = "OODS.ArchiveSummary";
|
|
|
3101
3096
|
var PriceCardMeta = React7__namespace.forwardRef(
|
|
3102
3097
|
({ title, label, heading, name, model, pricingModel, interval, billingInterval, children, className, ...rest }, ref) => {
|
|
3103
3098
|
const content = childContent(children);
|
|
3104
|
-
const terms = [["Model", firstText(model, pricingModel)], ["Interval", firstText(interval, billingInterval)]].filter((entry) => entry[1] !== void 0);
|
|
3099
|
+
const terms = [["Model", componentContracts.formatPriceCode(firstText(model, pricingModel))], ["Interval", componentContracts.formatPriceCode(firstText(interval, billingInterval))]].filter((entry) => entry[1] !== void 0);
|
|
3105
3100
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: classes7("oods-price-card-meta", className), "data-oods-component": "PriceCardMeta", "data-meta-type": "price", ...rest, children: content.authored || content.scalar !== void 0 ? children : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3106
3101
|
/* @__PURE__ */ jsxRuntime.jsx("span", { "data-meta-title": "true", children: firstText(title, label, heading, name) ?? "Price" }),
|
|
3107
3102
|
terms.map(([term, value]) => /* @__PURE__ */ jsxRuntime.jsxs("span", { "data-meta-item": "true", children: [
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Badge, Select, Input, Checkbox, Text } from './chunk-
|
|
2
|
-
export { AuditTimeline, Badge, Banner, Button, CancellationSummary, Card, Checkbox, DatePicker, Input, PaginationBar, PriceBadge, RelativeTimestamp, SearchInput, Select, StatusBadge, StatusTimeline, Text, Textarea } from './chunk-
|
|
3
|
-
export { Table } from './chunk-
|
|
1
|
+
import { Badge, Select, Input, Checkbox, Text } from './chunk-BPEHI36W.js';
|
|
2
|
+
export { AuditTimeline, Badge, Banner, Button, CancellationSummary, Card, Checkbox, DatePicker, Input, PaginationBar, PriceBadge, RelativeTimestamp, SearchInput, Select, StatusBadge, StatusTimeline, Text, Textarea } from './chunk-BPEHI36W.js';
|
|
3
|
+
export { Table } from './chunk-XAWAMZUQ.js';
|
|
4
4
|
import './chunk-G74PKSW3.js';
|
|
5
5
|
import * as React3 from 'react';
|
|
6
6
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
@@ -683,7 +683,7 @@ function createBadgeFamily(options) {
|
|
|
683
683
|
return typeof value === "string" && value.trim().length > 0 ? value : void 0;
|
|
684
684
|
};
|
|
685
685
|
const content = childContent(children);
|
|
686
|
-
const label = content.scalar ?? firstText(...options.labelKeys.map((key) => options.
|
|
686
|
+
const label = content.scalar ?? firstText(...options.labelKeys.map((key) => options.booleanLabels && typeof record[key] === "boolean" && options.booleanProps?.includes(key) ? options.booleanLabels[record[key] ? 0 : 1] : scalar(key))) ?? options.defaultLabel;
|
|
687
687
|
const status = firstText(...options.statusKeys.map(scalar));
|
|
688
688
|
const variant = scalar("variant") ?? options.defaultVariant;
|
|
689
689
|
const tone = record.tone;
|
|
@@ -1357,7 +1357,8 @@ var ArchivePill = createBadgeFamily({
|
|
|
1357
1357
|
defaultVariant: "archive",
|
|
1358
1358
|
labelKeys: ["label", "text", "status", "state", "isArchived", "value"],
|
|
1359
1359
|
statusKeys: ["status", "state", "isArchived", "value"],
|
|
1360
|
-
booleanProps: ["isArchived", "value"]
|
|
1360
|
+
booleanProps: ["isArchived", "value"],
|
|
1361
|
+
booleanLabels: ["Archived", "Not archived"]
|
|
1361
1362
|
});
|
|
1362
1363
|
var CancellationBadge = createBadgeFamily({
|
|
1363
1364
|
component: "CancellationBadge",
|
|
@@ -1366,7 +1367,8 @@ var CancellationBadge = createBadgeFamily({
|
|
|
1366
1367
|
defaultVariant: "cancellation",
|
|
1367
1368
|
labelKeys: ["label", "text", "status", "state", "cancelAtPeriodEnd", "value"],
|
|
1368
1369
|
statusKeys: ["status", "state", "cancelAtPeriodEnd", "isCancelled", "value"],
|
|
1369
|
-
booleanProps: ["cancelAtPeriodEnd", "isCancelled", "value"]
|
|
1370
|
+
booleanProps: ["cancelAtPeriodEnd", "isCancelled", "value"],
|
|
1371
|
+
booleanLabels: ["Cancellation scheduled", "No cancellation scheduled"]
|
|
1370
1372
|
});
|
|
1371
1373
|
var ArchiveSummary = React3.forwardRef(
|
|
1372
1374
|
({ title, label, heading, name, isArchived, archived, status, archivedAt, reason, archiveReason, summary: summary2, text, description, children, className, ...rest }, ref) => {
|
|
@@ -1386,7 +1388,7 @@ ArchiveSummary.displayName = "OODS.ArchiveSummary";
|
|
|
1386
1388
|
var PriceCardMeta = React3.forwardRef(
|
|
1387
1389
|
({ title, label, heading, name, model, pricingModel, interval, billingInterval, children, className, ...rest }, ref) => {
|
|
1388
1390
|
const content = childContent(children);
|
|
1389
|
-
const terms = [["Model", firstText(model, pricingModel)], ["Interval", firstText(interval, billingInterval)]].filter((entry) => entry[1] !== void 0);
|
|
1391
|
+
const terms = [["Model", formatPriceCode(firstText(model, pricingModel))], ["Interval", formatPriceCode(firstText(interval, billingInterval))]].filter((entry) => entry[1] !== void 0);
|
|
1390
1392
|
return /* @__PURE__ */ jsx("div", { ref, className: classes3("oods-price-card-meta", className), "data-oods-component": "PriceCardMeta", "data-meta-type": "price", ...rest, children: content.authored || content.scalar !== void 0 ? children : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1391
1393
|
/* @__PURE__ */ jsx("span", { "data-meta-title": "true", children: firstText(title, label, heading, name) ?? "Price" }),
|
|
1392
1394
|
terms.map(([term, value]) => /* @__PURE__ */ jsxs("span", { "data-meta-item": "true", children: [
|
package/dist/ported.cjs
CHANGED
|
@@ -508,17 +508,16 @@ var InputPrimitive = React3__namespace.forwardRef(
|
|
|
508
508
|
InputPrimitive.displayName = "OODS.Input";
|
|
509
509
|
var Input = InputPrimitive;
|
|
510
510
|
var DatePicker = React3__namespace.forwardRef(
|
|
511
|
-
({ pickerClassName, pickerStyle, inputClassName, inputStyle, ...rest }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
511
|
+
({ pickerClassName, pickerStyle, inputClassName, inputStyle, className, style, ...rest }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes("oods-date-picker", className), style, "data-oods-component": "DatePicker", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
512
512
|
Input,
|
|
513
513
|
{
|
|
514
514
|
ref,
|
|
515
515
|
type: "date",
|
|
516
|
-
"data-oods-component": "DatePicker",
|
|
517
516
|
inputClassName: classes("form-field__date-picker", inputClassName, pickerClassName),
|
|
518
517
|
inputStyle: { ...inputStyle, ...pickerStyle },
|
|
519
518
|
...rest
|
|
520
519
|
}
|
|
521
|
-
)
|
|
520
|
+
) })
|
|
522
521
|
);
|
|
523
522
|
DatePicker.displayName = "OODS.DatePicker";
|
|
524
523
|
var Checkbox = React3__namespace.forwardRef(
|
|
@@ -746,12 +745,12 @@ var Badge = React3__namespace.forwardRef(
|
|
|
746
745
|
const resolvedContent = children ?? content ?? presentation?.label ?? status;
|
|
747
746
|
const resolvedIcon = icon ?? resolveStatusGlyph(presentation?.iconName);
|
|
748
747
|
const resolvedShowIcon = showIcon ?? resolvedIcon !== void 0;
|
|
749
|
-
const iconNode = resolvedShowIcon && resolvedIcon ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "oods-badge__icon
|
|
748
|
+
const iconNode = resolvedShowIcon && resolvedIcon ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "oods-badge__icon", "aria-hidden": "true", children: resolvedIcon }) : null;
|
|
750
749
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
751
750
|
"span",
|
|
752
751
|
{
|
|
753
752
|
ref,
|
|
754
|
-
className: classes2("oods-badge",
|
|
753
|
+
className: classes2("oods-badge", className),
|
|
755
754
|
"data-oods-component": "Badge",
|
|
756
755
|
"data-status": status,
|
|
757
756
|
"data-domain": domain,
|
|
@@ -763,16 +762,12 @@ var Badge = React3__namespace.forwardRef(
|
|
|
763
762
|
"--cmp-badge-background": tokenSet.background,
|
|
764
763
|
"--cmp-badge-border": tokenSet.border,
|
|
765
764
|
"--cmp-badge-text": tokenSet.foreground,
|
|
766
|
-
"--statusable-badge-background": tokenSet.background,
|
|
767
|
-
"--statusable-badge-border": tokenSet.border,
|
|
768
|
-
"--statusable-badge-foreground": tokenSet.foreground,
|
|
769
|
-
"--statusable-badge-icon-color": tokenSet.foreground,
|
|
770
765
|
...style
|
|
771
766
|
},
|
|
772
767
|
...rest,
|
|
773
768
|
children: [
|
|
774
769
|
iconPosition === "start" ? iconNode : null,
|
|
775
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "oods-badge__label
|
|
770
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "oods-badge__label", children: resolvedContent }),
|
|
776
771
|
iconPosition === "end" ? iconNode : null
|
|
777
772
|
]
|
|
778
773
|
}
|
|
@@ -814,7 +809,7 @@ var Banner = React3__namespace.forwardRef(
|
|
|
814
809
|
ref,
|
|
815
810
|
role,
|
|
816
811
|
"aria-live": role === "alert" ? "assertive" : "polite",
|
|
817
|
-
className: classes2("oods-banner",
|
|
812
|
+
className: classes2("oods-banner", className),
|
|
818
813
|
"data-oods-component": "Banner",
|
|
819
814
|
"data-status": status,
|
|
820
815
|
"data-domain": domain,
|
|
@@ -824,25 +819,21 @@ var Banner = React3__namespace.forwardRef(
|
|
|
824
819
|
"--cmp-banner-background": tokenSet.background,
|
|
825
820
|
"--cmp-banner-border": tokenSet.border,
|
|
826
821
|
"--cmp-banner-text": tokenSet.foreground,
|
|
827
|
-
"--statusable-banner-background": tokenSet.background,
|
|
828
|
-
"--statusable-banner-border": tokenSet.border,
|
|
829
|
-
"--statusable-banner-foreground": tokenSet.foreground,
|
|
830
|
-
"--statusable-banner-icon-color": tokenSet.foreground,
|
|
831
822
|
...style
|
|
832
823
|
},
|
|
833
824
|
...rest,
|
|
834
825
|
children: [
|
|
835
|
-
resolvedShowIcon && resolvedIcon ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "oods-banner__icon
|
|
836
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "oods-banner__content
|
|
837
|
-
heading ? /* @__PURE__ */ jsxRuntime.jsx("strong", { className: "oods-banner__title
|
|
838
|
-
body ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "oods-banner__detail
|
|
839
|
-
actions ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "oods-banner__actions
|
|
826
|
+
resolvedShowIcon && resolvedIcon ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "oods-banner__icon", "aria-hidden": "true", children: resolvedIcon }) : null,
|
|
827
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "oods-banner__content", children: [
|
|
828
|
+
heading ? /* @__PURE__ */ jsxRuntime.jsx("strong", { className: "oods-banner__title", children: heading }) : null,
|
|
829
|
+
body ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "oods-banner__detail", children: body }) : null,
|
|
830
|
+
actions ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "oods-banner__actions", children: actions }) : null
|
|
840
831
|
] }),
|
|
841
832
|
onDismiss ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
842
833
|
"button",
|
|
843
834
|
{
|
|
844
835
|
type: "button",
|
|
845
|
-
className: "oods-banner-dismiss oods-banner__dismiss
|
|
836
|
+
className: "oods-banner-dismiss oods-banner__dismiss",
|
|
846
837
|
"aria-label": dismissLabel,
|
|
847
838
|
onClick: () => onDismiss(),
|
|
848
839
|
children: /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", children: "\xD7" })
|
|
@@ -965,6 +956,7 @@ var StatusBadge = React3__namespace.forwardRef(
|
|
|
965
956
|
compact,
|
|
966
957
|
variant,
|
|
967
958
|
title,
|
|
959
|
+
className,
|
|
968
960
|
"aria-label": ariaLabel,
|
|
969
961
|
...rest
|
|
970
962
|
}, ref) => {
|
|
@@ -982,6 +974,7 @@ var StatusBadge = React3__namespace.forwardRef(
|
|
|
982
974
|
content: children ?? content,
|
|
983
975
|
title: title ?? presentation.description,
|
|
984
976
|
"aria-label": ariaLabel ?? label ?? `Status: ${presentation.label}`,
|
|
977
|
+
className: classes3("oods-status-badge", className),
|
|
985
978
|
"data-oods-component": "StatusBadge",
|
|
986
979
|
...rest
|
|
987
980
|
}
|
|
@@ -1120,29 +1113,29 @@ var TimelinePrimitive = React3__namespace.forwardRef(
|
|
|
1120
1113
|
"data-timeline-type": kind,
|
|
1121
1114
|
...rest,
|
|
1122
1115
|
children: [
|
|
1123
|
-
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "oods-timeline__title", children: title }),
|
|
1116
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "oods-timeline__title", "data-timeline-title": "true", children: title }),
|
|
1124
1117
|
kind === "status" && status ? /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "oods-timeline__current", "data-timeline-current": "true", children: [
|
|
1125
1118
|
"Current status: ",
|
|
1126
1119
|
humanize(status)
|
|
1127
1120
|
] }) : null,
|
|
1128
|
-
transitionCount > 0 ? /* @__PURE__ */ jsxRuntime.jsxs("p", { children: [
|
|
1121
|
+
transitionCount > 0 ? /* @__PURE__ */ jsxRuntime.jsxs("p", { "data-timeline-transitions": "true", children: [
|
|
1129
1122
|
"Allowed transitions: ",
|
|
1130
1123
|
allowedTransitions?.join(", ")
|
|
1131
1124
|
] }) : null,
|
|
1132
|
-
children ?? /* @__PURE__ */ jsxRuntime.jsx("ol", { className: "oods-timeline__events", children: visibleEvents.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("li", { "data-timeline-empty": "true", children: "No events" }) : visibleEvents.map((event, index) => {
|
|
1125
|
+
children ?? /* @__PURE__ */ jsxRuntime.jsx("ol", { className: "oods-timeline__events", "data-timeline-events": "true", children: visibleEvents.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("li", { "data-timeline-empty": "true", children: "No events" }) : visibleEvents.map((event, index) => {
|
|
1133
1126
|
const timestamp = event.timestamp ?? event.datetime;
|
|
1134
1127
|
const actor = event.actor ?? event.actorId ?? event.actor_id;
|
|
1135
1128
|
const eventLabel = event.label ?? event.title ?? (event.from && event.to ? `${humanize(event.from)} \u2192 ${humanize(event.to)}` : void 0) ?? (event.status ? humanize(event.status) : void 0) ?? (event.state ? humanize(event.state) : void 0) ?? "Event";
|
|
1136
1129
|
const detail = event.detail ?? event.description;
|
|
1137
1130
|
return /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsxs("article", { className: "oods-timeline__event", "data-timeline-event": "true", children: [
|
|
1138
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "oods-timeline__label", children: eventLabel }),
|
|
1139
|
-
timestamp ? /* @__PURE__ */ jsxRuntime.jsx("time", { dateTime: timestamp, children: componentContracts.formatDateTime(timestamp) }) : null,
|
|
1140
|
-
detail ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "oods-timeline__detail", children: detail }) : null,
|
|
1141
|
-
showActorId && actor ? /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "oods-timeline__actor", children: [
|
|
1131
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "oods-timeline__label", "data-timeline-label": "true", children: eventLabel }),
|
|
1132
|
+
timestamp ? /* @__PURE__ */ jsxRuntime.jsx("time", { "data-timeline-time": "true", dateTime: timestamp, children: componentContracts.formatDateTime(timestamp) }) : null,
|
|
1133
|
+
detail ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "oods-timeline__detail", "data-timeline-detail": "true", children: detail }) : null,
|
|
1134
|
+
showActorId && actor ? /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "oods-timeline__actor", "data-timeline-actor": "true", children: [
|
|
1142
1135
|
"Actor: ",
|
|
1143
1136
|
actor
|
|
1144
1137
|
] }) : null,
|
|
1145
|
-
showReason && event.reason ? /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "oods-timeline__reason", children: [
|
|
1138
|
+
showReason && event.reason ? /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "oods-timeline__reason", "data-timeline-reason": "true", children: [
|
|
1146
1139
|
"Reason: ",
|
|
1147
1140
|
event.reason
|
|
1148
1141
|
] }) : null
|
package/dist/ported.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { AuditTimeline, CancellationSummary, PaginationBar, PriceBadge, RelativeTimestamp, SearchInput, StatusBadge, StatusTimeline } from './chunk-
|
|
1
|
+
export { AuditTimeline, CancellationSummary, PaginationBar, PriceBadge, RelativeTimestamp, SearchInput, StatusBadge, StatusTimeline } from './chunk-BPEHI36W.js';
|
|
2
2
|
import './chunk-G74PKSW3.js';
|
package/dist/table.cjs
CHANGED
|
@@ -468,7 +468,7 @@ var TableRoot = React__namespace.forwardRef(
|
|
|
468
468
|
...rest,
|
|
469
469
|
children: children ?? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
470
470
|
caption ? /* @__PURE__ */ jsxRuntime.jsx(TableCaption, { children: caption }) : null,
|
|
471
|
-
/* @__PURE__ */ jsxRuntime.jsx(TableHead, { children: /* @__PURE__ */ jsxRuntime.jsx("tr", { children: columns?.map((column) => /* @__PURE__ */ jsxRuntime.jsx(TableHeaderCell, { numeric: column.numeric, children: column.label }, column.key)) }) }),
|
|
471
|
+
/* @__PURE__ */ jsxRuntime.jsx(TableHead, { children: /* @__PURE__ */ jsxRuntime.jsx("tr", { className: "oods-table__row", children: columns?.map((column) => /* @__PURE__ */ jsxRuntime.jsx(TableHeaderCell, { numeric: column.numeric, children: column.label }, column.key)) }) }),
|
|
472
472
|
/* @__PURE__ */ jsxRuntime.jsx(TableBody, { children: (rows?.length ?? 0) === 0 ? /* @__PURE__ */ jsxRuntime.jsx("tr", { className: "oods-table__row", children: /* @__PURE__ */ jsxRuntime.jsx(TableCell, { colSpan: Math.max(columns?.length ?? 0, 1), children: "No rows available." }) }) : rows?.map((row) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
473
473
|
"tr",
|
|
474
474
|
{
|
package/dist/table.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Table, TableBody, TableCaption, TableCell, TableHead, TableHeaderCell, TableRow } from './chunk-
|
|
1
|
+
export { Table, TableBody, TableCaption, TableCell, TableHead, TableHeaderCell, TableRow } from './chunk-XAWAMZUQ.js';
|
|
2
2
|
import './chunk-G74PKSW3.js';
|
package/package.json
CHANGED
|
@@ -1,11 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oods/components-react",
|
|
3
|
-
"version": "0.3.
|
|
4
|
-
"description": "OODS
|
|
3
|
+
"version": "0.3.3",
|
|
4
|
+
"description": "React components for OODS Foundry: the controls, layouts and domain views its generated screens use.",
|
|
5
|
+
"homepage": "https://oods-foundry.com/",
|
|
6
|
+
"bugs": {
|
|
7
|
+
"email": "derek@derekn.com"
|
|
8
|
+
},
|
|
9
|
+
"keywords": [
|
|
10
|
+
"oods",
|
|
11
|
+
"oods-foundry",
|
|
12
|
+
"react",
|
|
13
|
+
"components",
|
|
14
|
+
"design-system",
|
|
15
|
+
"accessibility"
|
|
16
|
+
],
|
|
5
17
|
"type": "module",
|
|
6
18
|
"license": "Apache-2.0",
|
|
7
19
|
"engines": {
|
|
8
|
-
"node": ">=
|
|
20
|
+
"node": ">=22.0.0"
|
|
9
21
|
},
|
|
10
22
|
"files": [
|
|
11
23
|
"dist",
|
|
@@ -52,8 +64,8 @@
|
|
|
52
64
|
],
|
|
53
65
|
"dependencies": {
|
|
54
66
|
"@radix-ui/react-slot": "^1.1.2",
|
|
55
|
-
"@oods/component-contracts": "0.3.
|
|
56
|
-
"@oods/component-styles": "0.3.
|
|
67
|
+
"@oods/component-contracts": "0.3.3",
|
|
68
|
+
"@oods/component-styles": "0.3.3"
|
|
57
69
|
},
|
|
58
70
|
"peerDependencies": {
|
|
59
71
|
"react": ">=18 <20",
|