@launchpad-ui/form 0.6.5-alpha.0 → 0.6.5-alpha.1
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.
- package/dist/Checkbox.d.ts +19 -0
- package/dist/Checkbox.d.ts.map +1 -0
- package/dist/CompactTextField.d.ts +20 -0
- package/dist/CompactTextField.d.ts.map +1 -0
- package/dist/FieldError.d.ts +12 -0
- package/dist/FieldError.d.ts.map +1 -0
- package/dist/FieldSet.d.ts +9 -0
- package/dist/FieldSet.d.ts.map +1 -0
- package/dist/Form.d.ts +11 -0
- package/dist/Form.d.ts.map +1 -0
- package/dist/FormField.d.ts +20 -0
- package/dist/FormField.d.ts.map +1 -0
- package/dist/FormGroup.d.ts +12 -0
- package/dist/FormGroup.d.ts.map +1 -0
- package/dist/FormHint.d.ts +9 -0
- package/dist/FormHint.d.ts.map +1 -0
- package/dist/IconField.d.ts +12 -0
- package/dist/IconField.d.ts.map +1 -0
- package/dist/Label.d.ts +12 -0
- package/dist/Label.d.ts.map +1 -0
- package/dist/Radio.d.ts +11 -0
- package/dist/Radio.d.ts.map +1 -0
- package/dist/RadioGroup.d.ts +42 -0
- package/dist/RadioGroup.d.ts.map +1 -0
- package/dist/RequiredAsterisk.d.ts +9 -0
- package/dist/RequiredAsterisk.d.ts.map +1 -0
- package/dist/Select.d.ts +9 -0
- package/dist/Select.d.ts.map +1 -0
- package/dist/TextArea.d.ts +11 -0
- package/dist/TextArea.d.ts.map +1 -0
- package/dist/TextField.d.ts +17 -0
- package/dist/TextField.d.ts.map +1 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.es.js +468 -0
- package/dist/index.es.js.map +1 -0
- package/dist/index.js +468 -0
- package/dist/index.js.map +1 -0
- package/dist/style.css +402 -0
- package/dist/utils/index.d.ts +5 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/package.json +2 -2
    
        package/dist/index.es.js
    ADDED
    
    | @@ -0,0 +1,468 @@ | |
| 1 | 
            +
            import './style.css';
         | 
| 2 | 
            +
            import { forwardRef, useState, useRef, Children, isValidElement, cloneElement } from "react";
         | 
| 3 | 
            +
            import { cx } from "classix";
         | 
| 4 | 
            +
            import { jsx, jsxs, Fragment } from "react/jsx-runtime";
         | 
| 5 | 
            +
            import { VisuallyHidden } from "@react-aria/visually-hidden";
         | 
| 6 | 
            +
            const RequiredAsterisk$1 = "";
         | 
| 7 | 
            +
            const RequiredAsterisk = ({
         | 
| 8 | 
            +
              className,
         | 
| 9 | 
            +
              "data-test-id": testId = "required-asterisk",
         | 
| 10 | 
            +
              ...rest
         | 
| 11 | 
            +
            }) => {
         | 
| 12 | 
            +
              const classes = cx("RequiredAsterisk", className);
         | 
| 13 | 
            +
              return /* @__PURE__ */ jsx("span", {
         | 
| 14 | 
            +
                ...rest,
         | 
| 15 | 
            +
                "data-test-id": testId,
         | 
| 16 | 
            +
                className: classes,
         | 
| 17 | 
            +
                children: "*"
         | 
| 18 | 
            +
              });
         | 
| 19 | 
            +
            };
         | 
| 20 | 
            +
            const Form$1 = "";
         | 
| 21 | 
            +
            const Label = ({
         | 
| 22 | 
            +
              disabled,
         | 
| 23 | 
            +
              className,
         | 
| 24 | 
            +
              children,
         | 
| 25 | 
            +
              required = false,
         | 
| 26 | 
            +
              optional = false,
         | 
| 27 | 
            +
              "data-test-id": testId = "label",
         | 
| 28 | 
            +
              ...rest
         | 
| 29 | 
            +
            }) => {
         | 
| 30 | 
            +
              const classes = cx("Form-label", className, disabled && "Form-label--disabled");
         | 
| 31 | 
            +
              return /* @__PURE__ */ jsxs("label", {
         | 
| 32 | 
            +
                ...rest,
         | 
| 33 | 
            +
                "data-test-id": testId,
         | 
| 34 | 
            +
                className: classes,
         | 
| 35 | 
            +
                children: [children, optional && !required && /* @__PURE__ */ jsx("small", {
         | 
| 36 | 
            +
                  className: "Form-labelOptional",
         | 
| 37 | 
            +
                  children: "(optional)"
         | 
| 38 | 
            +
                }), required && !optional && /* @__PURE__ */ jsx(RequiredAsterisk, {})]
         | 
| 39 | 
            +
              });
         | 
| 40 | 
            +
            };
         | 
| 41 | 
            +
            const Checkbox = forwardRef(({
         | 
| 42 | 
            +
              "aria-label": ariaLabel,
         | 
| 43 | 
            +
              "aria-labelledby": ariaLabelledby,
         | 
| 44 | 
            +
              children,
         | 
| 45 | 
            +
              disabled,
         | 
| 46 | 
            +
              checked,
         | 
| 47 | 
            +
              labelClassName,
         | 
| 48 | 
            +
              "data-test-id": testId = "checkbox",
         | 
| 49 | 
            +
              ...rest
         | 
| 50 | 
            +
            }, ref) => {
         | 
| 51 | 
            +
              const hasAriaLabel = ariaLabel !== void 0 || ariaLabelledby !== void 0;
         | 
| 52 | 
            +
              if (!children && !hasAriaLabel) {
         | 
| 53 | 
            +
                console.warn("If you do not provide children, you must specify an aria-label for accessibility");
         | 
| 54 | 
            +
              }
         | 
| 55 | 
            +
              return /* @__PURE__ */ jsxs(Label, {
         | 
| 56 | 
            +
                className: labelClassName,
         | 
| 57 | 
            +
                children: [/* @__PURE__ */ jsx("input", {
         | 
| 58 | 
            +
                  ...rest,
         | 
| 59 | 
            +
                  ref,
         | 
| 60 | 
            +
                  checked,
         | 
| 61 | 
            +
                  "aria-checked": checked ? "true" : "false",
         | 
| 62 | 
            +
                  "aria-label": ariaLabel,
         | 
| 63 | 
            +
                  "aria-labelledby": ariaLabelledby,
         | 
| 64 | 
            +
                  className: "Form-checkbox",
         | 
| 65 | 
            +
                  disabled,
         | 
| 66 | 
            +
                  type: "checkbox",
         | 
| 67 | 
            +
                  "data-test-id": testId
         | 
| 68 | 
            +
                }), " ", disabled ? /* @__PURE__ */ jsx("span", {
         | 
| 69 | 
            +
                  className: "Form-label--disabled",
         | 
| 70 | 
            +
                  children
         | 
| 71 | 
            +
                }) : children]
         | 
| 72 | 
            +
              });
         | 
| 73 | 
            +
            });
         | 
| 74 | 
            +
            Checkbox.displayName = "Checkbox";
         | 
| 75 | 
            +
            const FormInput = "";
         | 
| 76 | 
            +
            const createFieldErrorId = (fieldIdentifier) => fieldIdentifier ? `${[...fieldIdentifier].join("")}-err` : void 0;
         | 
| 77 | 
            +
            const TextField = forwardRef(({
         | 
| 78 | 
            +
              className,
         | 
| 79 | 
            +
              type = "text",
         | 
| 80 | 
            +
              tiny = false,
         | 
| 81 | 
            +
              readOnly,
         | 
| 82 | 
            +
              tabIndex = 0,
         | 
| 83 | 
            +
              suffix,
         | 
| 84 | 
            +
              overrideWidth,
         | 
| 85 | 
            +
              "data-test-id": testId = "text-field",
         | 
| 86 | 
            +
              ...rest
         | 
| 87 | 
            +
            }, ref) => {
         | 
| 88 | 
            +
              const classes = overrideWidth ? className : cx("FormInput", `FormInput-${type}`, className, tiny && "FormInput--tiny");
         | 
| 89 | 
            +
              if (suffix) {
         | 
| 90 | 
            +
                return /* @__PURE__ */ jsxs("div", {
         | 
| 91 | 
            +
                  className: "FormInput-suffixContainer",
         | 
| 92 | 
            +
                  children: [/* @__PURE__ */ jsx("input", {
         | 
| 93 | 
            +
                    ...rest,
         | 
| 94 | 
            +
                    type,
         | 
| 95 | 
            +
                    "data-test-id": testId,
         | 
| 96 | 
            +
                    className: cx(classes, "FormInput-suffix"),
         | 
| 97 | 
            +
                    readOnly,
         | 
| 98 | 
            +
                    ref,
         | 
| 99 | 
            +
                    "aria-describedby": rest["aria-describedby"] || createFieldErrorId(rest.id)
         | 
| 100 | 
            +
                  }), /* @__PURE__ */ jsx("label", {
         | 
| 101 | 
            +
                    className: "FormInput-suffix",
         | 
| 102 | 
            +
                    htmlFor: rest.id,
         | 
| 103 | 
            +
                    children: suffix
         | 
| 104 | 
            +
                  })]
         | 
| 105 | 
            +
                });
         | 
| 106 | 
            +
              }
         | 
| 107 | 
            +
              return /* @__PURE__ */ jsx("input", {
         | 
| 108 | 
            +
                ...rest,
         | 
| 109 | 
            +
                type,
         | 
| 110 | 
            +
                className: classes,
         | 
| 111 | 
            +
                readOnly,
         | 
| 112 | 
            +
                tabIndex,
         | 
| 113 | 
            +
                ref,
         | 
| 114 | 
            +
                "data-test-id": testId,
         | 
| 115 | 
            +
                style: overrideWidth ? {
         | 
| 116 | 
            +
                  width: overrideWidth
         | 
| 117 | 
            +
                } : void 0,
         | 
| 118 | 
            +
                "aria-describedby": rest["aria-describedby"] || createFieldErrorId(rest.id)
         | 
| 119 | 
            +
              });
         | 
| 120 | 
            +
            });
         | 
| 121 | 
            +
            TextField.displayName = "TextField";
         | 
| 122 | 
            +
            const CompactTextField$1 = "";
         | 
| 123 | 
            +
            const CompactTextField = forwardRef(({
         | 
| 124 | 
            +
              className,
         | 
| 125 | 
            +
              id,
         | 
| 126 | 
            +
              label,
         | 
| 127 | 
            +
              needsErrorFeedback,
         | 
| 128 | 
            +
              value,
         | 
| 129 | 
            +
              onFocus,
         | 
| 130 | 
            +
              onBlur,
         | 
| 131 | 
            +
              "data-test-id": testId = "compact-text-field",
         | 
| 132 | 
            +
              ...rest
         | 
| 133 | 
            +
            }, ref) => {
         | 
| 134 | 
            +
              const [isActive, setIsActive] = useState((typeof value === "boolean" || value ? value.toString() : "").trim().length !== 0);
         | 
| 135 | 
            +
              const isActiveState = isActive || needsErrorFeedback;
         | 
| 136 | 
            +
              const classes = cx("CompactTextField", className, isActiveState && "is-active");
         | 
| 137 | 
            +
              const placeholder = isActiveState ? "" : label;
         | 
| 138 | 
            +
              const handleFocus = (event) => {
         | 
| 139 | 
            +
                setIsActive(true);
         | 
| 140 | 
            +
                if (onFocus) {
         | 
| 141 | 
            +
                  onFocus(event);
         | 
| 142 | 
            +
                }
         | 
| 143 | 
            +
              };
         | 
| 144 | 
            +
              const handleBlur = (event) => {
         | 
| 145 | 
            +
                const value2 = event.target.value || "";
         | 
| 146 | 
            +
                setIsActive(value2.trim().length !== 0);
         | 
| 147 | 
            +
                if (onBlur) {
         | 
| 148 | 
            +
                  onBlur(event);
         | 
| 149 | 
            +
                }
         | 
| 150 | 
            +
              };
         | 
| 151 | 
            +
              return /* @__PURE__ */ jsxs("div", {
         | 
| 152 | 
            +
                className: classes,
         | 
| 153 | 
            +
                "data-test-id": testId,
         | 
| 154 | 
            +
                children: [/* @__PURE__ */ jsx(Label, {
         | 
| 155 | 
            +
                  htmlFor: id,
         | 
| 156 | 
            +
                  children: label
         | 
| 157 | 
            +
                }), /* @__PURE__ */ jsx(TextField, {
         | 
| 158 | 
            +
                  ...rest,
         | 
| 159 | 
            +
                  id,
         | 
| 160 | 
            +
                  placeholder,
         | 
| 161 | 
            +
                  value,
         | 
| 162 | 
            +
                  ref,
         | 
| 163 | 
            +
                  onFocus: handleFocus,
         | 
| 164 | 
            +
                  onBlur: handleBlur
         | 
| 165 | 
            +
                })]
         | 
| 166 | 
            +
              });
         | 
| 167 | 
            +
            });
         | 
| 168 | 
            +
            CompactTextField.displayName = "CompactTextField";
         | 
| 169 | 
            +
            const FieldError = ({
         | 
| 170 | 
            +
              name,
         | 
| 171 | 
            +
              errorMessage,
         | 
| 172 | 
            +
              className,
         | 
| 173 | 
            +
              "data-test-id": testId = "field-error",
         | 
| 174 | 
            +
              ...rest
         | 
| 175 | 
            +
            }) => {
         | 
| 176 | 
            +
              if (!errorMessage) {
         | 
| 177 | 
            +
                return null;
         | 
| 178 | 
            +
              }
         | 
| 179 | 
            +
              return /* @__PURE__ */ jsx("span", {
         | 
| 180 | 
            +
                ...rest,
         | 
| 181 | 
            +
                className: cx("Form-fieldError", className),
         | 
| 182 | 
            +
                "aria-live": "polite",
         | 
| 183 | 
            +
                "data-test-id": testId,
         | 
| 184 | 
            +
                id: createFieldErrorId(name),
         | 
| 185 | 
            +
                children: `Error - ${errorMessage}`
         | 
| 186 | 
            +
              });
         | 
| 187 | 
            +
            };
         | 
| 188 | 
            +
            const FieldSet$1 = "";
         | 
| 189 | 
            +
            const FieldSet = ({
         | 
| 190 | 
            +
              children,
         | 
| 191 | 
            +
              className,
         | 
| 192 | 
            +
              "data-test-id": testId = "field-set",
         | 
| 193 | 
            +
              ...rest
         | 
| 194 | 
            +
            }) => {
         | 
| 195 | 
            +
              const classes = cx("FieldSet", className);
         | 
| 196 | 
            +
              return /* @__PURE__ */ jsx("fieldset", {
         | 
| 197 | 
            +
                "data-test-id": testId,
         | 
| 198 | 
            +
                className: classes,
         | 
| 199 | 
            +
                ...rest,
         | 
| 200 | 
            +
                children
         | 
| 201 | 
            +
              });
         | 
| 202 | 
            +
            };
         | 
| 203 | 
            +
            const Form = (props) => {
         | 
| 204 | 
            +
              const {
         | 
| 205 | 
            +
                className,
         | 
| 206 | 
            +
                inline,
         | 
| 207 | 
            +
                children,
         | 
| 208 | 
            +
                hasIncreasedErrorMargin,
         | 
| 209 | 
            +
                "data-test-id": testId = "form",
         | 
| 210 | 
            +
                ...rest
         | 
| 211 | 
            +
              } = props;
         | 
| 212 | 
            +
              const classes = cx("Form", className, inline && "Form--inline", !!hasIncreasedErrorMargin && "Form--increasedErrorMargin");
         | 
| 213 | 
            +
              return /* @__PURE__ */ jsx("form", {
         | 
| 214 | 
            +
                ...rest,
         | 
| 215 | 
            +
                "data-test-id": testId,
         | 
| 216 | 
            +
                className: classes,
         | 
| 217 | 
            +
                children
         | 
| 218 | 
            +
              });
         | 
| 219 | 
            +
            };
         | 
| 220 | 
            +
            const FormGroup = (props) => {
         | 
| 221 | 
            +
              const {
         | 
| 222 | 
            +
                className,
         | 
| 223 | 
            +
                name,
         | 
| 224 | 
            +
                ignoreValidation,
         | 
| 225 | 
            +
                isInvalid,
         | 
| 226 | 
            +
                children,
         | 
| 227 | 
            +
                "data-test-id": testId = "form-group",
         | 
| 228 | 
            +
                ...rest
         | 
| 229 | 
            +
              } = props;
         | 
| 230 | 
            +
              const classes = cx("Form-group", className, !ignoreValidation && isInvalid && "is-invalid");
         | 
| 231 | 
            +
              return /* @__PURE__ */ jsx("div", {
         | 
| 232 | 
            +
                className: classes,
         | 
| 233 | 
            +
                "data-test-id": testId,
         | 
| 234 | 
            +
                ...rest,
         | 
| 235 | 
            +
                children
         | 
| 236 | 
            +
              });
         | 
| 237 | 
            +
            };
         | 
| 238 | 
            +
            const FormHint$1 = "";
         | 
| 239 | 
            +
            const FormHint = ({
         | 
| 240 | 
            +
              className,
         | 
| 241 | 
            +
              children,
         | 
| 242 | 
            +
              "data-test-id": testId = "form-hint",
         | 
| 243 | 
            +
              ...rest
         | 
| 244 | 
            +
            }) => {
         | 
| 245 | 
            +
              const classes = cx("Form-hint", className);
         | 
| 246 | 
            +
              return /* @__PURE__ */ jsx("div", {
         | 
| 247 | 
            +
                ...rest,
         | 
| 248 | 
            +
                "data-test-id": testId,
         | 
| 249 | 
            +
                className: classes,
         | 
| 250 | 
            +
                children
         | 
| 251 | 
            +
              });
         | 
| 252 | 
            +
            };
         | 
| 253 | 
            +
            const FormField$1 = "";
         | 
| 254 | 
            +
            const FormField = ({
         | 
| 255 | 
            +
              isRequired,
         | 
| 256 | 
            +
              label,
         | 
| 257 | 
            +
              name,
         | 
| 258 | 
            +
              htmlFor,
         | 
| 259 | 
            +
              hint,
         | 
| 260 | 
            +
              errorMessage,
         | 
| 261 | 
            +
              ignoreValidation,
         | 
| 262 | 
            +
              isInvalid,
         | 
| 263 | 
            +
              children,
         | 
| 264 | 
            +
              className,
         | 
| 265 | 
            +
              onBlur,
         | 
| 266 | 
            +
              "data-test-id": testId = "form-field"
         | 
| 267 | 
            +
            }) => {
         | 
| 268 | 
            +
              const handleBlur = () => {
         | 
| 269 | 
            +
                onBlur && onBlur(name);
         | 
| 270 | 
            +
              };
         | 
| 271 | 
            +
              return /* @__PURE__ */ jsxs(FormGroup, {
         | 
| 272 | 
            +
                className: cx("FormField", className),
         | 
| 273 | 
            +
                name,
         | 
| 274 | 
            +
                ignoreValidation,
         | 
| 275 | 
            +
                isInvalid,
         | 
| 276 | 
            +
                onBlur: handleBlur,
         | 
| 277 | 
            +
                "data-test-id": testId,
         | 
| 278 | 
            +
                children: [label && /* @__PURE__ */ jsxs("label", {
         | 
| 279 | 
            +
                  htmlFor,
         | 
| 280 | 
            +
                  children: [label, isRequired && /* @__PURE__ */ jsx(RequiredAsterisk, {})]
         | 
| 281 | 
            +
                }), hint && /* @__PURE__ */ jsx(FormHint, {
         | 
| 282 | 
            +
                  className: "FormField-hint",
         | 
| 283 | 
            +
                  children: hint
         | 
| 284 | 
            +
                }), children, /* @__PURE__ */ jsx(FieldError, {
         | 
| 285 | 
            +
                  className: "FormField-errorMessage",
         | 
| 286 | 
            +
                  name,
         | 
| 287 | 
            +
                  errorMessage
         | 
| 288 | 
            +
                })]
         | 
| 289 | 
            +
              });
         | 
| 290 | 
            +
            };
         | 
| 291 | 
            +
            const IconField$1 = "";
         | 
| 292 | 
            +
            const IconField = ({
         | 
| 293 | 
            +
              icon,
         | 
| 294 | 
            +
              children,
         | 
| 295 | 
            +
              className,
         | 
| 296 | 
            +
              "data-test-id": testId = "icon-field",
         | 
| 297 | 
            +
              ...rest
         | 
| 298 | 
            +
            }) => {
         | 
| 299 | 
            +
              const Icon = icon;
         | 
| 300 | 
            +
              const classes = cx("IconField", className);
         | 
| 301 | 
            +
              return /* @__PURE__ */ jsxs("div", {
         | 
| 302 | 
            +
                className: classes,
         | 
| 303 | 
            +
                "data-test-id": testId,
         | 
| 304 | 
            +
                ...rest,
         | 
| 305 | 
            +
                children: [children, /* @__PURE__ */ jsx(Icon, {
         | 
| 306 | 
            +
                  size: "small"
         | 
| 307 | 
            +
                })]
         | 
| 308 | 
            +
              });
         | 
| 309 | 
            +
            };
         | 
| 310 | 
            +
            const Radio = ({
         | 
| 311 | 
            +
              "aria-label": ariaLabel,
         | 
| 312 | 
            +
              "aria-labelledby": ariaLabelledby,
         | 
| 313 | 
            +
              checked = false,
         | 
| 314 | 
            +
              children,
         | 
| 315 | 
            +
              className,
         | 
| 316 | 
            +
              disabled = false,
         | 
| 317 | 
            +
              id,
         | 
| 318 | 
            +
              labelClassName,
         | 
| 319 | 
            +
              labelStyle,
         | 
| 320 | 
            +
              "data-test-id": testId = "radio",
         | 
| 321 | 
            +
              ...rest
         | 
| 322 | 
            +
            }) => {
         | 
| 323 | 
            +
              const hasAriaLabel = ariaLabel !== void 0 || ariaLabelledby !== void 0;
         | 
| 324 | 
            +
              if (!children && !hasAriaLabel) {
         | 
| 325 | 
            +
                console.warn("If you do not provide children, you must specify an aria-label for accessibility");
         | 
| 326 | 
            +
              }
         | 
| 327 | 
            +
              return /* @__PURE__ */ jsxs(Fragment, {
         | 
| 328 | 
            +
                children: [/* @__PURE__ */ jsx("input", {
         | 
| 329 | 
            +
                  ...rest,
         | 
| 330 | 
            +
                  "aria-label": ariaLabel,
         | 
| 331 | 
            +
                  "aria-labelledby": ariaLabelledby,
         | 
| 332 | 
            +
                  className: cx("Form-radio", className),
         | 
| 333 | 
            +
                  checked,
         | 
| 334 | 
            +
                  disabled,
         | 
| 335 | 
            +
                  id,
         | 
| 336 | 
            +
                  "data-test-id": testId,
         | 
| 337 | 
            +
                  type: "radio"
         | 
| 338 | 
            +
                }), /* @__PURE__ */ jsx(Label, {
         | 
| 339 | 
            +
                  className: labelClassName,
         | 
| 340 | 
            +
                  htmlFor: id,
         | 
| 341 | 
            +
                  style: labelStyle,
         | 
| 342 | 
            +
                  children: disabled ? /* @__PURE__ */ jsx("span", {
         | 
| 343 | 
            +
                    className: "Form-label--disabled",
         | 
| 344 | 
            +
                    children
         | 
| 345 | 
            +
                  }) : children
         | 
| 346 | 
            +
                })]
         | 
| 347 | 
            +
              });
         | 
| 348 | 
            +
            };
         | 
| 349 | 
            +
            const RadioGroup = (props) => {
         | 
| 350 | 
            +
              const {
         | 
| 351 | 
            +
                name,
         | 
| 352 | 
            +
                value,
         | 
| 353 | 
            +
                onChange,
         | 
| 354 | 
            +
                children,
         | 
| 355 | 
            +
                disabled,
         | 
| 356 | 
            +
                legend,
         | 
| 357 | 
            +
                "data-test-id": testId = "radio-group",
         | 
| 358 | 
            +
                ...rest
         | 
| 359 | 
            +
              } = props;
         | 
| 360 | 
            +
              const fieldsetRef = useRef(null);
         | 
| 361 | 
            +
              function updateRadioElems(elem) {
         | 
| 362 | 
            +
                var _a, _b;
         | 
| 363 | 
            +
                if (!isValidElement(elem)) {
         | 
| 364 | 
            +
                  return elem;
         | 
| 365 | 
            +
                }
         | 
| 366 | 
            +
                const item = elem;
         | 
| 367 | 
            +
                if ((item == null ? void 0 : item.type) && item.type === Radio) {
         | 
| 368 | 
            +
                  return cloneElement(item, {
         | 
| 369 | 
            +
                    ...item.props,
         | 
| 370 | 
            +
                    name,
         | 
| 371 | 
            +
                    checked: item.props.value === value,
         | 
| 372 | 
            +
                    onChange,
         | 
| 373 | 
            +
                    disabled: typeof ((_a = item.props) == null ? void 0 : _a.disabled) !== "undefined" ? item.props.disabled : disabled
         | 
| 374 | 
            +
                  });
         | 
| 375 | 
            +
                }
         | 
| 376 | 
            +
                if ((item == null ? void 0 : item.type) && item.type === Label) {
         | 
| 377 | 
            +
                  return cloneElement(item, {
         | 
| 378 | 
            +
                    ...item.props,
         | 
| 379 | 
            +
                    onChange,
         | 
| 380 | 
            +
                    disabled
         | 
| 381 | 
            +
                  });
         | 
| 382 | 
            +
                }
         | 
| 383 | 
            +
                const elemChildren = (_b = item == null ? void 0 : item.props) == null ? void 0 : _b.children;
         | 
| 384 | 
            +
                if (elemChildren) {
         | 
| 385 | 
            +
                  if (Array.isArray(elemChildren)) {
         | 
| 386 | 
            +
                    return cloneElement(item, {
         | 
| 387 | 
            +
                      children: Children.map(elemChildren, (elemChild) => updateRadioElems(elemChild))
         | 
| 388 | 
            +
                    });
         | 
| 389 | 
            +
                  }
         | 
| 390 | 
            +
                  return cloneElement(item, {
         | 
| 391 | 
            +
                    children: updateRadioElems(elemChildren)
         | 
| 392 | 
            +
                  });
         | 
| 393 | 
            +
                }
         | 
| 394 | 
            +
                if ((item == null ? void 0 : item.type) && item.type !== Radio && item.type !== Label) {
         | 
| 395 | 
            +
                  return item;
         | 
| 396 | 
            +
                }
         | 
| 397 | 
            +
                return null;
         | 
| 398 | 
            +
              }
         | 
| 399 | 
            +
              const radios = Children.map(children, (child) => updateRadioElems(child));
         | 
| 400 | 
            +
              return /* @__PURE__ */ jsxs("fieldset", {
         | 
| 401 | 
            +
                "data-test-id": testId,
         | 
| 402 | 
            +
                ref: fieldsetRef,
         | 
| 403 | 
            +
                children: [legend && /* @__PURE__ */ jsx("legend", {
         | 
| 404 | 
            +
                  children: /* @__PURE__ */ jsx(VisuallyHidden, {
         | 
| 405 | 
            +
                    children: legend
         | 
| 406 | 
            +
                  })
         | 
| 407 | 
            +
                }), /* @__PURE__ */ jsx("div", {
         | 
| 408 | 
            +
                  ...rest,
         | 
| 409 | 
            +
                  children: radios
         | 
| 410 | 
            +
                })]
         | 
| 411 | 
            +
              });
         | 
| 412 | 
            +
            };
         | 
| 413 | 
            +
            const Select = ({
         | 
| 414 | 
            +
              className,
         | 
| 415 | 
            +
              children,
         | 
| 416 | 
            +
              "data-test-id": testId = "select",
         | 
| 417 | 
            +
              ...rest
         | 
| 418 | 
            +
            }) => {
         | 
| 419 | 
            +
              const classes = cx("FormInput", "FormInput-select", className);
         | 
| 420 | 
            +
              return /* @__PURE__ */ jsx("select", {
         | 
| 421 | 
            +
                ...rest,
         | 
| 422 | 
            +
                "data-test-id": testId,
         | 
| 423 | 
            +
                className: classes,
         | 
| 424 | 
            +
                children
         | 
| 425 | 
            +
              });
         | 
| 426 | 
            +
            };
         | 
| 427 | 
            +
            const TextArea = forwardRef(({
         | 
| 428 | 
            +
              className,
         | 
| 429 | 
            +
              "data-test-id": testId = "text-area",
         | 
| 430 | 
            +
              ...props
         | 
| 431 | 
            +
            }, ref) => {
         | 
| 432 | 
            +
              const onKeyDown = (e) => {
         | 
| 433 | 
            +
                if (e.key === "ArrowRight" || e.key === "ArrowDown" || e.key === "ArrowUp" || e.key === "ArrowLeft") {
         | 
| 434 | 
            +
                  e.stopPropagation();
         | 
| 435 | 
            +
                }
         | 
| 436 | 
            +
                if (e.key === "Escape") {
         | 
| 437 | 
            +
                  e.nativeEvent.stopImmediatePropagation();
         | 
| 438 | 
            +
                }
         | 
| 439 | 
            +
              };
         | 
| 440 | 
            +
              return /* @__PURE__ */ jsx("textarea", {
         | 
| 441 | 
            +
                ...props,
         | 
| 442 | 
            +
                className: cx("FormInput", className),
         | 
| 443 | 
            +
                ref,
         | 
| 444 | 
            +
                "data-test-id": testId,
         | 
| 445 | 
            +
                "aria-describedby": props["aria-describedby"] || createFieldErrorId(props.id),
         | 
| 446 | 
            +
                onKeyDown
         | 
| 447 | 
            +
              });
         | 
| 448 | 
            +
            });
         | 
| 449 | 
            +
            TextArea.displayName = "TextArea";
         | 
| 450 | 
            +
            export {
         | 
| 451 | 
            +
              Checkbox,
         | 
| 452 | 
            +
              CompactTextField,
         | 
| 453 | 
            +
              FieldError,
         | 
| 454 | 
            +
              FieldSet,
         | 
| 455 | 
            +
              Form,
         | 
| 456 | 
            +
              FormField,
         | 
| 457 | 
            +
              FormGroup,
         | 
| 458 | 
            +
              FormHint,
         | 
| 459 | 
            +
              IconField,
         | 
| 460 | 
            +
              Label,
         | 
| 461 | 
            +
              Radio,
         | 
| 462 | 
            +
              RadioGroup,
         | 
| 463 | 
            +
              RequiredAsterisk,
         | 
| 464 | 
            +
              Select,
         | 
| 465 | 
            +
              TextArea,
         | 
| 466 | 
            +
              TextField
         | 
| 467 | 
            +
            };
         | 
| 468 | 
            +
            //# sourceMappingURL=index.es.js.map
         | 
| @@ -0,0 +1 @@ | |
| 1 | 
            +
            {"version":3,"file":"index.es.js","sources":["../src/RequiredAsterisk.tsx","../src/Label.tsx","../src/Checkbox.tsx","../src/utils/index.ts","../src/TextField.tsx","../src/CompactTextField.tsx","../src/FieldError.tsx","../src/FieldSet.tsx","../src/Form.tsx","../src/FormGroup.tsx","../src/FormHint.tsx","../src/FormField.tsx","../src/IconField.tsx","../src/Radio.tsx","../src/RadioGroup.tsx","../src/Select.tsx","../src/TextArea.tsx"],"sourcesContent":["import type { HTMLAttributes } from 'react';\n\nimport { cx } from 'classix';\n\nimport './styles/RequiredAsterisk.css';\n\ntype RequiredAsteriskProps = HTMLAttributes<HTMLSpanElement> & {\n  'data-test-id'?: string;\n};\n\nconst RequiredAsterisk = ({\n  className,\n  'data-test-id': testId = 'required-asterisk',\n  ...rest\n}: RequiredAsteriskProps) => {\n  const classes = cx('RequiredAsterisk', className);\n\n  return (\n    <span {...rest} data-test-id={testId} className={classes}>\n      *\n    </span>\n  );\n};\n\nexport { RequiredAsterisk };\nexport type { RequiredAsteriskProps };\n","import type { LabelHTMLAttributes } from 'react';\n\nimport { cx } from 'classix';\n\nimport { RequiredAsterisk } from './RequiredAsterisk';\nimport './styles/Form.css';\n\ntype LabelProps = LabelHTMLAttributes<HTMLLabelElement> & {\n  required?: boolean;\n  optional?: boolean;\n  disabled?: boolean;\n  'data-test-id'?: string;\n};\n\nconst Label = ({\n  disabled,\n  className,\n  children,\n  required = false,\n  optional = false,\n  'data-test-id': testId = 'label',\n  ...rest\n}: LabelProps) => {\n  const classes = cx('Form-label', className, disabled && 'Form-label--disabled');\n\n  return (\n    <label {...rest} data-test-id={testId} className={classes}>\n      {children}\n      {optional && !required && <small className=\"Form-labelOptional\">(optional)</small>}\n      {required && !optional && <RequiredAsterisk />}\n    </label>\n  );\n};\n\nexport { Label };\nexport type { LabelProps };\n","import type { InputHTMLAttributes } from 'react';\n\nimport { forwardRef } from 'react';\n\nimport { Label } from './Label';\nimport './styles/Form.css';\n\ntype CheckboxProps = InputHTMLAttributes<HTMLInputElement> & {\n  /**\n   * The className to pass into the Checkbox's Label component\n   */\n  labelClassName?: string;\n  'data-test-id'?: string;\n};\n\nconst Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(\n  (\n    {\n      'aria-label': ariaLabel,\n      'aria-labelledby': ariaLabelledby,\n      children,\n      disabled,\n      checked,\n      labelClassName,\n      'data-test-id': testId = 'checkbox',\n      ...rest\n    },\n    ref\n  ) => {\n    const hasAriaLabel = ariaLabel !== undefined || ariaLabelledby !== undefined;\n    if (!children && !hasAriaLabel) {\n      console.warn(\n        'If you do not provide children, you must specify an aria-label for accessibility'\n      );\n    }\n\n    return (\n      <Label className={labelClassName}>\n        <input\n          {...rest}\n          ref={ref}\n          checked={checked}\n          aria-checked={checked ? 'true' : 'false'}\n          aria-label={ariaLabel}\n          aria-labelledby={ariaLabelledby}\n          className=\"Form-checkbox\"\n          disabled={disabled}\n          type=\"checkbox\"\n          data-test-id={testId}\n        />{' '}\n        {disabled ? <span className=\"Form-label--disabled\">{children}</span> : children}\n      </Label>\n    );\n  }\n);\n\nCheckbox.displayName = 'Checkbox';\n\nexport { Checkbox };\nexport type { CheckboxProps };\n","type FieldPath = string | string[];\n\nconst createFieldErrorId = (fieldIdentifier?: FieldPath) =>\n  fieldIdentifier ? `${[...fieldIdentifier].join('')}-err` : undefined;\n\nexport { createFieldErrorId };\nexport type { FieldPath };\n","import type { InputHTMLAttributes } from 'react';\n\nimport { cx } from 'classix';\nimport { forwardRef } from 'react';\n\nimport './styles/FormInput.css';\nimport { createFieldErrorId } from './utils';\n\ntype TextFieldProps = InputHTMLAttributes<HTMLInputElement> & {\n  suffix?: string;\n  tiny?: boolean;\n  overrideWidth?: string;\n  'data-test-id'?: string;\n};\n\nconst TextField = forwardRef<HTMLInputElement, TextFieldProps>(\n  (\n    {\n      className,\n      type = 'text',\n      tiny = false,\n      readOnly,\n      tabIndex = 0,\n      suffix,\n      overrideWidth,\n      'data-test-id': testId = 'text-field',\n      ...rest\n    },\n    ref\n  ) => {\n    const classes = overrideWidth\n      ? className\n      : cx('FormInput', `FormInput-${type}`, className, tiny && 'FormInput--tiny');\n\n    if (suffix) {\n      return (\n        <div className=\"FormInput-suffixContainer\">\n          <input\n            {...rest}\n            type={type}\n            data-test-id={testId}\n            className={cx(classes, 'FormInput-suffix')}\n            readOnly={readOnly}\n            ref={ref}\n            aria-describedby={rest['aria-describedby'] || createFieldErrorId(rest.id)}\n          />\n          <label className=\"FormInput-suffix\" htmlFor={rest.id}>\n            {suffix}\n          </label>\n        </div>\n      );\n    }\n\n    return (\n      <input\n        {...rest}\n        type={type}\n        className={classes}\n        readOnly={readOnly}\n        tabIndex={tabIndex}\n        ref={ref}\n        data-test-id={testId}\n        style={\n          overrideWidth\n            ? {\n                width: overrideWidth,\n              }\n            : undefined\n        }\n        aria-describedby={rest['aria-describedby'] || createFieldErrorId(rest.id)}\n      />\n    );\n  }\n);\n\nTextField.displayName = 'TextField';\n\nexport { TextField };\nexport type { TextFieldProps };\n","import type { TextFieldProps } from './TextField';\nimport type { FocusEvent } from 'react';\n\nimport { cx } from 'classix';\nimport { forwardRef, useState } from 'react';\n\nimport { Label } from './Label';\nimport { TextField } from './TextField';\nimport './styles/CompactTextField.css';\nimport './styles/FormInput.css';\n\ntype CompactTextFieldProps = TextFieldProps & {\n  label: string;\n  needsErrorFeedback?: boolean;\n};\n\nconst CompactTextField = forwardRef<HTMLInputElement, CompactTextFieldProps>(\n  (\n    {\n      className,\n      id,\n      label,\n      needsErrorFeedback,\n      value,\n      onFocus,\n      onBlur,\n      'data-test-id': testId = 'compact-text-field',\n      ...rest\n    },\n    ref\n  ) => {\n    const [isActive, setIsActive] = useState(\n      (typeof value === 'boolean' || value ? value.toString() : '').trim().length !== 0\n    );\n\n    const isActiveState = isActive || needsErrorFeedback;\n\n    const classes = cx('CompactTextField', className, isActiveState && 'is-active');\n\n    const placeholder = isActiveState ? '' : label;\n\n    const handleFocus = (event: FocusEvent<HTMLInputElement>) => {\n      setIsActive(true);\n      if (onFocus) {\n        onFocus(event);\n      }\n    };\n\n    const handleBlur = (event: FocusEvent<HTMLInputElement>) => {\n      const value = event.target.value || '';\n      setIsActive(value.trim().length !== 0);\n      if (onBlur) {\n        onBlur(event);\n      }\n    };\n\n    return (\n      <div className={classes} data-test-id={testId}>\n        <Label htmlFor={id}>{label}</Label>\n        <TextField\n          {...rest}\n          id={id}\n          placeholder={placeholder}\n          value={value}\n          ref={ref}\n          onFocus={handleFocus}\n          onBlur={handleBlur}\n        />\n      </div>\n    );\n  }\n);\n\nCompactTextField.displayName = 'CompactTextField';\n\nexport { CompactTextField };\nexport type { CompactTextFieldProps };\n","import type { FieldPath } from './utils';\nimport type { HTMLAttributes } from 'react';\n\nimport { cx } from 'classix';\n\nimport './styles/Form.css';\nimport { createFieldErrorId } from './utils';\n\ntype FieldErrorProps = HTMLAttributes<HTMLSpanElement> & {\n  name: FieldPath;\n  errorMessage?: string;\n  'data-test-id'?: string;\n};\n\nconst FieldError = ({\n  name,\n  errorMessage,\n  className,\n  'data-test-id': testId = 'field-error',\n  ...rest\n}: FieldErrorProps) => {\n  if (!errorMessage) {\n    return null;\n  }\n\n  return (\n    <span\n      {...rest}\n      className={cx('Form-fieldError', className)}\n      aria-live=\"polite\"\n      data-test-id={testId}\n      id={createFieldErrorId(name)}\n    >\n      {`Error - ${errorMessage}`}\n    </span>\n  );\n};\n\nexport { FieldError };\nexport type { FieldErrorProps };\n","import type { HTMLAttributes } from 'react';\n\nimport { cx } from 'classix';\n\nimport './styles/FieldSet.css';\n\ntype FieldSetProps = HTMLAttributes<HTMLFieldSetElement> & {\n  'data-test-id'?: string;\n};\n\nconst FieldSet = ({\n  children,\n  className,\n  'data-test-id': testId = 'field-set',\n  ...rest\n}: FieldSetProps) => {\n  const classes = cx('FieldSet', className);\n\n  return (\n    <fieldset data-test-id={testId} className={classes} {...rest}>\n      {children}\n    </fieldset>\n  );\n};\n\nexport { FieldSet };\nexport type { FieldSetProps };\n","import type { FormHTMLAttributes } from 'react';\n\nimport { cx } from 'classix';\n\nimport './styles/Form.css';\n\ntype FormProps = FormHTMLAttributes<HTMLFormElement> & {\n  inline?: boolean;\n  // Increases margin between form fields to make room for error messages.\n  // This prevents the form from shifting when rendering a field error.\n  // This may be desired when the form contains external links that will\n  // shift while clicking if the form shifts from validation.\n  hasIncreasedErrorMargin?: boolean;\n  'data-test-id'?: string;\n};\n\nconst Form = (props: FormProps) => {\n  const {\n    className,\n    inline,\n    children,\n    hasIncreasedErrorMargin,\n    'data-test-id': testId = 'form',\n    ...rest\n  } = props;\n\n  const classes = cx(\n    'Form',\n    className,\n    inline && 'Form--inline',\n    !!hasIncreasedErrorMargin && 'Form--increasedErrorMargin'\n  );\n\n  return (\n    <form {...rest} data-test-id={testId} className={classes}>\n      {children}\n    </form>\n  );\n};\n\nexport { Form };\nexport type { FormProps };\n","import type { HTMLAttributes } from 'react';\n\nimport { cx } from 'classix';\n\nimport './styles/Form.css';\n\ntype FormGroupProps = HTMLAttributes<HTMLDivElement> & {\n  name?: string | string[];\n  ignoreValidation?: boolean;\n  isInvalid?: boolean;\n  'data-test-id'?: string;\n};\n\nconst FormGroup = (props: FormGroupProps) => {\n  const {\n    className,\n    name,\n    ignoreValidation,\n    isInvalid,\n    children,\n    'data-test-id': testId = 'form-group',\n    ...rest\n  } = props;\n\n  const classes = cx('Form-group', className, !ignoreValidation && isInvalid && 'is-invalid');\n\n  return (\n    <div className={classes} data-test-id={testId} {...rest}>\n      {children}\n    </div>\n  );\n};\n\nexport { FormGroup };\nexport type { FormGroupProps };\n","import type { HTMLAttributes } from 'react';\n\nimport { cx } from 'classix';\n\nimport './styles/FormHint.css';\n\ntype FormHintProps = HTMLAttributes<HTMLDivElement> & {\n  'data-test-id'?: string;\n};\n\nconst FormHint = ({\n  className,\n  children,\n  'data-test-id': testId = 'form-hint',\n  ...rest\n}: FormHintProps) => {\n  const classes = cx('Form-hint', className);\n\n  return (\n    <div {...rest} data-test-id={testId} className={classes}>\n      {children}\n    </div>\n  );\n};\n\nexport { FormHint };\nexport type { FormHintProps };\n","import { cx } from 'classix';\n\nimport { FieldError } from './FieldError';\nimport { FormGroup } from './FormGroup';\nimport { FormHint } from './FormHint';\nimport { RequiredAsterisk } from './RequiredAsterisk';\nimport './styles/FormField.css';\n\ntype FormFieldProps = {\n  isRequired: boolean;\n  label?: string;\n  name: string;\n  htmlFor: string;\n  hint?: string;\n  errorMessage?: string;\n  ignoreValidation?: boolean;\n  isInvalid?: boolean;\n  children: JSX.Element;\n  className?: string;\n  onBlur?: (field: string) => void;\n  'data-test-id'?: string;\n};\n\nconst FormField = ({\n  isRequired,\n  label,\n  name,\n  htmlFor,\n  hint,\n  errorMessage,\n  ignoreValidation,\n  isInvalid,\n  children,\n  className,\n  onBlur,\n  'data-test-id': testId = 'form-field',\n}: FormFieldProps) => {\n  const handleBlur = () => {\n    onBlur && onBlur(name);\n  };\n\n  return (\n    <FormGroup\n      className={cx('FormField', className)}\n      name={name}\n      ignoreValidation={ignoreValidation}\n      isInvalid={isInvalid}\n      onBlur={handleBlur}\n      data-test-id={testId}\n    >\n      {label && (\n        <label htmlFor={htmlFor}>\n          {label}\n          {isRequired && <RequiredAsterisk />}\n        </label>\n      )}\n      {hint && <FormHint className=\"FormField-hint\">{hint}</FormHint>}\n      {children}\n      <FieldError className=\"FormField-errorMessage\" name={name} errorMessage={errorMessage} />\n    </FormGroup>\n  );\n};\n\nexport type { FormFieldProps };\nexport { FormField };\n","import type { IconProps } from '@launchpad-ui/icons';\nimport type { HTMLAttributes } from 'react';\n\nimport { cx } from 'classix';\n\nimport './styles/IconField.css';\n\ntype IconFieldProps = HTMLAttributes<HTMLDivElement> & {\n  icon(args: IconProps): JSX.Element;\n  children: JSX.Element | JSX.Element[];\n  'data-test-id'?: string;\n};\n\nconst IconField = ({\n  icon,\n  children,\n  className,\n  'data-test-id': testId = 'icon-field',\n  ...rest\n}: IconFieldProps) => {\n  const Icon = icon;\n\n  const classes = cx('IconField', className);\n\n  return (\n    <div className={classes} data-test-id={testId} {...rest}>\n      {children}\n      <Icon size=\"small\" />\n    </div>\n  );\n};\n\nexport { IconField };\nexport type { IconFieldProps };\n","import type { CSSProperties, InputHTMLAttributes } from 'react';\n\nimport { cx } from 'classix';\n\nimport { Label } from './Label';\nimport './styles/Form.css';\n\ntype RadioProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'type'> & {\n  labelClassName?: string;\n  labelStyle?: CSSProperties;\n  'data-test-id'?: string;\n};\n\nconst Radio = ({\n  'aria-label': ariaLabel,\n  'aria-labelledby': ariaLabelledby,\n  checked = false,\n  children,\n  className,\n  disabled = false,\n  id,\n  labelClassName,\n  labelStyle,\n  'data-test-id': testId = 'radio',\n  ...rest\n}: RadioProps) => {\n  const hasAriaLabel = ariaLabel !== undefined || ariaLabelledby !== undefined;\n\n  if (!children && !hasAriaLabel) {\n    console.warn(\n      'If you do not provide children, you must specify an aria-label for accessibility'\n    );\n  }\n\n  return (\n    <>\n      <input\n        {...rest}\n        aria-label={ariaLabel}\n        aria-labelledby={ariaLabelledby}\n        className={cx('Form-radio', className)}\n        checked={checked}\n        disabled={disabled}\n        id={id}\n        data-test-id={testId}\n        type=\"radio\"\n      />\n      <Label className={labelClassName} htmlFor={id} style={labelStyle}>\n        {disabled ? <span className=\"Form-label--disabled\">{children}</span> : children}\n      </Label>\n    </>\n  );\n};\n\nexport { Radio };\nexport type { RadioProps };\n","import type { ChangeEvent, FormEvent, ReactElement, ReactNode } from 'react';\n\nimport { VisuallyHidden } from '@react-aria/visually-hidden';\nimport { Children, cloneElement, isValidElement, useRef } from 'react';\n\nimport { Label } from './Label';\nimport { Radio } from './Radio';\nimport './styles/Form.css';\n\ntype RadioGroupProps = {\n  /**\n   * The legend that describes this groups of radio buttons. The legend\n   * is important for screen reader users.\n   */\n  legend?: string;\n  /**\n   * The children passed into the RadioGroup.\n   */\n  children?: ReactNode;\n  /**\n   * Custom classname(s) passed to the fieldset inner div.\n   */\n  className?: string;\n  /**\n   * Set the underlying Radio to disabled if the Radio's disabled prop is undefined.\n   */\n  disabled?: boolean;\n  /**\n   * The RadioGroup's id.\n   */\n  id?: string;\n  /**\n   * Name to apply to the underlying Radio. The same name value is passed to each Radio when grouping in a RadioGroup for screen reader support.\n   */\n  name: string;\n  /**\n   * This function is passed into each Radio onChange synthetic event handler.\n   */\n  onChange?(e: ChangeEvent | FormEvent<HTMLInputElement>): void;\n  /**\n   * The value to compare against the Radio's value to determine if the Radio will be checked.\n   */\n  value: string;\n\n  'data-test-id'?: string;\n};\n\nconst RadioGroup = (props: RadioGroupProps) => {\n  const {\n    name,\n    value,\n    onChange,\n    children,\n    disabled,\n    legend,\n    'data-test-id': testId = 'radio-group',\n    ...rest\n  } = props;\n  const fieldsetRef = useRef<HTMLFieldSetElement>(null);\n\n  function updateRadioElems(elem: ReactNode): ReactNode {\n    if (!isValidElement(elem)) {\n      return elem;\n    }\n\n    const item = elem as ReactElement;\n\n    if (item?.type && item.type === Radio) {\n      return cloneElement(item, {\n        ...item.props,\n        name,\n        checked: item.props.value === value,\n        onChange,\n        disabled: typeof item.props?.disabled !== 'undefined' ? item.props.disabled : disabled,\n      });\n    }\n\n    if (item?.type && item.type === Label) {\n      return cloneElement(item, {\n        ...item.props,\n        onChange,\n        disabled,\n      });\n    }\n\n    const elemChildren = item?.props?.children;\n    if (elemChildren) {\n      if (Array.isArray(elemChildren)) {\n        return cloneElement(item, {\n          children: Children.map(elemChildren, (elemChild) => updateRadioElems(elemChild)),\n        });\n      }\n      return cloneElement(item, {\n        children: updateRadioElems(elemChildren),\n      });\n    }\n\n    if (item?.type && item.type !== Radio && item.type !== Label) {\n      return item;\n    }\n\n    return null;\n  }\n\n  const radios = Children.map(children, (child) => updateRadioElems(child));\n  return (\n    <fieldset data-test-id={testId} ref={fieldsetRef}>\n      {legend && (\n        <legend>\n          <VisuallyHidden>{legend}</VisuallyHidden>\n        </legend>\n      )}\n      <div {...rest}>{radios}</div>\n    </fieldset>\n  );\n};\n\nexport { RadioGroup };\nexport type { RadioGroupProps };\n","import type { SelectHTMLAttributes } from 'react';\n\nimport { cx } from 'classix';\n\nimport './styles/FormInput.css';\n\ntype SelectProps = SelectHTMLAttributes<HTMLSelectElement> & {\n  'data-test-id'?: string;\n};\n\nconst Select = ({\n  className,\n  children,\n  'data-test-id': testId = 'select',\n  ...rest\n}: SelectProps) => {\n  const classes = cx('FormInput', 'FormInput-select', className);\n\n  return (\n    <select {...rest} data-test-id={testId} className={classes}>\n      {children}\n    </select>\n  );\n};\n\nexport { Select };\nexport type { SelectProps };\n","import type { KeyboardEvent, TextareaHTMLAttributes } from 'react';\n\nimport { cx } from 'classix';\nimport { forwardRef } from 'react';\n\nimport './styles/FormInput.css';\nimport { createFieldErrorId } from './utils';\n\ntype TextAreaProps = TextareaHTMLAttributes<HTMLTextAreaElement> & {\n  'data-test-id'?: string;\n};\n\nconst TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(\n  ({ className, 'data-test-id': testId = 'text-area', ...props }, ref) => {\n    const onKeyDown = (e: KeyboardEvent<HTMLTextAreaElement>) => {\n      if (\n        e.key === 'ArrowRight' ||\n        e.key === 'ArrowDown' ||\n        e.key === 'ArrowUp' ||\n        e.key === 'ArrowLeft'\n      ) {\n        e.stopPropagation();\n      }\n      if (e.key === 'Escape') {\n        e.nativeEvent.stopImmediatePropagation();\n      }\n    };\n\n    return (\n      <textarea\n        {...props}\n        className={cx('FormInput', className)}\n        ref={ref}\n        data-test-id={testId}\n        aria-describedby={props['aria-describedby'] || createFieldErrorId(props.id)}\n        onKeyDown={onKeyDown}\n      />\n    );\n  }\n);\n\nTextArea.displayName = 'TextArea';\n\nexport { TextArea };\nexport type { TextAreaProps };\n"],"names":["RequiredAsterisk","className","testId","rest","classes","cx","Label","disabled","children","required","optional","_jsx","Checkbox","forwardRef","ariaLabel","ariaLabelledby","checked","labelClassName","ref","hasAriaLabel","undefined","console","warn","displayName","TextField","type","tiny","readOnly","tabIndex","suffix","overrideWidth","createFieldErrorId","id","width","CompactTextField","label","needsErrorFeedback","value","onFocus","onBlur","isActive","setIsActive","useState","toString","trim","length","isActiveState","placeholder","handleFocus","event","handleBlur","target","FieldError","name","errorMessage","FieldSet","Form","props","inline","hasIncreasedErrorMargin","FormGroup","ignoreValidation","isInvalid","FormHint","FormField","isRequired","htmlFor","hint","_jsxs","IconField","icon","Icon","Radio","labelStyle","_Fragment","RadioGroup","onChange","legend","fieldsetRef","useRef","updateRadioElems","elem","isValidElement","item","cloneElement","elemChildren","Array","isArray","Children","map","elemChild","radios","child","Select","TextArea","onKeyDown","e","key","stopPropagation","nativeEvent","stopImmediatePropagation"],"mappings":";;;;;AAU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