@voyantjs/booking-requirements-ui 0.15.0 → 0.17.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/README.md +15 -0
- package/dist/components/booking-requirements-contact-tab.d.ts.map +1 -1
- package/dist/components/booking-requirements-contact-tab.js +3 -1
- package/dist/components/booking-requirements-questions-tab.d.ts.map +1 -1
- package/dist/components/booking-requirements-questions-tab.js +6 -2
- package/dist/i18n/en.d.ts +94 -0
- package/dist/i18n/en.d.ts.map +1 -0
- package/dist/i18n/en.js +93 -0
- package/dist/i18n/index.d.ts +5 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +3 -0
- package/dist/i18n/messages.d.ts +59 -0
- package/dist/i18n/messages.d.ts.map +1 -0
- package/dist/i18n/messages.js +1 -0
- package/dist/i18n/provider.d.ts +210 -0
- package/dist/i18n/provider.d.ts.map +1 -0
- package/dist/i18n/provider.js +44 -0
- package/dist/i18n/ro.d.ts +94 -0
- package/dist/i18n/ro.d.ts.map +1 -0
- package/dist/i18n/ro.js +93 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/package.json +21 -5
package/README.md
CHANGED
|
@@ -12,6 +12,21 @@ pnpm add @voyantjs/booking-requirements-ui @voyantjs/booking-requirements-react
|
|
|
12
12
|
|
|
13
13
|
All components accept a `className` prop and merge it with `cn()`. Wrap or compose to extend; use the registry copy-paste path (`npx shadcn add @voyant/...`) for components you want to fork outright.
|
|
14
14
|
|
|
15
|
+
## I18n
|
|
16
|
+
|
|
17
|
+
Components render English by default. To localize them, wrap your UI in
|
|
18
|
+
`BookingRequirementsUiMessagesProvider` and import only the locales your app
|
|
19
|
+
supports.
|
|
20
|
+
|
|
21
|
+
```tsx
|
|
22
|
+
import { BookingRequirementsUiMessagesProvider } from "@voyantjs/booking-requirements-ui"
|
|
23
|
+
import { bookingRequirementsUiEn } from "@voyantjs/booking-requirements-ui/i18n/en"
|
|
24
|
+
import { bookingRequirementsUiRo } from "@voyantjs/booking-requirements-ui/i18n/ro"
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
English-only apps should import only `./i18n/en`. Bilingual apps can import
|
|
28
|
+
`./i18n/en` and `./i18n/ro`.
|
|
29
|
+
|
|
15
30
|
## Not included (registry-only)
|
|
16
31
|
|
|
17
32
|
Some components couple to TanStack Router or template-local helpers and remain available only via the shadcn registry: `booking-question-dialog`, `contact-requirement-dialog`, `question-option-dialog`. Import via `npx shadcn add @voyant/<component>` and customize per-project.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"booking-requirements-contact-tab.d.ts","sourceRoot":"","sources":["../../src/components/booking-requirements-contact-tab.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAA;
|
|
1
|
+
{"version":3,"file":"booking-requirements-contact-tab.d.ts","sourceRoot":"","sources":["../../src/components/booking-requirements-contact-tab.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAA;AAM9E,wBAAgB,6BAA6B,CAAC,EAC5C,IAAI,EACJ,QAAQ,EACR,MAAM,EACN,QAAQ,GACT,EAAE;IACD,IAAI,EAAE,kBAAkB,EAAE,CAAA;IAC1B,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,MAAM,EAAE,CAAC,GAAG,EAAE,kBAAkB,KAAK,IAAI,CAAA;IACzC,QAAQ,EAAE,CAAC,GAAG,EAAE,kBAAkB,KAAK,IAAI,CAAA;CAC5C,2CAiGA"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Badge, Button } from "@voyantjs/ui/components";
|
|
3
3
|
import { Pencil, Plus, Trash2 } from "lucide-react";
|
|
4
|
+
import { useBookingRequirementsUiMessagesOrDefault } from "../i18n";
|
|
4
5
|
export function BookingRequirementsContactTab({ rows, onCreate, onEdit, onDelete, }) {
|
|
5
|
-
|
|
6
|
+
const messages = useBookingRequirementsUiMessagesOrDefault();
|
|
7
|
+
return (_jsxs("div", { className: "flex flex-col gap-4", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsxs("div", { children: [_jsx("h2", { className: "text-lg font-semibold", children: messages.contactTab.title }), _jsx("p", { className: "text-sm text-muted-foreground", children: messages.contactTab.description })] }), _jsxs(Button, { size: "sm", onClick: onCreate, children: [_jsx(Plus, { className: "mr-2 h-4 w-4" }), messages.contactTab.addRequirement] })] }), rows.length === 0 ? (_jsx("div", { className: "rounded-md border border-dashed p-8 text-center", children: _jsx("p", { className: "text-sm text-muted-foreground", children: messages.contactTab.empty }) })) : (_jsx("div", { className: "rounded-md border bg-background", children: _jsxs("table", { className: "w-full text-sm", children: [_jsx("thead", { children: _jsxs("tr", { className: "border-b text-muted-foreground", children: [_jsx("th", { className: "p-3 text-left font-medium", children: messages.contactTab.columns.field }), _jsx("th", { className: "p-3 text-left font-medium", children: messages.contactTab.columns.scope }), _jsx("th", { className: "p-3 text-left font-medium", children: messages.contactTab.columns.required }), _jsx("th", { className: "p-3 text-left font-medium", children: messages.contactTab.columns.perTraveler }), _jsx("th", { className: "p-3 text-left font-medium", children: messages.contactTab.columns.sort }), _jsx("th", { className: "p-3 text-left font-medium", children: messages.contactTab.columns.status }), _jsx("th", { className: "w-20 p-3" })] }) }), _jsx("tbody", { children: rows.map((row) => (_jsxs("tr", { className: "border-b last:border-b-0", children: [_jsx("td", { className: "p-3 font-medium", children: messages.common.fieldKeyLabels[row.fieldKey] }), _jsx("td", { className: "p-3 text-muted-foreground", children: messages.common.scopeLabels[row.scope] }), _jsx("td", { className: "p-3", children: row.isRequired ? (_jsx(Badge, { variant: "default", children: messages.common.required })) : (_jsx(Badge, { variant: "outline", children: messages.common.optional })) }), _jsx("td", { className: "p-3", children: row.perTraveler ? (_jsx(Badge, { variant: "secondary", children: messages.common.yes })) : (_jsx("span", { className: "text-xs text-muted-foreground", children: messages.common.no })) }), _jsx("td", { className: "p-3 font-mono text-xs", children: row.sortOrder }), _jsx("td", { className: "p-3", children: _jsx(Badge, { variant: row.active ? "default" : "outline", children: row.active ? messages.common.active : messages.common.inactive }) }), _jsx("td", { className: "p-3", children: _jsxs("div", { className: "flex items-center gap-1", children: [_jsx("button", { type: "button", onClick: () => onEdit(row), "aria-label": messages.common.edit, title: messages.common.edit, className: "text-muted-foreground hover:text-foreground", children: _jsx(Pencil, { className: "h-3.5 w-3.5" }) }), _jsx("button", { type: "button", onClick: () => onDelete(row), "aria-label": messages.common.delete, title: messages.common.delete, className: "text-muted-foreground hover:text-destructive", children: _jsx(Trash2, { className: "h-3.5 w-3.5" }) })] }) })] }, row.id))) })] }) }))] }));
|
|
6
8
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"booking-requirements-questions-tab.d.ts","sourceRoot":"","sources":["../../src/components/booking-requirements-questions-tab.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAE3B,MAAM,sCAAsC,CAAA;
|
|
1
|
+
{"version":3,"file":"booking-requirements-questions-tab.d.ts","sourceRoot":"","sources":["../../src/components/booking-requirements-questions-tab.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAE3B,MAAM,sCAAsC,CAAA;AAM7C,wBAAgB,+BAA+B,CAAC,EAC9C,IAAI,EACJ,WAAW,EACX,mBAAmB,EACnB,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,cAAc,GACf,EAAE;IACD,IAAI,EAAE,eAAe,EAAE,CAAA;IACvB,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IACxB,mBAAmB,EAAE,GAAG,CAAC,MAAM,EAAE,qBAAqB,EAAE,CAAC,CAAA;IACzD,QAAQ,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAA;IACtC,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,MAAM,EAAE,CAAC,QAAQ,EAAE,eAAe,KAAK,IAAI,CAAA;IAC3C,QAAQ,EAAE,CAAC,QAAQ,EAAE,eAAe,KAAK,IAAI,CAAA;IAC7C,cAAc,EAAE,CAAC,QAAQ,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAA;IACrE,YAAY,EAAE,CAAC,QAAQ,EAAE,eAAe,EAAE,MAAM,EAAE,qBAAqB,KAAK,IAAI,CAAA;IAChF,cAAc,EAAE,CAAC,MAAM,EAAE,qBAAqB,KAAK,IAAI,CAAA;CACxD,2CAsMA"}
|
|
@@ -2,12 +2,16 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import { SELECT_TYPES, } from "@voyantjs/booking-requirements-react";
|
|
3
3
|
import { Badge, Button } from "@voyantjs/ui/components";
|
|
4
4
|
import { Pencil, Plus, Trash2 } from "lucide-react";
|
|
5
|
+
import { useBookingRequirementsUiMessagesOrDefault } from "../i18n";
|
|
5
6
|
export function BookingRequirementsQuestionsTab({ rows, expandedIds, questionOptionsById, onToggle, onCreate, onEdit, onDelete, onCreateOption, onEditOption, onDeleteOption, }) {
|
|
6
|
-
|
|
7
|
+
const messages = useBookingRequirementsUiMessagesOrDefault();
|
|
8
|
+
return (_jsxs("div", { className: "flex flex-col gap-4", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsxs("div", { children: [_jsx("h2", { className: "text-lg font-semibold", children: messages.questionsTab.title }), _jsx("p", { className: "text-sm text-muted-foreground", children: messages.questionsTab.description })] }), _jsxs(Button, { size: "sm", onClick: onCreate, children: [_jsx(Plus, { className: "mr-2 h-4 w-4" }), messages.questionsTab.addQuestion] })] }), rows.length === 0 ? (_jsx("div", { className: "rounded-md border border-dashed p-8 text-center", children: _jsx("p", { className: "text-sm text-muted-foreground", children: messages.questionsTab.empty }) })) : (_jsx("div", { className: "flex flex-col gap-2", children: rows.map((question) => {
|
|
7
9
|
const expanded = expandedIds.has(question.id);
|
|
8
10
|
const options = (questionOptionsById.get(question.id) ?? []).slice();
|
|
9
11
|
const hasChoices = SELECT_TYPES.has(question.fieldType);
|
|
10
12
|
const nextSort = options.length > 0 ? Math.max(...options.map((option) => option.sortOrder)) + 1 : 0;
|
|
11
|
-
return (_jsxs("div", { className: "rounded-md border", children: [_jsxs("div", { className: "flex items-center gap-3 p-3", children: [_jsx("button", { type: "button", onClick: () => onToggle(question.id), className: "text-sm text-muted-foreground hover:text-foreground", children: expanded ?
|
|
13
|
+
return (_jsxs("div", { className: "rounded-md border", children: [_jsxs("div", { className: "flex items-center gap-3 p-3", children: [_jsx("button", { type: "button", onClick: () => onToggle(question.id), className: "text-sm text-muted-foreground hover:text-foreground", children: expanded ? messages.common.hide : messages.common.show }), _jsxs("div", { className: "flex-1", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [_jsx("span", { className: "text-sm font-medium", children: question.label }), question.code ? (_jsx("span", { className: "font-mono text-xs text-muted-foreground", children: question.code })) : null, _jsx(Badge, { variant: "outline", children: messages.common.questionFieldTypeLabels[question.fieldType] }), _jsx(Badge, { variant: "secondary", children: messages.common.questionTargetLabels[question.target] }), question.isRequired ? (_jsx(Badge, { variant: "default", children: messages.common.required })) : null, _jsx(Badge, { variant: question.active ? "default" : "outline", children: question.active ? messages.common.active : messages.common.inactive })] }), question.description ? (_jsx("p", { className: "mt-1 text-xs text-muted-foreground", children: question.description })) : null] }), _jsxs("div", { className: "flex items-center gap-1", children: [_jsx(Button, { variant: "ghost", size: "sm", onClick: () => onEdit(question), "aria-label": messages.common.edit, title: messages.common.edit, children: _jsx(Pencil, { className: "h-3.5 w-3.5" }) }), _jsx(Button, { variant: "ghost", size: "sm", onClick: () => onDelete(question), "aria-label": messages.common.delete, title: messages.common.delete, children: _jsx(Trash2, { className: "h-3.5 w-3.5" }) })] })] }), expanded ? (_jsxs("div", { className: "border-t bg-muted/30 p-3", children: [!hasChoices ? (_jsx("p", { className: "py-2 text-center text-xs text-muted-foreground", children: messages.questionsTab.choiceTypesHint })) : null, hasChoices ? (_jsxs(_Fragment, { children: [_jsxs("div", { className: "mb-2 flex items-center justify-between", children: [_jsx("p", { className: "text-xs font-medium uppercase tracking-wide text-muted-foreground", children: messages.questionsTab.choices }), _jsxs(Button, { variant: "outline", size: "sm", onClick: () => onCreateOption(question, nextSort), children: [_jsx(Plus, { className: "mr-1 h-3 w-3" }), messages.questionsTab.addChoice] })] }), options.length === 0 ? (_jsx("p", { className: "py-2 text-center text-xs text-muted-foreground", children: messages.questionsTab.noChoices })) : (_jsx("div", { className: "rounded border bg-background", children: _jsxs("table", { className: "w-full text-xs", children: [_jsx("thead", { children: _jsxs("tr", { className: "border-b text-muted-foreground", children: [_jsx("th", { className: "p-2 text-left font-medium", children: messages.questionsTab.columns.sort }), _jsx("th", { className: "p-2 text-left font-medium", children: messages.questionsTab.columns.value }), _jsx("th", { className: "p-2 text-left font-medium", children: messages.questionsTab.columns.label }), _jsx("th", { className: "p-2 text-left font-medium", children: messages.questionsTab.columns.default }), _jsx("th", { className: "p-2 text-left font-medium", children: messages.questionsTab.columns.status }), _jsx("th", { className: "w-16 p-2" })] }) }), _jsx("tbody", { children: options.map((option) => (_jsxs("tr", { className: "border-b last:border-b-0", children: [_jsx("td", { className: "p-2 font-mono", children: option.sortOrder }), _jsx("td", { className: "p-2 font-mono text-muted-foreground", children: option.value }), _jsx("td", { className: "p-2", children: option.label }), _jsx("td", { className: "p-2", children: option.isDefault ? (_jsx(Badge, { variant: "secondary", children: messages.common.default })) : (_jsx("span", { className: "text-muted-foreground", children: "-" })) }), _jsx("td", { className: "p-2", children: _jsx(Badge, { variant: option.active ? "default" : "outline", children: option.active
|
|
14
|
+
? messages.common.active
|
|
15
|
+
: messages.common.inactive }) }), _jsx("td", { className: "p-2", children: _jsxs("div", { className: "flex items-center gap-1", children: [_jsx("button", { type: "button", onClick: () => onEditOption(question, option), "aria-label": messages.common.edit, title: messages.common.edit, className: "text-muted-foreground hover:text-foreground", children: _jsx(Pencil, { className: "h-3 w-3" }) }), _jsx("button", { type: "button", onClick: () => onDeleteOption(option), "aria-label": messages.common.delete, title: messages.common.delete, className: "text-muted-foreground hover:text-destructive", children: _jsx(Trash2, { className: "h-3 w-3" }) })] }) })] }, option.id))) })] }) }))] })) : null] })) : null] }, question.id));
|
|
12
16
|
}) }))] }));
|
|
13
17
|
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
export declare const bookingRequirementsUiEn: {
|
|
2
|
+
common: {
|
|
3
|
+
edit: string;
|
|
4
|
+
delete: string;
|
|
5
|
+
add: string;
|
|
6
|
+
show: string;
|
|
7
|
+
hide: string;
|
|
8
|
+
required: string;
|
|
9
|
+
optional: string;
|
|
10
|
+
yes: string;
|
|
11
|
+
no: string;
|
|
12
|
+
active: string;
|
|
13
|
+
inactive: string;
|
|
14
|
+
default: string;
|
|
15
|
+
fieldKeyLabels: {
|
|
16
|
+
first_name: string;
|
|
17
|
+
last_name: string;
|
|
18
|
+
email: string;
|
|
19
|
+
phone: string;
|
|
20
|
+
date_of_birth: string;
|
|
21
|
+
nationality: string;
|
|
22
|
+
passport_number: string;
|
|
23
|
+
passport_expiry: string;
|
|
24
|
+
dietary_requirements: string;
|
|
25
|
+
accessibility_needs: string;
|
|
26
|
+
special_requests: string;
|
|
27
|
+
address: string;
|
|
28
|
+
other: string;
|
|
29
|
+
};
|
|
30
|
+
scopeLabels: {
|
|
31
|
+
booking: string;
|
|
32
|
+
lead_traveler: string;
|
|
33
|
+
traveler: string;
|
|
34
|
+
booker: string;
|
|
35
|
+
};
|
|
36
|
+
questionTargetLabels: {
|
|
37
|
+
booking: string;
|
|
38
|
+
traveler: string;
|
|
39
|
+
lead_traveler: string;
|
|
40
|
+
booker: string;
|
|
41
|
+
extra: string;
|
|
42
|
+
service: string;
|
|
43
|
+
};
|
|
44
|
+
questionFieldTypeLabels: {
|
|
45
|
+
text: string;
|
|
46
|
+
textarea: string;
|
|
47
|
+
number: string;
|
|
48
|
+
email: string;
|
|
49
|
+
phone: string;
|
|
50
|
+
date: string;
|
|
51
|
+
datetime: string;
|
|
52
|
+
boolean: string;
|
|
53
|
+
single_select: string;
|
|
54
|
+
multi_select: string;
|
|
55
|
+
file: string;
|
|
56
|
+
country: string;
|
|
57
|
+
other: string;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
contactTab: {
|
|
61
|
+
title: string;
|
|
62
|
+
description: string;
|
|
63
|
+
addRequirement: string;
|
|
64
|
+
empty: string;
|
|
65
|
+
columns: {
|
|
66
|
+
field: string;
|
|
67
|
+
scope: string;
|
|
68
|
+
required: string;
|
|
69
|
+
perTraveler: string;
|
|
70
|
+
sort: string;
|
|
71
|
+
status: string;
|
|
72
|
+
actions: string;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
questionsTab: {
|
|
76
|
+
title: string;
|
|
77
|
+
description: string;
|
|
78
|
+
addQuestion: string;
|
|
79
|
+
empty: string;
|
|
80
|
+
choiceTypesHint: string;
|
|
81
|
+
choices: string;
|
|
82
|
+
addChoice: string;
|
|
83
|
+
noChoices: string;
|
|
84
|
+
columns: {
|
|
85
|
+
sort: string;
|
|
86
|
+
value: string;
|
|
87
|
+
label: string;
|
|
88
|
+
default: string;
|
|
89
|
+
status: string;
|
|
90
|
+
actions: string;
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
//# sourceMappingURL=en.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../src/i18n/en.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4FK,CAAA"}
|
package/dist/i18n/en.js
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
export const bookingRequirementsUiEn = {
|
|
2
|
+
common: {
|
|
3
|
+
edit: "Edit",
|
|
4
|
+
delete: "Delete",
|
|
5
|
+
add: "Add",
|
|
6
|
+
show: "Show",
|
|
7
|
+
hide: "Hide",
|
|
8
|
+
required: "Required",
|
|
9
|
+
optional: "Optional",
|
|
10
|
+
yes: "Yes",
|
|
11
|
+
no: "No",
|
|
12
|
+
active: "Active",
|
|
13
|
+
inactive: "Inactive",
|
|
14
|
+
default: "Default",
|
|
15
|
+
fieldKeyLabels: {
|
|
16
|
+
first_name: "First name",
|
|
17
|
+
last_name: "Last name",
|
|
18
|
+
email: "Email",
|
|
19
|
+
phone: "Phone",
|
|
20
|
+
date_of_birth: "Date of birth",
|
|
21
|
+
nationality: "Nationality",
|
|
22
|
+
passport_number: "Passport number",
|
|
23
|
+
passport_expiry: "Passport expiry",
|
|
24
|
+
dietary_requirements: "Dietary requirements",
|
|
25
|
+
accessibility_needs: "Accessibility needs",
|
|
26
|
+
special_requests: "Special requests",
|
|
27
|
+
address: "Address",
|
|
28
|
+
other: "Other",
|
|
29
|
+
},
|
|
30
|
+
scopeLabels: {
|
|
31
|
+
booking: "Booking",
|
|
32
|
+
lead_traveler: "Lead traveler",
|
|
33
|
+
traveler: "Traveler",
|
|
34
|
+
booker: "Booker",
|
|
35
|
+
},
|
|
36
|
+
questionTargetLabels: {
|
|
37
|
+
booking: "Booking",
|
|
38
|
+
traveler: "Traveler",
|
|
39
|
+
lead_traveler: "Lead traveler",
|
|
40
|
+
booker: "Booker",
|
|
41
|
+
extra: "Extra",
|
|
42
|
+
service: "Service",
|
|
43
|
+
},
|
|
44
|
+
questionFieldTypeLabels: {
|
|
45
|
+
text: "Text",
|
|
46
|
+
textarea: "Textarea",
|
|
47
|
+
number: "Number",
|
|
48
|
+
email: "Email",
|
|
49
|
+
phone: "Phone",
|
|
50
|
+
date: "Date",
|
|
51
|
+
datetime: "Date and time",
|
|
52
|
+
boolean: "Boolean",
|
|
53
|
+
single_select: "Single select",
|
|
54
|
+
multi_select: "Multi select",
|
|
55
|
+
file: "File",
|
|
56
|
+
country: "Country",
|
|
57
|
+
other: "Other",
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
contactTab: {
|
|
61
|
+
title: "Contact Requirements",
|
|
62
|
+
description: "Standard traveler fields collected at booking (name, email, passport, etc.).",
|
|
63
|
+
addRequirement: "Add Requirement",
|
|
64
|
+
empty: "No contact requirements yet. Add one to start collecting traveler data.",
|
|
65
|
+
columns: {
|
|
66
|
+
field: "Field",
|
|
67
|
+
scope: "Scope",
|
|
68
|
+
required: "Required",
|
|
69
|
+
perTraveler: "Per Traveler",
|
|
70
|
+
sort: "Sort",
|
|
71
|
+
status: "Status",
|
|
72
|
+
actions: "Actions",
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
questionsTab: {
|
|
76
|
+
title: "Custom Questions",
|
|
77
|
+
description: "Product-specific questions asked at booking (dietary needs, preferences, etc.).",
|
|
78
|
+
addQuestion: "Add Question",
|
|
79
|
+
empty: "No questions yet. Add one to collect custom data at booking.",
|
|
80
|
+
choiceTypesHint: "Choice options only apply to single-select / multi-select field types.",
|
|
81
|
+
choices: "Choices",
|
|
82
|
+
addChoice: "Add Choice",
|
|
83
|
+
noChoices: "No choices yet.",
|
|
84
|
+
columns: {
|
|
85
|
+
sort: "Sort",
|
|
86
|
+
value: "Value",
|
|
87
|
+
label: "Label",
|
|
88
|
+
default: "Default",
|
|
89
|
+
status: "Status",
|
|
90
|
+
actions: "Actions",
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { bookingRequirementsUiEn } from "./en";
|
|
2
|
+
export type { BookingRequirementsUiMessages, ContactFieldKey, ContactScope, QuestionFieldType, QuestionTarget, } from "./messages";
|
|
3
|
+
export { type BookingRequirementsUiMessageOverrides, BookingRequirementsUiMessagesProvider, bookingRequirementsUiMessageDefinitions, getBookingRequirementsUiI18n, resolveBookingRequirementsUiMessages, useBookingRequirementsUiI18n, useBookingRequirementsUiI18nOrDefault, useBookingRequirementsUiMessages, useBookingRequirementsUiMessagesOrDefault, } from "./provider";
|
|
4
|
+
export { bookingRequirementsUiRo } from "./ro";
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/i18n/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,MAAM,CAAA;AAC9C,YAAY,EACV,6BAA6B,EAC7B,eAAe,EACf,YAAY,EACZ,iBAAiB,EACjB,cAAc,GACf,MAAM,YAAY,CAAA;AACnB,OAAO,EACL,KAAK,qCAAqC,EAC1C,qCAAqC,EACrC,uCAAuC,EACvC,4BAA4B,EAC5B,oCAAoC,EACpC,4BAA4B,EAC5B,qCAAqC,EACrC,gCAAgC,EAChC,yCAAyC,GAC1C,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,uBAAuB,EAAE,MAAM,MAAM,CAAA"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { bookingRequirementsUiEn } from "./en";
|
|
2
|
+
export { BookingRequirementsUiMessagesProvider, bookingRequirementsUiMessageDefinitions, getBookingRequirementsUiI18n, resolveBookingRequirementsUiMessages, useBookingRequirementsUiI18n, useBookingRequirementsUiI18nOrDefault, useBookingRequirementsUiMessages, useBookingRequirementsUiMessagesOrDefault, } from "./provider";
|
|
3
|
+
export { bookingRequirementsUiRo } from "./ro";
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { BookingQuestion, ContactRequirement } from "@voyantjs/booking-requirements-react";
|
|
2
|
+
export type ContactFieldKey = ContactRequirement["fieldKey"];
|
|
3
|
+
export type ContactScope = ContactRequirement["scope"];
|
|
4
|
+
export type QuestionTarget = BookingQuestion["target"];
|
|
5
|
+
export type QuestionFieldType = BookingQuestion["fieldType"];
|
|
6
|
+
export type BookingRequirementsUiMessages = {
|
|
7
|
+
common: {
|
|
8
|
+
edit: string;
|
|
9
|
+
delete: string;
|
|
10
|
+
add: string;
|
|
11
|
+
show: string;
|
|
12
|
+
hide: string;
|
|
13
|
+
required: string;
|
|
14
|
+
optional: string;
|
|
15
|
+
yes: string;
|
|
16
|
+
no: string;
|
|
17
|
+
active: string;
|
|
18
|
+
inactive: string;
|
|
19
|
+
default: string;
|
|
20
|
+
fieldKeyLabels: Record<ContactFieldKey, string>;
|
|
21
|
+
scopeLabels: Record<ContactScope, string>;
|
|
22
|
+
questionTargetLabels: Record<QuestionTarget, string>;
|
|
23
|
+
questionFieldTypeLabels: Record<QuestionFieldType, string>;
|
|
24
|
+
};
|
|
25
|
+
contactTab: {
|
|
26
|
+
title: string;
|
|
27
|
+
description: string;
|
|
28
|
+
addRequirement: string;
|
|
29
|
+
empty: string;
|
|
30
|
+
columns: {
|
|
31
|
+
field: string;
|
|
32
|
+
scope: string;
|
|
33
|
+
required: string;
|
|
34
|
+
perTraveler: string;
|
|
35
|
+
sort: string;
|
|
36
|
+
status: string;
|
|
37
|
+
actions: string;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
questionsTab: {
|
|
41
|
+
title: string;
|
|
42
|
+
description: string;
|
|
43
|
+
addQuestion: string;
|
|
44
|
+
empty: string;
|
|
45
|
+
choiceTypesHint: string;
|
|
46
|
+
choices: string;
|
|
47
|
+
addChoice: string;
|
|
48
|
+
noChoices: string;
|
|
49
|
+
columns: {
|
|
50
|
+
sort: string;
|
|
51
|
+
value: string;
|
|
52
|
+
label: string;
|
|
53
|
+
default: string;
|
|
54
|
+
status: string;
|
|
55
|
+
actions: string;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=messages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/i18n/messages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAA;AAE/F,MAAM,MAAM,eAAe,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAAA;AAC5D,MAAM,MAAM,YAAY,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAA;AACtD,MAAM,MAAM,cAAc,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAA;AACtD,MAAM,MAAM,iBAAiB,GAAG,eAAe,CAAC,WAAW,CAAC,CAAA;AAE5D,MAAM,MAAM,6BAA6B,GAAG;IAC1C,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAA;QACZ,MAAM,EAAE,MAAM,CAAA;QACd,GAAG,EAAE,MAAM,CAAA;QACX,IAAI,EAAE,MAAM,CAAA;QACZ,IAAI,EAAE,MAAM,CAAA;QACZ,QAAQ,EAAE,MAAM,CAAA;QAChB,QAAQ,EAAE,MAAM,CAAA;QAChB,GAAG,EAAE,MAAM,CAAA;QACX,EAAE,EAAE,MAAM,CAAA;QACV,MAAM,EAAE,MAAM,CAAA;QACd,QAAQ,EAAE,MAAM,CAAA;QAChB,OAAO,EAAE,MAAM,CAAA;QACf,cAAc,EAAE,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CAAA;QAC/C,WAAW,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,CAAA;QACzC,oBAAoB,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,CAAA;QACpD,uBAAuB,EAAE,MAAM,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAA;KAC3D,CAAA;IACD,UAAU,EAAE;QACV,KAAK,EAAE,MAAM,CAAA;QACb,WAAW,EAAE,MAAM,CAAA;QACnB,cAAc,EAAE,MAAM,CAAA;QACtB,KAAK,EAAE,MAAM,CAAA;QACb,OAAO,EAAE;YACP,KAAK,EAAE,MAAM,CAAA;YACb,KAAK,EAAE,MAAM,CAAA;YACb,QAAQ,EAAE,MAAM,CAAA;YAChB,WAAW,EAAE,MAAM,CAAA;YACnB,IAAI,EAAE,MAAM,CAAA;YACZ,MAAM,EAAE,MAAM,CAAA;YACd,OAAO,EAAE,MAAM,CAAA;SAChB,CAAA;KACF,CAAA;IACD,YAAY,EAAE;QACZ,KAAK,EAAE,MAAM,CAAA;QACb,WAAW,EAAE,MAAM,CAAA;QACnB,WAAW,EAAE,MAAM,CAAA;QACnB,KAAK,EAAE,MAAM,CAAA;QACb,eAAe,EAAE,MAAM,CAAA;QACvB,OAAO,EAAE,MAAM,CAAA;QACf,SAAS,EAAE,MAAM,CAAA;QACjB,SAAS,EAAE,MAAM,CAAA;QACjB,OAAO,EAAE;YACP,IAAI,EAAE,MAAM,CAAA;YACZ,KAAK,EAAE,MAAM,CAAA;YACb,KAAK,EAAE,MAAM,CAAA;YACb,OAAO,EAAE,MAAM,CAAA;YACf,MAAM,EAAE,MAAM,CAAA;YACd,OAAO,EAAE,MAAM,CAAA;SAChB,CAAA;KACF,CAAA;CACF,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { type LocaleMessageOverrides, type PackageI18nValue } from "@voyantjs/i18n";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
import type { BookingRequirementsUiMessages } from "./messages";
|
|
4
|
+
export declare const bookingRequirementsUiMessageDefinitions: {
|
|
5
|
+
en: {
|
|
6
|
+
common: {
|
|
7
|
+
edit: string;
|
|
8
|
+
delete: string;
|
|
9
|
+
add: string;
|
|
10
|
+
show: string;
|
|
11
|
+
hide: string;
|
|
12
|
+
required: string;
|
|
13
|
+
optional: string;
|
|
14
|
+
yes: string;
|
|
15
|
+
no: string;
|
|
16
|
+
active: string;
|
|
17
|
+
inactive: string;
|
|
18
|
+
default: string;
|
|
19
|
+
fieldKeyLabels: {
|
|
20
|
+
first_name: string;
|
|
21
|
+
last_name: string;
|
|
22
|
+
email: string;
|
|
23
|
+
phone: string;
|
|
24
|
+
date_of_birth: string;
|
|
25
|
+
nationality: string;
|
|
26
|
+
passport_number: string;
|
|
27
|
+
passport_expiry: string;
|
|
28
|
+
dietary_requirements: string;
|
|
29
|
+
accessibility_needs: string;
|
|
30
|
+
special_requests: string;
|
|
31
|
+
address: string;
|
|
32
|
+
other: string;
|
|
33
|
+
};
|
|
34
|
+
scopeLabels: {
|
|
35
|
+
booking: string;
|
|
36
|
+
lead_traveler: string;
|
|
37
|
+
traveler: string;
|
|
38
|
+
booker: string;
|
|
39
|
+
};
|
|
40
|
+
questionTargetLabels: {
|
|
41
|
+
booking: string;
|
|
42
|
+
traveler: string;
|
|
43
|
+
lead_traveler: string;
|
|
44
|
+
booker: string;
|
|
45
|
+
extra: string;
|
|
46
|
+
service: string;
|
|
47
|
+
};
|
|
48
|
+
questionFieldTypeLabels: {
|
|
49
|
+
text: string;
|
|
50
|
+
textarea: string;
|
|
51
|
+
number: string;
|
|
52
|
+
email: string;
|
|
53
|
+
phone: string;
|
|
54
|
+
date: string;
|
|
55
|
+
datetime: string;
|
|
56
|
+
boolean: string;
|
|
57
|
+
single_select: string;
|
|
58
|
+
multi_select: string;
|
|
59
|
+
file: string;
|
|
60
|
+
country: string;
|
|
61
|
+
other: string;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
contactTab: {
|
|
65
|
+
title: string;
|
|
66
|
+
description: string;
|
|
67
|
+
addRequirement: string;
|
|
68
|
+
empty: string;
|
|
69
|
+
columns: {
|
|
70
|
+
field: string;
|
|
71
|
+
scope: string;
|
|
72
|
+
required: string;
|
|
73
|
+
perTraveler: string;
|
|
74
|
+
sort: string;
|
|
75
|
+
status: string;
|
|
76
|
+
actions: string;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
questionsTab: {
|
|
80
|
+
title: string;
|
|
81
|
+
description: string;
|
|
82
|
+
addQuestion: string;
|
|
83
|
+
empty: string;
|
|
84
|
+
choiceTypesHint: string;
|
|
85
|
+
choices: string;
|
|
86
|
+
addChoice: string;
|
|
87
|
+
noChoices: string;
|
|
88
|
+
columns: {
|
|
89
|
+
sort: string;
|
|
90
|
+
value: string;
|
|
91
|
+
label: string;
|
|
92
|
+
default: string;
|
|
93
|
+
status: string;
|
|
94
|
+
actions: string;
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
ro: {
|
|
99
|
+
common: {
|
|
100
|
+
edit: string;
|
|
101
|
+
delete: string;
|
|
102
|
+
add: string;
|
|
103
|
+
show: string;
|
|
104
|
+
hide: string;
|
|
105
|
+
required: string;
|
|
106
|
+
optional: string;
|
|
107
|
+
yes: string;
|
|
108
|
+
no: string;
|
|
109
|
+
active: string;
|
|
110
|
+
inactive: string;
|
|
111
|
+
default: string;
|
|
112
|
+
fieldKeyLabels: {
|
|
113
|
+
first_name: string;
|
|
114
|
+
last_name: string;
|
|
115
|
+
email: string;
|
|
116
|
+
phone: string;
|
|
117
|
+
date_of_birth: string;
|
|
118
|
+
nationality: string;
|
|
119
|
+
passport_number: string;
|
|
120
|
+
passport_expiry: string;
|
|
121
|
+
dietary_requirements: string;
|
|
122
|
+
accessibility_needs: string;
|
|
123
|
+
special_requests: string;
|
|
124
|
+
address: string;
|
|
125
|
+
other: string;
|
|
126
|
+
};
|
|
127
|
+
scopeLabels: {
|
|
128
|
+
booking: string;
|
|
129
|
+
lead_traveler: string;
|
|
130
|
+
traveler: string;
|
|
131
|
+
booker: string;
|
|
132
|
+
};
|
|
133
|
+
questionTargetLabels: {
|
|
134
|
+
booking: string;
|
|
135
|
+
traveler: string;
|
|
136
|
+
lead_traveler: string;
|
|
137
|
+
booker: string;
|
|
138
|
+
extra: string;
|
|
139
|
+
service: string;
|
|
140
|
+
};
|
|
141
|
+
questionFieldTypeLabels: {
|
|
142
|
+
text: string;
|
|
143
|
+
textarea: string;
|
|
144
|
+
number: string;
|
|
145
|
+
email: string;
|
|
146
|
+
phone: string;
|
|
147
|
+
date: string;
|
|
148
|
+
datetime: string;
|
|
149
|
+
boolean: string;
|
|
150
|
+
single_select: string;
|
|
151
|
+
multi_select: string;
|
|
152
|
+
file: string;
|
|
153
|
+
country: string;
|
|
154
|
+
other: string;
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
contactTab: {
|
|
158
|
+
title: string;
|
|
159
|
+
description: string;
|
|
160
|
+
addRequirement: string;
|
|
161
|
+
empty: string;
|
|
162
|
+
columns: {
|
|
163
|
+
field: string;
|
|
164
|
+
scope: string;
|
|
165
|
+
required: string;
|
|
166
|
+
perTraveler: string;
|
|
167
|
+
sort: string;
|
|
168
|
+
status: string;
|
|
169
|
+
actions: string;
|
|
170
|
+
};
|
|
171
|
+
};
|
|
172
|
+
questionsTab: {
|
|
173
|
+
title: string;
|
|
174
|
+
description: string;
|
|
175
|
+
addQuestion: string;
|
|
176
|
+
empty: string;
|
|
177
|
+
choiceTypesHint: string;
|
|
178
|
+
choices: string;
|
|
179
|
+
addChoice: string;
|
|
180
|
+
noChoices: string;
|
|
181
|
+
columns: {
|
|
182
|
+
sort: string;
|
|
183
|
+
value: string;
|
|
184
|
+
label: string;
|
|
185
|
+
default: string;
|
|
186
|
+
status: string;
|
|
187
|
+
actions: string;
|
|
188
|
+
};
|
|
189
|
+
};
|
|
190
|
+
};
|
|
191
|
+
};
|
|
192
|
+
export type BookingRequirementsUiMessageOverrides = LocaleMessageOverrides<BookingRequirementsUiMessages>;
|
|
193
|
+
export declare function resolveBookingRequirementsUiMessages({ locale, overrides, }: {
|
|
194
|
+
locale: string | null | undefined;
|
|
195
|
+
overrides?: BookingRequirementsUiMessageOverrides | null;
|
|
196
|
+
}): BookingRequirementsUiMessages;
|
|
197
|
+
export declare function getBookingRequirementsUiI18n({ locale, overrides, }: {
|
|
198
|
+
locale?: string | null | undefined;
|
|
199
|
+
overrides?: BookingRequirementsUiMessageOverrides | null;
|
|
200
|
+
}): PackageI18nValue<BookingRequirementsUiMessages>;
|
|
201
|
+
export declare function BookingRequirementsUiMessagesProvider({ children, locale, overrides, }: {
|
|
202
|
+
children: ReactNode;
|
|
203
|
+
locale: string | null | undefined;
|
|
204
|
+
overrides?: BookingRequirementsUiMessageOverrides | null;
|
|
205
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
206
|
+
export declare const useBookingRequirementsUiI18n: () => PackageI18nValue<BookingRequirementsUiMessages>;
|
|
207
|
+
export declare const useBookingRequirementsUiMessages: () => BookingRequirementsUiMessages;
|
|
208
|
+
export declare function useBookingRequirementsUiI18nOrDefault(): PackageI18nValue<BookingRequirementsUiMessages>;
|
|
209
|
+
export declare function useBookingRequirementsUiMessagesOrDefault(): BookingRequirementsUiMessages;
|
|
210
|
+
//# sourceMappingURL=provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/i18n/provider.tsx"],"names":[],"mappings":"AAEA,OAAO,EAIL,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EAEtB,MAAM,gBAAgB,CAAA;AACvB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtC,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,YAAY,CAAA;AAK/D,eAAO,MAAM,uCAAuC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGe,CAAA;AAEnE,MAAM,MAAM,qCAAqC,GAC/C,sBAAsB,CAAC,6BAA6B,CAAC,CAAA;AAWvD,wBAAgB,oCAAoC,CAAC,EACnD,MAAM,EACN,SAAS,GACV,EAAE;IACD,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;IACjC,SAAS,CAAC,EAAE,qCAAqC,GAAG,IAAI,CAAA;CACzD,iCAOA;AAED,wBAAgB,4BAA4B,CAAC,EAC3C,MAAM,EACN,SAAS,GACV,EAAE;IACD,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;IAClC,SAAS,CAAC,EAAE,qCAAqC,GAAG,IAAI,CAAA;CACzD,GAAG,gBAAgB,CAAC,6BAA6B,CAAC,CASlD;AAED,wBAAgB,qCAAqC,CAAC,EACpD,QAAQ,EACR,MAAM,EACN,SAAS,GACV,EAAE;IACD,QAAQ,EAAE,SAAS,CAAA;IACnB,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;IACjC,SAAS,CAAC,EAAE,qCAAqC,GAAG,IAAI,CAAA;CACzD,2CAWA;AAED,eAAO,MAAM,4BAA4B,uDAAuC,CAAA;AAChF,eAAO,MAAM,gCAAgC,qCAA2C,CAAA;AAExF,wBAAgB,qCAAqC,oDAEpD;AAED,wBAAgB,yCAAyC,kCAExD"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { createLocaleFormatters, createPackageMessagesContext, resolvePackageMessages, } from "@voyantjs/i18n";
|
|
4
|
+
import { bookingRequirementsUiEn } from "./en";
|
|
5
|
+
import { bookingRequirementsUiRo } from "./ro";
|
|
6
|
+
const fallbackLocale = "en";
|
|
7
|
+
export const bookingRequirementsUiMessageDefinitions = {
|
|
8
|
+
en: bookingRequirementsUiEn,
|
|
9
|
+
ro: bookingRequirementsUiRo,
|
|
10
|
+
};
|
|
11
|
+
const bookingRequirementsUiContext = createPackageMessagesContext("BookingRequirementsUiMessages");
|
|
12
|
+
const defaultBookingRequirementsUiI18n = {
|
|
13
|
+
messages: bookingRequirementsUiEn,
|
|
14
|
+
...createLocaleFormatters(fallbackLocale),
|
|
15
|
+
};
|
|
16
|
+
export function resolveBookingRequirementsUiMessages({ locale, overrides, }) {
|
|
17
|
+
return resolvePackageMessages({
|
|
18
|
+
definitions: bookingRequirementsUiMessageDefinitions,
|
|
19
|
+
fallbackLocale,
|
|
20
|
+
locale,
|
|
21
|
+
overrides,
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
export function getBookingRequirementsUiI18n({ locale, overrides, }) {
|
|
25
|
+
const resolvedLocale = locale ?? fallbackLocale;
|
|
26
|
+
return {
|
|
27
|
+
messages: resolveBookingRequirementsUiMessages({
|
|
28
|
+
locale: resolvedLocale,
|
|
29
|
+
overrides,
|
|
30
|
+
}),
|
|
31
|
+
...createLocaleFormatters(resolvedLocale),
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export function BookingRequirementsUiMessagesProvider({ children, locale, overrides, }) {
|
|
35
|
+
return (_jsx(bookingRequirementsUiContext.ResolvedMessagesProvider, { definitions: bookingRequirementsUiMessageDefinitions, fallbackLocale: fallbackLocale, locale: locale, overrides: overrides, children: children }));
|
|
36
|
+
}
|
|
37
|
+
export const useBookingRequirementsUiI18n = bookingRequirementsUiContext.useI18n;
|
|
38
|
+
export const useBookingRequirementsUiMessages = bookingRequirementsUiContext.useMessages;
|
|
39
|
+
export function useBookingRequirementsUiI18nOrDefault() {
|
|
40
|
+
return bookingRequirementsUiContext.useOptionalI18n() ?? defaultBookingRequirementsUiI18n;
|
|
41
|
+
}
|
|
42
|
+
export function useBookingRequirementsUiMessagesOrDefault() {
|
|
43
|
+
return useBookingRequirementsUiI18nOrDefault().messages;
|
|
44
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
export declare const bookingRequirementsUiRo: {
|
|
2
|
+
common: {
|
|
3
|
+
edit: string;
|
|
4
|
+
delete: string;
|
|
5
|
+
add: string;
|
|
6
|
+
show: string;
|
|
7
|
+
hide: string;
|
|
8
|
+
required: string;
|
|
9
|
+
optional: string;
|
|
10
|
+
yes: string;
|
|
11
|
+
no: string;
|
|
12
|
+
active: string;
|
|
13
|
+
inactive: string;
|
|
14
|
+
default: string;
|
|
15
|
+
fieldKeyLabels: {
|
|
16
|
+
first_name: string;
|
|
17
|
+
last_name: string;
|
|
18
|
+
email: string;
|
|
19
|
+
phone: string;
|
|
20
|
+
date_of_birth: string;
|
|
21
|
+
nationality: string;
|
|
22
|
+
passport_number: string;
|
|
23
|
+
passport_expiry: string;
|
|
24
|
+
dietary_requirements: string;
|
|
25
|
+
accessibility_needs: string;
|
|
26
|
+
special_requests: string;
|
|
27
|
+
address: string;
|
|
28
|
+
other: string;
|
|
29
|
+
};
|
|
30
|
+
scopeLabels: {
|
|
31
|
+
booking: string;
|
|
32
|
+
lead_traveler: string;
|
|
33
|
+
traveler: string;
|
|
34
|
+
booker: string;
|
|
35
|
+
};
|
|
36
|
+
questionTargetLabels: {
|
|
37
|
+
booking: string;
|
|
38
|
+
traveler: string;
|
|
39
|
+
lead_traveler: string;
|
|
40
|
+
booker: string;
|
|
41
|
+
extra: string;
|
|
42
|
+
service: string;
|
|
43
|
+
};
|
|
44
|
+
questionFieldTypeLabels: {
|
|
45
|
+
text: string;
|
|
46
|
+
textarea: string;
|
|
47
|
+
number: string;
|
|
48
|
+
email: string;
|
|
49
|
+
phone: string;
|
|
50
|
+
date: string;
|
|
51
|
+
datetime: string;
|
|
52
|
+
boolean: string;
|
|
53
|
+
single_select: string;
|
|
54
|
+
multi_select: string;
|
|
55
|
+
file: string;
|
|
56
|
+
country: string;
|
|
57
|
+
other: string;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
contactTab: {
|
|
61
|
+
title: string;
|
|
62
|
+
description: string;
|
|
63
|
+
addRequirement: string;
|
|
64
|
+
empty: string;
|
|
65
|
+
columns: {
|
|
66
|
+
field: string;
|
|
67
|
+
scope: string;
|
|
68
|
+
required: string;
|
|
69
|
+
perTraveler: string;
|
|
70
|
+
sort: string;
|
|
71
|
+
status: string;
|
|
72
|
+
actions: string;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
questionsTab: {
|
|
76
|
+
title: string;
|
|
77
|
+
description: string;
|
|
78
|
+
addQuestion: string;
|
|
79
|
+
empty: string;
|
|
80
|
+
choiceTypesHint: string;
|
|
81
|
+
choices: string;
|
|
82
|
+
addChoice: string;
|
|
83
|
+
noChoices: string;
|
|
84
|
+
columns: {
|
|
85
|
+
sort: string;
|
|
86
|
+
value: string;
|
|
87
|
+
label: string;
|
|
88
|
+
default: string;
|
|
89
|
+
status: string;
|
|
90
|
+
actions: string;
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
//# sourceMappingURL=ro.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ro.d.ts","sourceRoot":"","sources":["../../src/i18n/ro.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+FK,CAAA"}
|
package/dist/i18n/ro.js
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
export const bookingRequirementsUiRo = {
|
|
2
|
+
common: {
|
|
3
|
+
edit: "Editeaza",
|
|
4
|
+
delete: "Sterge",
|
|
5
|
+
add: "Adauga",
|
|
6
|
+
show: "Arata",
|
|
7
|
+
hide: "Ascunde",
|
|
8
|
+
required: "Obligatoriu",
|
|
9
|
+
optional: "Optional",
|
|
10
|
+
yes: "Da",
|
|
11
|
+
no: "Nu",
|
|
12
|
+
active: "Activ",
|
|
13
|
+
inactive: "Inactiv",
|
|
14
|
+
default: "Implicit",
|
|
15
|
+
fieldKeyLabels: {
|
|
16
|
+
first_name: "Prenume",
|
|
17
|
+
last_name: "Nume",
|
|
18
|
+
email: "Email",
|
|
19
|
+
phone: "Telefon",
|
|
20
|
+
date_of_birth: "Data nasterii",
|
|
21
|
+
nationality: "Nationalitate",
|
|
22
|
+
passport_number: "Numar pasaport",
|
|
23
|
+
passport_expiry: "Expirare pasaport",
|
|
24
|
+
dietary_requirements: "Cerinte alimentare",
|
|
25
|
+
accessibility_needs: "Nevoi de accesibilitate",
|
|
26
|
+
special_requests: "Cereri speciale",
|
|
27
|
+
address: "Adresa",
|
|
28
|
+
other: "Altul",
|
|
29
|
+
},
|
|
30
|
+
scopeLabels: {
|
|
31
|
+
booking: "Rezervare",
|
|
32
|
+
lead_traveler: "Calator principal",
|
|
33
|
+
traveler: "Calator",
|
|
34
|
+
booker: "Persoana care rezerva",
|
|
35
|
+
},
|
|
36
|
+
questionTargetLabels: {
|
|
37
|
+
booking: "Rezervare",
|
|
38
|
+
traveler: "Calator",
|
|
39
|
+
lead_traveler: "Calator principal",
|
|
40
|
+
booker: "Persoana care rezerva",
|
|
41
|
+
extra: "Extra",
|
|
42
|
+
service: "Serviciu",
|
|
43
|
+
},
|
|
44
|
+
questionFieldTypeLabels: {
|
|
45
|
+
text: "Text",
|
|
46
|
+
textarea: "Text lung",
|
|
47
|
+
number: "Numar",
|
|
48
|
+
email: "Email",
|
|
49
|
+
phone: "Telefon",
|
|
50
|
+
date: "Data",
|
|
51
|
+
datetime: "Data si ora",
|
|
52
|
+
boolean: "Boolean",
|
|
53
|
+
single_select: "Selectie simpla",
|
|
54
|
+
multi_select: "Selectie multipla",
|
|
55
|
+
file: "Fisier",
|
|
56
|
+
country: "Tara",
|
|
57
|
+
other: "Altul",
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
contactTab: {
|
|
61
|
+
title: "Cerinte de Contact",
|
|
62
|
+
description: "Campuri standard pentru calatori colectate la rezervare (nume, email, pasaport etc.).",
|
|
63
|
+
addRequirement: "Adauga Cerinta",
|
|
64
|
+
empty: "Nu exista inca cerinte de contact. Adauga una pentru a colecta datele calatorului.",
|
|
65
|
+
columns: {
|
|
66
|
+
field: "Camp",
|
|
67
|
+
scope: "Domeniu",
|
|
68
|
+
required: "Obligatoriu",
|
|
69
|
+
perTraveler: "Per Calator",
|
|
70
|
+
sort: "Ordine",
|
|
71
|
+
status: "Status",
|
|
72
|
+
actions: "Actiuni",
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
questionsTab: {
|
|
76
|
+
title: "Intrebari Personalizate",
|
|
77
|
+
description: "Intrebari specifice produsului puse la rezervare (preferinte, cerinte alimentare etc.).",
|
|
78
|
+
addQuestion: "Adauga Intrebare",
|
|
79
|
+
empty: "Nu exista inca intrebari. Adauga una pentru a colecta date personalizate la rezervare.",
|
|
80
|
+
choiceTypesHint: "Optiunile se aplica doar pentru tipurile selectie simpla / selectie multipla.",
|
|
81
|
+
choices: "Optiuni",
|
|
82
|
+
addChoice: "Adauga Optiune",
|
|
83
|
+
noChoices: "Nu exista inca optiuni.",
|
|
84
|
+
columns: {
|
|
85
|
+
sort: "Ordine",
|
|
86
|
+
value: "Valoare",
|
|
87
|
+
label: "Eticheta",
|
|
88
|
+
default: "Implicit",
|
|
89
|
+
status: "Status",
|
|
90
|
+
actions: "Actiuni",
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { BookingRequirementsContactTab } from "./components/booking-requirements-contact-tab";
|
|
2
2
|
export { BookingRequirementsQuestionsTab } from "./components/booking-requirements-questions-tab";
|
|
3
|
+
export { type BookingRequirementsUiMessageOverrides, type BookingRequirementsUiMessages, BookingRequirementsUiMessagesProvider, bookingRequirementsUiEn, bookingRequirementsUiMessageDefinitions, bookingRequirementsUiRo, getBookingRequirementsUiI18n, resolveBookingRequirementsUiMessages, useBookingRequirementsUiI18n, useBookingRequirementsUiI18nOrDefault, useBookingRequirementsUiMessages, useBookingRequirementsUiMessagesOrDefault, } from "./i18n";
|
|
3
4
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,+CAA+C,CAAA;AAC7F,OAAO,EAAE,+BAA+B,EAAE,MAAM,iDAAiD,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,+CAA+C,CAAA;AAC7F,OAAO,EAAE,+BAA+B,EAAE,MAAM,iDAAiD,CAAA;AACjG,OAAO,EACL,KAAK,qCAAqC,EAC1C,KAAK,6BAA6B,EAClC,qCAAqC,EACrC,uBAAuB,EACvB,uCAAuC,EACvC,uBAAuB,EACvB,4BAA4B,EAC5B,oCAAoC,EACpC,4BAA4B,EAC5B,qCAAqC,EACrC,gCAAgC,EAChC,yCAAyC,GAC1C,MAAM,QAAQ,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export { BookingRequirementsContactTab } from "./components/booking-requirements-contact-tab";
|
|
2
2
|
export { BookingRequirementsQuestionsTab } from "./components/booking-requirements-questions-tab";
|
|
3
|
+
export { BookingRequirementsUiMessagesProvider, bookingRequirementsUiEn, bookingRequirementsUiMessageDefinitions, bookingRequirementsUiRo, getBookingRequirementsUiI18n, resolveBookingRequirementsUiMessages, useBookingRequirementsUiI18n, useBookingRequirementsUiI18nOrDefault, useBookingRequirementsUiMessages, useBookingRequirementsUiMessagesOrDefault, } from "./i18n";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voyantjs/booking-requirements-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"license": "FSL-1.1-Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -14,6 +14,18 @@
|
|
|
14
14
|
"types": "./dist/index.d.ts",
|
|
15
15
|
"import": "./dist/index.js"
|
|
16
16
|
},
|
|
17
|
+
"./i18n": {
|
|
18
|
+
"types": "./dist/i18n/index.d.ts",
|
|
19
|
+
"import": "./dist/i18n/index.js"
|
|
20
|
+
},
|
|
21
|
+
"./i18n/en": {
|
|
22
|
+
"types": "./dist/i18n/en.d.ts",
|
|
23
|
+
"import": "./dist/i18n/en.js"
|
|
24
|
+
},
|
|
25
|
+
"./i18n/ro": {
|
|
26
|
+
"types": "./dist/i18n/ro.d.ts",
|
|
27
|
+
"import": "./dist/i18n/ro.js"
|
|
28
|
+
},
|
|
17
29
|
"./components/*": {
|
|
18
30
|
"types": "./dist/components/*.d.ts",
|
|
19
31
|
"import": "./dist/components/*.js"
|
|
@@ -23,8 +35,11 @@
|
|
|
23
35
|
"@tanstack/react-query": "^5.0.0",
|
|
24
36
|
"react": "^19.0.0",
|
|
25
37
|
"react-dom": "^19.0.0",
|
|
26
|
-
"@voyantjs/booking-requirements-react": "0.
|
|
27
|
-
"@voyantjs/ui": "0.
|
|
38
|
+
"@voyantjs/booking-requirements-react": "0.17.0",
|
|
39
|
+
"@voyantjs/ui": "0.17.0"
|
|
40
|
+
},
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"@voyantjs/i18n": "0.17.0"
|
|
28
43
|
},
|
|
29
44
|
"devDependencies": {
|
|
30
45
|
"@tanstack/react-query": "^5.96.2",
|
|
@@ -35,9 +50,10 @@
|
|
|
35
50
|
"react-dom": "^19.2.4",
|
|
36
51
|
"typescript": "^6.0.2",
|
|
37
52
|
"vitest": "^4.1.2",
|
|
38
|
-
"@voyantjs/booking-requirements-react": "0.
|
|
53
|
+
"@voyantjs/booking-requirements-react": "0.17.0",
|
|
54
|
+
"@voyantjs/i18n": "0.17.0",
|
|
39
55
|
"@voyantjs/voyant-typescript-config": "0.1.0",
|
|
40
|
-
"@voyantjs/ui": "0.
|
|
56
|
+
"@voyantjs/ui": "0.17.0"
|
|
41
57
|
},
|
|
42
58
|
"files": [
|
|
43
59
|
"dist"
|