import * as i0 from "@angular/core"; import { ChangeDetectorRef, ElementRef, EventEmitter, InjectionToken, OnChanges, OnDestroy, OnInit, Renderer2, Signal, SimpleChanges, Type } from "@angular/core"; import { BreakpointObserver, BreakpointState } from "@angular/cdk/layout"; import { Observable } from "rxjs"; import { DaffPersistenceService } from "@daffodil/core"; import * as i1 from "@angular/cdk/a11y"; import { CdkTrapFocus } from "@angular/cdk/a11y"; /** * A type representing what Angular accepts on an animation template binding. * This type should likely be moved to `@angular/animations`. */ export interface AnimationStateWithParams> { value: T; params: V; } /** * Places content before the main content of a component. */ export declare class DaffPrefixDirective { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * Places content after the main content of a component. */ export declare class DaffSuffixDirective { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * @deprecated in favor of standalone components. Deprecated in version 0.91.0. Will be removed in version 1.0.0. */ export declare class DaffPrefixSuffixModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } export declare const DAFF_PREFIX_SUFFIX_DIRECTIVES: readonly [typeof DaffPrefixDirective, typeof DaffSuffixDirective]; /** * The available color options. */ export type DaffColor = 'primary' | 'secondary' | 'tertiary' | 'light' | 'dark' | 'theme' | 'theme-contrast' | 'black' | 'white' | undefined; /** * Enforces consistent use of {@link DaffColor} on a component by applying * color-specific CSS classes and validating the color in dev mode. */ export declare class DaffColorableDirective implements OnChanges, OnInit { /** * The color of the component. */ color: DaffColor; /** * The default color used when no color is set. */ defaultColor: DaffColor; /** * @docs-private */ ngOnChanges(changes: SimpleChanges): void; /** * @docs-private */ ngOnInit(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * Sensible breakpoints for layouts and interfaces used across `@daffodil/design` components. */ export declare enum DaffBreakpoints { /** `min-width: 1920px` */ DESKTOP = "(min-width: 1920px)", /** `min-width: 1440px` */ LAPTOP = "(min-width: 1440px)", /** `min-width: 1200px` */ SMALL_LAPTOP = "(min-width: 1200px)", /** `min-width: 1024px` */ BIG_TABLET = "(min-width: 1024px)", /** `min-width: 768px` */ TABLET = "(min-width: 768px)", /** `min-width: 480px` */ MOBILE = "(min-width: 480px)" } /** * Provides a {@link NoopBreakpointObserver} if the platform is not browser. */ export declare const SERVER_SAFE_BREAKPOINT_OBSERVER: InjectionToken>; /** * A no-op implementation of Angular CDK's `BreakpointObserver` that always reports * no breakpoints as matched. Useful for server-side rendering or testing contexts * where browser layout APIs are unavailable. */ export declare class NoopBreakpointObserver implements Omit { /** * @docs-private */ ngOnDestroy(): void; /** * Always returns `false`, indicating that none of the given media queries are active. */ isMatched(value: string | readonly string[]): boolean; /** * Returns an observable that never emits a `BreakpointState`, making breakpoint-dependent logic inert. */ observe(value: string | readonly string[]): Observable; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } /** * A basic constructor type useful for mixins * See https://blog.mariusschulz.com/2017/05/26/typescript-2-2-mixin-classes * for a really good explanation of why mixins are useful. */ export type Constructor> = new (...args: any[]) => T; /** * The `DaffStatusable` interface defines a component that can have a status. * This status determines the styling or behavior of the component. */ export interface DaffStatusable { /** * The status of the component. */ status: DaffStatus; } /** * The `DaffStatus` type defines the possible status values that a component can have. * - 'info': Indicates an informational status. * - 'warn': Indicates a warning status. * - 'critical': Indicates a critical or error status. * - 'success': Indicates a success status. */ export type DaffStatus = 'info' | 'warn' | 'critical' | 'success'; /** * The `DaffStatusEnum` enumerates the possible status values for a component. */ export declare enum DaffStatusEnum { Info = "info", Warn = "warn", Critical = "critical", Success = "success" } /** * Enforces consistent use of {@link DaffStatus} on a component by applying * status-specific CSS classes and validating the status in dev mode. */ export declare class DaffStatusableDirective implements DaffStatusable, OnChanges, OnInit { /** * The status of the component. */ status: DaffStatus; /** * The default status used when no status is set. */ defaultStatus: DaffStatus; /** * @docs-private */ ngOnChanges(changes: SimpleChanges): void; /** * @docs-private */ ngOnInit(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * Enforces consistent use of the skeleton loading state. */ export declare class DaffSkeletonableDirective { /** * Whether the component displays a skeleton loading screen. */ skeleton: boolean; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * * The available text alignment options. */ export type DaffTextAlignment = 'left' | 'center' | 'right'; /** * @deprecated Deprecated in version 0.93.0. Will be removed in version 1.0.0. * * This is deprecated from the public api, not a full removal. */ export declare enum DaffTextAlignmentEnum { Left = "left", Center = "center", Right = "right" } /** * `DaffTextAlignableDirective` enforces consistent use of text alignment across components. */ export declare class DaffTextAlignableDirective implements OnChanges, OnInit { /** * The text alignment of the component. */ textAlignment: DaffTextAlignment; /** * The default used when no text alignment is set. */ defaultAlignment: DaffTextAlignment; /** * @docs-private */ ngOnChanges(changes: SimpleChanges): void; /** * @docs-private */ ngOnInit(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * Enforces consistent use of the compact property. */ export declare class DaffCompactableDirective { /** * Whether the component is compact. */ compact: boolean; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * `DaffManageContainerLayoutDirective` gives a component the ability to manage a `DaffContainerComponent`'s layout. * By including this directive, predetermined layout styles are passed down to the container. * * To understand the motivation for this directive, consider: * * ```html * * * * ``` * vs. * * ```html * * * * ``` * * The former may inappropriately constrain the width of its child elements, * while the latter (without `DaffManageContainerLayoutDirective`) may unexpectedly * interfere in the layout features of its parent element (i.e. display: grid, display: flex). * * @example Implementing it as an attribute directive * * ```html * * * * ``` * * ```scss * :host { * display: grid; * grid-template-columns: 1fr 1fr; * } * ``` * * @example Implementing it as an Angular host directive * * ```ts * @Component({ * selector: 'my-custom-component', * template: 'my-custom-component.html', * hostDirectives: [{ directive: DaffManageContainerLayoutDirective }], * }) * export class MyCustomComponent { } * * ```scss * :host { * display: grid; * grid-template-columns: 1fr 1fr; * } * ``` * * This directive will apply the `daff-manage-container-layout` class to your component, ensuring that the styles set on `:host` are passed down to the container. */ export declare class DaffManageContainerLayoutDirective { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * The `DaffArticleEncapsulatedDirective` prevents {@link DaffArticleComponent } styles from bleeding into custom components nested within an article. */ export declare class DaffArticleEncapsulatedDirective { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * The possible states of a theme. */ export declare enum DaffTheme { Light = "light", Dark = "dark", System = "system" } /** * A service for retrieving the operating system's theme preference. */ declare class DaffOsThemeService { preference$: Observable; private doc?; constructor(_doc: any); /** * Get the operating system's theme preference. */ getThemePreference(): Observable; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } /** * A service for retrieving and managing the application's stored theme. */ declare class DaffThemeStorageService { private storage; private theme$; private storage$; private doc?; constructor(storage: DaffPersistenceService, _doc: any); /** * Given that Safari doesn't respect in-tab storage events, we have to manually * fire storage events in the open tab on Webkit based browsers. */ private progressStorageEvent; getThemeAsObservable(): Observable; getTheme(): DaffTheme; setTheme(theme: DaffTheme): void; removeThemeSetting(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } /** * A service for controlling the application's theme. */ export declare class DaffThemingService { private osTheme; private themeStorage; private theme$; private theme; constructor(osTheme: DaffOsThemeService, themeStorage: DaffThemeStorageService); /** * Get the current theme. */ getTheme(): Observable; /** * Get the user's stored theme preference. Emits `DaffTheme.System` when no * preference is stored and the theme follows the operating system. */ getThemePreference(): Observable; /** * Set the theme to dark mode. */ darkMode(): void; /** * Set the theme to light mode. */ lightMode(): void; /** * Follow the operating system's theme preference by clearing any stored theme. */ systemMode(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } /** * The theme provider for the app. * This configures updating the body with the theme class. */ export declare const DAFF_THEME_INITIALIZER: import("@angular/core").EnvironmentProviders; /** * A definition for a lazy component. */ export interface DaffLazyComponent { import: () => Promise>; } export declare const daffFocusableElementsSelector = "a[href],a[routerlink], button, input, textarea, select, details, [tabindex]:not([tabindex=\"-1\"])"; export declare class DaffFocusStackService { private document; private _stack; constructor(document: any); /** * Return the current length of the stack. */ length(): number; /** * Adds a HTML element to a focus stack and returns the new length of the stack. * * Generally, you will probably want to call this before you transition focus * onto a new element. * * @example Using the push function * ```ts * this._focusStack.push(this._doc.activeElement); * ``` */ push(el?: HTMLElement | undefined): number; /** * Focuses on the HTML element at the top of a stack. * * @example Using the focus function * ```ts * this._focusStack.focus(this._doc.activeElement); * ``` */ focus(): void; /** * Removes the HMTL element at the top of a stack and focuses on it. */ pop(focus?: boolean): HTMLElement; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } /** * @deprecated Deprecated in version 0.92.1. Will be removed in version 1.0.0. */ export interface DaffSizable { size: T; } export type DaffSizeXSmallType = 'xs'; export type DaffSizeSmallType = 'sm'; export type DaffSizeMediumType = 'md'; export type DaffSizeLargeType = 'lg'; export type DaffSizeXLargeType = 'xl'; /** * All available sizes. */ export type DaffSizeAllType = DaffSizeXSmallType | DaffSizeSmallType | DaffSizeMediumType | DaffSizeLargeType | DaffSizeXLargeType; /** * @deprecated Deprecated in version 0.93.0. Will be removed in version 0.96.0. * * This is deprecated from the public api, not a full removal. */ export declare enum DaffSizableEnum { XSmall = "xs", Small = "sm", Medium = "md", Large = "lg", XLarge = "xl" } /** * `DaffSizableDirective` enforces consistent use of sizes across components. */ export declare class DaffSizableDirective implements OnChanges, OnInit { /** * The size of the component. */ size: T; /** * Sets a default size. */ defaultSize: T; /** * @docs-private */ ngOnChanges(changes: SimpleChanges): void; /** * @docs-private */ ngOnInit(): void; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵdir: i0.ɵɵDirectiveDeclaration, "[daffSizable]", never, { "size": { "alias": "size"; "required": false; }; }, {}, never, never, true, never>; } /** * An interface for giving a component the ability to display an open UI. */ export interface DaffOpenable { /** Whether a component is open or not */ open: Signal; /** Reveal the component */ reveal: () => void; /** Hide the component */ hide: () => void; /** Toggles the component between open and not open */ toggle: () => void; } /** * A directive that opens or closes a component. It should only be used as an [Angular Host Directive](https://angular.dev/guide/directives/directive-composition-api). * This directive is stateless by default, but it supports both a state and stateless implementation. Only one version should be used within a component. * * @example Using the DaffOpenableDirective * ```ts * import { * Component, * ChangeDetectionStrategy, * } from '@angular/core'; * * import { DaffOpenableDirective } from '@daffodil/design'; * * @Component({ * selector: 'custom-component', * template: ` * *
This is a hidden block that can be shown by clicking the button.
* `, * styles: [` * :host { * .hidden-block { * display: none; * } * * &.daff-open { * .hidden-block { * display: block; * } * } * }`], * changeDetection: ChangeDetectionStrategy.OnPush, * hostDirectives: [{ * directive: DaffOpenableDirective, * }], * }) * export class CustomComponent { * constructor(private openDirective: DaffOpenableDirective) {} * * toggle() { * this.openDirective.toggle(); * } * } * ``` */ export declare class DaffOpenableDirective implements DaffOpenable, OnChanges { /** Controls whether the component is open. */ open: import("@angular/core").ModelSignal; private _setOpen; /** Whether or not a component should handle state * * @example Setting the `stateless` property on a component * ```ts * constructor(private openDirective: DaffOpenableDirective) { * this.openDirective.stateless = false; * } * ``` */ stateless: boolean; /** * Event fired when a component is opened (true) or closed (false) */ toggled: EventEmitter; /** * Open the component */ reveal(): void; /** * Close the component */ hide(): void; /** * Open or close the component, depending on if it's currently open or not */ toggle(): void; /** * @docs-private */ ngOnChanges(changes: SimpleChanges): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * The possible types that can be passed to a DaffOrientable component */ export type DaffOrientation = 'horizontal' | 'vertical'; /** * @deprecated Deprecated in version 0.93.0. Will be removed in version 1.0.0. * * This is deprecated from the public api, not a full removal. */ export declare enum DaffOrientationEnum { Horizontal = "horizontal", Vertical = "vertical" } /** * `DaffOrientableDirective`enforces consistent use of orientation across components. */ export declare class DaffOrientableDirective implements OnChanges, OnInit { /** * The orientation of the component. */ orientation: DaffOrientation; /** * The default used when no orientation is set. */ defaultOrientation: DaffOrientation; /** * @docs-private */ ngOnInit(): void; /** * @docs-private */ ngOnChanges(changes: SimpleChanges): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * An interface for giving a component the ability to display a selected UI. * In order to be selectable, the class must implement this property. */ export interface DaffSelectable { selected: boolean; } /** * Enforces consistent use of the selected state. */ export declare class DaffSelectableDirective implements DaffSelectable { private cd; /** * Whether the component is selected. */ selected: boolean; /** * An event that fires after the component becomes selected. */ becameSelected: EventEmitter; constructor(cd: ChangeDetectorRef); /** * Selects the component and emits the `becameSelected` event. */ select(): this; /** * Deselects the component. */ deselect(): this; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * Tracks when a sticky element becomes pinned so it can be styled differently. */ export declare class DaffStickyTrackerDirective implements OnDestroy { private readonly elementRef; private readonly renderer; private readonly document; /** * The edge of the scroll container the element sticks to. */ sticky: 'top' | 'bottom' | undefined; private sentinelObserver?; private readonly className; private lastPinnedState; private debounceTimeout?; private sentinelElement?; private idleCallbackId?; constructor(elementRef: ElementRef, renderer: Renderer2, document: Document); private get isBottomSticky(); private scheduleObserverCreation; private findScrollableParent; private createSentinel; private createSentinelObserver; ngOnDestroy(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * Enforces consistent use of the disabled property. */ export declare class DaffDisableableDirective { /** * Whether the component is disabled. */ disabled: import("@angular/core").ModelSignal; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * An interface for any component or directive that can be disabled. */ export interface DaffDisableable { disabled: boolean; } /** * `DaffLoadableDirective` allows a component to display a loading UI * by conditionally applying a CSS class. This is useful for indicating to * users that a user action is being processed. This directive can be used to * apply a loading UI to any component by toggling the `loading` * input property. When `loading` is `true`, the `daff-loading` CSS class * is applied, which should style the component to look like it's not interactable. * * @example Implementing it as an attribute directive * * ```html *
Content
* ``` * * @example Implementing it as an Angular host directive * * ```ts * @Component({ * selector: 'custom-component', * template: 'custom-component.html', * hostDirectives: [ * { * directive: DaffLoadableDirective, * inputs: ['loading'], * }, * ], * }) * export class CustomComponent { } * ``` * * ```scss * :host { * .spinner { * opacity: 0; * } * .daff-loading { * .spinner { * opacity: 1; * } * } * } * ``` * * The directive applies the `daff-loading` class to the component. The class should be * defined in your styles to display the loading state as desired. */ export declare class DaffLoadableDirective { loading: boolean; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * The public shape of an RTI boundary, exposed to descendant RTI targets. */ export interface DaffRovingTabIndexBoundary { /** * The name of the group defined by this boundary. */ readonly effectiveBoundary: Signal; } /** * Allows RTI targets to inject their nearest ancestor boundary without * creating a circular import with the boundary directive. */ export declare const DAFF_ROVING_TAB_INDEX_BOUNDARY: InjectionToken; declare class DaffRovingTabIndexService { private document; private readonly _hierarchy; private readonly _group; readonly group: import("@angular/core").Signal; constructor(document: Document); enter(group: string): void; leave(): void; next(): void; previous(): void; private _changeFocus; onKeydown(evt: Event): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } /** * Declares that an element is an RTI target. * Automatically applied to `` and `