@comet/admin 9.0.0-beta.3 → 9.0.0-beta.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/common/DeleteDialog.d.ts +1 -0
- package/lib/common/DeleteDialog.d.ts.map +1 -1
- package/lib/common/DeleteDialog.js +8 -1
- package/lib/common/__stories__/Tooltip.stories.js +404 -0
- package/lib/common/buttons/__stories__/Button.stories.js +445 -0
- package/lib/common/buttons/clearinput/ClearInputButton.js +1 -1
- package/lib/common/buttons/delete/__stories__/DeleteButton.stories.js +1 -1
- package/lib/common/toolbar/__stories__/DataGridToolbar.stories.js +76 -0
- package/lib/common/toolbar/__stories__/Toolbar.stories.js +82 -0
- package/lib/dataGrid/__stories__/ClickableRows.stories.js +109 -0
- package/lib/dataGrid/__stories__/CrudMoreActionsMenu.stories.js +50 -0
- package/lib/dataGrid/__stories__/DataGrid.stories.js +94 -0
- package/lib/dataGrid/__stories__/DataGridSingleSelectFilter.stories.js +492 -0
- package/lib/error/errorHandler/ErrorHandlerProvider.d.ts +8 -0
- package/lib/error/errorHandler/ErrorHandlerProvider.d.ts.map +1 -0
- package/lib/error/errorHandler/ErrorHandlerProvider.js +16 -0
- package/lib/error/errorboundary/ErrorBoundary.d.ts.map +1 -1
- package/lib/error/errorboundary/ErrorBoundary.js +26 -18
- package/lib/form/FinalFormInput.d.ts.map +1 -1
- package/lib/form/FinalFormInput.js +3 -2
- package/lib/form/__stories__/AsyncAutocompleteField.stories.js +660 -0
- package/lib/form/__stories__/AsyncSelectField.stories.js +513 -0
- package/lib/form/__stories__/Autocomplete.stories.js +188 -0
- package/lib/form/__stories__/AutocompleteField.stories.js +48 -0
- package/lib/form/__stories__/Checkbox.stories.js +70 -0
- package/lib/form/__stories__/CheckboxField.stories.js +87 -0
- package/lib/form/__stories__/CheckboxListField.stories.js +172 -0
- package/lib/form/__stories__/CustomButtons.stories.js +78 -0
- package/lib/form/__stories__/DependentAsyncSelects.stories.js +91 -0
- package/lib/form/__stories__/DisableAutoNavigation.stories.js +132 -0
- package/lib/form/__stories__/DisabledSubmitIfNotDirty.stories.js +54 -0
- package/lib/form/__stories__/FieldContainer.stories.js +87 -0
- package/lib/form/__stories__/FinalFormFileSelect.stories.js +155 -0
- package/lib/form/__stories__/FormInStack.stories.js +133 -0
- package/lib/form/__stories__/FormLayouts.stories.js +174 -0
- package/lib/form/__stories__/FormValidation.stories.js +82 -0
- package/lib/form/__stories__/Input.stories.js +37 -0
- package/lib/form/__stories__/NumberField.stories.js +38 -0
- package/lib/form/__stories__/Radio.stories.js +101 -0
- package/lib/form/__stories__/RadioGroupField.stories.js +172 -0
- package/lib/form/__stories__/RangeInput.stories.js +239 -0
- package/lib/form/__stories__/RouterTabs.stories.js +96 -0
- package/lib/form/__stories__/RouterTabsInForm.stories.js +73 -0
- package/lib/form/__stories__/RouterTabsInFormWithSubroutes.stories.js +96 -0
- package/lib/form/__stories__/ScrollToErrorField.stories.js +82 -0
- package/lib/form/__stories__/SearchField.stories.js +38 -0
- package/lib/form/__stories__/Select.stories.js +187 -0
- package/lib/form/__stories__/SelectField.stories.js +100 -0
- package/lib/form/__stories__/ShowErrorStrategies.stories.js +107 -0
- package/lib/form/__stories__/SingleTextField.stories.js +108 -0
- package/lib/form/__stories__/StackInForm.stories.js +53 -0
- package/lib/form/__stories__/SubmitErrors.stories.js +90 -0
- package/lib/form/__stories__/Switch.stories.js +49 -0
- package/lib/form/__stories__/SwitchField.stories.js +87 -0
- package/lib/form/__stories__/Tabs.stories.js +78 -0
- package/lib/form/__stories__/TextAreaField.stories.js +38 -0
- package/lib/form/__stories__/TextField.stories.js +67 -0
- package/lib/form/__stories__/ToggleButtonGroupField.stories.js +312 -0
- package/lib/form/__stories__/TwoLevelValidation.stories.js +168 -0
- package/lib/form/__stories__/Typography.stories.js +71 -0
- package/lib/form/file/__stories__/FileDropzone.stories.js +81 -0
- package/lib/form/file/__stories__/FileSelect.stories.js +139 -0
- package/lib/form/file/__stories__/FileSelectListItem.stories.js +108 -0
- package/lib/form/file/__stories__/FileSelectMultipleExamples.stories.js +187 -0
- package/lib/helpers/useTopOffset.js +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/section/__stories__/SectionHeadline.stories.js +71 -0
- package/lib/stack/Stack.d.ts.map +1 -1
- package/lib/stack/Stack.js +3 -0
- package/lib/stack/__stories__/RouterTabsNestedStack.stories.js +51 -0
- package/lib/stack/__stories__/Stack.stories.js +14 -0
- package/lib/stack/__stories__/StackBackButton.stories.js +50 -0
- package/lib/stack/__stories__/StackBreadcrumbs.stories.js +139 -0
- package/lib/stack/__stories__/StackBreadcrumbsTabs.stories.js +47 -0
- package/lib/stack/__stories__/StackCustomSeparator.stories.js +47 -0
- package/lib/stack/__stories__/StackLink.stories.js +41 -0
- package/lib/stack/__stories__/StackNested.stories.js +58 -0
- package/lib/stack/__stories__/StackNestedOnInitialPage.stories.js +78 -0
- package/lib/stack/__stories__/StackNestedOneStack.stories.js +90 -0
- package/lib/stack/__stories__/StackPageTitle.stories.js +121 -0
- package/lib/stack/__stories__/StackReactNodeTitle.stories.js +54 -0
- package/lib/stack/__stories__/StackRefApi.stories.js +56 -0
- package/lib/stack/__stories__/StackTableFormQueryAtStack.stories.js +155 -0
- package/lib/stack/__stories__/StackTableFormQueryInTable.stories.js +160 -0
- package/lib/stack/__stories__/StackUrl.stories.js +66 -0
- package/lib/tabs/__stories__/DynamicTabs.stories.js +84 -0
- package/lib/tabs/__stories__/NestedStackSwitchWithRouterTabs.stories.js +84 -0
- package/lib/tabs/__stories__/OverflowIssues.stories.js +224 -0
- package/lib/tabs/__stories__/RouterTabs.stories.js +31 -0
- package/lib/tabs/__stories__/RouterTabsInStack.stories.js +74 -0
- package/lib/tabs/__stories__/RouterTabsInSubroute.stories.js +68 -0
- package/lib/tabs/__stories__/Tabs.stories.js +219 -0
- package/lib/theme/componentsTheme/MuiDataGrid.js +1 -1
- package/lib/translator/ContentTranslationServiceContext.d.ts +1 -0
- package/lib/translator/ContentTranslationServiceContext.d.ts.map +1 -1
- package/lib/translator/ContentTranslationServiceProvider.d.ts +1 -1
- package/lib/translator/ContentTranslationServiceProvider.d.ts.map +1 -1
- package/lib/translator/ContentTranslationServiceProvider.js +4 -2
- package/lib/translator/PlainTextTranslationDialog.d.ts +1 -0
- package/lib/translator/PlainTextTranslationDialog.d.ts.map +1 -1
- package/lib/translator/PlainTextTranslationDialog.js +8 -3
- package/lib/translator/__stories__/ContentTranslation.stories.js +104 -0
- package/package.json +23 -24
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeleteDialog.d.ts","sourceRoot":"","sources":["../../src/common/DeleteDialog.tsx"],"names":[],"mappings":"AAcA,UAAU,iBAAiB;IACvB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IACjC,QAAQ,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9B,QAAQ,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,eAAO,MAAM,YAAY,GAAI,OAAO,iBAAiB,
|
|
1
|
+
{"version":3,"file":"DeleteDialog.d.ts","sourceRoot":"","sources":["../../src/common/DeleteDialog.tsx"],"names":[],"mappings":"AAcA,UAAU,iBAAiB;IACvB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IACjC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9B,QAAQ,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,eAAO,MAAM,YAAY,GAAI,OAAO,iBAAiB,4CA+CpD,CAAC"}
|
|
@@ -17,6 +17,7 @@ export var DeleteDialog = function DeleteDialog(props) {
|
|
|
17
17
|
var dialogOpen = props.dialogOpen,
|
|
18
18
|
_props$deleteType = props.deleteType,
|
|
19
19
|
deleteType = _props$deleteType === void 0 ? "delete" : _props$deleteType,
|
|
20
|
+
deleteCount = props.deleteCount,
|
|
20
21
|
onDelete = props.onDelete,
|
|
21
22
|
onCancel = props.onCancel;
|
|
22
23
|
return /*#__PURE__*/_jsxs(Dialog, {
|
|
@@ -41,7 +42,13 @@ export var DeleteDialog = function DeleteDialog(props) {
|
|
|
41
42
|
},
|
|
42
43
|
children: [/*#__PURE__*/_jsx(WarningSolid, {
|
|
43
44
|
color: "error"
|
|
44
|
-
}), deleteType === "delete" ? /*#__PURE__*/_jsx(FormattedMessage, {
|
|
45
|
+
}), deleteType === "delete" ? deleteCount !== undefined && deleteCount > 1 ? /*#__PURE__*/_jsx(FormattedMessage, {
|
|
46
|
+
id: "comet.table.deleteDialog.contentMultiple",
|
|
47
|
+
defaultMessage: "You are about to delete {count} items permanently.",
|
|
48
|
+
values: {
|
|
49
|
+
count: deleteCount
|
|
50
|
+
}
|
|
51
|
+
}) : /*#__PURE__*/_jsx(FormattedMessage, {
|
|
45
52
|
id: "comet.table.deleteDialog.content",
|
|
46
53
|
defaultMessage: "You are about to delete this item permanently."
|
|
47
54
|
}) : /*#__PURE__*/_jsx(FormattedMessage, {
|
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
4
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
7
|
+
import { Add, StatusErrorSolid, StatusSuccessSolid, StatusWarningSolid } from "@comet/admin-icons";
|
|
8
|
+
import { Box, Chip, Stack, Typography } from "@mui/material";
|
|
9
|
+
import { useEffect, useState } from "react";
|
|
10
|
+
import { Button } from "../buttons/Button";
|
|
11
|
+
import { Tooltip } from "../Tooltip";
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
|
+
var config = {
|
|
14
|
+
component: Tooltip,
|
|
15
|
+
title: "components/common/Tooltip"
|
|
16
|
+
};
|
|
17
|
+
export default config;
|
|
18
|
+
export var IconWithTooltip = {
|
|
19
|
+
render: function render() {
|
|
20
|
+
return /*#__PURE__*/_jsx(Tooltip, {
|
|
21
|
+
title: "Add something",
|
|
22
|
+
children: /*#__PURE__*/_jsx(Add, {})
|
|
23
|
+
});
|
|
24
|
+
},
|
|
25
|
+
name: "Icon with Tooltip"
|
|
26
|
+
};
|
|
27
|
+
export var StatusIndicators = {
|
|
28
|
+
render: function render() {
|
|
29
|
+
return /*#__PURE__*/_jsxs(Stack, {
|
|
30
|
+
py: 5,
|
|
31
|
+
spacing: 5,
|
|
32
|
+
children: [/*#__PURE__*/_jsx(Tooltip, {
|
|
33
|
+
title: "Success variant",
|
|
34
|
+
placement: "top-start",
|
|
35
|
+
color: "success",
|
|
36
|
+
children: /*#__PURE__*/_jsx(StatusSuccessSolid, {
|
|
37
|
+
color: "success"
|
|
38
|
+
})
|
|
39
|
+
}), /*#__PURE__*/_jsx(Tooltip, {
|
|
40
|
+
title: "Warning variant",
|
|
41
|
+
placement: "top-start",
|
|
42
|
+
color: "warning",
|
|
43
|
+
children: /*#__PURE__*/_jsx(StatusWarningSolid, {
|
|
44
|
+
color: "warning"
|
|
45
|
+
})
|
|
46
|
+
}), /*#__PURE__*/_jsx(Tooltip, {
|
|
47
|
+
title: "Error variant",
|
|
48
|
+
placement: "top-start",
|
|
49
|
+
color: "error",
|
|
50
|
+
children: /*#__PURE__*/_jsx(StatusErrorSolid, {
|
|
51
|
+
color: "error"
|
|
52
|
+
})
|
|
53
|
+
})]
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
// Makes it easier to see the light variant of the tooltip
|
|
59
|
+
var lightGrayBackgroundDecorator = function lightGrayBackgroundDecorator(Story) {
|
|
60
|
+
return /*#__PURE__*/_jsx(Box, {
|
|
61
|
+
sx: {
|
|
62
|
+
backgroundColor: "#f0f0f0",
|
|
63
|
+
margin: "-40px -30px",
|
|
64
|
+
padding: "40px 30px"
|
|
65
|
+
},
|
|
66
|
+
children: /*#__PURE__*/_jsx(Story, {})
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
export var StackedTooltipsFromDesign = {
|
|
70
|
+
decorators: [lightGrayBackgroundDecorator],
|
|
71
|
+
render: function render() {
|
|
72
|
+
var _useState = useState(false),
|
|
73
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
74
|
+
showTooltips = _useState2[0],
|
|
75
|
+
setShowTooltips = _useState2[1];
|
|
76
|
+
useEffect(function () {
|
|
77
|
+
setTimeout(function () {
|
|
78
|
+
// Delay showing tooltips to prevent them being rendered in the wrong place due to the underlying element not being rendered properly yet.
|
|
79
|
+
setShowTooltips(true);
|
|
80
|
+
}, 1000);
|
|
81
|
+
}, []);
|
|
82
|
+
return /*#__PURE__*/_jsxs(Stack, {
|
|
83
|
+
pb: 12,
|
|
84
|
+
spacing: 16,
|
|
85
|
+
direction: "row",
|
|
86
|
+
children: [/*#__PURE__*/_jsx(Tooltip, {
|
|
87
|
+
title: "Title",
|
|
88
|
+
description: "Notification Text",
|
|
89
|
+
color: "light",
|
|
90
|
+
placement: "bottom-start",
|
|
91
|
+
open: showTooltips,
|
|
92
|
+
children: /*#__PURE__*/_jsx(Chip, {
|
|
93
|
+
label: "Light",
|
|
94
|
+
sx: {
|
|
95
|
+
width: 140
|
|
96
|
+
}
|
|
97
|
+
})
|
|
98
|
+
}), /*#__PURE__*/_jsx(Tooltip, {
|
|
99
|
+
title: "Title",
|
|
100
|
+
description: "Notification Text",
|
|
101
|
+
color: "dark",
|
|
102
|
+
placement: "bottom-start",
|
|
103
|
+
open: showTooltips,
|
|
104
|
+
children: /*#__PURE__*/_jsx(Chip, {
|
|
105
|
+
label: "Dark",
|
|
106
|
+
sx: {
|
|
107
|
+
width: 140
|
|
108
|
+
}
|
|
109
|
+
})
|
|
110
|
+
})]
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
export var FeedbackTooltipsFromDesign = {
|
|
115
|
+
render: function render() {
|
|
116
|
+
var _useState3 = useState(false),
|
|
117
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
118
|
+
showTooltips = _useState4[0],
|
|
119
|
+
setShowTooltips = _useState4[1];
|
|
120
|
+
useEffect(function () {
|
|
121
|
+
setTimeout(function () {
|
|
122
|
+
// Delay showing tooltips to prevent them being rendered in the wrong place due to the underlying element not being rendered properly yet.
|
|
123
|
+
setShowTooltips(true);
|
|
124
|
+
}, 1000);
|
|
125
|
+
}, []);
|
|
126
|
+
return /*#__PURE__*/_jsxs(Stack, {
|
|
127
|
+
pb: 8,
|
|
128
|
+
spacing: 12,
|
|
129
|
+
direction: "row",
|
|
130
|
+
children: [/*#__PURE__*/_jsx(Tooltip, {
|
|
131
|
+
title: "Notification text",
|
|
132
|
+
color: "dark",
|
|
133
|
+
placement: "bottom-start",
|
|
134
|
+
open: showTooltips,
|
|
135
|
+
children: /*#__PURE__*/_jsx(Chip, {
|
|
136
|
+
label: "Dark",
|
|
137
|
+
sx: {
|
|
138
|
+
width: 70
|
|
139
|
+
}
|
|
140
|
+
})
|
|
141
|
+
}), /*#__PURE__*/_jsx(Tooltip, {
|
|
142
|
+
title: "Notification text",
|
|
143
|
+
color: "success",
|
|
144
|
+
placement: "bottom-start",
|
|
145
|
+
open: showTooltips,
|
|
146
|
+
children: /*#__PURE__*/_jsx(Chip, {
|
|
147
|
+
label: "Success",
|
|
148
|
+
sx: {
|
|
149
|
+
width: 70
|
|
150
|
+
}
|
|
151
|
+
})
|
|
152
|
+
}), /*#__PURE__*/_jsx(Tooltip, {
|
|
153
|
+
title: "Notification text",
|
|
154
|
+
color: "error",
|
|
155
|
+
placement: "bottom-start",
|
|
156
|
+
open: showTooltips,
|
|
157
|
+
children: /*#__PURE__*/_jsx(Chip, {
|
|
158
|
+
label: "Error",
|
|
159
|
+
sx: {
|
|
160
|
+
width: 70
|
|
161
|
+
}
|
|
162
|
+
})
|
|
163
|
+
}), /*#__PURE__*/_jsx(Tooltip, {
|
|
164
|
+
title: "Notification text",
|
|
165
|
+
color: "warning",
|
|
166
|
+
placement: "bottom-start",
|
|
167
|
+
open: showTooltips,
|
|
168
|
+
children: /*#__PURE__*/_jsx(Chip, {
|
|
169
|
+
label: "Warning",
|
|
170
|
+
sx: {
|
|
171
|
+
width: 70
|
|
172
|
+
}
|
|
173
|
+
})
|
|
174
|
+
})]
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* This demonstrates using custom content in tooltips where a simple title and description is not sufficient. <br/>
|
|
181
|
+
* Currently, ther is no obvious correct way to do this, which causes inconsistent styling, depending on how the content is provided.
|
|
182
|
+
*/
|
|
183
|
+
export var TooltipsWithCustomContent = {
|
|
184
|
+
decorators: [lightGrayBackgroundDecorator],
|
|
185
|
+
render: function render() {
|
|
186
|
+
var _useState5 = useState(false),
|
|
187
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
188
|
+
showTooltips = _useState6[0],
|
|
189
|
+
setShowTooltips = _useState6[1];
|
|
190
|
+
useEffect(function () {
|
|
191
|
+
setTimeout(function () {
|
|
192
|
+
// Delay showing tooltips to prevent them being rendered in the wrong place due to the underlying element not being rendered properly yet.
|
|
193
|
+
setShowTooltips(true);
|
|
194
|
+
}, 1000);
|
|
195
|
+
}, []);
|
|
196
|
+
var customElementsContent = /*#__PURE__*/_jsxs(_Fragment, {
|
|
197
|
+
children: [/*#__PURE__*/_jsx(Typography, {
|
|
198
|
+
variant: "subtitle1",
|
|
199
|
+
children: "Title"
|
|
200
|
+
}), /*#__PURE__*/_jsx(Typography, {
|
|
201
|
+
variant: "caption",
|
|
202
|
+
children: "Detail information"
|
|
203
|
+
}), /*#__PURE__*/_jsxs(Box, {
|
|
204
|
+
sx: {
|
|
205
|
+
display: "flex",
|
|
206
|
+
justifyContent: "space-between",
|
|
207
|
+
backgroundColor: "primary.main",
|
|
208
|
+
px: 2,
|
|
209
|
+
py: 1,
|
|
210
|
+
borderRadius: 2,
|
|
211
|
+
marginTop: 1
|
|
212
|
+
},
|
|
213
|
+
children: [/*#__PURE__*/_jsx(Typography, {
|
|
214
|
+
variant: "overline",
|
|
215
|
+
children: "Custom"
|
|
216
|
+
}), /*#__PURE__*/_jsx(Typography, {
|
|
217
|
+
variant: "overline",
|
|
218
|
+
children: "Element"
|
|
219
|
+
})]
|
|
220
|
+
})]
|
|
221
|
+
});
|
|
222
|
+
var imageContent = /*#__PURE__*/_jsx(Box, {
|
|
223
|
+
sx: {
|
|
224
|
+
width: 200,
|
|
225
|
+
height: 100
|
|
226
|
+
},
|
|
227
|
+
component: "img",
|
|
228
|
+
src: "https://picsum.photos/400/200"
|
|
229
|
+
});
|
|
230
|
+
var imageWithDescriptionContent = /*#__PURE__*/_jsxs(Box, {
|
|
231
|
+
sx: {
|
|
232
|
+
display: "flex",
|
|
233
|
+
flexDirection: "column",
|
|
234
|
+
alignItems: "center",
|
|
235
|
+
gap: 1,
|
|
236
|
+
width: 200
|
|
237
|
+
},
|
|
238
|
+
children: [/*#__PURE__*/_jsx(Box, {
|
|
239
|
+
sx: {
|
|
240
|
+
width: 200,
|
|
241
|
+
height: 100
|
|
242
|
+
},
|
|
243
|
+
component: "img",
|
|
244
|
+
src: "https://picsum.photos/400/200"
|
|
245
|
+
}), /*#__PURE__*/_jsx(Typography, {
|
|
246
|
+
variant: "caption",
|
|
247
|
+
sx: {
|
|
248
|
+
textAlign: "center"
|
|
249
|
+
},
|
|
250
|
+
children: "This could be some information about the image above."
|
|
251
|
+
})]
|
|
252
|
+
});
|
|
253
|
+
return /*#__PURE__*/_jsxs(Stack, {
|
|
254
|
+
pb: 32,
|
|
255
|
+
spacing: 24,
|
|
256
|
+
direction: "row",
|
|
257
|
+
children: [/*#__PURE__*/_jsx(Tooltip, {
|
|
258
|
+
customContent: customElementsContent,
|
|
259
|
+
color: "light",
|
|
260
|
+
open: showTooltips,
|
|
261
|
+
children: /*#__PURE__*/_jsx(Chip, {
|
|
262
|
+
label: "Custom elements",
|
|
263
|
+
sx: {
|
|
264
|
+
width: 150
|
|
265
|
+
}
|
|
266
|
+
})
|
|
267
|
+
}), /*#__PURE__*/_jsx(Tooltip, {
|
|
268
|
+
customContent: imageContent,
|
|
269
|
+
color: "light",
|
|
270
|
+
open: showTooltips,
|
|
271
|
+
children: /*#__PURE__*/_jsx(Chip, {
|
|
272
|
+
label: "Image",
|
|
273
|
+
sx: {
|
|
274
|
+
width: 150
|
|
275
|
+
}
|
|
276
|
+
})
|
|
277
|
+
}), /*#__PURE__*/_jsx(Tooltip, {
|
|
278
|
+
customContent: imageWithDescriptionContent,
|
|
279
|
+
color: "light",
|
|
280
|
+
open: showTooltips,
|
|
281
|
+
children: /*#__PURE__*/_jsx(Chip, {
|
|
282
|
+
label: "Image with description",
|
|
283
|
+
sx: {
|
|
284
|
+
width: 150
|
|
285
|
+
}
|
|
286
|
+
})
|
|
287
|
+
})]
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
};
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* This is to test how the focus-behavior works with different tooltip children.
|
|
294
|
+
*/
|
|
295
|
+
export var FocusTest = {
|
|
296
|
+
render: function render() {
|
|
297
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
298
|
+
children: [/*#__PURE__*/_jsx(Typography, {
|
|
299
|
+
variant: "h4",
|
|
300
|
+
children: "Without tooltip (standalone elements)"
|
|
301
|
+
}), /*#__PURE__*/_jsx(Typography, {
|
|
302
|
+
variant: "overline",
|
|
303
|
+
children: "Only the button should be focusable"
|
|
304
|
+
}), /*#__PURE__*/_jsxs(Stack, {
|
|
305
|
+
p: 2,
|
|
306
|
+
mt: 2,
|
|
307
|
+
mb: 8,
|
|
308
|
+
spacing: 12,
|
|
309
|
+
direction: "row",
|
|
310
|
+
alignItems: "center",
|
|
311
|
+
sx: {
|
|
312
|
+
backgroundColor: "#f0f0f0"
|
|
313
|
+
},
|
|
314
|
+
children: [/*#__PURE__*/_jsx(Typography, {
|
|
315
|
+
children: "Typography"
|
|
316
|
+
}), /*#__PURE__*/_jsx(Chip, {
|
|
317
|
+
label: "Chip"
|
|
318
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
319
|
+
children: "Button"
|
|
320
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
321
|
+
children: "Span"
|
|
322
|
+
})]
|
|
323
|
+
}), /*#__PURE__*/_jsx(Typography, {
|
|
324
|
+
variant: "h4",
|
|
325
|
+
children: "With tooltip"
|
|
326
|
+
}), /*#__PURE__*/_jsx(Typography, {
|
|
327
|
+
variant: "overline",
|
|
328
|
+
children: "All elements should be focusable"
|
|
329
|
+
}), /*#__PURE__*/_jsxs(Stack, {
|
|
330
|
+
p: 2,
|
|
331
|
+
mt: 2,
|
|
332
|
+
mb: 8,
|
|
333
|
+
spacing: 12,
|
|
334
|
+
direction: "row",
|
|
335
|
+
alignItems: "center",
|
|
336
|
+
sx: {
|
|
337
|
+
backgroundColor: "#f0f0f0"
|
|
338
|
+
},
|
|
339
|
+
children: [/*#__PURE__*/_jsx(Tooltip, {
|
|
340
|
+
title: "Hello Tooltip",
|
|
341
|
+
children: /*#__PURE__*/_jsx(Typography, {
|
|
342
|
+
children: "Typography"
|
|
343
|
+
})
|
|
344
|
+
}), /*#__PURE__*/_jsx(Tooltip, {
|
|
345
|
+
title: "Hello Tooltip",
|
|
346
|
+
children: /*#__PURE__*/_jsx(Chip, {
|
|
347
|
+
label: "Chip"
|
|
348
|
+
})
|
|
349
|
+
}), /*#__PURE__*/_jsx(Tooltip, {
|
|
350
|
+
title: "Hello Tooltip",
|
|
351
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
352
|
+
children: "Button"
|
|
353
|
+
})
|
|
354
|
+
}), /*#__PURE__*/_jsx(Tooltip, {
|
|
355
|
+
title: "Hello Tooltip",
|
|
356
|
+
children: /*#__PURE__*/_jsx("span", {
|
|
357
|
+
children: "Span"
|
|
358
|
+
})
|
|
359
|
+
})]
|
|
360
|
+
}), /*#__PURE__*/_jsx(Typography, {
|
|
361
|
+
variant: "h4",
|
|
362
|
+
children: "With tooltip and disabled tabindex"
|
|
363
|
+
}), /*#__PURE__*/_jsx(Typography, {
|
|
364
|
+
variant: "overline",
|
|
365
|
+
children: "Nothing should be focusable"
|
|
366
|
+
}), /*#__PURE__*/_jsxs(Stack, {
|
|
367
|
+
p: 2,
|
|
368
|
+
mt: 2,
|
|
369
|
+
mb: 8,
|
|
370
|
+
spacing: 12,
|
|
371
|
+
direction: "row",
|
|
372
|
+
alignItems: "center",
|
|
373
|
+
sx: {
|
|
374
|
+
backgroundColor: "#f0f0f0"
|
|
375
|
+
},
|
|
376
|
+
children: [/*#__PURE__*/_jsx(Tooltip, {
|
|
377
|
+
title: "Hello Tooltip",
|
|
378
|
+
tabIndex: -1,
|
|
379
|
+
children: /*#__PURE__*/_jsx(Typography, {
|
|
380
|
+
children: "Typography"
|
|
381
|
+
})
|
|
382
|
+
}), /*#__PURE__*/_jsx(Tooltip, {
|
|
383
|
+
title: "Hello Tooltip",
|
|
384
|
+
tabIndex: -1,
|
|
385
|
+
children: /*#__PURE__*/_jsx(Chip, {
|
|
386
|
+
label: "Chip"
|
|
387
|
+
})
|
|
388
|
+
}), /*#__PURE__*/_jsx(Tooltip, {
|
|
389
|
+
title: "Hello Tooltip",
|
|
390
|
+
tabIndex: -1,
|
|
391
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
392
|
+
children: "Button"
|
|
393
|
+
})
|
|
394
|
+
}), /*#__PURE__*/_jsx(Tooltip, {
|
|
395
|
+
title: "Hello Tooltip",
|
|
396
|
+
tabIndex: -1,
|
|
397
|
+
children: /*#__PURE__*/_jsx("span", {
|
|
398
|
+
children: "Span"
|
|
399
|
+
})
|
|
400
|
+
})]
|
|
401
|
+
})]
|
|
402
|
+
});
|
|
403
|
+
}
|
|
404
|
+
};
|