kaafil-react-uikit 0.1.0-beta.1 → 0.2.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 (61) hide show
  1. package/README.md +12 -6
  2. package/dist/admin/index.cjs +343 -343
  3. package/dist/admin/index.cjs.map +1 -1
  4. package/dist/admin/index.js +6 -6
  5. package/dist/admin/index.js.map +1 -1
  6. package/dist/chunk-57SUK3GD.cjs +110 -0
  7. package/dist/chunk-57SUK3GD.cjs.map +1 -0
  8. package/dist/{chunk-LL243STJ.cjs → chunk-6WV5VYT2.cjs} +111 -95
  9. package/dist/chunk-6WV5VYT2.cjs.map +1 -0
  10. package/dist/{chunk-YDGR7JSY.js → chunk-7ISKFGLW.js} +28 -12
  11. package/dist/chunk-7ISKFGLW.js.map +1 -0
  12. package/dist/{chunk-PTQ2CJKE.cjs → chunk-7UFX3Y2U.cjs} +4 -4
  13. package/dist/{chunk-PTQ2CJKE.cjs.map → chunk-7UFX3Y2U.cjs.map} +1 -1
  14. package/dist/{chunk-6FPAGGFL.js → chunk-A4Z2YBEF.js} +29 -8
  15. package/dist/chunk-A4Z2YBEF.js.map +1 -0
  16. package/dist/{chunk-IIPQ4JNC.js → chunk-GJ2J3PYN.js} +3 -3
  17. package/dist/{chunk-IIPQ4JNC.js.map → chunk-GJ2J3PYN.js.map} +1 -1
  18. package/dist/{chunk-PJRZCOFF.cjs → chunk-HTIY33UH.cjs} +37 -37
  19. package/dist/{chunk-PJRZCOFF.cjs.map → chunk-HTIY33UH.cjs.map} +1 -1
  20. package/dist/chunk-KW5LH6KV.js +105 -0
  21. package/dist/chunk-KW5LH6KV.js.map +1 -0
  22. package/dist/{chunk-XI7MK4Y7.js → chunk-L3QEMEFM.js} +3 -3
  23. package/dist/{chunk-XI7MK4Y7.js.map → chunk-L3QEMEFM.js.map} +1 -1
  24. package/dist/{chunk-WUAFL77X.js → chunk-LJJMNZ7B.js} +7 -101
  25. package/dist/chunk-LJJMNZ7B.js.map +1 -0
  26. package/dist/{chunk-QHUDOVKW.cjs → chunk-OZJ74DVQ.cjs} +33 -17
  27. package/dist/chunk-OZJ74DVQ.cjs.map +1 -0
  28. package/dist/{chunk-VHTSTUCJ.cjs → chunk-RG4YDSCN.cjs} +17 -114
  29. package/dist/chunk-RG4YDSCN.cjs.map +1 -0
  30. package/dist/{chunk-UYJ6LIWP.js → chunk-RSC2ZJUP.js} +35 -19
  31. package/dist/chunk-RSC2ZJUP.js.map +1 -0
  32. package/dist/{chunk-UUGMNP27.js → chunk-SIAPCJ7G.js} +5 -5
  33. package/dist/{chunk-UUGMNP27.js.map → chunk-SIAPCJ7G.js.map} +1 -1
  34. package/dist/{chunk-EM7JV3D7.cjs → chunk-UALMCHNW.cjs} +29 -8
  35. package/dist/chunk-UALMCHNW.cjs.map +1 -0
  36. package/dist/{chunk-ACVU55PZ.cjs → chunk-YNHOPYBK.cjs} +12 -12
  37. package/dist/{chunk-ACVU55PZ.cjs.map → chunk-YNHOPYBK.cjs.map} +1 -1
  38. package/dist/core/index.cjs +126 -120
  39. package/dist/core/index.cjs.map +1 -1
  40. package/dist/core/index.js +19 -13
  41. package/dist/core/index.js.map +1 -1
  42. package/dist/index.css +1 -1
  43. package/dist/manager/index.cjs +278 -283
  44. package/dist/manager/index.cjs.map +1 -1
  45. package/dist/manager/index.js +48 -52
  46. package/dist/manager/index.js.map +1 -1
  47. package/dist/traveller/index.cjs +35 -35
  48. package/dist/traveller/index.js +5 -5
  49. package/package.json +4 -3
  50. package/dist/chunk-6FPAGGFL.js.map +0 -1
  51. package/dist/chunk-EM7JV3D7.cjs.map +0 -1
  52. package/dist/chunk-LL243STJ.cjs.map +0 -1
  53. package/dist/chunk-PZKXLQSU.js +0 -10
  54. package/dist/chunk-PZKXLQSU.js.map +0 -1
  55. package/dist/chunk-QHUDOVKW.cjs.map +0 -1
  56. package/dist/chunk-TOBZFADB.cjs +0 -12
  57. package/dist/chunk-TOBZFADB.cjs.map +0 -1
  58. package/dist/chunk-UYJ6LIWP.js.map +0 -1
  59. package/dist/chunk-VHTSTUCJ.cjs.map +0 -1
  60. package/dist/chunk-WUAFL77X.js.map +0 -1
  61. package/dist/chunk-YDGR7JSY.js.map +0 -1
@@ -1,8 +1,9 @@
1
- import { useManagerMe, useConflicts, useNotifications } from '../chunk-YDGR7JSY.js';
2
- import { FORM_FIELD_KIND_SINGLE_BOOLEAN, useChecklists, useManagers, useCloseout, useFiles, useFloat, useForms, useParties, useItinerary, useVendors, useExpenses, useCollections, useManagerToday, usePickups, useRooming, useTravellerProfile, useSeating } from '../chunk-UYJ6LIWP.js';
3
- import { useOfflineEngine } from '../chunk-PZKXLQSU.js';
4
- export { BootErrorScreen, LockedTripScreen, NotFoundScreen, OfflineFallbackScreen, SessionExpiredScreen } from '../chunk-IIPQ4JNC.js';
5
- import { createRegistry, useKaafilChrome, tokenStyle, useOutboxStatus, useSession } from '../chunk-6FPAGGFL.js';
1
+ import { useManagerMe, useConflicts, useNotifications } from '../chunk-7ISKFGLW.js';
2
+ import { FORM_FIELD_KIND_SINGLE_BOOLEAN, useChecklists, useManagers, useCloseout, useFiles, useFloat, useForms, useParties, useItinerary, useVendors, useExpenses, useCollections, useManagerToday, usePickups, useRooming, useTravellerProfile, useSeating } from '../chunk-RSC2ZJUP.js';
3
+ import { useOfflineEngine, useKaafilBrand } from '../chunk-KW5LH6KV.js';
4
+ import { OfflineFallbackScreen } from '../chunk-GJ2J3PYN.js';
5
+ export { BootErrorScreen, LockedTripScreen, NotFoundScreen, OfflineFallbackScreen, SessionExpiredScreen } from '../chunk-GJ2J3PYN.js';
6
+ import { createRegistry, useKaafilChrome, tokenStyle, useOutboxStatus, useSession } from '../chunk-A4Z2YBEF.js';
6
7
  import { useState, useRef, useEffect, useMemo, useId } from 'react';
7
8
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
8
9
 
@@ -4605,7 +4606,24 @@ function ManagerManifestSection({
4605
4606
  ] });
4606
4607
  }
4607
4608
  if (parties.status === "error") {
4608
- return null;
4609
+ return /* @__PURE__ */ jsx(
4610
+ OfflineFallbackScreen,
4611
+ {
4612
+ tripRef,
4613
+ onRetry: () => void parties.retry(),
4614
+ ...style !== void 0 ? { style } : {}
4615
+ }
4616
+ );
4617
+ }
4618
+ if (!parties.tripRoster.loaded && parties.tripRoster.lastFetchFailed) {
4619
+ return /* @__PURE__ */ jsx(
4620
+ OfflineFallbackScreen,
4621
+ {
4622
+ tripRef,
4623
+ onRetry: () => void parties.tripRoster.refresh(),
4624
+ ...style !== void 0 ? { style } : {}
4625
+ }
4626
+ );
4609
4627
  }
4610
4628
  const noMatches = filteredTravellers.length === 0;
4611
4629
  const resolvedEmptyView = emptyView !== void 0 ? typeof emptyView === "function" ? emptyView() : emptyView : null;
@@ -13214,6 +13232,8 @@ function ReadyKaafilManagerApp(props) {
13214
13232
  style
13215
13233
  } = props;
13216
13234
  const { t } = useKaafilChrome();
13235
+ const { appName } = useKaafilBrand();
13236
+ const surfaceTitle = appName !== void 0 && appName.trim().length > 0 ? appName : t("chrome.managerApp.title");
13217
13237
  const managerMe = useManagerMe();
13218
13238
  const notifications = useNotifications();
13219
13239
  const outboxStatus = useOutboxStatus();
@@ -13246,62 +13266,38 @@ function ReadyKaafilManagerApp(props) {
13246
13266
  if (LoadingViewComponent !== void 0) {
13247
13267
  return /* @__PURE__ */ jsx(LoadingViewComponent, {});
13248
13268
  }
13249
- return /* @__PURE__ */ jsxs(
13250
- ManagerShell,
13251
- {
13252
- header: { title: t("chrome.managerApp.title") },
13253
- components: shellComponents,
13254
- style,
13255
- children: [
13256
- /* @__PURE__ */ jsxs("div", { className: "kf-manager-app__skeleton", children: [
13257
- /* @__PURE__ */ jsx("div", { className: "kf-manager-app__skeleton-block" }),
13258
- /* @__PURE__ */ jsx("div", { className: "kf-manager-app__skeleton-line" })
13259
- ] }),
13260
- syncBadge
13261
- ]
13262
- }
13263
- );
13269
+ return /* @__PURE__ */ jsxs(ManagerShell, { header: { title: surfaceTitle }, components: shellComponents, style, children: [
13270
+ /* @__PURE__ */ jsxs("div", { className: "kf-manager-app__skeleton", children: [
13271
+ /* @__PURE__ */ jsx("div", { className: "kf-manager-app__skeleton-block" }),
13272
+ /* @__PURE__ */ jsx("div", { className: "kf-manager-app__skeleton-line" })
13273
+ ] }),
13274
+ syncBadge
13275
+ ] });
13264
13276
  }
13265
13277
  if (managerMe.status === "error" || managerMe.trips.length === 0) {
13266
13278
  if (EmptyStateComponent !== void 0) {
13267
13279
  return /* @__PURE__ */ jsx(EmptyStateComponent, {});
13268
13280
  }
13269
- return /* @__PURE__ */ jsxs(
13270
- ManagerShell,
13271
- {
13272
- header: { title: t("chrome.managerApp.title") },
13273
- components: shellComponents,
13274
- style,
13275
- children: [
13276
- /* @__PURE__ */ jsx("p", { className: "kf-manager-app__empty", children: t("chrome.managerApp.noTripAssignment") }),
13277
- syncBadge
13278
- ]
13279
- }
13280
- );
13281
+ return /* @__PURE__ */ jsxs(ManagerShell, { header: { title: surfaceTitle }, components: shellComponents, style, children: [
13282
+ /* @__PURE__ */ jsx("p", { className: "kf-manager-app__empty", children: t("chrome.managerApp.noTripAssignment") }),
13283
+ syncBadge
13284
+ ] });
13281
13285
  }
13282
13286
  const { trips, manager, syncedAt } = managerMe;
13283
13287
  const resolvedTripRef = controlledTripRef ?? internalTripRef ?? (trips.length === 1 ? trips[0]?.tripRef : void 0);
13284
13288
  const currentTrip = trips.find((trip) => trip.tripRef === resolvedTripRef);
13285
13289
  if (currentTrip === void 0) {
13286
- return /* @__PURE__ */ jsxs(
13287
- ManagerShell,
13288
- {
13289
- header: { title: t("chrome.managerApp.title") },
13290
- components: shellComponents,
13291
- style,
13292
- children: [
13293
- /* @__PURE__ */ jsx(
13294
- TripListScreen,
13295
- {
13296
- trips,
13297
- onSelect: selectTrip,
13298
- TripListItemComponent
13299
- }
13300
- ),
13301
- syncBadge
13302
- ]
13303
- }
13304
- );
13290
+ return /* @__PURE__ */ jsxs(ManagerShell, { header: { title: surfaceTitle }, components: shellComponents, style, children: [
13291
+ /* @__PURE__ */ jsx(
13292
+ TripListScreen,
13293
+ {
13294
+ trips,
13295
+ onSelect: selectTrip,
13296
+ TripListItemComponent
13297
+ }
13298
+ ),
13299
+ syncBadge
13300
+ ] });
13305
13301
  }
13306
13302
  const tripRef = currentTrip.tripRef;
13307
13303
  const isTrek = currentTrip.eventType === "TREK";