From 35263dfcb1c1b3028a5cc2854568e9a1d5c8c549 Mon Sep 17 00:00:00 2001 From: Jean-Michel FRANCOIS Date: Fri, 20 Oct 2023 18:48:17 +0200 Subject: [PATCH] chore: fix stories in errors (#4942) * chore: remove stories around code that do not exists * chore: fix RHF/Select/Valdation error * fix: storybook * Add style for icons in storybook one to be able to use it in chromatic * Fix Icon stories * fix: story * fix customValidation * Fix call to ToggleSwitch --------- Co-authored-by: Sebastien LE MOUILLOUR <32456736+smouillour@users.noreply.github.com> Co-authored-by: smouillour --- .changeset/small-kiwis-end.md | 5 ++ .../components/src/Toggle/Toggle.stories.js | 61 ------------------- .../FacetedToolbar.component.js | 4 +- .../src/rhf/fields/Select/Select.stories.js | 10 ++- packages/forms/stories/SchemaCore.stories.tsx | 5 ++ .../forms/stories/SchemaFields.stories.tsx | 58 ++++++++++++++++++ packages/icons/.storybook/preview-head.html | 29 --------- packages/icons/stories/Icon.stories.tsx | 35 ++++++----- packages/icons/stories/Icon.tsx | 24 ++++++++ .../.storybook-templates/preview.js | 10 +-- 10 files changed, 126 insertions(+), 115 deletions(-) create mode 100644 .changeset/small-kiwis-end.md delete mode 100644 packages/icons/.storybook/preview-head.html diff --git a/.changeset/small-kiwis-end.md b/.changeset/small-kiwis-end.md new file mode 100644 index 00000000000..ac2b4b0c516 --- /dev/null +++ b/.changeset/small-kiwis-end.md @@ -0,0 +1,5 @@ +--- +'@talend/scripts-config-storybook-lib': patch +--- + +fix: icon url to support prefix diff --git a/packages/components/src/Toggle/Toggle.stories.js b/packages/components/src/Toggle/Toggle.stories.js index 6d623ea7299..e8304eeb02d 100644 --- a/packages/components/src/Toggle/Toggle.stories.js +++ b/packages/components/src/Toggle/Toggle.stories.js @@ -1,5 +1,3 @@ -import { useState } from 'react'; -import PropTypes from 'prop-types'; import { action } from '@storybook/addon-actions'; import Toggle from './Toggle.component'; @@ -31,33 +29,6 @@ const withLabel = { label: 'Some label', }; -const labelToggleProps = { - values: [ - { value: 'val1', label: 'Value 1' }, - { value: 'val2', label: 'Value 2' }, - { value: 'val3', label: 'Value 3' }, - ], -}; - -const InteractiveLabelToggle = ({ defaultValue = '', name, autoFocus }) => { - const [value, setValue] = useState(defaultValue); - - return ( - - ); -}; -InteractiveLabelToggle.propTypes = { - defaultValue: PropTypes.string, - autoFocus: PropTypes.bool, - name: PropTypes.string.isRequired, -}; - export default { title: 'Components/Form - Controls/Toggle', }; @@ -89,35 +60,3 @@ export const Default = () => ( ); - -export const LabelToggle = () => ( -
-

Label Toggle

-
-

Non interactive two states

- -

Interactive

- -

Interactive autofocused

- -

Interactive with default selected value

- -

Disabled with selected value

- - -
-); diff --git a/packages/faceted-search/src/components/FacetedToolbar/FacetedToolbar.component.js b/packages/faceted-search/src/components/FacetedToolbar/FacetedToolbar.component.js index 8c11fa6e461..c7b96f13172 100644 --- a/packages/faceted-search/src/components/FacetedToolbar/FacetedToolbar.component.js +++ b/packages/faceted-search/src/components/FacetedToolbar/FacetedToolbar.component.js @@ -1,6 +1,6 @@ import PropTypes from 'prop-types'; -import { Form, ToggleSwitch } from '@talend/design-system'; +import { Form } from '@talend/design-system'; import { getTheme } from '@talend/react-components/lib/theme'; import { FACETED_MODE, USAGE_TRACKING_TAGS } from '../../constants'; @@ -11,7 +11,7 @@ const theme = getTheme(cssModule); const SwitchFacetedMode = ({ facetedMode, onChange, t }) => (
- diff --git a/packages/forms/src/rhf/fields/Select/Select.stories.js b/packages/forms/src/rhf/fields/Select/Select.stories.js index d7c297d471a..acda33aac47 100644 --- a/packages/forms/src/rhf/fields/Select/Select.stories.js +++ b/packages/forms/src/rhf/fields/Select/Select.stories.js @@ -104,7 +104,13 @@ export const Validation = props => {