feat(block-kit): add card block example#116
Draft
zimeg wants to merge 1 commit into
Draft
Conversation
Add a Block Kit card block example to the block-kit examples package, mirroring the official docs example. Includes a full card (icon, title, subtitle, hero image, body, action button) and a minimal title+actions variant, a matching deep-equal test, and a README entry. Docs: https://docs.slack.dev/reference/block-kit/blocks/card-block Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a Block Kit card block example to the
block-kitexamples package, mirroring the official docs example.example01()— a full card withicon,title,subtitle,hero_image,body, and anactionsbutton (matches the docs JSON verbatim).example02()— a minimal card with onlytitle+actions, illustrating that at least one ofhero_image,title,actions, orbodyis required.Each example is typed against
@slack/typesCardBlockvia JSDoc, with a matchingnode:testdeep-equal test and a new alphabetized README entry.Docs: https://docs.slack.dev/reference/block-kit/blocks/card-block
Validation
Run in
block-kit/(deps installed vianpm install --no-save @slack/types typescript @types/nodesince the pinned@biomejs/biomedevDep was unavailable in this environment):node --test→ 34 tests pass, 0 fail (includes the 2 new card tests).npx tsc --checkJs --noEmit --types node src/blocks/card.js tests/blocks/card.test.js→ exit 0 (no type errors).Note:
@slack/types@2.20.1(the resolved version) does not yet expose theslack_icon/subtext/block_idcard fields beyond the baseBlock, so the examples use the currently-typed fields.This is a draft — one block per PR. Not marking ready for review.
Co-Authored-By: Claude svc-devxp-claude@slack-corp.com