import { jsx as _jsx } from "react/jsx-runtime";
import { withForm } from '../../lib/decorators.js';
import { getDefaultArgTypes, getValidationArgTypes, PrebuiltArgTypes, StorybookControlCategory, } from '../../lib/storybook-arg-types.js';
import { CountryCodeField } from './country-code-field.js';
const meta = {
    title: 'Scalars/Country Code Field',
    component: CountryCodeField,
    decorators: [
        withForm,
        (Story) => (_jsx("div", { style: { width: '280px', margin: '1rem auto 0' }, children: _jsx(Story, {}) })),
    ],
    parameters: {
        layout: 'padded',
    },
    tags: ['autodocs'],
    argTypes: {
        ...getDefaultArgTypes(),
        ...PrebuiltArgTypes.placeholder,
        allowedCountries: {
            control: 'object',
            description: 'List of allowed country codes',
            table: {
                type: { summary: 'string[]' },
                category: StorybookControlCategory.COMPONENT_SPECIFIC,
            },
        },
        excludedCountries: {
            control: 'object',
            description: 'List of country codes to exclude',
            table: {
                type: { summary: 'string[]' },
                category: StorybookControlCategory.COMPONENT_SPECIFIC,
            },
        },
        includeDependentAreas: {
            control: 'boolean',
            description: 'Whether to include dependent territories in country list',
            table: {
                type: { summary: 'boolean' },
                defaultValue: { summary: 'false' },
                category: StorybookControlCategory.COMPONENT_SPECIFIC,
            },
        },
        optionFormat: {
            control: 'radio',
            options: ['CodesOnly', 'NamesOnly', 'NamesAndCodes'],
            description: 'How to display country options in dropdown',
            table: {
                type: { summary: '"CodesOnly" | "NamesOnly" | "NamesAndCodes"' },
                defaultValue: { summary: '"NamesOnly"' },
                category: StorybookControlCategory.COMPONENT_SPECIFIC,
            },
        },
        showFlagIcons: {
            control: 'boolean',
            description: 'Whether to show country flag icons',
            table: {
                type: { summary: 'boolean' },
                defaultValue: { summary: 'true' },
                category: StorybookControlCategory.COMPONENT_SPECIFIC,
            },
        },
        enableSearch: {
            control: 'boolean',
            description: 'Enable search functionality',
            table: {
                type: { summary: 'boolean' },
                defaultValue: { summary: 'false' },
                category: StorybookControlCategory.COMPONENT_SPECIFIC,
            },
        },
        ...getValidationArgTypes(),
        ...PrebuiltArgTypes.viewMode,
        ...PrebuiltArgTypes.baseValue,
    },
    args: {
        name: 'country-code-field',
        placeholder: 'Select a country',
    },
};
export default meta;
export const Default = {
    args: {
        label: 'Country',
    },
};
export const Disabled = {
    args: {
        label: 'Disabled field',
        value: 'FR',
        disabled: true,
    },
};
export const Required = {
    args: {
        label: 'Country',
        required: true,
    },
};
export const WithSearchEnabled = {
    args: {
        label: 'Country',
        description: 'Type to search through options',
        enableSearch: true,
    },
};
export const WithError = {
    args: {
        label: 'Country',
        value: 'AO',
        errors: ['Please select a different country'],
    },
};
export const WithWarning = {
    args: {
        label: 'Country',
        value: 'AF',
        warnings: ['This country may have restricted access'],
    },
};
export const WithoutFlags = {
    args: {
        label: 'Country',
        description: 'Shows country options without flag icons',
        showFlagIcons: false,
    },
};
export const WithCodesOnly = {
    args: {
        label: 'Country',
        description: 'Shows country codes only',
        optionFormat: 'CodesOnly',
    },
};
export const WithNamesAndCodes = {
    args: {
        label: 'Country',
        description: 'Shows country names and codes',
        optionFormat: 'NamesAndCodes',
    },
};
export const WithDependentAreas = {
    args: {
        label: 'Country',
        description: 'Shows dependent areas',
        includeDependentAreas: true,
    },
};
export const WithDifferencesAddition = {
    args: {
        label: 'Country addition',
        value: 'FR',
        baseValue: 'US',
        viewMode: 'addition',
    },
};
export const WithDifferencesRemoval = {
    args: {
        label: 'Country removal',
        value: 'FR',
        baseValue: 'US',
        viewMode: 'removal',
    },
};
export const WithDifferencesMixed = {
    args: {
        label: 'Country mixed',
        value: 'FR',
        baseValue: 'US',
        viewMode: 'mixed',
    },
};
//# sourceMappingURL=country-code-field.stories.js.map