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/renderers/vue3/src/public-types.test.ts
code/renderers/vue3/src/public-types.test.ts
// this file tests Typescript types that's why there are no assertions import { describe, it } from 'vitest'; import { satisfies } from 'storybook/internal/common'; import type { Canvas, ComponentAnnotations, StoryAnnotations } from 'storybook/internal/types'; import { expectTypeOf } from 'expect-type'; import type {...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/vue3/src/__tests__/composeStories/Button.stories.ts
code/renderers/vue3/src/__tests__/composeStories/Button.stories.ts
import { expect, fn, userEvent, within } from 'storybook/test'; import type { StoryFn as CSF2Story, Meta, StoryObj } from '../..'; import Button from './Button.vue'; const meta = { title: 'Example/Button', component: Button, argTypes: { size: { control: 'select', options: ['small', 'medium', 'large'] }, ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/vue3/src/__tests__/composeStories/portable-stories.test.ts
code/renderers/vue3/src/__tests__/composeStories/portable-stories.test.ts
// @vitest-environment happy-dom /// <reference types="@testing-library/jest-dom" />; import { cleanup, render, screen } from '@testing-library/vue'; import { afterEach, describe, expect, it, vi } from 'vitest'; import type { Meta } from '@storybook/vue3'; import { expectTypeOf } from 'expect-type'; import { addons }...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/vue3/src/docs/sourceDecorator.test.ts
code/renderers/vue3/src/docs/sourceDecorator.test.ts
import { expect, test } from 'vitest'; import { h } from 'vue'; import type { SourceCodeGeneratorContext } from './sourceDecorator'; import { generatePropsSourceCode, generateSlotSourceCode, generateSourceCode, getFunctionParamNames, parseDocgenInfo, } from './sourceDecorator'; test('should generate source...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/vue3/src/docs/sourceDecorator.ts
code/renderers/vue3/src/docs/sourceDecorator.ts
import { SourceType } from 'storybook/internal/docs-tools'; import { emitTransformCode, useEffect, useRef } from 'storybook/preview-api'; import type { VNode } from 'vue'; import { isVNode } from 'vue'; import type { Args, Decorator, StoryContext } from '../public-types'; /** * Context that is passed down to nested...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/vue3/src/docs/tests-meta-components/meta-components.ts
code/renderers/vue3/src/docs/tests-meta-components/meta-components.ts
import { TypeSystem } from 'storybook/internal/docs-tools'; import type { VueDocgenInfo } from '../../../../../frameworks/vue3-vite/src'; type TestComponent = { __docgenInfo: VueDocgenInfo<'vue-component-meta'> }; export const referenceTypeProps: TestComponent = { __docgenInfo: { type: 1, props: [ { ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
true
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/vue3/template/stories_vue3-vite-default-ts/ReactiveSlots.stories.ts
code/renderers/vue3/template/stories_vue3-vite-default-ts/ReactiveSlots.stories.ts
import { RESET_STORY_ARGS, STORY_ARGS_UPDATED, UPDATE_STORY_ARGS, } from 'storybook/internal/core-events'; import { global as globalThis } from '@storybook/global'; import type { Meta, StoryObj } from '@storybook/vue3'; import { expect, within } from 'storybook/test'; import { h } from 'vue'; import BaseLayout...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/vue3/template/stories_vue3-vite-default-ts/CustomRenderFunctionalComponent.stories.ts
code/renderers/vue3/template/stories_vue3-vite-default-ts/CustomRenderFunctionalComponent.stories.ts
import type { Meta } from '@storybook/vue3'; import { h } from 'vue'; import * as ReactiveDecorators from './ReactiveDecorators.stories'; import Reactivity from './Reactivity.vue'; const meta = { ...ReactiveDecorators.default, component: Reactivity, // storybook render function is not a functional component. i...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/vue3/template/stories_vue3-vite-default-ts/mount-in-play.stories.ts
code/renderers/vue3/template/stories_vue3-vite-default-ts/mount-in-play.stories.ts
import type { StoryObj } from '@storybook/vue3'; import { defineComponent } from 'vue'; const Button = defineComponent({ template: '<button :disabled="disabled">{{label}}</button>', props: ['disabled', 'label'], }); export default { component: Button, }; export const Basic: StoryObj<typeof Button> = { args:...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/vue3/template/stories_vue3-vite-default-ts/ReactiveArgs.stories.ts
code/renderers/vue3/template/stories_vue3-vite-default-ts/ReactiveArgs.stories.ts
import { RESET_STORY_ARGS, STORY_ARGS_UPDATED, UPDATE_STORY_ARGS, } from 'storybook/internal/core-events'; import type { Meta, StoryFn, StoryObj } from '@storybook/vue3'; import { expect, userEvent, within } from 'storybook/test'; import ReactiveArgs from './ReactiveArgs.vue'; const meta = { component: Reac...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/vue3/template/stories_vue3-vite-default-ts/preview.ts
code/renderers/vue3/template/stories_vue3-vite-default-ts/preview.ts
declare module 'vue' { interface ComponentCustomProperties { $greetingMessage: (key: string) => string; } } declare global { // eslint-disable-next-line no-var var Components: Record<string, any>; } export default {};
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/vue3/template/stories_vue3-vite-default-ts/GlobalSetup.stories.ts
code/renderers/vue3/template/stories_vue3-vite-default-ts/GlobalSetup.stories.ts
import type { Meta, StoryObj } from '@storybook/vue3'; import { expect, within } from 'storybook/test'; import { inject } from 'vue'; import GlobalSetup from './GlobalSetup.vue'; const meta: Meta = { component: GlobalSetup, argTypes: {}, render: (args: any) => ({ // Components used in your story `template`...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/vue3/template/stories_vue3-vite-default-ts/CustomRenderOptionsArgsFromData.stories.ts
code/renderers/vue3/template/stories_vue3-vite-default-ts/CustomRenderOptionsArgsFromData.stories.ts
import type { Meta } from '@storybook/vue3'; import { defineComponent, shallowReactive } from 'vue'; import * as ReactiveDecorators from './ReactiveDecorators.stories'; import Reactivity from './Reactivity.vue'; // when you use custom render, you can use any vue api to create your story and garanti reactivity, other...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/vue3/template/stories_vue3-vite-default-ts/SourceCode.stories.ts
code/renderers/vue3/template/stories_vue3-vite-default-ts/SourceCode.stories.ts
import type { Meta, StoryObj } from '@storybook/vue3'; import { h } from 'vue'; import SourceCode from './SourceCode.vue'; const meta: Meta<typeof SourceCode> = { component: SourceCode, tags: ['autodocs'], }; export default meta; type Story = StoryObj<typeof SourceCode>; export const Default = { args: { ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/vue3/template/stories_vue3-vite-default-ts/GlobalUsage.stories.ts
code/renderers/vue3/template/stories_vue3-vite-default-ts/GlobalUsage.stories.ts
import GlobalUsage from './GlobalUsage.vue'; export default { component: GlobalUsage, argTypes: {}, render: (args: any) => ({ // Components used in your story `template` are defined in the `components` object components: { GlobalUsage }, // The story's `args` need to be mapped into the template throu...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/vue3/template/stories_vue3-vite-default-ts/ScopedSlots.stories.ts
code/renderers/vue3/template/stories_vue3-vite-default-ts/ScopedSlots.stories.ts
import { RESET_STORY_ARGS, STORY_ARGS_UPDATED, UPDATE_STORY_ARGS, } from 'storybook/internal/core-events'; import { global as globalThis } from '@storybook/global'; import type { Meta, StoryObj } from '@storybook/vue3'; import { expect, within } from 'storybook/test'; import MySlotComponent from './MySlotCompo...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/vue3/template/stories_vue3-vite-default-ts/ReactiveDecorators.stories.ts
code/renderers/vue3/template/stories_vue3-vite-default-ts/ReactiveDecorators.stories.ts
import { RESET_STORY_ARGS, STORY_ARGS_UPDATED, UPDATE_STORY_ARGS, } from 'storybook/internal/core-events'; import { global as globalThis } from '@storybook/global'; import type { Meta, StoryObj } from '@storybook/vue3'; import { userEvent, within } from 'storybook/test'; import { h } from 'vue'; import Reactiv...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/vue3/template/stories_vue3-vite-default-ts/SourceDecorator.stories.ts
code/renderers/vue3/template/stories_vue3-vite-default-ts/SourceDecorator.stories.ts
import type { Meta, StoryObj } from '@storybook/vue3'; import GlobalSetup from './GlobalSetup.vue'; import GlobalUsage from './GlobalUsage.vue'; const meta: Meta = { component: GlobalUsage, argTypes: {}, tags: ['autodocs'], } satisfies Meta<typeof GlobalUsage>; export default meta; type Story = StoryObj<typeof...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/vue3/template/stories_vue3-vite-default-ts/decorators.stories.ts
code/renderers/vue3/template/stories_vue3-vite-default-ts/decorators.stories.ts
import type { DecoratorFunction } from 'storybook/internal/types'; import { global as globalThis } from '@storybook/global'; import type { Meta, StoryObj, VueRenderer } from '@storybook/vue3'; import { h } from 'vue'; const { Button, Pre } = (globalThis as any).__TEMPLATE_COMPONENTS__; const meta = { component: B...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/vue3/template/stories_vue3-vite-default-ts/component-meta/DefineSlots.stories.ts
code/renderers/vue3/template/stories_vue3-vite-default-ts/component-meta/DefineSlots.stories.ts
import type { Meta, StoryObj } from '@storybook/vue3'; import Component from './define-slots/component.vue'; const meta = { component: Component, tags: ['autodocs'], } satisfies Meta<typeof Component>; type Story = StoryObj<typeof meta>; export default meta; export const Default: Story = { args: { default...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/vue3/template/stories_vue3-vite-default-ts/component-meta/TsComponent.stories.ts
code/renderers/vue3/template/stories_vue3-vite-default-ts/component-meta/TsComponent.stories.ts
import type { Meta, StoryObj } from '@storybook/vue3'; import Component from './ts-component/component'; const meta = { component: Component, tags: ['autodocs'], } satisfies Meta<typeof Component>; type Story = StoryObj<typeof meta>; export default meta; export const Default: Story = { args: { foo: 'bar',...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/vue3/template/stories_vue3-vite-default-ts/component-meta/ReferenceTypeExposed.stories.ts
code/renderers/vue3/template/stories_vue3-vite-default-ts/component-meta/ReferenceTypeExposed.stories.ts
import type { Meta, StoryObj } from '@storybook/vue3'; import Component from './reference-type-exposed/component.vue'; const meta = { component: Component, tags: ['autodocs'], } satisfies Meta<typeof Component>; type Story = StoryObj<typeof meta>; export default meta; export const ReferenceTypeExposed: Story = ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/vue3/template/stories_vue3-vite-default-ts/component-meta/ReferenceTypeEvents.stories.ts
code/renderers/vue3/template/stories_vue3-vite-default-ts/component-meta/ReferenceTypeEvents.stories.ts
import type { Meta, StoryObj } from '@storybook/vue3'; import Component from './reference-type-events/component.vue'; const meta = { component: Component, tags: ['autodocs'], } satisfies Meta<typeof Component>; type Story = StoryObj<typeof meta>; export default meta; export const ReferenceTypeEvents: Story = {}...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/vue3/template/stories_vue3-vite-default-ts/component-meta/ReferenceTypeProps.stories.ts
code/renderers/vue3/template/stories_vue3-vite-default-ts/component-meta/ReferenceTypeProps.stories.ts
import type { Meta, StoryObj } from '@storybook/vue3'; import Component from './reference-type-props/component.vue'; const meta = { component: Component, tags: ['autodocs'], } satisfies Meta<typeof Component>; type Story = StoryObj<typeof meta>; export default meta; enum MyEnum { Small, Medium, Large, } ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/vue3/template/stories_vue3-vite-default-ts/component-meta/TemplateSlots.stories.ts
code/renderers/vue3/template/stories_vue3-vite-default-ts/component-meta/TemplateSlots.stories.ts
import type { Meta, StoryObj } from '@storybook/vue3'; import { h } from 'vue'; import Component from './template-slots/component.vue'; const meta = { component: Component, tags: ['autodocs'], } satisfies Meta<typeof Component>; type Story = StoryObj<typeof meta>; export default meta; export const Default: Sto...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/vue3/template/stories_vue3-vite-default-ts/component-meta/TsNameExport.stories.ts
code/renderers/vue3/template/stories_vue3-vite-default-ts/component-meta/TsNameExport.stories.ts
import type { Meta, StoryObj } from '@storybook/vue3'; import { ComponentA } from './ts-named-export/component'; const meta = { component: ComponentA, tags: ['autodocs'], } satisfies Meta<typeof ComponentA>; type Story = StoryObj<typeof meta>; export default meta; export const Default: Story = { args: { s...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/vue3/template/stories_vue3-vite-default-ts/component-meta/DefineModel.stories.ts
code/renderers/vue3/template/stories_vue3-vite-default-ts/component-meta/DefineModel.stories.ts
import type { Meta, StoryObj } from '@storybook/vue3'; import Component from './define-model/component.vue'; const meta = { component: Component, tags: ['autodocs'], } satisfies Meta<typeof Component>; type Story = StoryObj<typeof meta>; export default meta; export const Default: Story = { args: { modelVa...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/vue3/template/stories_vue3-vite-default-ts/component-meta/OptionApi.stories.ts
code/renderers/vue3/template/stories_vue3-vite-default-ts/component-meta/OptionApi.stories.ts
import type { Meta, StoryObj } from '@storybook/vue3'; import Component from './options-api/component'; const meta = { component: Component, tags: ['autodocs'], } satisfies Meta<typeof Component>; type Story = StoryObj<typeof meta>; export default meta; export const Default: Story = { args: { numberDefaul...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/vue3/template/stories_vue3-vite-default-ts/component-meta/ts-named-export/component.ts
code/renderers/vue3/template/stories_vue3-vite-default-ts/component-meta/ts-named-export/component.ts
import type { PropType } from 'vue'; import { defineComponent, h } from 'vue'; export const ComponentA = defineComponent({ name: 'MyCompo1', props: { /** * This is a description of the prop * * @defaultValue 'medium' * @values 'small', 'medium', 'large' * @control select * @group ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/vue3/template/stories_vue3-vite-default-ts/component-meta/options-api/component.ts
code/renderers/vue3/template/stories_vue3-vite-default-ts/component-meta/options-api/component.ts
import { defineComponent, h } from 'vue'; interface SubmitPayload { /** Email of user */ email: string; /** Password of same user */ password: string; } export default defineComponent({ emits: { // Validate submit event submit: ({ email, password }: SubmitPayload) => { if (email && password) {...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/vue3/template/stories_vue3-vite-default-ts/component-meta/ts-component/component.ts
code/renderers/vue3/template/stories_vue3-vite-default-ts/component-meta/ts-component/component.ts
import { defineComponent, h } from 'vue'; export default defineComponent({ props: { /** String foo */ foo: { type: String, required: true, }, /** Optional number bar */ bar: { type: Number, }, }, setup(props) { return () => h('pre', JSON.stringify(props, null, 2)); ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/vue3/template/stories_vue3-vite-default-ts/component-meta/reference-type-props/my-props.ts
code/renderers/vue3/template/stories_vue3-vite-default-ts/component-meta/reference-type-props/my-props.ts
export interface MyNestedProps { /** Nested prop documentation */ nestedProp: string; } export interface MyIgnoredNestedProps { nestedProp: string; } export interface MyNestedRecursiveProps { recursive: MyNestedRecursiveProps; } enum MyEnum { Small, Medium, Large, } const categories = [ 'Uncategoriz...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/vue3/template/cli/ts/Button.stories.ts
code/renderers/vue3/template/cli/ts/Button.stories.ts
import type { Meta, StoryObj } from '@storybook/vue3'; import { fn } from 'storybook/test'; import Button from './Button.vue'; // More on how to set up stories at: https://storybook.js.org/docs/writing-stories const meta = { title: 'Example/Button', component: Button, // This component will have an automatical...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/vue3/template/cli/ts/Page.stories.ts
code/renderers/vue3/template/cli/ts/Page.stories.ts
import type { Meta, StoryObj } from '@storybook/vue3'; import { expect, userEvent, within } from 'storybook/test'; import MyPage from './Page.vue'; const meta = { title: 'Example/Page', component: MyPage, render: () => ({ components: { MyPage }, template: '<my-page />', }), parameters: { // Mor...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/vue3/template/cli/ts/Header.stories.ts
code/renderers/vue3/template/cli/ts/Header.stories.ts
import type { Meta, StoryObj } from '@storybook/vue3'; import { fn } from 'storybook/test'; import MyHeader from './Header.vue'; const meta = { /* 👇 The title prop is optional. * See https://storybook.js.org/docs/configure/#configure-story-loading * to learn how to generate automatic titles */ title: '...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/web-components/vitest.config.ts
code/renderers/web-components/vitest.config.ts
import { defineConfig, mergeConfig } from 'vitest/config'; import { vitestCommonConfig } from '../../vitest.shared'; export default mergeConfig( vitestCommonConfig, defineConfig({ // Add custom config here }) );
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/web-components/build-config.ts
code/renderers/web-components/build-config.ts
import type { BuildEntries } from '../../../scripts/build/utils/entry-utils'; const config: BuildEntries = { entries: { browser: [ { exportEntries: ['.'], entryPoint: './src/index.ts', }, { exportEntries: ['./entry-preview'], entryPoint: './src/entry-preview.ts',...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/web-components/src/public-types.ts
code/renderers/web-components/src/public-types.ts
import type { AnnotatedStoryFn, Args, ComponentAnnotations, DecoratorFunction, StoryContext as GenericStoryContext, LoaderFunction, ProjectAnnotations, StoryAnnotations, StrictArgs, } from 'storybook/internal/types'; import type { WebComponentsRenderer } from './types'; export type { Args, ArgTypes,...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/web-components/src/render.ts
code/renderers/web-components/src/render.ts
/* eslint-disable @typescript-eslint/ban-ts-comment */ import type { ArgsStoryFn, RenderContext } from 'storybook/internal/types'; import { global } from '@storybook/global'; import { render as litRender } from 'lit'; // Keep `.js` extension to avoid issue with Webpack (related to export map?) import { isTemplateResu...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/web-components/src/framework-api.ts
code/renderers/web-components/src/framework-api.ts
import { global } from '@storybook/global'; export function isValidComponent(tagName: string) { if (!tagName) { return false; } if (typeof tagName === 'string') { return true; } throw new Error('Provided component needs to be a string. e.g. component: "my-element"'); } export function isValidMetaDat...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/web-components/src/entry-preview-argtypes.ts
code/renderers/web-components/src/entry-preview-argtypes.ts
import { enhanceArgTypes } from 'storybook/internal/docs-tools'; import type { ArgTypesEnhancer } from 'storybook/internal/types'; import { extractArgTypes, extractComponentDescription } from './docs/custom-elements'; import type { WebComponentsRenderer } from './types'; export const parameters = { docs: { extr...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/web-components/src/entry-preview.ts
code/renderers/web-components/src/entry-preview.ts
export { render, renderToCanvas } from './render'; export const parameters = { renderer: 'web-components', };
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/web-components/src/typings.d.ts
code/renderers/web-components/src/typings.d.ts
declare var STORYBOOK_ENV: 'web-components'; declare var __STORYBOOK_CUSTOM_ELEMENTS_MANIFEST__: any; declare var __STORYBOOK_CUSTOM_ELEMENTS__: any; declare var LOGLEVEL: 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'silent' | undefined;
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/web-components/src/entry-preview-docs.ts
code/renderers/web-components/src/entry-preview-docs.ts
import { SourceType } from 'storybook/internal/docs-tools'; import type { DecoratorFunction } from 'storybook/internal/types'; import { sourceDecorator } from './docs/sourceDecorator'; import type { WebComponentsRenderer } from './types'; export const decorators: DecoratorFunction<WebComponentsRenderer>[] = [sourceDe...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/web-components/src/preset.ts
code/renderers/web-components/src/preset.ts
import { fileURLToPath } from 'node:url'; import type { PresetProperty } from 'storybook/internal/types'; export const previewAnnotations: PresetProperty<'previewAnnotations'> = async ( input = [], options ) => { const docsEnabled = Object.keys(await options.presets.apply('docs', {}, options)).length > 0; con...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/web-components/src/types.ts
code/renderers/web-components/src/types.ts
import type { StoryContext as StoryContextBase, WebRenderer } from 'storybook/internal/types'; import type { SVGTemplateResult, TemplateResult } from 'lit'; export type StoryFnHtmlReturnType = | string | Node | DocumentFragment | TemplateResult | SVGTemplateResult; export type StoryContext = StoryContextBa...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/web-components/src/portable-stories.ts
code/renderers/web-components/src/portable-stories.ts
import type { NamedOrDefaultProjectAnnotations, NormalizedProjectAnnotations, } from 'storybook/internal/types'; import { setProjectAnnotations as originalSetProjectAnnotations, setDefaultProjectAnnotations, } from 'storybook/preview-api'; import * as webComponentsAnnotations from './entry-preview'; import ty...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/web-components/src/index.ts
code/renderers/web-components/src/index.ts
import { global } from '@storybook/global'; import './globals'; const { window, EventSource } = global; export * from './public-types'; export * from './framework-api'; export * from './portable-stories'; // TODO: disable HMR and do full page loads because of customElements.define // eslint-disable-next-line @types...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/web-components/src/globals.ts
code/renderers/web-components/src/globals.ts
import { global } from '@storybook/global'; const { window: globalWindow } = global; globalWindow.STORYBOOK_ENV = 'web-components';
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/web-components/src/docs/web-components-properties.test.ts
code/renderers/web-components/src/docs/web-components-properties.test.ts
// @vitest-environment happy-dom import { readdirSync } from 'node:fs'; import { readFile, readdir } from 'node:fs/promises'; import { join } from 'node:path'; import { describe, expect, it, vi } from 'vitest'; import { spawn } from 'cross-spawn'; import tmp from 'tmp'; import { extractArgTypesFromElements } from '....
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/web-components/src/docs/sourceDecorator.test.ts
code/renderers/web-components/src/docs/sourceDecorator.test.ts
/** @vitest-environment happy-dom */ import { beforeEach, describe, expect, it, vi } from 'vitest'; import { SourceType } from 'storybook/internal/docs-tools'; import { render } from 'lit'; import { addons, emitTransformCode, useEffect, useRef } from 'storybook/preview-api'; import { sourceDecorator } from './source...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/web-components/src/docs/custom-elements.ts
code/renderers/web-components/src/docs/custom-elements.ts
import { logger } from 'storybook/internal/client-logger'; import type { ArgTypes, InputType } from 'storybook/internal/types'; import invariant from 'tiny-invariant'; import { getCustomElements, isValidComponent, isValidMetaData } from '..'; interface TagItem { name: string; type: { [key: string]: any }; desc...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/web-components/src/docs/sourceDecorator.ts
code/renderers/web-components/src/docs/sourceDecorator.ts
import { SourceType } from 'storybook/internal/docs-tools'; import type { ArgsStoryFn, PartialStoryFn, StoryContext } from 'storybook/internal/types'; import { render } from 'lit'; import { emitTransformCode, useEffect } from 'storybook/preview-api'; import type { WebComponentsRenderer } from '../types'; // Taken fr...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/web-components/src/docs/custom-elements.test.ts
code/renderers/web-components/src/docs/custom-elements.test.ts
// @vitest-environment happy-dom import { afterEach, beforeEach, describe, expect, it } from 'vitest'; import { global } from '@storybook/global'; import customElementsManifest from './__testfixtures__/custom-elements.json'; import { extractArgTypes } from './custom-elements'; const { window } = global; describe('e...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/web-components/template/cli/ts/Button.stories.ts
code/renderers/web-components/template/cli/ts/Button.stories.ts
import type { Meta, StoryObj } from '@storybook/web-components'; import { fn } from 'storybook/test'; import type { ButtonProps } from './Button'; import { Button } from './Button'; // More on how to set up stories at: https://storybook.js.org/docs/writing-stories const meta = { title: 'Example/Button', tags: ['...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/web-components/template/cli/ts/Page.stories.ts
code/renderers/web-components/template/cli/ts/Page.stories.ts
import type { Meta, StoryObj } from '@storybook/web-components'; import * as HeaderStories from './Header.stories'; import type { PageProps } from './Page'; import { Page } from './Page'; const meta = { title: 'Example/Page', render: (args: PageProps) => Page(args), } satisfies Meta<PageProps>; export default me...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/web-components/template/cli/ts/Header.ts
code/renderers/web-components/template/cli/ts/Header.ts
import { html } from 'lit'; import { Button } from './Button'; import './header.css'; type User = { name: string; }; export interface HeaderProps { user?: User; onLogin?: () => void; onLogout?: () => void; onCreateAccount?: () => void; } export const Header = ({ user, onLogin, onLogout, onCreateAccount }:...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/web-components/template/cli/ts/Button.ts
code/renderers/web-components/template/cli/ts/Button.ts
import { html } from 'lit'; import { styleMap } from 'lit/directives/style-map.js'; import './button.css'; export interface ButtonProps { /** Is this the principal call to action on the page? */ primary?: boolean; /** What background color to use */ backgroundColor?: string; /** How large should the button ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/web-components/template/cli/ts/Header.stories.ts
code/renderers/web-components/template/cli/ts/Header.stories.ts
import type { Meta, StoryObj } from '@storybook/web-components'; import { fn } from 'storybook/test'; import type { HeaderProps } from './Header'; import { Header } from './Header'; const meta = { title: 'Example/Header', // This component will have an automatically generated Autodocs entry: https://storybook.js...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/web-components/template/cli/ts/Page.ts
code/renderers/web-components/template/cli/ts/Page.ts
import { html } from 'lit'; import { Header } from './Header'; import './page.css'; type User = { name: string; }; export interface PageProps { user?: User; onLogin?: () => void; onLogout?: () => void; onCreateAccount?: () => void; } export const Page = ({ user, onLogin, onLogout, onCreateAccount }: PageP...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/react/vitest.config.ts
code/renderers/react/vitest.config.ts
import { defineConfig, mergeConfig } from 'vitest/config'; import { vitestCommonConfig } from '../../vitest.shared'; export default mergeConfig( vitestCommonConfig, defineConfig({ test: { setupFiles: ['./vitest.setup.ts'], }, }) );
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/react/vitest.setup.ts
code/renderers/react/vitest.setup.ts
import { beforeEach, vi } from 'vitest'; import { type JsPackageManager, JsPackageManagerFactory } from 'storybook/internal/common'; import { vol } from 'memfs'; import { loadConfig } from 'tsconfig-paths'; import { cachedFindUp, cachedResolveImport, invalidateCache } from './src/componentManifest/utils'; vi.mock('...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/react/build-config.ts
code/renderers/react/build-config.ts
import type { BuildEntries } from '../../../scripts/build/utils/entry-utils'; const config: BuildEntries = { entries: { browser: [ { exportEntries: ['.'], entryPoint: './src/index.ts', }, { exportEntries: ['./preview'], entryPoint: './src/preview.tsx', }, ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/react/src/public-types.ts
code/renderers/react/src/public-types.ts
import type { ComponentProps, ComponentType } from 'react'; import type { AnnotatedStoryFn, Args, ArgsFromMeta, ArgsStoryFn, ComponentAnnotations, DecoratorFunction, StoryContext as GenericStoryContext, LoaderFunction, ProjectAnnotations, StoryAnnotations, StrictArgs, } from 'storybook/internal/t...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/react/src/mount.ts
code/renderers/react/src/mount.ts
import type { BaseAnnotations } from 'storybook/internal/types'; import { type ReactRenderer, type StoryContext } from './public-types'; export const mount: BaseAnnotations<ReactRenderer>['mount'] = (context: StoryContext) => async (ui) => { if (ui != null) { context.originalStoryFn = () => ui; } ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/react/src/entry-preview-argtypes.ts
code/renderers/react/src/entry-preview-argtypes.ts
import { enhanceArgTypes, extractComponentDescription } from 'storybook/internal/docs-tools'; import type { ArgTypesEnhancer } from 'storybook/internal/types'; import { extractArgTypes } from './extractArgTypes'; import type { ReactRenderer } from './types'; export const parameters = { docs: { extractArgTypes, ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/react/src/entry-preview.tsx
code/renderers/react/src/entry-preview.tsx
import * as React from 'react'; import { global } from '@storybook/global'; import { configure } from 'storybook/test'; import { getAct, getReactActEnvironment, setReactActEnvironment } from './act-compat'; import type { Decorator } from './public-types'; export { render } from './render'; export { renderToCanvas }...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/react/src/preview.tsx
code/renderers/react/src/preview.tsx
import type { ComponentType } from 'react'; import { definePreview as definePreviewBase } from 'storybook/internal/csf'; import type { AddonTypes, InferTypes, Meta, Preview, Story } from 'storybook/internal/csf'; import type { PreviewAddon } from 'storybook/internal/csf'; import type { Args, ArgsStoryFn, Compone...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/react/src/typings.d.ts
code/renderers/react/src/typings.d.ts
declare var STORYBOOK_ENV: 'react'; declare var FRAMEWORK_OPTIONS: any; declare var LOGLEVEL: 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'silent' | undefined; declare var FEATURES: import('storybook/internal/types').StorybookConfigRaw['features'];
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/react/src/act-compat.ts
code/renderers/react/src/act-compat.ts
// Copied from // https://github.com/testing-library/react-testing-library/blob/3dcd8a9649e25054c0e650d95fca2317b7008576/src/act-compat.js import * as React from 'react'; declare const globalThis: { IS_REACT_ACT_ENVIRONMENT: boolean; }; // We need to spread React to avoid // export 'act' (imported as 'React4') was ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/react/src/playwright.ts
code/renderers/react/src/playwright.ts
export { createPlaywrightTest as createTest } from 'storybook/preview-api';
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/react/src/enrichCsf.test.ts
code/renderers/react/src/enrichCsf.test.ts
import { expect, test, vi } from 'vitest'; import { generate } from 'storybook/internal/babel'; import { type InterPresetOptions, getPresets } from 'storybook/internal/common'; import { loadCsf } from 'storybook/internal/csf-tools'; import { dedent } from 'ts-dedent'; import { enrichCsf } from './enrichCsf'; vi.moc...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/react/src/entry-preview-docs.ts
code/renderers/react/src/entry-preview-docs.ts
import type { DecoratorFunction } from 'storybook/internal/types'; import { jsxDecorator } from './docs/jsxDecorator'; import type { ReactRenderer } from './types'; export const decorators: DecoratorFunction<ReactRenderer>[] = 'FEATURES' in globalThis && globalThis?.FEATURES?.experimentalCodeExamples ? [] : [jsxDec...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/react/src/portable-stories.tsx
code/renderers/react/src/portable-stories.tsx
import * as React from 'react'; import type { Args, ComposedStoryFn, NamedOrDefaultProjectAnnotations, NormalizedProjectAnnotations, ProjectAnnotations, Store_CSFExports, StoriesWithPartialProps, StoryAnnotationsOrFn, } from 'storybook/internal/types'; import { composeConfigs, composeStories as or...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/react/src/extractArgTypes.test.ts
code/renderers/react/src/extractArgTypes.test.ts
import { join, resolve } from 'node:path'; import { describe, expect, it, vi } from 'vitest'; import { normalizeNewlines } from 'storybook/internal/docs-tools'; import type { Renderer } from 'storybook/internal/types'; import { transformFileSync, transformSync } from '@babel/core'; // @ts-expect-error (seems broken/...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/react/src/entry-preview-rsc.tsx
code/renderers/react/src/entry-preview-rsc.tsx
export const parameters = { react: { rsc: true, }, };
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/react/src/extractProps.ts
code/renderers/react/src/extractProps.ts
import { type PropDef, TypeSystem, extractComponentProps, hasDocgen, } from 'storybook/internal/docs-tools'; import { isMemo } from './docs/lib/componentTypes'; import { enhancePropTypesProps } from './docs/propTypes/handleProp'; import { enhanceTypeScriptProps } from './docs/typeScript/handleProp'; // FIXME ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/react/src/preset.ts
code/renderers/react/src/preset.ts
import { fileURLToPath } from 'node:url'; import type { PresetProperty } from 'storybook/internal/types'; import { resolvePackageDir } from '../../../core/src/shared/utils/module'; export const addons: PresetProperty<'addons'> = [ import.meta.resolve('@storybook/react-dom-shim/preset'), ]; export { manifests as e...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/react/src/public-types.test.tsx
code/renderers/react/src/public-types.test.tsx
// @vitest-environment happy-dom // this file tests Typescript types that's why there are no assertions import { describe, it } from 'vitest'; import type { KeyboardEventHandler, ReactElement, ReactNode } from 'react'; import React from 'react'; import { satisfies } from 'storybook/internal/common'; import type { Can...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/react/src/renderToCanvas.tsx
code/renderers/react/src/renderToCanvas.tsx
import type { FC } from 'react'; import React, { Fragment, Component as ReactComponent, StrictMode } from 'react'; import type { RenderContext } from 'storybook/internal/types'; import { global } from '@storybook/global'; import { getAct } from './act-compat'; import type { ReactRenderer, StoryContext } from './type...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/react/src/types.ts
code/renderers/react/src/types.ts
import type { ComponentType, JSX } from 'react'; import type { RootOptions } from 'react-dom/client'; import type { Canvas, WebRenderer } from 'storybook/internal/types'; export type { RenderContext, StoryContext } from 'storybook/internal/types'; export interface ReactRenderer extends WebRenderer { component: Com...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/react/src/index.ts
code/renderers/react/src/index.ts
import './globals'; export * from './public-types'; export * from './portable-stories'; export * from './preview'; export type { ReactTypes } from './types';
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/react/src/globals.ts
code/renderers/react/src/globals.ts
import { global } from '@storybook/global'; const { window: globalWindow } = global; if (globalWindow) { globalWindow.STORYBOOK_ENV = 'react'; }
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/react/src/extractArgTypes.ts
code/renderers/react/src/extractArgTypes.ts
import type { ArgTypesExtractor, PropDef } from 'storybook/internal/docs-tools'; import type { StrictArgTypes } from 'storybook/internal/types'; import { extractProps } from './extractProps'; export const extractArgTypes: ArgTypesExtractor = (component): StrictArgTypes | null => { if (component) { const { rows ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/react/src/applyDecorators.ts
code/renderers/react/src/applyDecorators.ts
import React from 'react'; import type { DecoratorFunction, LegacyStoryFn } from 'storybook/internal/types'; import { defaultDecorateStory } from 'storybook/preview-api'; import type { ReactRenderer } from './types'; export const applyDecorators = ( storyFn: LegacyStoryFn<ReactRenderer>, decorators: DecoratorFu...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/react/src/enrichCsf.ts
code/renderers/react/src/enrichCsf.ts
import { type NodePath, recast, types as t } from 'storybook/internal/babel'; import { getPrettier } from 'storybook/internal/common'; import { type CsfFile } from 'storybook/internal/csf-tools'; import type { PresetPropertyFn } from 'storybook/internal/types'; import { join } from 'pathe'; import { getCodeSnippet } ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/react/src/csf-factories.test.tsx
code/renderers/react/src/csf-factories.test.tsx
// @vitest-environment happy-dom // this file tests Typescript types that's why there are no assertions import { describe, it } from 'vitest'; import { expect, test } from 'vitest'; import type { ComponentType, KeyboardEventHandler, ReactElement, ReactNode } from 'react'; import React from 'react'; import type { Canv...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/react/src/render.tsx
code/renderers/react/src/render.tsx
import React from 'react'; import type { ArgsStoryFn } from 'storybook/internal/types'; import type { ReactRenderer } from './types'; export const render: ArgsStoryFn<ReactRenderer> = (args, context) => { const { id, component: Component } = context; if (!Component) { throw new Error( `Unable to render...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/react/src/__test__/ComponentWithError.stories.tsx
code/renderers/react/src/__test__/ComponentWithError.stories.tsx
import type { Meta, StoryObj } from '..'; import { ComponentWithError } from './ComponentWithError'; const meta = { title: 'Example/ComponentWithError', component: ComponentWithError as any, } satisfies Meta<typeof ComponentWithError>; export default meta; type Story = StoryObj<typeof meta>; export const Throws...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/react/src/__test__/portable-stories-legacy.test.tsx
code/renderers/react/src/__test__/portable-stories-legacy.test.tsx
// @vitest-environment happy-dom import { cleanup, render, screen } from '@testing-library/react'; import { afterEach, describe, expect, it, vi } from 'vitest'; import React from 'react'; import type { Meta } from '@storybook/react'; import { expectTypeOf } from 'expect-type'; import { addons } from 'storybook/previ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/react/src/__test__/portable-stories.test.tsx
code/renderers/react/src/__test__/portable-stories.test.tsx
// @vitest-environment happy-dom import { cleanup, render, screen } from '@testing-library/react'; import { afterEach, beforeAll, describe, expect, it, vi } from 'vitest'; import React from 'react'; import type { Meta } from '@storybook/react'; import { expectTypeOf } from 'expect-type'; import { addons } from 'stor...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/react/src/__test__/ComponentWithError.tsx
code/renderers/react/src/__test__/ComponentWithError.tsx
export function ComponentWithError() { // eslint-disable-next-line local-rules/no-uncategorized-errors throw new Error('Error in render'); }
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/react/src/__test__/Button.stories.tsx
code/renderers/react/src/__test__/Button.stories.tsx
import React, { useEffect, useState } from 'react'; import { createPortal } from 'react-dom'; import { action } from 'storybook/actions'; import type { HandlerFunction } from 'storybook/actions'; import { expect, fn, mocked, userEvent, within } from 'storybook/test'; import type { StoryFn as CSF2Story, StoryObj as CS...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/react/src/__test__/portable-stories-factory.test.tsx
code/renderers/react/src/__test__/portable-stories-factory.test.tsx
// @vitest-environment happy-dom import { cleanup, render, screen } from '@testing-library/react'; import { afterEach, describe, expect, it, vi } from 'vitest'; import React from 'react'; import { CSF2StoryWithLocale, CSF3Button, CSF3ButtonWithRender, CSF3InputFieldFilled, CSF3Primary, MountInPlayFunction...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/react/src/__test__/Button.tsx
code/renderers/react/src/__test__/Button.tsx
import React from 'react'; import './button.css'; export interface ButtonProps { /** Is this the principal call to action on the page? */ primary?: boolean; /** What background color to use */ backgroundColor?: string; /** How large should the button be? */ size?: 'small' | 'medium' | 'large'; /** Butto...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/react/src/__test__/Button.csf4.stories.tsx
code/renderers/react/src/__test__/Button.csf4.stories.tsx
import React, { useEffect, useState } from 'react'; import { createPortal } from 'react-dom'; import { action } from 'storybook/actions'; import { expect, fn, mocked, userEvent, within } from 'storybook/test'; import { __definePreview } from '../preview'; import { Button } from './Button'; const preview = __definePr...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/react/src/componentManifest/generateCodeSnippet.test.tsx
code/renderers/react/src/componentManifest/generateCodeSnippet.test.tsx
import { expect, test } from 'vitest'; import { recast, types as t } from 'storybook/internal/babel'; import { loadCsf } from 'storybook/internal/csf-tools'; import { dedent } from 'ts-dedent'; import { getCodeSnippet } from './generateCodeSnippet'; function generateExample(code: string) { const csf = loadCsf(cod...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/react/src/componentManifest/jsdocTags.ts
code/renderers/react/src/componentManifest/jsdocTags.ts
import { parse } from 'comment-parser'; import { groupBy } from './utils'; export function extractJSDocInfo(jsdocComment: string) { const lines = jsdocComment.split('\n'); const jsDoc = ['/**', ...lines.map((line) => ` * ${line}`), ' */'].join('\n'); const parsed = parse(jsDoc); return { description: pa...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/react/src/componentManifest/getComponentImports.ts
code/renderers/react/src/componentManifest/getComponentImports.ts
import { dirname } from 'node:path'; import { type NodePath, babelParse, recast, types as t } from 'storybook/internal/babel'; import { type CsfFile } from 'storybook/internal/csf-tools'; import { logger } from 'storybook/internal/node-logger'; import { getImportTag, getReactDocgen, matchPath } from './reactDocgen'; ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/react/src/componentManifest/reactDocgen.test.ts
code/renderers/react/src/componentManifest/reactDocgen.test.ts
import { describe, expect, test } from 'vitest'; import { dedent } from 'ts-dedent'; import { parseWithReactDocgen } from './reactDocgen'; async function parse(code: string, name = 'Component.tsx') { const filename = `/virtual/${name}`; return parseWithReactDocgen(code, filename); } describe('parseWithReactDocg...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false