First pass at making tones more static. I'm not sure if this actually achieves what we'd discussed @chiefcll, however I can't pass the styles through props since the sub-node toneStyles need to be explicitly mapped to the right node.
This PR adds a Higher Order Component(sorta? we're not exactly wrapping the component so it might be a different pattern) to add the styles of a given tone to a component. Instead of using the inline prop like we currently are, createComponentWithTone parses out the tone styles of a given component and passes them to the component with a special prop. the component uses the styles from this prop(if present) to add tones to the given component.
This draft is meant to be a collaborative effort - I'm not sure if this is the right path forward, or if we even gain anything of real substance from this approach
Description
First pass at making tones more static. I'm not sure if this actually achieves what we'd discussed @chiefcll, however I can't pass the styles through props since the sub-node toneStyles need to be explicitly mapped to the right node.
This PR adds a Higher Order Component(sorta? we're not exactly wrapping the component so it might be a different pattern) to add the styles of a given tone to a component. Instead of using the inline prop like we currently are,
createComponentWithTone
parses out the tone styles of a given component and passes them to the component with a special prop. the component uses the styles from this prop(if present) to add tones to the given component.This draft is meant to be a collaborative effort - I'm not sure if this is the right path forward, or if we even gain anything of real substance from this approach