@asgardeo/react 0.21.3 → 0.21.4

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/dist/index.js CHANGED
@@ -5241,6 +5241,16 @@ var createField = (config) => {
5241
5241
  autoComplete: "email"
5242
5242
  }
5243
5243
  );
5244
+ case FieldType.Tel:
5245
+ return /* @__PURE__ */ jsx35(
5246
+ TextField_default,
5247
+ {
5248
+ ...commonProps,
5249
+ type: "tel",
5250
+ onChange: (e) => onChange(e.target.value),
5251
+ autoComplete: "tel"
5252
+ }
5253
+ );
5244
5254
  case FieldType.Date:
5245
5255
  return /* @__PURE__ */ jsx35(DatePicker_default, { ...commonProps, onChange: (e) => onChange(e.target.value) });
5246
5256
  case FieldType.Checkbox: {
@@ -8791,6 +8801,8 @@ var getFieldType = (variant) => {
8791
8801
  switch (variant) {
8792
8802
  case EmbeddedFlowComponentType.EmailInput:
8793
8803
  return FieldType7.Email;
8804
+ case EmbeddedFlowComponentType.PhoneInput:
8805
+ return FieldType7.Tel;
8794
8806
  case EmbeddedFlowComponentType.PasswordInput:
8795
8807
  return FieldType7.Password;
8796
8808
  case EmbeddedFlowComponentType.TextInput:
@@ -8839,7 +8851,8 @@ var createAuthComponentFromFlow = (component, formValues, touchedFields, formErr
8839
8851
  switch (component.type) {
8840
8852
  case EmbeddedFlowComponentType.TextInput:
8841
8853
  case EmbeddedFlowComponentType.PasswordInput:
8842
- case EmbeddedFlowComponentType.EmailInput: {
8854
+ case EmbeddedFlowComponentType.EmailInput:
8855
+ case EmbeddedFlowComponentType.PhoneInput: {
8843
8856
  const identifier = component.ref;
8844
8857
  const value = formValues[identifier] || "";
8845
8858
  const isTouched = touchedFields[identifier] || false;
@@ -8859,6 +8872,25 @@ var createAuthComponentFromFlow = (component, formValues, touchedFields, formErr
8859
8872
  });
8860
8873
  return cloneElement(field, { key });
8861
8874
  }
8875
+ case EmbeddedFlowComponentType.OtpInput: {
8876
+ const identifier = component.ref;
8877
+ const value = formValues[identifier] || "";
8878
+ const isTouched = touchedFields[identifier] || false;
8879
+ const error = isTouched ? formErrors[identifier] : void 0;
8880
+ const field = createField({
8881
+ className: options.inputClassName,
8882
+ error,
8883
+ label: resolve(component.label) || "",
8884
+ name: identifier,
8885
+ onBlur: () => options.onInputBlur?.(identifier),
8886
+ onChange: (newValue) => onInputChange(identifier, newValue),
8887
+ placeholder: resolve(component.placeholder) || "",
8888
+ required: component.required || false,
8889
+ type: FieldType7.Otp,
8890
+ value
8891
+ });
8892
+ return cloneElement(field, { key });
8893
+ }
8862
8894
  case EmbeddedFlowComponentType.Action: {
8863
8895
  const actionId = component.id;
8864
8896
  const eventType = component.eventType || "";
@@ -9239,7 +9271,7 @@ var BaseSignInContent2 = ({
9239
9271
  const fields = [];
9240
9272
  const processComponents = (comps) => {
9241
9273
  comps.forEach((component) => {
9242
- if (component.type === "TEXT_INPUT" || component.type === "PASSWORD_INPUT" || component.type === "EMAIL_INPUT") {
9274
+ if (component.type === "TEXT_INPUT" || component.type === "PASSWORD_INPUT" || component.type === "EMAIL_INPUT" || component.type === "PHONE_INPUT" || component.type === "OTP_INPUT") {
9243
9275
  const identifier = component.ref;
9244
9276
  fields.push({
9245
9277
  initialValue: "",
@@ -12245,7 +12277,7 @@ var BaseInviteUser = ({
12245
12277
  const errors = {};
12246
12278
  const validateComponents = (comps) => {
12247
12279
  comps.forEach((comp) => {
12248
- if ((comp.type === "TEXT_INPUT" || comp.type === "EMAIL_INPUT" || comp.type === "SELECT") && comp.required && comp.ref) {
12280
+ if ((comp.type === "TEXT_INPUT" || comp.type === "EMAIL_INPUT" || comp.type === "SELECT" || comp.type === "PHONE_INPUT" || comp.type === "OTP_INPUT") && comp.required && comp.ref) {
12249
12281
  const value = formValues[comp.ref];
12250
12282
  if (!value || value.trim() === "") {
12251
12283
  errors[comp.ref] = `${comp.label || comp.ref} is required`;
@@ -12704,7 +12736,7 @@ var BaseAcceptInvite = ({
12704
12736
  const errors = {};
12705
12737
  const validateComponents = (comps) => {
12706
12738
  comps.forEach((comp) => {
12707
- if ((comp.type === "PASSWORD_INPUT" || comp.type === "TEXT_INPUT" || comp.type === "EMAIL_INPUT") && comp.required && comp.ref) {
12739
+ if ((comp.type === "PASSWORD_INPUT" || comp.type === "TEXT_INPUT" || comp.type === "EMAIL_INPUT" || comp.type === "PHONE_INPUT" || comp.type === "OTP_INPUT") && comp.required && comp.ref) {
12708
12740
  const value = formValues[comp.ref];
12709
12741
  if (!value || value.trim() === "") {
12710
12742
  errors[comp.ref] = t("validations.required.field.error");