@ttoss/components 2.17.0 → 2.18.0

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/README.md CHANGED
@@ -23,6 +23,7 @@ import { OAuthConsent } from '@ttoss/components';
23
23
 
24
24
  <OAuthConsent
25
25
  clientName="My App"
26
+ logoUri={searchParams.get('logo_uri') ?? undefined}
26
27
  scopes={[
27
28
  {
28
29
  key: 'openid',
package/dist/index.d.mts CHANGED
@@ -900,7 +900,13 @@ type OAuthConsentProps = {
900
900
  * the consent heading. Falls back to the first letter of `clientName` if the
901
901
  * image fails to load. When omitted, no logo is shown (backward-compatible).
902
902
  */
903
- clientLogoUrl?: string; /** Scope tree to render. */
903
+ clientLogoUrl?: string;
904
+ /**
905
+ * Logo URL sourced directly from the OAuth `logo_uri` parameter appended by
906
+ * the consent-redirect flow. Takes precedence over `clientLogoUrl` when both
907
+ * are provided; otherwise the two are interchangeable.
908
+ */
909
+ logoUri?: string; /** Scope tree to render. */
904
910
  scopes: ConsentScope[];
905
911
  /**
906
912
  * Called when the user approves. Receives the minimal granted scope set
@@ -965,6 +971,7 @@ declare const collectGrantedScopes: (scopes: ConsentScope[], selected: Set<strin
965
971
  declare const OAuthConsent: ({
966
972
  clientName,
967
973
  clientLogoUrl,
974
+ logoUri,
968
975
  scopes,
969
976
  onAuthorize,
970
977
  onAuthorized,
package/dist/index.mjs CHANGED
@@ -3222,6 +3222,7 @@ var ConsentCard = ({
3222
3222
  var OAuthConsent = ({
3223
3223
  clientName,
3224
3224
  clientLogoUrl,
3225
+ logoUri,
3225
3226
  scopes,
3226
3227
  onAuthorize,
3227
3228
  onAuthorized,
@@ -3230,6 +3231,7 @@ var OAuthConsent = ({
3230
3231
  isValidRequest = true,
3231
3232
  labels
3232
3233
  }) => {
3234
+ const resolvedLogoUrl = logoUri ?? clientLogoUrl;
3233
3235
  const [selected, setSelected] = React.useState(() => {
3234
3236
  return initSelected(scopes);
3235
3237
  });
@@ -3271,12 +3273,12 @@ var OAuthConsent = ({
3271
3273
  })]
3272
3274
  });
3273
3275
  return /* @__PURE__ */jsxs(ConsentCard, {
3274
- children: [clientLogoUrl && /* @__PURE__ */jsx(Box, {
3276
+ children: [resolvedLogoUrl && /* @__PURE__ */jsx(Box, {
3275
3277
  sx: {
3276
3278
  marginBottom: 4
3277
3279
  },
3278
3280
  children: /* @__PURE__ */jsx(ClientLogo, {
3279
- src: clientLogoUrl,
3281
+ src: resolvedLogoUrl,
3280
3282
  clientName
3281
3283
  })
3282
3284
  }), /* @__PURE__ */jsx(Heading, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttoss/components",
3
- "version": "2.17.0",
3
+ "version": "2.18.0",
4
4
  "description": "React components for ttoss ecosystem.",
5
5
  "keywords": [
6
6
  "React",
@@ -53,20 +53,20 @@
53
53
  "react": "^19.2.6",
54
54
  "tsdown": "^0.22.2",
55
55
  "tsx": "^4.21.0",
56
- "@ttoss/config": "^1.37.17",
57
- "@ttoss/i18n-cli": "^0.8.17",
58
56
  "@ttoss/react-hooks": "^2.3.20",
59
- "@ttoss/react-icons": "^0.7.21",
57
+ "@ttoss/i18n-cli": "^0.8.17",
58
+ "@ttoss/config": "^1.37.17",
60
59
  "@ttoss/react-i18n": "^2.3.0",
60
+ "@ttoss/react-icons": "^0.7.21",
61
61
  "@ttoss/test-utils": "^4.2.18",
62
62
  "@ttoss/ui": "^6.9.28"
63
63
  },
64
64
  "peerDependencies": {
65
65
  "react": ">=16.8.0",
66
66
  "@ttoss/react-hooks": "^2.3.20",
67
+ "@ttoss/react-i18n": "^2.3.0",
67
68
  "@ttoss/react-icons": "^0.7.21",
68
- "@ttoss/ui": "^6.9.28",
69
- "@ttoss/react-i18n": "^2.3.0"
69
+ "@ttoss/ui": "^6.9.28"
70
70
  },
71
71
  "publishConfig": {
72
72
  "access": "public",