@vtfk/components
Advanced tools
Comparing version 0.7.1 to 0.7.2
{ | ||
"name": "@vtfk/components", | ||
"version": "0.7.1", | ||
"version": "0.7.2", | ||
"description": "Komponentbibliotek for Vestfold og Telemark fylkeskommune", | ||
@@ -5,0 +5,0 @@ "keywords": [], |
@@ -50,2 +50,3 @@ import React, { useEffect, useMemo, useState } from 'react' | ||
let classes = 'textfield' | ||
if (className) classes += ` ${className}` | ||
if (type && typeof type === 'string') classes += ` ${type}` | ||
@@ -62,3 +63,3 @@ if (required) classes += ' required-input' | ||
return classes | ||
}, [hasData, focusState, type, required, rounded, error, alwaysPlaceholder]) | ||
}, [hasData, focusState, type, required, rounded, error, alwaysPlaceholder, className]) | ||
@@ -65,0 +66,0 @@ // Determine what classes the input should have |
@@ -7,2 +7,4 @@ import React, { useState } from 'react' | ||
import './stories.styles.scss' | ||
export default getConfig( | ||
@@ -123,1 +125,10 @@ { title: 'TextField', component: TextField } | ||
} | ||
export function WithClassName () { | ||
return ( | ||
<div> | ||
<TextField placeholder='red' className='red' value='className = red' /> | ||
<TextField placeholder='green' className='green' value='className = green' /> | ||
</div> | ||
) | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
3053099
168
8929