Skip to content

Commit

Permalink
fix: update font sizes and line heights + rename story component cate…
Browse files Browse the repository at this point in the history
…gories (#210)
  • Loading branch information
Lisa18289 authored Mar 7, 2024
1 parent 67bebdf commit abbc424
Show file tree
Hide file tree
Showing 29 changed files with 46 additions and 36 deletions.
2 changes: 1 addition & 1 deletion packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"./Button": "./dist/Button.js",
"./Checkbox": "./dist/Checkbox.js",
"./Content": "./dist/Content.js",
"./LayoutCard": "./dist/LayoutCard.js",
"./CopyToClipboardButton": "./dist/CopyToClipboardButton.js",
"./FieldDescription": "./dist/FieldDescription.js",
"./FieldError": "./dist/FieldError.js",
Expand All @@ -23,6 +22,7 @@
"./InlineAlert": "./dist/InlineAlert.js",
"./Label": "./dist/Label.js",
"./LabeledValue": "./dist/LabeledValue.js",
"./LayoutCard": "./dist/LayoutCard.js",
"./Link": "./dist/Link.js",
"./Navigation": "./dist/Navigation.js",
"./NumberField": "./dist/NumberField.js",
Expand Down
1 change: 0 additions & 1 deletion packages/components/src/components/Badge/Badge.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
padding-block: var(--badge--padding-y);
padding-inline: var(--badge--padding-x);
height: var(--badge--height);
line-height: var(--size-rem--m);
display: inline-grid;
grid-template-areas: "icon content";
grid-template-columns: auto 1fr;
Expand Down
8 changes: 4 additions & 4 deletions packages/components/src/components/Button/Button.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@
}

.size-s {
font-size: var(--button--font-size-small);
padding-block: var(--button--padding-small-squished-y);
padding-inline: var(--button--padding-small-squished-x);
font-size: var(--button--font-size-s);
padding-block: var(--button--padding-s-squished-y);
padding-inline: var(--button--padding-s-squished-x);

&:has(.icon) {
padding: var(--button--padding-small);
padding: var(--button--padding-s);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { IconPlus } from "@/components/Icon/components/icons";
import { action } from "@storybook/addon-actions";

const meta: Meta<typeof Button> = {
title: "Buttons/Button",
title: "Actions/Button",
component: Button,
args: {
onPress: action("onPress"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import defaultMeta from "./Default.stories";

const meta: Meta<typeof Button> = {
...defaultMeta,
title: "Buttons/Button/Edge Cases",
title: "Actions/Button/Edge Cases",
};
export default meta;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import React from "react";

const meta: Meta<typeof Button> = {
...defaultMeta,
title: "Buttons/Button/States",
title: "Actions/Button/States",
};
export default meta;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import React from "react";

const meta: Meta<typeof Button> = {
...defaultMeta,
title: "Buttons/Button/Variants",
title: "Actions/Button/Variants",
};

export default meta;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React from "react";
import { action } from "@storybook/addon-actions";

const meta: Meta<typeof Checkbox> = {
title: "Forms/Checkbox",
title: "Form Controls/Checkbox",
component: Checkbox,
args: {
onChange: action("onChange"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import defaultMeta from "./Default.stories";
import { dummyText } from "@/lib/dev/dummyText";

const meta: Meta<typeof Checkbox> = {
title: "Forms/Checkbox/Edge Cases",
title: "Form Controls/Checkbox/Edge Cases",
...defaultMeta,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from "react";
import { CopyToClipboardButton } from "../CopyToClipboardButton";

const meta: Meta<typeof CopyToClipboardButton> = {
title: "Buttons/CopyToClipboardButton",
title: "Actions/CopyToClipboardButton",
component: CopyToClipboardButton,
render: (props) => <CopyToClipboardButton {...props} />,
args: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,9 @@
@include level(4);
@include level(5);
@include level(6);

@media (max-width: 550px) {
h1 {
font-size: var(--heading--h1-font-size-mobile);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@

.heading {
grid-area: heading;
font-size: var(--inline-alert--heading-font-size);
}

.content {
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/components/Label/Label.module.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.label {
color: var(--label--color);
color: var(--label--color--default);
font-size: var(--label--font-size);
font-weight: var(--label--font-weight);
}
1 change: 1 addition & 0 deletions packages/components/src/components/Link/Link.module.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.link {
font-size: var(--link--font-size);
line-height: var(--link--line-height);
font-weight: var(--link--font-weight);
transition-property: color;
transition-duration: var(--transition--duration--default);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import FieldDescription from "@/components/FieldDescription/FieldDescription";
import { FieldError } from "@/components/FieldError";

const meta: Meta<typeof NumberField> = {
title: "Forms/NumberField",
title: "Form Controls/NumberField",
component: NumberField,
render: (props) => (
<NumberField onChange={action("onChange")} {...props}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Label } from "@/components/Label";
import { action } from "@storybook/addon-actions";

const meta: Meta<typeof NumberField> = {
title: "Forms/NumberField/Edge Cases",
title: "Form Controls/NumberField/Edge Cases",
component: NumberField,
render: (props) => (
<NumberField onChange={action("onChange")} {...props}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { action } from "@storybook/addon-actions";
import { FieldError } from "@/components/FieldError";

const meta: Meta<typeof RadioGroup> = {
title: "Forms/RadioGroup",
title: "Form Controls/RadioGroup",
component: RadioGroup,
args: {
onChange: action("onChange"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { dummyText } from "@/lib/dev/dummyText";
import defaultMeta from "./Default.stories";

const meta: Meta<typeof RadioGroup> = {
title: "Forms/RadioGroup/Edge Cases",
title: "Form Controls/RadioGroup/Edge Cases",
...defaultMeta,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React from "react";
import { action } from "@storybook/addon-actions";

const meta: Meta<typeof Switch> = {
title: "Forms/Switch",
title: "Form Controls/Switch",
component: Switch,
args: {
onChange: action("onChange"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import defaultMeta from "./Default.stories";

const meta: Meta<typeof Switch> = {
...defaultMeta,
title: "Forms/Switch/Edge Cases",
title: "Form Controls/Switch/Edge Cases",
};

export default meta;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import defaultMeta from "./Default.stories";

const meta: Meta<typeof Switch> = {
...defaultMeta,
title: "Forms/Switch/Variants",
title: "Form Controls/Switch/Variants",
args: { defaultSelected: true },
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import FieldDescription from "@/components/FieldDescription/FieldDescription";
import { FieldError } from "@/components/FieldError";

const meta: Meta<typeof TextArea> = {
title: "Forms/TextArea",
title: "Form Controls/TextArea",
component: TextArea,
render: (props) => (
<TextArea onChange={action("onChange")} {...props}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Button } from "@/components/Button";
import { FieldError } from "@/components/FieldError";

const meta: Meta<typeof TextField> = {
title: "Forms/TextField",
title: "Form Controls/TextField",
component: TextField,
render: (props) => (
<TextField onChange={action("onChange")} {...props}>
Expand Down
2 changes: 1 addition & 1 deletion packages/components/vite.build.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export default defineConfig(
Button: "./src/components/Button/index.ts",
Checkbox: "./src/components/Checkbox/index.ts",
Content: "./src/components/Content/index.ts",
LayoutCard: "./src/components/LayoutCard/index.ts",
CopyToClipboardButton:
"./src/components/CopyToClipboardButton/index.ts",
FieldDescription: "./src/components/FieldDescription/index.ts",
Expand All @@ -32,6 +31,7 @@ export default defineConfig(
InlineAlert: "./src/components/InlineAlert/index.ts",
Label: "./src/components/Label/index.ts",
LabeledValue: "./src/components/LabeledValue/index.ts",
LayoutCard: "./src/components/LayoutCard/index.ts",
Link: "./src/components/Link/index.ts",
Navigation: "./src/components/Navigation/index.ts",
NumberField: "./src/components/NumberField/index.ts",
Expand Down
8 changes: 4 additions & 4 deletions packages/design-tokens/src/components/button.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ button:
value: "{danger.color.700}"

# Small
padding-small:
padding-s:
value: "{size-px.xs}"
padding-small-squished-x:
padding-s-squished-x:
value: "{size-px.s}"
padding-small-squished-y:
padding-s-squished-y:
value: "{size-px.xs}"
font-size-small:
font-size-s:
value: "{font-size.s}"

# Accent Solid
Expand Down
6 changes: 4 additions & 2 deletions packages/design-tokens/src/components/heading.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ heading:
value: "{font-weight.bold}"
h1-font-size:
value: "{font-size.xxl}"
h2-font-size:
h1-font-size-mobile:
value: "{font-size.xl}"
h3-font-size:
h2-font-size:
value: "{font-size.l}"
h3-font-size:
value: "{font-size.m}"
h4-font-size:
value: "{font-size.m}"
h5-font-size:
Expand Down
5 changes: 4 additions & 1 deletion packages/design-tokens/src/components/label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ label:
font-weight:
value: "{font-weight.bold}"
color:
value: "{neutral.color.800}"
default:
value: "{neutral.color.800}"
disabled:
value: "{neutral.color.600}"
2 changes: 2 additions & 0 deletions packages/design-tokens/src/components/link.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
link:
font-size:
value: "{font-size.s}"
line-height:
value: "{line-height.m}"
font-weight:
value: "{font-weight.bold}"
disabled-color:
Expand Down
6 changes: 2 additions & 4 deletions packages/design-tokens/src/font.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@ font-weight:
line-height:
default:
value: 1.5
m:
value: "calc({font-size.m} * 1.5)"
font-size:
default:
value: "{font-size.m}"
xxs:
value: 0.625rem
xs:
value: 0.75rem
s:
value: 0.875rem
m:
Expand Down

1 comment on commit abbc424

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage report for ./packages/components/

St.
Category Percentage Covered / Total
🟢 Statements 98.08% 102/104
🟢 Branches 93.55% 29/31
🟢 Functions 100% 27/27
🟢 Lines 98.06% 101/103

Test suite run success

52 tests passing in 9 suites.

Report generated by 🧪jest coverage report action from abbc424

Please sign in to comment.