### FieldSelect Example Source: https://github.com/cloud-ru-tech/snack-uikit/blob/master/packages/fields/README.md Shows the FieldSelect component for selecting options from a list. This example covers single selection mode, searchable options, and handling of open/close states. ```tsx const [value, setValue] = useState('1234'); const [isOpen, setIsOpen] = useState(false); {}} onBlur={() => {}} label='Select an item' labelTooltip='You can choose any option' required={true} hint='You have chosen wrong item' size='s' validationState='error' prefixIcon={} enableFuzzySearch={true} />; ``` -------------------------------- ### Toolbar Component Example Source: https://github.com/cloud-ru-tech/snack-uikit/blob/master/packages/toolbar/README.md Demonstrates the usage of the Toolbar component with search, multiple selection, bulk actions, refresh, more actions, filters, and persistence. ```tsx import { useState } from 'react'; import { Toolbar } from '@snack-uikit/toolbar'; import { ButtonFunction } from '@snack-uikit/button'; import { PlaceholderSVG } from '@snack-uikit/icons'; function Example() { const [searchValue, setSearchValue] = useState(''); const [checked, setChecked] = useState(false); const [filtersValue, setFiltersValue] = useState>({}); const [visibleFilters, setVisibleFilters] = useState([]); const bulkActions = [ { label: 'Confirm', icon: PlaceholderSVG, onClick: () => console.log('Confirm'), 'data-test-id': 'confirm-action', }, { label: 'Delete', icon: PlaceholderSVG, onClick: () => console.log('Delete'), 'data-test-id': 'delete-action', }, ]; const moreActions = [ { id: 'export', content: { option: 'Export' }, onClick: () => console.log('Export'), }, { id: 'import', content: { option: 'Import' }, onClick: () => console.log('Import'), }, ]; const filterRow = { showAddButton: true, showClearButton: true, filters: [ { id: 'status', label: 'Status', type: 'single', pinned: true, options: [ { label: 'Active', value: 'active' }, { label: 'Inactive', value: 'inactive' }, ], }, ], open: visibleFilters.length > 0, value: filtersValue, onChange: setFiltersValue, visibleFilters, onVisibleFiltersChange: setVisibleFilters, }; return ( console.log('Search:', value), placeholder: 'Search', }} selectionMode="multiple" checked={checked} onCheck={() => setChecked(!checked)} bulkActions={bulkActions} onRefresh={() => console.log('Refresh')} moreActions={moreActions} filterRow={filterRow} after={ <> } size="m" /> } size="m" /> } persist={{ id: 'example-toolbar', filterQueryKey: 'filters', onLoad: ({ filter, search }) => { if (filter) setFiltersValue(filter); if (search) setSearchValue(search); }, }} /> ); } ``` -------------------------------- ### Upload Toasts Source: https://github.com/cloud-ru-tech/snack-uikit/blob/master/packages/toaster/README.md Methods for starting, updating, and dismissing upload toasts. ```APIDOC ## toaster.upload ### Description Provides methods to manage upload toasts. ### Methods #### `startOrUpdate(options: object)` Starts or updates an upload toast. - **Parameters**: - **options** (`object`) - Configuration options for the upload toast. - **Returns**: `string` - The ID of the upload toast. #### `dismiss(id: string)` Dismisses an upload toast. - **Parameters**: - **id** (`string`) - The ID of the toast to dismiss. ``` -------------------------------- ### FieldTextArea Example Source: https://github.com/cloud-ru-tech/snack-uikit/blob/master/packages/fields/README.md Demonstrates the FieldTextArea component for multi-line text input. It includes properties for maximum length, row count, resizability, and validation. ```tsx const [value, setValue] = useState('abc'); {}} onBlur={() => {}} label='Enter text' labelTooltip='You can input any text' required={true} hint='You have entered wrong answer' size='s' validationState='error' />; ``` -------------------------------- ### FieldSecure Example Source: https://github.com/cloud-ru-tech/snack-uikit/blob/master/packages/fields/README.md Shows how to use the FieldSecure component for password input. It supports toggling password visibility, copy button, and includes props for input masking and validation. ```tsx const [value, setValue] = useState('1234'); const [isHidden, setIsHidden] = useState(false);