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/tooltip/TooltipNote.tsx | code/core/src/components/components/tooltip/TooltipNote.tsx | import React from 'react';
import { styled } from 'storybook/theming';
const Note = styled.div(({ theme }) => ({
padding: '2px 6px',
lineHeight: '16px',
fontSize: 10,
fontWeight: theme.typography.weight.bold,
color: theme.color.lightest,
boxShadow: '0 0 5px 0 rgba(0, 0, 0, 0.3)',
borderRadius: 4,
whit... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/tooltip/ListItem.tsx | code/core/src/components/components/tooltip/ListItem.tsx | import React, { type ComponentProps, type ReactNode, type SyntheticEvent, forwardRef } from 'react';
import { deprecate } from 'storybook/internal/client-logger';
import memoize from 'memoizerific';
import { styled } from 'storybook/theming';
export interface TitleProps {
children?: ReactNode;
active?: boolean;
... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/tooltip/WithTooltip.stories.tsx | code/core/src/components/components/tooltip/WithTooltip.stories.tsx | import type { ComponentProps, FunctionComponent } from 'react';
import React from 'react';
import type { StoryObj } from '@storybook/react-vite';
import { expect, screen } from 'storybook/test';
import { styled } from 'storybook/theming';
import { TooltipMessage } from './TooltipMessage';
import { WithToolTipState a... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/tooltip/Tooltip.tsx | code/core/src/components/components/tooltip/Tooltip.tsx | import React, { forwardRef } from 'react';
import { Popover, type PopoverProps } from '../Popover/Popover';
export type TooltipProps = Omit<PopoverProps, 'onHide' | 'hideLabel'>;
export const Tooltip = forwardRef<HTMLDivElement, TooltipProps>((props, ref) => {
return <Popover ref={ref} {...props} />;
});
Tooltip.... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/ProgressSpinner/ProgressSpinner.stories.tsx | code/core/src/components/components/ProgressSpinner/ProgressSpinner.stories.tsx | import React from 'react';
import { StopAltIcon } from '@storybook/icons';
import type { Meta, StoryObj } from '@storybook/react-vite';
import { ProgressSpinner } from './ProgressSpinner';
const meta = {
component: ProgressSpinner,
} satisfies Meta<typeof ProgressSpinner>;
export default meta;
type Story = Story... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/ProgressSpinner/ProgressSpinner.tsx | code/core/src/components/components/ProgressSpinner/ProgressSpinner.tsx | import React, { type ComponentProps } from 'react';
import { keyframes, styled } from 'storybook/theming';
const XMLNS = 'http://www.w3.org/2000/svg';
const rotate = keyframes({
'0%': {
transform: 'rotate(0deg)',
},
'100%': {
transform: 'rotate(360deg)',
},
});
const Wrapper = styled.div<{ size: num... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/addon-panel/addon-panel.tsx | code/core/src/components/components/addon-panel/addon-panel.tsx | import type { ReactElement } from 'react';
import React, { useEffect, useRef } from 'react';
import { styled } from 'storybook/theming';
import { ScrollArea } from '../ScrollArea/ScrollArea';
const usePrevious = (value: any) => {
const ref = useRef();
useEffect(() => {
// happens after return
ref.curren... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/Select/SelectOption.tsx | code/core/src/components/components/Select/SelectOption.tsx | import React from 'react';
import { darken, transparentize } from 'polished';
import { styled } from 'storybook/theming';
export interface SelectOptionProps {
/**
* DOM id attribute for the option, unique across the entire app. This is not the value of the
* option. We don't need the value internally as it'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/Select/helpers.tsx | code/core/src/components/components/Select/helpers.tsx | import type React from 'react';
import { styled } from 'storybook/theming';
export const PAGE_STEP_SIZE = 5;
export const UNDEFINED_VALUE = Symbol.for('undefined');
export type Value = string | number | null | boolean | undefined;
export type InternalValue = string | number | null | boolean | typeof UNDEFINED_VALUE;... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/Select/Select.tsx | code/core/src/components/components/Select/Select.tsx | import type { FC, KeyboardEvent } from 'react';
import React, { forwardRef, useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { RefreshIcon } from '@storybook/icons';
import { useInteractOutside } from '@react-aria/interactions';
import { Overlay, ariaHideOutside, useOverlay, useOverlayPosition... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/Select/Select.stories.tsx | code/core/src/components/components/Select/Select.stories.tsx | import React from 'react';
import { Button } from 'storybook/internal/components';
import { LinuxIcon } from '@storybook/icons';
import type { StoryAnnotations } from 'core/src/types';
import { expect, fn, screen, userEvent, within } from 'storybook/test';
import { styled } from 'storybook/theming';
import preview ... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | true |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/Select/SelectOption.stories.tsx | code/core/src/components/components/Select/SelectOption.stories.tsx | import React from 'react';
import { TabletIcon } from '@storybook/icons';
import { expect, fn, within } from 'storybook/test';
import preview from '../../../../../.storybook/preview';
import { SelectOption } from './SelectOption';
import { Listbox } from './helpers';
const meta = preview.meta({
id: 'select-option... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/Card/Card.tsx | code/core/src/components/components/Card/Card.tsx | import React, { type ComponentProps, forwardRef } from 'react';
import type { CSSObject, color } from 'storybook/theming';
import { keyframes, styled } from 'storybook/theming';
const fadeInOut = keyframes({
'0%': { opacity: 0 },
'5%': { opacity: 1 },
'25%': { opacity: 1 },
'30%': { opacity: 0 },
});
const 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/Card/Card.stories.tsx | code/core/src/components/components/Card/Card.stories.tsx | import preview from '../../../../../.storybook/preview';
import { Card } from './Card';
const meta = preview.meta({
component: Card,
});
const Contents = ({ children }: { children: React.ReactNode }) => (
<div style={{ padding: 16 }}>{children}</div>
);
export const Default = meta.story(() => (
<Card>
<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/ScrollArea/ScrollArea.stories.tsx | code/core/src/components/components/ScrollArea/ScrollArea.stories.tsx | import type { ReactElement } from 'react';
import React, { Fragment } from 'react';
import { styled } from 'storybook/theming';
import { ScrollArea } from './ScrollArea';
const Block = styled.span({
display: 'inline-block',
height: 40,
width: 40,
border: '1px solid silver',
lineHeight: '40px',
textAlign:... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/ScrollArea/ScrollArea.tsx | code/core/src/components/components/ScrollArea/ScrollArea.tsx | import React, { forwardRef } from 'react';
import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
import { styled } from 'storybook/theming';
export interface ScrollAreaProps {
children?: React.ReactNode;
horizontal?: boolean;
vertical?: boolean;
className?: string;
offset?: number;
scrollbar... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/Form/Input.stories.tsx | code/core/src/components/components/Form/Input.stories.tsx | import type { Meta, StoryObj } from '@storybook/react-vite';
import { Input as Component } from './Input';
const meta = {
title: 'Form/Input',
component: Component,
} satisfies Meta<typeof Component>;
export default meta;
type Story = StoryObj<typeof meta>;
export const Input: Story = {
render: (args) => <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/Form/Field.stories.tsx | code/core/src/components/components/Form/Field.stories.tsx | import React from 'react';
import { fn } from 'storybook/test';
import { styled } from 'storybook/theming';
import { Field as FieldComponent } from './Field';
import { Input as InputComponent } from './Input';
import { Select as SelectComponent } from './Select';
import { Textarea as TextareaComponent } from './Texta... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/Form/Select.tsx | code/core/src/components/components/Form/Select.tsx | import React, { type CSSProperties, type SelectHTMLAttributes } from 'react';
import { lighten, styled } from 'storybook/theming';
import { isTestEnvironment } from '../../../preview-api/modules/preview-web/render/animation-utils';
import { type Alignments, type Sizes, type ValidationStates, sizes } from './styles';
... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/Form/Radio.stories.tsx | code/core/src/components/components/Form/Radio.stories.tsx | import type { Meta, StoryObj } from '@storybook/react-vite';
import { Radio as Component } from './Radio';
const meta = {
component: Component,
title: 'Form/Radio',
} satisfies Meta<typeof Component>;
export default meta;
type Story = StoryObj<typeof meta>;
export const Radio: Story = {
render: () => (
<... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/Form/Textarea.stories.tsx | code/core/src/components/components/Form/Textarea.stories.tsx | import type { Meta, StoryObj } from '@storybook/react-vite';
import { Textarea as Component } from './Textarea';
const meta = {
title: 'Form/Textarea',
component: Component,
} satisfies Meta<typeof Component>;
type Story = StoryObj<typeof meta>;
export default meta;
export const Textarea: Story = {
render: (... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/Form/Select.stories.tsx | code/core/src/components/components/Form/Select.stories.tsx | import type { Meta, StoryObj } from '@storybook/react-vite';
import { action } from 'storybook/actions';
import { Select as Component } from './Select';
const meta = {
title: 'Form/Select',
component: Component,
} satisfies Meta<typeof Component>;
type Story = StoryObj<typeof meta>;
export default meta;
expor... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/Form/Checkbox.tsx | code/core/src/components/components/Form/Checkbox.tsx | import React from 'react';
import { color, styled } from 'storybook/theming';
const Input = styled.input(({ theme }) => ({
appearance: 'none',
backgroundColor: theme.input.background,
border: `1px solid ${theme.base === 'dark' ? 'hsl(0 0 100 / 0.4)' : 'hsl(0 0 0 / 0.44)'}`,
borderRadius: 2,
display: 'grid',... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/Form/Textarea.tsx | code/core/src/components/components/Form/Textarea.tsx | import React, { forwardRef } from 'react';
import TextareaAutoResize from 'react-textarea-autosize';
import { styled } from 'storybook/theming';
import {
type Alignments,
type Sizes,
type ValidationStates,
alignment,
sizes,
styles,
validation,
} from './styles';
/**
* These types are copied from `reac... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/Form/Radio.tsx | code/core/src/components/components/Form/Radio.tsx | import React from 'react';
import { color, styled } from 'storybook/theming';
const Input = styled.input(({ theme }) => ({
appearance: 'none',
backgroundColor: theme.input.background,
border: `1px solid ${theme.base === 'dark' ? 'hsl(0 0 100 / 0.4)' : 'hsl(0 0 0 / 0.44)'}`,
borderRadius: 8,
display: 'grid',... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/Form/Checkbox.stories.tsx | code/core/src/components/components/Form/Checkbox.stories.tsx | import type { Meta, StoryObj } from '@storybook/react-vite';
import { Checkbox as Component } from './Checkbox';
const meta = {
component: Component,
title: 'Form/Checkbox',
} satisfies Meta<typeof Component>;
export default meta;
type Story = StoryObj<typeof meta>;
export const Checkbox: Story = {
render: (... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/Form/styles.ts | code/core/src/components/components/Form/styles.ts | import type { CSSObject, StorybookTheme } from 'storybook/theming';
export type Sizes = '100%' | 'flex' | 'auto';
export type Alignments = 'end' | 'center' | 'start';
export type ValidationStates = 'valid' | 'error' | 'warn';
export const sizes = (({ size }: { size?: Sizes }) => {
switch (size) {
case '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/Form/Field.tsx | code/core/src/components/components/Form/Field.tsx | import React, { type ReactNode } from 'react';
import { styled } from 'storybook/theming';
const Wrapper = styled.label(({ theme }) => ({
display: 'flex',
borderBottom: `1px solid ${theme.appBorderColor}`,
margin: '0 15px',
padding: '8px 0',
'&:last-child': {
marginBottom: '3rem',
},
}));
const Labe... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/Form/Input.tsx | code/core/src/components/components/Form/Input.tsx | import React, { type HTMLProps } from 'react';
import { forwardRef } from 'react';
import { styled } from 'storybook/theming';
import {
type Alignments,
type Sizes,
type ValidationStates,
alignment,
sizes,
styles,
validation,
} from './styles';
type InputProps = Omit<
HTMLProps<HTMLInputElement>,
k... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/Form/Form.tsx | code/core/src/components/components/Form/Form.tsx | import { styled } from 'storybook/theming';
import { Button } from '../Button/Button';
import { Checkbox } from './Checkbox';
import { Field } from './Field';
import { Input } from './Input';
import { Radio } from './Radio';
import { Select } from './Select';
import { Textarea } from './Textarea';
export const Form =... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/ActionBar/ActionBar.tsx | code/core/src/components/components/ActionBar/ActionBar.tsx | import type { MouseEvent, ReactElement } from 'react';
import React from 'react';
import { styled } from 'storybook/theming';
const Container = styled.div(({ theme }) => ({
position: 'absolute',
bottom: 0,
right: 0,
maxWidth: '100%',
display: 'flex',
background: theme.background.content,
zIndex: 1,
}));... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/ActionBar/ActionBar.stories.tsx | code/core/src/components/components/ActionBar/ActionBar.stories.tsx | import type { ReactNode } from 'react';
import React from 'react';
import { action } from 'storybook/actions';
import { ActionBar } from './ActionBar';
const action1 = action('action1');
const action2 = action('action2');
const action3 = action('action3');
export default {
component: ActionBar,
decorators: [
... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/syntaxhighlighter/syntaxhighlighter.tsx | code/core/src/components/components/syntaxhighlighter/syntaxhighlighter.tsx | import type { MouseEvent } from 'react';
import React, { useCallback, useEffect, useState } from 'react';
import { logger } from 'storybook/internal/client-logger';
import { global } from '@storybook/global';
import memoize from 'memoizerific';
// @ts-expect-error (Converted from ts-ignore)
import createElement from... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/syntaxhighlighter/syntaxhighlighter.stories.tsx | code/core/src/components/components/syntaxhighlighter/syntaxhighlighter.stories.tsx | import type { ComponentProps } from 'react';
import React from 'react';
import { ThemeProvider, ensure, themes } from 'storybook/theming';
import { SyntaxHighlighter } from './lazy-syntaxhighlighter';
export default {
component: SyntaxHighlighter,
};
export const JS = {
args: {
language: 'js',
children:... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/syntaxhighlighter/syntaxhighlighter-types.ts | code/core/src/components/components/syntaxhighlighter/syntaxhighlighter-types.ts | import type { ReactNode } from 'react';
import type { supportedLanguages } from './syntaxhighlighter';
export interface SyntaxHighlighterRendererProps {
rows: any[];
stylesheet: string;
useInlineStyles: boolean;
}
export type SyntaxHighlighterRenderer = (props: SyntaxHighlighterRendererProps) => ReactNode;
ex... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/syntaxhighlighter/formatter.ts | code/core/src/components/components/syntaxhighlighter/formatter.ts | import memoize from 'memoizerific';
import { dedent } from 'ts-dedent';
import type { SyntaxHighlighterFormatTypes } from './syntaxhighlighter-types';
export const formatter = memoize(2)(async (type: SyntaxHighlighterFormatTypes, source: string) => {
if (type === false) {
return source;
}
return dedent(sou... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/syntaxhighlighter/formatter.test.ts | code/core/src/components/components/syntaxhighlighter/formatter.test.ts | import { describe, expect, it } from 'vitest';
import { dedent } from 'ts-dedent';
import { formatter } from './formatter';
describe('dedent', () => {
it('handles empty string', async () => {
const input = '';
const result = formatter(true, input);
await expect(result).resolves.toBe(input);
});
i... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/syntaxhighlighter/lazy-syntaxhighlighter.tsx | code/core/src/components/components/syntaxhighlighter/lazy-syntaxhighlighter.tsx | import React, { Suspense, lazy } from 'react';
import type { ComponentProps } from 'react';
import type ReactSyntaxHighlighter from './syntaxhighlighter';
let languages: Parameters<typeof ReactSyntaxHighlighter.registerLanguage>[] = [];
let Comp: typeof ReactSyntaxHighlighter | null = null;
const LazySyntaxHighlight... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/syntaxhighlighter/clipboard.ts | code/core/src/components/components/syntaxhighlighter/clipboard.ts | import { global } from '@storybook/global';
const { document, window: globalWindow } = global;
async function copyUsingClipboardAPI(text: string) {
try {
await globalWindow.top?.navigator.clipboard.writeText(text);
} catch {
await globalWindow.navigator.clipboard.writeText(text);
}
}
async function cop... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/clipboard/ClipboardCode.tsx | code/core/src/components/components/clipboard/ClipboardCode.tsx | import React from 'react';
import { color, styled, typography } from 'storybook/theming';
const Code = styled.pre`
line-height: 18px;
padding: 11px 1rem;
white-space: pre-wrap;
background: rgba(0, 0, 0, 0.05);
color: ${color.darkest};
border-radius: 3px;
margin: 1rem 0;
width: 100%;
display: block;
... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/utils/getStoryHref.ts | code/core/src/components/components/utils/getStoryHref.ts | function parseQuery(queryString: string) {
const query: Record<string, string> = {};
const pairs = queryString.split('&');
for (let i = 0; i < pairs.length; i++) {
const pair = pairs[i].split('=');
query[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1] || '');
}
return query;
}
export const... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/ErrorFormatter/ErrorFormatter.stories.tsx | code/core/src/components/components/ErrorFormatter/ErrorFormatter.stories.tsx | import React from 'react';
import type { Meta, StoryObj } from '@storybook/react-vite';
import { dedent } from 'ts-dedent';
import { ErrorFormatter } from './ErrorFormatter';
const meta: Meta<typeof ErrorFormatter> = {
component: ErrorFormatter,
decorators: [
(Story) => (
<pre>
<Story />
... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/ErrorFormatter/ErrorFormatter.tsx | code/core/src/components/components/ErrorFormatter/ErrorFormatter.tsx | import React, { Fragment } from 'react';
import { global } from '@storybook/global';
import { styled } from 'storybook/theming';
const { document } = global;
const ErrorName = styled.strong(({ theme }) => ({
color: theme.color.orange,
}));
const ErrorImportant = styled.strong(({ theme }) => ({
color: theme.colo... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/Toolbar/Toolbar.stories.tsx | code/core/src/components/components/Toolbar/Toolbar.stories.tsx | import React from 'react';
import { Button } from 'storybook/internal/components';
import preview from '../../../../../.storybook/preview';
import { Toolbar } from './Toolbar';
const Children = () => (
<>
<Button ariaLabel={false} key="button1">
Button 1
</Button>
<Button ariaLabel={false} key="b... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/Toolbar/AbstractToolbar.stories.tsx | code/core/src/components/components/Toolbar/AbstractToolbar.stories.tsx | import { Button } from 'storybook/internal/components';
import preview from '../../../../../.storybook/preview';
import { AbstractToolbar } from './Toolbar';
const Children = () => (
<>
<Button ariaLabel={false} key="button1">
Button 1
</Button>
<Button ariaLabel={false} key="button2">
Butto... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/Toolbar/Toolbar.tsx | code/core/src/components/components/Toolbar/Toolbar.tsx | import type { FC } from 'react';
import React, { useRef } from 'react';
import { useToolbar } from '@react-aria/toolbar';
import { Bar, type BarProps } from '../Bar/Bar';
export interface AbstractToolbarProps {
className?: string;
children?: React.ReactNode;
'aria-label'?: string;
'aria-labelledby'?: 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/placeholder/placeholder.tsx | code/core/src/components/components/placeholder/placeholder.tsx | import React, { Children } from 'react';
import { styled } from 'storybook/theming';
const Title = styled.div(({ theme }) => ({
fontWeight: theme.typography.weight.bold,
}));
const Desc = styled.div();
const Message = styled.div(({ theme }) => ({
padding: 30,
textAlign: 'center',
color: theme.color.defaultT... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/placeholder/placeholder.stories.tsx | code/core/src/components/components/placeholder/placeholder.stories.tsx | import React, { Fragment } from 'react';
import { Link } from '../typography/link/link';
import { Placeholder } from './placeholder';
export default {
component: Placeholder,
};
export const SingleChild = () => (
<Placeholder>This is a placeholder with single child, it's bolded</Placeholder>
);
export const TwoC... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/spaced/Spaced.tsx | code/core/src/components/components/spaced/Spaced.tsx | import React from 'react';
import { ignoreSsrWarning, styled } from 'storybook/theming';
const toNumber = (input: any) => (typeof input === 'number' ? input : Number(input));
export interface ContainerProps {
col?: number;
row?: number;
outer?: number;
}
const Container = styled.div<ContainerProps>(
({ them... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/spaced/Spaced.stories.tsx | code/core/src/components/components/spaced/Spaced.stories.tsx | import type { ComponentProps } from 'react';
import React from 'react';
import { styled } from 'storybook/theming';
import { Spaced } from './Spaced';
const PlaceholderBlock = styled.div(({ color }) => ({
background: color || 'hotpink',
padding: 20,
}));
const PlaceholderInline = styled.span(({ color }) => ({
... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/ActionList/ActionList.tsx | code/core/src/components/components/ActionList/ActionList.tsx | import React, { type ComponentProps, forwardRef } from 'react';
import type { TransitionStatus } from 'react-transition-state';
import { styled } from 'storybook/theming';
import { Button } from '../Button/Button';
import { ToggleButton } from '../ToggleButton/ToggleButton';
const ActionListItem = styled.li<{
acti... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/ActionList/ActionList.stories.tsx | code/core/src/components/components/ActionList/ActionList.stories.tsx | import { CheckIcon, EllipsisIcon, PlayAllHollowIcon } from '@storybook/icons';
import { Badge, Form, ProgressSpinner } from '../..';
import preview from '../../../../../.storybook/preview';
import { Shortcut } from '../../../manager/container/Menu';
import { ActionList } from './ActionList';
const meta = preview.meta... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/Bar/Bar.stories.tsx | code/core/src/components/components/Bar/Bar.stories.tsx | import React from 'react';
import { styled } from 'storybook/theming';
import preview from '../../../../../.storybook/preview';
import { Bar } from './Bar';
const Wrapper = styled.div(({ theme }) => ({
background: theme.background.app,
border: `1px solid ${theme.appBorderColor}`,
maxWidth: 500,
height: 200,
... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/Bar/FlexBar.stories.tsx | code/core/src/components/components/Bar/FlexBar.stories.tsx | import React from 'react';
import { styled } from 'storybook/theming';
import preview from '../../../../../.storybook/preview';
import { FlexBar } from './Bar';
const meta = preview.meta({ component: FlexBar, title: 'Bar/FlexBar (deprecated)' });
export default meta;
const Row = styled.div({
display: 'flex',
a... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/Bar/Bar.tsx | code/core/src/components/components/Bar/Bar.tsx | import React, { Children, forwardRef } from 'react';
import { deprecate } from 'storybook/internal/client-logger';
import { type CSSObject, styled } from 'storybook/theming';
export interface BarProps {
backgroundColor?: string;
border?: boolean;
className?: string;
children?: React.ReactNode;
scrollable?:... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/Bar/Separator.tsx | code/core/src/components/components/Bar/Separator.tsx | import React, { Fragment } from 'react';
import { styled } from 'storybook/theming';
export interface SeparatorProps {
force?: boolean;
}
export const Separator = styled.span<SeparatorProps>(
({ theme }) => ({
width: 1,
height: 20,
background: theme.appBorderColor,
marginLeft: 2,
marginRight:... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/Loader/Loader.stories.tsx | code/core/src/components/components/Loader/Loader.stories.tsx | import React from 'react';
import { Loader } from './Loader';
const withBackground = (storyFn: any) => (
<div
style={{
position: 'fixed',
top: 0,
left: 0,
width: '100vw',
height: '100vh',
background:
'linear-gradient(to right, rgba(56,56,56,1) 0%, rgba(0,0,0,1) 50%, r... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/Loader/Loader.tsx | code/core/src/components/components/Loader/Loader.tsx | import React from 'react';
import { LightningOffIcon } from '@storybook/icons';
import { transparentize } from 'polished';
import { keyframes, styled } from 'storybook/theming';
import { rotate360 } from '../shared/animation';
const LoaderWrapper = styled.div<{ size?: number }>(({ size = 32 }) => ({
borderRadius:... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/Collapsible/Collapsible.tsx | code/core/src/components/components/Collapsible/Collapsible.tsx | import React, {
type ComponentProps,
type ReactNode,
type SyntheticEvent,
useCallback,
useEffect,
useState,
} from 'react';
import { useId } from '@react-aria/utils';
import { styled } from 'storybook/theming';
const CollapsibleContent = styled.div<{ collapsed?: boolean }>(({ collapsed = false }) => ({
... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/Collapsible/Collapsible.stories.tsx | code/core/src/components/components/Collapsible/Collapsible.stories.tsx | import { useState } from 'react';
import preview from '../../../../../.storybook/preview';
import type { useCollapsible } from './Collapsible';
import { Collapsible } from './Collapsible';
const toggle = ({
isCollapsed,
toggleProps,
}: {
isCollapsed: boolean;
toggleProps: ReturnType<typeof useCollapsible>['to... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/Button/Button.stories.tsx | code/core/src/components/components/Button/Button.stories.tsx | import React from 'react';
import { FaceHappyIcon } from '@storybook/icons';
import { fn } from 'storybook/test';
import { styled } from 'storybook/theming';
import preview from '../../../../../.storybook/preview';
import { Button } from './Button';
const meta = preview.meta({
id: 'button-component',
title: 'Bu... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/Button/Button.tsx | code/core/src/components/components/Button/Button.tsx | import type { ComponentProps } from 'react';
import React, { forwardRef, useEffect, useMemo, useState } from 'react';
import { deprecate } from 'storybook/internal/client-logger';
import { Slot } from '@radix-ui/react-slot';
import { darken, lighten, rgba, transparentize } from 'polished';
import { type API_KeyCollec... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/Button/helpers/useAriaDescription.tsx | code/core/src/components/components/Button/helpers/useAriaDescription.tsx | import React, { type ReactElement } from 'react';
/**
* Provides a way to create an accessible description for an element. Returns a hidden element that
* contains the description and attributes to pass to the described element.
*
* @param description The description to provide for the element.
* @returns
*/
exp... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/Button/helpers/InteractiveTooltipWrapper.tsx | code/core/src/components/components/Button/helpers/InteractiveTooltipWrapper.tsx | import React, { type DOMAttributes, type ReactElement, useMemo } from 'react';
import { type API_KeyCollection, shortcutToHumanString } from 'storybook/manager-api';
import { TooltipNote } from '../../tooltip/TooltipNote';
import { TooltipProvider } from '../../tooltip/TooltipProvider';
export const InteractiveToolt... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/Button/helpers/InteractiveTooltipWrapper.stories.tsx | code/core/src/components/components/Button/helpers/InteractiveTooltipWrapper.stories.tsx | import React from 'react';
import { styled } from 'storybook/theming';
import preview from '../../../../../../.storybook/preview';
import { InteractiveTooltipWrapper } from './InteractiveTooltipWrapper';
const meta = preview.meta({
id: 'interactive-tooltip-wrapper-component',
title: 'InteractiveTooltipWrapper',
... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/shared/overlayHelpers.tsx | code/core/src/components/components/shared/overlayHelpers.tsx | import React, { type ButtonHTMLAttributes, type ReactNode, forwardRef, useState } from 'react';
import type { DecoratorFunction } from 'storybook/internal/csf';
import { UNSAFE_PortalProvider } from '@react-aria/overlays';
import type { PositionProps } from '@react-types/overlays';
import memoize from 'memoizerific';... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/shared/animation.ts | code/core/src/components/components/shared/animation.ts | import { keyframes } from 'storybook/theming';
export const rotate360 = keyframes`
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
`;
| typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/Badge/Badge.tsx | code/core/src/components/components/Badge/Badge.tsx | import React from 'react';
import { darken, transparentize } from 'polished';
import { styled } from 'storybook/theming';
const BadgeWrapper = styled.div<BadgeProps>(
({ theme, compact }) => ({
display: 'inline-flex',
alignItems: 'center',
justifyContent: 'center',
fontSize: theme.typography.size.s1... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/Badge/Badge.stories.tsx | code/core/src/components/components/Badge/Badge.stories.tsx | import type { Meta, StoryObj } from '@storybook/react-vite';
import { Badge } from './Badge';
const meta = {
component: Badge,
} satisfies Meta<typeof Badge>;
export default meta;
type Story = StoryObj<typeof meta>;
export const Default = { args: { children: 'Default' } } satisfies Story;
export const Active = { ... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/Tabs/StatelessTabsView.stories.tsx | code/core/src/components/components/Tabs/StatelessTabsView.stories.tsx | import { useState } from 'react';
import { Button, EmptyTabContent } from 'storybook/internal/components';
import { CrossIcon, ExpandIcon } from '@storybook/icons';
import { fn } from 'storybook/test';
import preview from '../../../../../.storybook/preview';
import { StatelessTab } from './StatelessTab';
import { 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/Tabs/StatelessTabsView.tsx | code/core/src/components/components/Tabs/StatelessTabsView.tsx | import type { FC, ReactNode } from 'react';
import React from 'react';
import { Tabs } from 'react-aria-components/patched-dist/Tabs';
import { styled } from 'storybook/theming';
import { Bar } from '../Bar/Bar';
import { EmptyTabContent } from './EmptyTabContent';
import type { TabsViewProps } from './TabsView';
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/Tabs/TabList.stories.tsx | code/core/src/components/components/Tabs/TabList.stories.tsx | import { Bar } from 'storybook/internal/components';
import { expect } from 'storybook/test';
import preview from '../../../../../.storybook/preview';
import { TabList } from './TabList';
import { TabPanel } from './TabPanel';
import type { TabProps } from './TabsView';
import { useTabsState } from './TabsView';
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/Tabs/EmptyTabContent.tsx | code/core/src/components/components/Tabs/EmptyTabContent.tsx | import React from 'react';
import { styled } from 'storybook/theming';
const Wrapper = styled.div(({ theme }) => ({
height: '100%',
display: 'flex',
padding: 30,
alignItems: 'center',
justifyContent: 'center',
flexDirection: 'column',
gap: 15,
background: theme.background.content,
}));
const Content ... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/Tabs/StatelessTabPanel.tsx | code/core/src/components/components/Tabs/StatelessTabPanel.tsx | import type { FC, ReactNode } from 'react';
import React from 'react';
import { TabPanel } from 'react-aria-components/patched-dist/Tabs';
import { styled } from 'storybook/theming';
import { ScrollArea } from '../ScrollArea/ScrollArea';
export interface StatelessTabPanelProps {
/** Content of the tab panel. */
... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/Tabs/TabPanel.tsx | code/core/src/components/components/Tabs/TabPanel.tsx | import type { FC, HTMLAttributes } from 'react';
import React, { useRef } from 'react';
import { useTabPanel } from '@react-aria/tabs';
import type { TabListState } from '@react-stately/tabs';
import type { Node } from '@react-types/shared';
import { styled } from 'storybook/theming';
import { ScrollArea } from '../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/Tabs/TabPanel.stories.tsx | code/core/src/components/components/Tabs/TabPanel.stories.tsx | import type { FC } from 'react';
import { useState } from 'react';
import type { TabListState } from '@react-stately/tabs';
import { expect, userEvent, within } from 'storybook/test';
import preview from '../../../../../.storybook/preview';
import { TabList } from './TabList';
import { TabPanel } from './TabPanel';
i... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/Tabs/StatelessTabList.tsx | code/core/src/components/components/Tabs/StatelessTabList.tsx | import type { FC, ReactNode } from 'react';
import React, { useCallback, useEffect, useRef, useState } from 'react';
import { ChevronSmallLeftIcon, ChevronSmallRightIcon } from '@storybook/icons';
import { TabList as TabListUpstream } from 'react-aria-components/patched-dist/Tabs';
import { styled } from 'storybook/t... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/Tabs/Tabs.helpers.tsx | code/core/src/components/components/Tabs/Tabs.helpers.tsx | import type { FC, PropsWithChildren, ReactChild, ReactElement, ReactNode } from 'react';
import React, { Children } from 'react';
import { deprecate } from 'storybook/internal/client-logger';
import type { Addon_RenderOptions } from 'storybook/internal/types';
import { styled } from 'storybook/theming';
import 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/Tabs/Tabs.stories.tsx | code/core/src/components/components/Tabs/Tabs.stories.tsx | import React from 'react';
import { Button } from 'storybook/internal/components';
import { BottomBarIcon, CloseIcon } from '@storybook/icons';
import type { Meta, StoryObj } from '@storybook/react-vite';
import { action } from 'storybook/actions';
import { expect, spyOn } from 'storybook/test';
import { userEvent ... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/Tabs/Tabs.tsx | code/core/src/components/components/Tabs/Tabs.tsx | /* eslint-disable react/destructuring-assignment */
import type { FC, PropsWithChildren, ReactElement, ReactNode, SyntheticEvent } from 'react';
import React, { Component, forwardRef, memo, useMemo } from 'react';
import { deprecate } from 'storybook/internal/client-logger';
import { sanitize } from 'storybook/interna... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/Tabs/TabsView.stories.tsx | code/core/src/components/components/Tabs/TabsView.stories.tsx | import { useState } from 'react';
import { Button, EmptyTabContent } from 'storybook/internal/components';
import { CrossIcon, ExpandIcon } from '@storybook/icons';
import { fn } from 'storybook/test';
import preview from '../../../../../.storybook/preview';
import { TabsView } from './TabsView';
const DEFAULT_TAB... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/Tabs/Button.tsx | code/core/src/components/components/Tabs/Button.tsx | import type {
AnchorHTMLAttributes,
ButtonHTMLAttributes,
DetailedHTMLProps,
ForwardRefExoticComponent,
ForwardedRef,
ReactElement,
ReactNode,
RefAttributes,
} from 'react';
import React, { forwardRef } from 'react';
import { deprecate } from 'storybook/internal/client-logger';
import { isPropValid, 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/Tabs/Tabs.hooks.tsx | code/core/src/components/components/Tabs/Tabs.hooks.tsx | import React, { useCallback, useLayoutEffect, useRef, useState } from 'react';
import { deprecate } from 'storybook/internal/client-logger';
import { sanitize } from 'storybook/internal/csf';
import { styled } from 'storybook/theming';
import useResizeObserver from 'use-resize-observer';
import { PopoverProvider } f... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/Tabs/TabList.tsx | code/core/src/components/components/Tabs/TabList.tsx | import type { FC, HTMLAttributes } from 'react';
import React, { useCallback, useEffect, useRef, useState } from 'react';
import { ChevronSmallLeftIcon, ChevronSmallRightIcon } from '@storybook/icons';
import { useTab, useTabList } from '@react-aria/tabs';
import type { TabListState } from '@react-stately/tabs';
impo... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/Tabs/StatelessTab.tsx | code/core/src/components/components/Tabs/StatelessTab.tsx | import type { FC } from 'react';
import React from 'react';
import { Tab } from 'react-aria-components/patched-dist/Tabs';
import { styled } from 'storybook/theming';
export interface StatelessTabProps {
/** Unique id of the Tab, must match that of its corresponding TabPanel. */
name: string;
/** Tab button 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/Tabs/EmptyTabContent.stories.tsx | code/core/src/components/components/Tabs/EmptyTabContent.stories.tsx | import React from 'react';
import { Link } from 'storybook/internal/components';
import { DocumentIcon } from '@storybook/icons';
import type { Meta, StoryObj } from '@storybook/react-vite';
import { EmptyTabContent } from './EmptyTabContent';
export default {
title: 'Tabs/TabContentEmpty',
component: EmptyTab... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/Tabs/TabsView.tsx | code/core/src/components/components/Tabs/TabsView.tsx | import type { ComponentProps, FC, HTMLAttributes, ReactElement, ReactNode } from 'react';
import React from 'react';
import { Item } from '@react-stately/collections';
import type { TabListState } from '@react-stately/tabs';
import { useTabListState } from '@react-stately/tabs';
import type { Key } from '@react-types/... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/Zoom/Zoom.tsx | code/core/src/components/components/Zoom/Zoom.tsx | import { ZoomElement } from './ZoomElement';
import { ZoomIFrame } from './ZoomIFrame';
export const Zoom = {
Element: ZoomElement,
IFrame: ZoomIFrame,
};
| typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/Zoom/ZoomElement.tsx | code/core/src/components/components/Zoom/ZoomElement.tsx | import type { ReactElement } from 'react';
import React, { useCallback, useEffect, useRef, useState } from 'react';
import { styled } from 'storybook/theming';
import type { ResizeHandler } from 'use-resize-observer';
import useResizeObserver from 'use-resize-observer';
const ZoomElementWrapper = styled.div<{ centere... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/Zoom/Zoom.stories.tsx | code/core/src/components/components/Zoom/Zoom.stories.tsx | import type { CSSProperties } from 'react';
import React, { useEffect, useState } from 'react';
import { Zoom } from './Zoom';
export default {
component: Zoom,
argTypes: {
scale: {
control: { type: 'range', min: 0.2, max: 30, step: 0.02 },
},
},
parameters: {
chromatic: { delay: 500, diffTh... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/Zoom/ZoomIFrame.tsx | code/core/src/components/components/Zoom/ZoomIFrame.tsx | import type { ReactElement, RefObject } from 'react';
import React, { Component } from 'react';
export type IZoomIFrameProps = {
scale: number;
children: ReactElement<HTMLIFrameElement>;
iFrameRef: RefObject<HTMLIFrameElement>;
active?: boolean;
};
export class ZoomIFrame extends Component<IZoomIFrameProps> {... | 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/DocumentFormatting.tsx | code/core/src/components/components/typography/DocumentFormatting.tsx | export const nameSpaceClassNames = ({ ...props }, key: string) => {
const classes = [props.class, props.className];
delete props.class;
props.className = ['sbdocs', `sbdocs-${key}`, ...classes].filter(Boolean).join(' ');
return props;
};
| 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/ResetWrapper.tsx | code/core/src/components/components/typography/ResetWrapper.tsx | import { styled } from 'storybook/theming';
import { withReset } from './lib/common';
/**
* This is a "local" reset to style subtrees with Storybook styles
*
* We can't style individual elements (e.g. h1, h2, etc.) in here because the CSS specificity is too
* high, so those styles can too easily override child el... | 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/DocumentWrapper.stories.tsx | code/core/src/components/components/typography/DocumentWrapper.stories.tsx | import React from 'react';
import { DocumentWrapper } from './DocumentWrapper';
export default {
component: DocumentWrapper,
decorators: [(storyFn: any) => <div style={{ width: '600px' }}>{storyFn()}</div>],
};
export const WithDOM = () => (
<DocumentWrapper>
<h1>h1 Heading</h1>
<h2>h2 Heading</h2>
... | 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/DocumentWrapper.tsx | code/core/src/components/components/typography/DocumentWrapper.tsx | import { styled } from 'storybook/theming';
export const DocumentWrapper = styled.div(({ theme }) => ({
fontSize: `${theme.typography.size.s2}px`,
lineHeight: '1.6',
h1: {
fontSize: `${theme.typography.size.l1}px`,
fontWeight: theme.typography.weight.bold,
},
h2: {
fontSize: `${theme.typography.... | 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/components.tsx | code/core/src/components/components/typography/components.tsx | import type {
AnchorHTMLAttributes,
BlockquoteHTMLAttributes,
DetailedHTMLProps,
HTMLAttributes,
ImgHTMLAttributes,
LiHTMLAttributes,
OlHTMLAttributes,
TableHTMLAttributes,
} from 'react';
import React from 'react';
import { nameSpaceClassNames } from './DocumentFormatting';
import { ResetWrapper } fro... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/components/components/typography/elements/Span.tsx | code/core/src/components/components/typography/elements/Span.tsx | import { styled } from 'storybook/theming';
import { withReset } from '../lib/common';
export const Span = styled.span(withReset, ({ theme }) => ({
'&.frame': {
display: 'block',
overflow: 'hidden',
'& > span': {
border: `1px solid ${theme.color.medium}`,
display: 'block',
float: 'lef... | 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/HR.tsx | code/core/src/components/components/typography/elements/HR.tsx | import { styled } from 'storybook/theming';
export const HR = styled.hr(({ theme }) => ({
border: '0 none',
borderTop: `1px solid ${theme.appBorderColor}`,
height: 4,
padding: 0,
}));
| 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/H1.tsx | code/core/src/components/components/typography/elements/H1.tsx | import { styled } from 'storybook/theming';
import { headerCommon, withReset } from '../lib/common';
export const H1 = styled.h1(withReset, headerCommon, ({ theme }) => ({
fontSize: `${theme.typography.size.l1}px`,
fontWeight: theme.typography.weight.bold,
}));
| 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/DL.tsx | code/core/src/components/components/typography/elements/DL.tsx | import { styled } from 'storybook/theming';
import { withMargin, withReset } from '../lib/common';
export const DL = styled.dl(withReset, withMargin, {
padding: 0,
'& dt': {
fontSize: '14px',
fontWeight: 'bold',
fontStyle: 'italic',
padding: 0,
margin: '16px 0 4px',
},
'& dt:first-of-type'... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.