corekit-ui 0.1.12 → 0.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -16,6 +16,22 @@
16
16
 
17
17
  ---
18
18
 
19
+ ## 📦 Instalación Rápida
20
+
21
+ ```bash
22
+ npm install corekit-ui
23
+ ```
24
+
25
+ **⚠️ IMPORTANTE**: Los estilos NO se importan automáticamente. Debes agregar esto en tu archivo principal:
26
+
27
+ ```typescript
28
+ import 'corekit-ui/styles.css'; // ✅ Obligatorio
29
+ ```
30
+
31
+ 📖 **[Ver Guía Completa de Instalación →](./INSTALLATION.md)**
32
+
33
+ ---
34
+
19
35
  ## Características
20
36
 
21
37
  - ⚡ **Vite** + **pnpm** → desarrollo y builds rápidos.
package/dist/index.d.ts CHANGED
@@ -2532,7 +2532,7 @@ declare type SelectObjectFullProps<T> = BaseSelectProps<T> & WrapperProps & {
2532
2532
  * @description
2533
2533
  * Este es el modo más común para stores/APIs.
2534
2534
  * - El `value` que recibe es el ID (string | number)
2535
- * - El `onChange` devuelve el ID
2535
+ * - El `onChange` devuelve el ID (string vacío si se limpia)
2536
2536
  * - `optionValueKey` es **obligatorio**
2537
2537
  *
2538
2538
  * @example
@@ -2546,7 +2546,7 @@ declare type SelectObjectFullProps<T> = BaseSelectProps<T> & WrapperProps & {
2546
2546
  * optionValueKey="id" // Obligatorio
2547
2547
  * optionLabelKey="nombre"
2548
2548
  * onChange={(id) => {
2549
- * console.log(id); // '123' (string)
2549
+ * console.log(id); // '123' (string) o '' si se limpia
2550
2550
  * // Luego buscas el objeto si lo necesitas
2551
2551
  * }}
2552
2552
  * />
@@ -2554,10 +2554,10 @@ declare type SelectObjectFullProps<T> = BaseSelectProps<T> & WrapperProps & {
2554
2554
  */
2555
2555
  declare type SelectObjectIdProps<T> = BaseSelectProps<T> & WrapperProps & {
2556
2556
  options: T[];
2557
- /** Recibe el ID como string o number */
2558
- value?: string | number | null;
2559
- /** Devuelve el ID */
2560
- onChange?: (value: string | number | null) => void;
2557
+ /** Recibe el ID como string o number (string vacío para indicar sin selección) */
2558
+ value?: string | number;
2559
+ /** Devuelve el ID (string vacío en lugar de null al limpiar) */
2560
+ onChange?: (value: string | number) => void;
2561
2561
  /** Obligatorio cuando son objetos */
2562
2562
  optionValueKey: keyof T;
2563
2563
  /** Opcional */
@@ -3151,7 +3151,7 @@ export declare type SelectRef = {
3151
3151
  *
3152
3152
  * @description
3153
3153
  * Cuando las opciones son strings, no se necesitan optionValueKey ni optionLabelKey.
3154
- * El onChange recibe directamente el string seleccionado o null.
3154
+ * El onChange recibe directamente el string seleccionado (string vacío si se limpia).
3155
3155
  *
3156
3156
  * @example
3157
3157
  * ```tsx
@@ -3159,17 +3159,17 @@ export declare type SelectRef = {
3159
3159
  * <Select
3160
3160
  * options={frutas}
3161
3161
  * value="Manzana"
3162
- * onChange={(fruta) => console.log(fruta)} // 'Manzana' | null
3162
+ * onChange={(fruta) => console.log(fruta)} // 'Manzana' | ''
3163
3163
  * />
3164
3164
  * ```
3165
3165
  */
3166
3166
  declare type SelectStringProps = BaseSelectProps<string> & WrapperProps & {
3167
3167
  /** Lista de strings */
3168
3168
  options: string[];
3169
- /** Valor seleccionado actual */
3170
- value?: string | null;
3171
- /** Callback al cambiar selección */
3172
- onChange?: (value: string | null) => void;
3169
+ /** Valor seleccionado actual (string vacío si no hay selección) */
3170
+ value?: string;
3171
+ /** Callback al cambiar selección (devuelve string vacío en lugar de null al limpiar) */
3172
+ onChange?: (value: string) => void;
3173
3173
  /** No debe existir en modo string */
3174
3174
  optionValueKey?: never;
3175
3175
  /** No debe existir en modo string */