Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
5 changes: 5 additions & 0 deletions .changeset/short-comics-wish.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"reshaped": patch
---

Text: Added semibold and extrabold weight support
9 changes: 9 additions & 0 deletions packages/reshaped/src/cli/theming/tailwind.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,15 @@ export const transformToTailwind = (theme?: GeneratedThemeDefinition) => {
return;
});

Object.keys(definition.fontWeight).forEach((tokenName) => {
const cssTokenName = camelToKebab(tokenName);
const cssVariable = ["rs", "font-weight", cssTokenName].join("-");
const configValue = `var(--${cssVariable})`;

variables[`--font-weight-${cssTokenName}`] = configValue;
return;
});

Object.keys(definition.unit).forEach((tokenName) => {
if (tokenName.startsWith("base")) {
[...Array(11).keys()].forEach((i) => {
Expand Down
4 changes: 2 additions & 2 deletions packages/reshaped/src/components/Accordion/Accordion.types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Attributes, ClassName } from "@reshaped/headless";
import type { IconProps } from "@/components/Icon";
import type React from "react";
import type * as G from "@/types/global";
import type { Attributes, ClassName } from "@reshaped/headless";
import type React from "react";

export type BaseProps = {
/** Expand / collapse icon size in units */
Expand Down
4 changes: 2 additions & 2 deletions packages/reshaped/src/components/ActionBar/ActionBar.types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Attributes, ClassName } from "@reshaped/headless";
import type { ViewProps } from "@/components/View";
import type React from "react";
import type * as G from "@/types/global";
import type { Attributes, ClassName } from "@reshaped/headless";
import type React from "react";

export type Props = Pick<ViewProps, "paddingBlock" | "paddingInline" | "padding"> & {
/** Show or hide the component */
Expand Down
4 changes: 2 additions & 2 deletions packages/reshaped/src/components/Alert/Alert.types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Attributes, ClassName } from "@reshaped/headless";
import type { IconProps } from "@/components/Icon";
import type React from "react";
import type * as G from "@/types/global";
import type { Attributes, ClassName } from "@reshaped/headless";
import type React from "react";

export type Props = {
/** SVG component for the icon */
Expand Down
2 changes: 1 addition & 1 deletion packages/reshaped/src/components/Avatar/Avatar.types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Attributes, ClassName } from "@reshaped/headless";
import type { IconProps } from "@/components/Icon";
import type * as G from "@/types/global";
import type { Attributes, ClassName } from "@reshaped/headless";

export type Props = {
/** Image URL */
Expand Down
2 changes: 1 addition & 1 deletion packages/reshaped/src/components/Badge/Badge.types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Attributes, ClassName } from "@reshaped/headless";
import type { ActionableProps } from "@/components/Actionable";
import type { IconProps } from "@/components/Icon";
import type { Attributes, ClassName } from "@reshaped/headless";
import type React from "react";

type BaseProps = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Attributes, ClassName } from "@reshaped/headless";
import type { LinkProps } from "@/components/Link";
import type { Attributes, ClassName } from "@reshaped/headless";
import type React from "react";

export type Props = {
Expand Down
4 changes: 2 additions & 2 deletions packages/reshaped/src/components/Button/Button.types.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { Attributes, ClassName } from "@reshaped/headless";
import type { AlignerProps as BaseAlignerProps } from "@/components/_private/Aligner";
import type { ActionableProps } from "@/components/Actionable";
import type { IconProps } from "@/components/Icon";
import type React from "react";
import type * as G from "@/types/global";
import type { Attributes, ClassName } from "@reshaped/headless";
import type React from "react";

export type Size = "xlarge" | "large" | "medium" | "small";

Expand Down
4 changes: 2 additions & 2 deletions packages/reshaped/src/components/Carousel/Carousel.types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Attributes, ClassName } from "@reshaped/headless";
import type { ActionableRef } from "@/components/Actionable";
import type React from "react";
import type * as G from "@/types/global";
import type { Attributes, ClassName } from "@reshaped/headless";
import type React from "react";

export type Instance =
| {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type * as G from "@/types/global";
import type { Attributes, ClassName } from "@reshaped/headless";
import type React from "react";
import type * as G from "@/types/global";

type BaseProps = {
/** Node for inserting the label */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { CheckboxProps } from "@/components/Checkbox";
import type React from "react";
import type * as G from "@/types/global";
import type React from "react";

type BaseProps = {
/** Component id attribute */
Expand Down
4 changes: 2 additions & 2 deletions packages/reshaped/src/components/Container/Container.types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Attributes, ClassName } from "@reshaped/headless";
import type { ViewProps } from "@/components/View";
import type React from "react";
import type * as G from "@/types/global";
import type { Attributes, ClassName } from "@reshaped/headless";
import type React from "react";

export type Props = Pick<ViewProps, "align" | "justify" | "height" | "maxHeight"> & {
/** Component inline padding */
Expand Down
2 changes: 1 addition & 1 deletion packages/reshaped/src/components/Divider/Divider.types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type * as G from "@/types/global";
import type { Attributes, ClassName } from "@reshaped/headless";
import type React from "react";
import type * as G from "@/types/global";

export type Props = {
/** Change component to take no space, useful for using it as a border in components like Tabs */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Attributes, ClassName } from "@reshaped/headless";
import type { ViewProps } from "@/components/View";
import type React from "react";
import type * as G from "@/types/global";
import type { Attributes, ClassName } from "@reshaped/headless";
import type React from "react";

export type Props = {
/** Name of the input element */
Expand Down
4 changes: 2 additions & 2 deletions packages/reshaped/src/components/Grid/Grid.types.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type * as TStyles from "@/styles/types";
import type * as G from "@/types/global";
import type { Attributes, ClassName } from "@reshaped/headless";
import type { Property } from "csstype";
import type React from "react";
import type * as TStyles from "@/styles/types";
import type * as G from "@/types/global";

export type Props<TagName extends keyof React.JSX.IntrinsicElements | void = void> = {
/** Gap between grid items */
Expand Down
2 changes: 1 addition & 1 deletion packages/reshaped/src/components/Hidden/Hidden.types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type React from "react";
import type * as G from "@/types/global";
import type React from "react";

export type Props = {
/** Pick at which viewport sizes to hide the children*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";

import type { Attributes, ClassName } from "@reshaped/headless";
import type * as G from "@/types/global";
import type { Attributes, ClassName } from "@reshaped/headless";

export type Props = {
/** Name of the input element */
Expand Down
2 changes: 1 addition & 1 deletion packages/reshaped/src/components/Icon/Icon.types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type * as G from "@/types/global";
import type { Attributes, ClassName } from "@reshaped/headless";
import type React from "react";
import type * as G from "@/types/global";

export type Props = {
/** Icon svg component or node */
Expand Down
4 changes: 2 additions & 2 deletions packages/reshaped/src/components/Image/Image.types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Attributes, ClassName } from "@reshaped/headless";
import type React from "react";
import type * as TStyles from "@/styles/types";
import type * as G from "@/types/global";
import type { Attributes, ClassName } from "@reshaped/headless";
import type React from "react";

export type Props = {
/** Image URL */
Expand Down
2 changes: 1 addition & 1 deletion packages/reshaped/src/components/Loader/Loader.types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Attributes, ClassName } from "@reshaped/headless";
import type * as G from "@/types/global";
import type { Attributes, ClassName } from "@reshaped/headless";

export type Props = {
/** Component size */
Expand Down
4 changes: 2 additions & 2 deletions packages/reshaped/src/components/MenuItem/MenuItem.types.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { Attributes, ClassName } from "@reshaped/headless";
import type { ActionableProps } from "@/components/Actionable";
import type { IconProps } from "@/components/Icon";
import type React from "react";
import type * as G from "@/types/global";
import type { Attributes, ClassName } from "@reshaped/headless";
import type React from "react";

export type Size = "small" | "medium" | "large";

Expand Down
4 changes: 2 additions & 2 deletions packages/reshaped/src/components/Modal/Modal.types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Attributes, ClassName } from "@reshaped/headless";
import type { OverlayProps, OverlayCloseReason } from "@/components/Overlay";
import type React from "react";
import type * as G from "@/types/global";
import type { Attributes, ClassName } from "@reshaped/headless";
import type React from "react";

export type Context = {
id: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Attributes, ClassName } from "@reshaped/headless";
import type * as G from "@/types/global";
import type { Attributes, ClassName } from "@reshaped/headless";

export type Size = "small" | "medium" | "large" | "xlarge";

Expand Down
2 changes: 1 addition & 1 deletion packages/reshaped/src/components/Radio/Radio.types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type * as G from "@/types/global";
import type { Attributes, ClassName } from "@reshaped/headless";
import type React from "react";
import type * as G from "@/types/global";

type BaseProps = {
/** Node for inserting children */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Attributes, ClassName } from "@reshaped/headless";
import type { RadioProps } from "@/components/Radio";
import type React from "react";
import type * as G from "@/types/global";
import type { Attributes, ClassName } from "@reshaped/headless";
import type React from "react";

type BaseProps = {
/** Unique identifier for the radio group */
Expand Down
4 changes: 2 additions & 2 deletions packages/reshaped/src/components/Reshaped/Reshaped.types.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { Attributes, ClassName } from "@reshaped/headless";
import type { GlobalColorModeProps, ThemeProps } from "@/components/Theme";
import type { ToastProviderProps } from "@/components/Toast";
import type React from "react";
import type * as G from "@/types/global";
import type { Attributes, ClassName } from "@reshaped/headless";
import type React from "react";

export type Props = {
/** Node for inserting children */
Expand Down
2 changes: 1 addition & 1 deletion packages/reshaped/src/components/Scrim/Scrim.types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";

import type { Attributes, ClassName } from "@reshaped/headless";
import type { ViewProps } from "@/components/View";
import type { Attributes, ClassName } from "@reshaped/headless";

export type Props = {
/** Node for inserting content */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type * as G from "@/types/global";
import type { Attributes, ClassName } from "@reshaped/headless";
import type { Coordinates } from "@reshaped/headless/internal";
import type React from "react";
import type * as G from "@/types/global";

export type Props = {
/** Node for inserting content */
Expand Down
2 changes: 1 addition & 1 deletion packages/reshaped/src/components/Select/Select.types.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React from "react";

import type { Attributes, ClassName } from "@reshaped/headless";
import type { ActionableProps } from "@/components/Actionable";
import type { DropdownMenuProps } from "@/components/DropdownMenu";
import type { IconProps } from "@/components/Icon";
import type { MenuItemProps } from "@/components/MenuItem";
import type * as G from "@/types/global";
import type { Attributes, ClassName } from "@reshaped/headless";

type Size = G.Responsive<"small" | "medium" | "large" | "xlarge">;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Attributes, ClassName } from "@reshaped/headless";
import type { ViewProps } from "@/components/View";
import type { Attributes, ClassName } from "@reshaped/headless";

export type Props = Pick<ViewProps, "width" | "height" | "borderRadius"> & {
/** Additional classname for the root element */
Expand Down
2 changes: 1 addition & 1 deletion packages/reshaped/src/components/Stepper/Stepper.types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type * as G from "@/types/global";
import type { Attributes, ClassName } from "@reshaped/headless";
import type React from "react";
import type * as G from "@/types/global";

export type Props = {
/** Id of the item to display as active */
Expand Down
2 changes: 1 addition & 1 deletion packages/reshaped/src/components/Switch/Switch.types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";

import type { Attributes, ClassName } from "@reshaped/headless";
import type * as G from "@/types/global";
import type { Attributes, ClassName } from "@reshaped/headless";

type BaseProps = {
/** Node for inserting children */
Expand Down
2 changes: 1 addition & 1 deletion packages/reshaped/src/components/Tabs/Tabs.types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Attributes, ClassName } from "@reshaped/headless";
import type { IconProps } from "@/components/Icon";
import type { Attributes, ClassName } from "@reshaped/headless";
import type React from "react";

export type SelectionState = {
Expand Down
8 changes: 8 additions & 0 deletions packages/reshaped/src/components/Text/Text.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,17 @@
font-weight: var(--rs-font-weight-medium) !important;
}

@value semibold {
font-weight: var(--rs-font-weight-semibold) !important;
}

@value bold {
font-weight: var(--rs-font-weight-bold) !important;
}

@value extrabold {
font-weight: var(--rs-font-weight-extrabold) !important;
}
}

@each $color in neutral, neutral-faded, primary, warning, positive, critical, disabled {
Expand Down
4 changes: 2 additions & 2 deletions packages/reshaped/src/components/Text/Text.types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type * as G from "@/types/global";
import type { Attributes, ClassName } from "@reshaped/headless";
import type React from "react";
import type * as G from "@/types/global";

export type Variant =
| "title-1"
Expand All @@ -22,7 +22,7 @@ export type Props<TagName extends keyof React.JSX.IntrinsicElements | void = voi
/** Text render variant */
variant?: G.Responsive<Variant>;
/** Text font weight */
weight?: G.Responsive<"regular" | "medium" | "bold">;
weight?: G.Responsive<"regular" | "medium" | "semibold" | "bold" | "extrabold">;
/** Render monospace font */
monospace?: boolean;
/** Text color, based on the color tokens */
Expand Down
6 changes: 6 additions & 0 deletions packages/reshaped/src/components/Text/tests/Text.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,15 @@ export const weight = {
<Example.Item title="weight: medium">
<Text weight="medium">Medium</Text>
</Example.Item>
<Example.Item title="weight: semibold">
<Text weight="semibold">Semibold</Text>
</Example.Item>
<Example.Item title="weight: bold">
<Text weight="bold">Bold</Text>
</Example.Item>
<Example.Item title="weight: extrabold">
<Text weight="extrabold">Extrabold</Text>
</Example.Item>
<Example.Item title={["responsive", "[s] weight: regular", "[m+] bold"]}>
<Text weight={{ s: "regular", m: "bold" }}>Responsive</Text>
</Example.Item>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from "react";

import type { Attributes, ClassName } from "@reshaped/headless";
import type { FormControlProps } from "@/components/FormControl";
import type * as G from "@/types/global";
import type { Attributes, ClassName } from "@reshaped/headless";

type Size = G.Responsive<"medium" | "large" | "xlarge">;

Expand Down
4 changes: 2 additions & 2 deletions packages/reshaped/src/components/TextField/TextField.types.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { Attributes, ClassName } from "@reshaped/headless";
import type { FormControlProps } from "@/components/FormControl";
import type { IconProps } from "@/components/Icon";
import type React from "react";
import type * as G from "@/types/global";
import type { Attributes, ClassName } from "@reshaped/headless";
import type React from "react";

type Size = G.Responsive<"small" | "medium" | "large" | "xlarge">;

Expand Down
2 changes: 1 addition & 1 deletion packages/reshaped/src/components/Toast/Toast.types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Attributes, ClassName } from "@reshaped/headless";
import type { IconProps } from "@/components/Icon";
import type { Attributes, ClassName } from "@reshaped/headless";
import type React from "react";

export type Status = "entering" | "entered" | "exited";
Expand Down
Loading