import { EventEmitter } from '../../stencil-public-runtime'; import { MdsPrefThemeEventDetail } from "../../event-detail/theme"; import { MdsPrefChangeEventDetail } from "../../event-detail/preference"; import { PreferenceCornerShapeChoiceType, PreferenceThemeSchemeType } from "../../type/preference"; import { TabSizeType } from "../../type/button"; /** * @slot - Add `mds-pref-theme-item` element/s. * @category preferences */ export declare class MdsPrefTheme { showDropdown: boolean; element: HTMLMdsPrefThemeElement; private readonly localStorageAliasThemeName; private readonly localStorageAliasThemeScheme; private readonly localStorageAliasCornerShape; private currentSelectedItem; private itemsObserver?; private appliedTheme?; private appliedCornerShape?; private themeItems; private userThemeName; private userThemeScheme; private userCornerShape; private readonly t; private readonly clasNameThemeNamePrefix; private previousName; private readonly customPropertyAliasThemeScheme; private readonly customPropertyAliasThemeName; private readonly schemeSet; /** * Sets the size of the component items nested inside it */ readonly size?: TabSizeType; /** * Specifies the theme name attribute * A string representing the theme name, in lowercase kebab-case. * @example 'maggioli-editore' */ name: string; /** * Specifies the theme scheme which can be 'light', 'dark' or 'all' * Default is 'all' which means this theme supporto both light and dark. * If you set 'light' means this theme support only light mode and will be forced and shown light colors mode only. * A theme whose stylesheet declares one mode (`--magma-color-modes`, from `color.modes` of its * file) is applied in that mode whatever this says: the theme's own lock wins. */ scheme: PreferenceThemeSchemeType; /** * Specifies the corner geometry of the whole page: one of the `corner-shape` * keywords, or `default`. * * Corner geometry is theme appearance rather than an accessibility preference, * which is why it lives here next to the theme name and scheme instead of in * `mds-pref-mode`. Setting it writes `data-corner-shape` on ``, where * the generated axis picks both the shape and the radius scale tuned for it. * * Leaving it unset touches nothing. Setting it to `default` REMOVES the * attribute rather than writing today's default into the page, so a project * that never chose keeps following the design system when the default changes. */ cornerShape?: PreferenceCornerShapeChoiceType; /** * Emits when the component changes the language selected from the click event of the dropdown list item. * Its `scheme` is the one the theme is applied with: the mode the theme declares, when it * declares one, or else the scheme of the item. */ themeChangeEvent: EventEmitter; /** * Emits when the component is triggered */ prefChangeEvent: EventEmitter; handleNameChange(name?: string | null): void; handleSchemeChange(scheme?: string | null): void; handleCornerShapeChange(shape?: string | null): void; connectedCallback(): void; componentDidLoad(): void; disconnectedCallback(): void; componentWillRender(): void; /** * The stored choice, or null when there is none or it is one the component cannot apply: an * earlier version stored an unchecked scheme, which then broke every following load (#825). */ private readonly storedChoice; private readonly isThemeName; private readonly isScheme; private readonly isCornerShape; /** * The text of the trigger: the label of the item for the active theme, as the open list * shows it, or, when no item matches, the label an item derives from the name. */ private readonly triggerLabel; private readonly toggleDropdown; private readonly hideThemeDropdownSelect; private readonly changeThemeItem; handleItemSelect(e: CustomEvent): void; private readonly checkThemeSelect; /** * The scheme a theme is applied with: the one mode its stylesheet declares on `` * (`--magma-color-modes`, printed from `color.modes` of the theme file, #1274), or else the * scheme of the item or the prop. The theme's lock wins over the item's: its colours are made * for that mode, and a product that keeps the theme in a file does not repeat it on every * item. The declaration lives under `:root[data-theme-name]`, so the name is written first; * the stylesheet of the theme has to be on the page when the theme is applied. */ private readonly appliedSchemeOf; private readonly setTheme; /** * Apply a corner choice, or do nothing at all when there is none: an unset prop * with nothing in storage must leave the page exactly as the stylesheet ships * it. * * Note the one place this deliberately does NOT follow `setTheme`: * `data-theme-name` is always written, `default` included, which is harmless * only because no CSS block defines a theme called `default`. Here the default * IS a live block, so writing it would freeze today's default into the * consumer's page - `default` removes the attribute instead. */ private readonly setCornerShape; render(): any; }