@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.
Files changed (105) hide show
  1. package/lib/common/DeleteDialog.d.ts +1 -0
  2. package/lib/common/DeleteDialog.d.ts.map +1 -1
  3. package/lib/common/DeleteDialog.js +8 -1
  4. package/lib/common/__stories__/Tooltip.stories.js +404 -0
  5. package/lib/common/buttons/__stories__/Button.stories.js +445 -0
  6. package/lib/common/buttons/clearinput/ClearInputButton.js +1 -1
  7. package/lib/common/buttons/delete/__stories__/DeleteButton.stories.js +1 -1
  8. package/lib/common/toolbar/__stories__/DataGridToolbar.stories.js +76 -0
  9. package/lib/common/toolbar/__stories__/Toolbar.stories.js +82 -0
  10. package/lib/dataGrid/__stories__/ClickableRows.stories.js +109 -0
  11. package/lib/dataGrid/__stories__/CrudMoreActionsMenu.stories.js +50 -0
  12. package/lib/dataGrid/__stories__/DataGrid.stories.js +94 -0
  13. package/lib/dataGrid/__stories__/DataGridSingleSelectFilter.stories.js +492 -0
  14. package/lib/error/errorHandler/ErrorHandlerProvider.d.ts +8 -0
  15. package/lib/error/errorHandler/ErrorHandlerProvider.d.ts.map +1 -0
  16. package/lib/error/errorHandler/ErrorHandlerProvider.js +16 -0
  17. package/lib/error/errorboundary/ErrorBoundary.d.ts.map +1 -1
  18. package/lib/error/errorboundary/ErrorBoundary.js +26 -18
  19. package/lib/form/FinalFormInput.d.ts.map +1 -1
  20. package/lib/form/FinalFormInput.js +3 -2
  21. package/lib/form/__stories__/AsyncAutocompleteField.stories.js +660 -0
  22. package/lib/form/__stories__/AsyncSelectField.stories.js +513 -0
  23. package/lib/form/__stories__/Autocomplete.stories.js +188 -0
  24. package/lib/form/__stories__/AutocompleteField.stories.js +48 -0
  25. package/lib/form/__stories__/Checkbox.stories.js +70 -0
  26. package/lib/form/__stories__/CheckboxField.stories.js +87 -0
  27. package/lib/form/__stories__/CheckboxListField.stories.js +172 -0
  28. package/lib/form/__stories__/CustomButtons.stories.js +78 -0
  29. package/lib/form/__stories__/DependentAsyncSelects.stories.js +91 -0
  30. package/lib/form/__stories__/DisableAutoNavigation.stories.js +132 -0
  31. package/lib/form/__stories__/DisabledSubmitIfNotDirty.stories.js +54 -0
  32. package/lib/form/__stories__/FieldContainer.stories.js +87 -0
  33. package/lib/form/__stories__/FinalFormFileSelect.stories.js +155 -0
  34. package/lib/form/__stories__/FormInStack.stories.js +133 -0
  35. package/lib/form/__stories__/FormLayouts.stories.js +174 -0
  36. package/lib/form/__stories__/FormValidation.stories.js +82 -0
  37. package/lib/form/__stories__/Input.stories.js +37 -0
  38. package/lib/form/__stories__/NumberField.stories.js +38 -0
  39. package/lib/form/__stories__/Radio.stories.js +101 -0
  40. package/lib/form/__stories__/RadioGroupField.stories.js +172 -0
  41. package/lib/form/__stories__/RangeInput.stories.js +239 -0
  42. package/lib/form/__stories__/RouterTabs.stories.js +96 -0
  43. package/lib/form/__stories__/RouterTabsInForm.stories.js +73 -0
  44. package/lib/form/__stories__/RouterTabsInFormWithSubroutes.stories.js +96 -0
  45. package/lib/form/__stories__/ScrollToErrorField.stories.js +82 -0
  46. package/lib/form/__stories__/SearchField.stories.js +38 -0
  47. package/lib/form/__stories__/Select.stories.js +187 -0
  48. package/lib/form/__stories__/SelectField.stories.js +100 -0
  49. package/lib/form/__stories__/ShowErrorStrategies.stories.js +107 -0
  50. package/lib/form/__stories__/SingleTextField.stories.js +108 -0
  51. package/lib/form/__stories__/StackInForm.stories.js +53 -0
  52. package/lib/form/__stories__/SubmitErrors.stories.js +90 -0
  53. package/lib/form/__stories__/Switch.stories.js +49 -0
  54. package/lib/form/__stories__/SwitchField.stories.js +87 -0
  55. package/lib/form/__stories__/Tabs.stories.js +78 -0
  56. package/lib/form/__stories__/TextAreaField.stories.js +38 -0
  57. package/lib/form/__stories__/TextField.stories.js +67 -0
  58. package/lib/form/__stories__/ToggleButtonGroupField.stories.js +312 -0
  59. package/lib/form/__stories__/TwoLevelValidation.stories.js +168 -0
  60. package/lib/form/__stories__/Typography.stories.js +71 -0
  61. package/lib/form/file/__stories__/FileDropzone.stories.js +81 -0
  62. package/lib/form/file/__stories__/FileSelect.stories.js +139 -0
  63. package/lib/form/file/__stories__/FileSelectListItem.stories.js +108 -0
  64. package/lib/form/file/__stories__/FileSelectMultipleExamples.stories.js +187 -0
  65. package/lib/helpers/useTopOffset.js +1 -1
  66. package/lib/index.d.ts +1 -0
  67. package/lib/index.d.ts.map +1 -1
  68. package/lib/index.js +1 -0
  69. package/lib/section/__stories__/SectionHeadline.stories.js +71 -0
  70. package/lib/stack/Stack.d.ts.map +1 -1
  71. package/lib/stack/Stack.js +3 -0
  72. package/lib/stack/__stories__/RouterTabsNestedStack.stories.js +51 -0
  73. package/lib/stack/__stories__/Stack.stories.js +14 -0
  74. package/lib/stack/__stories__/StackBackButton.stories.js +50 -0
  75. package/lib/stack/__stories__/StackBreadcrumbs.stories.js +139 -0
  76. package/lib/stack/__stories__/StackBreadcrumbsTabs.stories.js +47 -0
  77. package/lib/stack/__stories__/StackCustomSeparator.stories.js +47 -0
  78. package/lib/stack/__stories__/StackLink.stories.js +41 -0
  79. package/lib/stack/__stories__/StackNested.stories.js +58 -0
  80. package/lib/stack/__stories__/StackNestedOnInitialPage.stories.js +78 -0
  81. package/lib/stack/__stories__/StackNestedOneStack.stories.js +90 -0
  82. package/lib/stack/__stories__/StackPageTitle.stories.js +121 -0
  83. package/lib/stack/__stories__/StackReactNodeTitle.stories.js +54 -0
  84. package/lib/stack/__stories__/StackRefApi.stories.js +56 -0
  85. package/lib/stack/__stories__/StackTableFormQueryAtStack.stories.js +155 -0
  86. package/lib/stack/__stories__/StackTableFormQueryInTable.stories.js +160 -0
  87. package/lib/stack/__stories__/StackUrl.stories.js +66 -0
  88. package/lib/tabs/__stories__/DynamicTabs.stories.js +84 -0
  89. package/lib/tabs/__stories__/NestedStackSwitchWithRouterTabs.stories.js +84 -0
  90. package/lib/tabs/__stories__/OverflowIssues.stories.js +224 -0
  91. package/lib/tabs/__stories__/RouterTabs.stories.js +31 -0
  92. package/lib/tabs/__stories__/RouterTabsInStack.stories.js +74 -0
  93. package/lib/tabs/__stories__/RouterTabsInSubroute.stories.js +68 -0
  94. package/lib/tabs/__stories__/Tabs.stories.js +219 -0
  95. package/lib/theme/componentsTheme/MuiDataGrid.js +1 -1
  96. package/lib/translator/ContentTranslationServiceContext.d.ts +1 -0
  97. package/lib/translator/ContentTranslationServiceContext.d.ts.map +1 -1
  98. package/lib/translator/ContentTranslationServiceProvider.d.ts +1 -1
  99. package/lib/translator/ContentTranslationServiceProvider.d.ts.map +1 -1
  100. package/lib/translator/ContentTranslationServiceProvider.js +4 -2
  101. package/lib/translator/PlainTextTranslationDialog.d.ts +1 -0
  102. package/lib/translator/PlainTextTranslationDialog.d.ts.map +1 -1
  103. package/lib/translator/PlainTextTranslationDialog.js +8 -3
  104. package/lib/translator/__stories__/ContentTranslation.stories.js +104 -0
  105. package/package.json +23 -24
@@ -0,0 +1,445 @@
1
+ import { Add, ArrowRight, Favorite, Wrench } from "@comet/admin-icons";
2
+ import { Box, Chip, Stack } from "@mui/material";
3
+ import { Button } from "../Button";
4
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
5
+ var config = {
6
+ component: Button,
7
+ title: "components/common/buttons/Button"
8
+ };
9
+ export default config;
10
+ export var Default = {
11
+ parameters: {
12
+ layout: "fullscreen"
13
+ },
14
+ args: {
15
+ variant: "primary",
16
+ responsive: false,
17
+ disabled: false,
18
+ startIcon: true,
19
+ endIcon: false
20
+ },
21
+ argTypes: {
22
+ variant: {
23
+ name: "Variant",
24
+ control: "select",
25
+ options: ["primary", "secondary", "outlined", "destructive", "success", "textLight", "textDark"]
26
+ },
27
+ responsive: {
28
+ name: "Responsive",
29
+ control: "boolean"
30
+ },
31
+ disabled: {
32
+ name: "Disabled",
33
+ control: "boolean"
34
+ },
35
+ startIcon: {
36
+ name: "Start Icon",
37
+ control: "boolean"
38
+ },
39
+ endIcon: {
40
+ name: "End Icon",
41
+ control: "boolean"
42
+ }
43
+ },
44
+ render: function render(_ref) {
45
+ var startIcon = _ref.startIcon,
46
+ endIcon = _ref.endIcon,
47
+ disabled = _ref.disabled,
48
+ variant = _ref.variant,
49
+ responsive = _ref.responsive;
50
+ var showDarkBackground = variant === "textLight";
51
+ return /*#__PURE__*/_jsx(Box, {
52
+ py: 10,
53
+ px: 8,
54
+ bgcolor: showDarkBackground ? "#333" : "transparent",
55
+ children: /*#__PURE__*/_jsx(Button, {
56
+ onClick: function onClick() {
57
+ alert("Button clicked");
58
+ },
59
+ startIcon: startIcon ? /*#__PURE__*/_jsx(Wrench, {}) : undefined,
60
+ endIcon: endIcon ? /*#__PURE__*/_jsx(Favorite, {}) : undefined,
61
+ disabled: disabled,
62
+ variant: variant,
63
+ responsive: responsive,
64
+ children: "This is a button"
65
+ })
66
+ });
67
+ }
68
+ };
69
+ export var AllVariants = {
70
+ render: function render() {
71
+ return /*#__PURE__*/_jsxs(Stack, {
72
+ spacing: 10,
73
+ children: [/*#__PURE__*/_jsxs(Stack, {
74
+ direction: "row",
75
+ alignItems: "center",
76
+ spacing: 8,
77
+ children: [/*#__PURE__*/_jsx(Button, {
78
+ children: "Button"
79
+ }), /*#__PURE__*/_jsx(Button, {
80
+ startIcon: /*#__PURE__*/_jsx(ArrowRight, {}),
81
+ children: "Button"
82
+ }), /*#__PURE__*/_jsx(Button, {
83
+ endIcon: /*#__PURE__*/_jsx(ArrowRight, {}),
84
+ children: "Button"
85
+ }), /*#__PURE__*/_jsx(Button, {
86
+ endIcon: /*#__PURE__*/_jsx(Chip, {
87
+ label: "5"
88
+ }),
89
+ children: "Button"
90
+ }), /*#__PURE__*/_jsx(Button, {
91
+ startIcon: /*#__PURE__*/_jsx(ArrowRight, {}),
92
+ endIcon: /*#__PURE__*/_jsx(Chip, {
93
+ label: "5"
94
+ }),
95
+ children: "Button"
96
+ }), /*#__PURE__*/_jsx(Button, {
97
+ endIcon: /*#__PURE__*/_jsxs(_Fragment, {
98
+ children: [/*#__PURE__*/_jsx(ArrowRight, {}), /*#__PURE__*/_jsx(Chip, {
99
+ label: "5"
100
+ })]
101
+ }),
102
+ children: "Button"
103
+ }), /*#__PURE__*/_jsx(Button, {
104
+ children: /*#__PURE__*/_jsx(ArrowRight, {})
105
+ }), /*#__PURE__*/_jsx(Button, {
106
+ endIcon: /*#__PURE__*/_jsx(ArrowRight, {}),
107
+ disabled: true,
108
+ children: "Button"
109
+ })]
110
+ }), /*#__PURE__*/_jsxs(Stack, {
111
+ direction: "row",
112
+ alignItems: "center",
113
+ spacing: 8,
114
+ children: [/*#__PURE__*/_jsx(Button, {
115
+ variant: "secondary",
116
+ children: "Button"
117
+ }), /*#__PURE__*/_jsx(Button, {
118
+ variant: "secondary",
119
+ startIcon: /*#__PURE__*/_jsx(ArrowRight, {}),
120
+ children: "Button"
121
+ }), /*#__PURE__*/_jsx(Button, {
122
+ variant: "secondary",
123
+ endIcon: /*#__PURE__*/_jsx(ArrowRight, {}),
124
+ children: "Button"
125
+ }), /*#__PURE__*/_jsx(Button, {
126
+ variant: "secondary",
127
+ endIcon: /*#__PURE__*/_jsx(Chip, {
128
+ label: "5"
129
+ }),
130
+ children: "Button"
131
+ }), /*#__PURE__*/_jsx(Button, {
132
+ variant: "secondary",
133
+ startIcon: /*#__PURE__*/_jsx(ArrowRight, {}),
134
+ endIcon: /*#__PURE__*/_jsx(Chip, {
135
+ label: "5"
136
+ }),
137
+ children: "Button"
138
+ }), /*#__PURE__*/_jsx(Button, {
139
+ variant: "secondary",
140
+ endIcon: /*#__PURE__*/_jsxs(_Fragment, {
141
+ children: [/*#__PURE__*/_jsx(ArrowRight, {}), /*#__PURE__*/_jsx(Chip, {
142
+ label: "5"
143
+ })]
144
+ }),
145
+ children: "Button"
146
+ }), /*#__PURE__*/_jsx(Button, {
147
+ variant: "secondary",
148
+ children: /*#__PURE__*/_jsx(ArrowRight, {})
149
+ }), /*#__PURE__*/_jsx(Button, {
150
+ variant: "secondary",
151
+ endIcon: /*#__PURE__*/_jsx(ArrowRight, {}),
152
+ disabled: true,
153
+ children: "Button"
154
+ })]
155
+ }), /*#__PURE__*/_jsxs(Stack, {
156
+ direction: "row",
157
+ alignItems: "center",
158
+ spacing: 8,
159
+ children: [/*#__PURE__*/_jsx(Button, {
160
+ variant: "outlined",
161
+ children: "Button"
162
+ }), /*#__PURE__*/_jsx(Button, {
163
+ variant: "outlined",
164
+ startIcon: /*#__PURE__*/_jsx(ArrowRight, {}),
165
+ children: "Button"
166
+ }), /*#__PURE__*/_jsx(Button, {
167
+ variant: "outlined",
168
+ endIcon: /*#__PURE__*/_jsx(ArrowRight, {}),
169
+ children: "Button"
170
+ }), /*#__PURE__*/_jsx(Button, {
171
+ variant: "outlined",
172
+ endIcon: /*#__PURE__*/_jsx(Chip, {
173
+ label: "5"
174
+ }),
175
+ children: "Button"
176
+ }), /*#__PURE__*/_jsx(Button, {
177
+ variant: "outlined",
178
+ startIcon: /*#__PURE__*/_jsx(ArrowRight, {}),
179
+ endIcon: /*#__PURE__*/_jsx(Chip, {
180
+ label: "5"
181
+ }),
182
+ children: "Button"
183
+ }), /*#__PURE__*/_jsx(Button, {
184
+ variant: "outlined",
185
+ endIcon: /*#__PURE__*/_jsxs(_Fragment, {
186
+ children: [/*#__PURE__*/_jsx(ArrowRight, {}), /*#__PURE__*/_jsx(Chip, {
187
+ label: "5"
188
+ })]
189
+ }),
190
+ children: "Button"
191
+ }), /*#__PURE__*/_jsx(Button, {
192
+ variant: "outlined",
193
+ children: /*#__PURE__*/_jsx(ArrowRight, {})
194
+ }), /*#__PURE__*/_jsx(Button, {
195
+ variant: "outlined",
196
+ endIcon: /*#__PURE__*/_jsx(ArrowRight, {}),
197
+ disabled: true,
198
+ children: "Button"
199
+ })]
200
+ }), /*#__PURE__*/_jsxs(Stack, {
201
+ direction: "row",
202
+ alignItems: "center",
203
+ spacing: 8,
204
+ children: [/*#__PURE__*/_jsx(Button, {
205
+ variant: "destructive",
206
+ children: "Button"
207
+ }), /*#__PURE__*/_jsx(Button, {
208
+ variant: "destructive",
209
+ startIcon: /*#__PURE__*/_jsx(ArrowRight, {}),
210
+ children: "Button"
211
+ }), /*#__PURE__*/_jsx(Button, {
212
+ variant: "destructive",
213
+ endIcon: /*#__PURE__*/_jsx(ArrowRight, {}),
214
+ children: "Button"
215
+ }), /*#__PURE__*/_jsx(Button, {
216
+ variant: "destructive",
217
+ endIcon: /*#__PURE__*/_jsx(Chip, {
218
+ label: "5"
219
+ }),
220
+ children: "Button"
221
+ }), /*#__PURE__*/_jsx(Button, {
222
+ variant: "destructive",
223
+ startIcon: /*#__PURE__*/_jsx(ArrowRight, {}),
224
+ endIcon: /*#__PURE__*/_jsx(Chip, {
225
+ label: "5"
226
+ }),
227
+ children: "Button"
228
+ }), /*#__PURE__*/_jsx(Button, {
229
+ variant: "destructive",
230
+ endIcon: /*#__PURE__*/_jsxs(_Fragment, {
231
+ children: [/*#__PURE__*/_jsx(ArrowRight, {}), /*#__PURE__*/_jsx(Chip, {
232
+ label: "5"
233
+ })]
234
+ }),
235
+ children: "Button"
236
+ }), /*#__PURE__*/_jsx(Button, {
237
+ variant: "destructive",
238
+ children: /*#__PURE__*/_jsx(ArrowRight, {})
239
+ }), /*#__PURE__*/_jsx(Button, {
240
+ variant: "destructive",
241
+ endIcon: /*#__PURE__*/_jsx(ArrowRight, {}),
242
+ disabled: true,
243
+ children: "Button"
244
+ })]
245
+ }), /*#__PURE__*/_jsxs(Stack, {
246
+ direction: "row",
247
+ alignItems: "center",
248
+ spacing: 8,
249
+ children: [/*#__PURE__*/_jsx(Button, {
250
+ variant: "success",
251
+ children: "Button"
252
+ }), /*#__PURE__*/_jsx(Button, {
253
+ variant: "success",
254
+ startIcon: /*#__PURE__*/_jsx(ArrowRight, {}),
255
+ children: "Button"
256
+ }), /*#__PURE__*/_jsx(Button, {
257
+ variant: "success",
258
+ endIcon: /*#__PURE__*/_jsx(ArrowRight, {}),
259
+ children: "Button"
260
+ }), /*#__PURE__*/_jsx(Button, {
261
+ variant: "success",
262
+ endIcon: /*#__PURE__*/_jsx(Chip, {
263
+ label: "5"
264
+ }),
265
+ children: "Button"
266
+ }), /*#__PURE__*/_jsx(Button, {
267
+ variant: "success",
268
+ startIcon: /*#__PURE__*/_jsx(ArrowRight, {}),
269
+ endIcon: /*#__PURE__*/_jsx(Chip, {
270
+ label: "5"
271
+ }),
272
+ children: "Button"
273
+ }), /*#__PURE__*/_jsx(Button, {
274
+ variant: "success",
275
+ endIcon: /*#__PURE__*/_jsxs(_Fragment, {
276
+ children: [/*#__PURE__*/_jsx(ArrowRight, {}), /*#__PURE__*/_jsx(Chip, {
277
+ label: "5"
278
+ })]
279
+ }),
280
+ children: "Button"
281
+ }), /*#__PURE__*/_jsx(Button, {
282
+ variant: "success",
283
+ children: /*#__PURE__*/_jsx(ArrowRight, {})
284
+ }), /*#__PURE__*/_jsx(Button, {
285
+ variant: "success",
286
+ endIcon: /*#__PURE__*/_jsx(ArrowRight, {}),
287
+ disabled: true,
288
+ children: "Button"
289
+ })]
290
+ }), /*#__PURE__*/_jsxs(Stack, {
291
+ direction: "row",
292
+ alignItems: "center",
293
+ spacing: 8,
294
+ paddingTop: 8,
295
+ paddingBottom: 8,
296
+ sx: {
297
+ backgroundColor: function backgroundColor(theme) {
298
+ return theme.palette.grey[800];
299
+ }
300
+ },
301
+ children: [/*#__PURE__*/_jsx(Button, {
302
+ variant: "textLight",
303
+ children: "Button"
304
+ }), /*#__PURE__*/_jsx(Button, {
305
+ variant: "textLight",
306
+ startIcon: /*#__PURE__*/_jsx(ArrowRight, {}),
307
+ children: "Button"
308
+ }), /*#__PURE__*/_jsx(Button, {
309
+ variant: "textLight",
310
+ endIcon: /*#__PURE__*/_jsx(ArrowRight, {}),
311
+ children: "Button"
312
+ }), /*#__PURE__*/_jsx(Button, {
313
+ variant: "textLight",
314
+ endIcon: /*#__PURE__*/_jsx(Chip, {
315
+ label: "5"
316
+ }),
317
+ children: "Button"
318
+ }), /*#__PURE__*/_jsx(Button, {
319
+ variant: "textLight",
320
+ startIcon: /*#__PURE__*/_jsx(ArrowRight, {}),
321
+ endIcon: /*#__PURE__*/_jsx(Chip, {
322
+ label: "5"
323
+ }),
324
+ children: "Button"
325
+ }), /*#__PURE__*/_jsx(Button, {
326
+ variant: "textLight",
327
+ endIcon: /*#__PURE__*/_jsxs(_Fragment, {
328
+ children: [/*#__PURE__*/_jsx(ArrowRight, {}), /*#__PURE__*/_jsx(Chip, {
329
+ label: "5"
330
+ })]
331
+ }),
332
+ children: "Button"
333
+ }), /*#__PURE__*/_jsx(Button, {
334
+ variant: "textLight",
335
+ children: /*#__PURE__*/_jsx(ArrowRight, {})
336
+ }), /*#__PURE__*/_jsx(Button, {
337
+ variant: "textLight",
338
+ endIcon: /*#__PURE__*/_jsx(ArrowRight, {}),
339
+ disabled: true,
340
+ children: "Button"
341
+ })]
342
+ }), /*#__PURE__*/_jsxs(Stack, {
343
+ direction: "row",
344
+ alignItems: "center",
345
+ spacing: 8,
346
+ children: [/*#__PURE__*/_jsx(Button, {
347
+ variant: "textDark",
348
+ children: "Button"
349
+ }), /*#__PURE__*/_jsx(Button, {
350
+ variant: "textDark",
351
+ startIcon: /*#__PURE__*/_jsx(ArrowRight, {}),
352
+ children: "Button"
353
+ }), /*#__PURE__*/_jsx(Button, {
354
+ variant: "textDark",
355
+ endIcon: /*#__PURE__*/_jsx(ArrowRight, {}),
356
+ children: "Button"
357
+ }), /*#__PURE__*/_jsx(Button, {
358
+ variant: "textDark",
359
+ endIcon: /*#__PURE__*/_jsx(Chip, {
360
+ label: "5"
361
+ }),
362
+ children: "Button"
363
+ }), /*#__PURE__*/_jsx(Button, {
364
+ variant: "textDark",
365
+ startIcon: /*#__PURE__*/_jsx(ArrowRight, {}),
366
+ endIcon: /*#__PURE__*/_jsx(Chip, {
367
+ label: "5"
368
+ }),
369
+ children: "Button"
370
+ }), /*#__PURE__*/_jsx(Button, {
371
+ variant: "textDark",
372
+ endIcon: /*#__PURE__*/_jsxs(_Fragment, {
373
+ children: [/*#__PURE__*/_jsx(ArrowRight, {}), /*#__PURE__*/_jsx(Chip, {
374
+ label: "5"
375
+ })]
376
+ }),
377
+ children: "Button"
378
+ }), /*#__PURE__*/_jsx(Button, {
379
+ variant: "textDark",
380
+ children: /*#__PURE__*/_jsx(ArrowRight, {})
381
+ }), /*#__PURE__*/_jsx(Button, {
382
+ variant: "textDark",
383
+ endIcon: /*#__PURE__*/_jsx(ArrowRight, {}),
384
+ disabled: true,
385
+ children: "Button"
386
+ })]
387
+ })]
388
+ });
389
+ }
390
+ };
391
+ export var Responsive = {
392
+ args: {
393
+ startIcon: true,
394
+ endIcon: false,
395
+ mobileIcon: "auto",
396
+ mobileBreakpoint: "sm",
397
+ disabled: false
398
+ },
399
+ argTypes: {
400
+ startIcon: {
401
+ name: "Start Icon",
402
+ control: "boolean"
403
+ },
404
+ endIcon: {
405
+ name: "End Icon",
406
+ control: "boolean"
407
+ },
408
+ mobileIcon: {
409
+ name: "Mobile Icon",
410
+ control: "select",
411
+ options: ["auto", "startIcon", "endIcon", "custom"]
412
+ },
413
+ mobileBreakpoint: {
414
+ name: "Mobile Breakpoint",
415
+ control: "select",
416
+ options: ["xs", "sm", "md", "lg", "xl"]
417
+ },
418
+ disabled: {
419
+ name: "Disabled",
420
+ control: "boolean"
421
+ }
422
+ },
423
+ render: function render(_ref2) {
424
+ var startIcon = _ref2.startIcon,
425
+ endIcon = _ref2.endIcon,
426
+ mobileIcon = _ref2.mobileIcon,
427
+ mobileBreakpoint = _ref2.mobileBreakpoint,
428
+ disabled = _ref2.disabled;
429
+ var customMobileIcon = /*#__PURE__*/_jsx(Favorite, {});
430
+ return /*#__PURE__*/_jsx(Stack, {
431
+ direction: "row",
432
+ alignItems: "center",
433
+ spacing: 2,
434
+ children: /*#__PURE__*/_jsx(Button, {
435
+ responsive: true,
436
+ startIcon: startIcon ? /*#__PURE__*/_jsx(Wrench, {}) : undefined,
437
+ endIcon: endIcon ? /*#__PURE__*/_jsx(Add, {}) : undefined,
438
+ mobileIcon: mobileIcon === "custom" ? customMobileIcon : mobileIcon,
439
+ mobileBreakpoint: mobileBreakpoint,
440
+ disabled: disabled,
441
+ children: "This is a responsive button"
442
+ })
443
+ });
444
+ }
445
+ };
@@ -23,7 +23,7 @@ var Root = createComponentSlot(ButtonBase)({
23
23
  slotName: "root"
24
24
  })(function (_ref) {
25
25
  var theme = _ref.theme;
26
- return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n height: 100%;\n width: 40px;\n color: ", ";\n\n ", ":last-child & {\n margin-right: ", ";\n }\n\n ", ":first-child & {\n margin-left: ", ";\n }\n\n &:disabled {\n color: ", ";\n }\n "])), theme.palette.action.active, ".".concat(inputAdornmentClasses.positionEnd), theme.spacing(-2), ".".concat(inputAdornmentClasses.positionStart), theme.spacing(-2), theme.palette.action.disabled);
26
+ return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n height: 100%;\n width: 40px;\n color: ", ";\n\n ", ":last-child & {\n margin-right: ", ";\n }\n\n ", ":first-of-type & {\n margin-left: ", ";\n }\n\n &:disabled {\n color: ", ";\n }\n "])), theme.palette.action.active, ".".concat(inputAdornmentClasses.positionEnd), theme.spacing(-2), ".".concat(inputAdornmentClasses.positionStart), theme.spacing(-2), theme.palette.action.disabled);
27
27
  });
28
28
 
29
29
  /**
@@ -1,7 +1,7 @@
1
1
  import { DeleteButton } from "../DeleteButton";
2
2
  var config = {
3
3
  component: DeleteButton,
4
- title: "common/Buttons/DeleteButton"
4
+ title: "components/common/buttons/delete/DeleteButton"
5
5
  };
6
6
  export default config;
7
7
  export var DeleteButtonStory = {};
@@ -0,0 +1,76 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
6
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
+ import { Button, DataGridToolbar, FillSpace, GridColumnsButton, GridFilterButton, GridToolbarQuickFilter, StackLink, useDataGridRemote, usePersistentColumnState } from "@comet/admin";
8
+ import { Add as AddIcon } from "@comet/admin-icons";
9
+ import { DataGrid as DataGridCommunity } from "@mui/x-data-grid";
10
+ import { DataGridPro } from "@mui/x-data-grid-pro";
11
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
12
+ var data = [{
13
+ id: "1f30a6a0-5b9d-4b25-8307-9e8b4a4d2b1c",
14
+ firstname: "Emily",
15
+ lastname: "Smith"
16
+ }, {
17
+ id: "28b9bdf3-5646-4a22-9449-74112db67b5f",
18
+ firstname: "Daniel",
19
+ lastname: "Johnson"
20
+ }, {
21
+ id: "e60900ec-3c69-4e67-8d78-83a10c7573d3",
22
+ firstname: "Sophia",
23
+ lastname: "Williams"
24
+ }];
25
+ var gridOptions = ["Community", "Pro"];
26
+ export default {
27
+ title: "components/toolbar/DataGridToolbar",
28
+ argTypes: {
29
+ gridVersion: {
30
+ name: "Data Grid Version",
31
+ control: "select",
32
+ options: gridOptions
33
+ }
34
+ },
35
+ args: {
36
+ gridVersion: gridOptions[0]
37
+ }
38
+ };
39
+ export var _DataGridToolbar = {
40
+ render: function render(_ref) {
41
+ var gridVersion = _ref.gridVersion;
42
+ var dataGridProps = _objectSpread(_objectSpread({}, useDataGridRemote()), usePersistentColumnState("FooBar"));
43
+ var columns = [{
44
+ field: "firstname",
45
+ headerName: "First Name",
46
+ width: 150
47
+ }, {
48
+ field: "lastname",
49
+ headerName: "Last Name",
50
+ width: 150
51
+ }];
52
+ var ToolbarSlot = function ToolbarSlot() {
53
+ return /*#__PURE__*/_jsxs(DataGridToolbar, {
54
+ children: [/*#__PURE__*/_jsx(GridToolbarQuickFilter, {}), /*#__PURE__*/_jsx(GridFilterButton, {}), /*#__PURE__*/_jsx(GridColumnsButton, {}), /*#__PURE__*/_jsx(FillSpace, {}), /*#__PURE__*/_jsx(Button, {
55
+ responsive: true,
56
+ startIcon: /*#__PURE__*/_jsx(AddIcon, {}),
57
+ component: StackLink,
58
+ pageName: "add",
59
+ payload: "add",
60
+ children: "Add person"
61
+ })]
62
+ });
63
+ };
64
+ var DataGrid = gridVersion === "Community" ? DataGridCommunity : DataGridPro;
65
+ return /*#__PURE__*/_jsx(DataGrid, _objectSpread(_objectSpread({}, dataGridProps), {}, {
66
+ autoHeight: true,
67
+ columns: columns,
68
+ rows: data,
69
+ slots: {
70
+ toolbar: ToolbarSlot
71
+ },
72
+ showToolbar: true
73
+ }));
74
+ },
75
+ name: "DataGrid Toolbar"
76
+ };
@@ -0,0 +1,82 @@
1
+ import { Button, FillSpace, HelpDialogButton, Stack, StackLink, StackPage, StackSwitch, Toolbar, ToolbarActions, ToolbarAutomaticTitleItem, ToolbarBackButton, ToolbarItem } from "@comet/admin";
2
+ import { ArrowRight, Save } from "@comet/admin-icons";
3
+ import { Box, Chip, Typography } from "@mui/material";
4
+ import { FormattedMessage } from "react-intl";
5
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
6
+ function StackWrapper(_ref) {
7
+ var children = _ref.children;
8
+ return /*#__PURE__*/_jsx(Stack, {
9
+ topLevelTitle: "Stack Root",
10
+ children: /*#__PURE__*/_jsxs(StackSwitch, {
11
+ initialPage: "root",
12
+ children: [/*#__PURE__*/_jsxs(StackPage, {
13
+ name: "root",
14
+ children: [children, /*#__PURE__*/_jsx(StackLink, {
15
+ pageName: "detail",
16
+ payload: "x",
17
+ children: "Go to detail page"
18
+ })]
19
+ }), /*#__PURE__*/_jsx(StackPage, {
20
+ name: "detail",
21
+ title: " Stack Detail",
22
+ children: children
23
+ })]
24
+ })
25
+ });
26
+ }
27
+ function Story() {
28
+ return /*#__PURE__*/_jsxs(Toolbar, {
29
+ children: [/*#__PURE__*/_jsx(ToolbarBackButton, {}), /*#__PURE__*/_jsx(ToolbarAutomaticTitleItem, {}), /*#__PURE__*/_jsx(ToolbarItem, {
30
+ children: /*#__PURE__*/_jsx(Chip, {
31
+ label: "Chip text"
32
+ })
33
+ }), /*#__PURE__*/_jsx(FillSpace, {}), /*#__PURE__*/_jsxs(ToolbarActions, {
34
+ children: [/*#__PURE__*/_jsx(Button, {
35
+ responsive: true,
36
+ startIcon: /*#__PURE__*/_jsx(ArrowRight, {}),
37
+ variant: "outlined",
38
+ children: "Secondary button"
39
+ }), /*#__PURE__*/_jsx(Button, {
40
+ responsive: true,
41
+ startIcon: /*#__PURE__*/_jsx(Save, {}),
42
+ children: "Primary button"
43
+ })]
44
+ })]
45
+ });
46
+ }
47
+ export default {
48
+ title: "components/toolbar/Toolbar"
49
+ };
50
+ export var _Toolbar = function _Toolbar() {
51
+ return /*#__PURE__*/_jsx(StackWrapper, {
52
+ children: /*#__PURE__*/_jsx(Story, {})
53
+ });
54
+ };
55
+ export var ToolbarWithHelp = function ToolbarWithHelp() {
56
+ return /*#__PURE__*/_jsx(Toolbar, {
57
+ scopeIndicator: /*#__PURE__*/_jsx(Chip, {
58
+ label: "Global"
59
+ }),
60
+ topBarActions: /*#__PURE__*/_jsx(HelpDialogButton, {
61
+ dialogTitle: /*#__PURE__*/_jsx(FormattedMessage, {
62
+ id: "story.toolbar.helpDialog.title",
63
+ defaultMessage: "Help"
64
+ }),
65
+ dialogDescription: /*#__PURE__*/_jsxs(_Fragment, {
66
+ children: [/*#__PURE__*/_jsx(Box, {
67
+ sx: {
68
+ width: 150,
69
+ height: 150
70
+ },
71
+ component: "img",
72
+ src: "https://picsum.photos/id/35/300/300"
73
+ }), /*#__PURE__*/_jsx(Typography, {
74
+ children: "This is some helpful text inside the help dialog."
75
+ })]
76
+ })
77
+ }),
78
+ children: /*#__PURE__*/_jsx(ToolbarItem, {
79
+ children: "Some title"
80
+ })
81
+ });
82
+ };