@newtonedev/components 0.1.8 → 0.1.9
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.cjs +2 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/primitives/Text/Text.d.ts +1 -1
- package/dist/primitives/Text/Text.d.ts.map +1 -1
- package/dist/primitives/Text/Text.types.d.ts +2 -0
- package/dist/primitives/Text/Text.types.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/primitives/Text/Text.tsx +4 -1
- package/src/primitives/Text/Text.types.ts +3 -0
package/dist/index.cjs
CHANGED
|
@@ -993,6 +993,7 @@ function TextBase({
|
|
|
993
993
|
role = "body",
|
|
994
994
|
color = "primary",
|
|
995
995
|
size: sizeOverride,
|
|
996
|
+
weight: weightOverride,
|
|
996
997
|
align,
|
|
997
998
|
numberOfLines,
|
|
998
999
|
elevation = 1,
|
|
@@ -1009,7 +1010,7 @@ function TextBase({
|
|
|
1009
1010
|
const { config, reportingEndpoint } = useNewtoneTheme();
|
|
1010
1011
|
const size = sizeOverride ?? "md";
|
|
1011
1012
|
const fontSlot = tokens.typography.fonts[scope];
|
|
1012
|
-
const resolvedFontWeight = config.typography.roleWeights?.[role] ?? fonts.ROLE_DEFAULT_WEIGHTS[role];
|
|
1013
|
+
const resolvedFontWeight = weightOverride ? fonts.SEMANTIC_WEIGHT_MAP[weightOverride] : config.typography.roleWeights?.[role] ?? fonts.ROLE_DEFAULT_WEIGHTS[role];
|
|
1013
1014
|
const breakpoint = useBreakpoint();
|
|
1014
1015
|
const baseStep = config.typography.roles[role][size];
|
|
1015
1016
|
const bpScale = fonts.BREAKPOINT_ROLE_SCALE[breakpoint][role];
|