Skip to content

Commit

Permalink
Merge branch 'kasper/csf-factories' into kasper/base-factories
Browse files Browse the repository at this point in the history
  • Loading branch information
yannbf committed Jan 31, 2025
2 parents ce00ea5 + 66131f1 commit 1d637ec
Show file tree
Hide file tree
Showing 162 changed files with 4,328 additions and 1,398 deletions.
174 changes: 79 additions & 95 deletions .circleci/config.yml

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
22.6.0
22.13.1

894 changes: 0 additions & 894 deletions .yarn/releases/yarn-4.3.0.cjs

This file was deleted.

934 changes: 934 additions & 0 deletions .yarn/releases/yarn-4.6.0.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ nodeLinker: node-modules

npmPublishAccess: public

yarnPath: .yarn/releases/yarn-4.3.0.cjs
yarnPath: .yarn/releases/yarn-4.6.0.cjs
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 8.5.2

- Addon Test: Support Vitest 3 browser.test.instances field - [#30309](https://github.com/storybookjs/storybook/pull/30309), thanks @valentinpalkovic!
- CLI: Corrected Next.js createScript for pnpm. - [#30304](https://github.com/storybookjs/storybook/pull/30304), thanks @zhyd1997!

## 8.5.1

- Addon Test: Replace `interaction test` -> `component test` - [#30333](https://github.com/storybookjs/storybook/pull/30333), thanks @kylegach!
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.prerelease.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 8.6.0-alpha.2

- Addon Test: Support Vitest 3 browser.test.instances field - [#30309](https://github.com/storybookjs/storybook/pull/30309), thanks @valentinpalkovic!
- Bun: Add support for text lock file - [#30160](https://github.com/storybookjs/storybook/pull/30160), thanks @Arctomachine!
- CLI: Corrected Next.js createScript for pnpm. - [#30304](https://github.com/storybookjs/storybook/pull/30304), thanks @zhyd1997!

## 8.6.0-alpha.1

- Addon Test: Replace `interaction test` -> `component test` - [#30333](https://github.com/storybookjs/storybook/pull/30333), thanks @kylegach!
Expand Down
2 changes: 1 addition & 1 deletion MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@

Storybook now supports [Angular's experimental zoneless mode](https://angular.dev/guide/experimental/zoneless). This mode is intended to improve performance by removing Angular's zone.js dependency. To enable zoneless mode in your Angular Storybook, set the `experimentalZoneless` config in your `angular.json` file:

````diff
```diff
{
"projects": {
"your-project": {
Expand Down
934 changes: 934 additions & 0 deletions code/.yarn/releases/yarn-4.6.0.cjs

Large diffs are not rendered by default.

5 changes: 1 addition & 4 deletions code/.yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ plugins:
- path: ../.yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: '@yarnpkg/plugin-workspace-tools'

# See https://github.com/nrwl/nx/issues/22177
supportedArchitectures:
cpu:
- current
Expand All @@ -36,6 +35,4 @@ supportedArchitectures:
unsafeHttpWhitelist:
- localhost

yarnPath: ../.yarn/releases/yarn-4.3.0.cjs
# Sometimes you get a "The remote archive doesn't match the expected checksum" error, uncommenting this line will fix it
# checksumBehavior: 'update'
yarnPath: .yarn/releases/yarn-4.6.0.cjs
2 changes: 1 addition & 1 deletion code/addons/a11y/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-a11y",
"version": "8.6.0-alpha.1",
"version": "8.6.0-alpha.2",
"description": "Test component compliance with web accessibility standards",
"keywords": [
"a11y",
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
Expand Up @@ -42,13 +42,13 @@ const getFilter = (filterName: string) => {
return `url('#${filterName}')`;
};

const Hidden = styled.div(() => ({
const Hidden = styled.div({
'&, & svg': {
position: 'absolute',
width: 0,
height: 0,
},
}));
});

const ColorIcon = styled.span<{ filter: string }>(
{
Expand Down
1 change: 1 addition & 0 deletions code/addons/a11y/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ import * as addonAnnotations from './preview';

export { PARAM_KEY } from './constants';
export * from './params';
export type { A11yParameters } from './types';

export default () => definePreview(addonAnnotations);
2 changes: 1 addition & 1 deletion code/addons/a11y/src/params.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ElementContext, ImpactValue, RunOptions, Spec } from 'axe-core';
import type { ElementContext, RunOptions, Spec } from 'axe-core';

export interface Setup {
element?: ElementContext;
Expand Down
48 changes: 47 additions & 1 deletion code/addons/a11y/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,49 @@
import type { AxeResults } from 'axe-core';
import type { AxeResults, ElementContext, RunOptions, Spec } from 'axe-core';

export type A11YReport = AxeResults | { error: Error };

export interface A11yParameters {
/**
* Accessibility configuration
*
* @see https://storybook.js.org/docs/writing-tests/accessibility-testing
*/
a11y?: {
/** Manual configuration for specific elements */
element?: ElementContext;

/**
* Configuration for the accessibility rules
*
* @see https://github.com/dequelabs/axe-core/blob/develop/doc/API.md#api-name-axeconfigure
*/
config?: Spec;

/**
* Options for the accessibility checks To learn more about the available options,
*
* @see https://github.com/dequelabs/axe-core/blob/develop/doc/API.md#options-parameter
*/
options?: RunOptions;

/** Remove the addon panel and disable the addon's behavior */
disable?: boolean;
};
}

export interface A11yGlobals {
/**
* Accessibility configuration
*
* @see https://storybook.js.org/docs/writing-tests/accessibility-testing
*/
a11y: {
/**
* Prevent the addon from executing automated accessibility checks upon visiting a story. You
* can still trigger the checks from the addon panel.
*
* @see https://storybook.js.org/docs/writing-tests/accessibility-testing#turn-off-automated-a11y-tests
*/
manual?: boolean;
};
}
2 changes: 1 addition & 1 deletion code/addons/actions/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-actions",
"version": "8.6.0-alpha.1",
"version": "8.6.0-alpha.2",
"description": "Get UI feedback when an action is performed on an interactive element",
"keywords": [
"storybook",
Expand Down
2 changes: 2 additions & 0 deletions code/addons/actions/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ export * from './models';
export * from './runtime';

export default () => definePreview(addonAnnotations);

export type { ActionsParameters } from './types';
38 changes: 38 additions & 0 deletions code/addons/actions/src/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
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 has dozens (or hundreds) of methods and you do not
* want to manually apply the fn utility for each of those methods. However, this is not the
* recommended way of writing actions. That's because automatically inferred args are not
* available as spies in your play function. If you use argTypesRegex and your stories have play
* functions, you will need to also define args with the fn utility to test them in your play
* function.
*
* @example `argTypesRegex: '^on.*'`
*/
argTypesRegex?: string;

/** Remove the addon panel and disable the addon's behavior */
disable?: boolean;

/**
* Binds a standard HTML event handler to the outermost HTML element rendered by your component
* and triggers an action when the event is called for a given selector. The format is
* `<eventname> <selector>`. The selector is optional; it defaults to all elements.
*
* **To enable this feature, you must use the `withActions` decorator.**
*
* @example `handles: ['mouseover', 'click .btn']`
*
* @see https://storybook.js.org/docs/essentials/actions#action-event-handlers
*/
handles?: string[];
};
}
2 changes: 1 addition & 1 deletion code/addons/backgrounds/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-backgrounds",
"version": "8.6.0-alpha.1",
"version": "8.6.0-alpha.2",
"description": "Switch backgrounds to view components in different settings",
"keywords": [
"addon",
Expand Down
2 changes: 2 additions & 0 deletions code/addons/backgrounds/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ import { definePreview } from 'storybook/internal/preview-api';
import * as addonAnnotations from './preview';

export default () => definePreview(addonAnnotations);

export type { BackgroundsParameters, BackgroundsGlobals } from './types';
30 changes: 30 additions & 0 deletions code/addons/backgrounds/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,33 @@ export interface Config {

export type GlobalState = { value: string | undefined; grid: boolean };
export type GlobalStateUpdate = Partial<GlobalState>;

export interface BackgroundsParameters {
/**
* Backgrounds configuration
*
* @see https://storybook.js.org/docs/essentials/backgrounds#parameters
*/
backgrounds: {
/** Default background color */
default?: string;

/** Remove the addon panel and disable the addon's behavior */
disable?: boolean;

/** Configuration for the background grid */
grid?: Partial<GridConfig>;

/** Available background colors */
values?: Array<Background>;
};
}

export interface BackgroundsGlobals {
/**
* Backgrounds configuration
*
* @see https://storybook.js.org/docs/essentials/backgrounds#globals
*/
backgrounds: GlobalState;
}
2 changes: 1 addition & 1 deletion code/addons/controls/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-controls",
"version": "8.6.0-alpha.1",
"version": "8.6.0-alpha.2",
"description": "Interact with component inputs dynamically in the Storybook UI",
"keywords": [
"addon",
Expand Down
2 changes: 2 additions & 0 deletions code/addons/controls/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ import { definePreview } from 'storybook/internal/preview-api';
export { PARAM_KEY } from './constants';

export default () => definePreview({});

export type { ControlsParameters } from './types';
37 changes: 37 additions & 0 deletions code/addons/controls/src/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
export interface ControlsParameters {
/**
* Controls configuration
*
* @see https://storybook.js.org/docs/essentials/controls#parameters-1
*/
controls: {
/** Remove the addon panel and disable the addon's behavior */
disable?: boolean;

/** Disable the ability to create or edit stories from the Controls panel */
disableSaveFromUI?: boolean;

/** Exclude specific properties from the Controls panel */
exclude?: string[] | RegExp;

/**
* Show the full documentation for each property in the Controls addon panel, including the
* description and default value.
*/
expanded?: boolean;

/** Exclude only specific properties in the Controls panel */
include?: string[] | RegExp;

/**
* Preset color swatches for the color picker control
*
* @example PresetColors: [{ color: '#ff4785', title: 'Coral' }, 'rgba(0, 159, 183, 1)',
* '#fe4a49']
*/
presetColors?: Array<string | { color: string; title?: string }>;

/** Controls sorting order */
sort?: 'none' | 'alpha' | 'requiredFirst';
};
}
2 changes: 1 addition & 1 deletion code/addons/docs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-docs",
"version": "8.6.0-alpha.1",
"version": "8.6.0-alpha.2",
"description": "Document component usage and properties in Markdown",
"keywords": [
"addon",
Expand Down
1 change: 1 addition & 0 deletions code/addons/docs/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ import * as addonAnnotations from './preview';

export * from '@storybook/blocks';
export { DocsRenderer } from './DocsRenderer';
export type { DocsParameters } from './types';

export default () => definePreview(addonAnnotations);
Loading

0 comments on commit 1d637ec

Please sign in to comment.