@vectara/vectara-ui 15.6.1 → 15.6.5
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/modal/Modal.js +2 -2
- package/lib/components/screenBlock/ScreenBlock.d.ts +2 -1
- package/lib/components/screenBlock/ScreenBlock.js +2 -2
- package/lib/components/screenBlock/_index.scss +8 -1
- package/lib/components/typography/_text.scss +51 -9
- package/lib/styles/index.css +75 -4
- package/package.json +1 -1
- package/src/docs/pages/text/Text.tsx +14 -0
|
@@ -45,10 +45,10 @@ export const VuiModal = (_a) => {
|
|
|
45
45
|
}, 0);
|
|
46
46
|
};
|
|
47
47
|
const classes = classNames("vuiModal", `vuiModal--${color}`, `vuiModal--${size}`, className);
|
|
48
|
-
return (_jsx(VuiPortal, { children: isOpen && (_jsx(VuiScreenBlock, { children: _jsx(FocusOn, Object.assign({ onEscapeKey: onCloseDelayed, onClickOutside: canClickOutsideToClose ? onCloseDelayed : undefined,
|
|
48
|
+
return (_jsx(VuiPortal, { children: isOpen && (_jsx(VuiScreenBlock, Object.assign({ type: "modal" }, { children: _jsx(FocusOn, Object.assign({ onEscapeKey: onCloseDelayed, onClickOutside: canClickOutsideToClose ? onCloseDelayed : undefined,
|
|
49
49
|
// Enable manual focus return to work.
|
|
50
50
|
returnFocus: false,
|
|
51
51
|
// Enable focus on contents when it's open,
|
|
52
52
|
// but enable manual focus return to work when it's closed.
|
|
53
|
-
autoFocus: isOpen }, { children: _jsx("div", Object.assign({ className: "vuiModalContainer" }, getOverlayProps("modalTitle"), { children: _jsxs("div", Object.assign({ className: classes }, rest, { children: [_jsx("div", Object.assign({ className: "vuiModalHeader" }, { children: _jsxs(VuiFlexContainer, Object.assign({ justifyContent: "spaceBetween", alignItems: "center" }, { children: [_jsx(VuiFlexItem, Object.assign({ grow: false }, { children: _jsxs(VuiFlexContainer, Object.assign({ alignItems: "center", spacing: "xs" }, { children: [icon && (_jsx(VuiFlexItem, Object.assign({ grow: false, shrink: false }, { children: _jsx(VuiIcon, Object.assign({ size: "l" }, { children: icon })) }))), _jsx(VuiFlexItem, Object.assign({ grow: false }, { children: _jsx("div", Object.assign({ className: "vuiModalHeader__title" }, { children: _jsx(DrawerTitle, Object.assign({ id: "modalTitle" }, { children: title })) })) }))] })) })), onClose && (_jsx(VuiFlexItem, { children: _jsx(VuiIconButton, { "aria-label": "Close", "data-testid": "modalCloseButton", onClick: onCloseDelayed, color: "neutral", icon: _jsx(VuiIcon, Object.assign({ size: "m", color: "neutral" }, { children: _jsx(BiX, {}) })) }) }))] })) })), _jsx("div", Object.assign({ className: "vuiModalContent" }, { children: _jsx("div", Object.assign({ className: "vuiModalContent__inner" }, { children: children })) }))] })) })) })) }, key)) }));
|
|
53
|
+
autoFocus: isOpen }, { children: _jsx("div", Object.assign({ className: "vuiModalContainer" }, getOverlayProps("modalTitle"), { children: _jsxs("div", Object.assign({ className: classes }, rest, { children: [_jsx("div", Object.assign({ className: "vuiModalHeader" }, { children: _jsxs(VuiFlexContainer, Object.assign({ justifyContent: "spaceBetween", alignItems: "center" }, { children: [_jsx(VuiFlexItem, Object.assign({ grow: false }, { children: _jsxs(VuiFlexContainer, Object.assign({ alignItems: "center", spacing: "xs" }, { children: [icon && (_jsx(VuiFlexItem, Object.assign({ grow: false, shrink: false }, { children: _jsx(VuiIcon, Object.assign({ size: "l" }, { children: icon })) }))), _jsx(VuiFlexItem, Object.assign({ grow: false }, { children: _jsx("div", Object.assign({ className: "vuiModalHeader__title" }, { children: _jsx(DrawerTitle, Object.assign({ id: "modalTitle" }, { children: title })) })) }))] })) })), onClose && (_jsx(VuiFlexItem, { children: _jsx(VuiIconButton, { "aria-label": "Close", "data-testid": "modalCloseButton", onClick: onCloseDelayed, color: "neutral", icon: _jsx(VuiIcon, Object.assign({ size: "m", color: "neutral" }, { children: _jsx(BiX, {}) })) }) }))] })) })), _jsx("div", Object.assign({ className: "vuiModalContent" }, { children: _jsx("div", Object.assign({ className: "vuiModalContent__inner" }, { children: children })) }))] })) })) })) }), key)) }));
|
|
54
54
|
};
|
|
@@ -2,6 +2,7 @@ type Props = {
|
|
|
2
2
|
onClick?: () => void;
|
|
3
3
|
children: React.ReactNode;
|
|
4
4
|
color?: "neutral" | "primary" | "danger" | "success";
|
|
5
|
+
type?: "default" | "modal";
|
|
5
6
|
};
|
|
6
|
-
export declare const VuiScreenBlock: ({ onClick, children, color }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const VuiScreenBlock: ({ onClick, children, color, type }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
7
8
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import classNames from "classnames";
|
|
3
|
-
export const VuiScreenBlock = ({ onClick, children, color = "neutral" }) => {
|
|
4
|
-
const classes = classNames("vuiScreenBlock", `vuiScreenBlock--${color}`);
|
|
3
|
+
export const VuiScreenBlock = ({ onClick, children, color = "neutral", type = "default" }) => {
|
|
4
|
+
const classes = classNames("vuiScreenBlock", `vuiScreenBlock--${color}`, `vuiScreenBlock--${type}`);
|
|
5
5
|
return (_jsxs("div", Object.assign({ className: classes }, { children: [children, _jsx("div", { className: "vuiScreenBlock__mask", onClick: onClick })] })));
|
|
6
6
|
};
|
|
@@ -4,12 +4,19 @@
|
|
|
4
4
|
left: 0;
|
|
5
5
|
right: 0;
|
|
6
6
|
bottom: 0;
|
|
7
|
-
z-index: $screenBlockZIndex;
|
|
8
7
|
display: flex;
|
|
9
8
|
align-items: center;
|
|
10
9
|
justify-content: center;
|
|
11
10
|
}
|
|
12
11
|
|
|
12
|
+
.vuiScreenBlock--default {
|
|
13
|
+
z-index: $screenBlockZIndex;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.vuiScreenBlock--modal {
|
|
17
|
+
z-index: $modalZIndex;
|
|
18
|
+
}
|
|
19
|
+
|
|
13
20
|
.vuiScreenBlock__mask {
|
|
14
21
|
width: 100%;
|
|
15
22
|
height: 100%;
|
|
@@ -39,6 +39,7 @@ $textRhythm: $sizeM;
|
|
|
39
39
|
margin-bottom: $textRhythm;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
+
// Default block styles for code and pre.
|
|
42
43
|
pre:not(:has(> code)),
|
|
43
44
|
code {
|
|
44
45
|
display: block;
|
|
@@ -59,22 +60,63 @@ $textRhythm: $sizeM;
|
|
|
59
60
|
}
|
|
60
61
|
|
|
61
62
|
pre > code {
|
|
63
|
+
display: block;
|
|
62
64
|
word-wrap: break-word;
|
|
63
65
|
word-break: break-word;
|
|
64
66
|
white-space: pre-wrap;
|
|
65
67
|
font-family: var(--vui-font-family-monospace);
|
|
66
68
|
margin-bottom: 0;
|
|
69
|
+
padding: 0;
|
|
70
|
+
background-color: transparent;
|
|
67
71
|
}
|
|
68
72
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
73
|
+
// Inline styles when nested in text-like elements.
|
|
74
|
+
strong,
|
|
75
|
+
b,
|
|
76
|
+
em,
|
|
77
|
+
i,
|
|
78
|
+
p,
|
|
79
|
+
li,
|
|
80
|
+
td,
|
|
81
|
+
th,
|
|
82
|
+
span,
|
|
83
|
+
label,
|
|
84
|
+
h1,
|
|
85
|
+
h2,
|
|
86
|
+
h3,
|
|
87
|
+
h4,
|
|
88
|
+
h5,
|
|
89
|
+
h6 {
|
|
90
|
+
> pre,
|
|
91
|
+
> code {
|
|
92
|
+
display: inline;
|
|
93
|
+
padding: $sizeXxxs $sizeXxs;
|
|
94
|
+
border-radius: $sizeXs;
|
|
95
|
+
overflow: auto;
|
|
96
|
+
background-color: var(--vui-color-light-shade);
|
|
97
|
+
font-family: var(--vui-font-family-monospace);
|
|
98
|
+
margin-bottom: 0;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// Block styles when nested in block-like elements.
|
|
103
|
+
div,
|
|
104
|
+
blockquote,
|
|
105
|
+
section,
|
|
106
|
+
article,
|
|
107
|
+
aside,
|
|
108
|
+
main,
|
|
109
|
+
nav,
|
|
110
|
+
header,
|
|
111
|
+
footer {
|
|
112
|
+
> pre:not(:has(> code)),
|
|
113
|
+
> code {
|
|
114
|
+
display: block;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
> pre:has(> code) {
|
|
118
|
+
display: block;
|
|
119
|
+
}
|
|
78
120
|
}
|
|
79
121
|
|
|
80
122
|
blockquote {
|
package/lib/styles/index.css
CHANGED
|
@@ -4493,12 +4493,19 @@ h2.react-datepicker__current-month {
|
|
|
4493
4493
|
left: 0;
|
|
4494
4494
|
right: 0;
|
|
4495
4495
|
bottom: 0;
|
|
4496
|
-
z-index: 10;
|
|
4497
4496
|
display: flex;
|
|
4498
4497
|
align-items: center;
|
|
4499
4498
|
justify-content: center;
|
|
4500
4499
|
}
|
|
4501
4500
|
|
|
4501
|
+
.vuiScreenBlock--default {
|
|
4502
|
+
z-index: 10;
|
|
4503
|
+
}
|
|
4504
|
+
|
|
4505
|
+
.vuiScreenBlock--modal {
|
|
4506
|
+
z-index: 12;
|
|
4507
|
+
}
|
|
4508
|
+
|
|
4502
4509
|
.vuiScreenBlock__mask {
|
|
4503
4510
|
width: 100%;
|
|
4504
4511
|
height: 100%;
|
|
@@ -5716,21 +5723,85 @@ h2.react-datepicker__current-month {
|
|
|
5716
5723
|
font-family: var(--vui-font-family-monospace);
|
|
5717
5724
|
}
|
|
5718
5725
|
.vuiText pre > code {
|
|
5726
|
+
display: block;
|
|
5719
5727
|
word-wrap: break-word;
|
|
5720
5728
|
word-break: break-word;
|
|
5721
5729
|
white-space: pre-wrap;
|
|
5722
5730
|
font-family: var(--vui-font-family-monospace);
|
|
5723
5731
|
margin-bottom: 0;
|
|
5732
|
+
padding: 0;
|
|
5733
|
+
background-color: transparent;
|
|
5724
5734
|
}
|
|
5725
|
-
.vuiText
|
|
5726
|
-
.vuiText
|
|
5735
|
+
.vuiText strong > pre,
|
|
5736
|
+
.vuiText strong > code,
|
|
5737
|
+
.vuiText b > pre,
|
|
5738
|
+
.vuiText b > code,
|
|
5739
|
+
.vuiText em > pre,
|
|
5740
|
+
.vuiText em > code,
|
|
5741
|
+
.vuiText i > pre,
|
|
5742
|
+
.vuiText i > code,
|
|
5743
|
+
.vuiText p > pre,
|
|
5744
|
+
.vuiText p > code,
|
|
5745
|
+
.vuiText li > pre,
|
|
5746
|
+
.vuiText li > code,
|
|
5747
|
+
.vuiText td > pre,
|
|
5748
|
+
.vuiText td > code,
|
|
5749
|
+
.vuiText th > pre,
|
|
5750
|
+
.vuiText th > code,
|
|
5751
|
+
.vuiText span > pre,
|
|
5752
|
+
.vuiText span > code,
|
|
5753
|
+
.vuiText label > pre,
|
|
5754
|
+
.vuiText label > code,
|
|
5755
|
+
.vuiText h1 > pre,
|
|
5756
|
+
.vuiText h1 > code,
|
|
5757
|
+
.vuiText h2 > pre,
|
|
5758
|
+
.vuiText h2 > code,
|
|
5759
|
+
.vuiText h3 > pre,
|
|
5760
|
+
.vuiText h3 > code,
|
|
5761
|
+
.vuiText h4 > pre,
|
|
5762
|
+
.vuiText h4 > code,
|
|
5763
|
+
.vuiText h5 > pre,
|
|
5764
|
+
.vuiText h5 > code,
|
|
5765
|
+
.vuiText h6 > pre,
|
|
5766
|
+
.vuiText h6 > code {
|
|
5727
5767
|
display: inline;
|
|
5728
5768
|
padding: 2px 4px;
|
|
5729
|
-
border: none;
|
|
5730
5769
|
border-radius: 8px;
|
|
5731
5770
|
overflow: auto;
|
|
5732
5771
|
background-color: var(--vui-color-light-shade);
|
|
5733
5772
|
font-family: var(--vui-font-family-monospace);
|
|
5773
|
+
margin-bottom: 0;
|
|
5774
|
+
}
|
|
5775
|
+
.vuiText div > pre:not(:has(> code)),
|
|
5776
|
+
.vuiText div > code,
|
|
5777
|
+
.vuiText blockquote > pre:not(:has(> code)),
|
|
5778
|
+
.vuiText blockquote > code,
|
|
5779
|
+
.vuiText section > pre:not(:has(> code)),
|
|
5780
|
+
.vuiText section > code,
|
|
5781
|
+
.vuiText article > pre:not(:has(> code)),
|
|
5782
|
+
.vuiText article > code,
|
|
5783
|
+
.vuiText aside > pre:not(:has(> code)),
|
|
5784
|
+
.vuiText aside > code,
|
|
5785
|
+
.vuiText main > pre:not(:has(> code)),
|
|
5786
|
+
.vuiText main > code,
|
|
5787
|
+
.vuiText nav > pre:not(:has(> code)),
|
|
5788
|
+
.vuiText nav > code,
|
|
5789
|
+
.vuiText header > pre:not(:has(> code)),
|
|
5790
|
+
.vuiText header > code,
|
|
5791
|
+
.vuiText footer > pre:not(:has(> code)),
|
|
5792
|
+
.vuiText footer > code {
|
|
5793
|
+
display: block;
|
|
5794
|
+
}
|
|
5795
|
+
.vuiText div > pre:has(> code),
|
|
5796
|
+
.vuiText blockquote > pre:has(> code),
|
|
5797
|
+
.vuiText section > pre:has(> code),
|
|
5798
|
+
.vuiText article > pre:has(> code),
|
|
5799
|
+
.vuiText aside > pre:has(> code),
|
|
5800
|
+
.vuiText main > pre:has(> code),
|
|
5801
|
+
.vuiText nav > pre:has(> code),
|
|
5802
|
+
.vuiText header > pre:has(> code),
|
|
5803
|
+
.vuiText footer > pre:has(> code) {
|
|
5804
|
+
display: block;
|
|
5734
5805
|
}
|
|
5735
5806
|
.vuiText blockquote {
|
|
5736
5807
|
border-left: 4px solid var(--vui-color-light-shade);
|
package/package.json
CHANGED
|
@@ -95,6 +95,20 @@ export const Text = () => (
|
|
|
95
95
|
> In Markdown's ring.`}
|
|
96
96
|
</code>
|
|
97
97
|
|
|
98
|
+
<ol>
|
|
99
|
+
<li>
|
|
100
|
+
Choose:
|
|
101
|
+
<ul>
|
|
102
|
+
<li>
|
|
103
|
+
<strong>Option A:</strong> <code>EXECUTE</code>
|
|
104
|
+
</li>
|
|
105
|
+
<li>
|
|
106
|
+
<strong>Option B:</strong> <code>ABORT</code>
|
|
107
|
+
</li>
|
|
108
|
+
</ul>
|
|
109
|
+
</li>
|
|
110
|
+
</ol>
|
|
111
|
+
|
|
98
112
|
<table>
|
|
99
113
|
<thead>
|
|
100
114
|
<tr>
|