lkd-web-kit 0.10.6 → 0.10.8

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.
Files changed (27) hide show
  1. package/package.json +2 -2
  2. package/scripts/install-agent-skills.mjs +2 -2
  3. package/src/distributed-skills/lkd-create-modal-component/SKILL.md +168 -0
  4. package/src/distributed-skills/lkd-create-modal-component/agents/openai.yaml +4 -0
  5. package/src/distributed-skills/lkd-create-nextjs-page/SKILL.md +84 -0
  6. package/src/distributed-skills/lkd-create-nextjs-page/agents/openai.yaml +3 -0
  7. package/src/distributed-skills/lkd-create-svg-icon/SKILL.md +41 -0
  8. package/src/distributed-skills/lkd-create-svg-icon/agents/openai.yaml +3 -0
  9. package/src/distributed-skills/lkd-create-table-component/SKILL.md +189 -0
  10. package/src/distributed-skills/lkd-create-table-component/agents/openai.yaml +3 -0
  11. package/src/distributed-skills/lkd-layout-mantine-tailwind/SKILL.md +99 -0
  12. package/src/distributed-skills/lkd-layout-mantine-tailwind/agents/openai.yaml +4 -0
  13. package/src/distributed-skills/lkd-rhf-lkd-forms/SKILL.md +186 -0
  14. package/.agents/skills/create-nextjs-page/SKILL.md +0 -104
  15. package/.agents/skills/create-nextjs-page/agents/openai.yaml +0 -3
  16. package/.agents/skills/mantine-combobox/SKILL.md +0 -73
  17. package/.agents/skills/mantine-combobox/references/api.md +0 -199
  18. package/.agents/skills/mantine-combobox/references/patterns.md +0 -279
  19. package/.agents/skills/mantine-custom-components/SKILL.md +0 -112
  20. package/.agents/skills/mantine-custom-components/references/api.md +0 -407
  21. package/.agents/skills/mantine-custom-components/references/patterns.md +0 -431
  22. package/.agents/skills/publish-lkd-web-kit/SKILL.md +0 -165
  23. package/.agents/skills/publish-lkd-web-kit/agents/openai.yaml +0 -4
  24. package/.agents/skills/publish-lkd-web-kit/references/npm-trusted-publishing.md +0 -82
  25. package/.agents/skills/update-lkd-dependencies/SKILL.md +0 -88
  26. package/.agents/skills/update-lkd-dependencies/agents/openai.yaml +0 -4
  27. package/.agents/skills/update-lkd-dependencies/scripts/collect-npm-metadata.mjs +0 -73
@@ -0,0 +1,186 @@
1
+ ---
2
+ name: lkd-rhf-lkd-forms
3
+ description: Crear y revisar formularios, filtros, campos controlados, integraciones con React Hook Form, validaciones Zod, reglas superRefine, botones de submit y patrones Form* de lkd-web-kit. Usar cuando Codex trabaje en interfaces de formularios, filtros, wrappers de campos, schemas, valores iniciales, mapeo de payloads, flujos de submit o comportamiento de validación en proyectos que usan React Hook Form, Zod y lkd-web-kit.
4
+ ---
5
+
6
+ # Formularios RHF + lkd-web-kit
7
+
8
+ Usar este skill para formularios, filtros y campos controlados construidos con React Hook Form, Zod y `lkd-web-kit`.
9
+
10
+ ## Workflow obligatorio
11
+
12
+ 1. Leer primero la documentación de formularios del proyecto: `docs/lkd-web-kit.md` o el equivalente local.
13
+ 2. Reutilizar la familia `Form*` existente antes de crear algo nuevo:
14
+ `Form`, `FormTextInput`, `FormSelect`, `FormMultiSelect`, `FormTextarea`,
15
+ `FormNumberInput`, `FormMonthPickerInput`, `FormCheckbox`,
16
+ `FormRadioGroup`, `FormSubmitButton` y wrappers cercanos del proyecto.
17
+ 3. Importar primero desde `lkd-web-kit`. Usar wrappers locales solo cuando el proyecto ya los tenga y agreguen estilos o comportamiento propio.
18
+ 4. No crear un wrapper nuevo si el kit o el proyecto ya tienen un campo equivalente.
19
+ 5. Para formularios con validación, usar `useForm` con `zodResolver(schema)`.
20
+ 6. Pasar `mode` solo cuando la API del componente lo soporte. No inventar props.
21
+
22
+ ## Estructura recomendada
23
+
24
+ - Mantener formularios triviales inline.
25
+ - Cuando un formulario mapea datos de API o construye un payload, separar lo repetitivo:
26
+ - `schema`: objeto Zod y tipo inferido.
27
+ - `createDefaultValues`: datos de API/dominio a valores del formulario.
28
+ - `createPayload`: valores del formulario a payload de API.
29
+ - Usar `z.input<typeof schema>` para defaults cuando haya transforms o preprocess.
30
+ - Usar `z.infer<typeof schema>` para datos ya validados en submit.
31
+ - Colocar el código privado junto a la ruta o feature, salvo que sea realmente compartido.
32
+
33
+ ## Validaciones con Zod
34
+
35
+ - Poner reglas de campo en el schema base.
36
+ - No poner mensajes textuales en reglas base de Zod como `min(1, "Texto")`; usar la configuración global de errores o la capa de traducciones del proyecto.
37
+ - Usar `superRefine` para reglas cruzadas entre campos y reglas de negocio.
38
+ - En `superRefine`, asociar el issue al campo que el usuario puede corregir usando `path`.
39
+ - Permitir mensajes custom en `superRefine` cuando el proyecto no tenga un mapeo de códigos para esa regla de negocio.
40
+ - Preferir `ctx.addIssue(...)`; usar `ctx.issues.push(...)` solo si ya es el patrón local.
41
+
42
+ ## Campos y filtros
43
+
44
+ - Todo input que modifique estado de React Hook Form debe ser un componente `Form*`.
45
+ - Usar `My*` o inputs Mantine solo para UI standalone fuera de React Hook Form.
46
+ - Preferir componentes de campo del proyecto, como `NameField` o `StatusField`, cuando ya provean `name`, labels, opciones traducidas o carga de datos.
47
+ - Los filtros siguen el mismo patrón: `useForm` + `Form` + `Form*`.
48
+ - El submit de filtros puede actualizar query params, estado local o estado del padre según el proyecto; no agregar una librería de estado solo por un filtro.
49
+ - Si un campo client lee catálogos o datos cacheados, verificar que la página o el padre carguen esos datos según la convención del proyecto.
50
+
51
+ ## Submit y errores
52
+
53
+ - Usar `FormSubmitButton` para acciones de submit. No usar aliases como `FormButtonSubmit` salvo que el proyecto realmente los exporte.
54
+ - Dejar que `FormSubmitButton` maneje el loading de submit mediante React Hook Form.
55
+ - En submits async, mostrar la notificación de éxito o error esperada por el proyecto.
56
+ - En `catch`, mostrar la notificación de error y luego hacer `throw error` para que el wrapper del formulario pueda reaccionar visualmente.
57
+ - Recortar o normalizar valores en el límite donde se arma el payload de API, no en handlers sueltos de campos.
58
+
59
+ ## Antipatrones
60
+
61
+ - No usar `register` directamente para campos ya cubiertos por `Form*`.
62
+ - No duplicar wrappers tipo `FormTextInput` o `FormSelect`.
63
+ - No usar `any`; tipar valores del formulario desde el schema.
64
+ - No agregar helpers custom de validación cuando Zod ya cubre la regla.
65
+ - No mezclar campos Mantine no controlados dentro de un formulario de React Hook Form.
66
+ - No agregar dependencias nuevas para estado de formulario, validación de campos o filtros comunes.
67
+
68
+ ## Ejemplos mínimos
69
+
70
+ Formulario de edición:
71
+
72
+ ```tsx
73
+ "use client";
74
+
75
+ import { zodResolver } from "@hookform/resolvers/zod";
76
+ import {
77
+ FormSelect,
78
+ FormSubmitButton,
79
+ FormTextInput,
80
+ } from "lkd-web-kit";
81
+ import { useForm } from "react-hook-form";
82
+ import z from "zod";
83
+ import Form from "src/components/form/Form";
84
+
85
+ const editSchema = z.object({
86
+ name: z.string().min(1),
87
+ status: z.string().nullable(),
88
+ });
89
+
90
+ type EditValues = z.infer<typeof editSchema>;
91
+
92
+ const createDefaultValues = (item: { name: string; status: string | null }): EditValues => ({
93
+ name: item.name,
94
+ status: item.status,
95
+ });
96
+
97
+ const createPayload = (data: EditValues) => ({
98
+ name: data.name.trim(),
99
+ status: data.status || undefined,
100
+ });
101
+
102
+ export function EditItemForm({ item }: { item: { name: string; status: string | null } }) {
103
+ const methods = useForm<EditValues>({
104
+ defaultValues: createDefaultValues(item),
105
+ resolver: zodResolver(
106
+ editSchema.superRefine((data, ctx) => {
107
+ if (data.status === "published" && data.name.trim().length < 3) {
108
+ ctx.addIssue({
109
+ code: "custom",
110
+ message: "El nombre es demasiado corto para publicar",
111
+ path: ["name"],
112
+ });
113
+ }
114
+ }),
115
+ ),
116
+ });
117
+
118
+ return (
119
+ <Form
120
+ methods={methods}
121
+ onSubmit={async (data) => {
122
+ try {
123
+ await updateItem(createPayload(data));
124
+ } catch (error) {
125
+ showErrorNotification();
126
+ throw error;
127
+ }
128
+ }}
129
+ >
130
+ <FormTextInput name="name" label="Nombre" />
131
+ <FormSelect
132
+ name="status"
133
+ label="Estado"
134
+ data={[
135
+ { value: "draft", label: "Borrador" },
136
+ { value: "published", label: "Publicado" },
137
+ ]}
138
+ />
139
+ <FormSubmitButton>Guardar</FormSubmitButton>
140
+ </Form>
141
+ );
142
+ }
143
+ ```
144
+
145
+ Filtro:
146
+
147
+ ```tsx
148
+ "use client";
149
+
150
+ import { FormSelect, FormSubmitButton, FormTextInput } from "lkd-web-kit";
151
+ import { useForm } from "react-hook-form";
152
+ import Form from "src/components/form/Form";
153
+
154
+ type FilterValues = {
155
+ search: string;
156
+ status: string | null;
157
+ };
158
+
159
+ export function ItemFilters({
160
+ onApply,
161
+ }: {
162
+ onApply: (values: FilterValues) => void;
163
+ }) {
164
+ const methods = useForm<FilterValues>({
165
+ defaultValues: {
166
+ search: "",
167
+ status: null,
168
+ },
169
+ });
170
+
171
+ return (
172
+ <Form methods={methods} onSubmit={onApply}>
173
+ <FormTextInput name="search" label="Buscar" />
174
+ <FormSelect
175
+ name="status"
176
+ label="Estado"
177
+ data={[
178
+ { value: "draft", label: "Borrador" },
179
+ { value: "published", label: "Publicado" },
180
+ ]}
181
+ />
182
+ <FormSubmitButton>Aplicar</FormSubmitButton>
183
+ </Form>
184
+ );
185
+ }
186
+ ```
@@ -1,104 +0,0 @@
1
- ---
2
- name: create-nextjs-page
3
- description: Crear o refactorizar paginas de Next.js App Router manteniendo app limpio y delegando la UI a componentes de pagina en src/components/pages. Usar cuando Codex deba crear page.tsx, mover UI fuera de app, organizar subcomponentes privados de una pagina, envolver paginas con PageProviders o normalizar nombres/rutas de componentes Page en proyectos que consumen lkd-web-kit.
4
- ---
5
-
6
- # Create Next.js Page
7
-
8
- Usar este skill para crear o refactorizar paginas de Next.js App Router en proyectos que usan `lkd-web-kit`.
9
-
10
- ## Lectura obligatoria
11
-
12
- 1. Leer la documentacion relevante de Next.js antes de tocar rutas. Si existe `node_modules/next/dist/docs/`, usarla como fuente local.
13
- 2. Leer la documentacion local del proyecto sobre `lkd-web-kit`, componentes compartidos y patrones de UI si existe.
14
- 3. Revisar una pagina cercana antes de editar para respetar imports, providers, carga de datos, traducciones y convenciones del proyecto.
15
-
16
- ## Regla principal
17
-
18
- - Mantener `app` como capa de routing de Next.js.
19
- - En `app`, dejar solo `layout.tsx`, `page.tsx` y archivos especiales de Next.js cuando correspondan: `not-found.tsx`, `loading.tsx`, `error.tsx`, `route.ts`, `template.tsx`, `default.tsx` o metadata files.
20
- - No colocar vistas, subcomponentes, hooks privados, helpers de UI, schemas, columnas de tabla ni componentes de pagina dentro de `app`.
21
- - Colocar la UI real de cada ruta en `src/components/pages`.
22
-
23
- ## Estructura de pagina
24
-
25
- Para una pagina simple:
26
-
27
- ```txt
28
- src/app/[locale]/(app-layout)/development/page.tsx
29
- src/components/pages/app/DevelopmentPage.tsx
30
- ```
31
-
32
- Para una pagina con subcomponentes privados:
33
-
34
- ```txt
35
- src/app/[locale]/(app-layout)/development/page.tsx
36
- src/components/pages/app/DevelopmentPage/index.tsx
37
- src/components/pages/app/DevelopmentPage/Header.tsx
38
- src/components/pages/app/DevelopmentPage/helpers.ts
39
- ```
40
-
41
- - Usar archivo plano `{PageName}Page.tsx` si el componente es de una pieza.
42
- - Usar carpeta `{PageName}Page/index.tsx` si hay subcomponentes, helpers, schemas o piezas privadas.
43
- - Mantener dentro de esa carpeta solo lo privado de esa pagina.
44
- - Mover a componentes compartidos solo cuando exista reutilizacion real.
45
-
46
- ## PageProviders
47
-
48
- Cada `page.tsx` debe retornar el componente Page envuelto con `PageProviders`.
49
-
50
- ```tsx
51
- import PageProviders from "src/app/PageProviders";
52
- import DevelopmentPage from "src/components/pages/app/DevelopmentPage";
53
-
54
- const Page = async () => {
55
- return (
56
- <PageProviders>
57
- <DevelopmentPage />
58
- </PageProviders>
59
- );
60
- };
61
-
62
- export default Page;
63
- ```
64
-
65
- - Usar el import real de `PageProviders` del proyecto si difiere del ejemplo.
66
- - Pasar a `PageProviders` solo las props que existan y sean necesarias en ese proyecto.
67
- - Mantener en `page.tsx` solo responsabilidades de entrypoint: params, metadata, fetch server-side, redirects/notFound y providers.
68
- - No duplicar providers dentro del componente de pagina salvo que el proyecto tenga una razon documentada.
69
-
70
- ## Mapeo de area
71
-
72
- Derivar `{area}` desde el route group principal cuando exista:
73
-
74
- - `(app-layout)` -> `app`
75
- - `(admin-layout)` -> `admin`
76
- - `(home-layout)` -> `home`
77
- - `(developer-layout)` -> `developer`
78
- - `(agency-layout)` -> `agency`
79
-
80
- Regla general:
81
-
82
- - Si el route group termina en `-layout`, quitar ese sufijo.
83
- - Si no termina en `-layout`, usar el nombre limpio del group sin parentesis.
84
- - Si no hay route group claro, usar el primer segmento estable de la ruta.
85
- - Ignorar `[locale]`, route groups y segmentos dinamicos para elegir el area.
86
-
87
- ## Nombres
88
-
89
- - Usar PascalCase y sufijo `Page`.
90
- - Para rutas estaticas, usar el ultimo segmento estable: `(app-layout)/development/page.tsx` -> `DevelopmentPage`.
91
- - Para rutas dinamicas, usar el ultimo segmento estatico util y agregar `DetailPage`: `development/[development_slug]/page.tsx` -> `DevelopmentDetailPage`.
92
- - Para rutas dinamicas anidadas, preferir el ultimo segmento estatico util: `development/[development_slug]/property/[property_slug]` -> `PropertyDetailPage`.
93
- - Si el nombre colisiona o pierde contexto, anteponer el segmento padre: `DevelopmentPropertyDetailPage`.
94
- - No incluir nombres de route groups, `[locale]` ni nombres de parametros como `Slug` salvo que haga falta para evitar ambiguedad real.
95
-
96
- ## Checklist
97
-
98
- - `app` queda limpio y sin UI privada.
99
- - `page.tsx` importa un componente desde `src/components/pages/{area}`.
100
- - `page.tsx` envuelve siempre con `PageProviders`.
101
- - Las props de `PageProviders` corresponden al proyecto actual, no a otro consumidor.
102
- - El componente de pagina no usa `any`.
103
- - Los subcomponentes privados viven junto a la pagina, no en `app`.
104
- - Se ejecuta una verificacion focalizada cuando el cambio toca codigo de aplicacion.
@@ -1,3 +0,0 @@
1
- display_name: Create Next.js Page
2
- short_description: Create clean Next.js App Router pages.
3
- default_prompt: Create or refactor a Next.js App Router page using the clean PageProviders pattern.
@@ -1,73 +0,0 @@
1
- ---
2
- name: mantine-combobox
3
- description: >
4
- Build custom dropdown/select/autocomplete/multiselect components using Mantine's Combobox
5
- primitives. Use this skill when: (1) creating a new custom select-like component with
6
- Combobox primitives, (2) building a searchable dropdown, (3) implementing a multi-select
7
- or tags input variant, (4) customizing option rendering, (5) adding custom filtering logic,
8
- or (6) any task involving useCombobox, Combobox.Target, Combobox.Option, or Combobox.Dropdown.
9
- ---
10
-
11
- # Mantine Combobox Skill
12
-
13
- ## Overview
14
-
15
- `Combobox` provides low-level primitives for building any select-like UI. The built-in
16
- `Select`, `Autocomplete`, and `TagsInput` components are all built on top of it.
17
-
18
- ## Core Workflow
19
-
20
- ### 1. Create the store
21
-
22
- ```tsx
23
- const combobox = useCombobox({
24
- onDropdownClose: () => combobox.resetSelectedOption(),
25
- onDropdownOpen: () => combobox.selectFirstOption(),
26
- });
27
- ```
28
-
29
- ### 2. Render structure
30
-
31
- ```tsx
32
- <Combobox store={combobox} onOptionSubmit={handleSubmit}>
33
- <Combobox.Target>
34
- <InputBase
35
- component="button"
36
- pointer
37
- rightSection={<Combobox.Chevron />}
38
- onClick={() => combobox.toggleDropdown()}
39
- >
40
- {value || <Input.Placeholder>Pick value</Input.Placeholder>}
41
- </InputBase>
42
- </Combobox.Target>
43
- <Combobox.Dropdown>
44
- <Combobox.Options>
45
- {options.map((item) => (
46
- <Combobox.Option value={item} key={item}>{item}</Combobox.Option>
47
- ))}
48
- </Combobox.Options>
49
- </Combobox.Dropdown>
50
- </Combobox>
51
- ```
52
-
53
- ### 3. Handle submit
54
-
55
- ```tsx
56
- const handleSubmit = (val: string) => {
57
- setValue(val);
58
- combobox.closeDropdown();
59
- };
60
- ```
61
-
62
- ## Target Types
63
-
64
- | Scenario | Use |
65
- |---|---|
66
- | Button trigger (no text input) | `<Combobox.Target targetType="button">` |
67
- | Input trigger | `<Combobox.Target>` (default) |
68
- | Pills + separate input (multi-select) | `<Combobox.DropdownTarget>` + `<Combobox.EventsTarget>` |
69
-
70
- ## References
71
-
72
- - **[`references/api.md`](references/api.md)** — Full API: `useCombobox` options and store, all sub-component props, CSS variables, Styles API selectors
73
- - **[`references/patterns.md`](references/patterns.md)** — Code examples: searchable select, multi-select with pills, groups, custom rendering, clear button, form integration
@@ -1,199 +0,0 @@
1
- # Combobox API Reference
2
-
3
- ## Table of Contents
4
- - [useCombobox hook](#usecombobox-hook)
5
- - [Combobox (root)](#combobox-root)
6
- - [Sub-components](#sub-components)
7
- - [CSS variables & Styles API](#css-variables--styles-api)
8
-
9
- ---
10
-
11
- ## useCombobox hook
12
-
13
- ```tsx
14
- const combobox = useCombobox(options?: UseComboboxOptions);
15
- ```
16
-
17
- **Options:**
18
- ```ts
19
- interface UseComboboxOptions {
20
- defaultOpened?: boolean;
21
- opened?: boolean;
22
- onOpenedChange?: (opened: boolean) => void;
23
- onDropdownClose?: (eventSource: 'keyboard' | 'mouse' | 'unknown') => void;
24
- onDropdownOpen?: (eventSource: 'keyboard' | 'mouse' | 'unknown') => void;
25
- loop?: boolean; // Default: true — keyboard nav wraps at boundaries
26
- scrollBehavior?: ScrollBehavior; // Default: 'instant'
27
- }
28
- ```
29
-
30
- **Returned store:**
31
- ```ts
32
- interface ComboboxStore {
33
- // Dropdown state
34
- dropdownOpened: boolean;
35
- openDropdown(eventSource?: 'keyboard' | 'mouse' | 'unknown'): void;
36
- closeDropdown(eventSource?: 'keyboard' | 'mouse' | 'unknown'): void;
37
- toggleDropdown(eventSource?: 'keyboard' | 'mouse' | 'unknown'): void;
38
-
39
- // Option keyboard navigation
40
- selectActiveOption(): string | null;
41
- selectFirstOption(): string | null;
42
- selectNextOption(): string | null;
43
- selectPreviousOption(): string | null;
44
- resetSelectedOption(): void;
45
- clickSelectedOption(): void;
46
- updateSelectedOptionIndex(
47
- target?: 'active' | 'selected' | number,
48
- options?: { scrollIntoView?: boolean }
49
- ): void;
50
-
51
- // Programmatic focus
52
- focusSearchInput(): void;
53
- focusTarget(): void;
54
- }
55
- ```
56
-
57
- ---
58
-
59
- ## Combobox (root)
60
-
61
- ```tsx
62
- <Combobox
63
- store={combobox} // required — ComboboxStore from useCombobox()
64
- onOptionSubmit={fn} // (value: string, optionProps) => void
65
- size="sm" // MantineSize | string, default: 'sm'
66
- dropdownPadding={4} // number, default: 4
67
- resetSelectionOnOptionHover // boolean
68
- readOnly // boolean — disables all interactions
69
- // + all Popover props (position, offset, width, withinPortal, etc.)
70
- />
71
- ```
72
-
73
- ---
74
-
75
- ## Sub-components
76
-
77
- ### Combobox.Target
78
- ```tsx
79
- <Combobox.Target
80
- targetType="input" // 'button' | 'input', default: 'input'
81
- withKeyboardNavigation // boolean, default: true
82
- withAriaAttributes // boolean, default: true
83
- withExpandedAttribute // boolean, default: false
84
- autoComplete="off" // string
85
- >
86
- {/* single child — the trigger element */}
87
- </Combobox.Target>
88
- ```
89
-
90
- Use `targetType="button"` when the trigger is a button (Space key toggles dropdown).
91
-
92
- ### Combobox.DropdownTarget
93
- Marks the element used for dropdown positioning when separate from the keyboard events target. Used together with `Combobox.EventsTarget` in multi-select/pills patterns.
94
-
95
- ### Combobox.EventsTarget
96
- Receives keyboard events for dropdown navigation. Used alongside `Combobox.DropdownTarget` when the typing input is nested inside the trigger (e.g. inside `PillsInput`).
97
-
98
- ### Combobox.Dropdown
99
- ```tsx
100
- <Combobox.Dropdown hidden={false}>
101
- {/* dropdown content */}
102
- </Combobox.Dropdown>
103
- ```
104
-
105
- Use `hidden` to hide without unmounting (preserves scroll position).
106
-
107
- ### Combobox.Options
108
- ```tsx
109
- <Combobox.Options labelledBy="some-label-id">
110
- {/* Combobox.Option or Combobox.Group elements */}
111
- </Combobox.Options>
112
- ```
113
-
114
- ### Combobox.Option
115
- ```tsx
116
- <Combobox.Option
117
- value="react" // string | number, required
118
- active={false} // visually marks as selected; used by selectActiveOption()
119
- disabled={false}
120
- >
121
- React
122
- </Combobox.Option>
123
- ```
124
-
125
- ### Combobox.Search
126
- Built-in search input, wired to keyboard navigation. Renders sticky at top of dropdown.
127
-
128
- ```tsx
129
- <Combobox.Search
130
- value={search}
131
- onChange={(e) => setSearch(e.currentTarget.value)}
132
- placeholder="Search..."
133
- withAriaAttributes // boolean, default: true
134
- withKeyboardNavigation // boolean, default: true
135
- // + all Input props
136
- />
137
- ```
138
-
139
- ### Combobox.Empty
140
- ```tsx
141
- <Combobox.Empty>Nothing found</Combobox.Empty>
142
- ```
143
-
144
- ### Combobox.Group
145
- ```tsx
146
- <Combobox.Group label="Frontend">
147
- <Combobox.Option value="react">React</Combobox.Option>
148
- </Combobox.Group>
149
- ```
150
-
151
- ### Combobox.Header / Combobox.Footer
152
- ```tsx
153
- <Combobox.Header>Custom header</Combobox.Header>
154
- <Combobox.Footer>Custom footer</Combobox.Footer>
155
- ```
156
-
157
- ### Combobox.Chevron
158
- ```tsx
159
- <Combobox.Chevron size="sm" error={error} color="blue" />
160
- ```
161
-
162
- ### Combobox.ClearButton
163
- ```tsx
164
- <Combobox.ClearButton onClear={() => setValue(null)} />
165
- ```
166
-
167
- ### Combobox.HiddenInput
168
- ```tsx
169
- <Combobox.HiddenInput
170
- value={value} // string | number | (string | number)[] | null
171
- valuesDivider="," // string, default: ','
172
- name="myField"
173
- form="myForm"
174
- />
175
- ```
176
-
177
- ---
178
-
179
- ## CSS variables & Styles API
180
-
181
- ### CSS variables (set on root element)
182
- | Variable | Description |
183
- |---|---|
184
- | `--combobox-option-fz` | Option font size (driven by `size` prop) |
185
- | `--combobox-option-padding` | Option padding (driven by `size` prop) |
186
- | `--combobox-padding` | Dropdown padding (driven by `dropdownPadding`, default 4px) |
187
-
188
- ### Styles API selectors
189
- | Selector | Element |
190
- |---|---|
191
- | `dropdown` | Dropdown container |
192
- | `options` | Options listbox |
193
- | `option` | Individual option |
194
- | `search` | Search input |
195
- | `empty` | Nothing found message |
196
- | `header` | Dropdown header |
197
- | `footer` | Dropdown footer |
198
- | `group` | Group container |
199
- | `groupLabel` | Group label text |