### Development Setup Source: https://github.com/alfa-laboratory/core-components/blob/master/README.md Commands to clone the repository, install dependencies, and start the development server. ```bash $ git clone git@github.com:alfa-laboratory/core-components.git $ cd core-components $ yarn install $ yarn start ``` -------------------------------- ### Install Specific Component Source: https://github.com/alfa-laboratory/core-components/blob/master/README.md Install individual components to reduce project size. This example shows installing the button component. ```bash yarn add @alfalab/core-components-button ``` -------------------------------- ### Install All Core Components Source: https://github.com/alfa-laboratory/core-components/blob/master/README.md Use this command to install the entire core-components library. ```bash yarn add @alfalab/core-components ``` -------------------------------- ### TabsMobile Example Source: https://github.com/alfa-laboratory/core-components/blob/master/packages/tabs/src/docs/description.mdx Demonstrates the basic usage of the TabsMobile component with multiple tabs. Use this for mobile interfaces. ```tsx render(() => { const [selectedId, setSelectedId] = React.useState('tab-1'); const handleChange = (event, { selectedId }) => setSelectedId(selectedId); return ( Таб 1 Таб 2 Таб 3 Таб 4 Таб 5 ); }); ``` -------------------------------- ### TabsDesktop Example Source: https://github.com/alfa-laboratory/core-components/blob/master/packages/tabs/src/docs/description.mdx Demonstrates the basic usage of the TabsDesktop component with multiple tabs. Use this for standard desktop interfaces. ```tsx render(() => { const [selectedId, setSelectedId] = React.useState('tab-1'); const handleChange = (event, { selectedId }) => setSelectedId(selectedId); return ( Таб 1 Таб 2 Таб 3 Таб 4 Таб 5 ); }); ``` -------------------------------- ### Line Chart Example Source: https://github.com/alfa-laboratory/core-components/blob/master/packages/chart/src/docs/description.mdx Example of a line chart configuration. It includes options for hiding the chart, legend, or tooltip, setting zIndex, chart type, icon, and various properties for the line and its dots. ```javascript { /* * Скрыть график */ hide?: false, /* * Скрыть график в легенде */ hideLegend?: false, /* * Скрыть график в тултипe */ hideTooltip?: false, /* * Z-index графика */ zIndex, /* * Тип графика */ chart: 'line', /* * Тип иконки для графика */ icon, /* * Параметры графика */ properties: { /* * Название графика (отображается в легендах и тултипе) */ name, /* * Ключ данных */ dataKey, /* * Цвет линии графика */ stroke?: '#3182bd', /* * Отображение точек на графике */ dot?, /* * Параметры для точек грфика (если dot: true) */ dotSettings: [{ /* * Значение media query */ media, /* * Значение маштаба при ховере */ scale, /* * Начальный значения маштаба */ initScale, /* * Ширина точки */ width, /* * Высота точки */ height, }], /* * Наследование цвета */ inheritStroke?: false, /* * Форматирование значения графика для тултипа */ formatter?, /* * Тип линии */ type? 'linear', /* * Толщина линии */ strokeWidth?: 1, /* * Прерывистость линии */ strokeDasharray?, }, /* *  Массив данных для отрисовки */ data: [ /** * Метка */ label, /** * Значение */ value, ], } ``` -------------------------------- ### TabsResponsive Example Source: https://github.com/alfa-laboratory/core-components/blob/master/packages/tabs/src/docs/description.mdx Demonstrates the TabsResponsive component, which adapts its layout at 768px. Use this for interfaces that need to work across different screen sizes. ```tsx render(() => { const [selectedId, setSelectedId] = React.useState('tab-1'); const handleChange = (event, { selectedId }) => setSelectedId(selectedId); return ( Таб 1 Таб 2 Таб 3 Таб 4 Таб 5 ); }); ``` -------------------------------- ### Confirmation Component Live Example Source: https://github.com/alfa-laboratory/core-components/blob/master/packages/confirmation/src/docs/description.mdx Demonstrates the Confirmation component with different states and scenarios, including success, error, fatal error, attempts left, and temporary blocking. Use this to visualize the component's behavior in various conditions. ```tsx render(() => { const variants = [ { key: 'success', content: 'Успешный сценарий' }, { key: 'error', content: 'Сценарий с ошибкой' }, { key: 'fatal', content: 'Сценарий с критичной ошибкой' }, { key: 'attempts-left', content: 'Сценарий, когда кончились попытки запроса смс', }, { key: 'temp-block', content: 'Сценарий, когда форма временно заблокирована', }, ]; const [variant, setVariant] = React.useState({ key: 'success', content: 'Успешный сценарий' }); const { confirmationState, confirmationScreen, confirmationBlockSmsRetry, setConfirmationState, setConfirmationScreen, setConfirmationBlockSmsRetry, } = useConfirmation(); const handleInputFinished = () => { setTimeout(() => { switch (variant.key) { case 'success': setConfirmationState('INITIAL'); break; case 'error': setConfirmationState('CODE_ERROR'); break; case 'fatal': setConfirmationScreen('FATAL_ERROR'); break; case 'attempts-left': setConfirmationState('CODE_ERROR'); break; case 'temp-block': setConfirmationScreen('TEMP_BLOCK'); break; default: break; } }, 1000); }; const handleSmsRetryClick = () => { setTimeout(() => { if (variant.key === 'attempts-left') { setConfirmationBlockSmsRetry(true); } setConfirmationState('INITIAL'); }, 1000); }; const handleTempBlockFinished = () => { setConfirmationScreen('INITIAL'); setConfirmationState('CODE_SENDING'); }; return (