Heading-1e87a15f.js 591 B

1234567891011121314151617181920
  1. /*!
  2. * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
  3. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
  4. * v1.0.0-beta.97
  5. */
  6. 'use strict';
  7. const index = require('./index-a0010f96.js');
  8. function constrainHeadingLevel(level) {
  9. return Math.min(Math.max(Math.ceil(level), 1), 6);
  10. }
  11. const Heading = (props, children) => {
  12. const HeadingTag = `h${props.level}`;
  13. delete props.level;
  14. return index.h(HeadingTag, { ...props }, children);
  15. };
  16. exports.Heading = Heading;
  17. exports.constrainHeadingLevel = constrainHeadingLevel;