@neo4j-ndl/react 5.6.3 → 5.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,89 @@
1
+ import { useDebounceCallback } from "../hooks/use-debounce-callback/index.mjs";
2
+ import SvgMagnifyingGlassOutline from "../icons/generated/custom/MagnifyingGlassOutline.mjs";
3
+ import { TextInput } from "../text-input/TextInput.mjs";
4
+ import _objectWithoutProperties from "../_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/objectWithoutProperties.mjs";
5
+ import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/objectSpread2.mjs";
6
+ import { useCallback } from "react";
7
+ import { jsx } from "react/jsx-runtime";
8
+ // src/search-field/SearchField.tsx
9
+ /*!
10
+ *
11
+ * Copyright (c) "Neo4j"
12
+ * Neo4j Sweden AB [http://neo4j.com]
13
+ *
14
+ * This file is part of Neo4j.
15
+ *
16
+ * Neo4j is free software: you can redistribute it and/or modify
17
+ * it under the terms of the GNU General Public License as published by
18
+ * the Free Software Foundation, either version 3 of the License, or
19
+ * (at your option) any later version.
20
+ *
21
+ * This program is distributed in the hope that it will be useful,
22
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
23
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24
+ * GNU General Public License for more details.
25
+ *
26
+ * You should have received a copy of the GNU General Public License
27
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
28
+ */
29
+ const _excluded = [
30
+ "debounceDelay",
31
+ "htmlAttributes",
32
+ "label",
33
+ "onChange",
34
+ "onSearch"
35
+ ];
36
+ /**
37
+ * A text input for entering search queries.
38
+ *
39
+ * @remarks
40
+ * SearchField renders a fixed search icon and uses the native `search` input
41
+ * type. `onChange` is called immediately, while `onSearch` is debounced until
42
+ * typing pauses. Pressing Enter or clearing the field calls `onSearch`
43
+ * immediately.
44
+ */
45
+ const SearchField = (_ref) => {
46
+ let { debounceDelay = 500, htmlAttributes, label, onChange, onSearch } = _ref, textInputProps = _objectWithoutProperties(_ref, _excluded);
47
+ const debouncedSearch = useDebounceCallback((query) => {
48
+ onSearch === null || onSearch === void 0 || onSearch(query);
49
+ }, debounceDelay);
50
+ const handleChange = useCallback((event) => {
51
+ onChange === null || onChange === void 0 || onChange(event);
52
+ const query = event.target.value;
53
+ if (query === "") {
54
+ debouncedSearch.cancel();
55
+ onSearch === null || onSearch === void 0 || onSearch("");
56
+ return;
57
+ }
58
+ debouncedSearch(query);
59
+ }, [
60
+ debouncedSearch,
61
+ onChange,
62
+ onSearch
63
+ ]);
64
+ const handleKeyDown = useCallback((event) => {
65
+ var _htmlAttributes$onKey;
66
+ htmlAttributes === null || htmlAttributes === void 0 || (_htmlAttributes$onKey = htmlAttributes.onKeyDown) === null || _htmlAttributes$onKey === void 0 || _htmlAttributes$onKey.call(htmlAttributes, event);
67
+ if (event.key === "Enter" && !event.defaultPrevented && !event.nativeEvent.isComposing) {
68
+ if (debouncedSearch.isPending()) debouncedSearch.flush();
69
+ else onSearch === null || onSearch === void 0 || onSearch(event.currentTarget.value);
70
+ }
71
+ }, [
72
+ debouncedSearch,
73
+ htmlAttributes,
74
+ onSearch
75
+ ]);
76
+ return /* @__PURE__ */ jsx(TextInput, _objectSpread2(_objectSpread2({}, textInputProps), {}, {
77
+ htmlAttributes: _objectSpread2(_objectSpread2({}, htmlAttributes), {}, {
78
+ "aria-label": label,
79
+ onKeyDown: handleKeyDown,
80
+ type: "search"
81
+ }),
82
+ isClearable: true,
83
+ leadingElement: /* @__PURE__ */ jsx(SvgMagnifyingGlassOutline, {}),
84
+ onChange: handleChange
85
+ }));
86
+ };
87
+ export { SearchField };
88
+
89
+ //# sourceMappingURL=SearchField.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SearchField.mjs","names":["MagnifyingGlassOutlineIcon"],"sources":["../../../src/search-field/SearchField.tsx"],"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 { type ChangeEvent, type ComponentProps, useCallback } from 'react';\n\nimport { useDebounceCallback } from '../hooks/use-debounce-callback';\nimport MagnifyingGlassOutlineIcon from '../icons/generated/custom/MagnifyingGlassOutline';\nimport { TextInput } from '../text-input';\n\ntype SearchFieldTextInputProps = Pick<\n ComponentProps<typeof TextInput>,\n | 'className'\n | 'errorText'\n | 'helpText'\n | 'htmlAttributes'\n | 'isDisabled'\n | 'isFluid'\n | 'isLoading'\n | 'isReadOnly'\n | 'isSkeletonLoading'\n | 'onChange'\n | 'placeholder'\n | 'ref'\n | 'size'\n | 'skeletonProps'\n | 'style'\n | 'value'\n>;\n\nexport type SearchFieldProps = SearchFieldTextInputProps & {\n /**\n * Accessible name for the search field. The label is announced by assistive\n * technologies but is not rendered visually.\n */\n label: string;\n\n /**\n * Called with the search query after typing pauses for `debounceDelay`, and\n * immediately when the user presses Enter or clears the field.\n */\n onSearch?: (query: string) => void;\n\n /**\n * Delay in milliseconds before calling `onSearch` after the query changes.\n * @default 500\n */\n debounceDelay?: number;\n};\n\n/**\n * A text input for entering search queries.\n *\n * @remarks\n * SearchField renders a fixed search icon and uses the native `search` input\n * type. `onChange` is called immediately, while `onSearch` is debounced until\n * typing pauses. Pressing Enter or clearing the field calls `onSearch`\n * immediately.\n */\nexport const SearchField = ({\n debounceDelay = 500,\n htmlAttributes,\n label,\n onChange,\n onSearch,\n ...textInputProps\n}: SearchFieldProps) => {\n const debouncedSearch = useDebounceCallback((query: string) => {\n onSearch?.(query);\n }, debounceDelay);\n\n const handleChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n onChange?.(event);\n\n const query = event.target.value;\n if (query === '') {\n debouncedSearch.cancel();\n onSearch?.('');\n return;\n }\n\n debouncedSearch(query);\n },\n [debouncedSearch, onChange, onSearch],\n );\n\n const handleKeyDown = useCallback(\n (event: React.KeyboardEvent<HTMLInputElement>) => {\n htmlAttributes?.onKeyDown?.(event);\n\n if (\n event.key === 'Enter' &&\n !event.defaultPrevented &&\n !event.nativeEvent.isComposing\n ) {\n if (debouncedSearch.isPending()) {\n debouncedSearch.flush();\n } else {\n onSearch?.(event.currentTarget.value);\n }\n }\n },\n [debouncedSearch, htmlAttributes, onSearch],\n );\n\n return (\n <TextInput\n {...textInputProps}\n htmlAttributes={{\n ...htmlAttributes,\n 'aria-label': label,\n onKeyDown: handleKeyDown,\n type: 'search',\n }}\n isClearable\n leadingElement={<MagnifyingGlassOutlineIcon />}\n onChange={handleChange}\n />\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6EE;CACA;CACA;CACA;CACA;;;;;;;;;;;AALF,MAAa,eAAe,SAOJ;CAPI,IAAA,EAC1B,gBAAgB,KAChB,gBACA,OACA,UACA,aAAA,MACG,iBAAA,yBAAA,MAAA,SAAA;CAEH,MAAM,kBAAkB,qBAAqB,UAAkB;EAC7D,aAAA,QAAA,aAAA,KAAA,KAAA,SAAW,KAAK;CAClB,GAAG,aAAa;CAEhB,MAAM,eAAe,aAClB,UAAyC;EACxC,aAAA,QAAA,aAAA,KAAA,KAAA,SAAW,KAAK;EAEhB,MAAM,QAAQ,MAAM,OAAO;EAC3B,IAAI,UAAU,IAAI;GAChB,gBAAgB,OAAO;GACvB,aAAA,QAAA,aAAA,KAAA,KAAA,SAAW,EAAE;GACb;EACF;EAEA,gBAAgB,KAAK;CACvB,GACA;EAAC;EAAiB;EAAU;CAAQ,CACtC;CAEA,MAAM,gBAAgB,aACnB,UAAiD;;EAChD,mBAAA,QAAA,mBAAA,KAAA,MAAA,wBAAA,eAAgB,eAAA,QAAA,0BAAA,KAAA,KAAA,sBAAA,KAAA,gBAAY,KAAK;EAEjC,IACE,MAAM,QAAQ,WACd,CAAC,MAAM,oBACP,CAAC,MAAM,YAAY,aACnB;GACA,IAAI,gBAAgB,UAAU,GAC5B,gBAAgB,MAAM;QAEtB,aAAA,QAAA,aAAA,KAAA,KAAA,SAAW,MAAM,cAAc,KAAK;EAExC;CACF,GACA;EAAC;EAAiB;EAAgB;CAAQ,CAC5C;CAEA,OACE,oBAAC,WAAA,eAAA,eAAA,CAAA,GACK,cAAA,GAAA,CAAA,GAAA;EACJ,gBAAA,eAAA,eAAA,CAAA,GACK,cAAA,GAAA,CAAA,GAAA;GACH,cAAc;GACd,WAAW;GACX,MAAM;EACR,CAAA;EACA,aAAA;EACA,gBAAgB,oBAACA,2BAAD,CAA6B,CAAA;EAC7C,UAAU;CACX,CAAA,CAAA;AAEL"}
@@ -0,0 +1,24 @@
1
+ // src/search-field/index.ts
2
+ /*!
3
+ *
4
+ * Copyright (c) "Neo4j"
5
+ * Neo4j Sweden AB [http://neo4j.com]
6
+ *
7
+ * This file is part of Neo4j.
8
+ *
9
+ * Neo4j is free software: you can redistribute it and/or modify
10
+ * it under the terms of the GNU General Public License as published by
11
+ * the Free Software Foundation, either version 3 of the License, or
12
+ * (at your option) any later version.
13
+ *
14
+ * This program is distributed in the hope that it will be useful,
15
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
+ * GNU General Public License for more details.
18
+ *
19
+ * You should have received a copy of the GNU General Public License
20
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
21
+ */
22
+ export { SearchField } from "./SearchField.mjs";
23
+
24
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../../src/search-field/index.ts"],"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\nexport * from './SearchField';\n"],"mappings":""}
@@ -177,7 +177,7 @@ const SideNavComponent = (_ref) => {
177
177
  className: "ndl-side-nav-nav",
178
178
  "aria-label": ariaLabel,
179
179
  children: /* @__PURE__ */ jsx(Composite, {
180
- as: "ul",
180
+ render: /* @__PURE__ */ jsx("ul", {}),
181
181
  "aria-label": ariaLabel,
182
182
  role: "menubar",
183
183
  orientation: "vertical",
@@ -1 +1 @@
1
- {"version":3,"file":"SideNavigation.mjs","names":["PinIcon"],"sources":["../../../src/side-navigation/SideNavigation.tsx"],"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 {\n autoUpdate,\n Composite,\n CompositeItem,\n flip,\n FloatingFocusManager,\n FloatingList,\n FloatingPortal,\n offset,\n safePolygon,\n shift,\n useDismiss,\n useFloating,\n useFocus,\n useHover,\n useInteractions,\n useListItem,\n useListNavigation,\n useMergeRefs,\n useTransitionStyles,\n} from '@floating-ui/react';\nimport { tokens } from '@neo4j-ndl/base';\nimport classNames from 'classnames';\nimport type React from 'react';\nimport { useEffect, useId, useRef, useState } from 'react';\n\nimport { IconIndicatorWrapper } from '../_common/IconIndicatorWrapper';\nimport {\n type CommonProps,\n type PolymorphicCommonProps,\n} from '../_common/types';\nimport { CleanIconButton } from '../clean-icon-button';\nimport { ConditionalWrap } from '../conditional-wrap';\nimport { Divider } from '../divider';\nimport PinIcon from '../icons/generated/custom/Pin';\nimport { ChevronRightIconOutline } from '../icons/generated/heroIcons/ChevronRightIconOutline';\nimport { Tooltip } from '../tooltip';\nimport { Typography } from '../typography';\nimport {\n SideNavCategoryContext,\n SideNavContext,\n useSideNavCategoryContext,\n useSideNavContext,\n} from './side-navigation-context';\nimport {\n type CategoryHeaderProps,\n type CategoryItemProps,\n type ItemBadgeProps,\n type NavItemProps,\n type SideNavListItemProps,\n type SideNavProps,\n} from './side-navigation-types';\n\n/**\n * SideNav\n */\nconst SideNavComponent = ({\n children,\n className,\n style,\n htmlAttributes,\n isExpanded = false,\n shouldOverlayOnInteraction = true,\n ariaLabel,\n onPinButtonClick,\n expandedWidth,\n ref,\n ...restProps\n}: CommonProps<'div', SideNavProps>) => {\n const [isHovered, setIsHovered] = useState(false);\n const [hasFocusVisible, setHasFocusVisible] = useState(false);\n const [isCollapseTransitioning, setIsCollapseTransitioning] = useState(false);\n const collapseTransitionTimeoutRef = useRef<ReturnType<\n typeof setTimeout\n > | null>(null);\n\n const rootRef = useRef<HTMLDivElement>(null);\n\n const isFloatingExpanded =\n shouldOverlayOnInteraction && (!isHovered ? hasFocusVisible : true);\n\n const classes = classNames('ndl-side-nav', 'ndl-side-nav-root', className, {\n 'ndl-side-nav-collapsed':\n isExpanded !== true && shouldOverlayOnInteraction !== true,\n 'ndl-side-nav-expanded': isExpanded,\n });\n\n const innerClasses = classNames('ndl-side-nav-inner', {\n 'ndl-side-nav-collapsing': isCollapseTransitioning,\n 'ndl-side-nav-hover': isFloatingExpanded === true && isExpanded !== true,\n });\n\n const customStyle = {\n ...style,\n ...(Boolean(expandedWidth) && {\n '--side-nav-width-expanded':\n typeof expandedWidth === 'string'\n ? expandedWidth\n : `${expandedWidth}px`,\n }),\n };\n\n const mergedRef = useMergeRefs([ref, rootRef]);\n\n const collapseTransitionDuration = Number.parseInt(\n tokens.motion.duration.quick,\n 10,\n );\n\n useEffect(() => {\n return () => {\n if (collapseTransitionTimeoutRef.current !== null) {\n clearTimeout(collapseTransitionTimeoutRef.current);\n collapseTransitionTimeoutRef.current = null;\n }\n };\n }, []);\n\n return (\n <SideNavContext.Provider\n value={{\n isExpanded,\n isHovered: isFloatingExpanded, // needs refactoring\n onPinButtonClick,\n shouldOverlayOnInteraction,\n }}\n >\n <div\n className={classes}\n ref={mergedRef}\n style={customStyle}\n onMouseEnter={() => {\n if (collapseTransitionTimeoutRef.current !== null) {\n clearTimeout(collapseTransitionTimeoutRef.current);\n collapseTransitionTimeoutRef.current = null;\n }\n setIsCollapseTransitioning(false);\n setIsHovered(true);\n }}\n onMouseLeave={() => {\n const shouldDelayZIndexRemoval =\n shouldOverlayOnInteraction &&\n !isExpanded &&\n (isHovered || hasFocusVisible);\n setIsHovered(false);\n if (shouldDelayZIndexRemoval) {\n if (collapseTransitionTimeoutRef.current !== null) {\n clearTimeout(collapseTransitionTimeoutRef.current);\n }\n setIsCollapseTransitioning(true);\n collapseTransitionTimeoutRef.current = setTimeout(() => {\n collapseTransitionTimeoutRef.current = null;\n setIsCollapseTransitioning(false);\n }, collapseTransitionDuration);\n }\n }}\n onFocusCapture={() => {\n // Delay slightly to let Composite's focus management settle\n requestAnimationFrame(() => {\n const activeElement = document.activeElement;\n // Check if focus is inside and visible (using :focus-visible on the active element)\n if (\n activeElement instanceof HTMLElement &&\n rootRef.current !== null &&\n rootRef.current.contains(activeElement) &&\n activeElement.matches(':focus-visible')\n ) {\n // Update state after another frame to let focus fully settle\n // This updates the context for consumers without disrupting focus\n requestAnimationFrame(() => {\n setHasFocusVisible(true);\n });\n }\n });\n }}\n onBlurCapture={() => {\n // Small delay to check if focus moved to another element inside\n requestAnimationFrame(() => {\n const activeElement = document.activeElement;\n const isInsideNav =\n activeElement instanceof HTMLElement &&\n rootRef.current !== null &&\n rootRef.current.contains(activeElement);\n // Check if focus is in a portaled floating menu\n const isInsideFloatingMenu =\n activeElement instanceof HTMLElement &&\n activeElement.closest('.ndl-side-nav-popover') !== null;\n\n if (\n (isInsideNav || isInsideFloatingMenu) &&\n activeElement instanceof HTMLElement &&\n activeElement.matches(':focus-visible')\n ) {\n // Focus stayed inside with focus-visible\n setHasFocusVisible(true);\n } else {\n // Focus left - collapse\n setHasFocusVisible(false);\n }\n });\n }}\n {...restProps}\n {...htmlAttributes}\n >\n <div className={innerClasses}>\n {/* Both the nav landmark and the Menubar get the same label following the\n WAI-ARIA pattern for Menubar:\n https://www.w3.org/WAI/ARIA/apg/patterns/menubar/examples/menubar-navigation */}\n <nav className=\"ndl-side-nav-nav\" aria-label={ariaLabel}>\n <Composite\n as=\"ul\"\n aria-label={ariaLabel}\n role=\"menubar\"\n orientation=\"vertical\"\n aria-orientation=\"vertical\"\n className=\"ndl-side-nav-list\"\n loop={true}\n >\n {children}\n </Composite>\n </nav>\n {shouldOverlayOnInteraction === true && (\n <div className=\"ndl-side-nav-footer\">\n <PinButton />\n </div>\n )}\n </div>\n </div>\n </SideNavContext.Provider>\n );\n};\n\n/**\n * SideNavListItem\n */\nconst SideNavListItem = ({\n children,\n className,\n style,\n htmlAttributes,\n ref,\n ...restProps\n}: CommonProps<'li', SideNavListItemProps>) => {\n const classes = classNames('ndl-side-nav-list-item', className, {});\n\n return (\n <li\n role=\"none\"\n className={classes}\n style={style}\n ref={ref}\n {...restProps}\n {...htmlAttributes}\n >\n <SelectedIndicator />\n {children}\n </li>\n );\n};\n\n/**\n * NavItem\n */\nconst NavItem = <T extends React.ElementType = 'button'>({\n icon,\n label,\n trailingElement,\n isActive,\n className,\n style,\n htmlAttributes,\n as,\n badge,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, NavItemProps>) => {\n const { isExpanded, isHovered, shouldOverlayOnInteraction } =\n useSideNavContext();\n const categoryContext = useSideNavCategoryContext();\n const isInCategory = categoryContext !== null;\n\n const item = useListItem();\n const mergedRef = useMergeRefs([item.ref, ref]);\n\n const isActiveIndex = item.index === categoryContext?.activeIndex;\n\n const Component: React.ElementType = as ?? 'button';\n const classes = classNames('ndl-side-nav-nav-item', className, {\n 'ndl-active': isActive === true,\n });\n\n const Wrapper = isInCategory ? Component : CompositeItem;\n const componentProps = {\n className: classes,\n ref: mergedRef,\n role: 'menuitem',\n style: style,\n ...(isInCategory && {\n ...categoryContext?.getItemProps(),\n tabIndex: isActiveIndex ? 0 : -1,\n }),\n ...restProps,\n ...htmlAttributes,\n };\n const wrapperProps = isInCategory\n ? componentProps\n : {\n render: <Component {...componentProps} />,\n };\n\n return (\n <ConditionalWrap\n shouldWrap={\n isExpanded === false &&\n !shouldOverlayOnInteraction &&\n !isInCategory &&\n Boolean(label)\n }\n wrap={(children) => (\n <Tooltip\n type=\"simple\"\n placement=\"right\"\n hoverDelay={{ close: 0, open: shouldOverlayOnInteraction ? 100 : 0 }}\n >\n <Tooltip.Trigger hasButtonWrapper={true}>{children}</Tooltip.Trigger>\n <Tooltip.Content>{label}</Tooltip.Content>\n </Tooltip>\n )}\n >\n <Wrapper {...wrapperProps}>\n <div className=\"ndl-side-nav-item-inner\">\n {Boolean(icon) && (\n <div className=\"ndl-side-nav-item-leading-element\">\n <ConditionalWrap\n shouldWrap={Boolean(badge) && !isHovered && !isExpanded}\n wrap={(children) => (\n <IconIndicatorWrapper type={badge?.type ?? 'info'}>\n {children}\n </IconIndicatorWrapper>\n )}\n >\n {icon}\n </ConditionalWrap>\n </div>\n )}\n {Boolean(label) && (\n <Typography\n variant=\"body-medium\"\n as=\"div\"\n className=\"ndl-side-nav-item-label\"\n >\n {label}\n </Typography>\n )}\n {(Boolean(trailingElement) || Boolean(badge)) && (\n <div className=\"ndl-side-nav-item-trailing-element\">\n {trailingElement}\n {badge !== undefined && (\n <ItemBadge type={badge.type} number={badge.number} />\n )}\n </div>\n )}\n </div>\n </Wrapper>\n </ConditionalWrap>\n );\n};\n\n/**\n * CategoryItem\n */\nconst CategoryItem = ({\n children,\n icon,\n label,\n isActive,\n className,\n style,\n htmlAttributes,\n badge,\n isMenuOpen = false,\n ref,\n ...restProps\n}: CommonProps<'button', CategoryItemProps>) => {\n const floatingId = useId();\n const { isExpanded, isHovered, shouldOverlayOnInteraction } =\n useSideNavContext();\n const anchorRef = useRef<HTMLLIElement>(null);\n const [isOpen, setIsOpen] = useState(false);\n const [activeIndex, setActiveIndex] = useState<number | null>(null);\n const [isTooltipOpen, setIsTooltipOpen] = useState(false);\n const elementsRef = useRef<\n Array<HTMLButtonElement | HTMLAnchorElement | null>\n >([]);\n\n const classes = classNames('ndl-side-nav-category-item', className, {\n 'ndl-active': isActive === true,\n });\n\n // Floating UI setup\n const { refs, context } = useFloating({\n elements: {\n reference: anchorRef.current,\n },\n middleware: [\n offset(5),\n flip({ crossAxis: true, fallbackAxisSideDirection: 'end', padding: 5 }),\n shift({ padding: 5 }),\n ],\n onOpenChange: setIsOpen,\n open: isOpen || isMenuOpen,\n placement: 'right-start',\n strategy: 'fixed',\n whileElementsMounted: autoUpdate,\n });\n\n const dismiss = useDismiss(context, {\n referencePress: false,\n });\n const hover = useHover(context, {\n delay: { close: 130, open: 130 },\n handleClose: safePolygon({\n blockPointerEvents: false,\n requireIntent: false,\n }),\n });\n const focus = useFocus(context);\n const listNavigation = useListNavigation(context, {\n activeIndex: activeIndex,\n focusItemOnHover: false,\n focusItemOnOpen: false,\n listRef: elementsRef,\n loop: true,\n nested: true,\n onNavigate: setActiveIndex,\n openOnArrowKeyDown: false,\n });\n\n // Separate interactions: reference (no listNavigation), floating (with listNavigation)\n const refInteractions = useInteractions([dismiss, hover, focus]);\n const floatInteractions = useInteractions([dismiss, hover, listNavigation]);\n const { styles: transitionStyles } = useTransitionStyles(context, {\n duration: Number.parseInt(tokens.motion.duration.quick) ?? 0,\n });\n\n // Reset activeIndex when menu closes\n useEffect(() => {\n if (!context.open) {\n setActiveIndex(null);\n }\n }, [context.open]);\n\n const mergedRef = useMergeRefs([refs.setReference, ref]);\n\n return (\n <SideNavCategoryContext.Provider\n value={{\n activeIndex,\n getItemProps: floatInteractions.getItemProps,\n }}\n >\n <ConditionalWrap\n shouldWrap={\n isExpanded === false && !shouldOverlayOnInteraction && Boolean(label)\n }\n wrap={(children) => (\n <Tooltip\n type=\"simple\"\n placement=\"top\"\n hoverDelay={{\n close: 0,\n open: shouldOverlayOnInteraction ? 100 : 0,\n }}\n isOpen={isTooltipOpen}\n onOpenChange={setIsTooltipOpen}\n >\n <Tooltip.Trigger hasButtonWrapper={true}>\n {children}\n </Tooltip.Trigger>\n <Tooltip.Content className=\"ndl-side-nav ndl-side-nav-category-menu-tooltip-content\">\n {label}\n </Tooltip.Content>\n </Tooltip>\n )}\n >\n <CompositeItem\n render={\n <button\n type=\"button\"\n {...refInteractions.getReferenceProps({\n className: classes,\n ref: mergedRef,\n style,\n ...restProps,\n ...htmlAttributes,\n })}\n // {...restProps}\n // {...htmlAttributes}\n role=\"menuitem\"\n aria-haspopup=\"menu\"\n aria-expanded={context.open}\n aria-controls={floatingId}\n onFocus={(event) => {\n // Only show tooltip on focus-visible (keyboard navigation)\n if (\n event.target instanceof HTMLElement &&\n event.target.matches(':focus-visible')\n ) {\n setIsTooltipOpen(true);\n }\n // Call original handler if exists\n const originalOnFocus = refInteractions.getReferenceProps({})\n .onFocus as\n | ((event: React.FocusEvent<HTMLButtonElement>) => void)\n | undefined;\n originalOnFocus?.(event);\n }}\n onBlur={(event) => {\n setIsTooltipOpen(false);\n // Call original handler if exists\n const originalOnBlur = refInteractions.getReferenceProps({})\n .onBlur as\n | ((event: React.FocusEvent<HTMLButtonElement>) => void)\n | undefined;\n originalOnBlur?.(event);\n }}\n onKeyDown={(event) => {\n if (event.key === 'ArrowRight') {\n // open and move focus into submenu\n setIsOpen(true);\n setActiveIndex(0);\n // Defer focusing first item (if needed) to next tick\n requestAnimationFrame(() => {\n const el = elementsRef.current[0];\n el?.focus();\n });\n event.preventDefault();\n }\n // ArrowDown/ArrowUp: let Composite handle top-level roving focus.\n }}\n />\n }\n >\n <div className=\"ndl-side-nav-item-inner\">\n {Boolean(icon) && (\n <div className=\"ndl-side-nav-item-leading-element\">\n <ConditionalWrap\n shouldWrap={Boolean(badge) && !isHovered && !isExpanded}\n wrap={(children) => (\n <IconIndicatorWrapper type={badge?.type ?? 'info'}>\n {children}\n </IconIndicatorWrapper>\n )}\n >\n {icon}\n </ConditionalWrap>\n </div>\n )}\n {Boolean(label) && (\n <Typography\n variant=\"body-medium\"\n as=\"div\"\n className=\"ndl-side-nav-item-label\"\n >\n {label}\n </Typography>\n )}\n <div className=\"ndl-side-nav-item-trailing-element\">\n {badge && <ItemBadge type={badge.type} number={badge.number} />}\n <ChevronRightIconOutline className=\"ndl-side-nav-item-chevron\" />\n </div>\n </div>\n {context.open && (\n <FloatingList elementsRef={elementsRef}>\n <FloatingPortal>\n <FloatingFocusManager\n context={context}\n modal={false}\n initialFocus={-1}\n returnFocus={true}\n closeOnFocusOut={true}\n guards={true}\n >\n <ul\n id={floatingId}\n ref={refs.setFloating}\n className=\"ndl-side-nav ndl-side-nav-popover ndl-side-nav-popover-list\"\n style={{\n ...context.floatingStyles,\n ...transitionStyles,\n }}\n {...floatInteractions.getFloatingProps()}\n role=\"menu\"\n >\n {children}\n </ul>\n </FloatingFocusManager>\n </FloatingPortal>\n </FloatingList>\n )}\n </CompositeItem>\n </ConditionalWrap>\n </SideNavCategoryContext.Provider>\n );\n};\n\n/**\n * CategoryHeader\n */\nconst CategoryHeader = ({\n children,\n className,\n ref,\n style,\n htmlAttributes,\n ...restProps\n}: CommonProps<'li', CategoryHeaderProps>) => {\n const { isExpanded, isHovered } = useSideNavContext();\n\n const classes = classNames('ndl-side-nav-category-header', className, {\n 'ndl-side-nav-category-header-expanded': isExpanded || isHovered,\n });\n\n return (\n <Typography\n ref={ref}\n variant=\"label\"\n as=\"li\"\n className={classes}\n htmlAttributes={{\n ...htmlAttributes,\n role: 'separator',\n }}\n style={style}\n {...restProps}\n >\n {isExpanded || isHovered ? children : <Divider />}\n </Typography>\n );\n};\n\n/**\n * SelectedIndicator\n */\nconst SelectedIndicator = () => {\n return <div className=\"ndl-side-nav-selected-indicator\" />;\n};\n\n/**\n * SideNavDivider\n */\nconst SideNavDivider = () => {\n return (\n <Divider\n orientation=\"horizontal\"\n className=\"ndl-side-nav-divider\"\n as=\"li\"\n />\n );\n};\n\n/**\n * ItemBadge\n */\nconst ItemBadge = ({\n number,\n type,\n ref,\n htmlAttributes,\n style,\n className,\n ...restProps\n}: CommonProps<'span', ItemBadgeProps>) => {\n useSideNavContext();\n\n const badgeClasses = classNames('ndl-side-nav-item-badge', className, {\n 'ndl-danger': type === 'danger',\n 'ndl-info': type === 'info',\n 'ndl-warning': type === 'warning',\n });\n\n return (\n <Typography\n as=\"span\"\n className={badgeClasses}\n variant=\"subheading-small\"\n htmlAttributes={{\n 'aria-label': `${number} notifications of type ${type}`,\n ...htmlAttributes,\n }}\n style={style}\n ref={ref}\n {...restProps}\n >\n {number}\n </Typography>\n );\n};\n\n/**\n * PinButton\n */\nconst PinButton = () => {\n const { isExpanded, shouldOverlayOnInteraction, onPinButtonClick } =\n useSideNavContext();\n\n const classes = classNames('ndl-side-nav-pin-button');\n\n if (!shouldOverlayOnInteraction) {\n return null;\n }\n\n return (\n <CleanIconButton\n onClick={onPinButtonClick}\n className={classes}\n description=\"Pin\"\n size=\"medium\"\n isActive={isExpanded}\n tooltipProps={{\n root: {\n autoUpdateOptions: {\n animationFrame: true,\n },\n placement: 'right',\n },\n }}\n >\n <PinIcon />\n </CleanIconButton>\n );\n};\n\nconst SideNavigation = Object.assign(SideNavComponent, {\n CategoryHeader: CategoryHeader,\n CategoryItem: CategoryItem,\n Divider: SideNavDivider,\n ItemBadge: ItemBadge,\n ListItem: SideNavListItem,\n NavItem,\n});\n\nexport { SideNavigation };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8EE;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;;;CA0KA;CACA;CACA;CACA;CACA;;;CAwBA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;;;CAmGA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;;;CAqOA;CACA;CACA;CACA;CACA;;;CAmDA;CACA;CACA;CACA;CACA;CACA;;;;;AAtmBF,MAAM,oBAAoB,SAYc;CAZd,IAAA,EACxB,UACA,WACA,OACA,gBACA,aAAa,OACb,6BAA6B,MAC7B,WACA,kBACA,eACA,QAAA,MACG,YAAA,yBAAA,MAAA,SAAA;CAEH,MAAM,CAAC,WAAW,gBAAgB,SAAS,KAAK;CAChD,MAAM,CAAC,iBAAiB,sBAAsB,SAAS,KAAK;CAC5D,MAAM,CAAC,yBAAyB,8BAA8B,SAAS,KAAK;CAC5E,MAAM,+BAA+B,OAE3B,IAAI;CAEd,MAAM,UAAU,OAAuB,IAAI;CAE3C,MAAM,qBACJ,+BAA+B,CAAC,YAAY,kBAAkB;CAEhE,MAAM,UAAU,WAAW,gBAAgB,qBAAqB,WAAW;EACzE,0BACE,eAAe,QAAQ,+BAA+B;EACxD,yBAAyB;CAC3B,CAAC;CAED,MAAM,eAAe,WAAW,sBAAsB;EACpD,2BAA2B;EAC3B,sBAAsB,uBAAuB,QAAQ,eAAe;CACtE,CAAC;CAED,MAAM,cAAA,eAAA,eAAA,CAAA,GACD,KAAA,GACC,QAAQ,aAAa,KAAK,EAC5B,6BACE,OAAO,kBAAkB,WACrB,gBACA,GAAG,cAAc,IACzB,CACF;CAEA,MAAM,YAAY,aAAa,CAAC,KAAK,OAAO,CAAC;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mC,CAAA;AAC3D;;;;AAKA,MAAM,uBAAuB;CAC3B,OACE,oBAAC,SAAD;EACE,aAAY;EACZ,WAAU;EACV,IAAG;CACJ,CAAA;AAEL;;;;AAKA,MAAM,aAAa,UAQwB;CARxB,IAAA,EACjB,QACA,MACA,KACA,gBACA,OACA,cAAA,OACG,YAAA,yBAAA,OAAA,UAAA;CAEH,kBAAkB;CAElB,MAAM,eAAe,WAAW,2BAA2B,WAAW;EACpE,cAAc,SAAS;EACvB,YAAY,SAAS;EACrB,eAAe,SAAS;CAC1B,CAAC;CAED,OACE,oBAAC,YAAA,eAAA,eAAA;EACC,IAAG;EACH,WAAW;EACX,SAAQ;EACR,gBAAA,eAAA,EACE,cAAc,GAAG,OAAO,yBAAyB,OAAA,GAC9C,cACL;EACO;EACF;CACD,GAAA,SAAA,GAAA,CAAA,GAAA,EAAA,UAEH,OAAA,CACS,CAAA;AAEhB;;;;AAKA,MAAM,kBAAkB;CACtB,MAAM,EAAE,YAAY,4BAA4B,qBAC9C,kBAAkB;CAEpB,MAAM,UAAU,WAAW,yBAAyB;CAEpD,IAAI,CAAC,4BACH,OAAO;CAGT,OACE,oBAAC,iBAAD;EACE,SAAS;EACT,WAAW;EACX,aAAY;EACZ,MAAK;EACL,UAAU;EACV,cAAc,EACZ,MAAM;GACJ,mBAAmB,EACjB,gBAAgB,KAClB;GACA,WAAW;EACb,EACF;EAEA,UAAA,oBAACA,QAAD,CAAU,CAAA;CACK,CAAA;AAErB;AAEA,MAAM,iBAAiB,OAAO,OAAO,kBAAkB;CACrC;CACF;CACd,SAAS;CACE;CACX,UAAU;CACV;AACF,CAAC"}
1
+ {"version":3,"file":"SideNavigation.mjs","names":["PinIcon"],"sources":["../../../src/side-navigation/SideNavigation.tsx"],"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 {\n autoUpdate,\n Composite,\n CompositeItem,\n flip,\n FloatingFocusManager,\n FloatingList,\n FloatingPortal,\n offset,\n safePolygon,\n shift,\n useDismiss,\n useFloating,\n useFocus,\n useHover,\n useInteractions,\n useListItem,\n useListNavigation,\n useMergeRefs,\n useTransitionStyles,\n} from '@floating-ui/react';\nimport { tokens } from '@neo4j-ndl/base';\nimport classNames from 'classnames';\nimport type React from 'react';\nimport { useEffect, useId, useRef, useState } from 'react';\n\nimport { IconIndicatorWrapper } from '../_common/IconIndicatorWrapper';\nimport {\n type CommonProps,\n type PolymorphicCommonProps,\n} from '../_common/types';\nimport { CleanIconButton } from '../clean-icon-button';\nimport { ConditionalWrap } from '../conditional-wrap';\nimport { Divider } from '../divider';\nimport PinIcon from '../icons/generated/custom/Pin';\nimport { ChevronRightIconOutline } from '../icons/generated/heroIcons/ChevronRightIconOutline';\nimport { Tooltip } from '../tooltip';\nimport { Typography } from '../typography';\nimport {\n SideNavCategoryContext,\n SideNavContext,\n useSideNavCategoryContext,\n useSideNavContext,\n} from './side-navigation-context';\nimport {\n type CategoryHeaderProps,\n type CategoryItemProps,\n type ItemBadgeProps,\n type NavItemProps,\n type SideNavListItemProps,\n type SideNavProps,\n} from './side-navigation-types';\n\n/**\n * SideNav\n */\nconst SideNavComponent = ({\n children,\n className,\n style,\n htmlAttributes,\n isExpanded = false,\n shouldOverlayOnInteraction = true,\n ariaLabel,\n onPinButtonClick,\n expandedWidth,\n ref,\n ...restProps\n}: CommonProps<'div', SideNavProps>) => {\n const [isHovered, setIsHovered] = useState(false);\n const [hasFocusVisible, setHasFocusVisible] = useState(false);\n const [isCollapseTransitioning, setIsCollapseTransitioning] = useState(false);\n const collapseTransitionTimeoutRef = useRef<ReturnType<\n typeof setTimeout\n > | null>(null);\n\n const rootRef = useRef<HTMLDivElement>(null);\n\n const isFloatingExpanded =\n shouldOverlayOnInteraction && (!isHovered ? hasFocusVisible : true);\n\n const classes = classNames('ndl-side-nav', 'ndl-side-nav-root', className, {\n 'ndl-side-nav-collapsed':\n isExpanded !== true && shouldOverlayOnInteraction !== true,\n 'ndl-side-nav-expanded': isExpanded,\n });\n\n const innerClasses = classNames('ndl-side-nav-inner', {\n 'ndl-side-nav-collapsing': isCollapseTransitioning,\n 'ndl-side-nav-hover': isFloatingExpanded === true && isExpanded !== true,\n });\n\n const customStyle = {\n ...style,\n ...(Boolean(expandedWidth) && {\n '--side-nav-width-expanded':\n typeof expandedWidth === 'string'\n ? expandedWidth\n : `${expandedWidth}px`,\n }),\n };\n\n const mergedRef = useMergeRefs([ref, rootRef]);\n\n const collapseTransitionDuration = Number.parseInt(\n tokens.motion.duration.quick,\n 10,\n );\n\n useEffect(() => {\n return () => {\n if (collapseTransitionTimeoutRef.current !== null) {\n clearTimeout(collapseTransitionTimeoutRef.current);\n collapseTransitionTimeoutRef.current = null;\n }\n };\n }, []);\n\n return (\n <SideNavContext.Provider\n value={{\n isExpanded,\n isHovered: isFloatingExpanded, // needs refactoring\n onPinButtonClick,\n shouldOverlayOnInteraction,\n }}\n >\n <div\n className={classes}\n ref={mergedRef}\n style={customStyle}\n onMouseEnter={() => {\n if (collapseTransitionTimeoutRef.current !== null) {\n clearTimeout(collapseTransitionTimeoutRef.current);\n collapseTransitionTimeoutRef.current = null;\n }\n setIsCollapseTransitioning(false);\n setIsHovered(true);\n }}\n onMouseLeave={() => {\n const shouldDelayZIndexRemoval =\n shouldOverlayOnInteraction &&\n !isExpanded &&\n (isHovered || hasFocusVisible);\n setIsHovered(false);\n if (shouldDelayZIndexRemoval) {\n if (collapseTransitionTimeoutRef.current !== null) {\n clearTimeout(collapseTransitionTimeoutRef.current);\n }\n setIsCollapseTransitioning(true);\n collapseTransitionTimeoutRef.current = setTimeout(() => {\n collapseTransitionTimeoutRef.current = null;\n setIsCollapseTransitioning(false);\n }, collapseTransitionDuration);\n }\n }}\n onFocusCapture={() => {\n // Delay slightly to let Composite's focus management settle\n requestAnimationFrame(() => {\n const activeElement = document.activeElement;\n // Check if focus is inside and visible (using :focus-visible on the active element)\n if (\n activeElement instanceof HTMLElement &&\n rootRef.current !== null &&\n rootRef.current.contains(activeElement) &&\n activeElement.matches(':focus-visible')\n ) {\n // Update state after another frame to let focus fully settle\n // This updates the context for consumers without disrupting focus\n requestAnimationFrame(() => {\n setHasFocusVisible(true);\n });\n }\n });\n }}\n onBlurCapture={() => {\n // Small delay to check if focus moved to another element inside\n requestAnimationFrame(() => {\n const activeElement = document.activeElement;\n const isInsideNav =\n activeElement instanceof HTMLElement &&\n rootRef.current !== null &&\n rootRef.current.contains(activeElement);\n // Check if focus is in a portaled floating menu\n const isInsideFloatingMenu =\n activeElement instanceof HTMLElement &&\n activeElement.closest('.ndl-side-nav-popover') !== null;\n\n if (\n (isInsideNav || isInsideFloatingMenu) &&\n activeElement instanceof HTMLElement &&\n activeElement.matches(':focus-visible')\n ) {\n // Focus stayed inside with focus-visible\n setHasFocusVisible(true);\n } else {\n // Focus left - collapse\n setHasFocusVisible(false);\n }\n });\n }}\n {...restProps}\n {...htmlAttributes}\n >\n <div className={innerClasses}>\n {/* Both the nav landmark and the Menubar get the same label following the\n WAI-ARIA pattern for Menubar:\n https://www.w3.org/WAI/ARIA/apg/patterns/menubar/examples/menubar-navigation */}\n <nav className=\"ndl-side-nav-nav\" aria-label={ariaLabel}>\n <Composite\n render={<ul />}\n aria-label={ariaLabel}\n role=\"menubar\"\n orientation=\"vertical\"\n aria-orientation=\"vertical\"\n className=\"ndl-side-nav-list\"\n loop={true}\n >\n {children}\n </Composite>\n </nav>\n {shouldOverlayOnInteraction === true && (\n <div className=\"ndl-side-nav-footer\">\n <PinButton />\n </div>\n )}\n </div>\n </div>\n </SideNavContext.Provider>\n );\n};\n\n/**\n * SideNavListItem\n */\nconst SideNavListItem = ({\n children,\n className,\n style,\n htmlAttributes,\n ref,\n ...restProps\n}: CommonProps<'li', SideNavListItemProps>) => {\n const classes = classNames('ndl-side-nav-list-item', className, {});\n\n return (\n <li\n role=\"none\"\n className={classes}\n style={style}\n ref={ref}\n {...restProps}\n {...htmlAttributes}\n >\n <SelectedIndicator />\n {children}\n </li>\n );\n};\n\n/**\n * NavItem\n */\nconst NavItem = <T extends React.ElementType = 'button'>({\n icon,\n label,\n trailingElement,\n isActive,\n className,\n style,\n htmlAttributes,\n as,\n badge,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, NavItemProps>) => {\n const { isExpanded, isHovered, shouldOverlayOnInteraction } =\n useSideNavContext();\n const categoryContext = useSideNavCategoryContext();\n const isInCategory = categoryContext !== null;\n\n const item = useListItem();\n const mergedRef = useMergeRefs([item.ref, ref]);\n\n const isActiveIndex = item.index === categoryContext?.activeIndex;\n\n const Component: React.ElementType = as ?? 'button';\n const classes = classNames('ndl-side-nav-nav-item', className, {\n 'ndl-active': isActive === true,\n });\n\n const Wrapper = isInCategory ? Component : CompositeItem;\n const componentProps = {\n className: classes,\n ref: mergedRef,\n role: 'menuitem',\n style: style,\n ...(isInCategory && {\n ...categoryContext?.getItemProps(),\n tabIndex: isActiveIndex ? 0 : -1,\n }),\n ...restProps,\n ...htmlAttributes,\n };\n const wrapperProps = isInCategory\n ? componentProps\n : {\n render: <Component {...componentProps} />,\n };\n\n return (\n <ConditionalWrap\n shouldWrap={\n isExpanded === false &&\n !shouldOverlayOnInteraction &&\n !isInCategory &&\n Boolean(label)\n }\n wrap={(children) => (\n <Tooltip\n type=\"simple\"\n placement=\"right\"\n hoverDelay={{ close: 0, open: shouldOverlayOnInteraction ? 100 : 0 }}\n >\n <Tooltip.Trigger hasButtonWrapper={true}>{children}</Tooltip.Trigger>\n <Tooltip.Content>{label}</Tooltip.Content>\n </Tooltip>\n )}\n >\n <Wrapper {...wrapperProps}>\n <div className=\"ndl-side-nav-item-inner\">\n {Boolean(icon) && (\n <div className=\"ndl-side-nav-item-leading-element\">\n <ConditionalWrap\n shouldWrap={Boolean(badge) && !isHovered && !isExpanded}\n wrap={(children) => (\n <IconIndicatorWrapper type={badge?.type ?? 'info'}>\n {children}\n </IconIndicatorWrapper>\n )}\n >\n {icon}\n </ConditionalWrap>\n </div>\n )}\n {Boolean(label) && (\n <Typography\n variant=\"body-medium\"\n as=\"div\"\n className=\"ndl-side-nav-item-label\"\n >\n {label}\n </Typography>\n )}\n {(Boolean(trailingElement) || Boolean(badge)) && (\n <div className=\"ndl-side-nav-item-trailing-element\">\n {trailingElement}\n {badge !== undefined && (\n <ItemBadge type={badge.type} number={badge.number} />\n )}\n </div>\n )}\n </div>\n </Wrapper>\n </ConditionalWrap>\n );\n};\n\n/**\n * CategoryItem\n */\nconst CategoryItem = ({\n children,\n icon,\n label,\n isActive,\n className,\n style,\n htmlAttributes,\n badge,\n isMenuOpen = false,\n ref,\n ...restProps\n}: CommonProps<'button', CategoryItemProps>) => {\n const floatingId = useId();\n const { isExpanded, isHovered, shouldOverlayOnInteraction } =\n useSideNavContext();\n const anchorRef = useRef<HTMLLIElement>(null);\n const [isOpen, setIsOpen] = useState(false);\n const [activeIndex, setActiveIndex] = useState<number | null>(null);\n const [isTooltipOpen, setIsTooltipOpen] = useState(false);\n const elementsRef = useRef<\n Array<HTMLButtonElement | HTMLAnchorElement | null>\n >([]);\n\n const classes = classNames('ndl-side-nav-category-item', className, {\n 'ndl-active': isActive === true,\n });\n\n // Floating UI setup\n const { refs, context } = useFloating({\n elements: {\n reference: anchorRef.current,\n },\n middleware: [\n offset(5),\n flip({ crossAxis: true, fallbackAxisSideDirection: 'end', padding: 5 }),\n shift({ padding: 5 }),\n ],\n onOpenChange: setIsOpen,\n open: isOpen || isMenuOpen,\n placement: 'right-start',\n strategy: 'fixed',\n whileElementsMounted: autoUpdate,\n });\n\n const dismiss = useDismiss(context, {\n referencePress: false,\n });\n const hover = useHover(context, {\n delay: { close: 130, open: 130 },\n handleClose: safePolygon({\n blockPointerEvents: false,\n requireIntent: false,\n }),\n });\n const focus = useFocus(context);\n const listNavigation = useListNavigation(context, {\n activeIndex: activeIndex,\n focusItemOnHover: false,\n focusItemOnOpen: false,\n listRef: elementsRef,\n loop: true,\n nested: true,\n onNavigate: setActiveIndex,\n openOnArrowKeyDown: false,\n });\n\n // Separate interactions: reference (no listNavigation), floating (with listNavigation)\n const refInteractions = useInteractions([dismiss, hover, focus]);\n const floatInteractions = useInteractions([dismiss, hover, listNavigation]);\n const { styles: transitionStyles } = useTransitionStyles(context, {\n duration: Number.parseInt(tokens.motion.duration.quick) ?? 0,\n });\n\n // Reset activeIndex when menu closes\n useEffect(() => {\n if (!context.open) {\n setActiveIndex(null);\n }\n }, [context.open]);\n\n const mergedRef = useMergeRefs([refs.setReference, ref]);\n\n return (\n <SideNavCategoryContext.Provider\n value={{\n activeIndex,\n getItemProps: floatInteractions.getItemProps,\n }}\n >\n <ConditionalWrap\n shouldWrap={\n isExpanded === false && !shouldOverlayOnInteraction && Boolean(label)\n }\n wrap={(children) => (\n <Tooltip\n type=\"simple\"\n placement=\"top\"\n hoverDelay={{\n close: 0,\n open: shouldOverlayOnInteraction ? 100 : 0,\n }}\n isOpen={isTooltipOpen}\n onOpenChange={setIsTooltipOpen}\n >\n <Tooltip.Trigger hasButtonWrapper={true}>\n {children}\n </Tooltip.Trigger>\n <Tooltip.Content className=\"ndl-side-nav ndl-side-nav-category-menu-tooltip-content\">\n {label}\n </Tooltip.Content>\n </Tooltip>\n )}\n >\n <CompositeItem\n render={\n <button\n type=\"button\"\n {...refInteractions.getReferenceProps({\n className: classes,\n ref: mergedRef,\n style,\n ...restProps,\n ...htmlAttributes,\n })}\n // {...restProps}\n // {...htmlAttributes}\n role=\"menuitem\"\n aria-haspopup=\"menu\"\n aria-expanded={context.open}\n aria-controls={floatingId}\n onFocus={(event) => {\n // Only show tooltip on focus-visible (keyboard navigation)\n if (\n event.target instanceof HTMLElement &&\n event.target.matches(':focus-visible')\n ) {\n setIsTooltipOpen(true);\n }\n // Call original handler if exists\n const originalOnFocus = refInteractions.getReferenceProps({})\n .onFocus as\n | ((event: React.FocusEvent<HTMLButtonElement>) => void)\n | undefined;\n originalOnFocus?.(event);\n }}\n onBlur={(event) => {\n setIsTooltipOpen(false);\n // Call original handler if exists\n const originalOnBlur = refInteractions.getReferenceProps({})\n .onBlur as\n | ((event: React.FocusEvent<HTMLButtonElement>) => void)\n | undefined;\n originalOnBlur?.(event);\n }}\n onKeyDown={(event) => {\n if (event.key === 'ArrowRight') {\n // open and move focus into submenu\n setIsOpen(true);\n setActiveIndex(0);\n // Defer focusing first item (if needed) to next tick\n requestAnimationFrame(() => {\n const el = elementsRef.current[0];\n el?.focus();\n });\n event.preventDefault();\n }\n // ArrowDown/ArrowUp: let Composite handle top-level roving focus.\n }}\n />\n }\n >\n <div className=\"ndl-side-nav-item-inner\">\n {Boolean(icon) && (\n <div className=\"ndl-side-nav-item-leading-element\">\n <ConditionalWrap\n shouldWrap={Boolean(badge) && !isHovered && !isExpanded}\n wrap={(children) => (\n <IconIndicatorWrapper type={badge?.type ?? 'info'}>\n {children}\n </IconIndicatorWrapper>\n )}\n >\n {icon}\n </ConditionalWrap>\n </div>\n )}\n {Boolean(label) && (\n <Typography\n variant=\"body-medium\"\n as=\"div\"\n className=\"ndl-side-nav-item-label\"\n >\n {label}\n </Typography>\n )}\n <div className=\"ndl-side-nav-item-trailing-element\">\n {badge && <ItemBadge type={badge.type} number={badge.number} />}\n <ChevronRightIconOutline className=\"ndl-side-nav-item-chevron\" />\n </div>\n </div>\n {context.open && (\n <FloatingList elementsRef={elementsRef}>\n <FloatingPortal>\n <FloatingFocusManager\n context={context}\n modal={false}\n initialFocus={-1}\n returnFocus={true}\n closeOnFocusOut={true}\n guards={true}\n >\n <ul\n id={floatingId}\n ref={refs.setFloating}\n className=\"ndl-side-nav ndl-side-nav-popover ndl-side-nav-popover-list\"\n style={{\n ...context.floatingStyles,\n ...transitionStyles,\n }}\n {...floatInteractions.getFloatingProps()}\n role=\"menu\"\n >\n {children}\n </ul>\n </FloatingFocusManager>\n </FloatingPortal>\n </FloatingList>\n )}\n </CompositeItem>\n </ConditionalWrap>\n </SideNavCategoryContext.Provider>\n );\n};\n\n/**\n * CategoryHeader\n */\nconst CategoryHeader = ({\n children,\n className,\n ref,\n style,\n htmlAttributes,\n ...restProps\n}: CommonProps<'li', CategoryHeaderProps>) => {\n const { isExpanded, isHovered } = useSideNavContext();\n\n const classes = classNames('ndl-side-nav-category-header', className, {\n 'ndl-side-nav-category-header-expanded': isExpanded || isHovered,\n });\n\n return (\n <Typography\n ref={ref}\n variant=\"label\"\n as=\"li\"\n className={classes}\n htmlAttributes={{\n ...htmlAttributes,\n role: 'separator',\n }}\n style={style}\n {...restProps}\n >\n {isExpanded || isHovered ? children : <Divider />}\n </Typography>\n );\n};\n\n/**\n * SelectedIndicator\n */\nconst SelectedIndicator = () => {\n return <div className=\"ndl-side-nav-selected-indicator\" />;\n};\n\n/**\n * SideNavDivider\n */\nconst SideNavDivider = () => {\n return (\n <Divider\n orientation=\"horizontal\"\n className=\"ndl-side-nav-divider\"\n as=\"li\"\n />\n );\n};\n\n/**\n * ItemBadge\n */\nconst ItemBadge = ({\n number,\n type,\n ref,\n htmlAttributes,\n style,\n className,\n ...restProps\n}: CommonProps<'span', ItemBadgeProps>) => {\n useSideNavContext();\n\n const badgeClasses = classNames('ndl-side-nav-item-badge', className, {\n 'ndl-danger': type === 'danger',\n 'ndl-info': type === 'info',\n 'ndl-warning': type === 'warning',\n });\n\n return (\n <Typography\n as=\"span\"\n className={badgeClasses}\n variant=\"subheading-small\"\n htmlAttributes={{\n 'aria-label': `${number} notifications of type ${type}`,\n ...htmlAttributes,\n }}\n style={style}\n ref={ref}\n {...restProps}\n >\n {number}\n </Typography>\n );\n};\n\n/**\n * PinButton\n */\nconst PinButton = () => {\n const { isExpanded, shouldOverlayOnInteraction, onPinButtonClick } =\n useSideNavContext();\n\n const classes = classNames('ndl-side-nav-pin-button');\n\n if (!shouldOverlayOnInteraction) {\n return null;\n }\n\n return (\n <CleanIconButton\n onClick={onPinButtonClick}\n className={classes}\n description=\"Pin\"\n size=\"medium\"\n isActive={isExpanded}\n tooltipProps={{\n root: {\n autoUpdateOptions: {\n animationFrame: true,\n },\n placement: 'right',\n },\n }}\n >\n <PinIcon />\n </CleanIconButton>\n );\n};\n\nconst SideNavigation = Object.assign(SideNavComponent, {\n CategoryHeader: CategoryHeader,\n CategoryItem: CategoryItem,\n Divider: SideNavDivider,\n ItemBadge: ItemBadge,\n ListItem: SideNavListItem,\n NavItem,\n});\n\nexport { SideNavigation };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8EE;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;;;CA0KA;CACA;CACA;CACA;CACA;;;CAwBA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;;;CAmGA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;;;CAqOA;CACA;CACA;CACA;CACA;;;CAmDA;CACA;CACA;CACA;CACA;CACA;;;;;AAtmBF,MAAM,oBAAoB,SAYc;CAZd,IAAA,EACxB,UACA,WACA,OACA,gBACA,aAAa,OACb,6BAA6B,MAC7B,WACA,kBACA,eACA,QAAA,MACG,YAAA,yBAAA,MAAA,SAAA;CAEH,MAAM,CAAC,WAAW,gBAAgB,SAAS,KAAK;CAChD,MAAM,CAAC,iBAAiB,sBAAsB,SAAS,KAAK;CAC5D,MAAM,CAAC,yBAAyB,8BAA8B,SAAS,KAAK;CAC5E,MAAM,+BAA+B,OAE3B,IAAI;CAEd,MAAM,UAAU,OAAuB,IAAI;CAE3C,MAAM,qBACJ,+BAA+B,CAAC,YAAY,kBAAkB;CAEhE,MAAM,UAAU,WAAW,gBAAgB,q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EACF;EAEA,UAAA,oBAACA,QAAD,CAAU,CAAA;CACK,CAAA;AAErB;AAEA,MAAM,iBAAiB,OAAO,OAAO,kBAAkB;CACrC;CACF;CACd,SAAS;CACE;CACX,UAAU;CACV;AACF,CAAC"}
@@ -75,7 +75,7 @@ const TextInput = (_ref) => {
75
75
  state: value !== null && value !== void 0 ? value : ""
76
76
  });
77
77
  const hintId = useId();
78
- const canClear = isClearable && isDisabled !== true;
78
+ const canClear = isClearable && isDisabled !== true && isReadOnly !== true;
79
79
  const shouldRenderHint = canClear || isLoading;
80
80
  const { field, controlProps } = useFormField({
81
81
  errorText,
@@ -1 +1 @@
1
- {"version":3,"file":"TextInput.mjs","names":[],"sources":["../../../src/text-input/TextInput.tsx"],"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 classNames from 'classnames';\nimport {\n type InputHTMLAttributes,\n type ReactElement,\n type ReactNode,\n useId,\n useMemo,\n} from 'react';\n\nimport {\n FormFieldLabel,\n FormFieldMessage,\n useFormField,\n} from '../_common/form-control';\nimport { customLabelAndNoAriaLabelWarningMessage } from '../_common/messages';\nimport { type CommonProps, type TooltipObjectProps } from '../_common/types';\nimport { useSemiControlledInput } from '../_common/use-semi-controlled-input';\nimport { needleWarningMessage } from '../_common/utils';\nimport { XMarkIconOutline } from '../icons/generated/heroIcons/XMarkIconOutline';\nimport { LoadingSpinner } from '../loading-spinner';\nimport { Skeleton } from '../skeleton';\n\n/**\n * @remarks\n * When `moreInformationText` is provided, a tooltip is rendered next to the label, and the `tooltipProps` prop is used to configure the tooltip. The `TooltipObjectProps` type is defined as: `{ root?: Partial<React.ComponentProps<typeof Tooltip>>; trigger?: Partial<React.ComponentProps<typeof Tooltip.Trigger>>; content?: Partial<React.ComponentProps<typeof Tooltip.Content>>; }`, see the Tooltip component for more details.\n *\n * @remarks\n * When `isSkeletonLoading` is true, the input is rendered as a loading skeleton and the `skeletonProps` prop is used to configure the skeleton. For more information, see the Skeleton documentation.\n */\ntype TextInputProps = {\n /** Assistive text displayed below the input */\n helpText?: string | ReactNode;\n\n /** Error message displayed below the input. When provided, it overrides `helpText` and shows an error icon */\n errorText?: string | ReactNode;\n\n /** Leading element rendered inside the input */\n leadingElement?: ReactElement;\n\n /** Trailing element rendered inside the input */\n trailingElement?: ReactElement;\n\n /** Size of the input */\n size?: 'small' | 'medium' | 'large';\n\n /** Whether the input is read-only */\n isReadOnly?: boolean;\n\n /**\n * Whether to display the Required/Optional label next to the field label.\n * Shows Required if isRequired is true, otherwise shows Optional.\n * @default false\n */\n // TODO: inconsistent naming. The same switch is `hasRequiredIndicator` on\n // Combobox and on the internal form control this maps onto, and `isOptional`\n // on TextArea. The name also needs the disable below, which a name using one\n // of the allowed boolean prefixes would not.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n showRequiredOrOptionalLabel?: boolean;\n\n /** Whether the input is disabled */\n isDisabled?: boolean;\n\n /** Whether the input is required */\n isRequired?: boolean;\n\n /** The current value of the input */\n value?: React.ComponentPropsWithoutRef<'input'>['value'];\n\n /** Placeholder text displayed when the input is empty */\n placeholder?: React.ComponentPropsWithoutRef<'input'>['placeholder'];\n\n /** Callback function triggered when the input value changes */\n onChange?: React.ComponentPropsWithoutRef<'input'>['onChange'];\n\n /** Whether the input should take the full available width */\n isFluid?: boolean;\n\n /** Text displayed in the information tooltip shown next to the label */\n moreInformationText?: React.ReactNode;\n\n // TODO v5: inconsistent naming. Every form control names itself differently:\n // the label is optional here and a design with no room for it reaches for\n // htmlAttributes['aria-label'], TextArea, Select, Checkbox, Radio and Switch\n // expose an `ariaLabel` prop instead, and Combobox requires the label and\n // clips it with `hasVisuallyHiddenLabel`.\n /** The label displayed above the input */\n label?: string | React.ReactNode;\n\n /** Props for the Tooltip component used by the information icon */\n tooltipProps?: TooltipObjectProps;\n\n /** Whether to render skeletons instead of content */\n isSkeletonLoading?: boolean;\n\n /** Additional props forwarded to the underlying Skeleton components */\n skeletonProps?: React.ComponentProps<typeof Skeleton>;\n\n /** Whether to show the clear button */\n isClearable?: boolean;\n\n /** Whether to show the loading spinner */\n isLoading?: boolean;\n};\n\n/**\n *\n *\n * TextInput Component\n *\n *\n */\n\nexport const TextInput = ({\n label,\n isFluid,\n errorText,\n helpText,\n leadingElement,\n trailingElement,\n showRequiredOrOptionalLabel = false,\n moreInformationText,\n size = 'medium',\n placeholder,\n value,\n tooltipProps,\n htmlAttributes,\n isDisabled,\n isReadOnly,\n isRequired,\n onChange,\n isClearable = false,\n className,\n style,\n isSkeletonLoading = false,\n isLoading = false,\n skeletonProps,\n ref,\n ...restProps\n}: CommonProps<'input', TextInputProps>) => {\n const [currentValue, handleChange] = useSemiControlledInput({\n inputType: 'text',\n isControlled: value !== undefined,\n onChange,\n state: value ?? '',\n });\n const hintId = useId();\n const canClear = isClearable && isDisabled !== true;\n const shouldRenderHint = canClear || isLoading;\n const { field, controlProps } = useFormField({\n errorText,\n // The clear/loading hint describes the input alongside the message.\n extraDescribedByIds: [shouldRenderHint && hintId],\n hasRequiredIndicator: showRequiredOrOptionalLabel,\n helpText,\n isRequired,\n label,\n });\n\n const containerWrappingClasses = classNames(`ndl-text-input`, className, {\n 'ndl-disabled': isDisabled,\n 'ndl-has-error': errorText,\n 'ndl-has-icon': leadingElement || trailingElement || errorText,\n 'ndl-has-leading-icon': leadingElement,\n 'ndl-has-trailing-icon': trailingElement || errorText,\n 'ndl-large': size === 'large',\n 'ndl-medium': size === 'medium',\n 'ndl-read-only': isReadOnly,\n 'ndl-small': size === 'small',\n });\n\n const hasEmptyLabelValue =\n label === undefined || label === null || label === '';\n\n const labelWrappingClasses = classNames('ndl-text-input-label', {\n 'ndl-fluid': isFluid,\n });\n\n const combinedHtmlInputAttributes: InputHTMLAttributes<HTMLInputElement> = {\n ...htmlAttributes,\n className: classNames('ndl-input', htmlAttributes?.className),\n };\n const ariaLabel = combinedHtmlInputAttributes['aria-label'];\n const isCustomLabel = Boolean(label) && typeof label !== 'string';\n const hasCustomLabelAndNoAriaLabel =\n isCustomLabel && (ariaLabel === undefined || ariaLabel === '');\n\n const handleInputKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (canClear && event.key === 'Escape' && Boolean(currentValue)) {\n event.preventDefault();\n event.stopPropagation();\n handleChange?.({\n target: { value: '' },\n } as React.ChangeEvent<HTMLInputElement>);\n }\n htmlAttributes?.onKeyDown?.(event);\n };\n\n useMemo(() => {\n if (!label && !ariaLabel) {\n needleWarningMessage(\n 'A TextInput without a label does not have an aria label, be sure to include an aria label for screen readers. Link: https://dequeuniversity.com/rules/axe/4.2/label?application=axeAPI',\n );\n }\n\n if (hasCustomLabelAndNoAriaLabel) {\n needleWarningMessage(customLabelAndNoAriaLabelWarningMessage);\n }\n }, [label, ariaLabel, hasCustomLabelAndNoAriaLabel]);\n\n return (\n <div className={containerWrappingClasses} style={style}>\n {/* We enable implicit label wrapping */}\n {/* Source: https://dequeuniversity.com/rules/axe/4.2/label?application=axeAPI */}\n <label className={labelWrappingClasses}>\n {!hasEmptyLabelValue && (\n <FormFieldLabel\n field={field}\n size={size}\n association=\"implicit\"\n moreInformationText={moreInformationText}\n tooltipProps={tooltipProps}\n wrap={(row) => (\n <Skeleton\n onBackground=\"weak\"\n shape=\"rectangular\"\n {...skeletonProps}\n isLoading={isSkeletonLoading}\n >\n {row}\n </Skeleton>\n )}\n />\n )}\n <Skeleton\n onBackground=\"weak\"\n shape=\"rectangular\"\n {...skeletonProps}\n isLoading={isSkeletonLoading}\n >\n <div className=\"ndl-input-wrapper\">\n {(leadingElement || (isLoading && !trailingElement)) && (\n <div className=\"ndl-element-leading ndl-element\">\n {isLoading ? (\n <LoadingSpinner\n size={size === 'large' ? 'medium' : 'small'}\n className={\n size === 'large'\n ? 'ndl-medium-spinner'\n : 'ndl-small-spinner'\n }\n />\n ) : (\n leadingElement\n )}\n </div>\n )}\n <div\n className={classNames('ndl-input-container', {\n 'ndl-clearable': isClearable,\n })}\n >\n <input\n ref={ref}\n readOnly={isReadOnly}\n disabled={isDisabled}\n required={isRequired}\n value={currentValue}\n placeholder={placeholder}\n type=\"text\"\n onChange={handleChange}\n {...controlProps}\n {...combinedHtmlInputAttributes}\n onKeyDown={handleInputKeyDown}\n {...restProps}\n />\n {shouldRenderHint && (\n <span\n id={hintId}\n className=\"ndl-text-input-hint\"\n aria-hidden={true}\n >\n {isLoading && 'Loading '}\n {canClear && 'Press Escape to clear input.'}\n </span>\n )}\n {canClear && Boolean(currentValue) && (\n <div className=\"ndl-element-clear ndl-element\">\n <button\n tabIndex={-1}\n aria-hidden={true}\n type=\"button\"\n title=\"Clear input (Esc)\"\n onClick={() => {\n handleChange?.({\n target: { value: '' },\n } as React.ChangeEvent<HTMLInputElement>);\n }}\n >\n <XMarkIconOutline />\n </button>\n </div>\n )}\n </div>\n {trailingElement && (\n <div className=\"ndl-element-trailing ndl-element\">\n {isLoading && !leadingElement ? (\n <LoadingSpinner\n size={size === 'large' ? 'medium' : 'small'}\n className={\n size === 'large'\n ? 'ndl-medium-spinner'\n : 'ndl-small-spinner'\n }\n />\n ) : (\n trailingElement\n )}\n </div>\n )}\n </div>\n </Skeleton>\n </label>\n\n <FormFieldMessage\n field={field}\n size={size}\n wrap={(content) => (\n <Skeleton\n onBackground=\"weak\"\n shape=\"rectangular\"\n {...skeletonProps}\n isLoading={isSkeletonLoading}\n >\n {content}\n </Skeleton>\n )}\n />\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AW,uBAAuB,EAC3C,iBAAiB,YACnB,CAAC;OAHH,UAAA;QAKE,oBAAC,SAAA,eAAA,eAAA,eAAA;SACM;SACL,UAAU;SACV,UAAU;SACV,UAAU;SACV,OAAO;SACM;SACb,MAAK;SACL,UAAU;QACN,GAAA,YAAA,GACA,2BAAA,GAAA,CAAA,GAAA,EACJ,WAAW,mBAAA,GACP,SACL,CAAA;QACA,oBACC,qBAAC,QAAD;SACE,IAAI;SACJ,WAAU;SACV,eAAa;SAHf,UAAA,CAKG,aAAa,YACb,YAAY,8BACT;;QAEP,YAAY,QAAQ,YAAY,KAC/B,oBAAC,OAAD;SAAK,WAAU;SACb,UAAA,oBAAC,UAAD;UACE,UAAU;UACV,eAAa;UACb,MAAK;UACL,OAAM;UACN,eAAe;WACb,iBAAA,QAAA,iBAAA,KAAA,KAAA,aAAe,EACb,QAAQ,EAAE,OAAO,GAAG,EACtB,CAAwC;UAC1C;UAEA,UAAA,oBAAC,kBAAD,CAAmB,CAAA;SACb,CAAA;QACL,CAAA;OAEJ;;MACJ,mBACC,oBAAC,OAAD;OAAK,WAAU;OACZ,UAAA,aAAa,CAAC,iBACb,oBAAC,gBAAD;QACE,MAAM,SAAS,UAAU,WAAW;QACpC,WACE,SAAS,UACL,uBACA;OAEP,CAAA,IAED;MAEC,CAAA;KAEJ;;GACG,CAAA,CAAA,CACL;EAEP,CAAA,GAAA,oBAAC,kBAAD;GACS;GACD;GACN,OAAO,YACL,oBAAC,UAAA,eAAA,eAAA;IACC,cAAa;IACb,OAAM;GACF,GAAA,aAAA,GAAA,CAAA,GAAA;IACJ,WAAW;IAEV,UAAA;GACO,CAAA,CAAA;EAEb,CAAA,CACE;;AAET"}
1
+ {"version":3,"file":"TextInput.mjs","names":[],"sources":["../../../src/text-input/TextInput.tsx"],"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 classNames from 'classnames';\nimport {\n type InputHTMLAttributes,\n type ReactElement,\n type ReactNode,\n useId,\n useMemo,\n} from 'react';\n\nimport {\n FormFieldLabel,\n FormFieldMessage,\n useFormField,\n} from '../_common/form-control';\nimport { customLabelAndNoAriaLabelWarningMessage } from '../_common/messages';\nimport { type CommonProps, type TooltipObjectProps } from '../_common/types';\nimport { useSemiControlledInput } from '../_common/use-semi-controlled-input';\nimport { needleWarningMessage } from '../_common/utils';\nimport { XMarkIconOutline } from '../icons/generated/heroIcons/XMarkIconOutline';\nimport { LoadingSpinner } from '../loading-spinner';\nimport { Skeleton } from '../skeleton';\n\n/**\n * @remarks\n * When `moreInformationText` is provided, a tooltip is rendered next to the label, and the `tooltipProps` prop is used to configure the tooltip. The `TooltipObjectProps` type is defined as: `{ root?: Partial<React.ComponentProps<typeof Tooltip>>; trigger?: Partial<React.ComponentProps<typeof Tooltip.Trigger>>; content?: Partial<React.ComponentProps<typeof Tooltip.Content>>; }`, see the Tooltip component for more details.\n *\n * @remarks\n * When `isSkeletonLoading` is true, the input is rendered as a loading skeleton and the `skeletonProps` prop is used to configure the skeleton. For more information, see the Skeleton documentation.\n */\ntype TextInputProps = {\n /** Assistive text displayed below the input */\n helpText?: string | ReactNode;\n\n /** Error message displayed below the input. When provided, it overrides `helpText` and shows an error icon */\n errorText?: string | ReactNode;\n\n /** Leading element rendered inside the input */\n leadingElement?: ReactElement;\n\n /** Trailing element rendered inside the input */\n trailingElement?: ReactElement;\n\n /** Size of the input */\n size?: 'small' | 'medium' | 'large';\n\n /** Whether the input is read-only */\n isReadOnly?: boolean;\n\n /**\n * Whether to display the Required/Optional label next to the field label.\n * Shows Required if isRequired is true, otherwise shows Optional.\n * @default false\n */\n // TODO: inconsistent naming. The same switch is `hasRequiredIndicator` on\n // Combobox and on the internal form control this maps onto, and `isOptional`\n // on TextArea. The name also needs the disable below, which a name using one\n // of the allowed boolean prefixes would not.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n showRequiredOrOptionalLabel?: boolean;\n\n /** Whether the input is disabled */\n isDisabled?: boolean;\n\n /** Whether the input is required */\n isRequired?: boolean;\n\n /** The current value of the input */\n value?: React.ComponentPropsWithoutRef<'input'>['value'];\n\n /** Placeholder text displayed when the input is empty */\n placeholder?: React.ComponentPropsWithoutRef<'input'>['placeholder'];\n\n /** Callback function triggered when the input value changes */\n onChange?: React.ComponentPropsWithoutRef<'input'>['onChange'];\n\n /** Whether the input should take the full available width */\n isFluid?: boolean;\n\n /** Text displayed in the information tooltip shown next to the label */\n moreInformationText?: React.ReactNode;\n\n // TODO v5: inconsistent naming. Every form control names itself differently:\n // the label is optional here and a design with no room for it reaches for\n // htmlAttributes['aria-label'], TextArea, Select, Checkbox, Radio and Switch\n // expose an `ariaLabel` prop instead, and Combobox requires the label and\n // clips it with `hasVisuallyHiddenLabel`.\n /** The label displayed above the input */\n label?: string | React.ReactNode;\n\n /** Props for the Tooltip component used by the information icon */\n tooltipProps?: TooltipObjectProps;\n\n /** Whether to render skeletons instead of content */\n isSkeletonLoading?: boolean;\n\n /** Additional props forwarded to the underlying Skeleton components */\n skeletonProps?: React.ComponentProps<typeof Skeleton>;\n\n /** Whether to show the clear button */\n isClearable?: boolean;\n\n /** Whether to show the loading spinner */\n isLoading?: boolean;\n};\n\n/**\n *\n *\n * TextInput Component\n *\n *\n */\n\nexport const TextInput = ({\n label,\n isFluid,\n errorText,\n helpText,\n leadingElement,\n trailingElement,\n showRequiredOrOptionalLabel = false,\n moreInformationText,\n size = 'medium',\n placeholder,\n value,\n tooltipProps,\n htmlAttributes,\n isDisabled,\n isReadOnly,\n isRequired,\n onChange,\n isClearable = false,\n className,\n style,\n isSkeletonLoading = false,\n isLoading = false,\n skeletonProps,\n ref,\n ...restProps\n}: CommonProps<'input', TextInputProps>) => {\n const [currentValue, handleChange] = useSemiControlledInput({\n inputType: 'text',\n isControlled: value !== undefined,\n onChange,\n state: value ?? '',\n });\n const hintId = useId();\n const canClear = isClearable && isDisabled !== true && isReadOnly !== true;\n const shouldRenderHint = canClear || isLoading;\n const { field, controlProps } = useFormField({\n errorText,\n // The clear/loading hint describes the input alongside the message.\n extraDescribedByIds: [shouldRenderHint && hintId],\n hasRequiredIndicator: showRequiredOrOptionalLabel,\n helpText,\n isRequired,\n label,\n });\n\n const containerWrappingClasses = classNames(`ndl-text-input`, className, {\n 'ndl-disabled': isDisabled,\n 'ndl-has-error': errorText,\n 'ndl-has-icon': leadingElement || trailingElement || errorText,\n 'ndl-has-leading-icon': leadingElement,\n 'ndl-has-trailing-icon': trailingElement || errorText,\n 'ndl-large': size === 'large',\n 'ndl-medium': size === 'medium',\n 'ndl-read-only': isReadOnly,\n 'ndl-small': size === 'small',\n });\n\n const hasEmptyLabelValue =\n label === undefined || label === null || label === '';\n\n const labelWrappingClasses = classNames('ndl-text-input-label', {\n 'ndl-fluid': isFluid,\n });\n\n const combinedHtmlInputAttributes: InputHTMLAttributes<HTMLInputElement> = {\n ...htmlAttributes,\n className: classNames('ndl-input', htmlAttributes?.className),\n };\n const ariaLabel = combinedHtmlInputAttributes['aria-label'];\n const isCustomLabel = Boolean(label) && typeof label !== 'string';\n const hasCustomLabelAndNoAriaLabel =\n isCustomLabel && (ariaLabel === undefined || ariaLabel === '');\n\n const handleInputKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (canClear && event.key === 'Escape' && Boolean(currentValue)) {\n event.preventDefault();\n event.stopPropagation();\n handleChange?.({\n target: { value: '' },\n } as React.ChangeEvent<HTMLInputElement>);\n }\n htmlAttributes?.onKeyDown?.(event);\n };\n\n useMemo(() => {\n if (!label && !ariaLabel) {\n needleWarningMessage(\n 'A TextInput without a label does not have an aria label, be sure to include an aria label for screen readers. Link: https://dequeuniversity.com/rules/axe/4.2/label?application=axeAPI',\n );\n }\n\n if (hasCustomLabelAndNoAriaLabel) {\n needleWarningMessage(customLabelAndNoAriaLabelWarningMessage);\n }\n }, [label, ariaLabel, hasCustomLabelAndNoAriaLabel]);\n\n return (\n <div className={containerWrappingClasses} style={style}>\n {/* We enable implicit label wrapping */}\n {/* Source: https://dequeuniversity.com/rules/axe/4.2/label?application=axeAPI */}\n <label className={labelWrappingClasses}>\n {!hasEmptyLabelValue && (\n <FormFieldLabel\n field={field}\n size={size}\n association=\"implicit\"\n moreInformationText={moreInformationText}\n tooltipProps={tooltipProps}\n wrap={(row) => (\n <Skeleton\n onBackground=\"weak\"\n shape=\"rectangular\"\n {...skeletonProps}\n isLoading={isSkeletonLoading}\n >\n {row}\n </Skeleton>\n )}\n />\n )}\n <Skeleton\n onBackground=\"weak\"\n shape=\"rectangular\"\n {...skeletonProps}\n isLoading={isSkeletonLoading}\n >\n <div className=\"ndl-input-wrapper\">\n {(leadingElement || (isLoading && !trailingElement)) && (\n <div className=\"ndl-element-leading ndl-element\">\n {isLoading ? (\n <LoadingSpinner\n size={size === 'large' ? 'medium' : 'small'}\n className={\n size === 'large'\n ? 'ndl-medium-spinner'\n : 'ndl-small-spinner'\n }\n />\n ) : (\n leadingElement\n )}\n </div>\n )}\n <div\n className={classNames('ndl-input-container', {\n 'ndl-clearable': isClearable,\n })}\n >\n <input\n ref={ref}\n readOnly={isReadOnly}\n disabled={isDisabled}\n required={isRequired}\n value={currentValue}\n placeholder={placeholder}\n type=\"text\"\n onChange={handleChange}\n {...controlProps}\n {...combinedHtmlInputAttributes}\n onKeyDown={handleInputKeyDown}\n {...restProps}\n />\n {shouldRenderHint && (\n <span\n id={hintId}\n className=\"ndl-text-input-hint\"\n aria-hidden={true}\n >\n {isLoading && 'Loading '}\n {canClear && 'Press Escape to clear input.'}\n </span>\n )}\n {canClear && Boolean(currentValue) && (\n <div className=\"ndl-element-clear ndl-element\">\n <button\n tabIndex={-1}\n aria-hidden={true}\n type=\"button\"\n title=\"Clear input (Esc)\"\n onClick={() => {\n handleChange?.({\n target: { value: '' },\n } as React.ChangeEvent<HTMLInputElement>);\n }}\n >\n <XMarkIconOutline />\n </button>\n </div>\n )}\n </div>\n {trailingElement && (\n <div className=\"ndl-element-trailing ndl-element\">\n {isLoading && !leadingElement ? (\n <LoadingSpinner\n size={size === 'large' ? 'medium' : 'small'}\n className={\n size === 'large'\n ? 'ndl-medium-spinner'\n : 'ndl-small-spinner'\n }\n />\n ) : (\n trailingElement\n )}\n </div>\n )}\n </div>\n </Skeleton>\n </label>\n\n <FormFieldMessage\n field={field}\n size={size}\n wrap={(content) => (\n <Skeleton\n onBackground=\"weak\"\n shape=\"rectangular\"\n {...skeletonProps}\n isLoading={isSkeletonLoading}\n >\n {content}\n </Skeleton>\n )}\n />\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuIE;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;;;;;;;;;AAxBF,MAAa,aAAa,SA0BkB;CA1BlB,IAAA,EACxB,OACA,SACA,WACA,UACA,gBACA,iBACA,8BAA8B,OAC9B,qBACA,OAAO,UACP,aACA,OACA,cACA,gBACA,YACA,YACA,YACA,UACA,cAAc,OACd,WACA,OACA,oBAAoB,OACpB,YAAY,OACZ,eACA,QAAA,MACG,YAAA,yBAAA,MAAA,SAAA;CAEH,MAAM,CAAC,cAAc,gBAAgB,uBAAuB;EAC1D,WAAW;EACX,cAAc,UAAU,KAAA;EACxB;EACA,OAAO,UAAA,QAAA,UAAA,KAAA,IAAA,QAAS;CAClB,CAAC;CACD,MAAM,SAAS,MAAM;CACrB,MAAM,WAAW,eAAe,eAAe,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tB,CAAwC;UAC1C;UAEA,UAAA,oBAAC,kBAAD,CAAmB,CAAA;SACb,CAAA;QACL,CAAA;OAEJ;;MACJ,mBACC,oBAAC,OAAD;OAAK,WAAU;OACZ,UAAA,aAAa,CAAC,iBACb,oBAAC,gBAAD;QACE,MAAM,SAAS,UAAU,WAAW;QACpC,WACE,SAAS,UACL,uBACA;OAEP,CAAA,IAED;MAEC,CAAA;KAEJ;;GACG,CAAA,CAAA,CACL;EAEP,CAAA,GAAA,oBAAC,kBAAD;GACS;GACD;GACN,OAAO,YACL,oBAAC,UAAA,eAAA,eAAA;IACC,cAAa;IACb,OAAM;GACF,GAAA,aAAA,GAAA,CAAA,GAAA;IACJ,WAAW;IAEV,UAAA;GACO,CAAA,CAAA;EAEb,CAAA,CACE;;AAET"}
@@ -39,6 +39,7 @@ export { ProgressBar } from './progress-bar';
39
39
  export { Dropzone } from './dropzone';
40
40
  export * from './data-grid';
41
41
  export { TextInput } from './text-input';
42
+ export { SearchField } from './search-field';
42
43
  export { TextArea } from './text-area';
43
44
  export { TextLink } from './text-link';
44
45
  export { Select } from './select';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM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AsB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,cAAc,YAAY,CAAC"}
@@ -0,0 +1,52 @@
1
+ /*!
2
+ *
3
+ * Copyright (c) "Neo4j"
4
+ * Neo4j Sweden AB [http://neo4j.com]
5
+ *
6
+ * This file is part of Neo4j.
7
+ *
8
+ * Neo4j is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
+ */
21
+ import { type ComponentProps } from 'react';
22
+ import { TextInput } from '../text-input';
23
+ type SearchFieldTextInputProps = Pick<ComponentProps<typeof TextInput>, 'className' | 'errorText' | 'helpText' | 'htmlAttributes' | 'isDisabled' | 'isFluid' | 'isLoading' | 'isReadOnly' | 'isSkeletonLoading' | 'onChange' | 'placeholder' | 'ref' | 'size' | 'skeletonProps' | 'style' | 'value'>;
24
+ export type SearchFieldProps = SearchFieldTextInputProps & {
25
+ /**
26
+ * Accessible name for the search field. The label is announced by assistive
27
+ * technologies but is not rendered visually.
28
+ */
29
+ label: string;
30
+ /**
31
+ * Called with the search query after typing pauses for `debounceDelay`, and
32
+ * immediately when the user presses Enter or clears the field.
33
+ */
34
+ onSearch?: (query: string) => void;
35
+ /**
36
+ * Delay in milliseconds before calling `onSearch` after the query changes.
37
+ * @default 500
38
+ */
39
+ debounceDelay?: number;
40
+ };
41
+ /**
42
+ * A text input for entering search queries.
43
+ *
44
+ * @remarks
45
+ * SearchField renders a fixed search icon and uses the native `search` input
46
+ * type. `onChange` is called immediately, while `onSearch` is debounced until
47
+ * typing pauses. Pressing Enter or clearing the field calls `onSearch`
48
+ * immediately.
49
+ */
50
+ export declare const SearchField: ({ debounceDelay, htmlAttributes, label, onChange, onSearch, ...textInputProps }: SearchFieldProps) => import("react/jsx-runtime").JSX.Element;
51
+ export {};
52
+ //# sourceMappingURL=SearchField.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SearchField.d.ts","sourceRoot":"","sources":["../../../src/search-field/SearchField.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAoB,KAAK,cAAc,EAAe,MAAM,OAAO,CAAC;AAI3E,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,KAAK,yBAAyB,GAAG,IAAI,CACnC,cAAc,CAAC,OAAO,SAAS,CAAC,EAC9B,WAAW,GACX,WAAW,GACX,UAAU,GACV,gBAAgB,GAChB,YAAY,GACZ,SAAS,GACT,WAAW,GACX,YAAY,GACZ,mBAAmB,GACnB,UAAU,GACV,aAAa,GACb,KAAK,GACL,MAAM,GACN,eAAe,GACf,OAAO,GACP,OAAO,CACV,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,yBAAyB,GAAG;IACzD;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAEnC;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,WAAW,GAAI,iFAOzB,gBAAgB,4CAsDlB,CAAC"}
@@ -0,0 +1,22 @@
1
+ /*!
2
+ *
3
+ * Copyright (c) "Neo4j"
4
+ * Neo4j Sweden AB [http://neo4j.com]
5
+ *
6
+ * This file is part of Neo4j.
7
+ *
8
+ * Neo4j is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
+ */
21
+ export * from './SearchField';
22
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/search-field/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,cAAc,eAAe,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neo4j-ndl/react",
3
- "version": "5.6.3",
3
+ "version": "5.7.0",
4
4
  "sideEffects": false,
5
5
  "description": "React implementation of Neo4j Design System",
6
6
  "keywords": [
@@ -252,6 +252,11 @@
252
252
  "require": "./lib/cjs/read-only-tag/index.js",
253
253
  "import": "./lib/esm/read-only-tag/index.mjs"
254
254
  },
255
+ "./search-field": {
256
+ "types": "./lib/types/search-field/index.d.ts",
257
+ "require": "./lib/cjs/search-field/index.js",
258
+ "import": "./lib/esm/search-field/index.mjs"
259
+ },
255
260
  "./segmented-control": {
256
261
  "types": "./lib/types/segmented-control/index.d.ts",
257
262
  "require": "./lib/cjs/segmented-control/index.js",
@@ -429,7 +434,7 @@
429
434
  "@tanstack/react-table": "8.21.3",
430
435
  "react": ">=19.0.0",
431
436
  "react-dom": ">=19.0.0",
432
- "@neo4j-ndl/base": "^5.4.2"
437
+ "@neo4j-ndl/base": "^5.4.3"
433
438
  },
434
439
  "dependencies": {
435
440
  "@dnd-kit/core": "6.3.1",
@@ -2,7 +2,7 @@
2
2
  name: ndl-react
3
3
  metadata:
4
4
  package: '@neo4j-ndl/react'
5
- version: '5.6.3'
5
+ version: '5.7.0'
6
6
  description: >-
7
7
  Build and edit UI with the Neo4j Needle React design system
8
8
  (@neo4j-ndl/react). Use when adding, composing, or modifying Needle components
@@ -15,7 +15,7 @@ description: >-
15
15
 
16
16
  # Neo4j Needle (@neo4j-ndl/react)
17
17
 
18
- > 📌 Shipped with `@neo4j-ndl/react` v5.6.3. Once installed into your repo (e.g. via
18
+ > 📌 Shipped with `@neo4j-ndl/react` v5.7.0. Once installed into your repo (e.g. via
19
19
  > `npx skills add`) this folder is detached from the package — the installed
20
20
  > package (TypeScript types in `node_modules/@neo4j-ndl/react`) is the source of
21
21
  > truth.
@@ -184,6 +184,7 @@ Import from `@neo4j-ndl/react`.
184
184
  | `Radio` | [components/radio.md](components/radio.md) | ✅ | 7 |
185
185
  | `RadioGroup` | [components/radio-group.md](components/radio-group.md) | ✅ | 8 |
186
186
  | `ReadOnlyTag` | [components/read-only-tag.md](components/read-only-tag.md) | | 4 |
187
+ | `SearchField` | [components/search-field.md](components/search-field.md) | ✅ | 3 |
187
188
  | `SegmentedControl` | [components/segmented-control.md](components/segmented-control.md) | ✅ | 5 |
188
189
  | `Select` | [components/select.md](components/select.md) | | 14 |
189
190
  | `SelectIconButton` | [components/select-icon-button.md](components/select-icon-button.md) | | 4 |