-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2e624ed
commit 6787c5d
Showing
2 changed files
with
50 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,46 @@ | ||
const StatusBadge = { | ||
baseStyle: { | ||
borderRadius: "base", | ||
color: "ui.typography.heading", | ||
display: "block", | ||
fontSize: "desktop.body.body2", // slightly smaller than the default size | ||
fontStyle: "italic", | ||
py: "inset.extranarrow", | ||
px: "inset.narrow", | ||
textAlign: "center", | ||
width: "fit-content", | ||
_dark: { | ||
backgroundColor: "dark.ui.bg.active", | ||
borderLeft: "4px solid", | ||
borderColor: "dark.ui.border.default", | ||
color: "dark.ui.typography.heading", | ||
}, | ||
import { defineStyleConfig } from "@chakra-ui/react"; | ||
import { defineStyle } from "@chakra-ui/system"; | ||
|
||
const baseStyle = defineStyle({ | ||
borderRadius: "base", | ||
color: "ui.typography.heading", | ||
display: "block", | ||
fontSize: "desktop.body.body2", // slightly smaller than the default size | ||
fontStyle: "italic", | ||
py: "inset.extranarrow", | ||
px: "inset.narrow", | ||
textAlign: "center", | ||
width: "fit-content", | ||
_dark: { | ||
backgroundColor: "dark.ui.bg.active", | ||
borderLeft: "4px solid", | ||
borderColor: "dark.ui.border.default", | ||
color: "dark.ui.typography.heading", | ||
}, | ||
}); | ||
|
||
// Variants | ||
const low = defineStyle({ bg: "ui.gray.light-cool" }); | ||
const medium = defineStyle({ | ||
bg: "ui.status.primary", | ||
_dark: { | ||
borderColor: "ui.status.primary", | ||
}, | ||
}); | ||
const high = defineStyle({ | ||
bg: "ui.status.secondary", | ||
_dark: { | ||
borderColor: "dark.ui.error.primary", | ||
}, | ||
}); | ||
|
||
const StatusBadge = defineStyleConfig({ | ||
baseStyle, | ||
variants: { | ||
low: { | ||
bg: "ui.gray.light-cool", | ||
}, | ||
medium: { | ||
bg: "ui.status.primary", | ||
_dark: { | ||
borderColor: "ui.status.primary", | ||
}, | ||
}, | ||
high: { | ||
bg: "ui.status.secondary", | ||
_dark: { | ||
borderColor: "dark.ui.error.primary", | ||
}, | ||
}, | ||
low, | ||
medium, | ||
high, | ||
}, | ||
}; | ||
}); | ||
|
||
export default StatusBadge; |