Skip to content

Commit

Permalink
add an /internal in the path to core subpaths from storybook
Browse files Browse the repository at this point in the history
  • Loading branch information
ndelangen committed Jun 28, 2024
1 parent 3e9d8bc commit 3a1e61c
Show file tree
Hide file tree
Showing 519 changed files with 959 additions and 866 deletions.
4 changes: 2 additions & 2 deletions code/.storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ const config: StorybookConfig = {
...(configType === 'DEVELOPMENT'
? {
'@storybook/components': componentsPath,
'storybook/components': componentsPath,
'storybook/internal/components': componentsPath,
'@storybook/manager-api': managerApiPath,
'storybook/manager-api': managerApiPath,
'storybook/internal/manager-api': managerApiPath,
}
: {}),
},
Expand Down
2 changes: 1 addition & 1 deletion code/.storybook/manager.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { addons } from 'storybook/manager-api';
import { addons } from 'storybook/internal/manager-api';
import startCase from 'lodash/startCase.js';

addons.setConfig({
Expand Down
8 changes: 4 additions & 4 deletions code/.storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import {
convert,
styled,
useTheme,
} from 'storybook/theming';
import { useArgs, DocsContext as DocsContextProps } from 'storybook/preview-api';
import type { PreviewWeb } from 'storybook/preview-api';
} from 'storybook/internal/theming';
import { useArgs, DocsContext as DocsContextProps } from 'storybook/internal/preview-api';
import type { PreviewWeb } from 'storybook/internal/preview-api';
import type { ReactRenderer } from '@storybook/react';
import type { Channel } from 'storybook/channels';
import type { Channel } from 'storybook/internal/channels';

import { DocsContext } from '@storybook/blocks';

Expand Down
4 changes: 2 additions & 2 deletions code/addons/a11y/src/a11yRunner.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { Mock } from 'vitest';
import { describe, beforeEach, it, expect, vi } from 'vitest';
import { addons } from 'storybook/preview-api';
import { addons } from 'storybook/internal/preview-api';
import { EVENTS } from './constants';

vi.mock('storybook/preview-api');
vi.mock('storybook/internal/preview-api');
const mockedAddons = vi.mocked(addons);

describe('a11yRunner', () => {
Expand Down
2 changes: 1 addition & 1 deletion code/addons/a11y/src/a11yRunner.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { global } from '@storybook/global';
import { addons } from 'storybook/preview-api';
import { addons } from 'storybook/internal/preview-api';
import { EVENTS } from './constants';
import type { A11yParameters } from './params';

Expand Down
6 changes: 3 additions & 3 deletions code/addons/a11y/src/components/A11YPanel.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import { describe, beforeEach, afterEach, it, expect, vi } from 'vitest';
import React from 'react';
import { render, waitFor, fireEvent, act, cleanup } from '@testing-library/react';

import { ThemeProvider, themes, convert } from 'storybook/theming';
import * as api from 'storybook/manager-api';
import { ThemeProvider, themes, convert } from 'storybook/internal/theming';
import * as api from 'storybook/internal/manager-api';

import { A11YPanel } from './A11YPanel';
import { EVENTS } from '../constants';

vi.mock('storybook/manager-api');
vi.mock('storybook/internal/manager-api');

global.ResizeObserver = require('resize-observer-polyfill');

Expand Down
6 changes: 3 additions & 3 deletions code/addons/a11y/src/components/A11YPanel.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { useCallback, useMemo, useState } from 'react';

import { styled } from 'storybook/theming';
import { styled } from 'storybook/internal/theming';

import { ActionBar, ScrollArea } from 'storybook/components';
import { ActionBar, ScrollArea } from 'storybook/internal/components';
import { SyncIcon, CheckIcon } from '@storybook/icons';

import type { AxeResults } from 'axe-core';
Expand All @@ -11,7 +11,7 @@ import {
useParameter,
useStorybookApi,
useStorybookState,
} from 'storybook/manager-api';
} from 'storybook/internal/manager-api';

import { Report } from './Report';

Expand Down
6 changes: 3 additions & 3 deletions code/addons/a11y/src/components/A11yContext.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import { describe, beforeEach, afterEach, it, expect, vi } from 'vitest';
import * as React from 'react';
import type { AxeResults } from 'axe-core';
import { render, act, cleanup } from '@testing-library/react';
import * as api from 'storybook/manager-api';
import { STORY_CHANGED } from 'storybook/core-events';
import * as api from 'storybook/internal/manager-api';
import { STORY_CHANGED } from 'storybook/internal/core-events';
import { HIGHLIGHT } from '@storybook/addon-highlight';

import { A11yContextProvider, useA11yContext } from './A11yContext';
import { EVENTS } from '../constants';

vi.mock('storybook/manager-api');
vi.mock('storybook/internal/manager-api');
const mockedApi = vi.mocked(api);

const storyId = 'jest';
Expand Down
6 changes: 3 additions & 3 deletions code/addons/a11y/src/components/A11yContext.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as React from 'react';
import { themes, convert } from 'storybook/theming';
import { themes, convert } from 'storybook/internal/theming';
import type { Result } from 'axe-core';
import { useChannel, useAddonState, useStorybookApi } from 'storybook/manager-api';
import { STORY_CHANGED, STORY_RENDERED } from 'storybook/core-events';
import { useChannel, useAddonState, useStorybookApi } from 'storybook/internal/manager-api';
import { STORY_CHANGED, STORY_RENDERED } from 'storybook/internal/core-events';
import { HIGHLIGHT } from '@storybook/addon-highlight';
import { ADDON_ID, EVENTS } from '../constants';

Expand Down
2 changes: 1 addition & 1 deletion code/addons/a11y/src/components/Report/Elements.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { FC } from 'react';
import React from 'react';

import { styled } from 'storybook/theming';
import { styled } from 'storybook/internal/theming';

import type { NodeResult } from 'axe-core';
import { Rules } from './Rules';
Expand Down
2 changes: 1 addition & 1 deletion code/addons/a11y/src/components/Report/HighlightToggle.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { styled } from 'storybook/theming';
import { styled } from 'storybook/internal/theming';

import type { NodeResult } from 'axe-core';
import { useA11yContext } from '../A11yContext';
Expand Down
2 changes: 1 addition & 1 deletion code/addons/a11y/src/components/Report/Info.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { FC } from 'react';
import React from 'react';

import { styled } from 'storybook/theming';
import { styled } from 'storybook/internal/theming';
import type { Result } from 'axe-core';

const Wrapper = styled.div({
Expand Down
2 changes: 1 addition & 1 deletion code/addons/a11y/src/components/Report/Item.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { Fragment, useState } from 'react';

import { styled } from 'storybook/theming';
import { styled } from 'storybook/internal/theming';

import type { Result } from 'axe-core';
import { Info } from './Info';
Expand Down
4 changes: 2 additions & 2 deletions code/addons/a11y/src/components/Report/Rules.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { FC } from 'react';
import React from 'react';
import { styled } from 'storybook/theming';
import { Badge } from 'storybook/components';
import { styled } from 'storybook/internal/theming';
import { Badge } from 'storybook/internal/components';
import type { CheckResult } from 'axe-core';
import { useResizeDetector } from 'react-resize-detector';

Expand Down
2 changes: 1 addition & 1 deletion code/addons/a11y/src/components/Report/Tags.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { FC } from 'react';
import React from 'react';

import { styled } from 'storybook/theming';
import { styled } from 'storybook/internal/theming';
import type { TagValue } from 'axe-core';

const Wrapper = styled.div({
Expand Down
2 changes: 1 addition & 1 deletion code/addons/a11y/src/components/Report/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { FC } from 'react';
import React, { Fragment } from 'react';
import { EmptyTabContent } from 'storybook/components';
import { EmptyTabContent } from 'storybook/internal/components';
import type { Result } from 'axe-core';

import { Item } from './Item';
Expand Down
2 changes: 1 addition & 1 deletion code/addons/a11y/src/components/Tabs.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';

import { styled } from 'storybook/theming';
import { styled } from 'storybook/internal/theming';
import type { NodeResult, Result } from 'axe-core';
import { useResizeDetector } from 'react-resize-detector';
import HighlightToggle from './Report/HighlightToggle';
Expand Down
2 changes: 1 addition & 1 deletion code/addons/a11y/src/components/VisionSimulator.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { describe, it, expect } from 'vitest';
import React from 'react';
import { render, fireEvent, screen, waitFor } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { ThemeProvider, themes, convert } from 'storybook/theming';
import { ThemeProvider, themes, convert } from 'storybook/internal/theming';
import { VisionSimulator, baseList } from './VisionSimulator';

const getOptionByNameAndPercentage = (option: string, percentage?: number) =>
Expand Down
4 changes: 2 additions & 2 deletions code/addons/a11y/src/components/VisionSimulator.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { ReactNode } from 'react';
import React, { useState } from 'react';
import { Global, styled } from 'storybook/theming';
import { IconButton, WithTooltip, TooltipLinkList } from 'storybook/components';
import { Global, styled } from 'storybook/internal/theming';
import { IconButton, WithTooltip, TooltipLinkList } from 'storybook/internal/components';

import { AccessibilityIcon } from '@storybook/icons';
import { Filters } from './ColorFilters';
Expand Down
6 changes: 3 additions & 3 deletions code/addons/a11y/src/manager.test.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// @vitest-environment happy-dom

import { describe, it, expect, vi } from 'vitest';
import * as api from 'storybook/manager-api';
import type { Addon_BaseType } from 'storybook/types';
import * as api from 'storybook/internal/manager-api';
import type { Addon_BaseType } from 'storybook/internal/types';
import { PANEL_ID } from './constants';
import './manager';

vi.mock('storybook/manager-api');
vi.mock('storybook/internal/manager-api');
const mockedApi = vi.mocked<api.API>(api as any);
mockedApi.useAddonState = vi.fn();
const mockedAddons = vi.mocked(api.addons);
Expand Down
4 changes: 2 additions & 2 deletions code/addons/a11y/src/manager.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { addons, types, useAddonState } from 'storybook/manager-api';
import { Badge, Spaced } from 'storybook/components';
import { addons, types, useAddonState } from 'storybook/internal/manager-api';
import { Badge, Spaced } from 'storybook/internal/components';
import { ADDON_ID, PANEL_ID, PARAM_KEY } from './constants';
import { VisionSimulator } from './components/VisionSimulator';
import { A11YPanel } from './components/A11YPanel';
Expand Down
2 changes: 1 addition & 1 deletion code/addons/actions/src/addArgs.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ArgsEnhancer } from 'storybook/types';
import type { ArgsEnhancer } from 'storybook/internal/types';
import { addActionsFromArgTypes, inferActionsFromArgTypesRegex } from './addArgsHelpers';

export const argsEnhancers: ArgsEnhancer[] = [
Expand Down
2 changes: 1 addition & 1 deletion code/addons/actions/src/addArgsHelpers.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, it, expect } from 'vitest';
import type { StoryContext } from 'storybook/types';
import type { StoryContext } from 'storybook/internal/types';
import { inferActionsFromArgTypesRegex, addActionsFromArgTypes } from './addArgsHelpers';

describe('actions parameter enhancers', () => {
Expand Down
2 changes: 1 addition & 1 deletion code/addons/actions/src/addArgsHelpers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Args, Renderer, ArgsEnhancer } from 'storybook/types';
import type { Args, Renderer, ArgsEnhancer } from 'storybook/internal/types';
import { action } from './runtime/action';

// interface ActionsParameter {
Expand Down
6 changes: 3 additions & 3 deletions code/addons/actions/src/components/ActionLogger/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { ElementRef, ReactNode } from 'react';
import React, { forwardRef, Fragment, useEffect, useRef } from 'react';
import type { Theme } from 'storybook/theming';
import { styled, withTheme } from 'storybook/theming';
import type { Theme } from 'storybook/internal/theming';
import { styled, withTheme } from 'storybook/internal/theming';

import { Inspector } from 'react-inspector';
import { ActionBar, ScrollArea } from 'storybook/components';
import { ActionBar, ScrollArea } from 'storybook/internal/components';

import { Action, Counter, InspectorContainer } from './style';
import type { ActionDisplay } from '../../models';
Expand Down
2 changes: 1 addition & 1 deletion code/addons/actions/src/components/ActionLogger/style.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { styled } from 'storybook/theming';
import { styled } from 'storybook/internal/theming';
import { opacify } from 'polished';

export const Action = styled.div({
Expand Down
4 changes: 2 additions & 2 deletions code/addons/actions/src/containers/ActionLogger/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { Component } from 'react';
import { dequal as deepEqual } from 'dequal';

import type { API } from 'storybook/manager-api';
import { STORY_CHANGED } from 'storybook/core-events';
import type { API } from 'storybook/internal/manager-api';
import { STORY_CHANGED } from 'storybook/internal/core-events';

import { ActionLogger as ActionLoggerComponent } from '../../components/ActionLogger';
import type { ActionDisplay } from '../../models';
Expand Down
4 changes: 2 additions & 2 deletions code/addons/actions/src/decorator.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { global } from '@storybook/global';
import { useEffect, makeDecorator } from 'storybook/preview-api';
import type { PartialStoryFn, Renderer } from 'storybook/types';
import { useEffect, makeDecorator } from 'storybook/internal/preview-api';
import type { PartialStoryFn, Renderer } from 'storybook/internal/types';
import { actions } from './runtime/actions';

import { PARAM_KEY } from './constants';
Expand Down
2 changes: 1 addition & 1 deletion code/addons/actions/src/loaders.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable no-underscore-dangle */
import type { LoaderFunction } from 'storybook/types';
import type { LoaderFunction } from 'storybook/internal/types';
import { global } from '@storybook/global';
import type { onMockCall as onMockCallType } from '@storybook/test';
import { action } from './runtime';
Expand Down
6 changes: 3 additions & 3 deletions code/addons/actions/src/manager.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { addons, types, useAddonState, useChannel } from 'storybook/manager-api';
import { STORY_CHANGED } from 'storybook/core-events';
import { Badge, Spaced } from 'storybook/components';
import { addons, types, useAddonState, useChannel } from 'storybook/internal/manager-api';
import { STORY_CHANGED } from 'storybook/internal/core-events';
import { Badge, Spaced } from 'storybook/internal/components';
import ActionLogger from './containers/ActionLogger';
import { ADDON_ID, CLEAR_ID, EVENT_ID, PANEL_ID, PARAM_KEY } from './constants';

Expand Down
4 changes: 2 additions & 2 deletions code/addons/actions/src/runtime/__tests__/action.test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { describe, it, expect, vi } from 'vitest';
import { addons } from 'storybook/preview-api';
import { addons } from 'storybook/internal/preview-api';
import { action, configureActions } from '../..';

vi.mock('storybook/preview-api');
vi.mock('storybook/internal/preview-api');

const createChannel = () => {
const channel = { emit: vi.fn() };
Expand Down
4 changes: 2 additions & 2 deletions code/addons/actions/src/runtime/__tests__/actions.test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { describe, it, expect, vi } from 'vitest';
import { addons } from 'storybook/preview-api';
import { addons } from 'storybook/internal/preview-api';
import { actions } from '../..';

vi.mock('storybook/preview-api');
vi.mock('storybook/internal/preview-api');

const createChannel = () => {
const channel = { emit: vi.fn() };
Expand Down
8 changes: 4 additions & 4 deletions code/addons/actions/src/runtime/action.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { v4 as uuidv4 } from 'uuid';
import type { PreviewWeb } from 'storybook/preview-api';
import { addons } from 'storybook/preview-api';
import type { Renderer } from 'storybook/types';
import type { PreviewWeb } from 'storybook/internal/preview-api';
import { addons } from 'storybook/internal/preview-api';
import type { Renderer } from 'storybook/internal/types';
import { global } from '@storybook/global';
import { ImplicitActionsDuringRendering } from 'storybook/preview-errors';
import { ImplicitActionsDuringRendering } from 'storybook/internal/preview-errors';
import { EVENT_ID } from '../constants';
import type { ActionDisplay, ActionOptions, HandlerFunction } from '../models';
import { config } from './configureActions';
Expand Down
2 changes: 1 addition & 1 deletion code/addons/actions/src/typings.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
declare var FEATURES: import('storybook/types').StorybookConfigRaw['features'];
declare var FEATURES: import('storybook/internal/types').StorybookConfigRaw['features'];
2 changes: 1 addition & 1 deletion code/addons/backgrounds/src/components/ColorIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { styled } from 'storybook/theming';
import { styled } from 'storybook/internal/theming';

export const ColorIcon = styled.span(
({ background }: { background: string }) => ({
Expand Down
6 changes: 3 additions & 3 deletions code/addons/backgrounds/src/containers/BackgroundSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import type { FC } from 'react';
import React, { useState, Fragment, useCallback, useMemo, memo } from 'react';
import memoize from 'memoizerific';

import { useParameter, useGlobals } from 'storybook/manager-api';
import { logger } from 'storybook/client-logger';
import { IconButton, WithTooltip, TooltipLinkList } from 'storybook/components';
import { useParameter, useGlobals } from 'storybook/internal/manager-api';
import { logger } from 'storybook/internal/client-logger';
import { IconButton, WithTooltip, TooltipLinkList } from 'storybook/internal/components';

import { PhotoIcon } from '@storybook/icons';
import { PARAM_KEY as BACKGROUNDS_PARAM_KEY } from '../constants';
Expand Down
4 changes: 2 additions & 2 deletions code/addons/backgrounds/src/containers/GridSelector.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { FC } from 'react';
import React, { memo } from 'react';

import { useGlobals, useParameter } from 'storybook/manager-api';
import { IconButton } from 'storybook/components';
import { useGlobals, useParameter } from 'storybook/internal/manager-api';
import { IconButton } from 'storybook/internal/components';

import { GridIcon } from '@storybook/icons';
import { PARAM_KEY as BACKGROUNDS_PARAM_KEY } from '../constants';
Expand Down
8 changes: 6 additions & 2 deletions code/addons/backgrounds/src/decorators/withBackground.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { useMemo, useEffect } from 'storybook/preview-api';
import type { Renderer, PartialStoryFn as StoryFunction, StoryContext } from 'storybook/types';
import { useMemo, useEffect } from 'storybook/internal/preview-api';
import type {
Renderer,
PartialStoryFn as StoryFunction,
StoryContext,
} from 'storybook/internal/types';

import { PARAM_KEY as BACKGROUNDS_PARAM_KEY } from '../constants';
import {
Expand Down
Loading

0 comments on commit 3a1e61c

Please sign in to comment.