@asgardeo/react 0.6.1 → 0.6.2

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
@@ -7391,13 +7391,6 @@ var generateId = (prefix) => {
7391
7391
  return `${prefix}_${suffix}`;
7392
7392
  };
7393
7393
  var getInputVariant = (type, name) => {
7394
- const lowerName = name.toLowerCase();
7395
- if (lowerName.includes("password")) {
7396
- return "PASSWORD";
7397
- }
7398
- if (lowerName.includes("email")) {
7399
- return "EMAIL";
7400
- }
7401
7394
  switch (type.toLowerCase()) {
7402
7395
  case "email":
7403
7396
  return "EMAIL";
@@ -7424,15 +7417,19 @@ var getInputPlaceholder = (name, type, t) => {
7424
7417
  return placeholder;
7425
7418
  };
7426
7419
  var convertSimpleInputToComponent = (input, t) => {
7427
- const variant = getInputVariant(input.type, input.name);
7428
- const label = getInputLabel(input.name, input.type, t);
7429
- const placeholder = getInputPlaceholder(input.name, input.type, t);
7420
+ let fieldType = input.type;
7421
+ if (input.name.toLowerCase().includes("password") && input.type.toLowerCase() === "string") {
7422
+ fieldType = "password";
7423
+ }
7424
+ const variant = getInputVariant(fieldType, input.name);
7425
+ const label = getInputLabel(input.name, fieldType, t);
7426
+ const placeholder = getInputPlaceholder(input.name, fieldType, t);
7430
7427
  return {
7431
7428
  id: generateId("input"),
7432
7429
  type: EmbeddedFlowComponentType2.Input,
7433
7430
  variant,
7434
7431
  config: {
7435
- type: input.type,
7432
+ type: fieldType,
7436
7433
  label,
7437
7434
  placeholder,
7438
7435
  required: input.required,
@@ -7443,7 +7440,8 @@ var convertSimpleInputToComponent = (input, t) => {
7443
7440
  };
7444
7441
  };
7445
7442
  var convertActionToComponent = (action, t) => {
7446
- const i18nKey = `elements.buttons.${action.id}`;
7443
+ const normalizedId = action.id.replace(/_auth$/, "");
7444
+ const i18nKey = `elements.buttons.${normalizedId}`;
7447
7445
  let text = t(i18nKey);
7448
7446
  if (!text || text === i18nKey) {
7449
7447
  text = action.id.replace(/_/g, " ");
@@ -8210,13 +8208,6 @@ var generateId2 = (prefix) => {
8210
8208
  return `${prefix}_${suffix}`;
8211
8209
  };
8212
8210
  var getInputVariant2 = (type, name) => {
8213
- const lowerName = name.toLowerCase();
8214
- if (lowerName.includes("password")) {
8215
- return "PASSWORD";
8216
- }
8217
- if (lowerName.includes("email")) {
8218
- return "EMAIL";
8219
- }
8220
8211
  switch (type.toLowerCase()) {
8221
8212
  case "email":
8222
8213
  return "EMAIL";
@@ -8243,6 +8234,10 @@ var getInputPlaceholder2 = (name, type, t) => {
8243
8234
  return placeholder;
8244
8235
  };
8245
8236
  var convertSimpleInputToComponent2 = (input, t) => {
8237
+ let fieldType = input.type;
8238
+ if (input.name.toLowerCase().includes("password") && input.type.toLowerCase() === "string") {
8239
+ fieldType = "password";
8240
+ }
8246
8241
  const variant = getInputVariant2(input.type, input.name);
8247
8242
  const label = getInputLabel2(input.name, input.type, t);
8248
8243
  const placeholder = getInputPlaceholder2(input.name, input.type, t);
@@ -8262,7 +8257,8 @@ var convertSimpleInputToComponent2 = (input, t) => {
8262
8257
  };
8263
8258
  };
8264
8259
  var convertActionToComponent2 = (action, t) => {
8265
- const i18nKey = `elements.buttons.${action.id}`;
8260
+ const normalizedId = action.id.replace(/_auth$/, "");
8261
+ const i18nKey = `elements.buttons.${normalizedId}`;
8266
8262
  let text = t(i18nKey);
8267
8263
  if (!text || text === i18nKey) {
8268
8264
  text = action.id.replace(/_/g, " ");