repo stringlengths 7 64 | file_url stringlengths 81 338 | file_path stringlengths 5 257 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:25:31 2026-01-05 01:50:38 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/components/sidebar/FileSearchModal.stories.tsx | code/core/src/manager/components/sidebar/FileSearchModal.stories.tsx | import React from 'react';
import { ModalDecorator } from 'storybook/internal/components';
import type { Meta, StoryObj } from '@storybook/react-vite';
import { expect, fireEvent, fn, within } from 'storybook/test';
import { WithResults } from './FileSearchList.stories';
import { FileSearchModal } from './FileSearc... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/components/sidebar/NoResults.tsx | code/core/src/manager/components/sidebar/NoResults.tsx | import { styled } from 'storybook/theming';
export const NoResults = styled.div(({ theme }) => ({
display: 'flex',
flexDirection: 'column',
textAlign: 'center',
textWrap: 'balance',
gap: 4,
padding: '20px 0',
lineHeight: `18px`,
fontSize: `${theme.typography.size.s2}px`,
color: theme.color.defaultTex... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/components/sidebar/FileList.tsx | code/core/src/manager/components/sidebar/FileList.tsx | import { rgba } from 'polished';
import { styled } from 'storybook/theming';
export const FileListWrapper = styled('div')(({ theme }) => ({
marginTop: '-16px',
// after element which fades out the list
'&::after': {
content: '""',
position: 'fixed',
pointerEvents: 'none',
bottom: 0,
left: 0,
... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/components/sidebar/TreeNode.stories.tsx | code/core/src/manager/components/sidebar/TreeNode.stories.tsx | import React from 'react';
import { HighlightStyles } from './HighlightStyles';
import { IconSymbols } from './IconSymbols';
import { LeafNodeStyleWrapper } from './Tree';
import { ComponentNode, DocumentNode, GroupNode, StoryNode, TestNode } from './TreeNode';
export default {
title: 'Sidebar/TreeNode',
paramete... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/components/sidebar/Sidebar.stories.tsx | code/core/src/manager/components/sidebar/Sidebar.stories.tsx | import React from 'react';
import type { DecoratorFunction, StatusesByStoryIdAndTypeId } from 'storybook/internal/types';
import { global } from '@storybook/global';
import type { Meta, StoryObj } from '@storybook/react-vite';
import type { IndexHash } from 'storybook/manager-api';
import { ManagerContext } from 's... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/components/sidebar/SidebarBottom.tsx | code/core/src/manager/components/sidebar/SidebarBottom.tsx | import React, { Fragment, useEffect, useRef, useState } from 'react';
import {
type API_FilterFunction,
type Addon_Collection,
type Addon_TestProviderType,
Addon_TypesEnum,
} from 'storybook/internal/types';
import {
experimental_useStatusStore,
experimental_useTestProviderStore,
internal_fullStatusStor... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/components/sidebar/Heading.stories.tsx | code/core/src/manager/components/sidebar/Heading.stories.tsx | import React from 'react';
import type { Meta, StoryFn, StoryObj } from '@storybook/react-vite';
import { action } from 'storybook/actions';
import { screen } from 'storybook/test';
import { ThemeProvider, useTheme } from 'storybook/theming';
import type { Theme } from 'storybook/theming';
import { Heading } from '.... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/components/sidebar/TagsFilter.tsx | code/core/src/manager/components/sidebar/TagsFilter.tsx | import React, { useCallback, useEffect, useMemo, useState } from 'react';
import { Badge, Button, PopoverProvider } from 'storybook/internal/components';
import type {
API_PreparedIndexEntry,
StoryIndex,
Tag,
TagsOptions,
} from 'storybook/internal/types';
import { BeakerIcon, DocumentIcon, FilterIcon, PlayHo... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/components/sidebar/Search.stories.tsx | code/core/src/manager/components/sidebar/Search.stories.tsx | import React from 'react';
import type { Meta, StoryFn } from '@storybook/react-vite';
import { action } from 'storybook/actions';
import type { API } from 'storybook/manager-api';
import { ManagerContext } from 'storybook/manager-api';
import { IconSymbols } from './IconSymbols';
import { Search } from './Search';
... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/components/sidebar/HighlightStyles.tsx | code/core/src/manager/components/sidebar/HighlightStyles.tsx | import type { FC } from 'react';
import React from 'react';
import { transparentize } from 'polished';
import { Global } from 'storybook/theming';
import type { Highlight } from './types';
// @ts-expect-error (non strict)
export const HighlightStyles: FC<Highlight> = ({ refId, itemId }) => (
<Global
styles={({... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/components/sidebar/ChecklistWidget.stories.tsx | code/core/src/manager/components/sidebar/ChecklistWidget.stories.tsx | import type { PlayFunction } from 'storybook/internal/csf';
import { ManagerContext } from 'storybook/manager-api';
import { fn } from 'storybook/test';
import preview from '../../../../../.storybook/preview';
import { initialState } from '../../../shared/checklist-store/checklistData.state';
import { internal_univer... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/components/sidebar/CreateNewStoryFileModal.tsx | code/core/src/manager/components/sidebar/CreateNewStoryFileModal.tsx | import React, { useCallback, useDeferredValue, useEffect, useRef, useState } from 'react';
import {
ARGTYPES_INFO_REQUEST,
ARGTYPES_INFO_RESPONSE,
CREATE_NEW_STORYFILE_REQUEST,
CREATE_NEW_STORYFILE_RESPONSE,
FILE_COMPONENT_SEARCH_REQUEST,
FILE_COMPONENT_SEARCH_RESPONSE,
SAVE_STORY_REQUEST,
SAVE_STORY_R... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/components/sidebar/TreeNode.tsx | code/core/src/manager/components/sidebar/TreeNode.tsx | import type { ComponentProps, FC } from 'react';
import React from 'react';
import { type FunctionInterpolation, styled } from 'storybook/theming';
import { UseSymbol } from './IconSymbols';
import { CollapseIcon } from './components/CollapseIcon';
export const TypeIcon = styled.svg<{ type: 'component' | 'story' | '... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/components/sidebar/Brand.tsx | code/core/src/manager/components/sidebar/Brand.tsx | import React from 'react';
import { StorybookLogo } from 'storybook/internal/components';
import { styled, withTheme } from 'storybook/theming';
export const StorybookLogoStyled = styled(StorybookLogo)(({ theme }) => ({
width: 'auto',
height: '22px !important',
display: 'block',
color: theme.base === 'light'... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/components/sidebar/mockdata.large.ts | code/core/src/manager/components/sidebar/mockdata.large.ts | /**
* This data originates from the storiesHash state in Storybook. Grab it from the Manager node using
* React DevTools by assigning it to a global variable, then use the following script to remove the
* parameters, otherwise you'll end up with a huge file:
*
* JSON.stringify( Object.values($reactTemp1) .reduce((... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | true |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/components/sidebar/Explorer.stories.tsx | code/core/src/manager/components/sidebar/Explorer.stories.tsx | import React from 'react';
import { Explorer } from './Explorer';
import { IconSymbols } from './IconSymbols';
import * as RefStories from './Refs.stories';
import { mockDataset } from './mockdata';
import type { RefType } from './types';
export default {
component: Explorer,
title: 'Sidebar/Explorer',
globals:... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/components/sidebar/FileSearchListSkeleton.tsx | code/core/src/manager/components/sidebar/FileSearchListSkeleton.tsx | import React from 'react';
import { styled } from 'storybook/theming';
import { FileList, FileListItem } from './FileList';
const FileListItemContentWrapperSkeleton = styled('div')(({ theme }) => ({
display: 'flex',
alignItems: 'flex-start',
gap: '8px',
alignSelf: 'stretch',
padding: '8px 16px',
}));
cons... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/components/sidebar/Tree.stories.tsx | code/core/src/manager/components/sidebar/Tree.stories.tsx | import React, { useState } from 'react';
import {
type Addon_Collection,
type Addon_TestProviderType,
Addon_TypesEnum,
} from 'storybook/internal/types';
import type { Meta, StoryObj } from '@storybook/react-vite';
import { action } from 'storybook/actions';
import { type ComponentEntry, type IndexHash, Manage... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/components/sidebar/TagsFilterPanel.stories.tsx | code/core/src/manager/components/sidebar/TagsFilterPanel.stories.tsx | import { BeakerIcon, DocumentIcon, PlayHollowIcon } from '@storybook/icons';
import type { Meta, StoryObj } from '@storybook/react-vite';
import { fn } from 'storybook/test';
import { color } from 'storybook/theming';
import { TagsFilterPanel } from './TagsFilterPanel';
const builtInFilters = {
_docs: {
id: '... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/components/sidebar/ChecklistWidget.tsx | code/core/src/manager/components/sidebar/ChecklistWidget.tsx | import React, { useEffect, useRef, useState } from 'react';
import {
ActionList,
Card,
Collapsible,
PopoverProvider,
ProgressSpinner,
} from 'storybook/internal/components';
import {
ChevronSmallUpIcon,
EyeCloseIcon,
ListUnorderedIcon,
StatusFailIcon,
StatusPassIcon,
} from '@storybook/icons';
im... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/components/sidebar/TagsFilter.stories.tsx | code/core/src/manager/components/sidebar/TagsFilter.stories.tsx | import type { Meta, StoryObj } from '@storybook/react-vite';
import { findByRole, fn } from 'storybook/test';
import { TagsFilter } from './TagsFilter';
const meta = {
component: TagsFilter,
title: 'Sidebar/TagsFilter',
tags: ['haha', 'this-is-a-very-long-tag-that-will-be-truncated-after-a-while'],
args: {
... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/components/sidebar/StatusButton.tsx | code/core/src/manager/components/sidebar/StatusButton.tsx | import type { ComponentProps } from 'react';
import React, { forwardRef } from 'react';
import { Button } from 'storybook/internal/components';
import type { StatusValue } from 'storybook/internal/types';
import type { Theme } from '@emotion/react';
import { darken, lighten, transparentize } from 'polished';
import {... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/components/sidebar/types.ts | code/core/src/manager/components/sidebar/types.ts | import type { StatusValue, StatusesByStoryIdAndTypeId } from 'storybook/internal/types';
import type { ControllerStateAndHelpers } from 'downshift';
import type { State, StoriesHash } from 'storybook/manager-api';
export type Refs = State['refs'];
export type RefType = Refs[keyof Refs] & { allStatuses?: StatusesBySto... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/components/sidebar/Refs.stories.tsx | code/core/src/manager/components/sidebar/Refs.stories.tsx | /* eslint-disable local-rules/no-uncategorized-errors */
import React from 'react';
import type { Meta, StoryObj } from '@storybook/react-vite';
import { ManagerContext } from 'storybook/manager-api';
import { fn, userEvent, within } from 'storybook/test';
import { dedent } from 'ts-dedent';
import { standardData as... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/components/sidebar/useDynamicFavicon.stories.tsx | code/core/src/manager/components/sidebar/useDynamicFavicon.stories.tsx | import React, { useEffect, useState } from 'react';
import { getFaviconUrl } from './useDynamicFavicon';
export default {
title: 'Dynamic Favicon',
args: {
size: 16,
},
argTypes: {
size: {
control: 'select',
options: [16, 32, 64, 128, 256],
},
status: {
control: 'select',
... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/components/sidebar/Menu.tsx | code/core/src/manager/components/sidebar/Menu.tsx | import type { ComponentProps, FC } from 'react';
import React, { useState } from 'react';
import { ActionList, Button, PopoverProvider, ToggleButton } from 'storybook/internal/components';
import { CloseIcon, CogIcon } from '@storybook/icons';
import { transparentize } from 'polished';
import { type Theme, css, styl... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/components/sidebar/Search.tsx | code/core/src/manager/components/sidebar/Search.tsx | import React, { type ReactNode, useCallback, useRef, useState } from 'react';
import { Button } from 'storybook/internal/components';
import { global } from '@storybook/global';
import { CloseIcon, SearchIcon } from '@storybook/icons';
import type { DownshiftState, StateChangeOptions } from 'downshift';
import Downs... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/components/sidebar/Sidebar.tsx | code/core/src/manager/components/sidebar/Sidebar.tsx | import React, { useMemo, useState } from 'react';
import { Button, ScrollArea } from 'storybook/internal/components';
import type { API_LoadedRefData, StoryIndex, TagsOptions } from 'storybook/internal/types';
import type { StatusesByStoryIdAndTypeId } from 'storybook/internal/types';
import { global } from '@storybo... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/components/sidebar/TestingWidget.tsx | code/core/src/manager/components/sidebar/TestingWidget.tsx | import React, {
type ComponentProps,
type ReactNode,
type SyntheticEvent,
useCallback,
useEffect,
useRef,
useState,
} from 'react';
import { once } from 'storybook/internal/client-logger';
import { ActionList, Card } from 'storybook/internal/components';
import type {
Addon_Collection,
Addon_TestProv... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/components/sidebar/FileSearchList.stories.tsx | code/core/src/manager/components/sidebar/FileSearchList.stories.tsx | import type { Meta, StoryObj } from '@storybook/react-vite';
import { expect, fireEvent, fn, within } from 'storybook/test';
import { FileSearchList } from './FileSearchList';
const meta = {
component: FileSearchList,
title: 'Sidebar/FileSearchList',
args: {
onNewStory: fn(),
},
parameters: {
layou... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/components/sidebar/useLastViewed.ts | code/core/src/manager/components/sidebar/useLastViewed.ts | import { useCallback, useEffect, useMemo, useRef } from 'react';
import { debounce } from 'es-toolkit/function';
import store from 'store2';
import type { Selection, StoryRef } from './types';
const save = debounce((value) => store.set('lastViewedStoryIds', value), 1000);
export const useLastViewed = (selection: Se... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/components/sidebar/Loader.tsx | code/core/src/manager/components/sidebar/Loader.tsx | import type { FC } from 'react';
import React, { Fragment } from 'react';
import { styled } from 'storybook/theming';
const LOADER_SEQUENCE = [0, 0, 1, 1, 2, 3, 3, 3, 1, 1, 1, 2, 2, 2, 3];
const Loadingitem = styled.div<{
depth?: number;
}>(
{
cursor: 'progress',
fontSize: 13,
height: '16px',
mar... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/components/sidebar/SidebarBottom.stories.tsx | code/core/src/manager/components/sidebar/SidebarBottom.stories.tsx | import React, { type FC, useEffect, useState } from 'react';
import {
type Addon_Collection,
type Addon_TestProviderType,
Addon_TypesEnum,
} from 'storybook/internal/types';
import type { Meta, StoryObj } from '@storybook/react-vite';
import { type API, ManagerContext } from 'storybook/manager-api';
import { e... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/components/sidebar/TagsFilterPanel.tsx | code/core/src/manager/components/sidebar/TagsFilterPanel.tsx | import React, { Fragment, useRef } from 'react';
import { ActionList, Form } from 'storybook/internal/components';
import type { API_PreparedIndexEntry } from 'storybook/internal/types';
import {
BatchAcceptIcon,
DeleteIcon,
DocumentIcon,
ShareAltIcon,
SweepIcon,
UndoIcon,
} from '@storybook/icons';
impo... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/components/sidebar/useDynamicFavicon.ts | code/core/src/manager/components/sidebar/useDynamicFavicon.ts | /* eslint-env browser */
import { useEffect, useRef } from 'react';
const STATUSES = ['active', 'critical', 'negative', 'positive', 'warning'] as const;
let initialIcon: string | undefined;
export const getFaviconUrl = (
initialHref: string = './favicon.svg',
status?: (typeof STATUSES)[number]
) => {
initialIc... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/components/sidebar/mockdata.ts | code/core/src/manager/components/sidebar/mockdata.ts | import type { API_HashEntry } from 'storybook/internal/types';
export type MockDataSet = Record<string, Record<string, Partial<API_HashEntry>>>;
export const mockDataset: MockDataSet = {
withRoot: {
'group-1': {
type: 'group',
children: ['group-1--child-b1', 'group-1--child-b2'],
depth: 0,
... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/components/sidebar/StatusContext.tsx | code/core/src/manager/components/sidebar/StatusContext.tsx | import { createContext, useContext } from 'react';
import type {
Status,
StatusValue,
StatusesByStoryIdAndTypeId,
StoryId,
} from 'storybook/internal/types';
import type { StoriesHash } from 'storybook/manager-api';
import type { Item } from '../../container/Sidebar';
import { getDescendantIds } from '../../... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/components/sidebar/SearchResults.stories.tsx | code/core/src/manager/components/sidebar/SearchResults.stories.tsx | import React from 'react';
import type { StoriesHash } from 'storybook/manager-api';
import { searchItem } from '../../utils/tree';
import { IconSymbols } from './IconSymbols';
import { SearchResults } from './SearchResults';
import { mockDataset } from './mockdata';
import type { CombinedDataset, Refs, SearchItem } ... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/components/sidebar/FileSearchListSkeleton.stories.tsx | code/core/src/manager/components/sidebar/FileSearchListSkeleton.stories.tsx | import type { Meta, StoryObj } from '@storybook/react-vite';
import { FileSearchListLoadingSkeleton } from './FileSearchListSkeleton';
const meta = {
component: FileSearchListLoadingSkeleton,
title: 'Sidebar/FileSearchListLoadingSkeleton',
} satisfies Meta<typeof FileSearchListLoadingSkeleton>;
export default me... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/components/sidebar/useExpanded.ts | code/core/src/manager/components/sidebar/useExpanded.ts | import type { Dispatch, MutableRefObject, Reducer } from 'react';
import { useCallback, useEffect, useReducer } from 'react';
import { STORIES_COLLAPSE_ALL, STORIES_EXPAND_ALL } from 'storybook/internal/core-events';
import { global } from '@storybook/global';
import { throttle } from 'es-toolkit/function';
import t... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/components/sidebar/Tree.tsx | code/core/src/manager/components/sidebar/Tree.tsx | import type { ComponentProps, FC, MutableRefObject } from 'react';
import React, { useCallback, useMemo, useRef } from 'react';
import { Button, ListItem } from 'storybook/internal/components';
import { PRELOAD_ENTRIES } from 'storybook/internal/core-events';
import type { StatusValue } from 'storybook/internal/types'... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/components/sidebar/components/CollapseIcon.tsx | code/core/src/manager/components/sidebar/components/CollapseIcon.tsx | import type { ComponentProps, FC } from 'react';
import React from 'react';
import { styled } from 'storybook/theming';
export const CollapseIconWrapper = styled.div<{ isExpanded: boolean }>(({ theme, isExpanded }) => ({
width: 8,
height: 8,
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/components/sidebar/__tests__/Sidebar.test.tsx | code/core/src/manager/components/sidebar/__tests__/Sidebar.test.tsx | // @vitest-environment happy-dom
import { cleanup, fireEvent, render, screen } from '@testing-library/react';
import type { RenderResult } from '@testing-library/react';
import { afterEach, describe, expect, test } from 'vitest';
import React from 'react';
import type { API_IndexHash } from 'storybook/internal/types'... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/components/layout/useDragging.ts | code/core/src/manager/components/layout/useDragging.ts | import type { Dispatch, SetStateAction } from 'react';
import { useEffect, useRef } from 'react';
import type { LayoutState } from './Layout';
// the distance from the edge of the screen at which the panel/sidebar will snap to the edge
const SNAP_THRESHOLD_PX = 30;
const SIDEBAR_MIN_WIDTH_PX = 240;
const RIGHT_PANEL_... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/components/layout/Layout.tsx | code/core/src/manager/components/layout/Layout.tsx | import React, { useEffect, useLayoutEffect, useState } from 'react';
import { Match } from 'storybook/internal/router';
import type { API_Layout, API_ViewMode } from 'storybook/internal/types';
import { type API, useStorybookApi } from 'storybook/manager-api';
import { styled } from 'storybook/theming';
import { MED... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/components/layout/LayoutProvider.tsx | code/core/src/manager/components/layout/LayoutProvider.tsx | import type { FC, PropsWithChildren } from 'react';
import React, { createContext, useContext, useMemo, useState } from 'react';
import { BREAKPOINT } from '../../constants';
import { useMediaQuery } from '../../hooks/useMedia';
type LayoutContextType = {
isMobileMenuOpen: boolean;
setMobileMenuOpen: React.Dispat... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/components/layout/Layout.stories.tsx | code/core/src/manager/components/layout/Layout.stories.tsx | import type { FC, PropsWithChildren } from 'react';
import React, { useState } from 'react';
import { LocationProvider } from 'storybook/internal/router';
import type { Meta, StoryObj } from '@storybook/react-vite';
import { startCase } from 'es-toolkit/string';
import { action } from 'storybook/actions';
import { M... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/components/Particles/Particles.stories.tsx | code/core/src/manager/components/Particles/Particles.stories.tsx | import preview from '../../../../../.storybook/preview';
import { Particles } from './Particles';
const SomeComponent = (props: React.ComponentProps<'div'>) => {
return <div {...props}>Cool</div>;
};
const meta = preview.meta({
component: Particles,
parameters: {
layout: 'centered',
chromatic: {
d... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/components/Particles/Particles.tsx | code/core/src/manager/components/Particles/Particles.tsx | import type { ComponentProps } from 'react';
import React, { memo, useLayoutEffect, useRef, useState } from 'react';
import { createPortal } from 'react-dom';
import { keyframes, styled } from 'storybook/theming';
const Shape = styled.svg(({ color }) => ({
fill: color,
position: 'absolute',
inset: '0',
margin... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/components/notifications/NotificationItem.tsx | code/core/src/manager/components/notifications/NotificationItem.tsx | import type { FC, SyntheticEvent } from 'react';
import React, { useCallback, useEffect, useRef } from 'react';
import { Button } from 'storybook/internal/components';
import { Link } from 'storybook/internal/router';
import { CloseAltIcon } from '@storybook/icons';
import { transparentize } from 'polished';
import ... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/components/notifications/NotificationList.tsx | code/core/src/manager/components/notifications/NotificationList.tsx | import type { FC } from 'react';
import React from 'react';
import type { State } from 'storybook/manager-api';
import { styled } from 'storybook/theming';
import { useLayout } from '../layout/LayoutProvider';
import NotificationItem from './NotificationItem';
interface NotificationListProps {
notifications: State... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/components/notifications/NotificationItem.stories.tsx | code/core/src/manager/components/notifications/NotificationItem.stories.tsx | import React from 'react';
import { LocationProvider } from 'storybook/internal/router';
import {
AccessibilityIcon as AccessibilityIconIcon,
BookIcon as BookIconIcon,
FaceHappyIcon,
} from '@storybook/icons';
import type { Meta, StoryObj } from '@storybook/react-vite';
import { action } from 'storybook/actio... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/components/notifications/NotificationList.stories.tsx | code/core/src/manager/components/notifications/NotificationList.stories.tsx | import React from 'react';
import { LocationProvider } from 'storybook/internal/router';
import type { Meta, StoryObj } from '@storybook/react-vite';
import * as itemStories from './NotificationItem.stories';
import { NotificationList } from './NotificationList';
const meta = {
component: NotificationList,
titl... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/components/Optional/Optional.tsx | code/core/src/manager/components/Optional/Optional.tsx | import type { ReactElement } from 'react';
import React, { useEffect, useRef, useState } from 'react';
import { styled } from 'storybook/theming';
const Wrapper = styled.div({
display: 'inline-grid',
gridTemplateColumns: 'max-content',
overflow: 'hidden',
});
const Content = styled.div<{ isHidden: boolean | nu... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/components/Optional/Optional.stories.tsx | code/core/src/manager/components/Optional/Optional.stories.tsx | import type { Meta, StoryObj } from '@storybook/react-vite';
import { keyframes, styled } from 'storybook/theming';
import { Optional } from './Optional';
const resize = keyframes`
to {
width: 150px;
}
`;
const Resizing = styled.div({
display: 'inline-flex',
justifyContent: 'space-between',
width: '25... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/globals/globals-module-info.ts | code/core/src/manager/globals/globals-module-info.ts | import type { ModuleInfo } from '@fal-works/esbuild-plugin-global-externals';
import Exports from './exports';
import { globalPackages, globalsNameReferenceMap } from './globals';
/*
* We create a map of a module's name to a ModuleInfo.
* Which is a config object for a esbuild-plugin, to swap a import of a module t... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/globals/exports.ts | code/core/src/manager/globals/exports.ts | // this file is generated by sourcefiles.ts
// this is done to prevent runtime dependencies from making it's way into the build/start script of the manager
// the manager builder needs to know which dependencies are 'globalized' in the ui
export default {
react: [
'Children',
'Component',
'Fragment',
... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/globals/runtime.ts | code/core/src/manager/globals/runtime.ts | import * as REACT from 'react';
import * as REACT_DOM from 'react-dom';
import * as REACT_DOM_CLIENT from 'react-dom/client';
import * as CHANNELS from 'storybook/internal/channels';
import * as CLIENT_LOGGER from 'storybook/internal/client-logger';
import * as COMPONENTS from 'storybook/internal/components';
import *... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/globals/globals.ts | code/core/src/manager/globals/globals.ts | // Here we map the name of a module to their REFERENCE in the global scope.
export const globalsNameReferenceMap = {
react: '__REACT__',
'react-dom': '__REACT_DOM__',
'react-dom/client': '__REACT_DOM_CLIENT__',
'@storybook/icons': '__STORYBOOK_ICONS__',
'storybook/manager-api': '__STORYBOOK_API__',
'story... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/utils/status.tsx | code/core/src/manager/utils/status.tsx | import type { ReactElement } from 'react';
import React from 'react';
import type { StatusValue } from 'storybook/internal/types';
import { type API_HashEntry, type StatusesByStoryIdAndTypeId } from 'storybook/internal/types';
import { CircleIcon } from '@storybook/icons';
import memoizerific from 'memoizerific';
im... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/utils/status.test.ts | code/core/src/manager/utils/status.test.ts | // @vitest-environment happy-dom
import { describe, expect, it } from 'vitest';
import { mockDataset } from '../components/sidebar/mockdata';
import { getGroupStatus, getMostCriticalStatusValue } from './status';
describe('getHighestStatus', () => {
it('default value', () => {
expect(getMostCriticalStatusValue(... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/utils/tree.ts | code/core/src/manager/utils/tree.ts | import type { SyntheticEvent } from 'react';
import { global } from '@storybook/global';
import memoize from 'memoizerific';
import type { HashEntry, IndexHash } from 'storybook/manager-api';
import { DEFAULT_REF_ID } from '../components/sidebar/Sidebar';
import type { Dataset, Item, RefType, SearchItem } from '../c... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/utils/prepareForTelemetry.ts | code/core/src/manager/utils/prepareForTelemetry.ts | /* eslint-disable local-rules/no-uncategorized-errors */
import { UncaughtManagerError } from 'storybook/internal/manager-errors';
import { global } from '@storybook/global';
import type { BrowserInfo } from 'browser-dtector';
import BrowserDetector from 'browser-dtector';
let browserInfo: BrowserInfo | undefined;
... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/manager/__tests__/index.test.ts | code/core/src/manager/__tests__/index.test.ts | // @vitest-environment happy-dom
import { describe, expect, it } from 'vitest';
import { renderStorybookUI } from '..';
describe('Main API', () => {
it('should fail if provider is not extended from the base Provider', () => {
const run = () => {
const fakeProvider = {};
// @ts-expect-error (Converte... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/test/index.test.ts | code/core/src/test/index.test.ts | // @vitest-environment happy-dom
import { describe, it, test } from 'vitest';
import { action } from '../actions';
import { expect, fn, isMockFunction } from './index';
import { traverseArgs } from './preview';
it('storybook expect and fn can be used in vitest test', () => {
const spy = fn();
spy(1);
expect(spy... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/test/expect.ts | code/core/src/test/expect.ts | /* eslint-disable @typescript-eslint/ban-ts-comment */
import * as matchers from '@testing-library/jest-dom/matchers';
import type { TestingLibraryMatchers } from '@testing-library/jest-dom/matchers';
import type {
AsymmetricMatchersContaining,
ExpectStatic,
JestAssertion,
MatcherState,
MatchersObject,
} fro... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/test/preview.ts | code/core/src/test/preview.ts | import type { LoaderFunction } from 'storybook/internal/csf';
import { definePreviewAddon } from 'storybook/internal/csf';
import { instrument } from 'storybook/internal/instrumenter';
import {
clearAllMocks,
fn,
isMockFunction,
resetAllMocks,
restoreAllMocks,
uninstrumentedUserEvent,
within,
} from 'sto... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/test/utils.ts | code/core/src/test/utils.ts | export type Promisify<Fn> = Fn extends { <T>(...args: infer Args): infer Return }
? { <T>(...args: Args): Return extends Promise<any> ? Return : Promise<Return> }
: Fn extends { (...args: infer Args): infer Return }
? { (...args: Args): Return extends Promise<any> ? Return : Promise<Return> }
: Fn;
export ... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/test/spy.ts | code/core/src/test/spy.ts | import type { Mock, MockInstance } from '@vitest/spy';
import {
type MaybeMocked,
type MaybeMockedDeep,
type MaybePartiallyMocked,
type MaybePartiallyMockedDeep,
isMockFunction,
mocks,
fn as vitestFn,
spyOn as vitestSpyOn,
} from '@vitest/spy';
import type { SpyInternalImpl } from 'tinyspy';
import * as... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/test/testing-library.ts | code/core/src/test/testing-library.ts | import * as domTestingLibrary from '@testing-library/dom';
import type { FireFunction, FireObject } from '@testing-library/dom/types/events';
import * as _userEvent from '@testing-library/user-event';
import { once } from 'storybook/internal/client-logger';
import { instrument } from 'storybook/internal/instrumenter';... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/test/index.ts | code/core/src/test/index.ts | import type { BoundFunctions } from '@testing-library/dom';
import type { userEvent } from '@testing-library/user-event';
import { instrument } from 'storybook/internal/instrumenter';
import { Assertion } from 'chai';
import { expect as rawExpect } from './expect';
import { type queries } from './testing-library';
... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/test/spy.test.ts | code/core/src/test/spy.test.ts | import { beforeEach, expect, it, vi } from 'vitest';
import { fn, onMockCall, spyOn } from './spy';
const vitestSpy = vi.fn();
beforeEach(() => {
const unsubscribe = onMockCall(vitestSpy);
return () => unsubscribe();
});
it('mocks are reactive', () => {
const storybookSpy = fn();
storybookSpy(1);
expect(v... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/index.ts | code/core/src/components/index.ts | /// <reference path="../typings.d.ts" />
import type { ElementType } from 'react';
import { createElement, forwardRef } from 'react';
import * as typography from './components/typography/components';
export { A } from './components/typography/elements/A';
export { Blockquote } from './components/typography/elements/B... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/brand/StorybookIcon.stories.tsx | code/core/src/components/brand/StorybookIcon.stories.tsx | import { StorybookIcon } from './StorybookIcon';
export default {
component: StorybookIcon,
};
export const Default = {};
| typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/brand/StorybookLogo.stories.tsx | code/core/src/components/brand/StorybookLogo.stories.tsx | import React from 'react';
import { StorybookLogo } from './StorybookLogo';
export default {
component: StorybookLogo,
};
export const Normal = () => <StorybookLogo alt="Storybook logo" />;
| typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/brand/StorybookLogo.tsx | code/core/src/components/brand/StorybookLogo.tsx | import React from 'react';
type StorybookLogoProps = {
alt: string;
} & React.SVGAttributes<SVGSVGElement>;
export const StorybookLogo = ({ alt, ...props }: StorybookLogoProps) => (
<svg width="200px" height="40px" viewBox="0 0 200 40" {...props} role="img">
{alt ? <title>{alt}</title> : null}
<defs>
... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/brand/StorybookIcon.tsx | code/core/src/components/brand/StorybookIcon.tsx | import React from 'react';
export const StorybookIcon = (props: React.SVGAttributes<SVGElement>) => (
<svg viewBox="0 0 64 64" {...props}>
<title>Storybook icon</title>
<g id="Artboard" stroke="none" strokeWidth="1" fill="none" fillRule="evenodd">
<path
d="M8.04798541,58.7875918 L6.07908839,6.3... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/brand/SideBySide.tsx | code/core/src/components/brand/SideBySide.tsx | import { styled } from 'storybook/theming';
export const SideBySide = styled.div({
display: 'grid',
gridColumnGap: 30,
gridTemplateColumns: '1fr 1fr',
position: 'absolute',
width: '100vw',
height: '100vh',
overflow: 'auto',
top: 0,
left: 0,
'& > *': {
padding: 20,
},
});
| typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/Popover/Popover.tsx | code/core/src/components/components/Popover/Popover.tsx | import React, { type HTMLAttributes, forwardRef } from 'react';
import { CloseIcon } from '@storybook/icons';
import { lighten, styled } from 'storybook/theming';
import { Button } from '../Button/Button';
export interface PopoverProps extends HTMLAttributes<HTMLDivElement> {
/** Content of the popover. */
chil... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/Popover/PopoverProvider.tsx | code/core/src/components/components/Popover/PopoverProvider.tsx | import type { DOMAttributes, ReactElement, ReactNode } from 'react';
import React, { useCallback, useState } from 'react';
import { Pressable } from '@react-aria/interactions';
import { DialogTrigger } from 'react-aria-components/patched-dist/Dialog';
import { Popover as PopoverUpstream } from 'react-aria-components/p... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/Popover/Popover.stories.tsx | code/core/src/components/components/Popover/Popover.stories.tsx | import React from 'react';
import { Button } from 'storybook/internal/components';
import { CloseAltIcon } from '@storybook/icons';
import { fn } from 'storybook/test';
import preview from '../../../../../.storybook/preview';
import { Popover } from './Popover';
const SampleTooltip = () => 'Lorem ipsum dolor sit a... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/Popover/PopoverProvider.stories.tsx | code/core/src/components/components/Popover/PopoverProvider.stories.tsx | import React from 'react';
import { expect, fn, screen, userEvent, within } from 'storybook/test';
import { styled } from 'storybook/theming';
import preview from '../../../../../.storybook/preview';
import { OverlayTriggerDecorator, Trigger } from '../shared/overlayHelpers';
import { PopoverProvider } from './Popove... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/icon/icon.stories.tsx | code/core/src/components/components/icon/icon.stories.tsx | import type { ComponentProps } from 'react';
import React from 'react';
import { css, styled } from 'storybook/theming';
import type { IconType } from './icon';
import { Icons, icons } from './icon';
const Meta = styled.div`
color: #666;
font-size: 12px;
`;
const Item = styled.li<{ minimal?: boolean }>`
displ... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/icon/icon.tsx | code/core/src/components/components/icon/icon.tsx | import type { ComponentProps } from 'react';
import React, { memo } from 'react';
import { deprecate, logger } from 'storybook/internal/client-logger';
import * as StorybookIcons from '@storybook/icons';
import { styled } from 'storybook/theming';
export type IconType = keyof typeof icons;
type NewIconTypes = (type... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/Modal/Modal.styled.tsx | code/core/src/components/components/Modal/Modal.styled.tsx | import type { ComponentProps } from 'react';
import React, { useContext } from 'react';
import { deprecate } from 'storybook/internal/client-logger';
import { CrossIcon } from '@storybook/icons';
import { Heading } from 'react-aria-components/patched-dist/Heading';
import { Text } from 'react-aria-components/patched... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/Modal/Modal.tsx | code/core/src/components/components/Modal/Modal.tsx | import React, { type HTMLAttributes, createContext, useEffect, useRef, useState } from 'react';
import { deprecate } from 'storybook/internal/client-logger';
import type { DecoratorFunction } from 'storybook/internal/csf';
import { FocusScope } from '@react-aria/focus';
import {
Overlay,
UNSAFE_PortalProvider,
... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/Modal/Modal.stories.tsx | code/core/src/components/components/Modal/Modal.stories.tsx | import React, { forwardRef, useRef, useState } from 'react';
import { action } from 'storybook/actions';
import { expect, fn, screen, userEvent, waitFor, within } from 'storybook/test';
import preview from '../../../../../.storybook/preview';
import { Button } from '../Button/Button';
import { Modal } from './Modal';... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/ToggleButton/ToggleButton.stories.tsx | code/core/src/components/components/ToggleButton/ToggleButton.stories.tsx | import React, { useState } from 'react';
import type { Meta, StoryObj } from '@storybook/react-vite';
import { styled } from 'storybook/theming';
import { ToggleButton } from './ToggleButton';
const meta = {
title: 'ToggleButton',
component: ToggleButton,
tags: ['autodocs'],
args: { ariaLabel: false, childr... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/ToggleButton/ToggleButton.tsx | code/core/src/components/components/ToggleButton/ToggleButton.tsx | import React, { forwardRef } from 'react';
import { darken, transparentize } from 'polished';
import { styled } from 'storybook/theming';
import { Button, type ButtonProps } from '../Button/Button';
export interface ToggleButtonProps extends ButtonProps {
/** Whether the ToggleButton is currently pressed or not. *... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/tooltip/TooltipMessage.tsx | code/core/src/components/components/tooltip/TooltipMessage.tsx | import type { ReactNode } from 'react';
import React from 'react';
import { deprecate } from 'storybook/internal/client-logger';
import { styled } from 'storybook/theming';
import { Link } from '../typography/link/link';
const Title = styled.div(({ theme }) => ({
fontWeight: theme.typography.weight.bold,
}));
co... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/tooltip/TooltipNote.stories.tsx | code/core/src/components/components/tooltip/TooltipNote.stories.tsx | import { Button } from 'storybook/internal/components';
import { styled } from 'storybook/theming';
import preview from '../../../../../.storybook/preview';
import { TooltipNote } from './TooltipNote';
import { TooltipProvider } from './TooltipProvider';
const ViewPort = styled.div({
height: 300,
});
const meta =... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/tooltip/lazy-WithTooltip.tsx | code/core/src/components/components/tooltip/lazy-WithTooltip.tsx | import type { ComponentProps } from 'react';
import React, { Suspense, lazy } from 'react';
const LazyWithTooltip = lazy(() =>
import('./WithTooltip').then((mod) => ({ default: mod.WithTooltip }))
);
export const WithTooltip = (props: ComponentProps<typeof LazyWithTooltip>) => (
<Suspense fallback={<div />}>
... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/tooltip/TooltipMessage.stories.tsx | code/core/src/components/components/tooltip/TooltipMessage.stories.tsx | import React from 'react';
import type { DecoratorFunction } from 'storybook/internal/csf';
import type { Meta } from '@storybook/react-vite';
import { Button } from '../Button/Button';
import { PopoverProvider } from '../Popover/PopoverProvider';
import { TooltipMessage } from './TooltipMessage';
import { WithToolt... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/tooltip/Tooltip.stories.tsx | code/core/src/components/components/tooltip/Tooltip.stories.tsx | import React from 'react';
import preview from '../../../../../.storybook/preview';
import { Tooltip } from './Tooltip';
const SampleTooltip = () => (
<div>
<h3>Lorem ipsum dolor sit amet</h3>
<p>Consectatur vestibulum concet durum politu coret weirom</p>
</div>
);
const meta = preview.meta({
id: 'over... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/tooltip/TooltipLinkList.tsx | code/core/src/components/components/tooltip/TooltipLinkList.tsx | import type { ComponentProps, ReactNode, SyntheticEvent } from 'react';
import React, { Fragment, useCallback } from 'react';
import { deprecate } from 'storybook/internal/client-logger';
import { styled } from 'storybook/theming';
import type { LinkWrapperType, ListItemProps } from './ListItem';
import ListItem fro... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/tooltip/TooltipProvider.tsx | code/core/src/components/components/tooltip/TooltipProvider.tsx | import type { DOMAttributes, ReactElement, ReactNode } from 'react';
import React, { useCallback, useState } from 'react';
import { deprecate } from 'storybook/internal/client-logger';
import { Focusable } from '@react-aria/interactions';
import {
TooltipTrigger,
Tooltip as TooltipUpstream,
} from 'react-aria-com... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/tooltip/TooltipLinkList.stories.tsx | code/core/src/components/components/tooltip/TooltipLinkList.stories.tsx | import React from 'react';
import { LinkIcon, LinuxIcon } from '@storybook/icons';
import type { Meta, StoryObj } from '@storybook/react-vite';
import { action } from 'storybook/actions';
import { TooltipLinkList } from './TooltipLinkList';
import { WithTooltip } from './WithTooltip';
import ellipseUrl from './asse... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/tooltip/ListItem.stories.tsx | code/core/src/components/components/tooltip/ListItem.stories.tsx | import React, { Fragment } from 'react';
import { EyeIcon } from '@storybook/icons';
import ListItem from './ListItem';
export default {
component: ListItem,
};
export const All = {
render: () => (
<div>
<ListItem loading />
<ListItem title="Default" />
<ListItem title="Default icon" right... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/tooltip/WithTooltip.tsx | code/core/src/components/components/tooltip/WithTooltip.tsx | import type { ComponentProps, FC, ReactNode } from 'react';
import React, { useCallback, useEffect, useState } from 'react';
import ReactDOM from 'react-dom';
import { deprecate } from 'storybook/internal/client-logger';
import { global } from '@storybook/global';
import memoize from 'memoizerific';
import type { Po... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/tooltip/TooltipProvider.stories.tsx | code/core/src/components/components/tooltip/TooltipProvider.stories.tsx | import React from 'react';
import { Popover, TooltipNote } from 'storybook/internal/components';
import { expect, fn, screen } from 'storybook/test';
import preview from '../../../../../.storybook/preview';
import { OverlayTriggerDecorator, Trigger } from '../shared/overlayHelpers';
import { TooltipProvider } from '... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.