Skip to content

Commit

Permalink
Changing sidebar icon prefix to status-
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Hayward committed Feb 15, 2024
1 parent 7f888ed commit d450598
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const meta: Meta< typeof CustomSelect > = {
children: { control: { type: null } },
value: { control: { type: null } },
},
tags: [ 'sb-wip' ],
tags: [ 'status-wip' ],
parameters: {
badges: [ 'wip' ],
actions: { argTypesRegex: '^on.*' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const meta: Meta< typeof DropdownMenu > = {
children: { control: { type: null } },
trigger: { control: { type: null } },
},
tags: [ 'sb-private' ],
tags: [ 'status-private' ],
parameters: {
actions: { argTypesRegex: '^on.*' },
badges: [ 'private' ],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const meta: Meta< typeof ProgressBar > = {
argTypes: {
value: { control: { type: 'number', min: 0, max: 100, step: 1 } },
},
tags: [ 'sb-private' ],
tags: [ 'status-private' ],
parameters: {
badges: [ 'private' ],
controls: {
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/tabs/stories/index.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const meta: Meta< typeof Tabs > = {
// @ts-expect-error - See https://github.com/storybookjs/storybook/issues/23170
'Tabs.TabPanel': Tabs.TabPanel,
},
tags: [ 'sb-private' ],
tags: [ 'status-private' ],
parameters: {
actions: { argTypesRegex: '^on.*' },
badges: [ 'private' ],
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/theme/stories/index.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const meta: Meta< typeof Theme > = {
accent: { control: { type: 'color' } },
background: { control: { type: 'color' } },
},
tags: [ 'sb-private' ],
tags: [ 'status-private' ],
parameters: {
badges: [ 'private' ],
controls: { expanded: true },
Expand Down
7 changes: 3 additions & 4 deletions storybook/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import { styled } from '@storybook/theming';
*/
import badges from './badges';

const STEM = 'sb-';

const Wrapper = styled.span( {
flexGrow: 1,
display: 'flex',
Expand All @@ -29,6 +27,7 @@ const Icon = styled.span( {} );

function useIcons( item ) {
const api = useStorybookApi();
const prefix = 'status-';

return useMemo( () => {
let data = {};
Expand All @@ -40,8 +39,8 @@ function useIcons( item ) {
const { tags = [] } = data;

return tags
.filter( ( tag ) => tag.startsWith( STEM ) )
.map( ( tag ) => badges[ tag.substring( STEM.length ) ] )
.filter( ( tag ) => tag.startsWith( prefix ) )
.map( ( tag ) => badges[ tag.substring( prefix.length ) ] )
.map( ( { icon, title, tooltip } ) =>
icon
? createElement(
Expand Down

0 comments on commit d450598

Please sign in to comment.