@asgardeo/react 0.25.6 → 0.25.7

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/cjs/index.js CHANGED
@@ -17090,6 +17090,23 @@ var useStyles30 = (theme, colorScheme) => (0, import_react104.useMemo)(() => {
17090
17090
  flex-direction: column;
17091
17091
  gap: calc(${theme.vars.spacing.unit} * 2);
17092
17092
  `;
17093
+ const headerContainer = import_css66.css`
17094
+ margin-bottom: calc(${theme.vars.spacing.unit} * 3);
17095
+ padding-bottom: calc(${theme.vars.spacing.unit} * 2);
17096
+ border-bottom: 1px solid ${theme.vars.colors.border};
17097
+ `;
17098
+ const title = import_css66.css`
17099
+ font-size: 1.75rem;
17100
+ font-weight: 700;
17101
+ color: ${theme.vars.colors.text.primary};
17102
+ margin: 0 0 6px 0;
17103
+ letter-spacing: -0.01em;
17104
+ `;
17105
+ const subtitle = import_css66.css`
17106
+ font-size: 0.875rem;
17107
+ color: ${theme.vars.colors.text.secondary};
17108
+ margin: 0;
17109
+ `;
17093
17110
  const form = import_css66.css`
17094
17111
  display: flex;
17095
17112
  flex-direction: column;
@@ -17104,12 +17121,25 @@ var useStyles30 = (theme, colorScheme) => (0, import_react104.useMemo)(() => {
17104
17121
  `;
17105
17122
  const field = import_css66.css`
17106
17123
  display: flex;
17107
- align-items: center;
17124
+ align-items: flex-start;
17108
17125
  padding: ${theme.vars.spacing.unit} 0;
17109
- border-bottom: 1px solid ${theme.vars.colors.border};
17110
17126
  min-height: 32px;
17111
17127
  `;
17128
+ const label = import_css66.css`
17129
+ font-size: 0.875rem;
17130
+ font-weight: 600;
17131
+ color: ${theme.vars.colors.text.primary};
17132
+ width: 200px;
17133
+ min-width: 200px;
17134
+ flex-shrink: 0;
17135
+ text-align: left;
17136
+ padding-right: calc(${theme.vars.spacing.unit} * 2);
17137
+ padding-top: calc(${theme.vars.spacing.unit} * 0.75);
17138
+ white-space: nowrap;
17139
+ line-height: 1.4;
17140
+ `;
17112
17141
  const fieldGroup = import_css66.css`
17142
+ flex: 1;
17113
17143
  display: flex;
17114
17144
  flex-direction: column;
17115
17145
  gap: calc(${theme.vars.spacing.unit} * 0.5);
@@ -17126,6 +17156,8 @@ var useStyles30 = (theme, colorScheme) => (0, import_react104.useMemo)(() => {
17126
17156
  min-height: 80px;
17127
17157
  resize: vertical;
17128
17158
  outline: none;
17159
+ box-sizing: border-box;
17160
+ transition: border-color 0.2s, box-shadow 0.2s;
17129
17161
  &:focus {
17130
17162
  border-color: ${theme.vars.colors.primary.main};
17131
17163
  box-shadow: 0 0 0 2px ${theme.vars.colors.primary.main}20;
@@ -17183,12 +17215,16 @@ var useStyles30 = (theme, colorScheme) => (0, import_react104.useMemo)(() => {
17183
17215
  fieldGroup,
17184
17216
  form,
17185
17217
  header,
17218
+ headerContainer,
17186
17219
  infoContainer,
17187
17220
  input,
17221
+ label,
17188
17222
  popup,
17189
17223
  root,
17224
+ subtitle,
17190
17225
  textarea,
17191
17226
  textareaError,
17227
+ title,
17192
17228
  value
17193
17229
  };
17194
17230
  }, [
@@ -17299,53 +17335,68 @@ var BaseCreateOrganization = ({
17299
17335
  logger11.error("Form submission error:");
17300
17336
  }
17301
17337
  };
17338
+ const getTranslation = (key, fallback) => {
17339
+ const text = t(key);
17340
+ return text && text !== key ? text : fallback;
17341
+ };
17302
17342
  const createOrganizationContent = /* @__PURE__ */ (0, import_jsx_runtime118.jsx)("div", { className: (0, import_css67.cx)(styles["root"], cardLayout && styles["card"], className), style, children: /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)("div", { className: (0, import_css67.cx)(styles["content"]), children: [
17343
+ mode !== "popup" && /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)("div", { className: (0, import_css67.cx)(styles["headerContainer"]), children: [
17344
+ /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(Typography_default, { variant: "h5", component: "h1", className: (0, import_css67.cx)(styles["title"]), children: getTranslation("organization.create.heading", title || "Create organization") }),
17345
+ /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(Typography_default, { variant: "body2", color: "textSecondary", className: (0, import_css67.cx)(styles["subtitle"]), children: getTranslation("organization.create.subheading", "Set up a new organization workspace.") })
17346
+ ] }),
17303
17347
  /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)("form", { id: "create-organization-form", className: (0, import_css67.cx)(styles["form"]), onSubmit: handleSubmit, children: [
17304
17348
  error && /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)(Alert_default, { variant: "error", className: styles["errorAlert"], children: [
17305
17349
  /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(Alert_default.Title, { children: "Error" }),
17306
17350
  /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(Alert_default.Description, { children: error })
17307
17351
  ] }),
17308
- /* @__PURE__ */ (0, import_jsx_runtime118.jsx)("div", { className: (0, import_css67.cx)(styles["fieldGroup"]), children: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
17309
- TextField_default,
17310
- {
17311
- label: `${t("elements.fields.organization.name.label")}`,
17312
- placeholder: t("elements.fields.organization.name.placeholder"),
17313
- value: formData.name,
17314
- onChange: (e) => handleNameChange(e.target.value),
17315
- disabled: loading,
17316
- required: true,
17317
- error: formErrors.name,
17318
- className: (0, import_css67.cx)(styles["input"])
17319
- }
17320
- ) }),
17321
- /* @__PURE__ */ (0, import_jsx_runtime118.jsx)("div", { className: (0, import_css67.cx)(styles["fieldGroup"]), children: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
17322
- TextField_default,
17323
- {
17324
- label: `${t("elements.fields.organization.handle.label") || "Organization Handle"}`,
17325
- placeholder: t("elements.fields.organization.handle.placeholder") || "my-organization",
17326
- value: formData.handle,
17327
- onChange: (e) => handleInputChange("handle", e.target.value),
17328
- disabled: loading,
17329
- required: true,
17330
- error: formErrors.handle,
17331
- helperText: "This will be your organization's unique identifier. Only lowercase letters, numbers, and hyphens are allowed.",
17332
- className: (0, import_css67.cx)(styles["input"])
17333
- }
17334
- ) }),
17335
- /* @__PURE__ */ (0, import_jsx_runtime118.jsx)("div", { className: (0, import_css67.cx)(styles["fieldGroup"]), children: /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)(FormControl_default, { error: formErrors.description, children: [
17336
- /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(InputLabel_default, { required: true, children: t("elements.fields.organization.description.label") }),
17337
- /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
17352
+ /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)("div", { className: (0, import_css67.cx)(styles["field"]), children: [
17353
+ /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(InputLabel_default, { required: true, className: (0, import_css67.cx)(styles["label"]), children: getTranslation("elements.fields.organization.name.label", "Organization Name") }),
17354
+ /* @__PURE__ */ (0, import_jsx_runtime118.jsx)("div", { className: (0, import_css67.cx)(styles["fieldGroup"]), children: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
17355
+ TextField_default,
17356
+ {
17357
+ placeholder: getTranslation("elements.fields.organization.name.placeholder", "Organization Name"),
17358
+ value: formData.name,
17359
+ onChange: (e) => handleNameChange(e.target.value),
17360
+ disabled: loading,
17361
+ required: true,
17362
+ error: formErrors.name,
17363
+ className: (0, import_css67.cx)(styles["input"])
17364
+ }
17365
+ ) })
17366
+ ] }),
17367
+ /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)("div", { className: (0, import_css67.cx)(styles["field"]), children: [
17368
+ /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(InputLabel_default, { required: true, className: (0, import_css67.cx)(styles["label"]), children: getTranslation("elements.fields.organization.handle.label", "Organization Handle") }),
17369
+ /* @__PURE__ */ (0, import_jsx_runtime118.jsx)("div", { className: (0, import_css67.cx)(styles["fieldGroup"]), children: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
17370
+ TextField_default,
17371
+ {
17372
+ placeholder: getTranslation("elements.fields.organization.handle.placeholder", "my-organization"),
17373
+ value: formData.handle,
17374
+ onChange: (e) => handleInputChange("handle", e.target.value),
17375
+ disabled: loading,
17376
+ required: true,
17377
+ error: formErrors.handle,
17378
+ helperText: "This will be your organization's unique identifier. Only lowercase letters, numbers, and hyphens are allowed.",
17379
+ className: (0, import_css67.cx)(styles["input"])
17380
+ }
17381
+ ) })
17382
+ ] }),
17383
+ /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)("div", { className: (0, import_css67.cx)(styles["field"]), children: [
17384
+ /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(InputLabel_default, { required: true, className: (0, import_css67.cx)(styles["label"]), children: getTranslation("elements.fields.organization.description.label", "Organization Description") }),
17385
+ /* @__PURE__ */ (0, import_jsx_runtime118.jsx)("div", { className: (0, import_css67.cx)(styles["fieldGroup"]), children: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(FormControl_default, { error: formErrors.description, children: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
17338
17386
  "textarea",
17339
17387
  {
17340
17388
  className: (0, import_css67.cx)(styles["textarea"], formErrors.description && styles["textareaError"]),
17341
- placeholder: t("organization.create.description.placeholder"),
17389
+ placeholder: getTranslation(
17390
+ "organization.create.description.placeholder",
17391
+ "Enter organization description"
17392
+ ),
17342
17393
  value: formData.description,
17343
17394
  onChange: (e) => handleInputChange("description", e.target.value),
17344
17395
  disabled: loading,
17345
17396
  required: true
17346
17397
  }
17347
- )
17348
- ] }) }),
17398
+ ) }) })
17399
+ ] }),
17349
17400
  renderAdditionalFields && renderAdditionalFields()
17350
17401
  ] }),
17351
17402
  /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)("div", { className: (0, import_css67.cx)(styles["actions"]), children: [
@@ -17486,14 +17537,19 @@ var useStyles31 = (theme, colorScheme) => (0, import_react107.useMemo)(() => {
17486
17537
  padding-bottom: calc(${theme.vars.spacing.unit} * 2);
17487
17538
  border-bottom: 1px solid ${theme.vars.colors.border};
17488
17539
  `;
17540
+ const headerContainer = import_css68.css`
17541
+ margin-bottom: calc(${theme.vars.spacing.unit} * 3);
17542
+ padding-bottom: calc(${theme.vars.spacing.unit} * 2);
17543
+ border-bottom: 1px solid ${theme.vars.colors.border};
17544
+ `;
17489
17545
  const headerInfo = import_css68.css`
17490
17546
  flex: 1;
17491
17547
  `;
17492
17548
  const title = import_css68.css`
17493
- font-size: 1.5rem;
17494
- font-weight: 600;
17495
- margin: 0 0 8px 0;
17549
+ font-size: 1.75rem;
17550
+ font-weight: 700;
17496
17551
  color: ${theme.vars.colors.text.primary};
17552
+ margin: 0 0 calc(${theme.vars.spacing.unit} * 0.5) 0;
17497
17553
  `;
17498
17554
  const subtitle = import_css68.css`
17499
17555
  color: ${theme.vars.colors.text.secondary};
@@ -17652,7 +17708,7 @@ var useStyles31 = (theme, colorScheme) => (0, import_react107.useMemo)(() => {
17652
17708
  errorContainer,
17653
17709
  errorMargin,
17654
17710
  header,
17655
- headerInfo,
17711
+ headerContainer,
17656
17712
  listContainer,
17657
17713
  loadMoreButton,
17658
17714
  loadMoreMargin,
@@ -17763,7 +17819,8 @@ var BaseOrganizationList = ({
17763
17819
  renderLoadMore,
17764
17820
  renderOrganization,
17765
17821
  style,
17766
- title = "Organizations",
17822
+ title,
17823
+ subheading,
17767
17824
  showStatus,
17768
17825
  preferences
17769
17826
  }) => {
@@ -17815,7 +17872,15 @@ var BaseOrganizationList = ({
17815
17872
  }
17816
17873
  return emptyContent;
17817
17874
  }
17875
+ const getTranslation = (key, fallback) => {
17876
+ const text = t(key);
17877
+ return text && text !== key ? text : fallback;
17878
+ };
17818
17879
  const organizationListContent = /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { className: (0, import_css69.cx)(styles["root"], className), style, children: [
17880
+ mode !== "popup" && /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { className: (0, import_css69.cx)(styles["headerContainer"]), children: [
17881
+ /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Typography_default, { variant: "h5", component: "h1", className: (0, import_css69.cx)(styles["title"]), children: getTranslation("organization.list.heading", title || "Organizations List") }),
17882
+ /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Typography_default, { variant: "body2", color: "textSecondary", className: (0, import_css69.cx)(styles["subtitle"]), children: getTranslation("organization.list.subheading", subheading || "View list of organizations.") })
17883
+ ] }),
17819
17884
  /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { className: (0, import_css69.cx)(styles["header"]), children: [
17820
17885
  /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("div", { className: (0, import_css69.cx)(styles["headerInfo"]), children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Typography_default, { variant: "body2", color: "textSecondary", className: (0, import_css69.cx)(styles["subtitle"]), children: t("organization.switcher.showing.count", {
17821
17886
  showing: organizationsWithSwitchAccess?.length,
@@ -18018,6 +18083,7 @@ var useStyles33 = (theme, colorScheme) => (0, import_react111.useMemo)(
18018
18083
  color: ${theme.vars.colors.text.secondary};
18019
18084
  margin: 0;
18020
18085
  font-family: monospace;
18086
+ text-align: left;
18021
18087
  `,
18022
18088
  header: import_css72.css`
18023
18089
  display: flex;
@@ -18026,6 +18092,11 @@ var useStyles33 = (theme, colorScheme) => (0, import_react111.useMemo)(
18026
18092
  margin-bottom: calc(${theme.vars.spacing.unit} * 3);
18027
18093
  padding-bottom: calc(${theme.vars.spacing.unit} * 2);
18028
18094
  `,
18095
+ headerContainer: import_css72.css`
18096
+ margin-bottom: calc(${theme.vars.spacing.unit} * 3);
18097
+ padding-bottom: calc(${theme.vars.spacing.unit} * 2);
18098
+ border-bottom: 1px solid ${theme.vars.colors.border};
18099
+ `,
18029
18100
  infoContainer: import_css72.css`
18030
18101
  display: flex;
18031
18102
  flex-direction: column;
@@ -18035,18 +18106,26 @@ var useStyles33 = (theme, colorScheme) => (0, import_react111.useMemo)(
18035
18106
  font-size: 0.875rem;
18036
18107
  font-weight: 500;
18037
18108
  color: ${theme.vars.colors.text.secondary};
18038
- width: 120px;
18109
+ width: 200px;
18110
+ min-width: 200px;
18039
18111
  flex-shrink: 0;
18040
18112
  line-height: 28px;
18113
+ text-align: left;
18114
+ white-space: nowrap;
18041
18115
  `,
18042
18116
  name: import_css72.css`
18043
18117
  font-size: 1.5rem;
18044
18118
  font-weight: 600;
18045
18119
  margin: 0 0 8px 0;
18046
18120
  color: ${theme.vars.colors.text.primary};
18121
+ text-align: left;
18047
18122
  `,
18048
18123
  orgInfo: import_css72.css`
18049
18124
  flex: 1;
18125
+ display: flex;
18126
+ flex-direction: column;
18127
+ align-items: flex-start;
18128
+ text-align: left;
18050
18129
  `,
18051
18130
  permissionBadge: import_css72.css`
18052
18131
  padding: calc(${theme.vars.spacing.unit} / 4) ${theme.vars.spacing.unit};
@@ -18086,6 +18165,17 @@ var useStyles33 = (theme, colorScheme) => (0, import_react111.useMemo)(
18086
18165
  text-transform: uppercase;
18087
18166
  letter-spacing: 0.5px;
18088
18167
  `,
18168
+ subtitle: import_css72.css`
18169
+ font-size: 0.875rem;
18170
+ color: ${theme.vars.colors.text.secondary};
18171
+ margin: 0;
18172
+ `,
18173
+ title: import_css72.css`
18174
+ font-size: 1.75rem;
18175
+ font-weight: 700;
18176
+ color: ${theme.vars.colors.text.primary};
18177
+ margin: 0 0 calc(${theme.vars.spacing.unit} * 0.5) 0;
18178
+ `,
18089
18179
  value: import_css72.css`
18090
18180
  color: ${theme.vars.colors.text.primary};
18091
18181
  flex: 1;
@@ -18482,7 +18572,9 @@ var BaseOrganizationProfile = ({
18482
18572
  className = "",
18483
18573
  cardLayout = true,
18484
18574
  organization,
18485
- title = "Organization Profile",
18575
+ preferences,
18576
+ title,
18577
+ subheading,
18486
18578
  mode = "inline",
18487
18579
  editable = true,
18488
18580
  onOpenChange,
@@ -18522,6 +18614,7 @@ var BaseOrganizationProfile = ({
18522
18614
  ]
18523
18615
  }) => {
18524
18616
  const { theme, colorScheme } = useTheme_default();
18617
+ const { t } = useTranslation_default(preferences?.i18n);
18525
18618
  const styles = BaseOrganizationProfile_styles_default(theme, colorScheme);
18526
18619
  const [editedOrganization, setEditedOrganization] = (0, import_react114.useState)(organization);
18527
18620
  const [editingFields, setEditingFields] = (0, import_react114.useState)({});
@@ -18737,7 +18830,15 @@ var BaseOrganizationProfile = ({
18737
18830
  if (!organization) {
18738
18831
  return fallback;
18739
18832
  }
18833
+ const getTranslation = (key, fallback2) => {
18834
+ const text = t(key);
18835
+ return text && text !== key ? text : fallback2;
18836
+ };
18740
18837
  const profileContent = /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(Card_default, { className: (0, import_css75.cx)(styles["root"], cardLayout && styles["card"], className), children: [
18838
+ mode !== "popup" && /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)("div", { className: (0, import_css75.cx)(styles["headerContainer"]), children: [
18839
+ /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(Typography_default, { variant: "h5", component: "h1", className: (0, import_css75.cx)(styles["title"]), children: getTranslation("organization.profile.heading", title || "Organization Profile") }),
18840
+ /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(Typography_default, { variant: "body2", color: "textSecondary", className: (0, import_css75.cx)(styles["subtitle"]), children: getTranslation("organization.profile.subheading", subheading || "Manage your organization details.") })
18841
+ ] }),
18741
18842
  /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)("div", { className: (0, import_css75.cx)(styles["header"]), children: [
18742
18843
  /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(Avatar, { name: getOrgInitials(organization.name), size: 80, alt: `${organization.name} logo` }),
18743
18844
  /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)("div", { className: (0, import_css75.cx)(styles["orgInfo"]), children: [