@strapi-community/plugin-better-auth-dashboard 1.0.0-beta.1 → 1.0.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 (46) hide show
  1. package/README.md +0 -3
  2. package/dist/admin/Avatar-CdT7eBCh.js +39 -0
  3. package/dist/admin/Avatar-zlMTAZh3.mjs +40 -0
  4. package/dist/admin/{Root-2FMy-qQg.mjs → Root-CgVBJuoM.mjs} +12 -4
  5. package/dist/admin/{Root-DDi0mtve.js → Root-CsiOnzlB.js} +12 -4
  6. package/dist/admin/cs-C_jSgeON.js +416 -0
  7. package/dist/admin/cs-wtnknvBC.mjs +416 -0
  8. package/dist/admin/de-Cg5HyoCY.js +416 -0
  9. package/dist/admin/de-DnnVdUxk.mjs +416 -0
  10. package/dist/admin/en-B3utEgMT.mjs +416 -0
  11. package/dist/admin/en-Cz1IJEvp.js +416 -0
  12. package/dist/admin/es-CGA0Tslt.js +416 -0
  13. package/dist/admin/es-RoCEriJL.mjs +416 -0
  14. package/dist/admin/fr-Ca74t21t.js +416 -0
  15. package/dist/admin/fr-CtmuSfiQ.mjs +416 -0
  16. package/dist/admin/{index-BHfYu0uA.js → index-BCBu-0nr.js} +65 -10
  17. package/dist/admin/{index-D9CiI8Yr.mjs → index-BI2WIsds.mjs} +73 -18
  18. package/dist/admin/index-CPSoAbZt.js +2321 -0
  19. package/dist/admin/index-D9ttdrT3.js +2716 -0
  20. package/dist/admin/index-DQdn5s8q.js +1184 -0
  21. package/dist/admin/index-DvfwvCj0.mjs +1182 -0
  22. package/dist/admin/index-VyHXoQ6p.mjs +2321 -0
  23. package/dist/admin/index-gFqHlMLP.mjs +2716 -0
  24. package/dist/admin/index.js +1 -1
  25. package/dist/admin/index.mjs +1 -1
  26. package/dist/admin/it-BAB9hDdp.mjs +416 -0
  27. package/dist/admin/it-dYT2_ERV.js +416 -0
  28. package/dist/admin/nl-CVqSbUU9.js +416 -0
  29. package/dist/admin/nl-CYv26PHv.mjs +416 -0
  30. package/dist/admin/pl-Bc0cS2mD.mjs +416 -0
  31. package/dist/admin/pl-HYF4BxRv.js +416 -0
  32. package/dist/admin/pt-DDUGyLtb.js +416 -0
  33. package/dist/admin/pt-DZyyK3EG.mjs +416 -0
  34. package/dist/admin/{useModelSchema-CqOTI7P1.js → useModelSchema-BogQah8f.js} +309 -287
  35. package/dist/admin/{useModelSchema-B2tmzlwQ.mjs → useModelSchema-C6bxNjW4.mjs} +320 -298
  36. package/dist/server/index.js +15 -15
  37. package/dist/server/index.mjs +15 -15
  38. package/package.json +4 -4
  39. package/dist/admin/Avatar-Cvk89aMx.js +0 -67
  40. package/dist/admin/Avatar-DNczJU0i.mjs +0 -66
  41. package/dist/admin/index-BQi_BUi6.mjs +0 -1968
  42. package/dist/admin/index-BV-4M_Fp.js +0 -1970
  43. package/dist/admin/index-CANDPUGD.mjs +0 -1215
  44. package/dist/admin/index-CqR8WpOa.js +0 -1217
  45. package/dist/admin/index-D6ktNZcj.js +0 -1685
  46. package/dist/admin/index-DszX3ibA.mjs +0 -1683
@@ -2,9 +2,10 @@
2
2
  const jsxRuntime = require("react/jsx-runtime");
3
3
  const designSystem = require("@strapi/design-system");
4
4
  const icons = require("@strapi/icons");
5
+ const reactIntl = require("react-intl");
6
+ const index = require("./index-BCBu-0nr.js");
5
7
  const react = require("react");
6
8
  const styled = require("styled-components");
7
- const index = require("./index-BHfYu0uA.js");
8
9
  const admin = require("@strapi/strapi/admin");
9
10
  const reactQuery = require("react-query");
10
11
  const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
@@ -12,23 +13,50 @@ const styled__default = /* @__PURE__ */ _interopDefault(styled);
12
13
  function ConfirmDialog({
13
14
  title,
14
15
  message,
15
- confirmLabel = "Confirm",
16
+ confirmLabel,
16
17
  variant = "danger",
17
18
  loading = false,
18
19
  onConfirm,
19
20
  onCancel
20
21
  }) {
22
+ const { formatMessage } = reactIntl.useIntl();
21
23
  return /* @__PURE__ */ jsxRuntime.jsx(
22
- designSystem.Modal.Root,
24
+ designSystem.Dialog.Root,
23
25
  {
24
26
  defaultOpen: true,
25
27
  onOpenChange: (open) => !open && onCancel(),
26
- children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Modal.Content, { children: [
27
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Modal.Header, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "beta", tag: "h2", children: title }) }),
28
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Modal.Body, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", children: message }) }),
29
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Modal.Footer, { children: [
30
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "tertiary", onClick: onCancel, disabled: loading, children: "Cancel" }),
31
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant, loading, onClick: onConfirm, children: confirmLabel })
28
+ children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Dialog.Content, { children: [
29
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Header, { children: title }),
30
+ /* @__PURE__ */ jsxRuntime.jsx(
31
+ designSystem.Dialog.Body,
32
+ {
33
+ icon: /* @__PURE__ */ jsxRuntime.jsx(
34
+ icons.WarningCircle,
35
+ {
36
+ fill: variant === "danger" ? "danger600" : "primary600"
37
+ }
38
+ ),
39
+ children: message
40
+ }
41
+ ),
42
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Dialog.Footer, { children: [
43
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Cancel, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { fullWidth: true, variant: "tertiary", disabled: loading, children: formatMessage({
44
+ id: index.getTranslation("components.confirmDialog.cancel"),
45
+ defaultMessage: "Cancel"
46
+ }) }) }),
47
+ /* @__PURE__ */ jsxRuntime.jsx(
48
+ designSystem.Button,
49
+ {
50
+ fullWidth: true,
51
+ variant,
52
+ loading,
53
+ onClick: onConfirm,
54
+ children: confirmLabel ?? formatMessage({
55
+ id: index.getTranslation("components.confirmDialog.confirm"),
56
+ defaultMessage: "Confirm"
57
+ })
58
+ }
59
+ )
32
60
  ] })
33
61
  ] })
34
62
  }
@@ -41,238 +69,134 @@ const withContext = (ctx, headers) => ({
41
69
  [DASH_CONTEXT_HEADER]: btoa(JSON.stringify(ctx))
42
70
  }
43
71
  });
44
- const slideIn = styled.keyframes`
45
- from { transform: translateX(100%); opacity: 0.6; }
46
- to { transform: translateX(0); opacity: 1; }
47
- `;
48
- const fadeIn = styled.keyframes`
49
- from { opacity: 0; }
50
- to { opacity: 1; }
51
- `;
52
- const Overlay = styled__default.default.div`
53
- position: absolute;
54
- inset: 0;
55
- background: rgba(33, 33, 52, 0.4);
56
- animation: ${fadeIn} 180ms ease;
57
- `;
58
- const Panel = styled__default.default.div`
59
- position: absolute;
60
- top: 0;
61
- right: 0;
62
- bottom: 0;
63
- width: min(760px, 95vw);
64
- display: flex;
65
- flex-direction: column;
66
- background: white;
67
- box-shadow: -8px 0 40px rgba(33, 33, 52, 0.18);
68
- animation: ${slideIn} 220ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
69
- `;
70
- function Drawer({
71
- title,
72
- children,
73
- footer,
74
- onClose,
75
- "data-testid": testId
76
- }) {
77
- react.useEffect(() => {
78
- const prev = document.body.style.overflow;
79
- document.body.style.overflow = "hidden";
80
- return () => {
81
- document.body.style.overflow = prev;
82
- };
83
- }, []);
84
- react.useEffect(() => {
85
- const handler = (e) => {
86
- if (e.key === "Escape") onClose();
87
- };
88
- document.addEventListener("keydown", handler);
89
- return () => document.removeEventListener("keydown", handler);
90
- }, [onClose]);
91
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Portal, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { position: "fixed", inset: 0, zIndex: 200 }, children: [
92
- /* @__PURE__ */ jsxRuntime.jsx(Overlay, { onClick: onClose, "aria-hidden": "true" }),
93
- /* @__PURE__ */ jsxRuntime.jsxs(Panel, { "data-testid": testId, children: [
94
- /* @__PURE__ */ jsxRuntime.jsxs(
95
- designSystem.Flex,
96
- {
97
- justifyContent: "space-between",
98
- alignItems: "center",
99
- paddingTop: 5,
100
- paddingBottom: 5,
101
- paddingLeft: 6,
102
- paddingRight: 6,
103
- borderColor: "neutral150",
104
- borderStyle: "solid",
105
- borderWidth: "0 0 1px 0",
106
- style: { flexShrink: 0 },
107
- children: [
108
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "beta", tag: "h2", children: title }),
109
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.IconButton, { label: "Close panel", onClick: onClose, children: /* @__PURE__ */ jsxRuntime.jsx(icons.Cross, {}) })
110
- ]
111
- }
112
- ),
113
- /* @__PURE__ */ jsxRuntime.jsx(
114
- designSystem.Box,
115
- {
116
- paddingTop: 6,
117
- paddingBottom: 6,
118
- paddingLeft: 6,
119
- paddingRight: 6,
120
- style: { flex: 1, overflowY: "auto" },
121
- children
122
- }
123
- ),
124
- footer && /* @__PURE__ */ jsxRuntime.jsx(
125
- designSystem.Flex,
126
- {
127
- justifyContent: "flex-end",
128
- gap: 2,
129
- paddingTop: 4,
130
- paddingBottom: 4,
131
- paddingLeft: 6,
132
- paddingRight: 6,
133
- borderColor: "neutral150",
134
- borderStyle: "solid",
135
- borderWidth: "1px 0 0 0",
136
- style: { flexShrink: 0 },
137
- children: footer
138
- }
139
- )
140
- ] })
141
- ] }) });
142
- }
143
- const FormSection = styled__default.default.div`
144
- width: 100%;
145
- background: #f6f6f9;
146
- border-radius: 8px;
147
- padding: 16px 20px;
148
- display: flex;
149
- flex-direction: column;
150
- gap: 14px;
151
- `;
152
- const EditLayout = styled__default.default.div`
153
- display: grid;
154
- grid-template-columns: minmax(0, 1fr) 256px;
155
- gap: 28px;
156
- align-items: start;
157
- padding-top: 24px;
158
- `;
159
- const EditSidebar = styled__default.default.div`
160
- display: flex;
161
- flex-direction: column;
162
- gap: 20px;
163
- position: sticky;
164
- top: 0;
165
- `;
166
- const SectionLabel = styled__default.default.p`
167
- font-size: 11px;
168
- font-weight: 700;
169
- color: #8e8ea9;
170
- text-transform: uppercase;
171
- letter-spacing: 0.05em;
172
- margin: 0 0 4px;
173
- `;
174
- styled__default.default.div`
175
- background: #f6f6f9;
176
- border-radius: 8px;
177
- padding: 16px;
178
- display: grid;
179
- grid-template-columns: 1fr 1fr;
180
- gap: 16px;
181
- `;
182
- const MetaItem = styled__default.default.div`
183
- display: flex;
184
- flex-direction: column;
185
- gap: 4px;
186
- `;
187
- const MetaKey = styled__default.default.span`
188
- font-size: 11px;
189
- font-weight: 600;
190
- color: #8e8ea9;
191
- text-transform: uppercase;
192
- letter-spacing: 0.03em;
193
- `;
194
- const MetaVal = styled__default.default.span`
195
- font-size: 13px;
196
- color: #32324d;
197
- `;
198
- const MonoChip = styled__default.default.code`
199
- display: inline;
200
- font-size: 11px;
201
- color: #4945ff;
72
+ const FormSection = (props) => /* @__PURE__ */ jsxRuntime.jsx(
73
+ designSystem.Flex,
74
+ {
75
+ direction: "column",
76
+ alignItems: "stretch",
77
+ gap: 4,
78
+ width: "100%",
79
+ background: "neutral100",
80
+ hasRadius: true,
81
+ paddingTop: 4,
82
+ paddingBottom: 4,
83
+ paddingLeft: 5,
84
+ paddingRight: 5,
85
+ ...props
86
+ }
87
+ );
88
+ const EditLayout = ({ children }) => /* @__PURE__ */ jsxRuntime.jsx(
89
+ designSystem.Grid.Root,
90
+ {
91
+ gap: 6,
92
+ paddingTop: 6,
93
+ style: {
94
+ gridTemplateColumns: "minmax(0, 1fr) 25.6rem",
95
+ alignItems: "start"
96
+ },
97
+ children
98
+ }
99
+ );
100
+ const EditSidebar = ({ children }) => /* @__PURE__ */ jsxRuntime.jsx(
101
+ designSystem.Flex,
102
+ {
103
+ direction: "column",
104
+ alignItems: "stretch",
105
+ gap: 5,
106
+ position: "sticky",
107
+ top: 0,
108
+ children
109
+ }
110
+ );
111
+ const SectionLabel = (props) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", textColor: "neutral600", tag: "p", ...props });
112
+ const MetaItem = (props) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", alignItems: "flex-start", gap: 1, ...props });
113
+ const MetaKey = (props) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", textColor: "neutral600", ...props });
114
+ const MetaVal = (props) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", textColor: "neutral800", ...props });
115
+ const Code = styled__default.default(designSystem.Typography)`
202
116
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
203
117
  word-break: break-all;
204
- background: #f0f0ff;
205
- padding: 2px 6px;
206
- border-radius: 3px;
207
- `;
208
- const ProviderBadge = styled__default.default.span`
209
- display: inline-flex;
210
- align-items: center;
211
- padding: 2px 8px;
212
- background: #f0f0ff;
213
- border: 1px solid #d9d8ff;
214
- border-radius: 4px;
215
- font-size: 12px;
216
- font-weight: 600;
217
- color: #4945ff;
218
- text-transform: capitalize;
219
- `;
220
- const WarnCard = styled__default.default.div`
221
- background: #fcecea;
222
- border: 1px solid #f5c0b8;
223
- border-radius: 8px;
224
- padding: 14px 16px;
225
- display: flex;
226
- flex-direction: column;
227
- gap: 4px;
228
- `;
229
- styled__default.default.div`
230
- background: #eafbe7;
231
- border: 1px solid #c6efbd;
232
- border-radius: 8px;
233
- padding: 14px 16px;
234
- `;
235
- const PreviewPill = styled__default.default.div`
236
- display: inline-flex;
237
- align-items: center;
238
- gap: 6px;
239
- padding: 6px 12px;
240
- background: #fff3d3;
241
- border: 1px solid #f5d97f;
242
- border-radius: 6px;
243
- font-size: 12px;
244
- font-weight: 500;
245
- color: #8e6a00;
246
- width: fit-content;
247
- `;
248
- const AccountRow = styled__default.default.div`
249
- width: 100%;
250
- display: flex;
251
- align-items: center;
252
- justify-content: space-between;
253
- padding: 10px 14px;
254
- background: white;
255
- border: 1px solid #dcdce4;
256
- border-radius: 8px;
257
- gap: 12px;
258
- `;
259
- const DangerRow = styled__default.default(AccountRow)`
260
- background: #fef8f8;
261
- border-color: #f5c0b8;
262
- `;
263
- const RoleBadge = styled__default.default.span`
264
- display: inline-flex;
265
- align-items: center;
266
- padding: 2px 8px;
267
- border-radius: 4px;
268
- font-size: 11px;
269
- font-weight: 600;
270
- text-transform: capitalize;
271
- background: ${(p) => p.$role === "owner" ? "#f0f0ff" : p.$role === "admin" ? "#eafbe7" : "#f5f5f9"};
272
- border: 1px solid
273
- ${(p) => p.$role === "owner" ? "#d9d8ff" : p.$role === "admin" ? "#c6efbd" : "#dcdce4"};
274
- color: ${(p) => p.$role === "owner" ? "#4945ff" : p.$role === "admin" ? "#2e8044" : "#666687"};
275
118
  `;
119
+ const MonoChip = ({ children }) => /* @__PURE__ */ jsxRuntime.jsx(
120
+ designSystem.Box,
121
+ {
122
+ background: "primary100",
123
+ borderColor: "primary200",
124
+ borderStyle: "solid",
125
+ borderWidth: "1px",
126
+ hasRadius: true,
127
+ paddingLeft: 2,
128
+ paddingRight: 2,
129
+ paddingTop: 1,
130
+ paddingBottom: 1,
131
+ children: /* @__PURE__ */ jsxRuntime.jsx(Code, { variant: "pi", textColor: "primary600", children })
132
+ }
133
+ );
134
+ const ProviderBadge = ({ children }) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { variant: "primary", children });
135
+ const WarnCard = ({ children }) => /* @__PURE__ */ jsxRuntime.jsx(
136
+ designSystem.Flex,
137
+ {
138
+ direction: "column",
139
+ alignItems: "flex-start",
140
+ gap: 1,
141
+ background: "danger100",
142
+ borderColor: "danger200",
143
+ borderStyle: "solid",
144
+ borderWidth: "1px",
145
+ hasRadius: true,
146
+ padding: 4,
147
+ children
148
+ }
149
+ );
150
+ const PreviewPill = ({ children }) => /* @__PURE__ */ jsxRuntime.jsxs(
151
+ designSystem.Flex,
152
+ {
153
+ gap: 2,
154
+ background: "warning100",
155
+ borderColor: "warning200",
156
+ borderStyle: "solid",
157
+ borderWidth: "1px",
158
+ hasRadius: true,
159
+ paddingTop: 2,
160
+ paddingBottom: 2,
161
+ paddingLeft: 3,
162
+ paddingRight: 3,
163
+ width: "fit-content",
164
+ children: [
165
+ /* @__PURE__ */ jsxRuntime.jsx(icons.Clock, { fill: "warning700", width: "1.2rem", height: "1.2rem" }),
166
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "semiBold", textColor: "warning700", children })
167
+ ]
168
+ }
169
+ );
170
+ const AccountRow = (props) => /* @__PURE__ */ jsxRuntime.jsx(
171
+ designSystem.Flex,
172
+ {
173
+ width: "100%",
174
+ justifyContent: "space-between",
175
+ gap: 3,
176
+ background: "neutral0",
177
+ borderColor: "neutral200",
178
+ borderStyle: "solid",
179
+ borderWidth: "1px",
180
+ hasRadius: true,
181
+ paddingTop: 3,
182
+ paddingBottom: 3,
183
+ paddingLeft: 4,
184
+ paddingRight: 4,
185
+ ...props
186
+ }
187
+ );
188
+ const DangerRow = (props) => /* @__PURE__ */ jsxRuntime.jsx(AccountRow, { background: "danger100", borderColor: "danger200", ...props });
189
+ const RoleBadge = ({
190
+ memberRole,
191
+ children
192
+ }) => /* @__PURE__ */ jsxRuntime.jsx(
193
+ designSystem.Badge,
194
+ {
195
+ size: "S",
196
+ variant: memberRole === "owner" ? "primary" : memberRole === "admin" ? "success" : "neutral",
197
+ children
198
+ }
199
+ );
276
200
  function MediaPickerField({
277
201
  label,
278
202
  value,
@@ -282,6 +206,7 @@ function MediaPickerField({
282
206
  name,
283
207
  required
284
208
  }) {
209
+ const { formatMessage } = reactIntl.useIntl();
285
210
  const [showMedia, setShowMedia] = react.useState(false);
286
211
  const MediaLibraryDialog = index.getMediaLibraryComponent();
287
212
  const handleSelect = (assets) => {
@@ -295,15 +220,14 @@ function MediaPickerField({
295
220
  /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { style: { width: "100%" }, hint, required, children: [
296
221
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: label }),
297
222
  /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, alignItems: "center", children: [
298
- /* @__PURE__ */ jsxRuntime.jsx("div", { style: { flex: 1, minWidth: 0 }, children: /* @__PURE__ */ jsxRuntime.jsx(
223
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { flex: 1, minWidth: 0, children: /* @__PURE__ */ jsxRuntime.jsx(
299
224
  designSystem.TextInput,
300
225
  {
301
226
  name,
302
227
  type: "url",
303
228
  value,
304
229
  onChange: (e) => onChange(e.target.value),
305
- placeholder,
306
- style: { width: "100%" }
230
+ placeholder
307
231
  }
308
232
  ) }),
309
233
  MediaLibraryDialog && /* @__PURE__ */ jsxRuntime.jsx(
@@ -314,7 +238,10 @@ function MediaPickerField({
314
238
  startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.Images, {}),
315
239
  onClick: () => setShowMedia(true),
316
240
  style: { flexShrink: 0 },
317
- children: "Browse"
241
+ children: formatMessage({
242
+ id: index.getTranslation("components.mediaPickerField.browse"),
243
+ defaultMessage: "Browse"
244
+ })
318
245
  }
319
246
  )
320
247
  ] }),
@@ -331,19 +258,78 @@ function MediaPickerField({
331
258
  )
332
259
  ] });
333
260
  }
334
- const EntryRow = styled__default.default.div`
335
- display: flex;
336
- align-items: center;
337
- justify-content: space-between;
338
- gap: 8px;
339
- padding: 8px 12px;
340
- width: 100%;
341
- box-sizing: border-box;
342
- background: #ffffff;
343
- border: 1px solid ${({ theme }) => theme.colors?.neutral200 ?? "#dcdce4"};
344
- border-radius: 4px;
345
- min-width: 0;
261
+ const slideIn = styled.keyframes`
262
+ from { transform: translateX(100%); opacity: 0; }
263
+ to { transform: translateX(0); opacity: 1; }
346
264
  `;
265
+ const slideOut = styled.keyframes`
266
+ from { transform: translateX(0); opacity: 1; }
267
+ to { transform: translateX(100%); opacity: 0; }
268
+ `;
269
+ const Content = styled__default.default(designSystem.Modal.Content)`
270
+ && {
271
+ top: 0;
272
+ right: 0;
273
+ bottom: 0;
274
+ left: auto;
275
+ transform: none;
276
+ width: min(${(p) => p.$width}, 95vw);
277
+ max-width: none;
278
+ height: 100%;
279
+ max-height: none;
280
+ border-radius: 0;
281
+ box-shadow: ${({ theme }) => theme.shadows.popupShadow};
282
+
283
+ @media (prefers-reduced-motion: no-preference) {
284
+ &[data-state='open'] {
285
+ animation: ${slideIn} ${({ theme }) => theme.motion.timings["200"]}
286
+ ${({ theme }) => theme.motion.easings.authenticMotion};
287
+ }
288
+ &[data-state='closed'] {
289
+ animation: ${slideOut} ${({ theme }) => theme.motion.timings["120"]}
290
+ ${({ theme }) => theme.motion.easings.easeOutQuad};
291
+ }
292
+ }
293
+ }
294
+ `;
295
+ const Body = styled__default.default(designSystem.Modal.Body)`
296
+ flex: 1 1 auto;
297
+ min-height: 0;
298
+ `;
299
+ const Footer = styled__default.default(designSystem.Modal.Footer)`
300
+ flex: 0 0 auto;
301
+ `;
302
+ function SheetDialog({
303
+ title,
304
+ children,
305
+ actionButtons,
306
+ onClose,
307
+ width = "760px",
308
+ "data-testid": testId
309
+ }) {
310
+ const { formatMessage } = reactIntl.useIntl();
311
+ return /* @__PURE__ */ jsxRuntime.jsx(
312
+ designSystem.Modal.Root,
313
+ {
314
+ defaultOpen: true,
315
+ onOpenChange: (open) => !open && onClose(),
316
+ children: /* @__PURE__ */ jsxRuntime.jsxs(Content, { $width: width, "data-testid": testId, children: [
317
+ /* @__PURE__ */ jsxRuntime.jsx(
318
+ designSystem.Modal.Header,
319
+ {
320
+ closeLabel: formatMessage({
321
+ id: index.getTranslation("components.sheet.closeLabel"),
322
+ defaultMessage: "Close panel"
323
+ }),
324
+ children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Modal.Title, { children: title })
325
+ }
326
+ ),
327
+ /* @__PURE__ */ jsxRuntime.jsx(Body, { children }),
328
+ actionButtons && /* @__PURE__ */ jsxRuntime.jsx(Footer, { children: actionButtons })
329
+ ] })
330
+ }
331
+ );
332
+ }
347
333
  function getDisplayLabel(doc) {
348
334
  for (const key of ["name", "title", "email", "username", "label", "slug"]) {
349
335
  const v = doc[key];
@@ -376,6 +362,7 @@ function RelationField({
376
362
  onChange,
377
363
  readOnly = false
378
364
  }) {
365
+ const { formatMessage } = reactIntl.useIntl();
379
366
  const { get } = admin.useFetchClient();
380
367
  const cache = react.useRef(/* @__PURE__ */ new Map());
381
368
  const [search, setSearch] = react.useState("");
@@ -443,7 +430,10 @@ function RelationField({
443
430
  onChange: (val) => handleSelect(val),
444
431
  onInputChange: (e) => setSearch(e.target.value),
445
432
  loading: isLoading,
446
- placeholder: "Search…",
433
+ placeholder: formatMessage({
434
+ id: index.getTranslation("components.relationField.searchPlaceholder"),
435
+ defaultMessage: "Search…"
436
+ }),
447
437
  children: availableOptions.map((opt) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.ComboboxOption, { value: opt.documentId, children: opt.label }, opt.documentId))
448
438
  },
449
439
  addKey
@@ -452,34 +442,51 @@ function RelationField({
452
442
  designSystem.Flex,
453
443
  {
454
444
  direction: "column",
445
+ alignItems: "stretch",
455
446
  gap: 1,
456
- style: { marginTop: 8, width: "100%" },
457
- children: currentDocs.map((doc) => /* @__PURE__ */ jsxRuntime.jsxs(EntryRow, { children: [
458
- /* @__PURE__ */ jsxRuntime.jsx(
459
- designSystem.Typography,
460
- {
461
- variant: "omega",
462
- textColor: "neutral800",
463
- style: {
464
- overflow: "hidden",
465
- textOverflow: "ellipsis",
466
- whiteSpace: "nowrap",
467
- flex: 1,
468
- minWidth: 0
469
- },
470
- children: doc.label
471
- }
472
- ),
473
- !readOnly && /* @__PURE__ */ jsxRuntime.jsx(
474
- designSystem.IconButton,
475
- {
476
- label: "Remove",
477
- size: "S",
478
- onClick: () => handleRemove(doc.documentId),
479
- children: /* @__PURE__ */ jsxRuntime.jsx(icons.Trash, {})
480
- }
481
- )
482
- ] }, doc.documentId))
447
+ marginTop: 2,
448
+ width: "100%",
449
+ children: currentDocs.map((doc) => /* @__PURE__ */ jsxRuntime.jsxs(
450
+ designSystem.Flex,
451
+ {
452
+ justifyContent: "space-between",
453
+ gap: 2,
454
+ paddingTop: 2,
455
+ paddingBottom: 2,
456
+ paddingLeft: 3,
457
+ paddingRight: 3,
458
+ background: "neutral0",
459
+ borderColor: "neutral200",
460
+ borderStyle: "solid",
461
+ borderWidth: "1px",
462
+ hasRadius: true,
463
+ children: [
464
+ /* @__PURE__ */ jsxRuntime.jsx(
465
+ designSystem.Typography,
466
+ {
467
+ variant: "omega",
468
+ textColor: "neutral800",
469
+ ellipsis: true,
470
+ style: { flex: 1, minWidth: 0 },
471
+ children: doc.label
472
+ }
473
+ ),
474
+ !readOnly && /* @__PURE__ */ jsxRuntime.jsx(
475
+ designSystem.IconButton,
476
+ {
477
+ label: formatMessage({
478
+ id: index.getTranslation("components.relationField.remove"),
479
+ defaultMessage: "Remove"
480
+ }),
481
+ size: "S",
482
+ onClick: () => handleRemove(doc.documentId),
483
+ children: /* @__PURE__ */ jsxRuntime.jsx(icons.Trash, {})
484
+ }
485
+ )
486
+ ]
487
+ },
488
+ doc.documentId
489
+ ))
483
490
  }
484
491
  )
485
492
  ] });
@@ -640,10 +647,14 @@ function CustomFieldsSection({
640
647
  data,
641
648
  onChange
642
649
  }) {
650
+ const { formatMessage } = reactIntl.useIntl();
643
651
  const renderable = fields.filter((f) => !SKIP_TYPES.has(f.attribute.type));
644
652
  if (renderable.length === 0) return null;
645
653
  return /* @__PURE__ */ jsxRuntime.jsxs(FormSection, { children: [
646
- /* @__PURE__ */ jsxRuntime.jsx(SectionLabel, { children: "Custom fields" }),
654
+ /* @__PURE__ */ jsxRuntime.jsx(SectionLabel, { children: formatMessage({
655
+ id: index.getTranslation("components.dynamicField.customFields"),
656
+ defaultMessage: "Custom fields"
657
+ }) }),
647
658
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", gap: 4, alignItems: "stretch", children: renderable.map((field) => /* @__PURE__ */ jsxRuntime.jsx(
648
659
  DynamicField,
649
660
  {
@@ -655,7 +666,7 @@ function CustomFieldsSection({
655
666
  )) })
656
667
  ] });
657
668
  }
658
- function EditViewSidePanels({ model, documentId, document: document2 }) {
669
+ function EditViewSidePanels({ model, documentId, document }) {
659
670
  const panels = index.getEditViewSidePanels(model);
660
671
  if (panels.length === 0) return null;
661
672
  return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: panels.map(({ id, title, Component }) => /* @__PURE__ */ jsxRuntime.jsxs(FormSection, { children: [
@@ -665,7 +676,7 @@ function EditViewSidePanels({ model, documentId, document: document2 }) {
665
676
  {
666
677
  model,
667
678
  documentId,
668
- document: document2
679
+ document
669
680
  }
670
681
  )
671
682
  ] }, id)) });
@@ -687,6 +698,7 @@ const MODEL_UID = {
687
698
  };
688
699
  function useModelSchema(model) {
689
700
  const { get } = admin.useFetchClient();
701
+ const { formatMessage } = reactIntl.useIntl();
690
702
  return reactQuery.useQuery({
691
703
  queryKey: ["ba-model-schema", model],
692
704
  queryFn: async () => {
@@ -695,7 +707,16 @@ function useModelSchema(model) {
695
707
  );
696
708
  const uid = MODEL_UID[model];
697
709
  const contentType = data.data.find((ct) => ct.uid === uid);
698
- if (!contentType) throw new Error(`Content type ${uid} not found`);
710
+ if (!contentType)
711
+ throw new Error(
712
+ formatMessage(
713
+ {
714
+ id: index.getTranslation("common.errors.contentTypeNotFound"),
715
+ defaultMessage: "Content type {uid} not found"
716
+ },
717
+ { uid }
718
+ )
719
+ );
699
720
  const attributes = {};
700
721
  for (const [name, attr] of Object.entries(contentType.attributes)) {
701
722
  if (SYSTEM_FIELDS.has(name)) continue;
@@ -712,10 +733,10 @@ function useModelSchema(model) {
712
733
  });
713
734
  }
714
735
  exports.AccountRow = AccountRow;
736
+ exports.Code = Code;
715
737
  exports.ConfirmDialog = ConfirmDialog;
716
738
  exports.CustomFieldsSection = CustomFieldsSection;
717
739
  exports.DangerRow = DangerRow;
718
- exports.Drawer = Drawer;
719
740
  exports.EditLayout = EditLayout;
720
741
  exports.EditSidebar = EditSidebar;
721
742
  exports.EditViewSidePanels = EditViewSidePanels;
@@ -729,6 +750,7 @@ exports.PreviewPill = PreviewPill;
729
750
  exports.ProviderBadge = ProviderBadge;
730
751
  exports.RoleBadge = RoleBadge;
731
752
  exports.SectionLabel = SectionLabel;
753
+ exports.SheetDialog = SheetDialog;
732
754
  exports.WarnCard = WarnCard;
733
755
  exports.useModelSchema = useModelSchema;
734
756
  exports.withContext = withContext;