Skip to content

Commit

Permalink
chore: update @openlabs/theme
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastiandotdev committed May 31, 2024
1 parent d266119 commit 7baad86
Show file tree
Hide file tree
Showing 16 changed files with 45 additions and 224 deletions.
5 changes: 1 addition & 4 deletions apps/playground/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { Metadata } from 'next'
import { OpenUIProvider } from '@openlabs/ui'
import { Inter } from 'next/font/google'
import './globals.css'

Expand All @@ -18,9 +17,7 @@ export default function RootLayout({
return (
<html lang="en">
<body className={inter.className}>
<OpenUIProvider>
{children}
</OpenUIProvider>
{children}
</body>
</html>
)
Expand Down
2 changes: 2 additions & 0 deletions apps/playground/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ import { Button } from '@openlabs/ui'

export default function Home() {
return (

<main className="flex flex-col items-center justify-center w-screen h-screen">
<Button>Play</Button>
</main>

)
}
1 change: 1 addition & 0 deletions apps/playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"lint": "next lint"
},
"dependencies": {
"@openlabs/theme": "workspace:*",
"@openlabs/ui": "workspace:*",
"next": "14.2.3",
"react": "^18",
Expand Down
2 changes: 1 addition & 1 deletion apps/playground/tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Config } from 'tailwindcss'
import { openui } from '@openlabs/ui'
import { openui } from '@openlabs/theme'

const config: Config = {
content: [
Expand Down
6 changes: 4 additions & 2 deletions packages/system/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,14 @@
"react": ">=18",
"react-dom": ">=18"
},
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@openlabs/tsconfig": "workspace:*",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"tsup": "^8.0.2",
"typescript": "^5.4.5"
}
Expand Down
52 changes: 0 additions & 52 deletions packages/system/src/context.ts

This file was deleted.

8 changes: 0 additions & 8 deletions packages/system/src/create-provider.ts

This file was deleted.

26 changes: 3 additions & 23 deletions packages/system/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,3 @@
export type {
As,
DOMElement,
DOMElements,
CapitalizedDOMElements,
DOMAttributes,
OmitCommonProps,
RightJoinProps,
MergeWithAs,
InternalForwardRefRenderFunction,
PropsOf,
Merge,
HTMLOpenUIProps,
PropGetter,
} from './types'

export { forwardRef, isOpenUIEl, toIterator } from './utils'

export type { OpenUIProviderProps } from './provider'
export type { ProviderContextProps } from './create-provider'

export { OpenUIProvider } from './provider'
export { ProviderContext, useProviderContext } from './create-provider'
export type { OpenUIContextType } from './openui-context'
export { OpenUIContext, OpenUIProvider } from './openui-context'
export { useOpenUIContext } from './use-context'
10 changes: 10 additions & 0 deletions packages/system/src/openui-context.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import type { ReactNode } from 'react'
import { createContext } from 'react'

export interface OpenUIContextType {}

export const OpenUIContext = createContext<OpenUIContextType | null>(null)

export function OpenUIProvider({ children }: { children: ReactNode }) {
return <OpenUIContext.Provider value={{}}>{children}</OpenUIContext.Provider>
}
14 changes: 0 additions & 14 deletions packages/system/src/provider.tsx

This file was deleted.

65 changes: 0 additions & 65 deletions packages/system/src/types.ts

This file was deleted.

11 changes: 11 additions & 0 deletions packages/system/src/use-context.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { useContext } from 'react'
import type { OpenUIContextType } from './openui-context'
import { OpenUIContext } from './openui-context'

export function useOpenUIContext(): OpenUIContextType {
const context = useContext(OpenUIContext)
if (!context) {
throw new Error('useOpenUIContext must be used within a OpenUIProvider')
}
return context
}
42 changes: 0 additions & 42 deletions packages/system/src/utils.ts

This file was deleted.

2 changes: 0 additions & 2 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
},
"scripts": {
"compile": "tsup --dts --watch",
"prebuild": "node ./build.mjs",
"build": "tsup --dts",
"clean": "rm -rf .turbo node_modules dist"
},
Expand All @@ -40,7 +39,6 @@
"react-dom": ">=18"
},
"dependencies": {
"@openlabs/system": "workspace:*",
"@openlabs/theme": "workspace:*",
"@radix-ui/react-accordion": "^1.1.2",
"@radix-ui/react-alert-dialog": "^1.0.5",
Expand Down
4 changes: 2 additions & 2 deletions packages/ui/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export * from '@openlabs/theme'
export * from '@openlabs/system'
'use client'

export * from './components/accordion'
export * from './components/alert'
export * from './components/aspect-ratio'
Expand Down
19 changes: 10 additions & 9 deletions pnpm-lock.yaml

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

0 comments on commit 7baad86

Please sign in to comment.