@refraction-ui/astro 0.4.5 → 0.4.6

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.
@@ -49,6 +49,12 @@ const api = createSelect({ value, disabled, placeholder })
49
49
  if (content) {
50
50
  content.setAttribute('data-state', isOpen ? 'open' : 'closed')
51
51
  content.hidden = !isOpen
52
+ if (isOpen) {
53
+ setTimeout(() => {
54
+ const firstItem = content.querySelector('[data-rfr-select-item]:not([data-disabled])') as HTMLElement | null
55
+ if (firstItem) firstItem.focus()
56
+ }, 0)
57
+ }
52
58
  }
53
59
  }
54
60
 
@@ -39,7 +39,7 @@ export const selectContentVariants = cva({
39
39
  })
40
40
 
41
41
  export const selectItemVariants = cva({
42
- base: 'relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
42
+ base: 'relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground hover:bg-accent hover:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
43
43
  variants: {
44
44
  selected: {
45
45
  true: 'bg-accent/50',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@refraction-ui/astro",
3
- "version": "0.4.5",
3
+ "version": "0.4.6",
4
4
  "description": "All Refraction UI Astro components in one package",
5
5
  "type": "module",
6
6
  "exports": {