@voyantjs/extras-ui 0.84.1 → 0.84.3

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.
@@ -70,7 +70,7 @@ export function SlotExtrasManifestPanel({ slotId, className }) {
70
70
  collectionStatus,
71
71
  });
72
72
  };
73
- return (_jsxs("div", { className: cn("flex flex-col gap-3", className), children: [_jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsx("h2", { className: "text-sm font-semibold", children: messages.title }), _jsx(Badge, { variant: "outline", children: manifest.extras.length })] }), _jsx("div", { className: "overflow-x-auto rounded-md border", children: _jsxs(Table, { children: [_jsx(TableHeader, { children: _jsxs(TableRow, { children: [_jsx(TableHead, { className: "sticky left-0 z-10 min-w-56 bg-background", children: messages.travelerColumn }), _jsx(TableHead, { className: "min-w-32", children: messages.bookingColumn }), manifest.extras.map((extra) => (_jsx(TableHead, { className: "min-w-56 align-top", children: _jsxs("div", { className: "flex flex-col gap-2 py-1", children: [_jsxs("div", { children: [_jsx("div", { className: "font-medium", children: extra.name }), _jsx("div", { className: "text-xs font-normal text-muted-foreground", children: collectionModeLabel(extra.collectionMode) })] }), _jsxs("div", { className: "flex flex-wrap gap-1", children: [_jsxs(Button, { type: "button", variant: "outline", size: "sm", disabled: pending, onClick: () => bulkSetExtra(extra, true), children: [_jsx(Check, { "data-icon": "inline-start", "aria-hidden": "true" }), messages.selectAll] }), _jsxs(Button, { type: "button", variant: "outline", size: "sm", disabled: pending, onClick: () => bulkSetExtra(extra, false), children: [_jsx(X, { "data-icon": "inline-start", "aria-hidden": "true" }), messages.clearAll] }), extra.collectionMode === "cash_on_trip" ? (_jsxs(Button, { type: "button", variant: "outline", size: "sm", disabled: pending, onClick: () => bulkCollection(extra, "collected"), children: [_jsx(CircleDollarSign, { "data-icon": "inline-start", "aria-hidden": "true" }), messages.markCollected] })) : null] })] }) }, extra.id)))] }) }), _jsx(TableBody, { children: manifest.travelers.map((traveler) => (_jsxs(TableRow, { children: [_jsx(TableCell, { className: "sticky left-0 z-10 bg-background font-medium", children: traveler.fullName }), _jsx(TableCell, { className: "font-mono text-xs", children: traveler.bookingNumber }), manifest.extras.map((extra) => {
73
+ return (_jsxs("div", { className: cn("flex flex-col gap-3", className), children: [_jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsx("h2", { className: "text-sm font-semibold", children: messages.title }), _jsx(Badge, { variant: "outline", children: manifest.extras.length })] }), _jsx("div", { className: "overflow-x-auto rounded-md border", children: _jsxs(Table, { children: [_jsx(TableHeader, { children: _jsxs(TableRow, { children: [_jsx(TableHead, { className: "sticky left-0 z-10 min-w-56 bg-background", children: messages.travelerColumn }), _jsx(TableHead, { className: "min-w-32", children: messages.bookingColumn }), manifest.extras.map((extra) => (_jsx(TableHead, { className: "min-w-56 align-top", children: _jsxs("div", { className: "flex flex-col gap-2 py-1", children: [_jsxs("div", { children: [_jsx("div", { className: "font-medium", children: extra.name }), _jsx("div", { className: "text-xs font-normal text-muted-foreground", children: collectionModeLabel(extra.collectionMode, messages.collectionModeLabels) })] }), _jsxs("div", { className: "flex flex-wrap gap-1", children: [_jsxs(Button, { type: "button", variant: "outline", size: "sm", disabled: pending, onClick: () => bulkSetExtra(extra, true), children: [_jsx(Check, { "data-icon": "inline-start", "aria-hidden": "true" }), messages.selectAll] }), _jsxs(Button, { type: "button", variant: "outline", size: "sm", disabled: pending, onClick: () => bulkSetExtra(extra, false), children: [_jsx(X, { "data-icon": "inline-start", "aria-hidden": "true" }), messages.clearAll] }), extra.collectionMode === "cash_on_trip" ? (_jsxs(Button, { type: "button", variant: "outline", size: "sm", disabled: pending, onClick: () => bulkCollection(extra, "collected"), children: [_jsx(CircleDollarSign, { "data-icon": "inline-start", "aria-hidden": "true" }), messages.markCollected] })) : null] })] }) }, extra.id)))] }) }), _jsx(TableBody, { children: manifest.travelers.map((traveler) => (_jsxs(TableRow, { children: [_jsx(TableCell, { className: "sticky left-0 z-10 bg-background font-medium", children: traveler.fullName }), _jsx(TableCell, { className: "font-mono text-xs", children: traveler.bookingNumber }), manifest.extras.map((extra) => {
74
74
  const selection = selectionByKey.get(selectionKey(traveler.id, extra.id));
75
75
  const selected = selection?.selected ?? false;
76
76
  return (_jsx(TableCell, { children: _jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [_jsxs(Button, { type: "button", variant: selected ? "default" : "outline", size: "sm", disabled: pending, onClick: () => setCell(traveler, extra, selection, !selected), children: [selected ? (_jsx(Check, { "data-icon": "inline-start", "aria-hidden": "true" })) : (_jsx(X, { "data-icon": "inline-start", "aria-hidden": "true" })), selected ? messages.selectedLabel : messages.selectLabel] }), selection ? _jsx(CollectionBadge, { selection: selection }) : null] }) }, extra.id));
@@ -89,18 +89,18 @@ function CollectionBadge({ selection }) {
89
89
  }
90
90
  return _jsx(Badge, { variant: "outline", children: messages.notRequiredLabel });
91
91
  }
92
- function collectionModeLabel(mode) {
92
+ function collectionModeLabel(mode, labels) {
93
93
  switch (mode) {
94
94
  case "cash_on_trip":
95
- return "Cash on trip";
95
+ return labels.cash_on_trip;
96
96
  case "external":
97
- return "External";
97
+ return labels.external;
98
98
  case "included":
99
- return "Included";
99
+ return labels.included;
100
100
  case "none":
101
- return "No collection";
101
+ return labels.none;
102
102
  default:
103
- return "Booking total";
103
+ return labels.booking_total;
104
104
  }
105
105
  }
106
106
  function selectionKey(travelerId, productExtraId) {
package/dist/i18n/en.d.ts CHANGED
@@ -35,6 +35,13 @@ export declare const extrasUiEn: {
35
35
  pendingLabel: string;
36
36
  waivedLabel: string;
37
37
  notRequiredLabel: string;
38
+ collectionModeLabels: {
39
+ cash_on_trip: string;
40
+ external: string;
41
+ included: string;
42
+ none: string;
43
+ booking_total: string;
44
+ };
38
45
  markCollected: string;
39
46
  markWaived: string;
40
47
  selectAll: string;
@@ -1 +1 @@
1
- {"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../src/i18n/en.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2CK,CAAA"}
1
+ {"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../src/i18n/en.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkDK,CAAA"}
package/dist/i18n/en.js CHANGED
@@ -35,6 +35,13 @@ export const extrasUiEn = {
35
35
  pendingLabel: "Pending",
36
36
  waivedLabel: "Waived",
37
37
  notRequiredLabel: "No collection",
38
+ collectionModeLabels: {
39
+ cash_on_trip: "Cash on trip",
40
+ external: "External",
41
+ included: "Included",
42
+ none: "No collection",
43
+ booking_total: "Booking total",
44
+ },
38
45
  markCollected: "Mark collected",
39
46
  markWaived: "Waive",
40
47
  selectAll: "Select all",
@@ -26,6 +26,7 @@ export type ExtrasUiMessages = {
26
26
  pendingLabel: string;
27
27
  waivedLabel: string;
28
28
  notRequiredLabel: string;
29
+ collectionModeLabels: Record<"cash_on_trip" | "external" | "included" | "none" | "booking_total", string>;
29
30
  markCollected: string;
30
31
  markWaived: string;
31
32
  selectAll: string;
@@ -1 +1 @@
1
- {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/i18n/messages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAE7D,MAAM,MAAM,aAAa,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAA;AACnD,MAAM,MAAM,kBAAkB,GAAG,aAAa,CAAC,aAAa,CAAC,CAAA;AAE7D,MAAM,MAAM,gBAAgB,GAAG;IAC7B,WAAW,EAAE;QACX,QAAQ,EAAE,MAAM,CAAA;QAChB,UAAU,EAAE,MAAM,CAAA;KACnB,CAAA;IACD,eAAe,EAAE;QACf,WAAW,EAAE,MAAM,CAAA;QACnB,OAAO,EAAE,MAAM,CAAA;QACf,KAAK,EAAE,MAAM,CAAA;QACb,YAAY,EAAE,MAAM,CAAC,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AM,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAA;KACtD,CAAA;IACD,YAAY,EAAE;QACZ,KAAK,EAAE,MAAM,CAAA;QACb,WAAW,EAAE,MAAM,CAAA;QACnB,cAAc,EAAE,MAAM,CAAA;QACtB,cAAc,EAAE,MAAM,CAAA;QACtB,aAAa,EAAE,MAAM,CAAA;QACrB,aAAa,EAAE,MAAM,CAAA;QACrB,WAAW,EAAE,MAAM,CAAA;QACnB,WAAW,EAAE,MAAM,CAAA;QACnB,cAAc,EAAE,MAAM,CAAA;QACtB,YAAY,EAAE,MAAM,CAAA;QACpB,WAAW,EAAE,MAAM,CAAA;QACnB,gBAAgB,EAAE,MAAM,CAAA;QACxB,oBAAoB,EAAE,MAAM,CAC1B,cAAc,GAAG,UAAU,GAAG,UAAU,GAAG,MAAM,GAAG,eAAe,EACnE,MAAM,CACP,CAAA;QACD,aAAa,EAAE,MAAM,CAAA;QACrB,UAAU,EAAE,MAAM,CAAA;QAClB,SAAS,EAAE,MAAM,CAAA;QACjB,QAAQ,EAAE,MAAM,CAAA;QAChB,OAAO,EAAE,MAAM,CAAA;KAChB,CAAA;CACF,CAAA"}
@@ -39,6 +39,13 @@ export declare const extrasUiMessageDefinitions: {
39
39
  pendingLabel: string;
40
40
  waivedLabel: string;
41
41
  notRequiredLabel: string;
42
+ collectionModeLabels: {
43
+ cash_on_trip: string;
44
+ external: string;
45
+ included: string;
46
+ none: string;
47
+ booking_total: string;
48
+ };
42
49
  markCollected: string;
43
50
  markWaived: string;
44
51
  selectAll: string;
@@ -83,6 +90,13 @@ export declare const extrasUiMessageDefinitions: {
83
90
  pendingLabel: string;
84
91
  waivedLabel: string;
85
92
  notRequiredLabel: string;
93
+ collectionModeLabels: {
94
+ cash_on_trip: string;
95
+ external: string;
96
+ included: string;
97
+ none: string;
98
+ booking_total: string;
99
+ };
86
100
  markCollected: string;
87
101
  markWaived: string;
88
102
  selectAll: string;
@@ -1 +1 @@
1
- {"version":3,"file":"provider.d.ts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gB,4BAA4B,qBAE3C"}
package/dist/i18n/ro.d.ts CHANGED
@@ -35,6 +35,13 @@ export declare const extrasUiRo: {
35
35
  pendingLabel: string;
36
36
  waivedLabel: string;
37
37
  notRequiredLabel: string;
38
+ collectionModeLabels: {
39
+ cash_on_trip: string;
40
+ external: string;
41
+ included: string;
42
+ none: string;
43
+ booking_total: string;
44
+ };
38
45
  markCollected: string;
39
46
  markWaived: string;
40
47
  selectAll: string;
@@ -1 +1 @@
1
- {"version":3,"file":"ro.d.ts","sourceRoot":"","sources":["../../src/i18n/ro.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2CK,CAAA"}
1
+ {"version":3,"file":"ro.d.ts","sourceRoot":"","sources":["../../src/i18n/ro.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkDK,CAAA"}
package/dist/i18n/ro.js CHANGED
@@ -35,6 +35,13 @@ export const extrasUiRo = {
35
35
  pendingLabel: "In asteptare",
36
36
  waivedLabel: "Renuntat",
37
37
  notRequiredLabel: "Fara incasare",
38
+ collectionModeLabels: {
39
+ cash_on_trip: "Cash in excursie",
40
+ external: "Extern",
41
+ included: "Inclus",
42
+ none: "Fara incasare",
43
+ booking_total: "Total rezervare",
44
+ },
38
45
  markCollected: "Marcheaza incasat",
39
46
  markWaived: "Renunta",
40
47
  selectAll: "Selecteaza tot",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voyantjs/extras-ui",
3
- "version": "0.84.1",
3
+ "version": "0.84.3",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -46,13 +46,13 @@
46
46
  "react-dom": "^19.0.0",
47
47
  "react-hook-form": "^7.60.0",
48
48
  "zod": "^4.3.6",
49
- "@voyantjs/catalog-react": "0.84.1",
50
- "@voyantjs/extras-react": "0.84.1",
51
- "@voyantjs/products-react": "0.84.1",
52
- "@voyantjs/ui": "0.84.1"
49
+ "@voyantjs/catalog-react": "0.84.3",
50
+ "@voyantjs/extras-react": "0.84.3",
51
+ "@voyantjs/products-react": "0.84.3",
52
+ "@voyantjs/ui": "0.84.3"
53
53
  },
54
54
  "dependencies": {
55
- "@voyantjs/i18n": "0.84.1"
55
+ "@voyantjs/i18n": "0.84.3"
56
56
  },
57
57
  "devDependencies": {
58
58
  "@tanstack/react-query": "^5.100.11",
@@ -66,11 +66,11 @@
66
66
  "typescript": "^6.0.2",
67
67
  "vitest": "^4.1.2",
68
68
  "zod": "^4.3.6",
69
- "@voyantjs/catalog-react": "0.84.1",
70
- "@voyantjs/extras-react": "0.84.1",
71
- "@voyantjs/i18n": "0.84.1",
72
- "@voyantjs/products-react": "0.84.1",
73
- "@voyantjs/ui": "0.84.1",
69
+ "@voyantjs/catalog-react": "0.84.3",
70
+ "@voyantjs/extras-react": "0.84.3",
71
+ "@voyantjs/i18n": "0.84.3",
72
+ "@voyantjs/products-react": "0.84.3",
73
+ "@voyantjs/ui": "0.84.3",
74
74
  "@voyantjs/voyant-typescript-config": "0.1.0"
75
75
  },
76
76
  "files": [