@b1-road/react 0.1.0-alpha.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.
- package/LICENSE +21 -0
- package/README.md +300 -0
- package/dist/__tests__/a11y.test.d.ts +1 -0
- package/dist/__tests__/contract-replay.test.d.ts +1 -0
- package/dist/__tests__/create-role-dialog.test.d.ts +1 -0
- package/dist/__tests__/form-errors.test.d.ts +1 -0
- package/dist/__tests__/pending-invitations.test.d.ts +1 -0
- package/dist/__tests__/setup.d.ts +0 -0
- package/dist/api/client.d.ts +253 -0
- package/dist/api/client.test.d.ts +1 -0
- package/dist/api/cookie-mode.test.d.ts +1 -0
- package/dist/api/errors.d.ts +107 -0
- package/dist/api/errors.test.d.ts +1 -0
- package/dist/api/hooks.d.ts +126 -0
- package/dist/api/hooks.test.d.ts +1 -0
- package/dist/api/mock-client.d.ts +121 -0
- package/dist/api/mock-client.test.d.ts +1 -0
- package/dist/api/types.d.ts +7 -0
- package/dist/appearance/appearance.d.ts +19 -0
- package/dist/components/BusinessUnitSwitcher.d.ts +15 -0
- package/dist/components/BusinessUnitsMgmt.d.ts +35 -0
- package/dist/components/business-units/BusinessUnitDetail.d.ts +6 -0
- package/dist/components/business-units/BusinessUnitList.d.ts +5 -0
- package/dist/components/business-units/BusinessUnitRow.d.ts +7 -0
- package/dist/components/business-units/BusinessUnitSettings.d.ts +5 -0
- package/dist/components/business-units/BusinessUnitsTab.d.ts +5 -0
- package/dist/components/business-units/CreateBusinessUnitForm.d.ts +6 -0
- package/dist/components/business-units/MembersList.d.ts +5 -0
- package/dist/components/business-units/PendingInvitations.d.ts +15 -0
- package/dist/components/invitations/InvitationsList.d.ts +7 -0
- package/dist/components/invitations/InvitationsTab.d.ts +5 -0
- package/dist/components/invitations/InviteForm.d.ts +7 -0
- package/dist/components/roles/BUSelector.d.ts +8 -0
- package/dist/components/roles/CreateRoleDialog.d.ts +8 -0
- package/dist/components/roles/PermissionPicker.d.ts +10 -0
- package/dist/components/roles/RoleEditor.d.ts +7 -0
- package/dist/components/roles/RoleRow.d.ts +7 -0
- package/dist/components/roles/RolesList.d.ts +7 -0
- package/dist/components/roles/RolesTab.d.ts +1 -0
- package/dist/components/shared/Avatar.d.ts +7 -0
- package/dist/components/shared/EmptyState.d.ts +10 -0
- package/dist/components/shared/LoadMoreFooter.d.ts +18 -0
- package/dist/i18n/context.d.ts +21 -0
- package/dist/i18n/en.d.ts +2 -0
- package/dist/i18n/pt-BR.d.ts +2 -0
- package/dist/i18n/types.d.ts +227 -0
- package/dist/index.cjs +56 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.js +16566 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/cn.d.ts +2 -0
- package/dist/lib/use-form-errors.d.ts +34 -0
- package/dist/provider/RoadProvider.d.ts +93 -0
- package/dist/provider/context.d.ts +12 -0
- package/dist/provider/cookie-mode-integration.test.d.ts +1 -0
- package/dist/provider/current-business-unit.d.ts +37 -0
- package/dist/provider/current-business-unit.test.d.ts +1 -0
- package/dist/provider/strict-mode-checks.test.d.ts +1 -0
- package/dist/style.css +1 -0
- package/dist/ui/alert-dialog.d.ts +8 -0
- package/dist/ui/badge.d.ts +9 -0
- package/dist/ui/button.d.ts +11 -0
- package/dist/ui/checkbox.d.ts +2 -0
- package/dist/ui/dialog.d.ts +17 -0
- package/dist/ui/dropdown-menu.d.ts +10 -0
- package/dist/ui/field.d.ts +26 -0
- package/dist/ui/input.d.ts +4 -0
- package/dist/ui/label.d.ts +2 -0
- package/dist/ui/select.d.ts +6 -0
- package/dist/ui/skeleton.d.ts +2 -0
- package/dist/ui/tabs.d.ts +5 -0
- package/dist/ui/textarea.d.ts +2 -0
- package/dist/ui/tooltip.d.ts +5 -0
- package/package.json +126 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Localization, PluralForm } from './types';
|
|
2
|
+
type DeepPartial<T> = {
|
|
3
|
+
[K in keyof T]?: T[K] extends object ? DeepPartial<T[K]> : T[K];
|
|
4
|
+
};
|
|
5
|
+
export type LocalizationOverride = DeepPartial<Localization>;
|
|
6
|
+
export declare const BUILT_IN_LOCALES: {
|
|
7
|
+
readonly en: Localization;
|
|
8
|
+
readonly "pt-BR": Localization;
|
|
9
|
+
};
|
|
10
|
+
export type BuiltInLocale = keyof typeof BUILT_IN_LOCALES;
|
|
11
|
+
declare function format(template: string, vars?: Record<string, string | number>): string;
|
|
12
|
+
declare function plural(form: PluralForm, count: number, vars?: Record<string, string | number>): string;
|
|
13
|
+
export interface Translator {
|
|
14
|
+
dict: Localization;
|
|
15
|
+
locale: string;
|
|
16
|
+
format: typeof format;
|
|
17
|
+
plural: typeof plural;
|
|
18
|
+
relative: (iso: string) => string;
|
|
19
|
+
}
|
|
20
|
+
export declare function useT(): Translator;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Full string catalog for the widget. Every visible label lives here so
|
|
3
|
+
* integrators can override any of them via `<RoadProvider localization={…}>`.
|
|
4
|
+
*
|
|
5
|
+
* Strings may contain `{{name}}` placeholders that the `t.format(...)`
|
|
6
|
+
* helper interpolates. Plurals are expressed as two-form objects
|
|
7
|
+
* (`{ one, other }`) and resolved by `t.plural(...)`.
|
|
8
|
+
*/
|
|
9
|
+
export interface PluralForm {
|
|
10
|
+
one: string;
|
|
11
|
+
other: string;
|
|
12
|
+
}
|
|
13
|
+
export interface Localization {
|
|
14
|
+
common: {
|
|
15
|
+
cancel: string;
|
|
16
|
+
save: string;
|
|
17
|
+
saveChanges: string;
|
|
18
|
+
discard: string;
|
|
19
|
+
delete: string;
|
|
20
|
+
remove: string;
|
|
21
|
+
edit: string;
|
|
22
|
+
create: string;
|
|
23
|
+
search: string;
|
|
24
|
+
refresh: string;
|
|
25
|
+
back: string;
|
|
26
|
+
close: string;
|
|
27
|
+
submit: string;
|
|
28
|
+
tryAgain: string;
|
|
29
|
+
noMatches: string;
|
|
30
|
+
noMatchesQuery: string;
|
|
31
|
+
yes: string;
|
|
32
|
+
no: string;
|
|
33
|
+
you: string;
|
|
34
|
+
system: string;
|
|
35
|
+
suspended: string;
|
|
36
|
+
member: PluralForm;
|
|
37
|
+
permission: PluralForm;
|
|
38
|
+
day: PluralForm;
|
|
39
|
+
invitation: PluralForm;
|
|
40
|
+
selectedCountOf: string;
|
|
41
|
+
sendCount: string;
|
|
42
|
+
loadMore: string;
|
|
43
|
+
loading: string;
|
|
44
|
+
showingOf: string;
|
|
45
|
+
actionFailed: string;
|
|
46
|
+
};
|
|
47
|
+
shell: {
|
|
48
|
+
triggerLabel: string;
|
|
49
|
+
modalTitle: string;
|
|
50
|
+
modalDescription: string;
|
|
51
|
+
tabBusinessUnits: string;
|
|
52
|
+
tabRoles: string;
|
|
53
|
+
};
|
|
54
|
+
switcher: {
|
|
55
|
+
triggerCurrentLabel: string;
|
|
56
|
+
triggerSelectLabel: string;
|
|
57
|
+
triggerEmptyLabel: string;
|
|
58
|
+
triggerLoadingLabel: string;
|
|
59
|
+
triggerErrorLabel: string;
|
|
60
|
+
switcherHeader: string;
|
|
61
|
+
pendingInvitationsHeader: string;
|
|
62
|
+
invitedTitle: string;
|
|
63
|
+
pendingCount: PluralForm;
|
|
64
|
+
searchPlaceholder: string;
|
|
65
|
+
noMatches: string;
|
|
66
|
+
manageCta: string;
|
|
67
|
+
currentBadge: string;
|
|
68
|
+
emptyTitle: string;
|
|
69
|
+
emptyCta: string;
|
|
70
|
+
errorTitle: string;
|
|
71
|
+
errorRetry: string;
|
|
72
|
+
};
|
|
73
|
+
businessUnits: {
|
|
74
|
+
emptyTitle: string;
|
|
75
|
+
emptyDescription: string;
|
|
76
|
+
emptyCta: string;
|
|
77
|
+
listSearchPlaceholder: string;
|
|
78
|
+
newButton: string;
|
|
79
|
+
errorTitle: string;
|
|
80
|
+
errorDescription: string;
|
|
81
|
+
createFormName: string;
|
|
82
|
+
createNamePlaceholder: string;
|
|
83
|
+
createSubmit: string;
|
|
84
|
+
createNameTaken: string;
|
|
85
|
+
detailMemberCount: PluralForm;
|
|
86
|
+
detailTabMembers: string;
|
|
87
|
+
detailTabInvitations: string;
|
|
88
|
+
detailTabSettings: string;
|
|
89
|
+
settingsName: string;
|
|
90
|
+
settingsIdentifier: string;
|
|
91
|
+
settingsIdentifierHelp: string;
|
|
92
|
+
settingsMemberLimit: string;
|
|
93
|
+
settingsMemberLimitHelp: string;
|
|
94
|
+
memberLimitInvalid: string;
|
|
95
|
+
settingsJoinCode: string;
|
|
96
|
+
settingsJoinCodeHelp: string;
|
|
97
|
+
};
|
|
98
|
+
members: {
|
|
99
|
+
emptyTitle: string;
|
|
100
|
+
emptyDescription: string;
|
|
101
|
+
searchPlaceholder: string;
|
|
102
|
+
suspend: string;
|
|
103
|
+
reinstate: string;
|
|
104
|
+
suspendToast: string;
|
|
105
|
+
reinstateToast: string;
|
|
106
|
+
undo: string;
|
|
107
|
+
removeTitle: string;
|
|
108
|
+
removeDescription: string;
|
|
109
|
+
removeConfirm: string;
|
|
110
|
+
removeToast: string;
|
|
111
|
+
perBuSearchPlaceholder: string;
|
|
112
|
+
crossBuSearchPlaceholder: string;
|
|
113
|
+
pendingInvitationsHeader: string;
|
|
114
|
+
invitedToJoin: string;
|
|
115
|
+
invitedAs: string;
|
|
116
|
+
expiresInDays: PluralForm;
|
|
117
|
+
expiresToday: string;
|
|
118
|
+
accept: string;
|
|
119
|
+
decline: string;
|
|
120
|
+
joined: string;
|
|
121
|
+
declined: string;
|
|
122
|
+
couldNotLoad: string;
|
|
123
|
+
partialLoadWarning: string;
|
|
124
|
+
};
|
|
125
|
+
roles: {
|
|
126
|
+
emptyTitle: string;
|
|
127
|
+
emptyDescription: string;
|
|
128
|
+
emptyCta: string;
|
|
129
|
+
newButton: string;
|
|
130
|
+
buSelectorLabel: string;
|
|
131
|
+
noBusinessUnits: string;
|
|
132
|
+
noAccessTitle: string;
|
|
133
|
+
noAccessDescription: string;
|
|
134
|
+
couldNotLoad: string;
|
|
135
|
+
couldNotLoadDescription: string;
|
|
136
|
+
notFound: string;
|
|
137
|
+
rowAllPermissions: string;
|
|
138
|
+
rowPermissionsCount: PluralForm;
|
|
139
|
+
systemBadge: string;
|
|
140
|
+
systemBannerNote: string;
|
|
141
|
+
editorName: string;
|
|
142
|
+
editorDescription: string;
|
|
143
|
+
editorDescriptionPlaceholder: string;
|
|
144
|
+
permissionsHeader: string;
|
|
145
|
+
deleteRole: string;
|
|
146
|
+
deleteTitle: string;
|
|
147
|
+
deleteDescription: string;
|
|
148
|
+
deleteConfirm: string;
|
|
149
|
+
deleteToast: string;
|
|
150
|
+
savedToast: string;
|
|
151
|
+
allPermissionsBadge: string;
|
|
152
|
+
allPermissionsDescription: string;
|
|
153
|
+
create: {
|
|
154
|
+
title: string;
|
|
155
|
+
descChoose: string;
|
|
156
|
+
descBlank: string;
|
|
157
|
+
descClonePick: string;
|
|
158
|
+
descCloneName: string;
|
|
159
|
+
blankTitle: string;
|
|
160
|
+
blankDescription: string;
|
|
161
|
+
cloneTitle: string;
|
|
162
|
+
cloneDescriptionAvailable: string;
|
|
163
|
+
cloneDescriptionUnavailable: string;
|
|
164
|
+
pickSourcePrompt: string;
|
|
165
|
+
cloningFromBanner: string;
|
|
166
|
+
nameField: string;
|
|
167
|
+
namePlaceholder: string;
|
|
168
|
+
descriptionField: string;
|
|
169
|
+
descriptionPlaceholder: string;
|
|
170
|
+
permissionsHint: string;
|
|
171
|
+
permissionsError: string;
|
|
172
|
+
submit: string;
|
|
173
|
+
createdToast: string;
|
|
174
|
+
};
|
|
175
|
+
};
|
|
176
|
+
invitations: {
|
|
177
|
+
emptyTitle: string;
|
|
178
|
+
emptyDescription: string;
|
|
179
|
+
inviteButton: string;
|
|
180
|
+
formEmailsField: string;
|
|
181
|
+
formEmailsPlaceholder: string;
|
|
182
|
+
formEmailsHelp: string;
|
|
183
|
+
formEmailsValidCount: string;
|
|
184
|
+
formEmailsInvalidCount: string;
|
|
185
|
+
formRoleField: string;
|
|
186
|
+
formRolePlaceholder: string;
|
|
187
|
+
formSubmitSingle: string;
|
|
188
|
+
formSubmitMany: string;
|
|
189
|
+
sentToast: string;
|
|
190
|
+
sentSingleToast: string;
|
|
191
|
+
sentPartialToast: string;
|
|
192
|
+
sentErrorToast: string;
|
|
193
|
+
resend: string;
|
|
194
|
+
cancel: string;
|
|
195
|
+
resendToast: string;
|
|
196
|
+
cancelToast: string;
|
|
197
|
+
cancelTitle: string;
|
|
198
|
+
cancelDescription: string;
|
|
199
|
+
cancelConfirm: string;
|
|
200
|
+
cancelKeep: string;
|
|
201
|
+
couldNotLoad: string;
|
|
202
|
+
statusPending: string;
|
|
203
|
+
statusAccepted: string;
|
|
204
|
+
statusExpired: string;
|
|
205
|
+
statusCancelled: string;
|
|
206
|
+
statusRejected: string;
|
|
207
|
+
invitedRelative: string;
|
|
208
|
+
expiresRelative: string;
|
|
209
|
+
};
|
|
210
|
+
/**
|
|
211
|
+
* Inline form-validation copy. The client surfaces these next to the
|
|
212
|
+
* offending input before a request is sent; `generic` is the fallback for a
|
|
213
|
+
* server-reported field with no matching client rule, and `formSummary` is the
|
|
214
|
+
* top-of-form line when an error can't be tied to a specific field.
|
|
215
|
+
*/
|
|
216
|
+
validation: {
|
|
217
|
+
required: string;
|
|
218
|
+
/** `{{max}}` — maximum character count. */
|
|
219
|
+
tooLong: string;
|
|
220
|
+
slugFormat: string;
|
|
221
|
+
emailInvalid: string;
|
|
222
|
+
urlInvalid: string;
|
|
223
|
+
atLeastOne: string;
|
|
224
|
+
generic: string;
|
|
225
|
+
formSummary: string;
|
|
226
|
+
};
|
|
227
|
+
}
|