@oods/components-react 0.3.0 → 0.3.2

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
@@ -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 Forge's `code_generate` with `options.output: "application"` for an app entry and Vite configuration.
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 Forge's substitution mapping and inspect its advisory contract report.
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.2/LICENSE) and [NOTICE](https://cdn.jsdelivr.net/npm/@oods/components-react@0.3.2/NOTICE). Generated output belongs to its user; installed package dependencies retain their own licenses.
package/dist/index.cjs CHANGED
@@ -2398,7 +2398,7 @@ function createBadgeFamily(options) {
2398
2398
  return typeof value === "string" && value.trim().length > 0 ? value : void 0;
2399
2399
  };
2400
2400
  const content = childContent(children);
2401
- const label = content.scalar ?? firstText(...options.labelKeys.map((key) => options.component === "CancellationBadge" && typeof record[key] === "boolean" && options.booleanProps?.includes(key) ? record[key] ? "Cancellation scheduled" : "No cancellation scheduled" : scalar(key))) ?? options.defaultLabel;
2401
+ 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
2402
  const status = firstText(...options.statusKeys.map(scalar));
2403
2403
  const variant = scalar("variant") ?? options.defaultVariant;
2404
2404
  const tone = record.tone;
@@ -3072,7 +3072,8 @@ var ArchivePill = createBadgeFamily({
3072
3072
  defaultVariant: "archive",
3073
3073
  labelKeys: ["label", "text", "status", "state", "isArchived", "value"],
3074
3074
  statusKeys: ["status", "state", "isArchived", "value"],
3075
- booleanProps: ["isArchived", "value"]
3075
+ booleanProps: ["isArchived", "value"],
3076
+ booleanLabels: ["Archived", "Not archived"]
3076
3077
  });
3077
3078
  var CancellationBadge = createBadgeFamily({
3078
3079
  component: "CancellationBadge",
@@ -3081,7 +3082,8 @@ var CancellationBadge = createBadgeFamily({
3081
3082
  defaultVariant: "cancellation",
3082
3083
  labelKeys: ["label", "text", "status", "state", "cancelAtPeriodEnd", "value"],
3083
3084
  statusKeys: ["status", "state", "cancelAtPeriodEnd", "isCancelled", "value"],
3084
- booleanProps: ["cancelAtPeriodEnd", "isCancelled", "value"]
3085
+ booleanProps: ["cancelAtPeriodEnd", "isCancelled", "value"],
3086
+ booleanLabels: ["Cancellation scheduled", "No cancellation scheduled"]
3085
3087
  });
3086
3088
  var ArchiveSummary = React7__namespace.forwardRef(
3087
3089
  ({ title, label, heading, name, isArchived, archived, status, archivedAt, reason, archiveReason, summary: summary2, text, description, children, className, ...rest }, ref) => {
@@ -3101,7 +3103,7 @@ ArchiveSummary.displayName = "OODS.ArchiveSummary";
3101
3103
  var PriceCardMeta = React7__namespace.forwardRef(
3102
3104
  ({ title, label, heading, name, model, pricingModel, interval, billingInterval, children, className, ...rest }, ref) => {
3103
3105
  const content = childContent(children);
3104
- const terms = [["Model", firstText(model, pricingModel)], ["Interval", firstText(interval, billingInterval)]].filter((entry) => entry[1] !== void 0);
3106
+ const terms = [["Model", componentContracts.formatPriceCode(firstText(model, pricingModel))], ["Interval", componentContracts.formatPriceCode(firstText(interval, billingInterval))]].filter((entry) => entry[1] !== void 0);
3105
3107
  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
3108
  /* @__PURE__ */ jsxRuntime.jsx("span", { "data-meta-title": "true", children: firstText(title, label, heading, name) ?? "Price" }),
3107
3109
  terms.map(([term, value]) => /* @__PURE__ */ jsxRuntime.jsxs("span", { "data-meta-item": "true", children: [
package/dist/index.js CHANGED
@@ -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.component === "CancellationBadge" && typeof record[key] === "boolean" && options.booleanProps?.includes(key) ? record[key] ? "Cancellation scheduled" : "No cancellation scheduled" : scalar(key))) ?? options.defaultLabel;
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/package.json CHANGED
@@ -1,11 +1,23 @@
1
1
  {
2
2
  "name": "@oods/components-react",
3
- "version": "0.3.0",
4
- "description": "OODS React component package.",
3
+ "version": "0.3.2",
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.11.1"
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.0",
56
- "@oods/component-styles": "0.3.0"
67
+ "@oods/component-contracts": "0.3.2",
68
+ "@oods/component-styles": "0.3.2"
57
69
  },
58
70
  "peerDependencies": {
59
71
  "react": ">=18 <20",