@uktrade/react-component-library 0.20.1 → 0.20.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.
@@ -16,7 +16,7 @@ export const CheckboxGroup = ({ legend, hint, error, options, name, values, lege
16
16
  return (_jsx("div", { className: clsx("govuk-form-group", {
17
17
  "govuk-form-group--error": hasError,
18
18
  }), children: _jsxs("fieldset", { className: "govuk-fieldset", "aria-describedby": errorId, children: [_jsx("legend", { className: clsx("govuk-fieldset__legend", {
19
- [`govuk-fieldset__legend--${legendSize}`]: legendSize !== "m",
19
+ [`govuk-fieldset__legend--${legendSize}`]: true,
20
20
  }), children: legendHeading }), hint && _jsx("div", { className: "govuk-hint", children: hint }), hasError && (_jsxs("p", { id: errorId, className: "govuk-error-message", children: [_jsx("span", { className: "govuk-visually-hidden", children: "Error:" }), " ", error] })), _jsx("div", { className: clsx("govuk-checkboxes", {
21
21
  "govuk-checkboxes--small": checkboxSize === "small",
22
22
  }), "data-module": "govuk-checkboxes", children: options.map((opt) => (_jsxs("div", { className: "govuk-checkboxes__item", children: [_jsx("input", { className: "govuk-checkboxes__input", id: opt.id, name: name, type: "checkbox", value: opt.value, checked: values.includes(opt.value), onChange: handleChange, "aria-label": opt.ariaLabel }), _jsx("label", { className: "govuk-label govuk-checkboxes__label", htmlFor: opt.id, children: opt.label }), opt.hint && (_jsx("div", { className: "govuk-hint govuk-checkboxes__hint", children: opt.hint }))] }, opt.id))) })] }) }));
@@ -8,7 +8,7 @@ export const SelectInput = ({ id, label, hint, error, options, placeholder, labe
8
8
  const errorId = hasError ? `${id}-error` : undefined;
9
9
  const ariaDescribedBy = [hintId, errorId].filter(Boolean).join(" ") || undefined;
10
10
  const labelElement = (_jsx("label", { htmlFor: id, className: clsx("govuk-label", {
11
- [`govuk-label--${labelSize}`]: labelSize !== "m",
11
+ [`govuk-label--${labelSize}`]: true,
12
12
  }), children: label }));
13
13
  return (_jsxs("div", { className: clsx("govuk-form-group", {
14
14
  "govuk-form-group--error": hasError,
@@ -8,7 +8,7 @@ export const TextInput = ({ id, label, hint, error, width = "20", labelSize = "m
8
8
  const errorId = hasError ? `${id}-error` : undefined;
9
9
  const describedBy = [hintId, errorId].filter(Boolean).join(" ") || undefined;
10
10
  const labelElement = (_jsx("label", { htmlFor: id, className: clsx("govuk-label", {
11
- [`govuk-label--${labelSize}`]: labelSize !== "m",
11
+ [`govuk-label--${labelSize}`]: true,
12
12
  }), children: label }));
13
13
  const input = (_jsx("input", { id: id, className: clsx("govuk-input", `govuk-input--width-${width}`, className), "aria-invalid": hasError, "aria-describedby": describedBy, placeholder: placeholder, ...props }));
14
14
  return (_jsxs("div", { className: clsx("govuk-form-group", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uktrade/react-component-library",
3
- "version": "0.20.1",
3
+ "version": "0.20.2",
4
4
  "description": "A collection of reusable React components following GOV.UK design patterns.",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -69,7 +69,7 @@ export const CheckboxGroup = ({
69
69
  <fieldset className="govuk-fieldset" aria-describedby={errorId}>
70
70
  <legend
71
71
  className={clsx("govuk-fieldset__legend", {
72
- [`govuk-fieldset__legend--${legendSize}`]: legendSize !== "m",
72
+ [`govuk-fieldset__legend--${legendSize}`]: true,
73
73
  })}
74
74
  >
75
75
  {legendHeading}
@@ -42,7 +42,7 @@ export const SelectInput = ({
42
42
  <label
43
43
  htmlFor={id}
44
44
  className={clsx("govuk-label", {
45
- [`govuk-label--${labelSize}`]: labelSize !== "m",
45
+ [`govuk-label--${labelSize}`]: true,
46
46
  })}
47
47
  >
48
48
  {label}
@@ -42,7 +42,7 @@ export const TextInput = ({
42
42
  <label
43
43
  htmlFor={id}
44
44
  className={clsx("govuk-label", {
45
- [`govuk-label--${labelSize}`]: labelSize !== "m",
45
+ [`govuk-label--${labelSize}`]: true,
46
46
  })}
47
47
  >
48
48
  {label}