`,
}),
}
/* -------------------------------------------------------------------------- */
/* Help & tooltip */
/* -------------------------------------------------------------------------- */
/**
* Attach a help text under the field and a tooltip next to the label.
*/
export const HelpAndTooltip: Story = {
args: {
...Default.args,
help: 'This is a help text',
tooltip: 'This is a tooltip',
},
}
/* -------------------------------------------------------------------------- */
/* Variants */
/* -------------------------------------------------------------------------- */
/**
* Search input with a built-in icon.
*/
export const Search: Story = {
args: {
...Default.args,
isSearch: true,
},
}
/**
* Input masked with a pattern (phone numbers, card numbers, etc.).
*/
export const Mask: Story = {
args: {
...Default.args,
placeholder: 'Enter your phone number',
mask: '## ## ## ## ##',
},
}
/**
* Slot icons on either side of the input.
*/
export const WithIcon: Story = {
args: { ...Default.args },
render: (args: StoryArgs) => ({
components: { CpInput, CpIcon },
setup() {
const value = ref('')
return { args, value }
},
template: `
`,
}),
}
/**
* Use the icon slots to render unit labels, perfect for currencies or
* measurement units.
*/
export const WithUnits: Story = {
args: { ...Default.args },
render: (args: StoryArgs) => ({
components: { CpInput },
setup() {
const value = ref('')
return { args, value }
},
template: `