@servicetitan/anvil2 3.9.0 → 3.10.0

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.
Files changed (168) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/Combobox.js +1 -1
  3. package/dist/{DataTable-CRzQKN_P.js → DataTable-D-SKKt5w.js} +53 -16
  4. package/dist/DataTable-D-SKKt5w.js.map +1 -0
  5. package/dist/{DateFieldRange-CHbrYgsD.js → DateFieldRange-DUFfyknZ.js} +51 -31
  6. package/dist/DateFieldRange-DUFfyknZ.js.map +1 -0
  7. package/dist/DateFieldRange.js +1 -1
  8. package/dist/{DateFieldSingle-D-KZ3NL0.js → DateFieldSingle-BZjlO0hX.js} +49 -28
  9. package/dist/DateFieldSingle-BZjlO0hX.js.map +1 -0
  10. package/dist/DateFieldSingle.js +1 -1
  11. package/dist/{DateFieldYearless-DouEX24o.js → DateFieldYearless-TcKb9jE2.js} +4 -2
  12. package/dist/DateFieldYearless-TcKb9jE2.js.map +1 -0
  13. package/dist/DateFieldYearless.js +1 -1
  14. package/dist/{DateFieldYearlessRange-B_bImgyn.js → DateFieldYearlessRange-D9XtRNWi.js} +16 -4
  15. package/dist/DateFieldYearlessRange-D9XtRNWi.js.map +1 -0
  16. package/dist/DateFieldYearlessRange.js +1 -1
  17. package/dist/DrillDown.js +1 -1
  18. package/dist/{FilterBar-CBTAkEri.js → FilterBar-luqnJzAK.js} +27 -6
  19. package/dist/FilterBar-luqnJzAK.js.map +1 -0
  20. package/dist/FilterBar.js +1 -1
  21. package/dist/{MenuFooter-BXcNxNnX.js → MenuFooter--lBF8OjJ.js} +5 -1
  22. package/dist/MenuFooter--lBF8OjJ.js.map +1 -0
  23. package/dist/MultiSelectField.js +1 -1
  24. package/dist/{MultiSelectFieldSync-CpfsWecG.js → MultiSelectFieldSync-HhFKGtQM.js} +60 -15
  25. package/dist/MultiSelectFieldSync-HhFKGtQM.js.map +1 -0
  26. package/dist/MultiSelectMenu.js +1 -1
  27. package/dist/{MultiSelectMenuSync-CtyLYyDE.js → MultiSelectMenuSync-C3Y7jnJQ.js} +22 -8
  28. package/dist/MultiSelectMenuSync-C3Y7jnJQ.js.map +1 -0
  29. package/dist/{Page-B6E3Gbji.js → Page-Pk0-Sxf_.js} +11 -10
  30. package/dist/Page-Pk0-Sxf_.js.map +1 -0
  31. package/dist/Page.js +1 -1
  32. package/dist/{Pagination-DF7iMeJe.js → Pagination-Bx_u6Uea.js} +32 -6
  33. package/dist/Pagination-Bx_u6Uea.js.map +1 -0
  34. package/dist/Pagination.js +1 -1
  35. package/dist/{RichTextEditor-CLo8yoUP.js → RichTextEditor-CTIGe6xA.js} +3 -3
  36. package/dist/{RichTextEditor-CLo8yoUP.js.map → RichTextEditor-CTIGe6xA.js.map} +1 -1
  37. package/dist/RichTextEditor.js +1 -1
  38. package/dist/{SavedFiltersButton-FcYVncxU.js → SavedFiltersButton-CpnoAIrw.js} +250 -164
  39. package/dist/SavedFiltersButton-CpnoAIrw.js.map +1 -0
  40. package/dist/SavedFiltersButton.js +1 -1
  41. package/dist/SelectField.js +1 -1
  42. package/dist/{SelectFieldSync-Bi8HsMYP.js → SelectFieldSync-Dyug8Fgk.js} +35 -7
  43. package/dist/SelectFieldSync-Dyug8Fgk.js.map +1 -0
  44. package/dist/SelectMenu.js +1 -1
  45. package/dist/{SelectMenuSync-DKg4g5nN.js → SelectMenuSync-BkC0FD5P.js} +22 -8
  46. package/dist/SelectMenuSync-BkC0FD5P.js.map +1 -0
  47. package/dist/{SelectOptions-DszNAjxB.js → SelectOptions-B3Vmtb_k.js} +2 -2
  48. package/dist/{SelectOptions-DszNAjxB.js.map → SelectOptions-B3Vmtb_k.js.map} +1 -1
  49. package/dist/{SelectTrigger-DNIc5ttg.js → SelectTrigger-Do1puyA_.js} +2 -2
  50. package/dist/{SelectTrigger-DNIc5ttg.js.map → SelectTrigger-Do1puyA_.js.map} +1 -1
  51. package/dist/SelectTrigger.js +1 -1
  52. package/dist/{SelectTriggerBase-1Cc6EUBw.js → SelectTriggerBase-rxHXMSb4.js} +3 -1
  53. package/dist/SelectTriggerBase-rxHXMSb4.js.map +1 -0
  54. package/dist/Table.js +1 -1
  55. package/dist/{Toolbar-2VQIjU5b.js → Toolbar-BOgHhw7K.js} +12 -3
  56. package/dist/Toolbar-BOgHhw7K.js.map +1 -0
  57. package/dist/{Toolbar-BbImThIu.js → Toolbar-DDWUuQm_.js} +24 -2
  58. package/dist/Toolbar-DDWUuQm_.js.map +1 -0
  59. package/dist/Toolbar.js +2 -2
  60. package/dist/{ToolbarButtonToggle-Bc0XvCM9.js → ToolbarButtonToggle-BbtKfezH.js} +18 -2
  61. package/dist/ToolbarButtonToggle-BbtKfezH.js.map +1 -0
  62. package/dist/TreeSelectField.js +1 -1
  63. package/dist/{TreeSelectFieldSync-DUHVmOQa.js → TreeSelectFieldSync-Cd87uR6b.js} +35 -12
  64. package/dist/TreeSelectFieldSync-Cd87uR6b.js.map +1 -0
  65. package/dist/TreeSelectMenu.js +1 -1
  66. package/dist/{TreeSelectMenuSync-DVoYUG7F.js → TreeSelectMenuSync-88q0ydo5.js} +18 -6
  67. package/dist/TreeSelectMenuSync-88q0ydo5.js.map +1 -0
  68. package/dist/{YearlessDateInputWithPicker-CM9mmz8s.js → YearlessDateInputWithPicker-BquY4bCd.js} +19 -5
  69. package/dist/YearlessDateInputWithPicker-BquY4bCd.js.map +1 -0
  70. package/dist/anvParts-BGg5dgfl.js +43 -0
  71. package/dist/anvParts-BGg5dgfl.js.map +1 -0
  72. package/dist/beta.js +13 -13
  73. package/dist/{bulkActionTypes-BnZNAru6.js → bulkActionTypes-CWcUhKFS.js} +2 -2
  74. package/dist/{bulkActionTypes-BnZNAru6.js.map → bulkActionTypes-CWcUhKFS.js.map} +1 -1
  75. package/dist/{filter-state-XmqhkURU.js → filter-state-BQOX7_rO.js} +152 -80
  76. package/dist/filter-state-BQOX7_rO.js.map +1 -0
  77. package/dist/{index-BwNeldDw.js → index-DjirBR0l.js} +2 -2
  78. package/dist/{index-BwNeldDw.js.map → index-DjirBR0l.js.map} +1 -1
  79. package/dist/index.js +14 -14
  80. package/dist/src/beta/components/FilterBar/FilterBar.d.ts +3 -3
  81. package/dist/src/beta/components/FilterBar/internal/utils/dateListLibraryOptions.d.ts +17 -3
  82. package/dist/src/beta/components/FilterBar/parts.d.ts +38 -0
  83. package/dist/src/beta/components/SavedFiltersButton/parts.d.ts +37 -0
  84. package/dist/src/beta/components/SavedFiltersButton/types.d.ts +2 -1
  85. package/dist/src/beta/components/Table/DataTable/DataTable.d.ts +3 -2
  86. package/dist/src/beta/components/Table/DataTable/parts.d.ts +30 -0
  87. package/dist/src/beta/components/Table/internal/ResizeHandle.d.ts +3 -2
  88. package/dist/src/beta/components/Toolbar/Toolbar.d.ts +4 -4
  89. package/dist/src/beta/components/Toolbar/parts.d.ts +19 -0
  90. package/dist/src/beta/components/TreeSelectField/TreeSelectField.d.ts +6 -5
  91. package/dist/src/beta/components/TreeSelectField/parts.d.ts +23 -0
  92. package/dist/src/beta/components/TreeSelectField/types.d.ts +11 -4
  93. package/dist/src/beta/components/TreeSelectMenu/TreeSelectMenu.d.ts +33 -2
  94. package/dist/src/beta/components/TreeSelectMenu/parts.d.ts +12 -0
  95. package/dist/src/beta/components/TreeSelectMenu/types.d.ts +3 -2
  96. package/dist/src/components/Combobox/ComboboxTypes.d.ts +2 -2
  97. package/dist/src/components/Combobox/parts.d.ts +19 -0
  98. package/dist/src/components/DateFieldRange/DateFieldRange.d.ts +2 -2
  99. package/dist/src/components/DateFieldRange/parts.d.ts +16 -0
  100. package/dist/src/components/DateFieldSingle/DateFieldSingle.d.ts +2 -2
  101. package/dist/src/components/DateFieldSingle/parts.d.ts +16 -0
  102. package/dist/src/components/DateFieldYearless/DateFieldYearless.d.ts +2 -2
  103. package/dist/src/components/DateFieldYearless/parts.d.ts +15 -0
  104. package/dist/src/components/DateFieldYearlessRange/DateFieldYearlessRange.d.ts +2 -2
  105. package/dist/src/components/DateFieldYearlessRange/parts.d.ts +12 -0
  106. package/dist/src/components/DrillDown/DrillDown.d.ts +11 -0
  107. package/dist/src/components/MultiSelectField/internal/MultiSelectFieldComboboxMode.d.ts +1 -1
  108. package/dist/src/components/MultiSelectField/internal/MultiSelectFieldSelectMode.d.ts +1 -1
  109. package/dist/src/components/MultiSelectField/internal/types.d.ts +3 -1
  110. package/dist/src/components/MultiSelectField/parts.d.ts +20 -0
  111. package/dist/src/components/MultiSelectField/types.d.ts +2 -2
  112. package/dist/src/components/MultiSelectMenu/parts.d.ts +12 -0
  113. package/dist/src/components/MultiSelectMenu/types.d.ts +3 -2
  114. package/dist/src/components/Pagination/Pagination.d.ts +4 -3
  115. package/dist/src/components/Pagination/parts.d.ts +28 -0
  116. package/dist/src/components/SelectField/internal/SelectFieldComboboxMode.d.ts +1 -1
  117. package/dist/src/components/SelectField/internal/SelectFieldSelectMode.d.ts +1 -1
  118. package/dist/src/components/SelectField/parts.d.ts +18 -0
  119. package/dist/src/components/SelectField/types.d.ts +7 -2
  120. package/dist/src/components/SelectMenu/internal/useMenuInteraction.d.ts +8 -6
  121. package/dist/src/components/SelectMenu/parts.d.ts +12 -0
  122. package/dist/src/components/SelectMenu/types.d.ts +3 -2
  123. package/dist/src/components/SelectTrigger/internal/SelectTriggerBase.d.ts +6 -5
  124. package/dist/src/components/Toolbar/Toolbar.d.ts +3 -3
  125. package/dist/src/components/Toolbar/parts.d.ts +18 -0
  126. package/dist/src/internal/constants/anvParts.d.ts +81 -0
  127. package/dist/src/internal/testing/anvPartsContract.d.ts +24 -0
  128. package/dist/src/internal/types/selectFieldInternalTypes.d.ts +3 -1
  129. package/dist/{syncFilterUtils-UVNoFsDr.js → syncFilterUtils-YB6gRuuR.js} +11 -4
  130. package/dist/syncFilterUtils-YB6gRuuR.js.map +1 -0
  131. package/dist/{treeSync-CiU5d6rF.js → treeSync-DOen59wP.js} +24 -4
  132. package/dist/treeSync-DOen59wP.js.map +1 -0
  133. package/dist/{useAdaptiveView-C_WvM4-P.js → useAdaptiveView-DmhhcX-B.js} +3 -1
  134. package/dist/useAdaptiveView-DmhhcX-B.js.map +1 -0
  135. package/dist/{useDrilldown-D7DKSs7E.js → useDrilldown-UAm0-l1l.js} +10 -3
  136. package/dist/{useDrilldown-D7DKSs7E.js.map → useDrilldown-UAm0-l1l.js.map} +1 -1
  137. package/dist/{useInfiniteCombobox-COJTJxCZ.js → useInfiniteCombobox-V94SoOiU.js} +70 -23
  138. package/dist/useInfiniteCombobox-V94SoOiU.js.map +1 -0
  139. package/dist/{useMenuInteraction-AgrXU8kv.js → useMenuInteraction-nNF1dsrp.js} +7 -4
  140. package/dist/useMenuInteraction-nNF1dsrp.js.map +1 -0
  141. package/package.json +7 -5
  142. package/dist/DataTable-CRzQKN_P.js.map +0 -1
  143. package/dist/DateFieldRange-CHbrYgsD.js.map +0 -1
  144. package/dist/DateFieldSingle-D-KZ3NL0.js.map +0 -1
  145. package/dist/DateFieldYearless-DouEX24o.js.map +0 -1
  146. package/dist/DateFieldYearlessRange-B_bImgyn.js.map +0 -1
  147. package/dist/FilterBar-CBTAkEri.js.map +0 -1
  148. package/dist/MenuFooter-BXcNxNnX.js.map +0 -1
  149. package/dist/MultiSelectFieldSync-CpfsWecG.js.map +0 -1
  150. package/dist/MultiSelectMenuSync-CtyLYyDE.js.map +0 -1
  151. package/dist/Page-B6E3Gbji.js.map +0 -1
  152. package/dist/Pagination-DF7iMeJe.js.map +0 -1
  153. package/dist/SavedFiltersButton-FcYVncxU.js.map +0 -1
  154. package/dist/SelectFieldSync-Bi8HsMYP.js.map +0 -1
  155. package/dist/SelectMenuSync-DKg4g5nN.js.map +0 -1
  156. package/dist/SelectTriggerBase-1Cc6EUBw.js.map +0 -1
  157. package/dist/Toolbar-2VQIjU5b.js.map +0 -1
  158. package/dist/Toolbar-BbImThIu.js.map +0 -1
  159. package/dist/ToolbarButtonToggle-Bc0XvCM9.js.map +0 -1
  160. package/dist/TreeSelectFieldSync-DUHVmOQa.js.map +0 -1
  161. package/dist/TreeSelectMenuSync-DVoYUG7F.js.map +0 -1
  162. package/dist/YearlessDateInputWithPicker-CM9mmz8s.js.map +0 -1
  163. package/dist/filter-state-XmqhkURU.js.map +0 -1
  164. package/dist/syncFilterUtils-UVNoFsDr.js.map +0 -1
  165. package/dist/treeSync-CiU5d6rF.js.map +0 -1
  166. package/dist/useAdaptiveView-C_WvM4-P.js.map +0 -1
  167. package/dist/useInfiniteCombobox-COJTJxCZ.js.map +0 -1
  168. package/dist/useMenuInteraction-AgrXU8kv.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { DataTrackingId, LayoutUtilProps, Size } from '../../types';
1
+ import { DataAttributes, DataTrackingId, LayoutUtilProps, Size } from '../../types';
2
2
  import { YearlessDate, YearlessDateMode } from './types';
3
3
  import { ReactElement, ReactNode, ComponentPropsWithoutRef } from 'react';
4
4
  import { FieldLabelProps } from '../FieldLabel';
@@ -105,7 +105,7 @@ export type DateFieldYearlessProps = Omit<ComponentPropsWithoutRef<"input">, "on
105
105
  * Function to call when the field is blurred
106
106
  */
107
107
  onBlur?: (event: React.FocusEvent) => void;
108
- } & DataTrackingId;
108
+ } & DataTrackingId & DataAttributes;
109
109
  /**
110
110
  * Represents a change event for the DateFieldYearless component
111
111
  */
@@ -0,0 +1,15 @@
1
+ /**
2
+ * `data-anv-part` names for DateFieldYearless interactive sub-elements.
3
+ *
4
+ * Consumer `data-*` (e.g. `data-cy`) is forwarded to the masked text input —
5
+ * the one element present in every mode (including `disablePicker`). The
6
+ * picker popover and month/day lists render in the top layer, outside the
7
+ * input's subtree — target them by part attribute directly.
8
+ */
9
+ export declare const PARTS: {
10
+ readonly input: "date-input";
11
+ readonly popover: "popover";
12
+ readonly monthList: "month-list";
13
+ readonly dayList: "day-list";
14
+ readonly option: "option";
15
+ };
@@ -1,6 +1,6 @@
1
1
  import { ReactElement } from 'react';
2
2
  import { HelperProps } from '../../internal/components';
3
- import { LayoutUtilProps, Size } from '../../types';
3
+ import { DataAttributes, LayoutUtilProps, Size } from '../../types';
4
4
  import { FieldLabelProps } from '../FieldLabel';
5
5
  import { YearlessDate, YearlessDateMode } from '../DateFieldYearless/types';
6
6
  export type DateFieldYearlessRangeValue = {
@@ -73,7 +73,7 @@ export type DateFieldYearlessRangeProps = {
73
73
  endLabel?: string;
74
74
  legendProps?: Omit<FieldLabelProps, "el">;
75
75
  moreInfo?: FieldLabelProps["moreInfo"];
76
- } & LayoutUtilProps;
76
+ } & LayoutUtilProps & DataAttributes;
77
77
  /**
78
78
  * DateFieldYearlessRange component for entering a start and end month/day
79
79
  * pair — a date range with no year, e.g. recurring events or anniversaries.
@@ -0,0 +1,12 @@
1
+ /**
2
+ * `data-anv-part` names for DateFieldYearlessRange interactive sub-elements.
3
+ *
4
+ * Consumer `data-*` is forwarded to the fieldset root. Scope start/end inputs
5
+ * under it (`[data-cy="x"] [data-anv-part="start-input"]`). Picker popover /
6
+ * month-list / day-list / option parts are stamped by the shared yearless
7
+ * picker internals — see DateFieldYearless `PARTS`.
8
+ */
9
+ export declare const PARTS: {
10
+ readonly startInput: "start-input";
11
+ readonly endInput: "end-input";
12
+ };
@@ -10,6 +10,17 @@ import { PassThroughPropsWithRef } from '../../types';
10
10
  export type DrillDownProps = PassThroughPropsWithRef<"div"> & {
11
11
  index: number;
12
12
  onClose?: () => void;
13
+ /**
14
+ * Suspends this screen's focus trap while `false`, even though the screen
15
+ * stays mounted and visible. Use when a consumer opens an independent
16
+ * Dialog/Drawer of their own (not a nested `DrillDown` index — e.g. a
17
+ * `DateListDialog` triggered from a form field in this screen) that stacks
18
+ * on top: that overlay isn't a descendant of this screen's trap boundary,
19
+ * so without this escape hatch the trap treats every click inside it as
20
+ * "outside" and blocks it.
21
+ * @default true
22
+ */
23
+ interactive?: boolean;
13
24
  };
14
25
  /**
15
26
  * Multi-step, hierarchical drill-down navigation component for Dialog, Drawer, and Page.Panel — lets users drill down by selecting a category to go deeper into nested subcategories or screens, and navigate back up.
@@ -2,4 +2,4 @@ import { MultiSelectFieldComboboxInternalProps } from './types';
2
2
  /**
3
3
  * Combobox mode: searchable multi-select using useCombobox.
4
4
  */
5
- export declare const MultiSelectFieldComboboxMode: ({ labelAiMark, id, helperUid, selectedOptions, onSelectedOptionsChange, displayAs, isDisabledOrReadOnly, disabled, readOnly, isHighlighted, required, placeholder, size, error, hasHelperText, disableClearButton, prefix, suffix, label, hideLabel, hint, moreInfo, moreInfoId, errorMessages, warning, description, className, style, layoutStyles, pinned, groupToString, groupSorter, virtualize, options, loading, loadingMore, hasMore, loadOptions, loadMore, initialLoad, initialLoadPerformed, setInitialLoadPerformed, inputWrapperRef, debounceMs, selectAll, selectFiltered, bulkPending, onBulkActivate, singleRow, maxChips, getChipProps, onSearchChange, addItemLabel, onAddNewItem, handleRemoveOption, handleClear, }: MultiSelectFieldComboboxInternalProps) => import("react/jsx-runtime").JSX.Element;
5
+ export declare const MultiSelectFieldComboboxMode: ({ labelAiMark, id, helperUid, selectedOptions, onSelectedOptionsChange, displayAs, isDisabledOrReadOnly, disabled, readOnly, isHighlighted, required, placeholder, size, error, hasHelperText, disableClearButton, prefix, suffix, label, hideLabel, hint, moreInfo, moreInfoId, errorMessages, warning, description, className, style, layoutStyles, pinned, groupToString, groupSorter, virtualize, options, loading, loadingMore, hasMore, loadOptions, loadMore, initialLoad, initialLoadPerformed, setInitialLoadPerformed, inputWrapperRef, debounceMs, selectAll, selectFiltered, bulkPending, onBulkActivate, singleRow, maxChips, getChipProps, onSearchChange, addItemLabel, onAddNewItem, handleRemoveOption, handleClear, dataAttributes, }: MultiSelectFieldComboboxInternalProps) => import("react/jsx-runtime").JSX.Element;
@@ -3,4 +3,4 @@ import { MultiSelectFieldBaseInternalProps } from './types';
3
3
  * Select mode: non-searchable multi-select using useSelect.
4
4
  * Active when disableSearch is true.
5
5
  */
6
- export declare const MultiSelectFieldSelectMode: ({ labelAiMark, id, helperUid, selectedOptions, onSelectedOptionsChange, displayAs, isDisabledOrReadOnly, disabled, readOnly, isHighlighted, required, placeholder, size, error, hasHelperText, disableClearButton, prefix, suffix, label, hideLabel, hint, moreInfo, moreInfoId, errorMessages, warning, description, className, style, layoutStyles, pinned, groupToString, groupSorter, virtualize, options, loading, loadingMore, hasMore, loadOptions, loadMore, initialLoad, initialLoadPerformed, setInitialLoadPerformed, inputWrapperRef, selectAll, bulkPending, onBulkActivate, singleRow, maxChips, getChipProps, addItemLabel, onAddNewItem, handleRemoveOption, handleClear, }: MultiSelectFieldBaseInternalProps) => import("react/jsx-runtime").JSX.Element;
6
+ export declare const MultiSelectFieldSelectMode: ({ labelAiMark, id, helperUid, selectedOptions, onSelectedOptionsChange, displayAs, isDisabledOrReadOnly, disabled, readOnly, isHighlighted, required, placeholder, size, error, hasHelperText, disableClearButton, prefix, suffix, label, hideLabel, hint, moreInfo, moreInfoId, errorMessages, warning, description, className, style, layoutStyles, pinned, groupToString, groupSorter, virtualize, options, loading, loadingMore, hasMore, loadOptions, loadMore, initialLoad, initialLoadPerformed, setInitialLoadPerformed, inputWrapperRef, selectAll, bulkPending, onBulkActivate, singleRow, maxChips, getChipProps, addItemLabel, onAddNewItem, handleRemoveOption, handleClear, dataAttributes, }: MultiSelectFieldBaseInternalProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import { ReactElement, ReactNode, RefObject } from 'react';
2
- import { AiMarkWithTooltipOrPopoverProps, CheckState } from '../../../types';
2
+ import { AiMarkWithTooltipOrPopoverProps, CheckState, DataAttributes } from '../../../types';
3
3
  import { AddNewItemProps } from '../../../internal/types/addNewItemTypes';
4
4
  import { MultiSelectFieldChipProps, MultiSelectFieldOption, MultiSelectFieldProps } from '../types';
5
5
  export type MultiSelectFieldBaseInternalProps = {
@@ -63,6 +63,8 @@ export type MultiSelectFieldBaseInternalProps = {
63
63
  id: string | number;
64
64
  }) => void;
65
65
  handleClear: () => void;
66
+ /** Consumer-supplied `data-*` attributes forwarded to the field wrapper. */
67
+ dataAttributes?: DataAttributes;
66
68
  } & AddNewItemProps;
67
69
  export type MultiSelectFieldComboboxInternalProps = MultiSelectFieldBaseInternalProps & {
68
70
  debounceMs: number;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * `data-anv-part` names for MultiSelectField's interactive sub-elements.
3
+ *
4
+ * Scope a query by the consumer's `data-cy` on the field root
5
+ * (`[data-cy="x"] [data-anv-part="input"]`). Portaled parts (`menu`, `option`,
6
+ * `dialog`, `popover`) come from the shared option internals and render in the
7
+ * top layer — target them by part attribute or the field's `#{id}-popover` /
8
+ * `#{id}-dialog`.
9
+ *
10
+ * Every role MultiSelectField needs is a shared one, so all values come from
11
+ * `COMMON_PART`.
12
+ */
13
+ export declare const PARTS: {
14
+ readonly trigger: "trigger";
15
+ readonly input: "input";
16
+ readonly chip: "chip";
17
+ readonly overflowChip: "overflow-chip";
18
+ readonly clearButton: "clear-button";
19
+ readonly toggleButton: "toggle-button";
20
+ };
@@ -1,5 +1,5 @@
1
1
  import { AriaAttributes, CSSProperties, ReactElement, ReactNode } from 'react';
2
- import { AiMarkWithTooltipOrPopoverProps, LayoutUtilProps, Size } from '../../types';
2
+ import { AiMarkWithTooltipOrPopoverProps, DataAttributes, LayoutUtilProps, Size } from '../../types';
3
3
  import { SelectFieldGroupByValue, SelectFieldOption, SelectFieldOptionContent } from '../SelectField/types';
4
4
  import { ChipProps } from '../../components/Chip';
5
5
  import { AddNewItemProps } from '../../internal/types/addNewItemTypes';
@@ -294,7 +294,7 @@ type MultiSelectFieldCommonProps = {
294
294
  * @returns Partial chip props to merge onto the chip
295
295
  */
296
296
  getChipProps?: (option: MultiSelectFieldOption) => MultiSelectFieldChipProps;
297
- } & MultiSelectFieldSearchProps & LayoutUtilProps & AddNewItemProps;
297
+ } & MultiSelectFieldSearchProps & LayoutUtilProps & AddNewItemProps & DataAttributes;
298
298
  type MultiSelectFieldGroupingProps = {
299
299
  /**
300
300
  * Function to convert a group value to a display label.
@@ -0,0 +1,12 @@
1
+ /**
2
+ * `data-anv-part` names for MultiSelectMenu interactive sub-elements.
3
+ *
4
+ * There is no wrapper root — attach consumer `data-*` (e.g. `data-cy`) via
5
+ * props; they are merged into the trigger render-prop bag. Portaled
6
+ * `menu` / `option` / `popover` / `dialog` / footer buttons come from shared
7
+ * internals (not redeclared here).
8
+ */
9
+ export declare const PARTS: {
10
+ readonly trigger: "trigger";
11
+ readonly input: "input";
12
+ };
@@ -1,4 +1,5 @@
1
1
  import { KeyboardEvent, ReactElement, RefObject } from 'react';
2
+ import { DataAttributes } from '../../types';
2
3
  import { SelectFieldGroupByValue, SelectFieldOption, SelectFieldOptionContent } from '../SelectField/types';
3
4
  import { MultiSelectFieldCacheOptions, MultiSelectFieldEagerLoader, MultiSelectFieldGroupLazyLoader, MultiSelectFieldOffsetLazyLoader, MultiSelectFieldPageLazyLoader, MultiSelectFieldPinnedOptions, MultiSelectFieldSearchProps } from '../MultiSelectField/types';
4
5
  import { AddNewItemProps } from '../../internal/types/addNewItemTypes';
@@ -54,7 +55,7 @@ export type MultiSelectMenuTriggerProps = {
54
55
  "aria-controls": string;
55
56
  "aria-expanded": boolean;
56
57
  "data-state": "open" | "close";
57
- };
58
+ } & DataAttributes;
58
59
  type MultiSelectMenuCommonProps = {
59
60
  /**
60
61
  * The id of the multi-select menu.
@@ -188,7 +189,7 @@ type MultiSelectMenuCommonProps = {
188
189
  label?: string;
189
190
  disabled?: boolean;
190
191
  };
191
- } & MultiSelectMenuSearchProps & AddNewItemProps;
192
+ } & MultiSelectMenuSearchProps & AddNewItemProps & DataAttributes;
192
193
  type MultiSelectMenuGroupingProps = {
193
194
  /**
194
195
  * Function to convert a group value to a display label.
@@ -1,4 +1,4 @@
1
- import { DataTrackingId } from '../../types';
1
+ import { DataAttributes, DataTrackingId } from '../../types';
2
2
  import { PaginationProps as BasePaginationProps } from './internal/Pagination';
3
3
  /**
4
4
  * Props for the Pagination component
@@ -12,8 +12,9 @@ import { PaginationProps as BasePaginationProps } from './internal/Pagination';
12
12
  * @property {string} [itemsPerPageLabel] - Custom label displayed before the items-per-page selector. Defaults to "Rows per page"
13
13
  * @extends Omit<BasePaginationProps, "children">
14
14
  * @extends DataTrackingId
15
+ * @extends DataAttributes
15
16
  */
16
- export type PaginationProps = Omit<BasePaginationProps, "children"> & DataTrackingId & {
17
+ export type PaginationProps = Omit<BasePaginationProps, "children"> & DataTrackingId & DataAttributes & {
17
18
  page: number;
18
19
  itemsPerPage: number;
19
20
  itemsPerPageOptions?: number[];
@@ -47,7 +48,7 @@ export type PaginationProps = Omit<BasePaginationProps, "children"> & DataTracki
47
48
  * onItemsPerPageChange={(itemsPerPage) => console.log('Items per page:', itemsPerPage)}
48
49
  * />
49
50
  */
50
- export declare const Pagination: import('react').ForwardRefExoticComponent<Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLElement>, HTMLElement>, "ref">, "children"> & DataTrackingId & {
51
+ export declare const Pagination: import('react').ForwardRefExoticComponent<Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLElement>, HTMLElement>, "ref">, "children"> & DataTrackingId & DataAttributes & {
51
52
  page: number;
52
53
  itemsPerPage: number;
53
54
  itemsPerPageOptions?: number[];
@@ -0,0 +1,28 @@
1
+ /**
2
+ * `data-anv-part` names for Pagination's interactive sub-elements.
3
+ *
4
+ * Scope a query by the consumer's `data-cy` on the Pagination root
5
+ * (`[data-cy="x"] [data-anv-part="next-page-button"]`).
6
+ *
7
+ * Repeated parts use secondary discriminators:
8
+ * - page buttons / overflow options: `data-page`
9
+ * - items-per-page options: `data-items-per-page`
10
+ *
11
+ * Overflow and items-per-page menus render in the browser top layer — target
12
+ * `option` parts by attribute (or after opening the matching trigger), not as
13
+ * descendants of the Pagination root.
14
+ */
15
+ export declare const PARTS: {
16
+ /** Shared role for menu options (overflow pages + items-per-page). */
17
+ readonly option: "option";
18
+ /** Previous-page control. */
19
+ readonly prevPageButton: "prev-page-button";
20
+ /** Next-page control. */
21
+ readonly nextPageButton: "next-page-button";
22
+ /** Numbered page control. Narrow with `data-page`. */
23
+ readonly pageButton: "page-button";
24
+ /** Ellipsis control that opens the overflow page menu. */
25
+ readonly overflowTrigger: "overflow-trigger";
26
+ /** Control that opens the items-per-page menu. */
27
+ readonly itemsPerPageTrigger: "items-per-page-trigger";
28
+ };
@@ -3,4 +3,4 @@ import { SelectFieldComboboxInternalProps } from '../../../internal/types/select
3
3
  * Combobox mode: searchable select using useCombobox.
4
4
  * This is the default behavior when disableSearch is false.
5
5
  */
6
- export declare const SelectFieldComboboxMode: ({ id, helperUid, selectedOption, onSelectedOptionChange, displayAs, isDisabledOrReadOnly, disabled, labelAiMark, readOnly, isHighlighted, required, placeholder, size, error, hasHelperText, disableClearButton, prefix, suffix, label, hideLabel, hint, moreInfo, moreInfoId, errorMessages, warning, description, className, style, layoutStyles, pinned, groupToString, groupSorter, virtualize, options, loading, loadingMore, hasMore, loadOptions, loadMore, initialLoad, initialLoadPerformed, setInitialLoadPerformed, inputWrapperRef, debounceMs, addItemLabel, onAddNewItem, }: SelectFieldComboboxInternalProps) => import("react/jsx-runtime").JSX.Element;
6
+ export declare const SelectFieldComboboxMode: ({ id, helperUid, selectedOption, onSelectedOptionChange, displayAs, isDisabledOrReadOnly, disabled, labelAiMark, readOnly, isHighlighted, required, placeholder, size, error, hasHelperText, disableClearButton, prefix, suffix, label, hideLabel, hint, moreInfo, moreInfoId, errorMessages, warning, description, className, style, layoutStyles, pinned, groupToString, groupSorter, virtualize, options, loading, loadingMore, hasMore, loadOptions, loadMore, initialLoad, initialLoadPerformed, setInitialLoadPerformed, inputWrapperRef, debounceMs, addItemLabel, onAddNewItem, dataAttributes, }: SelectFieldComboboxInternalProps) => import("react/jsx-runtime").JSX.Element;
@@ -3,4 +3,4 @@ import { SelectFieldBaseInternalProps } from '../../../internal/types/selectFiel
3
3
  * Select mode: non-searchable select using useSelect.
4
4
  * Active when disableSearch is true.
5
5
  */
6
- export declare const SelectFieldSelectMode: ({ labelAiMark, id, helperUid, selectedOption, onSelectedOptionChange, displayAs, isDisabledOrReadOnly, disabled, readOnly, isHighlighted, placeholder, size, error, hasHelperText, disableClearButton, prefix, suffix, label, hideLabel, hint, moreInfo, moreInfoId, errorMessages, warning, description, className, style, layoutStyles, pinned, groupToString, groupSorter, virtualize, options, loading, loadingMore, hasMore, loadOptions, loadMore, initialLoad, initialLoadPerformed, setInitialLoadPerformed, inputWrapperRef, required, addItemLabel, onAddNewItem, }: SelectFieldBaseInternalProps) => import("react/jsx-runtime").JSX.Element;
6
+ export declare const SelectFieldSelectMode: ({ labelAiMark, id, helperUid, selectedOption, onSelectedOptionChange, displayAs, isDisabledOrReadOnly, disabled, readOnly, isHighlighted, placeholder, size, error, hasHelperText, disableClearButton, prefix, suffix, label, hideLabel, hint, moreInfo, moreInfoId, errorMessages, warning, description, className, style, layoutStyles, pinned, groupToString, groupSorter, virtualize, options, loading, loadingMore, hasMore, loadOptions, loadMore, initialLoad, initialLoadPerformed, setInitialLoadPerformed, inputWrapperRef, required, addItemLabel, onAddNewItem, dataAttributes, }: SelectFieldBaseInternalProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * `data-anv-part` names for SelectField's interactive sub-elements.
3
+ *
4
+ * Scope a query by the consumer's `data-cy` on the field root
5
+ * (`[data-cy="x"] [data-anv-part="input"]`). Portaled parts (`menu`, `option`,
6
+ * `dialog`, `popover`) come from the shared option internals and render in the
7
+ * top layer — target them by part attribute or the field's `#{id}-popover` /
8
+ * `#{id}-dialog`.
9
+ *
10
+ * Every role SelectField needs is a shared one, so all values come from
11
+ * `COMMON_PART`.
12
+ */
13
+ export declare const PARTS: {
14
+ readonly trigger: "trigger";
15
+ readonly input: "input";
16
+ readonly clearButton: "clear-button";
17
+ readonly toggleButton: "toggle-button";
18
+ };
@@ -1,5 +1,5 @@
1
1
  import { AriaAttributes, CSSProperties, ReactElement, ReactNode } from 'react';
2
- import { AiMarkWithTooltipOrPopoverProps, LayoutUtilProps, Size } from '../../types';
2
+ import { AiMarkWithTooltipOrPopoverProps, DataAttributes, LayoutUtilProps, Size } from '../../types';
3
3
  import { OptionContent } from '../../internal/types/optionContent';
4
4
  import { AddNewItemProps } from '../../internal/types/addNewItemTypes';
5
5
  /**
@@ -31,6 +31,11 @@ export type SelectFieldOption = {
31
31
  label: string;
32
32
  searchText?: string;
33
33
  group?: SelectFieldGroupByValue;
34
+ /**
35
+ * When true, the option cannot be selected from the menu. If the option is
36
+ * already in the field `value`, MultiSelectField also treats it as locked:
37
+ * the chip has no close control, and clear / backspace skip it.
38
+ */
34
39
  disabled?: boolean;
35
40
  extra?: Record<string, unknown>;
36
41
  content?: SelectFieldOptionContent;
@@ -252,7 +257,7 @@ type SelectFieldCommonSelectFieldProps = {
252
257
  * @default false
253
258
  */
254
259
  disableSearch?: boolean;
255
- } & SelectFieldSearchProps & SelectFieldAddNewOptionProps & LayoutUtilProps & AddNewItemProps;
260
+ } & SelectFieldSearchProps & SelectFieldAddNewOptionProps & LayoutUtilProps & AddNewItemProps & DataAttributes;
256
261
  type SelectFieldGroupingProps = {
257
262
  /**
258
263
  * Function to convert a group value to a display label.
@@ -36,12 +36,12 @@ export type MenuTriggerProps = {
36
36
  "aria-controls": string;
37
37
  "aria-expanded": boolean;
38
38
  "data-state": "open" | "close";
39
- };
39
+ } & Record<`data-${string}`, string>;
40
40
  type MenuPropsArg = {
41
41
  className?: string;
42
42
  style?: CSSProperties;
43
- };
44
- type MenuReturnProps = MenuPropsArg & {
43
+ } & Record<string, unknown>;
44
+ type MenuReturnProps = {
45
45
  role: "listbox";
46
46
  id: string;
47
47
  "aria-label": string;
@@ -50,13 +50,15 @@ type MenuReturnProps = MenuPropsArg & {
50
50
  "aria-activedescendant"?: string;
51
51
  ref: RefObject<HTMLDivElement>;
52
52
  onKeyDown: (e: KeyboardEvent) => void;
53
- };
53
+ className?: string;
54
+ style?: CSSProperties;
55
+ } & Record<string, unknown>;
54
56
  type ItemPropsArg = {
55
57
  item: SelectItem;
56
58
  index: number;
57
59
  className?: string;
58
60
  "data-type"?: string;
59
- };
61
+ } & Record<string, unknown>;
60
62
  type ItemReturnProps = {
61
63
  role: "option";
62
64
  id: string;
@@ -66,7 +68,7 @@ type ItemReturnProps = {
66
68
  onMouseMove: () => void;
67
69
  className?: string;
68
70
  "data-type"?: string;
69
- };
71
+ } & Record<string, unknown>;
70
72
  export type GetMenuPropsFn = (opts?: MenuPropsArg) => MenuReturnProps;
71
73
  export type GetItemPropsFn = (opts: ItemPropsArg) => ItemReturnProps;
72
74
  export declare const useMenuInteraction: ({ items, sectionsMeta: _sectionsMeta, onItemActivate, selectedItemIds, displayAs: _displayAs, closeOnActivate, disabled, closeOnDisabled, id, triggerRef, label, isOpen, setIsOpen, onImplicitClose, onExplicitClose, }: UseMenuInteractionConfig) => {
@@ -0,0 +1,12 @@
1
+ /**
2
+ * `data-anv-part` names for SelectMenu interactive sub-elements.
3
+ *
4
+ * There is no wrapper root — attach consumer `data-*` (e.g. `data-cy`) via
5
+ * props; they are merged into the trigger render-prop bag. Portaled
6
+ * `menu` / `option` / `popover` / `dialog` / footer buttons come from shared
7
+ * internals (not redeclared here).
8
+ */
9
+ export declare const PARTS: {
10
+ readonly trigger: "trigger";
11
+ readonly input: "input";
12
+ };
@@ -1,4 +1,5 @@
1
1
  import { KeyboardEvent, ReactElement, RefObject } from 'react';
2
+ import { DataAttributes } from '../../types';
2
3
  import { SelectFieldCacheOptions, SelectFieldEagerLoader, SelectFieldGroupByValue, SelectFieldGroupLazyLoader, SelectFieldGroupedOption, SelectFieldOffsetLazyLoader, SelectFieldOption, SelectFieldOptionContent, SelectFieldPageLazyLoader, SelectFieldPinnedOptions, SelectFieldSearchProps } from '../SelectField/types';
3
4
  import { AddNewItemProps } from '../../internal/types/addNewItemTypes';
4
5
  /**
@@ -48,7 +49,7 @@ export type SelectMenuTriggerProps = {
48
49
  "aria-controls": string;
49
50
  "aria-expanded": boolean;
50
51
  "data-state": "open" | "close";
51
- };
52
+ } & DataAttributes;
52
53
  type SelectMenuCommonProps = {
53
54
  /**
54
55
  * The id of the select menu.
@@ -145,7 +146,7 @@ type SelectMenuCommonProps = {
145
146
  label?: string;
146
147
  disabled?: boolean;
147
148
  };
148
- } & SelectMenuSearchProps & AddNewItemProps;
149
+ } & SelectMenuSearchProps & AddNewItemProps & DataAttributes;
149
150
  type SelectMenuGroupingProps = {
150
151
  /**
151
152
  * Function to convert a group value to a display label.
@@ -2,8 +2,8 @@ import { ComponentPropsWithoutRef, MutableRefObject, MouseEventHandler, ReactNod
2
2
  import { ChipProps } from '../../Chip';
3
3
  import { FieldLabelProps } from '../../FieldLabel';
4
4
  import { TextFieldProps } from '../../TextField';
5
- import { DistributiveOmit } from '../../../types';
6
- type PartialChipProps = Partial<Omit<ChipProps, "icon" | "avatar">> & ({
5
+ import { DataAttributes, DistributiveOmit } from '../../../types';
6
+ type PartialChipProps = Partial<Omit<ChipProps, "icon" | "avatar">> & DataAttributes & ({
7
7
  icon?: ChipProps["icon"];
8
8
  avatar?: never;
9
9
  } | {
@@ -30,12 +30,13 @@ export type SelectTriggerBaseProps<Item = unknown> = DistributiveOmit<TextFieldP
30
30
  onClearButtonClick?: MouseEventHandler<HTMLButtonElement>;
31
31
  labelProps?: Partial<FieldLabelProps>;
32
32
  inputWrapperProps?: ComponentPropsWithoutRef<"div">;
33
- toggleButtonProps?: ComponentPropsWithoutRef<"button">;
33
+ toggleButtonProps?: ComponentPropsWithoutRef<"button"> & DataAttributes;
34
+ clearButtonProps?: ComponentPropsWithoutRef<"button"> & DataAttributes;
34
35
  chipProps?: (item: Item, index: number) => PartialChipProps;
35
- inputProps?: ComponentPropsWithoutRef<"input" | "div">;
36
+ inputProps?: ComponentPropsWithoutRef<"input" | "div"> & DataAttributes;
36
37
  disableToggleButton?: boolean;
37
38
  } & {
38
39
  prefix?: string | ReactNode;
39
40
  };
40
- export declare const SelectTriggerBase: <Item>({ className, label, size, error, hint, description, prefix, suffix, maxRows, selectedItemProps, disabled, readOnly, disableClearSelection, itemToString: itemToStringProp, selectedItem, selectedItems, removeSelectedItem, inputValue, referenceRef, variant, onClearButtonClick, labelProps, inputWrapperProps, toggleButtonProps, inputProps, chipProps, disableToggleButton, warning, placeholder, ...rest }: SelectTriggerBaseProps<Item>) => import("react/jsx-runtime").JSX.Element;
41
+ export declare const SelectTriggerBase: <Item>({ className, label, size, error, hint, description, prefix, suffix, maxRows, selectedItemProps, disabled, readOnly, disableClearSelection, itemToString: itemToStringProp, selectedItem, selectedItems, removeSelectedItem, inputValue, referenceRef, variant, onClearButtonClick, labelProps, inputWrapperProps, toggleButtonProps, clearButtonProps, inputProps, chipProps, disableToggleButton, warning, placeholder, ...rest }: SelectTriggerBaseProps<Item>) => import("react/jsx-runtime").JSX.Element;
41
42
  export {};
@@ -1,12 +1,12 @@
1
1
  import { ToolbarOverflowTypes, ToolbarSize } from './types';
2
2
  import { ComponentPropsWithoutRef, ReactElement } from 'react';
3
- import { LayoutUtilProps } from '../../types';
3
+ import { DataAttributes, LayoutUtilProps } from '../../types';
4
4
  /**
5
5
  * Props for the Toolbar component
6
6
  * @extends ComponentPropsWithoutRef<"div">
7
7
  * @extends LayoutUtilProps
8
8
  */
9
- export type ToolbarProps = ComponentPropsWithoutRef<"div"> & LayoutUtilProps & {
9
+ export type ToolbarProps = ComponentPropsWithoutRef<"div"> & LayoutUtilProps & DataAttributes & {
10
10
  /**
11
11
  * Description of the content this toolbar is associated with, used for accessibility
12
12
  */
@@ -57,7 +57,7 @@ export type ToolbarProps = ComponentPropsWithoutRef<"div"> & LayoutUtilProps & {
57
57
  * />
58
58
  * </Toolbar>
59
59
  */
60
- export declare const Toolbar: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & LayoutUtilProps & {
60
+ export declare const Toolbar: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & LayoutUtilProps & DataAttributes & {
61
61
  /**
62
62
  * Description of the content this toolbar is associated with, used for accessibility
63
63
  */
@@ -0,0 +1,18 @@
1
+ /**
2
+ * `data-anv-part` names for Toolbar's interactive sub-elements.
3
+ *
4
+ * Scope in-wrapper parts by the consumer's `data-cy` on the Toolbar root.
5
+ * Overflow menu/items render in the popover top layer — target them by part
6
+ * attribute directly.
7
+ */
8
+ export declare const PARTS: {
9
+ readonly trigger: "trigger";
10
+ readonly menu: "menu";
11
+ readonly overflowItem: "overflow-item";
12
+ /**
13
+ * A leaf toolbar control (`Toolbar.Button` / `Toolbar.ButtonToggle`).
14
+ * Discriminate with `aria-label`, `id`, or a consumer `data-*`. Callers may
15
+ * override this (e.g. FilterBar stamps `trigger` on boolean toggles).
16
+ */
17
+ readonly item: "item";
18
+ };
@@ -0,0 +1,81 @@
1
+ /**
2
+ * `data-anv-part` — the internally-managed test attribute for targeting the
3
+ * interactive sub-elements of complex Anvil2 components in end-to-end tests.
4
+ *
5
+ * Scoping model (two independent axes — use either or both):
6
+ * - **Component type**: the component's existing `data-anv` root value
7
+ * (e.g. `data-anv="data-table-base"`). Stable, already present on most roots.
8
+ * - **Instance**: a consumer-supplied `data-*` (e.g. `data-cy`) forwarded to the
9
+ * root. The consumer owns this.
10
+ *
11
+ * A test then queries `[data-anv="<component>"] [data-anv-part="row"]` or
12
+ * `[data-cy="x"] [data-anv-part="row"]`. Because the part is always read in the
13
+ * context of a component, **part names only need to be unique within a single
14
+ * component** — `header`, `row`, and `item` may repeat across components.
15
+ *
16
+ * Kept separate from `data-anv` (which holds structural/decorative values like
17
+ * "popover-content" or "button"); the two attributes coexist on an element.
18
+ *
19
+ * ## Where part names live
20
+ *
21
+ * Each component owns its part names in a co-located `parts.ts` next to its
22
+ * source (e.g. `beta/components/Table/parts.ts`):
23
+ *
24
+ * import { ANV_PART_ATTR } from "../../../internal/constants/anvParts";
25
+ * export const PARTS = {
26
+ * row: "row",
27
+ * cell: "cell",
28
+ * sortToggle: "sort-toggle",
29
+ * } as const;
30
+ *
31
+ * This file centralizes only (1) the attribute name and (2) the small set of
32
+ * roles that recur across many components, so their *string values* stay
33
+ * identical everywhere. Prefer a `COMMON_PART` value when one fits; otherwise
34
+ * define a component-specific name in that component's `parts.ts`.
35
+ */
36
+ export declare const ANV_PART_ATTR: "data-anv-part";
37
+ /**
38
+ * Cross-cutting part roles whose string values must match across components so
39
+ * consumers can rely on them. Spread or reference these from a component's
40
+ * co-located `parts.ts` rather than re-typing the literals.
41
+ */
42
+ export declare const COMMON_PART: {
43
+ /** Element that opens a menu/popover/dialog/drawer. */
44
+ readonly trigger: "trigger";
45
+ /** Free-text entry. */
46
+ readonly input: "input";
47
+ /** Button that clears the current value/selection. */
48
+ readonly clearButton: "clear-button";
49
+ /** Button that opens/closes an adjacent surface. */
50
+ readonly toggleButton: "toggle-button";
51
+ /** Button that commits a pending selection. */
52
+ readonly applyButton: "apply-button";
53
+ /** Button that dismisses a surface without committing. */
54
+ readonly cancelButton: "cancel-button";
55
+ /** Listbox/menu container. */
56
+ readonly menu: "menu";
57
+ /** A single option/row within a menu. */
58
+ readonly option: "option";
59
+ /** A selected-value chip. */
60
+ readonly chip: "chip";
61
+ /** Dialog container (top layer). */
62
+ readonly dialog: "dialog";
63
+ /** Popover container (top layer). */
64
+ readonly popover: "popover";
65
+ /** Drawer container (top layer). */
66
+ readonly drawer: "drawer";
67
+ /** Masked text input of a date / date-range field. */
68
+ readonly dateInput: "date-input";
69
+ /** Calendar surface of a date / date-range field. */
70
+ readonly dateCalendar: "date-calendar";
71
+ /** Affordance that adds a new item from a select/combobox menu. */
72
+ readonly addNewItemButton: "add-new-item-button";
73
+ /** Lazy-load control inside a virtualized/paged options list. */
74
+ readonly loadMoreButton: "load-more-button";
75
+ /**
76
+ * "+N" overflow indicator when selected-value chips exceed the visible
77
+ * budget. Distinct from `chip` (real selected values).
78
+ */
79
+ readonly overflowChip: "overflow-chip";
80
+ };
81
+ export type CommonPart = (typeof COMMON_PART)[keyof typeof COMMON_PART];
@@ -0,0 +1,24 @@
1
+ type PartsRecord = Record<string, string>;
2
+ type PartKey<T extends PartsRecord> = Extract<keyof T, string>;
3
+ export type ExpectAnvPartsOptions<T extends PartsRecord> = {
4
+ /** Part keys that must be present in `scope` (default: at least one match). */
5
+ present?: PartKey<T>[];
6
+ /** Part keys that must not appear in `scope`. */
7
+ absent?: PartKey<T>[];
8
+ /**
9
+ * Node to query within. Defaults to `document.body` so portaled parts
10
+ * (menu / popover / dialog / drawer) are found without a wrapper.
11
+ */
12
+ scope?: ParentNode;
13
+ /** Exact match count for a present key. */
14
+ count?: Partial<Record<PartKey<T>, number>>;
15
+ /** Minimum match count for a present key (ignored when `count` is set). */
16
+ minCount?: Partial<Record<PartKey<T>, number>>;
17
+ };
18
+ /**
19
+ * Assert that `data-anv-part` values from a PARTS / COMMON_PART map are present
20
+ * or absent in the DOM. Prefer this over hard-coded attribute strings so
21
+ * renames in `parts.ts` fail the contract instead of silently drifting.
22
+ */
23
+ export declare function expectAnvParts<T extends PartsRecord>(parts: T, options?: ExpectAnvPartsOptions<T>): void;
24
+ export {};
@@ -1,5 +1,5 @@
1
1
  import { ReactElement, ReactNode, RefObject } from 'react';
2
- import { AiMarkWithTooltipOrPopoverProps, CheckState } from '../../types';
2
+ import { AiMarkWithTooltipOrPopoverProps, CheckState, DataAttributes } from '../../types';
3
3
  import { SelectFieldOption, SelectFieldProps } from '../../components/SelectField/types';
4
4
  import { AddNewItemProps } from './addNewItemTypes';
5
5
  import { ResolvedConfirmation } from './confirmationTypes';
@@ -66,6 +66,8 @@ export type SelectFieldBaseInternalProps = {
66
66
  setInitialLoadPerformed: (val: boolean) => void;
67
67
  inputWrapperRef: RefObject<HTMLDivElement>;
68
68
  confirmation?: ResolvedConfirmation;
69
+ /** Consumer-supplied `data-*` attributes forwarded to the field wrapper. */
70
+ dataAttributes?: DataAttributes;
69
71
  } & AddNewItemProps;
70
72
  export type SelectFieldComboboxInternalProps = SelectFieldBaseInternalProps & {
71
73
  debounceMs: number;