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/types/modules/docs.ts
code/core/src/types/modules/docs.ts
import type { Channel } from 'storybook/internal/channels'; import type { Parameters, Renderer, StoryContext, StoryId, StoryName } from './csf'; import type { CSFFile, ModuleExport, ModuleExports, NormalizedProjectAnnotations, PreparedMeta, PreparedStory, RenderContext, } from './story'; export type Ren...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/types/modules/features.ts
code/core/src/types/modules/features.ts
export enum Feature { DOCS = 'docs', TEST = 'test', ONBOARDING = 'onboarding', A11Y = 'a11y', }
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/types/modules/core-common.ts
code/core/src/types/modules/core-common.ts
// should be node:http, but that caused the ui/manager to fail to build, might be able to switch this back once ui/manager is in the core import type { FileSystemCache } from 'storybook/internal/common'; import { type StoryIndexGenerator } from 'storybook/internal/core-server'; import { type CsfFile } from 'storybook/i...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/viewport/defaults.ts
code/core/src/viewport/defaults.ts
import type { ViewportMap } from './types'; export const INITIAL_VIEWPORTS = { iphone5: { name: 'iPhone 5', styles: { height: '568px', width: '320px', }, type: 'mobile', }, iphone6: { name: 'iPhone 6', styles: { height: '667px', width: '375px', }, type: 'mo...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/viewport/preview.ts
code/core/src/viewport/preview.ts
import { definePreviewAddon } from 'storybook/internal/csf'; import { PARAM_KEY } from './constants'; import type { GlobalState, ViewportGlobals, ViewportTypes } from './types'; export const initialGlobals: Record<string, GlobalState> = { [PARAM_KEY]: { value: undefined, isRotated: false }, }; export type { Viewpo...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/viewport/manager.tsx
code/core/src/viewport/manager.tsx
import * as React from 'react'; import { addons, types } from 'storybook/manager-api'; import { ViewportTool } from './components/Tool'; import { ADDON_ID, TOOL_ID } from './constants'; export default addons.register(ADDON_ID, (api) => { if (globalThis?.FEATURES?.viewport) { addons.add(TOOL_ID, { title: ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/viewport/utils.tsx
code/core/src/viewport/utils.tsx
import React, { Fragment } from 'react'; import { BrowserIcon, MobileIcon, TabletIcon } from '@storybook/icons'; import { styled } from 'storybook/theming'; import type { Viewport } from './types'; export const ActiveViewportSize = styled.div({ display: 'inline-flex', alignItems: 'center', }); export const Act...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/viewport/constants.ts
code/core/src/viewport/constants.ts
export const ADDON_ID = 'storybook/viewport'; export const PARAM_KEY = 'viewport'; export const PANEL_ID = `${ADDON_ID}/panel`; export const TOOL_ID = `${ADDON_ID}/tool`;
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/viewport/types.ts
code/core/src/viewport/types.ts
export interface Viewport { name: string; styles: ViewportStyles; type?: 'desktop' | 'mobile' | 'tablet' | 'other'; } export interface ViewportStyles { height: string; width: string; } export type ViewportMap = Record<string, Viewport>; export type GlobalState = { /** * When set, the viewport is appli...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/viewport/responsiveViewport.tsx
code/core/src/viewport/responsiveViewport.tsx
import type { Viewport } from './types'; export const responsiveViewport: Viewport = { name: 'Reset viewport', styles: { height: '100%', width: '100%', }, type: 'desktop', };
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/viewport/index.ts
code/core/src/viewport/index.ts
export * from './constants'; export * from './types'; export * from './defaults'; export * from './responsiveViewport';
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/viewport/shortcuts.ts
code/core/src/viewport/shortcuts.ts
import { type API } from 'storybook/manager-api'; import { ADDON_ID } from './constants'; const getCurrentViewportIndex = (viewportsKeys: string[], current: string): number => viewportsKeys.indexOf(current); const getNextViewport = (viewportsKeys: string[], current: string): string => { const currentViewportInde...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/viewport/components/Tool.tsx
code/core/src/viewport/components/Tool.tsx
import React, { type FC, Fragment, useCallback, useEffect, useMemo } from 'react'; import { Button, Select } from 'storybook/internal/components'; import { GrowIcon, TransferIcon } from '@storybook/icons'; import { type API, useGlobals, useParameter } from 'storybook/manager-api'; import { Global, styled } from 'sto...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/controls/typings.d.ts
code/core/src/controls/typings.d.ts
declare var DOCS_OPTIONS: any; declare var CONFIG_TYPE: 'DEVELOPMENT' | 'PRODUCTION'; declare var PREVIEW_URL: any; declare var __STORYBOOK_ADDONS_MANAGER: any; declare var RELEASE_NOTES_DATA: any; declare var FEATURES: import('storybook/internal/types').StorybookConfigRaw['features']; declare var REFS: any; declare...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/controls/preview.ts
code/core/src/controls/preview.ts
import { definePreviewAddon } from 'storybook/internal/csf'; import type { ControlsTypes } from './types'; export type { ControlsTypes }; export default definePreviewAddon<ControlsTypes>({ // Controls addon doesn't need any preview-side configuration // It operates entirely through the manager UI });
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/controls/manager.tsx
code/core/src/controls/manager.tsx
import React from 'react'; import { AddonPanel } from 'storybook/internal/components'; import type { ResponseData, SaveStoryRequestPayload, SaveStoryResponsePayload, } from 'storybook/internal/core-events'; import { SAVE_STORY_REQUEST, SAVE_STORY_RESPONSE } from 'storybook/internal/core-events'; import type { Ar...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/controls/stringifyArgs.tsx
code/core/src/controls/stringifyArgs.tsx
export const stringifyArgs = (args: Record<string, any>) => JSON.stringify(args, (_, value) => { if (typeof value === 'function') { return '__sb_empty_function_arg__'; } return value; });
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/controls/constants.ts
code/core/src/controls/constants.ts
// ! please keep this in sync with addons/onboarding/src/constants.ts export const ADDON_ID = 'addon-controls' as const; export const PARAM_KEY = 'controls' as const;
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/controls/decorator.ts
code/core/src/controls/decorator.ts
import type { DecoratorFunction, PartialStoryFn, StoryContext } from 'storybook/internal/types'; // The controls addon doesn't need a decorator as it operates through the manager UI // This is a placeholder to maintain API compatibility export const withControls: DecoratorFunction = (storyFn: PartialStoryFn, context: ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/controls/types.ts
code/core/src/controls/types.ts
export interface ControlsParameters { /** * Controls configuration * * @see https://storybook.js.org/docs/essentials/controls#parameters-1 */ controls?: { /** * Removes the addon panel and turns off the feature's behavior. If you wish to turn off this * feature for the entire Storybook, yo...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/controls/index.ts
code/core/src/controls/index.ts
export * from './constants';
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/controls/components/ControlsPanel.tsx
code/core/src/controls/components/ControlsPanel.tsx
import React, { useEffect, useMemo, useState } from 'react'; import { ScrollArea } from 'storybook/internal/components'; import type { ArgTypes } from 'storybook/internal/types'; import { global } from '@storybook/global'; import { dequal as deepEqual } from 'dequal'; import { useArgTypes, useArgs, useGlobals,...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/controls/components/SaveStory.stories.tsx
code/core/src/controls/components/SaveStory.stories.tsx
import React from 'react'; import { ModalDecorator } from 'storybook/internal/components'; import type { Meta, StoryObj } from '@storybook/react-vite'; import { expect, fireEvent, fn, screen, within } from 'storybook/test'; import { SaveStory } from './SaveStory'; const meta = { component: SaveStory, args: { ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/controls/components/SaveStory.tsx
code/core/src/controls/components/SaveStory.tsx
import React from 'react'; import { Bar as BaseBar, Button, Form, Modal } from 'storybook/internal/components'; import { AddIcon, CheckIcon, UndoIcon } from '@storybook/icons'; import { keyframes, styled } from 'storybook/theming'; const slideIn = keyframes({ from: { transform: 'translateY(40px)' }, to: { trans...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/controls/components/Title.tsx
code/core/src/controls/components/Title.tsx
import React from 'react'; import { Badge } from 'storybook/internal/components'; import { useArgTypes, useStorybookApi } from 'storybook/manager-api'; import { ADDON_ID } from '../constants'; export function Title() { const api = useStorybookApi(); const selectedPanel = api.getSelectedPanel(); const rows = u...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/csf/index.test.ts
code/core/src/csf/index.test.ts
import { describe, expect, it } from 'vitest'; import { combineTags, isExportStory, storyNameFromExport, toId } from './index'; describe('toId', () => { const testCases: [string, string, string | undefined, string][] = [ // name, kind, story, output ['handles simple cases', 'kind', 'story', 'kind--story'], ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/csf/toStartCaseStr.test.ts
code/core/src/csf/toStartCaseStr.test.ts
import { expect, test } from 'vitest'; import { toStartCaseStr } from './toStartCaseStr'; test.each([ ['snake_case', 'Snake Case'], ['AAAaaaAAAaaa', 'AA Aaaa AA Aaaa'], ['kebab-case', 'Kebab Case'], ['camelCase', 'Camel Case'], ['camelCase1', 'Camel Case 1'], ['camelCase1a', 'Camel Case 1 A'], ['camelCa...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/csf/core-annotations.ts
code/core/src/csf/core-annotations.ts
import type { StorybookTypes } from 'storybook/internal/types'; import actionAnnotations, { type ActionsTypes } from '../actions/preview'; import backgroundsAnnotations, { type BackgroundTypes } from '../backgrounds/preview'; import componentTestingAnnotations from '../component-testing/preview'; import { type Control...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/csf/includeConditionalArg.test.ts
code/core/src/csf/includeConditionalArg.test.ts
import { describe, expect, it } from 'vitest'; import { includeConditionalArg, testValue } from './includeConditionalArg'; import type { Conditional } from './story'; describe('testValue', () => { describe('truthy', () => { it.each([ ['implicit true', {}, true, true], ['implicit truthy', {}, 1, true...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/csf/story.ts
code/core/src/csf/story.ts
import type { RemoveIndexSignature, Simplify, UnionToIntersection } from 'type-fest'; import type { SBScalarType, SBType } from './SBType'; import type { CoreTypes } from './core-annotations'; export * from './SBType'; export type StoryId = string; export type ComponentId = string; export type ComponentTitle = string...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/csf/csf-factories.ts
code/core/src/csf/csf-factories.ts
import type { AddonTypes, StoryContext } from 'storybook/internal/csf'; import { combineTags } from 'storybook/internal/csf'; import type { Args, ComponentAnnotations, ComposedStoryFn, NormalizedProjectAnnotations, ProjectAnnotations, Renderer, StoryAnnotations, TestFunction, } from 'storybook/internal/...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/csf/csf-factories.test.ts
code/core/src/csf/csf-factories.test.ts
//* @vitest-environment happy-dom */ import { describe, expect, test, vi } from 'vitest'; import { definePreview, definePreviewAddon, getStoryChildren } from './csf-factories'; interface Addon1Types { parameters: { foo?: { value: string } }; } const addon = definePreviewAddon<Addon1Types>({}); interface Addon2Typ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/csf/story.test.ts
code/core/src/csf/story.test.ts
/* global HTMLElement */ import { test } from 'vitest'; import { expectTypeOf } from 'expect-type'; import type { Args, ArgsFromMeta, ArgsStoryFn, ComponentAnnotations, DecoratorFunction, LoaderFunction, ProjectAnnotations, Renderer, StoryAnnotationsOrFn, StrictArgs, } from './story'; // NOTE Exa...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/csf/includeConditionalArg.ts
code/core/src/csf/includeConditionalArg.ts
/* @ts-expect-error (has no typings) */ import { isEqual } from '@ngard/tiny-isequal'; import type { Args, Conditional, Globals, InputType } from './story'; const count = (vals: any[]) => vals.map((v) => typeof v !== 'undefined').filter(Boolean).length; export const testValue = (cond: Omit<Conditional, 'arg' | 'glob...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/csf/index.ts
code/core/src/csf/index.ts
import { toStartCaseStr } from './toStartCaseStr'; /** * Remove punctuation and illegal characters from a story ID. * * See https://gist.github.com/davidjrice/9d2af51100e41c6c4b4a */ export const sanitize = (string: string) => { return string .toLowerCase() .replace(/[ ’–—―′¿'`~!@#$%^&*()_|+\-=?;:'",.<>...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/csf/SBType.ts
code/core/src/csf/SBType.ts
interface SBBaseType { required?: boolean; raw?: string; } export type SBScalarType = SBBaseType & { name: 'boolean' | 'string' | 'number' | 'function' | 'symbol'; }; export type SBArrayType = SBBaseType & { name: 'array'; value: SBType; }; export type SBObjectType = SBBaseType & { name: 'object'; value...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/csf/toStartCaseStr.ts
code/core/src/csf/toStartCaseStr.ts
export function toStartCaseStr(str: string) { return str .replace(/_/g, ' ') .replace(/-/g, ' ') .replace(/\./g, ' ') .replace(/([^\n])([A-Z])([a-z])/g, (str2, $1, $2, $3) => `${$1} ${$2}${$3}`) .replace(/([a-z])([A-Z])/g, (str2, $1, $2) => `${$1} ${$2}`) .replace(/([a-z])([0-9])/gi, (str2, $1...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/docs-tools/index.ts
code/core/src/docs-tools/index.ts
export * from './argTypes/index'; export * from './shared';
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/docs-tools/shared.ts
code/core/src/docs-tools/shared.ts
export const ADDON_ID = 'storybook/docs'; export const PANEL_ID = `${ADDON_ID}/panel`; export const PARAM_KEY = `docs`; export const SNIPPET_RENDERED = `${ADDON_ID}/snippet-rendered`; export enum SourceType { /** * AUTO is the default * * Use the CODE logic if: * * - The user has set a custom source ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/docs-tools/argTypes/jsdocParser.test.ts
code/core/src/docs-tools/argTypes/jsdocParser.test.ts
import { describe, expect, it } from 'vitest'; import { parseJsDoc } from './jsdocParser'; describe('parseJsDoc', () => { it('should set includesJsDoc to false when the value is null', () => { const { includesJsDoc, description, extractedTags } = parseJsDoc(null, {}); expect(includesJsDoc).toBeFalsy(); ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/docs-tools/argTypes/enhanceArgTypes.test.ts
code/core/src/docs-tools/argTypes/enhanceArgTypes.test.ts
import { describe, expect, it } from 'vitest'; import type { ArgTypes, StrictInputType } from 'storybook/internal/types'; import { enhanceArgTypes } from './enhanceArgTypes'; expect.addSnapshotSerializer({ print: (val: any) => JSON.stringify(val, null, 2), test: (val) => typeof val !== 'string', }); const enhan...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/docs-tools/argTypes/typings.d.ts
code/core/src/docs-tools/argTypes/typings.d.ts
declare module 'require-from-string';
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/docs-tools/argTypes/utils.ts
code/core/src/docs-tools/argTypes/utils.ts
import type { PropSummaryValue } from './docgen'; export const MAX_TYPE_SUMMARY_LENGTH = 90; export const MAX_DEFAULT_VALUE_SUMMARY_LENGTH = 50; export function isTooLongForTypeSummary(value: string): boolean { return value.length > MAX_TYPE_SUMMARY_LENGTH; } export function isTooLongForDefaultValueSummary(value: ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/docs-tools/argTypes/enhanceArgTypes.ts
code/core/src/docs-tools/argTypes/enhanceArgTypes.ts
import type { Renderer, StoryContextForEnhancers } from 'storybook/internal/types'; import { combineParameters } from '../../preview-api/modules/store/parameters'; export const enhanceArgTypes = <TRenderer extends Renderer>( context: StoryContextForEnhancers<TRenderer> ) => { const { component, argTypes: ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/docs-tools/argTypes/utils.test.ts
code/core/src/docs-tools/argTypes/utils.test.ts
import { describe, expect, it } from 'vitest'; import { createSummaryValue } from './utils'; describe('createSummaryValue', () => { it('creates an object with just summary if detail is not passed', () => { const summary = 'boolean'; expect(createSummaryValue(summary)).toEqual({ summary }); }); it('crea...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/docs-tools/argTypes/jsdocParser.ts
code/core/src/docs-tools/argTypes/jsdocParser.ts
import type { Block, Spec } from 'comment-parser'; import { parse as parseJSDoc } from 'comment-parser'; import type { RootResult as JSDocType } from 'jsdoc-type-pratt-parser'; import { parse as parseJSDocType, stringifyRules, transform as transformJSDocType, } from 'jsdoc-type-pratt-parser'; import type { JsDoc...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/docs-tools/argTypes/types.ts
code/core/src/docs-tools/argTypes/types.ts
export type Component = any;
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/docs-tools/argTypes/index.ts
code/core/src/docs-tools/argTypes/index.ts
export * from './convert'; export * from './docgen'; export * from './jsdocParser'; export * from './types'; export * from './utils'; export * from './enhanceArgTypes';
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/docs-tools/argTypes/docgen/extractDocgenProps.test.ts
code/core/src/docs-tools/argTypes/docgen/extractDocgenProps.test.ts
import { describe, expect, it } from 'vitest'; import type { Component } from '../types'; import { extractComponentProps } from './extractDocgenProps'; const DOCGEN_SECTION = 'props'; const PROP_NAME = 'propName'; interface TypeSystemDef { name: string; typeProperty: string; } const TypeSystems: TypeSystemDef[]...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/docs-tools/argTypes/docgen/createPropDef.ts
code/core/src/docs-tools/argTypes/docgen/createPropDef.ts
import { convert } from '../convert'; import type { JsDocParsingResult } from '../jsdocParser'; import { createSummaryValue } from '../utils'; import type { JsDocParam, PropDefaultValue } from './PropDef'; import { createFlowPropDef } from './flow/createPropDef'; import { createTsPropDef } from './typeScript/createProp...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/docs-tools/argTypes/docgen/extractDocgenProps.ts
code/core/src/docs-tools/argTypes/docgen/extractDocgenProps.ts
import type { ExtractedJsDoc } from '../jsdocParser'; import { parseJsDoc } from '../jsdocParser'; import type { Component } from '../types'; import type { PropDefFactory } from './createPropDef'; import { getPropDefFactory } from './createPropDef'; import type { DocgenInfo, PropDef } from './types'; import { TypeSyste...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/docs-tools/argTypes/docgen/PropDef.ts
code/core/src/docs-tools/argTypes/docgen/PropDef.ts
// FIXME: this is legacy code that needs to be updated & simplified with ArgType refactor export interface JsDocParam { name: string | undefined | null; description?: string | null; } export interface JsDocReturns { description?: string | null; } export interface JsDocTags { params?: JsDocParam[] | null; r...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/docs-tools/argTypes/docgen/types.ts
code/core/src/docs-tools/argTypes/docgen/types.ts
import type { StrictArgTypes } from 'storybook/internal/types'; import type { Component } from '../types'; import type { PropDef } from './PropDef'; export type PropsExtractor = (component: Component) => { rows?: PropDef[] } | null; export type ArgTypesExtractor = (component: Component) => StrictArgTypes | null; ex...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/docs-tools/argTypes/docgen/index.ts
code/core/src/docs-tools/argTypes/docgen/index.ts
export * from './types'; export * from './utils'; export * from './extractDocgenProps'; export * from './PropDef';
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/docs-tools/argTypes/docgen/typeScript/createPropDef.ts
code/core/src/docs-tools/argTypes/docgen/typeScript/createPropDef.ts
import type { PropDefFactory } from '../createPropDef'; import { createDefaultValue } from './createDefaultValue'; import { createType } from './createType'; export const createTsPropDef: PropDefFactory = (propName, docgenInfo) => { const { description, required } = docgenInfo; return { name: propName, ty...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/docs-tools/argTypes/docgen/typeScript/createType.ts
code/core/src/docs-tools/argTypes/docgen/typeScript/createType.ts
import { createSummaryValue } from '../../utils'; import type { PropType } from '../PropDef'; import type { DocgenInfo } from '../types'; export function createType({ tsType, required }: DocgenInfo): PropType | null { // A type could be null if a defaultProp has been provided without a type definition. if (tsType ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/docs-tools/argTypes/docgen/typeScript/createPropDef.test.ts
code/core/src/docs-tools/argTypes/docgen/typeScript/createPropDef.test.ts
import { describe, expect, it } from 'vitest'; import type { DocgenInfo } from '../types'; import { createTsPropDef } from './createPropDef'; const PROP_NAME = 'propName'; function createDocgenInfo({ tsType, ...others }: Partial<DocgenInfo>): DocgenInfo { return { tsType, required: true, ...others, }...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/docs-tools/argTypes/docgen/typeScript/createDefaultValue.ts
code/core/src/docs-tools/argTypes/docgen/typeScript/createDefaultValue.ts
import { createSummaryValue } from '../../utils'; import type { PropDefaultValue } from '../PropDef'; import type { DocgenInfo } from '../types'; import { isDefaultValueBlacklisted } from '../utils/defaultValue'; export function createDefaultValue({ defaultValue }: DocgenInfo): PropDefaultValue | null { if (defaultV...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/docs-tools/argTypes/docgen/flow/createPropDef.ts
code/core/src/docs-tools/argTypes/docgen/flow/createPropDef.ts
import type { PropDefFactory } from '../createPropDef'; import { createDefaultValue } from './createDefaultValue'; import { createType } from './createType'; export const createFlowPropDef: PropDefFactory = (propName, docgenInfo) => { const { flowType, description, required, defaultValue } = docgenInfo; return { ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/docs-tools/argTypes/docgen/flow/createType.ts
code/core/src/docs-tools/argTypes/docgen/flow/createType.ts
import { createSummaryValue, isTooLongForTypeSummary } from '../../utils'; import type { PropType } from '../PropDef'; import type { DocgenFlowType } from '../types'; enum FlowTypesType { UNION = 'union', SIGNATURE = 'signature', } interface DocgenFlowUnionElement { name: string; value?: string; elements?: ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/docs-tools/argTypes/docgen/flow/createPropDef.test.ts
code/core/src/docs-tools/argTypes/docgen/flow/createPropDef.test.ts
import { describe, expect, it } from 'vitest'; import type { DocgenInfo } from '../types'; import { createFlowPropDef } from './createPropDef'; const PROP_NAME = 'propName'; function createDocgenInfo({ flowType, ...others }: Partial<DocgenInfo>): DocgenInfo { return { flowType, required: false, ...othe...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/docs-tools/argTypes/docgen/flow/createDefaultValue.ts
code/core/src/docs-tools/argTypes/docgen/flow/createDefaultValue.ts
import { createSummaryValue, isTooLongForDefaultValueSummary } from '../../utils'; import type { PropDefaultValue } from '../PropDef'; import type { DocgenPropDefaultValue, DocgenPropType } from '../types'; import { isDefaultValueBlacklisted } from '../utils/defaultValue'; export function createDefaultValue( default...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/docs-tools/argTypes/docgen/utils/defaultValue.ts
code/core/src/docs-tools/argTypes/docgen/utils/defaultValue.ts
const BLACKLIST = ['null', 'undefined']; export function isDefaultValueBlacklisted(value: string): boolean { return BLACKLIST.some((x) => x === value); }
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/docs-tools/argTypes/docgen/utils/string.ts
code/core/src/docs-tools/argTypes/docgen/utils/string.ts
export const str = (obj: any) => { if (!obj) { return ''; } if (typeof obj === 'string') { return obj as string; } throw new Error(`Description: expected string, got: ${JSON.stringify(obj)}`); };
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/docs-tools/argTypes/docgen/utils/docgenInfo.ts
code/core/src/docs-tools/argTypes/docgen/utils/docgenInfo.ts
import type { Component } from '../../types'; import { str } from './string'; export function hasDocgen<T = any>( component: Component ): component is object & { __docgenInfo: T } { return !!component.__docgenInfo; } export function isValidDocgenSection(docgenSection: any) { return docgenSection != null && Obje...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/docs-tools/argTypes/docgen/utils/index.ts
code/core/src/docs-tools/argTypes/docgen/utils/index.ts
export * from './defaultValue'; export * from './string'; export * from './docgenInfo';
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/docs-tools/argTypes/convert/utils.ts
code/core/src/docs-tools/argTypes/convert/utils.ts
const QUOTE_REGEX = /^['"]|['"]$/g; export const trimQuotes = (str: string) => str.replace(QUOTE_REGEX, ''); export const includesQuotes = (str: string) => QUOTE_REGEX.test(str); export const parseLiteral = (str: string) => { const trimmedValue = trimQuotes(str); return includesQuotes(str) || Number.isNaN(Number(t...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/docs-tools/argTypes/convert/convert.test.ts
code/core/src/docs-tools/argTypes/convert/convert.test.ts
import { readFileSync } from 'node:fs'; import { describe, expect, it } from 'vitest'; import { transformSync } from 'storybook/internal/babel'; import { mapValues } from 'es-toolkit/object'; import requireFromString from 'require-from-string'; import { normalizeNewlines } from '../utils'; import { convert } from '...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/docs-tools/argTypes/convert/index.ts
code/core/src/docs-tools/argTypes/convert/index.ts
import type { DocgenInfo } from '../docgen/types'; import type { FlowType } from './flow'; import { convert as flowConvert } from './flow'; import { convert as propTypesConvert } from './proptypes'; import type { TSType } from './typescript'; import { convert as tsConvert } from './typescript'; export const convert = ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/docs-tools/argTypes/convert/flow/convert.ts
code/core/src/docs-tools/argTypes/convert/flow/convert.ts
import { UnknownArgTypesError } from 'storybook/internal/preview-errors'; import type { SBType } from 'storybook/internal/types'; import type { FlowLiteralType, FlowSigType, FlowType } from './types'; const isLiteral = (type: FlowType): type is FlowLiteralType => type.name === 'literal'; const toEnumOption = (element...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/docs-tools/argTypes/convert/flow/types.ts
code/core/src/docs-tools/argTypes/convert/flow/types.ts
interface FlowBaseType { name: string; type?: string; raw?: string; required?: boolean; } type FlowArgType = FlowType; type FlowCombinationType = FlowBaseType & { name: 'union' | 'intersection'; elements: FlowType[]; }; type FlowFuncSigType = FlowBaseType & { name: 'signature'; type: 'function'; si...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/docs-tools/argTypes/convert/flow/index.ts
code/core/src/docs-tools/argTypes/convert/flow/index.ts
export * from './convert'; export * from './types';
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/docs-tools/argTypes/convert/proptypes/convert.ts
code/core/src/docs-tools/argTypes/convert/proptypes/convert.ts
import type { SBType } from 'storybook/internal/types'; import { mapValues } from 'es-toolkit/object'; import { parseLiteral } from '../utils'; import type { PTType } from './types'; const SIGNATURE_REGEXP = /^\(.*\) => /; export const convert = (type: PTType): SBType | any => { const { name, raw, computed, value...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/docs-tools/argTypes/convert/proptypes/types.ts
code/core/src/docs-tools/argTypes/convert/proptypes/types.ts
interface PTBaseType { name: string; description?: string; required?: boolean; } export type PTType = PTBaseType & { value?: any; raw?: string; computed?: boolean; };
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/docs-tools/argTypes/convert/proptypes/index.ts
code/core/src/docs-tools/argTypes/convert/proptypes/index.ts
export * from './convert'; export * from './types';
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/docs-tools/argTypes/convert/typescript/convert.ts
code/core/src/docs-tools/argTypes/convert/typescript/convert.ts
import { UnknownArgTypesError } from 'storybook/internal/preview-errors'; import type { SBType } from 'storybook/internal/types'; import { parseLiteral } from '../utils'; import type { TSSigType, TSType } from './types'; // Type guards for narrowing TSType discriminant unions type TSLiteralType = Extract<TSType, { na...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/docs-tools/argTypes/convert/typescript/types.ts
code/core/src/docs-tools/argTypes/convert/typescript/types.ts
interface TSBaseType { name: string; type?: string; raw?: string; required?: boolean; } type TSArgType = TSType; type TSCombinationType = TSBaseType & { name: 'union' | 'intersection'; elements: TSType[]; }; type TSFuncSigType = TSBaseType & { name: 'signature'; type: 'function'; signature: { a...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/docs-tools/argTypes/convert/typescript/index.ts
code/core/src/docs-tools/argTypes/convert/typescript/index.ts
export * from './convert'; export * from './types';
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/docs-tools/argTypes/convert/__testfixtures__/typescript/enums.tsx
code/core/src/docs-tools/argTypes/convert/__testfixtures__/typescript/enums.tsx
import type { FC } from 'react'; import React from 'react'; enum DefaultEnum { TopLeft, TopRight, TopCenter, } enum NumericEnum { TopLeft = 0, TopRight, TopCenter, } enum StringEnum { TopLeft = 'top-left', TopRight = 'top-right', TopCenter = 'top-center', } interface Props { defaultEnum: DefaultEnu...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/docs-tools/argTypes/convert/__testfixtures__/typescript/intersections.tsx
code/core/src/docs-tools/argTypes/convert/__testfixtures__/typescript/intersections.tsx
import type { FC } from 'react'; import React from 'react'; interface ItemInterface { text: string; value: string; } interface PersonInterface { name: string; } type InterfaceIntersection = ItemInterface & PersonInterface; interface Props { intersectionType: InterfaceIntersection; intersectionWithInlineType:...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/docs-tools/argTypes/convert/__testfixtures__/typescript/functions.tsx
code/core/src/docs-tools/argTypes/convert/__testfixtures__/typescript/functions.tsx
import type { FC } from 'react'; import React from 'react'; interface ItemInterface { text: string; value: string; } interface Props { onClick?: () => void; voidFunc: () => void; funcWithArgsAndReturns: (a: string, b: string) => string; funcWithUnionArg: (a: string | number) => string; funcWithMultipleUn...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/docs-tools/argTypes/convert/__testfixtures__/typescript/aliases.tsx
code/core/src/docs-tools/argTypes/convert/__testfixtures__/typescript/aliases.tsx
import type { FC } from 'react'; import React from 'react'; type StringAlias = string; type NumberAlias = number; type AliasesIntersection = StringAlias & NumberAlias; type AliasesUnion = StringAlias | NumberAlias; interface GenericAlias<T> { value: T; } interface Props { typeAlias: StringAlias; aliasesIntersect...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/docs-tools/argTypes/convert/__testfixtures__/typescript/arrays.tsx
code/core/src/docs-tools/argTypes/convert/__testfixtures__/typescript/arrays.tsx
import type { FC } from 'react'; import React from 'react'; interface ItemInterface { text: string; value: string; } interface Point { x: number; y: number; } interface Props { arrayOfPoints: Point[]; arrayOfInlineObjects: { w: number; h: number }[]; arrayOfPrimitive: string[]; arrayOfComplexObject: It...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/docs-tools/argTypes/convert/__testfixtures__/typescript/records.tsx
code/core/src/docs-tools/argTypes/convert/__testfixtures__/typescript/records.tsx
import type { FC } from 'react'; import React from 'react'; interface ItemInterface { text: string; value: string; } interface Props { recordOfPrimitive: Record<string, number>; recordOfComplexObject: Record<string, ItemInterface>; } export const Component: FC<Props> = (props: Props) => <>JSON.stringify(props)...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/docs-tools/argTypes/convert/__testfixtures__/typescript/optionals.tsx
code/core/src/docs-tools/argTypes/convert/__testfixtures__/typescript/optionals.tsx
import type { FC } from 'react'; import React from 'react'; interface Props { any?: any; string?: string; bool?: boolean; number?: number; symbol?: symbol; readonly readonlyPrimitive?: string; } export const Component: FC<Props> = ({ any = 'foo', string = 'bar', bool = true, number = 4, ...rest }...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/docs-tools/argTypes/convert/__testfixtures__/typescript/interfaces.tsx
code/core/src/docs-tools/argTypes/convert/__testfixtures__/typescript/interfaces.tsx
import type { FC } from 'react'; import React from 'react'; interface ItemInterface { text: string; value: string; } interface GenericInterface<T> { value: T; } interface Props { interface: ItemInterface; genericInterface: GenericInterface<string>; } export const Component: FC<Props> = (props: Props) => <>JS...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/docs-tools/argTypes/convert/__testfixtures__/typescript/tuples.tsx
code/core/src/docs-tools/argTypes/convert/__testfixtures__/typescript/tuples.tsx
import type { FC } from 'react'; import React from 'react'; interface ItemInterface { text: string; value: string; } interface Props { tupleOfPrimitive: [string, number]; tupleWithComplexType: [string, ItemInterface]; } export const Component: FC<Props> = (props: Props) => <>JSON.stringify(props)</>;
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/docs-tools/argTypes/convert/__testfixtures__/typescript/scalars.tsx
code/core/src/docs-tools/argTypes/convert/__testfixtures__/typescript/scalars.tsx
import type { FC } from 'react'; import React from 'react'; interface Props { any: any; string: string; bool: boolean; number: number; symbol: symbol; readonly readonlyPrimitive: string; } export const Component: FC<Props> = (props: Props) => <>JSON.stringify(props)</>;
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/docs-tools/argTypes/convert/__testfixtures__/typescript/unions.tsx
code/core/src/docs-tools/argTypes/convert/__testfixtures__/typescript/unions.tsx
import type { FC } from 'react'; import React from 'react'; type Kind = 'default' | 'action'; enum DefaultEnum { TopLeft, TopRight, TopCenter, } enum NumericEnum { TopLeft = 0, TopRight, TopCenter, } type EnumUnion = DefaultEnum | NumericEnum; interface Props { kind?: Kind; inlinedNumericLiteralUnion: ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/component-testing/preview.ts
code/core/src/component-testing/preview.ts
import { definePreviewAddon } from 'storybook/internal/csf'; import { instrument } from 'storybook/internal/instrumenter'; import type { PlayFunction, StepLabel, StoryContext } from 'storybook/internal/types'; const { step } = instrument( { // It seems like the label is unused, but the instrumenter has access to...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/component-testing/manager.tsx
code/core/src/component-testing/manager.tsx
import React from 'react'; import { AddonPanel } from 'storybook/internal/components'; import { type Combo, Consumer, addons, types } from 'storybook/manager-api'; import { Panel } from './components/Panel'; import { PanelTitle } from './components/PanelTitle'; import { ADDON_ID, PANEL_ID } from './constants'; impor...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/component-testing/utils.ts
code/core/src/component-testing/utils.ts
import type { API_StoryEntry } from 'storybook/internal/types'; import Filter from 'ansi-to-html'; import { type StorybookTheme, useTheme } from 'storybook/theming'; // eslint-disable-next-line depend/ban-dependencies import stripAnsi from 'strip-ansi'; import { PARAM_KEY } from './constants'; export function isInte...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/component-testing/manager.test.tsx
code/core/src/component-testing/manager.test.tsx
import { describe, expect, it } from 'vitest'; import { PARAM_KEY } from './constants'; import type { InteractionsParameters } from './types'; import { isInteractionsDisabled } from './utils'; describe('Interactions Panel Disable Parameter', () => { it('should return true when interactions.disable is true', () => {...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/component-testing/constants.ts
code/core/src/component-testing/constants.ts
export const ADDON_ID = 'storybook/interactions'; export const PANEL_ID = `${ADDON_ID}/panel`; export const PARAM_KEY = 'interactions'; export const DOCUMENTATION_LINK = 'writing-tests/integrations/vitest-addon'; export const DOCUMENTATION_DISCREPANCY_LINK = `${DOCUMENTATION_LINK}#what-happens-when-there-are-different...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/component-testing/types.ts
code/core/src/component-testing/types.ts
export interface InteractionsParameters { /** * Interactions configuration * * @see https://storybook.js.org/docs/writing-tests/interaction-testing */ interactions?: { /** * Removes the addon panel and disables the feature's behavior. If you wish to turn off this * feature for the entire S...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/component-testing/mocks/index.ts
code/core/src/component-testing/mocks/index.ts
import { type Call, CallStates } from 'storybook/internal/instrumenter'; import { INTERNAL_RENDER_CALL_ID } from '../constants'; export const getCalls = (finalStatus: CallStates, slice?: number) => { let calls: Call[] = [ { id: INTERNAL_RENDER_CALL_ID, storyId: 'story--id', cursor: 0, an...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/component-testing/components/InteractionsPanel.stories.tsx
code/core/src/component-testing/components/InteractionsPanel.stories.tsx
import React from 'react'; import type { Meta, StoryObj } from '@storybook/react-vite'; import { ManagerContext } from 'storybook/manager-api'; import { expect, fn, userEvent, waitFor, within } from 'storybook/test'; import { styled } from 'storybook/theming'; import { isChromatic } from '../../../../.storybook/isCh...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/component-testing/components/Panel.tsx
code/core/src/component-testing/components/Panel.tsx
import type { Dispatch, SetStateAction } from 'react'; import React, { Fragment, memo, useEffect, useMemo, useRef, useState } from 'react'; import { FORCE_REMOUNT, PLAY_FUNCTION_THREW_EXCEPTION, STORY_RENDER_PHASE_CHANGED, STORY_THREW_EXCEPTION, UNHANDLED_ERRORS_WHILE_PLAYING, } from 'storybook/internal/core...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/component-testing/components/DetachedDebuggerMessage.tsx
code/core/src/component-testing/components/DetachedDebuggerMessage.tsx
import React from 'react'; import { Link } from 'storybook/internal/components'; import { styled } from 'storybook/theming'; import { PANEL_ID } from '../constants'; const Wrapper = styled.div(({ theme: { color, typography, background } }) => ({ textAlign: 'start', padding: '11px 15px', fontSize: `${typograph...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/component-testing/components/TestDiscrepancyMessage.tsx
code/core/src/component-testing/components/TestDiscrepancyMessage.tsx
import React from 'react'; import { Link } from 'storybook/internal/components'; import { useStorybookApi } from 'storybook/manager-api'; import { styled } from 'storybook/theming'; import { CallStates } from '../../instrumenter/types'; import { DOCUMENTATION_DISCREPANCY_LINK } from '../constants'; const Wrapper = ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false