@incodetech/web 0.0.0-dev-20260630-d195eb29 → 0.0.0-dev-20260630-183debc7

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 (2) hide show
  1. package/dist/id/id.es.js +51 -26
  2. package/package.json +2 -2
package/dist/id/id.es.js CHANGED
@@ -614,6 +614,24 @@ var DigitalIdUpload = ({ manager, state }) => {
614
614
  return null;
615
615
  };
616
616
  //#endregion
617
+ //#region src/modules/id/manualUpload/manualUploadError.tsx
618
+ /**
619
+ * Inline validation message for the manual-upload flow. Rendered directly
620
+ * beneath the slot it refers to so the user can tell which document side was
621
+ * rejected — the side context comes from the placement, not the copy.
622
+ * `role="alert"` announces it once on insert (SC 4.1.3).
623
+ */
624
+ var ManualUploadError = ({ errorKey, id }) => {
625
+ const { t } = useTranslation();
626
+ return /* @__PURE__ */ u("div", {
627
+ id,
628
+ class: "IncodeManualUploadError",
629
+ role: "alert",
630
+ "data-testid": "manual-upload-error",
631
+ children: [/* @__PURE__ */ u(ErrorIcon, { size: 16 }), /* @__PURE__ */ u("p", { children: t(errorKey) })]
632
+ });
633
+ };
634
+ //#endregion
617
635
  //#region src/modules/id/manualUpload/uploadButton.tsx
618
636
  /**
619
637
  * Slot card for a single document side. The whole card is the clickable
@@ -764,11 +782,20 @@ var UploadTab = ({ mode, manager, state, errorMessageId }) => {
764
782
  invalid: true,
765
783
  describedById: errorMessageId
766
784
  } : {};
785
+ /**
786
+ * Render the validation message directly beneath the slot it refers to so
787
+ * the error is unambiguously tied to the correct document side. Only the
788
+ * slot matching `errorSide` gets the message.
789
+ */
790
+ const slotError = (slot) => state.errorKey && state.errorSide === slot ? /* @__PURE__ */ u(ManualUploadError, {
791
+ id: errorMessageId,
792
+ errorKey: state.errorKey
793
+ }) : null;
767
794
  if (mode === "passport") {
768
795
  const isUploading = state.uploadingSide === "passport";
769
796
  return /* @__PURE__ */ u("div", {
770
797
  class: "IncodeManualUploadTab",
771
- children: /* @__PURE__ */ u(UploadButton, {
798
+ children: [/* @__PURE__ */ u(UploadButton, {
772
799
  icon: /* @__PURE__ */ u(PassportSlotIcon, {}),
773
800
  label: slotLabel("passport", isUploading, state.passportUploaded),
774
801
  uploaded: state.passportUploaded,
@@ -776,30 +803,34 @@ var UploadTab = ({ mode, manager, state, errorMessageId }) => {
776
803
  testId: "manual-upload-passport",
777
804
  onFile: (file) => manager.manualUploadSelectFile("passport", file),
778
805
  ...slotErrorProps("passport")
779
- })
806
+ }), slotError("passport")]
780
807
  });
781
808
  }
782
809
  const isUploadingFront = state.uploadingSide === "front";
783
810
  const isUploadingBack = state.uploadingSide === "back";
784
811
  return /* @__PURE__ */ u("div", {
785
812
  class: "IncodeManualUploadTab",
786
- children: [/* @__PURE__ */ u(UploadButton, {
787
- icon: /* @__PURE__ */ u(IdFrontIcon, {}),
788
- label: slotLabel("front", isUploadingFront, state.frontUploaded),
789
- uploaded: state.frontUploaded,
790
- uploading: isUploadingFront,
791
- testId: "manual-upload-front",
792
- onFile: (file) => manager.manualUploadSelectFile("front", file),
793
- ...slotErrorProps("front")
794
- }), state.showBackSlot && /* @__PURE__ */ u(UploadButton, {
795
- icon: /* @__PURE__ */ u(IdBackIcon, {}),
796
- label: slotLabel("back", isUploadingBack, state.backUploaded),
797
- uploaded: state.backUploaded,
798
- uploading: isUploadingBack,
799
- testId: "manual-upload-back",
800
- onFile: (file) => manager.manualUploadSelectFile("back", file),
801
- ...slotErrorProps("back")
802
- })]
813
+ children: [
814
+ /* @__PURE__ */ u(UploadButton, {
815
+ icon: /* @__PURE__ */ u(IdFrontIcon, {}),
816
+ label: slotLabel("front", isUploadingFront, state.frontUploaded),
817
+ uploaded: state.frontUploaded,
818
+ uploading: isUploadingFront,
819
+ testId: "manual-upload-front",
820
+ onFile: (file) => manager.manualUploadSelectFile("front", file),
821
+ ...slotErrorProps("front")
822
+ }),
823
+ slotError("front"),
824
+ state.showBackSlot && /* @__PURE__ */ u(k, { children: [/* @__PURE__ */ u(UploadButton, {
825
+ icon: /* @__PURE__ */ u(IdBackIcon, {}),
826
+ label: slotLabel("back", isUploadingBack, state.backUploaded),
827
+ uploaded: state.backUploaded,
828
+ uploading: isUploadingBack,
829
+ testId: "manual-upload-back",
830
+ onFile: (file) => manager.manualUploadSelectFile("back", file),
831
+ ...slotErrorProps("back")
832
+ }), slotError("back")] })
833
+ ]
803
834
  });
804
835
  };
805
836
  //#endregion
@@ -880,13 +911,7 @@ var ManualUpload = ({ manager, state }) => {
880
911
  manager,
881
912
  state,
882
913
  errorMessageId
883
- }) : null, state.errorKey ? /* @__PURE__ */ u("div", {
884
- id: errorMessageId,
885
- class: "IncodeManualUploadError",
886
- role: "alert",
887
- "data-testid": "manual-upload-error",
888
- children: [/* @__PURE__ */ u(ErrorIcon, { size: 16 }), /* @__PURE__ */ u("p", { children: t(state.errorKey) })]
889
- }) : null]
914
+ }) : null, state.errorKey && !state.errorSide ? /* @__PURE__ */ u(ManualUploadError, { errorKey: state.errorKey }) : null]
890
915
  }), /* @__PURE__ */ u("div", {
891
916
  class: "IncodeManualUploadFooter",
892
917
  children: [/* @__PURE__ */ u("ul", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@incodetech/web",
3
- "version": "0.0.0-dev-20260630-d195eb29",
3
+ "version": "0.0.0-dev-20260630-183debc7",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/IncodeTechnologies/incode-web-sdk.git"
@@ -291,7 +291,7 @@
291
291
  "qrcode": "^1.5.4",
292
292
  "signature_pad": "^5.1.3",
293
293
  "tailwindcss": "^4.1.17",
294
- "@incodetech/core": "0.0.0-dev-20260630-d195eb29"
294
+ "@incodetech/core": "0.0.0-dev-20260630-183debc7"
295
295
  },
296
296
  "devDependencies": {
297
297
  "@microsoft/api-extractor": "^7.53.3",