@neo4j-ndl/react 4.22.0 → 4.23.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.
Files changed (197) hide show
  1. package/lib/cjs/_common/form-control/FormFieldLabel.js +52 -0
  2. package/lib/cjs/_common/form-control/FormFieldLabel.js.map +1 -0
  3. package/lib/cjs/_common/form-control/FormFieldMessage.js +72 -0
  4. package/lib/cjs/_common/form-control/FormFieldMessage.js.map +1 -0
  5. package/lib/cjs/_common/form-control/form-control-types.js +23 -0
  6. package/lib/cjs/_common/form-control/form-control-types.js.map +1 -0
  7. package/lib/cjs/_common/form-control/index.js +39 -0
  8. package/lib/cjs/_common/form-control/index.js.map +1 -0
  9. package/lib/cjs/_common/form-control/use-form-field.js +76 -0
  10. package/lib/cjs/_common/form-control/use-form-field.js.map +1 -0
  11. package/lib/cjs/_common/form-control/use-inline-field-label.js +76 -0
  12. package/lib/cjs/_common/form-control/use-inline-field-label.js.map +1 -0
  13. package/lib/cjs/checkbox/Checkbox.js +9 -21
  14. package/lib/cjs/checkbox/Checkbox.js.map +1 -1
  15. package/lib/cjs/combobox/Combobox.js +75 -53
  16. package/lib/cjs/combobox/Combobox.js.map +1 -1
  17. package/lib/cjs/combobox/combobox-types.js.map +1 -1
  18. package/lib/cjs/date-picker/DatePicker.js.map +1 -1
  19. package/lib/cjs/icons/generated/custom/FloppyDiskArrowTopRight.js +30 -0
  20. package/lib/cjs/icons/generated/custom/FloppyDiskArrowTopRight.js.map +1 -0
  21. package/lib/cjs/icons/generated/custom/OpenQueryTab.js +1 -0
  22. package/lib/cjs/icons/generated/custom/OpenQueryTab.js.map +1 -1
  23. package/lib/cjs/icons/generated/custom/index.js +5 -3
  24. package/lib/cjs/icons/generated/custom/index.js.map +1 -1
  25. package/lib/cjs/next/tree-view/TreeView.js +16 -1
  26. package/lib/cjs/next/tree-view/TreeView.js.map +1 -1
  27. package/lib/cjs/radio/Radio.js +12 -22
  28. package/lib/cjs/radio/Radio.js.map +1 -1
  29. package/lib/cjs/select/Select.js +14 -5
  30. package/lib/cjs/select/Select.js.map +1 -1
  31. package/lib/cjs/select/types.js.map +1 -1
  32. package/lib/cjs/switch/Switch.js +9 -21
  33. package/lib/cjs/switch/Switch.js.map +1 -1
  34. package/lib/cjs/text-area/TextArea.js +8 -21
  35. package/lib/cjs/text-area/TextArea.js.map +1 -1
  36. package/lib/cjs/text-input/TextInput.js +15 -38
  37. package/lib/cjs/text-input/TextInput.js.map +1 -1
  38. package/lib/cjs/text-input/stories/text-input-sizes.story.js +1 -1
  39. package/lib/cjs/text-input/stories/text-input-sizes.story.js.map +1 -1
  40. package/lib/cjs/time-picker/TimePicker.js +13 -7
  41. package/lib/cjs/time-picker/TimePicker.js.map +1 -1
  42. package/lib/cjs/timezone-picker/TimeZonePicker.js +13 -7
  43. package/lib/cjs/timezone-picker/TimeZonePicker.js.map +1 -1
  44. package/lib/esm/_common/form-control/FormFieldLabel.js +45 -0
  45. package/lib/esm/_common/form-control/FormFieldLabel.js.map +1 -0
  46. package/lib/esm/_common/form-control/FormFieldMessage.js +65 -0
  47. package/lib/esm/_common/form-control/FormFieldMessage.js.map +1 -0
  48. package/lib/esm/_common/form-control/form-control-types.js +22 -0
  49. package/lib/esm/_common/form-control/form-control-types.js.map +1 -0
  50. package/lib/esm/_common/form-control/index.js +32 -0
  51. package/lib/esm/_common/form-control/index.js.map +1 -0
  52. package/lib/esm/_common/form-control/use-form-field.js +72 -0
  53. package/lib/esm/_common/form-control/use-form-field.js.map +1 -0
  54. package/lib/esm/_common/form-control/use-inline-field-label.js +69 -0
  55. package/lib/esm/_common/form-control/use-inline-field-label.js.map +1 -0
  56. package/lib/esm/checkbox/Checkbox.js +10 -22
  57. package/lib/esm/checkbox/Checkbox.js.map +1 -1
  58. package/lib/esm/combobox/Combobox.js +76 -54
  59. package/lib/esm/combobox/Combobox.js.map +1 -1
  60. package/lib/esm/combobox/combobox-types.js.map +1 -1
  61. package/lib/esm/date-picker/DatePicker.js.map +1 -1
  62. package/lib/esm/icons/generated/custom/FloppyDiskArrowTopRight.js +28 -0
  63. package/lib/esm/icons/generated/custom/FloppyDiskArrowTopRight.js.map +1 -0
  64. package/lib/esm/icons/generated/custom/OpenQueryTab.js +1 -0
  65. package/lib/esm/icons/generated/custom/OpenQueryTab.js.map +1 -1
  66. package/lib/esm/icons/generated/custom/index.js +1 -0
  67. package/lib/esm/icons/generated/custom/index.js.map +1 -1
  68. package/lib/esm/next/tree-view/TreeView.js +16 -1
  69. package/lib/esm/next/tree-view/TreeView.js.map +1 -1
  70. package/lib/esm/radio/Radio.js +12 -22
  71. package/lib/esm/radio/Radio.js.map +1 -1
  72. package/lib/esm/select/Select.js +14 -5
  73. package/lib/esm/select/Select.js.map +1 -1
  74. package/lib/esm/select/types.js.map +1 -1
  75. package/lib/esm/switch/Switch.js +10 -22
  76. package/lib/esm/switch/Switch.js.map +1 -1
  77. package/lib/esm/text-area/TextArea.js +9 -22
  78. package/lib/esm/text-area/TextArea.js.map +1 -1
  79. package/lib/esm/text-input/TextInput.js +15 -38
  80. package/lib/esm/text-input/TextInput.js.map +1 -1
  81. package/lib/esm/text-input/stories/text-input-sizes.story.js +1 -1
  82. package/lib/esm/text-input/stories/text-input-sizes.story.js.map +1 -1
  83. package/lib/esm/time-picker/TimePicker.js +13 -7
  84. package/lib/esm/time-picker/TimePicker.js.map +1 -1
  85. package/lib/esm/timezone-picker/TimeZonePicker.js +13 -7
  86. package/lib/esm/timezone-picker/TimeZonePicker.js.map +1 -1
  87. package/lib/types/_common/form-control/FormFieldLabel.d.ts +58 -0
  88. package/lib/types/_common/form-control/FormFieldLabel.d.ts.map +1 -0
  89. package/lib/types/_common/form-control/FormFieldMessage.d.ts +46 -0
  90. package/lib/types/_common/form-control/FormFieldMessage.d.ts.map +1 -0
  91. package/lib/types/_common/form-control/form-control-types.d.ts +92 -0
  92. package/lib/types/_common/form-control/form-control-types.d.ts.map +1 -0
  93. package/lib/types/_common/form-control/index.d.ts +33 -0
  94. package/lib/types/_common/form-control/index.d.ts.map +1 -0
  95. package/lib/types/_common/form-control/use-form-field.d.ts +53 -0
  96. package/lib/types/_common/form-control/use-form-field.d.ts.map +1 -0
  97. package/lib/types/_common/form-control/use-inline-field-label.d.ts +69 -0
  98. package/lib/types/_common/form-control/use-inline-field-label.d.ts.map +1 -0
  99. package/lib/types/checkbox/Checkbox.d.ts.map +1 -1
  100. package/lib/types/combobox/Combobox.d.ts.map +1 -1
  101. package/lib/types/combobox/combobox-types.d.ts +6 -5
  102. package/lib/types/combobox/combobox-types.d.ts.map +1 -1
  103. package/lib/types/icons/generated/custom/FloppyDiskArrowTopRight.d.ts +29 -0
  104. package/lib/types/icons/generated/custom/FloppyDiskArrowTopRight.d.ts.map +1 -0
  105. package/lib/types/icons/generated/custom/OpenQueryTab.d.ts +1 -0
  106. package/lib/types/icons/generated/custom/OpenQueryTab.d.ts.map +1 -1
  107. package/lib/types/icons/generated/custom/index.d.ts +1 -0
  108. package/lib/types/icons/generated/custom/index.d.ts.map +1 -1
  109. package/lib/types/next/tree-view/TreeView.d.ts.map +1 -1
  110. package/lib/types/radio/Radio.d.ts.map +1 -1
  111. package/lib/types/select/Select.d.ts.map +1 -1
  112. package/lib/types/select/types.d.ts.map +1 -1
  113. package/lib/types/switch/Switch.d.ts.map +1 -1
  114. package/lib/types/text-area/TextArea.d.ts.map +1 -1
  115. package/lib/types/text-input/TextInput.d.ts.map +1 -1
  116. package/lib/types/text-input/stories/text-input-sizes.story.d.ts.map +1 -1
  117. package/lib/types/time-picker/TimePicker.d.ts +3 -1
  118. package/lib/types/time-picker/TimePicker.d.ts.map +1 -1
  119. package/lib/types/timezone-picker/TimeZonePicker.d.ts +4 -1
  120. package/lib/types/timezone-picker/TimeZonePicker.d.ts.map +1 -1
  121. package/package.json +3 -3
  122. package/skills/ndl-react/SKILL.md +7 -2
  123. package/skills/ndl-react/components/accordion.md +2 -0
  124. package/skills/ndl-react/components/ai/code-preview.md +4 -0
  125. package/skills/ndl-react/components/ai/file-tag.md +2 -0
  126. package/skills/ndl-react/components/ai/image-tag.md +2 -0
  127. package/skills/ndl-react/components/ai/more-files.md +2 -0
  128. package/skills/ndl-react/components/ai/presence.md +2 -0
  129. package/skills/ndl-react/components/ai/preview.md +2 -0
  130. package/skills/ndl-react/components/ai/prompt.md +2 -0
  131. package/skills/ndl-react/components/ai/reasoning.md +2 -0
  132. package/skills/ndl-react/components/ai/response.md +2 -0
  133. package/skills/ndl-react/components/ai/suggestion.md +2 -0
  134. package/skills/ndl-react/components/ai/thinking.md +2 -0
  135. package/skills/ndl-react/components/ai/tool-call.md +2 -0
  136. package/skills/ndl-react/components/ai/user-bubble.md +2 -0
  137. package/skills/ndl-react/components/avatar.md +2 -0
  138. package/skills/ndl-react/components/banner.md +2 -0
  139. package/skills/ndl-react/components/box.md +2 -0
  140. package/skills/ndl-react/components/breadcrumbs.md +2 -0
  141. package/skills/ndl-react/components/checkbox.md +2 -0
  142. package/skills/ndl-react/components/clean-icon-button.md +2 -0
  143. package/skills/ndl-react/components/clipboard-button.md +2 -0
  144. package/skills/ndl-react/components/code-block.md +2 -0
  145. package/skills/ndl-react/components/code.md +2 -0
  146. package/skills/ndl-react/components/color-picker.md +34 -32
  147. package/skills/ndl-react/components/combobox.md +5 -3
  148. package/skills/ndl-react/components/conditional-wrap.md +2 -0
  149. package/skills/ndl-react/components/data-grid.md +2 -0
  150. package/skills/ndl-react/components/date-picker.md +2 -0
  151. package/skills/ndl-react/components/dialog.md +2 -0
  152. package/skills/ndl-react/components/dismissible-tag.md +2 -0
  153. package/skills/ndl-react/components/divider.md +2 -0
  154. package/skills/ndl-react/components/drawer.md +2 -0
  155. package/skills/ndl-react/components/dropdown-button.md +2 -0
  156. package/skills/ndl-react/components/dropzone.md +7 -5
  157. package/skills/ndl-react/components/filled-button.md +2 -0
  158. package/skills/ndl-react/components/flex.md +2 -0
  159. package/skills/ndl-react/components/graph-label.md +2 -0
  160. package/skills/ndl-react/components/icon-button-array.md +2 -0
  161. package/skills/ndl-react/components/icon-button.md +2 -0
  162. package/skills/ndl-react/components/inline-edit.md +2 -0
  163. package/skills/ndl-react/components/kbd.md +2 -0
  164. package/skills/ndl-react/components/loading-bar.md +2 -0
  165. package/skills/ndl-react/components/loading-spinner.md +2 -0
  166. package/skills/ndl-react/components/logo.md +2 -0
  167. package/skills/ndl-react/components/menu.md +2 -0
  168. package/skills/ndl-react/components/modal.md +2 -0
  169. package/skills/ndl-react/components/next/tree-view.md +90 -2
  170. package/skills/ndl-react/components/outlined-button.md +2 -0
  171. package/skills/ndl-react/components/popover.md +2 -0
  172. package/skills/ndl-react/components/progress-bar.md +2 -0
  173. package/skills/ndl-react/components/radio.md +2 -0
  174. package/skills/ndl-react/components/read-only-tag.md +2 -0
  175. package/skills/ndl-react/components/segmented-control.md +2 -0
  176. package/skills/ndl-react/components/select-icon-button.md +2 -0
  177. package/skills/ndl-react/components/select.md +4 -0
  178. package/skills/ndl-react/components/selectable-tag.md +2 -0
  179. package/skills/ndl-react/components/side-navigation.md +2 -0
  180. package/skills/ndl-react/components/skeleton.md +2 -0
  181. package/skills/ndl-react/components/slider.md +2 -0
  182. package/skills/ndl-react/components/spotlight.md +2 -0
  183. package/skills/ndl-react/components/status-indicator.md +2 -0
  184. package/skills/ndl-react/components/status-label.md +2 -0
  185. package/skills/ndl-react/components/switch.md +2 -0
  186. package/skills/ndl-react/components/tabs.md +2 -0
  187. package/skills/ndl-react/components/tag.md +4 -0
  188. package/skills/ndl-react/components/text-area.md +2 -0
  189. package/skills/ndl-react/components/text-button.md +2 -0
  190. package/skills/ndl-react/components/text-input.md +8 -0
  191. package/skills/ndl-react/components/text-link.md +2 -0
  192. package/skills/ndl-react/components/time-picker.md +3 -0
  193. package/skills/ndl-react/components/timezone-picker.md +3 -0
  194. package/skills/ndl-react/components/tooltip.md +2 -0
  195. package/skills/ndl-react/components/tree-view.md +2 -0
  196. package/skills/ndl-react/components/typography.md +2 -0
  197. package/skills/ndl-react/components/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Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport { useMergeRefs } from '@floating-ui/react';\nimport classNames from 'classnames';\nimport {\n Children,\n cloneElement,\n createContext,\n isValidElement,\n useCallback,\n useContext,\n useEffect,\n useId,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n useSyncExternalStore,\n} from 'react';\n\nimport { type CommonProps, type TooltipObjectProps } from '../../_common/types';\nimport { useSemicontrolledState } from '../../_common/use-semi-controlled-state';\nimport { needleWarningMessage } from '../../_common/utils';\nimport { Checkbox } from '../../checkbox';\nimport { CleanIconButton } from '../../clean-icon-button';\nimport { ConditionalWrap } from '../../conditional-wrap';\nimport { isApplePlatform } from '../../helpers/platform';\nimport { ChevronRightIconOutline } from '../../icons/generated/heroIcons/ChevronRightIconOutline';\nimport { EllipsisHorizontalIconOutline } from '../../icons/generated/heroIcons/EllipsisHorizontalIconOutline';\nimport { Menu } from '../../menu';\nimport { Skeleton } from '../../skeleton';\nimport { Tooltip } from '../../tooltip';\nimport {\n computeNextSelection,\n computeSelectionEdges,\n countChangedIds,\n formatSelectionAnnouncement,\n type SelectionAnchor,\n type SelectionEdge,\n type SelectionIntent,\n type SelectionMode,\n} from './selection';\n\ntype ItemEntry = {\n isDisabled: boolean;\n isSelectable: boolean;\n isSelected: boolean;\n onSelectedChange?: (isSelected: boolean) => void;\n parentId: string | null;\n toggleExpanded: () => void;\n};\n\ntype TreeViewContextValue = {\n isRootManaged: boolean;\n level: number;\n onSelectionIntent: (itemId: string, intent: SelectionIntent) => void;\n parentId: string | null;\n registerItem: (itemId: string, entry: ItemEntry | null) => void;\n selectionMode: SelectionMode;\n setFocusedId: (id: string | null) => void;\n store: TreeViewStore;\n};\n\nconst noop = () => undefined;\n\nconst EMPTY_EDGES: ReadonlyMap<string, SelectionEdge> = new Map();\nconst EMPTY_IDS: ReadonlySet<string> = new Set();\nconst EMPTY_ID_LIST: string[] = [];\n\ntype TreeViewStoreState = {\n edgeById: ReadonlyMap<string, SelectionEdge>;\n focusedId: string | null;\n /** Mirror of the selected ids; only meaningful when the root manages selection. */\n selectedIds: ReadonlySet<string>;\n};\n\ntype TreeViewStore = {\n getState: () => TreeViewStoreState;\n setState: (partial: Partial<TreeViewStoreState>) => void;\n subscribe: (listener: () => void) => () => void;\n};\n\n/**\n * Volatile per-interaction state (focus, root-managed selection, edge\n * styling) lives in this store instead of React context, so each item can\n * subscribe to its own primitive slice via `useSyncExternalStore` and an\n * interaction only re-renders the rows whose slice actually changed.\n */\nfunction createTreeViewStore(\n initialState?: Partial<TreeViewStoreState>,\n): TreeViewStore {\n let state: TreeViewStoreState = {\n edgeById: EMPTY_EDGES,\n focusedId: null,\n selectedIds: EMPTY_IDS,\n ...initialState,\n };\n const listeners = new Set<() => void>();\n return {\n getState: () => state,\n setState: (partial) => {\n state = { ...state, ...partial };\n listeners.forEach((listener) => listener());\n },\n subscribe: (listener) => {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n },\n };\n}\n\nconst TREE_EVENTS = {\n action: 'treeitem-action',\n collapse: 'treeitem-collapse',\n expand: 'treeitem-expand',\n} as const;\n\nconst TreeViewContext = createContext<TreeViewContextValue>({\n isRootManaged: false,\n level: 1,\n onSelectionIntent: noop,\n parentId: null,\n registerItem: noop,\n selectionMode: 'single',\n setFocusedId: noop,\n store: createTreeViewStore(),\n});\n\n/**\n * On Apple platforms Ctrl+click is the context menu gesture, so only Cmd may\n * stand for an additive selection there.\n */\nfunction getSelectionIntent(\n event: React.KeyboardEvent | React.MouseEvent,\n): SelectionIntent {\n return {\n isRange: event.shiftKey,\n isToggle: isApplePlatform() ? event.metaKey : event.ctrlKey,\n };\n}\n\nfunction getVisibleTreeItems(root: HTMLElement): HTMLElement[] {\n return Array.from(\n root.querySelectorAll<HTMLElement>('[role=\"treeitem\"]'),\n ).filter((el) => {\n let parent = el.parentElement;\n while (parent && parent !== root) {\n if (parent.getAttribute('role') === 'group' && parent.hidden) {\n return false;\n }\n parent = parent.parentElement;\n }\n return true;\n });\n}\n\nfunction getVisibleItemIds(root: HTMLElement): string[] {\n return getVisibleTreeItems(root).map((el) => el.id);\n}\n\nfunction areIdSetsEqual(\n first: ReadonlySet<string>,\n second: ReadonlySet<string>,\n): boolean {\n if (first.size !== second.size) {\n return false;\n }\n for (const id of first) {\n if (!second.has(id)) {\n return false;\n }\n }\n return true;\n}\n\nfunction areEdgeMapsEqual(\n first: ReadonlyMap<string, SelectionEdge>,\n second: ReadonlyMap<string, SelectionEdge>,\n): boolean {\n if (first.size !== second.size) {\n return false;\n }\n for (const [id, edge] of first) {\n if (second.get(id) !== edge) {\n return false;\n }\n }\n return true;\n}\n\nfunction annotateTreeItems(children: React.ReactNode): React.ReactNode {\n const items = Children.toArray(children);\n const treeItemCount = items.filter(\n (child): child is React.ReactElement =>\n isValidElement(child) && child.type === Item,\n ).length;\n\n let posInSet = 0;\n return Children.map(children, (child) => {\n if (isValidElement(child) && child.type === Item) {\n posInSet++;\n return cloneElement(\n child as React.ReactElement<React.HTMLAttributes<HTMLElement>>,\n {\n 'aria-posinset': posInSet,\n 'aria-setsize': treeItemCount,\n },\n );\n }\n return child;\n });\n}\n\ntype RootProps = {\n /** The aria-label for the tree. Required for accessibility, unless using ariaLabelledby. Pass null to omit. */\n ariaLabel: string | null;\n /** The aria-labelledby for the tree. Pass a string of space-separated IDs of elements that label the tree. */\n ariaLabelledby?: string;\n /** The children of the tree. Should be TreeView.Item components or TreeView.SkeletonItem components only. */\n children?: React.ReactNode;\n /** Initially selected item ids for an uncontrolled root-managed selection. */\n defaultSelectedIds?: string[];\n /** Selected item ids. Makes the tree manage selection itself, instead of each item managing its own. */\n selectedIds?: string[];\n /** Selection mode for the tree. Defaults to \"single\". */\n selectionMode?: SelectionMode;\n /** Callback called with the complete next selection whenever the tree manages selection. Fires once per interaction. */\n onSelectedIdsChange?: (selectedIds: string[]) => void;\n};\n\n/**\n * Root container for a tree view. Renders a `role=\"tree\"` element with full\n * keyboard navigation (arrow keys, Home/End, Enter/Space) following the\n * WAI-ARIA TreeView pattern.\n *\n * Direct children should be `TreeView.Item` or `TreeView.SkeletonItem`.\n *\n * @example\n * ```tsx\n * <TreeView ariaLabel=\"Files\">\n * <TreeView.Item title=\"README.md\" onSelectedChange={setSelected} isSelected={selected} />\n * </TreeView>\n * ```\n *\n * @alpha - this component is still in development and may change in the future. It might not have feature parity with the old tree view yet.\n */\nconst Root = ({\n children,\n defaultSelectedIds,\n selectedIds: selectedIdsProp,\n selectionMode = 'single',\n ariaLabel,\n ariaLabelledby,\n className,\n style,\n htmlAttributes,\n onSelectedIdsChange,\n ref,\n ...restProps\n}: CommonProps<'div', RootProps>) => {\n const treeRef = useRef<HTMLDivElement>(null);\n const mergedRef = useMergeRefs([treeRef, ref]);\n const [announcement, setAnnouncement] = useState('');\n const anchorRef = useRef<SelectionAnchor>(null);\n const entriesRef = useRef(new Map<string, ItemEntry>());\n\n const isRootManaged =\n selectedIdsProp !== undefined || defaultSelectedIds !== undefined;\n\n const storeRef = useRef<TreeViewStore>(null);\n if (storeRef.current === null) {\n storeRef.current = createTreeViewStore({\n selectedIds: new Set(\n selectedIdsProp ?? defaultSelectedIds ?? EMPTY_ID_LIST,\n ),\n });\n }\n const store = storeRef.current;\n\n const setFocusedId = useCallback(\n (id: string | null) => {\n if (store.getState().focusedId !== id) {\n store.setState({ focusedId: id });\n }\n },\n [store],\n );\n\n const [selectedIdList, setSelectedIdList] = useSemicontrolledState<string[]>({\n isControlled: selectedIdsProp !== undefined,\n onChange: onSelectedIdsChange,\n state: selectedIdsProp ?? defaultSelectedIds ?? EMPTY_ID_LIST,\n });\n\n // useSemicontrolledState recreates its setter whenever the value changes;\n // reading it through a ref keeps onSelectionIntent (and with it the\n // memoized context value) stable across selection changes.\n const setSelectedIdListRef = useRef(setSelectedIdList);\n useLayoutEffect(() => {\n setSelectedIdListRef.current = setSelectedIdList;\n });\n\n const readSelectedIds = useCallback((): Set<string> => {\n if (isRootManaged) {\n return new Set(store.getState().selectedIds);\n }\n const selected = new Set<string>();\n entriesRef.current.forEach((entry, itemId) => {\n if (entry.isSelected) {\n selected.add(itemId);\n }\n });\n return selected;\n }, [isRootManaged, store]);\n\n const readItemMaps = useCallback(() => {\n const parentIdById = new Map<string, string>();\n const selectableIds = new Set<string>();\n entriesRef.current.forEach((entry, itemId) => {\n if (entry.parentId !== null) {\n parentIdById.set(itemId, entry.parentId);\n }\n if (entry.isSelectable && !entry.isDisabled) {\n selectableIds.add(itemId);\n }\n });\n return { parentIdById, selectableIds };\n }, []);\n\n const recomputeEdges = useCallback(() => {\n const root = treeRef.current;\n const previousEdges = store.getState().edgeById;\n if (!root || selectionMode !== 'multiple-replace') {\n if (previousEdges.size > 0) {\n store.setState({ edgeById: EMPTY_EDGES });\n }\n return;\n }\n const selectedIds = readSelectedIds();\n if (selectedIds.size === 0 && previousEdges.size === 0) {\n return;\n }\n const nextEdges = computeSelectionEdges(\n getVisibleItemIds(root),\n selectedIds,\n );\n if (!areEdgeMapsEqual(previousEdges, nextEdges)) {\n store.setState({ edgeById: nextEdges });\n }\n }, [readSelectedIds, selectionMode, store]);\n\n const recomputeEdgesRef = useRef(recomputeEdges);\n useLayoutEffect(() => {\n recomputeEdgesRef.current = recomputeEdges;\n });\n\n // Debounced through a microtask so a commit that touches many items (mount,\n // expansion, range selection) triggers a single recompute, after all item\n // layout effects have registered and before the browser paints.\n const isEdgeRecomputeScheduledRef = useRef(false);\n const scheduleEdgeRecompute = useCallback(() => {\n if (isEdgeRecomputeScheduledRef.current) {\n return;\n }\n isEdgeRecomputeScheduledRef.current = true;\n queueMicrotask(() => {\n isEdgeRecomputeScheduledRef.current = false;\n recomputeEdgesRef.current();\n });\n }, []);\n\n const registerItem = useCallback(\n (itemId: string, entry: ItemEntry | null) => {\n if (entry === null) {\n entriesRef.current.delete(itemId);\n } else {\n entriesRef.current.set(itemId, entry);\n }\n // Covers item mount/unmount and expansion toggles (a collapsing parent\n // re-registers because its toggleExpanded callback is recreated).\n scheduleEdgeRecompute();\n },\n [scheduleEdgeRecompute],\n );\n\n const onSelectionIntent = useCallback(\n (itemId: string, intent: SelectionIntent) => {\n const root = treeRef.current;\n const entry = entriesRef.current.get(itemId);\n if (!root || !entry || entry.isDisabled) {\n return;\n }\n if (!entry.isSelectable) {\n entry.toggleExpanded();\n return;\n }\n\n const { parentIdById, selectableIds } = readItemMaps();\n const selectedIds = readSelectedIds();\n const result = computeNextSelection({\n anchor: anchorRef.current,\n intent,\n parentIdById,\n selectableIds,\n selectedIds,\n selectionMode,\n targetId: itemId,\n visibleIds: getVisibleItemIds(root),\n });\n anchorRef.current = result.anchor;\n\n const nextSelectedIds = result.selectedIds;\n const changedCount = countChangedIds(selectedIds, nextSelectedIds);\n\n if (isRootManaged) {\n if (changedCount > 0) {\n setSelectedIdListRef.current([...nextSelectedIds]);\n }\n } else if (selectionMode === 'single') {\n // Single mode leaves clearing the previously selected item to the\n // consumer, so only the clicked item is told about the change.\n if (!selectedIds.has(itemId)) {\n entry.onSelectedChange?.(true);\n }\n } else {\n entriesRef.current.forEach((itemEntry, id) => {\n const isSelected = nextSelectedIds.has(id);\n if (itemEntry.isSelected !== isSelected) {\n itemEntry.onSelectedChange?.(isSelected);\n }\n });\n }\n\n scheduleEdgeRecompute();\n\n if (selectionMode !== 'single') {\n setAnnouncement(\n intent.isRange\n ? formatSelectionAnnouncement(nextSelectedIds.size)\n : '',\n );\n }\n },\n [\n isRootManaged,\n readItemMaps,\n readSelectedIds,\n scheduleEdgeRecompute,\n selectionMode,\n ],\n );\n\n // Mirrors the root-managed selection into the store, so items subscribe to\n // their own slice and event handlers read it without a state dependency.\n useLayoutEffect(() => {\n const next = isRootManaged ? new Set(selectedIdList) : EMPTY_IDS;\n if (areIdSetsEqual(store.getState().selectedIds, next)) {\n return;\n }\n store.setState({ selectedIds: next });\n scheduleEdgeRecompute();\n }, [isRootManaged, scheduleEdgeRecompute, selectedIdList, store]);\n\n // Computes edges on mount and whenever the edge inputs change identity\n // (selection mode, root-managed flag). Interaction-driven recomputes go\n // through scheduleEdgeRecompute instead.\n useLayoutEffect(() => {\n recomputeEdges();\n }, [recomputeEdges]);\n\n const handleKeyDown = useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n const root = treeRef.current;\n if (!root) {\n return;\n }\n\n const items = getVisibleTreeItems(root);\n if (items.length === 0) {\n return;\n }\n\n const currentIndex = items.findIndex(\n (el) => el.id === store.getState().focusedId,\n );\n let isHandled = true;\n\n const extendRangeTo = (item: HTMLElement) => {\n if (selectionMode === 'single' || currentIndex < 0) {\n return;\n }\n const entry = entriesRef.current.get(item.id);\n if (!entry?.isSelectable || entry.isDisabled) {\n return;\n }\n if (anchorRef.current === null) {\n // A keyboard range has no preceding click to repeat, so it grows the\n // selection outwards from wherever focus already is.\n anchorRef.current = {\n baseSelectedIds: readSelectedIds(),\n id: items[currentIndex].id,\n isSelected: true,\n };\n }\n onSelectionIntent(item.id, { isRange: true, isToggle: false });\n };\n\n switch (event.key) {\n case 'ArrowDown': {\n const nextIndex =\n currentIndex < items.length - 1 ? currentIndex + 1 : currentIndex;\n const nextItem = items[nextIndex];\n if (nextItem) {\n if (event.shiftKey) {\n extendRangeTo(nextItem);\n }\n setFocusedId(nextItem.id);\n nextItem.focus();\n }\n break;\n }\n case 'ArrowUp': {\n const prevIndex = currentIndex > 0 ? currentIndex - 1 : 0;\n const prevItem = items[prevIndex];\n if (prevItem) {\n if (event.shiftKey) {\n extendRangeTo(prevItem);\n }\n setFocusedId(prevItem.id);\n prevItem.focus();\n }\n break;\n }\n case 'ArrowRight': {\n const current = currentIndex >= 0 ? items[currentIndex] : null;\n if (!current) {\n break;\n }\n const isExpanded = current.getAttribute('aria-expanded');\n if (isExpanded === 'false') {\n current.dispatchEvent(new CustomEvent(TREE_EVENTS.expand));\n } else if (isExpanded === 'true') {\n const nextIndex = currentIndex + 1;\n if (nextIndex < items.length) {\n const nextItem = items[nextIndex];\n setFocusedId(nextItem.id);\n nextItem.focus();\n }\n }\n break;\n }\n case 'ArrowLeft': {\n const current = currentIndex >= 0 ? items[currentIndex] : null;\n if (!current) {\n break;\n }\n const isExpanded = current.getAttribute('aria-expanded');\n if (isExpanded === 'true') {\n current.dispatchEvent(new CustomEvent(TREE_EVENTS.collapse));\n } else {\n const parentGroup = current.closest('[role=\"group\"]');\n if (parentGroup?.id) {\n const parentItem = root.querySelector<HTMLElement>(\n `[aria-owns=\"${parentGroup.id}\"]`,\n );\n if (parentItem) {\n setFocusedId(parentItem.id);\n parentItem.focus();\n }\n }\n }\n break;\n }\n case 'Home': {\n const first = items[0];\n if (first) {\n setFocusedId(first.id);\n first.focus();\n }\n break;\n }\n case 'End': {\n const last = items[items.length - 1];\n if (last) {\n setFocusedId(last.id);\n last.focus();\n }\n break;\n }\n case 'Enter':\n case ' ': {\n const current = currentIndex >= 0 ? items[currentIndex] : null;\n if (current) {\n onSelectionIntent(current.id, getSelectionIntent(event));\n }\n break;\n }\n case 'F10': {\n if (event.shiftKey) {\n const current = currentIndex >= 0 ? items[currentIndex] : null;\n if (current) {\n current.dispatchEvent(new CustomEvent(TREE_EVENTS.action));\n }\n } else {\n isHandled = false;\n }\n break;\n }\n default:\n isHandled = false;\n }\n\n if (isHandled) {\n event.preventDefault();\n event.stopPropagation();\n }\n },\n [onSelectionIntent, readSelectedIds, selectionMode, setFocusedId, store],\n );\n\n const handleFocus = useCallback(\n (event: React.FocusEvent<HTMLDivElement>) => {\n const root = treeRef.current;\n if (!root) {\n return;\n }\n\n if (event.target === root) {\n const items = getVisibleTreeItems(root);\n const { focusedId } = store.getState();\n const alreadyFocused = focusedId\n ? items.find((el) => el.id === focusedId)\n : null;\n const target = alreadyFocused ?? items[0];\n if (target) {\n setFocusedId(target.id);\n target.focus();\n }\n }\n },\n [setFocusedId, store],\n );\n\n const classes = classNames(className, 'ndl-tree-view-new', {\n 'ndl-tree-view-new--checkbox': selectionMode === 'multiple',\n });\n\n // Cached on children identity so Root-internal state commits (announcement,\n // uncontrolled selection) reuse the same annotated elements and React bails\n // out of the whole item subtree instead of re-rendering every row.\n const annotatedChildren = useMemo(\n () => annotateTreeItems(children),\n [children],\n );\n\n // Everything in here is stable or primitive, so items only re-render via\n // context when the tree's configuration changes, not per interaction.\n const contextValue = useMemo(\n () => ({\n isRootManaged,\n level: 1,\n onSelectionIntent,\n parentId: null,\n registerItem,\n selectionMode,\n setFocusedId,\n store,\n }),\n [\n isRootManaged,\n onSelectionIntent,\n registerItem,\n selectionMode,\n setFocusedId,\n store,\n ],\n );\n\n return (\n <TreeViewContext.Provider value={contextValue}>\n <div\n ref={mergedRef}\n role=\"tree\"\n aria-multiselectable={\n selectionMode === 'multiple' || selectionMode === 'multiple-replace'\n ? true\n : undefined\n }\n tabIndex={0}\n className={classes}\n onKeyDown={handleKeyDown}\n onFocus={handleFocus}\n aria-label={ariaLabel ?? undefined}\n aria-labelledby={ariaLabelledby}\n style={style}\n {...htmlAttributes}\n {...restProps}\n >\n {annotatedChildren}\n </div>\n <div\n role=\"status\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n className=\"ndl-tree-view-new-live-region\"\n >\n {announcement}\n </div>\n </TreeViewContext.Provider>\n );\n};\n\ntype ItemProps = {\n /** Nested TreeView.Item or TreeView.SkeletonItem elements rendered as sub-items in a collapsible group. */\n children?: React.ReactNode;\n /** The label content displayed in the item row. */\n title?: React.ReactNode;\n /** Default expansion for uncontrolled items */\n // TODO v5: fix boolean naming convention\n // eslint-disable-next-line @typescript-eslint/naming-convention\n defaultExpanded?: boolean;\n /** Whether the item has children. Decides if the item should render a chevron for expansion. Needed for lazy loading. */\n hasChildren?: boolean;\n /** Identifies the item. Required when the tree manages selection via `selectedIds`. */\n id?: string;\n /** Whether the item is disabled */\n isDisabled?: boolean;\n /** Whether the item is expanded. Makes the item controlled. */\n isExpanded?: boolean;\n /** Whether the item is in an indeterminate state. Only meaningful in multi-select mode for parent nodes. */\n isIndeterminate?: boolean;\n /** Whether the item is loading. Applies aria-busy=\"true\" to the item. */\n isLoading?: boolean;\n /** Whether the item can be selected. Defaults to true when the tree manages selection, and otherwise to whether `onSelectedChange` is set. */\n isSelectable?: boolean;\n /** Whether the item is selected. Ignored when the tree manages selection via `selectedIds`. */\n isSelected?: boolean;\n /** Leading visual for the item. */\n leadingVisual?: React.ReactNode;\n /** Trailing content for the item. Shown after the children but before the action menu. */\n trailingContent?: React.ReactNode;\n /** ReactNode containing Menu.Item elements to render in an action menu. When provided, an action button is rendered. */\n actionMenuItems?: React.ReactNode;\n /** Props forwarded to the Menu sub-components (anchorRef, onClose). */\n actionMenuProps?: React.ComponentProps<typeof Menu>;\n /** Content rendered inside the tooltip. When provided, the item is wrapped in a Tooltip. */\n tooltipContent?: React.ReactNode;\n /** Props forwarded to the Tooltip sub-components (root, trigger, content). */\n tooltipProps?: TooltipObjectProps;\n /** Callback called when the item is expanded/collapsed. */\n onExpandedChange?: (isExpanded: boolean) => void;\n /** Callback called when the item is selected/deselected. Receives the new selected state. Ignored when the tree manages selection via `selectedIds`. */\n onSelectedChange?: (isSelected: boolean) => void;\n};\n\n/**\n * A single item within a `TreeView`. Renders a `role=\"treeitem\"` element that\n * supports selection, expansion, leading/trailing visuals, and an action menu.\n *\n * The `title` prop provides the item's label content. Nesting `TreeView.Item`\n * elements as `children` creates a hierarchical tree structure.\n *\n * Supports both controlled (`isExpanded`) and uncontrolled (`defaultExpanded`)\n * expansion, as well as lazy loading via `hasChildren` + `isLoading`.\n *\n * @example\n * ```tsx\n * <TreeView.Item\n * title=\"src\"\n * leadingVisual={<FolderIcon />}\n * isSelected={selected}\n * onSelectedChange={setSelected}\n * >\n * <TreeView.Item title=\"index.ts\" />\n * </TreeView.Item>\n * ```\n */\nconst Item = ({\n actionMenuItems,\n children,\n defaultExpanded = false,\n hasChildren: hasChildrenProp,\n id: idProp,\n isDisabled,\n isExpanded: isExpandedProp,\n isIndeterminate,\n isLoading,\n isSelectable: isSelectableProp,\n isSelected: isSelectedProp,\n leadingVisual,\n title,\n tooltipContent,\n tooltipProps,\n trailingContent,\n onExpandedChange,\n onSelectedChange,\n actionMenuProps,\n className,\n style,\n htmlAttributes,\n ref,\n ...restProps\n}: CommonProps<'div', ItemProps>) => {\n const generatedId = useId();\n const itemId = idProp ?? htmlAttributes?.id ?? `ndl-treeitem-${generatedId}`;\n const titleId = `ndl-treeitem-title-${generatedId}`;\n const groupId = `ndl-treegroup-${generatedId}`;\n const itemRef = useRef<HTMLDivElement>(null);\n const actionButtonRef = useRef<HTMLButtonElement>(null);\n const didOpenViaKeyboard = useRef(false);\n const [isMenuOpen, setIsMenuOpen] = useState(false);\n const treeViewContext = useContext(TreeViewContext);\n const {\n isRootManaged,\n level,\n onSelectionIntent,\n parentId,\n registerItem,\n selectionMode,\n setFocusedId,\n store,\n } = treeViewContext;\n\n // Primitive slices of the store, so Object.is bails out of re-renders for\n // rows whose focus/selection/edge state did not change.\n const isFocused = useSyncExternalStore(\n store.subscribe,\n () => store.getState().focusedId === itemId,\n () => store.getState().focusedId === itemId,\n );\n const isRootSelected = useSyncExternalStore(\n store.subscribe,\n () => store.getState().selectedIds.has(itemId),\n () => store.getState().selectedIds.has(itemId),\n );\n const edge = useSyncExternalStore(\n store.subscribe,\n () => store.getState().edgeById.get(itemId),\n () => store.getState().edgeById.get(itemId),\n );\n\n const isControlledExpansion = isExpandedProp !== undefined;\n const [isExpanded, setIsExpanded] = useSemicontrolledState({\n isControlled: isControlledExpansion,\n onChange: onExpandedChange,\n state: isExpandedProp ?? defaultExpanded,\n });\n\n const hasChildren = hasChildrenProp ?? Children.count(children) > 0;\n const isSelectable = isRootManaged\n ? (isSelectableProp ?? true)\n : (isSelectableProp ?? onSelectedChange !== undefined);\n const isSelected = isRootManaged ? isRootSelected : (isSelectedProp ?? false);\n const isMultiple = selectionMode === 'multiple';\n\n const toggleExpanded = useCallback(() => {\n if (isDisabled) {\n return;\n }\n if (hasChildren) {\n setIsExpanded(!isExpanded);\n }\n }, [isDisabled, hasChildren, setIsExpanded, isExpanded]);\n\n useLayoutEffect(() => {\n registerItem(itemId, {\n isDisabled: isDisabled ?? false,\n isSelectable,\n isSelected,\n onSelectedChange,\n parentId,\n toggleExpanded,\n });\n }, [\n isDisabled,\n isSelectable,\n isSelected,\n itemId,\n onSelectedChange,\n parentId,\n registerItem,\n toggleExpanded,\n ]);\n\n useLayoutEffect(() => {\n return () => registerItem(itemId, null);\n }, [itemId, registerItem]);\n\n useEffect(() => {\n if (!isRootManaged) {\n return;\n }\n if (idProp === undefined) {\n needleWarningMessage(\n 'TreeView.Item needs an `id` when the tree manages selection with `selectedIds`.',\n );\n }\n if (isSelectedProp !== undefined || onSelectedChange !== undefined) {\n needleWarningMessage(\n 'TreeView.Item `isSelected` and `onSelectedChange` are ignored when the tree manages selection with `selectedIds`.',\n );\n }\n }, [idProp, isRootManaged, isSelectedProp, onSelectedChange]);\n\n const handleClick = useCallback(\n (event: React.MouseEvent) => {\n if (isDisabled) {\n return;\n }\n setFocusedId(itemId);\n onSelectionIntent(itemId, getSelectionIntent(event));\n },\n [isDisabled, setFocusedId, itemId, onSelectionIntent],\n );\n\n const handleChevronClick = useCallback(\n (event: React.MouseEvent) => {\n event.stopPropagation();\n if (isDisabled) {\n return;\n }\n setFocusedId(itemId);\n toggleExpanded();\n },\n [isDisabled, setFocusedId, itemId, toggleExpanded],\n );\n\n const handleMenuClose = useCallback(() => {\n setIsMenuOpen(false);\n if (didOpenViaKeyboard.current) {\n itemRef.current?.focus();\n didOpenViaKeyboard.current = false;\n }\n }, []);\n\n const handleCustomEvents = useCallback(\n (event: Event) => {\n if (event.type === TREE_EVENTS.expand) {\n event.stopPropagation();\n if (hasChildren && !isExpanded && !isDisabled) {\n setIsExpanded(true);\n }\n } else if (event.type === TREE_EVENTS.collapse) {\n event.stopPropagation();\n if (hasChildren && isExpanded && !isDisabled) {\n setIsExpanded(false);\n }\n } else if (event.type === TREE_EVENTS.action) {\n event.stopPropagation();\n if (actionMenuItems && !isDisabled) {\n didOpenViaKeyboard.current = true;\n setIsMenuOpen(true);\n }\n }\n },\n [actionMenuItems, hasChildren, isExpanded, isDisabled, setIsExpanded],\n );\n\n const callbackRef = useCallback(\n (node: HTMLDivElement | null) => {\n const prev = itemRef.current;\n if (prev) {\n prev.removeEventListener(TREE_EVENTS.expand, handleCustomEvents);\n prev.removeEventListener(TREE_EVENTS.collapse, handleCustomEvents);\n prev.removeEventListener(TREE_EVENTS.action, handleCustomEvents);\n }\n (itemRef as React.MutableRefObject<HTMLDivElement | null>).current = node;\n if (node) {\n node.addEventListener(TREE_EVENTS.expand, handleCustomEvents);\n node.addEventListener(TREE_EVENTS.collapse, handleCustomEvents);\n node.addEventListener(TREE_EVENTS.action, handleCustomEvents);\n }\n },\n [handleCustomEvents],\n );\n\n const mergedRef = useMergeRefs([callbackRef, ref]);\n\n const selectionAriaProps = (() => {\n if (!isSelectable) {\n return {};\n }\n if (isMultiple) {\n return {\n 'aria-checked': isIndeterminate ? ('mixed' as const) : isSelected,\n };\n }\n return { 'aria-selected': isSelected };\n })();\n\n const edgeClass =\n edge === undefined ? undefined : `ndl-tree-view-new-item--selected-${edge}`;\n\n const childContextValue = useMemo(\n () => ({\n ...treeViewContext,\n level: treeViewContext.level + 1,\n parentId: itemId,\n }),\n [itemId, treeViewContext],\n );\n\n // Same caching as in Root: keeps child element identity stable across\n // renders of this item (selection, focus, expansion) so unchanged\n // descendants bail out of re-rendering.\n const annotatedChildren = useMemo(\n () => annotateTreeItems(children),\n [children],\n );\n\n const itemElement = (\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events -- keyboard handled on tree root; aria-selected/aria-checked applied via spread\n <div\n ref={mergedRef}\n // eslint-disable-next-line jsx-a11y/role-has-required-aria-props -- aria-selected/aria-checked applied conditionally via spread\n role=\"treeitem\"\n {...selectionAriaProps}\n aria-expanded={hasChildren ? isExpanded : undefined}\n aria-owns={hasChildren ? groupId : undefined}\n aria-disabled={isDisabled || undefined}\n aria-busy={isLoading || undefined}\n aria-keyshortcuts={actionMenuItems ? 'Shift+F10' : undefined}\n aria-labelledby={titleId}\n aria-level={level}\n tabIndex={isFocused ? 0 : -1}\n className={classNames('ndl-tree-view-new-item', className, edgeClass, {\n 'ndl-tree-view-new-item--disabled': isDisabled,\n 'ndl-tree-view-new-item--parent': hasChildren,\n 'ndl-tree-view-new-item--selected': isSelected && isSelectable,\n })}\n style={{ '--tree-level': level - 1, ...style } as React.CSSProperties}\n onClick={(event) => {\n event.stopPropagation();\n handleClick(event);\n }}\n {...htmlAttributes}\n {...restProps}\n id={itemId}\n >\n <div\n className={classNames('ndl-tree-view-new-item-content', {\n 'ndl-tree-view-new-item-content--parent': hasChildren,\n })}\n >\n {hasChildren && (\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions -- keyboard handled on tree root\n <span\n className=\"ndl-tree-view-new-chevron\"\n aria-disabled={isDisabled}\n onClick={handleChevronClick}\n >\n <ChevronRightIconOutline\n className={classNames('ndl-tree-view-new-chevron-icon', {\n 'ndl-tree-view-new-chevron-icon--open': isExpanded,\n })}\n />\n </span>\n )}\n {leadingVisual && (\n <div className=\"ndl-tree-view-new-item-content-leading-visual\">\n {leadingVisual}\n </div>\n )}\n {isMultiple && isSelectable && (\n <div className=\"ndl-tree-view-new-checkbox\" inert>\n <Checkbox\n style={{ borderWidth: '1.5px' }}\n ariaLabel=\"Select\"\n isChecked={isSelected}\n isIndeterminate={isIndeterminate}\n isDisabled={isDisabled}\n onChange={noop}\n />\n </div>\n )}\n <div id={titleId} className=\"ndl-tree-view-new-item-content-title\">\n {title}\n </div>\n {trailingContent && (\n <div className=\"ndl-tree-view-new-item-content-trailing-content\">\n {trailingContent}\n </div>\n )}\n {actionMenuItems && (\n <div\n className={classNames('ndl-tree-view-new-action', {\n 'ndl-tree-view-new-action--visible': isMenuOpen,\n })}\n >\n <CleanIconButton\n ref={actionButtonRef}\n size=\"small\"\n description={null}\n isDisabled={isDisabled}\n style={{ height: '24px', width: '24px' }}\n htmlAttributes={{\n 'aria-expanded': isMenuOpen || undefined,\n 'aria-haspopup': 'menu',\n 'aria-label': 'Actions',\n onClick: (event: React.MouseEvent) => {\n event.stopPropagation();\n didOpenViaKeyboard.current = false;\n setIsMenuOpen((prev) => !prev);\n },\n tabIndex: -1,\n }}\n >\n <EllipsisHorizontalIconOutline />\n </CleanIconButton>\n <Menu\n isOpen={isMenuOpen}\n anchorRef={actionButtonRef}\n onClose={handleMenuClose}\n {...actionMenuProps}\n >\n {actionMenuItems}\n </Menu>\n </div>\n )}\n </div>\n </div>\n );\n\n return (\n <>\n <ConditionalWrap\n shouldWrap={tooltipContent !== undefined && tooltipContent !== null}\n wrap={(children) => (\n <Tooltip\n type=\"simple\"\n hoverDelay={{ close: 0, open: 500 }}\n isDisabled={isMenuOpen}\n followCursor=\"initial\"\n {...tooltipProps?.root}\n >\n <Tooltip.Trigger hasButtonWrapper {...tooltipProps?.trigger}>\n {children}\n </Tooltip.Trigger>\n <Tooltip.Content {...tooltipProps?.content}>\n {tooltipContent}\n </Tooltip.Content>\n </Tooltip>\n )}\n >\n {itemElement}\n </ConditionalWrap>\n {hasChildren && (\n <TreeViewContext.Provider value={childContextValue}>\n <div\n role=\"group\"\n id={groupId}\n hidden={!isExpanded}\n style={{ '--tree-level': level - 1 } as React.CSSProperties}\n >\n {annotatedChildren}\n </div>\n </TreeViewContext.Provider>\n )}\n </>\n );\n};\n\ntype SkeletonItemProps = {\n /** The number of rows to render. */\n rows?: number;\n};\n\n/**\n * A skeleton placeholder for tree items that are being loaded. Renders one or\n * more `Skeleton` rows at the current nesting depth. The element is\n * `aria-hidden` since it is purely a visual indicator and not interactive.\n *\n * Typically used inside a `TreeView.Item` that has `isLoading` set, to give\n * the user a visual hint that child items are being fetched.\n *\n * @example\n * ```tsx\n * <TreeView.Item title=\"Lazy folder\" hasChildren isLoading isExpanded>\n * {isLoading && <TreeView.SkeletonItem rows={3} />}\n * </TreeView.Item>\n * ```\n */\nconst SkeletonItem = ({\n rows = 1,\n className,\n style,\n htmlAttributes,\n ref,\n ...restProps\n}: CommonProps<'div', SkeletonItemProps>) => {\n const { level } = useContext(TreeViewContext);\n return (\n <div\n ref={ref}\n aria-hidden=\"true\"\n className={classNames('ndl-tree-view-new-skeleton', className)}\n style={{ '--tree-level': level - 1, ...style } as React.CSSProperties}\n {...htmlAttributes}\n {...restProps}\n >\n {Array.from({ length: rows }, (_unused, index) => (\n <Skeleton key={index} height=\"18px\" width=\"100%\" />\n ))}\n </div>\n );\n};\n\n/**\n * @remarks\n * Selection can be managed per item, with `isSelected` and `onSelectedChange`\n * on each `TreeView.Item`, or by the tree itself, by passing `selectedIds` (or\n * `defaultSelectedIds`) together with `onSelectedIdsChange`. When the tree\n * manages selection, every item needs an `id`, and each item's own\n * `isSelected` and `onSelectedChange` are ignored.\n *\n * The available selection modes are:\n *\n * - `single` — one item at a time. An unmodified click selects the clicked item and never clears it.\n * - `multiple` — multi-select with checkboxes. An unmodified click toggles an item, and `Shift` repeats that across a range without clearing anything outside it.\n * - `multiple-replace` — multi-select without checkboxes. An unmodified click selects only that item, `Cmd`/`Ctrl` toggles it and moves the anchor, and `Shift` extends from that anchor while retaining its selection snapshot. `Shift` + arrow extends the range.\n */\nconst TreeView = Object.assign(Root, { Item, SkeletonItem });\nexport { TreeView };\n"]}
1
+ {"version":3,"file":"TreeView.js","sourceRoot":"","sources":["../../../../src/next/tree-view/TreeView.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,UAAU,MAAM,Y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AAE,EAAE,CAAC,CAChD,KAAC,QAAQ,IAAa,MAAM,EAAC,MAAM,EAAC,KAAK,EAAC,MAAM,IAAjC,KAAK,CAA+B,CACpD,CAAC,IACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport { useMergeRefs } from '@floating-ui/react';\nimport classNames from 'classnames';\nimport {\n Children,\n cloneElement,\n createContext,\n isValidElement,\n useCallback,\n useContext,\n useEffect,\n useId,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n useSyncExternalStore,\n} from 'react';\n\nimport { type CommonProps, type TooltipObjectProps } from '../../_common/types';\nimport { useSemicontrolledState } from '../../_common/use-semi-controlled-state';\nimport { needleWarningMessage } from '../../_common/utils';\nimport { Checkbox } from '../../checkbox';\nimport { CleanIconButton } from '../../clean-icon-button';\nimport { ConditionalWrap } from '../../conditional-wrap';\nimport { isApplePlatform } from '../../helpers/platform';\nimport { ChevronRightIconOutline } from '../../icons/generated/heroIcons/ChevronRightIconOutline';\nimport { EllipsisHorizontalIconOutline } from '../../icons/generated/heroIcons/EllipsisHorizontalIconOutline';\nimport { Menu } from '../../menu';\nimport { Skeleton } from '../../skeleton';\nimport { Tooltip } from '../../tooltip';\nimport {\n computeNextSelection,\n computeSelectionEdges,\n countChangedIds,\n formatSelectionAnnouncement,\n type SelectionAnchor,\n type SelectionEdge,\n type SelectionIntent,\n type SelectionMode,\n} from './selection';\n\ntype ItemEntry = {\n isDisabled: boolean;\n isSelectable: boolean;\n isSelected: boolean;\n onSelectedChange?: (isSelected: boolean) => void;\n parentId: string | null;\n toggleExpanded: () => void;\n};\n\ntype TreeViewContextValue = {\n isRootManaged: boolean;\n level: number;\n onSelectionIntent: (itemId: string, intent: SelectionIntent) => void;\n parentId: string | null;\n registerItem: (itemId: string, entry: ItemEntry | null) => void;\n selectionMode: SelectionMode;\n setFocusedId: (id: string | null) => void;\n store: TreeViewStore;\n};\n\nconst noop = () => undefined;\n\nconst EMPTY_EDGES: ReadonlyMap<string, SelectionEdge> = new Map();\nconst EMPTY_IDS: ReadonlySet<string> = new Set();\nconst EMPTY_ID_LIST: string[] = [];\n\ntype TreeViewStoreState = {\n edgeById: ReadonlyMap<string, SelectionEdge>;\n focusedId: string | null;\n /** Mirror of the selected ids; only meaningful when the root manages selection. */\n selectedIds: ReadonlySet<string>;\n};\n\ntype TreeViewStore = {\n getState: () => TreeViewStoreState;\n setState: (partial: Partial<TreeViewStoreState>) => void;\n subscribe: (listener: () => void) => () => void;\n};\n\n/**\n * Volatile per-interaction state (focus, root-managed selection, edge\n * styling) lives in this store instead of React context, so each item can\n * subscribe to its own primitive slice via `useSyncExternalStore` and an\n * interaction only re-renders the rows whose slice actually changed.\n */\nfunction createTreeViewStore(\n initialState?: Partial<TreeViewStoreState>,\n): TreeViewStore {\n let state: TreeViewStoreState = {\n edgeById: EMPTY_EDGES,\n focusedId: null,\n selectedIds: EMPTY_IDS,\n ...initialState,\n };\n const listeners = new Set<() => void>();\n return {\n getState: () => state,\n setState: (partial) => {\n state = { ...state, ...partial };\n listeners.forEach((listener) => listener());\n },\n subscribe: (listener) => {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n },\n };\n}\n\nconst TREE_EVENTS = {\n action: 'treeitem-action',\n collapse: 'treeitem-collapse',\n expand: 'treeitem-expand',\n} as const;\n\nconst TreeViewContext = createContext<TreeViewContextValue>({\n isRootManaged: false,\n level: 1,\n onSelectionIntent: noop,\n parentId: null,\n registerItem: noop,\n selectionMode: 'single',\n setFocusedId: noop,\n store: createTreeViewStore(),\n});\n\n/**\n * On Apple platforms Ctrl+click is the context menu gesture, so only Cmd may\n * stand for an additive selection there.\n */\nfunction getSelectionIntent(\n event: React.KeyboardEvent | React.MouseEvent,\n): SelectionIntent {\n return {\n isRange: event.shiftKey,\n isToggle: isApplePlatform() ? event.metaKey : event.ctrlKey,\n };\n}\n\nfunction getVisibleTreeItems(root: HTMLElement): HTMLElement[] {\n return Array.from(\n root.querySelectorAll<HTMLElement>('[role=\"treeitem\"]'),\n ).filter((el) => {\n let parent = el.parentElement;\n while (parent && parent !== root) {\n if (parent.getAttribute('role') === 'group' && parent.hidden) {\n return false;\n }\n parent = parent.parentElement;\n }\n return true;\n });\n}\n\nfunction getVisibleItemIds(root: HTMLElement): string[] {\n return getVisibleTreeItems(root).map((el) => el.id);\n}\n\nfunction areIdSetsEqual(\n first: ReadonlySet<string>,\n second: ReadonlySet<string>,\n): boolean {\n if (first.size !== second.size) {\n return false;\n }\n for (const id of first) {\n if (!second.has(id)) {\n return false;\n }\n }\n return true;\n}\n\nfunction areEdgeMapsEqual(\n first: ReadonlyMap<string, SelectionEdge>,\n second: ReadonlyMap<string, SelectionEdge>,\n): boolean {\n if (first.size !== second.size) {\n return false;\n }\n for (const [id, edge] of first) {\n if (second.get(id) !== edge) {\n return false;\n }\n }\n return true;\n}\n\nfunction annotateTreeItems(children: React.ReactNode): React.ReactNode {\n const items = Children.toArray(children);\n const treeItemCount = items.filter(\n (child): child is React.ReactElement =>\n isValidElement(child) && child.type === Item,\n ).length;\n\n let posInSet = 0;\n return Children.map(children, (child) => {\n if (isValidElement(child) && child.type === Item) {\n posInSet++;\n return cloneElement(\n child as React.ReactElement<React.HTMLAttributes<HTMLElement>>,\n {\n 'aria-posinset': posInSet,\n 'aria-setsize': treeItemCount,\n },\n );\n }\n return child;\n });\n}\n\ntype RootProps = {\n /** The aria-label for the tree. Required for accessibility, unless using ariaLabelledby. Pass null to omit. */\n ariaLabel: string | null;\n /** The aria-labelledby for the tree. Pass a string of space-separated IDs of elements that label the tree. */\n ariaLabelledby?: string;\n /** The children of the tree. Should be TreeView.Item components or TreeView.SkeletonItem components only. */\n children?: React.ReactNode;\n /** Initially selected item ids for an uncontrolled root-managed selection. */\n defaultSelectedIds?: string[];\n /** Selected item ids. Makes the tree manage selection itself, instead of each item managing its own. */\n selectedIds?: string[];\n /** Selection mode for the tree. Defaults to \"single\". */\n selectionMode?: SelectionMode;\n /** Callback called with the complete next selection whenever the tree manages selection. Fires once per interaction. */\n onSelectedIdsChange?: (selectedIds: string[]) => void;\n};\n\n/**\n * Root container for a tree view. Renders a `role=\"tree\"` element with full\n * keyboard navigation (arrow keys, Home/End, Enter/Space) following the\n * WAI-ARIA TreeView pattern.\n *\n * Direct children should be `TreeView.Item` or `TreeView.SkeletonItem`.\n *\n * @example\n * ```tsx\n * <TreeView ariaLabel=\"Files\">\n * <TreeView.Item title=\"README.md\" onSelectedChange={setSelected} isSelected={selected} />\n * </TreeView>\n * ```\n *\n * @alpha - this component is still in development and may change in the future. It might not have feature parity with the old tree view yet.\n */\nconst Root = ({\n children,\n defaultSelectedIds,\n selectedIds: selectedIdsProp,\n selectionMode = 'single',\n ariaLabel,\n ariaLabelledby,\n className,\n style,\n htmlAttributes,\n onSelectedIdsChange,\n ref,\n ...restProps\n}: CommonProps<'div', RootProps>) => {\n const treeRef = useRef<HTMLDivElement>(null);\n const mergedRef = useMergeRefs([treeRef, ref]);\n const [announcement, setAnnouncement] = useState('');\n // While focus is inside the tree the root drops out of the tab order so\n // that Shift+Tab moves focus out of the tree instead of landing on the\n // root, which would delegate focus straight back to the item (a trap).\n const [isFocusWithin, setIsFocusWithin] = useState(false);\n const anchorRef = useRef<SelectionAnchor>(null);\n const entriesRef = useRef(new Map<string, ItemEntry>());\n\n const isRootManaged =\n selectedIdsProp !== undefined || defaultSelectedIds !== undefined;\n\n const storeRef = useRef<TreeViewStore>(null);\n if (storeRef.current === null) {\n storeRef.current = createTreeViewStore({\n selectedIds: new Set(\n selectedIdsProp ?? defaultSelectedIds ?? EMPTY_ID_LIST,\n ),\n });\n }\n const store = storeRef.current;\n\n const setFocusedId = useCallback(\n (id: string | null) => {\n if (store.getState().focusedId !== id) {\n store.setState({ focusedId: id });\n }\n },\n [store],\n );\n\n const [selectedIdList, setSelectedIdList] = useSemicontrolledState<string[]>({\n isControlled: selectedIdsProp !== undefined,\n onChange: onSelectedIdsChange,\n state: selectedIdsProp ?? defaultSelectedIds ?? EMPTY_ID_LIST,\n });\n\n // useSemicontrolledState recreates its setter whenever the value changes;\n // reading it through a ref keeps onSelectionIntent (and with it the\n // memoized context value) stable across selection changes.\n const setSelectedIdListRef = useRef(setSelectedIdList);\n useLayoutEffect(() => {\n setSelectedIdListRef.current = setSelectedIdList;\n });\n\n const readSelectedIds = useCallback((): Set<string> => {\n if (isRootManaged) {\n return new Set(store.getState().selectedIds);\n }\n const selected = new Set<string>();\n entriesRef.current.forEach((entry, itemId) => {\n if (entry.isSelected) {\n selected.add(itemId);\n }\n });\n return selected;\n }, [isRootManaged, store]);\n\n const readItemMaps = useCallback(() => {\n const parentIdById = new Map<string, string>();\n const selectableIds = new Set<string>();\n entriesRef.current.forEach((entry, itemId) => {\n if (entry.parentId !== null) {\n parentIdById.set(itemId, entry.parentId);\n }\n if (entry.isSelectable && !entry.isDisabled) {\n selectableIds.add(itemId);\n }\n });\n return { parentIdById, selectableIds };\n }, []);\n\n const recomputeEdges = useCallback(() => {\n const root = treeRef.current;\n const previousEdges = store.getState().edgeById;\n if (!root || selectionMode !== 'multiple-replace') {\n if (previousEdges.size > 0) {\n store.setState({ edgeById: EMPTY_EDGES });\n }\n return;\n }\n const selectedIds = readSelectedIds();\n if (selectedIds.size === 0 && previousEdges.size === 0) {\n return;\n }\n const nextEdges = computeSelectionEdges(\n getVisibleItemIds(root),\n selectedIds,\n );\n if (!areEdgeMapsEqual(previousEdges, nextEdges)) {\n store.setState({ edgeById: nextEdges });\n }\n }, [readSelectedIds, selectionMode, store]);\n\n const recomputeEdgesRef = useRef(recomputeEdges);\n useLayoutEffect(() => {\n recomputeEdgesRef.current = recomputeEdges;\n });\n\n // Debounced through a microtask so a commit that touches many items (mount,\n // expansion, range selection) triggers a single recompute, after all item\n // layout effects have registered and before the browser paints.\n const isEdgeRecomputeScheduledRef = useRef(false);\n const scheduleEdgeRecompute = useCallback(() => {\n if (isEdgeRecomputeScheduledRef.current) {\n return;\n }\n isEdgeRecomputeScheduledRef.current = true;\n queueMicrotask(() => {\n isEdgeRecomputeScheduledRef.current = false;\n recomputeEdgesRef.current();\n });\n }, []);\n\n const registerItem = useCallback(\n (itemId: string, entry: ItemEntry | null) => {\n if (entry === null) {\n entriesRef.current.delete(itemId);\n } else {\n entriesRef.current.set(itemId, entry);\n }\n // Covers item mount/unmount and expansion toggles (a collapsing parent\n // re-registers because its toggleExpanded callback is recreated).\n scheduleEdgeRecompute();\n },\n [scheduleEdgeRecompute],\n );\n\n const onSelectionIntent = useCallback(\n (itemId: string, intent: SelectionIntent) => {\n const root = treeRef.current;\n const entry = entriesRef.current.get(itemId);\n if (!root || !entry || entry.isDisabled) {\n return;\n }\n if (!entry.isSelectable) {\n entry.toggleExpanded();\n return;\n }\n\n const { parentIdById, selectableIds } = readItemMaps();\n const selectedIds = readSelectedIds();\n const result = computeNextSelection({\n anchor: anchorRef.current,\n intent,\n parentIdById,\n selectableIds,\n selectedIds,\n selectionMode,\n targetId: itemId,\n visibleIds: getVisibleItemIds(root),\n });\n anchorRef.current = result.anchor;\n\n const nextSelectedIds = result.selectedIds;\n const changedCount = countChangedIds(selectedIds, nextSelectedIds);\n\n if (isRootManaged) {\n if (changedCount > 0) {\n setSelectedIdListRef.current([...nextSelectedIds]);\n }\n } else if (selectionMode === 'single') {\n // Single mode leaves clearing the previously selected item to the\n // consumer, so only the clicked item is told about the change.\n if (!selectedIds.has(itemId)) {\n entry.onSelectedChange?.(true);\n }\n } else {\n entriesRef.current.forEach((itemEntry, id) => {\n const isSelected = nextSelectedIds.has(id);\n if (itemEntry.isSelected !== isSelected) {\n itemEntry.onSelectedChange?.(isSelected);\n }\n });\n }\n\n scheduleEdgeRecompute();\n\n if (selectionMode !== 'single') {\n setAnnouncement(\n intent.isRange\n ? formatSelectionAnnouncement(nextSelectedIds.size)\n : '',\n );\n }\n },\n [\n isRootManaged,\n readItemMaps,\n readSelectedIds,\n scheduleEdgeRecompute,\n selectionMode,\n ],\n );\n\n // Mirrors the root-managed selection into the store, so items subscribe to\n // their own slice and event handlers read it without a state dependency.\n useLayoutEffect(() => {\n const next = isRootManaged ? new Set(selectedIdList) : EMPTY_IDS;\n if (areIdSetsEqual(store.getState().selectedIds, next)) {\n return;\n }\n store.setState({ selectedIds: next });\n scheduleEdgeRecompute();\n }, [isRootManaged, scheduleEdgeRecompute, selectedIdList, store]);\n\n // Computes edges on mount and whenever the edge inputs change identity\n // (selection mode, root-managed flag). Interaction-driven recomputes go\n // through scheduleEdgeRecompute instead.\n useLayoutEffect(() => {\n recomputeEdges();\n }, [recomputeEdges]);\n\n const handleKeyDown = useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n const root = treeRef.current;\n if (!root) {\n return;\n }\n\n const items = getVisibleTreeItems(root);\n if (items.length === 0) {\n return;\n }\n\n const currentIndex = items.findIndex(\n (el) => el.id === store.getState().focusedId,\n );\n let isHandled = true;\n\n const extendRangeTo = (item: HTMLElement) => {\n if (selectionMode === 'single' || currentIndex < 0) {\n return;\n }\n const entry = entriesRef.current.get(item.id);\n if (!entry?.isSelectable || entry.isDisabled) {\n return;\n }\n if (anchorRef.current === null) {\n // A keyboard range has no preceding click to repeat, so it grows the\n // selection outwards from wherever focus already is.\n anchorRef.current = {\n baseSelectedIds: readSelectedIds(),\n id: items[currentIndex].id,\n isSelected: true,\n };\n }\n onSelectionIntent(item.id, { isRange: true, isToggle: false });\n };\n\n switch (event.key) {\n case 'ArrowDown': {\n const nextIndex =\n currentIndex < items.length - 1 ? currentIndex + 1 : currentIndex;\n const nextItem = items[nextIndex];\n if (nextItem) {\n if (event.shiftKey) {\n extendRangeTo(nextItem);\n }\n setFocusedId(nextItem.id);\n nextItem.focus();\n }\n break;\n }\n case 'ArrowUp': {\n const prevIndex = currentIndex > 0 ? currentIndex - 1 : 0;\n const prevItem = items[prevIndex];\n if (prevItem) {\n if (event.shiftKey) {\n extendRangeTo(prevItem);\n }\n setFocusedId(prevItem.id);\n prevItem.focus();\n }\n break;\n }\n case 'ArrowRight': {\n const current = currentIndex >= 0 ? items[currentIndex] : null;\n if (!current) {\n break;\n }\n const isExpanded = current.getAttribute('aria-expanded');\n if (isExpanded === 'false') {\n current.dispatchEvent(new CustomEvent(TREE_EVENTS.expand));\n } else if (isExpanded === 'true') {\n const nextIndex = currentIndex + 1;\n if (nextIndex < items.length) {\n const nextItem = items[nextIndex];\n setFocusedId(nextItem.id);\n nextItem.focus();\n }\n }\n break;\n }\n case 'ArrowLeft': {\n const current = currentIndex >= 0 ? items[currentIndex] : null;\n if (!current) {\n break;\n }\n const isExpanded = current.getAttribute('aria-expanded');\n if (isExpanded === 'true') {\n current.dispatchEvent(new CustomEvent(TREE_EVENTS.collapse));\n } else {\n const parentGroup = current.closest('[role=\"group\"]');\n if (parentGroup?.id) {\n const parentItem = root.querySelector<HTMLElement>(\n `[aria-owns=\"${parentGroup.id}\"]`,\n );\n if (parentItem) {\n setFocusedId(parentItem.id);\n parentItem.focus();\n }\n }\n }\n break;\n }\n case 'Home': {\n const first = items[0];\n if (first) {\n setFocusedId(first.id);\n first.focus();\n }\n break;\n }\n case 'End': {\n const last = items[items.length - 1];\n if (last) {\n setFocusedId(last.id);\n last.focus();\n }\n break;\n }\n case 'Enter':\n case ' ': {\n const current = currentIndex >= 0 ? items[currentIndex] : null;\n if (current) {\n onSelectionIntent(current.id, getSelectionIntent(event));\n }\n break;\n }\n case 'F10': {\n if (event.shiftKey) {\n const current = currentIndex >= 0 ? items[currentIndex] : null;\n if (current) {\n current.dispatchEvent(new CustomEvent(TREE_EVENTS.action));\n }\n } else {\n isHandled = false;\n }\n break;\n }\n default:\n isHandled = false;\n }\n\n if (isHandled) {\n event.preventDefault();\n event.stopPropagation();\n }\n },\n [onSelectionIntent, readSelectedIds, selectionMode, setFocusedId, store],\n );\n\n const handleFocus = useCallback(\n (event: React.FocusEvent<HTMLDivElement>) => {\n const root = treeRef.current;\n if (!root) {\n return;\n }\n\n setIsFocusWithin(true);\n\n if (event.target === root) {\n const items = getVisibleTreeItems(root);\n const { focusedId } = store.getState();\n const alreadyFocused = focusedId\n ? items.find((el) => el.id === focusedId)\n : null;\n const target = alreadyFocused ?? items[0];\n if (target) {\n setFocusedId(target.id);\n target.focus();\n }\n }\n },\n [setFocusedId, store],\n );\n\n const handleBlur = useCallback((event: React.FocusEvent<HTMLDivElement>) => {\n const root = treeRef.current;\n if (!root) {\n return;\n }\n if (\n !(event.relatedTarget instanceof Node) ||\n !root.contains(event.relatedTarget)\n ) {\n setIsFocusWithin(false);\n }\n }, []);\n\n const classes = classNames(className, 'ndl-tree-view-new', {\n 'ndl-tree-view-new--checkbox': selectionMode === 'multiple',\n });\n\n // Cached on children identity so Root-internal state commits (announcement,\n // uncontrolled selection) reuse the same annotated elements and React bails\n // out of the whole item subtree instead of re-rendering every row.\n const annotatedChildren = useMemo(\n () => annotateTreeItems(children),\n [children],\n );\n\n // Everything in here is stable or primitive, so items only re-render via\n // context when the tree's configuration changes, not per interaction.\n const contextValue = useMemo(\n () => ({\n isRootManaged,\n level: 1,\n onSelectionIntent,\n parentId: null,\n registerItem,\n selectionMode,\n setFocusedId,\n store,\n }),\n [\n isRootManaged,\n onSelectionIntent,\n registerItem,\n selectionMode,\n setFocusedId,\n store,\n ],\n );\n\n return (\n <TreeViewContext.Provider value={contextValue}>\n <div\n ref={mergedRef}\n role=\"tree\"\n aria-multiselectable={\n selectionMode === 'multiple' || selectionMode === 'multiple-replace'\n ? true\n : undefined\n }\n tabIndex={isFocusWithin ? -1 : 0}\n className={classes}\n onKeyDown={handleKeyDown}\n onFocus={handleFocus}\n onBlur={handleBlur}\n aria-label={ariaLabel ?? undefined}\n aria-labelledby={ariaLabelledby}\n style={style}\n {...htmlAttributes}\n {...restProps}\n >\n {annotatedChildren}\n </div>\n <div\n role=\"status\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n className=\"ndl-tree-view-new-live-region\"\n >\n {announcement}\n </div>\n </TreeViewContext.Provider>\n );\n};\n\ntype ItemProps = {\n /** Nested TreeView.Item or TreeView.SkeletonItem elements rendered as sub-items in a collapsible group. */\n children?: React.ReactNode;\n /** The label content displayed in the item row. */\n title?: React.ReactNode;\n /** Default expansion for uncontrolled items */\n // TODO v5: fix boolean naming convention\n // eslint-disable-next-line @typescript-eslint/naming-convention\n defaultExpanded?: boolean;\n /** Whether the item has children. Decides if the item should render a chevron for expansion. Needed for lazy loading. */\n hasChildren?: boolean;\n /** Identifies the item. Required when the tree manages selection via `selectedIds`. */\n id?: string;\n /** Whether the item is disabled */\n isDisabled?: boolean;\n /** Whether the item is expanded. Makes the item controlled. */\n isExpanded?: boolean;\n /** Whether the item is in an indeterminate state. Only meaningful in multi-select mode for parent nodes. */\n isIndeterminate?: boolean;\n /** Whether the item is loading. Applies aria-busy=\"true\" to the item. */\n isLoading?: boolean;\n /** Whether the item can be selected. Defaults to true when the tree manages selection, and otherwise to whether `onSelectedChange` is set. */\n isSelectable?: boolean;\n /** Whether the item is selected. Ignored when the tree manages selection via `selectedIds`. */\n isSelected?: boolean;\n /** Leading visual for the item. */\n leadingVisual?: React.ReactNode;\n /** Trailing content for the item. Shown after the children but before the action menu. */\n trailingContent?: React.ReactNode;\n /** ReactNode containing Menu.Item elements to render in an action menu. When provided, an action button is rendered. */\n actionMenuItems?: React.ReactNode;\n /** Props forwarded to the Menu sub-components (anchorRef, onClose). */\n actionMenuProps?: React.ComponentProps<typeof Menu>;\n /** Content rendered inside the tooltip. When provided, the item is wrapped in a Tooltip. */\n tooltipContent?: React.ReactNode;\n /** Props forwarded to the Tooltip sub-components (root, trigger, content). */\n tooltipProps?: TooltipObjectProps;\n /** Callback called when the item is expanded/collapsed. */\n onExpandedChange?: (isExpanded: boolean) => void;\n /** Callback called when the item is selected/deselected. Receives the new selected state. Ignored when the tree manages selection via `selectedIds`. */\n onSelectedChange?: (isSelected: boolean) => void;\n};\n\n/**\n * A single item within a `TreeView`. Renders a `role=\"treeitem\"` element that\n * supports selection, expansion, leading/trailing visuals, and an action menu.\n *\n * The `title` prop provides the item's label content. Nesting `TreeView.Item`\n * elements as `children` creates a hierarchical tree structure.\n *\n * Supports both controlled (`isExpanded`) and uncontrolled (`defaultExpanded`)\n * expansion, as well as lazy loading via `hasChildren` + `isLoading`.\n *\n * @example\n * ```tsx\n * <TreeView.Item\n * title=\"src\"\n * leadingVisual={<FolderIcon />}\n * isSelected={selected}\n * onSelectedChange={setSelected}\n * >\n * <TreeView.Item title=\"index.ts\" />\n * </TreeView.Item>\n * ```\n */\nconst Item = ({\n actionMenuItems,\n children,\n defaultExpanded = false,\n hasChildren: hasChildrenProp,\n id: idProp,\n isDisabled,\n isExpanded: isExpandedProp,\n isIndeterminate,\n isLoading,\n isSelectable: isSelectableProp,\n isSelected: isSelectedProp,\n leadingVisual,\n title,\n tooltipContent,\n tooltipProps,\n trailingContent,\n onExpandedChange,\n onSelectedChange,\n actionMenuProps,\n className,\n style,\n htmlAttributes,\n ref,\n ...restProps\n}: CommonProps<'div', ItemProps>) => {\n const generatedId = useId();\n const itemId = idProp ?? htmlAttributes?.id ?? `ndl-treeitem-${generatedId}`;\n const titleId = `ndl-treeitem-title-${generatedId}`;\n const groupId = `ndl-treegroup-${generatedId}`;\n const itemRef = useRef<HTMLDivElement>(null);\n const actionButtonRef = useRef<HTMLButtonElement>(null);\n const didOpenViaKeyboard = useRef(false);\n const [isMenuOpen, setIsMenuOpen] = useState(false);\n const treeViewContext = useContext(TreeViewContext);\n const {\n isRootManaged,\n level,\n onSelectionIntent,\n parentId,\n registerItem,\n selectionMode,\n setFocusedId,\n store,\n } = treeViewContext;\n\n // Primitive slices of the store, so Object.is bails out of re-renders for\n // rows whose focus/selection/edge state did not change.\n const isFocused = useSyncExternalStore(\n store.subscribe,\n () => store.getState().focusedId === itemId,\n () => store.getState().focusedId === itemId,\n );\n const isRootSelected = useSyncExternalStore(\n store.subscribe,\n () => store.getState().selectedIds.has(itemId),\n () => store.getState().selectedIds.has(itemId),\n );\n const edge = useSyncExternalStore(\n store.subscribe,\n () => store.getState().edgeById.get(itemId),\n () => store.getState().edgeById.get(itemId),\n );\n\n const isControlledExpansion = isExpandedProp !== undefined;\n const [isExpanded, setIsExpanded] = useSemicontrolledState({\n isControlled: isControlledExpansion,\n onChange: onExpandedChange,\n state: isExpandedProp ?? defaultExpanded,\n });\n\n const hasChildren = hasChildrenProp ?? Children.count(children) > 0;\n const isSelectable = isRootManaged\n ? (isSelectableProp ?? true)\n : (isSelectableProp ?? onSelectedChange !== undefined);\n const isSelected = isRootManaged ? isRootSelected : (isSelectedProp ?? false);\n const isMultiple = selectionMode === 'multiple';\n\n const toggleExpanded = useCallback(() => {\n if (isDisabled) {\n return;\n }\n if (hasChildren) {\n setIsExpanded(!isExpanded);\n }\n }, [isDisabled, hasChildren, setIsExpanded, isExpanded]);\n\n useLayoutEffect(() => {\n registerItem(itemId, {\n isDisabled: isDisabled ?? false,\n isSelectable,\n isSelected,\n onSelectedChange,\n parentId,\n toggleExpanded,\n });\n }, [\n isDisabled,\n isSelectable,\n isSelected,\n itemId,\n onSelectedChange,\n parentId,\n registerItem,\n toggleExpanded,\n ]);\n\n useLayoutEffect(() => {\n return () => registerItem(itemId, null);\n }, [itemId, registerItem]);\n\n useEffect(() => {\n if (!isRootManaged) {\n return;\n }\n if (idProp === undefined) {\n needleWarningMessage(\n 'TreeView.Item needs an `id` when the tree manages selection with `selectedIds`.',\n );\n }\n if (isSelectedProp !== undefined || onSelectedChange !== undefined) {\n needleWarningMessage(\n 'TreeView.Item `isSelected` and `onSelectedChange` are ignored when the tree manages selection with `selectedIds`.',\n );\n }\n }, [idProp, isRootManaged, isSelectedProp, onSelectedChange]);\n\n const handleClick = useCallback(\n (event: React.MouseEvent) => {\n if (isDisabled) {\n return;\n }\n setFocusedId(itemId);\n onSelectionIntent(itemId, getSelectionIntent(event));\n },\n [isDisabled, setFocusedId, itemId, onSelectionIntent],\n );\n\n const handleChevronClick = useCallback(\n (event: React.MouseEvent) => {\n event.stopPropagation();\n if (isDisabled) {\n return;\n }\n setFocusedId(itemId);\n toggleExpanded();\n },\n [isDisabled, setFocusedId, itemId, toggleExpanded],\n );\n\n const handleMenuClose = useCallback(() => {\n setIsMenuOpen(false);\n if (didOpenViaKeyboard.current) {\n itemRef.current?.focus();\n didOpenViaKeyboard.current = false;\n }\n }, []);\n\n const handleCustomEvents = useCallback(\n (event: Event) => {\n if (event.type === TREE_EVENTS.expand) {\n event.stopPropagation();\n if (hasChildren && !isExpanded && !isDisabled) {\n setIsExpanded(true);\n }\n } else if (event.type === TREE_EVENTS.collapse) {\n event.stopPropagation();\n if (hasChildren && isExpanded && !isDisabled) {\n setIsExpanded(false);\n }\n } else if (event.type === TREE_EVENTS.action) {\n event.stopPropagation();\n if (actionMenuItems && !isDisabled) {\n didOpenViaKeyboard.current = true;\n setIsMenuOpen(true);\n }\n }\n },\n [actionMenuItems, hasChildren, isExpanded, isDisabled, setIsExpanded],\n );\n\n const callbackRef = useCallback(\n (node: HTMLDivElement | null) => {\n const prev = itemRef.current;\n if (prev) {\n prev.removeEventListener(TREE_EVENTS.expand, handleCustomEvents);\n prev.removeEventListener(TREE_EVENTS.collapse, handleCustomEvents);\n prev.removeEventListener(TREE_EVENTS.action, handleCustomEvents);\n }\n (itemRef as React.MutableRefObject<HTMLDivElement | null>).current = node;\n if (node) {\n node.addEventListener(TREE_EVENTS.expand, handleCustomEvents);\n node.addEventListener(TREE_EVENTS.collapse, handleCustomEvents);\n node.addEventListener(TREE_EVENTS.action, handleCustomEvents);\n }\n },\n [handleCustomEvents],\n );\n\n const mergedRef = useMergeRefs([callbackRef, ref]);\n\n const selectionAriaProps = (() => {\n if (!isSelectable) {\n return {};\n }\n if (isMultiple) {\n return {\n 'aria-checked': isIndeterminate ? ('mixed' as const) : isSelected,\n };\n }\n return { 'aria-selected': isSelected };\n })();\n\n const edgeClass =\n edge === undefined ? undefined : `ndl-tree-view-new-item--selected-${edge}`;\n\n const childContextValue = useMemo(\n () => ({\n ...treeViewContext,\n level: treeViewContext.level + 1,\n parentId: itemId,\n }),\n [itemId, treeViewContext],\n );\n\n // Same caching as in Root: keeps child element identity stable across\n // renders of this item (selection, focus, expansion) so unchanged\n // descendants bail out of re-rendering.\n const annotatedChildren = useMemo(\n () => annotateTreeItems(children),\n [children],\n );\n\n const itemElement = (\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events -- keyboard handled on tree root; aria-selected/aria-checked applied via spread\n <div\n ref={mergedRef}\n // eslint-disable-next-line jsx-a11y/role-has-required-aria-props -- aria-selected/aria-checked applied conditionally via spread\n role=\"treeitem\"\n {...selectionAriaProps}\n aria-expanded={hasChildren ? isExpanded : undefined}\n aria-owns={hasChildren ? groupId : undefined}\n aria-disabled={isDisabled || undefined}\n aria-busy={isLoading || undefined}\n aria-keyshortcuts={actionMenuItems ? 'Shift+F10' : undefined}\n aria-labelledby={titleId}\n aria-level={level}\n tabIndex={isFocused ? 0 : -1}\n className={classNames('ndl-tree-view-new-item', className, edgeClass, {\n 'ndl-tree-view-new-item--disabled': isDisabled,\n 'ndl-tree-view-new-item--parent': hasChildren,\n 'ndl-tree-view-new-item--selected': isSelected && isSelectable,\n })}\n style={{ '--tree-level': level - 1, ...style } as React.CSSProperties}\n onClick={(event) => {\n event.stopPropagation();\n handleClick(event);\n }}\n {...htmlAttributes}\n {...restProps}\n id={itemId}\n >\n <div\n className={classNames('ndl-tree-view-new-item-content', {\n 'ndl-tree-view-new-item-content--parent': hasChildren,\n })}\n >\n {hasChildren && (\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions -- keyboard handled on tree root\n <span\n className=\"ndl-tree-view-new-chevron\"\n aria-disabled={isDisabled}\n onClick={handleChevronClick}\n >\n <ChevronRightIconOutline\n className={classNames('ndl-tree-view-new-chevron-icon', {\n 'ndl-tree-view-new-chevron-icon--open': isExpanded,\n })}\n />\n </span>\n )}\n {leadingVisual && (\n <div className=\"ndl-tree-view-new-item-content-leading-visual\">\n {leadingVisual}\n </div>\n )}\n {isMultiple && isSelectable && (\n <div className=\"ndl-tree-view-new-checkbox\" inert>\n <Checkbox\n style={{ borderWidth: '1.5px' }}\n ariaLabel=\"Select\"\n isChecked={isSelected}\n isIndeterminate={isIndeterminate}\n isDisabled={isDisabled}\n onChange={noop}\n />\n </div>\n )}\n <div id={titleId} className=\"ndl-tree-view-new-item-content-title\">\n {title}\n </div>\n {trailingContent && (\n <div className=\"ndl-tree-view-new-item-content-trailing-content\">\n {trailingContent}\n </div>\n )}\n {actionMenuItems && (\n <div\n className={classNames('ndl-tree-view-new-action', {\n 'ndl-tree-view-new-action--visible': isMenuOpen,\n })}\n >\n <CleanIconButton\n ref={actionButtonRef}\n size=\"small\"\n description={null}\n isDisabled={isDisabled}\n style={{ height: '24px', width: '24px' }}\n htmlAttributes={{\n 'aria-expanded': isMenuOpen || undefined,\n 'aria-haspopup': 'menu',\n 'aria-label': 'Actions',\n onClick: (event: React.MouseEvent) => {\n event.stopPropagation();\n didOpenViaKeyboard.current = false;\n setIsMenuOpen((prev) => !prev);\n },\n tabIndex: -1,\n }}\n >\n <EllipsisHorizontalIconOutline />\n </CleanIconButton>\n <Menu\n isOpen={isMenuOpen}\n anchorRef={actionButtonRef}\n onClose={handleMenuClose}\n {...actionMenuProps}\n >\n {actionMenuItems}\n </Menu>\n </div>\n )}\n </div>\n </div>\n );\n\n return (\n <>\n <ConditionalWrap\n shouldWrap={tooltipContent !== undefined && tooltipContent !== null}\n wrap={(children) => (\n <Tooltip\n type=\"simple\"\n hoverDelay={{ close: 0, open: 500 }}\n isDisabled={isMenuOpen}\n followCursor=\"initial\"\n {...tooltipProps?.root}\n >\n <Tooltip.Trigger hasButtonWrapper {...tooltipProps?.trigger}>\n {children}\n </Tooltip.Trigger>\n <Tooltip.Content {...tooltipProps?.content}>\n {tooltipContent}\n </Tooltip.Content>\n </Tooltip>\n )}\n >\n {itemElement}\n </ConditionalWrap>\n {hasChildren && (\n <TreeViewContext.Provider value={childContextValue}>\n <div\n role=\"group\"\n id={groupId}\n hidden={!isExpanded}\n style={{ '--tree-level': level - 1 } as React.CSSProperties}\n >\n {annotatedChildren}\n </div>\n </TreeViewContext.Provider>\n )}\n </>\n );\n};\n\ntype SkeletonItemProps = {\n /** The number of rows to render. */\n rows?: number;\n};\n\n/**\n * A skeleton placeholder for tree items that are being loaded. Renders one or\n * more `Skeleton` rows at the current nesting depth. The element is\n * `aria-hidden` since it is purely a visual indicator and not interactive.\n *\n * Typically used inside a `TreeView.Item` that has `isLoading` set, to give\n * the user a visual hint that child items are being fetched.\n *\n * @example\n * ```tsx\n * <TreeView.Item title=\"Lazy folder\" hasChildren isLoading isExpanded>\n * {isLoading && <TreeView.SkeletonItem rows={3} />}\n * </TreeView.Item>\n * ```\n */\nconst SkeletonItem = ({\n rows = 1,\n className,\n style,\n htmlAttributes,\n ref,\n ...restProps\n}: CommonProps<'div', SkeletonItemProps>) => {\n const { level } = useContext(TreeViewContext);\n return (\n <div\n ref={ref}\n aria-hidden=\"true\"\n className={classNames('ndl-tree-view-new-skeleton', className)}\n style={{ '--tree-level': level - 1, ...style } as React.CSSProperties}\n {...htmlAttributes}\n {...restProps}\n >\n {Array.from({ length: rows }, (_unused, index) => (\n <Skeleton key={index} height=\"18px\" width=\"100%\" />\n ))}\n </div>\n );\n};\n\n/**\n * @remarks\n * Selection can be managed per item, with `isSelected` and `onSelectedChange`\n * on each `TreeView.Item`, or by the tree itself, by passing `selectedIds` (or\n * `defaultSelectedIds`) together with `onSelectedIdsChange`. When the tree\n * manages selection, every item needs an `id`, and each item's own\n * `isSelected` and `onSelectedChange` are ignored.\n *\n * The available selection modes are:\n *\n * - `single` — one item at a time. An unmodified click selects the clicked item and never clears it.\n * - `multiple` — multi-select with checkboxes. An unmodified click toggles an item, and `Shift` repeats that across a range without clearing anything outside it.\n * - `multiple-replace` — multi-select without checkboxes. An unmodified click selects only that item, `Cmd`/`Ctrl` toggles it and moves the anchor, and `Shift` extends from that anchor while retaining its selection snapshot. `Shift` + arrow extends the range.\n */\nconst TreeView = Object.assign(Root, { Item, SkeletonItem });\nexport { TreeView };\n"]}
@@ -31,9 +31,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
31
31
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
32
32
  */
33
33
  import classNames from 'classnames';
34
- import { useEffect, useMemo } from 'react';
34
+ import { useInlineFieldLabel } from '../_common/form-control';
35
35
  import { useSemiControlledInput } from '../_common/use-semi-controlled-input';
36
- import { needleWarningMessage } from '../_common/utils';
37
36
  export const Radio = (_a) => {
38
37
  var _b;
39
38
  var { ariaLabel, isDisabled = false, isDefaultChecked, label, isFluid = false, isChecked, hasLeadingLabel, onChange, className, style, onClick, value, htmlAttributes, ref } = _a, restProps = __rest(_a, ["ariaLabel", "isDisabled", "isDefaultChecked", "label", "isFluid", "isChecked", "hasLeadingLabel", "onChange", "className", "style", "onClick", "value", "htmlAttributes", "ref"]);
@@ -43,28 +42,19 @@ export const Radio = (_a) => {
43
42
  onChange,
44
43
  state: (_b = isChecked !== null && isChecked !== void 0 ? isChecked : isDefaultChecked) !== null && _b !== void 0 ? _b : false,
45
44
  });
46
- const labelWrappingClasses = classNames('ndl-radio-label', {
47
- 'ndl-disabled': isDisabled,
48
- 'ndl-fluid': isFluid,
49
- });
50
45
  const radioClasses = classNames('ndl-radio', className, {
51
46
  'ndl-disabled': isDisabled,
52
47
  });
53
- /** TODO: Label handling. We can get rid of this annoying stuff as soon as we do proper form control. */
54
- const labelContent = useMemo(() => {
55
- if (Boolean(label) === false) {
56
- return null;
57
- }
58
- if (typeof label === 'string') {
59
- return (_jsx("span", { title: label, className: "ndl-radio-label-text", children: label }));
60
- }
61
- return label;
62
- }, [label]);
63
- useEffect(() => {
64
- if (Boolean(label) === false && Boolean(ariaLabel) === false) {
65
- needleWarningMessage('Radio needs a valid label or ariaLabel: https://dequeuniversity.com/rules/axe/4.2/label?application=axeAPI');
66
- }
67
- }, [ariaLabel, label]);
68
- return (_jsxs("label", { className: labelWrappingClasses, children: [hasLeadingLabel === true && labelContent, _jsx("input", Object.assign({ ref: ref, type: "radio", "aria-label": ariaLabel, disabled: isDisabled, checked: isCheckedState, onClick: onClick, onChange: internalOnChange, value: value, style: style, className: radioClasses }, restProps, htmlAttributes)), Boolean(hasLeadingLabel) === false && labelContent] }));
48
+ const { labelContent, fieldClassName } = useInlineFieldLabel({
49
+ ariaLabel,
50
+ componentName: 'Radio',
51
+ isDisabled,
52
+ isFluid,
53
+ // TODO v5: decide whether all selection controls should truncate; today
54
+ // only Radio does.
55
+ isTruncated: true,
56
+ label,
57
+ });
58
+ return (_jsxs("label", { className: fieldClassName, children: [hasLeadingLabel === true && labelContent, _jsx("input", Object.assign({ ref: ref, type: "radio", "aria-label": ariaLabel, disabled: isDisabled, checked: isCheckedState, onClick: onClick, onChange: internalOnChange, value: value, style: style, className: radioClasses }, restProps, htmlAttributes)), Boolean(hasLeadingLabel) === false && labelContent] }));
69
59
  };
70
60
  //# sourceMappingURL=Radio.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Radio.js","sourceRoot":"","sources":["../../../src/radio/Radio.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO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ACjD,KAAK,GACD,CACR,CAAC;QACJ,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,OAAO,CAAC,KAAK,CAAC,KAAK,KAAK,IAAI,OAAO,CAAC,SAAS,CAAC,KAAK,KAAK,EAAE,CAAC;YAC7D,oBAAoB,CAClB,4GAA4G,CAC7G,CAAC;QACJ,CAAC;IACH,CAAC,EAAE,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC;IAEvB,OAAO,CACL,iBAAO,SAAS,EAAE,oBAAoB,aACnC,eAAe,KAAK,IAAI,IAAI,YAAY,EACzC,8BACE,GAAG,EAAE,GAAG,EACR,IAAI,EAAC,OAAO,gBACA,SAAS,EACrB,QAAQ,EAAE,UAAU,EACpB,OAAO,EAAE,cAAc,EACvB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,gBAAgB,EAC1B,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,YAAY,IACnB,SAAS,EACT,cAAc,EAClB,EACD,OAAO,CAAC,eAAe,CAAC,KAAK,KAAK,IAAI,YAAY,IAC7C,CACT,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport classNames from 'classnames';\nimport { useEffect, useMemo } from 'react';\n\nimport { type CommonProps, type HtmlAttributes } from '../_common/types';\nimport { useSemiControlledInput } from '../_common/use-semi-controlled-input';\nimport { needleWarningMessage } from '../_common/utils';\n\ntype RadioProps = {\n /** Whether the radio is checked */\n isChecked?: boolean;\n /** Selects the radio by default in uncontrolled mode */\n isDefaultChecked?: boolean;\n /** Whether the radio is disabled */\n isDisabled?: boolean;\n /** Whether the radio & label should take the full available width of its container */\n isFluid?: boolean;\n /** Whether the label should be displayed before the radio */\n hasLeadingLabel?: boolean;\n /** The callback function triggered when the radio value changes */\n onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;\n /** The value of the radio */\n value?: HtmlAttributes<'input'>['value'];\n /** The callback function triggered when the radio is clicked */\n onClick?: (event: React.MouseEvent<HTMLInputElement>) => void;\n} & (\n | {\n /** The aria label of the radio. Required if the label is not a string. */\n ariaLabel: string;\n /** The label of the radio. If not a string, supply an aria label for screen reader support. */\n label?: undefined;\n }\n | {\n ariaLabel?: string;\n label: React.ReactNode;\n }\n);\n\nexport const Radio = ({\n ariaLabel,\n isDisabled = false,\n isDefaultChecked,\n label,\n isFluid = false,\n isChecked,\n hasLeadingLabel,\n onChange,\n className,\n style,\n onClick,\n value,\n htmlAttributes,\n ref,\n ...restProps\n}: CommonProps<'input', RadioProps>) => {\n const [isCheckedState, internalOnChange] = useSemiControlledInput({\n inputType: 'radio',\n isControlled: isChecked !== undefined,\n onChange,\n state: isChecked ?? isDefaultChecked ?? false,\n });\n\n const labelWrappingClasses = classNames('ndl-radio-label', {\n 'ndl-disabled': isDisabled,\n 'ndl-fluid': isFluid,\n });\n\n const radioClasses = classNames('ndl-radio', className, {\n 'ndl-disabled': isDisabled,\n });\n\n /** TODO: Label handling. We can get rid of this annoying stuff as soon as we do proper form control. */\n const labelContent = useMemo(() => {\n if (Boolean(label) === false) {\n return null;\n }\n\n if (typeof label === 'string') {\n return (\n <span title={label} className=\"ndl-radio-label-text\">\n {label}\n </span>\n );\n }\n return label;\n }, [label]);\n\n useEffect(() => {\n if (Boolean(label) === false && Boolean(ariaLabel) === false) {\n needleWarningMessage(\n 'Radio needs a valid label or ariaLabel: https://dequeuniversity.com/rules/axe/4.2/label?application=axeAPI',\n );\n }\n }, [ariaLabel, label]);\n\n return (\n <label className={labelWrappingClasses}>\n {hasLeadingLabel === true && labelContent}\n <input\n ref={ref}\n type=\"radio\"\n aria-label={ariaLabel}\n disabled={isDisabled}\n checked={isCheckedState}\n onClick={onClick}\n onChange={internalOnChange}\n value={value}\n style={style}\n className={radioClasses}\n {...restProps}\n {...htmlAttributes}\n />\n {Boolean(hasLeadingLabel) === false && labelContent}\n </label>\n );\n};\n"]}
1
+ {"version":3,"file":"Radio.js","sourceRoot":"","sources":["../../../src/radio/Radio.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAqC9E,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,EAgBa,EAAE,EAAE;;QAhBjB,EACpB,SAAS,EACT,UAAU,GAAG,KAAK,EAClB,gBAAgB,EAChB,KAAK,EACL,OAAO,GAAG,KAAK,EACf,SAAS,EACT,eAAe,EACf,QAAQ,EACR,SAAS,EACT,KAAK,EACL,OAAO,EACP,KAAK,EACL,cAAc,EACd,GAAG,OAE8B,EAD9B,SAAS,cAfQ,kLAgBrB,CADa;IAEZ,MAAM,CAAC,cAAc,EAAE,gBAAgB,CAAC,GAAG,sBAAsB,CAAC;QAChE,SAAS,EAAE,OAAO;QAClB,YAAY,EAAE,SAAS,KAAK,SAAS;QACrC,QAAQ;QACR,KAAK,EAAE,MAAA,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,gBAAgB,mCAAI,KAAK;KAC9C,CAAC,CAAC;IAEH,MAAM,YAAY,GAAG,UAAU,CAAC,WAAW,EAAE,SAAS,EAAE;QACtD,cAAc,EAAE,UAAU;KAC3B,CAAC,CAAC;IAEH,MAAM,EAAE,YAAY,EAAE,cAAc,EAAE,GAAG,mBAAmB,CAAC;QAC3D,SAAS;QACT,aAAa,EAAE,OAAO;QACtB,UAAU;QACV,OAAO;QACP,wEAAwE;QACxE,mBAAmB;QACnB,WAAW,EAAE,IAAI;QACjB,KAAK;KACN,CAAC,CAAC;IAEH,OAAO,CACL,iBAAO,SAAS,EAAE,cAAc,aAC7B,eAAe,KAAK,IAAI,IAAI,YAAY,EACzC,8BACE,GAAG,EAAE,GAAG,EACR,IAAI,EAAC,OAAO,gBACA,SAAS,EACrB,QAAQ,EAAE,UAAU,EACpB,OAAO,EAAE,cAAc,EACvB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,gBAAgB,EAC1B,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,YAAY,IACnB,SAAS,EACT,cAAc,EAClB,EACD,OAAO,CAAC,eAAe,CAAC,KAAK,KAAK,IAAI,YAAY,IAC7C,CACT,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport classNames from 'classnames';\n\nimport { useInlineFieldLabel } from '../_common/form-control';\nimport { type CommonProps, type HtmlAttributes } from '../_common/types';\nimport { useSemiControlledInput } from '../_common/use-semi-controlled-input';\n\ntype RadioProps = {\n /** Whether the radio is checked */\n isChecked?: boolean;\n /** Selects the radio by default in uncontrolled mode */\n isDefaultChecked?: boolean;\n /** Whether the radio is disabled */\n isDisabled?: boolean;\n /** Whether the radio & label should take the full available width of its container */\n isFluid?: boolean;\n /** Whether the label should be displayed before the radio */\n hasLeadingLabel?: boolean;\n /** The callback function triggered when the radio value changes */\n onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;\n /** The value of the radio */\n value?: HtmlAttributes<'input'>['value'];\n /** The callback function triggered when the radio is clicked */\n onClick?: (event: React.MouseEvent<HTMLInputElement>) => void;\n} & (\n | {\n /** The aria label of the radio. Required if the label is not a string. */\n ariaLabel: string;\n // TODO v5: inconsistent naming. Naming the radio takes a union of `label`\n // and `ariaLabel`, so the accessible name comes from a different prop\n // depending on what the label renders. Combobox instead requires the\n // label and clips it with `hasVisuallyHiddenLabel`, and TextInput reaches\n // for htmlAttributes['aria-label'].\n /** The label of the radio. If not a string, supply an aria label for screen reader support. */\n label?: undefined;\n }\n | {\n ariaLabel?: string;\n label: React.ReactNode;\n }\n);\n\nexport const Radio = ({\n ariaLabel,\n isDisabled = false,\n isDefaultChecked,\n label,\n isFluid = false,\n isChecked,\n hasLeadingLabel,\n onChange,\n className,\n style,\n onClick,\n value,\n htmlAttributes,\n ref,\n ...restProps\n}: CommonProps<'input', RadioProps>) => {\n const [isCheckedState, internalOnChange] = useSemiControlledInput({\n inputType: 'radio',\n isControlled: isChecked !== undefined,\n onChange,\n state: isChecked ?? isDefaultChecked ?? false,\n });\n\n const radioClasses = classNames('ndl-radio', className, {\n 'ndl-disabled': isDisabled,\n });\n\n const { labelContent, fieldClassName } = useInlineFieldLabel({\n ariaLabel,\n componentName: 'Radio',\n isDisabled,\n isFluid,\n // TODO v5: decide whether all selection controls should truncate; today\n // only Radio does.\n isTruncated: true,\n label,\n });\n\n return (\n <label className={fieldClassName}>\n {hasLeadingLabel === true && labelContent}\n <input\n ref={ref}\n type=\"radio\"\n aria-label={ariaLabel}\n disabled={isDisabled}\n checked={isCheckedState}\n onClick={onClick}\n onChange={internalOnChange}\n value={value}\n style={style}\n className={radioClasses}\n {...restProps}\n {...htmlAttributes}\n />\n {Boolean(hasLeadingLabel) === false && labelContent}\n </label>\n );\n};\n"]}
@@ -37,10 +37,9 @@ import ReactSelect from 'react-select';
37
37
  import AsyncSelect from 'react-select/async';
38
38
  /** Different types of select components */
39
39
  import Creatable from 'react-select/creatable';
40
+ import { FormFieldLabel, FormFieldMessage, useFormField, } from '../_common/form-control';
40
41
  import { needleWarningMessage } from '../_common/utils';
41
42
  import { useIsInsideDialog } from '../dialog/dialog-context';
42
- import { ExclamationCircleIconSolid } from '../icons/generated/heroIcons/ExclamationCircleIconSolid';
43
- import { Typography } from '../typography';
44
43
  import { CustomClearIndication, CustomControl, CustomIndicatorsContainer, CustomInput, CustomMenu, CustomMenuList, CustomMenuPortal, CustomMultiValue, CustomOption, CustomPlaceholder, CustomSingleValue, CustomValueContainer, DropdownIndicatorCurrying, } from './Overrides';
45
44
  /**
46
45
  *
@@ -96,8 +95,18 @@ export const Select = (_a) => {
96
95
  const isInsideDialog = useIsInsideDialog();
97
96
  const menuPosition = isInsideDialog ? 'fixed' : 'absolute';
98
97
  const identifier = useId();
99
- const helpTextId = useId();
100
- const errorTextId = useId();
98
+ // The shared form field resolves the ids and which message is displayed -
99
+ // an error always replaces the help text. Select has no required support;
100
+ // it is deprecated in favor of Combobox, which has isRequired and
101
+ // hasRequiredIndicator.
102
+ const { field } = useFormField({
103
+ controlId: identifier,
104
+ errorText,
105
+ helpText,
106
+ label,
107
+ });
108
+ const helpTextId = field.helpTextId;
109
+ const errorTextId = field.errorTextId;
101
110
  const [isMenuOpen, setIsMenuOpen] = useState(false);
102
111
  const handleMenuOpen = () => {
103
112
  setIsMenuOpen(true);
@@ -158,6 +167,6 @@ export const Select = (_a) => {
158
167
  'ndl-multi': selectProps.isMulti,
159
168
  'ndl-small': size === 'small',
160
169
  });
161
- return (_jsxs(Component, Object.assign({ ref: ref, className: classes, style: style }, restProps, htmlAttributes, { children: [Boolean(label) && _jsx("label", { htmlFor: identifier, children: label }), SelectElement, Boolean(helpText) && Boolean(errorText) === false && (_jsx(Typography, { variant: size === 'large' ? 'body-medium' : 'body-small', className: "ndl-sub-text", htmlAttributes: { id: helpTextId }, children: helpText })), Boolean(errorText) && (_jsxs("div", { className: "n-flex n-flex-row n-gap-token-4 n-items-center", children: [_jsx(ExclamationCircleIconSolid, { className: "ndl-error-icon", htmlAttributes: { role: 'img', type: 'solid' } }), _jsx("span", { id: errorTextId, className: "ndl-sub-text ndl-error-text", children: errorText })] }))] })));
170
+ return (_jsxs(Component, Object.assign({ ref: ref, className: classes, style: style }, restProps, htmlAttributes, { children: [Boolean(label) && _jsx(FormFieldLabel, { field: field, size: size }), SelectElement, _jsx(FormFieldMessage, { field: field, size: size })] })));
162
171
  };
163
172
  //# sourceMappingURL=Select.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Select.js","sourceRoot":"","sources":["../../../src/select/Select.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5D,OAAO,WAA+B,MAAM,cAAc,CAAC;AAC3D,OAAO,WAAW,MAAM,oBAAoB,CAAC;AAC7C,2CAA2C;AAC3C,OAAO,SAAS,MAAM,wBAAwB,CAAC;AAG/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,0BAA0B,EAAE,MAAM,yDAAyD,CAAC;AACrG,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EACL,qBAAqB,EACrB,aAAa,EACb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;KAC9B,CAAC,CAAC;IAEH,OAAO,CACL,MAAC,SAAS,kBACR,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,OAAO,EAClB,KAAK,EAAE,KAAK,IACR,SAAS,EACT,cAAc,eAEjB,OAAO,CAAC,KAAK,CAAC,IAAI,gBAAO,OAAO,EAAE,UAAU,YAAG,KAAK,GAAS,EAC7D,aAAa,EACb,OAAO,CAAC,QAAQ,CAAC,IAAI,OAAO,CAAC,SAAS,CAAC,KAAK,KAAK,IAAI,CACpD,KAAC,UAAU,IACT,OAAO,EAAE,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,YAAY,EACxD,SAAS,EAAC,cAAc,EACxB,cAAc,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE,YAEjC,QAAQ,GACE,CACd,EACA,OAAO,CAAC,SAAS,CAAC,IAAI,CACrB,eAAK,SAAS,EAAC,gDAAgD,aAC7D,KAAC,0BAA0B,IACzB,SAAS,EAAC,gBAAgB,EAC1B,cAAc,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,GAC9C,EACF,eAAM,EAAE,EAAE,WAAW,EAAE,SAAS,EAAC,6BAA6B,YAC3D,SAAS,GACL,IACH,CACP,KACS,CACb,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport { tokens } from '@neo4j-ndl/base';\nimport classNames from 'classnames';\nimport type React from 'react';\nimport { useEffect, useId, useMemo, useState } from 'react';\nimport ReactSelect, { type GroupBase } from 'react-select';\nimport AsyncSelect from 'react-select/async';\n/** Different types of select components */\nimport Creatable from 'react-select/creatable';\n\nimport { type PolymorphicCommonProps } from '../_common/types';\nimport { needleWarningMessage } from '../_common/utils';\nimport { useIsInsideDialog } from '../dialog/dialog-context';\nimport { ExclamationCircleIconSolid } from '../icons/generated/heroIcons/ExclamationCircleIconSolid';\nimport { Typography } from '../typography';\nimport {\n CustomClearIndication,\n CustomControl,\n CustomIndicatorsContainer,\n CustomInput,\n CustomMenu,\n CustomMenuList,\n CustomMenuPortal,\n CustomMultiValue,\n CustomOption,\n CustomPlaceholder,\n CustomSingleValue,\n CustomValueContainer,\n DropdownIndicatorCurrying,\n} from './Overrides';\nimport { type SelectOverrideCustomProps, type SelectProps } from './types';\n\n/**\n *\n *\n * Helpers\n *\n *\n */\n\nconst overrideComponents = <\n OptionType,\n IsMulti extends boolean = false,\n GroupType extends GroupBase<OptionType> = GroupBase<OptionType>,\n>(\n props: SelectOverrideCustomProps<OptionType, IsMulti, GroupType>,\n) =>\n ({\n ClearIndicator: CustomClearIndication(props),\n Control: CustomControl(props),\n DropdownIndicator: DropdownIndicatorCurrying(props),\n IndicatorSeparator: null,\n IndicatorsContainer: CustomIndicatorsContainer(props),\n Input: CustomInput(props),\n Menu: CustomMenu(props),\n MenuList: CustomMenuList(props),\n MenuPortal: CustomMenuPortal(props),\n MultiValue: CustomMultiValue(props),\n Option: CustomOption(props),\n Placeholder: CustomPlaceholder(props),\n SingleValue: CustomSingleValue(props),\n ValueContainer: CustomValueContainer(props),\n }) as SelectProps<\n OptionType,\n IsMulti,\n GroupType\n >['selectProps']['components'];\n\nconst customStyles = <\n OptionType,\n IsMulti extends boolean = false,\n GroupType extends GroupBase<OptionType> = GroupBase<OptionType>,\n>() => {\n return {\n clearIndicator: () => ({}),\n control: () => ({}),\n dropdownIndicator: () => ({}),\n indicatorsContainer: () => ({}),\n input: () => ({}),\n menu: (provided) => ({\n bottom: provided.bottom,\n top: provided.top,\n }),\n menuList: (provided) => ({\n maxHeight: provided.maxHeight,\n minHeight: provided.minHeight,\n }),\n menuPortal: (provided) => ({\n ...provided,\n zIndex: tokens.zIndex.popover,\n }),\n option: () => ({}),\n placeholder: () => ({}),\n singleValue: () => ({}),\n valueContainer: (provided) => ({\n ...provided,\n padding: '0',\n }),\n } as SelectProps<OptionType, IsMulti, GroupType>['selectProps']['styles'];\n};\n\n/**\n * @deprecated Use `Combobox` instead. This component will be removed in a future release.\n */\nexport const Select = <\n OptionType,\n IsMulti extends boolean = false,\n GroupType extends GroupBase<OptionType> = GroupBase<OptionType>,\n T extends React.ElementType = 'div',\n>({\n as,\n label,\n helpText,\n errorText,\n isFluid = true,\n size = 'medium',\n type = 'select',\n ariaLabel,\n selectProps = {},\n isClean = false,\n isDisabled,\n htmlAttributes,\n className,\n style,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, SelectProps<OptionType, IsMulti, GroupType>>) => {\n const isInsideDialog = useIsInsideDialog();\n const menuPosition = isInsideDialog ? 'fixed' : 'absolute';\n const identifier = useId();\n const helpTextId = useId();\n const errorTextId = useId();\n const [isMenuOpen, setIsMenuOpen] = useState(false);\n\n const handleMenuOpen = () => {\n setIsMenuOpen(true);\n if (selectProps.onMenuOpen) {\n selectProps.onMenuOpen();\n }\n };\n\n const handleMenuClose = () => {\n setIsMenuOpen(false);\n if (selectProps.onMenuClose) {\n selectProps.onMenuClose();\n }\n };\n\n // Handle Escape and Enter key to prevent it from bubbling up to dialog\n const handleKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (\n (event.key === 'Escape' && isMenuOpen) ||\n (event.key === 'Enter' && isMenuOpen)\n ) {\n event.stopPropagation();\n }\n\n if (selectProps.onKeyDown) {\n selectProps.onKeyDown(event);\n }\n };\n\n const Component: React.ElementType = as ?? 'div';\n\n const ComponentOverrides = useMemo(\n () =>\n overrideComponents<OptionType, IsMulti, GroupType>({\n errorText,\n errorTextId,\n helpText,\n helpTextId,\n isClean,\n size,\n }),\n [errorText, errorTextId, helpText, helpTextId, size, isClean],\n );\n\n const StyleOverrides = useMemo(\n () => customStyles<OptionType, IsMulti, GroupType>(),\n [],\n );\n\n useEffect(() => {\n if (label === undefined && ariaLabel === undefined) {\n needleWarningMessage(\n 'A Select needs to have a label or an aria label to be accessible. link: https://dequeuniversity.com/rules/axe/4.2/label?application=axeAPI',\n );\n }\n }, [label, ariaLabel]);\n\n let SelectElement: React.JSX.Element;\n switch (type) {\n case 'async': {\n SelectElement = (\n <AsyncSelect\n name={identifier}\n inputId={identifier}\n isDisabled={Boolean(isDisabled) || selectProps.isDisabled}\n menuPlacement=\"auto\"\n aria-label={ariaLabel}\n aria-invalid={Boolean(errorText)}\n {...selectProps}\n onKeyDown={handleKeyDown}\n onMenuOpen={handleMenuOpen}\n onMenuClose={handleMenuClose}\n menuPosition={selectProps.menuPosition ?? menuPosition}\n hideSelectedOptions={false}\n closeMenuOnSelect={Boolean(selectProps.isMulti) === false}\n styles={{ ...StyleOverrides, ...selectProps.styles }}\n components={{ ...ComponentOverrides, ...selectProps.components }}\n />\n );\n break;\n }\n case 'creatable':\n SelectElement = (\n <Creatable\n name={identifier}\n inputId={identifier}\n isDisabled={Boolean(isDisabled) || selectProps.isDisabled}\n menuPlacement=\"auto\"\n {...selectProps}\n aria-label={ariaLabel}\n aria-invalid={Boolean(errorText)}\n onKeyDown={handleKeyDown}\n onMenuOpen={handleMenuOpen}\n onMenuClose={handleMenuClose}\n menuPosition={selectProps.menuPosition ?? menuPosition}\n hideSelectedOptions={false}\n closeMenuOnSelect={Boolean(selectProps.isMulti) === false}\n styles={{ ...StyleOverrides, ...selectProps.styles }}\n components={{ ...ComponentOverrides, ...selectProps.components }}\n />\n );\n break;\n default:\n SelectElement = (\n <ReactSelect\n name={identifier}\n inputId={identifier}\n isDisabled={Boolean(isDisabled) || selectProps.isDisabled}\n menuPlacement=\"auto\"\n {...selectProps}\n aria-label={ariaLabel}\n aria-invalid={Boolean(errorText)}\n onKeyDown={handleKeyDown}\n onMenuOpen={handleMenuOpen}\n onMenuClose={handleMenuClose}\n menuPosition={selectProps.menuPosition ?? menuPosition}\n hideSelectedOptions={false}\n closeMenuOnSelect={Boolean(selectProps.isMulti) === false}\n styles={{ ...StyleOverrides, ...selectProps.styles }}\n components={{ ...ComponentOverrides, ...selectProps.components }}\n />\n );\n }\n\n const classes = classNames('ndl-select', className, {\n 'ndl-creatable': type === 'creatable',\n 'ndl-disabled': selectProps.isDisabled,\n 'ndl-fluid': isFluid,\n 'ndl-has-error': Boolean(errorText),\n 'ndl-large': size === 'large',\n 'ndl-medium': size === 'medium',\n 'ndl-multi': selectProps.isMulti,\n 'ndl-small': size === 'small',\n });\n\n return (\n <Component\n ref={ref}\n className={classes}\n style={style}\n {...restProps}\n {...htmlAttributes}\n >\n {Boolean(label) && <label htmlFor={identifier}>{label}</label>}\n {SelectElement}\n {Boolean(helpText) && Boolean(errorText) === false && (\n <Typography\n variant={size === 'large' ? 'body-medium' : 'body-small'}\n className=\"ndl-sub-text\"\n htmlAttributes={{ id: helpTextId }}\n >\n {helpText}\n </Typography>\n )}\n {Boolean(errorText) && (\n <div className=\"n-flex n-flex-row n-gap-token-4 n-items-center\">\n <ExclamationCircleIconSolid\n className=\"ndl-error-icon\"\n htmlAttributes={{ role: 'img', type: 'solid' }}\n />\n <span id={errorTextId} className=\"ndl-sub-text ndl-error-text\">\n {errorText}\n </span>\n </div>\n )}\n </Component>\n );\n};\n"]}
1
+ {"version":3,"file":"Select.js","sourceRoot":"","sources":["../../../src/select/Select.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,QA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AI,YAAY,EACtD,mBAAmB,EAAE,KAAK,EAC1B,iBAAiB,EAAE,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,KAAK,KAAK,EACzD,MAAM,kCAAO,cAAc,GAAK,WAAW,CAAC,MAAM,GAClD,UAAU,kCAAO,kBAAkB,GAAK,WAAW,CAAC,UAAU,KAC9D,CACH,CAAC;IACN,CAAC;IAED,MAAM,OAAO,GAAG,UAAU,CAAC,YAAY,EAAE,SAAS,EAAE;QAClD,eAAe,EAAE,IAAI,KAAK,WAAW;QACrC,cAAc,EAAE,WAAW,CAAC,UAAU;QACtC,WAAW,EAAE,OAAO;QACpB,eAAe,EAAE,OAAO,CAAC,SAAS,CAAC;QACnC,WAAW,EAAE,IAAI,KAAK,OAAO;QAC7B,YAAY,EAAE,IAAI,KAAK,QAAQ;QAC/B,WAAW,EAAE,WAAW,CAAC,OAAO;QAChC,WAAW,EAAE,IAAI,KAAK,OAAO;KAC9B,CAAC,CAAC;IAEH,OAAO,CACL,MAAC,SAAS,kBACR,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,OAAO,EAClB,KAAK,EAAE,KAAK,IACR,SAAS,EACT,cAAc,eAEjB,OAAO,CAAC,KAAK,CAAC,IAAI,KAAC,cAAc,IAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,GAAI,EAC9D,aAAa,EACd,KAAC,gBAAgB,IAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,GAAI,KACpC,CACb,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport { tokens } from '@neo4j-ndl/base';\nimport classNames from 'classnames';\nimport type React from 'react';\nimport { useEffect, useId, useMemo, useState } from 'react';\nimport ReactSelect, { type GroupBase } from 'react-select';\nimport AsyncSelect from 'react-select/async';\n/** Different types of select components */\nimport Creatable from 'react-select/creatable';\n\nimport {\n FormFieldLabel,\n FormFieldMessage,\n useFormField,\n} from '../_common/form-control';\nimport { type PolymorphicCommonProps } from '../_common/types';\nimport { needleWarningMessage } from '../_common/utils';\nimport { useIsInsideDialog } from '../dialog/dialog-context';\nimport {\n CustomClearIndication,\n CustomControl,\n CustomIndicatorsContainer,\n CustomInput,\n CustomMenu,\n CustomMenuList,\n CustomMenuPortal,\n CustomMultiValue,\n CustomOption,\n CustomPlaceholder,\n CustomSingleValue,\n CustomValueContainer,\n DropdownIndicatorCurrying,\n} from './Overrides';\nimport { type SelectOverrideCustomProps, type SelectProps } from './types';\n\n/**\n *\n *\n * Helpers\n *\n *\n */\n\nconst overrideComponents = <\n OptionType,\n IsMulti extends boolean = false,\n GroupType extends GroupBase<OptionType> = GroupBase<OptionType>,\n>(\n props: SelectOverrideCustomProps<OptionType, IsMulti, GroupType>,\n) =>\n ({\n ClearIndicator: CustomClearIndication(props),\n Control: CustomControl(props),\n DropdownIndicator: DropdownIndicatorCurrying(props),\n IndicatorSeparator: null,\n IndicatorsContainer: CustomIndicatorsContainer(props),\n Input: CustomInput(props),\n Menu: CustomMenu(props),\n MenuList: CustomMenuList(props),\n MenuPortal: CustomMenuPortal(props),\n MultiValue: CustomMultiValue(props),\n Option: CustomOption(props),\n Placeholder: CustomPlaceholder(props),\n SingleValue: CustomSingleValue(props),\n ValueContainer: CustomValueContainer(props),\n }) as SelectProps<\n OptionType,\n IsMulti,\n GroupType\n >['selectProps']['components'];\n\nconst customStyles = <\n OptionType,\n IsMulti extends boolean = false,\n GroupType extends GroupBase<OptionType> = GroupBase<OptionType>,\n>() => {\n return {\n clearIndicator: () => ({}),\n control: () => ({}),\n dropdownIndicator: () => ({}),\n indicatorsContainer: () => ({}),\n input: () => ({}),\n menu: (provided) => ({\n bottom: provided.bottom,\n top: provided.top,\n }),\n menuList: (provided) => ({\n maxHeight: provided.maxHeight,\n minHeight: provided.minHeight,\n }),\n menuPortal: (provided) => ({\n ...provided,\n zIndex: tokens.zIndex.popover,\n }),\n option: () => ({}),\n placeholder: () => ({}),\n singleValue: () => ({}),\n valueContainer: (provided) => ({\n ...provided,\n padding: '0',\n }),\n } as SelectProps<OptionType, IsMulti, GroupType>['selectProps']['styles'];\n};\n\n/**\n * @deprecated Use `Combobox` instead. This component will be removed in a future release.\n */\nexport const Select = <\n OptionType,\n IsMulti extends boolean = false,\n GroupType extends GroupBase<OptionType> = GroupBase<OptionType>,\n T extends React.ElementType = 'div',\n>({\n as,\n label,\n helpText,\n errorText,\n isFluid = true,\n size = 'medium',\n type = 'select',\n ariaLabel,\n selectProps = {},\n isClean = false,\n isDisabled,\n htmlAttributes,\n className,\n style,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, SelectProps<OptionType, IsMulti, GroupType>>) => {\n const isInsideDialog = useIsInsideDialog();\n const menuPosition = isInsideDialog ? 'fixed' : 'absolute';\n const identifier = useId();\n // The shared form field resolves the ids and which message is displayed -\n // an error always replaces the help text. Select has no required support;\n // it is deprecated in favor of Combobox, which has isRequired and\n // hasRequiredIndicator.\n const { field } = useFormField({\n controlId: identifier,\n errorText,\n helpText,\n label,\n });\n const helpTextId = field.helpTextId;\n const errorTextId = field.errorTextId;\n const [isMenuOpen, setIsMenuOpen] = useState(false);\n\n const handleMenuOpen = () => {\n setIsMenuOpen(true);\n if (selectProps.onMenuOpen) {\n selectProps.onMenuOpen();\n }\n };\n\n const handleMenuClose = () => {\n setIsMenuOpen(false);\n if (selectProps.onMenuClose) {\n selectProps.onMenuClose();\n }\n };\n\n // Handle Escape and Enter key to prevent it from bubbling up to dialog\n const handleKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (\n (event.key === 'Escape' && isMenuOpen) ||\n (event.key === 'Enter' && isMenuOpen)\n ) {\n event.stopPropagation();\n }\n\n if (selectProps.onKeyDown) {\n selectProps.onKeyDown(event);\n }\n };\n\n const Component: React.ElementType = as ?? 'div';\n\n const ComponentOverrides = useMemo(\n () =>\n overrideComponents<OptionType, IsMulti, GroupType>({\n errorText,\n errorTextId,\n helpText,\n helpTextId,\n isClean,\n size,\n }),\n [errorText, errorTextId, helpText, helpTextId, size, isClean],\n );\n\n const StyleOverrides = useMemo(\n () => customStyles<OptionType, IsMulti, GroupType>(),\n [],\n );\n\n useEffect(() => {\n if (label === undefined && ariaLabel === undefined) {\n needleWarningMessage(\n 'A Select needs to have a label or an aria label to be accessible. link: https://dequeuniversity.com/rules/axe/4.2/label?application=axeAPI',\n );\n }\n }, [label, ariaLabel]);\n\n let SelectElement: React.JSX.Element;\n switch (type) {\n case 'async': {\n SelectElement = (\n <AsyncSelect\n name={identifier}\n inputId={identifier}\n isDisabled={Boolean(isDisabled) || selectProps.isDisabled}\n menuPlacement=\"auto\"\n aria-label={ariaLabel}\n aria-invalid={Boolean(errorText)}\n {...selectProps}\n onKeyDown={handleKeyDown}\n onMenuOpen={handleMenuOpen}\n onMenuClose={handleMenuClose}\n menuPosition={selectProps.menuPosition ?? menuPosition}\n hideSelectedOptions={false}\n closeMenuOnSelect={Boolean(selectProps.isMulti) === false}\n styles={{ ...StyleOverrides, ...selectProps.styles }}\n components={{ ...ComponentOverrides, ...selectProps.components }}\n />\n );\n break;\n }\n case 'creatable':\n SelectElement = (\n <Creatable\n name={identifier}\n inputId={identifier}\n isDisabled={Boolean(isDisabled) || selectProps.isDisabled}\n menuPlacement=\"auto\"\n {...selectProps}\n aria-label={ariaLabel}\n aria-invalid={Boolean(errorText)}\n onKeyDown={handleKeyDown}\n onMenuOpen={handleMenuOpen}\n onMenuClose={handleMenuClose}\n menuPosition={selectProps.menuPosition ?? menuPosition}\n hideSelectedOptions={false}\n closeMenuOnSelect={Boolean(selectProps.isMulti) === false}\n styles={{ ...StyleOverrides, ...selectProps.styles }}\n components={{ ...ComponentOverrides, ...selectProps.components }}\n />\n );\n break;\n default:\n SelectElement = (\n <ReactSelect\n name={identifier}\n inputId={identifier}\n isDisabled={Boolean(isDisabled) || selectProps.isDisabled}\n menuPlacement=\"auto\"\n {...selectProps}\n aria-label={ariaLabel}\n aria-invalid={Boolean(errorText)}\n onKeyDown={handleKeyDown}\n onMenuOpen={handleMenuOpen}\n onMenuClose={handleMenuClose}\n menuPosition={selectProps.menuPosition ?? menuPosition}\n hideSelectedOptions={false}\n closeMenuOnSelect={Boolean(selectProps.isMulti) === false}\n styles={{ ...StyleOverrides, ...selectProps.styles }}\n components={{ ...ComponentOverrides, ...selectProps.components }}\n />\n );\n }\n\n const classes = classNames('ndl-select', className, {\n 'ndl-creatable': type === 'creatable',\n 'ndl-disabled': selectProps.isDisabled,\n 'ndl-fluid': isFluid,\n 'ndl-has-error': Boolean(errorText),\n 'ndl-large': size === 'large',\n 'ndl-medium': size === 'medium',\n 'ndl-multi': selectProps.isMulti,\n 'ndl-small': size === 'small',\n });\n\n return (\n <Component\n ref={ref}\n className={classes}\n style={style}\n {...restProps}\n {...htmlAttributes}\n >\n {Boolean(label) && <FormFieldLabel field={field} size={size} />}\n {SelectElement}\n <FormFieldMessage field={field} size={size} />\n </Component>\n );\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/select/types.tsx"],"names":[],"mappings":"","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport { type ReactNode } from 'react';\nimport { type GroupBase, type Props } from 'react-select';\nimport { type AsyncProps } from 'react-select/async';\nimport { type CreatableProps } from 'react-select/creatable';\n\nexport type SelectCommonProps = {\n /** Error message, if it exists the select will be in error state */\n errorText?: string | ReactNode;\n /** Help text of the select component */\n helpText?: string | ReactNode;\n /** Size of the component */\n size?: 'small' | 'medium' | 'large';\n /** Whether the select component is fluid */\n isFluid?: boolean;\n /** Whether the select component is clean. If true, the select component will have a transparent background, no border and be hug the width of the content. */\n isClean?: boolean;\n /** Whether the select component is disabled */\n isDisabled?: boolean;\n /** Additional class name */\n className?: string;\n /** Additional style */\n style?: React.CSSProperties;\n} & (\n | {\n /** Label of the select component. If not provided, please provide an ariaLabel. */\n label?: undefined;\n /** Aria label of the select component */\n ariaLabel: string;\n }\n | {\n label: React.ReactNode;\n ariaLabel?: string;\n }\n);\n\ntype ReactSelectProps<\n OptionType,\n IsMulti extends boolean = false,\n GroupType extends GroupBase<OptionType> = GroupBase<OptionType>,\n> = {\n /** Type of the select component */\n type: 'select';\n /** Props of the select component, based of React Select props */\n selectProps: Props<OptionType, IsMulti, GroupType>;\n} & SelectCommonProps;\n\ntype ReactSelectAsyncProps<\n OptionType,\n IsMulti extends boolean = false,\n GroupType extends GroupBase<OptionType> = GroupBase<OptionType>,\n> = {\n /** Type of the select component */\n type: 'async';\n /** Props of the select component, based of React Select props */\n selectProps: AsyncProps<OptionType, IsMulti, GroupType>;\n} & SelectCommonProps;\n\ntype ReactSelectCreatableProps<\n OptionType,\n IsMulti extends boolean = false,\n GroupType extends GroupBase<OptionType> = GroupBase<OptionType>,\n> = {\n /** Type of the select component */\n type: 'creatable';\n /** Props of the select component, based of React Select props */\n selectProps: CreatableProps<OptionType, IsMulti, GroupType>;\n} & SelectCommonProps;\n\n/**\n * We will provide a wrapper to the three distinct select components\n * the library provides:\n * 1. Select (the most simple component)\n * 2. Creatable (for creating new values in our options)\n * 3. Async for fetching while typing, useful for cases that we avoid storing things\n * in browser\n */\n/**\n * @remarks\n * The `type` prop is used to specify the type of select component to render, which will be passed to the underlying React Select component.\n *\n * @remarks\n * The `selectProps` prop is dynamically typed based on the `type` prop and can be one of the following: `StateManagerProps`, `CreatableProps`, `AsyncProps`. All select variants will have the `SelectProps` base type from React Select. For more information on the available props, see the [React Select documentation](https://react-select.com/props).\n */\nexport type SelectProps<\n OptionType,\n IsMulti extends boolean = false,\n GroupType extends GroupBase<OptionType> = GroupBase<OptionType>,\n> =\n | ReactSelectProps<OptionType, IsMulti, GroupType>\n | ReactSelectCreatableProps<OptionType, IsMulti, GroupType>\n | ReactSelectAsyncProps<OptionType, IsMulti, GroupType>;\n\nexport type SelectOverrideCustomProps<\n OptionType,\n IsMulti extends boolean = false,\n GroupType extends GroupBase<OptionType> = GroupBase<OptionType>,\n> = Pick<\n SelectProps<OptionType, IsMulti, GroupType>,\n 'size' | 'errorText' | 'helpText' | 'isClean'\n> & {\n errorTextId?: string;\n helpTextId?: string;\n};\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/select/types.tsx"],"names":[],"mappings":"","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport { type ReactNode } from 'react';\nimport { type GroupBase, type Props } from 'react-select';\nimport { type AsyncProps } from 'react-select/async';\nimport { type CreatableProps } from 'react-select/creatable';\n\nexport type SelectCommonProps = {\n /** Error message, if it exists the select will be in error state */\n errorText?: string | ReactNode;\n /** Help text of the select component */\n helpText?: string | ReactNode;\n /** Size of the component */\n size?: 'small' | 'medium' | 'large';\n /** Whether the select component is fluid */\n isFluid?: boolean;\n /** Whether the select component is clean. If true, the select component will have a transparent background, no border and be hug the width of the content. */\n isClean?: boolean;\n /** Whether the select component is disabled */\n isDisabled?: boolean;\n /** Additional class name */\n className?: string;\n /** Additional style */\n style?: React.CSSProperties;\n} & (\n | {\n // Deprecated, so this keeps its aria label union even though naming a\n // control is spelled differently on every form component. Combobox, its\n // replacement, requires the label and clips it with\n // `hasVisuallyHiddenLabel` instead.\n /** Label of the select component. If not provided, please provide an ariaLabel. */\n label?: undefined;\n /** Aria label of the select component */\n ariaLabel: string;\n }\n | {\n label: React.ReactNode;\n ariaLabel?: string;\n }\n);\n\ntype ReactSelectProps<\n OptionType,\n IsMulti extends boolean = false,\n GroupType extends GroupBase<OptionType> = GroupBase<OptionType>,\n> = {\n /** Type of the select component */\n type: 'select';\n /** Props of the select component, based of React Select props */\n selectProps: Props<OptionType, IsMulti, GroupType>;\n} & SelectCommonProps;\n\ntype ReactSelectAsyncProps<\n OptionType,\n IsMulti extends boolean = false,\n GroupType extends GroupBase<OptionType> = GroupBase<OptionType>,\n> = {\n /** Type of the select component */\n type: 'async';\n /** Props of the select component, based of React Select props */\n selectProps: AsyncProps<OptionType, IsMulti, GroupType>;\n} & SelectCommonProps;\n\ntype ReactSelectCreatableProps<\n OptionType,\n IsMulti extends boolean = false,\n GroupType extends GroupBase<OptionType> = GroupBase<OptionType>,\n> = {\n /** Type of the select component */\n type: 'creatable';\n /** Props of the select component, based of React Select props */\n selectProps: CreatableProps<OptionType, IsMulti, GroupType>;\n} & SelectCommonProps;\n\n/**\n * We will provide a wrapper to the three distinct select components\n * the library provides:\n * 1. Select (the most simple component)\n * 2. Creatable (for creating new values in our options)\n * 3. Async for fetching while typing, useful for cases that we avoid storing things\n * in browser\n */\n/**\n * @remarks\n * The `type` prop is used to specify the type of select component to render, which will be passed to the underlying React Select component.\n *\n * @remarks\n * The `selectProps` prop is dynamically typed based on the `type` prop and can be one of the following: `StateManagerProps`, `CreatableProps`, `AsyncProps`. All select variants will have the `SelectProps` base type from React Select. For more information on the available props, see the [React Select documentation](https://react-select.com/props).\n */\nexport type SelectProps<\n OptionType,\n IsMulti extends boolean = false,\n GroupType extends GroupBase<OptionType> = GroupBase<OptionType>,\n> =\n | ReactSelectProps<OptionType, IsMulti, GroupType>\n | ReactSelectCreatableProps<OptionType, IsMulti, GroupType>\n | ReactSelectAsyncProps<OptionType, IsMulti, GroupType>;\n\nexport type SelectOverrideCustomProps<\n OptionType,\n IsMulti extends boolean = false,\n GroupType extends GroupBase<OptionType> = GroupBase<OptionType>,\n> = Pick<\n SelectProps<OptionType, IsMulti, GroupType>,\n 'size' | 'errorText' | 'helpText' | 'isClean'\n> & {\n errorTextId?: string;\n helpTextId?: string;\n};\n"]}