Skip to content

composable AddSelect: update Storybook patterns and docs to reflect composable API changes #9719

Description

@szinta

All the changes listed in #9718 require corresponding updates to the AddSelect Storybook stories, MDX documentation, patterns and tests so that patterns shown to consumers stay accurate and runnable.

Scope

Update packages/ibm-products/src/components/AddSelect/next/ :

next/AddSelect.stories.tsx

Change from parent issue Story update required
Issue 1onNavigate removed from root context Remove any story that passes onNavigate to root AddSelect; ensure navigation examples wire it through AddSelect.Column only
Issue 2multi removed from root context Remove any multi prop set on root AddSelect; move it to the relevant AddSelect.Column instances
Issue 3 — search state renamed + JSDoc added Update story arg descriptions for onSearch on both Body and Column to reflect their scoped documentation
Issue 5navIndicatorLabel new prop on AddSelectRow Add navIndicatorLabel as an argType in the AddSelectRow story with a descriptive default
Issue 8itemDetails type changed to Array<{ label, value }> Update all story data (e.g. sampleItems, summaryItems) that use itemDetails from Record<string, unknown> to Array<{ label: string; value: string | number }>
Issue 10SelectionSummary selectedItems + renderItem props removed; selectedItemCount added Rewrite the AddSelectSelectionSummary story to use composable AddSelect.SelectionSummaryItem children; replace selectedItems with selectedItemCount prop
Issue 12open prop added to AddSelectItemPanel Add open as a boolean argType in the AddSelectItemPanel story; demonstrate show/hide toggle

next/AddSelect.mdx

  • Update all code examples in the MDX docs to reflect the same API changes listed above.
  • Add a note under AddSelectBody and AddSelectColumn clarifying that global search and column search are independent (from issue 3).
  • Add a note under AddSelectSelectionSummary documenting that the component is children-only (from issue 10).

next/AddSelect.test.js

  • Update the ControlledAddSelect test helper if it passes multi or onNavigate to root AddSelect.
  • Update any test fixtures that use itemDetails as a Record to the new Array<{ label, value }> shape.
  • Update SelectionSummary tests that rely on selectedItems or renderItem props.

Acceptance criteria

  • All stories in AddSelect.stories.tsx run without errors after parent issue changes are applied
  • AddSelect.mdx code examples reflect the updated API (no references to removed props)
  • AddSelect.test.js test fixtures updated; all tests pass
  • No story or doc still references selectedItems or renderItem on SelectionSummary
  • No story or doc still passes multi or onNavigate to the root AddSelect
  • New navIndicatorLabel and open props are demonstrated in their respective stories
  • itemDetails sample data uses Array<{ label, value }> shape throughout

Metadata

Metadata

Assignees

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
In review 👀

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions