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 1
1
import React from 'react' ;
2
2
3
+ import cn from 'classnames' ;
4
+
3
5
import { Box } from '../box' ;
4
6
5
7
import * as cx from './amount-input.css' ;
@@ -11,6 +13,8 @@ interface Props {
11
13
value ?: string ;
12
14
id : string ;
13
15
testId ?: string ;
16
+ className ?: string ;
17
+ inputClassName ?: string ;
14
18
}
15
19
16
20
export const AmountInput = ( {
@@ -19,11 +23,13 @@ export const AmountInput = ({
19
23
value,
20
24
id,
21
25
testId,
26
+ className,
27
+ inputClassName,
22
28
} : Readonly < Props > ) : JSX . Element => {
23
29
return (
24
- < Box className = { cx . amountInputSizer } data-value = { value } >
30
+ < Box className = { cn ( cx . amountInputSizer , className ) } data-value = { value } >
25
31
< input
26
- className = { cx . amountInput [ alignment ] }
32
+ className = { cn ( cx . amountInput [ alignment ] , inputClassName ) }
27
33
value = { value }
28
34
size = { 1 }
29
35
onChange = { ( { target } ) : void => onChange ?.( target . value ) }
Original file line number Diff line number Diff line change @@ -38,6 +38,17 @@ const AssetInputMainComponents = (): JSX.Element => (
38
38
</ Variants . Row >
39
39
) ;
40
40
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
+
41
52
const AssetInputUIStates = ( ) : JSX . Element => (
42
53
< >
43
54
< Variants . Row >
@@ -94,9 +105,12 @@ export const Overview = (): JSX.Element => (
94
105
< Divider my = "$64" />
95
106
96
107
< Section title = "Main components" >
97
- < ColorSchemaTable headers = { [ 'Rest ' ] } >
108
+ < ColorSchemaTable headers = { [ 'Asset Input ' ] } >
98
109
< AssetInputMainComponents />
99
110
</ ColorSchemaTable >
111
+ < ColorSchemaTable headers = { [ 'Simple Asset Input' ] } >
112
+ < SimpleAssetInputMainComponents />
113
+ </ ColorSchemaTable >
100
114
</ Section >
101
115
102
116
< Divider my = "$64" />
Original file line number Diff line number Diff line change @@ -31,6 +31,8 @@ export const SimpleAssetInput = ({
31
31
onAmountChange ?.( state . asset , value ) ;
32
32
} }
33
33
testId = { testId }
34
+ className = { cx . amountInputContainer }
35
+ inputClassName = { cx . amountInput }
34
36
/>
35
37
</ Box >
36
38
< Box className = { cx . balance } >
Original file line number Diff line number Diff line change @@ -20,6 +20,10 @@ export const root = style([
20
20
21
21
export const amountBox = style ( { gridArea : 'amount' } ) ;
22
22
23
+ export const amountInputContainer = style ( { display : 'flex' } ) ;
24
+
25
+ export const amountInput = style ( { width : '100%' } ) ;
26
+
23
27
export const balance = style ( { gridArea : 'balance' } ) ;
24
28
25
29
export const error = style ( { gridArea : 'error' } ) ;
You can’t perform that action at this time.
0 commit comments