@veracity/vui 2.28.7 → 2.28.8-beta.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 (38) hide show
  1. package/dist/cjs/copyToClipboard/copyToClipboard.d.ts.map +1 -1
  2. package/dist/cjs/copyToClipboard/copyToClipboard.js +3 -2
  3. package/dist/cjs/copyToClipboard/copyToClipboard.js.map +1 -1
  4. package/dist/cjs/copyToClipboard/copyToClipboard.types.d.ts +3 -0
  5. package/dist/cjs/copyToClipboard/copyToClipboard.types.d.ts.map +1 -1
  6. package/dist/cjs/input/consts.d.ts +1 -0
  7. package/dist/cjs/input/consts.d.ts.map +1 -1
  8. package/dist/cjs/input/consts.js +2 -1
  9. package/dist/cjs/input/consts.js.map +1 -1
  10. package/dist/cjs/input/input.d.ts.map +1 -1
  11. package/dist/cjs/input/input.js +1 -1
  12. package/dist/cjs/input/input.js.map +1 -1
  13. package/dist/cjs/textarea/textarea.d.ts.map +1 -1
  14. package/dist/cjs/textarea/textarea.js +1 -1
  15. package/dist/cjs/textarea/textarea.js.map +1 -1
  16. package/dist/esm/copyToClipboard/copyToClipboard.d.ts.map +1 -1
  17. package/dist/esm/copyToClipboard/copyToClipboard.js +3 -2
  18. package/dist/esm/copyToClipboard/copyToClipboard.js.map +1 -1
  19. package/dist/esm/copyToClipboard/copyToClipboard.types.d.ts +3 -0
  20. package/dist/esm/copyToClipboard/copyToClipboard.types.d.ts.map +1 -1
  21. package/dist/esm/input/consts.d.ts +1 -0
  22. package/dist/esm/input/consts.d.ts.map +1 -1
  23. package/dist/esm/input/consts.js +1 -0
  24. package/dist/esm/input/consts.js.map +1 -1
  25. package/dist/esm/input/input.d.ts.map +1 -1
  26. package/dist/esm/input/input.js +2 -2
  27. package/dist/esm/input/input.js.map +1 -1
  28. package/dist/esm/textarea/textarea.d.ts.map +1 -1
  29. package/dist/esm/textarea/textarea.js +2 -2
  30. package/dist/esm/textarea/textarea.js.map +1 -1
  31. package/dist/tsconfig.legacy.tsbuildinfo +1 -1
  32. package/dist/tsconfig.tsbuildinfo +1 -1
  33. package/package.json +2 -1
  34. package/src/copyToClipboard/copyToClipboard.tsx +6 -5
  35. package/src/copyToClipboard/copyToClipboard.types.ts +3 -0
  36. package/src/input/consts.ts +2 -0
  37. package/src/input/input.tsx +9 -2
  38. package/src/textarea/textarea.tsx +7 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veracity/vui",
3
- "version": "2.28.7",
3
+ "version": "2.28.8-beta.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",
@@ -9,6 +9,7 @@
9
9
  "license": "SEE LICENSE IN LICENSE.md",
10
10
  "scripts": {
11
11
  "clean": "rimraf .turbo dist node_modules",
12
+ "prebuild": "tsc -p tsconfig.json",
12
13
  "build": "tsc -p tsconfig.json && tsc -p tsconfig.legacy.json",
13
14
  "dev": "tsc --watch -p tsconfig.json",
14
15
  "eslint": "eslint \"src/**/*.{ts,tsx}\"",
@@ -1,11 +1,12 @@
1
- import React from 'react'
2
-
3
1
  import Button from '../button'
4
2
  import { vui } from '../core'
3
+ import { IconProp } from '../icon'
5
4
  import { cs } from '../utils'
6
5
  import { CopyToClipboardProps } from './copyToClipboard.types'
7
6
  import { useCopyToClipboard } from './useCopyToClipboard'
8
7
 
8
+ const defaultIcon: IconProp = 'falCopy'
9
+
9
10
  /**
10
11
  * A helper button component.
11
12
  *
@@ -15,16 +16,16 @@ import { useCopyToClipboard } from './useCopyToClipboard'
15
16
  *
16
17
  */
17
18
  export const CopyToClipboard = vui<'button', CopyToClipboardProps>((props, ref) => {
18
- const { disabled, copyText, className, size = 'sm', variant = 'tertiaryDark', ...rest } = props
19
+ const { disabled, copyText, className, icon = defaultIcon, size = 'sm', variant = 'tertiaryDark', ...rest } = props
19
20
 
20
21
  const { copy, isCopyDisabled } = useCopyToClipboard(copyText)
21
22
 
22
23
  return (
23
24
  <Button
24
- aria-label="copy to clipboard"
25
+ aria-label={`Copy to clipboard ${copyText}`}
25
26
  className={cs('vui-copy-to-clipboard', className)}
26
27
  disabled={disabled || isCopyDisabled}
27
- icon="falCopy"
28
+ icon={icon}
28
29
  onClick={() => copy()}
29
30
  ref={ref}
30
31
  size={size}
@@ -1,3 +1,4 @@
1
+ import { IconProp } from '../icon'
1
2
  import { SystemProps } from '../system'
2
3
  import { ThemingProps } from '../theme'
3
4
 
@@ -5,6 +6,8 @@ export type CopyToClipboardProps = SystemProps &
5
6
  ThemingProps<'Button'> & {
6
7
  /** Text string for copying */
7
8
  copyText: string
9
+ /** Icon @default falCopy */
10
+ icon?: IconProp
8
11
  /** Button size @default "xs" */
9
12
  size?: 'xs' | 'sm' | 'md' | 'lg'
10
13
  }
@@ -64,3 +64,5 @@ export const helpTextSize = {
64
64
  lg: 'md',
65
65
  xl: 'md',
66
66
  } as const
67
+
68
+ export const helpTextMargin = '60px' as const
@@ -7,7 +7,14 @@ import Label from '../label'
7
7
  import { T } from '../t'
8
8
  import { ChangeEvent, cs, filterUndefined, isString } from '../utils'
9
9
  import AutoCompletePopover from './autoCompletePopover'
10
- import { clearIconSize, displayValueOnlyTextSize, helpTextSize, inputColors, inputStateMapping } from './consts'
10
+ import {
11
+ clearIconSize,
12
+ displayValueOnlyTextSize,
13
+ helpTextMargin,
14
+ helpTextSize,
15
+ inputColors,
16
+ inputStateMapping,
17
+ } from './consts'
11
18
  import { InputProvider } from './context'
12
19
  import { getInitialCount } from './helpers'
13
20
  import HelpText from './helpText'
@@ -230,7 +237,7 @@ export const Input = vui<'div', InputProps>((props, ref) => {
230
237
  </InputBase>
231
238
  {!!helpText && <HelpText size={helpTextSize[size]}>{helpText}</HelpText>}
232
239
  {!!errorText && (
233
- <HelpText isError size={helpTextSize[size]}>
240
+ <HelpText isError mr={showCount ? helpTextMargin : undefined} size={helpTextSize[size]}>
234
241
  {errorText}
235
242
  </HelpText>
236
243
  )}
@@ -2,7 +2,7 @@ import { useEffect, useId, useState } from 'react'
2
2
 
3
3
  import { Box, Label } from '..'
4
4
  import { omitThemingProps, styled, useStyleConfig, vui } from '../core'
5
- import { helpTextSize, inputColors } from '../input/consts'
5
+ import { helpTextMargin, helpTextSize, inputColors } from '../input/consts'
6
6
  import HelpText from '../input/helpText'
7
7
  import T from '../t'
8
8
  import { ChangeEvent, cs, filterUndefined, isString } from '../utils'
@@ -157,14 +157,13 @@ export const Textarea = vui<'div', TextareaProps>((props, ref) => {
157
157
  {count} {maxLength ? `/ ${maxLength}` : null}
158
158
  </T>
159
159
  )}
160
-
161
- {!!helpText && <HelpText size={helpTextSize['lg']}>{helpText}</HelpText>}
162
- {!!errorText && (
163
- <HelpText isError size={helpTextSize['lg']}>
164
- {errorText}
165
- </HelpText>
166
- )}
167
160
  </TextareaBase>
161
+ {!!helpText && <HelpText size={helpTextSize['lg']}>{helpText}</HelpText>}
162
+ {!!errorText && (
163
+ <HelpText isError mr={showCount ? helpTextMargin : undefined} size={helpTextSize['lg']}>
164
+ {errorText}
165
+ </HelpText>
166
+ )}
168
167
  </Box>
169
168
  )
170
169
  })