-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(merge): merge latest changes from the main branch
- Loading branch information
Showing
708 changed files
with
21,895 additions
and
15,939 deletions.
There are no files selected for viewing
File renamed without changes.
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 |
---|---|---|
|
@@ -5,4 +5,5 @@ module.exports = { | |
endOfLine: "lf", | ||
tabWidth: 2, | ||
trailingComma: "es5", | ||
printWidth: 80, | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React from "react"; | ||
import { StyledSidebarItem } from "./style"; | ||
import StatusTag from "../StatusTag/StatusTag"; | ||
|
||
export type StatusType = "beta" | "deprecated" | "wip"; | ||
|
||
interface SidebarItemProps { | ||
children: React.ReactNode; | ||
status: StatusType; | ||
} | ||
|
||
const SidebarItem = ({ children, status }: SidebarItemProps) => { | ||
return ( | ||
<StyledSidebarItem> | ||
<div>{children}</div> | ||
<StatusTag type={status}>{status}</StatusTag> | ||
</StyledSidebarItem> | ||
); | ||
}; | ||
|
||
export default SidebarItem; |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { styled } from "@mui/material"; | ||
|
||
export const StyledSidebarItem = styled("div")` | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
width: 100%; | ||
`; |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import React, { FC } from "react"; | ||
import { StyledLabel } from "./style"; | ||
import { StatusType } from "../SidebarItem/SidebarItem"; | ||
|
||
interface StatusTagProps { | ||
children: React.ReactNode; | ||
type: StatusType; | ||
} | ||
|
||
const TypeToLabel: Record<StatusType, string> = { | ||
beta: "Beta", | ||
deprecated: "Deprecated", | ||
wip: "Work in Progress", | ||
}; | ||
|
||
const StatusTag: FC<StatusTagProps> = ({ type }) => { | ||
const label = TypeToLabel[type]; | ||
|
||
return <StyledLabel type={type}>{label}</StyledLabel>; | ||
}; | ||
|
||
export default StatusTag; |
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { styled } from "@mui/material"; | ||
import { StatusType } from "../SidebarItem/SidebarItem"; | ||
|
||
interface StyledLabelProps { | ||
type: StatusType; | ||
} | ||
|
||
const TypeToColor: Record<StatusType, string> = { | ||
beta: "#703CBE", | ||
deprecated: "#C61128", | ||
wip: "#D8921F", | ||
}; | ||
|
||
const TypeToBorderColor: Record<StatusType, string> = { | ||
beta: "#7A41CE", | ||
deprecated: "#DC132C", | ||
wip: "#F5A623", | ||
}; | ||
|
||
export const StyledLabel = styled("label")` | ||
${(props: StyledLabelProps) => { | ||
const { type } = props; | ||
const color = TypeToColor[type]; | ||
const borderColor = TypeToBorderColor[type]; | ||
return ` | ||
margin: 0 16px 0 8px; | ||
padding: 1px 4px; | ||
font-size: 10px; | ||
font-weight: 600; | ||
color: ${color}; | ||
border: solid 1px ${borderColor}; | ||
border-radius: 2px; | ||
`; | ||
}} | ||
`; |
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
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,8 +1,25 @@ | ||
// .storybook/manager.js | ||
|
||
import React from "react"; | ||
import { addons } from "@storybook/addons"; | ||
import sdsTheme from "./sds-theme"; | ||
import SidebarItem from "./components/SidebarItem/SidebarItem"; | ||
|
||
addons.setConfig({ | ||
theme: sdsTheme, | ||
sidebar: { | ||
renderLabel: ({ name }) => { | ||
const statusRegex = /\[([^)]+)]/gi; | ||
const [statusMatch, statusType] = statusRegex.exec(name) || []; | ||
|
||
if (statusMatch) { | ||
return ( | ||
<SidebarItem status={statusType}> | ||
{name.replace(statusMatch, "").trim()} | ||
</SidebarItem> | ||
); | ||
} | ||
|
||
return name; | ||
}, | ||
}, | ||
}); |
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,6 +1,10 @@ | ||
<link rel="preconnect" href="https://fonts.gstatic.com" /> | ||
<link rel="preconnect" href="https://fonts.googleapis.com" /> | ||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin /> | ||
<link | ||
href="https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300;0,400;0,600;0,700;0,800;1,400;1,600;1,700&display=swap" | ||
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap" | ||
rel="stylesheet" | ||
/> | ||
<link | ||
href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&display=swap" | ||
rel="stylesheet" | ||
crossorigin="anonymous" | ||
/> |
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
Binary file not shown.
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
Oops, something went wrong.