@comet/admin 9.0.0-beta.4 → 9.0.0-beta.6

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.
Files changed (67) hide show
  1. package/lib/common/ClearInputAdornment.d.ts.map +1 -1
  2. package/lib/common/ClearInputAdornment.js +6 -2
  3. package/lib/common/DeleteDialog.d.ts +1 -0
  4. package/lib/common/DeleteDialog.d.ts.map +1 -1
  5. package/lib/common/DeleteDialog.js +8 -1
  6. package/lib/common/buttons/clearinput/ClearInputButton.js +1 -1
  7. package/lib/dataGrid/excelExport/generateExcelFile.d.ts.map +1 -1
  8. package/lib/dataGrid/excelExport/generateExcelFile.js +23 -1
  9. package/lib/dateTime/timePicker/TimePicker.d.ts.map +1 -1
  10. package/lib/dateTime/timePicker/TimePicker.js +2 -17
  11. package/lib/dateTime/timeRangePicker/TimeRangePicker.d.ts +71 -0
  12. package/lib/dateTime/timeRangePicker/TimeRangePicker.d.ts.map +1 -0
  13. package/lib/dateTime/timeRangePicker/TimeRangePicker.js +191 -0
  14. package/lib/dateTime/timeRangePickerField/TimeRangePickerField.d.ts +13 -0
  15. package/lib/dateTime/timeRangePickerField/TimeRangePickerField.d.ts.map +1 -0
  16. package/lib/dateTime/timeRangePickerField/TimeRangePickerField.js +31 -0
  17. package/lib/dateTime/utils.d.ts +6 -0
  18. package/lib/dateTime/utils.d.ts.map +1 -1
  19. package/lib/dateTime/utils.js +19 -1
  20. package/lib/{EditDialog.d.ts → editDialog/EditDialog.d.ts} +1 -1
  21. package/lib/editDialog/EditDialog.d.ts.map +1 -0
  22. package/lib/{EditDialog.js → editDialog/EditDialog.js} +5 -5
  23. package/lib/editDialog/EditDialogApiContext.d.ts.map +1 -0
  24. package/lib/form/FinalFormNumberInput.d.ts.map +1 -1
  25. package/lib/form/FinalFormNumberInput.js +2 -3
  26. package/lib/helpers/useTopOffset.js +1 -1
  27. package/lib/index.d.ts +4 -2
  28. package/lib/index.d.ts.map +1 -1
  29. package/lib/index.js +4 -2
  30. package/lib/theme/componentsTheme/MuiDataGrid.js +1 -1
  31. package/package.json +26 -19
  32. package/lib/EditDialog.d.ts.map +0 -1
  33. package/lib/EditDialogApiContext.d.ts.map +0 -1
  34. package/lib/alert/__stories__/Alert.stories.js +0 -152
  35. package/lib/common/__stories__/Tooltip.stories.js +0 -404
  36. package/lib/common/buttons/__stories__/Button.stories.js +0 -445
  37. package/lib/common/buttons/delete/__stories__/DeleteButton.stories.js +0 -8
  38. package/lib/dateTime/datePicker/__stories__/DatePicker.stories.js +0 -214
  39. package/lib/dateTime/datePickerField/__stories__/DatePickerField.stories.js +0 -220
  40. package/lib/dateTime/dateRangePicker/__stories__/DateRangePicker.stories.js +0 -238
  41. package/lib/dateTime/dateRangePickerField/__stories__/DateRangePickerField.stories.js +0 -224
  42. package/lib/dateTime/dateTimePicker/__stories__/DateTimePicker.stories.js +0 -214
  43. package/lib/dateTime/dateTimePickerField/__stories__/DateTimePickerField.stories.js +0 -220
  44. package/lib/dateTime/dateTimeRangePicker/__stories__/DateTimeRangePicker.stories.js +0 -238
  45. package/lib/dateTime/dateTimeRangePickerField/__stories__/DateTimeRangePickerField.stories.js +0 -223
  46. package/lib/dateTime/timePicker/__stories__/TimePicker.stories.js +0 -219
  47. package/lib/dateTime/timePickerField/__stories__/TimePickerField.stories.js +0 -229
  48. package/lib/section/__stories__/SectionHeadline.stories.js +0 -71
  49. package/lib/stack/__stories__/RouterTabsNestedStack.stories.js +0 -51
  50. package/lib/stack/__stories__/Stack.stories.js +0 -14
  51. package/lib/stack/__stories__/StackBackButton.stories.js +0 -50
  52. package/lib/stack/__stories__/StackBreadcrumbs.stories.js +0 -139
  53. package/lib/stack/__stories__/StackBreadcrumbsTabs.stories.js +0 -47
  54. package/lib/stack/__stories__/StackCustomSeparator.stories.js +0 -47
  55. package/lib/stack/__stories__/StackLink.stories.js +0 -41
  56. package/lib/stack/__stories__/StackNested.stories.js +0 -58
  57. package/lib/stack/__stories__/StackNestedOnInitialPage.stories.js +0 -78
  58. package/lib/stack/__stories__/StackNestedOneStack.stories.js +0 -90
  59. package/lib/stack/__stories__/StackPageTitle.stories.js +0 -121
  60. package/lib/stack/__stories__/StackReactNodeTitle.stories.js +0 -54
  61. package/lib/stack/__stories__/StackRefApi.stories.js +0 -56
  62. package/lib/stack/__stories__/StackTableFormQueryAtStack.stories.js +0 -155
  63. package/lib/stack/__stories__/StackTableFormQueryInTable.stories.js +0 -160
  64. package/lib/stack/__stories__/StackUrl.stories.js +0 -66
  65. package/lib/translator/__stories__/ContentTranslation.stories.js +0 -104
  66. /package/lib/{EditDialogApiContext.d.ts → editDialog/EditDialogApiContext.d.ts} +0 -0
  67. /package/lib/{EditDialogApiContext.js → editDialog/EditDialogApiContext.js} +0 -0
@@ -1,404 +0,0 @@
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
- };