@asgardeo/react 0.25.6 → 0.25.8

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 (24) hide show
  1. package/dist/cjs/index.js +527 -356
  2. package/dist/cjs/index.js.map +4 -4
  3. package/dist/components/adapters/FormContainer.d.ts.map +1 -1
  4. package/dist/components/presentation/CreateOrganization/BaseCreateOrganization.d.ts.map +1 -1
  5. package/dist/components/presentation/CreateOrganization/BaseCreateOrganization.styles.d.ts.map +1 -1
  6. package/dist/components/presentation/OrganizationList/BaseOrganizationList.d.ts +4 -0
  7. package/dist/components/presentation/OrganizationList/BaseOrganizationList.d.ts.map +1 -1
  8. package/dist/components/presentation/OrganizationList/BaseOrganizationList.styles.d.ts.map +1 -1
  9. package/dist/components/presentation/OrganizationProfile/BaseOrganizationProfile.d.ts +4 -0
  10. package/dist/components/presentation/OrganizationProfile/BaseOrganizationProfile.d.ts.map +1 -1
  11. package/dist/components/presentation/OrganizationProfile/BaseOrganizationProfile.styles.d.ts.map +1 -1
  12. package/dist/components/presentation/UserProfile/BaseUserProfile.d.ts.map +1 -1
  13. package/dist/components/presentation/auth/Recovery/v1/RecoveryOptionFactory.d.ts +7 -2
  14. package/dist/components/presentation/auth/Recovery/v1/RecoveryOptionFactory.d.ts.map +1 -1
  15. package/dist/components/presentation/auth/SignIn/v1/BaseSignIn.d.ts.map +1 -1
  16. package/dist/components/presentation/auth/SignUp/v1/BaseSignUp.d.ts.map +1 -1
  17. package/dist/components/presentation/auth/SignUp/v1/SignUpOptionFactory.d.ts +7 -2
  18. package/dist/components/presentation/auth/SignUp/v1/SignUpOptionFactory.d.ts.map +1 -1
  19. package/dist/components/presentation/auth/SignUp/v2/BaseSignUp.d.ts.map +1 -1
  20. package/dist/index.js +258 -88
  21. package/dist/index.js.map +4 -4
  22. package/dist/utils/resolveFlowErrorMessage.d.ts +35 -0
  23. package/dist/utils/resolveFlowErrorMessage.d.ts.map +1 -0
  24. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -3790,7 +3790,6 @@ import {
3790
3790
  EmbeddedSignInFlowStatus,
3791
3791
  EmbeddedSignInFlowAuthenticatorPromptType,
3792
3792
  ApplicationNativeAuthenticationConstants as ApplicationNativeAuthenticationConstants3,
3793
- AsgardeoAPIError,
3794
3793
  withVendorCSSClassPrefix as withVendorCSSClassPrefix19,
3795
3794
  handleWebAuthnAuthentication,
3796
3795
  createPackageComponentLogger as createPackageComponentLogger5
@@ -6150,6 +6149,40 @@ var createSignInOptionFromAuthenticator = (authenticator, formValues, touchedFie
6150
6149
  ...options
6151
6150
  });
6152
6151
 
6152
+ // src/utils/resolveFlowErrorMessage.ts
6153
+ var resolveFlowErrorMessage = (error, fallback) => {
6154
+ let raw = "";
6155
+ if (error instanceof Error) {
6156
+ raw = error.message;
6157
+ } else if (typeof error === "string") {
6158
+ raw = error;
6159
+ } else if (error && typeof error === "object") {
6160
+ const { description, message } = error;
6161
+ raw = typeof description === "string" && description || typeof message === "string" && message || "";
6162
+ }
6163
+ if (!raw) {
6164
+ return fallback;
6165
+ }
6166
+ const jsonStart = raw.indexOf("{");
6167
+ const jsonEnd = raw.lastIndexOf("}");
6168
+ if (jsonStart !== -1 && jsonEnd > jsonStart) {
6169
+ try {
6170
+ const payload = JSON.parse(raw.slice(jsonStart, jsonEnd + 1));
6171
+ const extracted = payload?.description || payload?.message;
6172
+ if (typeof extracted === "string" && extracted) {
6173
+ return extracted;
6174
+ }
6175
+ } catch {
6176
+ }
6177
+ }
6178
+ const messagePart = raw.match(/Message:\s*([\s\S]+)$/);
6179
+ if (messagePart?.[1]?.trim()) {
6180
+ return messagePart[1].trim();
6181
+ }
6182
+ return raw;
6183
+ };
6184
+ var resolveFlowErrorMessage_default = resolveFlowErrorMessage;
6185
+
6153
6186
  // src/components/primitives/Alert/Alert.tsx
6154
6187
  import { withVendorCSSClassPrefix as withVendorCSSClassPrefix15, bem as bem12 } from "@asgardeo/browser";
6155
6188
  import { cx as cx15 } from "@emotion/css";
@@ -7268,7 +7301,7 @@ var BaseSignInContent = ({
7268
7301
  }
7269
7302
  }
7270
7303
  } catch (err) {
7271
- const errorMessage = err instanceof AsgardeoAPIError ? err.message : t("errors.signin.flow.failure");
7304
+ const errorMessage = resolveFlowErrorMessage_default(err, t("errors.signin.flow.failure"));
7272
7305
  setError(errorMessage);
7273
7306
  onError?.(err);
7274
7307
  } finally {
@@ -7477,7 +7510,7 @@ var BaseSignInContent = ({
7477
7510
  }
7478
7511
  }
7479
7512
  } catch (err) {
7480
- const errorMessage = err instanceof AsgardeoAPIError ? err?.message : "Authenticator selection failed";
7513
+ const errorMessage = resolveFlowErrorMessage_default(err, "Authenticator selection failed");
7481
7514
  setError(errorMessage);
7482
7515
  onError?.(err);
7483
7516
  } finally {
@@ -7563,7 +7596,7 @@ var BaseSignInContent = ({
7563
7596
  );
7564
7597
  }
7565
7598
  } catch (err) {
7566
- const errorMessage = err instanceof AsgardeoAPIError ? err.message : t("errors.signin.initialization");
7599
+ const errorMessage = resolveFlowErrorMessage_default(err, t("errors.signin.initialization"));
7567
7600
  setError(errorMessage);
7568
7601
  onError?.(err);
7569
7602
  } finally {
@@ -10426,6 +10459,7 @@ import { useEffect as useEffect19, useState as useState21, useCallback as useCal
10426
10459
 
10427
10460
  // src/components/presentation/auth/SignUp/v1/SignUpOptionFactory.tsx
10428
10461
  import { EmbeddedFlowComponentType as EmbeddedFlowComponentType2 } from "@asgardeo/browser";
10462
+ import { cloneElement as cloneElement2 } from "react";
10429
10463
 
10430
10464
  // src/components/adapters/CheckboxInput.tsx
10431
10465
  import { FieldType as FieldType8 } from "@asgardeo/browser";
@@ -10545,9 +10579,10 @@ var FormContainer = (props) => {
10545
10579
  }
10546
10580
  };
10547
10581
  return /* @__PURE__ */ jsx76("form", { onSubmit: handleFormSubmit, style: { display: "flex", flexDirection: "column" }, children: component.components.map(
10548
- (childComponent) => createSignUpComponent({
10582
+ (childComponent, index) => createSignUpComponent({
10549
10583
  ...props,
10550
- component: childComponent
10584
+ component: childComponent,
10585
+ key: childComponent.id || index
10551
10586
  })
10552
10587
  ) }, component.id);
10553
10588
  }
@@ -10846,7 +10881,7 @@ var Typography_default2 = TypographyComponent;
10846
10881
 
10847
10882
  // src/components/presentation/auth/SignUp/v1/SignUpOptionFactory.tsx
10848
10883
  import { jsx as jsx80 } from "react/jsx-runtime";
10849
- var createSignUpComponent = ({ component, onSubmit, ...rest }) => {
10884
+ var createSignUpElement = ({ component, onSubmit, ...rest }) => {
10850
10885
  switch (component.type) {
10851
10886
  case EmbeddedFlowComponentType2.Typography:
10852
10887
  return /* @__PURE__ */ jsx80(Typography_default2, { component, onSubmit, ...rest });
@@ -10910,6 +10945,10 @@ var createSignUpComponent = ({ component, onSubmit, ...rest }) => {
10910
10945
  return /* @__PURE__ */ jsx80("div", {});
10911
10946
  }
10912
10947
  };
10948
+ var createSignUpComponent = ({ key, ...props }) => {
10949
+ const element = createSignUpElement(props);
10950
+ return key === void 0 || key === null ? element : cloneElement2(element, { key });
10951
+ };
10913
10952
  var createSignUpOptionFromComponent = (component, formValues, touchedFields, formErrors, isLoading, isFormValid, onInputChange, options) => createSignUpComponent({
10914
10953
  component,
10915
10954
  formErrors,
@@ -11081,6 +11120,13 @@ var logger8 = createPackageComponentLogger7(
11081
11120
  "@asgardeo/react",
11082
11121
  "BaseSignUp"
11083
11122
  );
11123
+ var resolveAlertVariant = (type) => {
11124
+ const normalized = type?.toLowerCase() ?? "";
11125
+ if (normalized === "success" || normalized === "error" || normalized === "warning") {
11126
+ return normalized;
11127
+ }
11128
+ return "info";
11129
+ };
11084
11130
  var BaseSignUpContent = ({
11085
11131
  afterSignUpUrl,
11086
11132
  onInitialize,
@@ -11107,29 +11153,7 @@ var BaseSignUpContent = ({
11107
11153
  const styles = BaseSignUp_styles_default(theme, colorScheme);
11108
11154
  const handleError = useCallback14(
11109
11155
  (error) => {
11110
- let errorMessage = t("errors.signup.flow.failure");
11111
- if (error && typeof error === "object") {
11112
- if (error.code && (error.message || error.description)) {
11113
- errorMessage = error.description || error.message;
11114
- } else if (error instanceof Error && error.name === "AsgardeoAPIError") {
11115
- try {
11116
- const errorResponse = JSON.parse(error.message);
11117
- if (errorResponse.description) {
11118
- errorMessage = errorResponse.description;
11119
- } else if (errorResponse.message) {
11120
- errorMessage = errorResponse.message;
11121
- } else {
11122
- errorMessage = error.message;
11123
- }
11124
- } catch {
11125
- errorMessage = error.message;
11126
- }
11127
- } else if (error.message) {
11128
- errorMessage = error.message;
11129
- }
11130
- } else if (typeof error === "string") {
11131
- errorMessage = error;
11132
- }
11156
+ const errorMessage = resolveFlowErrorMessage_default(error, t("errors.signup.flow.failure"));
11133
11157
  clearMessages();
11134
11158
  addMessage({
11135
11159
  message: errorMessage,
@@ -11140,8 +11164,22 @@ var BaseSignUpContent = ({
11140
11164
  );
11141
11165
  const [isLoading, setIsLoading] = useState21(false);
11142
11166
  const [isFlowInitialized, setIsFlowInitialized] = useState21(false);
11167
+ const [isFlowComplete, setIsFlowComplete] = useState21(false);
11143
11168
  const [currentFlow, setCurrentFlow] = useState21(null);
11144
11169
  const initializationAttemptedRef = useRef8(false);
11170
+ const handleFlowComplete = useCallback14(
11171
+ (response) => {
11172
+ setCurrentFlow(response);
11173
+ setIsFlowComplete(true);
11174
+ clearMessages();
11175
+ addMessage({
11176
+ message: t("signup.success"),
11177
+ type: "success"
11178
+ });
11179
+ onComplete?.(response);
11180
+ },
11181
+ [t, addMessage, clearMessages, onComplete]
11182
+ );
11145
11183
  const extractFormFields = useCallback14(
11146
11184
  (components) => {
11147
11185
  const fields = [];
@@ -11251,9 +11289,14 @@ var BaseSignUpContent = ({
11251
11289
  };
11252
11290
  try {
11253
11291
  const continueResponse = await onSubmit(payload);
11292
+ if (!continueResponse) {
11293
+ popup.close();
11294
+ cleanup();
11295
+ return;
11296
+ }
11254
11297
  onFlowChange?.(continueResponse);
11255
11298
  if (continueResponse.flowStatus === EmbeddedFlowStatus.Complete) {
11256
- onComplete?.(continueResponse);
11299
+ handleFlowComplete(continueResponse);
11257
11300
  } else if (continueResponse.flowStatus === EmbeddedFlowStatus.Incomplete) {
11258
11301
  setCurrentFlow(continueResponse);
11259
11302
  setupFormFields(continueResponse);
@@ -11304,9 +11347,13 @@ var BaseSignUpContent = ({
11304
11347
  };
11305
11348
  try {
11306
11349
  const continueResponse = await onSubmit(payload);
11350
+ if (!continueResponse) {
11351
+ popup.close();
11352
+ return;
11353
+ }
11307
11354
  onFlowChange?.(continueResponse);
11308
11355
  if (continueResponse.flowStatus === EmbeddedFlowStatus.Complete) {
11309
- onComplete?.(continueResponse);
11356
+ handleFlowComplete(continueResponse);
11310
11357
  } else if (continueResponse.flowStatus === EmbeddedFlowStatus.Incomplete) {
11311
11358
  setCurrentFlow(continueResponse);
11312
11359
  setupFormFields(continueResponse);
@@ -11352,9 +11399,12 @@ var BaseSignUpContent = ({
11352
11399
  ...actionId && { actionId }
11353
11400
  };
11354
11401
  const response = await onSubmit(payload);
11402
+ if (!response) {
11403
+ return;
11404
+ }
11355
11405
  onFlowChange?.(response);
11356
11406
  if (response.flowStatus === EmbeddedFlowStatus.Complete) {
11357
- onComplete?.(response);
11407
+ handleFlowComplete(response);
11358
11408
  return;
11359
11409
  }
11360
11410
  if (response.flowStatus === EmbeddedFlowStatus.Incomplete) {
@@ -11363,6 +11413,11 @@ var BaseSignUpContent = ({
11363
11413
  }
11364
11414
  setCurrentFlow(response);
11365
11415
  setupFormFields(response);
11416
+ const flowError = response.data?.additionalData?.["error"];
11417
+ if (flowError) {
11418
+ clearMessages();
11419
+ addMessage({ message: String(flowError), type: "error" });
11420
+ }
11366
11421
  }
11367
11422
  } catch (err) {
11368
11423
  handleError(err);
@@ -11435,11 +11490,14 @@ var BaseSignUpContent = ({
11435
11490
  clearMessages();
11436
11491
  try {
11437
11492
  const response = await onInitialize();
11493
+ if (!response) {
11494
+ return;
11495
+ }
11438
11496
  setCurrentFlow(response);
11439
11497
  setIsFlowInitialized(true);
11440
11498
  onFlowChange?.(response);
11441
11499
  if (response.flowStatus === EmbeddedFlowStatus.Complete) {
11442
- onComplete?.(response);
11500
+ handleFlowComplete(response);
11443
11501
  return;
11444
11502
  }
11445
11503
  if (response.flowStatus === EmbeddedFlowStatus.Incomplete) {
@@ -11457,7 +11515,7 @@ var BaseSignUpContent = ({
11457
11515
  isInitialized,
11458
11516
  isFlowInitialized,
11459
11517
  onInitialize,
11460
- onComplete,
11518
+ handleFlowComplete,
11461
11519
  onError,
11462
11520
  onFlowChange,
11463
11521
  setupFormFields,
@@ -11499,13 +11557,13 @@ var BaseSignUpContent = ({
11499
11557
  flowMessages && flowMessages.length > 0 && /* @__PURE__ */ jsx81("div", { className: styles.flowMessagesContainer, children: flowMessages.map((message, index) => /* @__PURE__ */ jsx81(
11500
11558
  Alert_default,
11501
11559
  {
11502
- variant: message.type?.toLowerCase() === "error" ? "error" : "info",
11560
+ variant: resolveAlertVariant(message.type),
11503
11561
  className: cx24(styles.flowMessageItem, messageClasses),
11504
11562
  children: /* @__PURE__ */ jsx81(Alert_default.Description, { children: message.message })
11505
11563
  },
11506
11564
  message.id || index
11507
11565
  )) }),
11508
- /* @__PURE__ */ jsx81("div", { className: styles.contentContainer, children: currentFlow.data?.components && currentFlow.data.components.length > 0 ? renderComponents(currentFlow.data.components) : /* @__PURE__ */ jsx81(Alert_default, { variant: "warning", children: /* @__PURE__ */ jsx81(Typography_default, { variant: "body1", children: t("errors.signup.components.not.available") }) }) })
11566
+ !isFlowComplete && /* @__PURE__ */ jsx81("div", { className: styles.contentContainer, children: currentFlow.data?.components && currentFlow.data.components.length > 0 ? renderComponents(currentFlow.data.components) : /* @__PURE__ */ jsx81(Alert_default, { variant: "warning", children: /* @__PURE__ */ jsx81(Typography_default, { variant: "body1", children: t("errors.signup.components.not.available") }) }) })
11509
11567
  ] })
11510
11568
  ] });
11511
11569
  };
@@ -11926,6 +11984,9 @@ var BaseSignUpContent2 = ({
11926
11984
  inputs: filteredInputs
11927
11985
  };
11928
11986
  const rawResponse = await onSubmit(payload);
11987
+ if (!rawResponse) {
11988
+ return;
11989
+ }
11929
11990
  const response = normalizeFlowResponseLocal(rawResponse);
11930
11991
  onFlowChange?.(response);
11931
11992
  await setChallengeToken(response.challengeToken ?? null);
@@ -12344,8 +12405,9 @@ import { useEffect as useEffect21, useState as useState23, useCallback as useCal
12344
12405
 
12345
12406
  // src/components/presentation/auth/Recovery/v1/RecoveryOptionFactory.tsx
12346
12407
  import { EmbeddedFlowComponentType as EmbeddedFlowComponentType5 } from "@asgardeo/browser";
12408
+ import { cloneElement as cloneElement3 } from "react";
12347
12409
  import { jsx as jsx87 } from "react/jsx-runtime";
12348
- var createRecoveryComponent = ({ component, onSubmit, ...rest }) => {
12410
+ var createRecoveryElement = ({ component, onSubmit, ...rest }) => {
12349
12411
  switch (component.type) {
12350
12412
  case EmbeddedFlowComponentType5.Typography:
12351
12413
  return /* @__PURE__ */ jsx87(Typography_default2, { component, onSubmit, ...rest });
@@ -12409,6 +12471,10 @@ var createRecoveryComponent = ({ component, onSubmit, ...rest }) => {
12409
12471
  return /* @__PURE__ */ jsx87("div", {});
12410
12472
  }
12411
12473
  };
12474
+ var createRecoveryComponent = ({ key, ...props }) => {
12475
+ const element = createRecoveryElement(props);
12476
+ return key === void 0 || key === null ? element : cloneElement3(element, { key });
12477
+ };
12412
12478
  var createRecoveryOptionFromComponent = (component, formValues, touchedFields, formErrors, isLoading, isFormValid, onInputChange, options) => createRecoveryComponent({
12413
12479
  component,
12414
12480
  formErrors,
@@ -14824,7 +14890,7 @@ import {
14824
14890
  useId
14825
14891
  } from "@floating-ui/react";
14826
14892
  import {
14827
- cloneElement as cloneElement2,
14893
+ cloneElement as cloneElement4,
14828
14894
  createContext as createContext12,
14829
14895
  forwardRef as forwardRef10,
14830
14896
  isValidElement,
@@ -15046,7 +15112,7 @@ var DialogTrigger = forwardRef10(
15046
15112
  const childrenRef = children.ref;
15047
15113
  const ref = useMergeRefs([context.refs.setReference, propRef, childrenRef]);
15048
15114
  if (asChild && isValidElement(children)) {
15049
- return cloneElement2(
15115
+ return cloneElement4(
15050
15116
  children,
15051
15117
  context.getReferenceProps({
15052
15118
  ref,
@@ -15160,7 +15226,7 @@ var DialogClose = forwardRef10(
15160
15226
  props.onClick?.(event);
15161
15227
  };
15162
15228
  if (asChild && isValidElement(children)) {
15163
- return cloneElement2(children, {
15229
+ return cloneElement4(children, {
15164
15230
  ref,
15165
15231
  ...props,
15166
15232
  ...children.props,
@@ -15457,6 +15523,9 @@ var fieldsToSkip = [
15457
15523
  "preferredMFAOption"
15458
15524
  ];
15459
15525
  var readonlyFields = ["username", "userName", "user_name"];
15526
+ var normalizeMutability = (mutability) => (mutability ?? "").replace(/_/g, "").toLowerCase();
15527
+ var isReadOnlyMutability = (mutability) => normalizeMutability(mutability) === "readonly";
15528
+ var isReadWriteMutability = (mutability) => normalizeMutability(mutability) === "readwrite";
15460
15529
  var BaseUserProfile = ({
15461
15530
  fallback = null,
15462
15531
  className = "",
@@ -15635,7 +15704,7 @@ var BaseUserProfile = ({
15635
15704
  }
15636
15705
  if (Array.isArray(value) || multiValued) {
15637
15706
  const hasValues = Array.isArray(value) ? value.length > 0 : value !== void 0 && value !== null && value !== "";
15638
- const isEditable2 = editable && mutability !== "READ_ONLY" && !readonlyFields.includes(name || "");
15707
+ const isEditable2 = editable && !isReadOnlyMutability(mutability) && !readonlyFields.includes(name || "");
15639
15708
  if (isEditing && onEditValue && isEditable2) {
15640
15709
  let currentValue;
15641
15710
  if (editedUser && name && editedUser[name] !== void 0) {
@@ -15705,7 +15774,7 @@ var BaseUserProfile = ({
15705
15774
  if (type === "COMPLEX" && typeof value === "object") {
15706
15775
  return /* @__PURE__ */ jsx109(ObjectDisplay, { data: value });
15707
15776
  }
15708
- if (isEditing && onEditValue && mutability !== "READ_ONLY" && !readonlyFields.includes(name || "")) {
15777
+ if (isEditing && onEditValue && !isReadOnlyMutability(mutability) && !readonlyFields.includes(name || "")) {
15709
15778
  let fieldValue;
15710
15779
  if (editedUser && name && editedUser[name] !== void 0) {
15711
15780
  fieldValue = editedUser[name];
@@ -15763,7 +15832,7 @@ var BaseUserProfile = ({
15763
15832
  ] });
15764
15833
  }
15765
15834
  const hasValue = value !== void 0 && value !== null && value !== "";
15766
- const isEditable = editable && mutability !== "READ_ONLY" && !readonlyFields.includes(name || "");
15835
+ const isEditable = editable && !isReadOnlyMutability(mutability) && !readonlyFields.includes(name || "");
15767
15836
  let displayValue;
15768
15837
  if (hasValue) {
15769
15838
  displayValue = String(value);
@@ -15793,7 +15862,7 @@ var BaseUserProfile = ({
15793
15862
  const hasValue = schema.value !== void 0 && schema.value !== "" && schema.value !== null;
15794
15863
  const isFieldEditing = editingFields[schema.name];
15795
15864
  const isReadonlyField = readonlyFields.includes(schema.name);
15796
- const shouldShow = hasValue || isFieldEditing || editable && schema.mutability === "READ_WRITE";
15865
+ const shouldShow = hasValue || isFieldEditing || editable && isReadWriteMutability(schema.mutability);
15797
15866
  if (!shouldShow) {
15798
15867
  return null;
15799
15868
  }
@@ -15808,7 +15877,7 @@ var BaseUserProfile = ({
15808
15877
  },
15809
15878
  () => toggleFieldEdit(schema.name)
15810
15879
  ) }),
15811
- editable && schema.mutability !== "READ_ONLY" && !isReadonlyField && /* @__PURE__ */ jsxs47("div", { className: styles.fieldActions, children: [
15880
+ editable && !isReadOnlyMutability(schema.mutability) && !isReadonlyField && /* @__PURE__ */ jsxs47("div", { className: styles.fieldActions, children: [
15812
15881
  isFieldEditing && /* @__PURE__ */ jsxs47(Fragment20, { children: [
15813
15882
  /* @__PURE__ */ jsx109(Button_default, { size: "small", color: "primary", variant: "solid", onClick: () => handleFieldSave(schema), children: "Save" }),
15814
15883
  /* @__PURE__ */ jsx109(
@@ -17092,6 +17161,23 @@ var useStyles30 = (theme, colorScheme) => useMemo41(() => {
17092
17161
  flex-direction: column;
17093
17162
  gap: calc(${theme.vars.spacing.unit} * 2);
17094
17163
  `;
17164
+ const headerContainer = css31`
17165
+ margin-bottom: calc(${theme.vars.spacing.unit} * 3);
17166
+ padding-bottom: calc(${theme.vars.spacing.unit} * 2);
17167
+ border-bottom: 1px solid ${theme.vars.colors.border};
17168
+ `;
17169
+ const title = css31`
17170
+ font-size: 1.75rem;
17171
+ font-weight: 700;
17172
+ color: ${theme.vars.colors.text.primary};
17173
+ margin: 0 0 6px 0;
17174
+ letter-spacing: -0.01em;
17175
+ `;
17176
+ const subtitle = css31`
17177
+ font-size: 0.875rem;
17178
+ color: ${theme.vars.colors.text.secondary};
17179
+ margin: 0;
17180
+ `;
17095
17181
  const form = css31`
17096
17182
  display: flex;
17097
17183
  flex-direction: column;
@@ -17106,12 +17192,25 @@ var useStyles30 = (theme, colorScheme) => useMemo41(() => {
17106
17192
  `;
17107
17193
  const field = css31`
17108
17194
  display: flex;
17109
- align-items: center;
17195
+ align-items: flex-start;
17110
17196
  padding: ${theme.vars.spacing.unit} 0;
17111
- border-bottom: 1px solid ${theme.vars.colors.border};
17112
17197
  min-height: 32px;
17113
17198
  `;
17199
+ const label = css31`
17200
+ font-size: 0.875rem;
17201
+ font-weight: 600;
17202
+ color: ${theme.vars.colors.text.primary};
17203
+ width: 200px;
17204
+ min-width: 200px;
17205
+ flex-shrink: 0;
17206
+ text-align: left;
17207
+ padding-right: calc(${theme.vars.spacing.unit} * 2);
17208
+ padding-top: calc(${theme.vars.spacing.unit} * 0.75);
17209
+ white-space: nowrap;
17210
+ line-height: 1.4;
17211
+ `;
17114
17212
  const fieldGroup = css31`
17213
+ flex: 1;
17115
17214
  display: flex;
17116
17215
  flex-direction: column;
17117
17216
  gap: calc(${theme.vars.spacing.unit} * 0.5);
@@ -17128,6 +17227,8 @@ var useStyles30 = (theme, colorScheme) => useMemo41(() => {
17128
17227
  min-height: 80px;
17129
17228
  resize: vertical;
17130
17229
  outline: none;
17230
+ box-sizing: border-box;
17231
+ transition: border-color 0.2s, box-shadow 0.2s;
17131
17232
  &:focus {
17132
17233
  border-color: ${theme.vars.colors.primary.main};
17133
17234
  box-shadow: 0 0 0 2px ${theme.vars.colors.primary.main}20;
@@ -17185,12 +17286,16 @@ var useStyles30 = (theme, colorScheme) => useMemo41(() => {
17185
17286
  fieldGroup,
17186
17287
  form,
17187
17288
  header,
17289
+ headerContainer,
17188
17290
  infoContainer,
17189
17291
  input,
17292
+ label,
17190
17293
  popup,
17191
17294
  root,
17295
+ subtitle,
17192
17296
  textarea,
17193
17297
  textareaError,
17298
+ title,
17194
17299
  value
17195
17300
  };
17196
17301
  }, [
@@ -17301,53 +17406,68 @@ var BaseCreateOrganization = ({
17301
17406
  logger11.error("Form submission error:");
17302
17407
  }
17303
17408
  };
17409
+ const getTranslation = (key, fallback) => {
17410
+ const text = t(key);
17411
+ return text && text !== key ? text : fallback;
17412
+ };
17304
17413
  const createOrganizationContent = /* @__PURE__ */ jsx118("div", { className: cx36(styles["root"], cardLayout && styles["card"], className), style, children: /* @__PURE__ */ jsxs53("div", { className: cx36(styles["content"]), children: [
17414
+ mode !== "popup" && /* @__PURE__ */ jsxs53("div", { className: cx36(styles["headerContainer"]), children: [
17415
+ /* @__PURE__ */ jsx118(Typography_default, { variant: "h5", component: "h1", className: cx36(styles["title"]), children: getTranslation("organization.create.heading", title || "Create organization") }),
17416
+ /* @__PURE__ */ jsx118(Typography_default, { variant: "body2", color: "textSecondary", className: cx36(styles["subtitle"]), children: getTranslation("organization.create.subheading", "Set up a new organization workspace.") })
17417
+ ] }),
17305
17418
  /* @__PURE__ */ jsxs53("form", { id: "create-organization-form", className: cx36(styles["form"]), onSubmit: handleSubmit, children: [
17306
17419
  error && /* @__PURE__ */ jsxs53(Alert_default, { variant: "error", className: styles["errorAlert"], children: [
17307
17420
  /* @__PURE__ */ jsx118(Alert_default.Title, { children: "Error" }),
17308
17421
  /* @__PURE__ */ jsx118(Alert_default.Description, { children: error })
17309
17422
  ] }),
17310
- /* @__PURE__ */ jsx118("div", { className: cx36(styles["fieldGroup"]), children: /* @__PURE__ */ jsx118(
17311
- TextField_default,
17312
- {
17313
- label: `${t("elements.fields.organization.name.label")}`,
17314
- placeholder: t("elements.fields.organization.name.placeholder"),
17315
- value: formData.name,
17316
- onChange: (e) => handleNameChange(e.target.value),
17317
- disabled: loading,
17318
- required: true,
17319
- error: formErrors.name,
17320
- className: cx36(styles["input"])
17321
- }
17322
- ) }),
17323
- /* @__PURE__ */ jsx118("div", { className: cx36(styles["fieldGroup"]), children: /* @__PURE__ */ jsx118(
17324
- TextField_default,
17325
- {
17326
- label: `${t("elements.fields.organization.handle.label") || "Organization Handle"}`,
17327
- placeholder: t("elements.fields.organization.handle.placeholder") || "my-organization",
17328
- value: formData.handle,
17329
- onChange: (e) => handleInputChange("handle", e.target.value),
17330
- disabled: loading,
17331
- required: true,
17332
- error: formErrors.handle,
17333
- helperText: "This will be your organization's unique identifier. Only lowercase letters, numbers, and hyphens are allowed.",
17334
- className: cx36(styles["input"])
17335
- }
17336
- ) }),
17337
- /* @__PURE__ */ jsx118("div", { className: cx36(styles["fieldGroup"]), children: /* @__PURE__ */ jsxs53(FormControl_default, { error: formErrors.description, children: [
17338
- /* @__PURE__ */ jsx118(InputLabel_default, { required: true, children: t("elements.fields.organization.description.label") }),
17339
- /* @__PURE__ */ jsx118(
17423
+ /* @__PURE__ */ jsxs53("div", { className: cx36(styles["field"]), children: [
17424
+ /* @__PURE__ */ jsx118(InputLabel_default, { required: true, className: cx36(styles["label"]), children: getTranslation("elements.fields.organization.name.label", "Organization Name") }),
17425
+ /* @__PURE__ */ jsx118("div", { className: cx36(styles["fieldGroup"]), children: /* @__PURE__ */ jsx118(
17426
+ TextField_default,
17427
+ {
17428
+ placeholder: getTranslation("elements.fields.organization.name.placeholder", "Organization Name"),
17429
+ value: formData.name,
17430
+ onChange: (e) => handleNameChange(e.target.value),
17431
+ disabled: loading,
17432
+ required: true,
17433
+ error: formErrors.name,
17434
+ className: cx36(styles["input"])
17435
+ }
17436
+ ) })
17437
+ ] }),
17438
+ /* @__PURE__ */ jsxs53("div", { className: cx36(styles["field"]), children: [
17439
+ /* @__PURE__ */ jsx118(InputLabel_default, { required: true, className: cx36(styles["label"]), children: getTranslation("elements.fields.organization.handle.label", "Organization Handle") }),
17440
+ /* @__PURE__ */ jsx118("div", { className: cx36(styles["fieldGroup"]), children: /* @__PURE__ */ jsx118(
17441
+ TextField_default,
17442
+ {
17443
+ placeholder: getTranslation("elements.fields.organization.handle.placeholder", "my-organization"),
17444
+ value: formData.handle,
17445
+ onChange: (e) => handleInputChange("handle", e.target.value),
17446
+ disabled: loading,
17447
+ required: true,
17448
+ error: formErrors.handle,
17449
+ helperText: "This will be your organization's unique identifier. Only lowercase letters, numbers, and hyphens are allowed.",
17450
+ className: cx36(styles["input"])
17451
+ }
17452
+ ) })
17453
+ ] }),
17454
+ /* @__PURE__ */ jsxs53("div", { className: cx36(styles["field"]), children: [
17455
+ /* @__PURE__ */ jsx118(InputLabel_default, { required: true, className: cx36(styles["label"]), children: getTranslation("elements.fields.organization.description.label", "Organization Description") }),
17456
+ /* @__PURE__ */ jsx118("div", { className: cx36(styles["fieldGroup"]), children: /* @__PURE__ */ jsx118(FormControl_default, { error: formErrors.description, children: /* @__PURE__ */ jsx118(
17340
17457
  "textarea",
17341
17458
  {
17342
17459
  className: cx36(styles["textarea"], formErrors.description && styles["textareaError"]),
17343
- placeholder: t("organization.create.description.placeholder"),
17460
+ placeholder: getTranslation(
17461
+ "organization.create.description.placeholder",
17462
+ "Enter organization description"
17463
+ ),
17344
17464
  value: formData.description,
17345
17465
  onChange: (e) => handleInputChange("description", e.target.value),
17346
17466
  disabled: loading,
17347
17467
  required: true
17348
17468
  }
17349
- )
17350
- ] }) }),
17469
+ ) }) })
17470
+ ] }),
17351
17471
  renderAdditionalFields && renderAdditionalFields()
17352
17472
  ] }),
17353
17473
  /* @__PURE__ */ jsxs53("div", { className: cx36(styles["actions"]), children: [
@@ -17491,14 +17611,19 @@ var useStyles31 = (theme, colorScheme) => useMemo42(() => {
17491
17611
  padding-bottom: calc(${theme.vars.spacing.unit} * 2);
17492
17612
  border-bottom: 1px solid ${theme.vars.colors.border};
17493
17613
  `;
17614
+ const headerContainer = css32`
17615
+ margin-bottom: calc(${theme.vars.spacing.unit} * 3);
17616
+ padding-bottom: calc(${theme.vars.spacing.unit} * 2);
17617
+ border-bottom: 1px solid ${theme.vars.colors.border};
17618
+ `;
17494
17619
  const headerInfo = css32`
17495
17620
  flex: 1;
17496
17621
  `;
17497
17622
  const title = css32`
17498
- font-size: 1.5rem;
17499
- font-weight: 600;
17500
- margin: 0 0 8px 0;
17623
+ font-size: 1.75rem;
17624
+ font-weight: 700;
17501
17625
  color: ${theme.vars.colors.text.primary};
17626
+ margin: 0 0 calc(${theme.vars.spacing.unit} * 0.5) 0;
17502
17627
  `;
17503
17628
  const subtitle = css32`
17504
17629
  color: ${theme.vars.colors.text.secondary};
@@ -17657,7 +17782,7 @@ var useStyles31 = (theme, colorScheme) => useMemo42(() => {
17657
17782
  errorContainer,
17658
17783
  errorMargin,
17659
17784
  header,
17660
- headerInfo,
17785
+ headerContainer,
17661
17786
  listContainer,
17662
17787
  loadMoreButton,
17663
17788
  loadMoreMargin,
@@ -17768,7 +17893,8 @@ var BaseOrganizationList = ({
17768
17893
  renderLoadMore,
17769
17894
  renderOrganization,
17770
17895
  style,
17771
- title = "Organizations",
17896
+ title,
17897
+ subheading,
17772
17898
  showStatus,
17773
17899
  preferences
17774
17900
  }) => {
@@ -17820,7 +17946,15 @@ var BaseOrganizationList = ({
17820
17946
  }
17821
17947
  return emptyContent;
17822
17948
  }
17949
+ const getTranslation = (key, fallback) => {
17950
+ const text = t(key);
17951
+ return text && text !== key ? text : fallback;
17952
+ };
17823
17953
  const organizationListContent = /* @__PURE__ */ jsxs54("div", { className: cx37(styles["root"], className), style, children: [
17954
+ mode !== "popup" && /* @__PURE__ */ jsxs54("div", { className: cx37(styles["headerContainer"]), children: [
17955
+ /* @__PURE__ */ jsx120(Typography_default, { variant: "h5", component: "h1", className: cx37(styles["title"]), children: getTranslation("organization.list.heading", title || "Organizations List") }),
17956
+ /* @__PURE__ */ jsx120(Typography_default, { variant: "body2", color: "textSecondary", className: cx37(styles["subtitle"]), children: getTranslation("organization.list.subheading", subheading || "View list of organizations.") })
17957
+ ] }),
17824
17958
  /* @__PURE__ */ jsxs54("div", { className: cx37(styles["header"]), children: [
17825
17959
  /* @__PURE__ */ jsx120("div", { className: cx37(styles["headerInfo"]), children: /* @__PURE__ */ jsx120(Typography_default, { variant: "body2", color: "textSecondary", className: cx37(styles["subtitle"]), children: t("organization.switcher.showing.count", {
17826
17960
  showing: organizationsWithSwitchAccess?.length,
@@ -18023,6 +18157,7 @@ var useStyles33 = (theme, colorScheme) => useMemo45(
18023
18157
  color: ${theme.vars.colors.text.secondary};
18024
18158
  margin: 0;
18025
18159
  font-family: monospace;
18160
+ text-align: left;
18026
18161
  `,
18027
18162
  header: css34`
18028
18163
  display: flex;
@@ -18031,6 +18166,11 @@ var useStyles33 = (theme, colorScheme) => useMemo45(
18031
18166
  margin-bottom: calc(${theme.vars.spacing.unit} * 3);
18032
18167
  padding-bottom: calc(${theme.vars.spacing.unit} * 2);
18033
18168
  `,
18169
+ headerContainer: css34`
18170
+ margin-bottom: calc(${theme.vars.spacing.unit} * 3);
18171
+ padding-bottom: calc(${theme.vars.spacing.unit} * 2);
18172
+ border-bottom: 1px solid ${theme.vars.colors.border};
18173
+ `,
18034
18174
  infoContainer: css34`
18035
18175
  display: flex;
18036
18176
  flex-direction: column;
@@ -18040,18 +18180,26 @@ var useStyles33 = (theme, colorScheme) => useMemo45(
18040
18180
  font-size: 0.875rem;
18041
18181
  font-weight: 500;
18042
18182
  color: ${theme.vars.colors.text.secondary};
18043
- width: 120px;
18183
+ width: 200px;
18184
+ min-width: 200px;
18044
18185
  flex-shrink: 0;
18045
18186
  line-height: 28px;
18187
+ text-align: left;
18188
+ white-space: nowrap;
18046
18189
  `,
18047
18190
  name: css34`
18048
18191
  font-size: 1.5rem;
18049
18192
  font-weight: 600;
18050
18193
  margin: 0 0 8px 0;
18051
18194
  color: ${theme.vars.colors.text.primary};
18195
+ text-align: left;
18052
18196
  `,
18053
18197
  orgInfo: css34`
18054
18198
  flex: 1;
18199
+ display: flex;
18200
+ flex-direction: column;
18201
+ align-items: flex-start;
18202
+ text-align: left;
18055
18203
  `,
18056
18204
  permissionBadge: css34`
18057
18205
  padding: calc(${theme.vars.spacing.unit} / 4) ${theme.vars.spacing.unit};
@@ -18091,6 +18239,17 @@ var useStyles33 = (theme, colorScheme) => useMemo45(
18091
18239
  text-transform: uppercase;
18092
18240
  letter-spacing: 0.5px;
18093
18241
  `,
18242
+ subtitle: css34`
18243
+ font-size: 0.875rem;
18244
+ color: ${theme.vars.colors.text.secondary};
18245
+ margin: 0;
18246
+ `,
18247
+ title: css34`
18248
+ font-size: 1.75rem;
18249
+ font-weight: 700;
18250
+ color: ${theme.vars.colors.text.primary};
18251
+ margin: 0 0 calc(${theme.vars.spacing.unit} * 0.5) 0;
18252
+ `,
18094
18253
  value: css34`
18095
18254
  color: ${theme.vars.colors.text.primary};
18096
18255
  flex: 1;
@@ -18487,7 +18646,9 @@ var BaseOrganizationProfile = ({
18487
18646
  className = "",
18488
18647
  cardLayout = true,
18489
18648
  organization,
18490
- title = "Organization Profile",
18649
+ preferences,
18650
+ title,
18651
+ subheading,
18491
18652
  mode = "inline",
18492
18653
  editable = true,
18493
18654
  onOpenChange,
@@ -18527,6 +18688,7 @@ var BaseOrganizationProfile = ({
18527
18688
  ]
18528
18689
  }) => {
18529
18690
  const { theme, colorScheme } = useTheme_default();
18691
+ const { t } = useTranslation_default(preferences?.i18n);
18530
18692
  const styles = BaseOrganizationProfile_styles_default(theme, colorScheme);
18531
18693
  const [editedOrganization, setEditedOrganization] = useState38(organization);
18532
18694
  const [editingFields, setEditingFields] = useState38({});
@@ -18742,7 +18904,15 @@ var BaseOrganizationProfile = ({
18742
18904
  if (!organization) {
18743
18905
  return fallback;
18744
18906
  }
18907
+ const getTranslation = (key, fallback2) => {
18908
+ const text = t(key);
18909
+ return text && text !== key ? text : fallback2;
18910
+ };
18745
18911
  const profileContent = /* @__PURE__ */ jsxs56(Card_default, { className: cx40(styles["root"], cardLayout && styles["card"], className), children: [
18912
+ mode !== "popup" && /* @__PURE__ */ jsxs56("div", { className: cx40(styles["headerContainer"]), children: [
18913
+ /* @__PURE__ */ jsx123(Typography_default, { variant: "h5", component: "h1", className: cx40(styles["title"]), children: getTranslation("organization.profile.heading", title || "Organization Profile") }),
18914
+ /* @__PURE__ */ jsx123(Typography_default, { variant: "body2", color: "textSecondary", className: cx40(styles["subtitle"]), children: getTranslation("organization.profile.subheading", subheading || "Manage your organization details.") })
18915
+ ] }),
18746
18916
  /* @__PURE__ */ jsxs56("div", { className: cx40(styles["header"]), children: [
18747
18917
  /* @__PURE__ */ jsx123(Avatar, { name: getOrgInitials(organization.name), size: 80, alt: `${organization.name} logo` }),
18748
18918
  /* @__PURE__ */ jsxs56("div", { className: cx40(styles["orgInfo"]), children: [