mirror of https://github.com/apache/superset.git
test(storybook): fix component stories (#29245)
This commit is contained in:
parent
3dadefcfb0
commit
66bd0ce3d0
|
@ -87,6 +87,7 @@ InteractiveAlert.args = {
|
||||||
InteractiveAlert.argTypes = {
|
InteractiveAlert.argTypes = {
|
||||||
onClose: { action: 'onClose' },
|
onClose: { action: 'onClose' },
|
||||||
type: {
|
type: {
|
||||||
control: { type: 'select', options: types },
|
control: { type: 'select' },
|
||||||
|
options: types,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -87,11 +87,13 @@ AsyncAceEditor.args = {
|
||||||
AsyncAceEditor.argTypes = {
|
AsyncAceEditor.argTypes = {
|
||||||
editorType: {
|
editorType: {
|
||||||
defaultValue: 'json',
|
defaultValue: 'json',
|
||||||
control: { type: 'select', options: editorTypes },
|
control: { type: 'select' },
|
||||||
|
options: editorTypes,
|
||||||
},
|
},
|
||||||
defaultTheme: {
|
defaultTheme: {
|
||||||
defaultValue: 'github',
|
defaultValue: 'github',
|
||||||
control: { type: 'radio', options: ['textmate', 'github'] },
|
control: { type: 'radio' },
|
||||||
|
options: ['textmate', 'github'],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -73,32 +73,32 @@ InteractiveBadge.argTypes = {
|
||||||
status: {
|
status: {
|
||||||
control: {
|
control: {
|
||||||
type: 'select',
|
type: 'select',
|
||||||
options: [undefined, ...STATUSES],
|
|
||||||
},
|
},
|
||||||
|
options: [undefined, ...STATUSES],
|
||||||
},
|
},
|
||||||
size: {
|
size: {
|
||||||
control: {
|
control: {
|
||||||
type: 'select',
|
type: 'select',
|
||||||
options: SIZES.options,
|
|
||||||
},
|
},
|
||||||
|
options: SIZES.options,
|
||||||
},
|
},
|
||||||
color: {
|
color: {
|
||||||
control: {
|
control: {
|
||||||
type: 'select',
|
type: 'select',
|
||||||
options: [undefined, ...COLORS.options],
|
|
||||||
},
|
},
|
||||||
|
options: [undefined, ...COLORS.options],
|
||||||
},
|
},
|
||||||
textColor: {
|
textColor: {
|
||||||
control: {
|
control: {
|
||||||
type: 'select',
|
type: 'select',
|
||||||
options: [undefined, ...COLORS.options],
|
|
||||||
},
|
},
|
||||||
|
options: [undefined, ...COLORS.options],
|
||||||
},
|
},
|
||||||
count: {
|
count: {
|
||||||
control: {
|
control: {
|
||||||
type: 'select',
|
type: 'select',
|
||||||
options: [undefined, ...Array(100).keys()],
|
|
||||||
},
|
},
|
||||||
|
options: [undefined, ...Array(100).keys()],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -117,11 +117,13 @@ InteractiveButton.args = {
|
||||||
InteractiveButton.argTypes = {
|
InteractiveButton.argTypes = {
|
||||||
target: {
|
target: {
|
||||||
name: TARGETS.label,
|
name: TARGETS.label,
|
||||||
control: { type: 'select', options: Object.values(TARGETS.options) },
|
control: { type: 'select' },
|
||||||
|
options: Object.values(TARGETS.options),
|
||||||
},
|
},
|
||||||
href: {
|
href: {
|
||||||
name: HREFS.label,
|
name: HREFS.label,
|
||||||
control: { type: 'select', options: Object.values(HREFS.options) },
|
control: { type: 'select' },
|
||||||
|
options: Object.values(HREFS.options),
|
||||||
},
|
},
|
||||||
onClick: { action: 'clicked' },
|
onClick: { action: 'clicked' },
|
||||||
};
|
};
|
||||||
|
|
|
@ -49,11 +49,13 @@ InteractiveButtonGroup.args = {
|
||||||
InteractiveButtonGroup.argTypes = {
|
InteractiveButtonGroup.argTypes = {
|
||||||
buttonStyle: {
|
buttonStyle: {
|
||||||
name: STYLES.label,
|
name: STYLES.label,
|
||||||
control: { type: 'select', options: STYLES.options },
|
control: { type: 'select' },
|
||||||
|
options: STYLES.options,
|
||||||
},
|
},
|
||||||
buttonSize: {
|
buttonSize: {
|
||||||
name: SIZES.label,
|
name: SIZES.label,
|
||||||
control: { type: 'select', options: SIZES.options },
|
control: { type: 'select' },
|
||||||
|
options: SIZES.options,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -55,6 +55,7 @@ InteractiveCopyToClipboard.argTypes = {
|
||||||
onCopyEnd: { action: 'onCopyEnd' },
|
onCopyEnd: { action: 'onCopyEnd' },
|
||||||
copyNode: {
|
copyNode: {
|
||||||
defaultValue: 'Button',
|
defaultValue: 'Button',
|
||||||
control: { type: 'radio', options: ['Button', 'Icon', 'Text'] },
|
control: { type: 'radio' },
|
||||||
|
options: ['Button', 'Icon', 'Text'],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -40,14 +40,14 @@ const interactiveTypes = {
|
||||||
picker: {
|
picker: {
|
||||||
control: {
|
control: {
|
||||||
type: 'select',
|
type: 'select',
|
||||||
options: ['', 'date', 'week', 'month', 'quarter', 'year'],
|
|
||||||
},
|
},
|
||||||
|
options: ['', 'date', 'week', 'month', 'quarter', 'year'],
|
||||||
},
|
},
|
||||||
size: {
|
size: {
|
||||||
control: {
|
control: {
|
||||||
type: 'select',
|
type: 'select',
|
||||||
options: ['large', 'middle', 'small'],
|
|
||||||
},
|
},
|
||||||
|
options: ['large', 'middle', 'small'],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -60,6 +60,7 @@ export const InteractiveDropdown = ({
|
||||||
InteractiveDropdown.argTypes = {
|
InteractiveDropdown.argTypes = {
|
||||||
overlayType: {
|
overlayType: {
|
||||||
defaultValue: 'menu',
|
defaultValue: 'menu',
|
||||||
control: { type: 'radio', options: ['menu', 'custom'] },
|
control: { type: 'radio' },
|
||||||
|
options: ['menu', 'custom'],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -59,7 +59,8 @@ InteractiveDropdownButton.args = {
|
||||||
InteractiveDropdownButton.argTypes = {
|
InteractiveDropdownButton.argTypes = {
|
||||||
placement: {
|
placement: {
|
||||||
defaultValue: 'top',
|
defaultValue: 'top',
|
||||||
control: { type: 'select', options: PLACEMENTS },
|
control: { type: 'select' },
|
||||||
|
options: PLACEMENTS,
|
||||||
},
|
},
|
||||||
overlay: {
|
overlay: {
|
||||||
defaultValue: menu,
|
defaultValue: menu,
|
||||||
|
|
|
@ -46,12 +46,12 @@ InteractiveIconButton.argTypes = {
|
||||||
defaultValue: '/images/icons/sql.svg',
|
defaultValue: '/images/icons/sql.svg',
|
||||||
control: {
|
control: {
|
||||||
type: 'select',
|
type: 'select',
|
||||||
options: [
|
|
||||||
'/images/icons/sql.svg',
|
|
||||||
'/images/icons/server.svg',
|
|
||||||
'/images/icons/image.svg',
|
|
||||||
'Click to see example alt text',
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
|
options: [
|
||||||
|
'/images/icons/sql.svg',
|
||||||
|
'/images/icons/server.svg',
|
||||||
|
'/images/icons/image.svg',
|
||||||
|
'Click to see example alt text',
|
||||||
|
],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -53,6 +53,7 @@ InteractiveIconTooltip.args = {
|
||||||
InteractiveIconTooltip.argTypes = {
|
InteractiveIconTooltip.argTypes = {
|
||||||
placement: {
|
placement: {
|
||||||
defaultValue: 'top',
|
defaultValue: 'top',
|
||||||
control: { type: 'select', options: PLACEMENTS },
|
control: { type: 'select' },
|
||||||
|
options: PLACEMENTS,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -71,11 +71,13 @@ InteractiveIcons.argTypes = {
|
||||||
},
|
},
|
||||||
iconSize: {
|
iconSize: {
|
||||||
defaultValue: 'xl',
|
defaultValue: 'xl',
|
||||||
control: { type: 'inline-radio', options: ['s', 'l', 'm', 'xl', 'xxl'] },
|
control: { type: 'inline-radio' },
|
||||||
|
options: ['s', 'l', 'm', 'xl', 'xxl'],
|
||||||
},
|
},
|
||||||
iconColor: {
|
iconColor: {
|
||||||
defaultValue: null,
|
defaultValue: null,
|
||||||
control: { type: 'select', options: palette },
|
control: { type: 'select' },
|
||||||
|
options: palette,
|
||||||
},
|
},
|
||||||
theme: {
|
theme: {
|
||||||
table: {
|
table: {
|
||||||
|
|
|
@ -44,27 +44,27 @@ InteractiveInfoTooltip.argTypes = {
|
||||||
defaultValue: 'top',
|
defaultValue: 'top',
|
||||||
control: {
|
control: {
|
||||||
type: 'select',
|
type: 'select',
|
||||||
options: [
|
|
||||||
'bottom',
|
|
||||||
'left',
|
|
||||||
'right',
|
|
||||||
'top',
|
|
||||||
'topLeft',
|
|
||||||
'topRight',
|
|
||||||
'bottomLeft',
|
|
||||||
'bottomRight',
|
|
||||||
'leftTop',
|
|
||||||
'leftBottom',
|
|
||||||
'rightTop',
|
|
||||||
'rightBottom',
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
|
options: [
|
||||||
|
'bottom',
|
||||||
|
'left',
|
||||||
|
'right',
|
||||||
|
'top',
|
||||||
|
'topLeft',
|
||||||
|
'topRight',
|
||||||
|
'bottomLeft',
|
||||||
|
'bottomRight',
|
||||||
|
'leftTop',
|
||||||
|
'leftBottom',
|
||||||
|
'rightTop',
|
||||||
|
'rightBottom',
|
||||||
|
],
|
||||||
},
|
},
|
||||||
trigger: {
|
trigger: {
|
||||||
defaultValue: 'hover',
|
defaultValue: 'hover',
|
||||||
control: {
|
control: {
|
||||||
type: 'select',
|
type: 'select',
|
||||||
options: ['hover', 'click'],
|
|
||||||
},
|
},
|
||||||
|
options: ['hover', 'click'],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -64,6 +64,7 @@ InteractiveLoading.args = {
|
||||||
InteractiveLoading.argTypes = {
|
InteractiveLoading.argTypes = {
|
||||||
position: {
|
position: {
|
||||||
name: 'position',
|
name: 'position',
|
||||||
control: { type: 'select', options: POSITIONS },
|
control: { type: 'select' },
|
||||||
|
options: POSITIONS,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -71,10 +71,12 @@ InteractivePopover.args = {
|
||||||
InteractivePopover.argTypes = {
|
InteractivePopover.argTypes = {
|
||||||
placement: {
|
placement: {
|
||||||
name: PLACEMENTS.label,
|
name: PLACEMENTS.label,
|
||||||
control: { type: 'select', options: PLACEMENTS.options },
|
control: { type: 'select' },
|
||||||
|
options: PLACEMENTS.options,
|
||||||
},
|
},
|
||||||
trigger: {
|
trigger: {
|
||||||
name: TRIGGERS.label,
|
name: TRIGGERS.label,
|
||||||
control: { type: 'select', options: TRIGGERS.options },
|
control: { type: 'select' },
|
||||||
|
options: TRIGGERS.options,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -68,11 +68,13 @@ export const InteractivePopoverDropdown = (props: Props) => {
|
||||||
InteractivePopoverDropdown.argTypes = {
|
InteractivePopoverDropdown.argTypes = {
|
||||||
buttonType: {
|
buttonType: {
|
||||||
defaultValue: 'default',
|
defaultValue: 'default',
|
||||||
control: { type: 'radio', options: ['default', 'button'] },
|
control: { type: 'radio' },
|
||||||
|
options: ['default', 'button'],
|
||||||
},
|
},
|
||||||
optionType: {
|
optionType: {
|
||||||
defaultValue: 'default',
|
defaultValue: 'default',
|
||||||
control: { type: 'radio', options: ['default', 'button'] },
|
control: { type: 'radio' },
|
||||||
|
options: ['default', 'button'],
|
||||||
},
|
},
|
||||||
value: {
|
value: {
|
||||||
defaultValue: OPTIONS[0].value,
|
defaultValue: OPTIONS[0].value,
|
||||||
|
|
|
@ -42,19 +42,19 @@ InteractiveProgressBar.argTypes = {
|
||||||
status: {
|
status: {
|
||||||
control: {
|
control: {
|
||||||
type: 'select',
|
type: 'select',
|
||||||
options: ['normal', 'success', 'exception', 'active'],
|
|
||||||
},
|
},
|
||||||
|
options: ['normal', 'success', 'exception', 'active'],
|
||||||
},
|
},
|
||||||
strokeLinecap: {
|
strokeLinecap: {
|
||||||
control: {
|
control: {
|
||||||
type: 'select',
|
type: 'select',
|
||||||
options: ['round', 'square'],
|
|
||||||
},
|
},
|
||||||
|
options: ['round', 'square'],
|
||||||
},
|
},
|
||||||
type: {
|
type: {
|
||||||
control: {
|
control: {
|
||||||
type: 'select',
|
type: 'select',
|
||||||
options: ['line', 'circle', 'dashboard'],
|
|
||||||
},
|
},
|
||||||
|
options: ['line', 'circle', 'dashboard'],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -44,6 +44,7 @@ InteractiveSwitch.args = {
|
||||||
InteractiveSwitch.argTypes = {
|
InteractiveSwitch.argTypes = {
|
||||||
size: {
|
size: {
|
||||||
defaultValue: 'default',
|
defaultValue: 'default',
|
||||||
control: { type: 'radio', options: ['small', 'default'] },
|
control: { type: 'radio' },
|
||||||
|
options: ['small', 'default'],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -83,8 +83,8 @@ InteractiveTableView.argTypes = {
|
||||||
emptyWrapperType: {
|
emptyWrapperType: {
|
||||||
control: {
|
control: {
|
||||||
type: 'select',
|
type: 'select',
|
||||||
options: [EmptyWrapperType.Default, EmptyWrapperType.Small],
|
|
||||||
},
|
},
|
||||||
|
options: [EmptyWrapperType.Default, EmptyWrapperType.Small],
|
||||||
},
|
},
|
||||||
pageSize: {
|
pageSize: {
|
||||||
control: {
|
control: {
|
||||||
|
|
|
@ -53,7 +53,7 @@ InteractiveTabs.argTypes = {
|
||||||
defaultValue: 'line',
|
defaultValue: 'line',
|
||||||
control: {
|
control: {
|
||||||
type: 'inline-radio',
|
type: 'inline-radio',
|
||||||
options: ['line', 'card', 'editable-card'],
|
|
||||||
},
|
},
|
||||||
|
options: ['line', 'card', 'editable-card'],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -45,16 +45,16 @@ InteractiveTimer.argTypes = {
|
||||||
status: {
|
status: {
|
||||||
control: {
|
control: {
|
||||||
type: 'select',
|
type: 'select',
|
||||||
options: [
|
|
||||||
'success',
|
|
||||||
'warning',
|
|
||||||
'danger',
|
|
||||||
'info',
|
|
||||||
'default',
|
|
||||||
'primary',
|
|
||||||
'secondary',
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
|
options: [
|
||||||
|
'success',
|
||||||
|
'warning',
|
||||||
|
'danger',
|
||||||
|
'info',
|
||||||
|
'default',
|
||||||
|
'primary',
|
||||||
|
'secondary',
|
||||||
|
],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -57,11 +57,13 @@ InteractiveTooltip.args = {
|
||||||
InteractiveTooltip.argTypes = {
|
InteractiveTooltip.argTypes = {
|
||||||
placement: {
|
placement: {
|
||||||
defaultValue: 'top',
|
defaultValue: 'top',
|
||||||
control: { type: 'select', options: PLACEMENTS },
|
control: { type: 'select' },
|
||||||
|
options: PLACEMENTS,
|
||||||
},
|
},
|
||||||
trigger: {
|
trigger: {
|
||||||
defaultValue: 'hover',
|
defaultValue: 'hover',
|
||||||
control: { type: 'select', options: TRIGGERS },
|
control: { type: 'select' },
|
||||||
|
options: TRIGGERS,
|
||||||
},
|
},
|
||||||
color: { control: { type: 'color' } },
|
color: { control: { type: 'color' } },
|
||||||
onVisibleChange: { action: 'onVisibleChange' },
|
onVisibleChange: { action: 'onVisibleChange' },
|
||||||
|
|
Loading…
Reference in New Issue