@veracity/vui 2.24.0 → 2.24.1

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.24.0",
3
+ "version": "2.24.1",
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",
@@ -20,6 +20,7 @@ export const LabelBase = styled.labelBox`
20
20
  /** Displays a paragraph of text. */
21
21
  export const Label = vui<'label', LabelProps>((props, ref) => {
22
22
  const { children, className, markAsOptional, tooltipText, text, fontSize, ...rest } = omitThemingProps(props)
23
+ const styles = useStyleConfig('Label', props)
23
24
 
24
25
  const isOnlyText = text && !markAsOptional && !tooltipText && !children
25
26
 
@@ -31,23 +32,17 @@ export const Label = vui<'label', LabelProps>((props, ref) => {
31
32
  ) : (
32
33
  <>
33
34
  <T fontSize={fontSize}>{text}</T>
34
- {markAsOptional && (
35
- <>
36
- {' '}
37
- <T fontSize={fontSize} fontWeight={400}>
38
- (optional)
39
- </T>
40
- </>
35
+ {!!markAsOptional && (
36
+ <T fontSize={fontSize} {...styles.helper}>
37
+ (optional)
38
+ </T>
41
39
  )}
42
- {tooltipText && (
43
- <>
44
- {' '}
45
- <T fontSize={fontSize} fontWeight={400}>
46
- <Tooltip text={tooltipText}>
47
- <Icon mb={fontSize === 'xs' ? '-6px' : '-5px'} name="falInfoCircle" role="button" size="sm" />
48
- </Tooltip>
49
- </T>
50
- </>
40
+ {!!tooltipText && (
41
+ <T fontSize={fontSize} {...styles.helper}>
42
+ <Tooltip text={tooltipText}>
43
+ <Icon mb={fontSize === 'xs' ? '-6px' : '-5px'} name="falInfoCircle" role="button" size="sm" />
44
+ </Tooltip>
45
+ </T>
51
46
  )}
52
47
  </>
53
48
  ))}
@@ -1,4 +1,9 @@
1
- const baseStyle = {}
1
+ const baseStyle = {
2
+ helper: {
3
+ ml: '8px',
4
+ fontWeight: 400,
5
+ },
6
+ }
2
7
 
3
8
  const defaultProps = {}
4
9
 
@@ -6,9 +11,12 @@ const sizes = {}
6
11
 
7
12
  const variants = {}
8
13
 
14
+ const parts = ['helper']
15
+
9
16
  export default {
10
17
  baseStyle,
11
18
  defaultProps,
19
+ parts,
12
20
  sizes,
13
21
  variants,
14
22
  }