diff --git a/package.json b/package.json index 4347e38be..6824e4444 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "build-storybook": "storybook build", "chromatic": "chromatic --exit-zero-on-changes", "dev": "npm-run-all -p start test:watch storybook", - "lint": "eslint '**/*.{ts,tsx}'", + "lint": "eslint \"**/*.{ts,tsx}\"", "prepare": "husky install && rollup -c", "size": "size-limit", "start": "rollup -c -w", diff --git a/rollup.config.js b/rollup.config.js index d1e83fb93..7cf36581b 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -54,7 +54,7 @@ const baseConfig = { ); file.code = file.code.replace( /import\s?(\w+)?\s?from\s?["'](\.\.\/|\.\/){1,5}node_modules\/style-inject\/dist\/style-inject.es.(esm).?js["'];?/, - `import $1 from "${relativePath}";` + `import $1 from "${relativePath.replaceAll('\\', '/')}";` ); } else if (fileName.match(/.*(.module.cjs.js)$/)) { // Replace tslib import with a custom resolution or code snippet @@ -64,7 +64,7 @@ const baseConfig = { ); file.code = file.code.replace( /require\(["'](\.\.\/|\.\/){1,5}node_modules\/style-inject\/dist\/style-inject.es.(cjs).?js["']\);?/, - `require("${relativePath}");` + `require("${relativePath.replaceAll('\\', '/')}");` ); } }); diff --git a/src/components/Form/Wrapper/InputWrapper/InputWrapper.tsx b/src/components/Form/Wrapper/InputWrapper/InputWrapper.tsx index d0373a239..077ef5e43 100644 --- a/src/components/Form/Wrapper/InputWrapper/InputWrapper.tsx +++ b/src/components/Form/Wrapper/InputWrapper/InputWrapper.tsx @@ -64,6 +64,9 @@ const InputWrapperComponent: ForwardRefRenderFunction = ( inputWrapperClasses.push(inputProps?.wrapperProps?.className); disabled && inputWrapperClasses.push(classes["disabled"]); + const describedByErrorId = error ? errorId : undefined; + const describedByHelperId = helperText ? helperId : undefined; + return ( = ( }} ref={inputProps?.ref || input} aria-labelledby={labelId} - aria-describedby={error ? errorId : helperId} + aria-describedby={describedByErrorId ?? describedByHelperId} onChange={onChange} onFocus={e => { onFocus?.(e);