{"version":3,"file":"eui-components-eui-label.mjs","sources":["../../eui-label/eui-label.component.ts","../../eui-label/index.ts","../../eui-label/eui-components-eui-label.ts"],"sourcesContent":["import { Component, HostBinding, Input, ChangeDetectionStrategy, booleanAttribute, inject } from '@angular/core';\nimport { BaseStatesDirective } from '@eui/components/shared';\n\n/**\n * @description\n * `eui-label` is a versatile textual component used to display labels, sublabels, or inline text associated with other UI elements such as inputs, form fields, or interactive components.\n * It supports multiple visual states, sizes, and variants through host directives and can be rendered as different HTML elements (`<label>`, `<span>`, `<div>`, `<a>`) while preserving consistent EUI styling and behavior.\n * The component is purely structural and semantic. It does not manage layout or interaction by itself.\n *\n * @usageNotes\n * ### Basic Usage\n * ```html\n * <label euiLabel for=\"username\">Username</label>\n * <input euiInputText id=\"username\" />\n * ```\n *\n * ### Required Field\n * ```html\n * <label euiLabel [euiRequired]=\"true\" for=\"email\">Email Address</label>\n * ```\n *\n * ### With Variants\n * ```html\n * <span euiLabel euiDanger>Error message</span>\n * <span euiLabel euiSuccess>Success message</span>\n * ```\n *\n * ### Accessibility\n * - Use `<label>` element with `for` attribute to associate with form controls\n * - Required indicator is visual only; ensure form validation communicates requirement\n * - Color alone should not convey meaning; use additional text or icons\n *\n * ### Notes\n * - Can be used as attribute selector on multiple HTML elements\n * - Supports all BaseStatesDirective variants (primary, secondary, success, info, warning, danger)\n * - Readonly state applies visual styling but does not affect functionality\n */\n@Component({\n    selector: `label[euiLabel], span[euiLabel], div[euiLabel], a[euiLabel], eui-label,\n               label[euiSublabel], span[euiSublabel], div[euiSublabel], a[euiSublabel], eui-sublabel`,\n    template: '<ng-content/>',\n    styleUrl: './eui-label.scss',\n    changeDetection: ChangeDetectionStrategy.OnPush,\n    hostDirectives: [\n        {\n            directive: BaseStatesDirective,\n            inputs: [\n                'euiPrimary',\n                'euiSecondary',\n                'euiSuccess',\n                'euiInfo',\n                'euiWarning',\n                'euiDanger',\n                'euiVariant',\n                'euiSizeS',\n                'euiSizeM',\n                'euiSizeL',\n                'euiSizeVariant',\n                'euiDisabled',\n            ],\n        },\n    ],\n})\nexport class EuiLabelComponent {\n    /**\n     * @description\n     * Computes and returns the CSS classes for the label component based on its current state.\n     * Combines base states, required status, readonly status, and sublabel type.\n     *\n     * @returns {string} Space-separated string of CSS class names\n     */\n    @HostBinding('class')\n    public get cssClasses(): string {\n        return [\n            this.baseStatesDirective.getCssClasses('eui-label'),\n            this.euiRequired ? 'eui-label--required' : '',\n            this.euiReadonly ? 'eui-label--readonly' : '',\n            this.euiSublabel ? 'eui-label__sublabel' : '',\n        ]\n            .join(' ')\n            .trim();\n    }\n\n    /**\n     * @description Indicates if the label should be marked as required\n     * @default false\n     */\n    @Input({ transform: booleanAttribute }) euiRequired = false;\n\n    /**\n     * @description Indicates if the label should be displayed in readonly state\n     * @default false\n     */\n    @Input({ transform: booleanAttribute }) euiReadonly = false;\n\n    /**\n     * @description Indicates if the component should be rendered as a sublabel\n     * @default false\n     */\n    @Input({ transform: booleanAttribute }) euiSublabel = false;\n    baseStatesDirective = inject(BaseStatesDirective);\n}\n","import { EuiLabelComponent } from './eui-label.component';\n\nexport * from './eui-label.component';\n\nexport const EUI_LABEL = [\n    EuiLabelComponent,\n] as const;\n\n// export { EuiLabelComponent as EuiLabel } from './eui-label.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCG;MA2BU,iBAAiB,CAAA;AA1B9B,IAAA,WAAA,GAAA;AA8CI;;;AAGG;QACqC,IAAA,CAAA,WAAW,GAAG,KAAK;AAE3D;;;AAGG;QACqC,IAAA,CAAA,WAAW,GAAG,KAAK;AAE3D;;;AAGG;QACqC,IAAA,CAAA,WAAW,GAAG,KAAK;AAC3D,QAAA,IAAA,CAAA,mBAAmB,GAAG,MAAM,CAAC,mBAAmB,CAAC;AACpD,IAAA;AArCG;;;;;;AAMG;AACH,IAAA,IACW,UAAU,GAAA;Q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