@veracity/vui 2.20.2 → 2.21.0-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.
- package/dist/cjs/dialog/dialog.d.ts.map +1 -1
- package/dist/cjs/dialog/dialog.js +2 -2
- package/dist/cjs/dialog/dialog.js.map +1 -1
- package/dist/cjs/dialog/dialog.types.d.ts +3 -1
- package/dist/cjs/dialog/dialog.types.d.ts.map +1 -1
- package/dist/cjs/link/link.d.ts +3 -1
- package/dist/cjs/link/link.d.ts.map +1 -1
- package/dist/cjs/link/link.js +24 -5
- package/dist/cjs/link/link.js.map +1 -1
- package/dist/cjs/select/select.types.d.ts +1 -1
- package/dist/cjs/select/select.types.d.ts.map +1 -1
- package/dist/cjs/tooltip/consts.d.ts +57 -1
- package/dist/cjs/tooltip/consts.d.ts.map +1 -1
- package/dist/cjs/tooltip/consts.js +62 -6
- package/dist/cjs/tooltip/consts.js.map +1 -1
- package/dist/cjs/tooltip/tooltip.types.d.ts +1 -1
- package/dist/cjs/tooltip/tooltip.types.d.ts.map +1 -1
- package/dist/esm/dialog/dialog.d.ts.map +1 -1
- package/dist/esm/dialog/dialog.js +2 -2
- package/dist/esm/dialog/dialog.js.map +1 -1
- package/dist/esm/dialog/dialog.types.d.ts +3 -1
- package/dist/esm/dialog/dialog.types.d.ts.map +1 -1
- package/dist/esm/link/link.d.ts +3 -1
- package/dist/esm/link/link.d.ts.map +1 -1
- package/dist/esm/link/link.js +24 -5
- package/dist/esm/link/link.js.map +1 -1
- package/dist/esm/select/select.types.d.ts +1 -1
- package/dist/esm/select/select.types.d.ts.map +1 -1
- package/dist/esm/tooltip/consts.d.ts +57 -1
- package/dist/esm/tooltip/consts.d.ts.map +1 -1
- package/dist/esm/tooltip/consts.js +62 -6
- package/dist/esm/tooltip/consts.js.map +1 -1
- package/dist/esm/tooltip/tooltip.types.d.ts +1 -1
- package/dist/esm/tooltip/tooltip.types.d.ts.map +1 -1
- package/dist/tsconfig.legacy.tsbuildinfo +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/dialog/dialog.tsx +2 -1
- package/src/dialog/dialog.types.ts +3 -1
- package/src/link/link.tsx +25 -9
- package/src/select/select.types.ts +1 -1
- package/src/tooltip/consts.ts +62 -6
- package/src/tooltip/tooltip.types.ts +13 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veracity/vui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.21.0-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",
|
package/src/dialog/dialog.tsx
CHANGED
|
@@ -39,6 +39,7 @@ export const Dialog = vui<'div', DialogProps>((props, ref) => {
|
|
|
39
39
|
children,
|
|
40
40
|
className,
|
|
41
41
|
closeButton,
|
|
42
|
+
disableBackdropClose,
|
|
42
43
|
footer,
|
|
43
44
|
header,
|
|
44
45
|
icon,
|
|
@@ -76,7 +77,7 @@ export const Dialog = vui<'div', DialogProps>((props, ref) => {
|
|
|
76
77
|
|
|
77
78
|
return (
|
|
78
79
|
<DialogProvider value={context}>
|
|
79
|
-
<Modal {...{ isOpen, onClose }} {...modalProps}>
|
|
80
|
+
<Modal {...{ disableBackdropClose, isOpen, onClose }} {...modalProps}>
|
|
80
81
|
<DialogBase
|
|
81
82
|
className={cs('vui-dialog', className)}
|
|
82
83
|
id={dialogId}
|
|
@@ -35,13 +35,15 @@ export type DialogProps = SystemProps &
|
|
|
35
35
|
cancelButton?: DialogCancelButtonProps | JSX.Element
|
|
36
36
|
/** Socket for a close icon button in the Dialog Header. */
|
|
37
37
|
closeButton?: boolean | DialogCloseButtonProps | JSX.Element
|
|
38
|
+
/** Clicking Backdrop element will not trigger 'onClose'. */
|
|
39
|
+
disableBackdropClose?: boolean
|
|
38
40
|
/** Socket for a footer with buttons below Dialog Body. */
|
|
39
41
|
footer?: DialogFooterProps | JSX.Element
|
|
40
42
|
/** Socket for a header with title and icon above the Dialog Body */
|
|
41
43
|
header?: DialogHeaderProps | JSX.Element
|
|
42
44
|
/** Socket for a custom icon in the Dialog Header. */
|
|
43
45
|
icon?: IconProp | DialogIconProps | JSX.Element
|
|
44
|
-
/**
|
|
46
|
+
/** The props being passed into the internal Modal component. */
|
|
45
47
|
modalProps?: ModalProps
|
|
46
48
|
/** Adds an icon for a given status, such as error or warning. */
|
|
47
49
|
status?: DialogStatus
|
package/src/link/link.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useMemo } from 'react'
|
|
2
2
|
|
|
3
3
|
import { styled, useStyleConfig, vui, VuiComponent } from '../core'
|
|
4
4
|
import { cs, filterUndefined, isReactText, isString } from '../utils'
|
|
@@ -7,7 +7,9 @@ import { LinkProps } from './link.types'
|
|
|
7
7
|
import LinkIcon from './linkIcon'
|
|
8
8
|
import LinkText from './linkText'
|
|
9
9
|
|
|
10
|
-
export const LinkBase = styled.aBox
|
|
10
|
+
export const LinkBase = styled.aBox.attrs((props: LinkProps) => ({
|
|
11
|
+
isUnderlined: props.isUnderlined || false,
|
|
12
|
+
}))`
|
|
11
13
|
align-items: center;
|
|
12
14
|
border-radius: none;
|
|
13
15
|
cursor: pointer;
|
|
@@ -17,6 +19,24 @@ export const LinkBase = styled.aBox`
|
|
|
17
19
|
text-decoration: none;
|
|
18
20
|
transition-duration: instant;
|
|
19
21
|
width: fit-content;
|
|
22
|
+
position: relative;
|
|
23
|
+
|
|
24
|
+
&::after {
|
|
25
|
+
content: '';
|
|
26
|
+
position: absolute;
|
|
27
|
+
bottom: 0;
|
|
28
|
+
left: 0;
|
|
29
|
+
width: 100%;
|
|
30
|
+
height: ${props => (props.isUnderlined ? '1px' : '0')};
|
|
31
|
+
background-color: currentColor;
|
|
32
|
+
opacity: ${props => (props.isUnderlined ? '1' : '0')};
|
|
33
|
+
transition: height 0.2s ease-in-out;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&:hover::after {
|
|
37
|
+
height: 2px;
|
|
38
|
+
opacity: 1;
|
|
39
|
+
}
|
|
20
40
|
`
|
|
21
41
|
|
|
22
42
|
/**
|
|
@@ -27,8 +47,7 @@ export const Link = vui<'a', LinkProps>((props, ref) => {
|
|
|
27
47
|
const {
|
|
28
48
|
children,
|
|
29
49
|
className,
|
|
30
|
-
|
|
31
|
-
hoverDecoration = 'underline',
|
|
50
|
+
fontWeight,
|
|
32
51
|
iconLeft,
|
|
33
52
|
iconRight,
|
|
34
53
|
isExternal,
|
|
@@ -44,10 +63,9 @@ export const Link = vui<'a', LinkProps>((props, ref) => {
|
|
|
44
63
|
const context = useMemo(() => filterUndefined({ size, variant }), [size, variant])
|
|
45
64
|
|
|
46
65
|
const aliasedProps = filterUndefined({
|
|
47
|
-
fontWeight: weight,
|
|
66
|
+
fontWeight: weight || fontWeight,
|
|
48
67
|
rel: isExternal ? 'noopener' : undefined,
|
|
49
68
|
target: isExternal ? '_blank' : undefined,
|
|
50
|
-
textDecoration: decoration ?? (isUnderlined ? 'underline' : undefined),
|
|
51
69
|
})
|
|
52
70
|
|
|
53
71
|
return (
|
|
@@ -55,16 +73,14 @@ export const Link = vui<'a', LinkProps>((props, ref) => {
|
|
|
55
73
|
<LinkBase
|
|
56
74
|
className={cs('vui-link', className)}
|
|
57
75
|
focusRing={2}
|
|
58
|
-
|
|
76
|
+
isUnderlined={isUnderlined}
|
|
59
77
|
ref={ref}
|
|
60
78
|
{...styles.container}
|
|
61
79
|
{...aliasedProps}
|
|
62
80
|
{...rest}
|
|
63
81
|
>
|
|
64
82
|
{isString(iconLeft) ? <LinkIcon mr={1} name={iconLeft} /> : iconLeft}
|
|
65
|
-
|
|
66
83
|
{children ?? (isReactText(text) ? <LinkText text={text} /> : text)}
|
|
67
|
-
|
|
68
84
|
{isString(iconRight) ? <LinkIcon ml={1} name={iconRight} /> : iconRight}
|
|
69
85
|
</LinkBase>
|
|
70
86
|
</LinkProvider>
|
|
@@ -50,7 +50,7 @@ export type SelectProps = ThemingProps<'Select'> &
|
|
|
50
50
|
readOnly?: boolean
|
|
51
51
|
/** Custom select button slot. */
|
|
52
52
|
selectButton?: ReactNode
|
|
53
|
-
/** Displays a filter input to limit the number of options. */
|
|
53
|
+
/** Displays a filter input to limit the number of options. Important: it takes effect only if the options array is provided. */
|
|
54
54
|
showOptionsFilter?: boolean
|
|
55
55
|
}
|
|
56
56
|
|
package/src/tooltip/consts.ts
CHANGED
|
@@ -14,6 +14,41 @@ export const pointerPlacement = {
|
|
|
14
14
|
right: 'auto',
|
|
15
15
|
translate: '-50%, 0',
|
|
16
16
|
},
|
|
17
|
+
'top-start': {
|
|
18
|
+
top: 'auto',
|
|
19
|
+
bottom: `-${pointerSize / 2}px`,
|
|
20
|
+
left: pointerSize * 2,
|
|
21
|
+
right: undefined,
|
|
22
|
+
translate: '-50%, 0',
|
|
23
|
+
},
|
|
24
|
+
'top-end': {
|
|
25
|
+
top: 'auto',
|
|
26
|
+
bottom: `-${pointerSize / 2}px`,
|
|
27
|
+
left: undefined,
|
|
28
|
+
right: pointerSize,
|
|
29
|
+
translate: '-50%, 0',
|
|
30
|
+
},
|
|
31
|
+
right: {
|
|
32
|
+
top: '50%',
|
|
33
|
+
bottom: 'auto',
|
|
34
|
+
left: '2px',
|
|
35
|
+
right: 'auto',
|
|
36
|
+
translate: '0, -50%',
|
|
37
|
+
},
|
|
38
|
+
'right-start': {
|
|
39
|
+
top: `${pointerSize * 1.5}px`,
|
|
40
|
+
bottom: 'auto',
|
|
41
|
+
left: '2px',
|
|
42
|
+
right: 'auto',
|
|
43
|
+
translate: '0, -50%',
|
|
44
|
+
},
|
|
45
|
+
'right-end': {
|
|
46
|
+
top: 'auto',
|
|
47
|
+
bottom: `${pointerSize / 2}px`,
|
|
48
|
+
left: '2px',
|
|
49
|
+
right: 'auto',
|
|
50
|
+
translate: '0, -50%',
|
|
51
|
+
},
|
|
17
52
|
bottom: {
|
|
18
53
|
top: `-${pointerSize / 2}px`,
|
|
19
54
|
bottom: 'auto',
|
|
@@ -21,18 +56,39 @@ export const pointerPlacement = {
|
|
|
21
56
|
right: 'auto',
|
|
22
57
|
translate: '-50%, 0',
|
|
23
58
|
},
|
|
59
|
+
'bottom-start': {
|
|
60
|
+
top: `-${pointerSize / 2}px`,
|
|
61
|
+
bottom: 'auto',
|
|
62
|
+
left: pointerSize * 2,
|
|
63
|
+
right: undefined,
|
|
64
|
+
translate: '-50%, 0',
|
|
65
|
+
},
|
|
66
|
+
'bottom-end': {
|
|
67
|
+
top: `-${pointerSize / 2}px`,
|
|
68
|
+
bottom: 'auto',
|
|
69
|
+
left: undefined,
|
|
70
|
+
right: pointerSize,
|
|
71
|
+
translate: '-50%, 0',
|
|
72
|
+
},
|
|
24
73
|
left: {
|
|
25
|
-
top:
|
|
74
|
+
top: '50%',
|
|
26
75
|
bottom: 'auto',
|
|
27
76
|
left: 'auto',
|
|
28
77
|
right: '-4px',
|
|
29
78
|
translate: '-50%, -50%',
|
|
30
79
|
},
|
|
31
|
-
|
|
32
|
-
top:
|
|
80
|
+
'left-start': {
|
|
81
|
+
top: `${pointerSize * 1.5}px`,
|
|
33
82
|
bottom: 'auto',
|
|
34
|
-
left: '
|
|
35
|
-
right: '
|
|
36
|
-
translate: '
|
|
83
|
+
left: 'auto',
|
|
84
|
+
right: '-4px',
|
|
85
|
+
translate: '-50%, -50%',
|
|
86
|
+
},
|
|
87
|
+
'left-end': {
|
|
88
|
+
top: 'auto',
|
|
89
|
+
bottom: `${pointerSize / 2}px`,
|
|
90
|
+
left: 'auto',
|
|
91
|
+
right: '-4px',
|
|
92
|
+
translate: '-50%, -50%',
|
|
37
93
|
},
|
|
38
94
|
}
|
|
@@ -7,7 +7,19 @@ export interface TooltipProps extends ChildrenProp {
|
|
|
7
7
|
/** Displays given text at the tooltip. */
|
|
8
8
|
text?: string
|
|
9
9
|
/** Tooltip position. */
|
|
10
|
-
placement?:
|
|
10
|
+
placement?:
|
|
11
|
+
| 'top'
|
|
12
|
+
| 'top-start'
|
|
13
|
+
| 'top-end'
|
|
14
|
+
| 'right'
|
|
15
|
+
| 'right-start'
|
|
16
|
+
| 'right-end'
|
|
17
|
+
| 'bottom'
|
|
18
|
+
| 'bottom-start'
|
|
19
|
+
| 'bottom-end'
|
|
20
|
+
| 'left'
|
|
21
|
+
| 'left-start'
|
|
22
|
+
| 'left-end'
|
|
11
23
|
/** Sets maximum width to the tooltip body. */
|
|
12
24
|
maxWidth?: string
|
|
13
25
|
/** Link text that will be concatenated to the end of the tooltip text. */
|