0.55.0 - Add Countdown timer component#58
Merged
Conversation
…ariants and a Storybook story. Live countdown timer that ticks down to a target date/time (trial expiry, maintenance windows, limited-time offers, session timeouts). Supports three layouts, four themed colour intents, three sizes, optional days/seconds/labels, an onComplete callback, and custom completedContent. Themed via @schemavaults/theme. https://claude.ai/code/session_01FC7R7ebM1k2MPzBLGhUzgB
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…allback. Replaces the onComplete ref-mirroring effect with a useEffectEvent Effect Event, which always sees the latest callback without making the interval Effect reactive to it. https://claude.ai/code/session_01FC7R7ebM1k2MPzBLGhUzgB
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 new
Countdowncomponent—a live countdown timer that ticks down to a target date/time. Useful for trial expiry, scheduled maintenance windows, limited-time offers, and session timeouts.Key Changes
New Countdown component (
src/components/ui/countdown/countdown.tsx)Date, ISO string, or epoch-ms numberboxed(default),plain, andcompactdefault,brand,warning,destructivesm,default,lgonCompletecallback exactly once when target is reachedcompletedContentto render when countdown finishesrole="timer")suppressHydrationWarningon dynamic time values for SSR compatibilityComprehensive Storybook stories (
src/components/ui/countdown/Countdown.stories.tsx)Public exports (
src/components/ui/countdown/index.ts)Library integration (
src/components/ui/index.ts)Version bump (
package.json)0.54.3to0.55.0Implementation Details
setIntervalfor 1-second tick updates with proper cleanupHH:MM:SSorHH:MMformathttps://claude.ai/code/session_01FC7R7ebM1k2MPzBLGhUzgB