+ export default styles
+}
diff --git a/packages/ui/index.tsx b/packages/ui/index.tsx
index 36292bbda94..5e59e1a5a0f 100644
--- a/packages/ui/index.tsx
+++ b/packages/ui/index.tsx
@@ -2,29 +2,21 @@
import * as React from 'react'
-// Providers
-
-export * from './src/providers'
-
// Markdown components
export * from './src/lib/Markdown'
-// // GENERAL
+// GENERAL
export * from './src/components/Admonition'
export * from './src/components/Button'
export * from './src/components/Icon'
export * from './src/components/Icon/IconContext'
-export * from './src/components/GlassPanel'
-export * from './src/components/IconPanel'
export * from './src/components/Icon/IconBackground'
-export * from './src/components/ThemeImage'
// DISPLAYS
export * from './src/components/Card'
-export * from './src/components/TweetCard'
export * from './src/components/Badge'
export * from './src/components/Tabs'
export * from './src/components/Alert'
@@ -41,10 +33,7 @@ export * from './src/components/NavMenu'
export * from './src/components/Modal'
export * from './src/components/SidePanel'
-export * from './src/components/ConsentToast'
export * from './src/components/ContextMenu'
-export * from './src/components/ExpandableVideo'
-export * from './src/components/PrivacySettings'
export * from './src/components/PromoToast'
export * from './src/components/Popover'
export * from './src/layout/PortalToast'
@@ -71,9 +60,6 @@ export * from './src/components/Form'
// CMD+K
export * from './src/components/Command'
-// Widgets
-export * from './src/components/CountdownWidget'
-
// layout
export * from './src/components/LoadingLine'
@@ -87,11 +73,8 @@ export * from './src/layout/ai-icon-animation'
export * from './src/lib/utils'
// theme switcher
-export * from './src/components/ThemeProvider/ThemeToggle'
export * from './src/components/ThemeProvider/themes'
-// animated ui
-
// shadcn
export * from './src/components/shadcn/ui/dropdown-menu'
@@ -209,10 +192,6 @@ export { ScrollArea, ScrollBar } from './src/components/shadcn/ui/scroll-area'
export { Separator } from './src/components/shadcn/ui/separator'
-// patterns
-
-export * from './src/patterns/SchemaTableNode'
-
// links
export * from './src/components/TextLink'
diff --git a/packages/ui/src/components/Command/ThemeOptions.tsx b/packages/ui/src/components/Command/ThemeOptions.tsx
index 8e954d34c8c..28e296ff014 100644
--- a/packages/ui/src/components/Command/ThemeOptions.tsx
+++ b/packages/ui/src/components/Command/ThemeOptions.tsx
@@ -2,7 +2,7 @@ import { CommandGroup } from 'cmdk'
import { useCommandMenu } from './CommandMenuProvider'
import ChildItem from './ChildItem'
import { useTheme } from 'next-themes'
-import { Theme, themes } from 'ui'
+import { Theme, themes } from '../ThemeProvider/themes'
const ThemeOptions = ({ isSubItem = false }) => {
const { setIsOpen } = useCommandMenu()
diff --git a/packages/ui/src/components/ConsentToast/ConsentToast.tsx b/packages/ui/src/components/ConsentToast/ConsentToast.tsx
deleted file mode 100644
index 19fc1265e51..00000000000
--- a/packages/ui/src/components/ConsentToast/ConsentToast.tsx
+++ /dev/null
@@ -1,56 +0,0 @@
-import { useBreakpoint } from 'common'
-import { noop } from 'lodash'
-import Link from 'next/link'
-import { Button } from 'ui'
-
-interface ConsentToastProps {
- onAccept: () => void
- onOptOut: () => void
-}
-
-const ConsentToast = ({ onAccept = noop, onOptOut = noop }: ConsentToastProps) => {
- const isMobile = useBreakpoint(639)
-
- return (
-
-
-
- We only collect analytics essential to ensuring smooth operation of our services.{' '}
-
- Learn more
-
-
-
-
-
-
-
-
-
- )
-}
-
-export default ConsentToast
diff --git a/packages/ui/src/components/ConsentToast/index.ts b/packages/ui/src/components/ConsentToast/index.ts
deleted file mode 100644
index d0afb7d9651..00000000000
--- a/packages/ui/src/components/ConsentToast/index.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import ConsentToast from './ConsentToast'
-
-export default ConsentToast
diff --git a/packages/ui/src/components/CountdownWidget/Countdown.tsx b/packages/ui/src/components/CountdownWidget/Countdown.tsx
deleted file mode 100644
index e8394b6128f..00000000000
--- a/packages/ui/src/components/CountdownWidget/Countdown.tsx
+++ /dev/null
@@ -1,35 +0,0 @@
-import React from 'react'
-import Countdown from 'react-countdown'
-import { CountdownWidget } from 'ui'
-
-const CountdownComponent = ({
- date,
- showCard = true,
-}: {
- date: string | number | Date
- showCard?: boolean
-}) => {
- if (!date) return null
-
- const renderer = ({ days, hours, minutes, seconds, completed }: any) => {
- if (completed) {
- // Render a completed state
- return null
- } else {
- // Render countdown
- return (
-
- )
- }
- }
-
- return
-}
-
-export default CountdownComponent
diff --git a/packages/ui/src/components/CountdownWidget/index.ts b/packages/ui/src/components/CountdownWidget/index.ts
deleted file mode 100644
index 0c677d46517..00000000000
--- a/packages/ui/src/components/CountdownWidget/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export { default as CountdownWidget } from './CountdownWidget'
diff --git a/packages/ui/src/components/ExpandableVideo/index.tsx b/packages/ui/src/components/ExpandableVideo/index.tsx
deleted file mode 100644
index 979662ad54b..00000000000
--- a/packages/ui/src/components/ExpandableVideo/index.tsx
+++ /dev/null
@@ -1 +0,0 @@
-export * from './ExpandableVideo'
diff --git a/packages/ui/src/components/GlassPanel/index.tsx b/packages/ui/src/components/GlassPanel/index.tsx
deleted file mode 100644
index 3728536c76b..00000000000
--- a/packages/ui/src/components/GlassPanel/index.tsx
+++ /dev/null
@@ -1 +0,0 @@
-export { default as GlassPanel } from './GlassPanel'
diff --git a/packages/ui/src/components/IconPanel/index.tsx b/packages/ui/src/components/IconPanel/index.tsx
deleted file mode 100644
index d0ad46b1e51..00000000000
--- a/packages/ui/src/components/IconPanel/index.tsx
+++ /dev/null
@@ -1 +0,0 @@
-export { default as IconPanel } from './IconPanel'
diff --git a/packages/ui/src/components/PrivacySettings/index.ts b/packages/ui/src/components/PrivacySettings/index.ts
deleted file mode 100644
index 3ca1b366740..00000000000
--- a/packages/ui/src/components/PrivacySettings/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export { default as PrivacySettings } from './PrivacySettings'
diff --git a/packages/ui/src/components/ThemeImage/index.ts b/packages/ui/src/components/ThemeImage/index.ts
deleted file mode 100644
index 09b99518081..00000000000
--- a/packages/ui/src/components/ThemeImage/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export { default as ThemeImage } from './ThemeImage'
diff --git a/packages/ui/src/components/ThemeProvider/ThemeProvider.tsx b/packages/ui/src/components/ThemeProvider/ThemeProvider.tsx
index 51bc73bc9e7..1fd4fedce9c 100644
--- a/packages/ui/src/components/ThemeProvider/ThemeProvider.tsx
+++ b/packages/ui/src/components/ThemeProvider/ThemeProvider.tsx
@@ -1,7 +1,6 @@
-import React, { createContext, useMemo } from 'react'
+import { createContext } from 'react'
import defaultTheme from '../../lib/theme/defaultTheme'
-import { mergeDeep } from './../../lib/utils'
// import useDarkMode from './utils/useDarkMode'
interface ThemeContextInterface {
@@ -15,52 +14,3 @@ export const ThemeContext = createContext
({
// mode: 'light',
// toggleMode: true,
})
-
-interface Props extends React.HTMLAttributes {
- children: React.ReactNode
- /**
- * Defines the styles used throughout the library
- */
- theme?: object
- /**
- * Defines dark mode as the default theme
- */
- // dark?: boolean
- /**
- * Allows the change of theme, reading user's preferences and saving them
- */
- // usePreferences?: boolean
-}
-
-const ThemeProvider: React.FC = ({
- children,
- theme: customTheme,
- // dark,
- // usePreferences = false,
-}) => {
- const mergedTheme = mergeDeep(defaultTheme, customTheme)
- // const [mode, setMode, toggleMode] = useDarkMode(usePreferences)
-
- // useLayoutEffect(() => {
- // if (dark) {
- // if (setMode != null) {
- // setMode('dark')
- // }
- // document.documentElement.classList.add(`dark`)
- // }
- // }, [dark])
-
- const value = useMemo(
- () => ({
- theme: mergedTheme,
- // mode,
- // toggleMode,
- }),
- []
- )
-
- // console.log('defaultTheme', defaultTheme)
- return {children}
-}
-
-export default ThemeProvider
diff --git a/packages/ui/src/components/ThemeProvider/index.tsx b/packages/ui/src/components/ThemeProvider/index.tsx
index ed7c079a21b..e69de29bb2d 100644
--- a/packages/ui/src/components/ThemeProvider/index.tsx
+++ b/packages/ui/src/components/ThemeProvider/index.tsx
@@ -1 +0,0 @@
-export { default as ThemeProvider } from './ThemeProvider'
diff --git a/packages/ui/src/components/TweetCard/index.tsx b/packages/ui/src/components/TweetCard/index.tsx
deleted file mode 100644
index c02564fc0f1..00000000000
--- a/packages/ui/src/components/TweetCard/index.tsx
+++ /dev/null
@@ -1 +0,0 @@
-export { default as TweetCard } from './TweetCard'
\ No newline at end of file
diff --git a/packages/ui/src/components/shadcn/stories/Card.stories.tsx b/packages/ui/src/components/shadcn/stories/Card.stories.tsx
index 4af6b585e24..07ab40867eb 100644
--- a/packages/ui/src/components/shadcn/stories/Card.stories.tsx
+++ b/packages/ui/src/components/shadcn/stories/Card.stories.tsx
@@ -1,5 +1,6 @@
import { Meta } from '@storybook/react'
import { BellRing, Check } from 'lucide-react'
+import React from 'react'
import { cn } from '../../../lib/utils/cn'
import { Button } from '../ui/button'
import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from '../ui/card'
diff --git a/packages/ui/src/components/shadcn/stories/Form.stories.tsx b/packages/ui/src/components/shadcn/stories/Form.stories.tsx
index 899f4985459..d3bc51943b4 100644
--- a/packages/ui/src/components/shadcn/stories/Form.stories.tsx
+++ b/packages/ui/src/components/shadcn/stories/Form.stories.tsx
@@ -4,11 +4,10 @@ import { zodResolver } from '@hookform/resolvers/zod'
import type { Meta, StoryObj } from '@storybook/react'
import { format } from 'date-fns'
import { CalendarIcon } from 'lucide-react'
+import React from 'react'
import { useForm } from 'react-hook-form'
import * as z from 'zod'
import { cn } from '../../../lib/utils'
-import { Popover, PopoverContent, PopoverTrigger } from '../ui//popover'
-import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../ui//select'
import { Button } from '../ui/button'
import { Calendar } from '../ui/calendar'
import {
@@ -21,6 +20,8 @@ import {
FormMessage,
} from '../ui/form'
import { Input } from '../ui/input'
+import { Popover, PopoverContent, PopoverTrigger } from '../ui/popover'
+import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../ui/select'
import { toast } from '../ui/use-toast'
const meta: Meta = {
diff --git a/packages/ui/src/components/shadcn/stories/Slider.stories.tsx b/packages/ui/src/components/shadcn/stories/Slider.stories.tsx
index 926562d85b1..c747ea2b090 100644
--- a/packages/ui/src/components/shadcn/stories/Slider.stories.tsx
+++ b/packages/ui/src/components/shadcn/stories/Slider.stories.tsx
@@ -1,4 +1,5 @@
import { Meta } from '@storybook/react'
+import React from 'react'
import { cn } from '../../../lib/utils/cn'
import { Slider } from '../ui/slider'
diff --git a/packages/ui/src/layout/banners/LWXCountdownBanner/Countdown.tsx b/packages/ui/src/layout/banners/LWXCountdownBanner/Countdown.tsx
deleted file mode 100644
index e8394b6128f..00000000000
--- a/packages/ui/src/layout/banners/LWXCountdownBanner/Countdown.tsx
+++ /dev/null
@@ -1,35 +0,0 @@
-import React from 'react'
-import Countdown from 'react-countdown'
-import { CountdownWidget } from 'ui'
-
-const CountdownComponent = ({
- date,
- showCard = true,
-}: {
- date: string | number | Date
- showCard?: boolean
-}) => {
- if (!date) return null
-
- const renderer = ({ days, hours, minutes, seconds, completed }: any) => {
- if (completed) {
- // Render a completed state
- return null
- } else {
- // Render countdown
- return (
-
- )
- }
- }
-
- return
-}
-
-export default CountdownComponent
diff --git a/packages/ui/src/layout/banners/LWXCountdownBanner/LWXBannerBg.tsx b/packages/ui/src/layout/banners/LWXCountdownBanner/LWXBannerBg.tsx
deleted file mode 100644
index 5f12e502353..00000000000
--- a/packages/ui/src/layout/banners/LWXCountdownBanner/LWXBannerBg.tsx
+++ /dev/null
@@ -1,224 +0,0 @@
-export default function LWXBannerBg({ className }: { className?: string }) {
- return (
-
-
-
- )
-}
diff --git a/packages/ui/src/layout/banners/LWXCountdownBanner/LWXCountdownBanner.tsx b/packages/ui/src/layout/banners/LWXCountdownBanner/LWXCountdownBanner.tsx
deleted file mode 100644
index 8da57e90f6e..00000000000
--- a/packages/ui/src/layout/banners/LWXCountdownBanner/LWXCountdownBanner.tsx
+++ /dev/null
@@ -1,49 +0,0 @@
-import { useRouter } from 'next/router'
-import Image from 'next/image'
-import { Button, cn } from 'ui'
-
-export function LWXCountdownBanner() {
- const { pathname } = useRouter()
- const isHomePage = pathname === '/'
- const isLaunchWeekPage = pathname === '/launch-week'
- const isLaunchWeekSection = pathname.includes('launch-week')
- const LWXLogo =
- 'https://obuldanrptloktxcffvn.supabase.co/storage/v1/object/public/images/lwx/assets/lwx_logo.svg?t=2023-11-22T17%3A45%3A52.077Z'
-
- if (isLaunchWeekPage || isHomePage) return null
-
- return (
-
-
-
-
-
11-15 Dec
-
-
-
-
- )
-}
-
-export default LWXCountdownBanner
diff --git a/packages/ui/src/layout/banners/LWXCountdownBanner/VideoPreview.tsx b/packages/ui/src/layout/banners/LWXCountdownBanner/VideoPreview.tsx
deleted file mode 100644
index e35ae0b4a0f..00000000000
--- a/packages/ui/src/layout/banners/LWXCountdownBanner/VideoPreview.tsx
+++ /dev/null
@@ -1,22 +0,0 @@
-import Image from 'next/image'
-
-const VideoPreview = () => (
-
-)
-
-export default VideoPreview
diff --git a/packages/ui/src/layout/banners/LWXCountdownBanner/index.ts b/packages/ui/src/layout/banners/LWXCountdownBanner/index.ts
deleted file mode 100644
index b3babd6ba41..00000000000
--- a/packages/ui/src/layout/banners/LWXCountdownBanner/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export { LWXCountdownBanner } from './LWXCountdownBanner'
diff --git a/packages/ui/src/layout/banners/index.tsx b/packages/ui/src/layout/banners/index.tsx
index d5f3f4322fd..8ba69528077 100644
--- a/packages/ui/src/layout/banners/index.tsx
+++ b/packages/ui/src/layout/banners/index.tsx
@@ -1,4 +1,3 @@
export { default as Announcement } from './Announcement'
-export { default as LW8CountdownBanner } from './LW8CountdownBanner/LW8CountdownBanner'
-export { default as LWXCountdownBanner } from './LWXCountdownBanner/LWXCountdownBanner'
export { default as IPV4Banner } from './IPV4Banner'
+export { default as LW8CountdownBanner } from './LW8CountdownBanner/LW8CountdownBanner'
diff --git a/packages/ui/src/lib/Hooks.tsx b/packages/ui/src/lib/Hooks.tsx
index 828bd2583e2..a68fa4ce894 100644
--- a/packages/ui/src/lib/Hooks.tsx
+++ b/packages/ui/src/lib/Hooks.tsx
@@ -1,7 +1,4 @@
-import { LOCAL_STORAGE_KEYS, handlePageTelemetry, isBrowser, useTelemetryProps } from 'common'
-import { useEffect, useRef, useState } from 'react'
-import { toast } from 'react-hot-toast'
-import ConsentToast from '../components/ConsentToast/ConsentToast'
+import { useEffect } from 'react'
/*
reference https://usehooks.com/useOnClickOutside/
@@ -38,77 +35,3 @@ function useOnClickOutside(ref: any, handler: Function) {
}
export { useOnClickOutside }
-
-// Use with PortalToast from 'ui/src/layout/PortalToast'
-export const useConsent = () => {
- const { TELEMETRY_CONSENT } = LOCAL_STORAGE_KEYS
- const consentToastId = useRef()
- const isClient = typeof window !== 'undefined'
- if (!isClient) return {}
- const telemetryProps = useTelemetryProps()
- const [consentValue, setConsentValue] = useState(
- localStorage?.getItem(TELEMETRY_CONSENT)
- )
-
- const handleConsent = (value: 'true' | 'false') => {
- if (!isClient) return
- setConsentValue(value)
- localStorage.setItem(TELEMETRY_CONSENT, value)
-
- if (consentToastId.current) toast.dismiss(consentToastId.current)
- if (value === 'true')
- handlePageTelemetry(process.env.NEXT_PUBLIC_API_URL!, location.pathname, telemetryProps)
- }
-
- useEffect(() => {
- const handleSetLocalStorage = () => {
- if (localStorage?.getItem(TELEMETRY_CONSENT)) toast.dismiss(consentToastId.current)
- }
-
- window.addEventListener('storage', handleSetLocalStorage)
- return window.removeEventListener('storage', () => null)
- }, [])
-
- useEffect(() => {
- if (isClient && consentValue === null) {
- consentToastId.current = toast(
- handleConsent('true')}
- onOptOut={() => handleConsent('false')}
- />,
- {
- id: 'consent-toast',
- position: 'bottom-right',
- duration: Infinity,
- className:
- '!w-screen !-m-4 !border-t !rounded-none !max-w-none !bg-overlay !text sm:!m-0 sm:!rounded-lg sm:!w-auto sm:!max-w-[400px] sm:border',
- }
- )
- }
- }, [consentValue])
-
- return { consentValue, setConsentValue, hasAcceptedConsent: consentValue === 'true' }
-}
-
-export const useConsentValue = (KEY_NAME: string) => {
- if (!isBrowser) return {}
-
- const telemetryProps = useTelemetryProps()
- const [consentValue, setConsentValue] = useState(localStorage?.getItem(KEY_NAME))
-
- const handleConsent = (value: 'true' | 'false') => {
- if (!isBrowser) return
- setConsentValue(value)
- localStorage.setItem(KEY_NAME, value)
- window.dispatchEvent(new Event('storage'))
- if (value === 'true')
- handlePageTelemetry(process.env.NEXT_PUBLIC_API_URL!, location.pathname, telemetryProps)
- }
-
- return {
- consentValue,
- setConsentValue,
- hasAccepted: consentValue === 'true',
- handleConsent,
- }
-}
diff --git a/packages/ui/src/providers/Theme.tsx b/packages/ui/src/providers/Theme.tsx
deleted file mode 100644
index b7d2bba7bf0..00000000000
--- a/packages/ui/src/providers/Theme.tsx
+++ /dev/null
@@ -1,44 +0,0 @@
-import * as React from 'react'
-
-interface UseThemeProps {
- isDarkMode?: boolean
- toggleTheme: () => void
-}
-
-interface ThemeProviderProps {
- children?: any
-}
-
-export const ThemeContext = React.createContext({
- isDarkMode: true,
- toggleTheme: () => {},
-})
-
-export const useTheme = () => React.useContext(ThemeContext)
-
-export const ThemeProvider = ({ children }: ThemeProviderProps) => {
- const [isDarkMode, setIsDarkMode] = React.useState(false)
-
- React.useEffect(() => {
- const key = localStorage.getItem('supabaseDarkMode')
- // Default to dark mode if no preference config
- setIsDarkMode(!key || key === 'true')
- }, [])
-
- const toggleTheme = () => {
- setIsDarkMode(!isDarkMode)
- }
-
- return (
- <>
-
- {children}
-
- >
- )
-}
diff --git a/packages/ui/src/providers/index.tsx b/packages/ui/src/providers/index.tsx
deleted file mode 100644
index 9590e591001..00000000000
--- a/packages/ui/src/providers/index.tsx
+++ /dev/null
@@ -1 +0,0 @@
-export * from './Theme'