Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,12 @@ module.exports = {
],

addons: [
'@storybook/addon-essentials',
'@storybook/addon-controls',
'@storybook/addon-actions',
'storybook-source-link',
'@storybook/addon-webpack5-compiler-babel',
'@chromatic-com/storybook',
'@storybook/addon-viewport',
{
name: '@storybook/addon-a11y',
options: {
element: '#story-root',
context: '#story-root',
},
},
],
Expand Down
40 changes: 38 additions & 2 deletions .storybook/manager.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,43 @@
import { addons } from '@storybook/manager-api';
import { create } from '@storybook/theming/create';
import React from 'react';
import { addons, types, useParameter } from 'storybook/manager-api';
import { IconButton } from 'storybook/internal/components';
import { create } from 'storybook/theming/create';
import pkg from '../package.json';

const ADDON_ID = 'storybook/source-link';

const SourceLinkTool = () => {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This recreates the source link renderer addon that is no longer supported by SB 9.

const sourceLink = useParameter('sourceLink', null);
const prefix = useParameter('sourceLinkPrefix', null);
const link = sourceLink ? (prefix ? `${prefix}${sourceLink}` : sourceLink) : null;

if (!link) return null;

return (
<IconButton title={`View source: ${link}`} onClick={() => window.open(link)}>
<svg viewBox="0 0 14 14" width="14" height="14" style={{ marginRight: 4 }}>
<path
d="M3.5 1.75a.25.25 0 0 1 .25-.25h6.5a.25.25 0 0 1 .25.25v8.5a.25.25 0 0 1-.25.25h-6.5a.25.25 0 0 1-.25-.25V1.75Z"
fill="none"
stroke="currentColor"
strokeWidth="1.5"
/>
<path d="M5.75 4h2.5M5.75 6.5h2.5" stroke="currentColor" strokeWidth="1" />
</svg>
Source
</IconButton>
);
};

addons.register(ADDON_ID, () => {
addons.add(`${ADDON_ID}/tool`, {
type: types.TOOLEXTRA,
title: 'Source Link',
match: ({ viewMode }) => !!(viewMode && viewMode.match(/^(story|docs)$/)),
render: SourceLinkTool,
});
});

addons.setConfig({
theme: create({
base: 'dark',
Expand Down
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
nodejs 24.11.0
nodejs 24.13.1
yarn 1.22.18
23 changes: 8 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,19 +85,13 @@
"@babel/preset-env": "^7.24.7",
"@babel/preset-react": "^7.24.7",
"@babel/preset-typescript": "^7.24.7",
"@chromatic-com/storybook": "^5.1.2",
"@chromatic-com/storybook": "^4.1.3",
"@jest/types": "^30",
"@storybook/addon-a11y": "^8.6.18",
"@storybook/addon-actions": "^8.6.18",
"@storybook/addon-controls": "^8.6.18",
"@storybook/addon-essentials": "^8.6.18",
"@storybook/addon-links": "^8.6.18",
"@storybook/addon-viewport": "^8.6.18",
"@storybook/addon-webpack5-compiler-babel": "^3.0.3",
"@storybook/manager-api": "^8.6.18",
"@storybook/react": "^8.6.18",
"@storybook/react-webpack5": "^8.6.18",
"@storybook/theming": "^8.6.18",
"@storybook/addon-a11y": "^9.1.20",
"@storybook/addon-links": "^9.1.20",
"@storybook/addon-webpack5-compiler-babel": "^4.0.1",
"@storybook/react": "^9.1.20",
"@storybook/react-webpack5": "^9.1.20",
"@testing-library/dom": "^8.13.0",
"@testing-library/jest-dom": "^6.4.6",
"@testing-library/react": "^11.2.6",
Expand Down Expand Up @@ -147,10 +141,9 @@
"react-dom": "^16.14.0",
"regenerator-runtime": "^0.13.7",
"sinon": "^9.2.1",
"storybook": "^8.6.18",
"storybook-source-link": "^4.0.1",
"storybook": "^9.1.20",
"ts-node": "^10.7.0",
"typescript": "^4.6.3",
"typescript": "^4.9.5",
"uncontrollable": "^4.1.0"
},
"resolutions": {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Activity/Activity.stories.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { action as sbAction } from '@storybook/addon-actions';
import { action as sbAction } from 'storybook/actions';

Check warning on line 1 in src/components/Activity/Activity.stories.js

View workflow job for this annotation

GitHub Actions / test

Unable to resolve path to module 'storybook/actions'
import React from 'react';

Check warning on line 2 in src/components/Activity/Activity.stories.js

View workflow job for this annotation

GitHub Actions / test

`react` import should occur before import of `storybook/actions`
import { colors } from '../../tooling/colors';
import Activity from './Activity';
Expand Down
2 changes: 1 addition & 1 deletion src/components/Address/AddressInput.stories.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { action } from '@storybook/addon-actions';
import { action } from 'storybook/actions';

Check warning on line 1 in src/components/Address/AddressInput.stories.js

View workflow job for this annotation

GitHub Actions / test

Unable to resolve path to module 'storybook/actions'
import React from 'react';

Check warning on line 2 in src/components/Address/AddressInput.stories.js

View workflow job for this annotation

GitHub Actions / test

`react` import should occur before import of `storybook/actions`
import Label from '../Label/Label';
import AddressInput from './AddressInput';
Expand Down
2 changes: 1 addition & 1 deletion src/components/Address/CountryInput.stories.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { action } from '@storybook/addon-actions';
import { action } from 'storybook/actions';

Check warning on line 1 in src/components/Address/CountryInput.stories.js

View workflow job for this annotation

GitHub Actions / test

Unable to resolve path to module 'storybook/actions'
import React from 'react';

Check warning on line 2 in src/components/Address/CountryInput.stories.js

View workflow job for this annotation

GitHub Actions / test

`react` import should occur before import of `storybook/actions`
import CountryInput from './CountryInput';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { action } from '@storybook/addon-actions';
import { action } from 'storybook/actions';

Check warning on line 1 in src/components/Address/InternationalAddressInput.stories.js

View workflow job for this annotation

GitHub Actions / test

Unable to resolve path to module 'storybook/actions'
import React from 'react';

Check warning on line 2 in src/components/Address/InternationalAddressInput.stories.js

View workflow job for this annotation

GitHub Actions / test

`react` import should occur before import of `storybook/actions`
import uncontrollable from 'uncontrollable';
import InternationalAddressInput from './InternationalAddressInput';
Expand Down
2 changes: 1 addition & 1 deletion src/components/Address/StateInput.stories.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { action } from '@storybook/addon-actions';
import { action } from 'storybook/actions';

Check warning on line 1 in src/components/Address/StateInput.stories.js

View workflow job for this annotation

GitHub Actions / test

Unable to resolve path to module 'storybook/actions'
import React from 'react';

Check warning on line 2 in src/components/Address/StateInput.stories.js

View workflow job for this annotation

GitHub Actions / test

`react` import should occur before import of `storybook/actions`
import StateInput from './StateInput';

Expand Down
2 changes: 1 addition & 1 deletion src/components/Alert/Alert.stories.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { action } from '@storybook/addon-actions';
import { action } from 'storybook/actions';
import React from 'react';
import { colors } from '../../tooling/colors';
import Alert from './Alert';
Expand Down
2 changes: 1 addition & 1 deletion src/components/BlockPanel/BlockPanel.stories.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { action } from '@storybook/addon-actions';
import { action } from 'storybook/actions';
import React from 'react';
import Button from '../Button/Button';
import ButtonGroup from '../Button/ButtonGroup';
Expand Down
2 changes: 1 addition & 1 deletion src/components/Button/Button.stories.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { action } from '@storybook/addon-actions';
import { action } from 'storybook/actions';
import React from 'react';
import { buttonColors } from '../../tooling/colors';
import DropdownItem from '../Dropdown/DropdownItem';
Expand Down
2 changes: 1 addition & 1 deletion src/components/Calendar/Calendar.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { action } from '@storybook/addon-actions';
import { action } from 'storybook/actions';
import type { Meta, StoryObj } from '@storybook/react';
import Calendar from './Calendar';

Expand Down
2 changes: 1 addition & 1 deletion src/components/Calendar/MonthCalendar.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { action } from '@storybook/addon-actions';
import { action } from 'storybook/actions';
import { Meta, StoryObj } from '@storybook/react';
import React, { useState } from 'react';
import MonthCalendar from './MonthCalendar';
Expand Down
2 changes: 1 addition & 1 deletion src/components/Checkbox/CheckboxGroup.stories.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { action } from '@storybook/addon-actions';
import { action } from 'storybook/actions';
import React, { useState } from 'react';
import CheckboxGroup from './CheckboxGroup';

Expand Down
2 changes: 1 addition & 1 deletion src/components/Checkbox/CheckboxListInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class CheckboxListInput extends React.Component<CheckboxListInputProps> {
children,
(choice) =>
React.isValidElement(choice) &&
React.cloneElement(choice, {
React.cloneElement(choice as React.ReactElement<any>, {
type: 'checkbox',
selected: value,
onChange: this.onChange,
Expand Down
2 changes: 1 addition & 1 deletion src/components/Combobox/Combobox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function Combobox<T>({

const grouped = !!(optionsProp[0] as OptionGroup<T>)?.options;
const options: Option<T>[] = useMemo(() => {
if (optionsProp === [] || !optionsProp) {
if (!optionsProp || optionsProp.length === 0) {
return [];
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/Dropdown/Dropdown.stories.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { action } from '@storybook/addon-actions';
import { action } from 'storybook/actions';
import React from 'react';
import { colors } from '../../tooling/colors';
import Dropdown from './Dropdown';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { action } from '@storybook/addon-actions';
import { action } from 'storybook/actions';
import React from 'react';
import Button from '../Button/Button';
import ExpandableSection from './ExpandableSection';
Expand Down
2 changes: 1 addition & 1 deletion src/components/FeedbackButton/FeedbackButton.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { action } from '@storybook/addon-actions';
import { action } from 'storybook/actions';
import { Meta, StoryObj } from '@storybook/react';
import React from 'react';
import { buttonColors } from '../../tooling/colors';
Expand Down
2 changes: 1 addition & 1 deletion src/components/FilterList/FilterList.stories.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { action } from '@storybook/addon-actions';
import { action } from 'storybook/actions';
import React from 'react';
import FilterList from './FilterList';

Expand Down
2 changes: 1 addition & 1 deletion src/components/Form/Form.stories.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { action } from '@storybook/addon-actions';
import { action } from 'storybook/actions';
import React from 'react';
import AddressInput from '../Address/AddressInput';
import CountryInput from '../Address/CountryInput';
Expand Down
2 changes: 1 addition & 1 deletion src/components/Form/FormRow.stories.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { action } from '@storybook/addon-actions';
import { action } from 'storybook/actions';
import React, { useState } from 'react';
import FormChoice from './FormChoice';
import FormRow from './FormRow';
Expand Down
4 changes: 3 additions & 1 deletion src/components/Form/FormRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ function FormRow<T extends TypeProp>({
inputCouldHaveChildren
? React.Children.map(
children,
(child) => React.isValidElement(child) && React.cloneElement(child, { type })
(child) =>
React.isValidElement(child) &&
React.cloneElement(child as React.ReactElement<any>, { type })
)
: undefined,
[inputCouldHaveChildren, children, type]
Expand Down
2 changes: 1 addition & 1 deletion src/components/HasManyFields/HasManyFields.stories.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { action } from '@storybook/addon-actions';
import { action } from 'storybook/actions';
import React from 'react';
import AddressInput from '../Address/AddressInput';
import Input from '../Input/Input';
Expand Down
2 changes: 1 addition & 1 deletion src/components/Input/CreditCardNumber.stories.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { action } from '@storybook/addon-actions';
import { action } from 'storybook/actions';
import React from 'react';
import uncontrollable from 'uncontrollable';
import CreditCardNumber from './CreditCardNumber';
Expand Down
2 changes: 1 addition & 1 deletion src/components/Input/CurrencyInput.stories.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { action } from '@storybook/addon-actions';
import { action } from 'storybook/actions';
import React from 'react';
import CurrencyInput from './CurrencyInput';

Expand Down
2 changes: 1 addition & 1 deletion src/components/Input/DateInput.stories.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { action } from '@storybook/addon-actions';
import { action } from 'storybook/actions';
import classNames from 'classnames';
import React from 'react';
import Calendar from '../Calendar/Calendar';
Expand Down
2 changes: 1 addition & 1 deletion src/components/Input/MonthInput.stories.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { action } from '@storybook/addon-actions';
import { action } from 'storybook/actions';
import React from 'react';
import FormRow from '../Form/FormRow';
import Icon from '../Icon/Icon';
Expand Down
2 changes: 1 addition & 1 deletion src/components/Input/TimeInput.stories.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { action } from '@storybook/addon-actions';
import { action } from 'storybook/actions';
import React from 'react';
import FormRow from '../Form/FormRow';
import TimeInput from './TimeInput';
Expand Down
2 changes: 1 addition & 1 deletion src/components/LabelBadge/LabelBadge.stories.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { action } from '@storybook/addon-actions';
import { action } from 'storybook/actions';
import React from 'react';
import LabelBadge from './LabelBadge';

Expand Down
2 changes: 1 addition & 1 deletion src/components/List/List.stories.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { action } from '@storybook/addon-actions';
import { action } from 'storybook/actions';
import React, { useState, useEffect } from 'react';
import Label from '../Label/Label';
import List from './List';
Expand Down
2 changes: 1 addition & 1 deletion src/components/List/ListGroup.stories.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { action } from '@storybook/addon-actions';
import { action } from 'storybook/actions';
import React from 'react';
import { colors } from '../../tooling/colors';
import ListGroup from './ListGroup';
Expand Down
2 changes: 1 addition & 1 deletion src/components/List/SortableList.stories.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { action } from '@storybook/addon-actions';
import { action } from 'storybook/actions';
import React, { useState } from 'react';
import Alert from '../Alert/Alert';
import Button from '../Button/Button';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { action } from '@storybook/addon-actions';
import { action } from 'storybook/actions';
import { Meta, StoryObj } from '@storybook/react';
import React from 'react';
import { states } from '../../tooling/comboboxData';
Expand Down
2 changes: 1 addition & 1 deletion src/components/Nav/Nav.stories.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { action } from '@storybook/addon-actions';
import { action } from 'storybook/actions';
import React from 'react';
import Nav from './Nav';
import NavItem from './NavItem';
Expand Down
2 changes: 1 addition & 1 deletion src/components/Note/Note.stories.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { action } from '@storybook/addon-actions';
import { action } from 'storybook/actions';
import React, { useState } from 'react';
import EditableNote from './EditableNote';
import EditableNoteMentions from './EditableNoteMentions';
Expand Down
2 changes: 1 addition & 1 deletion src/components/Note/Notes.stories.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { action } from '@storybook/addon-actions';
import { action } from 'storybook/actions';
import React from 'react';
import Note from './Note';
import Notes from './Notes';
Expand Down
2 changes: 1 addition & 1 deletion src/components/Pagination/Paginator.stories.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { action } from '@storybook/addon-actions';
import { action } from 'storybook/actions';
import React from 'react';
import Paginator from './Paginator';

Expand Down
2 changes: 1 addition & 1 deletion src/components/Popover/Popover.stories.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { action } from '@storybook/addon-actions';
import { action } from 'storybook/actions';
import React, { useState } from 'react';
import Button from '../Button/Button';
import Popover from './Popover';
Expand Down
2 changes: 1 addition & 1 deletion src/components/Radio/RadioGroup.stories.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { action } from '@storybook/addon-actions';
import { action } from 'storybook/actions';
import React, { useState } from 'react';
import RadioGroup from './RadioGroup';

Expand Down
2 changes: 1 addition & 1 deletion src/components/Select/Select.stories.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { action } from '@storybook/addon-actions';
import { action } from 'storybook/actions';
import React from 'react';
import COUNTRIES from '../Address/util/Countries';
import Select from './Select';
Expand Down
2 changes: 1 addition & 1 deletion src/components/Steps/Steps.stories.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { action } from '@storybook/addon-actions';
import { action } from 'storybook/actions';
import React from 'react';
import Steps from './Steps';

Expand Down
2 changes: 1 addition & 1 deletion src/components/Table/SortableTable.stories.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { action } from '@storybook/addon-actions';
import { action } from 'storybook/actions';
import fecha from 'fecha';
import React from 'react';
import SortableTable from './SortableTable';
Expand Down
2 changes: 1 addition & 1 deletion src/components/Table/UncontrolledTable.stories.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { action } from '@storybook/addon-actions';
import { action } from 'storybook/actions';
import fecha from 'fecha';
import React from 'react';
import Button from '../Button/Button';
Expand Down
Loading
Loading