/* * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. * * OpenCRVS is also distributed under the terms of the Civil Registration * & Healthcare Disclaimer located at http://opencrvs.org/license. * * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. */ import React from 'react' import { Meta, Story } from '@storybook/react' import { ArrowWithGradient } from '../icons' import { Select } from '../Select' import { TextInput } from '../TextInput/TextInput' import { InputField, IInputFieldProps } from './InputField' import { DateField } from '../DateField' import { VerifyingIndicator } from './VerifyingIndicator' import { ValidIndicator } from './ValidIndicator' export default { title: 'Input/Input field', component: InputField } as Meta const Template: Story = (args) => export const InputFieldWithText = Template.bind({}) InputFieldWithText.args = { id: 'default-input', label: 'Mobile number', children: } export const InputFieldWithSelect = Template.bind({}) InputFieldWithSelect.args = { required: false, id: 'select-input', label: 'Your favourite ice create flavour?', children: ( { alert(`${value}`) }} options={[ { value: 'chocolate', label: 'Chocolate' }, { value: 'strawberry', label: 'Strawberry' }, { value: 'vanilla', label: 'Vanilla' } ]} /> ) } export const InputFieldWithVerifyIndicator = Template.bind({}) InputFieldWithVerifyIndicator.args = { id: 'Verify-indicator', label: 'Is Valid?', postfix: , children: } export const InputFieldWithValidityIndicator = Template.bind({}) InputFieldWithValidityIndicator.args = { id: 'Validity-indicator', label: 'Is Valid?', postfix: , children: } export const InputFieldWithDateField = Template.bind({}) InputFieldWithDateField.args = { id: 'input-date-field', label: 'Date of Birth', children: ( { alert('Date field changed') }} /> ) } export const InputFieldWithPredefinedDateField = Template.bind({}) InputFieldWithPredefinedDateField.args = { id: 'input-date-field', label: 'Date of Birth', children: ( { alert(dob) }} /> ) }