Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ jobs:
with:
node-version: 22.x
cache: npm
- run: npm install
- run: npm install -g npm@latest
- run: npm install

- name: Build
run: npm run build
Expand Down
33 changes: 19 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,24 +71,33 @@ Subsequently, you can use it as follows:

This is type-checked, and will throw an error if the corresponding icon doesn't exist.

## AsciiDoc Components
## Usage

This repository includes various
[`@oxide/react-asciidoc`](https://github.com/oxidecomputer/react-asciidoc) components that
are reused across multiple internal sites such as docs.oxide.computer, oxide.computer, and
eventually the rfd.shared.oxide.computer (when its conversion to `react-asciidoc` is
complete). The associated stylesheet `asciidoc.css` is also included.
This package provides two main entry points:

They can be imported and used as follows:
### UI Components (`@oxide/design-system/ui`)

Basic UI components like Badge, Button, Checkbox, Listbox, Spinner, and Tabs. These are
lightweight components without dependencies on AsciiDoc processing.

```ts
import { AsciiDocBlocks } from '@oxide/design-system/components/dist'
import { Button, Badge } from '@oxide/design-system/ui'
```

### AsciiDoc Components (`@oxide/design-system/asciidoc`)

[`@oxide/react-asciidoc`](https://github.com/oxidecomputer/react-asciidoc) components for
rendering AsciiDoc content, reused across docs.oxide.computer, oxide.computer, and
rfd.shared.oxide.computer. The associated stylesheet `asciidoc.css` is also included.

```ts
import { AsciiDocBlocks } from '@oxide/design-system/asciidoc'

export const opts: Options = {
overrides: {
admonition: AsciiDocBlocks.Admonition,
table: AsciiDocBlocks.Table,
listing: AsciiDocBlocks.Listing,
section: AsciiDocBlocks.Section,
},
}
```
Expand All @@ -97,11 +106,7 @@ export const opts: Options = {
<Asciidoc content={document} options={opts} />
```

## React Components

The full UI library is housed within the web console repo. The components included in this
package are those reused across other Oxide sites. When using them, remember to also import
their associated stylesheets.
When using these components, remember to also import their associated stylesheets.

Be sure to add the components path to the `tailwind.config.js` to ensure the appropriate
styles are included. For example:
Expand Down
10 changes: 0 additions & 10 deletions components/src/index.ts

This file was deleted.

3 changes: 2 additions & 1 deletion components/src/ui/listbox/Listbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import { flip, FloatingPortal, offset, size, useFloating } from '@floating-ui/re
import { Listbox as Select } from '@headlessui/react'
import cn from 'classnames'
import type { ReactNode } from 'react'
import { SpinnerLoader } from '~/src'

import { SpinnerLoader } from '../'

export type ListboxItem<Value extends string = string> = {
value: Value
Expand Down
4 changes: 3 additions & 1 deletion components/src/ui/spinner/Spinner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,12 @@ type Props = {
minTime?: number
}

type Timeout = ReturnType<typeof setTimeout>

/** Loading spinner that shows for a minimum of `minTime` */
export const SpinnerLoader = ({ isLoading, children = null, minTime = 500 }: Props) => {
const [isVisible, setIsVisible] = useState(isLoading)
const hideTimeout = useRef<NodeJS.Timeout | null>(null)
const hideTimeout = useRef<Timeout | null>(null)
const loadingStartTime = useRef<number>(0)

useEffect(() => {
Expand Down
46 changes: 27 additions & 19 deletions package-lock.json

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

Loading