mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-16 10:51:06 +00:00
refactor: use $$restProps API
- add ref prop for applicable components (#196) - add slot to Content Switcher `Switch` component (#183) - remove fillArray, css utilities
This commit is contained in:
parent
4e2959080b
commit
e886d772c7
288 changed files with 4681 additions and 4498 deletions
|
@ -1,60 +1,60 @@
|
|||
import { withKnobs, select, text } from '@storybook/addon-knobs';
|
||||
import Component from './Tooltip.Story.svelte';
|
||||
import { withKnobs, select, text } from "@storybook/addon-knobs";
|
||||
import Component from "./Tooltip.Story.svelte";
|
||||
|
||||
export default { title: 'Tooltip', decorators: [withKnobs] };
|
||||
export default { title: "Tooltip", decorators: [withKnobs] };
|
||||
|
||||
const directions = {
|
||||
'Top (top)': 'top',
|
||||
'Right (right)': 'right',
|
||||
'Bottom (bottom)': 'bottom',
|
||||
'Left (left)': 'left'
|
||||
"Top (top)": "top",
|
||||
"Right (right)": "right",
|
||||
"Bottom (bottom)": "bottom",
|
||||
"Left (left)": "left",
|
||||
};
|
||||
|
||||
export const Default = () => ({
|
||||
Component,
|
||||
props: {
|
||||
direction: select('Tooltip direction (direction)', directions, 'bottom'),
|
||||
triggerText: text('Trigger text (triggerText)', 'Tooltip label'),
|
||||
tabindex: text('Tab index (tabindex in <Tooltip>)', '0')
|
||||
}
|
||||
direction: select("Tooltip direction (direction)", directions, "bottom"),
|
||||
triggerText: text("Trigger text (triggerText)", "Tooltip label"),
|
||||
tabindex: text("Tab index (tabindex in <Tooltip>)", "0"),
|
||||
},
|
||||
});
|
||||
|
||||
export const NoIcon = () => ({
|
||||
Component,
|
||||
props: {
|
||||
story: 'no icon',
|
||||
story: "no icon",
|
||||
hideIcon: true,
|
||||
direction: select('Tooltip direction (direction)', directions, 'bottom'),
|
||||
triggerText: text('Trigger text (triggerText)', 'Tooltip label'),
|
||||
tabindex: text('Tab index (tabindex in <Tooltip>)', '0')
|
||||
}
|
||||
direction: select("Tooltip direction (direction)", directions, "bottom"),
|
||||
triggerText: text("Trigger text (triggerText)", "Tooltip label"),
|
||||
tabindex: text("Tab index (tabindex in <Tooltip>)", "0"),
|
||||
},
|
||||
});
|
||||
|
||||
export const CustomIcon = () => ({
|
||||
Component,
|
||||
props: {
|
||||
story: 'custom icon',
|
||||
story: "custom icon",
|
||||
showIcon: true,
|
||||
direction: select('Tooltip direction (direction)', directions, 'bottom'),
|
||||
triggerText: text('Trigger text (triggerText)', 'Tooltip label'),
|
||||
tabindex: text('Tab index (tabindex in <Tooltip>)', '0')
|
||||
}
|
||||
direction: select("Tooltip direction (direction)", directions, "bottom"),
|
||||
triggerText: text("Trigger text (triggerText)", "Tooltip label"),
|
||||
tabindex: text("Tab index (tabindex in <Tooltip>)", "0"),
|
||||
},
|
||||
});
|
||||
|
||||
export const CustomIconOnly = () => ({
|
||||
Component,
|
||||
props: {
|
||||
story: 'custom icon only',
|
||||
direction: select('Tooltip direction (direction)', directions, 'bottom'),
|
||||
iconDescription: 'Helpful Information',
|
||||
tabindex: text('Tab index (tabindex in <Tooltip>)', '0')
|
||||
}
|
||||
story: "custom icon only",
|
||||
direction: select("Tooltip direction (direction)", directions, "bottom"),
|
||||
iconDescription: "Helpful Information",
|
||||
tabindex: text("Tab index (tabindex in <Tooltip>)", "0"),
|
||||
},
|
||||
});
|
||||
|
||||
export const UncontrolledTooltip = () => ({
|
||||
Component,
|
||||
props: {
|
||||
story: 'uncontrolled',
|
||||
direction: select('Tooltip direction (direction)', directions, 'bottom')
|
||||
}
|
||||
story: "uncontrolled",
|
||||
direction: select("Tooltip direction (direction)", directions, "bottom"),
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue