UNPKG

@esri/calcite-components

Version:

Web Components for Esri's Calcite Design System.

14 lines (13 loc) 483 B
/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. */ import { h } from "@stencil/core"; export function constrainHeadingLevel(level) { return Math.min(Math.max(Math.ceil(level), 1), 6); } export const Heading = (props, children) => { const HeadingTag = `h${props.level}`; delete props.level; return h(HeadingTag, Object.assign({}, props), children); };