5a824c2eee
75 components + DESIGN_SYSTEM.md + sync script. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
3.0 KiB
3.0 KiB
name, kind, lang, domain, version, purity, signature, description, tags, uses_functions, uses_types, returns, returns_optional, error_type, imports, tested, tests, test_file_path, file_path, framework, has_state, props, emits, output, params
| name | kind | lang | domain | version | purity | signature | description | tags | uses_functions | uses_types | returns | returns_optional | error_type | imports | tested | tests | test_file_path | file_path | framework | has_state | props | emits | output | params | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| color_input | component | ts | ui | 1.0.0 | impure | ColorInput(props: ColorInputProps): JSX.Element | Selector de color con picker, swatches predefinidos y eye dropper. Soporta hex, rgb, hsl con alpha. Wrapper sobre Mantine ColorInput. |
|
false |
|
false | frontend/functions/ui/color_input.tsx | react | true |
|
|
Componente ColorInput que renderiza input de color con picker desplegable y swatches |
Ejemplo
import { ColorInput } from '@fn_library/color_input'
// Basico con hex (default)
<ColorInput
label="Color primario"
placeholder="#228be6"
/>
// Con swatches predefinidos
<ColorInput
label="Color de marca"
swatches={['#2e2e2e', '#868e96', '#fa5252', '#e64980', '#be4bdb', '#228be6', '#15aabf', '#12b886', '#40c057', '#82c91e', '#fab005', '#fd7e14']}
swatchesPerRow={7}
placeholder="Elige un color"
/>
// Con rgba y eye dropper
<ColorInput
label="Color con transparencia"
format="rgba"
withEyeDropper
value="rgba(34, 139, 230, 0.5)"
onChange={(value) => console.log(value)}
/>
Notas
Wrapper directo sobre ColorInput de Mantine v9. Hereda todas las props de Mantine sin restricciones.
El eye dropper (withEyeDropper) solo funciona en browsers que soporten la EyeDropper API (Chrome/Edge). En Firefox no aparece el boton automaticamente.
Cuando format es hex o hsl, el valor no incluye canal alpha. Para transparencia usar hexa, rgba o hsla.