@gntik-ai/blocks 0.10.0 → 0.12.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 (248) hide show
  1. package/dist/index.d.ts +1761 -1231
  2. package/dist/index.js +3280 -1088
  3. package/dist/index.js.map +1 -1
  4. package/package.json +6 -6
  5. package/src/ai/PromptEditor/PromptEditor.tsx +2 -2
  6. package/src/ai/PromptEditor/examples/controlled-variables.tsx +1 -1
  7. package/src/ai/TraceWaterfall/TraceWaterfall.tsx +2 -2
  8. package/src/auth/ForgotPasswordForm/ForgotPasswordForm.labels.test.tsx +179 -0
  9. package/src/auth/ForgotPasswordForm/ForgotPasswordForm.test.tsx +6 -0
  10. package/src/auth/ForgotPasswordForm/ForgotPasswordForm.tsx +63 -25
  11. package/src/auth/ForgotPasswordForm/block.meta.ts +22 -1
  12. package/src/auth/ForgotPasswordForm/examples/Labels.tsx +29 -0
  13. package/src/auth/ForgotPasswordForm/examples/LargeFields.tsx +6 -0
  14. package/src/auth/MfaChallenge/MfaChallenge.labels.test.tsx +139 -0
  15. package/src/auth/MfaChallenge/MfaChallenge.test.tsx +9 -0
  16. package/src/auth/MfaChallenge/MfaChallenge.tsx +74 -25
  17. package/src/auth/MfaChallenge/block.meta.ts +29 -1
  18. package/src/auth/MfaChallenge/examples/Labels.tsx +28 -0
  19. package/src/auth/MfaChallenge/examples/LargeFields.tsx +6 -0
  20. package/src/auth/ResetPasswordForm/ResetPasswordForm.labels.test.tsx +104 -0
  21. package/src/auth/ResetPasswordForm/ResetPasswordForm.test.tsx +7 -0
  22. package/src/auth/ResetPasswordForm/ResetPasswordForm.tsx +47 -18
  23. package/src/auth/ResetPasswordForm/block.meta.ts +17 -1
  24. package/src/auth/ResetPasswordForm/examples/Labels.tsx +28 -0
  25. package/src/auth/ResetPasswordForm/examples/LargeFields.tsx +6 -0
  26. package/src/auth/SignInForm/SignInForm.labels.test.tsx +137 -0
  27. package/src/auth/SignInForm/SignInForm.test.tsx +7 -0
  28. package/src/auth/SignInForm/SignInForm.tsx +48 -17
  29. package/src/auth/SignInForm/block.meta.ts +22 -1
  30. package/src/auth/SignInForm/examples/Labels.tsx +29 -0
  31. package/src/auth/SignInForm/examples/LargeFields.tsx +6 -0
  32. package/src/auth/SignUpForm/SignUpForm.labels.test.tsx +217 -0
  33. package/src/auth/SignUpForm/SignUpForm.test.tsx +22 -0
  34. package/src/auth/SignUpForm/SignUpForm.tsx +72 -27
  35. package/src/auth/SignUpForm/block.meta.ts +27 -1
  36. package/src/auth/SignUpForm/examples/Labels.tsx +29 -0
  37. package/src/auth/SignUpForm/examples/LargeFields.tsx +6 -0
  38. package/src/auth/SsoButtons/SsoButtons.labels.test.tsx +30 -0
  39. package/src/auth/SsoButtons/SsoButtons.tsx +10 -2
  40. package/src/auth/SsoButtons/block.meta.ts +8 -1
  41. package/src/auth/SsoButtons/examples/Labels.tsx +24 -0
  42. package/src/auth/__snapshots__/field-size.test.tsx.snap +11 -0
  43. package/src/auth/field-size.test.tsx +21 -0
  44. package/src/auth/large-examples.test.tsx +30 -0
  45. package/src/auth/shared.i18n.test.tsx +71 -0
  46. package/src/auth/shared.tsx +55 -13
  47. package/src/billing/PaymentMethodCard/PaymentMethodCard.tsx +1 -1
  48. package/src/billing/PlanCard/PlanCard.baseline.test.tsx +3 -2
  49. package/src/billing/PlanCard/__snapshots__/PlanCard.baseline.test.tsx.snap +2 -2
  50. package/src/billing/PlanDefinitionCard/examples/Compact.tsx +1 -4
  51. package/src/billing/PlanDefinitionCard/examples/Full.tsx +1 -4
  52. package/src/builders/CodePanel/CodePanel.tsx +2 -2
  53. package/src/builders/FlowBuilder/FlowBuilder.tsx +4 -19
  54. package/src/builders/FlowBuilder/parts.tsx +4 -4
  55. package/src/builders/LogViewer/LogViewer.follow.test.tsx +29 -0
  56. package/src/builders/LogViewer/LogViewer.levels.test.tsx +49 -0
  57. package/src/builders/LogViewer/LogViewer.test.tsx +24 -0
  58. package/src/builders/LogViewer/LogViewer.tsx +96 -28
  59. package/src/builders/LogViewer/LogViewer.wrap.test.tsx +181 -0
  60. package/src/builders/LogViewer/block.meta.ts +7 -1
  61. package/src/builders/LogViewer/examples/Spanish.tsx +2 -1
  62. package/src/builders/LogViewer/examples/Wrap.tsx +62 -0
  63. package/src/builders/LogViewer/use-wrapped-log-rows.ts +42 -0
  64. package/src/data-display/ActivityFeed/ActivityFeed.tsx +1 -1
  65. package/src/data-display/ChartCard/ChartCard.tsx +2 -2
  66. package/src/data-display/ChartCard/examples/ContainerPanel.tsx +16 -0
  67. package/src/data-display/CommentThread/CommentThread.test.tsx +70 -1
  68. package/src/data-display/CommentThread/CommentThread.tsx +22 -6
  69. package/src/data-display/CommentThread/block.meta.ts +1 -1
  70. package/src/data-display/CommentThread/examples/RenderedBody.tsx +20 -0
  71. package/src/data-display/DescriptionListCard/DescriptionListCard.options.test.tsx +64 -0
  72. package/src/data-display/DescriptionListCard/DescriptionListCard.test.tsx +24 -1
  73. package/src/data-display/DescriptionListCard/DescriptionListCard.tsx +52 -37
  74. package/src/data-display/DescriptionListCard/block.meta.ts +2 -1
  75. package/src/data-display/DescriptionListCard/examples/Spanish.tsx +9 -1
  76. package/src/data-display/KpiRow/KpiRow.doc.ts +14 -0
  77. package/src/data-display/KpiRow/KpiRow.test.tsx +11 -0
  78. package/src/data-display/KpiRow/KpiRow.tsx +72 -55
  79. package/src/data-display/KpiRow/examples/ContainerPanel.tsx +47 -0
  80. package/src/data-display/ResourceCardGrid/ResourceCardGrid.doc.ts +19 -0
  81. package/src/data-display/ResourceCardGrid/ResourceCardGrid.test.tsx +13 -0
  82. package/src/data-display/ResourceCardGrid/ResourceCardGrid.tsx +49 -40
  83. package/src/data-display/ResourceCardGrid/examples/ContainerPanel.tsx +18 -0
  84. package/src/data-display/StatusTimeline/StatusTimeline.tsx +1 -1
  85. package/src/feedback/EmptyStates/EmptyStates.test.tsx +42 -0
  86. package/src/feedback/EmptyStates/EmptyStates.tsx +37 -17
  87. package/src/feedback/EmptyStates/NoAccessEmpty.options.test.tsx +38 -0
  88. package/src/feedback/EmptyStates/block.meta.ts +1 -1
  89. package/src/feedback/EmptyStates/examples/HiddenAction.tsx +13 -0
  90. package/src/feedback/EmptyStates/examples/Spanish.tsx +7 -0
  91. package/src/feedback/ErrorPanel/ErrorPanel.tsx +13 -15
  92. package/src/forms/CreateApiKeyDialog/CreateApiKeyDialog.labels.test.tsx +115 -0
  93. package/src/forms/CreateApiKeyDialog/CreateApiKeyDialog.lifecycle.test.tsx +123 -0
  94. package/src/forms/CreateApiKeyDialog/CreateApiKeyDialog.tsx +153 -122
  95. package/src/forms/CreateApiKeyDialog/block.meta.ts +34 -2
  96. package/src/forms/CreateApiKeyDialog/examples/Labels.tsx +29 -0
  97. package/src/forms/CredentialDisclosureDialog/CredentialDisclosureDialog.labels.test.tsx +165 -0
  98. package/src/forms/CredentialDisclosureDialog/CredentialDisclosureDialog.tsx +31 -8
  99. package/src/forms/CredentialDisclosureDialog/SecretCopy.tsx +16 -8
  100. package/src/forms/CredentialDisclosureDialog/block.meta.ts +19 -1
  101. package/src/forms/CredentialDisclosureDialog/examples/Labels.tsx +38 -0
  102. package/src/forms/DangerZone/ConfirmDestructiveDialog.tsx +17 -3
  103. package/src/forms/DangerZone/DangerZone.labels.test.tsx +87 -0
  104. package/src/forms/DangerZone/DangerZone.tsx +20 -5
  105. package/src/forms/DangerZone/block.meta.ts +10 -1
  106. package/src/forms/DangerZone/examples/Labels.tsx +29 -0
  107. package/src/forms/DateRangeFilter/DateRangeFilter.labels.test.tsx +52 -0
  108. package/src/forms/DateRangeFilter/DateRangeFilter.tsx +11 -3
  109. package/src/forms/DateRangeFilter/block.meta.ts +8 -1
  110. package/src/forms/DateRangeFilter/examples/Labels.tsx +28 -0
  111. package/src/forms/DialogWizard/DialogWizard.labels.test.tsx +37 -0
  112. package/src/forms/DialogWizard/DialogWizard.tsx +13 -2
  113. package/src/forms/DialogWizard/block.meta.ts +7 -1
  114. package/src/forms/DialogWizard/examples/Labels.tsx +39 -0
  115. package/src/forms/FileUploadPanel/FileUploadPanel.controlled.test.tsx +482 -0
  116. package/src/forms/FileUploadPanel/FileUploadPanel.drag.test.tsx +60 -0
  117. package/src/forms/FileUploadPanel/FileUploadPanel.labels.test.tsx +126 -0
  118. package/src/forms/FileUploadPanel/FileUploadPanel.lifecycle.test.tsx +165 -0
  119. package/src/forms/FileUploadPanel/FileUploadPanel.tsx +336 -75
  120. package/src/forms/FileUploadPanel/block.meta.ts +26 -1
  121. package/src/forms/FileUploadPanel/examples/AutoCancel.tsx +38 -0
  122. package/src/forms/FileUploadPanel/examples/Labels.tsx +29 -0
  123. package/src/forms/FileUploadPanel/examples/ManualForm.tsx +36 -0
  124. package/src/forms/FileUploadPanel/fixtures.ts +31 -16
  125. package/src/forms/FileUploadPanel/simulate-upload.test.ts +24 -0
  126. package/src/forms/FormSection/FormSection.labels.test.tsx +37 -0
  127. package/src/forms/FormSection/FormSection.test.tsx +11 -0
  128. package/src/forms/FormSection/FormSection.tsx +34 -25
  129. package/src/forms/FormSection/block.meta.ts +7 -1
  130. package/src/forms/FormSection/examples/ContainerPanel.tsx +16 -0
  131. package/src/forms/FormSection/examples/Labels.tsx +27 -0
  132. package/src/forms/InviteMembersDialog/InviteMembersDialog.labels.test.tsx +87 -0
  133. package/src/forms/InviteMembersDialog/InviteMembersDialog.lifecycle.test.tsx +80 -0
  134. package/src/forms/InviteMembersDialog/InviteMembersDialog.tsx +121 -105
  135. package/src/forms/InviteMembersDialog/block.meta.ts +21 -2
  136. package/src/forms/InviteMembersDialog/examples/Labels.tsx +28 -0
  137. package/src/forms/SettingsRow/SettingsRow.labels.test.tsx +33 -0
  138. package/src/forms/SettingsRow/SettingsRow.tsx +14 -3
  139. package/src/forms/SettingsRow/block.meta.ts +7 -1
  140. package/src/forms/SettingsRow/examples/Labels.tsx +27 -0
  141. package/src/forms/ValidationSummary/ValidationSummary.labels.test.tsx +47 -0
  142. package/src/forms/ValidationSummary/ValidationSummary.tsx +10 -7
  143. package/src/forms/ValidationSummary/block.meta.ts +6 -1
  144. package/src/forms/ValidationSummary/examples/Labels.tsx +24 -0
  145. package/src/forms/index.ts +5 -1
  146. package/src/forms/translated-content.tsx +12 -0
  147. package/src/hooks/index.ts +2 -0
  148. package/src/hooks/useTableData.integration.test.tsx +89 -0
  149. package/src/hooks/useTableData.test.tsx +613 -0
  150. package/src/hooks/useTableData.ts +377 -0
  151. package/src/index.ts +1 -0
  152. package/src/marketing/ComparisonTable/ComparisonTable.tsx +2 -2
  153. package/src/marketing/FeatureGrid/FeatureGrid.tsx +1 -1
  154. package/src/marketing/LogoCloud/LogoCloud.doc.ts +13 -0
  155. package/src/marketing/LogoCloud/LogoCloud.test.tsx +155 -0
  156. package/src/marketing/LogoCloud/LogoCloud.tsx +89 -0
  157. package/src/marketing/LogoCloud/block.meta.ts +10 -0
  158. package/src/marketing/LogoCloud/examples/CaptionStart.tsx +6 -0
  159. package/src/marketing/LogoCloud/examples/Custom.tsx +25 -0
  160. package/src/marketing/LogoCloud/examples/Empty.tsx +6 -0
  161. package/src/marketing/LogoCloud/examples/Grid.tsx +13 -0
  162. package/src/marketing/LogoCloud/examples/Row.tsx +6 -0
  163. package/src/marketing/LogoCloud/examples/UnderHero.tsx +13 -0
  164. package/src/marketing/LogoCloud/fixtures.ts +23 -0
  165. package/src/marketing/PricingTable/PricingTable.tsx +1 -1
  166. package/src/marketing/SiteFooter/SiteFooter.doc.ts +18 -0
  167. package/src/marketing/SiteFooter/SiteFooter.test.tsx +236 -0
  168. package/src/marketing/SiteFooter/SiteFooter.tsx +160 -0
  169. package/src/marketing/SiteFooter/block.meta.ts +10 -0
  170. package/src/marketing/SiteFooter/examples/Centered.tsx +15 -0
  171. package/src/marketing/SiteFooter/examples/Columns.tsx +15 -0
  172. package/src/marketing/SiteFooter/examples/Custom.tsx +35 -0
  173. package/src/marketing/SiteFooter/examples/Empty.tsx +6 -0
  174. package/src/marketing/SiteFooter/examples/Simple.tsx +14 -0
  175. package/src/marketing/SiteFooter/fixtures.ts +36 -0
  176. package/src/marketing/index.ts +6 -0
  177. package/src/page-chrome/PageHeader/EditableTitle.test.tsx +26 -0
  178. package/src/page-chrome/PageHeader/PageHeader.options.test.tsx +34 -0
  179. package/src/page-chrome/PageHeader/PageHeader.tsx +11 -5
  180. package/src/page-chrome/PageHeader/block.meta.ts +1 -1
  181. package/src/page-chrome/PageHeader/examples/ContainerPanel.tsx +16 -0
  182. package/src/page-chrome/PageHeader/examples/EditableTitle.tsx +23 -0
  183. package/src/page-chrome/PageHeader/examples/Spanish.tsx +11 -0
  184. package/src/page-chrome/StickyActionBar/StickyActionBar.tsx +1 -1
  185. package/src/scheduling/AgendaList/AgendaList.tsx +39 -15
  186. package/src/scheduling/AgendaList/AgendaListZone.test.tsx +38 -0
  187. package/src/scheduling/AgendaList/block.meta.ts +1 -1
  188. package/src/scheduling/AgendaList/examples/TimeZone.tsx +28 -0
  189. package/src/scheduling/MonthCalendar/MonthCalendar.tsx +51 -40
  190. package/src/scheduling/MonthCalendar/MonthCalendarZone.test.tsx +44 -0
  191. package/src/scheduling/MonthCalendar/block.meta.ts +1 -1
  192. package/src/scheduling/MonthCalendar/examples/TimeZone.tsx +28 -0
  193. package/src/scheduling/WeekCalendar/WeekCalendar.tsx +37 -28
  194. package/src/scheduling/WeekCalendar/WeekCalendarZone.test.tsx +41 -0
  195. package/src/scheduling/WeekCalendar/block.meta.ts +1 -1
  196. package/src/scheduling/WeekCalendar/examples/TimeZone.tsx +28 -0
  197. package/src/scheduling/shared/CalendarHeader.tsx +26 -1
  198. package/src/scheduling/shared/dates.ts +102 -58
  199. package/src/scheduling/shared/events.ts +2 -2
  200. package/src/shell/AppSidebar/AppSidebar.context.test.tsx +175 -0
  201. package/src/shell/AppSidebar/AppSidebar.doc.ts +29 -0
  202. package/src/shell/AppSidebar/AppSidebar.tsx +97 -25
  203. package/src/shell/AppSidebar/block.meta.ts +1 -1
  204. package/src/shell/GlobalSearch/GlobalSearch.test.tsx +1 -0
  205. package/src/shell/GlobalSearch/GlobalSearch.tsx +1 -1
  206. package/src/tables/DataTable/DataTable.cross-page-selection.test.tsx +322 -0
  207. package/src/tables/DataTable/DataTable.cursor-example.test.tsx +67 -0
  208. package/src/tables/DataTable/DataTable.export.test.tsx +511 -0
  209. package/src/tables/DataTable/DataTable.inline-edit-focus.test.tsx +32 -0
  210. package/src/tables/DataTable/DataTable.labels.test.tsx +74 -0
  211. package/src/tables/DataTable/DataTable.layout.test.tsx +6 -5
  212. package/src/tables/DataTable/DataTable.link-actions.test.tsx +18 -0
  213. package/src/tables/DataTable/DataTable.server-pagination.test.tsx +329 -15
  214. package/src/tables/DataTable/DataTable.single-select.test.tsx +47 -7
  215. package/src/tables/DataTable/DataTable.test.tsx +140 -1
  216. package/src/tables/DataTable/DataTable.tsx +241 -80
  217. package/src/tables/DataTable/block.meta.ts +31 -3
  218. package/src/tables/DataTable/column-sizing.ts +2 -2
  219. package/src/tables/DataTable/data-table-props.ts +43 -6
  220. package/src/tables/DataTable/data-table-row.tsx +9 -5
  221. package/src/tables/DataTable/data-table-utils.ts +6 -0
  222. package/src/tables/DataTable/editable-cell.tsx +20 -79
  223. package/src/tables/DataTable/examples/client-selection.tsx +33 -0
  224. package/src/tables/DataTable/examples/csv-export.tsx +74 -0
  225. package/src/tables/DataTable/examples/cursor-load-more.tsx +87 -0
  226. package/src/tables/DataTable/examples/paginated-single-selection.tsx +46 -0
  227. package/src/tables/DataTable/examples/server-pagination.tsx +91 -44
  228. package/src/tables/DataTable/export-menu.tsx +58 -0
  229. package/src/tables/DataTable/header-cell.tsx +1 -1
  230. package/src/tables/DataTable/labels.ts +11 -0
  231. package/src/tables/DataTable/resize-handle.tsx +2 -2
  232. package/src/tables/DataTable/selection-strip.tsx +31 -0
  233. package/src/tables/DataTable/single-selection.tsx +0 -7
  234. package/src/tables/DataTable/use-multiple-selection.ts +86 -0
  235. package/src/tables/DataTable/use-table-export.ts +117 -0
  236. package/src/tables/FilterBar/FilterBar.test.tsx +12 -0
  237. package/src/tables/FilterBar/FilterBar.tsx +5 -7
  238. package/src/team/ProfileHeader/ProfileHeader.picker.test.tsx +34 -0
  239. package/src/team/ProfileHeader/ProfileHeader.test.tsx +2 -2
  240. package/src/team/ProfileHeader/ProfileHeader.tsx +17 -24
  241. package/src/team/ProfileHeader/block.meta.ts +1 -1
  242. package/src/test/OptInDefaults.test.tsx +36 -0
  243. package/src/test/clipboard-fallback.test.tsx +49 -0
  244. package/src/test/copy-examples.test.tsx +29 -0
  245. package/src/test/copy-feedback.test.tsx +166 -0
  246. package/src/test/fixtures/opt-in-defaults.json +10 -0
  247. package/src/test/without-forced-colors.test.ts +44 -0
  248. package/src/test/without-forced-colors.ts +14 -0
@@ -1,19 +1,12 @@
1
1
  import {
2
+ useI18n,
2
3
  Alert,
3
4
  Button,
4
- Dialog,
5
- DialogBody,
6
- DialogClose,
7
- DialogContent,
8
- DialogDescription,
9
- DialogFooter,
10
- DialogHeader,
11
- DialogTitle,
12
- DialogTrigger,
13
5
  Field,
14
6
  FieldDescription,
15
7
  FieldError,
16
8
  FieldLabel,
9
+ FormDialog,
17
10
  Select,
18
11
  SelectContent,
19
12
  SelectItem,
@@ -22,7 +15,7 @@ import {
22
15
  TokenInput,
23
16
  } from '@gntik-ai/ui';
24
17
  import { UserPlus } from '@gntik-ai/icons';
25
- import { useState, type ReactElement } from 'react';
18
+ import { useEffect, useRef, useState, type ReactElement } from 'react';
26
19
  import { EMAIL_RE, memberRoles, type RoleOption } from './fixtures';
27
20
 
28
21
  export type { RoleOption } from './fixtures';
@@ -33,7 +26,27 @@ export interface InvitePayload {
33
26
  message: string;
34
27
  }
35
28
 
29
+ export interface InviteMembersDialogLabels {
30
+ title: string;
31
+ description: string;
32
+ emails: string;
33
+ placeholder: string;
34
+ listLabel: string;
35
+ role: string;
36
+ message: string;
37
+ messagePlaceholder: string;
38
+ emailRequired: string;
39
+ emailInvalid: (email: string) => string;
40
+ fixInvalid: (count: number) => string;
41
+ errorTitle: string;
42
+ fallbackError: string;
43
+ cancel: string;
44
+ submit: string;
45
+ submitMany: (count: number) => string;
46
+ }
47
+
36
48
  export interface InviteMembersDialogProps {
49
+ labels?: Partial<InviteMembersDialogLabels>;
37
50
  roles?: RoleOption[];
38
51
  defaultRole?: string;
39
52
  /** Sends the invitations. A returned promise shows a loading state; a rejection shows its message. */
@@ -49,135 +62,138 @@ export interface InviteMembersDialogProps {
49
62
  description?: string;
50
63
  }
51
64
 
52
- const emailError = (t: string) => (EMAIL_RE.test(t) ? null : `${t} is not a valid email address`);
53
-
54
65
  /** Invite dialog: email chips with validation, a role and an optional message; submit with loading. */
55
66
  export function InviteMembersDialog({
67
+ labels,
56
68
  roles = memberRoles,
57
69
  defaultRole = 'member',
58
70
  onInvite,
59
71
  maxInvites = 20,
60
- open: openProp,
72
+ open,
61
73
  defaultOpen = false,
62
74
  onOpenChange,
63
75
  trigger = <Button icon={UserPlus} />,
64
- title = 'Invite members',
65
- description = 'Invitations expire after 7 days. Separate addresses with commas or Enter.',
76
+ title: titleProp,
77
+ description: descriptionProp,
66
78
  }: InviteMembersDialogProps) {
67
- const [innerOpen, setInnerOpen] = useState(defaultOpen);
79
+ const { t } = useI18n();
80
+ const title = titleProp ?? labels?.title ?? t('inviteMembers.title');
81
+ const description = descriptionProp ?? labels?.description ?? t('inviteMembers.description');
82
+ const emailError = (email: string) =>
83
+ EMAIL_RE.test(email) ? null : (labels?.emailInvalid?.(email) ?? t('inviteMembers.emailInvalid', { email }));
68
84
  const [emails, setEmails] = useState<string[]>([]);
69
85
  const [role, setRole] = useState(defaultRole);
70
86
  const [message, setMessage] = useState('');
71
87
  const [submitted, setSubmitted] = useState(false);
72
- const [loading, setLoading] = useState(false);
73
88
  const [error, setError] = useState<string | null>(null);
74
- const open = openProp ?? innerOpen;
89
+
90
+ // Bumped whenever an opening ends, so a submit that settles later can't touch a reopened dialog.
91
+ const opening = useRef(0);
92
+ useEffect(() => {
93
+ opening.current += 1;
94
+ }, [open]);
75
95
 
76
96
  const invalidCount = emails.filter((e) => emailError(e)).length;
77
97
  const emailsProblem =
78
98
  emails.length === 0
79
- ? 'Add at least one email address.'
99
+ ? (labels?.emailRequired ?? t('inviteMembers.emailRequired'))
80
100
  : invalidCount > 0
81
- ? `Fix ${invalidCount} invalid ${invalidCount === 1 ? 'address' : 'addresses'}.`
101
+ ? (labels?.fixInvalid?.(invalidCount) ?? t('inviteMembers.fixInvalid', { count: invalidCount }))
82
102
  : null;
83
103
  const showEmailError = submitted && emailsProblem != null;
84
104
 
85
- const setOpen = (next: boolean) => {
86
- if (loading && !next) return;
87
- if (!next) {
88
- setEmails([]);
89
- setRole(defaultRole);
90
- setMessage('');
91
- setSubmitted(false);
92
- setError(null);
93
- }
94
- setInnerOpen(next);
95
- onOpenChange?.(next);
105
+ const reset = () => {
106
+ opening.current += 1;
107
+ setEmails([]);
108
+ setRole(defaultRole);
109
+ setMessage('');
110
+ setSubmitted(false);
111
+ setError(null);
96
112
  };
97
113
 
98
- const submit = async () => {
99
- setSubmitted(true);
100
- setError(null);
101
- if (emailsProblem) return;
102
- setLoading(true);
114
+ const send = async () => {
115
+ const current = opening.current;
103
116
  try {
104
117
  await onInvite?.({ emails, role, message: message.trim() });
105
- setLoading(false);
106
- setOpen(false);
107
118
  } catch (e) {
108
- setLoading(false);
109
- setError(e instanceof Error ? e.message : 'The invitations could not be sent.');
119
+ if (current === opening.current) {
120
+ setError(e instanceof Error ? e.message : (labels?.fallbackError ?? t('inviteMembers.fallbackError')));
121
+ }
122
+ return false;
110
123
  }
111
124
  };
112
125
 
126
+ const submit = () => {
127
+ setSubmitted(true);
128
+ setError(null);
129
+ return emailsProblem ? false : send();
130
+ };
131
+
113
132
  const roleLabel = roles.find((r) => r.value === role)?.description;
114
133
 
115
134
  return (
116
- <Dialog open={open} onOpenChange={setOpen}>
117
- {trigger && <DialogTrigger render={trigger}>{title}</DialogTrigger>}
118
- <DialogContent size="lg">
119
- <DialogHeader>
120
- <DialogTitle>{title}</DialogTitle>
121
- <DialogDescription>{description}</DialogDescription>
122
- </DialogHeader>
123
- <form
124
- noValidate
125
- onSubmit={(e) => {
126
- e.preventDefault();
127
- void submit();
128
- }}
135
+ <FormDialog
136
+ size="lg"
137
+ title={title}
138
+ description={description}
139
+ trigger={trigger ?? undefined}
140
+ open={open}
141
+ defaultOpen={defaultOpen}
142
+ onOpenChange={onOpenChange}
143
+ onSubmit={submit}
144
+ onClosed={reset}
145
+ cancelLabel={labels?.cancel ?? t('inviteMembers.cancel')}
146
+ submitLabel={
147
+ emails.length > 1
148
+ ? (labels?.submitMany?.(emails.length) ?? t('inviteMembers.submitMany', { count: emails.length }))
149
+ : (labels?.submit ?? t('inviteMembers.submit'))
150
+ }
151
+ summary={
152
+ error && (
153
+ <Alert tone="destructive" title={labels?.errorTitle ?? t('inviteMembers.errorTitle')} description={error} />
154
+ )
155
+ }
156
+ >
157
+ <Field invalid={showEmailError}>
158
+ <FieldLabel required>{labels?.emails ?? t('inviteMembers.emails')}</FieldLabel>
159
+ <TokenInput
160
+ value={emails}
161
+ onValueChange={setEmails}
162
+ validate={emailError}
163
+ maxItems={maxInvites}
164
+ placeholder={labels?.placeholder ?? t('inviteMembers.placeholder')}
165
+ listLabel={labels?.listLabel ?? t('inviteMembers.listLabel')}
166
+ invalid={showEmailError}
167
+ />
168
+ <FieldError match={showEmailError}>{emailsProblem}</FieldError>
169
+ </Field>
170
+ <Field>
171
+ <FieldLabel>{labels?.role ?? t('inviteMembers.role')}</FieldLabel>
172
+ <Select
173
+ value={role}
174
+ onValueChange={(v) => v != null && setRole(v)}
175
+ items={roles.map(({ value, label }) => ({ value, label }))}
129
176
  >
130
- <DialogBody className="grid gap-5">
131
- <Field invalid={showEmailError}>
132
- <FieldLabel required>Email addresses</FieldLabel>
133
- <TokenInput
134
- value={emails}
135
- onValueChange={setEmails}
136
- validate={emailError}
137
- maxItems={maxInvites}
138
- placeholder="name@company.com"
139
- listLabel="Invited addresses"
140
- invalid={showEmailError}
141
- />
142
- <FieldError match={showEmailError}>{emailsProblem}</FieldError>
143
- </Field>
144
- <Field>
145
- <FieldLabel>Role</FieldLabel>
146
- <Select
147
- value={role}
148
- onValueChange={(v) => v != null && setRole(v)}
149
- items={roles.map(({ value, label }) => ({ value, label }))}
150
- >
151
- <SelectTrigger className="w-full" />
152
- <SelectContent>
153
- {roles.map((r) => (
154
- <SelectItem key={r.value} value={r.value}>
155
- {r.label}
156
- </SelectItem>
157
- ))}
158
- </SelectContent>
159
- </Select>
160
- {roleLabel && <FieldDescription>{roleLabel}</FieldDescription>}
161
- </Field>
162
- <Field>
163
- <FieldLabel>Message (optional)</FieldLabel>
164
- <Textarea
165
- rows={3}
166
- value={message}
167
- onValueChange={setMessage}
168
- placeholder="Join us on the billing-dashboard project."
169
- />
170
- </Field>
171
- {error && <Alert tone="destructive" title="Invitations not sent" description={error} />}
172
- </DialogBody>
173
- <DialogFooter>
174
- <DialogClose render={<Button variant="ghost" disabled={loading} />}>Cancel</DialogClose>
175
- <Button type="submit" loading={loading}>
176
- {emails.length > 1 ? `Send ${emails.length} invitations` : 'Send invitation'}
177
- </Button>
178
- </DialogFooter>
179
- </form>
180
- </DialogContent>
181
- </Dialog>
177
+ <SelectTrigger className="w-full" />
178
+ <SelectContent>
179
+ {roles.map((r) => (
180
+ <SelectItem key={r.value} value={r.value}>
181
+ {r.label}
182
+ </SelectItem>
183
+ ))}
184
+ </SelectContent>
185
+ </Select>
186
+ {roleLabel && <FieldDescription>{roleLabel}</FieldDescription>}
187
+ </Field>
188
+ <Field>
189
+ <FieldLabel>{labels?.message ?? t('inviteMembers.message')}</FieldLabel>
190
+ <Textarea
191
+ rows={3}
192
+ value={message}
193
+ onValueChange={setMessage}
194
+ placeholder={labels?.messagePlaceholder ?? t('inviteMembers.messagePlaceholder')}
195
+ />
196
+ </Field>
197
+ </FormDialog>
182
198
  );
183
199
  }
@@ -1,10 +1,29 @@
1
1
  import type { BlockMeta } from '../../meta';
2
+ import type { InviteMembersDialogLabels } from './InviteMembersDialog';
2
3
 
3
4
  export const meta: BlockMeta = {
4
5
  name: 'Invite members dialog',
5
6
  family: 'forms',
6
7
  status: 'stable',
7
8
  description:
8
- 'Dialog to invite people by email (validated chips) with a role and an optional message; submits with a loading state.',
9
- uses: ['Dialog', 'TokenInput', 'Select', 'Textarea', 'Field', 'Button', 'Alert'],
9
+ 'Dialog to invite people by email (validated chips) with a role and an optional message; submits with a loading state. Optional labels?: Partial<InviteMembersDialogLabels> overrides built-in copy; explicit props and validation messages win, then labels, then I18nProvider (en/es). No provider preserves English; fixtures and caller content stay unchanged. Interactive preview: /preview.html?kind=block&id=invite-members-dialog--labels.',
10
+ labels: [
11
+ { key: 'title', type: 'string', state: 'Default content and accessible names' },
12
+ { key: 'description', type: 'string', state: 'Default content and accessible names' },
13
+ { key: 'emails', type: 'string', state: 'Default content and accessible names' },
14
+ { key: 'placeholder', type: 'string', state: 'Default content and accessible names' },
15
+ { key: 'listLabel', type: 'string', state: 'Default content and accessible names' },
16
+ { key: 'role', type: 'string', state: 'Default content and accessible names' },
17
+ { key: 'message', type: 'string', state: 'Default content and accessible names' },
18
+ { key: 'messagePlaceholder', type: 'string', state: 'Default content and accessible names' },
19
+ { key: 'emailRequired', type: 'string', state: 'Validation feedback' },
20
+ { key: 'emailInvalid', type: '(email: string) => string', state: 'Validation feedback' },
21
+ { key: 'fixInvalid', type: '(count: number) => string', state: 'Validation feedback' },
22
+ { key: 'errorTitle', type: 'string', state: 'Validation feedback' },
23
+ { key: 'fallbackError', type: 'string', state: 'Validation feedback' },
24
+ { key: 'cancel', type: 'string', state: 'Default content and accessible names' },
25
+ { key: 'submit', type: 'string', state: 'Default content and accessible names' },
26
+ { key: 'submitMany', type: '(count: number) => string', state: 'Default content and accessible names' },
27
+ ] satisfies Array<{ key: keyof InviteMembersDialogLabels; type: string; state: string }>,
28
+ uses: ['FormDialog', 'Dialog', 'TokenInput', 'Select', 'Textarea', 'Field', 'Button', 'Alert'],
10
29
  };
@@ -0,0 +1,28 @@
1
+ import { Button, I18nProvider } from '@gntik-ai/ui';
2
+ import { useState } from 'react';
3
+ import { InviteMembersDialog, type InviteMembersDialogLabels } from '../InviteMembersDialog';
4
+
5
+ export default function Labels() {
6
+ const [spanish, setSpanish] = useState(false);
7
+ const [custom, setCustom] = useState(true);
8
+ const labels: Partial<InviteMembersDialogLabels> = {
9
+ title: 'Invite teammates',
10
+ submit: 'Invite teammate',
11
+ submitMany: (count) => `Invite ${count} teammates`,
12
+ };
13
+ return (
14
+ <div className="grid gap-4">
15
+ <div className="flex flex-wrap gap-2">
16
+ <Button variant="secondary" aria-pressed={spanish} onClick={() => setSpanish(!spanish)}>
17
+ Spanish catalog
18
+ </Button>
19
+ <Button variant="secondary" aria-pressed={custom} onClick={() => setCustom(!custom)}>
20
+ Custom labels
21
+ </Button>
22
+ </div>
23
+ <I18nProvider locale={spanish ? 'es' : 'en'}>
24
+ <InviteMembersDialog labels={custom ? labels : undefined} />
25
+ </I18nProvider>
26
+ </div>
27
+ );
28
+ }
@@ -0,0 +1,33 @@
1
+ import { render, screen } from '@testing-library/react';
2
+ import { I18nProvider, es } from '@gntik-ai/ui';
3
+ import { SettingsRow } from './SettingsRow';
4
+ it('preserves English defaults and translates the label and description', () => {
5
+ const { rerender } = render(<SettingsRow />);
6
+ expect(screen.getByRole('switch', { name: 'Deployment notifications' })).toHaveAccessibleDescription(
7
+ 'Email the project owners when a deployment fails or is rolled back.',
8
+ );
9
+ rerender(
10
+ <I18nProvider locale="es">
11
+ <SettingsRow />
12
+ </I18nProvider>,
13
+ );
14
+ expect(screen.getByRole('switch', { name: 'Notificaciones de despliegue' })).toHaveAccessibleDescription(
15
+ es['settingsRow.description'],
16
+ );
17
+ expect(screen.getByText(es['settingsRow.label'])).toBeVisible();
18
+ });
19
+ it.each(['en', 'es'])('honours labels and explicit props under %s', (locale) => {
20
+ const labels = { label: 'Custom setting', description: 'Custom description' };
21
+ const { rerender } = render(
22
+ <I18nProvider locale={locale}>
23
+ <SettingsRow labels={labels} />
24
+ </I18nProvider>,
25
+ );
26
+ expect(screen.getByRole('switch', { name: labels.label })).toHaveAccessibleDescription(labels.description);
27
+ rerender(
28
+ <I18nProvider locale={locale}>
29
+ <SettingsRow labels={labels} label="Explicit setting" description="Explicit description" />
30
+ </I18nProvider>,
31
+ );
32
+ expect(screen.getByRole('switch', { name: 'Explicit setting' })).toHaveAccessibleDescription('Explicit description');
33
+ });
@@ -1,4 +1,4 @@
1
- import { Switch, cn } from '@gntik-ai/ui';
1
+ import { useI18n, Switch, cn } from '@gntik-ai/ui';
2
2
  import { useId, type ReactNode } from 'react';
3
3
 
4
4
  export interface SettingsRowControlIds {
@@ -8,7 +8,13 @@ export interface SettingsRowControlIds {
8
8
  descriptionId: string | undefined;
9
9
  }
10
10
 
11
+ export interface SettingsRowLabels {
12
+ label: string;
13
+ description: string;
14
+ }
15
+
11
16
  export interface SettingsRowProps {
17
+ labels?: Partial<SettingsRowLabels>;
12
18
  label?: ReactNode;
13
19
  description?: ReactNode;
14
20
  /**
@@ -27,8 +33,9 @@ export interface SettingsRowProps {
27
33
 
28
34
  /** One setting: label and description on the left, its control (a Switch by default) on the right. */
29
35
  export function SettingsRow({
30
- label = 'Deployment notifications',
31
- description = 'Email the project owners when a deployment fails or is rolled back.',
36
+ labels,
37
+ label: labelProp,
38
+ description: descriptionProp,
32
39
  control,
33
40
  checked,
34
41
  defaultChecked = true,
@@ -37,6 +44,10 @@ export function SettingsRow({
37
44
  children,
38
45
  className,
39
46
  }: SettingsRowProps) {
47
+ const { t } = useI18n();
48
+ const label = labelProp === undefined ? (labels?.label ?? t('settingsRow.label')) : labelProp;
49
+ const description =
50
+ descriptionProp === undefined ? (labels?.description ?? t('settingsRow.description')) : descriptionProp;
40
51
  const id = useId();
41
52
  const labelId = `${id}-label`;
42
53
  const descriptionId = description != null ? `${id}-desc` : undefined;
@@ -1,9 +1,15 @@
1
1
  import type { BlockMeta } from '../../meta';
2
+ import type { SettingsRowLabels } from './SettingsRow';
2
3
 
3
4
  export const meta: BlockMeta = {
4
5
  name: 'Settings row',
5
6
  family: 'forms',
6
7
  status: 'stable',
7
- description: 'A setting with its label and description on the left and a control (Switch by default) on the right.',
8
+ description:
9
+ 'A setting with its label and description on the left and a control (Switch by default) on the right. Optional labels?: Partial<SettingsRowLabels> overrides built-in copy; explicit props and validation messages win, then labels, then I18nProvider (en/es). No provider preserves English; fixtures and caller content stay unchanged. Interactive preview: /preview.html?kind=block&id=settings-row--labels.',
10
+ labels: [
11
+ { key: 'label', type: 'string', state: 'Default content and accessible names' },
12
+ { key: 'description', type: 'string', state: 'Default content and accessible names' },
13
+ ] satisfies Array<{ key: keyof SettingsRowLabels; type: string; state: string }>,
8
14
  uses: ['Switch'],
9
15
  };
@@ -0,0 +1,27 @@
1
+ import { Button, I18nProvider } from '@gntik-ai/ui';
2
+ import { useState } from 'react';
3
+ import { SettingsRow, type SettingsRowLabels } from '../SettingsRow';
4
+
5
+ export default function Labels() {
6
+ const [spanish, setSpanish] = useState(false);
7
+ const [custom, setCustom] = useState(true);
8
+ const labels: Partial<SettingsRowLabels> = {
9
+ label: 'Activity notifications',
10
+ description: 'Notify the workspace owners about new activity.',
11
+ };
12
+ return (
13
+ <div className="grid gap-4">
14
+ <div className="flex flex-wrap gap-2">
15
+ <Button variant="secondary" aria-pressed={spanish} onClick={() => setSpanish(!spanish)}>
16
+ Spanish catalog
17
+ </Button>
18
+ <Button variant="secondary" aria-pressed={custom} onClick={() => setCustom(!custom)}>
19
+ Custom labels
20
+ </Button>
21
+ </div>
22
+ <I18nProvider locale={spanish ? 'es' : 'en'}>
23
+ <SettingsRow labels={custom ? labels : undefined} />
24
+ </I18nProvider>
25
+ </div>
26
+ );
27
+ }
@@ -0,0 +1,47 @@
1
+ import { render, screen } from '@testing-library/react';
2
+ import { I18nProvider } from '@gntik-ai/ui';
3
+ import { ValidationSummary } from './ValidationSummary';
4
+ const errors = [{ fieldId: 'email', label: 'Email', message: 'Consumer error' }];
5
+ it('preserves English and translates singular and plural counts', () => {
6
+ const { rerender } = render(<ValidationSummary errors={errors} />);
7
+ expect(screen.getByText('There is 1 problem with this form')).toBeVisible();
8
+ rerender(<ValidationSummary errors={[...errors, { fieldId: 'name', message: 'Another error' }]} />);
9
+ expect(screen.getByText('There are 2 problems with this form')).toBeVisible();
10
+ rerender(
11
+ <I18nProvider locale="es">
12
+ <ValidationSummary errors={errors} />
13
+ </I18nProvider>,
14
+ );
15
+ expect(screen.getByText('Hay 1 problema en este formulario')).toBeVisible();
16
+ rerender(
17
+ <I18nProvider locale="es">
18
+ <ValidationSummary errors={[...errors, { fieldId: 'name', message: 'Another error' }]} />
19
+ </I18nProvider>,
20
+ );
21
+ expect(screen.getByText('Hay 2 problemas en este formulario')).toBeVisible();
22
+ expect(screen.getByRole('link', { name: 'Email: Consumer error' })).toBeVisible();
23
+ });
24
+ it.each(['en', 'es'])('honours title prop before labels under %s', (locale) => {
25
+ const labels = { title: (count: number) => `Custom ${count} issues` };
26
+ const { rerender } = render(
27
+ <I18nProvider locale={locale}>
28
+ <ValidationSummary errors={errors} labels={labels} />
29
+ </I18nProvider>,
30
+ );
31
+ expect(screen.getByText('Custom 1 issues')).toBeVisible();
32
+ rerender(
33
+ <I18nProvider locale={locale}>
34
+ <ValidationSummary errors={errors} labels={labels} title="Explicit title" />
35
+ </I18nProvider>,
36
+ );
37
+ expect(screen.getByText('Explicit title')).toBeVisible();
38
+ });
39
+
40
+ it('keeps English counts byte-identical above the grouping threshold', () => {
41
+ render(
42
+ <ValidationSummary
43
+ errors={Array.from({ length: 1000 }, (_, i) => ({ fieldId: `field-${i}`, message: 'Consumer error' }))}
44
+ />,
45
+ );
46
+ expect(screen.getByText('There are 1000 problems with this form')).toBeVisible();
47
+ });
@@ -1,10 +1,15 @@
1
- import { Alert, Link, cn } from '@gntik-ai/ui';
1
+ import { useI18n, Alert, Link, cn } from '@gntik-ai/ui';
2
2
  import { useEffect, useRef, type ReactNode } from 'react';
3
3
  import { validationIssues, type ValidationIssue } from './fixtures';
4
4
 
5
5
  export type { ValidationIssue } from './fixtures';
6
6
 
7
+ export interface ValidationSummaryLabels {
8
+ title: (count: number) => string;
9
+ }
10
+
7
11
  export interface ValidationSummaryProps {
12
+ labels?: Partial<ValidationSummaryLabels>;
8
13
  errors?: ValidationIssue[];
9
14
  /** Increment on every submit attempt: the summary takes focus when there are errors. */
10
15
  submitCount?: number;
@@ -25,11 +30,13 @@ const focusField = (fieldId: string) => {
25
30
  * After a failed submit it takes focus, so screen readers announce it.
26
31
  */
27
32
  export function ValidationSummary({
33
+ labels,
28
34
  errors = validationIssues,
29
35
  submitCount = 0,
30
36
  title,
31
37
  className,
32
38
  }: ValidationSummaryProps) {
39
+ const { t } = useI18n();
33
40
  const ref = useRef<HTMLDivElement | null>(null);
34
41
  const hasErrors = errors.length > 0;
35
42
 
@@ -38,8 +45,7 @@ export function ValidationSummary({
38
45
  }, [submitCount, hasErrors]);
39
46
 
40
47
  if (!hasErrors) return null;
41
- const heading =
42
- title ?? `There ${errors.length === 1 ? 'is 1 problem' : `are ${errors.length} problems`} with this form`;
48
+ const heading = title ?? labels?.title?.(errors.length) ?? t('validationSummary.title', { count: errors.length });
43
49
  return (
44
50
  <Alert
45
51
  ref={ref}
@@ -47,10 +53,7 @@ export function ValidationSummary({
47
53
  role="region"
48
54
  tone="destructive"
49
55
  title={heading}
50
- className={cn(
51
- 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring',
52
- className,
53
- )}
56
+ className={cn('focus-ring', className)}
54
57
  >
55
58
  <ul className="mt-1 list-disc space-y-1 ps-4">
56
59
  {errors.map((e) => (
@@ -1,9 +1,14 @@
1
1
  import type { BlockMeta } from '../../meta';
2
+ import type { ValidationSummaryLabels } from './ValidationSummary';
2
3
 
3
4
  export const meta: BlockMeta = {
4
5
  name: 'Validation summary',
5
6
  family: 'forms',
6
7
  status: 'stable',
7
- description: 'Error summary that lists every problem with a link to its field and takes focus after a failed submit.',
8
+ description:
9
+ 'Error summary that lists every problem with a link to its field and takes focus after a failed submit. Optional labels?: Partial<ValidationSummaryLabels> overrides built-in copy; explicit props and validation messages win, then labels, then I18nProvider (en/es). No provider preserves English; fixtures and caller content stay unchanged. Interactive preview: /preview.html?kind=block&id=validation-summary--labels.',
10
+ labels: [
11
+ { key: 'title', type: '(count: number) => string', state: 'Default content and accessible names' },
12
+ ] satisfies Array<{ key: keyof ValidationSummaryLabels; type: string; state: string }>,
8
13
  uses: ['Alert', 'Link'],
9
14
  };
@@ -0,0 +1,24 @@
1
+ import { Button, I18nProvider } from '@gntik-ai/ui';
2
+ import { useState } from 'react';
3
+ import { ValidationSummary, type ValidationSummaryLabels } from '../ValidationSummary';
4
+
5
+ export default function Labels() {
6
+ const [spanish, setSpanish] = useState(false);
7
+ const [custom, setCustom] = useState(true);
8
+ const labels: Partial<ValidationSummaryLabels> = { title: (count) => `Please resolve ${count} issues` };
9
+ return (
10
+ <div className="grid gap-4">
11
+ <div className="flex flex-wrap gap-2">
12
+ <Button variant="secondary" aria-pressed={spanish} onClick={() => setSpanish(!spanish)}>
13
+ Spanish catalog
14
+ </Button>
15
+ <Button variant="secondary" aria-pressed={custom} onClick={() => setCustom(!custom)}>
16
+ Custom labels
17
+ </Button>
18
+ </div>
19
+ <I18nProvider locale={spanish ? 'es' : 'en'}>
20
+ <ValidationSummary labels={custom ? labels : undefined} />
21
+ </I18nProvider>
22
+ </div>
23
+ );
24
+ }
@@ -19,7 +19,11 @@ export * from './DialogWizard/DialogWizard';
19
19
  export { meta as dialogWizardMeta } from './DialogWizard/block.meta';
20
20
  export { dialogWizardCopy, dialogWizardSteps } from './DialogWizard/fixtures';
21
21
  export { meta as validationSummaryMeta } from './ValidationSummary/block.meta';
22
- export { ConfirmDestructiveDialog, type ConfirmDestructiveDialogProps } from './DangerZone/ConfirmDestructiveDialog';
22
+ export {
23
+ ConfirmDestructiveDialog,
24
+ type ConfirmDestructiveDialogProps,
25
+ type ConfirmDestructiveDialogLabels,
26
+ } from './DangerZone/ConfirmDestructiveDialog';
23
27
  export { dangerZoneActions } from './DangerZone/fixtures';
24
28
  export { memberRoles } from './InviteMembersDialog/fixtures';
25
29
  export { apiKeyScopes, apiKeyExpiries, generateDemoSecret } from './CreateApiKeyDialog/fixtures';
@@ -0,0 +1,12 @@
1
+ import { Fragment, type ReactNode } from 'react';
2
+
3
+ /** Keep caller-owned rich content in place while the catalog controls sentence order. */
4
+ export function translatedContent(message: string, values: Record<string, ReactNode>): ReactNode {
5
+ return message
6
+ .split(/(\{\w+\})/)
7
+ .map((part, index) => (
8
+ <Fragment key={index}>
9
+ {part.startsWith('{') && part.endsWith('}') ? (values[part.slice(1, -1)] ?? part) : part}
10
+ </Fragment>
11
+ ));
12
+ }
@@ -0,0 +1,2 @@
1
+ export { useTableData } from './useTableData';
2
+ export type { TableDataParams, TableDataResult, UseTableDataOptions, UseTableDataResult } from './useTableData';