storybook-addon-pseudo-states 2.0.0-next.1 → 2.0.0-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/manager.js CHANGED
@@ -50,7 +50,11 @@ var LinkIcon = (0, import_theming.styled)(import_components.Icons)(({ active })
50
50
  var options = Object.keys(PSEUDO_STATES).sort();
51
51
  var PseudoStateTool = () => {
52
52
  const [{ pseudo }, updateGlobals] = (0, import_manager_api.useGlobals)();
53
- const isActive = (0, import_react.useCallback)((option) => pseudo?.[option] === true, [pseudo]);
53
+ const isActive = (0, import_react.useCallback)((option) => {
54
+ if (!pseudo)
55
+ return false;
56
+ return pseudo[option] === true;
57
+ }, [pseudo]);
54
58
  const toggleOption = (0, import_react.useCallback)(
55
59
  (option) => () => updateGlobals({ pseudo: { ...pseudo, [option]: !isActive(option) } }),
56
60
  [pseudo]
package/dist/manager.mjs CHANGED
@@ -22,7 +22,11 @@ var LinkIcon = styled(Icons)(({ active }) => ({
22
22
  var options = Object.keys(PSEUDO_STATES).sort();
23
23
  var PseudoStateTool = () => {
24
24
  const [{ pseudo }, updateGlobals] = useGlobals();
25
- const isActive = useCallback((option) => pseudo?.[option] === true, [pseudo]);
25
+ const isActive = useCallback((option) => {
26
+ if (!pseudo)
27
+ return false;
28
+ return pseudo[option] === true;
29
+ }, [pseudo]);
26
30
  const toggleOption = useCallback(
27
31
  (option) => () => updateGlobals({ pseudo: { ...pseudo, [option]: !isActive(option) } }),
28
32
  [pseudo]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "storybook-addon-pseudo-states",
3
- "version": "2.0.0-next.1",
3
+ "version": "2.0.0-next.2",
4
4
  "description": "CSS pseudo states for Storybook",
5
5
  "keywords": [
6
6
  "storybook-addons",