diff --git a/.changeset/rich-text-input-min-max-lines.md b/.changeset/rich-text-input-min-max-lines.md new file mode 100644 index 000000000..c2a063cf1 --- /dev/null +++ b/.changeset/rich-text-input-min-max-lines.md @@ -0,0 +1,5 @@ +--- +"@slack/types": minor +--- + +feat(types): add optional `min_lines` and `max_lines` properties to `RichTextInput` element diff --git a/packages/types/src/block-kit/block-elements.ts b/packages/types/src/block-kit/block-elements.ts index 2fd445a34..005f7ed60 100644 --- a/packages/types/src/block-kit/block-elements.ts +++ b/packages/types/src/block-kit/block-elements.ts @@ -1066,4 +1066,13 @@ export interface RichTextInput extends Actionable, Dispatchable, Focusable, Plac * @description Initial contents of the input when it is loaded. */ initial_value?: RichTextBlock; + /** + * @description The minimum number of lines of text shown in the input. Must be between 1 and 50. + */ + min_lines?: number; + /** + * @description The maximum number of lines of text shown in the input before it scrolls. Must be between 1 and 50. + * Defaults to `8` when not specified. + */ + max_lines?: number; } diff --git a/packages/types/test/block-elements.test-d.ts b/packages/types/test/block-elements.test-d.ts new file mode 100644 index 000000000..0c07deb1d --- /dev/null +++ b/packages/types/test/block-elements.test-d.ts @@ -0,0 +1,30 @@ +import { expectAssignable, expectError } from 'tsd'; +import type { RichTextInput } from '../src/index'; + +// RichTextInput — happy paths +expectAssignable({ + type: 'rich_text_input', +}); +expectAssignable({ + type: 'rich_text_input', + min_lines: 3, +}); +expectAssignable({ + type: 'rich_text_input', + max_lines: 16, +}); +expectAssignable({ + type: 'rich_text_input', + min_lines: 3, + max_lines: 16, +}); + +// RichTextInput — sad paths +expectError({ + type: 'rich_text_input', + min_lines: '3', +}); +expectError({ + type: 'rich_text_input', + max_lines: '16', +});