@nuskin/foundation-ui-components 1.11.0 → 1.12.0-911-v1.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/foundation-ui-components",
3
- "version": "1.11.0",
3
+ "version": "1.12.0-911-v1.1",
4
4
  "description": "It is a foundation library written in react, that provides common components to all UI pages",
5
5
  "main": "src/common/index.ts",
6
6
  "repository": {
@@ -12,12 +12,14 @@ const NsTypography = ({
12
12
  color = 'primary',
13
13
  additionalProps = {},
14
14
  colorOverride = '',
15
+ noSpacing = false,
15
16
  renderHTMLNode,
16
17
  }: PropsWithChildren<NsTypographyProps>) => {
17
18
  const htmlTagVariant: HtmlTagVariant | undefined = renderHTMLNode ? HtmlTagVariantMapping[variant] : undefined;
18
19
 
19
20
  return (
20
21
  <StyledTypography
22
+ noSpacing={noSpacing}
21
23
  as={htmlTagVariant}
22
24
  className={className}
23
25
  weight={weight}
@@ -129,10 +129,18 @@ const fontWeightMap = {
129
129
  bold: 600,
130
130
  };
131
131
 
132
- export const StyledTypography = styled.div<NsTypographyProps>`
133
- font-family: Inter;
134
- color: ${({ color, colorOverride }) => (colorOverride?.startsWith('#') ? colorOverride : paletteColor(color))};
135
- font-weight: ${({ weight = 'normal' }) => fontWeightMap[weight]};
136
- ${({ variant = 'h1' }) => variantStyles[variant]};
137
- text-decoration-line: ${({ decoration }) => decoration};
138
- `;
132
+ export const StyledTypography = styled('div')<NsTypographyProps>(
133
+ ({ theme, weight = 'normal', variant = 'h1', noSpacing, decoration, color, colorOverride }) => {
134
+ const fontStyles = variantStyles[variant];
135
+ if (noSpacing) {
136
+ fontStyles.margin = '0px';
137
+ }
138
+ return {
139
+ ...fontStyles,
140
+ fontFamily: 'Inter',
141
+ textDecorationLine: decoration,
142
+ fontWeight: fontWeightMap[weight],
143
+ color: colorOverride?.startsWith('#') ? colorOverride : paletteColor(color)({ theme }),
144
+ };
145
+ }
146
+ );
@@ -33,4 +33,5 @@ export type NsTypographyProps = {
33
33
  className?: string;
34
34
  colorOverride?: string;
35
35
  renderHTMLNode?: boolean;
36
+ noSpacing?:boolean;
36
37
  } & AdditionalProps;