@veracity/vui 2.18.3 → 2.19.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.
Files changed (138) hide show
  1. package/dist/cjs/button/button.d.ts.map +1 -1
  2. package/dist/cjs/button/button.js +3 -2
  3. package/dist/cjs/button/button.js.map +1 -1
  4. package/dist/cjs/checkbox/checkbox.js +3 -3
  5. package/dist/cjs/checkbox/checkbox.js.map +1 -1
  6. package/dist/cjs/checkbox/consts.d.ts +4 -3
  7. package/dist/cjs/checkbox/consts.d.ts.map +1 -1
  8. package/dist/cjs/checkbox/consts.js +4 -3
  9. package/dist/cjs/checkbox/consts.js.map +1 -1
  10. package/dist/cjs/checkbox/theme.d.ts +2 -2
  11. package/dist/cjs/input/consts.d.ts +27 -21
  12. package/dist/cjs/input/consts.d.ts.map +1 -1
  13. package/dist/cjs/input/consts.js +8 -2
  14. package/dist/cjs/input/consts.js.map +1 -1
  15. package/dist/cjs/input/helpText.d.ts +1 -1
  16. package/dist/cjs/input/helpText.d.ts.map +1 -1
  17. package/dist/cjs/input/helpText.js +2 -2
  18. package/dist/cjs/input/helpText.js.map +1 -1
  19. package/dist/cjs/input/input.d.ts.map +1 -1
  20. package/dist/cjs/input/input.js +3 -2
  21. package/dist/cjs/input/input.js.map +1 -1
  22. package/dist/cjs/input/input.types.d.ts +5 -3
  23. package/dist/cjs/input/input.types.d.ts.map +1 -1
  24. package/dist/cjs/input/inputInput.js +3 -2
  25. package/dist/cjs/input/inputInput.js.map +1 -1
  26. package/dist/cjs/input/theme.d.ts +8 -8
  27. package/dist/cjs/input/theme.js +1 -1
  28. package/dist/cjs/list/list.d.ts.map +1 -1
  29. package/dist/cjs/list/list.js +63 -2
  30. package/dist/cjs/list/list.js.map +1 -1
  31. package/dist/cjs/menu/menuItem.d.ts.map +1 -1
  32. package/dist/cjs/menu/menuItem.js +1 -1
  33. package/dist/cjs/menu/menuItem.js.map +1 -1
  34. package/dist/cjs/menu/menuList.d.ts.map +1 -1
  35. package/dist/cjs/menu/menuList.js +1 -1
  36. package/dist/cjs/menu/menuList.js.map +1 -1
  37. package/dist/cjs/radio/consts.d.ts +4 -3
  38. package/dist/cjs/radio/consts.d.ts.map +1 -1
  39. package/dist/cjs/radio/consts.js +4 -3
  40. package/dist/cjs/radio/consts.js.map +1 -1
  41. package/dist/cjs/radio/radio.js +1 -1
  42. package/dist/cjs/radio/radio.js.map +1 -1
  43. package/dist/cjs/radio/theme.d.ts +2 -2
  44. package/dist/cjs/select/selectButton.d.ts.map +1 -1
  45. package/dist/cjs/select/selectButton.js +14 -5
  46. package/dist/cjs/select/selectButton.js.map +1 -1
  47. package/dist/cjs/tabs/tabsNavBar.d.ts.map +1 -1
  48. package/dist/cjs/tabs/tabsNavBar.js +5 -1
  49. package/dist/cjs/tabs/tabsNavBar.js.map +1 -1
  50. package/dist/cjs/textarea/textarea.d.ts.map +1 -1
  51. package/dist/cjs/textarea/textarea.js +7 -4
  52. package/dist/cjs/textarea/textarea.js.map +1 -1
  53. package/dist/cjs/textarea/textarea.types.d.ts +6 -0
  54. package/dist/cjs/textarea/textarea.types.d.ts.map +1 -1
  55. package/dist/cjs/textarea/theme.d.ts +8 -8
  56. package/dist/cjs/textarea/theme.js +1 -1
  57. package/dist/cjs/theme/components.d.ts +20 -20
  58. package/dist/cjs/theme/defaultTheme.d.ts +20 -20
  59. package/dist/esm/button/button.d.ts.map +1 -1
  60. package/dist/esm/button/button.js +3 -2
  61. package/dist/esm/button/button.js.map +1 -1
  62. package/dist/esm/checkbox/checkbox.js +3 -3
  63. package/dist/esm/checkbox/checkbox.js.map +1 -1
  64. package/dist/esm/checkbox/consts.d.ts +4 -3
  65. package/dist/esm/checkbox/consts.d.ts.map +1 -1
  66. package/dist/esm/checkbox/consts.js +4 -3
  67. package/dist/esm/checkbox/consts.js.map +1 -1
  68. package/dist/esm/checkbox/theme.d.ts +2 -2
  69. package/dist/esm/input/consts.d.ts +27 -21
  70. package/dist/esm/input/consts.d.ts.map +1 -1
  71. package/dist/esm/input/consts.js +7 -1
  72. package/dist/esm/input/consts.js.map +1 -1
  73. package/dist/esm/input/helpText.d.ts +1 -1
  74. package/dist/esm/input/helpText.d.ts.map +1 -1
  75. package/dist/esm/input/helpText.js +2 -2
  76. package/dist/esm/input/helpText.js.map +1 -1
  77. package/dist/esm/input/input.d.ts.map +1 -1
  78. package/dist/esm/input/input.js +4 -3
  79. package/dist/esm/input/input.js.map +1 -1
  80. package/dist/esm/input/input.types.d.ts +5 -3
  81. package/dist/esm/input/input.types.d.ts.map +1 -1
  82. package/dist/esm/input/inputInput.js +3 -2
  83. package/dist/esm/input/inputInput.js.map +1 -1
  84. package/dist/esm/input/theme.d.ts +8 -8
  85. package/dist/esm/input/theme.js +1 -1
  86. package/dist/esm/list/list.d.ts.map +1 -1
  87. package/dist/esm/list/list.js +40 -2
  88. package/dist/esm/list/list.js.map +1 -1
  89. package/dist/esm/menu/menuItem.d.ts.map +1 -1
  90. package/dist/esm/menu/menuItem.js +1 -1
  91. package/dist/esm/menu/menuItem.js.map +1 -1
  92. package/dist/esm/menu/menuList.d.ts.map +1 -1
  93. package/dist/esm/menu/menuList.js +1 -1
  94. package/dist/esm/menu/menuList.js.map +1 -1
  95. package/dist/esm/radio/consts.d.ts +4 -3
  96. package/dist/esm/radio/consts.d.ts.map +1 -1
  97. package/dist/esm/radio/consts.js +4 -3
  98. package/dist/esm/radio/consts.js.map +1 -1
  99. package/dist/esm/radio/radio.js +1 -1
  100. package/dist/esm/radio/radio.js.map +1 -1
  101. package/dist/esm/radio/theme.d.ts +2 -2
  102. package/dist/esm/select/selectButton.d.ts.map +1 -1
  103. package/dist/esm/select/selectButton.js +14 -5
  104. package/dist/esm/select/selectButton.js.map +1 -1
  105. package/dist/esm/tabs/tabsNavBar.d.ts.map +1 -1
  106. package/dist/esm/tabs/tabsNavBar.js +4 -1
  107. package/dist/esm/tabs/tabsNavBar.js.map +1 -1
  108. package/dist/esm/textarea/textarea.d.ts.map +1 -1
  109. package/dist/esm/textarea/textarea.js +8 -5
  110. package/dist/esm/textarea/textarea.js.map +1 -1
  111. package/dist/esm/textarea/textarea.types.d.ts +6 -0
  112. package/dist/esm/textarea/textarea.types.d.ts.map +1 -1
  113. package/dist/esm/textarea/theme.d.ts +8 -8
  114. package/dist/esm/textarea/theme.js +1 -1
  115. package/dist/esm/theme/components.d.ts +20 -20
  116. package/dist/esm/theme/defaultTheme.d.ts +20 -20
  117. package/dist/tsconfig.legacy.tsbuildinfo +1 -1
  118. package/dist/tsconfig.tsbuildinfo +1 -1
  119. package/package.json +1 -1
  120. package/src/button/button.tsx +11 -6
  121. package/src/checkbox/checkbox.tsx +3 -3
  122. package/src/checkbox/consts.ts +5 -4
  123. package/src/input/consts.ts +12 -5
  124. package/src/input/helpText.tsx +2 -2
  125. package/src/input/input.tsx +10 -4
  126. package/src/input/input.types.ts +5 -4
  127. package/src/input/inputInput.tsx +2 -2
  128. package/src/input/theme.ts +1 -1
  129. package/src/list/list.tsx +43 -3
  130. package/src/menu/menuItem.tsx +1 -10
  131. package/src/menu/menuList.tsx +1 -0
  132. package/src/radio/consts.ts +5 -4
  133. package/src/radio/radio.tsx +1 -1
  134. package/src/select/selectButton.tsx +16 -5
  135. package/src/tabs/tabsNavBar.tsx +4 -1
  136. package/src/textarea/textarea.tsx +16 -4
  137. package/src/textarea/textarea.types.ts +6 -0
  138. package/src/textarea/theme.ts +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veracity/vui",
3
- "version": "2.18.3",
3
+ "version": "2.19.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",
@@ -55,7 +55,7 @@ export const Button = vui<'button', ButtonProps>((props, ref) => {
55
55
  dropDownIcon = 'falAngleDown',
56
56
  icon,
57
57
  iconLeft,
58
- iconRight,
58
+ iconRight: iconRightProp,
59
59
  isActive,
60
60
  isDropDown,
61
61
  isElevated,
@@ -77,6 +77,8 @@ export const Button = vui<'button', ButtonProps>((props, ref) => {
77
77
 
78
78
  const { iconProps: stateIconProps, ...stateProps } = states[state] ?? {}
79
79
 
80
+ const iconRight = isDropDown ? 'falAngleDown' : iconRightProp
81
+
80
82
  const variant = filterUndefined({
81
83
  variant: states[state]?.variant ?? variantProp,
82
84
  })
@@ -138,7 +140,7 @@ export const Button = vui<'button', ButtonProps>((props, ref) => {
138
140
  focusRing={3}
139
141
  h={h}
140
142
  pl={pl}
141
- pr={isDropDown ? 0 : pr}
143
+ pr={pr}
142
144
  ref={ref}
143
145
  title={title || ariaLabel}
144
146
  type="button"
@@ -159,19 +161,22 @@ export const Button = vui<'button', ButtonProps>((props, ref) => {
159
161
  {!icon && (
160
162
  <>
161
163
  {isLoading ? (
162
- <ButtonIcon mr={isDropDown ? 0 : iconLeftMr} {...loadingIconProps} />
164
+ <ButtonIcon mr={iconLeftMr} {...loadingIconProps} />
163
165
  ) : isString(iconLeft) ? (
164
- <ButtonIcon mr={isDropDown ? 0 : iconLeftMr} name={iconLeft} />
166
+ <ButtonIcon mr={iconLeftMr} name={iconLeft} />
165
167
  ) : (
166
168
  iconLeft
167
169
  )}
168
170
 
169
171
  {children ?? (isReactText(text) ? <ButtonText {...{ isTruncated, text }} /> : text)}
170
172
 
171
- {isString(iconRight) ? <ButtonIcon ml={iconRightMl} name={iconRight} /> : iconRight}
173
+ {isString(iconRight) ? (
174
+ <ButtonIcon ml={!children && !text ? 0 : iconRightMl} name={iconRight} />
175
+ ) : (
176
+ iconRight
177
+ )}
172
178
  </>
173
179
  )}
174
- {isDropDown && <ButtonIcon name={dropDownIcon} />}
175
180
  </Content>
176
181
  </ButtonBase>
177
182
  </ButtonProvider>
@@ -39,11 +39,11 @@ export const CheckboxBase = styled.labelBox<CheckboxStyleProps>`
39
39
  }
40
40
 
41
41
  &[aria-disabled='true'] {
42
- color: ${checkboxColors.disabled};
42
+ color: ${checkboxColors.disabledText};
43
43
  cursor: not-allowed;
44
44
 
45
45
  .vui-checkboxControl {
46
- color: ${checkboxColors.disabled};
46
+ color: ${checkboxColors.disabledText};
47
47
  }
48
48
  }
49
49
  `
@@ -81,7 +81,7 @@ export const Checkbox = vui<'span', CheckboxProps>((props, ref) => {
81
81
  const { color: controlColor, hoverColor, ...controlStyles } = styles.control
82
82
 
83
83
  const icon = isIndeterminate ? iconIndeterminate : isChecked ? iconChecked : iconProp
84
- const controlMr = children || label ? '12px' : 0
84
+ const controlMr = children || label ? 1 : 0
85
85
  const color = controlColor ? controlColor : checkboxColors.main
86
86
  const controlHoverColor = hoverColor ? hoverColor : checkboxColors.hover
87
87
  const isLongLabel = label && label?.length >= 60
@@ -1,5 +1,6 @@
1
1
  export const checkboxColors = {
2
- main: 'seaBlue.main',
3
- hover: 'seaBlue.40',
4
- disabled: 'sandstone.main',
5
- }
2
+ main: 'sandstone.60',
3
+ hover: 'sandstone.60',
4
+ disabled: 'sandstone.60',
5
+ disabledText: 'sandstone.60',
6
+ } as const
@@ -7,17 +7,17 @@ export const inputColors = {
7
7
  helpText: 'sandstone.30',
8
8
  icons: 'seaBlue.main',
9
9
  disabled: 'sandstone.95',
10
- focus: 'seaBlue.main',
10
+ focus: 'focusColor',
11
11
  error: 'energyRed.45',
12
12
  loading: 'seaBlue.80',
13
13
  success: 'landGreen.35',
14
- }
14
+ } as const
15
15
 
16
16
  export const stateIcons = {
17
17
  error: 'falExclamationTriangle',
18
18
  loading: 'fadSpinnerThird',
19
19
  success: 'falCheck',
20
- }
20
+ } as const
21
21
 
22
22
  export const inputStateMapping: InputStateMapping = {
23
23
  error: {
@@ -49,11 +49,18 @@ export const displayValueOnlyTextSize = {
49
49
  md: 'sm',
50
50
  lg: 'md',
51
51
  xl: 'lg',
52
- }
52
+ } as const
53
53
 
54
54
  export const clearIconSize = {
55
55
  sm: 'sm',
56
56
  md: 'sm',
57
57
  lg: 'sm',
58
58
  xl: 'md',
59
- }
59
+ } as const
60
+
61
+ export const helpTextSize = {
62
+ sm: 'sm',
63
+ md: 'sm',
64
+ lg: 'md',
65
+ xl: 'md',
66
+ } as const
@@ -8,7 +8,7 @@ import { inputColors } from './consts'
8
8
  import { useInputContext } from './context'
9
9
  import { HelpTextProps } from './input.types'
10
10
 
11
- /** Displaying help text bellow the input. */
11
+ /** Displaying help text below the input. */
12
12
  export const HelpText = vui<'div', HelpTextProps>((props, ref) => {
13
13
  const { className, children, isError, ...rest } = props
14
14
  const inputProps = useInputContext()
@@ -23,7 +23,7 @@ export const HelpText = vui<'div', HelpTextProps>((props, ref) => {
23
23
  className={cs('vui-inputHelpText', className)}
24
24
  color={color}
25
25
  display="flex"
26
- py={1}
26
+ pt={0.5}
27
27
  ref={ref}
28
28
  {...styles.helpText}
29
29
  {...rest}
@@ -5,7 +5,7 @@ import { styled, useStyleConfig, vui, VuiComponent } from '../core'
5
5
  import { T } from '../t'
6
6
  import { ChangeEvent, cs, filterUndefined, isString } from '../utils'
7
7
  import AutoCompletePopover from './autoCompletePopover'
8
- import { clearIconSize, displayValueOnlyTextSize, inputColors, inputStateMapping } from './consts'
8
+ import { clearIconSize, displayValueOnlyTextSize, helpTextSize, inputColors, inputStateMapping } from './consts'
9
9
  import { InputProvider } from './context'
10
10
  import { getInitialCount } from './helpers'
11
11
  import HelpText from './helpText'
@@ -47,6 +47,7 @@ export const Input = vui<'div', InputProps>((props, ref) => {
47
47
  autoCompleteOptions,
48
48
  autoCompleteMaxHeight,
49
49
  autoFocus,
50
+ ariaLabel,
50
51
  children,
51
52
  className,
52
53
  defaultValue,
@@ -151,6 +152,7 @@ export const Input = vui<'div', InputProps>((props, ref) => {
151
152
  ref={inputRef}
152
153
  {...{
153
154
  autoFocus,
155
+ ariaLabel,
154
156
  defaultValue,
155
157
  disabled,
156
158
  id,
@@ -182,7 +184,7 @@ export const Input = vui<'div', InputProps>((props, ref) => {
182
184
  icon="falTimes"
183
185
  mr={0.5}
184
186
  onClick={onClear}
185
- size={clearIconSize[size] as 'md' | 'sm' | 'lg'}
187
+ size={clearIconSize[size]}
186
188
  title="Clear"
187
189
  />
188
190
  )}
@@ -202,8 +204,12 @@ export const Input = vui<'div', InputProps>((props, ref) => {
202
204
  </AutoCompletePopover>
203
205
  )}
204
206
 
205
- {!!helpText && <HelpText>{helpText}</HelpText>}
206
- {!!errorText && <HelpText isError>{errorText}</HelpText>}
207
+ {!!helpText && <HelpText size={helpTextSize[size]}>{helpText}</HelpText>}
208
+ {!!errorText && (
209
+ <HelpText isError size={helpTextSize[size]}>
210
+ {errorText}
211
+ </HelpText>
212
+ )}
207
213
  </InputProvider>
208
214
  )
209
215
  }) as VuiComponent<'div', InputProps> & {
@@ -7,7 +7,6 @@ import { ThemingProps } from '../theme'
7
7
  import { ChangeEventHandler, FocusEventHandler, PropsOf } from '../utils'
8
8
 
9
9
  export type InputInputProps = PropsOf<'input', SystemProps>
10
-
11
10
  export type InputProps = SystemProps &
12
11
  ThemingProps<'Input'> & {
13
12
  /** Allow to remove input content with clear icon. */
@@ -20,14 +19,18 @@ export type InputProps = SystemProps &
20
19
  autoCompleteMaxHeight?: number
21
20
  /** Passed to the inner input. */
22
21
  autoFocus?: boolean
22
+ /** ARIA label for the input element. */
23
+ ariaLabel?: string
23
24
  /** Deprecated. Please use variant instead. @deprecated */
24
25
  colorScheme?: 'green' | 'grey' | 'red'
25
26
  /** Passed to the inner input. */
26
27
  defaultValue?: number | string
27
28
  /** Passed to the inner input. */
28
29
  disabled?: boolean
29
- /** Socket displaying error text bellow an input. */
30
+ /** Socket displaying error text below an input. */
30
31
  errorText?: string | React.ReactNode
32
+ /** Socket displaying help text below an input. */
33
+ helpText?: React.ReactNode | string
31
34
  /** Socket displaying an icon on the left. */
32
35
  iconLeft?: IconProp | JSX.Element
33
36
  /** Socket displaying an icon on the right. */
@@ -44,8 +47,6 @@ export type InputProps = SystemProps &
44
47
  itemLeft?: React.ReactNode
45
48
  /** Socket displaying a custom element on the right. */
46
49
  itemRight?: React.ReactNode
47
- /** Socket displaying help text bellow an input. */
48
- helpText?: React.ReactNode | string
49
50
  /** Passed to the inner input. */
50
51
  max?: number | string
51
52
  /** Passed to the inner input. */
@@ -25,18 +25,18 @@ export const InputInputBase = styled.input`
25
25
 
26
26
  /** Displays an input element within the Input component. */
27
27
  export const InputInput = vui<'input', InputInputProps>((props, ref) => {
28
- const { className, autoComplete, ...rest } = props
28
+ const { type, className, autoComplete, ...rest } = props
29
29
  const inputProps = useInputContext()
30
30
  const mergedProps = { ...inputProps, ...props }
31
31
  const styles = useStyleConfig('Input', mergedProps)
32
32
 
33
33
  const aliasedProps = filterUndefined({
34
34
  'aria-disabled': mergedProps.disabled,
35
+ 'aria-label': mergedProps.ariaLabel,
35
36
  })
36
37
 
37
38
  return (
38
39
  <InputInputBase
39
- aria-label="input-text"
40
40
  autoComplete={autoComplete}
41
41
  className={cs('vui-inputInput', className)}
42
42
  ref={ref}
@@ -2,7 +2,7 @@ import { inputColors } from './consts'
2
2
 
3
3
  const baseStyle = {
4
4
  container: {
5
- focusWithinRing: 2,
5
+ focusWithinRing: 3,
6
6
  color: inputColors.inputText,
7
7
  },
8
8
  input: {
package/src/list/list.tsx CHANGED
@@ -1,4 +1,5 @@
1
- import React, { useMemo } from 'react'
1
+ import { is } from '@xstyled/util'
2
+ import React, { useEffect, useMemo, useRef } from 'react'
2
3
 
3
4
  import { styled, useStyleConfig, vui, VuiComponent } from '../core'
4
5
  import { cs, filterUndefined, isArray, isReactText } from '../utils'
@@ -10,6 +11,10 @@ import ListIcon from './listIcon'
10
11
  import ListItem from './listItem'
11
12
  import ListText from './listText'
12
13
 
14
+ const clickKeys = ['Enter', ' ']
15
+ const nextKeys = ['ArrowDown', 'Tab']
16
+ const prevKeys = ['ArrowUp']
17
+
13
18
  export const ListBase = styled.ulBox``
14
19
 
15
20
  /** Displays a list of list link items and optional heading. Exposes some props to the children via context. */
@@ -19,11 +24,46 @@ export const List = vui<'ul', ListProps>((props, ref) => {
19
24
 
20
25
  const context = useMemo(() => filterUndefined({ isInteractive, size, variant }), [isInteractive, size, variant])
21
26
 
27
+ const listRef = useRef<HTMLUListElement>(null)
28
+
29
+ const [_, setActive] = React.useState(-1)
30
+
31
+ const onKeydown = (event: KeyboardEvent) => {
32
+ if ([...prevKeys, ...nextKeys, ...clickKeys].includes(event.key)) {
33
+ event.preventDefault()
34
+ setActive((a: number) => {
35
+ let active = a
36
+ if (listRef.current) {
37
+ const allChildren = Array.from(listRef.current.childNodes)
38
+ const tabIndexedChildren = allChildren.filter(child => (child as HTMLElement).tabIndex === 0)
39
+
40
+ if (nextKeys.includes(event.key) && active < tabIndexedChildren.length - 1) active++
41
+ if (prevKeys.includes(event.key)) active = active > 0 ? active - 1 : 0
42
+
43
+ tabIndexedChildren.forEach((node, index) => {
44
+ if (index === active) {
45
+ if (clickKeys.includes(event.key)) (node as HTMLElement)?.click()
46
+ else (node as HTMLElement)?.focus()
47
+ }
48
+ })
49
+ }
50
+ return active
51
+ })
52
+ }
53
+ }
54
+
55
+ useEffect(() => {
56
+ if (isInteractive) document.addEventListener('keydown', onKeydown)
57
+
58
+ return () => {
59
+ if (isInteractive) document.removeEventListener('keydown', onKeydown)
60
+ }
61
+ }, [])
62
+
22
63
  return (
23
64
  <ListProvider value={context}>
24
- <ListBase className={cs('vui-list', className)} ref={ref} {...styles.container} {...rest}>
65
+ <ListBase className={cs('vui-list', className)} ref={ref || listRef} {...styles.container} {...rest}>
25
66
  {isReactText(heading) ? <ListHeading text={heading} /> : heading}
26
-
27
67
  {children ??
28
68
  (isArray<ListItemProps>(items)
29
69
  ? items.map(({ key, ...props }, index) => <ListItem key={key ?? index} {...props} />)
@@ -18,16 +18,7 @@ export const MenuItem = vui<'li', ListItemProps>((props, ref) => {
18
18
  closeOnSelect && instance?.hide()
19
19
  })
20
20
 
21
- return (
22
- <ListItem
23
- className={cs('vui-menuItem', className)}
24
- isInteractive
25
- onClick={onClick}
26
- ref={ref}
27
- {...styles.item}
28
- {...rest}
29
- />
30
- )
21
+ return <ListItem className={cs('vui-menuItem', className)} onClick={onClick} ref={ref} {...styles.item} {...rest} />
31
22
  })
32
23
 
33
24
  MenuItem.displayName = 'MenuItem'
@@ -20,6 +20,7 @@ export const MenuList = vui<'ul', MenuListProps>((props, ref) => {
20
20
  {slotTop}
21
21
  <List
22
22
  className={cs('vui-menuList', className)}
23
+ isInteractive
23
24
  py={1}
24
25
  ref={ref}
25
26
  w="100%"
@@ -1,5 +1,6 @@
1
1
  export const radioColors = {
2
- main: 'seaBlue.main',
3
- hover: 'seaBlue.40',
4
- disabled: 'sandstone.main',
5
- }
2
+ main: 'sandstone.60',
3
+ hover: 'sandstone.60',
4
+ disabled: 'sandstone.60',
5
+ disabledText: 'sandstone.60',
6
+ } as const
@@ -40,7 +40,7 @@ export const RadioBase = styled.labelBox<RadioStyleProps>`
40
40
  }
41
41
 
42
42
  &[aria-disabled='true'] {
43
- color: ${radioColors.disabled};
43
+ color: ${radioColors.disabledText};
44
44
  cursor: not-allowed;
45
45
 
46
46
  .vui-radioControl {
@@ -18,8 +18,16 @@ export const SelectButton = vui<'button', SelectButtonProps>((props, ref) => {
18
18
  const styles = useStyleConfig('Select', useSelectContext())
19
19
 
20
20
  const text = valueText || placeholder
21
- const textColor = disabled ? 'sandstone.10' : !valueText ? 'sandstone.10' : undefined
22
- const iconColor = disabled ? 'sandstone.10' : 'seaBlue.main'
21
+
22
+ const disabledProps = disabled
23
+ ? {
24
+ activeBg: 'sandstone.79',
25
+ cursor: 'not-allowed',
26
+ backgroundColor: 'sandstone.79',
27
+ borderColor: 'sandstone.79',
28
+ hoverBg: 'sandstone.79',
29
+ }
30
+ : undefined
23
31
 
24
32
  const readOnlyProps = readOnly
25
33
  ? {
@@ -31,14 +39,17 @@ export const SelectButton = vui<'button', SelectButtonProps>((props, ref) => {
31
39
  hoverBg: 'sandstone.95',
32
40
  opacity: 1,
33
41
  }
34
- : {}
42
+ : undefined
35
43
 
36
44
  const isInvalidProps = isInvalid
37
45
  ? {
38
46
  borderColor: 'energyRed.45',
39
47
  hoverBorderColor: 'energyRed.45',
40
48
  }
41
- : {}
49
+ : undefined
50
+
51
+ const textColor = valueText ? undefined : 'sandstone.10'
52
+ const iconColor = disabled ? 'sandstone.10' : 'seaBlue.main'
42
53
 
43
54
  return (
44
55
  <PopoverTrigger
@@ -59,6 +70,7 @@ export const SelectButton = vui<'button', SelectButtonProps>((props, ref) => {
59
70
  }
60
71
  userSelect="text"
61
72
  {...styles.button}
73
+ {...disabledProps}
62
74
  {...readOnlyProps}
63
75
  {...isInvalidProps}
64
76
  {...rest}
@@ -67,5 +79,4 @@ export const SelectButton = vui<'button', SelectButtonProps>((props, ref) => {
67
79
  })
68
80
 
69
81
  SelectButton.displayName = 'SelectButton'
70
-
71
82
  export default SelectButton
@@ -66,7 +66,10 @@ export const TabsNavBar = vui<'div', TabNavBarProps>((props, ref) => {
66
66
  hoverColor="seaBlue.main"
67
67
  isRound={false}
68
68
  ml={1}
69
- onClick={e => tab?.onDelete?.(e)}
69
+ onClick={e => {
70
+ e.stopPropagation()
71
+ tab?.onDelete?.(e)
72
+ }}
70
73
  title="Delete"
71
74
  />
72
75
  )}
@@ -1,7 +1,8 @@
1
- import React, { useEffect, useState } from 'react'
1
+ import { useEffect, useState } from 'react'
2
2
 
3
3
  import { omitThemingProps, styled, useStyleConfig, vui } from '../core'
4
- import { inputColors } from '../input/consts'
4
+ import { helpTextSize, inputColors } from '../input/consts'
5
+ import HelpText from '../input/helpText'
5
6
  import T from '../t'
6
7
  import { ChangeEvent, cs, filterUndefined } from '../utils'
7
8
  import { getInitialCount } from './helpers'
@@ -13,6 +14,7 @@ const TextareaTextarea = styled.textareaBox`
13
14
  outline: none;
14
15
  padding: 1;
15
16
  resize: none;
17
+ min-height: 80px;
16
18
  transition-duration: fast;
17
19
  width: 100%;
18
20
 
@@ -26,7 +28,7 @@ const TextareaTextarea = styled.textareaBox`
26
28
 
27
29
  export const TextareaBase = styled.divBox`
28
30
  display: flex;
29
- min-height: 80px;
31
+ flex-direction: column;
30
32
  position: relative;
31
33
  width: 100%;
32
34
  `
@@ -38,12 +40,15 @@ export const TextareaBase = styled.divBox`
38
40
  export const Textarea = vui<'div', TextareaProps>((props, ref) => {
39
41
  const {
40
42
  autoFocus,
43
+ ariaLabel,
41
44
  className,
42
45
  colorScheme: colorSchemeProp,
43
46
  cols,
44
47
  defaultValue,
45
48
  disabled,
49
+ errorText,
46
50
  id,
51
+ helpText,
47
52
  maxLength,
48
53
  name,
49
54
  onBlur,
@@ -78,6 +83,7 @@ export const Textarea = vui<'div', TextareaProps>((props, ref) => {
78
83
 
79
84
  const textareaAliasedProps = filterUndefined({
80
85
  'aria-disabled': disabled,
86
+ 'aria-label': ariaLabel,
81
87
  bg: readOnly ? 'sandstone.97' : undefined,
82
88
  borderColor: readOnly ? 'sandstone.55' : undefined,
83
89
  focusWithinBorderColor: !readOnly ? 'transparent' : undefined,
@@ -92,7 +98,6 @@ export const Textarea = vui<'div', TextareaProps>((props, ref) => {
92
98
  return (
93
99
  <TextareaBase className={cs('vui-textarea', className)} ref={ref} {...styles.container} {...aliasedProps} {...rest}>
94
100
  <TextareaTextarea
95
- aria-label="input-textarea"
96
101
  className="vui-textareaTextarea"
97
102
  ref={textareaRef}
98
103
  {...{
@@ -130,6 +135,13 @@ export const Textarea = vui<'div', TextareaProps>((props, ref) => {
130
135
  {count} {maxLength ? `/ ${maxLength}` : null}
131
136
  </T>
132
137
  )}
138
+
139
+ {!!helpText && <HelpText size={helpTextSize['lg']}>{helpText}</HelpText>}
140
+ {!!errorText && (
141
+ <HelpText isError size={helpTextSize['lg']}>
142
+ {errorText}
143
+ </HelpText>
144
+ )}
133
145
  </TextareaBase>
134
146
  )
135
147
  })
@@ -6,6 +6,8 @@ export type TextareaProps = SystemProps &
6
6
  ThemingProps<'Textarea'> & {
7
7
  /** Passed to the inner input. */
8
8
  autoFocus?: boolean
9
+ /** ARIA label for the input element. */
10
+ ariaLabel?: string
9
11
  /** Children are disabled for this component. */
10
12
  children?: never
11
13
  /** Deprecated. Please use variant instead. @deprecated */
@@ -16,6 +18,10 @@ export type TextareaProps = SystemProps &
16
18
  defaultValue?: number | string
17
19
  /** Passed to the inner input. */
18
20
  disabled?: boolean
21
+ /** Socket displaying error text below an input. */
22
+ errorText?: string | React.ReactNode
23
+ /** Socket displaying help text below an input. */
24
+ helpText?: React.ReactNode | string
19
25
  /** Deprecated. Please use variant="red" instead. @deprecated*/
20
26
  isInvalid?: boolean
21
27
  /** Passed to the inner input. */
@@ -2,7 +2,7 @@ import { inputColors } from '../input/consts'
2
2
 
3
3
  const baseStyle = {
4
4
  textarea: {
5
- focusWithinRing: 2,
5
+ focusWithinRing: 3,
6
6
  color: inputColors.inputText,
7
7
  },
8
8
  input: {