braid-design-system 33.12.3 → 33.13.0-autosuggest-suggestions-data-prop-20251202035740

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/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # braid-design-system
2
2
 
3
+ ## 33.13.0-autosuggest-suggestions-data-prop-20251202035740
4
+
5
+ ### Minor Changes
6
+
7
+ - **Autosuggest:** Add support for data attributes on individual suggestions (305473f8c00885ece67f4af65e869d8bfd746f4f)
8
+
9
+ The data attributes are applied to each rendered list item.
10
+
11
+ **EXAMPLE USAGE:**
12
+
13
+ ```jsx
14
+ <Autosuggest
15
+ suggestions={[
16
+ {
17
+ text: 'Apples',
18
+ data: { testid: 'suggestion-apples' },
19
+ },
20
+ ]}
21
+ />
22
+ ```
23
+
3
24
  ## 33.12.3
4
25
 
5
26
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -3034,6 +3034,7 @@ interface Suggestion<Value = any> extends AutosuggestValue<Value> {
3034
3034
  highlights?: SuggestionMatch;
3035
3035
  onClear?: (value: AutosuggestValue<Value>) => void;
3036
3036
  clearLabel?: string;
3037
+ data?: DataAttributeMap;
3037
3038
  }
3038
3039
  interface GroupedSuggestions<Value> {
3039
3040
  label: string;
package/dist/index.d.ts CHANGED
@@ -3034,6 +3034,7 @@ interface Suggestion<Value = any> extends AutosuggestValue<Value> {
3034
3034
  highlights?: SuggestionMatch;
3035
3035
  onClear?: (value: AutosuggestValue<Value>) => void;
3036
3036
  clearLabel?: string;
3037
+ data?: DataAttributeMap;
3037
3038
  }
3038
3039
  interface GroupedSuggestions<Value> {
3039
3040
  label: string;
@@ -17,6 +17,7 @@ const lib_components_private_Announcement_Announcement_cjs = require("../private
17
17
  const lib_components_private_Field_ClearField_cjs = require("../private/Field/ClearField.cjs");
18
18
  const lib_components_private_Field_Field_cjs = require("../private/Field/Field.cjs");
19
19
  const lib_components_private_Popover_Popover_cjs = require("../private/Popover/Popover.cjs");
20
+ const lib_components_private_buildDataAttributes_cjs = require("../private/buildDataAttributes.cjs");
20
21
  const lib_components_private_getNextIndex_cjs = require("../private/getNextIndex.cjs");
21
22
  const lib_components_private_normalizeKey_cjs = require("../private/normalizeKey.cjs");
22
23
  const lib_components_private_smoothScroll_cjs = require("../private/smoothScroll.cjs");
@@ -48,7 +49,7 @@ function SuggestionItem({
48
49
  id,
49
50
  ...restProps
50
51
  }) {
51
- const { highlights = [], onClear, clearLabel } = suggestion;
52
+ const { highlights = [], onClear, clearLabel, data } = suggestion;
52
53
  const label = suggestion.label ?? suggestion.text;
53
54
  const suggestionParts = parseHighlights__default.default(
54
55
  label,
@@ -65,6 +66,7 @@ function SuggestionItem({
65
66
  onMouseMove: onHover,
66
67
  onTouchStart: onHover,
67
68
  id,
69
+ ...lib_components_private_buildDataAttributes_cjs.buildDataAttributes({ data, validateRestProps: false }),
68
70
  ...restProps,
69
71
  children: /* @__PURE__ */ jsxRuntime.jsxs(
70
72
  lib_components_Box_Box_cjs.Box,
@@ -16,6 +16,7 @@ import { Announcement } from "../private/Announcement/Announcement.mjs";
16
16
  import { ClearField } from "../private/Field/ClearField.mjs";
17
17
  import { Field } from "../private/Field/Field.mjs";
18
18
  import { Popover } from "../private/Popover/Popover.mjs";
19
+ import { buildDataAttributes } from "../private/buildDataAttributes.mjs";
19
20
  import { getNextIndex } from "../private/getNextIndex.mjs";
20
21
  import { normalizeKey } from "../private/normalizeKey.mjs";
21
22
  import { smoothScroll } from "../private/smoothScroll.mjs";
@@ -43,7 +44,7 @@ function SuggestionItem({
43
44
  id,
44
45
  ...restProps
45
46
  }) {
46
- const { highlights = [], onClear, clearLabel } = suggestion;
47
+ const { highlights = [], onClear, clearLabel, data } = suggestion;
47
48
  const label = suggestion.label ?? suggestion.text;
48
49
  const suggestionParts = parseHighlights(
49
50
  label,
@@ -60,6 +61,7 @@ function SuggestionItem({
60
61
  onMouseMove: onHover,
61
62
  onTouchStart: onHover,
62
63
  id,
64
+ ...buildDataAttributes({ data, validateRestProps: false }),
63
65
  ...restProps,
64
66
  children: /* @__PURE__ */ jsxs(
65
67
  Box,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "braid-design-system",
3
- "version": "33.12.3",
3
+ "version": "33.13.0-autosuggest-suggestions-data-prop-20251202035740",
4
4
  "description": "Themeable design system for the SEEK Group",
5
5
  "homepage": "https://seek-oss.github.io/braid-design-system/",
6
6
  "bugs": {