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EAAC,SAAS,EAAC,OAAO,EAAE,QAAQ,CAAC,OAAO;YAC3C,aAAK,GAAG,EAAC,OAAO,EAAC,OAAO,EAAE,QAAQ,CAAC,KAAK,EAAE,IAAI,EAAC,QAAQ,eAAW,QAAQ,IACxE,OAAO,CACH;YACL,OAAO,IAAI,CACX,aAAK,GAAG,EAAC,SAAS,EAAC,OAAO,EAAE,QAAQ,CAAC,OAAO,IAC1C,OAAO,CACH,CACN,CACI,CACD,CACN,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { RenderResult } from '@dojo/framework/core/interfaces';\nimport theme from '../middleware/theme';\nimport { create, tsx } from '@dojo/framework/core/vdom';\nimport * as css from '../theme/default/snackbar.m.css';\nimport * as fixedCss from './styles/snackbar.m.css';\n\nexport interface SnackbarProperties {\n\t/** If the snackbar is displayed */\n\topen: boolean;\n\t/** The type of snackbar message */\n\ttype?: 'success' | 'error';\n\t/** If the snackbar contents should be justified at the start */\n\tleading?: boolean;\n\t/** If the snackbar content should be rendered as a column */\n\tstacked?: boolean;\n}\n\nexport interface SnackbarChildren {\n\t/** Renders the message portion of the snackbar */\n\tmessage: RenderResult;\n\t/** If provided, render actions that the user may select */\n\tactions?: RenderResult;\n}\n\nconst factory = create({ theme })\n\t.properties<SnackbarProperties>()\n\t.children<SnackbarChildren>();\n\nexport const Snackbar = factory(function Snackbar({ middleware: { theme }, properties, children }) {\n\tconst { type, open, leading, stacked } = properties();\n\tconst { message, actions } = children()[0];\n\tconst themeCss = theme.classes(css);\n\n\treturn (\n\t\t<div\n\t\t\tkey=\"root\"\n\t\t\tclasses={[\n\t\t\t\ttheme.variant(),\n\t\t\t\tthemeCss.root,\n\t\t\t\tfixedCss.root,\n\t\t\t\topen ? themeCss.open : null,\n\t\t\t\ttype ? themeCss[type] : null,\n\t\t\t\tleading ? themeCss.leading : null,\n\t\t\t\tstacked ? themeCss.stacked : null\n\t\t\t]}\n\t\t>\n\t\t\t<div key=\"content\" classes={themeCss.content}>\n\t\t\t\t<div key=\"label\" classes={themeCss.label} role=\"status\" aria-live=\"polite\">\n\t\t\t\t\t{message}\n\t\t\t\t</div>\n\t\t\t\t{actions && (\n\t\t\t\t\t<div key=\"actions\" classes={themeCss.actions}>\n\t\t\t\t\t\t{actions}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</div>\n\t);\n});\n\nexport default Snackbar;\n"]}