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.
DRAFT ONLY
Description
This PR adds support for the
responsiveArray
property. This property is supported by Sprinkles, and allows conditional properties to be provided to the atoms function as an array instead of only as an object.This is achieved by optionally accepting the
responsiveArray
indefineProperties
. The responsive array is then added as a top level property in the object returned bydefineProperties
. This is consumed in the runtime function via a new utility (createNormalizeValueFn
) which looks up the config for a given property to find the relevant responsive array and crafts the responsive object.This particular approach is probably not the way I would have done it if I was building the library from scratch, but I wanted to avoid major refactors/be as non-invasive as possible. That is to say; I'm not wedded to the actual implementation.
For example, there are no properties outside of the
config
that are returned fromdefineProperties
at the moment. I added theresponsiveArray
outside because it felt cheaper than shoe-horning it into each property instead, but that could be another approach.Type of Change
Checklist