import { withForm } from '../../lib/decorators.js';
import { getDefaultArgTypes, getValidationArgTypes, PrebuiltArgTypes, StorybookControlCategory, } from '../../lib/storybook-arg-types.js';
import { NumberField } from './number-field.js';
const meta = {
    title: 'Scalars/Number Field',
    component: NumberField,
    parameters: {
        layout: 'centered',
    },
    decorators: [withForm],
    tags: ['autodocs'],
    argTypes: {
        ...getDefaultArgTypes({
            valueControlType: 'number',
            valueType: 'number',
        }),
        step: {
            control: 'number',
            description: 'Step value for the input field',
            table: {
                type: { summary: 'number' },
                defaultValue: { summary: '1' },
                category: StorybookControlCategory.COMPONENT_SPECIFIC,
            },
        },
        autoFocus: {
            table: {
                disable: true,
            },
        },
        numericType: {
            control: {
                type: 'select',
            },
            options: [
                'PositiveInt',
                'NegativeInt',
                'NonNegativeInt',
                'NonPositiveInt',
                'PositiveFloat',
                'NegativeFloat',
                'NonNegativeFloat',
                'NonPositiveFloat',
                'BigInt',
                'Int',
                'Float',
            ],
            description: 'Specifies the numeric type of the input field. Possible values are:\n\n\n' +
                '- PositiveInt: Positive whole numbers (1, 2, 3)\n' +
                '- NegativeInt: Negative whole numbers (-1, -2, -3)\n' +
                '- NonNegativeInt: Zero and positive whole numbers (0, 2)\n' +
                '- NonPositiveInt: Zero and negative whole numbers ( 0, -2)\n' +
                '- PositiveFloat: Positive decimals (1.0, 2.5)\n' +
                '- NegativeFloat: Negative decimals (-1.0, -2.5)\n' +
                '- NonNegativeFloat: Zero and positive decimals (0.0, 1.0)\n' +
                '- NonPositiveFloat: Zero and negative decimals (0.0, -1.0)\n' +
                '- BigInt: Large integers (9999999999999999)\n' +
                '- Float: Any decimal number (1.0, 2.5, -1.0, -2.5)\n' +
                '- Int: Any integer number, including positive (1, 2), negative (-1, -2), and zero\n',
            table: {
                defaultValue: { summary: 'Float' },
                type: {
                    summary: '"PositiveInt" | "NegativeInt" | "NonNegativeInt" | "NonPositiveInt" | "PositiveFloat" | "NegativeFloat" | "NonNegativeFloat" | "NonPositiveFloat" | "BigInt" | "Int" | "Float"',
                },
                category: StorybookControlCategory.COMPONENT_SPECIFIC,
            },
        },
        enableStepCarets: {
            control: 'boolean',
            description: 'Enable step carets',
            table: {
                type: { summary: 'boolean' },
                defaultValue: { summary: 'false' },
                category: StorybookControlCategory.COMPONENT_SPECIFIC,
            },
        },
        ...PrebuiltArgTypes.placeholder,
        ...getValidationArgTypes(),
        ...PrebuiltArgTypes.minValue,
        ...PrebuiltArgTypes.maxValue,
        ...PrebuiltArgTypes.precision,
        ...PrebuiltArgTypes.trailingZeros,
        ...PrebuiltArgTypes.viewMode,
        ...PrebuiltArgTypes.baseValue,
    },
    args: {
        name: 'number-field',
    },
};
export default meta;
export const Default = {
    args: {
        name: 'Label',
        label: 'Label',
        placeholder: 'Enter a number',
        value: 1234,
    },
};
export const Active = {
    args: {
        name: 'Label',
        label: 'Label',
        autoFocus: true,
        value: 45,
        placeholder: 'Enter a number',
    },
    parameters: {
        pseudo: { focus: true },
    },
};
export const Disable = {
    args: {
        name: 'Label',
        label: 'Label',
        value: 1234,
        disabled: true,
    },
};
export const Required = {
    args: {
        name: 'Label',
        label: 'Label',
        value: 345,
        required: true,
        placeholder: 'A number is required',
    },
};
export const WithWarning = {
    args: {
        name: 'Label',
        label: 'Label',
        value: 23,
        warnings: ['Warning message'],
        placeholder: 'Enter  number',
    },
};
export const WithError = {
    args: {
        name: 'Label',
        label: 'Label',
        value: 23,
        errors: ['Error message'],
        placeholder: 'Enter a number',
    },
};
export const WithMultipleErrors = {
    args: {
        name: 'Label',
        label: 'Label',
        value: 23,
        errors: ['Error message number 1', 'Error message number 2', 'Error message number 3', 'Error message number 4'],
        placeholder: 'Enter a number',
    },
};
export const WithValue = {
    args: {
        name: 'Label',
        label: 'Label',
        value: 23,
        placeholder: 'Enter a number',
    },
};
export const WithDescription = {
    args: {
        name: 'Label',
        label: 'Label',
        value: 0,
        description: 'This is the field description',
        placeholder: 'Enter a number',
    },
};
// Float Stories
export const WithFloatNumber = {
    args: {
        label: 'Label',
        name: 'Label',
        value: 0.0,
        precision: 2,
        trailingZeros: true,
        placeholder: 'Enter a decimal number',
    },
};
// BigInt Stories
export const WithBigInt = {
    args: {
        name: 'Label',
        label: 'Label',
        value: 99992342343299,
        numericType: 'BigInt',
        placeholder: 'Enter a large number',
    },
};
// Step Stories
export const WithStep = {
    args: {
        name: 'Label',
        label: 'Label',
        value: 456,
        step: 10,
        minValue: 20,
        placeholder: 'Enter a number',
    },
};
export const WithDifferencesAddition = {
    args: {
        label: 'Number difference addition',
        value: 2025,
        baseValue: 2024,
        viewMode: 'addition',
    },
};
export const WithDifferencesRemoval = {
    args: {
        label: 'Date difference removal',
        value: 205,
        baseValue: 2924,
        viewMode: 'removal',
    },
};
export const WithDifferencesMixed = {
    args: {
        label: 'Date difference mixed',
        value: 3345,
        baseValue: 345,
        viewMode: 'mixed',
    },
};
//# sourceMappingURL=number-field.stories.js.map