@oods/components-vue 0.3.1 → 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 @@ Vue components used by screens generated with OODS Foundry. The package exports
8
8
  npm install @oods/components-vue @oods/component-styles @oods/tokens @oods/component-contracts vue
9
9
  ```
10
10
 
11
- Use Vue 3. Bring your existing Vue app or use Forge's `code_generate` with `options.output: "application"` for an app entry and Vite configuration.
11
+ Use Vue 3. Bring your existing Vue 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
 
@@ -26,7 +26,7 @@ const review = () => window.alert('Connect this action to your application.');
26
26
 
27
27
  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.
28
28
 
29
- 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.
29
+ 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.
30
30
 
31
31
  ## Limits
32
32
 
@@ -34,4 +34,4 @@ Use matching versions of the OODS packages. These packages are separate from the
34
34
 
35
35
  ## License
36
36
 
37
- Apache License 2.0. See [LICENSE](LICENSE) and [NOTICE](NOTICE). Generated output belongs to its user; installed package dependencies retain their own licenses.
37
+ Apache License 2.0. See [LICENSE](https://cdn.jsdelivr.net/npm/@oods/components-vue@0.3.2/LICENSE) and [NOTICE](https://cdn.jsdelivr.net/npm/@oods/components-vue@0.3.2/NOTICE). Generated output belongs to its user; installed package dependencies retain their own licenses.
package/dist/index.cjs CHANGED
@@ -721,7 +721,7 @@ function createBadgeFamily(options) {
721
721
  const content = authoredContent(slots.default?.());
722
722
  const scalar = scalarContent(content);
723
723
  const read = (key) => typeof record[key] === "boolean" && options.booleanProps?.includes(key) ? String(record[key]) : record[key];
724
- const label = scalar ?? firstText(...options.labelKeys.map((key) => options.component === "CancellationBadge" && typeof record[key] === "boolean" && options.booleanProps?.includes(key) ? record[key] ? "Cancellation scheduled" : "No cancellation scheduled" : read(key))) ?? options.defaultLabel;
724
+ const label = scalar ?? firstText(...options.labelKeys.map((key) => options.booleanLabels && typeof record[key] === "boolean" && options.booleanProps?.includes(key) ? options.booleanLabels[record[key] ? 0 : 1] : read(key))) ?? options.defaultLabel;
725
725
  const status = firstText(...options.statusKeys.map(read));
726
726
  const variant = firstText(record.variant) ?? options.defaultVariant;
727
727
  return vue.h(Badge, {
@@ -1364,7 +1364,8 @@ var ArchivePill = createBadgeFamily({
1364
1364
  labelKeys: ["label", "text", "status", "state", "isArchived", "value"],
1365
1365
  statusKeys: ["status", "state", "isArchived", "value"],
1366
1366
  extraProps: ["isArchived"],
1367
- booleanProps: ["isArchived", "value"]
1367
+ booleanProps: ["isArchived", "value"],
1368
+ booleanLabels: ["Archived", "Not archived"]
1368
1369
  });
1369
1370
  var CancellationBadge = createBadgeFamily({
1370
1371
  component: "CancellationBadge",
@@ -1374,7 +1375,8 @@ var CancellationBadge = createBadgeFamily({
1374
1375
  labelKeys: ["label", "text", "status", "state", "cancelAtPeriodEnd", "value"],
1375
1376
  statusKeys: ["status", "state", "cancelAtPeriodEnd", "isCancelled", "value"],
1376
1377
  extraProps: ["cancelAtPeriodEnd", "isCancelled"],
1377
- booleanProps: ["cancelAtPeriodEnd", "isCancelled", "value"]
1378
+ booleanProps: ["cancelAtPeriodEnd", "isCancelled", "value"],
1379
+ booleanLabels: ["Cancellation scheduled", "No cancellation scheduled"]
1378
1380
  });
1379
1381
  var ArchiveSummary = vue.defineComponent({
1380
1382
  name: "OodsArchiveSummary",
@@ -1397,7 +1399,7 @@ var PriceCardMeta = vue.defineComponent({
1397
1399
  setup(props, { slots }) {
1398
1400
  return () => {
1399
1401
  const content = authoredContent(slots.default?.());
1400
- const terms = [["Model", firstText(props.model, props.pricingModel)], ["Interval", firstText(props.interval, props.billingInterval)]].filter((entry) => entry[1] !== void 0);
1402
+ const terms = [["Model", componentContracts.formatPriceCode(firstText(props.model, props.pricingModel))], ["Interval", componentContracts.formatPriceCode(firstText(props.interval, props.billingInterval))]].filter((entry) => entry[1] !== void 0);
1401
1403
  return vue.h("div", { class: "oods-price-card-meta", "data-oods-component": "PriceCardMeta", "data-meta-type": "price" }, content.length ? content : [
1402
1404
  vue.h("span", { "data-meta-title": "true" }, firstText(props.title, props.label, props.heading, props.name) ?? "Price"),
1403
1405
  ...terms.map(([term, value]) => vue.h("span", { key: term, "data-meta-item": "true" }, [vue.h("strong", `${term}:`), ` ${value}`]))
package/dist/index.js CHANGED
@@ -719,7 +719,7 @@ function createBadgeFamily(options) {
719
719
  const content = authoredContent(slots.default?.());
720
720
  const scalar = scalarContent(content);
721
721
  const read = (key) => typeof record[key] === "boolean" && options.booleanProps?.includes(key) ? String(record[key]) : record[key];
722
- const label = scalar ?? firstText(...options.labelKeys.map((key) => options.component === "CancellationBadge" && typeof record[key] === "boolean" && options.booleanProps?.includes(key) ? record[key] ? "Cancellation scheduled" : "No cancellation scheduled" : read(key))) ?? options.defaultLabel;
722
+ const label = scalar ?? firstText(...options.labelKeys.map((key) => options.booleanLabels && typeof record[key] === "boolean" && options.booleanProps?.includes(key) ? options.booleanLabels[record[key] ? 0 : 1] : read(key))) ?? options.defaultLabel;
723
723
  const status = firstText(...options.statusKeys.map(read));
724
724
  const variant = firstText(record.variant) ?? options.defaultVariant;
725
725
  return h(Badge, {
@@ -1362,7 +1362,8 @@ var ArchivePill = createBadgeFamily({
1362
1362
  labelKeys: ["label", "text", "status", "state", "isArchived", "value"],
1363
1363
  statusKeys: ["status", "state", "isArchived", "value"],
1364
1364
  extraProps: ["isArchived"],
1365
- booleanProps: ["isArchived", "value"]
1365
+ booleanProps: ["isArchived", "value"],
1366
+ booleanLabels: ["Archived", "Not archived"]
1366
1367
  });
1367
1368
  var CancellationBadge = createBadgeFamily({
1368
1369
  component: "CancellationBadge",
@@ -1372,7 +1373,8 @@ var CancellationBadge = createBadgeFamily({
1372
1373
  labelKeys: ["label", "text", "status", "state", "cancelAtPeriodEnd", "value"],
1373
1374
  statusKeys: ["status", "state", "cancelAtPeriodEnd", "isCancelled", "value"],
1374
1375
  extraProps: ["cancelAtPeriodEnd", "isCancelled"],
1375
- booleanProps: ["cancelAtPeriodEnd", "isCancelled", "value"]
1376
+ booleanProps: ["cancelAtPeriodEnd", "isCancelled", "value"],
1377
+ booleanLabels: ["Cancellation scheduled", "No cancellation scheduled"]
1376
1378
  });
1377
1379
  var ArchiveSummary = defineComponent({
1378
1380
  name: "OodsArchiveSummary",
@@ -1395,7 +1397,7 @@ var PriceCardMeta = defineComponent({
1395
1397
  setup(props, { slots }) {
1396
1398
  return () => {
1397
1399
  const content = authoredContent(slots.default?.());
1398
- const terms = [["Model", firstText(props.model, props.pricingModel)], ["Interval", firstText(props.interval, props.billingInterval)]].filter((entry) => entry[1] !== void 0);
1400
+ const terms = [["Model", formatPriceCode(firstText(props.model, props.pricingModel))], ["Interval", formatPriceCode(firstText(props.interval, props.billingInterval))]].filter((entry) => entry[1] !== void 0);
1399
1401
  return h("div", { class: "oods-price-card-meta", "data-oods-component": "PriceCardMeta", "data-meta-type": "price" }, content.length ? content : [
1400
1402
  h("span", { "data-meta-title": "true" }, firstText(props.title, props.label, props.heading, props.name) ?? "Price"),
1401
1403
  ...terms.map(([term, value]) => h("span", { key: term, "data-meta-item": "true" }, [h("strong", `${term}:`), ` ${value}`]))
package/package.json CHANGED
@@ -1,11 +1,23 @@
1
1
  {
2
2
  "name": "@oods/components-vue",
3
- "version": "0.3.1",
4
- "description": "OODS Vue 3 component package.",
3
+ "version": "0.3.2",
4
+ "description": "Vue 3 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
+ "vue",
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",
@@ -41,8 +53,8 @@
41
53
  "**/*.css"
42
54
  ],
43
55
  "dependencies": {
44
- "@oods/component-contracts": "0.3.1",
45
- "@oods/component-styles": "0.3.1"
56
+ "@oods/component-contracts": "0.3.2",
57
+ "@oods/component-styles": "0.3.2"
46
58
  },
47
59
  "peerDependencies": {
48
60
  "vue": "^3.5.0"