@thunderid/react 0.10.1 → 0.11.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/dist/cjs/components/adapters/Consent.cjs +96 -9
- package/dist/cjs/components/adapters/Consent.cjs.map +1 -1
- package/dist/cjs/components/adapters/ConsentCheckboxList.cjs +8 -6
- package/dist/cjs/components/adapters/ConsentCheckboxList.cjs.map +1 -1
- package/dist/cjs/components/adapters/ConsentCheckboxList.styles.cjs +1 -0
- package/dist/cjs/components/adapters/ConsentCheckboxList.styles.cjs.map +1 -1
- package/dist/cjs/components/presentation/UserDropdown/BaseUserDropdown.cjs +2 -2
- package/dist/cjs/components/presentation/UserProfile/BaseUserProfile.cjs +1 -1
- package/dist/cjs/components/presentation/auth/AuthOptionFactory.cjs +23 -4
- package/dist/cjs/components/presentation/auth/AuthOptionFactory.cjs.map +1 -1
- package/dist/cjs/components/primitives/Dialog/Dialog.cjs +1 -1
- package/dist/cjs/components/primitives/KeyValueInput/KeyValueInput.cjs +1 -1
- package/dist/cjs/components/primitives/PasswordField/PasswordField.cjs +1 -1
- package/dist/cjs/components/primitives/Tooltip/Tooltip.cjs +60 -0
- package/dist/cjs/components/primitives/Tooltip/Tooltip.cjs.map +1 -0
- package/dist/cjs/components/primitives/Tooltip/Tooltip.styles.cjs +110 -0
- package/dist/cjs/components/primitives/Tooltip/Tooltip.styles.cjs.map +1 -0
- package/dist/cjs/index.cjs +8 -8
- package/dist/cjs/utils/buildThemeConfigFromFlowMeta.cjs +6 -7
- package/dist/cjs/utils/buildThemeConfigFromFlowMeta.cjs.map +1 -1
- package/dist/components/adapters/Consent.d.ts +23 -1
- package/dist/components/adapters/Consent.d.ts.map +1 -1
- package/dist/components/adapters/Consent.js +96 -10
- package/dist/components/adapters/Consent.js.map +1 -1
- package/dist/components/adapters/ConsentCheckboxList.d.ts.map +1 -1
- package/dist/components/adapters/ConsentCheckboxList.js +8 -6
- package/dist/components/adapters/ConsentCheckboxList.js.map +1 -1
- package/dist/components/adapters/ConsentCheckboxList.styles.d.ts.map +1 -1
- package/dist/components/adapters/ConsentCheckboxList.styles.js +1 -0
- package/dist/components/adapters/ConsentCheckboxList.styles.js.map +1 -1
- package/dist/components/presentation/UserDropdown/BaseUserDropdown.js +2 -2
- package/dist/components/presentation/UserProfile/BaseUserProfile.js +1 -1
- package/dist/components/presentation/auth/AuthOptionFactory.d.ts.map +1 -1
- package/dist/components/presentation/auth/AuthOptionFactory.js +23 -4
- package/dist/components/presentation/auth/AuthOptionFactory.js.map +1 -1
- package/dist/components/primitives/Dialog/Dialog.js +1 -1
- package/dist/components/primitives/KeyValueInput/KeyValueInput.js +1 -1
- package/dist/components/primitives/PasswordField/PasswordField.js +1 -1
- package/dist/components/primitives/Tooltip/Tooltip.d.ts +40 -0
- package/dist/components/primitives/Tooltip/Tooltip.d.ts.map +1 -0
- package/dist/components/primitives/Tooltip/Tooltip.js +55 -0
- package/dist/components/primitives/Tooltip/Tooltip.js.map +1 -0
- package/dist/components/primitives/Tooltip/Tooltip.styles.d.ts +21 -0
- package/dist/components/primitives/Tooltip/Tooltip.styles.d.ts.map +1 -0
- package/dist/components/primitives/Tooltip/Tooltip.styles.js +107 -0
- package/dist/components/primitives/Tooltip/Tooltip.styles.js.map +1 -0
- package/dist/index.js +5 -5
- package/dist/utils/buildThemeConfigFromFlowMeta.d.ts.map +1 -1
- package/dist/utils/buildThemeConfigFromFlowMeta.js +5 -7
- package/dist/utils/buildThemeConfigFromFlowMeta.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { normalizeBorderRadius } from "@thunderid/browser";
|
|
2
|
+
|
|
1
3
|
//#region src/utils/buildThemeConfigFromFlowMeta.ts
|
|
2
4
|
/**
|
|
3
5
|
* Converts a v2 `FlowMetaTheme` into a `RecursivePartial<ThemeConfig>` that
|
|
@@ -14,8 +16,7 @@
|
|
|
14
16
|
*/
|
|
15
17
|
const buildThemeConfigFromFlowMeta = (flowMetaTheme, colorScheme) => {
|
|
16
18
|
const scheme = flowMetaTheme.colorSchemes?.[colorScheme];
|
|
17
|
-
const
|
|
18
|
-
const borderRadiusStr = borderRadius !== void 0 ? `${borderRadius}px` : void 0;
|
|
19
|
+
const borderRadiusConfig = normalizeBorderRadius(flowMetaTheme.shape?.borderRadius);
|
|
19
20
|
let colors;
|
|
20
21
|
if (scheme?.palette) {
|
|
21
22
|
colors = {};
|
|
@@ -30,12 +31,9 @@ const buildThemeConfigFromFlowMeta = (flowMetaTheme, colorScheme) => {
|
|
|
30
31
|
}
|
|
31
32
|
}
|
|
32
33
|
return {
|
|
34
|
+
...flowMetaTheme,
|
|
33
35
|
...flowMetaTheme.direction ? { direction: flowMetaTheme.direction } : {},
|
|
34
|
-
...
|
|
35
|
-
large: borderRadiusStr,
|
|
36
|
-
medium: borderRadiusStr,
|
|
37
|
-
small: borderRadiusStr
|
|
38
|
-
} } : {},
|
|
36
|
+
...borderRadiusConfig ? { borderRadius: borderRadiusConfig } : {},
|
|
39
37
|
...colors && Object.keys(colors).length > 0 ? { colors } : {},
|
|
40
38
|
...flowMetaTheme.typography?.fontFamily ? { typography: { fontFamily: flowMetaTheme.typography.fontFamily } } : {}
|
|
41
39
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildThemeConfigFromFlowMeta.js","names":["scheme: FlowMetaThemeColorScheme | undefined","
|
|
1
|
+
{"version":3,"file":"buildThemeConfigFromFlowMeta.js","names":["scheme: FlowMetaThemeColorScheme | undefined","colors: RecursivePartial<ThemeConfig['colors']> | undefined","bg: RecursivePartial<ThemeConfig['colors']['background']>"],"sources":["../../src/utils/buildThemeConfigFromFlowMeta.ts"],"sourcesContent":["/**\n * Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {\n FlowMetaTheme,\n FlowMetaThemeColorScheme,\n RecursivePartial,\n ThemeConfig,\n normalizeBorderRadius,\n} from '@thunderid/browser';\n\n/**\n * Converts a v2 `FlowMetaTheme` into a `RecursivePartial<ThemeConfig>` that\n * `createTheme` can consume.\n *\n * Only fields explicitly present in the FlowMeta response are included so that\n * `createTheme` can deep-merge them onto its base (light/dark) defaults without\n * accidentally dropping sibling keys that were not returned by the server.\n *\n * For example, when FlowMeta returns only `background.default` and\n * `background.paper`, only `body.main` and `surface` are set — the base\n * theme's `background.disabled` and `background.dark` are **not** overridden\n * and therefore keep their default CSS variable values.\n */\nconst buildThemeConfigFromFlowMeta = (\n flowMetaTheme: FlowMetaTheme,\n colorScheme: 'light' | 'dark',\n): RecursivePartial<ThemeConfig> => {\n const scheme: FlowMetaThemeColorScheme | undefined = flowMetaTheme.colorSchemes?.[colorScheme];\n const borderRadiusConfig = normalizeBorderRadius(flowMetaTheme.shape?.borderRadius);\n\n // Build only the colors that the server actually provided.\n // Each nested object is constructed incrementally so that absent fields are\n // simply omitted rather than set to `undefined`, which would shadow the\n // base-theme defaults inside `createTheme`.\n let colors: RecursivePartial<ThemeConfig['colors']> | undefined;\n\n if (scheme?.palette) {\n colors = {};\n\n if (scheme.palette.primary) {\n colors.primary = scheme.palette.primary;\n }\n if (scheme.palette.secondary) {\n colors.secondary = scheme.palette.secondary;\n }\n if (scheme.palette.text) {\n colors.text = scheme.palette.text;\n }\n\n // Build background incrementally to avoid replacing the full base object.\n if (scheme.palette.background) {\n const bg: RecursivePartial<ThemeConfig['colors']['background']> = {};\n\n if (scheme.palette.background.default) {\n bg.body = {main: scheme.palette.background.default};\n }\n if (scheme.palette.background.paper) {\n bg.surface = scheme.palette.background.paper;\n }\n\n if (Object.keys(bg).length > 0) {\n colors.background = bg;\n }\n }\n }\n\n return {\n ...flowMetaTheme,\n ...(flowMetaTheme.direction ? {direction: flowMetaTheme.direction} : {}),\n ...(borderRadiusConfig ? {borderRadius: borderRadiusConfig} : {}),\n ...(colors && Object.keys(colors).length > 0 ? {colors} : {}),\n ...(flowMetaTheme.typography?.fontFamily ? {typography: {fontFamily: flowMetaTheme.typography.fontFamily}} : {}),\n };\n};\n\nexport default buildThemeConfigFromFlowMeta;\n"],"mappings":";;;;;;;;;;;;;;;;AAuCA,MAAM,gCACJ,eACA,gBACkC;CAClC,MAAMA,SAA+C,cAAc,eAAe;CAClF,MAAM,qBAAqB,sBAAsB,cAAc,OAAO,aAAa;CAMnF,IAAIC;AAEJ,KAAI,QAAQ,SAAS;AACnB,WAAS,EAAE;AAEX,MAAI,OAAO,QAAQ,QACjB,QAAO,UAAU,OAAO,QAAQ;AAElC,MAAI,OAAO,QAAQ,UACjB,QAAO,YAAY,OAAO,QAAQ;AAEpC,MAAI,OAAO,QAAQ,KACjB,QAAO,OAAO,OAAO,QAAQ;AAI/B,MAAI,OAAO,QAAQ,YAAY;GAC7B,MAAMC,KAA4D,EAAE;AAEpE,OAAI,OAAO,QAAQ,WAAW,QAC5B,IAAG,OAAO,EAAC,MAAM,OAAO,QAAQ,WAAW,SAAQ;AAErD,OAAI,OAAO,QAAQ,WAAW,MAC5B,IAAG,UAAU,OAAO,QAAQ,WAAW;AAGzC,OAAI,OAAO,KAAK,GAAG,CAAC,SAAS,EAC3B,QAAO,aAAa;;;AAK1B,QAAO;EACL,GAAG;EACH,GAAI,cAAc,YAAY,EAAC,WAAW,cAAc,WAAU,GAAG,EAAE;EACvE,GAAI,qBAAqB,EAAC,cAAc,oBAAmB,GAAG,EAAE;EAChE,GAAI,UAAU,OAAO,KAAK,OAAO,CAAC,SAAS,IAAI,EAAC,QAAO,GAAG,EAAE;EAC5D,GAAI,cAAc,YAAY,aAAa,EAAC,YAAY,EAAC,YAAY,cAAc,WAAW,YAAW,EAAC,GAAG,EAAE;EAChH;;AAGH,2CAAe"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thunderid/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "React SDK for ThunderID",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"thunderid",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"@floating-ui/react": "0.27.12",
|
|
63
63
|
"dompurify": "3.4.11",
|
|
64
64
|
"tslib": "2.8.1",
|
|
65
|
-
"@thunderid/browser": "^0.
|
|
65
|
+
"@thunderid/browser": "^0.11.0"
|
|
66
66
|
},
|
|
67
67
|
"publishConfig": {
|
|
68
68
|
"access": "public"
|