@bloom-housing/ui-components 12.0.28 → 12.0.29

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.
@@ -1,6 +1,6 @@
1
1
  import { UseFormMethods } from "react-hook-form";
2
2
  type FormAddressProps = {
3
- subtitle: string;
3
+ subtitle?: string;
4
4
  dataKey: string;
5
5
  enableMailCheckbox?: boolean;
6
6
  register: UseFormMethods["register"];
@@ -4,28 +4,30 @@ export var FormAddress = function (_a) {
4
4
  var _b, _c, _d;
5
5
  var subtitle = _a.subtitle, dataKey = _a.dataKey, _e = _a.enableMailCheckbox, enableMailCheckbox = _e === void 0 ? false : _e, register = _a.register, errors = _a.errors, required = _a.required, stateKeys = _a.stateKeys;
6
6
  return (React.createElement(React.Fragment, null,
7
- React.createElement(GridSection, { subtitle: subtitle },
8
- React.createElement(GridCell, { span: 2 },
9
- React.createElement(ViewItem, { label: t("application.contact.streetAddress") },
10
- React.createElement(Field, { id: "".concat(dataKey, ".street"), name: "".concat(dataKey, ".street"), label: t("application.contact.streetAddress"), placeholder: t("application.contact.streetAddress"), register: register, validation: { required: required, maxLength: 64 }, error: !!resolveObject("".concat(dataKey, ".street"), errors), errorMessage: ((_b = resolveObject("".concat(dataKey, ".street"), errors)) === null || _b === void 0 ? void 0 : _b.type) === "maxLength"
11
- ? t("errors.maxLength")
12
- : t("errors.streetError"), readerOnly: true }))),
13
- React.createElement(GridCell, null,
14
- React.createElement(ViewItem, { label: t("application.contact.apt") },
15
- React.createElement(Field, { id: "".concat(dataKey, ".street2"), name: "".concat(dataKey, ".street2"), label: t("application.contact.apt"), placeholder: t("application.contact.apt"), register: register, readerOnly: true, error: !!resolveObject("".concat(dataKey, ".street2"), errors), validation: { maxLength: 64 }, errorMessage: t("errors.maxLength") }))),
16
- React.createElement(GridCell, null,
17
- React.createElement(ViewItem, { label: t("application.contact.city") },
18
- React.createElement(Field, { id: "".concat(dataKey, ".city"), name: "".concat(dataKey, ".city"), label: t("application.contact.cityName"), placeholder: t("application.contact.cityName"), register: register, validation: { required: required, maxLength: 64 }, error: !!resolveObject("".concat(dataKey, ".city"), errors), errorMessage: ((_c = resolveObject("".concat(dataKey, ".city"), errors)) === null || _c === void 0 ? void 0 : _c.type) === "maxLength"
19
- ? t("errors.maxLength")
20
- : t("errors.cityError"), readerOnly: true }))),
21
- React.createElement(GridCell, { className: "md:grid md:grid-cols-2 md:gap-8", span: 2 },
22
- React.createElement(ViewItem, { label: t("application.contact.state"), className: "mb-0" },
23
- React.createElement(Select, { id: "".concat(dataKey, ".state"), name: "".concat(dataKey, ".state"), label: t("application.contact.state"), labelClassName: "sr-only", register: register, controlClassName: "control", options: stateKeys, keyPrefix: "states", validation: { required: required }, error: !!resolveObject("".concat(dataKey, ".state"), errors), errorMessage: t("errors.stateError") })),
24
- React.createElement(ViewItem, { label: t("application.contact.zip") },
25
- React.createElement(Field, { id: "".concat(dataKey, ".zipCode"), name: "".concat(dataKey, ".zipCode"), label: t("application.contact.zip"), placeholder: t("application.contact.zipCode"), register: register, validation: { required: required, maxLength: 64 }, error: !!resolveObject("".concat(dataKey, ".zipCode"), errors), errorMessage: ((_d = resolveObject("".concat(dataKey, ".zipCode"), errors)) === null || _d === void 0 ? void 0 : _d.type) === "maxLength"
26
- ? t("errors.maxLength")
27
- : t("errors.zipCodeError"), readerOnly: true }))),
28
- enableMailCheckbox && (React.createElement(GridCell, { span: 2 },
29
- React.createElement(Field, { id: "application.sendMailToMailingAddress", name: "application.sendMailToMailingAddress", type: "checkbox", label: t("application.contact.sendMailToMailingAddress"), register: register }))))));
7
+ React.createElement("fieldset", null,
8
+ React.createElement("legend", { className: "text__caps-spaced ".concat(!subtitle ? "sr-only" : "") }, !subtitle ? t("application.preferences.options.address") : subtitle),
9
+ React.createElement(GridSection, null,
10
+ React.createElement(GridCell, { span: 2 },
11
+ React.createElement(ViewItem, { label: t("application.contact.streetAddress") },
12
+ React.createElement(Field, { id: "".concat(dataKey, ".street"), name: "".concat(dataKey, ".street"), label: t("application.contact.streetAddress"), register: register, validation: { required: required, maxLength: 64 }, error: !!resolveObject("".concat(dataKey, ".street"), errors), errorMessage: ((_b = resolveObject("".concat(dataKey, ".street"), errors)) === null || _b === void 0 ? void 0 : _b.type) === "maxLength"
13
+ ? t("errors.maxLength")
14
+ : t("errors.streetError"), readerOnly: true }))),
15
+ React.createElement(GridCell, null,
16
+ React.createElement(ViewItem, { label: t("application.contact.apt") },
17
+ React.createElement(Field, { id: "".concat(dataKey, ".street2"), name: "".concat(dataKey, ".street2"), label: t("application.contact.apt"), register: register, readerOnly: true, error: !!resolveObject("".concat(dataKey, ".street2"), errors), validation: { maxLength: 64 }, errorMessage: t("errors.maxLength") }))),
18
+ React.createElement(GridCell, null,
19
+ React.createElement(ViewItem, { label: t("application.contact.city") },
20
+ React.createElement(Field, { id: "".concat(dataKey, ".city"), name: "".concat(dataKey, ".city"), label: t("application.contact.city"), register: register, validation: { required: required, maxLength: 64 }, error: !!resolveObject("".concat(dataKey, ".city"), errors), errorMessage: ((_c = resolveObject("".concat(dataKey, ".city"), errors)) === null || _c === void 0 ? void 0 : _c.type) === "maxLength"
21
+ ? t("errors.maxLength")
22
+ : t("errors.cityError"), readerOnly: true }))),
23
+ React.createElement(GridCell, { className: "md:grid md:grid-cols-2 md:gap-8", span: 2 },
24
+ React.createElement(ViewItem, { label: t("application.contact.state"), className: "mb-0" },
25
+ React.createElement(Select, { id: "".concat(dataKey, ".state"), name: "".concat(dataKey, ".state"), label: t("application.contact.state"), labelClassName: "sr-only", register: register, controlClassName: "control", options: stateKeys, keyPrefix: "states", validation: { required: required }, error: !!resolveObject("".concat(dataKey, ".state"), errors), errorMessage: t("errors.stateError") })),
26
+ React.createElement(ViewItem, { label: t("application.contact.zip") },
27
+ React.createElement(Field, { id: "".concat(dataKey, ".zipCode"), name: "".concat(dataKey, ".zipCode"), label: t("application.contact.zip"), register: register, validation: { required: required, maxLength: 64 }, error: !!resolveObject("".concat(dataKey, ".zipCode"), errors), errorMessage: ((_d = resolveObject("".concat(dataKey, ".zipCode"), errors)) === null || _d === void 0 ? void 0 : _d.type) === "maxLength"
28
+ ? t("errors.maxLength")
29
+ : t("errors.zipCodeError"), readerOnly: true }))),
30
+ enableMailCheckbox && (React.createElement(GridCell, { span: 2 },
31
+ React.createElement(Field, { id: "application.sendMailToMailingAddress", name: "application.sendMailToMailingAddress", type: "checkbox", label: t("application.contact.sendMailToMailingAddress"), register: register })))))));
30
32
  };
31
33
  //# sourceMappingURL=preferences.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"preferences.js","sourceRoot":"","sources":["../../../src/helpers/preferences.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;AAYzF,MAAM,CAAC,IAAM,WAAW,GAAG,UAAC,EAQT;;QAPjB,QAAQ,cAAA,EACR,OAAO,aAAA,EACP,0BAA0B,EAA1B,kBAAkB,mBAAG,KAAK,KAAA,EAC1B,QAAQ,cAAA,EACR,MAAM,YAAA,EACN,QAAQ,cAAA,EACR,SAAS,eAAA;IAET,OAAO,CACL;QACE,oBAAC,WAAW,IAAC,QAAQ,EAAE,QAAQ;YAC7B,oBAAC,QAAQ,IAAC,IAAI,EAAE,CAAC;gBACf,oBAAC,QAAQ,IAAC,KAAK,EAAE,CAAC,CAAC,mCAAmC,CAAC;oBACrD,oBAAC,KAAK,IACJ,EAAE,EAAE,UAAG,OAAO,YAAS,EACvB,IAAI,EAAE,UAAG,OAAO,YAAS,EACzB,KAAK,EAAE,CAAC,CAAC,mCAAmC,CAAC,EAC7C,WAAW,EAAE,CAAC,CAAC,mCAAmC,CAAC,EACnD,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,EAAE,QAAQ,UAAA,EAAE,SAAS,EAAE,EAAE,EAAE,EACvC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C1B,KAAK,EAAE,CAAC,CAAC,yBAAyB,CAAC,EACnC,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,EAAE,QAAQ,UAAA,EAAE,SAAS,EAAE,EAAE,EAAE,EACvC,KAAK,EAAE,CAAC,CAAC,aAAa,CAAC,UAAG,OAAO,aAAU,EAAE,MAAM,CAAC,EACpD,YAAY,EACV,CAAA,MAAA,aAAa,CAAC,UAAG,OAAO,aAAU,EAAE,MAAM,CAAC,0CAAE,IAAI,MAAK,WAAW;gCAC/D,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC;gCACvB,CAAC,CAAC,CAAC,CAAC,qBAAqB,CAAC,EAE9B,UAAU,SACV,CACO,CACF;gBAEV,kBAAkB,IAAI,CACrB,oBAAC,QAAQ,IAAC,IAAI,EAAE,CAAC;oBACf,oBAAC,KAAK,IACJ,EAAE,EAAC,sCAAsC,EACzC,IAAI,EAAC,sCAAsC,EAC3C,IAAI,EAAC,UAAU,EACf,KAAK,EAAE,CAAC,CAAC,8CAA8C,CAAC,EACxD,QAAQ,EAAE,QAAQ,GAClB,CACO,CACZ,CACW,CACL,CACV,CACJ,CAAA;AACH,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bloom-housing/ui-components",
3
- "version": "12.0.28",
3
+ "version": "12.0.29",
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",
@@ -3,7 +3,7 @@ import { UseFormMethods } from "react-hook-form"
3
3
  import { t, GridSection, ViewItem, GridCell, Field, Select, resolveObject } from "../../"
4
4
 
5
5
  type FormAddressProps = {
6
- subtitle: string
6
+ subtitle?: string
7
7
  dataKey: string
8
8
  enableMailCheckbox?: boolean
9
9
  register: UseFormMethods["register"]
@@ -23,110 +23,111 @@ export const FormAddress = ({
23
23
  }: FormAddressProps) => {
24
24
  return (
25
25
  <>
26
- <GridSection subtitle={subtitle}>
27
- <GridCell span={2}>
28
- <ViewItem label={t("application.contact.streetAddress")}>
29
- <Field
30
- id={`${dataKey}.street`}
31
- name={`${dataKey}.street`}
32
- label={t("application.contact.streetAddress")}
33
- placeholder={t("application.contact.streetAddress")}
34
- register={register}
35
- validation={{ required, maxLength: 64 }}
36
- error={!!resolveObject(`${dataKey}.street`, errors)}
37
- errorMessage={
38
- resolveObject(`${dataKey}.street`, errors)?.type === "maxLength"
39
- ? t("errors.maxLength")
40
- : t("errors.streetError")
41
- }
42
- readerOnly
43
- />
44
- </ViewItem>
45
- </GridCell>
46
- <GridCell>
47
- <ViewItem label={t("application.contact.apt")}>
48
- <Field
49
- id={`${dataKey}.street2`}
50
- name={`${dataKey}.street2`}
51
- label={t("application.contact.apt")}
52
- placeholder={t("application.contact.apt")}
53
- register={register}
54
- readerOnly
55
- error={!!resolveObject(`${dataKey}.street2`, errors)}
56
- validation={{ maxLength: 64 }}
57
- errorMessage={t("errors.maxLength")}
58
- />
59
- </ViewItem>
60
- </GridCell>
61
-
62
- <GridCell>
63
- <ViewItem label={t("application.contact.city")}>
64
- <Field
65
- id={`${dataKey}.city`}
66
- name={`${dataKey}.city`}
67
- label={t("application.contact.cityName")}
68
- placeholder={t("application.contact.cityName")}
69
- register={register}
70
- validation={{ required, maxLength: 64 }}
71
- error={!!resolveObject(`${dataKey}.city`, errors)}
72
- errorMessage={
73
- resolveObject(`${dataKey}.city`, errors)?.type === "maxLength"
74
- ? t("errors.maxLength")
75
- : t("errors.cityError")
76
- }
77
- readerOnly
78
- />
79
- </ViewItem>
80
- </GridCell>
26
+ <fieldset>
27
+ <legend className={`text__caps-spaced ${!subtitle ? "sr-only" : ""}`}>
28
+ {!subtitle ? t("application.preferences.options.address") : subtitle}
29
+ </legend>
30
+ <GridSection>
31
+ <GridCell span={2}>
32
+ <ViewItem label={t("application.contact.streetAddress")}>
33
+ <Field
34
+ id={`${dataKey}.street`}
35
+ name={`${dataKey}.street`}
36
+ label={t("application.contact.streetAddress")}
37
+ register={register}
38
+ validation={{ required, maxLength: 64 }}
39
+ error={!!resolveObject(`${dataKey}.street`, errors)}
40
+ errorMessage={
41
+ resolveObject(`${dataKey}.street`, errors)?.type === "maxLength"
42
+ ? t("errors.maxLength")
43
+ : t("errors.streetError")
44
+ }
45
+ readerOnly
46
+ />
47
+ </ViewItem>
48
+ </GridCell>
49
+ <GridCell>
50
+ <ViewItem label={t("application.contact.apt")}>
51
+ <Field
52
+ id={`${dataKey}.street2`}
53
+ name={`${dataKey}.street2`}
54
+ label={t("application.contact.apt")}
55
+ register={register}
56
+ readerOnly
57
+ error={!!resolveObject(`${dataKey}.street2`, errors)}
58
+ validation={{ maxLength: 64 }}
59
+ errorMessage={t("errors.maxLength")}
60
+ />
61
+ </ViewItem>
62
+ </GridCell>
81
63
 
82
- <GridCell className="md:grid md:grid-cols-2 md:gap-8" span={2}>
83
- <ViewItem label={t("application.contact.state")} className="mb-0">
84
- <Select
85
- id={`${dataKey}.state`}
86
- name={`${dataKey}.state`}
87
- label={t("application.contact.state")}
88
- labelClassName="sr-only"
89
- register={register}
90
- controlClassName="control"
91
- options={stateKeys}
92
- keyPrefix="states"
93
- validation={{ required }}
94
- error={!!resolveObject(`${dataKey}.state`, errors)}
95
- errorMessage={t("errors.stateError")}
96
- />
97
- </ViewItem>
64
+ <GridCell>
65
+ <ViewItem label={t("application.contact.city")}>
66
+ <Field
67
+ id={`${dataKey}.city`}
68
+ name={`${dataKey}.city`}
69
+ label={t("application.contact.city")}
70
+ register={register}
71
+ validation={{ required, maxLength: 64 }}
72
+ error={!!resolveObject(`${dataKey}.city`, errors)}
73
+ errorMessage={
74
+ resolveObject(`${dataKey}.city`, errors)?.type === "maxLength"
75
+ ? t("errors.maxLength")
76
+ : t("errors.cityError")
77
+ }
78
+ readerOnly
79
+ />
80
+ </ViewItem>
81
+ </GridCell>
98
82
 
99
- <ViewItem label={t("application.contact.zip")}>
100
- <Field
101
- id={`${dataKey}.zipCode`}
102
- name={`${dataKey}.zipCode`}
103
- label={t("application.contact.zip")}
104
- placeholder={t("application.contact.zipCode")}
105
- register={register}
106
- validation={{ required, maxLength: 64 }}
107
- error={!!resolveObject(`${dataKey}.zipCode`, errors)}
108
- errorMessage={
109
- resolveObject(`${dataKey}.zipCode`, errors)?.type === "maxLength"
110
- ? t("errors.maxLength")
111
- : t("errors.zipCodeError")
112
- }
113
- readerOnly
114
- />
115
- </ViewItem>
116
- </GridCell>
83
+ <GridCell className="md:grid md:grid-cols-2 md:gap-8" span={2}>
84
+ <ViewItem label={t("application.contact.state")} className="mb-0">
85
+ <Select
86
+ id={`${dataKey}.state`}
87
+ name={`${dataKey}.state`}
88
+ label={t("application.contact.state")}
89
+ labelClassName="sr-only"
90
+ register={register}
91
+ controlClassName="control"
92
+ options={stateKeys}
93
+ keyPrefix="states"
94
+ validation={{ required }}
95
+ error={!!resolveObject(`${dataKey}.state`, errors)}
96
+ errorMessage={t("errors.stateError")}
97
+ />
98
+ </ViewItem>
117
99
 
118
- {enableMailCheckbox && (
119
- <GridCell span={2}>
120
- <Field
121
- id="application.sendMailToMailingAddress"
122
- name="application.sendMailToMailingAddress"
123
- type="checkbox"
124
- label={t("application.contact.sendMailToMailingAddress")}
125
- register={register}
126
- />
100
+ <ViewItem label={t("application.contact.zip")}>
101
+ <Field
102
+ id={`${dataKey}.zipCode`}
103
+ name={`${dataKey}.zipCode`}
104
+ label={t("application.contact.zip")}
105
+ register={register}
106
+ validation={{ required, maxLength: 64 }}
107
+ error={!!resolveObject(`${dataKey}.zipCode`, errors)}
108
+ errorMessage={
109
+ resolveObject(`${dataKey}.zipCode`, errors)?.type === "maxLength"
110
+ ? t("errors.maxLength")
111
+ : t("errors.zipCodeError")
112
+ }
113
+ readerOnly
114
+ />
115
+ </ViewItem>
127
116
  </GridCell>
128
- )}
129
- </GridSection>
117
+
118
+ {enableMailCheckbox && (
119
+ <GridCell span={2}>
120
+ <Field
121
+ id="application.sendMailToMailingAddress"
122
+ name="application.sendMailToMailingAddress"
123
+ type="checkbox"
124
+ label={t("application.contact.sendMailToMailingAddress")}
125
+ register={register}
126
+ />
127
+ </GridCell>
128
+ )}
129
+ </GridSection>
130
+ </fieldset>
130
131
  </>
131
132
  )
132
133
  }