mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 06:37:18 +01:00
Add Niteshift Dials SDK for runtime design prototyping
Introduces a complete design dials system that allows designers and PMs to adjust UI parameters at runtime without code changes. **Dials SDK (`packages/dials/`):** - useDynamicColor: Color values with design system integration - useDynamicSpacing: Spacing/padding/margin controls - useDynamicVariant: Discrete choice selections - useDynamicBoolean: Toggle/feature flag controls - useDynamicNumber: Numeric values with min/max/step - DialsOverlay: Compact Leva-inspired UI (Ctrl+D to toggle) - DialsProvider: React context for dial state management - Design manifest integration for design system tokens **App Integration:** - Added DialsProvider to app Providers - Example dials on WebsitePage (metrics bar, panels, navigation) - MetricCard component with adjustable typography dials - TypeScript manifest at src/config/niteshift-manifest.ts **Documentation:** - Comprehensive CLAUDE.md section on dials usage - Best practices for preserving original appearance - Examples for all dial types 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
f4d0a65b16
commit
2727fd6dff
39 changed files with 4623 additions and 19 deletions
26
packages/dials/src/hooks/useDynamicBoolean.ts
Normal file
26
packages/dials/src/hooks/useDynamicBoolean.ts
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
/**
|
||||
* React hook for creating a boolean dial (toggle)
|
||||
*/
|
||||
|
||||
import { useDial } from './useDial';
|
||||
import type { BooleanDialConfig } from '../types';
|
||||
|
||||
/**
|
||||
* Create a dynamic boolean dial for toggles and feature flags
|
||||
*
|
||||
* @example
|
||||
* ```typescript
|
||||
* const showMetrics = useDynamicBoolean('show-metrics', {
|
||||
* label: 'Show Metrics',
|
||||
* default: true,
|
||||
* trueLabel: 'Visible',
|
||||
* falseLabel: 'Hidden',
|
||||
* group: 'Dashboard'
|
||||
* });
|
||||
*
|
||||
* {showMetrics && <MetricsPanel />}
|
||||
* ```
|
||||
*/
|
||||
export function useDynamicBoolean(id: string, config: Omit<BooleanDialConfig, 'type'>): boolean {
|
||||
return useDial<boolean>(id, 'boolean', { ...config, type: 'boolean' });
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue