-
Notifications
You must be signed in to change notification settings - Fork 220
General Improvements #2899
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
Closed
Closed
General Improvements #2899
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
b25abb9
fix: Increase z-index of `DocsSecondaryNav`
bezbac b6781c4
fix: Improve `GetStartedSection` responsiveness
bezbac c6fb5c3
refactor: Cleanup `BrandAssetCard`
bezbac 525ebdb
fix: Also show `Banner` in docs
bezbac 0d753c8
feat: Add footer navigation to changelog posts
bezbac bef3819
feat: Add footer navigation to blog page
bezbac 87a0b9e
feat: Improve details element styling
bezbac 5728c83
fix: Improve max-width to match 14 inch MacBook screen
bezbac 67d9e83
fix: `FileTree` component styling
bezbac f3ca452
fix: `Availability` component styling
bezbac File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,83 @@ | ||
| "use client"; | ||
|
|
||
| import * as React from "react"; | ||
|
|
||
| import { cn } from "@/lib/utils"; | ||
|
|
||
| type DetailsProps = React.DetailedHTMLProps< | ||
| React.DetailsHTMLAttributes<HTMLDetailsElement>, | ||
| HTMLDetailsElement | ||
| >; | ||
|
|
||
| type SummaryProps = React.DetailedHTMLProps< | ||
| React.HTMLAttributes<HTMLElement>, | ||
| HTMLElement | ||
| >; | ||
|
|
||
| const DetailsContext = React.createContext<{ isOpen: boolean } | null>(null); | ||
|
|
||
| export function Details({ | ||
| children, | ||
| className, | ||
| open, | ||
| onToggle, | ||
| ...props | ||
| }: DetailsProps) { | ||
| const [isOpen, setIsOpen] = React.useState(Boolean(open)); | ||
|
|
||
| React.useEffect(() => { | ||
| setIsOpen(Boolean(open)); | ||
| }, [open]); | ||
|
|
||
| return ( | ||
| <DetailsContext.Provider value={{ isOpen }}> | ||
| <div | ||
| className={cn( | ||
| "relative my-4 border border-line-structure bg-surface-bg", | ||
| isOpen ? "corner-box-corners" : "corner-box-corners--hover" | ||
| )} | ||
| > | ||
| <details | ||
| className={cn( | ||
| "group relative overflow-hidden bg-surface-bg [&_summary~*]:px-4 [&_summary~*]:text-text-secondary [&_summary+*]:pt-4 [&_summary~*:last-child]:pb-4 [&_summary~p:first-of-type]:mt-0 [&_summary~p:last-of-type]:mb-0", | ||
| className | ||
| )} | ||
| open={open} | ||
| onToggle={(event) => { | ||
| setIsOpen(event.currentTarget.open); | ||
| onToggle?.(event); | ||
| }} | ||
| {...props} | ||
| > | ||
| {children} | ||
| </details> | ||
| </div> | ||
| </DetailsContext.Provider> | ||
| ); | ||
| } | ||
|
|
||
| export function Summary({ children, className, ...props }: SummaryProps) { | ||
| const context = React.useContext(DetailsContext); | ||
|
|
||
| return ( | ||
| <summary | ||
| className={cn( | ||
| "flex list-none items-center justify-between gap-4 px-4 py-2 text-text-primary cursor-pointer [&::-webkit-details-marker]:hidden", | ||
| context?.isOpen ? "with-stripes border-b border-line-structure" : "hover:bg-surface-1", | ||
| className | ||
| )} | ||
| {...props} | ||
| > | ||
| <span>{children}</span> | ||
| <div | ||
| aria-hidden | ||
| className={cn( | ||
| "shrink-0 text-base leading-none w-3 text-center select-none", | ||
| context?.isOpen ? "text-text-primary" : "text-text-tertiary" | ||
| )} | ||
| > | ||
| {context?.isOpen ? "-" : "+"} | ||
| </div> | ||
| </summary> | ||
| ); | ||
| } |
This file contains hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.