/** Source code string shown in the Storybook Docs tab for the AllControlsShowcase story */ declare const allControlsShowcaseSource = "\nimport { z } from 'zod';\nimport {\n Box,\n BaseSkeleton,\n Button,\n Checkbox,\n CheckboxGroup,\n DatePicker,\n DateRangePicker,\n ErrorMessage,\n Form,\n SimpleInput,\n InputGroup,\n InputGroupAddon,\n InputGroupIcon,\n InputGroupInput,\n InputOTP,\n Label,\n Link,\n Radio,\n Select,\n Switch,\n Text,\n useZodForm,\n Field,\n FieldControl,\n FieldDescription,\n FieldLabel\n} from '@jtl-software/platform-ui-react';\n\n/**\n * Zod schema covering every control type shown in the showcase form.\n * Each field maps to one of the supported control components.\n */\nconst allControlSchema = z\n .object({\n /** Standard text input */\n email: z.string().email({ message: 'Please enter a valid email address' }),\n /** InputGroup \u2014 prefix icon + text input */\n username: z.string().min(3, { message: 'Username must be at least 3 characters' }),\n /** InputOTP \u2014 6-digit one-time password */\n otp: z.string().length(6, { message: 'OTP must be exactly 6 digits' }),\n /** Checkbox \u2014 single boolean toggle */\n termsAccepted: z.boolean().refine(val => val === true, { message: 'You must accept the terms' }),\n /** CheckboxGroup \u2014 multi-select array of strings */\n interests: z.array(z.string().nullable()).min(1, { message: 'Select at least one interest' }),\n /**\n * DatePicker \u2014 typed as optional so undefined is a valid default value.\n * Required-on-submit validation is handled via superRefine below to avoid\n * Zod narrowing the output type to Date (which would break defaultValues).\n */\n birthDay: z.date().optional(),\n /** DateRangePicker \u2014 { from: Date, to?: Date } */\n bookingRange: z.object({ from: z.date(), to: z.date().optional() }).optional(),\n /** Radio \u2014 single string value from a radio group */\n gender: z.string().min(1, { message: 'Please select a gender' }),\n /** Select \u2014 single string value from a dropdown */\n country: z.string().min(1, { message: 'Please select a country' }),\n /** Switch \u2014 boolean toggle */\n newsletter: z.boolean().refine(val => val === true, { message: 'You must accept the newsletter' }),\n })\n .superRefine((data, ctx) => {\n // birthDay is optional in type but required on submit\n if (!data.birthDay) {\n ctx.addIssue({ code: z.ZodIssueCode.custom, message: 'Please select your birth date', path: ['birthDay'] });\n }\n if (!data.bookingRange?.from || !data.bookingRange?.to) {\n ctx.addIssue({ code: z.ZodIssueCode.custom, message: 'Please select your booking range', path: ['bookingRange'] });\n }\n });\n\n/** Options for the CheckboxGroup */\nconst interestOptions = [\n { value: 'technology', label: 'Technology' },\n { value: 'design', label: 'Design' },\n { value: 'marketing', label: 'Marketing' },\n];\n\n/** Options for the Select dropdown */\nconst countryOptions = [\n { value: 'de', label: 'Germany' },\n { value: 'at', label: 'Austria' },\n { value: 'ch', label: 'Switzerland' },\n { value: 'us', label: 'United States' },\n];\n\n/**\n * Showcase form demonstrating every supported control type integrated with\n * ``, ``, ``, and react-hook-form.\n *\n * Integration patterns used:\n * - `` \u2014 for SimpleInput, InputGroup, InputOTP, Select (string-value onChange)\n * - `render` prop \u2014 for CheckboxGroup, DatePicker, DateRangePicker, Radio, Switch\n * (non-standard onChange signatures incompatible with cloneElement injection)\n */\nconst AllControlsShowcase = ({ isLoading = false }) => {\n const form = useZodForm({\n schema: allControlSchema,\n defaultValues: {\n email: '',\n username: '',\n otp: '',\n termsAccepted: false,\n interests: [],\n birthDay: undefined,\n bookingRange: undefined,\n gender: '',\n country: '',\n newsletter: false,\n },\n });\n\n const onSubmit = (data) => {\n alert(JSON.stringify(data, null, 2));\n };\n\n return (\n
\n \n \n {/* SimpleInput \u2014 standard text control; FieldControl injects id + RHF props */}\n \n Email Address\n \n \n \n We'll never share your email\n \n\n {/* InputGroup \u2014 prefix icon + text input; FieldControl wires onChange */}\n \n Username\n \n \n \n \n \n \n \n \n At least 3 characters\n \n\n {/* InputOTP \u2014 6-digit code; FieldControl injects value + onChange(string) */}\n \n One-Time Password\n \n \n \n Enter the 6-digit code from your authenticator app\n \n\n {/* Select \u2014 string value; FieldControl handles cloneElement injection */}\n \n Country\n \n