@motor-hero/ui-kit 0.23.0 → 0.23.2
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/dist/components/combobox.d.ts +5 -1
- package/dist/components/combobox.d.ts.map +1 -1
- package/dist/components/multi-combobox.d.ts +4 -1
- package/dist/components/multi-combobox.d.ts.map +1 -1
- package/dist/index.cjs +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/combobox.tsx +7 -3
- package/src/components/multi-combobox.tsx +6 -3
|
@@ -32,7 +32,11 @@ export interface ComboboxProps {
|
|
|
32
32
|
/**
|
|
33
33
|
* Select com busca (combobox) acessível e responsivo.
|
|
34
34
|
*
|
|
35
|
-
* - Desktop: Popover
|
|
35
|
+
* - Desktop: Popover não-modal + cmdk — o dropdown acompanha a largura do
|
|
36
|
+
* gatilho. Não-modal (com `pointer-events-auto` no conteúdo) de propósito:
|
|
37
|
+
* dentro de um Dialog, um Popover modal trava `body { pointer-events: none }`
|
|
38
|
+
* e prende o foco, então a busca não recebe clique/digitação (mesmo motivo do
|
|
39
|
+
* MultiCombobox).
|
|
36
40
|
* - Mobile: Drawer (bottom sheet) + cmdk — evita os problemas de foco/clique de
|
|
37
41
|
* Popover dentro de modal no touch, então a busca funciona no celular.
|
|
38
42
|
*
|
|
@@ -116,13 +120,13 @@ export function Combobox({
|
|
|
116
120
|
|
|
117
121
|
if (isDesktop) {
|
|
118
122
|
return (
|
|
119
|
-
<PopoverPrimitive.Root open={open} onOpenChange={setOpen}
|
|
123
|
+
<PopoverPrimitive.Root open={open} onOpenChange={setOpen}>
|
|
120
124
|
<PopoverPrimitive.Trigger asChild>{trigger}</PopoverPrimitive.Trigger>
|
|
121
125
|
<PopoverPrimitive.Portal>
|
|
122
126
|
<PopoverPrimitive.Content
|
|
123
127
|
align="start"
|
|
124
128
|
sideOffset={4}
|
|
125
|
-
className="z-50 overflow-hidden rounded-md border bg-popover p-0 text-popover-foreground shadow-md"
|
|
129
|
+
className="pointer-events-auto z-50 overflow-hidden rounded-md border bg-popover p-0 text-popover-foreground shadow-md"
|
|
126
130
|
style={{ width: "var(--radix-popover-trigger-width)" }}
|
|
127
131
|
>
|
|
128
132
|
{command}
|
|
@@ -27,7 +27,10 @@ export interface MultiComboboxProps {
|
|
|
27
27
|
/**
|
|
28
28
|
* Combobox de múltipla seleção com chips, acessível e responsivo.
|
|
29
29
|
*
|
|
30
|
-
* - Desktop: Popover
|
|
30
|
+
* - Desktop: Popover não-modal + cmdk — o dropdown acompanha a largura do gatilho.
|
|
31
|
+
* Não-modal de propósito: dentro de um Dialog, um Popover modal trava
|
|
32
|
+
* `body { pointer-events: none }` e marca o resto do Dialog como aria-hidden,
|
|
33
|
+
* o que deixava a página/Dialog presos ao fechar com o picker aberto.
|
|
31
34
|
* - Mobile: Drawer (bottom sheet) + cmdk — evita os problemas de foco/clique de
|
|
32
35
|
* Popover dentro de modal no touch, então a busca funciona no celular.
|
|
33
36
|
*
|
|
@@ -151,7 +154,7 @@ export function MultiCombobox({
|
|
|
151
154
|
|
|
152
155
|
if (isDesktop) {
|
|
153
156
|
return (
|
|
154
|
-
<PopoverPrimitive.Root open={open} onOpenChange={setOpen}
|
|
157
|
+
<PopoverPrimitive.Root open={open} onOpenChange={setOpen}>
|
|
155
158
|
<PopoverPrimitive.Trigger asChild disabled={disabled}>
|
|
156
159
|
{trigger}
|
|
157
160
|
</PopoverPrimitive.Trigger>
|
|
@@ -159,7 +162,7 @@ export function MultiCombobox({
|
|
|
159
162
|
<PopoverPrimitive.Content
|
|
160
163
|
align="start"
|
|
161
164
|
sideOffset={4}
|
|
162
|
-
className="z-50 overflow-hidden rounded-md border bg-popover p-0 text-popover-foreground shadow-md"
|
|
165
|
+
className="pointer-events-auto z-50 overflow-hidden rounded-md border bg-popover p-0 text-popover-foreground shadow-md"
|
|
163
166
|
style={{ width: "var(--radix-popover-trigger-width)" }}
|
|
164
167
|
>
|
|
165
168
|
{command}
|