@oods/components-vue 0.3.2 → 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 CHANGED
@@ -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](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.
37
+ Apache License 2.0. See [LICENSE](https://cdn.jsdelivr.net/npm/@oods/components-vue@0.3.3/LICENSE) and [NOTICE](https://cdn.jsdelivr.net/npm/@oods/components-vue@0.3.3/NOTICE). Generated output belongs to its user; installed package dependencies retain their own licenses.
package/dist/index.cjs CHANGED
@@ -91,8 +91,8 @@ var Badge = vue.defineComponent({
91
91
  "--cmp-badge-text": `var(--sys-status-${palette}-text)`
92
92
  }
93
93
  }, [
94
- props.icon || slots.icon ? vue.h("span", { class: "oods-badge-icon", "aria-hidden": "true" }, [slotOrValue(slots.icon, props.icon)]) : null,
95
- slotOrValue(slots.default, props.content ?? statusLabel(props.status))
94
+ props.icon || slots.icon ? vue.h("span", { class: "oods-badge__icon", "aria-hidden": "true" }, [slotOrValue(slots.icon, props.icon)]) : null,
95
+ vue.h("span", { class: "oods-badge__label" }, [slotOrValue(slots.default, props.content ?? statusLabel(props.status))])
96
96
  ]);
97
97
  };
98
98
  }
@@ -116,7 +116,7 @@ var Banner = vue.defineComponent({
116
116
  return () => {
117
117
  const tone = resolveTone(props.tone, props.status, props.domain);
118
118
  const palette = tokenTone(tone);
119
- return vue.h("section", {
119
+ return vue.h("div", {
120
120
  class: "oods-banner",
121
121
  "data-oods-component": "Banner",
122
122
  "data-status": props.status,
@@ -131,17 +131,17 @@ var Banner = vue.defineComponent({
131
131
  "--cmp-banner-text": `var(--sys-status-${palette}-text)`
132
132
  }
133
133
  }, [
134
- vue.h("div", { class: "oods-banner-content" }, [
135
- props.title || props.status || slots.title ? vue.h("strong", { class: "oods-banner-title" }, [
134
+ vue.h("div", { class: "oods-banner__content" }, [
135
+ props.title || props.status || slots.title ? vue.h("strong", { class: "oods-banner__title" }, [
136
136
  slotOrValue(slots.title, props.title || statusLabel(props.status))
137
137
  ]) : null,
138
- props.detail ? vue.h("p", { class: "oods-banner-detail" }, props.detail) : null,
139
- slots.default || props.content ? vue.h(slots.default ? "div" : "p", { class: "oods-banner-body" }, [slotOrValue(slots.default, props.content)]) : null,
140
- slots.actions ? vue.h("div", { class: "oods-banner-actions" }, slots.actions()) : null
138
+ props.detail ? vue.h("p", { class: "oods-banner__detail" }, props.detail) : null,
139
+ slots.default || props.content ? vue.h(slots.default ? "div" : "p", { class: "oods-banner__body" }, [slotOrValue(slots.default, props.content)]) : null,
140
+ slots.actions ? vue.h("div", { class: "oods-banner__actions" }, slots.actions()) : null
141
141
  ]),
142
142
  props.dismissLabel ? vue.h("button", {
143
143
  type: "button",
144
- class: "oods-banner-dismiss",
144
+ class: "oods-banner-dismiss oods-banner__dismiss",
145
145
  "aria-label": props.dismissLabel,
146
146
  onClick: () => emit("dismiss")
147
147
  }, [vue.h("span", { "aria-hidden": "true" }, "\xD7")]) : null
@@ -433,6 +433,7 @@ var ColorizedBadge = vue.defineComponent({
433
433
  const color = firstText(props.color, props.hue, props.swatch, props.state);
434
434
  const variant = firstText(props.variant) ?? "colorized";
435
435
  return vue.h(Badge, {
436
+ class: "oods-colorized-badge",
436
437
  status,
437
438
  tone: props.tone,
438
439
  emphasis: props.emphasis,
@@ -1506,7 +1507,9 @@ var Input = vue.defineComponent({
1506
1507
  name: "OodsInput",
1507
1508
  props: {
1508
1509
  ...textFieldProps,
1509
- type: { type: String, default: "text" }
1510
+ type: { type: String, default: "text" },
1511
+ /** A class for the input element itself, as React's inputClassName; the field's own class stays on its frame. */
1512
+ inputClass: String
1510
1513
  },
1511
1514
  emits: {
1512
1515
  "update:modelValue": (_value) => true,
@@ -1524,7 +1527,7 @@ var Input = vue.defineComponent({
1524
1527
  };
1525
1528
  return () => renderField("Input", props, slots, metadata, vue.h("input", {
1526
1529
  id: metadata.controlId.value,
1527
- class: "oods-field-control",
1530
+ class: props.inputClass ? ["oods-field-control", props.inputClass] : "oods-field-control",
1528
1531
  type: props.type,
1529
1532
  name: props.name,
1530
1533
  value: props.type === "datetime-local" ? componentContracts.dateTimeInputValue(currentValue.value) : currentValue.value,
@@ -1727,25 +1730,25 @@ var Checkbox = vue.defineComponent({
1727
1730
  var TableCaption = vue.defineComponent({
1728
1731
  name: "OodsTableCaption",
1729
1732
  setup(_props, { slots }) {
1730
- return () => vue.h("caption", {}, slots.default?.());
1733
+ return () => vue.h("caption", { class: "oods-table__caption" }, slots.default?.());
1731
1734
  }
1732
1735
  });
1733
1736
  var TableHead = vue.defineComponent({
1734
1737
  name: "OodsTableHead",
1735
1738
  setup(_props, { slots }) {
1736
- return () => vue.h("thead", {}, slots.default?.());
1739
+ return () => vue.h("thead", { class: "oods-table__header" }, slots.default?.());
1737
1740
  }
1738
1741
  });
1739
1742
  var TableBody = vue.defineComponent({
1740
1743
  name: "OodsTableBody",
1741
1744
  setup(_props, { slots }) {
1742
- return () => vue.h("tbody", {}, slots.default?.());
1745
+ return () => vue.h("tbody", { class: "oods-table__body" }, slots.default?.());
1743
1746
  }
1744
1747
  });
1745
1748
  var TableRow = vue.defineComponent({
1746
1749
  name: "OodsTableRow",
1747
1750
  setup(_props, { slots }) {
1748
- return () => vue.h("tr", {}, slots.default?.());
1751
+ return () => vue.h("tr", { class: "oods-table__row" }, slots.default?.());
1749
1752
  }
1750
1753
  });
1751
1754
  var TableHeaderCell = vue.defineComponent({
@@ -1754,17 +1757,18 @@ var TableHeaderCell = vue.defineComponent({
1754
1757
  scope: { type: String, default: "col" }
1755
1758
  },
1756
1759
  setup(props, { slots }) {
1757
- return () => vue.h("th", { scope: props.scope }, slots.default?.());
1760
+ return () => vue.h("th", { class: "oods-table__header-cell", scope: props.scope }, slots.default?.());
1758
1761
  }
1759
1762
  });
1760
1763
  var TableCell = vue.defineComponent({
1761
1764
  name: "OodsTableCell",
1762
1765
  setup(_props, { slots }) {
1763
- return () => vue.h("td", {}, slots.default?.());
1766
+ return () => vue.h("td", { class: "oods-table__cell" }, slots.default?.());
1764
1767
  }
1765
1768
  });
1766
1769
  var Table = vue.defineComponent({
1767
1770
  name: "OodsTable",
1771
+ inheritAttrs: false,
1768
1772
  props: {
1769
1773
  caption: { type: String, default: "" },
1770
1774
  columns: { type: Array, default: () => [] },
@@ -1775,16 +1779,17 @@ var Table = vue.defineComponent({
1775
1779
  emits: {
1776
1780
  rowActivate: (_rowId) => true
1777
1781
  },
1778
- setup(props, { emit, slots }) {
1782
+ setup(props, { attrs, emit, slots }) {
1779
1783
  const activate = (row) => emit("rowActivate", row.id);
1780
- return () => vue.h("table", {
1781
- class: "oods-table",
1784
+ return () => vue.h("div", { class: "oods-table__container", "data-density": props.density }, [vue.h("table", {
1785
+ ...attrs,
1786
+ class: ["oods-table", attrs.class],
1782
1787
  "data-oods-component": "Table",
1783
1788
  "data-density": props.density
1784
1789
  }, [
1785
- vue.h(TableCaption, {}, {
1790
+ slots.caption || props.caption ? vue.h(TableCaption, {}, {
1786
1791
  default: () => slots.caption?.() ?? props.caption
1787
- }),
1792
+ }) : null,
1788
1793
  vue.h(TableHead, {}, {
1789
1794
  default: () => slots.head?.() ?? vue.h(TableRow, {}, {
1790
1795
  default: () => props.columns.map((column) => vue.h(TableHeaderCell, { key: column.key }, {
@@ -1799,7 +1804,7 @@ var Table = vue.defineComponent({
1799
1804
  }, {
1800
1805
  default: () => "No rows available."
1801
1806
  })
1802
- }) : props.rows.map((row, rowIndex) => slots.row?.({ row, rowIndex, activate: () => activate(row) }) ?? vue.h(TableRow, { key: row.id }, {
1807
+ }) : props.rows.map((row, rowIndex) => slots.row?.({ row, rowIndex, activate: () => activate(row) }) ?? vue.h(TableRow, { key: row.id, "data-selectable": props.selectable ? "true" : void 0 }, {
1803
1808
  default: () => props.columns.map((column, columnIndex) => {
1804
1809
  const content = slots.cell?.({ row, column, value: row[column.key] }) ?? String(row[column.key] ?? "");
1805
1810
  return vue.h(TableCell, { key: column.key }, {
@@ -1812,7 +1817,7 @@ var Table = vue.defineComponent({
1812
1817
  })
1813
1818
  })))
1814
1819
  })
1815
- ]);
1820
+ ])]);
1816
1821
  }
1817
1822
  });
1818
1823
  function itemDisabled(item) {
@@ -2334,12 +2339,12 @@ var timelineProps = {
2334
2339
  };
2335
2340
  function renderTimelineEvent(event, index, showActorId, showReason) {
2336
2341
  return vue.h("li", { key: `${event.timestamp ?? "event"}-${index}` }, [
2337
- vue.h("article", { "data-timeline-event": "true" }, [
2338
- vue.h("p", { "data-timeline-label": "true" }, event.label),
2342
+ vue.h("article", { class: "oods-timeline__event", "data-timeline-event": "true" }, [
2343
+ vue.h("p", { class: "oods-timeline__label", "data-timeline-label": "true" }, event.label),
2339
2344
  event.timestamp ? vue.h("time", { "data-timeline-time": "true", datetime: event.timestamp }, componentContracts.formatDateTime(event.timestamp)) : null,
2340
- event.detail ? vue.h("p", { "data-timeline-detail": "true" }, event.detail) : null,
2341
- showActorId && event.actorId ? vue.h("p", { "data-timeline-actor": "true" }, `Actor: ${event.actorId}`) : null,
2342
- showReason && event.reason ? vue.h("p", { "data-timeline-reason": "true" }, `Reason: ${event.reason}`) : null
2345
+ event.detail ? vue.h("p", { class: "oods-timeline__detail", "data-timeline-detail": "true" }, event.detail) : null,
2346
+ showActorId && event.actorId ? vue.h("p", { class: "oods-timeline__actor", "data-timeline-actor": "true" }, `Actor: ${event.actorId}`) : null,
2347
+ showReason && event.reason ? vue.h("p", { class: "oods-timeline__reason", "data-timeline-reason": "true" }, `Reason: ${event.reason}`) : null
2343
2348
  ])
2344
2349
  ]);
2345
2350
  }
@@ -2357,16 +2362,16 @@ function timelineComponent(configuration) {
2357
2362
  const slottedEvents = slots.default?.();
2358
2363
  return vue.h("div", {
2359
2364
  ...attrs,
2360
- class: mergedClass("oods-timeline", attrs.class),
2365
+ class: mergedClass(`oods-timeline oods-${configuration.timelineType}-timeline`, attrs.class),
2361
2366
  role: "log",
2362
2367
  "aria-label": stringValue(attrs["aria-label"]) ?? title,
2363
2368
  "data-oods-component": configuration.componentId,
2364
2369
  "data-timeline-type": configuration.timelineType
2365
2370
  }, [
2366
- vue.h("h2", { "data-timeline-title": "true" }, title),
2367
- props.status ? vue.h("p", { "data-timeline-current": "true" }, `Current status: ${statusLabel2(props.status)}`) : null,
2371
+ vue.h("h2", { class: "oods-timeline__title", "data-timeline-title": "true" }, title),
2372
+ props.status ? vue.h("p", { class: "oods-timeline__current", "data-timeline-current": "true" }, `Current status: ${statusLabel2(props.status)}`) : null,
2368
2373
  props.allowedTransitions?.length ? vue.h("p", { "data-timeline-transitions": "true" }, `Allowed transitions: ${props.allowedTransitions.join(", ")}`) : null,
2369
- vue.h("ol", { "data-timeline-events": "true" }, slottedEvents?.length ? slottedEvents : events.length ? events.map((event, index) => renderTimelineEvent(
2374
+ vue.h("ol", { class: "oods-timeline__events", "data-timeline-events": "true" }, slottedEvents?.length ? slottedEvents : events.length ? events.map((event, index) => renderTimelineEvent(
2370
2375
  event,
2371
2376
  index,
2372
2377
  props.showActorId,
@@ -2522,8 +2527,7 @@ var SearchInput = vue.defineComponent({
2522
2527
  updateValue("");
2523
2528
  emit("clear");
2524
2529
  };
2525
- const submit = (event) => {
2526
- event.preventDefault();
2530
+ const searchNow = () => {
2527
2531
  if (!props.disabled) {
2528
2532
  if (timer !== void 0) clearTimeout(timer);
2529
2533
  emitSearch(currentValue.value);
@@ -2532,14 +2536,13 @@ var SearchInput = vue.defineComponent({
2532
2536
  return () => {
2533
2537
  const id = props.id ?? `oods-search-${generatedId.replace(/:/g, "")}`;
2534
2538
  const ariaLabel = stringValue(attrs["aria-label"]) ?? props.label ?? props.placeholder;
2535
- return vue.h("form", {
2539
+ return vue.h("div", {
2536
2540
  ...attrs,
2537
2541
  class: mergedClass("oods-search-input", attrs.class),
2538
2542
  role: "search",
2539
2543
  "aria-label": ariaLabel,
2540
2544
  "data-oods-component": "SearchInput",
2541
- "data-behavioral": "search",
2542
- onSubmit: submit
2545
+ "data-behavioral": "search"
2543
2546
  }, [
2544
2547
  vue.h(Input, {
2545
2548
  id,
@@ -2548,14 +2551,20 @@ var SearchInput = vue.defineComponent({
2548
2551
  value: currentValue.value,
2549
2552
  placeholder: props.placeholder,
2550
2553
  disabled: props.disabled,
2554
+ inputClass: "oods-search-input__control",
2551
2555
  "aria-label": props.label ? void 0 : ariaLabel,
2552
2556
  onInput: (value) => updateValue(value),
2553
2557
  onKeydown: (event) => {
2554
2558
  if (event.key === "Escape") clear();
2559
+ if (event.key === "Enter") {
2560
+ event.preventDefault();
2561
+ searchNow();
2562
+ }
2555
2563
  }
2556
2564
  }),
2557
2565
  props.clearable && currentValue.value ? vue.h("button", {
2558
2566
  type: "button",
2567
+ class: "oods-search-input__clear",
2559
2568
  "data-search-clear": "true",
2560
2569
  "aria-label": "Clear search",
2561
2570
  disabled: props.disabled,
@@ -2965,7 +2974,7 @@ function summary(id) {
2965
2974
  } });
2966
2975
  }
2967
2976
  function preview(id, type) {
2968
- return vue.defineComponent({ name: id, props: { svg: String, title: String, description: String, width: Number, height: Number }, setup(props, { slots }) {
2977
+ return vue.defineComponent({ name: id, props: { svg: String, svgNarrow: String, svgWide: String, title: String, description: String, width: Number, height: Number }, setup(props, { slots }) {
2969
2978
  return () => vue.h(VizAreaPreview, { ...props, title: props.title ?? `${type[0].toUpperCase()}${type.slice(1)} chart`, "data-oods-component": id, "data-viz-preview-type": type }, { default: slots.default ?? (() => vue.h(Text, { content: "No rendered chart supplied" })) });
2970
2979
  } });
2971
2980
  }
package/dist/index.d.cts CHANGED
@@ -1705,6 +1705,8 @@ declare const Input: vue.DefineComponent<vue.ExtractPropTypes<{
1705
1705
  type: StringConstructor;
1706
1706
  default: string;
1707
1707
  };
1708
+ /** A class for the input element itself, as React's inputClassName; the field's own class stays on its frame. */
1709
+ inputClass: StringConstructor;
1708
1710
  id: StringConstructor;
1709
1711
  label: StringConstructor;
1710
1712
  modelValue: StringConstructor;
@@ -1734,6 +1736,8 @@ declare const Input: vue.DefineComponent<vue.ExtractPropTypes<{
1734
1736
  type: StringConstructor;
1735
1737
  default: string;
1736
1738
  };
1739
+ /** A class for the input element itself, as React's inputClassName; the field's own class stays on its frame. */
1740
+ inputClass: StringConstructor;
1737
1741
  id: StringConstructor;
1738
1742
  label: StringConstructor;
1739
1743
  modelValue: StringConstructor;
@@ -3972,6 +3976,8 @@ declare const VizRoleBadge: vue.DefineComponent<vue.ExtractPropTypes<{
3972
3976
  }, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
3973
3977
  declare const VizHeatmapPreview: vue.DefineComponent<vue.ExtractPropTypes<{
3974
3978
  svg: StringConstructor;
3979
+ svgNarrow: StringConstructor;
3980
+ svgWide: StringConstructor;
3975
3981
  title: StringConstructor;
3976
3982
  description: StringConstructor;
3977
3983
  width: NumberConstructor;
@@ -3980,6 +3986,8 @@ declare const VizHeatmapPreview: vue.DefineComponent<vue.ExtractPropTypes<{
3980
3986
  [key: string]: any;
3981
3987
  }>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
3982
3988
  svg: StringConstructor;
3989
+ svgNarrow: StringConstructor;
3990
+ svgWide: StringConstructor;
3983
3991
  title: StringConstructor;
3984
3992
  description: StringConstructor;
3985
3993
  width: NumberConstructor;
@@ -3987,6 +3995,8 @@ declare const VizHeatmapPreview: vue.DefineComponent<vue.ExtractPropTypes<{
3987
3995
  }>> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
3988
3996
  declare const VizGraphPreview: vue.DefineComponent<vue.ExtractPropTypes<{
3989
3997
  svg: StringConstructor;
3998
+ svgNarrow: StringConstructor;
3999
+ svgWide: StringConstructor;
3990
4000
  title: StringConstructor;
3991
4001
  description: StringConstructor;
3992
4002
  width: NumberConstructor;
@@ -3995,6 +4005,8 @@ declare const VizGraphPreview: vue.DefineComponent<vue.ExtractPropTypes<{
3995
4005
  [key: string]: any;
3996
4006
  }>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
3997
4007
  svg: StringConstructor;
4008
+ svgNarrow: StringConstructor;
4009
+ svgWide: StringConstructor;
3998
4010
  title: StringConstructor;
3999
4011
  description: StringConstructor;
4000
4012
  width: NumberConstructor;
@@ -4002,6 +4014,8 @@ declare const VizGraphPreview: vue.DefineComponent<vue.ExtractPropTypes<{
4002
4014
  }>> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
4003
4015
  declare const VizLinePreview: vue.DefineComponent<vue.ExtractPropTypes<{
4004
4016
  svg: StringConstructor;
4017
+ svgNarrow: StringConstructor;
4018
+ svgWide: StringConstructor;
4005
4019
  title: StringConstructor;
4006
4020
  description: StringConstructor;
4007
4021
  width: NumberConstructor;
@@ -4010,6 +4024,8 @@ declare const VizLinePreview: vue.DefineComponent<vue.ExtractPropTypes<{
4010
4024
  [key: string]: any;
4011
4025
  }>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
4012
4026
  svg: StringConstructor;
4027
+ svgNarrow: StringConstructor;
4028
+ svgWide: StringConstructor;
4013
4029
  title: StringConstructor;
4014
4030
  description: StringConstructor;
4015
4031
  width: NumberConstructor;
@@ -4017,6 +4033,8 @@ declare const VizLinePreview: vue.DefineComponent<vue.ExtractPropTypes<{
4017
4033
  }>> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
4018
4034
  declare const VizMarkPreview: vue.DefineComponent<vue.ExtractPropTypes<{
4019
4035
  svg: StringConstructor;
4036
+ svgNarrow: StringConstructor;
4037
+ svgWide: StringConstructor;
4020
4038
  title: StringConstructor;
4021
4039
  description: StringConstructor;
4022
4040
  width: NumberConstructor;
@@ -4025,6 +4043,8 @@ declare const VizMarkPreview: vue.DefineComponent<vue.ExtractPropTypes<{
4025
4043
  [key: string]: any;
4026
4044
  }>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
4027
4045
  svg: StringConstructor;
4046
+ svgNarrow: StringConstructor;
4047
+ svgWide: StringConstructor;
4028
4048
  title: StringConstructor;
4029
4049
  description: StringConstructor;
4030
4050
  width: NumberConstructor;
@@ -4032,6 +4052,8 @@ declare const VizMarkPreview: vue.DefineComponent<vue.ExtractPropTypes<{
4032
4052
  }>> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
4033
4053
  declare const VizPointPreview: vue.DefineComponent<vue.ExtractPropTypes<{
4034
4054
  svg: StringConstructor;
4055
+ svgNarrow: StringConstructor;
4056
+ svgWide: StringConstructor;
4035
4057
  title: StringConstructor;
4036
4058
  description: StringConstructor;
4037
4059
  width: NumberConstructor;
@@ -4040,6 +4062,8 @@ declare const VizPointPreview: vue.DefineComponent<vue.ExtractPropTypes<{
4040
4062
  [key: string]: any;
4041
4063
  }>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
4042
4064
  svg: StringConstructor;
4065
+ svgNarrow: StringConstructor;
4066
+ svgWide: StringConstructor;
4043
4067
  title: StringConstructor;
4044
4068
  description: StringConstructor;
4045
4069
  width: NumberConstructor;
@@ -4047,6 +4071,8 @@ declare const VizPointPreview: vue.DefineComponent<vue.ExtractPropTypes<{
4047
4071
  }>> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
4048
4072
  declare const VizScatterPreview: vue.DefineComponent<vue.ExtractPropTypes<{
4049
4073
  svg: StringConstructor;
4074
+ svgNarrow: StringConstructor;
4075
+ svgWide: StringConstructor;
4050
4076
  title: StringConstructor;
4051
4077
  description: StringConstructor;
4052
4078
  width: NumberConstructor;
@@ -4055,6 +4081,8 @@ declare const VizScatterPreview: vue.DefineComponent<vue.ExtractPropTypes<{
4055
4081
  [key: string]: any;
4056
4082
  }>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
4057
4083
  svg: StringConstructor;
4084
+ svgNarrow: StringConstructor;
4085
+ svgWide: StringConstructor;
4058
4086
  title: StringConstructor;
4059
4087
  description: StringConstructor;
4060
4088
  width: NumberConstructor;
package/dist/index.d.ts CHANGED
@@ -1705,6 +1705,8 @@ declare const Input: vue.DefineComponent<vue.ExtractPropTypes<{
1705
1705
  type: StringConstructor;
1706
1706
  default: string;
1707
1707
  };
1708
+ /** A class for the input element itself, as React's inputClassName; the field's own class stays on its frame. */
1709
+ inputClass: StringConstructor;
1708
1710
  id: StringConstructor;
1709
1711
  label: StringConstructor;
1710
1712
  modelValue: StringConstructor;
@@ -1734,6 +1736,8 @@ declare const Input: vue.DefineComponent<vue.ExtractPropTypes<{
1734
1736
  type: StringConstructor;
1735
1737
  default: string;
1736
1738
  };
1739
+ /** A class for the input element itself, as React's inputClassName; the field's own class stays on its frame. */
1740
+ inputClass: StringConstructor;
1737
1741
  id: StringConstructor;
1738
1742
  label: StringConstructor;
1739
1743
  modelValue: StringConstructor;
@@ -3972,6 +3976,8 @@ declare const VizRoleBadge: vue.DefineComponent<vue.ExtractPropTypes<{
3972
3976
  }, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
3973
3977
  declare const VizHeatmapPreview: vue.DefineComponent<vue.ExtractPropTypes<{
3974
3978
  svg: StringConstructor;
3979
+ svgNarrow: StringConstructor;
3980
+ svgWide: StringConstructor;
3975
3981
  title: StringConstructor;
3976
3982
  description: StringConstructor;
3977
3983
  width: NumberConstructor;
@@ -3980,6 +3986,8 @@ declare const VizHeatmapPreview: vue.DefineComponent<vue.ExtractPropTypes<{
3980
3986
  [key: string]: any;
3981
3987
  }>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
3982
3988
  svg: StringConstructor;
3989
+ svgNarrow: StringConstructor;
3990
+ svgWide: StringConstructor;
3983
3991
  title: StringConstructor;
3984
3992
  description: StringConstructor;
3985
3993
  width: NumberConstructor;
@@ -3987,6 +3995,8 @@ declare const VizHeatmapPreview: vue.DefineComponent<vue.ExtractPropTypes<{
3987
3995
  }>> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
3988
3996
  declare const VizGraphPreview: vue.DefineComponent<vue.ExtractPropTypes<{
3989
3997
  svg: StringConstructor;
3998
+ svgNarrow: StringConstructor;
3999
+ svgWide: StringConstructor;
3990
4000
  title: StringConstructor;
3991
4001
  description: StringConstructor;
3992
4002
  width: NumberConstructor;
@@ -3995,6 +4005,8 @@ declare const VizGraphPreview: vue.DefineComponent<vue.ExtractPropTypes<{
3995
4005
  [key: string]: any;
3996
4006
  }>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
3997
4007
  svg: StringConstructor;
4008
+ svgNarrow: StringConstructor;
4009
+ svgWide: StringConstructor;
3998
4010
  title: StringConstructor;
3999
4011
  description: StringConstructor;
4000
4012
  width: NumberConstructor;
@@ -4002,6 +4014,8 @@ declare const VizGraphPreview: vue.DefineComponent<vue.ExtractPropTypes<{
4002
4014
  }>> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
4003
4015
  declare const VizLinePreview: vue.DefineComponent<vue.ExtractPropTypes<{
4004
4016
  svg: StringConstructor;
4017
+ svgNarrow: StringConstructor;
4018
+ svgWide: StringConstructor;
4005
4019
  title: StringConstructor;
4006
4020
  description: StringConstructor;
4007
4021
  width: NumberConstructor;
@@ -4010,6 +4024,8 @@ declare const VizLinePreview: vue.DefineComponent<vue.ExtractPropTypes<{
4010
4024
  [key: string]: any;
4011
4025
  }>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
4012
4026
  svg: StringConstructor;
4027
+ svgNarrow: StringConstructor;
4028
+ svgWide: StringConstructor;
4013
4029
  title: StringConstructor;
4014
4030
  description: StringConstructor;
4015
4031
  width: NumberConstructor;
@@ -4017,6 +4033,8 @@ declare const VizLinePreview: vue.DefineComponent<vue.ExtractPropTypes<{
4017
4033
  }>> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
4018
4034
  declare const VizMarkPreview: vue.DefineComponent<vue.ExtractPropTypes<{
4019
4035
  svg: StringConstructor;
4036
+ svgNarrow: StringConstructor;
4037
+ svgWide: StringConstructor;
4020
4038
  title: StringConstructor;
4021
4039
  description: StringConstructor;
4022
4040
  width: NumberConstructor;
@@ -4025,6 +4043,8 @@ declare const VizMarkPreview: vue.DefineComponent<vue.ExtractPropTypes<{
4025
4043
  [key: string]: any;
4026
4044
  }>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
4027
4045
  svg: StringConstructor;
4046
+ svgNarrow: StringConstructor;
4047
+ svgWide: StringConstructor;
4028
4048
  title: StringConstructor;
4029
4049
  description: StringConstructor;
4030
4050
  width: NumberConstructor;
@@ -4032,6 +4052,8 @@ declare const VizMarkPreview: vue.DefineComponent<vue.ExtractPropTypes<{
4032
4052
  }>> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
4033
4053
  declare const VizPointPreview: vue.DefineComponent<vue.ExtractPropTypes<{
4034
4054
  svg: StringConstructor;
4055
+ svgNarrow: StringConstructor;
4056
+ svgWide: StringConstructor;
4035
4057
  title: StringConstructor;
4036
4058
  description: StringConstructor;
4037
4059
  width: NumberConstructor;
@@ -4040,6 +4062,8 @@ declare const VizPointPreview: vue.DefineComponent<vue.ExtractPropTypes<{
4040
4062
  [key: string]: any;
4041
4063
  }>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
4042
4064
  svg: StringConstructor;
4065
+ svgNarrow: StringConstructor;
4066
+ svgWide: StringConstructor;
4043
4067
  title: StringConstructor;
4044
4068
  description: StringConstructor;
4045
4069
  width: NumberConstructor;
@@ -4047,6 +4071,8 @@ declare const VizPointPreview: vue.DefineComponent<vue.ExtractPropTypes<{
4047
4071
  }>> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
4048
4072
  declare const VizScatterPreview: vue.DefineComponent<vue.ExtractPropTypes<{
4049
4073
  svg: StringConstructor;
4074
+ svgNarrow: StringConstructor;
4075
+ svgWide: StringConstructor;
4050
4076
  title: StringConstructor;
4051
4077
  description: StringConstructor;
4052
4078
  width: NumberConstructor;
@@ -4055,6 +4081,8 @@ declare const VizScatterPreview: vue.DefineComponent<vue.ExtractPropTypes<{
4055
4081
  [key: string]: any;
4056
4082
  }>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
4057
4083
  svg: StringConstructor;
4084
+ svgNarrow: StringConstructor;
4085
+ svgWide: StringConstructor;
4058
4086
  title: StringConstructor;
4059
4087
  description: StringConstructor;
4060
4088
  width: NumberConstructor;
package/dist/index.js CHANGED
@@ -89,8 +89,8 @@ var Badge = defineComponent({
89
89
  "--cmp-badge-text": `var(--sys-status-${palette}-text)`
90
90
  }
91
91
  }, [
92
- props.icon || slots.icon ? h("span", { class: "oods-badge-icon", "aria-hidden": "true" }, [slotOrValue(slots.icon, props.icon)]) : null,
93
- slotOrValue(slots.default, props.content ?? statusLabel(props.status))
92
+ props.icon || slots.icon ? h("span", { class: "oods-badge__icon", "aria-hidden": "true" }, [slotOrValue(slots.icon, props.icon)]) : null,
93
+ h("span", { class: "oods-badge__label" }, [slotOrValue(slots.default, props.content ?? statusLabel(props.status))])
94
94
  ]);
95
95
  };
96
96
  }
@@ -114,7 +114,7 @@ var Banner = defineComponent({
114
114
  return () => {
115
115
  const tone = resolveTone(props.tone, props.status, props.domain);
116
116
  const palette = tokenTone(tone);
117
- return h("section", {
117
+ return h("div", {
118
118
  class: "oods-banner",
119
119
  "data-oods-component": "Banner",
120
120
  "data-status": props.status,
@@ -129,17 +129,17 @@ var Banner = defineComponent({
129
129
  "--cmp-banner-text": `var(--sys-status-${palette}-text)`
130
130
  }
131
131
  }, [
132
- h("div", { class: "oods-banner-content" }, [
133
- props.title || props.status || slots.title ? h("strong", { class: "oods-banner-title" }, [
132
+ h("div", { class: "oods-banner__content" }, [
133
+ props.title || props.status || slots.title ? h("strong", { class: "oods-banner__title" }, [
134
134
  slotOrValue(slots.title, props.title || statusLabel(props.status))
135
135
  ]) : null,
136
- props.detail ? h("p", { class: "oods-banner-detail" }, props.detail) : null,
137
- slots.default || props.content ? h(slots.default ? "div" : "p", { class: "oods-banner-body" }, [slotOrValue(slots.default, props.content)]) : null,
138
- slots.actions ? h("div", { class: "oods-banner-actions" }, slots.actions()) : null
136
+ props.detail ? h("p", { class: "oods-banner__detail" }, props.detail) : null,
137
+ slots.default || props.content ? h(slots.default ? "div" : "p", { class: "oods-banner__body" }, [slotOrValue(slots.default, props.content)]) : null,
138
+ slots.actions ? h("div", { class: "oods-banner__actions" }, slots.actions()) : null
139
139
  ]),
140
140
  props.dismissLabel ? h("button", {
141
141
  type: "button",
142
- class: "oods-banner-dismiss",
142
+ class: "oods-banner-dismiss oods-banner__dismiss",
143
143
  "aria-label": props.dismissLabel,
144
144
  onClick: () => emit("dismiss")
145
145
  }, [h("span", { "aria-hidden": "true" }, "\xD7")]) : null
@@ -431,6 +431,7 @@ var ColorizedBadge = defineComponent({
431
431
  const color = firstText(props.color, props.hue, props.swatch, props.state);
432
432
  const variant = firstText(props.variant) ?? "colorized";
433
433
  return h(Badge, {
434
+ class: "oods-colorized-badge",
434
435
  status,
435
436
  tone: props.tone,
436
437
  emphasis: props.emphasis,
@@ -1504,7 +1505,9 @@ var Input = defineComponent({
1504
1505
  name: "OodsInput",
1505
1506
  props: {
1506
1507
  ...textFieldProps,
1507
- type: { type: String, default: "text" }
1508
+ type: { type: String, default: "text" },
1509
+ /** A class for the input element itself, as React's inputClassName; the field's own class stays on its frame. */
1510
+ inputClass: String
1508
1511
  },
1509
1512
  emits: {
1510
1513
  "update:modelValue": (_value) => true,
@@ -1522,7 +1525,7 @@ var Input = defineComponent({
1522
1525
  };
1523
1526
  return () => renderField("Input", props, slots, metadata, h("input", {
1524
1527
  id: metadata.controlId.value,
1525
- class: "oods-field-control",
1528
+ class: props.inputClass ? ["oods-field-control", props.inputClass] : "oods-field-control",
1526
1529
  type: props.type,
1527
1530
  name: props.name,
1528
1531
  value: props.type === "datetime-local" ? dateTimeInputValue(currentValue.value) : currentValue.value,
@@ -1725,25 +1728,25 @@ var Checkbox = defineComponent({
1725
1728
  var TableCaption = defineComponent({
1726
1729
  name: "OodsTableCaption",
1727
1730
  setup(_props, { slots }) {
1728
- return () => h("caption", {}, slots.default?.());
1731
+ return () => h("caption", { class: "oods-table__caption" }, slots.default?.());
1729
1732
  }
1730
1733
  });
1731
1734
  var TableHead = defineComponent({
1732
1735
  name: "OodsTableHead",
1733
1736
  setup(_props, { slots }) {
1734
- return () => h("thead", {}, slots.default?.());
1737
+ return () => h("thead", { class: "oods-table__header" }, slots.default?.());
1735
1738
  }
1736
1739
  });
1737
1740
  var TableBody = defineComponent({
1738
1741
  name: "OodsTableBody",
1739
1742
  setup(_props, { slots }) {
1740
- return () => h("tbody", {}, slots.default?.());
1743
+ return () => h("tbody", { class: "oods-table__body" }, slots.default?.());
1741
1744
  }
1742
1745
  });
1743
1746
  var TableRow = defineComponent({
1744
1747
  name: "OodsTableRow",
1745
1748
  setup(_props, { slots }) {
1746
- return () => h("tr", {}, slots.default?.());
1749
+ return () => h("tr", { class: "oods-table__row" }, slots.default?.());
1747
1750
  }
1748
1751
  });
1749
1752
  var TableHeaderCell = defineComponent({
@@ -1752,17 +1755,18 @@ var TableHeaderCell = defineComponent({
1752
1755
  scope: { type: String, default: "col" }
1753
1756
  },
1754
1757
  setup(props, { slots }) {
1755
- return () => h("th", { scope: props.scope }, slots.default?.());
1758
+ return () => h("th", { class: "oods-table__header-cell", scope: props.scope }, slots.default?.());
1756
1759
  }
1757
1760
  });
1758
1761
  var TableCell = defineComponent({
1759
1762
  name: "OodsTableCell",
1760
1763
  setup(_props, { slots }) {
1761
- return () => h("td", {}, slots.default?.());
1764
+ return () => h("td", { class: "oods-table__cell" }, slots.default?.());
1762
1765
  }
1763
1766
  });
1764
1767
  var Table = defineComponent({
1765
1768
  name: "OodsTable",
1769
+ inheritAttrs: false,
1766
1770
  props: {
1767
1771
  caption: { type: String, default: "" },
1768
1772
  columns: { type: Array, default: () => [] },
@@ -1773,16 +1777,17 @@ var Table = defineComponent({
1773
1777
  emits: {
1774
1778
  rowActivate: (_rowId) => true
1775
1779
  },
1776
- setup(props, { emit, slots }) {
1780
+ setup(props, { attrs, emit, slots }) {
1777
1781
  const activate = (row) => emit("rowActivate", row.id);
1778
- return () => h("table", {
1779
- class: "oods-table",
1782
+ return () => h("div", { class: "oods-table__container", "data-density": props.density }, [h("table", {
1783
+ ...attrs,
1784
+ class: ["oods-table", attrs.class],
1780
1785
  "data-oods-component": "Table",
1781
1786
  "data-density": props.density
1782
1787
  }, [
1783
- h(TableCaption, {}, {
1788
+ slots.caption || props.caption ? h(TableCaption, {}, {
1784
1789
  default: () => slots.caption?.() ?? props.caption
1785
- }),
1790
+ }) : null,
1786
1791
  h(TableHead, {}, {
1787
1792
  default: () => slots.head?.() ?? h(TableRow, {}, {
1788
1793
  default: () => props.columns.map((column) => h(TableHeaderCell, { key: column.key }, {
@@ -1797,7 +1802,7 @@ var Table = defineComponent({
1797
1802
  }, {
1798
1803
  default: () => "No rows available."
1799
1804
  })
1800
- }) : props.rows.map((row, rowIndex) => slots.row?.({ row, rowIndex, activate: () => activate(row) }) ?? h(TableRow, { key: row.id }, {
1805
+ }) : props.rows.map((row, rowIndex) => slots.row?.({ row, rowIndex, activate: () => activate(row) }) ?? h(TableRow, { key: row.id, "data-selectable": props.selectable ? "true" : void 0 }, {
1801
1806
  default: () => props.columns.map((column, columnIndex) => {
1802
1807
  const content = slots.cell?.({ row, column, value: row[column.key] }) ?? String(row[column.key] ?? "");
1803
1808
  return h(TableCell, { key: column.key }, {
@@ -1810,7 +1815,7 @@ var Table = defineComponent({
1810
1815
  })
1811
1816
  })))
1812
1817
  })
1813
- ]);
1818
+ ])]);
1814
1819
  }
1815
1820
  });
1816
1821
  function itemDisabled(item) {
@@ -2332,12 +2337,12 @@ var timelineProps = {
2332
2337
  };
2333
2338
  function renderTimelineEvent(event, index, showActorId, showReason) {
2334
2339
  return h("li", { key: `${event.timestamp ?? "event"}-${index}` }, [
2335
- h("article", { "data-timeline-event": "true" }, [
2336
- h("p", { "data-timeline-label": "true" }, event.label),
2340
+ h("article", { class: "oods-timeline__event", "data-timeline-event": "true" }, [
2341
+ h("p", { class: "oods-timeline__label", "data-timeline-label": "true" }, event.label),
2337
2342
  event.timestamp ? h("time", { "data-timeline-time": "true", datetime: event.timestamp }, formatDateTime(event.timestamp)) : null,
2338
- event.detail ? h("p", { "data-timeline-detail": "true" }, event.detail) : null,
2339
- showActorId && event.actorId ? h("p", { "data-timeline-actor": "true" }, `Actor: ${event.actorId}`) : null,
2340
- showReason && event.reason ? h("p", { "data-timeline-reason": "true" }, `Reason: ${event.reason}`) : null
2343
+ event.detail ? h("p", { class: "oods-timeline__detail", "data-timeline-detail": "true" }, event.detail) : null,
2344
+ showActorId && event.actorId ? h("p", { class: "oods-timeline__actor", "data-timeline-actor": "true" }, `Actor: ${event.actorId}`) : null,
2345
+ showReason && event.reason ? h("p", { class: "oods-timeline__reason", "data-timeline-reason": "true" }, `Reason: ${event.reason}`) : null
2341
2346
  ])
2342
2347
  ]);
2343
2348
  }
@@ -2355,16 +2360,16 @@ function timelineComponent(configuration) {
2355
2360
  const slottedEvents = slots.default?.();
2356
2361
  return h("div", {
2357
2362
  ...attrs,
2358
- class: mergedClass("oods-timeline", attrs.class),
2363
+ class: mergedClass(`oods-timeline oods-${configuration.timelineType}-timeline`, attrs.class),
2359
2364
  role: "log",
2360
2365
  "aria-label": stringValue(attrs["aria-label"]) ?? title,
2361
2366
  "data-oods-component": configuration.componentId,
2362
2367
  "data-timeline-type": configuration.timelineType
2363
2368
  }, [
2364
- h("h2", { "data-timeline-title": "true" }, title),
2365
- props.status ? h("p", { "data-timeline-current": "true" }, `Current status: ${statusLabel2(props.status)}`) : null,
2369
+ h("h2", { class: "oods-timeline__title", "data-timeline-title": "true" }, title),
2370
+ props.status ? h("p", { class: "oods-timeline__current", "data-timeline-current": "true" }, `Current status: ${statusLabel2(props.status)}`) : null,
2366
2371
  props.allowedTransitions?.length ? h("p", { "data-timeline-transitions": "true" }, `Allowed transitions: ${props.allowedTransitions.join(", ")}`) : null,
2367
- h("ol", { "data-timeline-events": "true" }, slottedEvents?.length ? slottedEvents : events.length ? events.map((event, index) => renderTimelineEvent(
2372
+ h("ol", { class: "oods-timeline__events", "data-timeline-events": "true" }, slottedEvents?.length ? slottedEvents : events.length ? events.map((event, index) => renderTimelineEvent(
2368
2373
  event,
2369
2374
  index,
2370
2375
  props.showActorId,
@@ -2520,8 +2525,7 @@ var SearchInput = defineComponent({
2520
2525
  updateValue("");
2521
2526
  emit("clear");
2522
2527
  };
2523
- const submit = (event) => {
2524
- event.preventDefault();
2528
+ const searchNow = () => {
2525
2529
  if (!props.disabled) {
2526
2530
  if (timer !== void 0) clearTimeout(timer);
2527
2531
  emitSearch(currentValue.value);
@@ -2530,14 +2534,13 @@ var SearchInput = defineComponent({
2530
2534
  return () => {
2531
2535
  const id = props.id ?? `oods-search-${generatedId.replace(/:/g, "")}`;
2532
2536
  const ariaLabel = stringValue(attrs["aria-label"]) ?? props.label ?? props.placeholder;
2533
- return h("form", {
2537
+ return h("div", {
2534
2538
  ...attrs,
2535
2539
  class: mergedClass("oods-search-input", attrs.class),
2536
2540
  role: "search",
2537
2541
  "aria-label": ariaLabel,
2538
2542
  "data-oods-component": "SearchInput",
2539
- "data-behavioral": "search",
2540
- onSubmit: submit
2543
+ "data-behavioral": "search"
2541
2544
  }, [
2542
2545
  h(Input, {
2543
2546
  id,
@@ -2546,14 +2549,20 @@ var SearchInput = defineComponent({
2546
2549
  value: currentValue.value,
2547
2550
  placeholder: props.placeholder,
2548
2551
  disabled: props.disabled,
2552
+ inputClass: "oods-search-input__control",
2549
2553
  "aria-label": props.label ? void 0 : ariaLabel,
2550
2554
  onInput: (value) => updateValue(value),
2551
2555
  onKeydown: (event) => {
2552
2556
  if (event.key === "Escape") clear();
2557
+ if (event.key === "Enter") {
2558
+ event.preventDefault();
2559
+ searchNow();
2560
+ }
2553
2561
  }
2554
2562
  }),
2555
2563
  props.clearable && currentValue.value ? h("button", {
2556
2564
  type: "button",
2565
+ class: "oods-search-input__clear",
2557
2566
  "data-search-clear": "true",
2558
2567
  "aria-label": "Clear search",
2559
2568
  disabled: props.disabled,
@@ -2963,7 +2972,7 @@ function summary(id) {
2963
2972
  } });
2964
2973
  }
2965
2974
  function preview(id, type) {
2966
- return defineComponent({ name: id, props: { svg: String, title: String, description: String, width: Number, height: Number }, setup(props, { slots }) {
2975
+ return defineComponent({ name: id, props: { svg: String, svgNarrow: String, svgWide: String, title: String, description: String, width: Number, height: Number }, setup(props, { slots }) {
2967
2976
  return () => h(VizAreaPreview, { ...props, title: props.title ?? `${type[0].toUpperCase()}${type.slice(1)} chart`, "data-oods-component": id, "data-viz-preview-type": type }, { default: slots.default ?? (() => h(Text, { content: "No rendered chart supplied" })) });
2968
2977
  } });
2969
2978
  }
package/dist/ported.cjs CHANGED
@@ -91,8 +91,8 @@ var Badge = vue.defineComponent({
91
91
  "--cmp-badge-text": `var(--sys-status-${palette}-text)`
92
92
  }
93
93
  }, [
94
- props.icon || slots.icon ? vue.h("span", { class: "oods-badge-icon", "aria-hidden": "true" }, [slotOrValue(slots.icon, props.icon)]) : null,
95
- slotOrValue(slots.default, props.content ?? statusLabel(props.status))
94
+ props.icon || slots.icon ? vue.h("span", { class: "oods-badge__icon", "aria-hidden": "true" }, [slotOrValue(slots.icon, props.icon)]) : null,
95
+ vue.h("span", { class: "oods-badge__label" }, [slotOrValue(slots.default, props.content ?? statusLabel(props.status))])
96
96
  ]);
97
97
  };
98
98
  }
@@ -116,7 +116,7 @@ vue.defineComponent({
116
116
  return () => {
117
117
  const tone = resolveTone(props.tone, props.status, props.domain);
118
118
  const palette = tokenTone(tone);
119
- return vue.h("section", {
119
+ return vue.h("div", {
120
120
  class: "oods-banner",
121
121
  "data-oods-component": "Banner",
122
122
  "data-status": props.status,
@@ -131,17 +131,17 @@ vue.defineComponent({
131
131
  "--cmp-banner-text": `var(--sys-status-${palette}-text)`
132
132
  }
133
133
  }, [
134
- vue.h("div", { class: "oods-banner-content" }, [
135
- props.title || props.status || slots.title ? vue.h("strong", { class: "oods-banner-title" }, [
134
+ vue.h("div", { class: "oods-banner__content" }, [
135
+ props.title || props.status || slots.title ? vue.h("strong", { class: "oods-banner__title" }, [
136
136
  slotOrValue(slots.title, props.title || statusLabel(props.status))
137
137
  ]) : null,
138
- props.detail ? vue.h("p", { class: "oods-banner-detail" }, props.detail) : null,
139
- slots.default || props.content ? vue.h(slots.default ? "div" : "p", { class: "oods-banner-body" }, [slotOrValue(slots.default, props.content)]) : null,
140
- slots.actions ? vue.h("div", { class: "oods-banner-actions" }, slots.actions()) : null
138
+ props.detail ? vue.h("p", { class: "oods-banner__detail" }, props.detail) : null,
139
+ slots.default || props.content ? vue.h(slots.default ? "div" : "p", { class: "oods-banner__body" }, [slotOrValue(slots.default, props.content)]) : null,
140
+ slots.actions ? vue.h("div", { class: "oods-banner__actions" }, slots.actions()) : null
141
141
  ]),
142
142
  props.dismissLabel ? vue.h("button", {
143
143
  type: "button",
144
- class: "oods-banner-dismiss",
144
+ class: "oods-banner-dismiss oods-banner__dismiss",
145
145
  "aria-label": props.dismissLabel,
146
146
  onClick: () => emit("dismiss")
147
147
  }, [vue.h("span", { "aria-hidden": "true" }, "\xD7")]) : null
@@ -355,7 +355,9 @@ var Input = vue.defineComponent({
355
355
  name: "OodsInput",
356
356
  props: {
357
357
  ...textFieldProps,
358
- type: { type: String, default: "text" }
358
+ type: { type: String, default: "text" },
359
+ /** A class for the input element itself, as React's inputClassName; the field's own class stays on its frame. */
360
+ inputClass: String
359
361
  },
360
362
  emits: {
361
363
  "update:modelValue": (_value) => true,
@@ -373,7 +375,7 @@ var Input = vue.defineComponent({
373
375
  };
374
376
  return () => renderField("Input", props, slots, metadata, vue.h("input", {
375
377
  id: metadata.controlId.value,
376
- class: "oods-field-control",
378
+ class: props.inputClass ? ["oods-field-control", props.inputClass] : "oods-field-control",
377
379
  type: props.type,
378
380
  name: props.name,
379
381
  value: props.type === "datetime-local" ? componentContracts.dateTimeInputValue(currentValue.value) : currentValue.value,
@@ -907,12 +909,12 @@ var timelineProps = {
907
909
  };
908
910
  function renderTimelineEvent(event, index, showActorId, showReason) {
909
911
  return vue.h("li", { key: `${event.timestamp ?? "event"}-${index}` }, [
910
- vue.h("article", { "data-timeline-event": "true" }, [
911
- vue.h("p", { "data-timeline-label": "true" }, event.label),
912
+ vue.h("article", { class: "oods-timeline__event", "data-timeline-event": "true" }, [
913
+ vue.h("p", { class: "oods-timeline__label", "data-timeline-label": "true" }, event.label),
912
914
  event.timestamp ? vue.h("time", { "data-timeline-time": "true", datetime: event.timestamp }, componentContracts.formatDateTime(event.timestamp)) : null,
913
- event.detail ? vue.h("p", { "data-timeline-detail": "true" }, event.detail) : null,
914
- showActorId && event.actorId ? vue.h("p", { "data-timeline-actor": "true" }, `Actor: ${event.actorId}`) : null,
915
- showReason && event.reason ? vue.h("p", { "data-timeline-reason": "true" }, `Reason: ${event.reason}`) : null
915
+ event.detail ? vue.h("p", { class: "oods-timeline__detail", "data-timeline-detail": "true" }, event.detail) : null,
916
+ showActorId && event.actorId ? vue.h("p", { class: "oods-timeline__actor", "data-timeline-actor": "true" }, `Actor: ${event.actorId}`) : null,
917
+ showReason && event.reason ? vue.h("p", { class: "oods-timeline__reason", "data-timeline-reason": "true" }, `Reason: ${event.reason}`) : null
916
918
  ])
917
919
  ]);
918
920
  }
@@ -930,16 +932,16 @@ function timelineComponent(configuration) {
930
932
  const slottedEvents = slots.default?.();
931
933
  return vue.h("div", {
932
934
  ...attrs,
933
- class: mergedClass("oods-timeline", attrs.class),
935
+ class: mergedClass(`oods-timeline oods-${configuration.timelineType}-timeline`, attrs.class),
934
936
  role: "log",
935
937
  "aria-label": stringValue(attrs["aria-label"]) ?? title,
936
938
  "data-oods-component": configuration.componentId,
937
939
  "data-timeline-type": configuration.timelineType
938
940
  }, [
939
- vue.h("h2", { "data-timeline-title": "true" }, title),
940
- props.status ? vue.h("p", { "data-timeline-current": "true" }, `Current status: ${statusLabel2(props.status)}`) : null,
941
+ vue.h("h2", { class: "oods-timeline__title", "data-timeline-title": "true" }, title),
942
+ props.status ? vue.h("p", { class: "oods-timeline__current", "data-timeline-current": "true" }, `Current status: ${statusLabel2(props.status)}`) : null,
941
943
  props.allowedTransitions?.length ? vue.h("p", { "data-timeline-transitions": "true" }, `Allowed transitions: ${props.allowedTransitions.join(", ")}`) : null,
942
- vue.h("ol", { "data-timeline-events": "true" }, slottedEvents?.length ? slottedEvents : events.length ? events.map((event, index) => renderTimelineEvent(
944
+ vue.h("ol", { class: "oods-timeline__events", "data-timeline-events": "true" }, slottedEvents?.length ? slottedEvents : events.length ? events.map((event, index) => renderTimelineEvent(
943
945
  event,
944
946
  index,
945
947
  props.showActorId,
@@ -1095,8 +1097,7 @@ var SearchInput = vue.defineComponent({
1095
1097
  updateValue("");
1096
1098
  emit("clear");
1097
1099
  };
1098
- const submit = (event) => {
1099
- event.preventDefault();
1100
+ const searchNow = () => {
1100
1101
  if (!props.disabled) {
1101
1102
  if (timer !== void 0) clearTimeout(timer);
1102
1103
  emitSearch(currentValue.value);
@@ -1105,14 +1106,13 @@ var SearchInput = vue.defineComponent({
1105
1106
  return () => {
1106
1107
  const id = props.id ?? `oods-search-${generatedId.replace(/:/g, "")}`;
1107
1108
  const ariaLabel = stringValue(attrs["aria-label"]) ?? props.label ?? props.placeholder;
1108
- return vue.h("form", {
1109
+ return vue.h("div", {
1109
1110
  ...attrs,
1110
1111
  class: mergedClass("oods-search-input", attrs.class),
1111
1112
  role: "search",
1112
1113
  "aria-label": ariaLabel,
1113
1114
  "data-oods-component": "SearchInput",
1114
- "data-behavioral": "search",
1115
- onSubmit: submit
1115
+ "data-behavioral": "search"
1116
1116
  }, [
1117
1117
  vue.h(Input, {
1118
1118
  id,
@@ -1121,14 +1121,20 @@ var SearchInput = vue.defineComponent({
1121
1121
  value: currentValue.value,
1122
1122
  placeholder: props.placeholder,
1123
1123
  disabled: props.disabled,
1124
+ inputClass: "oods-search-input__control",
1124
1125
  "aria-label": props.label ? void 0 : ariaLabel,
1125
1126
  onInput: (value) => updateValue(value),
1126
1127
  onKeydown: (event) => {
1127
1128
  if (event.key === "Escape") clear();
1129
+ if (event.key === "Enter") {
1130
+ event.preventDefault();
1131
+ searchNow();
1132
+ }
1128
1133
  }
1129
1134
  }),
1130
1135
  props.clearable && currentValue.value ? vue.h("button", {
1131
1136
  type: "button",
1137
+ class: "oods-search-input__clear",
1132
1138
  "data-search-clear": "true",
1133
1139
  "aria-label": "Clear search",
1134
1140
  disabled: props.disabled,
package/dist/ported.js CHANGED
@@ -89,8 +89,8 @@ var Badge = defineComponent({
89
89
  "--cmp-badge-text": `var(--sys-status-${palette}-text)`
90
90
  }
91
91
  }, [
92
- props.icon || slots.icon ? h("span", { class: "oods-badge-icon", "aria-hidden": "true" }, [slotOrValue(slots.icon, props.icon)]) : null,
93
- slotOrValue(slots.default, props.content ?? statusLabel(props.status))
92
+ props.icon || slots.icon ? h("span", { class: "oods-badge__icon", "aria-hidden": "true" }, [slotOrValue(slots.icon, props.icon)]) : null,
93
+ h("span", { class: "oods-badge__label" }, [slotOrValue(slots.default, props.content ?? statusLabel(props.status))])
94
94
  ]);
95
95
  };
96
96
  }
@@ -114,7 +114,7 @@ defineComponent({
114
114
  return () => {
115
115
  const tone = resolveTone(props.tone, props.status, props.domain);
116
116
  const palette = tokenTone(tone);
117
- return h("section", {
117
+ return h("div", {
118
118
  class: "oods-banner",
119
119
  "data-oods-component": "Banner",
120
120
  "data-status": props.status,
@@ -129,17 +129,17 @@ defineComponent({
129
129
  "--cmp-banner-text": `var(--sys-status-${palette}-text)`
130
130
  }
131
131
  }, [
132
- h("div", { class: "oods-banner-content" }, [
133
- props.title || props.status || slots.title ? h("strong", { class: "oods-banner-title" }, [
132
+ h("div", { class: "oods-banner__content" }, [
133
+ props.title || props.status || slots.title ? h("strong", { class: "oods-banner__title" }, [
134
134
  slotOrValue(slots.title, props.title || statusLabel(props.status))
135
135
  ]) : null,
136
- props.detail ? h("p", { class: "oods-banner-detail" }, props.detail) : null,
137
- slots.default || props.content ? h(slots.default ? "div" : "p", { class: "oods-banner-body" }, [slotOrValue(slots.default, props.content)]) : null,
138
- slots.actions ? h("div", { class: "oods-banner-actions" }, slots.actions()) : null
136
+ props.detail ? h("p", { class: "oods-banner__detail" }, props.detail) : null,
137
+ slots.default || props.content ? h(slots.default ? "div" : "p", { class: "oods-banner__body" }, [slotOrValue(slots.default, props.content)]) : null,
138
+ slots.actions ? h("div", { class: "oods-banner__actions" }, slots.actions()) : null
139
139
  ]),
140
140
  props.dismissLabel ? h("button", {
141
141
  type: "button",
142
- class: "oods-banner-dismiss",
142
+ class: "oods-banner-dismiss oods-banner__dismiss",
143
143
  "aria-label": props.dismissLabel,
144
144
  onClick: () => emit("dismiss")
145
145
  }, [h("span", { "aria-hidden": "true" }, "\xD7")]) : null
@@ -353,7 +353,9 @@ var Input = defineComponent({
353
353
  name: "OodsInput",
354
354
  props: {
355
355
  ...textFieldProps,
356
- type: { type: String, default: "text" }
356
+ type: { type: String, default: "text" },
357
+ /** A class for the input element itself, as React's inputClassName; the field's own class stays on its frame. */
358
+ inputClass: String
357
359
  },
358
360
  emits: {
359
361
  "update:modelValue": (_value) => true,
@@ -371,7 +373,7 @@ var Input = defineComponent({
371
373
  };
372
374
  return () => renderField("Input", props, slots, metadata, h("input", {
373
375
  id: metadata.controlId.value,
374
- class: "oods-field-control",
376
+ class: props.inputClass ? ["oods-field-control", props.inputClass] : "oods-field-control",
375
377
  type: props.type,
376
378
  name: props.name,
377
379
  value: props.type === "datetime-local" ? dateTimeInputValue(currentValue.value) : currentValue.value,
@@ -905,12 +907,12 @@ var timelineProps = {
905
907
  };
906
908
  function renderTimelineEvent(event, index, showActorId, showReason) {
907
909
  return h("li", { key: `${event.timestamp ?? "event"}-${index}` }, [
908
- h("article", { "data-timeline-event": "true" }, [
909
- h("p", { "data-timeline-label": "true" }, event.label),
910
+ h("article", { class: "oods-timeline__event", "data-timeline-event": "true" }, [
911
+ h("p", { class: "oods-timeline__label", "data-timeline-label": "true" }, event.label),
910
912
  event.timestamp ? h("time", { "data-timeline-time": "true", datetime: event.timestamp }, formatDateTime(event.timestamp)) : null,
911
- event.detail ? h("p", { "data-timeline-detail": "true" }, event.detail) : null,
912
- showActorId && event.actorId ? h("p", { "data-timeline-actor": "true" }, `Actor: ${event.actorId}`) : null,
913
- showReason && event.reason ? h("p", { "data-timeline-reason": "true" }, `Reason: ${event.reason}`) : null
913
+ event.detail ? h("p", { class: "oods-timeline__detail", "data-timeline-detail": "true" }, event.detail) : null,
914
+ showActorId && event.actorId ? h("p", { class: "oods-timeline__actor", "data-timeline-actor": "true" }, `Actor: ${event.actorId}`) : null,
915
+ showReason && event.reason ? h("p", { class: "oods-timeline__reason", "data-timeline-reason": "true" }, `Reason: ${event.reason}`) : null
914
916
  ])
915
917
  ]);
916
918
  }
@@ -928,16 +930,16 @@ function timelineComponent(configuration) {
928
930
  const slottedEvents = slots.default?.();
929
931
  return h("div", {
930
932
  ...attrs,
931
- class: mergedClass("oods-timeline", attrs.class),
933
+ class: mergedClass(`oods-timeline oods-${configuration.timelineType}-timeline`, attrs.class),
932
934
  role: "log",
933
935
  "aria-label": stringValue(attrs["aria-label"]) ?? title,
934
936
  "data-oods-component": configuration.componentId,
935
937
  "data-timeline-type": configuration.timelineType
936
938
  }, [
937
- h("h2", { "data-timeline-title": "true" }, title),
938
- props.status ? h("p", { "data-timeline-current": "true" }, `Current status: ${statusLabel2(props.status)}`) : null,
939
+ h("h2", { class: "oods-timeline__title", "data-timeline-title": "true" }, title),
940
+ props.status ? h("p", { class: "oods-timeline__current", "data-timeline-current": "true" }, `Current status: ${statusLabel2(props.status)}`) : null,
939
941
  props.allowedTransitions?.length ? h("p", { "data-timeline-transitions": "true" }, `Allowed transitions: ${props.allowedTransitions.join(", ")}`) : null,
940
- h("ol", { "data-timeline-events": "true" }, slottedEvents?.length ? slottedEvents : events.length ? events.map((event, index) => renderTimelineEvent(
942
+ h("ol", { class: "oods-timeline__events", "data-timeline-events": "true" }, slottedEvents?.length ? slottedEvents : events.length ? events.map((event, index) => renderTimelineEvent(
941
943
  event,
942
944
  index,
943
945
  props.showActorId,
@@ -1093,8 +1095,7 @@ var SearchInput = defineComponent({
1093
1095
  updateValue("");
1094
1096
  emit("clear");
1095
1097
  };
1096
- const submit = (event) => {
1097
- event.preventDefault();
1098
+ const searchNow = () => {
1098
1099
  if (!props.disabled) {
1099
1100
  if (timer !== void 0) clearTimeout(timer);
1100
1101
  emitSearch(currentValue.value);
@@ -1103,14 +1104,13 @@ var SearchInput = defineComponent({
1103
1104
  return () => {
1104
1105
  const id = props.id ?? `oods-search-${generatedId.replace(/:/g, "")}`;
1105
1106
  const ariaLabel = stringValue(attrs["aria-label"]) ?? props.label ?? props.placeholder;
1106
- return h("form", {
1107
+ return h("div", {
1107
1108
  ...attrs,
1108
1109
  class: mergedClass("oods-search-input", attrs.class),
1109
1110
  role: "search",
1110
1111
  "aria-label": ariaLabel,
1111
1112
  "data-oods-component": "SearchInput",
1112
- "data-behavioral": "search",
1113
- onSubmit: submit
1113
+ "data-behavioral": "search"
1114
1114
  }, [
1115
1115
  h(Input, {
1116
1116
  id,
@@ -1119,14 +1119,20 @@ var SearchInput = defineComponent({
1119
1119
  value: currentValue.value,
1120
1120
  placeholder: props.placeholder,
1121
1121
  disabled: props.disabled,
1122
+ inputClass: "oods-search-input__control",
1122
1123
  "aria-label": props.label ? void 0 : ariaLabel,
1123
1124
  onInput: (value) => updateValue(value),
1124
1125
  onKeydown: (event) => {
1125
1126
  if (event.key === "Escape") clear();
1127
+ if (event.key === "Enter") {
1128
+ event.preventDefault();
1129
+ searchNow();
1130
+ }
1126
1131
  }
1127
1132
  }),
1128
1133
  props.clearable && currentValue.value ? h("button", {
1129
1134
  type: "button",
1135
+ class: "oods-search-input__clear",
1130
1136
  "data-search-clear": "true",
1131
1137
  "aria-label": "Clear search",
1132
1138
  disabled: props.disabled,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oods/components-vue",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "Vue 3 components for OODS Foundry: the controls, layouts and domain views its generated screens use.",
5
5
  "homepage": "https://oods-foundry.com/",
6
6
  "bugs": {
@@ -53,8 +53,8 @@
53
53
  "**/*.css"
54
54
  ],
55
55
  "dependencies": {
56
- "@oods/component-contracts": "0.3.2",
57
- "@oods/component-styles": "0.3.2"
56
+ "@oods/component-contracts": "0.3.3",
57
+ "@oods/component-styles": "0.3.3"
58
58
  },
59
59
  "peerDependencies": {
60
60
  "vue": "^3.5.0"