import * as React from 'react'; import { themr, ThemedComponentClass } from '@friendsofreactjs/react-css-themr'; import { classNames } from '@shopify/react-utilities/styles'; import { CHOICE } from '../ThemeIdentifiers'; import * as baseTheme from './Choice.scss'; import { FlexBox,Icon } from '../../../src/components/'; export type Error = boolean | string; export interface Props { // Set id of Choice component. componentId: string; // Set label text. label: string; // Whether the associated form control is disabled disabled?: Boolean; // To give error as boolean or string. error?: Error; // Display label or not. labelHidden?: boolean; // To provide child text. children?: React.ReactNode; // Text to understand in detail. helpText?: React.ReactNode; // Theme to be injected via css-themr. theme?: any; markIfRequired?:boolean; errors?: any } const choice = ({ componentId, label, disabled = false, error, children, labelHidden = false, helpText, theme, markIfRequired, errors }: Props) => { const className = classNames( theme.choice, labelHidden && theme.labelHidden, disabled && theme.disabled ); const [onHover, SetOnHover] = React.useState(false) const labelMarkup = ( ); const helpTextMarkup = helpText ?