@vectara/vectara-ui 18.2.1 → 18.2.3
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/lib/components/drawer/Drawer.js +7 -1
- package/lib/components/drawer/_index.scss +2 -0
- package/lib/components/modal/Modal.js +7 -1
- package/lib/components/modal/_index.scss +5 -1
- package/lib/components/popover/Popover.js +7 -1
- package/lib/components/popover/_index.scss +2 -0
- package/lib/components/topicButton/TopicButton.d.ts +2 -1
- package/lib/components/topicButton/TopicButton.js +6 -4
- package/lib/components/topicButton/_index.scss +5 -0
- package/lib/styles/index.css +14 -1
- package/package.json +1 -1
|
@@ -71,7 +71,13 @@ export const VuiDrawer = (_a) => {
|
|
|
71
71
|
const classes = classNames("vuiDrawer", `vuiDrawer--${color}`, className, {
|
|
72
72
|
"vuiDrawer-isLoaded": showTransition
|
|
73
73
|
});
|
|
74
|
-
return (_jsx(VuiPortal, { children: (isOpen || isContentVisible || showTransition) && (_jsx(VuiScreenBlock, Object.assign({ isHidden: !isOpen }, { children: _jsx(FocusOn
|
|
74
|
+
return (_jsx(VuiPortal, { children: (isOpen || isContentVisible || showTransition) && (_jsx(VuiScreenBlock, Object.assign({ isHidden: !isOpen }, { children: _jsx(FocusOn
|
|
75
|
+
// Disable the focus guard as soon as the drawer begins closing
|
|
76
|
+
// so it doesn't intercept clicks while transitioning out.
|
|
77
|
+
, Object.assign({
|
|
78
|
+
// Disable the focus guard as soon as the drawer begins closing
|
|
79
|
+
// so it doesn't intercept clicks while transitioning out.
|
|
80
|
+
enabled: isOpen, onEscapeKey: onCloseDelayed, onClickOutside: handleClickOutside,
|
|
75
81
|
// Enable manual focus return to work.
|
|
76
82
|
returnFocus: false,
|
|
77
83
|
// Enable focus on contents when it's open,
|
|
@@ -16,6 +16,7 @@ $drawerWidth: 680px;
|
|
|
16
16
|
z-index: $drawerZIndex;
|
|
17
17
|
right: -$drawerWidth;
|
|
18
18
|
transition: right $transitionSpeed cubic-bezier(0, 1, 0, 1);
|
|
19
|
+
pointer-events: none;
|
|
19
20
|
|
|
20
21
|
@media screen and (max-width: ($drawerWidth + $sizeM)) {
|
|
21
22
|
max-width: calc(100% - $sizeM);
|
|
@@ -24,6 +25,7 @@ $drawerWidth: 680px;
|
|
|
24
25
|
|
|
25
26
|
.vuiDrawer-isLoaded {
|
|
26
27
|
right: 0;
|
|
28
|
+
pointer-events: auto;
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
.vuiDrawerHeader {
|
|
@@ -72,7 +72,13 @@ export const VuiModal = (_a) => {
|
|
|
72
72
|
"vuiModalContainer-isLoaded": showTransition
|
|
73
73
|
});
|
|
74
74
|
const classes = classNames("vuiModal", `vuiModal--${color}`, `vuiModal--${size}`, className);
|
|
75
|
-
return (_jsx(VuiPortal, { children: (isOpen || isContentVisible || showTransition) && (_jsx(VuiScreenBlock, Object.assign({ type: "modal", isHidden: !isOpen }, { children: _jsx(FocusOn
|
|
75
|
+
return (_jsx(VuiPortal, { children: (isOpen || isContentVisible || showTransition) && (_jsx(VuiScreenBlock, Object.assign({ type: "modal", isHidden: !isOpen }, { children: _jsx(FocusOn
|
|
76
|
+
// Disable the focus guard as soon as the modal begins closing
|
|
77
|
+
// so it doesn't intercept clicks while transitioning out.
|
|
78
|
+
, Object.assign({
|
|
79
|
+
// Disable the focus guard as soon as the modal begins closing
|
|
80
|
+
// so it doesn't intercept clicks while transitioning out.
|
|
81
|
+
enabled: isOpen, onEscapeKey: onCloseDelayed, onClickOutside: canClickOutsideToClose ? handleClickOutside : undefined,
|
|
76
82
|
// Enable manual focus return to work.
|
|
77
83
|
returnFocus: false,
|
|
78
84
|
// Enable focus on contents when it's open,
|
|
@@ -28,11 +28,15 @@
|
|
|
28
28
|
background-color: var(--vui-color-empty-shade);
|
|
29
29
|
border-radius: $sizeXxs;
|
|
30
30
|
z-index: $modalZIndex;
|
|
31
|
-
pointer-events:
|
|
31
|
+
pointer-events: none;
|
|
32
32
|
box-shadow: rgba(57, 57, 75, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;
|
|
33
33
|
transition: height $transitionSpeed, max-width $transitionSpeed, max-height $transitionSpeed;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
.vuiModalContainer-isLoaded .vuiModal {
|
|
37
|
+
pointer-events: all;
|
|
38
|
+
}
|
|
39
|
+
|
|
36
40
|
$size: (
|
|
37
41
|
s: 500px,
|
|
38
42
|
m: 900px,
|
|
@@ -167,7 +167,13 @@ export const VuiPopover = (_a) => {
|
|
|
167
167
|
"vuiPopoverContent--padding": padding === true,
|
|
168
168
|
"vuiPopoverContent--paddingNone": padding === "none"
|
|
169
169
|
});
|
|
170
|
-
return (_jsxs(_Fragment, { children: [button, _jsx(VuiPortal, { children: (isOpen || isContentVisible || showTransition) && position && (_jsx(FocusOn
|
|
170
|
+
return (_jsxs(_Fragment, { children: [button, _jsx(VuiPortal, { children: (isOpen || isContentVisible || showTransition) && position && (_jsx(FocusOn
|
|
171
|
+
// Disable the focus guard as soon as the popover begins closing
|
|
172
|
+
// so it doesn't intercept clicks while transitioning out.
|
|
173
|
+
, Object.assign({
|
|
174
|
+
// Disable the focus guard as soon as the popover begins closing
|
|
175
|
+
// so it doesn't intercept clicks while transitioning out.
|
|
176
|
+
enabled: isOpen, onEscapeKey: onCloseDelayed, onClickOutside: onCloseDelayed,
|
|
171
177
|
// Enable manual focus return to work.
|
|
172
178
|
returnFocus: false,
|
|
173
179
|
// Enable focus on contents when it's open,
|
|
@@ -9,11 +9,13 @@
|
|
|
9
9
|
opacity: 0;
|
|
10
10
|
transform: translateY(-$sizeXs);
|
|
11
11
|
transition: opacity $transitionSpeed, transform $transitionSpeed;
|
|
12
|
+
pointer-events: none;
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
.vuiPopover-isLoaded {
|
|
15
16
|
opacity: 1;
|
|
16
17
|
transform: translateY(0);
|
|
18
|
+
pointer-events: auto;
|
|
17
19
|
}
|
|
18
20
|
|
|
19
21
|
.vuiPopover--allowOverflow {
|
|
@@ -21,6 +21,7 @@ type Props = {
|
|
|
21
21
|
buttonStyle?: TopicButtonStyle;
|
|
22
22
|
badges?: TopicButtonBadge[];
|
|
23
23
|
icon?: React.ReactNode;
|
|
24
|
+
isDisabled?: boolean;
|
|
24
25
|
};
|
|
25
|
-
export declare const VuiTopicButton: ({ children, className, href, onClick, title, fullWidth, color, buttonStyle, badges, icon, target, track, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export declare const VuiTopicButton: ({ children, className, href, onClick, title, fullWidth, color, buttonStyle, badges, icon, isDisabled, target, track, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
26
27
|
export {};
|
|
@@ -22,11 +22,12 @@ import { VuiFlexItem } from "../flex/FlexItem";
|
|
|
22
22
|
export const TOPIC_BUTTON_COLOR = ["primary", "accent"];
|
|
23
23
|
export const TOPIC_BUTTON_STYLE = ["compactRow", "compactGrid"];
|
|
24
24
|
export const VuiTopicButton = (_a) => {
|
|
25
|
-
var { children, className, href, onClick, title, fullWidth, color = "primary", buttonStyle, badges, icon, target, track } = _a, rest = __rest(_a, ["children", "className", "href", "onClick", "title", "fullWidth", "color", "buttonStyle", "badges", "icon", "target", "track"]);
|
|
25
|
+
var { children, className, href, onClick, title, fullWidth, color = "primary", buttonStyle, badges, icon, isDisabled, target, track } = _a, rest = __rest(_a, ["children", "className", "href", "onClick", "title", "fullWidth", "color", "buttonStyle", "badges", "icon", "isDisabled", "target", "track"]);
|
|
26
26
|
const { createLink } = useVuiContext();
|
|
27
27
|
const classes = classNames("vuiTopicButton", `vuiTopicButton--${color}`, className, {
|
|
28
28
|
[`vuiTopicButton--${buttonStyle}`]: buttonStyle,
|
|
29
|
-
"vuiTopicButton--fullWidth": fullWidth
|
|
29
|
+
"vuiTopicButton--fullWidth": fullWidth,
|
|
30
|
+
"vuiTopicButton--isDisabled": isDisabled
|
|
30
31
|
});
|
|
31
32
|
const titleNode = title && (_jsx(VuiTitle, Object.assign({ size: buttonStyle ? "xs" : "s" }, { children: _jsx("p", { children: _jsx(VuiTextColor, Object.assign({ color: color }, { children: title })) }) })));
|
|
32
33
|
const badgeNodes = badges === null || badges === void 0 ? void 0 : badges.map((badge, index) => (_jsx(VuiFlexItem, Object.assign({ grow: false, shrink: false }, { children: _jsx(VuiBadge, Object.assign({ color: badge.color, size: "s" }, { children: badge.label })) }), index)));
|
|
@@ -42,9 +43,10 @@ export const VuiTopicButton = (_a) => {
|
|
|
42
43
|
else {
|
|
43
44
|
content = (_jsx(VuiFlexContainer, Object.assign({ alignItems: "start", spacing: "m" }, { children: _jsxs(VuiFlexItem, Object.assign({ grow: true }, { children: [title && (_jsxs(_Fragment, { children: [_jsxs(VuiFlexContainer, Object.assign({ alignItems: "center", spacing: "s" }, { children: [icon, _jsx(VuiFlexItem, Object.assign({ grow: false, shrink: false }, { children: titleNode })), badgeNodes] })), children && _jsx(VuiSpacer, { size: "xxs" })] })), children] })) })));
|
|
44
45
|
}
|
|
45
|
-
|
|
46
|
+
// Anchor tags can't be disabled, so we render a disabled button instead.
|
|
47
|
+
if (href && !isDisabled) {
|
|
46
48
|
return createLink(Object.assign(Object.assign({ className: classes, href,
|
|
47
49
|
onClick, children: content, target }, rest), getTrackingProps(track)));
|
|
48
50
|
}
|
|
49
|
-
return (_jsx("button", Object.assign({ className: classes, onClick: onClick, type: "button" }, rest, { children: content })));
|
|
51
|
+
return (_jsx("button", Object.assign({ className: classes, onClick: onClick, type: "button", disabled: isDisabled }, rest, { children: content })));
|
|
50
52
|
};
|
package/lib/styles/index.css
CHANGED
|
@@ -2477,6 +2477,7 @@ h2.react-datepicker__current-month {
|
|
|
2477
2477
|
z-index: 11;
|
|
2478
2478
|
right: -680px;
|
|
2479
2479
|
transition: right 0.2s cubic-bezier(0, 1, 0, 1);
|
|
2480
|
+
pointer-events: none;
|
|
2480
2481
|
}
|
|
2481
2482
|
@media screen and (max-width: 696px) {
|
|
2482
2483
|
.vuiDrawer {
|
|
@@ -2486,6 +2487,7 @@ h2.react-datepicker__current-month {
|
|
|
2486
2487
|
|
|
2487
2488
|
.vuiDrawer-isLoaded {
|
|
2488
2489
|
right: 0;
|
|
2490
|
+
pointer-events: auto;
|
|
2489
2491
|
}
|
|
2490
2492
|
|
|
2491
2493
|
.vuiDrawerHeader {
|
|
@@ -4211,11 +4213,15 @@ h2.react-datepicker__current-month {
|
|
|
4211
4213
|
background-color: var(--vui-color-empty-shade);
|
|
4212
4214
|
border-radius: 4px;
|
|
4213
4215
|
z-index: 12;
|
|
4214
|
-
pointer-events:
|
|
4216
|
+
pointer-events: none;
|
|
4215
4217
|
box-shadow: rgba(57, 57, 75, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;
|
|
4216
4218
|
transition: height 0.2s, max-width 0.2s, max-height 0.2s;
|
|
4217
4219
|
}
|
|
4218
4220
|
|
|
4221
|
+
.vuiModalContainer-isLoaded .vuiModal {
|
|
4222
|
+
pointer-events: all;
|
|
4223
|
+
}
|
|
4224
|
+
|
|
4219
4225
|
.vuiModal--s {
|
|
4220
4226
|
max-width: 500px;
|
|
4221
4227
|
}
|
|
@@ -4538,11 +4544,13 @@ h2.react-datepicker__current-month {
|
|
|
4538
4544
|
opacity: 0;
|
|
4539
4545
|
transform: translateY(-8px);
|
|
4540
4546
|
transition: opacity 0.2s, transform 0.2s;
|
|
4547
|
+
pointer-events: none;
|
|
4541
4548
|
}
|
|
4542
4549
|
|
|
4543
4550
|
.vuiPopover-isLoaded {
|
|
4544
4551
|
opacity: 1;
|
|
4545
4552
|
transform: translateY(0);
|
|
4553
|
+
pointer-events: auto;
|
|
4546
4554
|
}
|
|
4547
4555
|
|
|
4548
4556
|
.vuiPopover--allowOverflow {
|
|
@@ -6007,6 +6015,11 @@ h2.react-datepicker__current-month {
|
|
|
6007
6015
|
width: 100%;
|
|
6008
6016
|
}
|
|
6009
6017
|
|
|
6018
|
+
.vuiTopicButton--isDisabled {
|
|
6019
|
+
cursor: not-allowed;
|
|
6020
|
+
pointer-events: none;
|
|
6021
|
+
}
|
|
6022
|
+
|
|
6010
6023
|
.vuiTopicButton--primary:hover {
|
|
6011
6024
|
box-shadow: rgba(50, 50, 93, 0.25) 0px 6px 12px -2px, rgba(0, 0, 0, 0.3) 0px 3px 7px -3px, var(--vui-color-primary-shade) 0 0 1px 1px;
|
|
6012
6025
|
}
|