Skip to content
Draft
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
3 changes: 3 additions & 0 deletions packages/react/src/components/F0Box/F0Box.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ export const F0Box = forwardRef<HTMLDivElement, F0BoxProps>(
maxHeight,
// Background
background,
hoverBackground,
// Border
borderColor,
border,
Expand Down Expand Up @@ -167,6 +168,7 @@ export const F0Box = forwardRef<HTMLDivElement, F0BoxProps>(
ref={ref}
className={cn(
hasPerSideBorder && "border-0",
hoverBackground && "transition-colors",
boxVariants({
display,
position,
Expand Down Expand Up @@ -197,6 +199,7 @@ export const F0Box = forwardRef<HTMLDivElement, F0BoxProps>(
maxWidth,
maxHeight,
background,
hoverBackground,
borderColor,
border,
borderTop,
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/components/F0Box/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export type {
FlexWrapToken,
FractionToken,
GapToken,
HoverBackgroundToken,
JustifyContentToken,
MarginToken,
NumericSizeToken,
Expand Down
9 changes: 9 additions & 0 deletions packages/react/src/components/F0Box/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,15 @@ export type BackgroundToken =
| "selected-bold"
| "overlay"

/** Hover background tokens mapped to the f1 theme hover states */
export type HoverBackgroundToken =
| "default"
| "secondary"
| "accent-bold"
| "promote"
| "selected"
| "selected-bold"

/** Border color tokens mapped to the f1 theme */
export type BorderColorToken =
| "default"
Expand Down
10 changes: 9 additions & 1 deletion packages/react/src/components/F0Box/utils/background.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { BackgroundToken } from "../types"
import type { BackgroundToken, HoverBackgroundToken } from "../types"

export const backgroundVariants = {
background: {
Expand All @@ -25,4 +25,12 @@ export const backgroundVariants = {
"selected-bold": "bg-f1-background-selected-bold",
overlay: "bg-f1-background-overlay",
} satisfies Record<BackgroundToken, string>,
hoverBackground: {
default: "hover:bg-f1-background-hover",
secondary: "hover:bg-f1-background-secondary-hover",
"accent-bold": "hover:bg-f1-background-accent-bold-hover",
promote: "hover:bg-f1-background-promote-hover",
selected: "hover:bg-f1-background-selected-hover",
"selected-bold": "hover:bg-f1-background-selected-bold-hover",
} satisfies Record<HoverBackgroundToken, string>,
}
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,16 @@ export const RESPONSIVE_SAFELIST = [
"xl:bg-f1-background-positive", "xl:bg-f1-background-positive-bold",
"xl:bg-f1-background-selected", "xl:bg-f1-background-selected-secondary", "xl:bg-f1-background-selected-bold", "xl:bg-f1-background-overlay",

// ===================== HOVER BACKGROUND =====================
"sm:hover:bg-f1-background-hover", "sm:hover:bg-f1-background-secondary-hover", "sm:hover:bg-f1-background-accent-bold-hover",
"sm:hover:bg-f1-background-promote-hover", "sm:hover:bg-f1-background-selected-hover", "sm:hover:bg-f1-background-selected-bold-hover",
"md:hover:bg-f1-background-hover", "md:hover:bg-f1-background-secondary-hover", "md:hover:bg-f1-background-accent-bold-hover",
"md:hover:bg-f1-background-promote-hover", "md:hover:bg-f1-background-selected-hover", "md:hover:bg-f1-background-selected-bold-hover",
"lg:hover:bg-f1-background-hover", "lg:hover:bg-f1-background-secondary-hover", "lg:hover:bg-f1-background-accent-bold-hover",
"lg:hover:bg-f1-background-promote-hover", "lg:hover:bg-f1-background-selected-hover", "lg:hover:bg-f1-background-selected-bold-hover",
"xl:hover:bg-f1-background-hover", "xl:hover:bg-f1-background-secondary-hover", "xl:hover:bg-f1-background-accent-bold-hover",
"xl:hover:bg-f1-background-promote-hover", "xl:hover:bg-f1-background-selected-hover", "xl:hover:bg-f1-background-selected-bold-hover",

// ===================== BORDER COLOR =====================
"sm:border-f1-border", "sm:border-f1-border-secondary", "sm:border-f1-border-bold",
"sm:border-f1-border-selected", "sm:border-f1-border-selected-bold",
Expand Down
2 changes: 2 additions & 0 deletions packages/react/src/components/F0Box/utils/responsive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import type {
FlexDirectionToken,
FlexWrapToken,
GapToken,
HoverBackgroundToken,
JustifyContentToken,
MarginToken,
OverflowToken,
Expand Down Expand Up @@ -74,6 +75,7 @@ export interface ResponsiveStyleProps {
maxHeight?: SizeToken
// Background
background?: BackgroundToken
hoverBackground?: HoverBackgroundToken
// Border
borderColor?: BorderColorToken
border?: BorderWidthToken
Expand Down