feat(ui-kit): added accessory to CalloutBlock (#33528)
parent
81998f3450
commit
687f1efd5f
@ -0,0 +1,5 @@ |
||||
--- |
||||
|
||||
--- |
||||
|
||||
Adds `accessory` properties to `CalloutBlock` |
||||
@ -0,0 +1,41 @@ |
||||
import type * as UiKit from '@rocket.chat/ui-kit'; |
||||
|
||||
export const callout: readonly UiKit.LayoutBlock[] = [ |
||||
{ |
||||
type: 'callout', |
||||
title: { |
||||
type: 'plain_text', |
||||
text: 'Callout', |
||||
}, |
||||
text: { |
||||
type: 'plain_text', |
||||
text: 'This is a callout', |
||||
}, |
||||
variant: 'info', |
||||
}, |
||||
] as const; |
||||
|
||||
export const calloutWithAction: readonly UiKit.LayoutBlock[] = [ |
||||
{ |
||||
type: 'callout', |
||||
title: { |
||||
type: 'plain_text', |
||||
text: 'Callout', |
||||
}, |
||||
text: { |
||||
type: 'plain_text', |
||||
text: 'This is a callout', |
||||
}, |
||||
variant: 'info', |
||||
accessory: { |
||||
appId: 'dummy-app-id', |
||||
blockId: 'dummy-block-id', |
||||
actionId: 'dummy-action-id', |
||||
type: 'button', |
||||
text: { |
||||
type: 'plain_text', |
||||
text: 'Action', |
||||
}, |
||||
}, |
||||
}, |
||||
]; |
||||
@ -1,9 +1,12 @@ |
||||
import type { LayoutBlockish } from '../LayoutBlockish'; |
||||
import type { TextObject } from '../TextObject'; |
||||
import type { ButtonElement } from '../elements/ButtonElement'; |
||||
import type { OverflowElement } from '../elements/OverflowElement'; |
||||
|
||||
export type CalloutBlock = LayoutBlockish<{ |
||||
type: 'callout'; |
||||
title?: TextObject; |
||||
text: TextObject; |
||||
variant?: 'info' | 'danger' | 'warning' | 'success'; |
||||
accessory?: ButtonElement | OverflowElement; |
||||
}>; |
||||
|
||||
Loading…
Reference in new issue