From 2648ef2fb931034ce0961da0dd62d5cdd61bd976 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ver=C3=B3nica=20Mil=C3=A1n?= Date: Thu, 20 Jul 2023 19:47:31 +0200 Subject: [PATCH 1/2] SelectField stories leftovers --- .../stories/atoms/SelectField.stories.js | 83 +++---------------- .../stories/molecules/Table.stories.js | 41 ++++++--- 2 files changed, 38 insertions(+), 86 deletions(-) diff --git a/packages/react-ui/storybook/stories/atoms/SelectField.stories.js b/packages/react-ui/storybook/stories/atoms/SelectField.stories.js index e03b8e0b2..22065c824 100644 --- a/packages/react-ui/storybook/stories/atoms/SelectField.stories.js +++ b/packages/react-ui/storybook/stories/atoms/SelectField.stories.js @@ -76,21 +76,6 @@ const menuItems = [ } ]; -const menuItemsLong = [ - { - label: 'table_openstreetmap_pointsofinterest', - value: '10Long' - }, - { - label: 'Twenty', - value: '20' - }, - { - label: 'Thirty', - value: '30' - } -]; - const SelectFieldItem = ({ label, required, @@ -121,7 +106,6 @@ const SelectFieldItem = ({ label={label} variant={variant} placeholder={placeholder} - items={menuItems} helperText={helperText} onChange={handleChange} value={content} @@ -160,7 +144,6 @@ const VariantsTemplate = ({ label, required, placeholder, ...rest }) => { label={label} variant='filled' placeholder={placeholder} - items={menuItems} /> @@ -172,7 +155,6 @@ const VariantsTemplate = ({ label, required, placeholder, ...rest }) => { label={label} variant='outlined' placeholder={placeholder} - items={menuItems} /> @@ -184,7 +166,6 @@ const VariantsTemplate = ({ label, required, placeholder, ...rest }) => { label={label} variant='standard' placeholder={placeholder} - items={menuItems} /> @@ -203,36 +184,25 @@ const LabelAndHelperTextTemplate = ({ label, placeholder, helperText, ...rest }) label={label} placeholder={placeholder} helperText={helperText} - items={menuItems} /> - + - + - + @@ -273,7 +243,6 @@ const SizeTemplate = ({ variant='filled' label={label} placeholder={placeholder} - items={menuItems} size={size} /> @@ -283,7 +252,6 @@ const SizeTemplate = ({ variant='outlined' label={label} placeholder={placeholder} - items={menuItems} size={size} /> @@ -293,7 +261,6 @@ const SizeTemplate = ({ variant='standard' label={label} placeholder={placeholder} - items={menuItems} size={size} /> @@ -306,19 +273,19 @@ const SizeTemplate = ({ {label} - + {label} - + {label} - + @@ -398,7 +365,6 @@ const SizeTemplate = ({ placeholder={placeholder} focused size={size} - items={menuItems} /> @@ -409,7 +375,6 @@ const SizeTemplate = ({ placeholder={placeholder} focused size={size} - items={menuItems} /> @@ -420,7 +385,6 @@ const SizeTemplate = ({ placeholder={placeholder} focused size={size} - items={menuItems} /> @@ -437,7 +401,6 @@ const SizeTemplate = ({ placeholder={placeholder} disabled size={size} - items={menuItems} /> @@ -448,7 +411,6 @@ const SizeTemplate = ({ placeholder={placeholder} disabled size={size} - items={menuItems} /> @@ -459,7 +421,6 @@ const SizeTemplate = ({ placeholder={placeholder} disabled size={size} - items={menuItems} /> @@ -477,7 +438,6 @@ const SizeTemplate = ({ helperText={helperText} error size={size} - items={menuItems} /> @@ -489,7 +449,6 @@ const SizeTemplate = ({ helperText={helperText} error size={size} - items={menuItems} /> @@ -501,7 +460,6 @@ const SizeTemplate = ({ helperText={helperText} error size={size} - items={menuItems} /> @@ -535,12 +493,7 @@ const BehaviorTemplate = ({ label, placeholder, defaultValue, helperText, ...res - + @@ -551,20 +504,10 @@ const BehaviorTemplate = ({ label, placeholder, defaultValue, helperText, ...res - + - + @@ -574,12 +517,7 @@ const BehaviorTemplate = ({ label, placeholder, defaultValue, helperText, ...res - + @@ -588,7 +526,6 @@ const BehaviorTemplate = ({ label, placeholder, defaultValue, helperText, ...res label={label} placeholder={placeholder} fullWidth={false} - items={menuItems} /> diff --git a/packages/react-ui/storybook/stories/molecules/Table.stories.js b/packages/react-ui/storybook/stories/molecules/Table.stories.js index 54300339d..7523be687 100644 --- a/packages/react-ui/storybook/stories/molecules/Table.stories.js +++ b/packages/react-ui/storybook/stories/molecules/Table.stories.js @@ -10,7 +10,8 @@ import { TableContainer, TableBody, Table, - IconButton + IconButton, + MenuItem } from '@mui/material'; import SelectField from '../../../src/components/atoms/SelectField'; import { MoreVertOutlined } from '@mui/icons-material'; @@ -103,12 +104,19 @@ const PlaygroundTemplate = (args) => { + onChange={() => void 0} + value={[]} + > + {[...Array(3)].map((item, index) => { + const itemText = `${index + 1}`; + + return ( + + {itemText} + + ); + })} + {index === 3 ? ( @@ -172,12 +180,19 @@ const ScrollTemplate = (args) => ( + onChange={() => void 0} + value={[]} + > + {[...Array(3)].map((item, index) => { + const itemText = `${index + 1}`; + + return ( + + {itemText} + + ); + })} + {index % rows.length === 3 ? ( From 0a7311d202106802d5932f1750538537626f9842 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ver=C3=B3nica=20Mil=C3=A1n?= Date: Thu, 20 Jul 2023 19:51:25 +0200 Subject: [PATCH 2/2] changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3807ee3d0..4ccf57c95 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Not released +- SelectField Storybook leftovers [#746](https://github.com/CartoDB/carto-react/pull/746) + ## 2.2 ### 2.2.0 (2023-07-19)