|
| 1 | +import { CATEGORY_CONTROL } from '@/constants/categoryControl'; |
| 2 | +import { IThemeObjectVariants } from '@/designSystem/themesObject'; |
| 3 | +import { ArgTypesReturn } from '@/types'; |
| 4 | + |
| 5 | +export const argtypes = ( |
| 6 | + variantsObject: IThemeObjectVariants, |
| 7 | + themeSelected: string |
| 8 | +): ArgTypesReturn => { |
| 9 | + return { |
| 10 | + variant: { |
| 11 | + description: 'Select the component theme', |
| 12 | + type: { name: 'string', required: true }, |
| 13 | + control: { type: 'select' }, |
| 14 | + options: Object.keys(variantsObject[themeSelected].StepperProgressVariants || {}), |
| 15 | + table: { |
| 16 | + type: { |
| 17 | + summary: 'string', |
| 18 | + }, |
| 19 | + category: CATEGORY_CONTROL.MODIFIERS, |
| 20 | + }, |
| 21 | + }, |
| 22 | + maxSteps: { |
| 23 | + description: 'Max steps numbers. Max value: 10', |
| 24 | + type: { name: 'number', required: true }, |
| 25 | + control: { type: 'number', min: 0, max: 10 }, |
| 26 | + table: { |
| 27 | + type: { |
| 28 | + summary: 'number', |
| 29 | + }, |
| 30 | + category: CATEGORY_CONTROL.MODIFIERS, |
| 31 | + }, |
| 32 | + }, |
| 33 | + initialStep: { |
| 34 | + description: 'Initial Step', |
| 35 | + type: { name: 'number' }, |
| 36 | + control: { type: 'number' }, |
| 37 | + table: { |
| 38 | + type: { |
| 39 | + summary: 'number', |
| 40 | + }, |
| 41 | + category: CATEGORY_CONTROL.MODIFIERS, |
| 42 | + }, |
| 43 | + }, |
| 44 | + currentStep: { |
| 45 | + description: 'Current step number, It shouldnt be greater than maximum value of maxSteps', |
| 46 | + type: { name: 'number', required: true }, |
| 47 | + control: { type: 'number', min: 0, max: 10 }, |
| 48 | + table: { |
| 49 | + type: { |
| 50 | + summary: 'number', |
| 51 | + }, |
| 52 | + category: CATEGORY_CONTROL.MODIFIERS, |
| 53 | + }, |
| 54 | + }, |
| 55 | + ariaLabel: { |
| 56 | + description: 'Aria label text for progress bar', |
| 57 | + type: { name: 'string' }, |
| 58 | + control: { type: 'text' }, |
| 59 | + table: { |
| 60 | + type: { |
| 61 | + summary: 'string', |
| 62 | + }, |
| 63 | + category: CATEGORY_CONTROL.ACCESIBILITY, |
| 64 | + }, |
| 65 | + }, |
| 66 | + prefixAriaLabel: { |
| 67 | + description: 'Prefixes for creating the visual text', |
| 68 | + type: { name: '{ step: string; of: string, completed: string }' }, |
| 69 | + control: { type: 'object' }, |
| 70 | + table: { |
| 71 | + type: { |
| 72 | + summary: '{ step: string; of: string, completed: string }', |
| 73 | + }, |
| 74 | + defaultValue: { |
| 75 | + // eslint-disable-next-line quotes |
| 76 | + summary: "{ step: 'step', of: 'of', completed: 'completed' }", |
| 77 | + }, |
| 78 | + category: CATEGORY_CONTROL.CONTENT, |
| 79 | + }, |
| 80 | + }, |
| 81 | + id: { |
| 82 | + description: 'Id', |
| 83 | + type: { name: 'string' }, |
| 84 | + control: { type: 'text' }, |
| 85 | + table: { |
| 86 | + type: { |
| 87 | + summary: 'string', |
| 88 | + }, |
| 89 | + category: CATEGORY_CONTROL.ACCESIBILITY, |
| 90 | + }, |
| 91 | + }, |
| 92 | + dataTestId: { |
| 93 | + description: 'Test id', |
| 94 | + type: { name: 'string' }, |
| 95 | + control: false, |
| 96 | + table: { |
| 97 | + type: { |
| 98 | + summary: 'string', |
| 99 | + }, |
| 100 | + category: CATEGORY_CONTROL.TESTING, |
| 101 | + }, |
| 102 | + }, |
| 103 | + ctv: { |
| 104 | + description: 'Object used for update variant styles', |
| 105 | + type: { name: 'object' }, |
| 106 | + control: { type: 'object' }, |
| 107 | + table: { |
| 108 | + type: { |
| 109 | + summary: 'object', |
| 110 | + }, |
| 111 | + category: CATEGORY_CONTROL.CUSTOMIZATION, |
| 112 | + }, |
| 113 | + }, |
| 114 | + }; |
| 115 | +}; |
0 commit comments