@strato-admin/cloudscape 0.1.0 → 0.3.0

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 (231) hide show
  1. package/dist/Admin.d.ts +6 -2
  2. package/dist/Admin.js +14 -8
  3. package/dist/RecordLink.js +5 -4
  4. package/dist/Settings.d.ts +17 -0
  5. package/dist/Settings.js +14 -0
  6. package/dist/button/BulkDeleteButton.d.ts +4 -1
  7. package/dist/button/BulkDeleteButton.js +37 -5
  8. package/dist/button/Button.d.ts +2 -1
  9. package/dist/button/CancelButton.d.ts +6 -0
  10. package/dist/button/CancelButton.js +10 -0
  11. package/dist/button/CreateButton.js +9 -8
  12. package/dist/button/DeleteButton.d.ts +13 -0
  13. package/dist/button/DeleteButton.js +36 -0
  14. package/dist/button/EditButton.d.ts +1 -1
  15. package/dist/button/EditButton.js +10 -10
  16. package/dist/button/SaveButton.js +2 -2
  17. package/dist/button/index.d.ts +2 -0
  18. package/dist/button/index.js +2 -0
  19. package/dist/collection-hooks/interfaces.d.ts +7 -3
  20. package/dist/collection-hooks/useCollection.d.ts +1 -1
  21. package/dist/collection-hooks/useCollection.js +15 -10
  22. package/dist/create/Create.d.ts +9 -17
  23. package/dist/create/Create.js +40 -12
  24. package/dist/create/CreateHeader.d.ts +2 -2
  25. package/dist/create/CreateHeader.js +4 -5
  26. package/dist/defaults.d.ts +6 -0
  27. package/dist/defaults.js +21 -0
  28. package/dist/detail/Detail.d.ts +33 -0
  29. package/dist/detail/Detail.js +22 -0
  30. package/dist/detail/DetailHeader.d.ts +11 -0
  31. package/dist/detail/{ShowHeader.js → DetailHeader.js} +7 -5
  32. package/dist/detail/DetailHub.d.ts +27 -0
  33. package/dist/detail/DetailHub.js +63 -0
  34. package/dist/detail/KeyValuePairs.d.ts +7 -1
  35. package/dist/detail/KeyValuePairs.js +14 -8
  36. package/dist/detail/index.d.ts +3 -2
  37. package/dist/detail/index.js +3 -2
  38. package/dist/edit/Edit.d.ts +8 -19
  39. package/dist/edit/Edit.js +48 -12
  40. package/dist/edit/EditHeader.d.ts +2 -2
  41. package/dist/edit/EditHeader.js +5 -4
  42. package/dist/field/ArrayField.d.ts +26 -10
  43. package/dist/field/ArrayField.js +38 -10
  44. package/dist/field/BadgeField.d.ts +1 -1
  45. package/dist/field/BadgeField.js +1 -1
  46. package/dist/field/BooleanField.d.ts +1 -1
  47. package/dist/field/BooleanField.js +2 -2
  48. package/dist/field/CurrencyField.d.ts +1 -1
  49. package/dist/field/CurrencyField.js +1 -1
  50. package/dist/field/DateField.d.ts +1 -1
  51. package/dist/field/DateField.js +1 -1
  52. package/dist/field/IdField.d.ts +1 -1
  53. package/dist/field/IdField.js +3 -3
  54. package/dist/field/NumberField.d.ts +1 -1
  55. package/dist/field/NumberField.js +1 -1
  56. package/dist/field/ReferenceField.d.ts +1 -1
  57. package/dist/field/ReferenceField.js +4 -2
  58. package/dist/field/ReferenceManyField.d.ts +35 -4
  59. package/dist/field/ReferenceManyField.js +17 -4
  60. package/dist/field/StatusIndicatorField.d.ts +1 -1
  61. package/dist/field/StatusIndicatorField.js +6 -5
  62. package/dist/field/TextField.d.ts +1 -1
  63. package/dist/field/TextField.js +1 -1
  64. package/dist/field/types.d.ts +9 -9
  65. package/dist/form/Form.d.ts +12 -2
  66. package/dist/form/Form.js +10 -16
  67. package/dist/form/index.d.ts +1 -1
  68. package/dist/form/index.js +1 -1
  69. package/dist/hooks/useSchemaFields.d.ts +22 -0
  70. package/dist/hooks/useSchemaFields.js +45 -0
  71. package/dist/i18n/Message.d.ts +15 -0
  72. package/dist/i18n/Message.js +19 -0
  73. package/dist/i18n/RecordMessage.d.ts +14 -0
  74. package/dist/i18n/RecordMessage.js +16 -0
  75. package/dist/i18n/index.d.ts +3 -0
  76. package/dist/i18n/index.js +2 -0
  77. package/dist/i18n/types.d.ts +19 -0
  78. package/dist/i18n/types.js +1 -0
  79. package/dist/index.d.ts +5 -1
  80. package/dist/index.js +5 -1
  81. package/dist/input/ArrayInput.d.ts +33 -0
  82. package/dist/input/{AttributeEditor.js → ArrayInput.js} +18 -11
  83. package/dist/input/AutocompleteInput.d.ts +1 -1
  84. package/dist/input/AutocompleteInput.js +3 -3
  85. package/dist/input/BooleanInput.d.ts +6 -0
  86. package/dist/input/BooleanInput.js +23 -0
  87. package/dist/input/CommonInputProps.d.ts +6 -0
  88. package/dist/input/CommonInputProps.js +6 -0
  89. package/dist/input/FieldTitle.js +4 -4
  90. package/dist/input/FormField.js +12 -3
  91. package/dist/input/FormFieldContext.d.ts +1 -1
  92. package/dist/input/NumberInput.d.ts +1 -1
  93. package/dist/input/NumberInput.js +3 -3
  94. package/dist/input/ReferenceInput.d.ts +1 -1
  95. package/dist/input/ReferenceInput.js +22 -12
  96. package/dist/input/SelectInput.d.ts +1 -1
  97. package/dist/input/SelectInput.js +3 -3
  98. package/dist/input/SliderInput.d.ts +1 -1
  99. package/dist/input/SliderInput.js +4 -4
  100. package/dist/input/TextAreaInput.d.ts +1 -1
  101. package/dist/input/TextAreaInput.js +3 -3
  102. package/dist/input/TextInput.d.ts +1 -1
  103. package/dist/input/TextInput.js +6 -12
  104. package/dist/input/index.d.ts +2 -1
  105. package/dist/input/index.js +2 -1
  106. package/dist/input/types.d.ts +33 -2
  107. package/dist/layout/AppLayout.js +6 -3
  108. package/dist/layout/Notifications.d.ts +1 -0
  109. package/dist/layout/Notifications.js +51 -0
  110. package/dist/layout/Ready.d.ts +6 -0
  111. package/dist/layout/Ready.js +24 -0
  112. package/dist/layout/TopNavigation.d.ts +4 -2
  113. package/dist/layout/TopNavigation.js +7 -7
  114. package/dist/layout/index.d.ts +2 -0
  115. package/dist/layout/index.js +2 -0
  116. package/dist/list/Cards.d.ts +31 -4
  117. package/dist/list/Cards.js +81 -10
  118. package/dist/list/List.d.ts +9 -12
  119. package/dist/list/List.js +41 -11
  120. package/dist/list/Table.d.ts +8 -4
  121. package/dist/list/Table.js +55 -55
  122. package/dist/list/TableHeader.d.ts +2 -2
  123. package/dist/list/TableHeader.js +4 -5
  124. package/dist/theme/ThemeManager.js +1 -1
  125. package/package.json +9 -6
  126. package/src/Admin.tsx +35 -18
  127. package/src/RecordLink.stories.tsx +1 -1
  128. package/src/RecordLink.tsx +5 -4
  129. package/src/Settings.tsx +16 -0
  130. package/src/__mocks__/ra-core.tsx +83 -0
  131. package/src/__mocks__/strato-core.tsx +36 -42
  132. package/src/button/BulkDeleteButton.test.tsx +45 -8
  133. package/src/button/BulkDeleteButton.tsx +75 -12
  134. package/src/button/Button.tsx +31 -2
  135. package/src/button/CancelButton.tsx +20 -0
  136. package/src/button/CreateButton.tsx +12 -10
  137. package/src/button/DeleteButton.tsx +96 -0
  138. package/src/button/EditButton.tsx +13 -12
  139. package/src/button/SaveButton.tsx +2 -3
  140. package/src/button/index.ts +2 -0
  141. package/src/collection-hooks/interfaces.ts +7 -3
  142. package/src/collection-hooks/useCollection.test.ts +115 -2
  143. package/src/collection-hooks/useCollection.ts +15 -10
  144. package/src/create/Create.test.tsx +3 -3
  145. package/src/create/Create.tsx +68 -37
  146. package/src/create/CreateHeader.tsx +6 -10
  147. package/src/defaults.tsx +28 -0
  148. package/src/detail/Detail-CollectionFields.test.tsx +84 -0
  149. package/src/detail/Detail.test.tsx +91 -0
  150. package/src/detail/Detail.tsx +48 -0
  151. package/src/detail/{ShowHeader.test.tsx → DetailHeader.test.tsx} +11 -9
  152. package/src/detail/DetailHeader.tsx +42 -0
  153. package/src/detail/DetailHub.tsx +88 -0
  154. package/src/detail/KeyValuePairs.test.tsx +2 -2
  155. package/src/detail/KeyValuePairs.tsx +25 -18
  156. package/src/detail/index.ts +3 -2
  157. package/src/edit/Edit.test.tsx +7 -5
  158. package/src/edit/Edit.tsx +92 -40
  159. package/src/edit/EditHeader.tsx +7 -5
  160. package/src/field/ArrayField.tsx +57 -11
  161. package/src/field/BadgeField.tsx +2 -3
  162. package/src/field/BooleanField.test.tsx +2 -3
  163. package/src/field/BooleanField.tsx +3 -3
  164. package/src/field/CurrencyField.tsx +1 -1
  165. package/src/field/DateField.tsx +1 -1
  166. package/src/field/IdField.test.tsx +8 -20
  167. package/src/field/IdField.tsx +5 -20
  168. package/src/field/NumberField.tsx +1 -1
  169. package/src/field/ReferenceField.test.tsx +15 -6
  170. package/src/field/ReferenceField.tsx +10 -7
  171. package/src/field/ReferenceManyField.test.tsx +55 -10
  172. package/src/field/ReferenceManyField.tsx +84 -13
  173. package/src/field/StatusIndicatorField.test.tsx +7 -21
  174. package/src/field/StatusIndicatorField.tsx +8 -20
  175. package/src/field/TextField.tsx +1 -1
  176. package/src/field/types.ts +12 -13
  177. package/src/form/Form.test.tsx +8 -4
  178. package/src/form/Form.tsx +24 -19
  179. package/src/form/index.ts +1 -1
  180. package/src/hooks/useSchemaFields.ts +89 -0
  181. package/src/i18n/Message.tsx +22 -0
  182. package/src/i18n/RecordMessage.tsx +22 -0
  183. package/src/i18n/index.ts +3 -0
  184. package/src/i18n/types.ts +19 -0
  185. package/src/index.ts +5 -1
  186. package/src/input/ArrayInput.test.tsx +81 -0
  187. package/src/input/{AttributeEditor.tsx → ArrayInput.tsx} +36 -18
  188. package/src/input/AutocompleteInput.test.tsx +2 -4
  189. package/src/input/AutocompleteInput.tsx +9 -11
  190. package/src/input/BooleanInput.tsx +42 -0
  191. package/src/input/CommonInputProps.tsx +8 -0
  192. package/src/input/FieldTitle.tsx +3 -15
  193. package/src/input/FormField.tsx +78 -67
  194. package/src/input/FormFieldContext.ts +1 -1
  195. package/src/input/NumberInput.tsx +10 -7
  196. package/src/input/ReferenceInput.test.tsx +12 -2
  197. package/src/input/ReferenceInput.tsx +32 -14
  198. package/src/input/SelectInput.tsx +14 -17
  199. package/src/input/SliderInput.test.tsx +2 -3
  200. package/src/input/SliderInput.tsx +48 -38
  201. package/src/input/TextAreaInput.tsx +10 -6
  202. package/src/input/TextInput.test.tsx +2 -4
  203. package/src/input/TextInput.tsx +35 -20
  204. package/src/input/index.ts +2 -1
  205. package/src/input/types.ts +40 -8
  206. package/src/layout/AppLayout.test.tsx +23 -3
  207. package/src/layout/AppLayout.tsx +11 -8
  208. package/src/layout/Notifications.test.tsx +102 -0
  209. package/src/layout/Notifications.tsx +61 -0
  210. package/src/layout/Ready.tsx +123 -0
  211. package/src/layout/TopNavigation.test.tsx +2 -3
  212. package/src/layout/TopNavigation.tsx +9 -8
  213. package/src/layout/index.ts +2 -0
  214. package/src/list/Cards.test.tsx +320 -0
  215. package/src/list/Cards.tsx +146 -16
  216. package/src/list/List.tsx +87 -26
  217. package/src/list/Table.test.tsx +40 -5
  218. package/src/list/Table.tsx +89 -98
  219. package/src/list/TableHeader.test.tsx +15 -11
  220. package/src/list/TableHeader.tsx +6 -8
  221. package/src/theme/ThemeManager.tsx +1 -1
  222. package/dist/__mocks__/strato-core.js +0 -50
  223. package/dist/__mocks__to__delete/strato-core.js +0 -50
  224. package/dist/detail/Show.d.ts +0 -39
  225. package/dist/detail/Show.js +0 -40
  226. package/dist/detail/ShowHeader.d.ts +0 -7
  227. package/dist/input/AttributeEditor.d.ts +0 -25
  228. package/src/detail/Show.test.tsx +0 -96
  229. package/src/detail/Show.tsx +0 -104
  230. package/src/detail/ShowHeader.tsx +0 -35
  231. package/src/input/AttributeEditor.test.tsx +0 -147
package/dist/Admin.d.ts CHANGED
@@ -1,7 +1,11 @@
1
- import { type CoreAdminProps, type AdminChildren } from '@strato-admin/core';
1
+ import React from 'react';
2
+ import { type CoreAdminProps, type AdminChildren } from '@strato-admin/ra-core';
3
+ import { type AdminSettings } from '@strato-admin/core';
2
4
  export interface AdminProps extends CoreAdminProps {
3
5
  children?: AdminChildren;
4
6
  title?: string;
7
+ /** Declarative Admin-level defaults. Pass a <Settings> element. */
8
+ settings?: React.ReactElement<AdminSettings>;
5
9
  }
6
10
  /**
7
11
  * The root component of a Strato Admin application.
@@ -13,5 +17,5 @@ export interface AdminProps extends CoreAdminProps {
13
17
  * <Resource name="posts" list={PostList} />
14
18
  * </Admin>
15
19
  */
16
- export declare const Admin: ({ children, title, layout: Layout, i18nProvider, store, ...props }: AdminProps) => import("react/jsx-runtime").JSX.Element;
20
+ export declare const Admin: ({ children, title, layout: Layout, ready, i18nProvider, store, settings, ...props }: AdminProps) => import("react/jsx-runtime").JSX.Element;
17
21
  export default Admin;
package/dist/Admin.js CHANGED
@@ -1,29 +1,34 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useState, useEffect } from 'react';
3
- import { CoreAdmin, SchemaRegistryProvider, localStorageStore, useLocaleState, registerDefaultResourceComponents, registerFieldInputMapping, } from '@strato-admin/core';
3
+ import { CoreAdmin, localStorageStore, useLocaleState, } from '@strato-admin/ra-core';
4
+ import { SchemaRegistryProvider, registerDefaultResourceComponents, registerFieldInputMapping, SettingsContext, } from '@strato-admin/core';
4
5
  import { icuI18nProvider } from '@strato-admin/i18n';
5
6
  import englishMessages from '@strato-admin/language-en';
6
7
  import AppLayout from './layout/AppLayout';
8
+ import Ready from './layout/Ready';
7
9
  import { List } from './list';
8
10
  import { Create } from './create';
9
11
  import { Edit } from './edit';
10
- import { Show } from './detail';
11
- import { TextField, NumberField, CurrencyField, ReferenceField } from './field';
12
- import { TextInput, NumberInput, ReferenceInput } from './input';
12
+ import { Detail } from './detail';
13
+ import { FRAMEWORK_DEFAULTS } from './defaults';
14
+ import { TextField, NumberField, CurrencyField, ReferenceField, ArrayField, BooleanField } from './field';
15
+ import { TextInput, NumberInput, ReferenceInput, ArrayInput, BooleanInput } from './input';
13
16
  import { I18nProvider, importMessages } from '@cloudscape-design/components/i18n';
14
- // Register Cloudscape themed components as defaults for ResourceSchema.
17
+ // Register Cloudscape themed routing components as defaults for ResourceSchema.
15
18
  // This is done once, here, to avoid circular dependencies at the module level.
16
19
  registerDefaultResourceComponents({
17
20
  list: List,
18
21
  create: Create,
19
22
  edit: Edit,
20
- show: Show,
23
+ show: Detail,
21
24
  });
22
25
  registerFieldInputMapping(new Map([
23
26
  [TextField, TextInput],
24
27
  [NumberField, NumberInput],
25
28
  [CurrencyField, NumberInput],
29
+ [BooleanField, BooleanInput],
26
30
  [ReferenceField, ReferenceInput],
31
+ [ArrayField, ArrayInput],
27
32
  ]));
28
33
  const defaultI18nProvider = icuI18nProvider(() => englishMessages);
29
34
  const defaultStore = localStorageStore();
@@ -63,7 +68,8 @@ const CloudscapeLayout = (props) => {
63
68
  * <Resource name="posts" list={PostList} />
64
69
  * </Admin>
65
70
  */
66
- export const Admin = ({ children, title, layout: Layout = AppLayout, i18nProvider = defaultI18nProvider, store = defaultStore, ...props }) => {
67
- return (_jsx(SchemaRegistryProvider, { children: _jsx(CoreAdmin, { ...props, layout: (layoutProps) => _jsx(CloudscapeLayout, { ...layoutProps, layout: Layout }), title: title, i18nProvider: i18nProvider, store: store, children: children }) }));
71
+ export const Admin = ({ children, title, layout: Layout = AppLayout, ready = Ready, i18nProvider = defaultI18nProvider, store = defaultStore, settings, ...props }) => {
72
+ const mergedSettings = { ...FRAMEWORK_DEFAULTS, ...settings?.props };
73
+ return (_jsx(SettingsContext.Provider, { value: mergedSettings, children: _jsx(SchemaRegistryProvider, { children: _jsx(CoreAdmin, { ...props, layout: (layoutProps) => _jsx(CloudscapeLayout, { ...layoutProps, layout: Layout }), title: title, ready: ready, i18nProvider: i18nProvider, store: store, children: children }) }) }));
68
74
  };
69
75
  export default Admin;
@@ -1,6 +1,7 @@
1
1
  import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
2
  import Link from '@cloudscape-design/components/link';
3
- import { useCreatePath, useResourceContext, useRecordContext } from '@strato-admin/core';
3
+ import { useResourceContext, useRecordContext } from '@strato-admin/ra-core';
4
+ import { useCreatePath } from '@strato-admin/core';
4
5
  import { useNavigate } from 'react-router-dom';
5
6
  const RecordLinkImpl = ({ link, resource, children }) => {
6
7
  const contextResource = useResourceContext();
@@ -16,10 +17,10 @@ const RecordLinkImpl = ({ link, resource, children }) => {
16
17
  href = link(record, finalResource);
17
18
  }
18
19
  else if (link === true) {
19
- href = createPath({ resource: finalResource, id: record.id, type: 'edit' });
20
+ href = createPath({ resource: finalResource, id: record.id, type: 'detail' });
20
21
  }
21
- else if (link === 'edit' || link === 'show') {
22
- href = createPath({ resource: finalResource, id: record.id, type: link });
22
+ else if (link === 'edit' || link === 'detail' || link === 'show') {
23
+ href = createPath({ resource: finalResource, id: record.id, type: link === 'show' ? 'detail' : link });
23
24
  }
24
25
  else if (typeof link === 'string') {
25
26
  href = link;
@@ -0,0 +1,17 @@
1
+ import type { AdminSettings } from '@strato-admin/core';
2
+ /**
3
+ * Declarative configuration for Admin-level defaults.
4
+ * Pass as the `settings` prop on <Admin>.
5
+ *
6
+ * @example
7
+ * <Admin
8
+ * settings={<Settings listComponent={MyTable} deleteSuccessMessage="Deleted!" />}
9
+ * dataProvider={myDataProvider}
10
+ * >
11
+ * <Resource name="products" />
12
+ * </Admin>
13
+ */
14
+ export declare const Settings: {
15
+ (_: AdminSettings): null;
16
+ displayName: string;
17
+ };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Declarative configuration for Admin-level defaults.
3
+ * Pass as the `settings` prop on <Admin>.
4
+ *
5
+ * @example
6
+ * <Admin
7
+ * settings={<Settings listComponent={MyTable} deleteSuccessMessage="Deleted!" />}
8
+ * dataProvider={myDataProvider}
9
+ * >
10
+ * <Resource name="products" />
11
+ * </Admin>
12
+ */
13
+ export const Settings = (_) => null;
14
+ Settings.displayName = 'Settings';
@@ -2,6 +2,9 @@ export interface BulkDeleteButtonProps {
2
2
  label?: string;
3
3
  variant?: 'primary' | 'normal' | 'link';
4
4
  mutationMode?: 'undoable' | 'optimistic' | 'pessimistic';
5
+ successMessage?: string;
6
+ dialogTitle?: string;
7
+ dialogDescription?: string;
5
8
  }
6
- export declare const BulkDeleteButton: ({ label, variant, mutationMode, }: BulkDeleteButtonProps) => import("react/jsx-runtime").JSX.Element | null;
9
+ export declare const BulkDeleteButton: ({ label, variant, mutationMode, successMessage, dialogTitle, dialogDescription, }: BulkDeleteButtonProps) => import("react/jsx-runtime").JSX.Element | null;
7
10
  export default BulkDeleteButton;
@@ -1,17 +1,49 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useBulkDeleteController, useTranslate, useListContext, useResourceDefinition } from '@strato-admin/core';
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useState } from 'react';
3
+ import { useBulkDeleteController, useTranslate, useListContext, useResourceDefinition } from '@strato-admin/ra-core';
4
+ import { useSettingValue } from '@strato-admin/core';
5
+ import Modal from '@cloudscape-design/components/modal';
6
+ import Box from '@cloudscape-design/components/box';
7
+ import SpaceBetween from '@cloudscape-design/components/space-between';
3
8
  import { Button } from './Button';
4
- export const BulkDeleteButton = ({ label, variant = 'normal', mutationMode = 'pessimistic', }) => {
9
+ export const BulkDeleteButton = ({ label, variant = 'normal', mutationMode, successMessage, dialogTitle, dialogDescription, }) => {
5
10
  const translate = useTranslate();
6
11
  const { selectedIds } = useListContext();
7
12
  const { options } = useResourceDefinition();
13
+ const resolve = useSettingValue();
14
+ const rawDefault = resolve(undefined, 'bulkDeleteSuccessMessage');
15
+ const resolvedDefault = typeof rawDefault === 'function' ? rawDefault(selectedIds?.length ?? 0) : rawDefault;
8
16
  const { handleDelete, isPending, isLoading } = useBulkDeleteController({
9
- mutationMode,
17
+ mutationMode: resolve(mutationMode, 'mutationMode'),
18
+ successMessage: successMessage ?? options?.bulkDeleteSuccessMessage ?? resolvedDefault,
10
19
  });
20
+ const [isOpen, setIsOpen] = useState(false);
11
21
  if (options?.canDelete === false) {
12
22
  return null;
13
23
  }
14
24
  const isBusy = isPending || isLoading;
15
- return (_jsx(Button, { variant: variant, onClick: handleDelete, loading: isBusy, disabled: isBusy || !selectedIds || selectedIds.length === 0, children: label || translate('ra.action.delete', { _: 'Delete' }) }));
25
+ const handleConfirm = () => {
26
+ handleDelete();
27
+ setIsOpen(false);
28
+ };
29
+ const handleOpen = () => {
30
+ setIsOpen(true);
31
+ };
32
+ const handleClose = () => {
33
+ setIsOpen(false);
34
+ };
35
+ const defaultTitle = translate('strato.message.bulk_delete_title', {
36
+ smart_count: selectedIds?.length || 0,
37
+ _: `{smart_count, plural, one {Delete this item} other {Delete these # items}}`,
38
+ });
39
+ const defaultDescription = translate('strato.message.bulk_delete_content', {
40
+ smart_count: selectedIds?.length || 0,
41
+ _: `{
42
+ smart_count, plural,
43
+ one {Are you sure you want to delete this item?}
44
+ other {Are you sure you want to delete these # items?}
45
+ }`,
46
+ });
47
+ return (_jsxs(_Fragment, { children: [_jsx(Button, { variant: variant, onClick: handleOpen, loading: isBusy, disabled: isBusy || !selectedIds || selectedIds.length === 0, children: label || translate('strato.action.delete', { _: 'Delete' }) }), _jsx(Modal, { onDismiss: handleClose, visible: isOpen, closeAriaLabel: translate('strato.action.close', { _: 'Close' }), footer: _jsx(Box, { float: "right", children: _jsxs(SpaceBetween, { direction: "horizontal", size: "xs", children: [_jsx(Button, { variant: "link", onClick: handleClose, children: translate('strato.action.cancel', { _: 'Cancel' }) }), _jsx(Button, { variant: "primary", onClick: handleConfirm, loading: isBusy, "data-testid": "confirm-bulk-delete", children: translate('strato.action.confirm', { _: 'Confirm' }) })] }) }), header: dialogTitle || defaultTitle, children: dialogDescription || defaultDescription })] }));
16
48
  };
17
49
  export default BulkDeleteButton;
@@ -1,5 +1,6 @@
1
+ import React from 'react';
1
2
  import { ButtonProps as CloudscapeButtonProps } from '@cloudscape-design/components/button';
2
- export interface ButtonProps extends CloudscapeButtonProps {
3
+ export interface ButtonProps extends Pick<CloudscapeButtonProps, 'variant' | 'iconName' | 'iconSvg' | 'iconAlign' | 'iconAlt' | 'href' | 'target' | 'rel' | 'download' | 'onClick' | 'onFollow' | 'loading' | 'loadingText' | 'disabled' | 'disabledReason' | 'ariaLabel' | 'ariaDescribedby' | 'ariaExpanded' | 'ariaControls' | 'formAction' | 'form' | 'nativeButtonAttributes' | 'nativeAnchorAttributes' | 'wrapText' | 'fullWidth' | 'external'> {
3
4
  children: React.ReactNode;
4
5
  }
5
6
  export declare const Button: ({ children, ...props }: ButtonProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { ButtonProps } from './Button';
2
+ export interface CancelButtonProps extends Omit<ButtonProps, 'children'> {
3
+ label?: string;
4
+ }
5
+ export declare const CancelButton: ({ label, variant, ...props }: CancelButtonProps) => import("react/jsx-runtime").JSX.Element;
6
+ export default CancelButton;
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useTranslate } from '@strato-admin/ra-core';
3
+ import { useNavigate } from 'react-router-dom';
4
+ import { Button } from './Button';
5
+ export const CancelButton = ({ label, variant = 'link', ...props }) => {
6
+ const translate = useTranslate();
7
+ const navigate = useNavigate();
8
+ return (_jsx(Button, { variant: variant, formAction: "none", onClick: () => navigate(-1), ...props, children: label || translate('strato.action.cancel', { _: 'Cancel' }) }));
9
+ };
10
+ export default CancelButton;
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useResourceContext, useTranslate, useCreatePath, useResourceDefinitions } from '@strato-admin/core';
2
+ import { useResourceContext, useTranslate, useResourceDefinitions } from '@strato-admin/ra-core';
3
+ import { useCreatePath } from '@strato-admin/core';
3
4
  import { useNavigate } from 'react-router-dom';
4
5
  import { Button } from './Button';
5
6
  export const CreateButton = ({ label, variant = 'primary', ...props }) => {
@@ -12,13 +13,13 @@ export const CreateButton = ({ label, variant = 'primary', ...props }) => {
12
13
  if (!definition || !definition.hasCreate) {
13
14
  return null;
14
15
  }
15
- const handleClick = () => {
16
- const path = createPath({
17
- resource,
18
- type: 'create',
19
- });
20
- navigate(path);
16
+ const path = createPath({ resource, type: 'create' });
17
+ const handleClick = (e) => {
18
+ if (!e.detail.metaKey && !e.detail.ctrlKey && !e.detail.shiftKey && e.detail.button === 0) {
19
+ e.preventDefault();
20
+ navigate(path);
21
+ }
21
22
  };
22
- return (_jsx(Button, { variant: variant, onClick: handleClick, iconName: "add-plus", ...props, children: label || translate('ra.action.create', { _: 'Create' }) }));
23
+ return (_jsx(Button, { variant: variant, href: path, onClick: handleClick, iconName: "add-plus", ...props, children: label || translate('strato.action.create', { _: 'Create' }) }));
23
24
  };
24
25
  export default CreateButton;
@@ -0,0 +1,13 @@
1
+ import { RaRecord } from '@strato-admin/ra-core';
2
+ export interface DeleteButtonProps {
3
+ label?: string;
4
+ variant?: 'primary' | 'normal' | 'link';
5
+ mutationMode?: 'undoable' | 'optimistic' | 'pessimistic';
6
+ successMessage?: string;
7
+ dialogTitle?: string;
8
+ dialogDescription?: string;
9
+ record?: RaRecord;
10
+ redirect?: string;
11
+ }
12
+ export declare const DeleteButton: ({ label, variant, mutationMode, successMessage, dialogTitle, dialogDescription, record, redirect, }: DeleteButtonProps) => import("react/jsx-runtime").JSX.Element | null;
13
+ export default DeleteButton;
@@ -0,0 +1,36 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useState } from 'react';
3
+ import { useDeleteController, useTranslate, useResourceDefinition } from '@strato-admin/ra-core';
4
+ import { useSettingValue } from '@strato-admin/core';
5
+ import Modal from '@cloudscape-design/components/modal';
6
+ import Box from '@cloudscape-design/components/box';
7
+ import SpaceBetween from '@cloudscape-design/components/space-between';
8
+ import { Button } from './Button';
9
+ export const DeleteButton = ({ label, variant = 'normal', mutationMode, successMessage, dialogTitle, dialogDescription, record, redirect, }) => {
10
+ const translate = useTranslate();
11
+ const { options } = useResourceDefinition();
12
+ const resolve = useSettingValue();
13
+ const { handleDelete, isPending, isLoading } = useDeleteController({
14
+ mutationMode: resolve(mutationMode, 'mutationMode'),
15
+ successMessage: successMessage ?? options?.deleteSuccessMessage ?? resolve(undefined, 'deleteSuccessMessage'),
16
+ record,
17
+ redirect,
18
+ });
19
+ const [isOpen, setIsOpen] = useState(false);
20
+ if (options?.canDelete === false) {
21
+ return null;
22
+ }
23
+ const isBusy = isPending || isLoading;
24
+ const handleConfirm = () => {
25
+ handleDelete();
26
+ setIsOpen(false);
27
+ };
28
+ const defaultTitle = translate('strato.message.delete_title', {
29
+ _: 'Delete this item',
30
+ });
31
+ const defaultDescription = translate('strato.message.delete_content', {
32
+ _: 'Are you sure you want to delete this item?',
33
+ });
34
+ return (_jsxs(_Fragment, { children: [_jsx(Button, { variant: variant, onClick: () => setIsOpen(true), loading: isBusy, disabled: isBusy, "data-testid": "delete-button", children: label || translate('strato.action.delete', { _: 'Delete' }) }), _jsx(Modal, { onDismiss: () => setIsOpen(false), visible: isOpen, closeAriaLabel: translate('strato.action.close', { _: 'Close' }), footer: _jsx(Box, { float: "right", children: _jsxs(SpaceBetween, { direction: "horizontal", size: "xs", children: [_jsx(Button, { variant: "link", onClick: () => setIsOpen(false), children: translate('strato.action.cancel', { _: 'Cancel' }) }), _jsx(Button, { variant: "primary", onClick: handleConfirm, loading: isBusy, "data-testid": "confirm-delete", children: translate('strato.action.confirm', { _: 'Confirm' }) })] }) }), header: dialogTitle || defaultTitle, children: dialogDescription || defaultDescription })] }));
35
+ };
36
+ export default DeleteButton;
@@ -1,4 +1,4 @@
1
- import { RaRecord } from '@strato-admin/core';
1
+ import { RaRecord } from '@strato-admin/ra-core';
2
2
  import { ButtonProps } from './Button';
3
3
  export interface EditButtonProps extends Omit<ButtonProps, 'children'> {
4
4
  label?: string;
@@ -1,8 +1,9 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useResourceContext, useRecordContext, useTranslate, useCreatePath } from '@strato-admin/core';
2
+ import { useResourceContext, useRecordContext, useTranslate } from '@strato-admin/ra-core';
3
+ import { useCreatePath } from '@strato-admin/core';
3
4
  import { useNavigate } from 'react-router-dom';
4
5
  import { Button } from './Button';
5
- export const EditButton = ({ label, record: recordProp, variant = 'primary', ...props }) => {
6
+ export const EditButton = ({ label, record: recordProp, variant = 'normal', ...props }) => {
6
7
  const resource = useResourceContext();
7
8
  const record = useRecordContext(recordProp);
8
9
  const translate = useTranslate();
@@ -11,14 +12,13 @@ export const EditButton = ({ label, record: recordProp, variant = 'primary', ...
11
12
  if (!record) {
12
13
  return null;
13
14
  }
14
- const handleClick = () => {
15
- const path = createPath({
16
- resource,
17
- id: record.id,
18
- type: 'edit',
19
- });
20
- navigate(path);
15
+ const path = createPath({ resource, id: record.id, type: 'edit' });
16
+ const handleClick = (e) => {
17
+ if (!e.detail.metaKey && !e.detail.ctrlKey && !e.detail.shiftKey && e.detail.button === 0) {
18
+ e.preventDefault();
19
+ navigate(path);
20
+ }
21
21
  };
22
- return (_jsx(Button, { variant: variant, onClick: handleClick, ...props, children: label || translate('ra.action.edit', { _: 'Edit' }) }));
22
+ return (_jsx(Button, { variant: variant, href: path, onClick: handleClick, iconName: "edit", ...props, children: label || translate('strato.action.edit', { _: 'Edit' }) }));
23
23
  };
24
24
  export default EditButton;
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useTranslate } from '@strato-admin/core';
2
+ import { useTranslate } from '@strato-admin/ra-core';
3
3
  import { Button } from './Button';
4
4
  export const SaveButton = ({ label, variant = 'primary', ...props }) => {
5
5
  const translate = useTranslate();
6
- return (_jsx(Button, { variant: variant, formAction: "submit", nativeButtonAttributes: { type: 'submit' }, ...props, children: label || translate('ra.action.save', { _: 'Save' }) }));
6
+ return (_jsx(Button, { variant: variant, formAction: "submit", nativeButtonAttributes: { type: 'submit' }, ...props, children: label || translate('strato.action.save', { _: 'Save' }) }));
7
7
  };
8
8
  export default SaveButton;
@@ -1,5 +1,7 @@
1
1
  export * from './Button';
2
2
  export * from './EditButton';
3
3
  export * from './BulkDeleteButton';
4
+ export * from './DeleteButton';
4
5
  export * from './SaveButton';
5
6
  export * from './CreateButton';
7
+ export * from './CancelButton';
@@ -1,5 +1,7 @@
1
1
  export * from './Button';
2
2
  export * from './EditButton';
3
3
  export * from './BulkDeleteButton';
4
+ export * from './DeleteButton';
4
5
  export * from './SaveButton';
5
6
  export * from './CreateButton';
7
+ export * from './CancelButton';
@@ -14,9 +14,13 @@ export interface CollectionPreferences {
14
14
  contentDensity?: 'comfortable' | 'compact';
15
15
  }
16
16
  export interface UseCollectionOptions<_T> {
17
- filtering?: any;
18
- pagination?: any;
19
- sorting?: any;
17
+ /**
18
+ * Set to true when using a client-side data provider where the data array
19
+ * contains ALL records, not just the current page. The hook will slice the
20
+ * array for pagination instead of relying on the server.
21
+ * @default false
22
+ */
23
+ clientSidePagination?: boolean;
20
24
  preferences?: {
21
25
  pageSizeOptions?: ReadonlyArray<{
22
26
  value: number;
@@ -1,3 +1,3 @@
1
- import { RaRecord } from '@strato-admin/core';
1
+ import { RaRecord } from '@strato-admin/ra-core';
2
2
  import { UseCollectionOptions, UseCollectionResult } from './interfaces';
3
3
  export declare function useCollection<T extends RaRecord>(options: UseCollectionOptions<T>): UseCollectionResult<T>;
@@ -1,5 +1,5 @@
1
- import { useState, useMemo } from 'react';
2
- import { useListContext } from '@strato-admin/core';
1
+ import { useState, useMemo, useEffect } from 'react';
2
+ import { useListContext } from '@strato-admin/ra-core';
3
3
  export function useCollection(options) {
4
4
  const { data, // Array of the list records, e.g. [{ id: 123, title: 'hello world' }, { ... }
5
5
  total, // Total number of results for the current filters, excluding pagination. Useful to build the pagination controls, e.g. 23
@@ -22,11 +22,18 @@ export function useCollection(options) {
22
22
  const [wrapLines, setWrapLines] = useState(options.preferences?.wrapLines);
23
23
  const [stripedRows, setStripedRows] = useState(options.preferences?.stripedRows);
24
24
  const [visibleContent, setVisibleContent] = useState(options.preferences?.visibleContent ?? options.preferences?.visibleContentOptions?.map((o) => o.id));
25
- const [contentDisplay, setContentDisplay] = useState(options.preferences?.contentDisplay ?? options.preferences?.contentDisplayOptions?.map((o) => ({ id: o.id, visible: true })));
26
- useMemo(() => {
25
+ const [contentDisplay, setContentDisplay] = useState(options.preferences?.contentDisplay ??
26
+ options.preferences?.contentDisplayOptions?.map((o) => ({ id: o.id, visible: true })));
27
+ useEffect(() => {
27
28
  setVisibleContent(options.preferences?.visibleContent ?? options.preferences?.visibleContentOptions?.map((o) => o.id));
28
- setContentDisplay(options.preferences?.contentDisplay ?? options.preferences?.contentDisplayOptions?.map((o) => ({ id: o.id, visible: true })));
29
- }, [options.preferences?.visibleContent, options.preferences?.visibleContentOptions, options.preferences?.contentDisplay, options.preferences?.contentDisplayOptions]);
29
+ setContentDisplay(options.preferences?.contentDisplay ??
30
+ options.preferences?.contentDisplayOptions?.map((o) => ({ id: o.id, visible: true })));
31
+ }, [
32
+ options.preferences?.visibleContent,
33
+ options.preferences?.visibleContentOptions,
34
+ options.preferences?.contentDisplay,
35
+ options.preferences?.contentDisplayOptions,
36
+ ]);
30
37
  const selectedItems = (selectedIds || []).map((id) => {
31
38
  const item = data?.find((i) => i.id === id);
32
39
  if (item)
@@ -34,15 +41,13 @@ export function useCollection(options) {
34
41
  return { id };
35
42
  });
36
43
  const items = useMemo(() => {
37
- // If it's a client-side list (data contains all records), we need to slice it for pagination.
38
- // We detect this by checking if data.length equals total and if data.length is greater than perPage.
39
- if (data && total === data.length && data.length > (perPage || 0)) {
44
+ if (options.clientSidePagination && data) {
40
45
  const p = page || 1;
41
46
  const pp = perPage || 25;
42
47
  return data.slice((p - 1) * pp, p * pp);
43
48
  }
44
49
  return data;
45
- }, [data, total, page, perPage]);
50
+ }, [data, options.clientSidePagination, page, perPage]);
46
51
  return {
47
52
  items,
48
53
  collectionProps: {
@@ -1,17 +1,15 @@
1
1
  import React from 'react';
2
- import { type RaRecord } from '@strato-admin/core';
3
- export interface CreateProps<RecordType extends RaRecord = RaRecord> {
2
+ import { type RaRecord, type CreateBaseProps, Identifier } from '@strato-admin/ra-core';
3
+ export interface CreateProps<RecordType extends Omit<RaRecord, 'id'> = any, ResultRecordType extends RaRecord = RecordType & {
4
+ id: Identifier;
5
+ }, MutationOptionsError = Error> extends CreateBaseProps<RecordType, ResultRecordType, MutationOptionsError> {
4
6
  children?: React.ReactNode;
5
- inputSchema?: React.ReactNode;
6
- title?: React.ReactNode;
7
+ title?: React.ReactNode | ((record: Partial<RecordType>) => React.ReactNode);
8
+ description?: React.ReactNode | ((record: Partial<RecordType>) => React.ReactNode);
7
9
  actions?: React.ReactNode;
8
- resource?: string;
9
- record?: Partial<RecordType>;
10
- redirect?: any;
11
- transform?: any;
12
- mutationOptions?: any;
13
10
  include?: string[];
14
11
  exclude?: string[];
12
+ saveButtonLabel?: string;
15
13
  }
16
14
  /**
17
15
  * A Create component that provides record context and a Cloudscape Container.
@@ -26,15 +24,9 @@ export interface CreateProps<RecordType extends RaRecord = RaRecord> {
26
24
  * @example
27
25
  * // Using InputSchema from context
28
26
  * <Create include={['name', 'price']} />
29
- *
30
- * @example
31
- * // Passing a custom input schema
32
- * <Create inputSchema={<InputSchema>...</InputSchema>}>
33
- * <Form />
34
- * </Create>
35
27
  */
36
28
  export declare const Create: {
37
- <RecordType extends RaRecord = RaRecord<import("@strato-admin/ra-core").Identifier>>({ children, inputSchema, title, actions, include, exclude, ...props }: CreateProps<RecordType>): import("react/jsx-runtime").JSX.Element;
38
- Header: ({ title, actions, ...props }: import("./CreateHeader").CreateHeaderProps) => import("react/jsx-runtime").JSX.Element;
29
+ <RecordType extends RaRecord = RaRecord<Identifier>>({ children, title, actions, description, include, exclude, redirect, saveButtonLabel, ...props }: CreateProps<RecordType>): import("react/jsx-runtime").JSX.Element;
30
+ Header: ({ title, actions, description, counter, info, variant, headingTagOverride }: import("./CreateHeader").CreateHeaderProps) => import("react/jsx-runtime").JSX.Element;
39
31
  };
40
32
  export default Create;
@@ -1,11 +1,43 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { CreateBase, ResourceSchemaProvider } from '@strato-admin/core';
2
+ import React from 'react';
3
+ import { CreateBase, useTranslate } from '@strato-admin/ra-core';
4
+ import { ResourceSchemaProvider, useResourceSchema, useConstructedPageTitle, useSettingValue, } from '@strato-admin/core';
3
5
  import Container from '@cloudscape-design/components/container';
4
6
  import { CreateHeader } from './CreateHeader';
5
7
  import Form from '../form/Form';
6
- const CreateUI = ({ children, resource, inputSchema, title, actions, include, exclude, }) => {
7
- const finalChildren = children || _jsx(Form, { include: include, exclude: exclude });
8
- return (_jsx(ResourceSchemaProvider, { resource: resource, inputSchema: inputSchema, children: _jsx(Container, { header: _jsx(CreateHeader, { title: title, actions: actions }), children: finalChildren }) }));
8
+ const CreateUI = ({ children, title, actions, description, include, exclude, saveButtonLabel, }) => {
9
+ const { label, createTitle, createDescription } = useResourceSchema();
10
+ const translate = useTranslate();
11
+ const constructedTitle = useConstructedPageTitle('create', label);
12
+ const finalTitle = React.useMemo(() => {
13
+ if (typeof title === 'function')
14
+ return title({});
15
+ if (React.isValidElement(title))
16
+ return title;
17
+ if (title)
18
+ return translate(title);
19
+ if (React.isValidElement(createTitle))
20
+ return createTitle;
21
+ if (createTitle)
22
+ return translate(createTitle);
23
+ return constructedTitle;
24
+ }, [title, createTitle, translate, constructedTitle]);
25
+ const finalDescription = React.useMemo(() => {
26
+ if (typeof description === 'function')
27
+ return description({});
28
+ if (React.isValidElement(description))
29
+ return description;
30
+ if (description)
31
+ return translate(description);
32
+ if (React.isValidElement(createDescription))
33
+ return createDescription;
34
+ if (createDescription)
35
+ return translate(createDescription);
36
+ return undefined;
37
+ }, [description, createDescription, translate]);
38
+ const finalSaveButtonLabel = saveButtonLabel ? translate(saveButtonLabel) : translate('Create');
39
+ const finalChildren = children || _jsx(Form, { include: include, exclude: exclude, saveButtonLabel: finalSaveButtonLabel });
40
+ return (_jsx(Container, { header: _jsx(CreateHeader, { title: finalTitle, description: finalDescription, actions: actions }), children: finalChildren }));
9
41
  };
10
42
  /**
11
43
  * A Create component that provides record context and a Cloudscape Container.
@@ -20,15 +52,11 @@ const CreateUI = ({ children, resource, inputSchema, title, actions, include, ex
20
52
  * @example
21
53
  * // Using InputSchema from context
22
54
  * <Create include={['name', 'price']} />
23
- *
24
- * @example
25
- * // Passing a custom input schema
26
- * <Create inputSchema={<InputSchema>...</InputSchema>}>
27
- * <Form />
28
- * </Create>
29
55
  */
30
- export const Create = ({ children, inputSchema, title, actions, include, exclude, ...props }) => {
31
- return (_jsx(CreateBase, { ...props, children: _jsx(CreateUI, { resource: props.resource, title: title, actions: actions, include: include, exclude: exclude, inputSchema: inputSchema, children: children }) }));
56
+ export const Create = ({ children, title, actions, description, include, exclude, redirect, saveButtonLabel, ...props }) => {
57
+ const resolve = useSettingValue();
58
+ const resolvedRedirect = redirect !== undefined ? redirect : resolve(undefined, 'createRedirect');
59
+ return (_jsx(CreateBase, { redirect: resolvedRedirect, ...props, children: _jsx(ResourceSchemaProvider, { resource: props.resource, children: _jsx(CreateUI, { title: title, actions: actions, description: description, include: include, exclude: exclude, saveButtonLabel: saveButtonLabel, children: children }) }) }));
32
60
  };
33
61
  Create.Header = CreateHeader;
34
62
  export default Create;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { HeaderProps } from '@cloudscape-design/components/header';
3
- export interface CreateHeaderProps extends Omit<HeaderProps, 'children'> {
3
+ export interface CreateHeaderProps extends Pick<HeaderProps, 'variant' | 'counter' | 'actions' | 'description' | 'info' | 'headingTagOverride'> {
4
4
  title?: React.ReactNode;
5
5
  }
6
- export declare const CreateHeader: ({ title, actions, ...props }: CreateHeaderProps) => import("react/jsx-runtime").JSX.Element;
6
+ export declare const CreateHeader: ({ title, actions, description, counter, info, variant, headingTagOverride }: CreateHeaderProps) => import("react/jsx-runtime").JSX.Element;
7
7
  export default CreateHeader;
@@ -1,9 +1,8 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import React from 'react';
3
3
  import Header from '@cloudscape-design/components/header';
4
- import SpaceBetween from '@cloudscape-design/components/space-between';
5
- import { useCreateContext, useTranslate } from '@strato-admin/core';
6
- export const CreateHeader = ({ title, actions, ...props }) => {
4
+ import { useCreateContext, useTranslate } from '@strato-admin/ra-core';
5
+ export const CreateHeader = ({ title, actions, description, counter, info, variant = 'h2', headingTagOverride }) => {
7
6
  const translate = useTranslate();
8
7
  const { defaultTitle } = useCreateContext();
9
8
  const headerTitle = React.useMemo(() => {
@@ -12,7 +11,7 @@ export const CreateHeader = ({ title, actions, ...props }) => {
12
11
  }
13
12
  return defaultTitle;
14
13
  }, [title, defaultTitle, translate]);
15
- const headerActions = actions || (_jsx(SpaceBetween, { direction: "horizontal", size: "xs" }));
16
- return (_jsx(Header, { variant: "h2", ...props, actions: headerActions, children: headerTitle }));
14
+ const headerActions = actions ?? null;
15
+ return (_jsx(Header, { variant: variant, actions: headerActions, description: description, counter: counter, info: info, headingTagOverride: headingTagOverride, children: headerTitle }));
17
16
  };
18
17
  export default CreateHeader;
@@ -0,0 +1,6 @@
1
+ import type { AdminSettings } from '@strato-admin/core';
2
+ /**
3
+ * The framework's last-resort default values for all Admin-level configurable settings.
4
+ * Override any of these via the `settings` prop on <Admin>.
5
+ */
6
+ export declare const FRAMEWORK_DEFAULTS: AdminSettings;