@neo4j-ndl/react 4.9.1 → 4.9.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/lib/cjs/data-grid/DataGrid.js +2 -0
  2. package/lib/cjs/data-grid/DataGrid.js.map +1 -1
  3. package/lib/cjs/data-grid/stories/datagrid-compact-mode.story.js +82 -0
  4. package/lib/cjs/data-grid/stories/datagrid-compact-mode.story.js.map +1 -0
  5. package/lib/cjs/data-grid/stories/index.js +5 -1
  6. package/lib/cjs/data-grid/stories/index.js.map +1 -1
  7. package/lib/cjs/menu/Menu.js +24 -1
  8. package/lib/cjs/menu/Menu.js.map +1 -1
  9. package/lib/cjs/menu/menu-types.js.map +1 -1
  10. package/lib/cjs/tree-view/TreeViewTrail.js +1 -1
  11. package/lib/cjs/tree-view/TreeViewTrail.js.map +1 -1
  12. package/lib/esm/data-grid/DataGrid.js +2 -0
  13. package/lib/esm/data-grid/DataGrid.js.map +1 -1
  14. package/lib/esm/data-grid/stories/datagrid-compact-mode.story.js +80 -0
  15. package/lib/esm/data-grid/stories/datagrid-compact-mode.story.js.map +1 -0
  16. package/lib/esm/data-grid/stories/index.js +3 -0
  17. package/lib/esm/data-grid/stories/index.js.map +1 -1
  18. package/lib/esm/menu/Menu.js +25 -2
  19. package/lib/esm/menu/Menu.js.map +1 -1
  20. package/lib/esm/menu/menu-types.js.map +1 -1
  21. package/lib/esm/tree-view/TreeViewTrail.js +1 -1
  22. package/lib/esm/tree-view/TreeViewTrail.js.map +1 -1
  23. package/lib/types/data-grid/DataGrid.d.ts +2 -0
  24. package/lib/types/data-grid/DataGrid.d.ts.map +1 -1
  25. package/lib/types/data-grid/stories/datagrid-compact-mode.story.d.ts +24 -0
  26. package/lib/types/data-grid/stories/datagrid-compact-mode.story.d.ts.map +1 -0
  27. package/lib/types/data-grid/stories/index.d.ts +2 -0
  28. package/lib/types/data-grid/stories/index.d.ts.map +1 -1
  29. package/lib/types/menu/Menu.d.ts.map +1 -1
  30. package/lib/types/menu/menu-types.d.ts +1 -1
  31. package/lib/types/menu/menu-types.d.ts.map +1 -1
  32. package/lib/types/tree-view/TreeViewTrail.d.ts.map +1 -1
  33. package/package.json +4 -4
@@ -1 +1 @@
1
- {"version":3,"file":"DataGrid.js","sourceRoot":"","sources":["../../../src/data-grid/DataGrid.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAwBA,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EACL,SAAS,EACT,mBAAmB,EACnB,OAAO,EACP,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,OAAO,EACL,YAAY,EACZ,UAAU,EACV,IAAI,EACJ,QAAQ,EACR,OAAO,EACP,cAAc,EACd,YAAY,EACZ,MAAM,EACN,UAAU,EACV,WAAW,EACX,cAAc,EACd,kBAAkB,EAClB,UAAU,EACV,UAAU,EACV,iBAAiB,EACjB,+BAA+B,EAC/B,UAAU,EACV,qBAAqB,EACrB,uBAAuB,EACvB,wBAAwB,EACxB,WAAW,EACX,WAAW,EACX,UAAU,EACV,YAAY,GACb,MAAM,cAAc,CAAC;AACtB,OAAO,EAEL,eAAe,GAEhB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAE/C,IAAK,eAKJ;AALD,WAAK,eAAe;IAClB,yCAAsB,CAAA;IACtB,4CAAyB,CAAA;IACzB,wCAAqB,CAAA;IACrB,gCAAa,CAAA;AACf,CAAC,EALI,eAAe,KAAf,eAAe,QAKnB;AAID,IAAK,eAGJ;AAHD,WAAK,eAAe;IAClB,oCAAiB,CAAA;IACjB,kCAAe,CAAA;AACjB,CAAC,EAHI,eAAe,KAAf,eAAe,QAGnB;AAsDD,MAAM,eAAe,GAAgD;IACnE,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AEF,MAAM,kBAAkB,GAAG;IACzB,YAAY;IACZ,UAAU;IACV,IAAI;IACJ,QAAQ;IACR,OAAO;IACP,cAAc;IACd,YAAY;IACZ,MAAM;IACN,UAAU;IACV,WAAW;IACX,cAAc;IACd,kBAAkB;IAClB,UAAU;IACV,UAAU;IACV,iBAAiB;IACjB,+BAA+B;IAC/B,UAAU;IACV,qBAAqB;IACrB,uBAAuB;IACvB,wBAAwB;IACxB,WAAW;IACX,WAAW;IACX,UAAU;IACV,YAAY;CACb,CAAC;AAEF,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,iBAAiB,EAAE,kBAAkB,CAAC,CAAC;AAEtE,OAAO,EAAE,QAAQ,EAAE,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport {\n type RowData,\n type Table as DataGridType,\n} from '@tanstack/react-table';\nimport classNames from 'classnames';\nimport {\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { type CommonProps, type HtmlAttributes } from '../_common/types';\nimport { useResizeObserver } from '../hooks';\nimport { type Skeleton } from '../skeleton';\nimport {\n ActionButton,\n ActionCell,\n Body,\n BodyCell,\n BodyRow,\n ColumnControls,\n DropDownCell,\n Header,\n HeaderCell,\n HeaderTitle,\n InlineEditCell,\n LoadingPlaceholder,\n Navigation,\n NoDataIcon,\n NoDataPlaceholder,\n NoDataPlaceholderContentWrapper,\n Pagination,\n PaginationArrowButton,\n PaginationNumericButton,\n PaginationNumericButtons,\n ResizingBar,\n RowsPerPage,\n Scrollable,\n TableResults,\n} from './Components';\nimport {\n type DataGridComponentsInterface,\n DataGridContext,\n type DataGridContextType,\n} from './data-grid-context';\nimport { useTableNav } from './data-grid-nav';\nimport { updateColumnWidths } from './helpers';\n\nenum BorderStyleEnum {\n AllSides = 'all-sides',\n Horizontal = 'horizontal',\n Vertical = 'vertical',\n None = 'none',\n}\n\nexport type BorderStyle = `${BorderStyleEnum}`;\n\nenum HeaderStyleEnum {\n Filled = 'filled',\n Clean = 'clean',\n}\n\nexport type HeaderStyle = `${HeaderStyleEnum}`;\n\nexport type DataGridProps<T extends RowData> = {\n styling?: Partial<{\n /** Alternate the background color of rows */\n hasZebraStriping: boolean;\n /** Type of border that will be used */\n borderStyle: BorderStyle;\n /** If header should have styles or not (Aura example) */\n headerStyle: HeaderStyle;\n /** If background hover effects should be enabled on rows and header cells */\n hasHoverEffects: boolean;\n }>;\n /** Resizing the width of columns */\n isResizable?: boolean;\n /** Enables table's loading state */\n isLoading?: boolean;\n /**\n * Enables keyboard navigation.\n * To control keyboard navigation programmatically\n * for edge cases, pass a `ref` to `tableNavRef`\n */\n isKeyboardNavigable?: boolean;\n /**\n * Enables automatic resizing of columns.\n * If `isResizable` is `true`, the columns will only be automatically resized on initial render of the table.\n * If `isResizable` is `false`, the columns will be resized automatically to always fit the table width (assuming that column maxWidths allow for it).\n * Note: Action columns are a fixed size of 40px, and Pinned columns are not resized automatically.\n * @defaultValue true\n */\n isAutoResizingColumns?: boolean;\n /**\n * Reference to the tableNav instance\n * for programmatic control\n */\n // oxlint-disable-next-line @typescript-eslint/no-explicit-any\n tableNavRef?: React.RefObject<any>;\n /** Table instance created from `useTable`*/\n tableInstance: DataGridType<T>;\n /** Table sub-component overrides */\n components?: DataGridComponentsInterface<T>;\n /** @deprecated Use htmlAttributes, className and style on the root element instead */\n rootProps?: HtmlAttributes<'div'>;\n isSkeletonLoading?: boolean;\n skeletonProps?: React.ComponentProps<typeof Skeleton>;\n /** The target element for portaled elements to be rendered in, e.g. the modal root if the data grid is inside a modal.\n * This is used in for example the DropdownCell, RowsPerPage, and ColumnControls.\n */\n portalTarget?: HTMLElement | null;\n ref?: React.Ref<HTMLDivElement>;\n};\n\nconst DEFAULT_STYLING: Required<DataGridProps<unknown>['styling']> = {\n borderStyle: BorderStyleEnum.Horizontal,\n hasHoverEffects: true,\n hasZebraStriping: false,\n headerStyle: HeaderStyleEnum.Filled,\n};\n\nconst DataGridComponent = function DataGrid<T extends RowData = unknown>({\n isResizable = true,\n isLoading = false,\n isKeyboardNavigable = true,\n isAutoResizingColumns = true,\n tableInstance,\n components,\n rootProps,\n styling = {},\n tableNavRef,\n isSkeletonLoading = false,\n skeletonProps,\n ref,\n portalTarget = document.body,\n htmlAttributes,\n className,\n style,\n ...restProps\n}: CommonProps<'div', DataGridProps<T>>) {\n const { className: rootClassName = '', style: rootStyle = {} } =\n rootProps || {};\n\n const [isScrollable, setIsScrollable] = useState(false);\n const [isMediumNavigation, setIsMediumNavigation] = useState(false);\n const [isSmallNavigation, setIsSmallNavigation] = useState(false);\n const tableRef = useRef<HTMLDivElement>(null);\n const scrollableContainerRef = useRef<HTMLDivElement>(null);\n\n tableInstance.setOptions((prevOptions) => {\n return {\n ...prevOptions,\n enableSorting: isSkeletonLoading ? false : prevOptions.enableSorting,\n };\n });\n\n // Triggers when the whole container is resized\n useResizeObserver({\n onResize: (entry) => {\n if (entry.width === undefined) {\n return;\n }\n isAutoResizingColumns &&\n !isResizable &&\n updateColumnWidths(tableInstance, entry.width); // don't resize columns when the table is resizable due to problems with the resize handler.\n setIsScrollable(tableInstance.getTotalSize() > entry.width);\n setIsMediumNavigation(entry.width <= 680);\n setIsSmallNavigation(entry.width <= 480);\n },\n ref: scrollableContainerRef as React.RefObject<HTMLElement>,\n });\n\n // Triggers when the individual columns are resized\n useResizeObserver({\n onResize: () => {\n if (scrollableContainerRef.current === null) {\n return;\n }\n setIsScrollable(\n tableInstance.getTotalSize() >\n scrollableContainerRef.current.clientWidth,\n );\n },\n ref: tableRef as React.RefObject<HTMLElement>,\n });\n\n const Styling = useMemo(\n () => ({\n ...DEFAULT_STYLING,\n ...styling,\n }),\n [styling],\n );\n\n const Components = useMemo(\n () =>\n ({\n ...DataGridComponents,\n ...components,\n }) as DataGridContextType<T>['components'],\n [components],\n );\n const ScrollableContainer = Components?.Scrollable\n ? Components.Scrollable\n : Scrollable;\n\n const { listeners, tableNav } = useTableNav({\n isDebug: false,\n });\n\n /** Surface the tableNav instance for programmatic control if needed */\n useImperativeHandle(tableNavRef, () => tableNav, [tableNav]);\n\n useEffect(() => {\n if (isAutoResizingColumns && isResizable) {\n updateColumnWidths(\n tableInstance,\n scrollableContainerRef.current?.clientWidth\n ? scrollableContainerRef.current.clientWidth - 1 // -1 to avoid horizontal scrollbar\n : 0,\n );\n }\n }, [isAutoResizingColumns, tableInstance, isResizable]);\n\n return (\n <DataGridContext.Provider\n value={\n {\n components: Components,\n dataGridNav: tableNav,\n hasResizeColumns: isAutoResizingColumns,\n isKeyboardNavigationEnabled: isKeyboardNavigable,\n isLoading: isLoading,\n isMediumNavigation,\n isResizable: isResizable,\n isSkeletonLoading,\n isSmallNavigation,\n portalTarget: portalTarget,\n skeletonProps,\n tableProps: tableInstance,\n } as DataGridContextType<T>\n }\n >\n <div\n // Root props needs to be first in order to override className\n {...rootProps}\n className={classNames('ndl-data-grid-root', rootClassName, className, {\n 'ndl-data-grid-border-horizontal':\n Styling.borderStyle === BorderStyleEnum.Horizontal ||\n Styling.borderStyle === BorderStyleEnum.AllSides,\n 'ndl-data-grid-border-vertical':\n Styling.borderStyle === BorderStyleEnum.Vertical ||\n Styling.borderStyle === BorderStyleEnum.AllSides,\n 'ndl-data-grid-focusable-cells': isKeyboardNavigable,\n 'ndl-data-grid-header-filled':\n Styling.headerStyle === HeaderStyleEnum.Filled,\n 'ndl-data-grid-hover-effects': Styling.hasHoverEffects,\n 'ndl-data-grid-zebra-striping': Styling.hasZebraStriping,\n })}\n ref={ref}\n style={{ ...rootStyle, ...style }}\n {...restProps}\n {...htmlAttributes}\n {...(isKeyboardNavigable ? listeners : {})}\n >\n {/* Make DataGrid horizontally scrollable and avoid horizontal scrollbar have an extra vertical scrollbar (esp. Safari) */}\n {/* This behavior can be overridden by consumers through replacing the scrolling container */}\n <ScrollableContainer\n ref={scrollableContainerRef}\n htmlAttributes={{\n onKeyDown: (e) => {\n if (isScrollable && !isKeyboardNavigable) {\n if (e.key === 'ArrowRight' || e.key === 'ArrowLeft') {\n e.stopPropagation();\n }\n }\n },\n // Ensure that the user can focus and scroll inside the table with arrow keys even if there is no interactive element inside\n tabIndex: isScrollable && !isKeyboardNavigable ? 0 : undefined,\n }}\n >\n {/* Table content Area */}\n <div\n className=\"ndl-div-table\"\n role={isKeyboardNavigable ? 'grid' : 'table'}\n aria-busy={isLoading ? 'true' : 'false'}\n ref={tableRef}\n >\n {/* DataGrid Header Area */}\n {Components?.Header && <Components.Header />}\n {Components?.Body && <Components.Body />}\n </div>\n </ScrollableContainer>\n {/* Bottom Navigation Area */}\n {Components?.Navigation && <Components.Navigation />}\n </div>\n </DataGridContext.Provider>\n );\n};\n\nconst DataGridComponents = {\n ActionButton,\n ActionCell,\n Body,\n BodyCell,\n BodyRow,\n ColumnControls,\n DropDownCell,\n Header,\n HeaderCell,\n HeaderTitle,\n InlineEditCell,\n LoadingPlaceholder,\n Navigation,\n NoDataIcon,\n NoDataPlaceholder,\n NoDataPlaceholderContentWrapper,\n Pagination,\n PaginationArrowButton,\n PaginationNumericButton,\n PaginationNumericButtons,\n ResizingBar,\n RowsPerPage,\n Scrollable,\n TableResults,\n};\n\nconst DataGrid = Object.assign(DataGridComponent, DataGridComponents);\n\nexport { DataGrid };\n"]}
1
+ {"version":3,"file":"DataGrid.js","sourceRoot":"","sources":["../../../src/data-grid/DataGrid.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAwBA,OAAO,UAAU,MAAM,YA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AU;IACV,qBAAqB;IACrB,uBAAuB;IACvB,wBAAwB;IACxB,WAAW;IACX,WAAW;IACX,UAAU;IACV,YAAY;CACb,CAAC;AAEF,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,iBAAiB,EAAE,kBAAkB,CAAC,CAAC;AAEtE,OAAO,EAAE,QAAQ,EAAE,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport {\n type RowData,\n type Table as DataGridType,\n} from '@tanstack/react-table';\nimport classNames from 'classnames';\nimport {\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { type CommonProps, type HtmlAttributes } from '../_common/types';\nimport { useResizeObserver } from '../hooks';\nimport { type Skeleton } from '../skeleton';\nimport {\n ActionButton,\n ActionCell,\n Body,\n BodyCell,\n BodyRow,\n ColumnControls,\n DropDownCell,\n Header,\n HeaderCell,\n HeaderTitle,\n InlineEditCell,\n LoadingPlaceholder,\n Navigation,\n NoDataIcon,\n NoDataPlaceholder,\n NoDataPlaceholderContentWrapper,\n Pagination,\n PaginationArrowButton,\n PaginationNumericButton,\n PaginationNumericButtons,\n ResizingBar,\n RowsPerPage,\n Scrollable,\n TableResults,\n} from './Components';\nimport {\n type DataGridComponentsInterface,\n DataGridContext,\n type DataGridContextType,\n} from './data-grid-context';\nimport { useTableNav } from './data-grid-nav';\nimport { updateColumnWidths } from './helpers';\n\nenum BorderStyleEnum {\n AllSides = 'all-sides',\n Horizontal = 'horizontal',\n Vertical = 'vertical',\n None = 'none',\n}\n\nexport type BorderStyle = `${BorderStyleEnum}`;\n\nenum HeaderStyleEnum {\n Filled = 'filled',\n Clean = 'clean',\n}\n\nexport type HeaderStyle = `${HeaderStyleEnum}`;\n\nexport type DataGridProps<T extends RowData> = {\n styling?: Partial<{\n /** Alternate the background color of rows */\n hasZebraStriping: boolean;\n /** Type of border that will be used */\n borderStyle: BorderStyle;\n /** If header should have styles or not (Aura example) */\n headerStyle: HeaderStyle;\n /** If background hover effects should be enabled on rows and header cells */\n hasHoverEffects: boolean;\n /** If table should have less padding */\n isCompact: boolean;\n }>;\n /** Resizing the width of columns */\n isResizable?: boolean;\n /** Enables table's loading state */\n isLoading?: boolean;\n /**\n * Enables keyboard navigation.\n * To control keyboard navigation programmatically\n * for edge cases, pass a `ref` to `tableNavRef`\n */\n isKeyboardNavigable?: boolean;\n /**\n * Enables automatic resizing of columns.\n * If `isResizable` is `true`, the columns will only be automatically resized on initial render of the table.\n * If `isResizable` is `false`, the columns will be resized automatically to always fit the table width (assuming that column maxWidths allow for it).\n * Note: Action columns are a fixed size of 40px, and Pinned columns are not resized automatically.\n * @defaultValue true\n */\n isAutoResizingColumns?: boolean;\n /**\n * Reference to the tableNav instance\n * for programmatic control\n */\n // oxlint-disable-next-line @typescript-eslint/no-explicit-any\n tableNavRef?: React.RefObject<any>;\n /** Table instance created from `useTable`*/\n tableInstance: DataGridType<T>;\n /** Table sub-component overrides */\n components?: DataGridComponentsInterface<T>;\n /** @deprecated Use htmlAttributes, className and style on the root element instead */\n rootProps?: HtmlAttributes<'div'>;\n isSkeletonLoading?: boolean;\n skeletonProps?: React.ComponentProps<typeof Skeleton>;\n /** The target element for portaled elements to be rendered in, e.g. the modal root if the data grid is inside a modal.\n * This is used in for example the DropdownCell, RowsPerPage, and ColumnControls.\n */\n portalTarget?: HTMLElement | null;\n ref?: React.Ref<HTMLDivElement>;\n};\n\nconst DEFAULT_STYLING: Required<DataGridProps<unknown>['styling']> = {\n borderStyle: BorderStyleEnum.Horizontal,\n hasHoverEffects: true,\n hasZebraStriping: false,\n headerStyle: HeaderStyleEnum.Filled,\n isCompact: false,\n};\n\nconst DataGridComponent = function DataGrid<T extends RowData = unknown>({\n isResizable = true,\n isLoading = false,\n isKeyboardNavigable = true,\n isAutoResizingColumns = true,\n tableInstance,\n components,\n rootProps,\n styling = {},\n tableNavRef,\n isSkeletonLoading = false,\n skeletonProps,\n ref,\n portalTarget = document.body,\n htmlAttributes,\n className,\n style,\n ...restProps\n}: CommonProps<'div', DataGridProps<T>>) {\n const { className: rootClassName = '', style: rootStyle = {} } =\n rootProps || {};\n\n const [isScrollable, setIsScrollable] = useState(false);\n const [isMediumNavigation, setIsMediumNavigation] = useState(false);\n const [isSmallNavigation, setIsSmallNavigation] = useState(false);\n const tableRef = useRef<HTMLDivElement>(null);\n const scrollableContainerRef = useRef<HTMLDivElement>(null);\n\n tableInstance.setOptions((prevOptions) => {\n return {\n ...prevOptions,\n enableSorting: isSkeletonLoading ? false : prevOptions.enableSorting,\n };\n });\n\n // Triggers when the whole container is resized\n useResizeObserver({\n onResize: (entry) => {\n if (entry.width === undefined) {\n return;\n }\n isAutoResizingColumns &&\n !isResizable &&\n updateColumnWidths(tableInstance, entry.width); // don't resize columns when the table is resizable due to problems with the resize handler.\n setIsScrollable(tableInstance.getTotalSize() > entry.width);\n setIsMediumNavigation(entry.width <= 680);\n setIsSmallNavigation(entry.width <= 480);\n },\n ref: scrollableContainerRef as React.RefObject<HTMLElement>,\n });\n\n // Triggers when the individual columns are resized\n useResizeObserver({\n onResize: () => {\n if (scrollableContainerRef.current === null) {\n return;\n }\n setIsScrollable(\n tableInstance.getTotalSize() >\n scrollableContainerRef.current.clientWidth,\n );\n },\n ref: tableRef as React.RefObject<HTMLElement>,\n });\n\n const Styling = useMemo(\n () => ({\n ...DEFAULT_STYLING,\n ...styling,\n }),\n [styling],\n );\n\n const Components = useMemo(\n () =>\n ({\n ...DataGridComponents,\n ...components,\n }) as DataGridContextType<T>['components'],\n [components],\n );\n const ScrollableContainer = Components?.Scrollable\n ? Components.Scrollable\n : Scrollable;\n\n const { listeners, tableNav } = useTableNav({\n isDebug: false,\n });\n\n /** Surface the tableNav instance for programmatic control if needed */\n useImperativeHandle(tableNavRef, () => tableNav, [tableNav]);\n\n useEffect(() => {\n if (isAutoResizingColumns && isResizable) {\n updateColumnWidths(\n tableInstance,\n scrollableContainerRef.current?.clientWidth\n ? scrollableContainerRef.current.clientWidth - 1 // -1 to avoid horizontal scrollbar\n : 0,\n );\n }\n }, [isAutoResizingColumns, tableInstance, isResizable]);\n\n return (\n <DataGridContext.Provider\n value={\n {\n components: Components,\n dataGridNav: tableNav,\n hasResizeColumns: isAutoResizingColumns,\n isKeyboardNavigationEnabled: isKeyboardNavigable,\n isLoading: isLoading,\n isMediumNavigation,\n isResizable: isResizable,\n isSkeletonLoading,\n isSmallNavigation,\n portalTarget: portalTarget,\n skeletonProps,\n tableProps: tableInstance,\n } as DataGridContextType<T>\n }\n >\n <div\n // Root props needs to be first in order to override className\n {...rootProps}\n className={classNames('ndl-data-grid-root', rootClassName, className, {\n 'ndl-data-grid-border-horizontal':\n Styling.borderStyle === BorderStyleEnum.Horizontal ||\n Styling.borderStyle === BorderStyleEnum.AllSides,\n 'ndl-data-grid-border-vertical':\n Styling.borderStyle === BorderStyleEnum.Vertical ||\n Styling.borderStyle === BorderStyleEnum.AllSides,\n 'ndl-data-grid-compact': Styling.isCompact,\n 'ndl-data-grid-focusable-cells': isKeyboardNavigable,\n 'ndl-data-grid-header-filled':\n Styling.headerStyle === HeaderStyleEnum.Filled,\n 'ndl-data-grid-hover-effects': Styling.hasHoverEffects,\n 'ndl-data-grid-zebra-striping': Styling.hasZebraStriping,\n })}\n ref={ref}\n style={{ ...rootStyle, ...style }}\n {...restProps}\n {...htmlAttributes}\n {...(isKeyboardNavigable ? listeners : {})}\n >\n {/* Make DataGrid horizontally scrollable and avoid horizontal scrollbar have an extra vertical scrollbar (esp. Safari) */}\n {/* This behavior can be overridden by consumers through replacing the scrolling container */}\n <ScrollableContainer\n ref={scrollableContainerRef}\n htmlAttributes={{\n onKeyDown: (e) => {\n if (isScrollable && !isKeyboardNavigable) {\n if (e.key === 'ArrowRight' || e.key === 'ArrowLeft') {\n e.stopPropagation();\n }\n }\n },\n // Ensure that the user can focus and scroll inside the table with arrow keys even if there is no interactive element inside\n tabIndex: isScrollable && !isKeyboardNavigable ? 0 : undefined,\n }}\n >\n {/* Table content Area */}\n <div\n className=\"ndl-div-table\"\n role={isKeyboardNavigable ? 'grid' : 'table'}\n aria-busy={isLoading ? 'true' : 'false'}\n ref={tableRef}\n >\n {/* DataGrid Header Area */}\n {Components?.Header && <Components.Header />}\n {Components?.Body && <Components.Body />}\n </div>\n </ScrollableContainer>\n {/* Bottom Navigation Area */}\n {Components?.Navigation && <Components.Navigation />}\n </div>\n </DataGridContext.Provider>\n );\n};\n\nconst DataGridComponents = {\n ActionButton,\n ActionCell,\n Body,\n BodyCell,\n BodyRow,\n ColumnControls,\n DropDownCell,\n Header,\n HeaderCell,\n HeaderTitle,\n InlineEditCell,\n LoadingPlaceholder,\n Navigation,\n NoDataIcon,\n NoDataPlaceholder,\n NoDataPlaceholderContentWrapper,\n Pagination,\n PaginationArrowButton,\n PaginationNumericButton,\n PaginationNumericButtons,\n ResizingBar,\n RowsPerPage,\n Scrollable,\n TableResults,\n};\n\nconst DataGrid = Object.assign(DataGridComponent, DataGridComponents);\n\nexport { DataGrid };\n"]}
@@ -0,0 +1,80 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /**
3
+ *
4
+ * Copyright (c) "Neo4j"
5
+ * Neo4j Sweden AB [http://neo4j.com]
6
+ *
7
+ * This file is part of Neo4j.
8
+ *
9
+ * Neo4j is free software: you can redistribute it and/or modify
10
+ * it under the terms of the GNU General Public License as published by
11
+ * the Free Software Foundation, either version 3 of the License, or
12
+ * (at your option) any later version.
13
+ *
14
+ * This program is distributed in the hope that it will be useful,
15
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
+ * GNU General Public License for more details.
18
+ *
19
+ * You should have received a copy of the GNU General Public License
20
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
21
+ */
22
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
23
+ import { DataGrid } from '@neo4j-ndl/react';
24
+ import { createColumnHelper, getCoreRowModel, getPaginationRowModel, getSortedRowModel, useReactTable, } from '@tanstack/react-table';
25
+ import { TABLE_DEMO_DATA } from './staticData';
26
+ const Component = () => {
27
+ const columnHelper = createColumnHelper();
28
+ const columns = [
29
+ columnHelper.accessor('name', {
30
+ cell: (info) => info.getValue(),
31
+ footer: (info) => info.column.id,
32
+ header: () => 'Name',
33
+ maxSize: 300,
34
+ minSize: 180,
35
+ size: 220,
36
+ }),
37
+ columnHelper.accessor('age', {
38
+ cell: (info) => info.renderValue(),
39
+ footer: (info) => info.column.id,
40
+ header: () => 'Age',
41
+ minSize: 80,
42
+ }),
43
+ columnHelper.accessor('cypherCommand', {
44
+ cell: (info) => info.getValue(),
45
+ footer: (info) => info.column.id,
46
+ header: () => 'Cypher Command',
47
+ minSize: 400,
48
+ size: 400,
49
+ }),
50
+ ];
51
+ const table = useReactTable({
52
+ columnResizeMode: 'onChange',
53
+ columns,
54
+ data: TABLE_DEMO_DATA,
55
+ debugColumns: true,
56
+ debugHeaders: true,
57
+ debugTable: true,
58
+ defaultColumn: {
59
+ maxSize: 800,
60
+ minSize: 80,
61
+ },
62
+ enableSorting: true,
63
+ getCoreRowModel: getCoreRowModel(),
64
+ getPaginationRowModel: getPaginationRowModel(),
65
+ getSortedRowModel: getSortedRowModel(),
66
+ initialState: {
67
+ pagination: {
68
+ pageSize: 5,
69
+ },
70
+ },
71
+ });
72
+ return (_jsx("div", { className: "n-w-full n-bg-light-neutral-text-weakest", children: _jsx(DataGrid, { isResizable: false, tableInstance: table, isKeyboardNavigable: false, styling: {
73
+ borderStyle: 'all-sides',
74
+ hasHoverEffects: true,
75
+ hasZebraStriping: false,
76
+ isCompact: true,
77
+ } }) }));
78
+ };
79
+ export default Component;
80
+ //# sourceMappingURL=datagrid-compact-mode.story.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datagrid-compact-mode.story.js","sourceRoot":"","sources":["../../../../src/data-grid/stories/datagrid-compact-mode.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,qBAAqB,EACrB,iBAAiB,EACjB,aAAa,GACd,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAQ/C,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,YAAY,GAAG,kBAAkB,EAAkB,CAAC;IAE1D,MAAM,OAAO,GAAG;QACd,YAAY,CAAC,QAAQ,CAAC,MAAM,EAAE;YAC5B,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE;YAC/B,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;YAChC,MAAM,EAAE,GAAG,EAAE,CAAC,MAAM;YACpB,OAAO,EAAE,GAAG;YACZ,OAAO,EAAE,GAAG;YACZ,IAAI,EAAE,GAAG;SACV,CAAC;QACF,YAAY,CAAC,QAAQ,CAAC,KAAK,EAAE;YAC3B,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE;YAClC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;YAChC,MAAM,EAAE,GAAG,EAAE,CAAC,KA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j 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 '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { DataGrid } from '@neo4j-ndl/react';\nimport {\n createColumnHelper,\n getCoreRowModel,\n getPaginationRowModel,\n getSortedRowModel,\n useReactTable,\n} from '@tanstack/react-table';\n\nimport { TABLE_DEMO_DATA } from './staticData';\n\ntype TestDataFormat = {\n name: string;\n age: number;\n cypherCommand: string;\n};\n\nconst Component = () => {\n const columnHelper = createColumnHelper<TestDataFormat>();\n\n const columns = [\n columnHelper.accessor('name', {\n cell: (info) => info.getValue(),\n footer: (info) => info.column.id,\n header: () => 'Name',\n maxSize: 300,\n minSize: 180,\n size: 220,\n }),\n columnHelper.accessor('age', {\n cell: (info) => info.renderValue(),\n footer: (info) => info.column.id,\n header: () => 'Age',\n minSize: 80,\n }),\n columnHelper.accessor('cypherCommand', {\n cell: (info) => info.getValue(),\n footer: (info) => info.column.id,\n header: () => 'Cypher Command',\n minSize: 400,\n size: 400,\n }),\n ];\n\n const table = useReactTable({\n columnResizeMode: 'onChange',\n columns,\n data: TABLE_DEMO_DATA,\n debugColumns: true,\n debugHeaders: true,\n debugTable: true,\n defaultColumn: {\n maxSize: 800,\n minSize: 80,\n },\n enableSorting: true,\n getCoreRowModel: getCoreRowModel(),\n getPaginationRowModel: getPaginationRowModel(),\n getSortedRowModel: getSortedRowModel(),\n initialState: {\n pagination: {\n pageSize: 5,\n },\n },\n });\n\n return (\n <div className=\"n-w-full n-bg-light-neutral-text-weakest\">\n <DataGrid\n isResizable={false}\n tableInstance={table}\n isKeyboardNavigable={false}\n styling={{\n borderStyle: 'all-sides',\n hasHoverEffects: true,\n hasZebraStriping: false,\n isCompact: true,\n }}\n />\n </div>\n );\n};\n\nexport default Component;\n"]}
@@ -18,6 +18,7 @@
18
18
  * You should have received a copy of the GNU General Public License
19
19
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
20
  */
21
+ export { default as DataGridCompactMode } from './datagrid-compact-mode.story';
21
22
  export { default as DataGridSimple } from './datagrid-simple.story';
22
23
  export { default as DataGridSortable } from './datagrid-sortable.story';
23
24
  export { default as DataGridSelectable } from './datagrid-selectable.story';
@@ -37,6 +38,7 @@ export { default as DataGridSingleSelectable } from './datagrid-single-selectabl
37
38
  export { default as DataGridUsingEditableCells } from './datagrid-using-editable-cells.story';
38
39
  import { removeLicenseHeader } from '../../_common/export-stories-utils';
39
40
  import DataGridColumnFilteringSourceRaw from './datagrid-column-filtering.story?raw';
41
+ import DataGridCompactModeSourceRaw from './datagrid-compact-mode.story?raw';
40
42
  import DataGridComponentOverridingSourceRaw from './datagrid-component-overriding.story?raw';
41
43
  import DataGridInDialogSourceRaw from './datagrid-in-dialog.story?raw';
42
44
  import DataGridKeyboardNavigationSourceRaw from './datagrid-keyboard-navigation.story?raw';
@@ -55,6 +57,7 @@ import DataGridSortableSourceRaw from './datagrid-sortable.story?raw';
55
57
  import DataGridUsingEditableCellsSourceRaw from './datagrid-using-editable-cells.story?raw';
56
58
  import DataGridVirtualizationSourceRaw from './datagrid-virtualization.story?raw';
57
59
  export const DataGridSimpleSource = removeLicenseHeader(DataGridSimpleSourceRaw);
60
+ export const DataGridCompactModeSource = removeLicenseHeader(DataGridCompactModeSourceRaw);
58
61
  export const DataGridSortableSource = removeLicenseHeader(DataGridSortableSourceRaw);
59
62
  export const DataGridSelectableSource = removeLicenseHeader(DataGridSelectableSourceRaw);
60
63
  export const DataGridSearchableSource = removeLicenseHeader(DataGridSearchableSourceRaw);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../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mBAAmB,CAC1D,4BAA4B,CAC7B,CAAC;AACF,MAAM,CAAC,MAAM,4BAA4B,GAAG,mBAAmB,CAC7D,+BAA+B,CAChC,CAAC;AACF,MAAM,CAAC,MAAM,6BAA6B,GAAG,mBAAmB,CAC9D,gCAAgC,CACjC,CAAC;AACF,MAAM,CAAC,MAAM,+BAA+B,GAAG,mBAAmB,CAChE,kCAAkC,CACnC,CAAC;AACF,MAAM,CAAC,MAAM,6BAA6B,GAAG,mBAAmB,CAC9D,gCAAgC,CACjC,CAAC;AACF,MAAM,CAAC,MAAM,6BAA6B,GAAG,mBAAmB,CAC9D,gCAAgC,CACjC,CAAC;AACF,MAAM,CAAC,MAAM,iCAAiC,GAAG,mBAAmB,CAClE,oCAAoC,CACrC,CAAC;AACF,MAAM,CAAC,MAAM,gCAAgC,GAAG,mBAAmB,CACjE,mCAAmC,CACpC,CAAC;AACF,MAAM,CAAC,MAAM,oCAAoC,GAAG,mBAAmB,CACrE,uCAAuC,CACxC,CAAC;AACF,MAAM,CAAC,MAAM,2BAA2B,GAAG,mBAAmB,CAC5D,8BAA8B,CAC/B,CAAC;AACF,MAAM,CAAC,MAAM,+BAA+B,GAAG,mBAAmB,CAChE,4BAA4B,CAC7B,CAAC;AACF,MAAM,CAAC,MAAM,8BAA8B,GAAG,mBAAmB,CAC/D,iCAAiC,CAClC,CAAC;AACF,MAAM,CAAC,MAAM,gCAAgC,GAAG,mBAAmB,CACjE,mCAAmC,CACpC,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nexport { default as DataGridSimple } from './datagrid-simple.story';\nexport { default as DataGridSortable } from './datagrid-sortable.story';\nexport { default as DataGridSelectable } from './datagrid-selectable.story';\nexport {\n Searchable as DataGridSearchable,\n ColumnFiltering as DataGridColumnFiltering,\n} from './datagrid-search-and-filters.stories';\nexport { default as DataGridInDialog } from './datagrid-in-dialog.story';\nexport { default as DataGridKitchenSink } from './datagrid-kitchen-sink.story';\nexport { default as DataGridVirtualization } from './datagrid-virtualization.story';\nexport { default as DataGridSkeletonLoading } from './datagrid-skeleton-loading.story';\nexport { default as DataGridPlaceholderStates } from './datagrid-placeholder-states.story';\nexport { default as DataGridResizableColumn } from './datagrid-resizable-column.story';\nexport { default as DataGridComponentOverriding } from './datagrid-component-overriding.story';\nexport { default as DataGridKeyboardNavigation } from './datagrid-keyboard-navigation.story';\nexport { default as DataGridPercentageWidthColumns } from './datagrid-percentage-width-columns.story';\nexport {\n PinnedBothSides as DataGridPinnedBothSides,\n PinnedLeftSide as DataGridPinnedLeftSide,\n PinnedRightSide as DataGridPinnedRightSide,\n} from './datagrid-pinned-columns.stories';\nexport { default as DataGridNoPaginationTable } from './datagrid-no-pagination-table.story';\nexport { default as DataGridSingleSelectable } from './datagrid-single-selectable.story';\nexport { default as DataGridUsingEditableCells } from './datagrid-using-editable-cells.story';\n\nimport { removeLicenseHeader } from '../../_common/export-stories-utils';\nimport DataGridColumnFilteringSourceRaw from './datagrid-column-filtering.story?raw';\nimport DataGridComponentOverridingSourceRaw from './datagrid-component-overriding.story?raw';\nimport DataGridInDialogSourceRaw from './datagrid-in-dialog.story?raw';\nimport DataGridKeyboardNavigationSourceRaw from './datagrid-keyboard-navigation.story?raw';\nimport DataGridKitchenSinkSourceRaw from './datagrid-kitchen-sink.story?raw';\nimport DataGridNoPaginationTableRaw from './datagrid-no-pagination-table.story?raw';\nimport DataGridPercentageWidthColumnsSourceRaw from './datagrid-percentage-width-columns.story?raw';\nimport DataGridPinnedColumnsSourceRaw from './datagrid-pinned-columns.stories?raw';\nimport DataGridPlaceholderStatesSourceRaw from './datagrid-placeholder-states.story?raw';\nimport DataGridResizableColumnSourceRaw from './datagrid-resizable-column.story?raw';\nimport DataGridSearchableSourceRaw from './datagrid-search-and-filters.stories?raw';\nimport DataGridSelectableSourceRaw from './datagrid-selectable.story?raw';\nimport DataGridSimpleSourceRaw from './datagrid-simple.story?raw';\nimport DataGridSingleSelectableSourceRaw from './datagrid-single-selectable.story?raw';\nimport DataGridSkeletonLoadingSourceRaw from './datagrid-skeleton-loading.story?raw';\nimport DataGridSortableSourceRaw from './datagrid-sortable.story?raw';\nimport DataGridUsingEditableCellsSourceRaw from './datagrid-using-editable-cells.story?raw';\nimport DataGridVirtualizationSourceRaw from './datagrid-virtualization.story?raw';\n\nexport const DataGridSimpleSource = removeLicenseHeader(\n DataGridSimpleSourceRaw,\n);\nexport const DataGridSortableSource = removeLicenseHeader(\n DataGridSortableSourceRaw,\n);\nexport const DataGridSelectableSource = removeLicenseHeader(\n DataGridSelectableSourceRaw,\n);\nexport const DataGridSearchableSource = removeLicenseHeader(\n DataGridSearchableSourceRaw,\n);\nexport const DataGridInDialogSource = removeLicenseHeader(\n DataGridInDialogSourceRaw,\n);\nexport const DataGridKitchenSinkSource = removeLicenseHeader(\n DataGridKitchenSinkSourceRaw,\n);\nexport const DataGridVirtualizationSource = removeLicenseHeader(\n DataGridVirtualizationSourceRaw,\n);\nexport const DataGridSkeletonLoadingSource = removeLicenseHeader(\n DataGridSkeletonLoadingSourceRaw,\n);\nexport const DataGridPlaceholderStatesSource = removeLicenseHeader(\n DataGridPlaceholderStatesSourceRaw,\n);\nexport const DataGridResizableColumnSource = removeLicenseHeader(\n DataGridResizableColumnSourceRaw,\n);\nexport const DataGridColumnFilteringSource = removeLicenseHeader(\n DataGridColumnFilteringSourceRaw,\n);\nexport const DataGridComponentOverridingSource = removeLicenseHeader(\n DataGridComponentOverridingSourceRaw,\n);\nexport const DataGridKeyboardNavigationSource = removeLicenseHeader(\n DataGridKeyboardNavigationSourceRaw,\n);\nexport const DataGridPercentageWidthColumnsSource = removeLicenseHeader(\n DataGridPercentageWidthColumnsSourceRaw,\n);\nexport const DataGridPinnedColumnsSource = removeLicenseHeader(\n DataGridPinnedColumnsSourceRaw,\n);\nexport const DataGridNoPaginationTableSource = removeLicenseHeader(\n DataGridNoPaginationTableRaw,\n);\nexport const DataGridSingleSelectableSource = removeLicenseHeader(\n DataGridSingleSelectableSourceRaw,\n);\nexport const DataGridUsingEditableCellsSource = removeLicenseHeader(\n DataGridUsingEditableCellsSourceRaw,\n);\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/data-grid/stories/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAC/E,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAC5E,OAAO,EACL,UAAU,IAAI,kBAAkB,EAChC,eAAe,IAAI,uBAAuB,GAC3C,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAC/E,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACpF,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AACvF,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,qCAAqC,CAAC;AAC3F,OAAO,EAAE,OAAO,IAA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rE,uCAAuC,CACxC,CAAC;AACF,MAAM,CAAC,MAAM,2BAA2B,GAAG,mBAAmB,CAC5D,8BAA8B,CAC/B,CAAC;AACF,MAAM,CAAC,MAAM,+BAA+B,GAAG,mBAAmB,CAChE,4BAA4B,CAC7B,CAAC;AACF,MAAM,CAAC,MAAM,8BAA8B,GAAG,mBAAmB,CAC/D,iCAAiC,CAClC,CAAC;AACF,MAAM,CAAC,MAAM,gCAAgC,GAAG,mBAAmB,CACjE,mCAAmC,CACpC,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nexport { default as DataGridCompactMode } from './datagrid-compact-mode.story';\nexport { default as DataGridSimple } from './datagrid-simple.story';\nexport { default as DataGridSortable } from './datagrid-sortable.story';\nexport { default as DataGridSelectable } from './datagrid-selectable.story';\nexport {\n Searchable as DataGridSearchable,\n ColumnFiltering as DataGridColumnFiltering,\n} from './datagrid-search-and-filters.stories';\nexport { default as DataGridInDialog } from './datagrid-in-dialog.story';\nexport { default as DataGridKitchenSink } from './datagrid-kitchen-sink.story';\nexport { default as DataGridVirtualization } from './datagrid-virtualization.story';\nexport { default as DataGridSkeletonLoading } from './datagrid-skeleton-loading.story';\nexport { default as DataGridPlaceholderStates } from './datagrid-placeholder-states.story';\nexport { default as DataGridResizableColumn } from './datagrid-resizable-column.story';\nexport { default as DataGridComponentOverriding } from './datagrid-component-overriding.story';\nexport { default as DataGridKeyboardNavigation } from './datagrid-keyboard-navigation.story';\nexport { default as DataGridPercentageWidthColumns } from './datagrid-percentage-width-columns.story';\nexport {\n PinnedBothSides as DataGridPinnedBothSides,\n PinnedLeftSide as DataGridPinnedLeftSide,\n PinnedRightSide as DataGridPinnedRightSide,\n} from './datagrid-pinned-columns.stories';\nexport { default as DataGridNoPaginationTable } from './datagrid-no-pagination-table.story';\nexport { default as DataGridSingleSelectable } from './datagrid-single-selectable.story';\nexport { default as DataGridUsingEditableCells } from './datagrid-using-editable-cells.story';\n\nimport { removeLicenseHeader } from '../../_common/export-stories-utils';\nimport DataGridColumnFilteringSourceRaw from './datagrid-column-filtering.story?raw';\nimport DataGridCompactModeSourceRaw from './datagrid-compact-mode.story?raw';\nimport DataGridComponentOverridingSourceRaw from './datagrid-component-overriding.story?raw';\nimport DataGridInDialogSourceRaw from './datagrid-in-dialog.story?raw';\nimport DataGridKeyboardNavigationSourceRaw from './datagrid-keyboard-navigation.story?raw';\nimport DataGridKitchenSinkSourceRaw from './datagrid-kitchen-sink.story?raw';\nimport DataGridNoPaginationTableRaw from './datagrid-no-pagination-table.story?raw';\nimport DataGridPercentageWidthColumnsSourceRaw from './datagrid-percentage-width-columns.story?raw';\nimport DataGridPinnedColumnsSourceRaw from './datagrid-pinned-columns.stories?raw';\nimport DataGridPlaceholderStatesSourceRaw from './datagrid-placeholder-states.story?raw';\nimport DataGridResizableColumnSourceRaw from './datagrid-resizable-column.story?raw';\nimport DataGridSearchableSourceRaw from './datagrid-search-and-filters.stories?raw';\nimport DataGridSelectableSourceRaw from './datagrid-selectable.story?raw';\nimport DataGridSimpleSourceRaw from './datagrid-simple.story?raw';\nimport DataGridSingleSelectableSourceRaw from './datagrid-single-selectable.story?raw';\nimport DataGridSkeletonLoadingSourceRaw from './datagrid-skeleton-loading.story?raw';\nimport DataGridSortableSourceRaw from './datagrid-sortable.story?raw';\nimport DataGridUsingEditableCellsSourceRaw from './datagrid-using-editable-cells.story?raw';\nimport DataGridVirtualizationSourceRaw from './datagrid-virtualization.story?raw';\n\nexport const DataGridSimpleSource = removeLicenseHeader(\n DataGridSimpleSourceRaw,\n);\nexport const DataGridCompactModeSource = removeLicenseHeader(\n DataGridCompactModeSourceRaw,\n);\nexport const DataGridSortableSource = removeLicenseHeader(\n DataGridSortableSourceRaw,\n);\nexport const DataGridSelectableSource = removeLicenseHeader(\n DataGridSelectableSourceRaw,\n);\nexport const DataGridSearchableSource = removeLicenseHeader(\n DataGridSearchableSourceRaw,\n);\nexport const DataGridInDialogSource = removeLicenseHeader(\n DataGridInDialogSourceRaw,\n);\nexport const DataGridKitchenSinkSource = removeLicenseHeader(\n DataGridKitchenSinkSourceRaw,\n);\nexport const DataGridVirtualizationSource = removeLicenseHeader(\n DataGridVirtualizationSourceRaw,\n);\nexport const DataGridSkeletonLoadingSource = removeLicenseHeader(\n DataGridSkeletonLoadingSourceRaw,\n);\nexport const DataGridPlaceholderStatesSource = removeLicenseHeader(\n DataGridPlaceholderStatesSourceRaw,\n);\nexport const DataGridResizableColumnSource = removeLicenseHeader(\n DataGridResizableColumnSourceRaw,\n);\nexport const DataGridColumnFilteringSource = removeLicenseHeader(\n DataGridColumnFilteringSourceRaw,\n);\nexport const DataGridComponentOverridingSource = removeLicenseHeader(\n DataGridComponentOverridingSourceRaw,\n);\nexport const DataGridKeyboardNavigationSource = removeLicenseHeader(\n DataGridKeyboardNavigationSourceRaw,\n);\nexport const DataGridPercentageWidthColumnsSource = removeLicenseHeader(\n DataGridPercentageWidthColumnsSourceRaw,\n);\nexport const DataGridPinnedColumnsSource = removeLicenseHeader(\n DataGridPinnedColumnsSourceRaw,\n);\nexport const DataGridNoPaginationTableSource = removeLicenseHeader(\n DataGridNoPaginationTableRaw,\n);\nexport const DataGridSingleSelectableSource = removeLicenseHeader(\n DataGridSingleSelectableSourceRaw,\n);\nexport const DataGridUsingEditableCellsSource = removeLicenseHeader(\n DataGridUsingEditableCellsSourceRaw,\n);\n"]}
@@ -32,7 +32,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
32
32
  */
33
33
  import { autoUpdate, flip, FloatingFocusManager, FloatingList, FloatingNode, FloatingPortal, FloatingTree, offset, safePolygon, shift, useClick, useDismiss, useFloating, useFloatingNodeId, useFloatingParentNodeId, useFloatingTree, useHover, useInteractions, useListItem, useListNavigation, useMergeRefs, useRole, useTypeahead, } from '@floating-ui/react';
34
34
  import classNames from 'classnames';
35
- import { createContext, useContext, useEffect, useRef, useState } from 'react';
35
+ import { createContext, useCallback, useContext, useEffect, useRef, useState, } from 'react';
36
36
  import { ConditionalWrap } from '../conditional-wrap';
37
37
  import { useIsInsideDialog } from '../dialog/dialog-context';
38
38
  import { Divider } from '../divider';
@@ -108,6 +108,9 @@ const MenuComponent = ({ children, isOpen: controlledOpen, onClose, isRoot, anch
108
108
  else if (event instanceof KeyboardEvent) {
109
109
  onClose === null || onClose === void 0 ? void 0 : onClose(event, { type: 'escapeKeyDown' });
110
110
  }
111
+ else if (event instanceof FocusEvent) {
112
+ onClose === null || onClose === void 0 ? void 0 : onClose(event, { type: 'focusOut' });
113
+ }
111
114
  }
112
115
  },
113
116
  open: isOpen,
@@ -172,6 +175,24 @@ const MenuComponent = ({ children, isOpen: controlledOpen, onClose, isRoot, anch
172
175
  tree.events.emit('menuopen', { nodeId, parentId });
173
176
  }
174
177
  }, [tree, isOpen, nodeId, parentId]);
178
+ // Workaround for floating-ui bug where Shift+Tab doesn't trigger
179
+ // closeOnFocusOut.
180
+ // We detect Shift+Tab and check after guards redirect focus whether
181
+ // focus has actually left the floating element.
182
+ // TODO: check every now and then if floating ui addresses this
183
+ const handleShiftTabClose = useCallback((event) => {
184
+ if (event.key === 'Tab' && event.shiftKey) {
185
+ requestAnimationFrame(() => {
186
+ const floatingEl = refs.floating.current;
187
+ if (floatingEl && !floatingEl.contains(document.activeElement)) {
188
+ if (controlledOpen === undefined) {
189
+ setIsOpen(false);
190
+ }
191
+ onClose === null || onClose === void 0 ? void 0 : onClose(undefined, { type: 'focusOut' });
192
+ }
193
+ });
194
+ }
195
+ }, [controlledOpen, onClose, refs]);
175
196
  const menuClasses = classNames('ndl-menu', themeClassName, className);
176
197
  const ref = useMergeRefs([refs.setReference, item.ref, forwardedRef]);
177
198
  return (_jsxs(FloatingNode, { id: nodeId, children: [isRoot !== true && (_jsx(NestedMenuItem, { ref: ref, className: isNested ? 'MenuItem' : 'RootMenu', isDisabled: isDisabled, style: style, htmlAttributes: Object.assign(Object.assign({ 'data-focus-inside': hasFocusInside ? '' : undefined, 'data-nested': isNested ? '' : undefined, 'data-open': isOpen ? '' : undefined, role: isNested ? 'menuitem' : undefined, tabIndex: !isNested
@@ -191,7 +212,9 @@ const MenuComponent = ({ children, isOpen: controlledOpen, onClose, isRoot, anch
191
212
  isOpen: isDisabled === true ? false : isOpen,
192
213
  setActiveIndex,
193
214
  setHasFocusInside,
194
- }, children: _jsx(FloatingList, { elementsRef: elementsRef, labelsRef: labelsRef, children: isOpen && (_jsx(ConditionalWrap, { shouldWrap: isPortaled, wrap: (wrapChildren) => (_jsx(FloatingPortal, { root: portalTarget, children: wrapChildren })), children: _jsx(FloatingFocusManager, { context: context, modal: false, initialFocus: 0, returnFocus: !isNested, closeOnFocusOut: true, guards: true, children: _jsx(Component, Object.assign({ ref: refs.setFloating, className: menuClasses, style: Object.assign(Object.assign({ minWidth: minWidth !== undefined ? `${minWidth}px` : undefined }, floatingStyles), style) }, getFloatingProps(), { children: children })) }) })) }) })] }));
215
+ }, children: _jsx(FloatingList, { elementsRef: elementsRef, labelsRef: labelsRef, children: isOpen && (_jsx(ConditionalWrap, { shouldWrap: isPortaled, wrap: (wrapChildren) => (_jsx(FloatingPortal, { root: portalTarget, children: wrapChildren })), children: _jsx(FloatingFocusManager, { context: context, modal: false, initialFocus: 0, returnFocus: !isNested, closeOnFocusOut: true, guards: true, children: _jsx(Component, Object.assign({ ref: refs.setFloating, className: menuClasses, style: Object.assign(Object.assign({ minWidth: minWidth !== undefined ? `${minWidth}px` : undefined }, floatingStyles), style) }, getFloatingProps({
216
+ onKeyDown: handleShiftTabClose,
217
+ }), { children: children })) }) })) }) })] }));
195
218
  };
196
219
  /**
197
220
  * @internal This is used to build the menu item components. Do not export this component.
@@ -1 +1 @@
1
- {"version":3,"file":"Menu.js","sourceRoot":"","sources":["../../../src/menu/Menu.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EACL,UAAU,EACV,IAAI,EACJ,oBAAoB,EACpB,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,MAAM,EACN,WAAW,EACX,KAAK,EACL,QAAQ,EACR,UAAU,EACV,WAAW,EACX,iBAAiB,EACjB,uBAAuB,EACvB,eAAe,EACf,QAAQ,EACR,eAAe,EACf,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,OAAO,EACP,YAAY,GACb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAM/E,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAY1C,MAAM,WAAW,GAAG,aAAa,CAQ9B;IACD,WAAW,EAAE,IAAI;IACjB,YAAY,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC;IACxB,MAAM,EAAE,KAAK;IACb,gEAAgE;IAChE,cAAc,EAAE,GAAG,EAAE,GAAE,CAAC;IACxB,gEAAgE;IAChE,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AE,aAAF,EAAE,cAAF,EAAE,GAAI,KAAK,CAAC;IACjD,OAAO,CACL,KAAC,SAAS,kBACR,SAAS,EAAE,OAAO,EAClB,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,GAAG,IACJ,SAAS,EACT,cAAc,cAEjB,QAAQ,IACC,CACb,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,CAAC,EAOkB,EAAE,EAAE;QAPtB,EACjB,QAAQ,EACR,SAAS,EACT,cAAc,EACd,KAAK,EACL,GAAG,OAEgC,EADhC,SAAS,cANK,2DAOlB,CADa;IAEZ,MAAM,OAAO,GAAG,UAAU,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAAC;IACxD,OAAO,CACL,4BACE,SAAS,EAAE,OAAO,EAClB,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,GAAG,EACR,IAAI,EAAC,OAAO,IACR,SAAS,EACT,cAAc,cAEjB,QAAQ,IACL,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE;IACtC,YAAY,EAAE,YAAY;IAC1B,OAAO,EAAE,OAAO;IAChB,KAAK,EAAE,SAAS;IAChB,IAAI,EAAE,QAAQ;IACd;;OAEG;IACH,KAAK,EAAE,SAAS;IAChB,SAAS,EAAE,SAAS;CACrB,CAAC,CAAC;AACH,OAAO,EAAE,IAAI,EAAE,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport {\n autoUpdate,\n flip,\n FloatingFocusManager,\n FloatingList,\n FloatingNode,\n FloatingPortal,\n FloatingTree,\n offset,\n safePolygon,\n shift,\n useClick,\n useDismiss,\n useFloating,\n useFloatingNodeId,\n useFloatingParentNodeId,\n useFloatingTree,\n useHover,\n useInteractions,\n useListItem,\n useListNavigation,\n useMergeRefs,\n useRole,\n useTypeahead,\n} from '@floating-ui/react';\nimport classNames from 'classnames';\nimport type React from 'react';\nimport { createContext, useContext, useEffect, useRef, useState } from 'react';\n\nimport {\n type CommonProps,\n type PolymorphicCommonProps,\n} from '../_common/types';\nimport { ConditionalWrap } from '../conditional-wrap';\nimport { useIsInsideDialog } from '../dialog/dialog-context';\nimport { Divider } from '../divider';\nimport { CheckIconOutline, ChevronRightIconOutline } from '../icons';\nimport { placementTranslation } from '../popover';\nimport { useNeedleTheme } from '../theme';\nimport type {\n CategoryItemProps,\n MenuGroupProps,\n MenuItemComponentProps,\n MenuItemProps,\n MenuItemsProps,\n MenuProps,\n NestedMenuItemProps,\n RadioItemProps,\n} from './menu-types';\n\nconst MenuContext = createContext<{\n getItemProps: (\n userProps?: React.HTMLProps<HTMLElement>,\n ) => Record<string, unknown>;\n activeIndex: number | null;\n setActiveIndex: React.Dispatch<React.SetStateAction<number | null>>;\n setHasFocusInside: React.Dispatch<React.SetStateAction<boolean>>;\n isOpen: boolean;\n}>({\n activeIndex: null,\n getItemProps: () => ({}),\n isOpen: false,\n // oxlint-disable-next-line @typescript-eslint/no-empty-function\n setActiveIndex: () => {},\n // oxlint-disable-next-line @typescript-eslint/no-empty-function\n setHasFocusInside: () => {},\n});\n\nconst MenuWrapper = (props: React.ComponentProps<typeof MenuComponent>) => {\n const parentId = useFloatingParentNodeId();\n\n if (parentId === null) {\n return (\n <FloatingTree>\n <MenuComponent {...props} isRoot />\n </FloatingTree>\n );\n }\n\n return <MenuComponent {...props} />;\n};\n\nconst MenuComponent = <T extends React.ElementType = 'div'>({\n children,\n isOpen: controlledOpen,\n onClose,\n isRoot,\n anchorRef,\n as,\n className,\n placement,\n minWidth,\n title,\n isDisabled,\n description,\n icon,\n isPortaled = true,\n portalTarget,\n htmlAttributes,\n strategy,\n ref: forwardedRef,\n style,\n}: PolymorphicCommonProps<T, MenuProps>) => {\n const [isOpen, setIsOpen] = useState(false);\n const [hasFocusInside, setHasFocusInside] = useState(false);\n const [activeIndex, setActiveIndex] = useState<number | null>(null);\n\n const elementsRef = useRef<Array<HTMLButtonElement | null>>([]);\n const labelsRef = useRef<Array<string | null>>([]);\n const parent = useContext(MenuContext);\n\n const isInsideDialog = useIsInsideDialog();\n const tree = useFloatingTree();\n const nodeId = useFloatingNodeId();\n const parentId = useFloatingParentNodeId();\n const item = useListItem();\n const { themeClassName } = useNeedleTheme();\n useEffect(() => {\n if (controlledOpen === undefined) {\n return;\n }\n setIsOpen(controlledOpen);\n }, [controlledOpen]);\n\n useEffect(() => {\n if (isOpen) {\n setActiveIndex(0);\n }\n }, [isOpen]);\n\n const Component = as ?? 'div';\n\n const isNested = parentId !== null;\n\n const defaultPlacement = isNested ? 'right-start' : 'bottom-start';\n\n const { floatingStyles, refs, context } = useFloating<HTMLButtonElement>({\n elements: {\n reference: anchorRef?.current,\n },\n middleware: [\n offset({\n alignmentAxis: isNested ? -4 : 0,\n mainAxis: isNested ? 0 : 4,\n }),\n flip({\n fallbackPlacements: ['left-start', 'right-start'],\n }),\n shift(),\n ],\n nodeId,\n onOpenChange: (open, event) => {\n if (controlledOpen === undefined) {\n setIsOpen(open);\n }\n\n if (!open) {\n if (event instanceof PointerEvent) {\n onClose?.(event, { type: 'backdropClick' });\n } else if (event instanceof KeyboardEvent) {\n onClose?.(event, { type: 'escapeKeyDown' });\n }\n }\n },\n open: isOpen,\n placement: placement ? placementTranslation[placement] : defaultPlacement,\n strategy: strategy ?? (isInsideDialog ? 'fixed' : 'absolute'),\n whileElementsMounted: autoUpdate,\n });\n\n const hover = useHover(context, {\n delay: { open: 75 },\n enabled: isNested,\n handleClose: safePolygon({ blockPointerEvents: true }),\n });\n const click = useClick(context, {\n event: 'mousedown',\n ignoreMouse: isNested,\n toggle: !isNested,\n });\n const role = useRole(context, { role: 'menu' });\n const dismiss = useDismiss(context, { bubbles: true });\n const listNavigation = useListNavigation(context, {\n activeIndex,\n listRef: elementsRef,\n nested: isNested,\n onNavigate: setActiveIndex,\n });\n const typeahead = useTypeahead(context, {\n activeIndex,\n listRef: labelsRef,\n onMatch: isOpen ? setActiveIndex : undefined,\n });\n\n const { getReferenceProps, getFloatingProps, getItemProps } = useInteractions(\n [hover, click, role, dismiss, listNavigation, typeahead],\n );\n\n // Event emitter allows you to communicate across tree components.\n // This effect closes all menus when an item gets clicked anywhere\n // in the tree.\n useEffect(() => {\n if (!tree) {\n return;\n }\n\n function handleTreeClick(data: { id?: string }) {\n if (controlledOpen === undefined) {\n setIsOpen(false);\n }\n onClose?.(undefined, { id: data?.id, type: 'itemClick' });\n }\n\n function onSubMenuOpen(event: { nodeId: string; parentId: string }) {\n if (event.nodeId !== nodeId && event.parentId === parentId) {\n if (controlledOpen === undefined) {\n setIsOpen(false);\n }\n onClose?.(undefined, { type: 'itemClick' });\n }\n }\n\n tree.events.on('click', handleTreeClick);\n tree.events.on('menuopen', onSubMenuOpen);\n\n return () => {\n tree.events.off('click', handleTreeClick);\n tree.events.off('menuopen', onSubMenuOpen);\n };\n }, [tree, nodeId, parentId, onClose, controlledOpen]);\n\n useEffect(() => {\n if (isOpen && tree) {\n tree.events.emit('menuopen', { nodeId, parentId });\n }\n }, [tree, isOpen, nodeId, parentId]);\n\n const menuClasses = classNames('ndl-menu', themeClassName, className);\n const ref = useMergeRefs([refs.setReference, item.ref, forwardedRef]);\n\n return (\n <FloatingNode id={nodeId}>\n {isRoot !== true && (\n <NestedMenuItem\n ref={ref}\n className={isNested ? 'MenuItem' : 'RootMenu'}\n isDisabled={isDisabled}\n style={style}\n htmlAttributes={{\n 'data-focus-inside': hasFocusInside ? '' : undefined,\n 'data-nested': isNested ? '' : undefined,\n 'data-open': isOpen ? '' : undefined,\n role: isNested ? 'menuitem' : undefined,\n tabIndex: !isNested\n ? undefined\n : parent.activeIndex === item.index\n ? 0\n : -1,\n ...htmlAttributes,\n ...getReferenceProps(\n parent.getItemProps({\n onFocus(event: React.FocusEvent<HTMLButtonElement>) {\n htmlAttributes?.onFocus?.(event);\n setHasFocusInside(false);\n parent.setHasFocusInside(true);\n },\n }),\n ),\n }}\n title={title}\n description={description}\n leadingVisual={icon}\n />\n )}\n <MenuContext.Provider\n value={{\n activeIndex,\n getItemProps,\n isOpen: isDisabled === true ? false : isOpen,\n setActiveIndex,\n setHasFocusInside,\n }}\n >\n <FloatingList elementsRef={elementsRef} labelsRef={labelsRef}>\n {isOpen && (\n <ConditionalWrap\n shouldWrap={isPortaled}\n wrap={(wrapChildren) => (\n <FloatingPortal root={portalTarget}>\n {wrapChildren}\n </FloatingPortal>\n )}\n >\n <FloatingFocusManager\n context={context}\n modal={false}\n initialFocus={0}\n returnFocus={!isNested}\n closeOnFocusOut={true}\n guards={true}\n >\n <Component\n ref={refs.setFloating}\n className={menuClasses}\n style={{\n minWidth:\n minWidth !== undefined ? `${minWidth}px` : undefined,\n ...floatingStyles,\n ...style,\n }}\n {...getFloatingProps()}\n >\n {children}\n </Component>\n </FloatingFocusManager>\n </ConditionalWrap>\n )}\n </FloatingList>\n </MenuContext.Provider>\n </FloatingNode>\n );\n};\n\n/**\n * @internal This is used to build the menu item components. Do not export this component.\n */\nconst MenuItemComponent = <T extends React.ElementType = 'button'>({\n title,\n leadingContent,\n trailingContent,\n preLeadingContent,\n description,\n isDisabled,\n as,\n className,\n style,\n htmlAttributes,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, MenuItemComponentProps>) => {\n const classes = classNames(`ndl-menu-item`, className, {\n 'ndl-disabled': isDisabled,\n });\n\n const Component = as ?? 'button';\n\n return (\n <Component\n className={classes}\n ref={ref}\n type=\"button\"\n role=\"menuitem\"\n disabled={isDisabled}\n style={style}\n {...restProps}\n {...htmlAttributes}\n >\n <div className=\"ndl-menu-item-inner\">\n {Boolean(preLeadingContent) && (\n <div className=\"ndl-menu-item-pre-leading-content\">\n {preLeadingContent}\n </div>\n )}\n {Boolean(leadingContent) && (\n <div className=\"ndl-menu-item-leading-content\">{leadingContent}</div>\n )}\n\n <div className=\"ndl-menu-item-title-wrapper\">\n <div className=\"ndl-menu-item-title\">{title}</div>\n {Boolean(description) && (\n <div className=\"ndl-menu-item-description\">{description}</div>\n )}\n </div>\n\n {Boolean(trailingContent) && (\n <div className=\"ndl-menu-item-trailing-content\">\n {trailingContent}\n </div>\n )}\n </div>\n </Component>\n );\n};\n\nconst MenuItem = <T extends React.ElementType = 'button'>({\n title,\n className,\n style,\n leadingVisual,\n trailingContent,\n description,\n isDisabled,\n as,\n onClick,\n onFocus,\n htmlAttributes,\n id,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, MenuItemProps>) => {\n const menu = useContext(MenuContext);\n const itemLabel = typeof title === 'string' ? title : undefined;\n const item = useListItem({ label: isDisabled === true ? null : itemLabel });\n const tree = useFloatingTree();\n const isActive = item.index === menu.activeIndex;\n\n const mergedRefs = useMergeRefs([item.ref, ref]);\n\n return (\n <MenuItemComponent\n as={as ?? 'button'}\n style={style}\n className={className}\n ref={mergedRefs}\n title={title}\n description={description}\n leadingContent={leadingVisual}\n trailingContent={trailingContent}\n isDisabled={isDisabled}\n htmlAttributes={{\n ...htmlAttributes,\n tabIndex: isActive ? 0 : -1,\n ...menu.getItemProps({\n id: id,\n onClick(event: React.MouseEvent<HTMLButtonElement>) {\n onClick?.(event);\n tree?.events.emit('click', { id });\n },\n onFocus(event: React.FocusEvent<HTMLButtonElement>) {\n onFocus?.(event);\n menu.setHasFocusInside(true);\n },\n }),\n }}\n {...restProps}\n />\n );\n};\n\nconst NestedMenuItem = <T extends React.ElementType = 'button'>({\n title,\n isDisabled,\n description,\n leadingVisual,\n as,\n onFocus,\n onClick,\n className,\n style,\n htmlAttributes,\n id,\n ref,\n}: PolymorphicCommonProps<T, NestedMenuItemProps>) => {\n const menu = useContext(MenuContext);\n const itemLabel = typeof title === 'string' ? title : undefined;\n const item = useListItem({ label: isDisabled === true ? null : itemLabel });\n const isActive = item.index === menu.activeIndex;\n const mergedRefs = useMergeRefs([item.ref, ref]);\n\n return (\n <MenuItemComponent\n as={as ?? 'button'}\n style={style}\n className={className}\n ref={mergedRefs}\n title={title}\n description={description}\n leadingContent={leadingVisual}\n trailingContent={\n <ChevronRightIconOutline className=\"ndl-menu-item-chevron\" />\n }\n isDisabled={isDisabled}\n htmlAttributes={{\n ...htmlAttributes,\n tabIndex: isActive ? 0 : -1,\n ...menu.getItemProps({\n onClick(event: React.MouseEvent<HTMLButtonElement>) {\n onClick?.(event);\n },\n onFocus(event: React.FocusEvent<HTMLButtonElement>) {\n onFocus?.(event);\n menu.setHasFocusInside(true);\n },\n onTouchStart() {\n menu.setHasFocusInside(true);\n },\n }),\n id: id,\n }}\n />\n );\n};\n\nconst CategoryItem = <T extends React.ElementType = 'button'>({\n children,\n className,\n style,\n as,\n htmlAttributes,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, CategoryItemProps>) => {\n const classes = classNames('ndl-menu-category-item', className);\n const Component: React.ElementType = as ?? 'div';\n return (\n <Component\n className={classes}\n style={style}\n ref={ref}\n {...restProps}\n {...htmlAttributes}\n >\n {children}\n </Component>\n );\n};\n\nconst RadioItem = <T extends React.ElementType = 'button'>({\n title,\n leadingVisual,\n trailingContent,\n description,\n isDisabled,\n isChecked = false,\n onClick,\n onFocus,\n className,\n style,\n as,\n id,\n htmlAttributes,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, RadioItemProps>) => {\n const menu = useContext(MenuContext);\n const itemLabel = typeof title === 'string' ? title : undefined;\n const item = useListItem({ label: isDisabled === true ? null : itemLabel });\n const tree = useFloatingTree();\n const isActive = item.index === menu.activeIndex;\n\n const mergedRefs = useMergeRefs([item.ref, ref]);\n const classes = classNames('ndl-menu-radio-item', className, {\n 'ndl-checked': isChecked,\n });\n\n return (\n <MenuItemComponent\n as={as ?? 'button'}\n style={style}\n className={classes}\n ref={mergedRefs}\n title={title}\n description={description}\n preLeadingContent={\n isChecked ? (\n <CheckIconOutline className=\"n-size-5 n-shrink-0 n-self-center\" />\n ) : null\n }\n leadingContent={leadingVisual}\n trailingContent={trailingContent}\n isDisabled={isDisabled}\n htmlAttributes={{\n ...htmlAttributes,\n 'aria-checked': isChecked,\n role: 'menuitemradio',\n tabIndex: isActive ? 0 : -1,\n ...menu.getItemProps({\n id: id,\n onClick(event: React.MouseEvent<HTMLButtonElement>) {\n onClick?.(event);\n tree?.events.emit('click', { id });\n },\n onFocus(event: React.FocusEvent<HTMLButtonElement>) {\n onFocus?.(event);\n menu.setHasFocusInside(true);\n },\n }),\n }}\n {...restProps}\n />\n );\n};\n\nconst MenuItems = <T extends React.ElementType = 'div'>({\n as,\n children,\n className,\n htmlAttributes,\n style,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, MenuItemsProps>) => {\n const classes = classNames('ndl-menu-items', className);\n const Component: React.ElementType = as ?? 'div';\n return (\n <Component\n className={classes}\n style={style}\n ref={ref}\n {...restProps}\n {...htmlAttributes}\n >\n {children}\n </Component>\n );\n};\n\nconst MenuGroup = ({\n children,\n className,\n htmlAttributes,\n style,\n ref,\n ...restProps\n}: CommonProps<'div', MenuGroupProps>) => {\n const classes = classNames('ndl-menu-group', className);\n return (\n <div\n className={classes}\n style={style}\n ref={ref}\n role=\"group\"\n {...restProps}\n {...htmlAttributes}\n >\n {children}\n </div>\n );\n};\n\nconst Menu = Object.assign(MenuWrapper, {\n CategoryItem: CategoryItem,\n Divider: Divider,\n Group: MenuGroup,\n Item: MenuItem,\n /**\n * @deprecated Use Menu.Group instead if you want to group items together. If not, you can just omit this component in your implementation.\n */\n Items: MenuItems,\n RadioItem: RadioItem,\n});\nexport { Menu };\n"]}
1
+ {"version":3,"file":"Menu.js","sourceRo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,EAClB,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,GAAG,EACR,IAAI,EAAC,OAAO,IACR,SAAS,EACT,cAAc,cAEjB,QAAQ,IACL,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE;IACtC,YAAY,EAAE,YAAY;IAC1B,OAAO,EAAE,OAAO;IAChB,KAAK,EAAE,SAAS;IAChB,IAAI,EAAE,QAAQ;IACd;;OAEG;IACH,KAAK,EAAE,SAAS;IAChB,SAAS,EAAE,SAAS;CACrB,CAAC,CAAC;AACH,OAAO,EAAE,IAAI,EAAE,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport {\n autoUpdate,\n flip,\n FloatingFocusManager,\n FloatingList,\n FloatingNode,\n FloatingPortal,\n FloatingTree,\n offset,\n safePolygon,\n shift,\n useClick,\n useDismiss,\n useFloating,\n useFloatingNodeId,\n useFloatingParentNodeId,\n useFloatingTree,\n useHover,\n useInteractions,\n useListItem,\n useListNavigation,\n useMergeRefs,\n useRole,\n useTypeahead,\n} from '@floating-ui/react';\nimport classNames from 'classnames';\nimport type React from 'react';\nimport {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useRef,\n useState,\n} from 'react';\n\nimport {\n type CommonProps,\n type PolymorphicCommonProps,\n} from '../_common/types';\nimport { ConditionalWrap } from '../conditional-wrap';\nimport { useIsInsideDialog } from '../dialog/dialog-context';\nimport { Divider } from '../divider';\nimport { CheckIconOutline, ChevronRightIconOutline } from '../icons';\nimport { placementTranslation } from '../popover';\nimport { useNeedleTheme } from '../theme';\nimport type {\n CategoryItemProps,\n MenuGroupProps,\n MenuItemComponentProps,\n MenuItemProps,\n MenuItemsProps,\n MenuProps,\n NestedMenuItemProps,\n RadioItemProps,\n} from './menu-types';\n\nconst MenuContext = createContext<{\n getItemProps: (\n userProps?: React.HTMLProps<HTMLElement>,\n ) => Record<string, unknown>;\n activeIndex: number | null;\n setActiveIndex: React.Dispatch<React.SetStateAction<number | null>>;\n setHasFocusInside: React.Dispatch<React.SetStateAction<boolean>>;\n isOpen: boolean;\n}>({\n activeIndex: null,\n getItemProps: () => ({}),\n isOpen: false,\n // oxlint-disable-next-line @typescript-eslint/no-empty-function\n setActiveIndex: () => {},\n // oxlint-disable-next-line @typescript-eslint/no-empty-function\n setHasFocusInside: () => {},\n});\n\nconst MenuWrapper = (props: React.ComponentProps<typeof MenuComponent>) => {\n const parentId = useFloatingParentNodeId();\n\n if (parentId === null) {\n return (\n <FloatingTree>\n <MenuComponent {...props} isRoot />\n </FloatingTree>\n );\n }\n\n return <MenuComponent {...props} />;\n};\n\nconst MenuComponent = <T extends React.ElementType = 'div'>({\n children,\n isOpen: controlledOpen,\n onClose,\n isRoot,\n anchorRef,\n as,\n className,\n placement,\n minWidth,\n title,\n isDisabled,\n description,\n icon,\n isPortaled = true,\n portalTarget,\n htmlAttributes,\n strategy,\n ref: forwardedRef,\n style,\n}: PolymorphicCommonProps<T, MenuProps>) => {\n const [isOpen, setIsOpen] = useState(false);\n const [hasFocusInside, setHasFocusInside] = useState(false);\n const [activeIndex, setActiveIndex] = useState<number | null>(null);\n\n const elementsRef = useRef<Array<HTMLButtonElement | null>>([]);\n const labelsRef = useRef<Array<string | null>>([]);\n const parent = useContext(MenuContext);\n\n const isInsideDialog = useIsInsideDialog();\n const tree = useFloatingTree();\n const nodeId = useFloatingNodeId();\n const parentId = useFloatingParentNodeId();\n const item = useListItem();\n const { themeClassName } = useNeedleTheme();\n useEffect(() => {\n if (controlledOpen === undefined) {\n return;\n }\n setIsOpen(controlledOpen);\n }, [controlledOpen]);\n\n useEffect(() => {\n if (isOpen) {\n setActiveIndex(0);\n }\n }, [isOpen]);\n\n const Component = as ?? 'div';\n\n const isNested = parentId !== null;\n\n const defaultPlacement = isNested ? 'right-start' : 'bottom-start';\n\n const { floatingStyles, refs, context } = useFloating<HTMLButtonElement>({\n elements: {\n reference: anchorRef?.current,\n },\n middleware: [\n offset({\n alignmentAxis: isNested ? -4 : 0,\n mainAxis: isNested ? 0 : 4,\n }),\n flip({\n fallbackPlacements: ['left-start', 'right-start'],\n }),\n shift(),\n ],\n nodeId,\n onOpenChange: (open, event) => {\n if (controlledOpen === undefined) {\n setIsOpen(open);\n }\n\n if (!open) {\n if (event instanceof PointerEvent) {\n onClose?.(event, { type: 'backdropClick' });\n } else if (event instanceof KeyboardEvent) {\n onClose?.(event, { type: 'escapeKeyDown' });\n } else if (event instanceof FocusEvent) {\n onClose?.(event, { type: 'focusOut' });\n }\n }\n },\n open: isOpen,\n placement: placement ? placementTranslation[placement] : defaultPlacement,\n strategy: strategy ?? (isInsideDialog ? 'fixed' : 'absolute'),\n whileElementsMounted: autoUpdate,\n });\n\n const hover = useHover(context, {\n delay: { open: 75 },\n enabled: isNested,\n handleClose: safePolygon({ blockPointerEvents: true }),\n });\n const click = useClick(context, {\n event: 'mousedown',\n ignoreMouse: isNested,\n toggle: !isNested,\n });\n const role = useRole(context, { role: 'menu' });\n const dismiss = useDismiss(context, { bubbles: true });\n const listNavigation = useListNavigation(context, {\n activeIndex,\n listRef: elementsRef,\n nested: isNested,\n onNavigate: setActiveIndex,\n });\n const typeahead = useTypeahead(context, {\n activeIndex,\n listRef: labelsRef,\n onMatch: isOpen ? setActiveIndex : undefined,\n });\n\n const { getReferenceProps, getFloatingProps, getItemProps } = useInteractions(\n [hover, click, role, dismiss, listNavigation, typeahead],\n );\n\n // Event emitter allows you to communicate across tree components.\n // This effect closes all menus when an item gets clicked anywhere\n // in the tree.\n useEffect(() => {\n if (!tree) {\n return;\n }\n\n function handleTreeClick(data: { id?: string }) {\n if (controlledOpen === undefined) {\n setIsOpen(false);\n }\n onClose?.(undefined, { id: data?.id, type: 'itemClick' });\n }\n\n function onSubMenuOpen(event: { nodeId: string; parentId: string }) {\n if (event.nodeId !== nodeId && event.parentId === parentId) {\n if (controlledOpen === undefined) {\n setIsOpen(false);\n }\n onClose?.(undefined, { type: 'itemClick' });\n }\n }\n\n tree.events.on('click', handleTreeClick);\n tree.events.on('menuopen', onSubMenuOpen);\n\n return () => {\n tree.events.off('click', handleTreeClick);\n tree.events.off('menuopen', onSubMenuOpen);\n };\n }, [tree, nodeId, parentId, onClose, controlledOpen]);\n\n useEffect(() => {\n if (isOpen && tree) {\n tree.events.emit('menuopen', { nodeId, parentId });\n }\n }, [tree, isOpen, nodeId, parentId]);\n\n // Workaround for floating-ui bug where Shift+Tab doesn't trigger\n // closeOnFocusOut.\n // We detect Shift+Tab and check after guards redirect focus whether\n // focus has actually left the floating element.\n // TODO: check every now and then if floating ui addresses this\n const handleShiftTabClose = useCallback(\n (event: React.KeyboardEvent<HTMLElement>) => {\n if (event.key === 'Tab' && event.shiftKey) {\n requestAnimationFrame(() => {\n const floatingEl = refs.floating.current;\n if (floatingEl && !floatingEl.contains(document.activeElement)) {\n if (controlledOpen === undefined) {\n setIsOpen(false);\n }\n onClose?.(undefined, { type: 'focusOut' });\n }\n });\n }\n },\n [controlledOpen, onClose, refs],\n );\n\n const menuClasses = classNames('ndl-menu', themeClassName, className);\n const ref = useMergeRefs([refs.setReference, item.ref, forwardedRef]);\n\n return (\n <FloatingNode id={nodeId}>\n {isRoot !== true && (\n <NestedMenuItem\n ref={ref}\n className={isNested ? 'MenuItem' : 'RootMenu'}\n isDisabled={isDisabled}\n style={style}\n htmlAttributes={{\n 'data-focus-inside': hasFocusInside ? '' : undefined,\n 'data-nested': isNested ? '' : undefined,\n 'data-open': isOpen ? '' : undefined,\n role: isNested ? 'menuitem' : undefined,\n tabIndex: !isNested\n ? undefined\n : parent.activeIndex === item.index\n ? 0\n : -1,\n ...htmlAttributes,\n ...getReferenceProps(\n parent.getItemProps({\n onFocus(event: React.FocusEvent<HTMLButtonElement>) {\n htmlAttributes?.onFocus?.(event);\n setHasFocusInside(false);\n parent.setHasFocusInside(true);\n },\n }),\n ),\n }}\n title={title}\n description={description}\n leadingVisual={icon}\n />\n )}\n <MenuContext.Provider\n value={{\n activeIndex,\n getItemProps,\n isOpen: isDisabled === true ? false : isOpen,\n setActiveIndex,\n setHasFocusInside,\n }}\n >\n <FloatingList elementsRef={elementsRef} labelsRef={labelsRef}>\n {isOpen && (\n <ConditionalWrap\n shouldWrap={isPortaled}\n wrap={(wrapChildren) => (\n <FloatingPortal root={portalTarget}>\n {wrapChildren}\n </FloatingPortal>\n )}\n >\n <FloatingFocusManager\n context={context}\n modal={false}\n initialFocus={0}\n returnFocus={!isNested}\n closeOnFocusOut={true}\n guards={true}\n >\n <Component\n ref={refs.setFloating}\n className={menuClasses}\n style={{\n minWidth:\n minWidth !== undefined ? `${minWidth}px` : undefined,\n ...floatingStyles,\n ...style,\n }}\n {...getFloatingProps({\n onKeyDown: handleShiftTabClose,\n })}\n >\n {children}\n </Component>\n </FloatingFocusManager>\n </ConditionalWrap>\n )}\n </FloatingList>\n </MenuContext.Provider>\n </FloatingNode>\n );\n};\n\n/**\n * @internal This is used to build the menu item components. Do not export this component.\n */\nconst MenuItemComponent = <T extends React.ElementType = 'button'>({\n title,\n leadingContent,\n trailingContent,\n preLeadingContent,\n description,\n isDisabled,\n as,\n className,\n style,\n htmlAttributes,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, MenuItemComponentProps>) => {\n const classes = classNames(`ndl-menu-item`, className, {\n 'ndl-disabled': isDisabled,\n });\n\n const Component = as ?? 'button';\n\n return (\n <Component\n className={classes}\n ref={ref}\n type=\"button\"\n role=\"menuitem\"\n disabled={isDisabled}\n style={style}\n {...restProps}\n {...htmlAttributes}\n >\n <div className=\"ndl-menu-item-inner\">\n {Boolean(preLeadingContent) && (\n <div className=\"ndl-menu-item-pre-leading-content\">\n {preLeadingContent}\n </div>\n )}\n {Boolean(leadingContent) && (\n <div className=\"ndl-menu-item-leading-content\">{leadingContent}</div>\n )}\n\n <div className=\"ndl-menu-item-title-wrapper\">\n <div className=\"ndl-menu-item-title\">{title}</div>\n {Boolean(description) && (\n <div className=\"ndl-menu-item-description\">{description}</div>\n )}\n </div>\n\n {Boolean(trailingContent) && (\n <div className=\"ndl-menu-item-trailing-content\">\n {trailingContent}\n </div>\n )}\n </div>\n </Component>\n );\n};\n\nconst MenuItem = <T extends React.ElementType = 'button'>({\n title,\n className,\n style,\n leadingVisual,\n trailingContent,\n description,\n isDisabled,\n as,\n onClick,\n onFocus,\n htmlAttributes,\n id,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, MenuItemProps>) => {\n const menu = useContext(MenuContext);\n const itemLabel = typeof title === 'string' ? title : undefined;\n const item = useListItem({ label: isDisabled === true ? null : itemLabel });\n const tree = useFloatingTree();\n const isActive = item.index === menu.activeIndex;\n\n const mergedRefs = useMergeRefs([item.ref, ref]);\n\n return (\n <MenuItemComponent\n as={as ?? 'button'}\n style={style}\n className={className}\n ref={mergedRefs}\n title={title}\n description={description}\n leadingContent={leadingVisual}\n trailingContent={trailingContent}\n isDisabled={isDisabled}\n htmlAttributes={{\n ...htmlAttributes,\n tabIndex: isActive ? 0 : -1,\n ...menu.getItemProps({\n id: id,\n onClick(event: React.MouseEvent<HTMLButtonElement>) {\n onClick?.(event);\n tree?.events.emit('click', { id });\n },\n onFocus(event: React.FocusEvent<HTMLButtonElement>) {\n onFocus?.(event);\n menu.setHasFocusInside(true);\n },\n }),\n }}\n {...restProps}\n />\n );\n};\n\nconst NestedMenuItem = <T extends React.ElementType = 'button'>({\n title,\n isDisabled,\n description,\n leadingVisual,\n as,\n onFocus,\n onClick,\n className,\n style,\n htmlAttributes,\n id,\n ref,\n}: PolymorphicCommonProps<T, NestedMenuItemProps>) => {\n const menu = useContext(MenuContext);\n const itemLabel = typeof title === 'string' ? title : undefined;\n const item = useListItem({ label: isDisabled === true ? null : itemLabel });\n const isActive = item.index === menu.activeIndex;\n const mergedRefs = useMergeRefs([item.ref, ref]);\n\n return (\n <MenuItemComponent\n as={as ?? 'button'}\n style={style}\n className={className}\n ref={mergedRefs}\n title={title}\n description={description}\n leadingContent={leadingVisual}\n trailingContent={\n <ChevronRightIconOutline className=\"ndl-menu-item-chevron\" />\n }\n isDisabled={isDisabled}\n htmlAttributes={{\n ...htmlAttributes,\n tabIndex: isActive ? 0 : -1,\n ...menu.getItemProps({\n onClick(event: React.MouseEvent<HTMLButtonElement>) {\n onClick?.(event);\n },\n onFocus(event: React.FocusEvent<HTMLButtonElement>) {\n onFocus?.(event);\n menu.setHasFocusInside(true);\n },\n onTouchStart() {\n menu.setHasFocusInside(true);\n },\n }),\n id: id,\n }}\n />\n );\n};\n\nconst CategoryItem = <T extends React.ElementType = 'button'>({\n children,\n className,\n style,\n as,\n htmlAttributes,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, CategoryItemProps>) => {\n const classes = classNames('ndl-menu-category-item', className);\n const Component: React.ElementType = as ?? 'div';\n return (\n <Component\n className={classes}\n style={style}\n ref={ref}\n {...restProps}\n {...htmlAttributes}\n >\n {children}\n </Component>\n );\n};\n\nconst RadioItem = <T extends React.ElementType = 'button'>({\n title,\n leadingVisual,\n trailingContent,\n description,\n isDisabled,\n isChecked = false,\n onClick,\n onFocus,\n className,\n style,\n as,\n id,\n htmlAttributes,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, RadioItemProps>) => {\n const menu = useContext(MenuContext);\n const itemLabel = typeof title === 'string' ? title : undefined;\n const item = useListItem({ label: isDisabled === true ? null : itemLabel });\n const tree = useFloatingTree();\n const isActive = item.index === menu.activeIndex;\n\n const mergedRefs = useMergeRefs([item.ref, ref]);\n const classes = classNames('ndl-menu-radio-item', className, {\n 'ndl-checked': isChecked,\n });\n\n return (\n <MenuItemComponent\n as={as ?? 'button'}\n style={style}\n className={classes}\n ref={mergedRefs}\n title={title}\n description={description}\n preLeadingContent={\n isChecked ? (\n <CheckIconOutline className=\"n-size-5 n-shrink-0 n-self-center\" />\n ) : null\n }\n leadingContent={leadingVisual}\n trailingContent={trailingContent}\n isDisabled={isDisabled}\n htmlAttributes={{\n ...htmlAttributes,\n 'aria-checked': isChecked,\n role: 'menuitemradio',\n tabIndex: isActive ? 0 : -1,\n ...menu.getItemProps({\n id: id,\n onClick(event: React.MouseEvent<HTMLButtonElement>) {\n onClick?.(event);\n tree?.events.emit('click', { id });\n },\n onFocus(event: React.FocusEvent<HTMLButtonElement>) {\n onFocus?.(event);\n menu.setHasFocusInside(true);\n },\n }),\n }}\n {...restProps}\n />\n );\n};\n\nconst MenuItems = <T extends React.ElementType = 'div'>({\n as,\n children,\n className,\n htmlAttributes,\n style,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, MenuItemsProps>) => {\n const classes = classNames('ndl-menu-items', className);\n const Component: React.ElementType = as ?? 'div';\n return (\n <Component\n className={classes}\n style={style}\n ref={ref}\n {...restProps}\n {...htmlAttributes}\n >\n {children}\n </Component>\n );\n};\n\nconst MenuGroup = ({\n children,\n className,\n htmlAttributes,\n style,\n ref,\n ...restProps\n}: CommonProps<'div', MenuGroupProps>) => {\n const classes = classNames('ndl-menu-group', className);\n return (\n <div\n className={classes}\n style={style}\n ref={ref}\n role=\"group\"\n {...restProps}\n {...htmlAttributes}\n >\n {children}\n </div>\n );\n};\n\nconst Menu = Object.assign(MenuWrapper, {\n CategoryItem: CategoryItem,\n Divider: Divider,\n Group: MenuGroup,\n Item: MenuItem,\n /**\n * @deprecated Use Menu.Group instead if you want to group items together. If not, you can just omit this component in your implementation.\n */\n Items: MenuItems,\n RadioItem: RadioItem,\n});\nexport { Menu };\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"menu-types.js","sourceRoot":"","sources":["../../../src/menu/menu-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG","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 Popover } from '../popover';\n\nexport interface MenuProps {\n /** Whether the menu is open or closed (uncontrolled when omitted) */\n isOpen?: boolean;\n /** Callback function that is called when the menu closes */\n onClose?: (\n event: Event | undefined,\n closeReason: {\n type: 'backdropClick' | 'itemClick' | 'escapeKeyDown';\n id?: string;\n },\n ) => void;\n /** Anchor element ref for positioning */\n anchorRef?: React.RefObject<HTMLElement | null>;\n /** Content displayed inside the menu */\n children?: React.ReactNode;\n /** Whether the menu is a root menu instance. This is set internally by the component based on nesting */\n isRoot?: boolean;\n /** The placement of the floating element is determined by two sets of words. The first set of words specifies the point on the anchor element where the floating element will be attached. The second set of coordinates specifies the point on the floating element that will attach to the anchor element.*/\n placement?: React.ComponentProps<typeof Popover>['placement'];\n /** Minimum width in pixels for the menu component */\n minWidth?: number;\n /** Optional title for nested trigger rendering */\n title?: string;\n /** Whether the menu trigger is disabled */\n isDisabled?: boolean;\n /** Optional description for nested trigger rendering */\n description?: React.ReactNode;\n /** Optional icon for nested trigger rendering */\n icon?: React.ReactNode;\n /** Whether the menu should be wrapped in a floating portal */\n isPortaled?: boolean;\n /** Portal target element (defaults to `document.body`) */\n portalTarget?: HTMLElement | null;\n /** Positioning strategy used by Floating UI */\n strategy?: 'absolute' | 'fixed';\n}\n\nexport interface MenuItemProps {\n /** Title of the menu item component */\n title: React.ReactNode;\n /** Leading icon for the menu item component */\n leadingVisual?: React.ReactNode;\n trailingContent?: React.ReactNode;\n /** Supporting text below title */\n description?: React.ReactNode;\n /** Whether the menu item is disabled */\n isDisabled?: boolean;\n /** Callback function that is called when the menu item is clicked and it closes the menu tree */\n onClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;\n /** Callback function that is called when the menu item is focused */\n onFocus?: (event: React.FocusEvent<HTMLButtonElement>) => void;\n /** Unique identifier for the menu item */\n id?: string;\n /** Content displayed inside the menu item component */\n children?: React.ReactNode;\n}\n\nexport type NestedMenuItemProps = Omit<\n MenuItemProps,\n 'children' | 'trailingContent'\n>;\n\nexport interface MenuItemsProps {\n /** Content displayed inside the menu items component */\n children?: React.ReactNode;\n}\n\nexport interface CategoryItemProps {\n /** Content displayed inside the category item component */\n children?: React.ReactNode;\n}\n\nexport type MenuItemComponentProps = {\n title?: React.ReactNode;\n description?: React.ReactNode;\n className?: string;\n leadingContent?: React.ReactNode;\n trailingContent?: React.ReactNode;\n isDisabled?: boolean;\n preLeadingContent?: React.ReactNode;\n};\n\nexport type RadioItemProps = MenuItemProps & {\n /** Whether the radio item is checked. Marks the item as aria-checked. */\n isChecked?: boolean;\n};\n\nexport type MenuGroupProps = {\n /** Content displayed inside the group. */\n children?: React.ReactNode;\n};\n"]}
1
+ {"version":3,"file":"menu-types.js","sourceRoot":"","sources":["../../../src/menu/menu-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG","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 Popover } from '../popover';\n\nexport interface MenuProps {\n /** Whether the menu is open or closed (uncontrolled when omitted) */\n isOpen?: boolean;\n /** Callback function that is called when the menu closes */\n onClose?: (\n event: Event | undefined,\n closeReason: {\n type: 'backdropClick' | 'itemClick' | 'escapeKeyDown' | 'focusOut';\n id?: string;\n },\n ) => void;\n /** Anchor element ref for positioning */\n anchorRef?: React.RefObject<HTMLElement | null>;\n /** Content displayed inside the menu */\n children?: React.ReactNode;\n /** Whether the menu is a root menu instance. This is set internally by the component based on nesting */\n isRoot?: boolean;\n /** The placement of the floating element is determined by two sets of words. The first set of words specifies the point on the anchor element where the floating element will be attached. The second set of coordinates specifies the point on the floating element that will attach to the anchor element.*/\n placement?: React.ComponentProps<typeof Popover>['placement'];\n /** Minimum width in pixels for the menu component */\n minWidth?: number;\n /** Optional title for nested trigger rendering */\n title?: string;\n /** Whether the menu trigger is disabled */\n isDisabled?: boolean;\n /** Optional description for nested trigger rendering */\n description?: React.ReactNode;\n /** Optional icon for nested trigger rendering */\n icon?: React.ReactNode;\n /** Whether the menu should be wrapped in a floating portal */\n isPortaled?: boolean;\n /** Portal target element (defaults to `document.body`) */\n portalTarget?: HTMLElement | null;\n /** Positioning strategy used by Floating UI */\n strategy?: 'absolute' | 'fixed';\n}\n\nexport interface MenuItemProps {\n /** Title of the menu item component */\n title: React.ReactNode;\n /** Leading icon for the menu item component */\n leadingVisual?: React.ReactNode;\n trailingContent?: React.ReactNode;\n /** Supporting text below title */\n description?: React.ReactNode;\n /** Whether the menu item is disabled */\n isDisabled?: boolean;\n /** Callback function that is called when the menu item is clicked and it closes the menu tree */\n onClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;\n /** Callback function that is called when the menu item is focused */\n onFocus?: (event: React.FocusEvent<HTMLButtonElement>) => void;\n /** Unique identifier for the menu item */\n id?: string;\n /** Content displayed inside the menu item component */\n children?: React.ReactNode;\n}\n\nexport type NestedMenuItemProps = Omit<\n MenuItemProps,\n 'children' | 'trailingContent'\n>;\n\nexport interface MenuItemsProps {\n /** Content displayed inside the menu items component */\n children?: React.ReactNode;\n}\n\nexport interface CategoryItemProps {\n /** Content displayed inside the category item component */\n children?: React.ReactNode;\n}\n\nexport type MenuItemComponentProps = {\n title?: React.ReactNode;\n description?: React.ReactNode;\n className?: string;\n leadingContent?: React.ReactNode;\n trailingContent?: React.ReactNode;\n isDisabled?: boolean;\n preLeadingContent?: React.ReactNode;\n};\n\nexport type RadioItemProps = MenuItemProps & {\n /** Whether the radio item is checked. Marks the item as aria-checked. */\n isChecked?: boolean;\n};\n\nexport type MenuGroupProps = {\n /** Content displayed inside the group. */\n children?: React.ReactNode;\n};\n"]}
@@ -33,6 +33,6 @@ var __rest = (this && this.__rest) || function (s, e) {
33
33
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
34
34
  export const Trail = (_a) => {
35
35
  var { variant, htmlAttributes } = _a, restProps = __rest(_a, ["variant", "htmlAttributes"]);
36
- return (_jsxs("div", Object.assign({ className: "ndl-trail" }, restProps, htmlAttributes, { children: [variant === 'straight' && (_jsx("svg", { className: "ndl-trail-straight", width: "2", height: "24", viewBox: "0 0 2 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M1.00001 16.0005L1 -4.00049L1 28.0004", stroke: "#BBBEC3" }) })), variant === 'curved' && (_jsx("svg", { className: "ndl-trail-curved", width: "9", height: "13", viewBox: "0 0 9 13", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M1 -4L1 3.99988C1 8.41816 4.58172 11.9999 9 11.9999V11.9999", stroke: "#BBBEC3" }) })), variant === 'straight-curved' && (_jsxs("svg", { className: "ndl-trail-straight-curved", width: "16", height: "24", viewBox: "0 0 16 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("g", { clipPath: "url(#clip0_16990_133)", children: _jsx("path", { d: "M16 12V12C11.5817 12 8.00001 8.41828 8.00001 4L8.00001 -4L8 28", stroke: "#BBBEC3" }) }), _jsx("defs", { children: _jsx("clipPath", { id: "clip0_16990_133", children: _jsx("rect", { width: "16", height: "24", fill: "white" }) }) })] }))] })));
36
+ return (_jsxs("div", Object.assign({ className: "ndl-trail" }, restProps, htmlAttributes, { children: [variant === 'straight' && (_jsx("svg", { className: "ndl-trail-straight", "aria-hidden": true, width: "2", height: "24", viewBox: "0 0 2 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M1.00001 16.0005L1 -4.00049L1 28.0004", stroke: "#BBBEC3" }) })), variant === 'curved' && (_jsx("svg", { "aria-hidden": true, className: "ndl-trail-curved", width: "9", height: "13", viewBox: "0 0 9 13", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M1 -4L1 3.99988C1 8.41816 4.58172 11.9999 9 11.9999V11.9999", stroke: "#BBBEC3" }) })), variant === 'straight-curved' && (_jsxs("svg", { "aria-hidden": true, className: "ndl-trail-straight-curved", width: "16", height: "24", viewBox: "0 0 16 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("g", { clipPath: "url(#clip0_16990_133)", children: _jsx("path", { d: "M16 12V12C11.5817 12 8.00001 8.41828 8.00001 4L8.00001 -4L8 28", stroke: "#BBBEC3" }) }), _jsx("defs", { children: _jsx("clipPath", { id: "clip0_16990_133", children: _jsx("rect", { width: "16", height: "24", fill: "white" }) }) })] }))] })));
37
37
  };
38
38
  //# sourceMappingURL=TreeViewTrail.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TreeViewTrail.js","sourceRoot":"","sources":["../../../src/tree-view/TreeViewTrail.tsx"],"names":[],"mappings":";;;;;;;;;;;;AA0BA,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,EAIW,EAAE,EAAE;QAJf,EACpB,OAAO,EACP,cAAc,OAEiB,EAD5B,SAAS,cAHQ,6BAIrB,CADa;IAEZ,OAAO,CACL,6BAAK,SAAS,EAAC,WAAW,IAAK,SAAS,EAAM,cAAc,eACzD,OAAO,KAAK,UAAU,IAAI,CACzB,cACE,SAAS,EAAC,oBAAoB,EAC9B,KAAK,EAAC,GAAG,EACT,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,UAAU,EAClB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B,YAElC,eAAM,CAAC,EAAC,uCAAuC,EAAC,MAAM,EAAC,SAAS,GAAG,GAC/D,CACP,EACA,OAAO,KAAK,QAAQ,IAAI,CACvB,cACE,SAAS,EAAC,kBAAkB,EAC5B,KAAK,EAAC,GAAG,EACT,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,UAAU,EAClB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B,YAElC,eACE,CAAC,EAAC,6DAA6D,EAC/D,MAAM,EAAC,SAAS,GAChB,GACE,CACP,EACA,OAAO,KAAK,iBAAiB,IAAI,CAChC,eACE,SAAS,EAAC,2BAA2B,EACrC,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B,aAElC,YAAG,QAAQ,EAAC,uBAAuB,YACjC,eACE,CAAC,EAAC,gEAAgE,EAClE,MAAM,EAAC,SAAS,GAChB,GACA,EACJ,yBACE,mBAAU,EAAE,EAAC,iBAAiB,YAC5B,eAAM,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,IAAI,EAAC,OAAO,GAAG,GACnC,GACN,IACH,CACP,KACG,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport { type CommonProps } from '../_common/types';\n\nexport type TrailProps = {\n variant: 'straight' | 'curved' | 'straight-curved' | 'none';\n};\nexport const Trail = ({\n variant,\n htmlAttributes,\n ...restProps\n}: CommonProps<'div', TrailProps>) => {\n return (\n <div className=\"ndl-trail\" {...restProps} {...htmlAttributes}>\n {variant === 'straight' && (\n <svg\n className=\"ndl-trail-straight\"\n width=\"2\"\n height=\"24\"\n viewBox=\"0 0 2 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M1.00001 16.0005L1 -4.00049L1 28.0004\" stroke=\"#BBBEC3\" />\n </svg>\n )}\n {variant === 'curved' && (\n <svg\n className=\"ndl-trail-curved\"\n width=\"9\"\n height=\"13\"\n viewBox=\"0 0 9 13\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M1 -4L1 3.99988C1 8.41816 4.58172 11.9999 9 11.9999V11.9999\"\n stroke=\"#BBBEC3\"\n />\n </svg>\n )}\n {variant === 'straight-curved' && (\n <svg\n className=\"ndl-trail-straight-curved\"\n width=\"16\"\n height=\"24\"\n viewBox=\"0 0 16 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <g clipPath=\"url(#clip0_16990_133)\">\n <path\n d=\"M16 12V12C11.5817 12 8.00001 8.41828 8.00001 4L8.00001 -4L8 28\"\n stroke=\"#BBBEC3\"\n />\n </g>\n <defs>\n <clipPath id=\"clip0_16990_133\">\n <rect width=\"16\" height=\"24\" fill=\"white\" />\n </clipPath>\n </defs>\n </svg>\n )}\n </div>\n );\n};\n"]}
1
+ {"version":3,"file":"TreeViewTrail.js","sourceRoot":"","sources":["../../../src/tree-view/TreeViewTrail.tsx"],"names":[],"mappings":";;;;;;;;;;;;AA0BA,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,EAIW,EAAE,EAAE;QAJf,EACpB,OAAO,EACP,cAAc,OAEiB,EAD5B,SAAS,cAHQ,6BAIrB,CADa;IAEZ,OAAO,CACL,6BAAK,SAAS,EAAC,WAAW,IAAK,SAAS,EAAM,cAAc,eACzD,OAAO,KAAK,UAAU,IAAI,CACzB,cACE,SAAS,EAAC,oBAAoB,iBACjB,IAAI,EACjB,KAAK,EAAC,GAAG,EACT,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,UAAU,EAClB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B,YAElC,eAAM,CAAC,EAAC,uCAAuC,EAAC,MAAM,EAAC,SAAS,GAAG,GAC/D,CACP,EACA,OAAO,KAAK,QAAQ,IAAI,CACvB,6BACe,IAAI,EACjB,SAAS,EAAC,kBAAkB,EAC5B,KAAK,EAAC,GAAG,EACT,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,UAAU,EAClB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B,YAElC,eACE,CAAC,EAAC,6DAA6D,EAC/D,MAAM,EAAC,SAAS,GAChB,GACE,CACP,EACA,OAAO,KAAK,iBAAiB,IAAI,CAChC,8BACe,IAAI,EACjB,SAAS,EAAC,2BAA2B,EACrC,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B,aAElC,YAAG,QAAQ,EAAC,uBAAuB,YACjC,eACE,CAAC,EAAC,gEAAgE,EAClE,MAAM,EAAC,SAAS,GAChB,GACA,EACJ,yBACE,mBAAU,EAAE,EAAC,iBAAiB,YAC5B,eAAM,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,IAAI,EAAC,OAAO,GAAG,GACnC,GACN,IACH,CACP,KACG,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport { type CommonProps } from '../_common/types';\n\nexport type TrailProps = {\n variant: 'straight' | 'curved' | 'straight-curved' | 'none';\n};\nexport const Trail = ({\n variant,\n htmlAttributes,\n ...restProps\n}: CommonProps<'div', TrailProps>) => {\n return (\n <div className=\"ndl-trail\" {...restProps} {...htmlAttributes}>\n {variant === 'straight' && (\n <svg\n className=\"ndl-trail-straight\"\n aria-hidden={true}\n width=\"2\"\n height=\"24\"\n viewBox=\"0 0 2 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M1.00001 16.0005L1 -4.00049L1 28.0004\" stroke=\"#BBBEC3\" />\n </svg>\n )}\n {variant === 'curved' && (\n <svg\n aria-hidden={true}\n className=\"ndl-trail-curved\"\n width=\"9\"\n height=\"13\"\n viewBox=\"0 0 9 13\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M1 -4L1 3.99988C1 8.41816 4.58172 11.9999 9 11.9999V11.9999\"\n stroke=\"#BBBEC3\"\n />\n </svg>\n )}\n {variant === 'straight-curved' && (\n <svg\n aria-hidden={true}\n className=\"ndl-trail-straight-curved\"\n width=\"16\"\n height=\"24\"\n viewBox=\"0 0 16 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <g clipPath=\"url(#clip0_16990_133)\">\n <path\n d=\"M16 12V12C11.5817 12 8.00001 8.41828 8.00001 4L8.00001 -4L8 28\"\n stroke=\"#BBBEC3\"\n />\n </g>\n <defs>\n <clipPath id=\"clip0_16990_133\">\n <rect width=\"16\" height=\"24\" fill=\"white\" />\n </clipPath>\n </defs>\n </svg>\n )}\n </div>\n );\n};\n"]}
@@ -44,6 +44,8 @@ export type DataGridProps<T extends RowData> = {
44
44
  headerStyle: HeaderStyle;
45
45
  /** If background hover effects should be enabled on rows and header cells */
46
46
  hasHoverEffects: boolean;
47
+ /** If table should have less padding */
48
+ isCompact: boolean;
47
49
  }>;
48
50
  /** Resizing the width of columns */
49
51
  isResizable?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"DataGrid.d.ts","sourceRoot":"","sources":["../../../src/data-grid/DataGrid.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,KAAK,IAAI,YAAY,EAC3B,MAAM,uBAAuB,CAAC;AAU/B,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEzE,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC;AA2B5C,OAAO,EACL,KAAK,2BAA2B,EAGjC,MAAM,qBAAqB,CAAC;AAI7B,aAAK,eAAe;IAClB,QAAQ,cAAc;IACtB,UAAU,eAAe;IACzB,QAAQ,aAAa;IACrB,IAAI,SAAS;CACd;AAED,MAAM,MAAM,WAAW,GAAG,GAAG,eAAe,EAAE,CAAC;AAE/C,aAAK,eAAe;IAClB,MAAM,WAAW;IACjB,KAAK,UAAU;CAChB;AAED,MAAM,MAAM,WAAW,GAAG,GAAG,eAAe,EAAE,CAAC;AAE/C,MAAM,MAAM,aAAa,CAAC,CAAC,SAA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;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;;OAGG;IAEH,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IACnC,4CAA4C;IAC5C,aAAa,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;IAC/B,oCAAoC;IACpC,UAAU,CAAC,EAAE,2BAA2B,CAAC,CAAC,CAAC,CAAC;IAC5C,sFAAsF;IACtF,SAAS,CAAC,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC;IAClC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,aAAa,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,QAAQ,CAAC,CAAC;IACtD;;OAEG;IACH,YAAY,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAClC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;CACjC,CAAC;AAyNF,QAAA,MAAM,QAAQ,IA/M8B,CAAC,SAAS,OAAO,qPAkB1D,WAAW,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6L8B,CAAC;AAEtE,OAAO,EAAE,QAAQ,EAAE,CAAC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ *
3
+ * Copyright (c) "Neo4j"
4
+ * Neo4j Sweden AB [http://neo4j.com]
5
+ *
6
+ * This file is part of Neo4j.
7
+ *
8
+ * Neo4j is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
+ */
21
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
22
+ declare const Component: () => import("react/jsx-runtime").JSX.Element;
23
+ export default Component;
24
+ //# sourceMappingURL=datagrid-compact-mode.story.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datagrid-compact-mode.story.d.ts","sourceRoot":"","sources":["../../../../src/data-grid/stories/datagrid-compact-mode.story.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAmBjD,QAAA,MAAM,SAAS,+CAgEd,CAAC;AAEF,eAAe,SAAS,CAAC"}