storybook-addon-pseudo-states 9.1.0-alpha.7 → 9.1.0-alpha.8
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 +2 -2
- package/package.json +2 -2
package/dist/manager.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { addons, types, useGlobals } from 'storybook/manager-api';
|
|
2
2
|
import React, { useCallback } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { Form, WithTooltip, TooltipLinkList, IconButton } from 'storybook/internal/components';
|
|
4
4
|
import { styled, color } from 'storybook/internal/theming';
|
|
5
5
|
import { RefreshIcon, ButtonIcon } from '@storybook/icons';
|
|
6
6
|
|
|
7
|
-
var ADDON_ID="storybook/pseudo-states",TOOL_ID=`${ADDON_ID}/tool`,PARAM_KEY="pseudo";var PSEUDO_STATES={hover:"hover",active:"active",focusVisible:"focus-visible",focusWithin:"focus-within",focus:"focus",visited:"visited",link:"link",target:"target"};var LinkTitle=styled.span(({active})=>({color:active?color.secondary:"inherit"})),options=Object.keys(PSEUDO_STATES).sort(),PseudoStateTool=()=>{let[globals,updateGlobals]=useGlobals(),pseudo=globals[PARAM_KEY],isActive=useCallback(option=>pseudo?pseudo[option]===!0:!1,[pseudo]),hasActive=options.some(isActive),reset={id:"reset",title:"Reset pseudo states",icon:React.createElement(RefreshIcon,{style:{opacity:hasActive?1:.7}}),disabled:!hasActive,onClick:()=>updateGlobals({[PARAM_KEY]:{}})},toggleOption=useCallback(option=>()=>{let{[option]:value,...rest}=pseudo;updateGlobals({[PARAM_KEY]:value===!0?rest:{...rest,[option]:!0}});},[pseudo,updateGlobals]),links=options.map(option=>{let active=isActive(option);return {id:option,title:React.createElement(LinkTitle,{active},":",PSEUDO_STATES[option]),input:React.createElement(Checkbox,{checked:active,onChange:toggleOption(option)}),active}});return React.createElement(WithTooltip,{placement:"top",trigger:"click",closeOnOutsideClick:!0,tooltip:React.createElement(TooltipLinkList,{links:[[reset],links]})},React.createElement(IconButton,{key:"pseudo-states",title:"Select CSS pseudo states",active:hasActive},React.createElement(ButtonIcon,null)))};addons.register(ADDON_ID,()=>{addons.add(TOOL_ID,{type:types.TOOL,title:"CSS pseudo states",match:({viewMode})=>viewMode==="story",render:PseudoStateTool});});
|
|
7
|
+
var ADDON_ID="storybook/pseudo-states",TOOL_ID=`${ADDON_ID}/tool`,PARAM_KEY="pseudo";var PSEUDO_STATES={hover:"hover",active:"active",focusVisible:"focus-visible",focusWithin:"focus-within",focus:"focus",visited:"visited",link:"link",target:"target"};var LinkTitle=styled.span(({active})=>({color:active?color.secondary:"inherit"})),options=Object.keys(PSEUDO_STATES).sort(),PseudoStateTool=()=>{let[globals,updateGlobals]=useGlobals(),pseudo=globals[PARAM_KEY],isActive=useCallback(option=>pseudo?pseudo[option]===!0:!1,[pseudo]),hasActive=options.some(isActive),reset={id:"reset",title:"Reset pseudo states",icon:React.createElement(RefreshIcon,{style:{opacity:hasActive?1:.7}}),disabled:!hasActive,onClick:()=>updateGlobals({[PARAM_KEY]:{}})},toggleOption=useCallback(option=>()=>{let{[option]:value,...rest}=pseudo;updateGlobals({[PARAM_KEY]:value===!0?rest:{...rest,[option]:!0}});},[pseudo,updateGlobals]),links=options.map(option=>{let active=isActive(option);return {id:option,title:React.createElement(LinkTitle,{active},":",PSEUDO_STATES[option]),input:React.createElement(Form.Checkbox,{checked:active,onChange:toggleOption(option)}),active}});return React.createElement(WithTooltip,{placement:"top",trigger:"click",closeOnOutsideClick:!0,tooltip:React.createElement(TooltipLinkList,{links:[[reset],links]})},React.createElement(IconButton,{key:"pseudo-states",title:"Select CSS pseudo states",active:hasActive},React.createElement(ButtonIcon,null)))};addons.register(ADDON_ID,()=>{addons.add(TOOL_ID,{type:types.TOOL,title:"CSS pseudo states",match:({viewMode})=>viewMode==="story",render:PseudoStateTool});});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "storybook-addon-pseudo-states",
|
|
3
|
-
"version": "9.1.0-alpha.
|
|
3
|
+
"version": "9.1.0-alpha.8",
|
|
4
4
|
"description": "CSS pseudo states for Storybook",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"typescript": "^5.8.3"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
|
-
"storybook": "^9.1.0-alpha.
|
|
60
|
+
"storybook": "^9.1.0-alpha.8"
|
|
61
61
|
},
|
|
62
62
|
"publishConfig": {
|
|
63
63
|
"access": "public"
|