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KAAK,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI;YACzC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI;YACnC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI;YACnC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI;YACrC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI;YAC/B,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI;SACtC,EACD,GAAG,EAAE,KAAK,KAET,QAAQ,EAAE,CACJ,CACR,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,eAAe,KAAK,CAAC","sourcesContent":["import { create, tsx } from '@dojo/framework/core/vdom';\n\nimport * as baseCss from '../common/styles/base.m.css';\nimport theme from '../middleware/theme';\nimport * as css from '../theme/default/label.m.css';\nimport { formatAriaProperties } from '../common/util';\n\nexport interface LabelProperties {\n\t/** Custom aria attributes */\n\taria?: { [key: string]: string | null };\n\t/** If the label should be disabled */\n\tdisabled?: boolean;\n\t/** If the label is focused */\n\tfocused?: boolean;\n\t/** ID to explicitly associate the label with an input element */\n\tforId?: string;\n\t/** If the label should be invisible (it will remain accessible to screen readers) */\n\thidden?: boolean;\n\t/** If the label is read only */\n\treadOnly?: boolean;\n\t/** If the label is required */\n\trequired?: boolean;\n\t/** If the label should use the secondary styling */\n\tsecondary?: boolean;\n\t/** If the label is valid */\n\tvalid?: boolean;\n\t/** ID of the underlying label element */\n\twidgetId?: string;\n\t/** Indicates that the label or it's control are active, will add extra style class */\n\tactive?: boolean;\n}\n\nconst factory = create({ theme }).properties<LabelProperties>();\n\nexport const Label = factory(function Label({ properties, id, children, middleware: { theme } }) {\n\tconst {\n\t\taria = {},\n\t\tactive,\n\t\tdisabled,\n\t\tfocused,\n\t\tforId,\n\t\thidden,\n\t\treadOnly,\n\t\trequired,\n\t\tsecondary,\n\t\tvalid,\n\t\twidgetId = `label-${id}`\n\t} = properties();\n\n\tconst themeCss = theme.classes(css);\n\n\treturn (\n\t\t<label\n\t\t\t{...formatAriaProperties(aria)}\n\t\t\tid={widgetId}\n\t\t\tclasses={[\n\t\t\t\ttheme.variant(),\n\t\t\t\tthemeCss.root,\n\t\t\t\tdisabled ? themeCss.disabled : null,\n\t\t\t\tfocused ? themeCss.focused : null,\n\t\t\t\tvalid === true ? themeCss.valid : null,\n\t\t\t\tvalid === false ? themeCss.invalid : null,\n\t\t\t\treadOnly ? themeCss.readonly : null,\n\t\t\t\trequired ? themeCss.required : null,\n\t\t\t\tsecondary ? themeCss.secondary : null,\n\t\t\t\tactive ? themeCss.active : null,\n\t\t\t\thidden ? baseCss.visuallyHidden : null\n\t\t\t]}\n\t\t\tfor={forId}\n\t\t>\n\t\t\t{children()}\n\t\t</label>\n\t);\n});\n\nexport default Label;\n"]}