@@ -14,10 +14,12 @@ import { ButtonGroup } from '../../src/ButtonGroup';
14
14
import { ComboBox , ComboBoxClearButton } from '../../src/ComboBox' ;
15
15
import { Dialog , DialogTrigger } from '../../src/Dialog' ;
16
16
import { Group } from '../../src/Group' ;
17
+ import { Heading } from '../../src/Heading' ;
17
18
import { IconButton } from '../../src/IconButton' ;
18
19
import { Input } from '../../src/Input' ;
19
20
import { Label } from '../../src/Label' ;
20
21
import { ListBox , ListBoxItem } from '../../src/ListBox' ;
22
+ import { Modal , ModalOverlay } from '../../src/Modal' ;
21
23
import { Perceivable } from '../../src/Perceivable' ;
22
24
import { Popover } from '../../src/Popover' ;
23
25
import { RadioButton } from '../../src/RadioButton' ;
@@ -26,6 +28,7 @@ import { RadioIconButton } from '../../src/RadioIconButton';
26
28
import { Select , SelectValue } from '../../src/Select' ;
27
29
import { Text } from '../../src/Text' ;
28
30
import { ToastRegion , toastQueue } from '../../src/Toast' ;
31
+ import { ToggleButton } from '../../src/ToggleButton' ;
29
32
import { Tooltip , TooltipTrigger } from '../../src/Tooltip' ;
30
33
31
34
const Container = ( props : ComponentPropsWithoutRef < typeof Fragment > ) => < > { props . children } </ > ;
@@ -217,6 +220,7 @@ export const ListBoxTooltip: Story = {
217
220
218
221
export const DisabledWithTooltip : Story = {
219
222
render : ( ) => {
223
+ const [ isDisabled , setIsDisabled ] = useState ( true ) ;
220
224
return (
221
225
< div
222
226
style = { {
@@ -225,22 +229,58 @@ export const DisabledWithTooltip: Story = {
225
229
gap : vars . spacing [ 400 ] ,
226
230
} }
227
231
>
228
- < Perceivable >
229
- < TooltipTrigger >
230
- < Button onPress = { ( ) => console . log ( 'Pressed' ) } > Button</ Button >
231
- < Tooltip placement = "right" > Message</ Tooltip >
232
- </ TooltipTrigger >
233
- < TooltipTrigger >
234
- < IconButton
235
- icon = "add"
236
- size = "small"
237
- variant = "minimal"
238
- aria-label = "create"
239
- onPress = { ( ) => console . log ( 'Pressed' ) }
240
- />
241
- < Tooltip placement = "right" > Message</ Tooltip >
242
- </ TooltipTrigger >
243
- </ Perceivable >
232
+ < ToggleButton isSelected = { isDisabled } onChange = { setIsDisabled } >
233
+ Restrict
234
+ </ ToggleButton >
235
+ < DialogTrigger >
236
+ < Perceivable isDisabled = { isDisabled } >
237
+ < TooltipTrigger >
238
+ < Button onPress = { ( ) => console . log ( 'Pressed' ) } > Button</ Button >
239
+ < Tooltip placement = "right" > Message</ Tooltip >
240
+ </ TooltipTrigger >
241
+ < Popover > Message</ Popover >
242
+ </ Perceivable >
243
+ </ DialogTrigger >
244
+ < DialogTrigger >
245
+ < Perceivable isDisabled = { isDisabled } >
246
+ < TooltipTrigger >
247
+ < IconButton
248
+ icon = "add"
249
+ size = "small"
250
+ variant = "minimal"
251
+ aria-label = "create"
252
+ onPress = { ( ) => console . log ( 'Pressed' ) }
253
+ />
254
+ < Tooltip placement = "right" > Message</ Tooltip >
255
+ </ TooltipTrigger >
256
+ < ModalOverlay >
257
+ < Modal >
258
+ < Dialog >
259
+ { ( { close } ) => (
260
+ < >
261
+ < div slot = "header" >
262
+ < Heading slot = "title" > Title</ Heading >
263
+ < IconButton
264
+ aria-label = "close"
265
+ icon = "cancel"
266
+ size = "small"
267
+ variant = "minimal"
268
+ onPress = { close }
269
+ />
270
+ < Text slot = "subtitle" > Subtitle</ Text >
271
+ </ div >
272
+ < div slot = "body" > Body text</ div >
273
+ < div slot = "footer" >
274
+ < Button slot = "close" > Cancel</ Button >
275
+ < Button variant = "primary" > Confirm</ Button >
276
+ </ div >
277
+ </ >
278
+ ) }
279
+ </ Dialog >
280
+ </ Modal >
281
+ </ ModalOverlay >
282
+ </ Perceivable >
283
+ </ DialogTrigger >
244
284
</ div >
245
285
) ;
246
286
} ,
0 commit comments