ark icon indicating copy to clipboard operation
ark copied to clipboard

feat(react): implement timer

Open jeferson-sb opened this issue 1 year ago • 3 comments

Implement Zag's Timer in React as part of #2497

There's one issue still to be solved related to the action trigger, it seems that click handler from timer.getActionTriggerProps() does not modify the machine 🤔 and I couldn't figure out yet.

Demo

https://github.com/chakra-ui/ark/assets/30840709/abe8d26c-751d-4319-a917-9d3d9d476cfb

jeferson-sb avatar Jun 21 '24 21:06 jeferson-sb

@jeferson-sb is attempting to deploy a commit to the Chakra UI Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Jun 21 '24 21:06 vercel[bot]

It seems the issue from the getActionTriggerProps props might come from the actions on Zag.js

https://github.com/chakra-ui/zag/blob/70e6f64acc997490ef5c035f0995c6e8c9fd59d9/packages/machines/timer/src/timer.connect.ts#L75-L85

I wonder if it's expecting PAUSE, START, RESUME all uppercase instead of lowercase.

jeferson-sb avatar Jul 09 '24 23:07 jeferson-sb

@jeferson-sb

I've updated your PR. You were right. A fix in zag-js will be included in the next release.

cschroeter avatar Jul 25 '24 07:07 cschroeter