File tree Expand file tree Collapse file tree 4 files changed +29
-3
lines changed
src/design-system/asset-input Expand file tree Collapse file tree 4 files changed +29
-3
lines changed Original file line number Diff line number Diff line change 11import React from 'react' ;
22
3+ import cn from 'classnames' ;
4+
35import { Box } from '../box' ;
46
57import * as cx from './amount-input.css' ;
@@ -11,6 +13,8 @@ interface Props {
1113 value ?: string ;
1214 id : string ;
1315 testId ?: string ;
16+ className ?: string ;
17+ inputClassName ?: string ;
1418}
1519
1620export const AmountInput = ( {
@@ -19,11 +23,13 @@ export const AmountInput = ({
1923 value,
2024 id,
2125 testId,
26+ className,
27+ inputClassName,
2228} : Readonly < Props > ) : JSX . Element => {
2329 return (
24- < Box className = { cx . amountInputSizer } data-value = { value } >
30+ < Box className = { cn ( cx . amountInputSizer , className ) } data-value = { value } >
2531 < input
26- className = { cx . amountInput [ alignment ] }
32+ className = { cn ( cx . amountInput [ alignment ] , inputClassName ) }
2733 value = { value }
2834 size = { 1 }
2935 onChange = { ( { target } ) : void => onChange ?.( target . value ) }
Original file line number Diff line number Diff line change @@ -38,6 +38,17 @@ const AssetInputMainComponents = (): JSX.Element => (
3838 </ Variants . Row >
3939) ;
4040
41+ const SimpleAssetInputMainComponents = ( ) : JSX . Element => (
42+ < Variants . Row >
43+ < Variants . Cell >
44+ < SimpleAssetInput
45+ state = { validState ( '1' ) }
46+ balanceLabel = "Balance Available"
47+ />
48+ </ Variants . Cell >
49+ </ Variants . Row >
50+ ) ;
51+
4152const AssetInputUIStates = ( ) : JSX . Element => (
4253 < >
4354 < Variants . Row >
@@ -94,9 +105,12 @@ export const Overview = (): JSX.Element => (
94105 < Divider my = "$64" />
95106
96107 < Section title = "Main components" >
97- < ColorSchemaTable headers = { [ 'Rest ' ] } >
108+ < ColorSchemaTable headers = { [ 'Asset Input ' ] } >
98109 < AssetInputMainComponents />
99110 </ ColorSchemaTable >
111+ < ColorSchemaTable headers = { [ 'Simple Asset Input' ] } >
112+ < SimpleAssetInputMainComponents />
113+ </ ColorSchemaTable >
100114 </ Section >
101115
102116 < Divider my = "$64" />
Original file line number Diff line number Diff line change @@ -31,6 +31,8 @@ export const SimpleAssetInput = ({
3131 onAmountChange ?.( state . asset , value ) ;
3232 } }
3333 testId = { testId }
34+ className = { cx . amountInputContainer }
35+ inputClassName = { cx . amountInput }
3436 />
3537 </ Box >
3638 < Box className = { cx . balance } >
Original file line number Diff line number Diff line change @@ -20,6 +20,10 @@ export const root = style([
2020
2121export const amountBox = style ( { gridArea : 'amount' } ) ;
2222
23+ export const amountInputContainer = style ( { display : 'flex' } ) ;
24+
25+ export const amountInput = style ( { width : '100%' } ) ;
26+
2327export const balance = style ( { gridArea : 'balance' } ) ;
2428
2529export const error = style ( { gridArea : 'error' } ) ;
You can’t perform that action at this time.
0 commit comments