Skip to content

Commit

Permalink
feat(typography): caption label variant added
Browse files Browse the repository at this point in the history
  • Loading branch information
MEsteves22 committed Mar 13, 2024
1 parent 8af93b6 commit 0e96794
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/core/src/Typography/Typography.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const { useClasses, staticClasses } = createClasses("HvTypography", {
title4: { ...theme.typography.title4 },
body: { ...theme.typography.body },
label: { ...theme.typography.label },
captionLabel: { ...theme.typography.captionLabel },
caption1: { ...theme.typography.caption1 },
caption2: { ...theme.typography.caption2 },
// legacy variants
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/Typography/Typography.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const HvTypographyMap = {
title4: "h4",
body: "p",
label: "span",
captionLabel: "p",
caption1: "p",
caption2: "p",
// LEGACY
Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/Typography/Usage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ The Typography component comes with 9 variants that are mapped to an HTML elemen
| title3 | h3 |
| title4 | h4 |
| body | p |
| label | label |
| label | span |
| captionLabel | p |
| caption1 | p |
| caption2 | p |

Expand Down
1 change: 1 addition & 0 deletions packages/core/src/Typography/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export const typographyVariants = [
"title4",
"body",
"label",
"captionLabel",
"caption1",
"caption2",
] as const;
Expand Down
1 change: 1 addition & 0 deletions packages/styles/src/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ const typographySpec: DeepString<HvThemeTypography> = {
title4: { ...typographyProps },
label: { ...typographyProps },
body: { ...typographyProps },
captionLabel: { ...typographyProps },
caption1: { ...typographyProps },
caption2: { ...typographyProps },
// LEGACY UNMAPPABLE (DS3)
Expand Down
6 changes: 6 additions & 0 deletions packages/styles/src/themes/ds3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,12 @@ const ds3 = makeTheme((theme) => ({
lineHeight: "16px",
fontWeight: 400,
},
captionLabel: {
color: theme.colors.secondary,
fontWeight: theme.fontWeights.semibold,
fontSize: theme.fontSizes.sm,
lineHeight: theme.lineHeights.sm,
},
caption1: {
color: theme.colors.secondary,
fontSize: "10px",
Expand Down
6 changes: 6 additions & 0 deletions packages/styles/src/themes/ds5.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ const ds5 = makeTheme((theme) => ({
fontSize: theme.fontSizes.base,
lineHeight: theme.lineHeights.base,
},
captionLabel: {
color: theme.colors.secondary,
fontWeight: theme.fontWeights.semibold,
fontSize: theme.fontSizes.sm,
lineHeight: theme.lineHeights.sm,
},
caption1: {
color: theme.colors.secondary,
fontWeight: theme.fontWeights.normal,
Expand Down
6 changes: 6 additions & 0 deletions packages/styles/src/themes/pentahoPlus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ const pentahoPlus = makeTheme((theme) => ({
fontSize: theme.fontSizes.base,
lineHeight: theme.lineHeights.base,
},
captionLabel: {
color: theme.colors.secondary,
fontWeight: theme.fontWeights.semibold,
fontSize: theme.fontSizes.sm,
lineHeight: theme.lineHeights.sm,
},
caption1: {
color: theme.colors.secondary,
fontWeight: theme.fontWeights.normal,
Expand Down
1 change: 1 addition & 0 deletions packages/styles/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ export type HvThemeTypography = {
title4: HvThemeTypographyProps;
label: HvThemeTypographyProps;
body: HvThemeTypographyProps;
captionLabel: HvThemeTypographyProps;
caption1: HvThemeTypographyProps;
caption2: HvThemeTypographyProps;
// LEGACY UNMAPPABLE (DS3)
Expand Down

0 comments on commit 0e96794

Please sign in to comment.