Skip to content

Releases: helpscout/fancy

v2.7.0

11 Sep 14:47
Compare
Choose a tag to compare
  • Merge pull request #48 from helpscout/fix-emotion-conflict aa8c6a3
  • Added 'key' attribute to Emotion instance created by FrameManager bb96836

v2.6.0...v2.7.0

v2.6.0

16 May 15:04
Compare
Choose a tag to compare

Styled: Add ability to support certain static props

This update allows for the ability to add certain static properties to
styled. This enables the storage of "extra" properties, allowing for
an easier way to share utilities/values when creating styled components.


  • Styled: Add ability to support certain static props (#47) a234737

v2.5.0...v2.6.0

v2.5.0

13 May 16:14
Compare
Choose a tag to compare

createStyled: Export and add extraArguments feature

This update exports the createStyled factory function, which is used
to create the primary styled() styled component function.

createStyled was enhanced with a special argument called extraArguments.
This allows for a creation of styled() with unique + convenient built-in
props. By default, only theme is provided to the styled component.

Example

import { createStyled } from '@helpscout/fancy'

const extraArguments = {
  $branding: {
    main: '#00ff55'
  }
}
const styled = createStyled({ extraArguments })

From this point on, any component created with styled will have access to $branding.

const Block = styled('div')`
  $({ $branding }) => `
    color: ${$branding.main};
  `
`

Anything can be passed as extraArguments. Other handing things can include functions like rgba or font utils.

Inspiration:

https://github.com/reduxjs/redux-thunk#injecting-a-custom-argument

And

https://baseweb.design/getting-started/installation/#styletron


  • createStyled: Export and add extraArguments feature (#46) b2e290a

v2.4.1...v2.5.0

v2.4.1

25 Apr 21:06
Compare
Choose a tag to compare

Change data-cy to data-cy-styled. Add displayLabel for namespacing

This update changes the auto-generated data-cy to data-cy-styled to
reduce conflict with the HOC from HSDS: React.

The Styled Component generator is now paying attention to a special
static property (displayLabel), which can customize the autogenerated
className + data-cy-styled results. This borrows the label convention
introduced in Emotion 10.

Example
const MyComponent = () => <div />
MyComponent.displayLabel = 'hello'

const StyledComponent = styled(MyComponent)()

// Autogenerated CSS className will be something like
// .css-1jjidj3-hello

  • Change data-cy to data-cy-styled. Add displayLabel for namespacing (#45) cd30f28

v2.4.0...v2.4.1

Fancy - v2.4.0

08 Apr 16:54
Compare
Choose a tag to compare

Automatically add data-cy and displayName classNames

This update enhances the styled() factory to provide the component with
data-cy and a css-j21lkjf-COMPONENT_NAME className, if applicable.

data-cy will be added if the Component has a displayName or a name.
HTML Tags like span or div will not receive data-cy.

The displayName className will be added to all components. This is purely
for identification/debugging purposes. No actual styles will be associated
with these classNames.

Example:

<div data-cy="Card" class="card css-ko0v5 css-ko0v5-Card edlacb0">Card</div>

  • Automatically add data-cy and displayName classNames (#40) 8c25169
  • Update package-lock.json 003b5bd

v2.3.0...v2.4.0

Fancy - v2.3.0

11 Mar 16:59
Compare
Choose a tag to compare

Fix FrameProvider build for Babel 7 (Zero 3)

The issue came down to getEmotion from createFrameManager
https://github.com/helpscout/fancy/blob/master/src/create-emotion-styled/createFrameManager.js#L36

For some reason, changing the build from babel 6 -> 7 made this particular function not work as expected. Perhaps the update revealed some weaknesses in the logic.

The solution involved additional guards and a secondary argument to getEmotion:

getEmotion(frame, currentEmotion)

currentEmotion acts like a fallback. If any of the guards fail, that would be returned.
The method calling getEmotion also has additional guards!


Screencast:

https://www.useloom.com/share/10189a002d484e1b8ef91956a875f4ac


Resolves #42


  • Fix FrameProvider build for Babel 7 (Zero 3) (#44) e7d5c93

v2.2.6...v2.3.0

Fancy - v2.2.6

05 Mar 22:34
Compare
Choose a tag to compare

Fix emotion compiling

This update resolves how Emotion is compiled by reverting back
@helpscout/zero back to v0.0.9.

The older version of @helpscout/zero uses babel-6, along with different
.babelrc configs. This seems to play nicer with Emotion.

This has been manually tested with beacon-2.

Fancy - v2.2.5

25 Feb 23:03
Compare
Choose a tag to compare

Fix pure option + Update Zero

This update fixes the { pure } option for create-emotion-styled into
the correct scope.

This update also updates @helpscout/zero to the latest version.

Fancy - v2.2.4

17 Jan 16:07
Compare
Choose a tag to compare

Revert "Polyfill WeakMap for IE11 (#37)"

This reverts commit 7def3f7.

No longer needed :)

Fancy - v2.2.3

17 Jan 14:04
Compare
Choose a tag to compare

Polyfill WeakMap for IE11

This update polyfills Weakmap with a lightweight implementation from Google.