@cloudflare/component-page 9.3.2 → 9.3.4
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/CHANGELOG.md +12 -0
- package/es/Page.js +11 -3
- package/lib/Page.js +12 -3
- package/package.json +2 -2
- package/src/Page.tsx +22 -10
package/CHANGELOG.md
CHANGED
package/es/Page.js
CHANGED
|
@@ -17,6 +17,7 @@ import { DocumentationLink, Link } from '@cloudflare/component-link';
|
|
|
17
17
|
import { useIsMobile } from '@cloudflare/util-responsive';
|
|
18
18
|
import { Icon } from '@cloudflare/component-icon';
|
|
19
19
|
import { Button } from '@cloudflare/component-button';
|
|
20
|
+
import { Tooltip } from '@cloudflare/component-tooltip';
|
|
20
21
|
var maxWidthByType = {
|
|
21
22
|
narrow: '64em',
|
|
22
23
|
wide: '79em',
|
|
@@ -81,15 +82,22 @@ var PageHeader = _ref => {
|
|
|
81
82
|
lineHeight: 1.25,
|
|
82
83
|
fontWeight: 400,
|
|
83
84
|
wordBreak: "break-word"
|
|
84
|
-
}, description), documentationAsButton && !isMobile ? /*#__PURE__*/React.createElement(
|
|
85
|
+
}, description), documentationAsButton && !isMobile ? /*#__PURE__*/React.createElement(Tooltip, {
|
|
86
|
+
place: "right",
|
|
87
|
+
message: /*#__PURE__*/React.createElement(Trans, {
|
|
88
|
+
id: "common.open_documentation",
|
|
89
|
+
_: 'Open documentation'
|
|
90
|
+
})
|
|
91
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
85
92
|
type: "primary",
|
|
86
93
|
borderRadius: '20vh',
|
|
87
94
|
inverted: true,
|
|
88
95
|
iconType: "documentation",
|
|
89
96
|
onClick: onDocumentationButtonClick,
|
|
90
97
|
px: 3,
|
|
91
|
-
py: 1
|
|
92
|
-
|
|
98
|
+
py: 1,
|
|
99
|
+
ariaLabel: "open documentation"
|
|
100
|
+
}, documentationLabel)) : documentationHref && /*#__PURE__*/React.createElement(DocumentationLink, {
|
|
93
101
|
fontSize: 2,
|
|
94
102
|
iconSize: 14,
|
|
95
103
|
mb: [3, 0],
|
package/lib/Page.js
CHANGED
|
@@ -29,6 +29,8 @@ var _componentIcon = require("@cloudflare/component-icon");
|
|
|
29
29
|
|
|
30
30
|
var _componentButton = require("@cloudflare/component-button");
|
|
31
31
|
|
|
32
|
+
var _componentTooltip = require("@cloudflare/component-tooltip");
|
|
33
|
+
|
|
32
34
|
var _excluded = ["title", "parentPageLabel", "description", "documentationLabel", "documentationHref", "centerHeader", "beta", "testId", "className", "sidebar", "type", "sidebarPosition", "autofocus", "control", "titleRef", "parentPageLabelRef", "children", "navigation", "onDocumentationButtonClick", "documentationAsButton"];
|
|
33
35
|
|
|
34
36
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -103,15 +105,22 @@ var PageHeader = function PageHeader(_ref) {
|
|
|
103
105
|
lineHeight: 1.25,
|
|
104
106
|
fontWeight: 400,
|
|
105
107
|
wordBreak: "break-word"
|
|
106
|
-
}, description), documentationAsButton && !isMobile ? /*#__PURE__*/_react.default.createElement(
|
|
108
|
+
}, description), documentationAsButton && !isMobile ? /*#__PURE__*/_react.default.createElement(_componentTooltip.Tooltip, {
|
|
109
|
+
place: "right",
|
|
110
|
+
message: /*#__PURE__*/_react.default.createElement(_intlReact.Trans, {
|
|
111
|
+
id: "common.open_documentation",
|
|
112
|
+
_: 'Open documentation'
|
|
113
|
+
})
|
|
114
|
+
}, /*#__PURE__*/_react.default.createElement(_componentButton.Button, {
|
|
107
115
|
type: "primary",
|
|
108
116
|
borderRadius: '20vh',
|
|
109
117
|
inverted: true,
|
|
110
118
|
iconType: "documentation",
|
|
111
119
|
onClick: onDocumentationButtonClick,
|
|
112
120
|
px: 3,
|
|
113
|
-
py: 1
|
|
114
|
-
|
|
121
|
+
py: 1,
|
|
122
|
+
ariaLabel: "open documentation"
|
|
123
|
+
}, documentationLabel)) : documentationHref && /*#__PURE__*/_react.default.createElement(_componentLink.DocumentationLink, {
|
|
115
124
|
fontSize: 2,
|
|
116
125
|
iconSize: 14,
|
|
117
126
|
mb: [3, 0],
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudflare/component-page",
|
|
3
3
|
"description": "Cloudflare Page Component",
|
|
4
|
-
"version": "9.3.
|
|
4
|
+
"version": "9.3.4",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
7
7
|
"author": "James Kyle <jkyle@cloudflare.com>",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@cloudflare/component-label": "^5.0.8",
|
|
17
|
-
"@cloudflare/component-link": "^8.1.
|
|
17
|
+
"@cloudflare/component-link": "^8.1.11",
|
|
18
18
|
"@cloudflare/elements": "^3.0.8",
|
|
19
19
|
"@cloudflare/intl-react": "^1.9.80"
|
|
20
20
|
},
|
package/src/Page.tsx
CHANGED
|
@@ -9,6 +9,7 @@ import { DocumentationLink, Link } from '@cloudflare/component-link';
|
|
|
9
9
|
import { useIsMobile } from '@cloudflare/util-responsive';
|
|
10
10
|
import { Icon } from '@cloudflare/component-icon';
|
|
11
11
|
import { Button } from '@cloudflare/component-button';
|
|
12
|
+
import { Tooltip } from '@cloudflare/component-tooltip';
|
|
12
13
|
|
|
13
14
|
type PageWidth = 'narrow' | 'wide' | 'unbounded';
|
|
14
15
|
|
|
@@ -114,17 +115,28 @@ const PageHeader = ({
|
|
|
114
115
|
</P>
|
|
115
116
|
)}
|
|
116
117
|
{documentationAsButton && !isMobile ? (
|
|
117
|
-
<
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
118
|
+
<Tooltip
|
|
119
|
+
place="right"
|
|
120
|
+
message={
|
|
121
|
+
<Trans
|
|
122
|
+
id="common.open_documentation"
|
|
123
|
+
_={'Open documentation'}
|
|
124
|
+
/>
|
|
125
|
+
}
|
|
125
126
|
>
|
|
126
|
-
|
|
127
|
-
|
|
127
|
+
<Button
|
|
128
|
+
type="primary"
|
|
129
|
+
borderRadius={'20vh'}
|
|
130
|
+
inverted
|
|
131
|
+
iconType="documentation"
|
|
132
|
+
onClick={onDocumentationButtonClick}
|
|
133
|
+
px={3}
|
|
134
|
+
py={1}
|
|
135
|
+
ariaLabel="open documentation"
|
|
136
|
+
>
|
|
137
|
+
{documentationLabel}
|
|
138
|
+
</Button>
|
|
139
|
+
</Tooltip>
|
|
128
140
|
) : (
|
|
129
141
|
documentationHref && (
|
|
130
142
|
<DocumentationLink
|