@veracity/vui 2.20.0-rc.2 → 2.20.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veracity/vui",
3
- "version": "2.20.0-rc.2",
3
+ "version": "2.20.0",
4
4
  "description": "Veracity UI is a React component library crafted for use within Veracity applications and pages. Based on Styled Components and @xstyled.",
5
5
  "module": "./dist/esm/index.js",
6
6
  "main": "./dist/cjs/index.js",
@@ -48,7 +48,6 @@ export const HeaderNotifications = vui<'a', HeaderNotificationsProps>((props, re
48
48
  {children ?? (
49
49
  <>
50
50
  <Button.Icon name="falBell" />
51
-
52
51
  {count > 0 && (
53
52
  <Badge px={count < 9 ? '0' : '4px'} right={count < 9 ? 1 : 0}>
54
53
  {count < 100 ? count : '99+'}
@@ -22,6 +22,7 @@ export const NotificationButton = vui<'button', ButtonProps>((props, ref) => {
22
22
  px="12px"
23
23
  py="6px"
24
24
  ref={ref}
25
+ size="md"
25
26
  {...styles.button}
26
27
  variant={variant}
27
28
  {...rest}
@@ -4,7 +4,7 @@ import { Checkbox } from '../checkbox'
4
4
  import { useStyleConfig, vui } from '../core'
5
5
  import { List, ListItem } from '../list'
6
6
  import { usePopoverContext } from '../popover'
7
- import { cs, ellipsisOverflow, MouseEvent, useCallbackRef } from '../utils'
7
+ import { cs, ellipsisOverflow, KeyboardEvent, MouseEvent, useCallbackRef } from '../utils'
8
8
  import { useSelectContext } from './context'
9
9
  import { SelectOptionProps } from './select.types'
10
10
 
@@ -21,22 +21,22 @@ export const SelectOption = vui<'li', SelectOptionProps>((props, ref) => {
21
21
 
22
22
  const isSelected = Array.isArray(value) && valueProp ? value.includes(valueProp) : value === valueProp
23
23
 
24
- const onClick = useCallbackRef((e: MouseEvent<HTMLLIElement>) => {
25
- // Clone original click event
24
+ const onClick = useCallbackRef((e: MouseEvent<HTMLLIElement> | KeyboardEvent<HTMLLIElement>) => {
26
25
  const nativeEvent = e.nativeEvent || e
27
26
  const clonedEvent = new (nativeEvent.constructor as any)(nativeEvent.type, nativeEvent)
28
27
 
29
- // Extend cloned event with 'value' and 'name'
30
28
  Object.defineProperty(clonedEvent, 'target', {
31
29
  writable: true,
32
30
  value: { value: valueProp, name },
33
31
  })
34
32
 
35
- onClickProp?.(e)
33
+ onClickProp?.(e as MouseEvent<HTMLLIElement>)
36
34
  onChange?.(clonedEvent)
37
35
  !isMultiple && instance?.hide()
38
36
  })
39
37
 
38
+ const onKeyDown = useCallbackRef((e: KeyboardEvent<HTMLLIElement>) => e.key === 'Enter' && onClick(e))
39
+
40
40
  return (
41
41
  <ListItem
42
42
  activeBg="skyBlue.active"
@@ -46,8 +46,10 @@ export const SelectOption = vui<'li', SelectOptionProps>((props, ref) => {
46
46
  isInteractive
47
47
  isSelected={isSelected}
48
48
  onClick={onClick}
49
+ onKeyDown={onKeyDown}
49
50
  ref={ref}
50
51
  selectedBg="skyBlue.selected"
52
+ tabIndex={0}
51
53
  title={title}
52
54
  value={valueProp}
53
55
  {...styles.option}
@@ -126,7 +126,7 @@ export function TutorialCard({
126
126
  </Button>
127
127
  )}
128
128
  {!!onAction && (
129
- <Button mr={6} onClick={onAction} variant="primaryLight">
129
+ <Button mr={9} onClick={onAction} variant="primaryLight">
130
130
  {actionLabel}
131
131
  </Button>
132
132
  )}