kaafil-react-uikit 0.3.1 → 0.4.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 (62) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/dist/admin/index.cjs +565 -387
  3. package/dist/admin/index.cjs.map +1 -1
  4. package/dist/admin/index.d.cts +2 -2
  5. package/dist/admin/index.d.ts +2 -2
  6. package/dist/admin/index.js +231 -53
  7. package/dist/admin/index.js.map +1 -1
  8. package/dist/{chunk-RO2RNHQP.js → chunk-2LMFSKZU.js} +56 -17
  9. package/dist/chunk-2LMFSKZU.js.map +1 -0
  10. package/dist/{chunk-BBC5EX5O.cjs → chunk-2XW5EIMS.cjs} +17 -17
  11. package/dist/{chunk-BBC5EX5O.cjs.map → chunk-2XW5EIMS.cjs.map} +1 -1
  12. package/dist/{chunk-YU2242AR.js → chunk-3BEQYIFU.js} +5 -5
  13. package/dist/{chunk-YU2242AR.js.map → chunk-3BEQYIFU.js.map} +1 -1
  14. package/dist/{chunk-UALMCHNW.cjs → chunk-3N2EQ2KC.cjs} +84 -36
  15. package/dist/chunk-3N2EQ2KC.cjs.map +1 -0
  16. package/dist/{chunk-57SUK3GD.cjs → chunk-4QYI7TOF.cjs} +7 -7
  17. package/dist/{chunk-57SUK3GD.cjs.map → chunk-4QYI7TOF.cjs.map} +1 -1
  18. package/dist/{chunk-ECCQW5LN.cjs → chunk-6BY2NPBZ.cjs} +4 -4
  19. package/dist/{chunk-ECCQW5LN.cjs.map → chunk-6BY2NPBZ.cjs.map} +1 -1
  20. package/dist/{chunk-YNHOPYBK.cjs → chunk-7356B6YS.cjs} +12 -12
  21. package/dist/{chunk-YNHOPYBK.cjs.map → chunk-7356B6YS.cjs.map} +1 -1
  22. package/dist/{chunk-A4Z2YBEF.js → chunk-7G6IENKN.js} +84 -36
  23. package/dist/chunk-7G6IENKN.js.map +1 -0
  24. package/dist/{chunk-6TI6YQPE.cjs → chunk-A7C74SJT.cjs} +168 -123
  25. package/dist/chunk-A7C74SJT.cjs.map +1 -0
  26. package/dist/{chunk-KW5LH6KV.js → chunk-CLHAJBJS.js} +3 -3
  27. package/dist/{chunk-KW5LH6KV.js.map → chunk-CLHAJBJS.js.map} +1 -1
  28. package/dist/{chunk-GJ2J3PYN.js → chunk-E6ER25BG.js} +3 -3
  29. package/dist/{chunk-GJ2J3PYN.js.map → chunk-E6ER25BG.js.map} +1 -1
  30. package/dist/{chunk-HACH2NUM.cjs → chunk-KETEED2T.cjs} +9 -9
  31. package/dist/{chunk-HACH2NUM.cjs.map → chunk-KETEED2T.cjs.map} +1 -1
  32. package/dist/{chunk-RWLO6IFX.js → chunk-KTEXDGAA.js} +3 -3
  33. package/dist/{chunk-RWLO6IFX.js.map → chunk-KTEXDGAA.js.map} +1 -1
  34. package/dist/{chunk-VLP323AD.js → chunk-RBIEMGHT.js} +3 -3
  35. package/dist/{chunk-VLP323AD.js.map → chunk-RBIEMGHT.js.map} +1 -1
  36. package/dist/{chunk-JHMN6Q5R.js → chunk-WPQB7JWS.js} +92 -47
  37. package/dist/chunk-WPQB7JWS.js.map +1 -0
  38. package/dist/{chunk-IU2UM5JP.cjs → chunk-XBLAVNP3.cjs} +88 -48
  39. package/dist/chunk-XBLAVNP3.cjs.map +1 -0
  40. package/dist/core/index.cjs +124 -121
  41. package/dist/core/index.cjs.map +1 -1
  42. package/dist/core/index.d.cts +10 -1
  43. package/dist/core/index.d.ts +10 -1
  44. package/dist/core/index.js +20 -19
  45. package/dist/core/index.js.map +1 -1
  46. package/dist/index.css +1 -1
  47. package/dist/manager/index.cjs +239 -239
  48. package/dist/manager/index.js +6 -6
  49. package/dist/tokens.json +5013 -0
  50. package/dist/traveller/index.cjs +46 -40
  51. package/dist/traveller/index.cjs.map +1 -1
  52. package/dist/traveller/index.js +16 -10
  53. package/dist/traveller/index.js.map +1 -1
  54. package/dist/{useAgencyTrip-BUYSIaC2.d.cts → useAgencyTrip-C1YmfuQq.d.cts} +35 -1
  55. package/dist/{useAgencyTrip-BzyJB1D9.d.ts → useAgencyTrip-gZB0NILH.d.ts} +35 -1
  56. package/package.json +4 -3
  57. package/dist/chunk-6TI6YQPE.cjs.map +0 -1
  58. package/dist/chunk-A4Z2YBEF.js.map +0 -1
  59. package/dist/chunk-IU2UM5JP.cjs.map +0 -1
  60. package/dist/chunk-JHMN6Q5R.js.map +0 -1
  61. package/dist/chunk-RO2RNHQP.js.map +0 -1
  62. package/dist/chunk-UALMCHNW.cjs.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import { KaafilClient, AgencyManagersResource, TravellersResource, AgencyManagerFilters, TravellerDirectoryFilters, TripManagersResource, PartyKind, TripPartiesResource, AgencyTripsResource, AgencyTripFilters, AgencyTripSegmentCounts, TripManifestFilters, TripManifestFacets, CollectionsResource, ListEligibleCollectionsOptions, RecordCollectionOptions, OutboxOp, VoidCollectionOptions } from 'kaafil-js/client';
2
- import { H as CreateAgencyChecklistTemplateInput, P as PatchAgencyChecklistTemplateInput, J as RemoveAgencyChecklistTemplateInput, K as PublishAgencyChecklistTemplateInput, D as DomainHookResult } from './useVendors-DXOuZWhZ.cjs';
2
+ import { H as CreateAgencyChecklistTemplateInput, P as PatchAgencyChecklistTemplateInput, J as RemoveAgencyChecklistTemplateInput, K as PublishAgencyChecklistTemplateInput, h as ErrorClassification, D as DomainHookResult } from './useVendors-DXOuZWhZ.cjs';
3
3
 
4
4
  type BoundAgencySettings = KaafilClient['agencies']['settings'];
5
5
  /** `AgencySettingsResponse` — never imported by name, derived off the one
@@ -107,11 +107,45 @@ interface PaginatedListFetchResult<TRow> {
107
107
  type PaginatedListFetch<TRow> = (cursor: string | undefined) => Promise<PaginatedListFetchResult<TRow>>;
108
108
  interface PaginatedListOptions {
109
109
  readonly pageSize?: number;
110
+ /**
111
+ * APPEND each forward page to the rows already held, instead of replacing
112
+ * them. Off by default, because an ordinary pager wants exactly one page
113
+ * on screen at a time.
114
+ *
115
+ * Turn it on for a caller that must hold the WHOLE list before it can
116
+ * render anything — grouping is the real case: a family split across a
117
+ * page boundary would otherwise render as two groups of two. Such a caller
118
+ * pages to exhaustion by calling `loadNext()` while `hasNext` holds, and
119
+ * without this flag it ends up with only the LAST page (and renders an
120
+ * empty state outright when that page lands empty on an exact page
121
+ * boundary). That mismatch between this hook and `ManifestResults` is the
122
+ * defect QA reported as "the layout breaks completely when switching to
123
+ * Group by".
124
+ *
125
+ * Paging backwards makes no sense while accumulating, so `hasPrev` stays
126
+ * false and `loadPrev()` is inert.
127
+ */
128
+ readonly accumulate?: boolean;
110
129
  }
111
130
  interface PaginatedListResult<TRow> {
112
131
  readonly rows: readonly TRow[];
113
132
  readonly hasNext: boolean;
114
133
  readonly hasPrev: boolean;
134
+ /**
135
+ * False until the first fetch has finished, whether it succeeded or
136
+ * failed. `rows` is `[]` both before the first response and when the list
137
+ * is genuinely empty, so a consumer that renders an empty state off
138
+ * `rows.length` alone flashes "nothing here" on every mount — which is
139
+ * what QA saw as the add-traveller dialog's "weird loader", once per
140
+ * keystroke-debounce remount. Gate the empty state on this.
141
+ */
142
+ readonly settled: boolean;
143
+ /**
144
+ * The classified failure of the most recent page fetch, or `undefined`.
145
+ * A failed page also clears `hasNext`, so a caller paging to exhaustion
146
+ * stops rather than retrying the same broken cursor forever.
147
+ */
148
+ readonly error: ErrorClassification | undefined;
115
149
  readonly loadNext: () => Promise<void>;
116
150
  readonly loadPrev: () => Promise<void>;
117
151
  }
@@ -1,5 +1,5 @@
1
1
  import { KaafilClient, AgencyManagersResource, TravellersResource, AgencyManagerFilters, TravellerDirectoryFilters, TripManagersResource, PartyKind, TripPartiesResource, AgencyTripsResource, AgencyTripFilters, AgencyTripSegmentCounts, TripManifestFilters, TripManifestFacets, CollectionsResource, ListEligibleCollectionsOptions, RecordCollectionOptions, OutboxOp, VoidCollectionOptions } from 'kaafil-js/client';
2
- import { H as CreateAgencyChecklistTemplateInput, P as PatchAgencyChecklistTemplateInput, J as RemoveAgencyChecklistTemplateInput, K as PublishAgencyChecklistTemplateInput, D as DomainHookResult } from './useVendors-DXOuZWhZ.js';
2
+ import { H as CreateAgencyChecklistTemplateInput, P as PatchAgencyChecklistTemplateInput, J as RemoveAgencyChecklistTemplateInput, K as PublishAgencyChecklistTemplateInput, h as ErrorClassification, D as DomainHookResult } from './useVendors-DXOuZWhZ.js';
3
3
 
4
4
  type BoundAgencySettings = KaafilClient['agencies']['settings'];
5
5
  /** `AgencySettingsResponse` — never imported by name, derived off the one
@@ -107,11 +107,45 @@ interface PaginatedListFetchResult<TRow> {
107
107
  type PaginatedListFetch<TRow> = (cursor: string | undefined) => Promise<PaginatedListFetchResult<TRow>>;
108
108
  interface PaginatedListOptions {
109
109
  readonly pageSize?: number;
110
+ /**
111
+ * APPEND each forward page to the rows already held, instead of replacing
112
+ * them. Off by default, because an ordinary pager wants exactly one page
113
+ * on screen at a time.
114
+ *
115
+ * Turn it on for a caller that must hold the WHOLE list before it can
116
+ * render anything — grouping is the real case: a family split across a
117
+ * page boundary would otherwise render as two groups of two. Such a caller
118
+ * pages to exhaustion by calling `loadNext()` while `hasNext` holds, and
119
+ * without this flag it ends up with only the LAST page (and renders an
120
+ * empty state outright when that page lands empty on an exact page
121
+ * boundary). That mismatch between this hook and `ManifestResults` is the
122
+ * defect QA reported as "the layout breaks completely when switching to
123
+ * Group by".
124
+ *
125
+ * Paging backwards makes no sense while accumulating, so `hasPrev` stays
126
+ * false and `loadPrev()` is inert.
127
+ */
128
+ readonly accumulate?: boolean;
110
129
  }
111
130
  interface PaginatedListResult<TRow> {
112
131
  readonly rows: readonly TRow[];
113
132
  readonly hasNext: boolean;
114
133
  readonly hasPrev: boolean;
134
+ /**
135
+ * False until the first fetch has finished, whether it succeeded or
136
+ * failed. `rows` is `[]` both before the first response and when the list
137
+ * is genuinely empty, so a consumer that renders an empty state off
138
+ * `rows.length` alone flashes "nothing here" on every mount — which is
139
+ * what QA saw as the add-traveller dialog's "weird loader", once per
140
+ * keystroke-debounce remount. Gate the empty state on this.
141
+ */
142
+ readonly settled: boolean;
143
+ /**
144
+ * The classified failure of the most recent page fetch, or `undefined`.
145
+ * A failed page also clears `hasNext`, so a caller paging to exhaustion
146
+ * stops rather than retrying the same broken cursor forever.
147
+ */
148
+ readonly error: ErrorClassification | undefined;
115
149
  readonly loadNext: () => Promise<void>;
116
150
  readonly loadPrev: () => Promise<void>;
117
151
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kaafil-react-uikit",
3
- "version": "0.3.1",
3
+ "version": "0.4.0",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "tag": "latest",
@@ -58,7 +58,7 @@
58
58
  "peerDependencies": {
59
59
  "react": ">=18.2.0 <20.0.0",
60
60
  "react-dom": ">=18.2.0 <20.0.0",
61
- "kaafil-js": "^0.3.1"
61
+ "kaafil-js": "^0.4.0"
62
62
  },
63
63
  "devDependencies": {
64
64
  "react": "^19.0.0",
@@ -80,11 +80,12 @@
80
80
  "@vitest/coverage-v8": "^2.1.8"
81
81
  },
82
82
  "scripts": {
83
- "build": "tsup && node scripts/build-css.mjs",
83
+ "build": "tsup && node scripts/build-css.mjs && node scripts/build-token-reference.mjs",
84
84
  "release": "pnpm build && pnpm publish --tag latest --no-provenance --no-git-checks",
85
85
  "release:beta": "pnpm build && pnpm publish --tag beta --no-provenance --no-git-checks",
86
86
  "build:js": "tsup",
87
87
  "build:css": "node scripts/build-css.mjs",
88
+ "build:tokens": "node scripts/build-token-reference.mjs",
88
89
  "typecheck": "tsc -p tsconfig.build.json --noEmit",
89
90
  "clean": "rimraf dist",
90
91
  "dev": "tsup --watch",