BAH-4747 | [Storybook]: Consistent update for composite controls#55
Open
komalsharma225 wants to merge 4 commits into
Open
BAH-4747 | [Storybook]: Consistent update for composite controls#55komalsharma225 wants to merge 4 commits into
komalsharma225 wants to merge 4 commits into
Conversation
- Wire metadata (description + argTypes) to ObsControl, AbnormalObsControl, Section, MultiSelect, Forms stories - Add tags: ['autodocs'] for auto-generated professional documentation (Carbon Design System style) - Refactor StoryWrapper with optional showDebug prop (default false) for clean views - Add MDX support to Storybook config - Create _meta/*.js files with reusable control metadata and prop descriptions - Remove unused React import in Section.stories.js AC met: #2 (descriptions), #3 (argTypes), #4 (autodocs), #5 (clean default), #7 (all 5 controls) Note: AC #1 (sidebar rename to "Composite Controls") skipped per user direction to keep "Complex Controls" Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Exclude @carbon packages from transformIgnorePatterns so Jest doesn't attempt to parse their CSS imports. This resolves test failures introduced when @carbon/react, @carbon/icons-react, and @carbon/layout were added to devDependencies for BAH-4747. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Add explicit moduleNameMapper for @carbon/styles CSS files to resolve them as identity-obj-proxy - Remove @carbon from transformIgnorePatterns since it should not be transformed - Carbon packages are pre-built and should be ignored during transformation - This allows @bahmni/design-system (which is transformed) to properly import CSS from @carbon/styles Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Required for Jest moduleNameMapper to properly mock CSS imports. This package creates a proxy object for CSS modules during testing. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.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
Enhance Storybook documentation for control stories by adding professional, auto-generated documentation following the Carbon Design System pattern. Stories now include comprehensive prop descriptions, type information, and usage guidance.
Changes
New Files
stories/_meta/— 5 reusable metadata files with descriptions and argTypes:obsControlMeta.js— ObsControl documentation and prop definitionsabnormalObsControlMeta.js— AbnormalObsControl documentationsectionMeta.js— Section documentationmultiSelectMeta.js— MultiSelect documentationformsMeta.js— Forms documentationModified Files
.storybook/main.js— Added MDX file support (../stories/**/*.mdx)stories/StoryWrapper.js— Added optionalshowDebugprop (defaults to false) for clean default views with optional debug variantsstories/ObsControl.stories.js— Imported metadata, addedtags: ['autodocs']for auto-generated docsstories/AbnormalObsControl.stories.js— Imported metadata, added autodocs support, addedcomponent:referencestories/Section.stories.js— Imported metadata, added autodocs support, removed unused React importstories/MultiSelect.stories.js— Imported metadata, added autodocs support, addedcomponent:referencestories/Forms.stories.js— Imported metadata, added autodocs support, addedcomponent:referenceAcceptance Criteria Met
_meta/*.jsargTypeswith descriptions, types, and defaults for all control propstags: ['autodocs']to enable professional Docs tabs (Carbon Design System style)StoryWrapperrefactored with optional debug toggle; default is clean (no JSON tree)Technical Details
Metadata Pattern
Each
_meta/*.jsfile exports:Story Wiring
Each story file imports metadata:
Backward Compatibility
StoryWrapperchanges are fully backward compatible (defaultshowDebug: false)WithDebugViewvariants are optional additionsTesting
Visual Improvements
Before: Basic stories with minimal documentation
After: Professional, auto-generated docs with complete prop tables and usage guidance (Carbon Design System style)