/*! * * Copyright (c) "Neo4j" * Neo4j Sweden AB [http://neo4j.com] * * This file is part of Neo4j. * * Neo4j is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ /** * Typography variants that have a matching `ndl-typography-` class * in the shipped stylesheet (`src/base/typography.css`). Mirrors the keys of * `tokens.typography`. */ export declare const NDL_TYPOGRAPHY_VARIANTS: readonly ["code", "display", "title-1", "title-2", "title-3", "title-4", "subheading-large", "subheading-medium", "subheading-small", "body-large", "body-medium", "body-small", "label"]; export type NdlTypographyVariant = (typeof NDL_TYPOGRAPHY_VARIANTS)[number]; /** Class name prefix used by the public typography classes. */ export declare const NDL_TYPOGRAPHY_CLASS_PREFIX = "ndl-typography-"; /** Theme scope classes, also exposed through `useNeedleTheme().themeClassName`. */ export declare const NDL_THEME_CLASS_NAMES: readonly ["ndl-theme-light", "ndl-theme-dark"]; /** * The complete list of `ndl-*` class names that are part of the public API: * every `ndl-typography-` class and the theme scope classes. * * Exact names rather than prefixes, because internal component classes share * those prefixes (e.g. `ndl-theme-wrapper` from `NeedleThemeProvider`). * * Every other `ndl-*` class in the shipped stylesheet is an implementation * detail of a component and may change without notice. Consumers who want to * prevent accidental reliance on those internals can ban `ndl-*` class names in * their own code and allow only these names. For example, with ESLint's * `no-restricted-syntax`: * * ```js * const { NDL_INTERNAL_CLASS_PATTERN } = require('@neo4j-ndl/base'); * const regex = `/${NDL_INTERNAL_CLASS_PATTERN.source}/`; * * module.exports = { * rules: { * 'no-restricted-syntax': [ * 'error', * { * selector: `Literal[value=${regex}], TemplateElement[value.raw=${regex}]`, * message: * 'Do not style against internal ndl-* component classes. Use component props or your own class names.', * }, * ], * }, * }; * ``` * * And with Stylelint's `selector-disallowed-list`: * * ```js * const { NDL_INTERNAL_CLASS_PATTERN } = require('@neo4j-ndl/base'); * * module.exports = { * rules: { * 'selector-disallowed-list': [ * [new RegExp(`\\.${NDL_INTERNAL_CLASS_PATTERN.source}`)], * { message: 'Do not style against internal ndl-* component classes.' }, * ], * }, * }; * ``` */ export declare const NDL_PUBLIC_CLASS_NAMES: readonly string[]; /** * Matches exactly one of {@link NDL_PUBLIC_CLASS_NAMES}. */ export declare const NDL_PUBLIC_CLASS_PATTERN: RegExp; /** * Matches an `ndl-*` class name that is **not** part of the public API, i.e. * an internal component class. Intended for lint rules that scan class * strings; the pattern is unanchored so it can match anywhere in a string * such as `"my-class ndl-button"`. */ export declare const NDL_INTERNAL_CLASS_PATTERN: RegExp; /** * Returns `true` when the given class name is part of the public `ndl-*` API. * * @param className - A single class name (not a space separated list). */ export declare function isNdlPublicClassName(className: string): boolean;