Skip to content

Commit

Permalink
Design system tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminleonard committed Dec 17, 2024
1 parent 7492e4a commit 44ac341
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 75 deletions.
24 changes: 16 additions & 8 deletions app/components/AsciidocBlocks/Document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,23 @@
*
* Copyright Oxide Computer Company
*/
import { useDelegatedReactRouterLinks } from '@oxide/design-system/components/dist'
import { Content, type DocumentBlock } from '@oxide/react-asciidoc'
import { useRef } from 'react'

const CustomDocument = ({ document }: { document: DocumentBlock }) => (
<div
id="content"
className="asciidoc-body max-w-full flex-shrink overflow-hidden 800:overflow-visible 800:pr-10 1200:w-[calc(100%-var(--toc-width))] 1200:pr-16 print:p-0"
>
<Content blocks={document.blocks} />
</div>
)
const CustomDocument = ({ document }: { document: DocumentBlock }) => {
let ref = useRef<HTMLDivElement>(null)
useDelegatedReactRouterLinks(ref, document.title)

return (
<div
id="content"
className="asciidoc-body max-w-full flex-shrink overflow-hidden 800:overflow-visible 800:pr-10 1200:w-[calc(100%-var(--toc-width))] 1200:pr-16 print:p-0"
ref={ref}
>
<Content blocks={document.blocks} />
</div>
)
}

export { CustomDocument }
50 changes: 0 additions & 50 deletions app/components/Spinner.tsx

This file was deleted.

10 changes: 5 additions & 5 deletions app/components/rfd/RfdDiscussionDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
useDialogStore,
type DialogStore,
} from '@ariakit/react'
import { Spinner } from '@oxide/design-system/components/dist'
import cn from 'classnames'
import dayjs from 'dayjs'
import relativeTime from 'dayjs/plugin/relativeTime'
Expand All @@ -30,7 +31,6 @@ import type {
} from '~/services/rfd.server'

import { GotoIcon } from '../CustomIcons'
import Spinner from '../Spinner'
import { CommentThreadBlock, matchCommentToBlock } from './RfdInlineComments'
import { calcOffset } from './RfdPreview'

Expand Down Expand Up @@ -353,14 +353,14 @@ const DiscussionReview = ({
<div className="text-sans-semi-md">
<a
href={data.review.user.html_url}
className="hover:text-secondary"
className="text-sans-semi-md text-raise hover:text-default"
target="_blank"
rel="noreferrer"
>
{data.review.user.login}
</a>
</div>
<div className="ml-1 text-sans-md text-quaternary">
<div className="ml-1 text-sans-md text-tertiary">
reviewed on
<time dateTime={data.review.submitted_at}>
{' '}
Expand All @@ -376,7 +376,7 @@ const DiscussionReview = ({
<div className="flex items-center border-b p-3 text-sans-md bg-secondary border-b-secondary">
<a
href={data.review.user.html_url}
className="hover:text-secondary"
className="text-sans-semi-md text-raise hover:text-default"
target="_blank"
rel="noreferrer"
>
Expand Down Expand Up @@ -459,7 +459,7 @@ const DiscussionIssueComment = ({
<div className="flex items-center border-b p-3 text-sans-md bg-secondary border-b-secondary">
<a
href={data.user.html_url}
className="hover:text-secondary"
className="text-sans-semi-md text-raise hover:text-default"
target="_blank"
rel="noreferrer"
>
Expand Down
12 changes: 6 additions & 6 deletions app/components/rfd/RfdInlineComments.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
useInteractions,
useRole,
} from '@floating-ui/react'
import { Badge } from '@oxide/design-system/components/dist'
import cn from 'classnames'
import dayjs from 'dayjs'
import relativeTime from 'dayjs/plugin/relativeTime'
Expand Down Expand Up @@ -361,19 +362,18 @@ export const CommentThreadBlock = ({
)}
>
{/* Meta */}
{/* {isOverlay && ( */}
<div className="flex items-center justify-between p-3 bg-secondary">
<a href={htmlUrl} target="_blank" rel="noreferrer" className="hover:opacity-80">
<div className="flex items-center !normal-case text-mono-xs">
<div className="flex items-center !normal-case text-mono-sm">
{isOverlay && (
<span className="mr-1 text-sans-sm text-tertiary">Comment on </span>
)}
{path}

{isOutdated && (
<div className="ml-2 rounded px-1 py-[1px] text-mono-xs text-notice bg-notice-secondary">
<Badge className="ml-1" color="notice">
Outdated
</div>
</Badge>
)}
</div>
</a>
Expand Down Expand Up @@ -460,14 +460,14 @@ export const CommentThreadBlock = ({
<div className="text-sans-semi-md">
<a
href={comment.user.html_url}
className="hover:text-secondary"
className="text-raise hover:text-default"
target="_blank"
rel="noreferrer"
>
{comment.user.login}
</a>
</div>
<div className="ml-1 text-sans-md text-quaternary">
<div className="ml-1 text-sans-md text-tertiary">
<time dateTime={comment.created_at}>
{dayjs(comment.created_at).fromNow()}
</time>
Expand Down
1 change: 1 addition & 0 deletions app/routes/rfd.$slug.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import {
DesktopOutline,
SmallScreenOutline,
Spinner,
useActiveSectionTracking,
useIntersectionObserver,
} from '@oxide/design-system/components/dist'
Expand Down
1 change: 1 addition & 0 deletions app/styles/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
@import '@oxide/design-system/styles/dist/blue.css';
@import '@oxide/design-system/components/dist/asciidoc.css';
@import '@oxide/design-system/components/dist/button.css';
@import '@oxide/design-system/components/dist/spinner.css';

@import './lib/asciidoc.css';
@import './lib/highlight.css';
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@asciidoctor/core": "^3.0.4",
"@floating-ui/react": "^0.17.0",
"@meilisearch/instant-meilisearch": "^0.8.2",
"@oxide/design-system": "^1.7.7--canary.09651fc.0",
"@oxide/design-system": "^1.8.0",
"@oxide/react-asciidoc": "^1.0.2",
"@radix-ui/react-accordion": "^1.1.2",
"@radix-ui/react-dropdown-menu": "^2.0.4",
Expand Down Expand Up @@ -83,6 +83,6 @@
"vitest": "^2.0.3"
},
"engines": {
"node": "^20.0.0"
"node": "^23.0.0"
}
}

0 comments on commit 44ac341

Please sign in to comment.