Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/typography #4

Merged
merged 21 commits into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .storybook/components/component-info/ComponentInfo.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
.o-ui-sb-component-info-title {
display: inline-block !important;
color: var(--o-ui-text-alias-secondary) !important;
font-variation-settings: "wght" 500 !important;
font-weight: 550 !important;
font-size: var(--o-ui-fs-3) !important;
font-style: normal !important;
width: var(--o-ui-sz-11) !important;
Expand Down
3 changes: 1 addition & 2 deletions .storybook/components/preview/Preview.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
color: var(--o-ui-white);
z-index: 1;
font-size: 0.625rem;
font-weight: 400;
font-variation-settings: "wght" 500;
font-weight: 550;
letter-spacing: 0.025em;
text-transform: uppercase;
}
Expand Down
2 changes: 2 additions & 0 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import { Themes } from "./styles/themes";
if (!isChromatic) {
// Custom font makes chromatic inconsistent and cause "false positive". View https://www.chromatic.com/docs/resource-loading#loading-custom-fonts.
import("@css/font/index.css");
} else {
import("./styles/chromatic.css");
}

export const parameters = {
Expand Down
2 changes: 1 addition & 1 deletion .storybook/styles/app.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
html,
body {
font-family: "TT Interphases Variable", Arial, Helvetica, serif !important;
font-family: "Inter", Arial, Helvetica, serif !important;
-webkit-font-smoothing: antialiased;
font-size: 16px;
}
5 changes: 5 additions & 0 deletions .storybook/styles/chromatic.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*,
fraincs marked this conversation as resolved.
Show resolved Hide resolved
*::before,
*::after {
font-family: Arial;
}
23 changes: 8 additions & 15 deletions .storybook/styles/docs.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
:root {
/* Use this var only when the element is not affected by the font-family specified in Storybook docs theme */
--orbiter-font-family: "TT Interphases Variable", Arial, Helvetica, sans-serif;
--orbiter-font-family: "Inter", Arial, Helvetica, sans-serif;
}

/* LAYOUT */
Expand All @@ -15,7 +15,7 @@

/* STORY */
.docs-story div + div > button {
font-variation-settings: "wght" 500;
font-weight: 550;
font-size: var(--o-ui-fs-2);
}

Expand All @@ -32,8 +32,7 @@
}

.docblock-argstable-head tr th {
font-variation-settings: "wght" 500 !important;
font-weight: 400;
font-weight: 550 !important;
color: var(--o-ui-text-alias-primary) !important;
}

Expand All @@ -57,13 +56,11 @@

/* ARGS TABLE | BODY */
.docblock-argstable-body td > span {
font-variation-settings: "wght" 500 !important;
font-weight: 400;
font-weight: 550 !important;
}

.docblock-argstable-body td > label > span {
font-variation-settings: "wght" 500 !important;
font-weight: 400;
font-weight: 550 !important;
}

.docblock-argstable-body td label input[type=radio] {
Expand Down Expand Up @@ -154,8 +151,7 @@
.sbdocs.sbdocs-h4,
.sbdocs.sbdocs-h5,
.sbdocs.sbdocs-h6 {
font-variation-settings: "wght" 500;
font-weight: 400;
font-weight: 550;
/* fixing the default position relative on all titles in shared.tsx */
position: initial;
}
Expand All @@ -167,7 +163,7 @@

.sbdocs.sbdocs-h1,
.sbdocs .sbdocs-title {
font-variation-settings: "wght" 500;
font-weight: 550;
}

.sbdocs.sbdocs-h2 {
Expand Down Expand Up @@ -266,8 +262,7 @@
}

.sbdocs.sbdocs-table tr th {
font-weight: 400;
font-variation-settings: "wght" 600;
font-weight: 600;
font-size: var(--o-ui-fs-4);
}

Expand Down Expand Up @@ -303,7 +298,6 @@

.sbdocs.sbdocs-table b,
.sbdocs.sbdocs-table strong {
font-variation-settings: "wght" 600;
font-weight: 400;
}

Expand Down Expand Up @@ -354,7 +348,6 @@

/* ELEMENTS | STRONG */
.sbdocs strong {
font-variation-settings: "wght" 500;
font-weight: 400;
}

Expand Down
2 changes: 1 addition & 1 deletion .storybook/styles/themes.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const Themes = {
}),
docs: create({
base: "light",
fontBase: "TT Interphases Variable, Arial, Helvetica, sans-serif",
fontBase: "Inter, Arial, Helvetica, sans-serif",
textColor: "#04091A"
})
};
2 changes: 1 addition & 1 deletion packages/components/src/accordion/src/Accordion.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/* HEADER */
.o-ui-accordion .o-ui-accordion-header {
margin-bottom: 0;
font-variation-settings: "wght" 500;
font-weight: 505;
fraincs marked this conversation as resolved.
Show resolved Hide resolved
}

/* HEADER BORDERLESS */
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/accordion/src/AccordionHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export function InnerAccordionHeader(props: InnerAccordionHeaderProps) {
headingProps ?? {},
{
className: "o-ui-accordion-header",
size: "2xs"
size: "xs"
}
)}
>
Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/button/src/Button.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
background-image: none;
cursor: pointer;
line-height: var(--o-ui-lh-1);
font-variation-settings: "wght" 500;
font-weight: 500;
transition: all var(--o-ui-easing-duration-2) var(--o-ui-easing-productive);
border: none;
text-align: center;
Expand Down Expand Up @@ -402,4 +402,4 @@ a.o-ui-button {
.o-ui-button:hover.o-ui-button-primary .o-ui-button-counter,
.o-ui-button-hover:not([disabled]).o-ui-button-primary .o-ui-button-counter {
opacity: 1;
}
}
7 changes: 4 additions & 3 deletions packages/components/src/card/src/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,16 @@ export function InnerCard({
},
content: {
as: Text,
className: "o-ui-card-content"
className: "o-ui-card-content",
size: "sm"
},
header: {
className: "o-ui-card-header"
},
heading: {
as: "span",
className: "o-ui-card-heading",
size: "xs"
size: "sm"
},
illustration: {
className: "o-ui-card-illustration",
Expand All @@ -73,7 +74,7 @@ export function InnerCard({
}), [orientationValue]));

const headerMarkup = isString(header?.props?.children)
? cloneElement(header, { children: <Text>{header?.props?.children}</Text> })
? cloneElement(header, { children: <Text size="sm">{header?.props?.children}</Text> })
: header;

const imageMarkup = image && (
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/counter/src/Counter.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

/* HIGHLIGHT */
.o-ui-counter-highlight {
font-variation-settings: "wght" 500;
font-weight: 500;
}

/* PUSHED */
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/counter/src/Counter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export interface InnerCounterProps extends SlotProps, InternalProps, StyledCompo
/**
* A counter can vary in size.
*/
size?: ResponsiveProp<"xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "inherit">;
size?: ResponsiveProp<"xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "inherit">;
/**
* The style to use.
*/
Expand Down
5 changes: 3 additions & 2 deletions packages/components/src/dialog/src/Dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@ export function InnerDialog({
content: {
as: Text,
className: "o-ui-dialog-content",
id: `${dialogId}-content`
id: `${dialogId}-content`,
size: "sm"
},
footer: {
as: "footer",
Expand All @@ -241,7 +242,7 @@ export function InnerDialog({
as: "h3",
className: "o-ui-dialog-heading",
id: `${dialogId}-heading`,
size: "sm"
size: "lg"
},
illustration: {
className: "o-ui-dialog-illustration",
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/divider/src/Divider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function InnerDivider({
const orientationValue = useResponsiveValue(orientation);

const labelMarkup = children && (
<Text className="o-ui-divider-label">
<Text className="o-ui-divider-label" size="sm">
{children}
</Text>
);
Expand Down
3 changes: 2 additions & 1 deletion packages/components/src/field/src/FieldMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ export const FieldMessage = forwardRef<any, InnerFieldMessageProps>(({
variant,
fluidValue && "fluid"
),
ref
ref,
size: "sm" as const
}
)}
>
Expand Down
3 changes: 1 addition & 2 deletions packages/components/src/form/src/Form.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
.o-ui-fieldset-label {
display: inline-block;
font-size: var(--o-ui-fs-4);
font-weight: 400;
font-variation-settings: "wght" 600;
font-weight: 600;
color: var(--o-ui-text-alias-primary);
margin-bottom: var(--o-ui-sp-3);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export function InnerIllustratedMessage({
heading: {
as: "h3",
className: "o-ui-illustrated-message-heading",
size: "sm"
size: "md"
},
image: {
className: "o-ui-illustrated-message-image"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export function useInputGroupButtonAddonProps(): [UseInputGroupButtonAddonPropsR
const [{ disabled }, isInInputGroup] = useInputGroupContext();

const props = isInInputGroup && {
className: "o-ui-input-group-addon o-ui-input-group-button-addon",
className: "o-ui-input-group-addon o-ui-input-group-button-addon",
disabled
};

Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/listbox/src/Listbox.css
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ IMPORTANT: The Listbox component hardcoded a few CSS values to enable dynamic sc
/* SECTION */
.o-ui-listbox-section {
display: flex;
font-variation-settings: "wght" 500;
font-weight: 500;
padding-left: var(--o-ui-sp-3);
cursor: default;
line-height: var(--o-ui-lh-1);
Expand Down
3 changes: 2 additions & 1 deletion packages/components/src/listbox/src/ListboxOption.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ export function InnerListboxOption({
},
text: {
className: "o-ui-listbox-option-label",
id: `${id}-label`
id: `${id}-label`,
size: "sm"
}
}), [id]));

Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/lozenge/src/Lozenge.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
color: var(--o-ui-text-alias-primary);
padding: 0 var(--o-ui-sp-2);
border-radius: var(--o-ui-br-2);
font-variation-settings: "wght" 600;
font-weight: 600;
min-height: var(--o-ui-sz-3);
line-height: var(--o-ui-sz-3);
width: max-content;
Expand Down
3 changes: 1 addition & 2 deletions packages/components/src/menu/src/Menu.css
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,7 @@ IMPORTANT: The Menu component hardcoded a few CSS values to enable dynamic scrol
.o-ui-menu-section-title {
cursor: default;
display: flex;
font-weight: 400;
font-variation-settings: "wght" 500;
font-weight: 500;
padding-left: var(--o-ui-sp-3);
height: var(--o-ui-menu-item-height);
line-height: var(--o-ui-lh-1);
Expand Down
3 changes: 1 addition & 2 deletions packages/components/src/message/src/Message.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ const MessageContent = forwardRef<any, TextProps>(({
<StyleProvider
value={{
heading: {
className: "o-ui-message-title",
size: "2xs"
className: "o-ui-message-title"
},
"html-a": {
color: "inherit"
Expand Down
5 changes: 3 additions & 2 deletions packages/components/src/popover/src/Popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ export function InnerPopover({
},
content: {
as: Text,
className: "o-ui-popover-content"
className: "o-ui-popover-content",
size: "sm"
},
footer: {
as: "footer",
Expand All @@ -137,7 +138,7 @@ export function InnerPopover({
heading: {
as: "h3",
id: `${popoverId}-heading`,
size: "sm"
size: "md"
}
}), [popoverId]));

Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/shared/src/size.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export type Size = "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "inherit";
export type Size = "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "inherit";

export function normalizeSize<T extends Size>(size?: T) {
return size || "md";
Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/tag/src/Tag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ export interface InnerTagProps extends InternalProps, InteractionProps, StyledCo

/* eslint-disable sort-keys, sort-keys-fix/sort-keys-fix */
const textSize = createSizeAdapter({
"sm": "md",
"md": "md"
"sm": "sm",
"md": "sm"
});
/* eslint-enable sort-keys, sort-keys-fix/sort-keys-fix */

Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/tile/src/useTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export function useTile({
heading: {
as: "span",
className: "o-ui-tile-heading",
size: "xs"
size: "sm"
},
illustration: {
className: "o-ui-tile-illustration",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ You can alter the size of an heading component by specifying a `size` prop.
<Story name="size">
<>
<Heading>Houston, Tranquillity Base here. The Eagle has landed.</Heading>
<H2 size="sm">Houston, Tranquillity Base here. The Eagle has landed.</H2>
<H2 size="xs">Houston, Tranquillity Base here. The Eagle has landed.</H2>
</>
</Story>
</Preview>
Expand Down
Loading