Repository navigation
feat: React 19 transitions with onChangeAction/onClickAction - #146
Conversation
06d3515 to
101e12e
Compare
…itch/Selector/DateInput/TimeInput
Update RefObject type parameters to include null across Selector hooks, useGridFocus, and useListFocus to match React 19's stricter typing where useRef<T>(null) returns RefObject<T | null>. Co-authored-by: Navi <[email protected]>
101e12e to
1bb06b4
Compare
The root package.json was upgraded to React 19 but the workspace apps (storybook, sandbox, example-vite, example-nextjs) still pinned React 18. This caused Yarn to create duplicate React installations and broke hoisting of @storybook/react-vite, failing the Storybook build in CI.
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR Modified ComponentsButton · View in Storybook
CheckboxInput · View in Storybook
DateInput · View in Storybook
Layer
Selector · View in Storybook
Switch · View in Storybook
TextArea · View in Storybook
TextInput · View in Storybook
TimeInput · View in Storybook
Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Component PreviewsIncludes interactive hover previews as animated GIFs. XDSButtonXDSCheckboxInputDefaultScreenshot: Interaction Preview: (view video) View in Storybook · XDSDateInputDefaultScreenshot: Interaction Preview: (view video) View in Storybook · XDSSelectorXDSSwitchXDSTextAreaDescription With OptionalScreenshot: View in Storybook · XDSTextInputDefaultScreenshot: Interaction Preview: (view video) View in Storybook · Description With OptionalScreenshot: View in Storybook · With Start Icon And Small SizeScreenshot: View in Storybook · XDSTimeInputDefaultScreenshot: Interaction Preview: (view video) View in Storybook · Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
Add interactive stories demonstrating the async action pattern for all affected components: - Button: AsyncAction, AsyncActionVariants - TextInput: AsyncSave, AsyncValidation, ManualLoading - TextArea: AsyncAutoSave - CheckboxInput: AsyncToggle, AsyncWithValidation - Switch: AsyncToggle, AsyncSettingsPanel - Selector: AsyncSelection - DateInput: AsyncDateChange - TimeInput: AsyncTimeChange Each story uses a simulated delay to show the loading state and optimistic update behavior in action. Part of #146
|
Added storybook examples for all the new action props on branch Stories added (14 total):
All use simulated delays so you can see the loading spinners and optimistic updates in action. 959 tests passing, storybook builds clean. |
Replaces #93 with a clean implementation on top of current main.
Changes
All input components:
onChangeAction+isLoadingonChangeAction(value, event)withevent.preventDefault()gatingonChangeAction(checked, event)with spinner in checkbox/thumbonChangeAction(value)— no event, both fireButton:
onClickActiononClickAction(event)wrapped inuseTransitionCloseButton
onClickActionthrough to XDSButtonPattern
onChangealways fires first (sync).onChangeActionfires after if notevent.defaultPrevented(). Both can be used together:Implementation
useOptimisticfor immediate UI feedbackuseTransition+startTransitionfor async wrappingXDSSpinnerfor loading indicators (no inline CSS spinners)aria-busyfor accessibility749 tests passing
Supersedes #93