Skip to content

Commit

Permalink
move classed into @oxide/util
Browse files Browse the repository at this point in the history
  • Loading branch information
david-crespo committed Jan 7, 2022
1 parent bd3604a commit 4ffc54c
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 20 deletions.
2 changes: 1 addition & 1 deletion app/layouts/helpers.tsx
@@ -1,5 +1,5 @@
import './helpers.css'
import { classed } from '@oxide/ui'
import { classed } from '@oxide/util'

export const PageContainer = classed.div`ox-page-container`
export const Sidebar = classed.div`ox-sidebar`
Expand Down
3 changes: 2 additions & 1 deletion app/pages/ToastTestPage.tsx
@@ -1,6 +1,7 @@
import { Button, classed, Comment16Icon, Success16Icon } from '@oxide/ui'
import { Button, Comment16Icon, Success16Icon } from '@oxide/ui'
import React, { useState } from 'react'
import { useToast } from '../hooks'
import { classed } from '@oxide/util'

const useCounter = (initialValue: number): [number, () => void] => {
const [value, setValue] = useState(initialValue)
Expand Down
2 changes: 1 addition & 1 deletion app/pages/project/instances/create/InstancesCreatePage.tsx
Expand Up @@ -4,7 +4,6 @@ import cn from 'classnames'
import { Formik, Form } from 'formik'

import {
classed,
Button,
PageHeader,
PageTitle,
Expand All @@ -19,6 +18,7 @@ import {
FieldTitle,
Badge,
} from '@oxide/ui'
import { classed } from '@oxide/util'
import { useApiMutation } from '@oxide/api'
import { getServerError } from '../../../../util/errors'
import { INSTANCE_SIZES } from './instance-types'
Expand Down
2 changes: 0 additions & 2 deletions libs/ui/index.ts
Expand Up @@ -22,5 +22,3 @@ export * from './lib/tabs/Tabs'
export * from './lib/table/Table'
export * from './lib/tooltip/Tooltip'
export * from './lib/toast/Toast'

export * from './util/classed'
2 changes: 1 addition & 1 deletion libs/ui/lib/PageHeader.tsx
Expand Up @@ -2,7 +2,7 @@ import type { ReactElement } from 'react'
import { cloneElement } from 'react'
import React from 'react'

import { classed } from '../util/classed'
import { classed } from '@oxide/util'

export const PageHeader = classed.header`flex items-center justify-between mb-16 mt-4`

Expand Down
2 changes: 1 addition & 1 deletion libs/ui/lib/checkbox/Checkbox.tsx
@@ -1,7 +1,7 @@
import { Checkmark12Icon } from '@oxide/ui'
import React from 'react'

import { classed } from '../../util/classed'
import { classed } from '@oxide/util'

const Check = () => (
<Checkmark12Icon className="absolute w-3 h-2.5 left-0.5 top-0.5 fill-current text-green-500" />
Expand Down
2 changes: 1 addition & 1 deletion libs/ui/lib/radio-group/RadioGroup.tsx
Expand Up @@ -43,7 +43,7 @@
import React from 'react'
import cn from 'classnames'

import { classed } from '../../util/classed'
import { classed } from '@oxide/util'

export const RadioGroupHint = classed.p`text-base text-gray-100 font-sans font-light max-w-3xl`

Expand Down
14 changes: 2 additions & 12 deletions libs/ui/lib/side-modal/SideModal.tsx
Expand Up @@ -5,7 +5,7 @@ import { Button } from '../button/Button'
import { pluckFirstOfType } from '@oxide/util'
import type { ChildrenProp } from '@oxide/util'
import { Close12Icon } from '../icons'
import cn from 'classnames'
import { classed } from '@oxide/util'

export interface SideModalProps extends DialogProps, ChildrenProp {
id: string
Expand Down Expand Up @@ -52,17 +52,7 @@ export function SideModal({
)
}

SideModal.Section = ({
children,
className,
}: {
children: React.ReactNode
className?: string
}) => (
<div className={cn('p-8 space-y-6 border-gray-400', className)}>
{children}
</div>
)
SideModal.Section = classed.div`p-8 space-y-6 border-gray-400`

SideModal.Docs = ({ children }: ChildrenProp) => (
<SideModal.Section>
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions libs/util/index.ts
@@ -1,3 +1,4 @@
export * from './classed'
export * from './str'
export * from './invariant'
export * from './object'
Expand Down

0 comments on commit 4ffc54c

Please sign in to comment.