@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.
- package/lib/cjs/icons/index.js +1 -1
- package/lib/cjs/index.js +4 -2
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/search-field/SearchField.js +94 -0
- package/lib/cjs/search-field/SearchField.js.map +1 -0
- package/lib/cjs/search-field/index.js +30 -0
- package/lib/cjs/search-field/index.js.map +1 -0
- package/lib/cjs/side-navigation/SideNavigation.js +1 -1
- package/lib/cjs/side-navigation/SideNavigation.js.map +1 -1
- package/lib/cjs/text-input/TextInput.js +1 -1
- package/lib/cjs/text-input/TextInput.js.map +1 -1
- package/lib/esm/icons/index.mjs +1 -1
- package/lib/esm/index.mjs +4 -3
- package/lib/esm/index.mjs.map +1 -1
- package/lib/esm/search-field/SearchField.mjs +89 -0
- package/lib/esm/search-field/SearchField.mjs.map +1 -0
- package/lib/esm/search-field/index.mjs +24 -0
- package/lib/esm/search-field/index.mjs.map +1 -0
- package/lib/esm/side-navigation/SideNavigation.mjs +1 -1
- package/lib/esm/side-navigation/SideNavigation.mjs.map +1 -1
- package/lib/esm/text-input/TextInput.mjs +1 -1
- package/lib/esm/text-input/TextInput.mjs.map +1 -1
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/search-field/SearchField.d.ts +52 -0
- package/lib/types/search-field/SearchField.d.ts.map +1 -0
- package/lib/types/search-field/index.d.ts +22 -0
- package/lib/types/search-field/index.d.ts.map +1 -0
- package/package.json +7 -2
- package/skills/ndl-react/SKILL.md +3 -2
- package/skills/ndl-react/components/search-field.md +254 -0
package/lib/cjs/icons/index.js
CHANGED
|
@@ -34,6 +34,7 @@ const require_icons_generated_heroIcons_BarsArrowUpIconOutline = require("./gene
|
|
|
34
34
|
const require_icons_generated_heroIcons_ChevronDownIconSolid = require("./generated/heroIcons/ChevronDownIconSolid.js");
|
|
35
35
|
const require_icons_generated_heroIcons_ChevronLeftIconOutline = require("./generated/heroIcons/ChevronLeftIconOutline.js");
|
|
36
36
|
const require_icons_generated_heroIcons_EllipsisHorizontalIconOutline = require("./generated/heroIcons/EllipsisHorizontalIconOutline.js");
|
|
37
|
+
const require_icons_generated_custom_MagnifyingGlassOutline = require("./generated/custom/MagnifyingGlassOutline.js");
|
|
37
38
|
const require_icons_generated_custom_AcademicCapOutline = require("./generated/custom/AcademicCapOutline.js");
|
|
38
39
|
const require_icons_generated_custom_AdjustmentsHorizontalOutline = require("./generated/custom/AdjustmentsHorizontalOutline.js");
|
|
39
40
|
const require_icons_generated_custom_AdjustmentsVerticalOutline = require("./generated/custom/AdjustmentsVerticalOutline.js");
|
|
@@ -408,7 +409,6 @@ const require_icons_generated_custom_LockOpenOutline = require("./generated/cust
|
|
|
408
409
|
const require_icons_generated_custom_LogOutOutline = require("./generated/custom/LogOutOutline.js");
|
|
409
410
|
const require_icons_generated_custom_MagnifyingGlassCircleOutline = require("./generated/custom/MagnifyingGlassCircleOutline.js");
|
|
410
411
|
const require_icons_generated_custom_MagnifyingGlassMinusOutline = require("./generated/custom/MagnifyingGlassMinusOutline.js");
|
|
411
|
-
const require_icons_generated_custom_MagnifyingGlassOutline = require("./generated/custom/MagnifyingGlassOutline.js");
|
|
412
412
|
const require_icons_generated_custom_MagnifyingGlassPlusOutline = require("./generated/custom/MagnifyingGlassPlusOutline.js");
|
|
413
413
|
const require_icons_generated_custom_MagnifyingGlassResetOutline = require("./generated/custom/MagnifyingGlassResetOutline.js");
|
|
414
414
|
const require_icons_generated_custom_MagnifyingGlassReset = require("./generated/custom/MagnifyingGlassReset.js");
|
package/lib/cjs/index.js
CHANGED
|
@@ -25,6 +25,7 @@ const require_popover_Popover = require("./popover/Popover.js");
|
|
|
25
25
|
const require_progress_bar_ProgressBar = require("./progress-bar/ProgressBar.js");
|
|
26
26
|
const require_dropzone_Dropzone = require("./dropzone/Dropzone.js");
|
|
27
27
|
const require_text_input_TextInput = require("./text-input/TextInput.js");
|
|
28
|
+
const require_search_field_SearchField = require("./search-field/SearchField.js");
|
|
28
29
|
const require_text_area_TextArea = require("./text-area/TextArea.js");
|
|
29
30
|
const require_text_link_TextLink = require("./text-link/TextLink.js");
|
|
30
31
|
const require_select_Select = require("./select/Select.js");
|
|
@@ -37,19 +38,19 @@ const require_side_navigation_SideNavigation = require("./side-navigation/SideNa
|
|
|
37
38
|
const require_typography_Typography = require("./typography/Typography.js");
|
|
38
39
|
const require_drawer_Drawer = require("./drawer/Drawer.js");
|
|
39
40
|
const require_breadcrumbs_Breadcrumbs = require("./breadcrumbs/Breadcrumbs.js");
|
|
40
|
-
const require_hooks_index = require("./hooks/index.js");
|
|
41
41
|
const require_data_grid_data_grid_context = require("./data-grid/data-grid-context.js");
|
|
42
42
|
const require_data_grid_helpers_index = require("./data-grid/helpers/index.js");
|
|
43
43
|
const require_hooks_use_debounce_callback_index = require("./hooks/use-debounce-callback/index.js");
|
|
44
|
+
const require_hooks_index = require("./hooks/index.js");
|
|
44
45
|
const require_box_Box = require("./box/Box.js");
|
|
45
46
|
const require_flex_Flex = require("./flex/Flex.js");
|
|
46
|
-
const require_avatar_Avatar = require("./avatar/Avatar.js");
|
|
47
47
|
const require_data_grid_style_rules_evaluate = require("./data-grid/style-rules/evaluate.js");
|
|
48
48
|
const require_data_grid_style_rules_hooks = require("./data-grid/style-rules/hooks.js");
|
|
49
49
|
const require_data_grid_data_grid_nav_data_grid_nav = require("./data-grid/data-grid-nav/data-grid-nav.js");
|
|
50
50
|
const require_data_grid_data_grid_nav_index = require("./data-grid/data-grid-nav/index.js");
|
|
51
51
|
const require_data_grid_DataGrid = require("./data-grid/DataGrid.js");
|
|
52
52
|
const require_data_grid_style_rules_guard = require("./data-grid/style-rules/guard.js");
|
|
53
|
+
const require_avatar_Avatar = require("./avatar/Avatar.js");
|
|
53
54
|
const require_logo_Logo = require("./logo/Logo.js");
|
|
54
55
|
const require_clipboard_button_ClipboardButton = require("./clipboard-button/ClipboardButton.js");
|
|
55
56
|
const require_slider_Slider = require("./slider/Slider.js");
|
|
@@ -152,6 +153,7 @@ exports.ProgressBar = require_progress_bar_ProgressBar.ProgressBar;
|
|
|
152
153
|
exports.Radio = require_radio_Radio.Radio;
|
|
153
154
|
exports.RadioGroup = require_radio_group_RadioGroup.RadioGroup;
|
|
154
155
|
exports.ReadOnlyTag = require_read_only_tag_ReadOnlyTag.ReadOnlyTag;
|
|
156
|
+
exports.SearchField = require_search_field_SearchField.SearchField;
|
|
155
157
|
exports.SegmentedControl = require_segmented_control_SegmentedControl.SegmentedControl;
|
|
156
158
|
exports.Select = require_select_Select.Select;
|
|
157
159
|
exports.SelectIconButton = require_select_icon_button_SelectIconButton.SelectIconButton;
|
package/lib/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/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 { Accordion } from './accordion';\nexport { StatusLabel } from './status-label';\nexport { Banner } from './banner';\nexport { AnnouncementBanner } from './announcement-banner';\nexport { Checkbox } from './checkbox';\nexport { CheckboxGroup } from './checkbox-group';\nexport { Fieldset } from './fieldset';\nexport { Switch } from './switch';\nexport { Radio } from './radio';\nexport { RadioGroup } from './radio-group';\nexport { Menu } from './menu';\nexport { DatePicker } from './date-picker';\nexport { Dialog } from './dialog';\nexport { LoadingSpinner } from './loading-spinner';\nexport { Tabs } from './tabs';\nexport { SegmentedControl } from './segmented-control';\nexport * from './popover';\nexport { ProgressBar } from './progress-bar';\nexport { Dropzone } from './dropzone';\nexport * from './data-grid';\nexport { TextInput } from './text-input';\nexport { TextArea } from './text-area';\nexport { TextLink } from './text-link';\nexport { Select } from './select';\nexport { Tag } from './tag';\nexport * from './theme';\nexport { Wizard } from './wizard';\nexport { GraphLabel } from './graph-label';\nexport { CodeBlock } from './code-block';\nexport { StatusIndicator } from './status-indicator';\nexport { SideNavigation } from './side-navigation';\nexport { Typography } from './typography';\nexport { Drawer } from './drawer';\nexport { Breadcrumbs } from './breadcrumbs';\nexport * from './hooks';\nexport { Box } from './box';\nexport { Flex } from './flex';\nexport { Avatar } from './avatar';\nexport { Logo } from './logo';\nexport { ClipboardButton } from './clipboard-button';\nexport { Slider } from './slider';\nexport { InlineEdit } from './inline-edit';\nexport { DropdownButton } from './dropdown-button';\nexport { Divider } from './divider';\nexport * from './tree-view';\nexport { ToasterControlled, Toaster, toast, type ToastId } from './toast';\nexport { Tooltip } from './tooltip';\nexport { Skeleton } from './skeleton';\nexport { TimePicker, NeedleTime } from './time-picker';\nexport { TimeZonePicker } from './timezone-picker';\nexport {\n Spotlight,\n SpotlightProvider,\n SpotlightTarget,\n SpotlightTour,\n useSpotlightContext,\n} from './spotlight';\nexport { LoadingBar } from './loading-bar';\nexport { IconButton } from './icon-button';\nexport { CleanIconButton } from './clean-icon-button';\nexport { IconButtonArray } from './icon-button-array';\nexport { ConditionalWrap } from './conditional-wrap';\nexport { ColorPicker } from './color-picker';\nexport { OutlinedButton } from './outlined-button';\nexport { FilledButton } from './filled-button';\nexport { TextButton } from './text-button';\nexport { Code } from './code';\nexport { Kbd } from './kbd';\nexport { SelectIconButton } from './select-icon-button';\nexport { ReadOnlyTag } from './read-only-tag';\nexport { DismissibleTag } from './dismissible-tag';\nexport { SelectableTag } from './selectable-tag';\nexport { OperationalTag } from './operational-tag';\nexport * from './combobox';\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/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 { Accordion } from './accordion';\nexport { StatusLabel } from './status-label';\nexport { Banner } from './banner';\nexport { AnnouncementBanner } from './announcement-banner';\nexport { Checkbox } from './checkbox';\nexport { CheckboxGroup } from './checkbox-group';\nexport { Fieldset } from './fieldset';\nexport { Switch } from './switch';\nexport { Radio } from './radio';\nexport { RadioGroup } from './radio-group';\nexport { Menu } from './menu';\nexport { DatePicker } from './date-picker';\nexport { Dialog } from './dialog';\nexport { LoadingSpinner } from './loading-spinner';\nexport { Tabs } from './tabs';\nexport { SegmentedControl } from './segmented-control';\nexport * from './popover';\nexport { ProgressBar } from './progress-bar';\nexport { Dropzone } from './dropzone';\nexport * from './data-grid';\nexport { TextInput } from './text-input';\nexport { SearchField } from './search-field';\nexport { TextArea } from './text-area';\nexport { TextLink } from './text-link';\nexport { Select } from './select';\nexport { Tag } from './tag';\nexport * from './theme';\nexport { Wizard } from './wizard';\nexport { GraphLabel } from './graph-label';\nexport { CodeBlock } from './code-block';\nexport { StatusIndicator } from './status-indicator';\nexport { SideNavigation } from './side-navigation';\nexport { Typography } from './typography';\nexport { Drawer } from './drawer';\nexport { Breadcrumbs } from './breadcrumbs';\nexport * from './hooks';\nexport { Box } from './box';\nexport { Flex } from './flex';\nexport { Avatar } from './avatar';\nexport { Logo } from './logo';\nexport { ClipboardButton } from './clipboard-button';\nexport { Slider } from './slider';\nexport { InlineEdit } from './inline-edit';\nexport { DropdownButton } from './dropdown-button';\nexport { Divider } from './divider';\nexport * from './tree-view';\nexport { ToasterControlled, Toaster, toast, type ToastId } from './toast';\nexport { Tooltip } from './tooltip';\nexport { Skeleton } from './skeleton';\nexport { TimePicker, NeedleTime } from './time-picker';\nexport { TimeZonePicker } from './timezone-picker';\nexport {\n Spotlight,\n SpotlightProvider,\n SpotlightTarget,\n SpotlightTour,\n useSpotlightContext,\n} from './spotlight';\nexport { LoadingBar } from './loading-bar';\nexport { IconButton } from './icon-button';\nexport { CleanIconButton } from './clean-icon-button';\nexport { IconButtonArray } from './icon-button-array';\nexport { ConditionalWrap } from './conditional-wrap';\nexport { ColorPicker } from './color-picker';\nexport { OutlinedButton } from './outlined-button';\nexport { FilledButton } from './filled-button';\nexport { TextButton } from './text-button';\nexport { Code } from './code';\nexport { Kbd } from './kbd';\nexport { SelectIconButton } from './select-icon-button';\nexport { ReadOnlyTag } from './read-only-tag';\nexport { DismissibleTag } from './dismissible-tag';\nexport { SelectableTag } from './selectable-tag';\nexport { OperationalTag } from './operational-tag';\nexport * from './combobox';\n"],"mappings":""}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, {
|
|
3
|
+
__esModule: { value: true },
|
|
4
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
5
|
+
});
|
|
6
|
+
const require_hooks_use_debounce_callback_index = require("../hooks/use-debounce-callback/index.js");
|
|
7
|
+
const require_icons_generated_custom_MagnifyingGlassOutline = require("../icons/generated/custom/MagnifyingGlassOutline.js");
|
|
8
|
+
const require_text_input_TextInput = require("../text-input/TextInput.js");
|
|
9
|
+
const require_objectWithoutProperties = require("../_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/objectWithoutProperties.js");
|
|
10
|
+
const require_objectSpread2 = require("../_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/objectSpread2.js");
|
|
11
|
+
let react = require("react");
|
|
12
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
13
|
+
// src/search-field/SearchField.tsx
|
|
14
|
+
/*!
|
|
15
|
+
*
|
|
16
|
+
* Copyright (c) "Neo4j"
|
|
17
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
18
|
+
*
|
|
19
|
+
* This file is part of Neo4j.
|
|
20
|
+
*
|
|
21
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
22
|
+
* it under the terms of the GNU General Public License as published by
|
|
23
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
24
|
+
* (at your option) any later version.
|
|
25
|
+
*
|
|
26
|
+
* This program is distributed in the hope that it will be useful,
|
|
27
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
28
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
29
|
+
* GNU General Public License for more details.
|
|
30
|
+
*
|
|
31
|
+
* You should have received a copy of the GNU General Public License
|
|
32
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
33
|
+
*/
|
|
34
|
+
const _excluded = [
|
|
35
|
+
"debounceDelay",
|
|
36
|
+
"htmlAttributes",
|
|
37
|
+
"label",
|
|
38
|
+
"onChange",
|
|
39
|
+
"onSearch"
|
|
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
|
+
const SearchField = (_ref) => {
|
|
51
|
+
let { debounceDelay = 500, htmlAttributes, label, onChange, onSearch } = _ref, textInputProps = require_objectWithoutProperties.default(_ref, _excluded);
|
|
52
|
+
const debouncedSearch = require_hooks_use_debounce_callback_index.useDebounceCallback((query) => {
|
|
53
|
+
onSearch === null || onSearch === void 0 || onSearch(query);
|
|
54
|
+
}, debounceDelay);
|
|
55
|
+
const handleChange = (0, react.useCallback)((event) => {
|
|
56
|
+
onChange === null || onChange === void 0 || onChange(event);
|
|
57
|
+
const query = event.target.value;
|
|
58
|
+
if (query === "") {
|
|
59
|
+
debouncedSearch.cancel();
|
|
60
|
+
onSearch === null || onSearch === void 0 || onSearch("");
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
debouncedSearch(query);
|
|
64
|
+
}, [
|
|
65
|
+
debouncedSearch,
|
|
66
|
+
onChange,
|
|
67
|
+
onSearch
|
|
68
|
+
]);
|
|
69
|
+
const handleKeyDown = (0, react.useCallback)((event) => {
|
|
70
|
+
var _htmlAttributes$onKey;
|
|
71
|
+
htmlAttributes === null || htmlAttributes === void 0 || (_htmlAttributes$onKey = htmlAttributes.onKeyDown) === null || _htmlAttributes$onKey === void 0 || _htmlAttributes$onKey.call(htmlAttributes, event);
|
|
72
|
+
if (event.key === "Enter" && !event.defaultPrevented && !event.nativeEvent.isComposing) {
|
|
73
|
+
if (debouncedSearch.isPending()) debouncedSearch.flush();
|
|
74
|
+
else onSearch === null || onSearch === void 0 || onSearch(event.currentTarget.value);
|
|
75
|
+
}
|
|
76
|
+
}, [
|
|
77
|
+
debouncedSearch,
|
|
78
|
+
htmlAttributes,
|
|
79
|
+
onSearch
|
|
80
|
+
]);
|
|
81
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_input_TextInput.TextInput, require_objectSpread2.default(require_objectSpread2.default({}, textInputProps), {}, {
|
|
82
|
+
htmlAttributes: require_objectSpread2.default(require_objectSpread2.default({}, htmlAttributes), {}, {
|
|
83
|
+
"aria-label": label,
|
|
84
|
+
onKeyDown: handleKeyDown,
|
|
85
|
+
type: "search"
|
|
86
|
+
}),
|
|
87
|
+
isClearable: true,
|
|
88
|
+
leadingElement: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_icons_generated_custom_MagnifyingGlassOutline.default, {}),
|
|
89
|
+
onChange: handleChange
|
|
90
|
+
}));
|
|
91
|
+
};
|
|
92
|
+
exports.SearchField = SearchField;
|
|
93
|
+
|
|
94
|
+
//# sourceMappingURL=SearchField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchField.js","names":["useDebounceCallback","useCallback","TextInput","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,gCAAA,QAAA,MAAA,SAAA;CAEH,MAAM,kBAAkBA,0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
|
|
3
|
+
__esModule: { value: true },
|
|
4
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
5
|
+
});
|
|
6
|
+
const require_search_field_SearchField = require("./SearchField.js");
|
|
7
|
+
// src/search-field/index.ts
|
|
8
|
+
/*!
|
|
9
|
+
*
|
|
10
|
+
* Copyright (c) "Neo4j"
|
|
11
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
12
|
+
*
|
|
13
|
+
* This file is part of Neo4j.
|
|
14
|
+
*
|
|
15
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
16
|
+
* it under the terms of the GNU General Public License as published by
|
|
17
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
18
|
+
* (at your option) any later version.
|
|
19
|
+
*
|
|
20
|
+
* This program is distributed in the hope that it will be useful,
|
|
21
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
22
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
23
|
+
* GNU General Public License for more details.
|
|
24
|
+
*
|
|
25
|
+
* You should have received a copy of the GNU General Public License
|
|
26
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
27
|
+
*/
|
|
28
|
+
exports.SearchField = require_search_field_SearchField.SearchField;
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","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":""}
|
|
@@ -184,7 +184,7 @@ const SideNavComponent = (_ref) => {
|
|
|
184
184
|
className: "ndl-side-nav-nav",
|
|
185
185
|
"aria-label": ariaLabel,
|
|
186
186
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_floating_ui_react.Composite, {
|
|
187
|
-
|
|
187
|
+
render: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {}),
|
|
188
188
|
"aria-label": ariaLabel,
|
|
189
189
|
role: "menubar",
|
|
190
190
|
orientation: "vertical",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SideNavigation.js","names":["useState","useRef","classNames","useMergeRefs","tokens","SideNavContext","Composite","useSideNavContext","useSideNavCategoryContext","useListItem","CompositeItem","ConditionalWrap","Tooltip","IconIndicatorWrapper","Typography","useId","useFloating","offset","flip","shift","autoUpdate","useDismiss","useHover","safePolygon","useFocus","useListNavigation","useInteractions","useTransitionStyles","SideNavCategoryContext","ChevronRightIconOutline","FloatingList","FloatingPortal","FloatingFocusManager","Divider","CleanIconButton","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,gCAAA,QAAA,MAAA,SAAA;CAEH,MAAM,CAAC,WAAW,iBAAA,GAAgBA,MAAAA,SAAAA,CAAS,KAAK;CAChD,MAAM,CAAC,iBAAiB,uBAAA,GAAsBA,MAAAA,SAAAA,CAAS,KAAK;CAC5D,MAAM,CAAC,yBAAyB,+BAAA,GAA8BA,MAAAA,SAAAA,CAAS,KAAK;CAC5E,MAAM,gCAAA,GAA+BC,MAAAA,OAAAA,CAE3B,IAAI;CAEd,MAAM,WAAA,GAAUA,MAAAA,OAAAA,CAAuB,IAAI;CAE3C,MAAM,qBACJ,+BAA+B,CAAC,YAAY,kBAAkB;CAEhE,MAAM,WAAA,GAAUC,WAAAA,QAAAA,CAAW,gBAAgB,qBAAqB,WAAW;EACzE,0BACE,eAAe,QAAQ,+BAA+B;EACxD,yBAAyB;CAC3B,CAAC;CAED,MAAM,gBAAA,GAAeA,WAAAA,QAAAA,CAAW,sBAAsB;EACpD,2BAA2B;EAC3B,sBAAsB,uBAAuB,QAA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AU;CACV;AACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"SideNavigation.js","names":["useState","useRef","classNames","useMergeRefs","tokens","SideNavContext","Composite","useSideNavContext","useSideNavCategoryContext","useListItem","CompositeItem","ConditionalWrap","Tooltip","IconIndicatorWrapper","Typography","useId","useFloating","offset","flip","shift","autoUpdate","useDismiss","useHover","safePolygon","useFocus","useListNavigation","useInteractions","useTransitionStyles","SideNavCategoryContext","ChevronRightIconOutline","FloatingList","FloatingPortal","FloatingFocusManager","Divider","CleanIconButton","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;CAC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AA2B,WAAW;EACpE,cAAc,SAAS;EACvB,YAAY,SAAS;EACrB,eAAe,SAAS;CAC1B,CAAC;CAED,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACY,8BAAAA,YAAAA,sBAAAA,QAAAA,sBAAAA,QAAAA;EACC,IAAG;EACH,WAAW;EACX,SAAQ;EACR,gBAAA,sBAAA,QAAA,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,qBAC9CP,gDAAAA,kBAAkB;CAEpB,MAAM,WAAA,GAAUL,WAAAA,QAAAA,CAAW,yBAAyB;CAEpD,IAAI,CAAC,4BACH,OAAO;CAGT,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACgC,0CAAAA,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,iBAAA,GAAA,kBAAA,IAAA,CAACC,mCAAAA,SAAD,CAAU,CAAA;CACK,CAAA;AAErB;AAEA,MAAM,iBAAiB,OAAO,OAAO,kBAAkB;CACrC;CACF;CACd,SAAS;CACE;CACX,UAAU;CACV;AACF,CAAC"}
|
|
@@ -82,7 +82,7 @@ const TextInput = (_ref) => {
|
|
|
82
82
|
state: value !== null && value !== void 0 ? value : ""
|
|
83
83
|
});
|
|
84
84
|
const hintId = (0, react.useId)();
|
|
85
|
-
const canClear = isClearable && isDisabled !== true;
|
|
85
|
+
const canClear = isClearable && isDisabled !== true && isReadOnly !== true;
|
|
86
86
|
const shouldRenderHint = canClear || isLoading;
|
|
87
87
|
const { field, controlProps } = require__common_form_control_use_form_field.useFormField({
|
|
88
88
|
errorText,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextInput.js","names":["useSemiControlledInput","useId","useFormField","classNames","customLabelAndNoAriaLabelWarningMessage","FormFieldLabel","Skeleton","LoadingSpinner","XMarkIconOutline","FormFieldMessage"],"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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,YAC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A,IAED;MAEC,CAAA;KAEJ;;GACG,CAAA,CAAA,CACL;EAEP,CAAA,GAAA,iBAAA,GAAA,kBAAA,IAAA,CAACE,8CAAAA,kBAAD;GACS;GACD;GACN,OAAO,YACL,iBAAA,GAAA,kBAAA,IAAA,CAACH,0BAAAA,UAAAA,sBAAAA,QAAAA,sBAAAA,QAAAA;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.js","names":["useSemiControlledInput","useId","useFormField","classNames","customLabelAndNoAriaLabelWarningMessage","FormFieldLabel","Skeleton","LoadingSpinner","XMarkIconOutline","FormFieldMessage"],"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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EACb,QAAQ,EAAE,OAAO,GAAG,EACtB,CAAwC;UAC1C;UAEA,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACK,mDAAAA,kBAAD,CAAmB,CAAA;SACb,CAAA;QACL,CAAA;OAEJ;;MACJ,mBACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;OAAK,WAAU;OACZ,UAAA,aAAa,CAAC,iBACb,iBAAA,GAAA,kBAAA,IAAA,CAACD,uCAAAA,gBAAD;QACE,MAAM,SAAS,UAAU,WAAW;QACpC,WACE,SAAS,UACL,uBACA;OAEP,CAAA,IAED;MAEC,CAAA;KAEJ;;GACG,CAAA,CAAA,CACL;EAEP,CAAA,GAAA,iBAAA,GAAA,kBAAA,IAAA,CAACE,8CAAAA,kBAAD;GACS;GACD;GACN,OAAO,YACL,iBAAA,GAAA,kBAAA,IAAA,CAACH,0BAAAA,UAAAA,sBAAAA,QAAAA,sBAAAA,QAAAA;IACC,cAAa;IACb,OAAM;GACF,GAAA,aAAA,GAAA,CAAA,GAAA;IACJ,WAAW;IAEV,UAAA;GACO,CAAA,CAAA;EAEb,CAAA,CACE;;AAET"}
|
package/lib/esm/icons/index.mjs
CHANGED
|
@@ -29,6 +29,7 @@ import { BarsArrowUpIconOutline } from "./generated/heroIcons/BarsArrowUpIconOut
|
|
|
29
29
|
import { ChevronDownIconSolid } from "./generated/heroIcons/ChevronDownIconSolid.mjs";
|
|
30
30
|
import { ChevronLeftIconOutline } from "./generated/heroIcons/ChevronLeftIconOutline.mjs";
|
|
31
31
|
import { EllipsisHorizontalIconOutline } from "./generated/heroIcons/EllipsisHorizontalIconOutline.mjs";
|
|
32
|
+
import SvgMagnifyingGlassOutline from "./generated/custom/MagnifyingGlassOutline.mjs";
|
|
32
33
|
import SvgAcademicCapOutline from "./generated/custom/AcademicCapOutline.mjs";
|
|
33
34
|
import SvgAdjustmentsHorizontalOutline from "./generated/custom/AdjustmentsHorizontalOutline.mjs";
|
|
34
35
|
import SvgAdjustmentsVerticalOutline from "./generated/custom/AdjustmentsVerticalOutline.mjs";
|
|
@@ -403,7 +404,6 @@ import SvgLockOpenOutline from "./generated/custom/LockOpenOutline.mjs";
|
|
|
403
404
|
import SvgLogOutOutline from "./generated/custom/LogOutOutline.mjs";
|
|
404
405
|
import SvgMagnifyingGlassCircleOutline from "./generated/custom/MagnifyingGlassCircleOutline.mjs";
|
|
405
406
|
import SvgMagnifyingGlassMinusOutline from "./generated/custom/MagnifyingGlassMinusOutline.mjs";
|
|
406
|
-
import SvgMagnifyingGlassOutline from "./generated/custom/MagnifyingGlassOutline.mjs";
|
|
407
407
|
import SvgMagnifyingGlassPlusOutline from "./generated/custom/MagnifyingGlassPlusOutline.mjs";
|
|
408
408
|
import SvgMagnifyingGlassResetOutline from "./generated/custom/MagnifyingGlassResetOutline.mjs";
|
|
409
409
|
import SvgMagnifyingGlassReset from "./generated/custom/MagnifyingGlassReset.mjs";
|
package/lib/esm/index.mjs
CHANGED
|
@@ -20,6 +20,7 @@ import { Popover, placementTranslation, usePopoverContext } from "./popover/Popo
|
|
|
20
20
|
import { ProgressBar } from "./progress-bar/ProgressBar.mjs";
|
|
21
21
|
import { Dropzone } from "./dropzone/Dropzone.mjs";
|
|
22
22
|
import { TextInput } from "./text-input/TextInput.mjs";
|
|
23
|
+
import { SearchField } from "./search-field/SearchField.mjs";
|
|
23
24
|
import { TextArea } from "./text-area/TextArea.mjs";
|
|
24
25
|
import { TextLink } from "./text-link/TextLink.mjs";
|
|
25
26
|
import { Select } from "./select/Select.mjs";
|
|
@@ -32,19 +33,19 @@ import { SideNavigation } from "./side-navigation/SideNavigation.mjs";
|
|
|
32
33
|
import { Typography } from "./typography/Typography.mjs";
|
|
33
34
|
import { Drawer } from "./drawer/Drawer.mjs";
|
|
34
35
|
import { Breadcrumbs } from "./breadcrumbs/Breadcrumbs.mjs";
|
|
35
|
-
import { useCopyToClipboard, useDebounceValue, useEffectDebugger, useEventListener, useInterval, useMediaQuery, useOnClickOutside, usePrevious, useRenderCount, useRenderDebugger, useResizeObserver, useScrollLock, useWindowSize } from "./hooks/index.mjs";
|
|
36
36
|
import { useDataGridContext } from "./data-grid/data-grid-context.mjs";
|
|
37
37
|
import { helpers_exports } from "./data-grid/helpers/index.mjs";
|
|
38
38
|
import { useDebounceCallback } from "./hooks/use-debounce-callback/index.mjs";
|
|
39
|
+
import { useCopyToClipboard, useDebounceValue, useEffectDebugger, useEventListener, useInterval, useMediaQuery, useOnClickOutside, usePrevious, useRenderCount, useRenderDebugger, useResizeObserver, useScrollLock, useWindowSize } from "./hooks/index.mjs";
|
|
39
40
|
import { Box } from "./box/Box.mjs";
|
|
40
41
|
import { Flex } from "./flex/Flex.mjs";
|
|
41
|
-
import { Avatar } from "./avatar/Avatar.mjs";
|
|
42
42
|
import { evaluateDataGridStyleRules } from "./data-grid/style-rules/evaluate.mjs";
|
|
43
43
|
import { useDataGridCellStyle } from "./data-grid/style-rules/hooks.mjs";
|
|
44
44
|
import { DataGridNav } from "./data-grid/data-grid-nav/data-grid-nav.mjs";
|
|
45
45
|
import { useTableNav } from "./data-grid/data-grid-nav/index.mjs";
|
|
46
46
|
import { DataGrid } from "./data-grid/DataGrid.mjs";
|
|
47
47
|
import { isDataGridStyleRule } from "./data-grid/style-rules/guard.mjs";
|
|
48
|
+
import { Avatar } from "./avatar/Avatar.mjs";
|
|
48
49
|
import { Logo } from "./logo/Logo.mjs";
|
|
49
50
|
import { ClipboardButton } from "./clipboard-button/ClipboardButton.mjs";
|
|
50
51
|
import { Slider } from "./slider/Slider.mjs";
|
|
@@ -101,6 +102,6 @@ import { Combobox } from "./combobox/Combobox.mjs";
|
|
|
101
102
|
* You should have received a copy of the GNU General Public License
|
|
102
103
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
103
104
|
*/
|
|
104
|
-
export { Accordion, AnnouncementBanner, Avatar, Banner, Box, Breadcrumbs, Checkbox, CheckboxGroup, CleanIconButton, ClipboardButton, Code, CodeBlock, ColorPicker, Combobox, ConditionalWrap, DataGrid, DataGridNav, DatePicker, Dialog, DismissibleTag, Divider, Drawer, DropdownButton, Dropzone, Fieldset, FilledButton, Flex, GraphLabel, IconButton, IconButtonArray, InlineEdit, Kbd, LoadingBar, LoadingSpinner, Logo, Menu, NeedleThemeProvider, NeedleTime, OperationalTag, OutlinedButton, Popover, ProgressBar, Radio, RadioGroup, ReadOnlyTag, SegmentedControl, Select, SelectIconButton, SelectableTag, SideNavigation, Skeleton, Slider, Spotlight, SpotlightProvider, SpotlightTarget, SpotlightTour, StatusIndicator, StatusLabel, Switch, Tabs, Tag, TextArea, TextButton, TextInput, TextLink, ThemeContext, TimePicker, TimeZonePicker, Toaster, ToasterControlled, TokensContext, Tooltip, TreeView, Typography, Wizard, helpers_exports as dataGridUtils, evaluateDataGridStyleRules, isDataGridStyleRule, useToken as n, useToken, placementTranslation, toast, useCopyToClipboard, useDataGridCellStyle, useDataGridContext, useDebounceCallback, useDebounceValue, useEffectDebugger, useEventListener, useInterval, useMediaQuery, useNeedleTheme, useOnClickOutside, usePopoverContext, usePrevious, useRenderCount, useRenderDebugger, useResizeObserver, useScrollLock, useSpotlightContext, useTableNav, useWindowSize };
|
|
105
|
+
export { Accordion, AnnouncementBanner, Avatar, Banner, Box, Breadcrumbs, Checkbox, CheckboxGroup, CleanIconButton, ClipboardButton, Code, CodeBlock, ColorPicker, Combobox, ConditionalWrap, DataGrid, DataGridNav, DatePicker, Dialog, DismissibleTag, Divider, Drawer, DropdownButton, Dropzone, Fieldset, FilledButton, Flex, GraphLabel, IconButton, IconButtonArray, InlineEdit, Kbd, LoadingBar, LoadingSpinner, Logo, Menu, NeedleThemeProvider, NeedleTime, OperationalTag, OutlinedButton, Popover, ProgressBar, Radio, RadioGroup, ReadOnlyTag, SearchField, SegmentedControl, Select, SelectIconButton, SelectableTag, SideNavigation, Skeleton, Slider, Spotlight, SpotlightProvider, SpotlightTarget, SpotlightTour, StatusIndicator, StatusLabel, Switch, Tabs, Tag, TextArea, TextButton, TextInput, TextLink, ThemeContext, TimePicker, TimeZonePicker, Toaster, ToasterControlled, TokensContext, Tooltip, TreeView, Typography, Wizard, helpers_exports as dataGridUtils, evaluateDataGridStyleRules, isDataGridStyleRule, useToken as n, useToken, placementTranslation, toast, useCopyToClipboard, useDataGridCellStyle, useDataGridContext, useDebounceCallback, useDebounceValue, useEffectDebugger, useEventListener, useInterval, useMediaQuery, useNeedleTheme, useOnClickOutside, usePopoverContext, usePrevious, useRenderCount, useRenderDebugger, useResizeObserver, useScrollLock, useSpotlightContext, useTableNav, useWindowSize };
|
|
105
106
|
|
|
106
107
|
//# sourceMappingURL=index.mjs.map
|
package/lib/esm/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/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 { Accordion } from './accordion';\nexport { StatusLabel } from './status-label';\nexport { Banner } from './banner';\nexport { AnnouncementBanner } from './announcement-banner';\nexport { Checkbox } from './checkbox';\nexport { CheckboxGroup } from './checkbox-group';\nexport { Fieldset } from './fieldset';\nexport { Switch } from './switch';\nexport { Radio } from './radio';\nexport { RadioGroup } from './radio-group';\nexport { Menu } from './menu';\nexport { DatePicker } from './date-picker';\nexport { Dialog } from './dialog';\nexport { LoadingSpinner } from './loading-spinner';\nexport { Tabs } from './tabs';\nexport { SegmentedControl } from './segmented-control';\nexport * from './popover';\nexport { ProgressBar } from './progress-bar';\nexport { Dropzone } from './dropzone';\nexport * from './data-grid';\nexport { TextInput } from './text-input';\nexport { TextArea } from './text-area';\nexport { TextLink } from './text-link';\nexport { Select } from './select';\nexport { Tag } from './tag';\nexport * from './theme';\nexport { Wizard } from './wizard';\nexport { GraphLabel } from './graph-label';\nexport { CodeBlock } from './code-block';\nexport { StatusIndicator } from './status-indicator';\nexport { SideNavigation } from './side-navigation';\nexport { Typography } from './typography';\nexport { Drawer } from './drawer';\nexport { Breadcrumbs } from './breadcrumbs';\nexport * from './hooks';\nexport { Box } from './box';\nexport { Flex } from './flex';\nexport { Avatar } from './avatar';\nexport { Logo } from './logo';\nexport { ClipboardButton } from './clipboard-button';\nexport { Slider } from './slider';\nexport { InlineEdit } from './inline-edit';\nexport { DropdownButton } from './dropdown-button';\nexport { Divider } from './divider';\nexport * from './tree-view';\nexport { ToasterControlled, Toaster, toast, type ToastId } from './toast';\nexport { Tooltip } from './tooltip';\nexport { Skeleton } from './skeleton';\nexport { TimePicker, NeedleTime } from './time-picker';\nexport { TimeZonePicker } from './timezone-picker';\nexport {\n Spotlight,\n SpotlightProvider,\n SpotlightTarget,\n SpotlightTour,\n useSpotlightContext,\n} from './spotlight';\nexport { LoadingBar } from './loading-bar';\nexport { IconButton } from './icon-button';\nexport { CleanIconButton } from './clean-icon-button';\nexport { IconButtonArray } from './icon-button-array';\nexport { ConditionalWrap } from './conditional-wrap';\nexport { ColorPicker } from './color-picker';\nexport { OutlinedButton } from './outlined-button';\nexport { FilledButton } from './filled-button';\nexport { TextButton } from './text-button';\nexport { Code } from './code';\nexport { Kbd } from './kbd';\nexport { SelectIconButton } from './select-icon-button';\nexport { ReadOnlyTag } from './read-only-tag';\nexport { DismissibleTag } from './dismissible-tag';\nexport { SelectableTag } from './selectable-tag';\nexport { OperationalTag } from './operational-tag';\nexport * from './combobox';\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/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 { Accordion } from './accordion';\nexport { StatusLabel } from './status-label';\nexport { Banner } from './banner';\nexport { AnnouncementBanner } from './announcement-banner';\nexport { Checkbox } from './checkbox';\nexport { CheckboxGroup } from './checkbox-group';\nexport { Fieldset } from './fieldset';\nexport { Switch } from './switch';\nexport { Radio } from './radio';\nexport { RadioGroup } from './radio-group';\nexport { Menu } from './menu';\nexport { DatePicker } from './date-picker';\nexport { Dialog } from './dialog';\nexport { LoadingSpinner } from './loading-spinner';\nexport { Tabs } from './tabs';\nexport { SegmentedControl } from './segmented-control';\nexport * from './popover';\nexport { ProgressBar } from './progress-bar';\nexport { Dropzone } from './dropzone';\nexport * from './data-grid';\nexport { TextInput } from './text-input';\nexport { SearchField } from './search-field';\nexport { TextArea } from './text-area';\nexport { TextLink } from './text-link';\nexport { Select } from './select';\nexport { Tag } from './tag';\nexport * from './theme';\nexport { Wizard } from './wizard';\nexport { GraphLabel } from './graph-label';\nexport { CodeBlock } from './code-block';\nexport { StatusIndicator } from './status-indicator';\nexport { SideNavigation } from './side-navigation';\nexport { Typography } from './typography';\nexport { Drawer } from './drawer';\nexport { Breadcrumbs } from './breadcrumbs';\nexport * from './hooks';\nexport { Box } from './box';\nexport { Flex } from './flex';\nexport { Avatar } from './avatar';\nexport { Logo } from './logo';\nexport { ClipboardButton } from './clipboard-button';\nexport { Slider } from './slider';\nexport { InlineEdit } from './inline-edit';\nexport { DropdownButton } from './dropdown-button';\nexport { Divider } from './divider';\nexport * from './tree-view';\nexport { ToasterControlled, Toaster, toast, type ToastId } from './toast';\nexport { Tooltip } from './tooltip';\nexport { Skeleton } from './skeleton';\nexport { TimePicker, NeedleTime } from './time-picker';\nexport { TimeZonePicker } from './timezone-picker';\nexport {\n Spotlight,\n SpotlightProvider,\n SpotlightTarget,\n SpotlightTour,\n useSpotlightContext,\n} from './spotlight';\nexport { LoadingBar } from './loading-bar';\nexport { IconButton } from './icon-button';\nexport { CleanIconButton } from './clean-icon-button';\nexport { IconButtonArray } from './icon-button-array';\nexport { ConditionalWrap } from './conditional-wrap';\nexport { ColorPicker } from './color-picker';\nexport { OutlinedButton } from './outlined-button';\nexport { FilledButton } from './filled-button';\nexport { TextButton } from './text-button';\nexport { Code } from './code';\nexport { Kbd } from './kbd';\nexport { SelectIconButton } from './select-icon-button';\nexport { ReadOnlyTag } from './read-only-tag';\nexport { DismissibleTag } from './dismissible-tag';\nexport { SelectableTag } from './selectable-tag';\nexport { OperationalTag } from './operational-tag';\nexport * from './combobox';\n"],"mappings":""}
|