UNPKG

@esri/calcite-components

Version:

Web Components for Esri's Calcite Design System.

21 lines (17 loc) 612 B
/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.5.0-next.4 */ 'use strict'; const index = require('./index-55f8a3b7.js'); function constrainHeadingLevel(level) { return Math.min(Math.max(Math.ceil(level), 1), 6); } const Heading = (props, children) => { const HeadingTag = props.level ? `h${props.level}` : "div"; delete props.level; return index.h(HeadingTag, { ...props }, children); }; exports.Heading = Heading; exports.constrainHeadingLevel = constrainHeadingLevel;