{"version":3,"file":"types.mjs","names":[],"sources":["../../../src/_common/types.ts"],"sourcesContent":["/*!\n *\n *  Copyright (c) \"Neo4j\"\n *  Neo4j Sweden AB [http://neo4j.com]\n *\n *  This file is part of Neo4j.\n *\n *  Neo4j is free software: you can redistribute it and/or modify\n *  it under the terms of the GNU General Public License as published by\n *  the Free Software Foundation, either version 3 of the License, or\n *  (at your option) any later version.\n *\n *  This program is distributed in the hope that it will be useful,\n *  but WITHOUT ANY WARRANTY; without even the implied warranty of\n *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n *  GNU General Public License for more details.\n *\n *  You should have received a copy of the GNU General Public License\n *  along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport { type tokens } from '@neo4j-ndl/base';\nimport type React from 'react';\n\nimport type { Tooltip } from '../tooltip';\n\nexport type HtmlAttributes<T extends React.ElementType> =\n  React.ComponentPropsWithoutRef<T> & {\n    [key: `data-${string}`]: string | undefined;\n  };\n\ntype BaseProps<T extends React.ElementType> = {\n  /**\n   * Additional classnames will be applied to the root element.\n   */\n  className?: string;\n  /**\n   * Additional css styling. Will be applied to the root element.\n   */\n  style?: React.CSSProperties;\n\n  /**\n   * Html attributes to apply to the root element. This will override any default html attributes, use with caution.\n   */\n  htmlAttributes?: HtmlAttributes<T>;\n\n  /**\n   * A ref to apply to the root element.\n   */\n  ref?: React.ComponentPropsWithRef<T>['ref'];\n};\n\nexport type PolymorphicCommonProps<T extends React.ElementType, P> = P & {\n  /**\n   * An override of the default HTML tag of the root of the component.\n   * Can also be another React component.\n   */\n  as?: T;\n} & BaseProps<T>;\n\nexport type CommonProps<T extends React.ElementType, P> = P & BaseProps<T>;\n\nexport type TooltipObjectProps = {\n  root?: Partial<React.ComponentProps<typeof Tooltip>>;\n  trigger?: Partial<React.ComponentProps<typeof Tooltip.Trigger>>;\n  content?: Partial<React.ComponentProps<typeof Tooltip.Content>>;\n};\n\nexport type Spacing = keyof typeof tokens.space;\n\nexport type Radius = keyof typeof tokens.borderRadius;\n\n/**\n * Currently supporting only native HTML elements.\n */\nexport type CustomElementType = keyof HTMLElementTagNameMap;\n\n/**\n * More info here:\n * https://stackoverflow.com/questions/75085783/conditional-react-component-properties-with-multiple-generics#comment132505139_75086121\n */\n// oxlint-disable-next-line @typescript-eslint/no-explicit-any\nexport type ReactComponent = (args: any) => React.JSX.Element;\n"],"mappings":""}