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/components/components/typography/elements/H6.tsx
code/core/src/components/components/typography/elements/H6.tsx
import { styled } from 'storybook/theming'; import { headerCommon, withReset } from '../lib/common'; export const H6 = styled.h6(withReset, headerCommon, ({ theme }) => ({ fontSize: `${theme.typography.size.s2}px`, color: theme.color.dark, }));
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/typography/elements/Blockquote.tsx
code/core/src/components/components/typography/elements/Blockquote.tsx
import { styled } from 'storybook/theming'; import { withMargin, withReset } from '../lib/common'; export const Blockquote = styled.blockquote(withReset, withMargin, ({ theme }) => ({ borderLeft: `4px solid ${theme.color.medium}`, padding: '0 15px', color: theme.color.dark, '& > :first-of-type': { marginT...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/typography/elements/Pre.tsx
code/core/src/components/components/typography/elements/Pre.tsx
import { styled } from 'storybook/theming'; import { withMargin, withReset } from '../lib/common'; export const Pre = styled.pre(withReset, withMargin, ({ theme }) => ({ // reset fontFamily: theme.typography.fonts.mono, WebkitFontSmoothing: 'antialiased', MozOsxFontSmoothing: 'grayscale', lineHeight: '18px'...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/typography/elements/A.tsx
code/core/src/components/components/typography/elements/A.tsx
import { styled } from 'storybook/theming'; import { withReset } from '../lib/common'; import { Link } from './Link'; export const A = styled(Link)(withReset, ({ theme }) => ({ fontSize: 'inherit', lineHeight: '24px', color: theme.color.secondary, textDecoration: 'none', '&.absent': { color: '#cc0000',...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/typography/elements/OL.tsx
code/core/src/components/components/typography/elements/OL.tsx
import type { Interpolation } from 'storybook/theming'; import { styled } from 'storybook/theming'; import { withMargin, withReset } from '../lib/common'; const listCommon: Interpolation = { paddingLeft: 30, '& :first-of-type': { marginTop: 0, }, '& :last-child': { marginBottom: 0, }, }; export con...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/typography/elements/Link.tsx
code/core/src/components/components/typography/elements/Link.tsx
import React from 'react'; export const Link = ({ href: input = '', ...props }: React.AnchorHTMLAttributes<HTMLAnchorElement>) => { const isStorybookPath = /^\//.test(input); const href = isStorybookPath ? `./?path=${input}` : input; const isAnchorUrl = /^#.*/.test(input); const target = isAnchorUrl ? '_s...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/typography/elements/TT.tsx
code/core/src/components/components/typography/elements/TT.tsx
import { styled } from 'storybook/theming'; import { codeCommon } from '../lib/common'; export const TT = styled.title(codeCommon);
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/typography/elements/H5.tsx
code/core/src/components/components/typography/elements/H5.tsx
import { styled } from 'storybook/theming'; import { headerCommon, withReset } from '../lib/common'; export const H5 = styled.h5(withReset, headerCommon, ({ theme }) => ({ fontSize: `${theme.typography.size.s2}px`, }));
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/typography/elements/H3.tsx
code/core/src/components/components/typography/elements/H3.tsx
import { styled } from 'storybook/theming'; import { headerCommon, withReset } from '../lib/common'; export const H3 = styled.h3(withReset, headerCommon, ({ theme }) => ({ fontSize: `${theme.typography.size.m1}px`, }));
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/typography/elements/Code.tsx
code/core/src/components/components/typography/elements/Code.tsx
import type { ComponentProps } from 'react'; import React, { Children } from 'react'; import { styled } from 'storybook/theming'; import { SyntaxHighlighter } from '../../syntaxhighlighter/lazy-syntaxhighlighter'; import type { SupportedLanguage } from '../../syntaxhighlighter/syntaxhighlighter-types'; import { codeC...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/typography/elements/Div.tsx
code/core/src/components/components/typography/elements/Div.tsx
import { styled } from 'storybook/theming'; import { withReset } from '../lib/common'; export const Div = styled.div(withReset);
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/typography/elements/Table.tsx
code/core/src/components/components/typography/elements/Table.tsx
import { styled } from 'storybook/theming'; import { withMargin, withReset } from '../lib/common'; export const Table = styled.table(withReset, withMargin, ({ theme }) => ({ fontSize: theme.typography.size.s2, lineHeight: '24px', padding: 0, borderCollapse: 'collapse', '& tr': { borderTop: `1px solid ${...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/typography/elements/LI.tsx
code/core/src/components/components/typography/elements/LI.tsx
import type { CSSObject } from 'storybook/theming'; import { styled } from 'storybook/theming'; import { codeCommon, withReset } from '../lib/common'; export const LI = styled.li(withReset, ({ theme }) => ({ fontSize: theme.typography.size.s2, color: theme.color.defaultText, lineHeight: '24px', '& + li': { ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/typography/elements/H2.tsx
code/core/src/components/components/typography/elements/H2.tsx
import { styled } from 'storybook/theming'; import { headerCommon, withReset } from '../lib/common'; export const H2 = styled.h2(withReset, headerCommon, ({ theme }) => ({ fontSize: `${theme.typography.size.m2}px`, paddingBottom: 4, borderBottom: `1px solid ${theme.appBorderColor}`, }));
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/typography/elements/H4.tsx
code/core/src/components/components/typography/elements/H4.tsx
import { styled } from 'storybook/theming'; import { headerCommon, withReset } from '../lib/common'; export const H4 = styled.h4(withReset, headerCommon, ({ theme }) => ({ fontSize: `${theme.typography.size.s3}px`, }));
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/typography/elements/P.tsx
code/core/src/components/components/typography/elements/P.tsx
import type { CSSObject } from 'storybook/theming'; import { styled } from 'storybook/theming'; import { codeCommon, withMargin, withReset } from '../lib/common'; export const P = styled.p(withReset, withMargin, ({ theme }) => ({ fontSize: theme.typography.size.s2, lineHeight: '24px', color: theme.color.default...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/typography/elements/UL.tsx
code/core/src/components/components/typography/elements/UL.tsx
import type { Interpolation } from 'storybook/theming'; import { styled } from 'storybook/theming'; import { withMargin, withReset } from '../lib/common'; const listCommon: Interpolation = { paddingLeft: 30, '& :first-of-type': { marginTop: 0, }, '& :last-child': { marginBottom: 0, }, }; export con...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/typography/elements/Img.tsx
code/core/src/components/components/typography/elements/Img.tsx
import { styled } from 'storybook/theming'; export const Img = styled.img({ maxWidth: '100%', });
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/typography/lib/isReactChildString.tsx
code/core/src/components/components/typography/lib/isReactChildString.tsx
import type { ReactNode } from 'react'; export const isReactChildString = (child: ReactNode): child is string => typeof child === 'string';
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/typography/lib/common.tsx
code/core/src/components/components/typography/lib/common.tsx
import { transparentize } from 'polished'; import type { CSSObject, FunctionInterpolation } from 'storybook/theming'; export const headerCommon: FunctionInterpolation = ({ theme }) => ({ margin: '20px 0 8px', padding: 0, cursor: 'text', position: 'relative', color: theme.color.defaultText, '&:first-of-type...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/typography/link/link.tsx
code/core/src/components/components/typography/link/link.tsx
import type { AnchorHTMLAttributes, MouseEvent } from 'react'; import React, { forwardRef } from 'react'; import { ChevronRightIcon } from '@storybook/icons'; import { darken } from 'polished'; import { styled } from 'storybook/theming'; // Cmd/Ctrl/Shift/Alt + Click should trigger default browser behavior. Same app...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/typography/link/link.test.tsx
code/core/src/components/components/typography/link/link.test.tsx
// @vitest-environment happy-dom import { cleanup, render, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { afterEach, describe, expect, it, vi } from 'vitest'; import type { AnchorHTMLAttributes } from 'react'; import React from 'react'; import { ThemeProvider, co...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/typography/link/link.stories.tsx
code/core/src/components/components/typography/link/link.stories.tsx
import type { ComponentProps } from 'react'; import React from 'react'; import { DiscordIcon, SidebarIcon } from '@storybook/icons'; import { action } from 'storybook/actions'; import { Link } from './link'; const onClick = action('onClick'); export default { component: Link, }; export const CancelWOnClick = { ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/actions/loaders.ts
code/core/src/actions/loaders.ts
import type { LoaderFunction } from 'storybook/internal/types'; import { onMockCall } from 'storybook/test'; import { action } from './runtime'; let subscribed = false; const logActionsWhenMockCalled: LoaderFunction = (context) => { const { parameters } = context; if (parameters?.actions?.disable) { return...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/actions/typings.d.ts
code/core/src/actions/typings.d.ts
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/core/src/actions/preview.ts
code/core/src/actions/preview.ts
import { definePreviewAddon } from 'storybook/internal/csf'; import * as addArgs from './addArgs'; import * as loaders from './loaders'; import type { ActionsTypes } from './types'; export type { ActionsTypes }; export default () => definePreviewAddon<ActionsTypes>({ ...addArgs, ...loaders, });
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/actions/manager.tsx
code/core/src/actions/manager.tsx
import React from 'react'; import { addons, types } from 'storybook/manager-api'; import { Title } from './components/Title'; import { ADDON_ID, PANEL_ID, PARAM_KEY } from './constants'; import ActionLogger from './containers/ActionLogger'; export default addons.register(ADDON_ID, (api) => { if (globalThis?.FEATUR...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/actions/addArgsHelpers.ts
code/core/src/actions/addArgsHelpers.ts
import type { Args, ArgsEnhancer, Renderer } from 'storybook/internal/types'; import { action } from './runtime/action'; // interface ActionsParameter { // disable?: boolean; // argTypesRegex?: RegExp; // } const isInInitialArgs = (name: string, initialArgs: Args) => typeof initialArgs[name] === 'undefined' &&...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/actions/constants.ts
code/core/src/actions/constants.ts
export const PARAM_KEY = 'actions'; export const ADDON_ID = 'storybook/actions'; export const PANEL_ID = `${ADDON_ID}/panel`; export const EVENT_ID = `${ADDON_ID}/action-event`; export const CLEAR_ID = `${ADDON_ID}/action-clear`; export const CYCLIC_KEY = '$___storybook.isCyclic';
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/actions/decorator.ts
code/core/src/actions/decorator.ts
import type { PartialStoryFn, Renderer } from 'storybook/internal/types'; import { makeDecorator, useEffect } from 'storybook/preview-api'; import { PARAM_KEY } from './constants'; import { actions } from './runtime/actions'; const delegateEventSplitter = /^(\S+)\s*(.*)$/; const isIE = Element != null && !Element.p...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/actions/addArgsHelpers.test.ts
code/core/src/actions/addArgsHelpers.test.ts
import { describe, expect, it } from 'vitest'; import type { StoryContext } from 'storybook/internal/types'; import { addActionsFromArgTypes, inferActionsFromArgTypesRegex } from './addArgsHelpers'; describe('actions parameter enhancers', () => { describe('actions.argTypesRegex parameter', () => { const parame...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/actions/types.ts
code/core/src/actions/types.ts
export interface ActionsParameters { /** * Actions configuration * * @see https://storybook.js.org/docs/essentials/actions#parameters */ actions?: { /** * Create actions for each arg that matches the regex. (**NOT recommended, see below**) * * This is quite useful when your component ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/actions/addArgs.ts
code/core/src/actions/addArgs.ts
import type { ArgsEnhancer } from 'storybook/internal/types'; import { addActionsFromArgTypes, inferActionsFromArgTypesRegex } from './addArgsHelpers'; export const argsEnhancers: ArgsEnhancer[] = [ addActionsFromArgTypes, inferActionsFromArgTypesRegex, ];
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/actions/index.ts
code/core/src/actions/index.ts
export * from './constants'; export * from './models'; export * from './runtime';
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/actions/components/Title.tsx
code/core/src/actions/components/Title.tsx
import React from 'react'; import { Badge } from 'storybook/internal/components'; import { STORY_CHANGED } from 'storybook/internal/core-events'; import { useAddonState, useChannel, useStorybookApi } from 'storybook/manager-api'; import { ADDON_ID, CLEAR_ID, EVENT_ID, PANEL_ID } from '../constants'; export function...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/actions/components/ActionLogger/index.tsx
code/core/src/actions/components/ActionLogger/index.tsx
import type { ElementRef, ReactNode } from 'react'; import React, { Fragment, forwardRef, useEffect, useRef } from 'react'; import { ActionBar, ScrollArea } from 'storybook/internal/components'; import { Inspector } from 'react-inspector'; import type { Theme } from 'storybook/theming'; import { styled, withTheme } f...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/actions/components/ActionLogger/style.tsx
code/core/src/actions/components/ActionLogger/style.tsx
import { opacify } from 'polished'; import { styled } from 'storybook/theming'; export const Action = styled.div({ display: 'flex', padding: 0, borderLeft: '5px solid transparent', borderBottom: '1px solid transparent', transition: 'all 0.1s', alignItems: 'flex-start', whiteSpace: 'pre', }); export cons...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/actions/runtime/actions.ts
code/core/src/actions/runtime/actions.ts
import type { ActionOptions, ActionsFunction, ActionsMap } from '../models'; import { action } from './action'; import { config } from './configureActions'; export const actions: ActionsFunction = (...args: any[]) => { let options: ActionOptions = config; let names = args; // args argument can be a single argume...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/actions/runtime/action.ts
code/core/src/actions/runtime/action.ts
import { ImplicitActionsDuringRendering } from 'storybook/internal/preview-errors'; import type { Renderer } from 'storybook/internal/types'; import { global } from '@storybook/global'; import type { PreviewWeb } from 'storybook/preview-api'; import { addons } from 'storybook/preview-api'; import { EVENT_ID } from '...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/actions/runtime/configureActions.ts
code/core/src/actions/runtime/configureActions.ts
import type { ActionOptions } from '../models'; export const config: ActionOptions = { depth: 10, clearOnStoryChange: true, limit: 50, }; export const configureActions = (options: ActionOptions = {}): void => { Object.assign(config, options); };
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/actions/runtime/index.ts
code/core/src/actions/runtime/index.ts
export * from './action'; export * from './actions'; export * from './configureActions';
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/actions/models/ActionsFunction.ts
code/core/src/actions/models/ActionsFunction.ts
import type { ActionOptions } from './ActionOptions'; import type { ActionsMap } from './ActionsMap'; export interface ActionsFunction { <T extends string>(handlerMap: Record<T, string>, options?: ActionOptions): ActionsMap<T>; <T extends string>(...handlers: T[]): ActionsMap<T>; <T extends string>(handler1: T,...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/actions/models/ActionOptions.ts
code/core/src/actions/models/ActionOptions.ts
import type { Options as TelejsonOptions } from 'telejson'; interface Options { depth: number; // backwards compatibility, remove in 7.0 clearOnStoryChange: boolean; limit: number; implicit: boolean; id: string; } export type ActionOptions = Partial<Options> & Partial<TelejsonOptions>;
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/actions/models/DecoratorFunction.ts
code/core/src/actions/models/DecoratorFunction.ts
export type DecoratorFunction = (args: any[]) => any[];
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/actions/models/index.ts
code/core/src/actions/models/index.ts
export * from './ActionDisplay'; export * from './ActionsFunction'; export * from './ActionOptions'; export * from './ActionsMap'; export * from './DecoratorFunction'; export * from './HandlerFunction';
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/actions/models/ActionsMap.ts
code/core/src/actions/models/ActionsMap.ts
import type { HandlerFunction } from './HandlerFunction'; export type ActionsMap<T extends string = string> = Record<T, HandlerFunction>;
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/actions/models/HandlerFunction.ts
code/core/src/actions/models/HandlerFunction.ts
export type HandlerFunction = (...args: any[]) => void;
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/actions/models/ActionDisplay.ts
code/core/src/actions/models/ActionDisplay.ts
import type { ActionOptions } from './ActionOptions'; export interface ActionDisplay { id: string; data: { name: string; args: any[]; }; count: number; options: ActionOptions; }
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/actions/containers/ActionLogger/index.tsx
code/core/src/actions/containers/ActionLogger/index.tsx
import React, { Component } from 'react'; import { STORY_CHANGED } from 'storybook/internal/core-events'; import { dequal as deepEqual } from 'dequal'; import type { API } from 'storybook/manager-api'; import { ActionLogger as ActionLoggerComponent } from '../../components/ActionLogger'; import { CLEAR_ID, EVENT_ID ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/toolbar/preview.ts
code/core/src/toolbar/preview.ts
// The toolbar doesn't need any preview-side functionality export {};
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/toolbar/manager.tsx
code/core/src/toolbar/manager.tsx
import React from 'react'; import { addons, types } from 'storybook/manager-api'; import { ToolbarManager } from './components/ToolbarManager'; import { TOOLBAR_ID } from './constants'; // Register the toolbar in the manager addons.register(TOOLBAR_ID, () => addons.add(TOOLBAR_ID, { title: TOOLBAR_ID, type...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/toolbar/constants.ts
code/core/src/toolbar/constants.ts
export const TOOLBAR_ID = 'toolbar' as const; export const TOOLBAR_PARAM = 'toolbars' as const;
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/toolbar/types.ts
code/core/src/toolbar/types.ts
import type { InputType } from 'storybook/internal/types'; import type { IconsProps } from '../components/components/icon/icon'; export type ToolbarShortcutType = 'next' | 'previous' | 'reset'; export type ToolbarItemType = 'item' | 'reset'; export interface ToolbarShortcutConfig { label: string; keys: string[]...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/toolbar/index.ts
code/core/src/toolbar/index.ts
export * from './types'; export * from './constants'; export * from './components/ToolbarManager';
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/toolbar/components/ToolbarManager.tsx
code/core/src/toolbar/components/ToolbarManager.tsx
import React, { type FC } from 'react'; import { Separator } from 'storybook/internal/components'; import { useGlobalTypes } from 'storybook/manager-api'; import type { ToolbarArgType } from '../types'; import { normalizeArgType } from '../utils/normalize-toolbar-arg-type'; import { ToolbarMenuSelect } from './Toolb...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/toolbar/components/ToolbarMenuSelect.tsx
code/core/src/toolbar/components/ToolbarMenuSelect.tsx
import type { FC } from 'react'; import React from 'react'; import { Select } from 'storybook/internal/components'; import { useGlobals } from 'storybook/manager-api'; import { styled } from 'storybook/theming'; import { Icons } from '../../components/components/icon/icon'; import type { WithKeyboardCycleProps } fro...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/toolbar/utils/register-shortcuts.ts
code/core/src/toolbar/utils/register-shortcuts.ts
import type { API } from 'storybook/manager-api'; import { TOOLBAR_ID } from '../constants'; import type { ToolbarShortcutConfig } from '../types'; interface Shortcuts { next: ToolbarShortcutConfig & { action: () => void }; previous: ToolbarShortcutConfig & { action: () => void }; reset: ToolbarShortcutConfig &...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/toolbar/utils/get-selected.ts
code/core/src/toolbar/utils/get-selected.ts
import type { ToolbarItem } from '../types'; interface GetSelectedItemProps { currentValue: string | null; items: ToolbarItem[]; } export const getSelectedItem = ({ currentValue, items }: GetSelectedItemProps) => { const selectedItem = currentValue != null && items.find((item) => item.value === currentV...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/toolbar/utils/normalize-toolbar-arg-type.ts
code/core/src/toolbar/utils/normalize-toolbar-arg-type.ts
import type { NormalizedToolbarArgType, ToolbarArgType, ToolbarItem } from '../types'; const defaultItemValues: ToolbarItem = { type: 'item', value: '', }; export const normalizeArgType = ( key: string, argType: ToolbarArgType ): NormalizedToolbarArgType => ({ ...argType, name: argType.name || key, desc...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/toolbar/utils/create-cycle-value-array.ts
code/core/src/toolbar/utils/create-cycle-value-array.ts
import type { ToolbarItem, ToolbarItemType } from '../types'; const disallowedCycleableItemTypes: Array<ToolbarItemType> = ['reset']; export const createCycleValueArray = (items: ToolbarItem[]) => { // Do not allow items in the cycle arrays that are conditional in placement const valueArray = items .filter((i...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/toolbar/hoc/withKeyboardCycle.tsx
code/core/src/toolbar/hoc/withKeyboardCycle.tsx
import React, { useCallback, useEffect, useRef } from 'react'; import { useGlobals, useStorybookApi } from 'storybook/manager-api'; import type { ToolbarMenuProps } from '../types'; import { createCycleValueArray } from '../utils/create-cycle-value-array'; import { registerShortcuts } from '../utils/register-shortcut...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/builder-manager/types.ts
code/core/src/builder-manager/types.ts
import type { Builder, BuilderStats, Builder_Unpromise, Builder_WithRequiredProperty, } from 'storybook/internal/types'; import type { BuildOptions, BuildResult } from 'esbuild'; export type ManagerBuilder = Builder< Builder_WithRequiredProperty<BuildOptions, 'outdir'> & { entryPoints: string[] }, Builder...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/builder-manager/index.ts
code/core/src/builder-manager/index.ts
import { cp, rm, writeFile } from 'node:fs/promises'; import { stringifyProcessEnvs } from 'storybook/internal/common'; import { logger } from 'storybook/internal/node-logger'; import { globalExternals } from '@fal-works/esbuild-plugin-global-externals'; import { resolveModulePath } from 'exsolve'; import { join, par...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/builder-manager/utils/files.ts
code/core/src/builder-manager/utils/files.ts
import { existsSync } from 'node:fs'; import { mkdir, writeFile } from 'node:fs/promises'; import { dirname, join, normalize, relative } from 'node:path'; import type { OutputFile } from 'esbuild'; // eslint-disable-next-line depend/ban-dependencies import slash from 'slash'; import type { Compilation } from '../type...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/builder-manager/utils/managerEntries.ts
code/core/src/builder-manager/utils/managerEntries.ts
import { existsSync } from 'node:fs'; import { mkdir, writeFile } from 'node:fs/promises'; import { dirname, join, parse, relative, sep } from 'node:path'; import { resolvePathInStorybookCache } from 'storybook/internal/common'; // eslint-disable-next-line depend/ban-dependencies import slash from 'slash'; const san...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/builder-manager/utils/files.test.ts
code/core/src/builder-manager/utils/files.test.ts
import { platform } from 'node:os'; import { expect, it } from 'vitest'; import type { OutputFile } from 'esbuild'; import { sanitizePath } from './files'; const os = platform(); const isWindows = os === 'win32'; it('sanitizePath', () => { const addonsDir = isWindows ? 'C:\\Users\\username\\Projects\\project...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/builder-manager/utils/template.ts
code/core/src/builder-manager/utils/template.ts
import { readFile } from 'node:fs/promises'; import type { DocsOptions, Options, Ref, TagsOptions } from 'storybook/internal/types'; import { render } from 'ejs'; import { join } from 'pathe'; import { resolvePackageDir } from '../../shared/utils/module'; export const getTemplatePath = (template: string) => { ret...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/builder-manager/utils/data.ts
code/core/src/builder-manager/utils/data.ts
import { basename } from 'node:path'; import { getRefs } from 'storybook/internal/common'; import type { Options } from 'storybook/internal/types'; import { executor, getConfig } from '../index'; import { readTemplate } from './template'; export const getData = async (options: Options) => { const refs = getRefs(op...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/builder-manager/utils/framework.ts
code/core/src/builder-manager/utils/framework.ts
import { extractFrameworkPackageName, frameworkPackages, frameworkToRenderer, getFrameworkName, } from 'storybook/internal/common'; import { type Options, SupportedBuilder } from 'storybook/internal/types'; export const buildFrameworkGlobalsFromOptions = async (options: Options) => { const globals: Record<st...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/instrumenter/preview-api.ts
code/core/src/instrumenter/preview-api.ts
/** * We do this for mocking purposes, it's a lot easier to mock the a module than the addons channel * than it is to mock a globalThis property. */ export const addons = globalThis.__STORYBOOK_ADDONS_PREVIEW;
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/instrumenter/EVENTS.ts
code/core/src/instrumenter/EVENTS.ts
export const EVENTS = { CALL: 'storybook/instrumenter/call', SYNC: 'storybook/instrumenter/sync', START: 'storybook/instrumenter/start', BACK: 'storybook/instrumenter/back', GOTO: 'storybook/instrumenter/goto', NEXT: 'storybook/instrumenter/next', END: 'storybook/instrumenter/end', };
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/instrumenter/typings.d.ts
code/core/src/instrumenter/typings.d.ts
declare interface Window { __STORYBOOK_PREVIEW__: any; __STORYBOOK_ADDON_INTERACTIONS_INSTRUMENTER__: any; __STORYBOOK_ADDON_INTERACTIONS_INSTRUMENTER_STATE__: any; FEATURES: import('storybook/internal/types').StorybookConfigRaw['features']; LOGLEVEL: 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'silent' ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/instrumenter/instrumenter.test.ts
code/core/src/instrumenter/instrumenter.test.ts
// @vitest-environment happy-dom import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; import { SET_CURRENT_STORY, STORY_RENDER_PHASE_CHANGED } from 'storybook/internal/core-events'; import { global } from '@storybook/global'; import { EVENTS } from './EVENTS'; import { Instrumenter, isClass } fr...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/instrumenter/instrumenter.ts
code/core/src/instrumenter/instrumenter.ts
import type { Channel } from 'storybook/internal/channels'; import { once } from 'storybook/internal/client-logger'; import { FORCE_REMOUNT, SET_CURRENT_STORY, STORY_RENDER_PHASE_CHANGED, } from 'storybook/internal/core-events'; import type { StoryId } from 'storybook/internal/types'; import { global } from '@st...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/instrumenter/types.ts
code/core/src/instrumenter/types.ts
import type { StoryId } from 'storybook/internal/types'; import type { RenderPhase } from '../preview-api/modules/preview-web/render/StoryRender'; export type { RenderPhase }; export interface Call { id: string; cursor: number; storyId: StoryId; ancestors: Call['id'][]; path: Array<string | CallRef>; met...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/instrumenter/index.ts
code/core/src/instrumenter/index.ts
export { instrument } from './instrumenter'; export { EVENTS } from './EVENTS'; 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/measure/preview.ts
code/core/src/measure/preview.ts
import { definePreviewAddon } from 'storybook/internal/csf'; import { PARAM_KEY } from './constants'; import type { MeasureTypes } from './types'; import { withMeasure } from './withMeasure'; export const decorators = globalThis.FEATURES?.measure ? [withMeasure] : []; export const initialGlobals = { [PARAM_KEY]: f...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/measure/manager.tsx
code/core/src/measure/manager.tsx
import React from 'react'; import { addons, types } from 'storybook/manager-api'; import { Tool } from './Tool'; import { ADDON_ID, TOOL_ID } from './constants'; export default addons.register(ADDON_ID, () => { if (globalThis?.FEATURES?.measure) { addons.add(TOOL_ID, { type: types.TOOL, title: 'Mea...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/measure/util.ts
code/core/src/measure/util.ts
import { global } from '@storybook/global'; export const deepElementFromPoint = (x: number, y: number) => { const element = global.document.elementFromPoint(x, y) as HTMLElement; const crawlShadows = (node: HTMLElement): HTMLElement => { if (node && node.shadowRoot) { // elementFromPoint() doesn't exist...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/measure/util-types.ts
code/core/src/measure/util-types.ts
export interface Margin { top: number; bottom: number; left: number; right: number; } export interface Padding { top: number; bottom: number; left: number; right: number; } export interface Border { top: number; bottom: number; left: number; right: number; } export interface Dimensions { ma...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/measure/withMeasure.ts
code/core/src/measure/withMeasure.ts
/* eslint-env browser */ import type { DecoratorFunction } from 'storybook/internal/types'; import { useEffect } from 'storybook/preview-api'; import { destroy, init, rescale } from './box-model/canvas'; import { drawSelectedElement } from './box-model/visualizer'; import { deepElementFromPoint } from './util'; let ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/measure/constants.ts
code/core/src/measure/constants.ts
export const ADDON_ID = 'storybook/measure-addon'; export const TOOL_ID = `${ADDON_ID}/tool`; export const PARAM_KEY = 'measureEnabled'; export const EVENTS = { RESULT: `${ADDON_ID}/result`, REQUEST: `${ADDON_ID}/request`, CLEAR: `${ADDON_ID}/clear`, };
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/measure/types.ts
code/core/src/measure/types.ts
export interface MeasureParameters { /** * Measure configuration * * @see https://storybook.js.org/docs/essentials/measure-and-outline#parameters */ measure?: { /** * Removes the tool and disables the feature's behavior. If you wish to turn off this feature * for the entire Storybook, you ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/measure/Tool.tsx
code/core/src/measure/Tool.tsx
import React, { useCallback, useEffect } from 'react'; import { ToggleButton } from 'storybook/internal/components'; import { RulerIcon } from '@storybook/icons'; import { useGlobals, useStorybookApi } from 'storybook/manager-api'; import { ADDON_ID, TOOL_ID } from './constants'; export const Tool = () => { cons...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/measure/box-model/canvas.ts
code/core/src/measure/box-model/canvas.ts
import { global } from '@storybook/global'; import invariant from 'tiny-invariant'; interface Size { width: number; height: number; } interface CanvasState { canvas?: HTMLCanvasElement; context?: CanvasRenderingContext2D; width?: number; height?: number; } function getDocumentWidthAndHeight() { const ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/measure/box-model/visualizer.ts
code/core/src/measure/box-model/visualizer.ts
/** Based on https://gist.github.com/awestbro/e668c12662ad354f02a413205b65fce7 */ import { global } from '@storybook/global'; import type { Dimensions, ElementMeasurements, Extremities, FloatingAlignment, } from '../util-types'; import { draw } from './canvas'; import type { Label, LabelStack } from './labels'...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/measure/box-model/labels.ts
code/core/src/measure/box-model/labels.ts
import type { ElementMeasurements, FloatingAlignment } from '../util-types'; type LabelType = 'margin' | 'padding' | 'border' | 'content'; type LabelPosition = 'top' | 'right' | 'bottom' | 'left' | 'center'; type Direction = 'top' | 'right' | 'bottom' | 'left'; export interface Label { type: LabelType; text: numb...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/versions.ts
code/core/src/common/versions.ts
// auto generated file, do not edit export default { '@storybook/addon-a11y': '10.2.0-alpha.10', '@storybook/addon-docs': '10.2.0-alpha.10', '@storybook/addon-links': '10.2.0-alpha.10', '@storybook/addon-onboarding': '10.2.0-alpha.10', 'storybook-addon-pseudo-states': '10.2.0-alpha.10', '@storybook/addon-th...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/presets.test.ts
code/core/src/common/presets.test.ts
import path, { join, normalize, relative } from 'node:path'; import { fileURLToPath, pathToFileURL, resolve } from 'node:url'; import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; import { logger } from 'storybook/internal/node-logger'; import * as resolveUtils from '../shared/utils/module'; imp...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/index.ts
code/core/src/common/index.ts
import versions from './versions'; /// <reference types="@types/compression" /> export * from './presets'; export * from './utils/cache'; export * from './utils/cli'; export * from './utils/check-addon-order'; export * from './utils/envs'; export * from './utils/common-glob-options'; export * from './utils/framework...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/satellite-addons.ts
code/core/src/common/satellite-addons.ts
// Storybook packages that are not part of the monorepo but we maintain. export default [ '@storybook/test-runner', '@chromatic-com/storybook', '@storybook/addon-designs', '@storybook/addon-svelte-csf', '@storybook/addon-coverage', '@storybook/addon-webpack5-compiler-babel', '@storybook/addon-webpack5-com...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/config.test.ts
code/core/src/common/config.test.ts
import { describe, expect, it } from 'vitest'; import { filterPresetsConfig } from './presets'; describe('filterPresetsConfig', () => { it('string config', () => { expect(filterPresetsConfig(['@storybook/preset-scss', '@storybook/preset-typescript'])).toEqual( ['@storybook/preset-scss'] ); }); it...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/presets.ts
code/core/src/common/presets.ts
import { logger } from 'storybook/internal/node-logger'; import { CriticalPresetLoadError } from 'storybook/internal/server-errors'; import type { BuilderOptions, CLIOptions, CoreCommon_ResolvedAddonPreset, CoreCommon_ResolvedAddonVirtual, LoadOptions, LoadedPreset, PresetConfig, Presets, StorybookCon...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/get-builder-options.ts
code/core/src/common/utils/get-builder-options.ts
import type { Options } from 'storybook/internal/types'; /** * Builder options can be specified in `core.builder.options` or `framework.options.builder`. * Preference is given here to `framework.options.builder` if both are specified. */ export async function getBuilderOptions<T extends Record<string, any>>( opti...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/load-manager-or-addons-file.ts
code/core/src/common/utils/load-manager-or-addons-file.ts
import { resolve } from 'node:path'; import { logger } from 'storybook/internal/node-logger'; import { dedent } from 'ts-dedent'; import { getInterpretedFile } from './interpret-files'; export function loadManagerOrAddonsFile({ configDir }: { configDir: string }) { const storybookCustomAddonsPath = getInterpreted...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/normalize-path.test.ts
code/core/src/common/utils/normalize-path.test.ts
import { describe, expect, it } from 'vitest'; import { normalizePath } from './normalize-path'; describe('normalize-path', () => { it('should normalize paths', () => { expect(normalizePath('path/to/../file')).toBe('path/file'); expect(normalizePath('path/to/./file')).toBe('path/to/file'); expect(normal...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/get-story-id.test.ts
code/core/src/common/utils/get-story-id.test.ts
import { join } from 'node:path'; import { describe, expect, it } from 'vitest'; import { getStoryId } from './get-story-id'; describe('getStoryId', () => { it('should return the storyId', async () => { const cwd = process.cwd(); const options = { configDir: join(cwd, '.storybook'), presets: { ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/log-config.ts
code/core/src/common/utils/log-config.ts
import picocolors from 'picocolors'; export function logConfig(caption: unknown, config: unknown) { console.log(picocolors.cyan(String(caption))); console.dir(config, { depth: null }); }
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/get-addon-names.test.ts
code/core/src/common/utils/get-addon-names.test.ts
import { describe, expect, it } from 'vitest'; import { getAddonNames } from './get-addon-names'; describe('getAddonNames', () => { it('should extract addon names from simple strings', () => { const config = { stories: [], addons: ['@storybook/addon-highlight', '@storybook/addon-outline'], }; ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/get-storybook-info.ts
code/core/src/common/utils/get-storybook-info.ts
import { existsSync, readFileSync } from 'node:fs'; import { dirname, join } from 'node:path'; import { CoreWebpackCompiler, SupportedFramework } from 'storybook/internal/types'; import type { CoreCommon_StorybookInfo, PackageJson, StorybookConfigRaw, } from 'storybook/internal/types'; import { SupportedBuilder,...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false