@bloom-housing/ui-components 14.0.0 → 14.0.2
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.
|
@@ -25,6 +25,7 @@ interface FieldGroupProps {
|
|
|
25
25
|
fieldLabelClassName?: string;
|
|
26
26
|
fields?: FieldSingle[];
|
|
27
27
|
groupLabel?: string | React.ReactNode;
|
|
28
|
+
groupLabelClassName?: string;
|
|
28
29
|
groupNote?: string;
|
|
29
30
|
groupSubNote?: string;
|
|
30
31
|
name: string;
|
|
@@ -37,5 +38,5 @@ interface FieldGroupProps {
|
|
|
37
38
|
readMore?: string;
|
|
38
39
|
};
|
|
39
40
|
}
|
|
40
|
-
declare const FieldGroup: ({ name, groupLabel, fields, type, validation, error, errorMessage, groupNote, register, fieldGroupClassName, fieldClassName, fieldLabelClassName, groupSubNote, dataTestId, strings, }: FieldGroupProps) => React.JSX.Element;
|
|
41
|
+
declare const FieldGroup: ({ name, groupLabel, groupLabelClassName, fields, type, validation, error, errorMessage, groupNote, register, fieldGroupClassName, fieldClassName, fieldLabelClassName, groupSubNote, dataTestId, strings, }: FieldGroupProps) => React.JSX.Element;
|
|
41
42
|
export { FieldGroup as default, FieldGroup };
|
|
@@ -24,7 +24,7 @@ import { ErrorMessage } from "../notifications/ErrorMessage";
|
|
|
24
24
|
import { Field } from "./Field";
|
|
25
25
|
import { t } from "../helpers/translator";
|
|
26
26
|
var FieldGroup = function (_a) {
|
|
27
|
-
var name = _a.name, groupLabel = _a.groupLabel, fields = _a.fields, _b = _a.type, type = _b === void 0 ? "checkbox" : _b, _c = _a.validation, validation = _c === void 0 ? {} : _c, error = _a.error, errorMessage = _a.errorMessage, groupNote = _a.groupNote, register = _a.register, fieldGroupClassName = _a.fieldGroupClassName, fieldClassName = _a.fieldClassName, fieldLabelClassName = _a.fieldLabelClassName, groupSubNote = _a.groupSubNote, dataTestId = _a.dataTestId, strings = _a.strings;
|
|
27
|
+
var name = _a.name, groupLabel = _a.groupLabel, groupLabelClassName = _a.groupLabelClassName, fields = _a.fields, _b = _a.type, type = _b === void 0 ? "checkbox" : _b, _c = _a.validation, validation = _c === void 0 ? {} : _c, error = _a.error, errorMessage = _a.errorMessage, groupNote = _a.groupNote, register = _a.register, fieldGroupClassName = _a.fieldGroupClassName, fieldClassName = _a.fieldClassName, fieldLabelClassName = _a.fieldLabelClassName, groupSubNote = _a.groupSubNote, dataTestId = _a.dataTestId, strings = _a.strings;
|
|
28
28
|
// Always default align two-option radio groups side by side
|
|
29
29
|
if ((fields === null || fields === void 0 ? void 0 : fields.length) === 2) {
|
|
30
30
|
fieldGroupClassName = "".concat(fieldGroupClassName || "", " flex");
|
|
@@ -36,8 +36,8 @@ var FieldGroup = function (_a) {
|
|
|
36
36
|
};
|
|
37
37
|
var getIndividualInput = function (item) {
|
|
38
38
|
var _a, _b, _c;
|
|
39
|
-
return (React.createElement(
|
|
40
|
-
React.createElement("input", __assign({ "aria-describedby": "".concat(name, "-error"), "aria-invalid": !!error || false, type: type, id: item.id, defaultValue: item.value || item.id, name: subfieldsExist() || item.uniqueName ? "".concat(name, "-").concat(item.value || "") : name, onClick: function (e) {
|
|
39
|
+
return (React.createElement(React.Fragment, null,
|
|
40
|
+
React.createElement("input", __assign({ "aria-describedby": "".concat(name, "-error ").concat(item.note ? "".concat(item.id, "-note") : ""), "aria-invalid": !!error || false, type: type, id: item.id, defaultValue: item.value || item.id, name: subfieldsExist() || item.uniqueName ? "".concat(name, "-").concat(item.value || "") : name, onClick: function (e) {
|
|
41
41
|
var _a;
|
|
42
42
|
// We cannot reliably target an individual checkbox in a field group since they have the same name, so we keep track on our own
|
|
43
43
|
if (e.currentTarget.checked) {
|
|
@@ -48,7 +48,7 @@ var FieldGroup = function (_a) {
|
|
|
48
48
|
}
|
|
49
49
|
}, defaultChecked: item.defaultChecked || false, disabled: item.disabled, ref: register(validation) }, item.inputProps, { "data-testid": (_a = item.dataTestId) !== null && _a !== void 0 ? _a : dataTestId })),
|
|
50
50
|
React.createElement("label", { htmlFor: item.id, className: "font-semibold ".concat(fieldLabelClassName || "", " ").concat(item.disabled ? "text-gray-600 cursor-not-allowed" : "") }, item.label),
|
|
51
|
-
item.note && React.createElement("span", { className: "field-note font-normal" }, item.note),
|
|
51
|
+
item.note && (React.createElement("span", { id: "".concat(item.id, "-note"), className: "field-note font-normal" }, item.note)),
|
|
52
52
|
item.description && (React.createElement("div", { className: "ml-8 -mt-1 mb-5" },
|
|
53
53
|
React.createElement(ExpandableContent, { strings: {
|
|
54
54
|
readMore: (_b = strings === null || strings === void 0 ? void 0 : strings.readMore) !== null && _b !== void 0 ? _b : t("t.readMore"),
|
|
@@ -74,12 +74,15 @@ var FieldGroup = function (_a) {
|
|
|
74
74
|
}, [checkSelected, setCheckedInputs, fields]);
|
|
75
75
|
var getInputSet = function (item) {
|
|
76
76
|
var _a, _b;
|
|
77
|
-
return (React.createElement(
|
|
77
|
+
return (React.createElement(React.Fragment, null,
|
|
78
78
|
getIndividualInput(item),
|
|
79
79
|
item.additionalText && checkedInputs.indexOf(((_a = item.label) === null || _a === void 0 ? void 0 : _a.toString()) || "") >= 0 && (React.createElement(Field, { id: item.id, key: "".concat(item.value || "", "-additionalText"), name: "".concat(name, "-").concat(item.value || ""), register: register, defaultValue: item.defaultText, placeholder: (_b = strings === null || strings === void 0 ? void 0 : strings.description) !== null && _b !== void 0 ? _b : t("t.description"), className: "mb-4", disabled: item.disabled, dataTestId: item.dataTestId }))));
|
|
80
80
|
};
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
var describedBy = [groupSubNote ? "".concat(name, "-group-sub-note") : "", error ? "".concat(name, "-error") : ""]
|
|
82
|
+
.filter(Boolean)
|
|
83
|
+
.join(" ");
|
|
84
|
+
return (React.createElement("fieldset", __assign({}, (describedBy ? { "aria-describedby": describedBy } : {})),
|
|
85
|
+
groupLabel && (React.createElement("legend", { className: "text__caps-spaced ".concat(error ? "text-alert" : "", " ").concat(groupLabelClassName || "") }, groupLabel)),
|
|
83
86
|
groupNote && React.createElement("p", { className: "field-note mb-4" }, groupNote),
|
|
84
87
|
React.createElement("div", { className: "field ".concat(error ? "error" : "", " ").concat(fieldGroupClassName || "", " mb-0") }, fields === null || fields === void 0 ? void 0 : fields.map(function (item) {
|
|
85
88
|
var _a, _b;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldGroup.js","sourceRoot":"","sources":["../../../src/forms/FieldGroup.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,OAAO,CAAA;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAA;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAE5D,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,CAAC,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"FieldGroup.js","sourceRoot":"","sources":["../../../src/forms/FieldGroup.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,OAAO,CAAA;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAA;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAE5D,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,CAAC,EAAE,MAAM,uBAAuB,CAAA;AA0CzC,IAAM,UAAU,GAAG,UAAC,EAiBF;QAhBhB,IAAI,UAAA,EACJ,UAAU,gBAAA,EACV,mBAAmB,yBAAA,EACnB,MAAM,YAAA,EACN,YAAiB,EAAjB,IAAI,mBAAG,UAAU,KAAA,EACjB,kBAAe,EAAf,UAAU,mBAAG,EAAE,KAAA,EACf,KAAK,WA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C,IAAI,CAC7E,6BAAK,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,UAAG,IAAI,CAAC,KAAK,IAAI,EAAE,eAAY,IACzD,MAAA,IAAI,CAAC,SAAS,0CAAE,GAAG,CAAC,UAAC,OAAO;oBAC3B,OAAO,WAAW,CAAC,OAAO,CAAC,CAAA;gBAC7B,CAAC,CAAC,CACE,CACP,CACG,CACP,CAAA;SAAA,CAAC,CACE;QACL,YAAY,IAAI,CACf,2BAAG,EAAE,EAAE,UAAG,IAAI,oBAAiB,EAAE,SAAS,EAAC,gBAAgB,IACxD,YAAY,CACX,CACL;QACA,KAAK,IAAI,YAAY,CAAC,CAAC,CAAC,CACvB,oBAAC,YAAY,IAAC,EAAE,EAAE,UAAG,IAAI,WAAQ,EAAE,KAAK,EAAE,KAAK,IAC5C,YAAY,CACA,CAChB,CAAC,CAAC,CAAC,CACF,8BAAM,EAAE,EAAE,UAAG,IAAI,WAAQ,GAAS,CACnC,CACQ,CACZ,CAAA;AACH,CAAC,CAAA;AAED,OAAO,EAAE,UAAU,IAAI,OAAO,EAAE,UAAU,EAAE,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bloom-housing/ui-components",
|
|
3
|
-
"version": "14.0.
|
|
3
|
+
"version": "14.0.2",
|
|
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",
|
|
7
7
|
"main": "index.js",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": "./index.ts",
|
|
10
|
-
"./ag-table": "./ag-table.ts"
|
|
10
|
+
"./ag-table": "./ag-table.ts",
|
|
11
|
+
"./tailwind.config.js": "./tailwind.config.js",
|
|
12
|
+
"./tailwind.tosass.js": "./tailwind.tosass.js",
|
|
13
|
+
"./src/global/css-imports.scss": "./src/global/css-imports.scss",
|
|
14
|
+
"./src/global/app-css.scss": "./src/global/app-css.scss"
|
|
11
15
|
},
|
|
12
16
|
"license": "Apache-2.0",
|
|
13
17
|
"private": false,
|
package/src/forms/FieldGroup.tsx
CHANGED
|
@@ -31,6 +31,7 @@ interface FieldGroupProps {
|
|
|
31
31
|
fieldLabelClassName?: string
|
|
32
32
|
fields?: FieldSingle[]
|
|
33
33
|
groupLabel?: string | React.ReactNode
|
|
34
|
+
groupLabelClassName?: string
|
|
34
35
|
groupNote?: string
|
|
35
36
|
groupSubNote?: string
|
|
36
37
|
name: string
|
|
@@ -47,6 +48,7 @@ interface FieldGroupProps {
|
|
|
47
48
|
const FieldGroup = ({
|
|
48
49
|
name,
|
|
49
50
|
groupLabel,
|
|
51
|
+
groupLabelClassName,
|
|
50
52
|
fields,
|
|
51
53
|
type = "checkbox",
|
|
52
54
|
validation = {},
|
|
@@ -75,9 +77,9 @@ const FieldGroup = ({
|
|
|
75
77
|
|
|
76
78
|
const getIndividualInput = (item: FieldSingle): React.ReactNode => {
|
|
77
79
|
return (
|
|
78
|
-
|
|
80
|
+
<>
|
|
79
81
|
<input
|
|
80
|
-
aria-describedby={`${name}-error`}
|
|
82
|
+
aria-describedby={`${name}-error ${item.note ? `${item.id}-note` : ""}`}
|
|
81
83
|
aria-invalid={!!error || false}
|
|
82
84
|
type={type}
|
|
83
85
|
id={item.id}
|
|
@@ -105,7 +107,11 @@ const FieldGroup = ({
|
|
|
105
107
|
>
|
|
106
108
|
{item.label}
|
|
107
109
|
</label>
|
|
108
|
-
{item.note &&
|
|
110
|
+
{item.note && (
|
|
111
|
+
<span id={`${item.id}-note`} className={"field-note font-normal"}>
|
|
112
|
+
{item.note}
|
|
113
|
+
</span>
|
|
114
|
+
)}
|
|
109
115
|
|
|
110
116
|
{item.description && (
|
|
111
117
|
<div className="ml-8 -mt-1 mb-5">
|
|
@@ -119,7 +125,7 @@ const FieldGroup = ({
|
|
|
119
125
|
</ExpandableContent>
|
|
120
126
|
</div>
|
|
121
127
|
)}
|
|
122
|
-
|
|
128
|
+
</>
|
|
123
129
|
)
|
|
124
130
|
}
|
|
125
131
|
|
|
@@ -145,7 +151,7 @@ const FieldGroup = ({
|
|
|
145
151
|
|
|
146
152
|
const getInputSet = (item: FieldSingle): React.ReactNode => {
|
|
147
153
|
return (
|
|
148
|
-
|
|
154
|
+
<>
|
|
149
155
|
{getIndividualInput(item)}
|
|
150
156
|
{item.additionalText && checkedInputs.indexOf(item.label?.toString() || "") >= 0 && (
|
|
151
157
|
<Field
|
|
@@ -160,17 +166,21 @@ const FieldGroup = ({
|
|
|
160
166
|
dataTestId={item.dataTestId}
|
|
161
167
|
/>
|
|
162
168
|
)}
|
|
163
|
-
|
|
169
|
+
</>
|
|
164
170
|
)
|
|
165
171
|
}
|
|
172
|
+
const describedBy = [groupSubNote ? `${name}-group-sub-note` : "", error ? `${name}-error` : ""]
|
|
173
|
+
.filter(Boolean)
|
|
174
|
+
.join(" ")
|
|
175
|
+
|
|
166
176
|
return (
|
|
167
|
-
<fieldset
|
|
168
|
-
aria-describedby={`${groupSubNote ? `${name}-group-sub-note` : ""} ${
|
|
169
|
-
error ? `${name}-error` : ""
|
|
170
|
-
}`}
|
|
171
|
-
>
|
|
177
|
+
<fieldset {...(describedBy ? { "aria-describedby": describedBy } : {})}>
|
|
172
178
|
{groupLabel && (
|
|
173
|
-
<legend
|
|
179
|
+
<legend
|
|
180
|
+
className={`text__caps-spaced ${error ? "text-alert" : ""} ${groupLabelClassName || ""}`}
|
|
181
|
+
>
|
|
182
|
+
{groupLabel}
|
|
183
|
+
</legend>
|
|
174
184
|
)}
|
|
175
185
|
{groupNote && <p className="field-note mb-4">{groupNote}</p>}
|
|
176
186
|
|