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
55 changes: 55 additions & 0 deletions app/ui/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
*
* Copyright Oxide Computer Company
*/
import useInterval from './lib/use-interval'
import useTimeout from './lib/use-timeout'

import './styles/index.css'

export { useInterval, useTimeout }

export * from './lib/ActionMenu'
export * from './lib/AuthCodeInput'
export * from './lib/Badge'
export * from './lib/Button'
export * from './lib/Checkbox'
export * from './lib/CopyToClipboard'
export * from './lib/DateRangePicker'
export * from './lib/Divider'
export * from './lib/DropdownMenu'
export * from './lib/FileInput'
export * from './lib/EmptyMessage'
export * from './lib/FieldLabel'

export * from './lib/Identicon'
export * from './lib/Message'
export * from './lib/Listbox'
export * from './lib/Message'
export * from './lib/Modal'
export * from './lib/ModalLinks'
export * as MiniTable from './lib/MiniTable'
export * from './lib/NumberInput'
export * from './lib/PageHeader'
export * from './lib/Pagination'
export * from './lib/Progress'
export * from './lib/PropertiesTable'
export * from './lib/RadioGroup'
export * from './lib/Radio'
export * from './lib/ResourceMeter'
export * from './lib/SettingsGroup'
export * from './lib/SideModal'
export * from './lib/SkipLink'
export * from './lib/Spinner'
export * from './lib/Table'
export * from './lib/Tabs'
export * from './lib/TextInput'
export * from './lib/Toast'
export * from './lib/Tooltip'
export * from './lib/Truncate'
export * from './util/wrap'

export * from '@oxide/design-system/icons/react'
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
*/
import { useState } from 'react'

import { Button } from '../button/Button'
import { ActionMenu } from './ActionMenu'
import { Button } from './Button'

const makeItem = (value: string) => ({
value,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import React, { useState } from 'react'
import { Close12Icon } from '@oxide/design-system/icons/react'
import { classed, groupBy } from '@oxide/util'

import { useSteppedScroll } from '../hooks/use-stepped-scroll'
import { useSteppedScroll } from './use-stepped-scroll'

export interface QuickActionItem {
value: string
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* Copyright Oxide Computer Company
*/
import { Section } from '../../util/story-section'
import { Section } from '../util/story-section'
import { Badge, badgeColors, type BadgeColor, type BadgeVariant } from './Badge'

export const All = () => {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/
import { flattenChildren } from '@oxide/util'

import { Button, type ButtonProps } from '../button/Button'
import { Button, type ButtonProps } from './Button'

export interface BulkActionMenuProps {
selectedCount: number
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* Copyright Oxide Computer Company
*/
import { Section } from '../../util/story-section'
import { Section } from '../util/story-section'
import { Button, variants } from './Button'

// TODO: sizes (I guess)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import cn from 'classnames'
import type { ReactElement } from 'react'
import { Link } from 'react-router-dom'

import { Button, buttonStyle } from '../button/Button'
import { Button, buttonStyle } from './Button'

const buttonStyleProps = { variant: 'ghost', size: 'sm', color: 'secondary' } as const

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/
import { classed } from '@oxide/util'

import { Table as BigTable } from '../table/Table'
import { Table as BigTable } from './Table'

import './mini-table.css'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
*/
import { useState } from 'react'

import { Button } from '../button/Button'
import { FieldLabel } from '../field-label/FieldLabel'
import { ModalLink, ModalLinks } from '../ModalLinks'
import { TextInput, TextInputHint } from '../text-input/TextInput'
import { Button } from './Button'
import { FieldLabel } from './FieldLabel'
import { Modal } from './Modal'
import { ModalLink, ModalLinks } from './ModalLinks'
import { TextInput, TextInputHint } from './TextInput'

export function Default() {
const [isOpen, setIsOpen] = useState(false)
Expand Down
2 changes: 1 addition & 1 deletion libs/ui/lib/modal/Modal.tsx → app/ui/lib/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import React, { createContext, forwardRef, useContext, useId } from 'react'
import { Close12Icon } from '@oxide/design-system/icons/react'
import { classed } from '@oxide/util'

import { Button } from '../button/Button'
import { Button } from './Button'

const ModalContext = createContext(false)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/
import cn from 'classnames'

import { ariaLabel, type AriaLabel } from '../../util/aria'
import { ariaLabel, type AriaLabel } from '../util/aria'

export type ProgressProps = {
value: number // always out of 100
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import type { ReactNode } from 'react'

import { invariant, isOneOf } from '@oxide/util'

import { Badge } from '../badge/Badge'
import { Badge } from './Badge'

import './properties-table.css'

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* Copyright Oxide Computer Company
*/
import { Radio, RadioCard } from '../radio/Radio'
import { Radio, RadioCard } from './Radio'
import { RadioGroup } from './RadioGroup'

export const Default = () => (
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import cn from 'classnames'

import { Tooltip } from '../tooltip/Tooltip'
import { Tooltip } from './Tooltip'

type ResourceMeterProps = {
value: number
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
*/
import { useState } from 'react'

import { Button } from '../button/Button'
import { ModalLink, ModalLinks } from '../ModalLinks'
import { Button } from './Button'
import { ModalLink, ModalLinks } from './ModalLinks'
import { SideModal } from './SideModal'

// TODO: styling on modal mostly doesn't work
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* Copyright Oxide Computer Company
*/
import { Section } from '../../util/story-section'
import { Section } from '../util/story-section'
import { Tag, tagColors, type TagColor, type TagVariant } from './Tag'

export const Default = () => {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import { animated, Globals, useTransition } from '@react-spring/web'
import cn from 'classnames'

import useTimeout from '../hooks/use-timeout'
import useTimeout from './use-timeout'

export interface TimeoutIndicatorProps {
timeout: number
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions libs/ui/lib/toast/Toast.tsx → app/ui/lib/Toast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import {
Warning12Icon,
} from '@oxide/design-system/icons/react'

import { TimeoutIndicator } from '../timeout-indicator/TimeoutIndicator'
import { Truncate } from '../truncate/Truncate'
import { TimeoutIndicator } from './TimeoutIndicator'
import { Truncate } from './Truncate'

type Variant = 'success' | 'error' | 'info'

Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions libs/ui/lib/truncate/Truncate.tsx → app/ui/lib/Truncate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
* Copyright Oxide Computer Company
*/

import { CopyToClipboard } from '../copy-to-clipboard/CopyToClipboard'
import { Tooltip } from '../tooltip/Tooltip'
import { CopyToClipboard } from './CopyToClipboard'
import { Tooltip } from './Tooltip'

type TruncatePosition = 'middle' | 'end'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* Copyright Oxide Computer Company
*/
import { Section } from '../../util/story-section'
import { Section } from '../util/story-section'

export const Default = () => (
<>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
55 changes: 0 additions & 55 deletions libs/ui/index.ts

This file was deleted.

2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@oxide/gen/*": ["libs/api/__generated__/*"],
"@oxide/api": ["libs/api/index.ts"],
"@oxide/api-mocks": ["libs/api-mocks/index.ts"],
"@oxide/ui": ["libs/ui/index.ts"],
"@oxide/ui": ["app/ui/index.ts"],
"@oxide/util": ["libs/util/index.ts"],
"@oxide/table": ["app/table/index.ts"]
},
Expand Down