File tree Expand file tree Collapse file tree 2 files changed +35
-33
lines changed
pattern-library/components/patterns/prototype Expand file tree Collapse file tree 2 files changed +35
-33
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ import { useSyncedRef } from '../../hooks/use-synced-ref';
17
17
import type { PresentationalProps } from '../../types' ;
18
18
import { MenuCollapseIcon , MenuExpandIcon } from '../icons' ;
19
19
import Button from './Button' ;
20
+ import { inputGroupStyles } from './InputGroup' ;
20
21
import SelectContext from './SelectContext' ;
21
22
22
23
export type SelectOptionStatus = {
@@ -185,12 +186,15 @@ function SelectMain<T>({
185
186
} , [ buttonRef , listboxOpen ] ) ;
186
187
187
188
return (
188
- < div className = "relative" ref = { wrapperRef } >
189
+ < div
190
+ className = { classnames ( 'relative w-full border rounded' , inputGroupStyles ) }
191
+ ref = { wrapperRef }
192
+ >
189
193
< Button
190
194
id = { buttonId ?? defaultButtonId }
191
195
variant = "custom"
192
196
classes = { classnames (
193
- 'w-full flex border rounded ' ,
197
+ 'w-full flex' ,
194
198
'bg-grey-0 disabled:bg-grey-1 disabled:text-grey-6' ,
195
199
classes ,
196
200
) }
Original file line number Diff line number Diff line change @@ -92,40 +92,38 @@ function InputGroupSelectExample() {
92
92
onClick = { previous }
93
93
disabled = { selectedIndex <= 0 }
94
94
/>
95
- < div className = "w-full" >
96
- < SelectNext
97
- value = { selected }
98
- onChange = { setSelected }
99
- buttonContent = {
100
- selected ? (
95
+ < SelectNext
96
+ value = { selected }
97
+ onChange = { setSelected }
98
+ buttonContent = {
99
+ selected ? (
100
+ < >
101
+ { selected . name }
102
+ < div className = "rounded px-2 bg-grey-7 text-white" >
103
+ { selected . id }
104
+ </ div >
105
+ </ >
106
+ ) : (
107
+ < > Select one...</ >
108
+ )
109
+ }
110
+ >
111
+ { defaultItems . map ( item => (
112
+ < SelectNext . Option value = { item } key = { item . id } >
113
+ { ( ) => (
101
114
< >
102
- { selected . name }
103
- < div className = "rounded px-2 bg-grey-7 text-white" >
104
- { selected . id }
115
+ { item . name }
116
+ < div className = "grow" />
117
+ < div
118
+ className = { classnames ( 'rounded px-2 text-white bg-grey-7' ) }
119
+ >
120
+ { item . id }
105
121
</ div >
106
122
</ >
107
- ) : (
108
- < > Select one...</ >
109
- )
110
- }
111
- >
112
- { defaultItems . map ( item => (
113
- < SelectNext . Option value = { item } key = { item . id } >
114
- { ( ) => (
115
- < >
116
- { item . name }
117
- < div className = "grow" />
118
- < div
119
- className = { classnames ( 'rounded px-2 text-white bg-grey-7' ) }
120
- >
121
- { item . id }
122
- </ div >
123
- </ >
124
- ) }
125
- </ SelectNext . Option >
126
- ) ) }
127
- </ SelectNext >
128
- </ div >
123
+ ) }
124
+ </ SelectNext . Option >
125
+ ) ) }
126
+ </ SelectNext >
129
127
< IconButton
130
128
icon = { ArrowRightIcon }
131
129
title = "Next student"
You can’t perform that action at this time.
0 commit comments