### Install Konturio UI Packages
Source: https://context7.com/konturio/ui/llms.txt
Installs the necessary Konturio UI packages, including the core UI kit, default icons, default theme, and floating services, along with `clsx` and `react`.
```bash
npm install @konturio/ui-kit @konturio/default-icons @konturio/default-theme @konturio/floating clsx react
```
--------------------------------
### Modal Component Examples in React
Source: https://context7.com/konturio/ui/llms.txt
Illustrates the usage of the Modal component, showcasing basic modal implementation, handling backdrop clicks and ESC key presses for dismissal, and customizing the z-index. This example uses React and the @konturio/ui-kit library.
```tsx
import { Modal } from '@konturio/ui-kit';
import { useState } from 'react';
function ModalExamples() {
const [isOpen, setIsOpen] = useState(false);
const [confirmOpen, setConfirmOpen] = useState(false);
const handleCancel = (reason: 'esc' | 'click_outside') => {
console.log('Modal closed by:', reason);
setIsOpen(false);
};
return (
{/* Basic modal */}
setIsOpen(true)}>Open Modal
{isOpen && (
Modal Title
Modal content goes here.
setIsOpen(false)}>Close
)}
{/* Modal with custom z-index */}
setConfirmOpen(true)}>Open Confirmation
{confirmOpen && (
setConfirmOpen(false)}
zIndex="1000"
>
Confirm Action
Are you sure you want to proceed?
setConfirmOpen(false)}>Cancel
{
console.log('Confirmed!');
setConfirmOpen(false);
}}>Confirm
)}
);
}
```
--------------------------------
### Release Packages with Lerna
Source: https://github.com/konturio/ui/blob/v5/README.md
This command initiates the release process for packages managed by Lerna. It handles version bumping, changelog generation, and publishing to a package registry. Ensure you are on the main branch and have pushed your changes before running this.
```sh
npm run release
```
--------------------------------
### Panel Component Examples in React
Source: https://context7.com/konturio/ui/llms.txt
Demonstrates various configurations of the Panel component, including basic collapsible panels, panels with header icons, custom controls, height constraints, and modal display modes. It utilizes React and the @konturio/ui-kit library.
```tsx
import { Panel, PanelIcon } from '@konturio/ui-kit';
import { useState } from 'react';
import { InfoIcon, CloseIcon } from '@konturio/default-icons';
function PanelExamples() {
const [isOpen, setIsOpen] = useState(true);
const [showModal, setShowModal] = useState(false);
return (
{/* Basic collapsible panel */}
setIsOpen(!isOpen)}
>
Panel content goes here. This panel can be collapsed.
{/* Panel with header icon */}
}
isOpen={true}
>
Panel with an icon in the header.
{/* Panel with custom controls */}
,
onClick: () => console.log('Close clicked'),
}
]}
>
Panel with custom header controls.
{/* Panel with height constraints */}
Content with constrained height and vertical resize.
More content...
Even more content...
{/* Panel displayed in modal */}
setShowModal(true)}>Open Panel Modal
setShowModal(false)
}}
>
This panel is displayed in a modal overlay.
);
}
```
--------------------------------
### Tooltip Component Examples (React)
Source: https://context7.com/konturio/ui/llms.txt
Illustrates the use of the Tooltip component from the '@konturio/floating' package. It covers simple, compound, and programmatically controlled tooltips with various placement and content options. Includes `SimpleTooltip`, `Tooltip`, `TooltipTrigger`, `TooltipContent`, `FloatingProvider`, and `TooltipService`.
```tsx
import {
Tooltip,
TooltipTrigger,
TooltipContent,
SimpleTooltip,
FloatingProvider
} from '@konturio/floating';
function TooltipExamples() {
return (
{/* Simple tooltip (all-in-one) */}
Hover for tooltip
{/* Compound tooltip with more control */}
Hover me
Rich Content
Tooltips can contain any React content.
{/* Tooltip with different placements */}
Info icon
Aligned to the right, starting at top
{/* Bigger tooltip variant */}
Large tooltip
);
}
```
```tsx
// Tooltip Service for programmatic tooltips
import { TooltipService } from '@konturio/floating';
function TooltipServiceExample() {
const tooltipService = new TooltipService();
return (
);
}
function MapTooltipConsumer() {
const { useTooltip } = require('@konturio/floating');
const tooltip = useTooltip({ placement: 'top' });
const handleMouseMove = (e: React.MouseEvent) => {
tooltip.show({ x: e.clientX, y: e.clientY }, 'Tooltip at cursor position');
};
const handleMouseLeave = () => {
tooltip.close();
};
return (
Move mouse here for position-based tooltip
);
}
```
--------------------------------
### Textarea Component Examples in React
Source: https://context7.com/konturio/ui/llms.txt
Demonstrates the usage of the Textarea component from '@konturio/ui-kit'. Supports resizable dimensions, animated placeholders, and error states. It takes value, onChange, renderLabel, placeholder, and error props for configuration.
```tsx
import { Textarea } from '@konturio/ui-kit';
import { useState } from 'react';
function TextareaExamples() {
const [description, setDescription] = useState('');
return (
{/* Basic textarea */}
);
}
```
--------------------------------
### Menu Component Examples (React)
Source: https://context7.com/konturio/ui/llms.txt
Demonstrates the usage of the Menu component for creating dropdown menus. Supports various item types like buttons, links, and dividers, along with keyboard navigation. It imports components from '@konturio/ui-kit'.
```tsx
import { Menu, MenuButton, MenuList, MenuItem, MenuLink } from '@konturio/ui-kit';
import { Button, Divider } from '@konturio/ui-kit';
function MenuExamples() {
const handleAction = (action: string) => () => {
console.log(`Action: ${action}`);
};
return (
{/* Basic menu */}
Actions ▾
Download
Create a Copy
Delete
{/* Menu with Button component as trigger */}
Options ▾
Edit
Duplicate
Archive
Delete (disabled)
{/* Menu with links */}
Navigate ▾
Dashboard
Settings
Help (new tab)
);
}
```
--------------------------------
### Tabs Component Examples (React)
Source: https://context7.com/konturio/ui/llms.txt
Illustrates the functionality of the Tabs component for creating tabbed interfaces. It supports horizontal and vertical orientations, controlled and uncontrolled states, and keyboard navigation. The component is provided by the @konturio/ui-kit library.
```tsx
import { Tabs, TabList, Tab, TabPanels, TabPanel } from '@konturio/ui-kit';
import { useState } from 'react';
function TabsExamples() {
const [activeTab, setActiveTab] = useState(0);
return (
{/* Basic horizontal tabs */}
Overview
Settings
Analytics
Overview Content
Welcome to the dashboard overview.
Settings Content
Configure your preferences here.
Analytics Content
View your analytics data.
{/* Vertical tabs */}
Profile
Security
Notifications
Profile settings
Security options
Notification preferences
{/* Controlled tabs with onChange */}
setActiveTab(index)}>
Tab 1
Tab 2 (Disabled)
Tab 3
Content for Tab 1
Content for Tab 2
Content for Tab 3
{/* Tabs with default index */}
First
Second (default)
Third
First panel
Second panel - shown by default
Third panel
);
}
```
--------------------------------
### Input Component Examples (React)
Source: https://context7.com/konturio/ui/llms.txt
Illustrates the functionality of the Konturio UI Input component, including basic usage with labels and placeholders, animated top placeholders, password visibility toggles, error states, and applying custom CSS classes. It requires importing `Input` from `@konturio/ui-kit` and using React's `useState` and `useRef` hooks.
```tsx
import { Input } from '@konturio/ui-kit';
import { useState, useRef } from 'react';
function InputExamples() {
const [email, setEmail] = useState('');
const [password, setPassword] = useState('');
const inputRef = useRef(null);
return (
{/* Basic input with label */}
setEmail(e.target.value)}
renderLabel="Email Address"
placeholder="Enter your email"
/>
{/* Input with top placeholder animation */}
setEmail(e.target.value)}
placeholder="Email"
showTopPlaceholder={true}
/>
{/* Password input with visibility toggle */}
setPassword(e.target.value)}
renderLabel="Password"
placeholder="Enter password"
/>
{/* Input with error state */}
setEmail(e.target.value)}
error="Invalid email format"
renderLabel="Email"
/>
{/* Input with custom classes */}
);
}
```
--------------------------------
### Button Component Examples (React)
Source: https://context7.com/konturio/ui/llms.txt
Demonstrates the usage of the Konturio UI Button component, showcasing various variants, sizes, icon placements, active states, and disabled states. It requires importing `Button` from `@konturio/ui-kit` and optionally icons from `@konturio/default-icons`.
```tsx
import { Button } from '@konturio/ui-kit';
import { EyeBallIcon } from '@konturio/default-icons';
function ButtonExamples() {
const handleClick = () => console.log('Button clicked');
return (
{/* Basic button */}
Click Me
{/* Button with icon before text */}
}
onClick={handleClick}
>
View Details
{/* Icon-only button */}
}
onClick={handleClick}
/>
{/* Active state button */}
}
>
Active Button
{/* Disabled button */}
Disabled
);
}
```
--------------------------------
### Select Component Examples in React
Source: https://context7.com/konturio/ui/llms.txt
Illustrates the functionality of the Select component from '@konturio/ui-kit'. It supports single and multiple selections (chips, aggregate), custom item rendering, and keyboard navigation. Key props include items, value, onChange, label, multiselect, and error.
```tsx
import { Select } from '@konturio/ui-kit';
import { useState } from 'react';
import type { SelectableItem } from '@konturio/ui-kit';
const items: SelectableItem[] = [
{ title: 'Option One', value: 1 },
{ title: 'Option Two', value: 2 },
{ title: 'Option Three', value: 3, hasDivider: true },
{ title: 'Disabled Option', value: 4, disabled: true },
{ title: 'Option Five', value: 5 },
];
function SelectExamples() {
const [selected, setSelected] = useState(null);
const [multiSelected, setMultiSelected] = useState([]);
return (
{/* Basic single select */}
setSelected(e.selectedItem || null)}
label="Choose Option"
>
Select an option...
{/* Select with default value */}
console.log('Selected:', item)}
/>
{/* Multiselect with chips */}
setMultiSelected(items as SelectableItem[])}
>
Choose items...
{/* Multiselect with aggregate display */}
Select items
{/* Inline select variant */}
{/* Select with error state */}
);
}
```
--------------------------------
### Manual Publish Command for Lerna
Source: https://github.com/konturio/ui/blob/v5/README.md
This command can be used as a workaround if the automated release pipeline fails. It manually publishes packages, which might be necessary in certain CI/CD troubleshooting scenarios. Use with caution and ensure proper versioning.
```sh
npm run publish
```
--------------------------------
### Add Dependency to All Packages with Lerna
Source: https://github.com/konturio/ui/blob/v5/README.md
This command adds a specified package as a dependency to all packages within the Lerna monorepo. It's a convenient way to ensure a common dependency is available across the entire project.
```sh
lerna add @konturio/module3
```
--------------------------------
### Add Dependency to Specific Package with Lerna
Source: https://github.com/konturio/ui/blob/v5/README.md
This command adds a specified package as a dependency to a particular package within the Lerna monorepo. The `--scope` flag targets the installation to a single package, useful for managing inter-package dependencies.
```sh
lerna add @konturio/module3 --scope=@konturio/module2
```
--------------------------------
### Toggler Component Examples (React)
Source: https://context7.com/konturio/ui/llms.txt
Demonstrates the usage of the Toggler component for managing boolean states. It supports basic toggling, bidirectional labels, disabled states, and custom class names for labels. This component is part of the @konturio/ui-kit library.
```tsx
import { Toggler } from '@konturio/ui-kit';
import { useState } from 'react';
function TogglerExamples() {
const [darkMode, setDarkMode] = useState(false);
const [notifications, setNotifications] = useState(true);
return (
{/* Basic toggle */}
setDarkMode(e.target.checked)}
/>
{/* Toggle with off-value label (bidirectional) */}
console.log('View mode:', e.target.checked ? 'Grid' : 'List')}
/>
{/* Disabled toggle */}
{/* Toggle with custom label classes */}
setNotifications(e.target.checked)}
classes={{
label: 'custom-label',
activeLabel: 'active-label-highlight'
}}
/>
);
}
```
--------------------------------
### GitHub Actions CI/CD Workflow for PNPM Monorepo
Source: https://github.com/konturio/ui/blob/v5/docs/adr/0002-build-system-workflow-implementation.md
This YAML workflow defines the CI/CD pipeline for a PNPM monorepo. It includes a 'build' job that checks out code, sets up PNPM and Node.js, installs dependencies, builds the project, and runs tests. The 'release' job, triggered only on the main branch and not on 'ci skip' commits, depends on the 'build' job and uses Changesets to manage package releases and publishing.
```yaml
name: CI
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: pnpm/action-setup@v2
with:
version: 7
- uses: actions/setup-node@v3
with:
node-version: 16
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
- run: pnpm run build
- run: pnpm run test
release:
if: github.ref == 'refs/heads/main' && !contains(github.event.head_commit.message, 'ci skip')
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: pnpm/action-setup@v2
with:
version: 7
- uses: actions/setup-node@v3
with:
node-version: 16
cache: 'pnpm'
registry-url: 'https://registry.npmjs.org'
- run: pnpm install --frozen-lockfile
- name: Create Release Pull Request or Publish
id: changesets
uses: changesets/action@v1
with:
publish: pnpm run publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
```
--------------------------------
### Pull Request: Branch Naming Convention
Source: https://github.com/konturio/ui/blob/v5/AGENTS.md
Branch names should align with the branch name recorded in Fibery, if provided. For example, a branch name might look like `21648-switch-page-after-login-to-map`. This ensures consistency between development tasks and version control.
```git
git checkout -b 21648-switch-page-after-login-to-map
```
--------------------------------
### Context System Implementation Comparison
Source: https://github.com/konturio/ui/blob/v5/docs/investigations/tooltips-popups-audit.md
Illustrates the difference in context system implementation between the legacy ui-kit Dropdown and the modern floating TooltipService. The legacy system uses `createContext` for isolated implementations, while the modern system employs a standalone manager class.
```typescript
// ui-kit/Dropdown/context.ts
createContext(); // Isolated implementation
```
```typescript
// floating/TooltipService.ts
class TooltipService {
/* Standalone manager */
}
```
--------------------------------
### Python Code Commenting
Source: https://github.com/konturio/ui/blob/v5/AGENTS.md
This illustrates the practice of writing comments for each logical block of Python code to enhance readability and maintainability.
```python
def my_function(param1, param2):
# This is a comment for the first logical block
result1 = param1 + param2
# This is a comment for the second logical block
result2 = result1 * 2
return result2
```
--------------------------------
### Makefile Tab Usage
Source: https://github.com/konturio/ui/blob/v5/AGENTS.md
This highlights the requirement for Makefiles to use tabs for indentation, a common convention that needs to be adhered to for correct execution.
```makefile
target:
@echo "This command uses a tab for indentation."
```
--------------------------------
### Testing: Makefile Smoke Test
Source: https://github.com/konturio/ui/blob/v5/AGENTS.md
The `make --trace all` command can be used to smoke-test a Makefile. This command displays the dependency chain as it is executed, helping to identify any issues or unexpected behavior in the build process.
```bash
make --trace all
```
--------------------------------
### CI: GitHub Actions Configuration
Source: https://github.com/konturio/ui/blob/v5/AGENTS.md
The project utilizes GitHub Actions for its Continuous Integration (CI) processes. It's important to keep the GitHub Actions configuration up-to-date to ensure that the CI pipeline functions correctly and efficiently.
```yaml
name: CI Pipeline
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run tests
run: pytest
```
--------------------------------
### Applying Default Theme in React
Source: https://context7.com/konturio/ui/llms.txt
Shows how to integrate the default theme CSS from '@konturio/default-theme' into a React application. This enables consistent styling across UI components by utilizing CSS custom properties.
```tsx
// Import theme CSS at application root
import '@konturio/default-theme/src/style.module.css';
// Theme CSS variables available:
// --base-strong-down, --base-weak-up, --faint-strong, etc.
// --control-bg-weak, --control-bg-strong
// --danger-strong, --warning-strong, --success-strong
function ThemedApp() {
return (
{/* All @konturio/ui-kit components will use theme variables */}
Themed Button
);
}
```
--------------------------------
### Manual vs. Floating UI Positioning Logic
Source: https://github.com/konturio/ui/blob/v5/docs/investigations/tooltips-popups-audit.md
Compares the manual boundary checking logic in the legacy Tooltip component with the modern Floating UI approach using `useFloating` hook and middleware. The legacy system requires explicit calculations, while the modern system leverages a library for automated placement and offset adjustments.
```typescript
// Legacy (ui-kit/Tooltip)
function calculatePlacement(target: DOMRect, tooltip: DOMRect) {
// Manual boundary checks
}
```
```typescript
// Modern (floating/Tooltip)
const { x, y, refs } = useFloating({
middleware: [autoPlacement(), offset(4)],
});
```
--------------------------------
### Autocomplete Component Usage with React
Source: https://context7.com/konturio/ui/llms.txt
Demonstrates the usage of the Autocomplete component for type-ahead filtering and selection. Supports custom filter functions and various display options. Requires React and '@konturio/ui-kit'.
```tsx
import { Autocomplete } from '@konturio/ui-kit';
import { useState } from 'react';
import type { AutocompleteItemType } from '@konturio/ui-kit';
const countries: AutocompleteItemType[] = [
{ title: 'United States', value: 'us' },
{ title: 'United Kingdom', value: 'uk' },
{ title: 'Germany', value: 'de' },
{ title: 'France', value: 'fr' },
{ title: 'Japan', value: 'jp' },
];
function AutocompleteExamples() {
const [selected, setSelected] = useState(null);
// Custom filter function
const fuzzyFilter = (inputValue: string, items: AutocompleteItemType[]) => {
const lowerInput = inputValue.toLowerCase();
return items.filter(item =>
item.title.toLowerCase().startsWith(lowerInput) ||
item.value.toString().toLowerCase().includes(lowerInput)
);
};
return (
{/* Basic autocomplete */}
setSelected(item as AutocompleteItemType)}
/>
{/* Autocomplete with custom filter */}
{/* Controlled autocomplete */}
{
console.log('Change:', changes);
setSelected(changes.selectedItem || null);
}}
label="Select Country"
/>
{/* Inline variant with error */}
);
}
```
--------------------------------
### Makefile: Target Comment Format
Source: https://github.com/konturio/ui/blob/v5/AGENTS.md
Makefile targets should be formatted with self-documenting comments on the same line. The format is `target: dependencies | order_only_deps ## Description`. This makes the Makefile easier to understand and maintain by providing inline explanations for each target.
```makefile
# Example Makefile targets
build: src/* ## Compile source files
clean: ## Remove build artifacts
rm -rf build/
run: build ## Run the application
./build/app
```
--------------------------------
### Using Default Icons in React
Source: https://context7.com/konturio/ui/llms.txt
Demonstrates how to import and use SVG icon components from the '@konturio/default-icons' package in a React application. Supports basic usage, custom styling, size variants, and integration within other elements like buttons.
```tsx
import {
SearchIcon,
CloseIcon,
EyeBallIcon,
EyeBallCrossedIcon,
InfoIcon,
TrashBinIcon,
// Figma-exported icons with size variants
ChevronDown16,
ChevronDown24,
Close16,
Close24,
Eye16,
EyeOff16,
Calendar16,
Calendar24,
} from '@konturio/default-icons';
function IconExamples() {
return (
{/* Basic icon usage */}
{/* Icons with custom styling */}
{/* Size-variant icons (16px and 24px) */}
{/* 16x16 */}
{/* 24x24 */}
{/* Icons in buttons */}
Show
Hide
{/* Calendar icons */}
);
}
```
--------------------------------
### SQL: Idempotent Migration Format
Source: https://github.com/konturio/ui/blob/v5/AGENTS.md
SQL files, particularly migrations, should be idempotent. This means they can be run multiple times without causing unintended side effects. Typically, this involves using `DROP TABLE IF EXISTS` statements before creating tables and adding comments to clarify query logic.
```sql
-- Create users table if it does not exist
DROP TABLE IF EXISTS users;
CREATE TABLE users (
id SERIAL PRIMARY KEY,
username VARCHAR(50) UNIQUE NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
```
--------------------------------
### Listing Tooltip Consumers with Sourcegraph
Source: https://github.com/konturio/ui/blob/v5/docs/investigations/tooltips-popups-audit.md
Employs the `sg` (Sourcegraph CLI) tool to search for all occurrences of 'Tooltip' within the codebase and outputs the results in JSON format. The output is then piped to `jq` to extract the file paths of the matches.
```powershell
# List all Tooltip consumers
sg -p 'Tooltip' --json | jq '.matches[].file'
```
--------------------------------
### Export Icons from Figma using Personal Access Token
Source: https://github.com/konturio/ui/blob/v5/packages/default-icons/README.md
This section outlines the process of exporting icons from Figma using a Personal Access Token. It details how to generate the token in Figma settings and then use it either directly in the command line or by saving it in a `.env.local` file for subsequent exports. This method automates the process of bringing Figma icons into the project.
```bash
export FIGMA_TOKEN=
```
```bash
set FIGMA_TOKEN=
```
```bash
npm run figma:export
```
```bash
FIGMA_TOKEN=
```
```bash
npm run figma:export-env
```
--------------------------------
### Map Integration for Tooltips
Source: https://github.com/konturio/ui/blob/v5/docs/investigations/tooltips-popups-audit.md
Demonstrates how the MapTooltip component integrates with a map library to display tooltips based on screen coordinates and track geographical positions. This snippet shows the event handling for map clicks and the subsequent actions to show the tooltip and track the point's location.
```typescript
// MapTooltip.fixture.tsx
map.on('click', (e) => {
tooltip.show(e.point); // Screen coordinates
tracker.trackPointPosition(e.lngLat); // Geo coordinates
});
```
--------------------------------
### Testing: Offline Pipeline Execution
Source: https://github.com/konturio/ui/blob/v5/AGENTS.md
To run the CI pipeline in an offline testing mode, set the `TEST_MODE` environment variable to `1` and execute the `make -B -j all` command. This allows for testing without external network dependencies and helps verify build and test configurations.
```bash
TEST_MODE=1 PYTHONPATH=. make -B -j all
```
--------------------------------
### Python: Docstring Generation
Source: https://github.com/konturio/ui/blob/v5/AGENTS.md
Python code should include docstrings to facilitate the generation of call graphs and documentation. Docstrings explain the purpose of modules, classes, functions, and methods, making the codebase more understandable and maintainable.
```python
def calculate_area(length, width):
"""Calculates the area of a rectangle.
Args:
length (float): The length of the rectangle.
width (float): The width of the rectangle.
Returns:
float: The calculated area of the rectangle.
"""
return length * width
```
--------------------------------
### Checkbox Component Usage with React
Source: https://context7.com/konturio/ui/llms.txt
Illustrates the use of the Checkbox component for boolean selections. Supports controlled and uncontrolled states, labels, and custom styling. Requires React and '@konturio/ui-kit'.
```tsx
import { Checkbox } from '@konturio/ui-kit';
import { useState } from 'react';
function CheckboxExamples() {
const [isChecked, setIsChecked] = useState(false);
const [preferences, setPreferences] = useState({
notifications: true,
newsletter: false,
});
return (
{/* Basic checkbox */}
setIsChecked(checked)}
/>
{/* Inline checkbox (block=false) */}
setPreferences(prev => ({ ...prev, notifications: checked }))
}
/>
{/* Disabled checkbox */}
{/* Checkbox with custom classes */}
);
}
```
--------------------------------
### SQL JSONB Operator Usage
Source: https://github.com/konturio/ui/blob/v5/AGENTS.md
This snippet demonstrates the preferred method for querying jsonb data in SQL, utilizing indexed operators for better performance. It contrasts this with a less efficient alternative.
```sql
SELECT * FROM your_table WHERE tags @> '{"key": "value"}';
-- Instead of:
-- SELECT * FROM your_table WHERE tags ->> 'key' = 'value';
```
--------------------------------
### Radio Component Usage with React
Source: https://context7.com/konturio/ui/llms.txt
Shows how to use the Radio component for single selection within a group. It follows the API of the Checkbox component and supports labels and disabled states. Requires React and '@konturio/ui-kit'.
```tsx
import { Radio } from '@konturio/ui-kit';
import { useState } from 'react';
function RadioExamples() {
const [selectedPlan, setSelectedPlan] = useState('basic');
const handlePlanChange = (plan: string) => (checked: boolean) => {
if (checked) setSelectedPlan(plan);
};
return (
{/* Radio group for plan selection */}
{/* Disabled radio */}
{/* Inline radio (block=false) */}
);
}
```
--------------------------------
### Finding Broken Imports with ripgrep
Source: https://github.com/konturio/ui/blob/v5/docs/investigations/tooltips-popups-audit.md
Uses the `rg` (ripgrep) command-line tool to search for specific text patterns across files. This command is used to find broken imports related to '@konturio/floating'.
```powershell
# Find broken imports
rg '@konturio/floating' packages/
```
--------------------------------
### Makefile: Intermediate Target Dependency
Source: https://github.com/konturio/ui/blob/v5/AGENTS.md
When a Makefile target requires an intermediate result from another target, it should be split into two separate targets. The first target produces the intermediate result, and the second target depends on this intermediate result. This promotes modularity and clarity in build processes.
```makefile
target_with_intermediate:
@echo "Running target with intermediate"
intermediate_target:
@echo "Running intermediate target"
all: intermediate_target target_with_intermediate
t@echo "All targets completed."
```
--------------------------------
### Manually Add New Icon as React Component
Source: https://github.com/konturio/ui/blob/v5/packages/default-icons/README.md
This snippet demonstrates how to manually add a new SVG icon as a React component in the Konturio UI module. It involves creating a new TSX file, pasting the SVG content, and structuring it as a functional component that accepts SVG props. The component is then memoized for performance optimization.
```typescript jsx
import React, { FC } from 'react';
const CloseIcon: FC = (props: React.SVGProps) => (
);
export default React.memo(CloseIcon);
```
--------------------------------
### Pull Request: Conventional Commits Format
Source: https://github.com/konturio/ui/blob/v5/AGENTS.md
Pull requests and commits should follow the Conventional Commits specification. The format is `type(scope): TICKETNUMBER title ...`. The ticket number can be omitted if not provided. This convention helps in automating changelog generation and standardizing commit messages.
```git
feat(auth): AUTH-123 Implement user login endpoint
Adds a new POST endpoint to /api/v1/login for user authentication.
Includes validation for username and password.
```
=== COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.