@bloom-housing/ui-components 13.0.7 → 13.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,8 @@ import * as React from "react";
2
2
  import "./StepHeader.scss";
3
3
  var StepHeader = function (_a) {
4
4
  var currentStep = _a.currentStep, totalSteps = _a.totalSteps, stepPreposition = _a.stepPreposition, stepLabeling = _a.stepLabeling, className = _a.className, priority = _a.priority;
5
- var Tag = "h".concat(priority || 2);
5
+ var limitedPriority = priority && priority >= 1 && priority <= 6 ? priority : 2;
6
+ var Tag = "h".concat(limitedPriority);
6
7
  return (React.createElement(Tag, { className: "step-header ".concat(className || "") },
7
8
  React.createElement("span", { className: "step-header__circle-number" }, currentStep),
8
9
  React.createElement("span", null, "".concat(stepPreposition, " ").concat(totalSteps)),
@@ -1 +1 @@
1
- {"version":3,"file":"StepHeader.js","sourceRoot":"","sources":["../../../src/headers/StepHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,mBAAmB,CAAA;AAW1B,IAAM,UAAU,GAAG,UAAC,EAOF;QANhB,WAAW,iBAAA,EACX,UAAU,gBAAA,EACV,eAAe,qBAAA,EACf,YAAY,kBAAA,EACZ,SAAS,eAAA,EACT,QAAQ,cAAA;IAER,IAAM,GAAG,GAAG,WAAI,QAAQ,IAAI,CAAC,CAAuC,CAAA;IAEpE,OAAO,CACL,oBAAC,GAAG,IAAC,SAAS,EAAE,sBAAe,SAAS,IAAI,EAAE,CAAE;QAC9C,8BAAM,SAAS,EAAC,4BAA4B,IAAE,WAAW,CAAQ;QACjE,kCAAO,UAAG,eAAe,cAAI,UAAU,CAAE,CAAQ;QACjD,8BAAM,SAAS,EAAC,oBAAoB,IACjC,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,GAAG,CAAC,EAAE,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAC5D,CACH,CACP,CAAA;AACH,CAAC,CAAA;AAED,OAAO,EAAE,UAAU,IAAI,OAAO,EAAE,UAAU,EAAE,CAAA"}
1
+ {"version":3,"file":"StepHeader.js","sourceRoot":"","sources":["../../../src/headers/StepHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,mBAAmB,CAAA;AAY1B,IAAM,UAAU,GAAG,UAAC,EAOF;QANhB,WAAW,iBAAA,EACX,UAAU,gBAAA,EACV,eAAe,qBAAA,EACf,YAAY,kBAAA,EACZ,SAAS,eAAA,EACT,QAAQ,cAAA;IAER,IAAM,eAAe,GAAG,QAAQ,IAAI,QAAQ,IAAI,CAAC,IAAI,QAAQ,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAA;IACjF,IAAM,GAAG,GAAG,WAAI,eAAe,CAAgB,CAAA;IAE/C,OAAO,CACL,oBAAC,GAAG,IAAC,SAAS,EAAE,sBAAe,SAAS,IAAI,EAAE,CAAE;QAC9C,8BAAM,SAAS,EAAC,4BAA4B,IAAE,WAAW,CAAQ;QACjE,kCAAO,UAAG,eAAe,cAAI,UAAU,CAAE,CAAQ;QACjD,8BAAM,SAAS,EAAC,oBAAoB,IACjC,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,GAAG,CAAC,EAAE,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAC5D,CACH,CACP,CAAA;AACH,CAAC,CAAA;AAED,OAAO,EAAE,UAAU,IAAI,OAAO,EAAE,UAAU,EAAE,CAAA"}
@@ -15,5 +15,6 @@ declare const HeaderStyleMap: {
15
15
  lightWeighted: string;
16
16
  capsWeighted: string;
17
17
  };
18
+ export type HeadingTag = "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
18
19
  declare const Heading: (props: HeadingProps) => React.JSX.Element;
19
20
  export { Heading as default, Heading };
@@ -1 +1 @@
1
- {"version":3,"file":"Heading.js","sourceRoot":"","sources":["../../../src/text/Heading.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAW9B,IAAM,cAAc,GAAG;IACrB,YAAY,EAAE,qBAAqB;IACnC,YAAY,EAAE,qBAAqB;IACnC,aAAa,EAAE,sBAAsB;IACrC,WAAW,EAAE,oBAAoB;IACjC,iBAAiB,EAAE,0BAA0B;IAC7C,aAAa,EAAE,sBAAsB;IACrC,YAAY,EAAE,qBAAqB;CACpC,CAAA;AAED,IAAM,OAAO,GAAG,UAAC,KAAmB;IAClC,IAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,QAAQ,IAAI,CAAC,IAAI,KAAK,CAAC,QAAQ,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAA;IAClG,IAAM,GAAG,GAAG,WAAI,QAAQ,CAAuC,CAAA;IAC/D,IAAM,UAAU,GAAG,EAAE,CAAA;IACrB,IAAI,KAAK,CAAC,SAAS;QAAE,UAAU,CAAC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAA;IACrE,IAAI,KAAK,CAAC,SAAS;QAAE,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAA;IAErD,OAAO,oBAAC,GAAG,IAAC,SAAS,EAAE,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,IAAG,KAAK,CAAC,QAAQ,CAAO,CAAA;AACrE,CAAC,CAAA;AAED,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,OAAO,EAAE,CAAA"}
1
+ {"version":3,"file":"Heading.js","sourceRoot":"","sources":["../../../src/text/Heading.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAW9B,IAAM,cAAc,GAAG;IACrB,YAAY,EAAE,qBAAqB;IACnC,YAAY,EAAE,qBAAqB;IACnC,aAAa,EAAE,sBAAsB;IACrC,WAAW,EAAE,oBAAoB;IACjC,iBAAiB,EAAE,0BAA0B;IAC7C,aAAa,EAAE,sBAAsB;IACrC,YAAY,EAAE,qBAAqB;CACpC,CAAA;AAID,IAAM,OAAO,GAAG,UAAC,KAAmB;IAClC,IAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,QAAQ,IAAI,CAAC,IAAI,KAAK,CAAC,QAAQ,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAA;IAClG,IAAM,GAAG,GAAG,WAAI,QAAQ,CAAgB,CAAA;IACxC,IAAM,UAAU,GAAG,EAAE,CAAA;IACrB,IAAI,KAAK,CAAC,SAAS;QAAE,UAAU,CAAC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAA;IACrE,IAAI,KAAK,CAAC,SAAS;QAAE,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAA;IAErD,OAAO,oBAAC,GAAG,IAAC,SAAS,EAAE,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,IAAG,KAAK,CAAC,QAAQ,CAAO,CAAA;AACrE,CAAC,CAAA;AAED,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,OAAO,EAAE,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bloom-housing/ui-components",
3
- "version": "13.0.7",
3
+ "version": "13.0.8",
4
4
  "author": "Sean Albert <sean.albert@exygy.com>",
5
5
  "description": "Shared user interface components for Bloom affordable housing system",
6
6
  "homepage": "https://github.com/bloom-housing/ui-components",
@@ -1,5 +1,6 @@
1
1
  import * as React from "react"
2
2
  import "./StepHeader.scss"
3
+ import { HeadingTag } from "../text/Heading"
3
4
 
4
5
  export interface StepHeaderProps {
5
6
  currentStep: number
@@ -18,7 +19,8 @@ const StepHeader = ({
18
19
  className,
19
20
  priority,
20
21
  }: StepHeaderProps) => {
21
- const Tag = `h${priority || 2}` as keyof React.JSX.IntrinsicElements
22
+ const limitedPriority = priority && priority >= 1 && priority <= 6 ? priority : 2
23
+ const Tag = `h${limitedPriority}` as HeadingTag
22
24
 
23
25
  return (
24
26
  <Tag className={`step-header ${className || ""}`}>
@@ -19,9 +19,11 @@ const HeaderStyleMap = {
19
19
  capsWeighted: "text__caps-weighted",
20
20
  }
21
21
 
22
+ export type HeadingTag = "h1" | "h2" | "h3" | "h4" | "h5" | "h6"
23
+
22
24
  const Heading = (props: HeadingProps) => {
23
25
  const priority = props.priority && props.priority >= 1 && props.priority <= 6 ? props.priority : 1
24
- const Tag = `h${priority}` as keyof React.JSX.IntrinsicElements
26
+ const Tag = `h${priority}` as HeadingTag
25
27
  const classNames = []
26
28
  if (props.styleType) classNames.push(HeaderStyleMap[props.styleType])
27
29
  if (props.className) classNames.push(props.className)