Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

chore: migrate from deprecated `Accordion` to new shadcn components (#46103)

Gildas Garcia082c2546d2cc
diff --git a/apps/docs/components/Navigation/NavigationMenu/GlobalMobileMenu.tsx b/apps/docs/components/Navigation/NavigationMenu/GlobalMobileMenu.tsx
index 7faeb2db786..e5c9d6d27d5 100644
--- a/apps/docs/components/Navigation/NavigationMenu/GlobalMobileMenu.tsx
+++ b/apps/docs/components/Navigation/NavigationMenu/GlobalMobileMenu.tsx
@@ -1,3 +1,5 @@
+import { getCustomContent } from '~/lib/custom-content/getCustomContent'
+import { useIsLoggedIn, useIsUserLoading } from 'common'
import { AnimatePresence, domAnimation, LazyMotion, m } from 'framer-motion'
import { X } from 'lucide-react'
import Image from 'next/image'
@@ -5,12 +7,16 @@ import Link from 'next/link'
import { usePathname } from 'next/navigation'
import { Dispatch, Fragment, SetStateAction, useEffect } from 'react'
import { useKey } from 'react-use'
-
-import { useIsLoggedIn, useIsUserLoading } from 'common'
-import { Accordion, Button, cn } from 'ui'
+import {
+ Accordion_Shadcn_,
+ AccordionContent_Shadcn_,
+ AccordionItem_Shadcn_,
+ AccordionTrigger_Shadcn_,
+ Button,
+ cn,
+} from 'ui'
import { ThemeToggle } from 'ui-patterns/ThemeToggle'
-import { getCustomContent } from '~/lib/custom-content/getCustomContent'
import type { DropdownMenuItem } from '../Navigation.types'
import { MenuItem, useActiveMenuLabel } from './GlobalNavigationMenu'
import { GLOBAL_MENU_ITEMS } from './NavigationMenu.constants'
@@ -35,68 +41,59 @@ const itemClassName =
const AccordionMenuItem = ({ section }: { section: DropdownMenuItem[] }) => {
const activeLabel = useActiveMenuLabel(GLOBAL_MENU_ITEMS)
- return (
- <m.div
- variants={listItem}
- className="border-b border-muted [&>div]:rounded-none! [&_div[data-state=open]>div]:py-1"
- key={section[0].label}
- >
- {section[0].menuItems ? (
- <Accordion.Item
- header={section[0].label}
- id={section[0].label}
- className={cn(
- 'relative',
- activeLabel === section[0].label && 'text-foreground!',
- itemClassName
- )}
- >
- {section[0].menuItems?.map((menuItem, menuItemIndex) => (
- <Fragment key={`desktop-docs-menu-section-${menuItemIndex}`}>
- {menuItem
- .filter((item) => item.enabled !== false)
- .map((item) =>
- !item.href ? (
- <div className="font-mono tracking-wider flex items-center text-foreground-muted text-xs uppercase rounded-md p-2 leading-none">
- {item.label}
- </div>
- ) : (
- <MenuItem
- href={item.href}
- title={item.label}
- community={item.community}
- icon={item.icon}
- />
- )
- )}
- </Fragment>
- ))}
- </Accordion.Item>
- ) : (
- <Link
- href={section[0].href || '#'}
- className={cn(activeLabel === section[0].label && 'text-foreground!', itemClassName)}
- >
- {section[0].label}
- </Link>
+ return section[0].menuItems ? (
+ <AccordionItem_Shadcn_
+ value={section[0].label}
+ className={cn(
+ 'relative',
+ activeLabel === section[0].label && 'text-foreground!',
+ itemClassName
)}
- </m.div>
+ >
+ <AccordionTrigger_Shadcn_ className="py-1">{section[0].label}</AccordionTrigger_Shadcn_>
+ <AccordionContent_Shadcn_>
+ {section[0].menuItems?.map((menuItem, menuItemIndex) => (
+ <Fragment key={`desktop-docs-menu-section-${menuItemIndex}`}>
+ {menuItem
+ .filter((item) => item.enabled !== false)
+ .map((item) =>
+ !item.href ? (
+ <div
+ key={item.label}
+ className="font-mono tracking-wider flex items-center text-foreground-muted text-xs uppercase rounded-md p-2 leading-none"
+ >
+ {item.label}
+ </div>
+ ) : (
+ <MenuItem
+ key={item.label}
+ href={item.href}
+ title={item.label}
+ community={item.community}
+ icon={item.icon}
+ />
+ )
+ )}
+ </Fragment>
+ ))}
+ </AccordionContent_Shadcn_>
+ </AccordionItem_Shadcn_>
+ ) : (
+ <Link
+ href={section[0].href || '#'}
+ className={cn(activeLabel === section[0].label && 'text-foreground!', itemClassName)}
+ >
+ {section[0].label}
+ </Link>
)
}
const Menu = () => (
- <Accordion
- type="default"
- openBehaviour="multiple"
- size="small"
- className="space-y-1 mt-2.5"
- justified
- chevronAlign="right"
- >
- {GLOBAL_MENU_ITEMS.filter((section) => section[0].enabled !== false).map((section) => (
- <AccordionMenuItem section={section} />
+ <Accordion_Shadcn_ type="multiple" className="space-y-1 mt-2.5">
+ {GLOBAL_MENU_ITEMS.filter((section) => section[0].enabled !== false).map((section, index) => (
+ <AccordionMenuItem key={index} section={section} />
))}
- </Accordion>
+ </Accordion_Shadcn_>
)
interface Props {
open: boolean
diff --git a/apps/docs/components/Navigation/NavigationMenu/GlobalNavigationMenu.tsx b/apps/docs/components/Navigation/NavigationMenu/GlobalNavigationMenu.tsx
index f323b7737a7..df697cb5b6d 100644
--- a/apps/docs/components/Navigation/NavigationMenu/GlobalNavigationMenu.tsx
+++ b/apps/docs/components/Navigation/NavigationMenu/GlobalNavigationMenu.tsx
@@ -1,8 +1,8 @@
'use client'
-import React, { FC, Fragment, useEffect, useState } from 'react'
import Link from 'next/link'
import { usePathname } from 'next/navigation'
+import React, { FC, Fragment, useEffect, useState } from 'react'
import {
Badge,
cn,
@@ -170,7 +170,7 @@ export const MenuItem = React.forwardRef<
ref={ref}
className={cn(
'group/menu-item flex items-center gap-2',
- 'w-full flex h-8 items-center text-foreground-light text-sm hover:text-foreground select-none rounded-md p-2 leading-none no-underline outline-hidden! focus-visible:ring-2 focus-visible:ring-foreground-lighter focus-visible:text-foreground',
+ 'w-full flex h-8 items-center text-foreground-light text-sm hover:text-foreground select-none rounded-md py-2 leading-none no-underline outline-hidden! focus-visible:ring-2 focus-visible:ring-foreground-lighter focus-visible:text-foreground',
className
)}
{...props}
diff --git a/apps/docs/features/ui/Accordion.tsx b/apps/docs/features/ui/Accordion.tsx
index dea771bb5a4..1e74b407504 100644
--- a/apps/docs/features/ui/Accordion.tsx
+++ b/apps/docs/features/ui/Accordion.tsx
@@ -1,13 +1,79 @@
'use client'
-import { Accordion as AccordionPrimitive } from 'ui'
+import React, { ComponentProps, useState } from 'react'
+import {
+ Accordion_Shadcn_,
+ AccordionContent_Shadcn_,
+ AccordionItem_Shadcn_,
+ AccordionTrigger_Shadcn_,
+ cn,
+} from 'ui'
-/**
- * This makes the component work in MDX files, which otherwise would error on
- * "trying to dot into a Client Component".
- */
+type Type = 'default' | 'bordered'
+type Align = 'left' | 'right'
-const Accordion = AccordionPrimitive
-const AccordionItem = AccordionPrimitive.Item
+type BaseAccordionProps = ComponentProps<typeof Accordion_Shadcn_>
-export { Accordion, AccordionItem }
+export interface AccordionProps {
+ children?: React.ReactNode
+ className?: string
+ defaultActiveId?: (string | number)[]
+ onChange?: (item: string | string[]) => void
+ openBehaviour: 'single' | 'multiple'
+ type?: Type
+ defaultValue?: string | string[] | undefined
+ justified?: Boolean
+ chevronAlign?: Align
+}
+
+export function Accordion({
+ children,
+ className,
+ onChange,
+ openBehaviour = 'multiple',
+ defaultValue = undefined,
+ // All props below are ignored but kept to avoid impacting all docs pages
+ type = 'default',
+ justified = false,
+ chevronAlign = 'right',
+}: AccordionProps) {
+ return (
+ // @ts-expect-error: This is because the Radix component has 2 interfaces discriminated by its type prop. Safe to ignore
+ <Accordion_Shadcn_
+ type={openBehaviour}
+ onValueChange={onChange}
+ defaultValue={defaultValue}
+ className={className}
+ >
+ {children}
+ </Accordion_Shadcn_>
+ )
+}
+
+interface ItemProps {
+ children?: React.ReactNode
+ className?: string
+ header: React.ReactNode
+ id: string
+ icon?: React.ReactNode
+ disabled?: boolean
+}
+
+export function AccordionItem({ children, className, header, id, disabled }: ItemProps) {
+ const [open, setOpen] = useState(false)
+
+ return (
+ <AccordionItem_Shadcn_
+ value={id}
+ // my-0 is required to avoid issues with the prose classes
+ className={cn('*:my-0', className)}
+ disabled={disabled}
+ onClick={() => {
+ setOpen(!open)
+ }}
+ >
+ <AccordionTrigger_Shadcn_ className="text-sm">{header}</AccordionTrigger_Shadcn_>
+ <AccordionContent_Shadcn_>{children}</AccordionContent_Shadcn_>
+ </AccordionItem_Shadcn_>
+ )
+}
diff --git a/apps/studio/components/interfaces/Settings/Logs/LogsErrorRenderers/ResourcesExceededErrorRenderer.tsx b/apps/studio/components/interfaces/Settings/Logs/LogsErrorRenderers/ResourcesExceededErrorRenderer.tsx
index 9f060183952..df041a318c4 100644
--- a/apps/studio/components/interfaces/Settings/Logs/LogsErrorRenderers/ResourcesExceededErrorRenderer.tsx
+++ b/apps/studio/components/interfaces/Settings/Logs/LogsErrorRenderers/ResourcesExceededErrorRenderer.tsx
@@ -1,6 +1,9 @@
import { useState } from 'react'
import {
- Accordion,
+ Accordion_Shadcn_,
+ AccordionContent_Shadcn_,
+ AccordionItem_Shadcn_,
+ AccordionTrigger_Shadcn_,
copyToClipboard,
InputGroup,
InputGroupAddon,
@@ -24,37 +27,32 @@ const ResourcesExceededErrorRenderer: React.FC<ErrorRendererProps> = ({ error, i
</p>
{!isCustomQuery && <p>Please contact support if this error persists.</p>}
</div>
- <Accordion
- className="text-sm"
- justified={false}
- openBehaviour="multiple"
- type="default"
- chevronAlign="left"
- size="small"
- iconPosition="left"
- >
- <Accordion.Item id="1" header="Full error message">
- <InputGroup>
- <InputGroupTextarea value={errorAsJson} className="font-mono" rows={5} />
- <InputGroupAddon align="block-end">
- <InputGroupButton
- size="tiny"
- type="default"
- className="ml-auto"
- onClick={() => {
- copyToClipboard(errorAsJson)
- setCopied(true)
- setTimeout(() => {
- setCopied(false)
- }, 3000)
- }}
- >
- {copied ? 'Copied' : 'Copy'}
- </InputGroupButton>
- </InputGroupAddon>
- </InputGroup>
- </Accordion.Item>
- </Accordion>
+ <Accordion_Shadcn_ className="text-sm" type="single">
+ <AccordionItem_Shadcn_ value="1">
+ <AccordionTrigger_Shadcn_>Full error message</AccordionTrigger_Shadcn_>
+ <AccordionContent_Shadcn_>
+ <InputGroup>
+ <InputGroupTextarea value={errorAsJson} className="font-mono" rows={5} />
+ <InputGroupAddon align="block-end">
+ <InputGroupButton
+ size="tiny"
+ type="default"
+ className="ml-auto"
+ onClick={() => {
+ copyToClipboard(errorAsJson)
+ setCopied(true)
+ setTimeout(() => {
+ setCopied(false)
+ }, 3000)
+ }}
+ >
+ {copied ? 'Copied' : 'Copy'}
+ </InputGroupButton>
+ </InputGroupAddon>
+ </InputGroup>
+ </AccordionContent_Shadcn_>
+ </AccordionItem_Shadcn_>
+ </Accordion_Shadcn_>
</div>
)
}
diff --git a/apps/www/components/LaunchWeek/7/Releases/index.tsx b/apps/www/components/LaunchWeek/7/Releases/index.tsx
index 27d1d577eb4..7fa0ddaf53b 100644
--- a/apps/www/components/LaunchWeek/7/Releases/index.tsx
+++ b/apps/www/components/LaunchWeek/7/Releases/index.tsx
@@ -4,7 +4,12 @@ import { useBreakpoint } from 'common/hooks/useBreakpoint'
import { motion } from 'framer-motion'
import Image from 'next/image'
import { useEffect } from 'react'
-import { Accordion } from 'ui'
+import {
+ Accordion_Shadcn_,
+ AccordionContent_Shadcn_,
+ AccordionItem_Shadcn_,
+ AccordionTrigger_Shadcn_,
+} from 'ui'
import {
AccordionHeader,
@@ -244,31 +249,21 @@ export default function LW7Releases() {
</div>
</SectionContainer>
<SectionContainer className="pt-0! w-full! px-0! max-w-none!">
- <Accordion
- type="default"
- openBehaviour="multiple"
- size="large"
- className="text-white"
- justified={false}
- // bordered={false}
- chevronAlign="right"
- defaultValue={publishedSections}
- >
- <div className="border-b border-[#232323] pb-3">
- <Accordion.Item
- header={
- <AccordionHeader
- date={preRelease.date}
- day={preRelease.dd}
- title={preRelease.title}
- shipped={prereleaseShipped}
- />
- }
- key={preRelease.dd}
- disabled={!prereleaseShipped}
- className="h-[79px]"
- id={preRelease.d.toString()}
- >
+ <Accordion_Shadcn_ type="multiple" className="text-white" defaultValue={publishedSections}>
+ <AccordionItem_Shadcn_
+ key={preRelease.dd}
+ disabled={!prereleaseShipped}
+ value={preRelease.d.toString()}
+ >
+ <AccordionTrigger_Shadcn_ className="py-8 font-normal hover:no-underline">
+ <AccordionHeader
+ date={preRelease.date}
+ day={preRelease.dd}
+ title={preRelease.title}
+ shipped={prereleaseShipped}
+ />
+ </AccordionTrigger_Shadcn_>
+ <AccordionContent_Shadcn_>
{preRelease.steps.length > 0 && (
<div className="h-[800px] lg:h-[400px] flex flex-col gap-5 lg:flex-row">
<motion.div
@@ -372,22 +367,18 @@ export default function LW7Releases() {
</motion.div>
</div>
)}
- </Accordion.Item>
- </div>
- <div className="border-b border-[#232323] pb-3">
- <Accordion.Item
- header={
- <AccordionHeader
- date={day1.date}
- day={day1.dd}
- title={day1.title}
- shipped={day1Shipped}
- />
- }
- disabled={!day1Shipped}
- className="h-[79px]"
- id={day1.d.toString()}
- >
+ </AccordionContent_Shadcn_>
+ </AccordionItem_Shadcn_>
+ <AccordionItem_Shadcn_ disabled={!day1Shipped} value={day1.d.toString()}>
+ <AccordionTrigger_Shadcn_ className="py-8 font-normal hover:no-underline">
+ <AccordionHeader
+ date={day1.date}
+ day={day1.dd}
+ title={day1.title}
+ shipped={day1Shipped}
+ />
+ </AccordionTrigger_Shadcn_>
+ <AccordionContent_Shadcn_>
{day1.steps.length > 0 && (
<div className="h-[400px] flex flex-col gap-5 lg:flex-row">
<motion.div
@@ -446,22 +437,18 @@ export default function LW7Releases() {
</motion.div>
</div>
)}
- </Accordion.Item>
- </div>
- <div className="border-b border-[#232323] pb-3">
- <Accordion.Item
- header={
- <AccordionHeader
- date={day2.date}
- day={day2.dd}
- title={day2.title}
- shipped={day2Shipped}
- />
- }
- disabled={!day2Shipped}
- className="h-[79px]"
- id={day2.d.toString()}
- >
+ </AccordionContent_Shadcn_>
+ </AccordionItem_Shadcn_>
+ <AccordionItem_Shadcn_ disabled={!day2Shipped} value={day2.d.toString()}>
+ <AccordionTrigger_Shadcn_ className="py-8 font-normal hover:no-underline">
+ <AccordionHeader
+ date={day2.date}
+ day={day2.dd}
+ title={day2.title}
+ shipped={day2Shipped}
+ />
+ </AccordionTrigger_Shadcn_>
+ <AccordionContent_Shadcn_>
{day2.steps.length > 0 && (
<div className="h-[400px] flex flex-col gap-5 lg:flex-row">
<motion.div
@@ -520,22 +507,18 @@ export default function LW7Releases() {
</motion.div>
</div>
)}
- </Accordion.Item>
- </div>
- <div className="border-b border-[#232323] pb-3">
- <Accordion.Item
- header={
- <AccordionHeader
- date={day3.date}
- day={day3.dd}
- title={day3.title}
- shipped={day3Shipped}
- />
- }
- disabled={!day3Shipped}
- className="h-[79px]"
- id={day3.d.toString()}
- >
+ </AccordionContent_Shadcn_>
+ </AccordionItem_Shadcn_>
+ <AccordionItem_Shadcn_ disabled={!day3Shipped} value={day3.d.toString()}>
+ <AccordionTrigger_Shadcn_ className="py-8 font-normal hover:no-underline">
+ <AccordionHeader
+ date={day3.date}
+ day={day3.dd}
+ title={day3.title}
+ shipped={day3Shipped}
+ />
+ </AccordionTrigger_Shadcn_>
+ <AccordionContent_Shadcn_>
{day3.steps.length > 0 && (
<div className="h-[400px] flex flex-col gap-5 lg:flex-row">
<motion.div
@@ -594,22 +577,18 @@ export default function LW7Releases() {
</motion.div>
</div>
)}
- </Accordion.Item>
- </div>
- <div className="border-b border-[#232323] pb-3">
- <Accordion.Item
- header={
- <AccordionHeader
- date={day4.date}
- day={day4.dd}
- title={day4.title}
- shipped={day4Shipped}
- />
- }
- disabled={!day4Shipped}
- className="h-[79px]"
- id={day4.d.toString()}
- >
+ </AccordionContent_Shadcn_>
+ </AccordionItem_Shadcn_>
+ <AccordionItem_Shadcn_ disabled={!day4Shipped} value={day4.d.toString()}>
+ <AccordionTrigger_Shadcn_ className="py-8 font-normal hover:no-underline">
+ <AccordionHeader
+ date={day4.date}
+ day={day4.dd}
+ title={day4.title}
+ shipped={day4Shipped}
+ />
+ </AccordionTrigger_Shadcn_>
+ <AccordionContent_Shadcn_>
{day4.steps.length > 0 && (
<div className="h-[400px] flex flex-col gap-5 lg:flex-row">
<motion.div
@@ -666,26 +645,22 @@ export default function LW7Releases() {
</motion.div>
</div>
)}
- </Accordion.Item>
- </div>
- <div className="border-b border-[#232323] pb-3" id="currentDay">
- <Accordion.Item
- header={
- <AccordionHeader
- date={day5.date}
- day={day5.dd}
- title={day5.title}
- shipped={day5Shipped}
- />
- }
- disabled={!day5Shipped}
- className="h-[79px]"
- id={day5.d.toString()}
- >
+ </AccordionContent_Shadcn_>
+ </AccordionItem_Shadcn_>
+ <AccordionItem_Shadcn_ disabled={!day5Shipped} value={day5.d.toString()}>
+ <AccordionTrigger_Shadcn_ className="py-8 font-normal hover:no-underline">
+ <AccordionHeader
+ date={day5.date}
+ day={day5.dd}
+ title={day5.title}
+ shipped={day5Shipped}
+ />
+ </AccordionTrigger_Shadcn_>
+ <AccordionContent_Shadcn_>
<Day5 day={day5} />
- </Accordion.Item>
- </div>
- </Accordion>
+ </AccordionContent_Shadcn_>
+ </AccordionItem_Shadcn_>
+ </Accordion_Shadcn_>
</SectionContainer>
</>
)
diff --git a/apps/www/components/LaunchWeek/8/Releases/index.tsx b/apps/www/components/LaunchWeek/8/Releases/index.tsx
index 096f5ed26fd..a99417ad9d6 100644
--- a/apps/www/components/LaunchWeek/8/Releases/index.tsx
+++ b/apps/www/components/LaunchWeek/8/Releases/index.tsx
@@ -2,7 +2,13 @@ import SectionContainer from '~/components/Layouts/SectionContainer'
import { useBreakpoint } from 'common/hooks/useBreakpoint'
import Image from 'next/image'
import Link from 'next/link'
-import { Accordion, cn } from 'ui'
+import {
+ Accordion_Shadcn_,
+ AccordionContent_Shadcn_,
+ AccordionItem_Shadcn_,
+ AccordionTrigger_Shadcn_,
+ cn,
+} from 'ui'
import {
AccordionHeader,
@@ -13,7 +19,7 @@ import {
} from './components'
import days, { WeekDayProps } from './lw8_data'
-export default function LW8Releases() {
+function LW8Releases() {
const [preRelease, day1, day2, day3, day4, day5] = days
const isTablet = useBreakpoint(1023)
const isDesktop = useBreakpoint(1280)
@@ -28,32 +34,24 @@ export default function LW8Releases() {
return (
<>
<SectionContainer className="pt-0! w-full! px-0! max-w-none!">
- <Accordion
- type="default"
- openBehaviour="multiple"
- size="large"
- className="text-white"
- justified={false}
- chevronAlign="right"
- defaultValue={publishedSections}
- >
- <div className="border-b border-[#111718]">
- <Accordion.Item
- header={
- <AccordionHeader
- date={preRelease.date}
- day={preRelease.d}
- weekDay={preRelease.dd}
- title={preRelease.title}
- shipped={true}
- shippable={false}
- publishedAt={preRelease.publishedAt}
- />
- }
- key={preRelease.dd}
- className="h-[79px]"
- id={preRelease.d.toString()}
- >
+ <Accordion_Shadcn_ type="multiple" className="text-white" defaultValue={publishedSections}>
+ <AccordionItem_Shadcn_
+ key={preRelease.dd}
+ value={preRelease.d.toString()}
+ className="border-[#111718]"
+ >
+ <AccordionTrigger_Shadcn_ className="py-2 font-normal hover:no-underline">
+ <AccordionHeader
+ date={preRelease.date}
+ day={preRelease.d}
+ weekDay={preRelease.dd}
+ title={preRelease.title}
+ shipped={true}
+ shippable={false}
+ publishedAt={preRelease.publishedAt}
+ />
+ </AccordionTrigger_Shadcn_>
+ <AccordionContent_Shadcn_>
{preRelease.steps.length > 0 && (
<div className="flex flex-col gap-5 lg:flex-row pb-4">
<div
@@ -194,9 +192,13 @@ export default function LW8Releases() {
</div>
</div>
)}
- </Accordion.Item>
- </div>
- <div className="border-b border-[#111718] scroll-mt-16">
+ </AccordionContent_Shadcn_>
+ </AccordionItem_Shadcn_>
+ <AccordionItem_Shadcn_
+ key={day1.dd}
+ value={day1.d.toString()}
+ className="border-[#111718]"
+ >
<AccordionHeader
date={day1.date}
day={day1.d}
@@ -207,59 +209,69 @@ export default function LW8Releases() {
youtube_id={day1.youtube_id}
videoThumbnail={day1.videoThumbnail}
/>
-
- {day1.steps.length > 0 && (
- <div className="flex flex-col gap-5 lg:flex-row pb-4">
- <div
- className={`
+ <AccordionContent_Shadcn_>
+ {day1.steps.length > 0 && (
+ <div className="flex flex-col gap-5 lg:flex-row pb-4">
+ <div
+ className={`
min-h-[400px] relative overflow-hidden group/d1 flex-1 flex flex-col items-center lg:items-start justify-between
basis-1/2 lg:basis-1/3 border border-[#111718] rounded-xl lg:h-full bg-no-repeat py-10 lg:py-12 px-8 lg:px-10 text-2xl bg-contain shadow-lg
`}
- >
- <div
- className="inset-0 absolute group-hover/d1:scale-105 opacity-60 group-hover/d1:opacity-100 w-full h-full -z-10 transition-all duration-500 pointer-events-none"
- style={{
- background: `radial-gradient(100% 100% at 80% 80%, #6F13A450, #030A0C)`,
- }}
- />
- <div className="flex flex-col items-center lg:items-start gap-2 min-w-[300px] w-full text-center lg:text-left">
- <Link href={day1.steps[0].blog!} className="m-0">
- <CartTitle>{day1.steps[0].title}</CartTitle>
- </Link>
- <p className="text-sm text-slate-900">{day1.steps[0]?.description}</p>
- </div>
- <SectionButtons blog={day1.steps[0].blog} hackernews={day1.steps[0].hackernews} />
- {day1.steps[0]?.bg_layers &&
- day1.steps[0]?.bg_layers?.map(
- (layer, i) =>
- !!layer.img && (
- <div
- key={layer.img}
- className="absolute opacity-90 transition-opacity inset-0 w-full h-full -z-10 group-hover/d1:opacity-100"
- >
- <Image
- src={
- !!layer.mobileImg && isTablet ? (layer.mobileImg as any) : layer.img
- }
- className={cn(
- `
+ >
+ <div
+ className="inset-0 absolute group-hover/d1:scale-105 opacity-60 group-hover/d1:opacity-100 w-full h-full -z-10 transition-all duration-500 pointer-events-none"
+ style={{
+ background: `radial-gradient(100% 100% at 80% 80%, #6F13A450, #030A0C)`,
+ }}
+ />
+ <div className="flex flex-col items-center lg:items-start gap-2 min-w-[300px] w-full text-center lg:text-left">
+ <Link href={day1.steps[0].blog!} className="m-0">
+ <CartTitle>{day1.steps[0].title}</CartTitle>
+ </Link>
+ <p className="text-sm text-slate-900">{day1.steps[0]?.description}</p>
+ </div>
+ <SectionButtons
+ blog={day1.steps[0].blog}
+ hackernews={day1.steps[0].hackernews}
+ />
+ {day1.steps[0]?.bg_layers &&
+ day1.steps[0]?.bg_layers?.map(
+ (layer, i) =>
+ !!layer.img && (
+ <div
+ key={layer.img}
+ className="absolute opacity-90 transition-opacity inset-0 w-full h-full -z-10 group-hover/d1:opacity-100"
+ >
+ <Image
+ src={
+ !!layer.mobileImg && isTablet
+ ? (layer.mobileImg as any)
+ : layer.img
+ }
+ className={cn(
+ `
absolute opacity-90
w-full h-full -z-10 transition-all duration-300 object-contain
`,
- isTablet ? 'object-[50%]' : 'object-[90%_50%]'
- )}
- fill
- sizes="100%"
- alt=""
- />
- </div>
- )
- )}
+ isTablet ? 'object-[50%]' : 'object-[90%_50%]'
+ )}
+ fill
+ sizes="100%"
+ alt=""
+ />
+ </div>
+ )
+ )}
+ </div>
</div>
- </div>
- )}
- </div>
- <div className="border-b border-[#111718] scroll-mt-16">
+ )}
+ </AccordionContent_Shadcn_>
+ </AccordionItem_Shadcn_>
+ <AccordionItem_Shadcn_
+ key={day2.dd}
+ value={day2.d.toString()}
+ className="border-[#111718]"
+ >
<AccordionHeader
date={day2.date}
day={day2.d}
@@ -270,56 +282,66 @@ export default function LW8Releases() {
youtube_id={day2.youtube_id}
videoThumbnail={day2.videoThumbnail}
/>
-
- {day2.steps.length > 0 && (
- <div className="flex flex-col gap-5 lg:flex-row pb-4">
- <div
- className={`
+ <AccordionContent_Shadcn_>
+ {day2.steps.length > 0 && (
+ <div className="flex flex-col gap-5 lg:flex-row pb-4">
+ <div
+ className={`
min-h-[400px] relative overflow-hidden group/d1 flex-1 flex flex-col items-center lg:items-start justify-between
basis-1/2 lg:basis-1/3 border border-[#111718] rounded-xl lg:h-full bg-no-repeat py-10 lg:py-12 px-8 lg:px-10 text-2xl bg-contain shadow-lg
`}
- >
- <div
- className="inset-0 absolute group-hover/d1:scale-105 opacity-60 group-hover/d1:opacity-100 w-full h-full -z-10 transition-all duration-500 pointer-events-none"
- style={{
- background: `radial-gradient(100% 100% at 80% 80%, #6F13A450, #030A0C)`,
- }}
- />
- <div className="flex flex-col items-center lg:items-start gap-2 min-w-[300px] w-full text-center lg:text-left">
- <Link href={day2.steps[0].blog!} className="m-0">
- <CartTitle>{day2.steps[0].title}</CartTitle>
- </Link>
- <p className="text-sm text-slate-900">{day2.steps[0]?.description}</p>
- </div>
- <SectionButtons blog={day2.steps[0].blog} hackernews={day2.steps[0].hackernews} />
- {day2.steps[0]?.bg_layers &&
- day2.steps[0]?.bg_layers?.map(
- (layer, i) =>
- !!layer.img && (
- <div
- key={layer.img}
- className="absolute opacity-90 transition-opacity inset-0 w-full h-full -z-10 group-hover/d1:opacity-100"
- >
- <Image
- src={
- !!layer.mobileImg && isTablet ? (layer.mobileImg as any) : layer.img
- }
- className={`
+ >
+ <div
+ className="inset-0 absolute group-hover/d1:scale-105 opacity-60 group-hover/d1:opacity-100 w-full h-full -z-10 transition-all duration-500 pointer-events-none"
+ style={{
+ background: `radial-gradient(100% 100% at 80% 80%, #6F13A450, #030A0C)`,
+ }}
+ />
+ <div className="flex flex-col items-center lg:items-start gap-2 min-w-[300px] w-full text-center lg:text-left">
+ <Link href={day2.steps[0].blog!} className="m-0">
+ <CartTitle>{day2.steps[0].title}</CartTitle>
+ </Link>
+ <p className="text-sm text-slate-900">{day2.steps[0]?.description}</p>
+ </div>
+ <SectionButtons
+ blog={day2.steps[0].blog}
+ hackernews={day2.steps[0].hackernews}
+ />
+ {day2.steps[0]?.bg_layers &&
+ day2.steps[0]?.bg_layers?.map(
+ (layer, i) =>
+ !!layer.img && (
+ <div
+ key={layer.img}
+ className="absolute opacity-90 transition-opacity inset-0 w-full h-full -z-10 group-hover/d1:opacity-100"
+ >
+ <Image
+ src={
+ !!layer.mobileImg && isTablet
+ ? (layer.mobileImg as any)
+ : layer.img
+ }
+ className={`
absolute opacity-90
w-full h-full -z-10 transition-all duration-300 object-cover
`}
- fill
- sizes="100%"
- alt=""
- />
- </div>
- )
- )}
+ fill
+ sizes="100%"
+ alt=""
+ />
+ </div>
+ )
+ )}
+ </div>
</div>
- </div>
- )}
- </div>
- <div className="border-b border-[#111718] scroll-mt-16">
+ )}
+ </AccordionContent_Shadcn_>
+ </AccordionItem_Shadcn_>
+ <AccordionItem_Shadcn_
+ key={day3.dd}
+ value={day3.d.toString()}
+ className="border-[#111718]"
+ >
<AccordionHeader
date={day3.date}
day={day3.d}
@@ -330,71 +352,78 @@ export default function LW8Releases() {
youtube_id={day3.youtube_id}
videoThumbnail={day3.videoThumbnail}
/>
-
- {day3.steps.length > 0 && (
- <div className="flex flex-col gap-5 lg:flex-row pb-4">
- <div
- className={`
+ <AccordionContent_Shadcn_>
+ {day3.steps.length > 0 && (
+ <div className="flex flex-col gap-5 lg:flex-row pb-4">
+ <div
+ className={`
min-h-[400px] relative overflow-hidden group/d1 flex-1 flex flex-col items-center lg:items-start justify-between
basis-1/2 lg:basis-1/3 border border-[#111718] rounded-xl lg:h-full bg-no-repeat py-10 lg:py-12 px-8 lg:px-10 text-2xl bg-contain shadow-lg
`}
- >
- <div
- className="inset-0 absolute group-hover/d1:scale-105 opacity-60 group-hover/d1:opacity-100 w-full h-full -z-10 transition-all duration-500 pointer-events-none"
- style={{
- background: `radial-gradient(100% 100% at 80% 80%, #6F13A450, #030A0C)`,
- }}
- />
- <div className="flex flex-col items-center lg:items-start gap-2 min-w-[300px] w-full text-center lg:text-left">
- <Link href={day3.steps[0].blog!} className="m-0">
- <CartTitle>{day3.steps[0].title}</CartTitle>
- </Link>
- <p className="text-sm text-slate-900">{day3.steps[0]?.description}</p>
- <ul className="flex flex-row flex-wrap lg:flex-col gap-2 text-sm md:text-base justify-center">
- <li className="flex items-center gap-2">
- <CheckCircleSolidIcon /> AI SQL Editor
- </li>
- <li className="flex items-center gap-2">
- <CheckCircleSolidIcon /> Schema Diagrams
- </li>
- <li className="flex items-center gap-2">
- <CheckCircleSolidIcon /> Wrappers
- </li>
- </ul>
+ >
+ <div
+ className="inset-0 absolute group-hover/d1:scale-105 opacity-60 group-hover/d1:opacity-100 w-full h-full -z-10 transition-all duration-500 pointer-events-none"
+ style={{
+ background: `radial-gradient(100% 100% at 80% 80%, #6F13A450, #030A0C)`,
+ }}
+ />
+ <div className="flex flex-col items-center lg:items-start gap-2 min-w-[300px] w-full text-center lg:text-left">
+ <Link href={day3.steps[0].blog!} className="m-0">
+ <CartTitle>{day3.steps[0].title}</CartTitle>
+ </Link>
+ <p className="text-sm text-slate-900">{day3.steps[0]?.description}</p>
+ <ul className="flex flex-row flex-wrap lg:flex-col gap-2 text-sm md:text-base justify-center">
+ <li className="flex items-center gap-2">
+ <CheckCircleSolidIcon /> AI SQL Editor
+ </li>
+ <li className="flex items-center gap-2">
+ <CheckCircleSolidIcon /> Schema Diagrams
+ </li>
+ <li className="flex items-center gap-2">
+ <CheckCircleSolidIcon /> Wrappers
+ </li>
+ </ul>
+ </div>
+ <SectionButtons
+ blog={day3.steps[0].blog}
+ product_hunt={day3.steps[0].product_hunt}
+ />
+ {day3.steps[0]?.bg_layers &&
+ day3.steps[0]?.bg_layers?.map(
+ (layer, i) =>
+ !!layer.img && (
+ <div
+ key={layer.img}
+ className="absolute opacity-90 transition-opacity inset-0 w-full h-full -z-10 group-hover/d1:opacity-100"
+ >
+ <Image
+ src={
+ !!layer.mobileImg && isTablet
+ ? (layer.mobileImg as any)
+ : layer.img
+ }
+ className={cn(
+ 'absolute opacity-90 w-full h-full -z-10 transition-all duration-300',
+ isTablet ? 'object-[50%]' : 'object-[100%_50%]',
+ i == 1 && isTablet ? 'object-contain' : 'object-cover'
+ )}
+ fill
+ sizes="100%"
+ alt=""
+ />
+ </div>
+ )
+ )}
</div>
- <SectionButtons
- blog={day3.steps[0].blog}
- product_hunt={day3.steps[0].product_hunt}
- />
- {day3.steps[0]?.bg_layers &&
- day3.steps[0]?.bg_layers?.map(
- (layer, i) =>
- !!layer.img && (
- <div
- key={layer.img}
- className="absolute opacity-90 transition-opacity inset-0 w-full h-full -z-10 group-hover/d1:opacity-100"
- >
- <Image
- src={
- !!layer.mobileImg && isTablet ? (layer.mobileImg as any) : layer.img
- }
- className={cn(
- 'absolute opacity-90 w-full h-full -z-10 transition-all duration-300',
- isTablet ? 'object-[50%]' : 'object-[100%_50%]',
- i == 1 && isTablet ? 'object-contain' : 'object-cover'
- )}
- fill
- sizes="100%"
- alt=""
- />
- </div>
- )
- )}
</div>
- </div>
- )}
- </div>
- <div className="border-b border-[#111718] scroll-mt-16">
+ )}
+ </AccordionContent_Shadcn_>
+ </AccordionItem_Shadcn_>
+ <AccordionItem_Shadcn_
+ key={day4.dd}
+ value={day4.d.toString()}
+ className="border-[#111718]"
+ >
<AccordionHeader
date={day4.date}
day={day4.d}
@@ -405,97 +434,106 @@ export default function LW8Releases() {
youtube_id={day4.youtube_id}
videoThumbnail={day4.videoThumbnail}
/>
-
- {day4.steps.length > 0 && (
- <div className="flex flex-col gap-5 lg:flex-row pb-4">
- <div
- className={`
+ <AccordionContent_Shadcn_>
+ {day4.steps.length > 0 && (
+ <div className="flex flex-col gap-5 lg:flex-row pb-4">
+ <div
+ className={`
min-h-[400px] relative overflow-hidden group/d1 flex-1 flex flex-col items-center lg:items-start justify-between
basis-1/2 lg:shrink xl:basis-2/3 border border-[#111718] rounded-xl lg:h-full bg-no-repeat py-10 lg:py-12 px-8 lg:px-10 text-2xl bg-contain shadow-lg
`}
- >
- <div
- className="inset-0 absolute group-hover/d1:scale-105 opacity-60 group-hover/d1:opacity-100 w-full h-full -z-10 transition-all duration-500 pointer-events-none"
- style={{
- background: `radial-gradient(100% 100% at 80% 80%, #6F13A450, #030A0C)`,
- }}
- />
- <div className="flex flex-col items-center lg:items-start gap-2 min-w-[300px] w-full text-center lg:text-left">
- <Link href={day4.steps[0].blog!} className="m-0">
- <CartTitle>{day4.steps[0].title}</CartTitle>
- </Link>
- <p className="text-sm text-slate-900">{day4.steps[0]?.description}</p>
+ >
+ <div
+ className="inset-0 absolute group-hover/d1:scale-105 opacity-60 group-hover/d1:opacity-100 w-full h-full -z-10 transition-all duration-500 pointer-events-none"
+ style={{
+ background: `radial-gradient(100% 100% at 80% 80%, #6F13A450, #030A0C)`,
+ }}
+ />
+ <div className="flex flex-col items-center lg:items-start gap-2 min-w-[300px] w-full text-center lg:text-left">
+ <Link href={day4.steps[0].blog!} className="m-0">
+ <CartTitle>{day4.steps[0].title}</CartTitle>
+ </Link>
+ <p className="text-sm text-slate-900">{day4.steps[0]?.description}</p>
+ </div>
+ <SectionButtons blog={day4.steps[0].blog} />
+ {day4.steps[0]?.bg_layers &&
+ day4.steps[0]?.bg_layers?.map(
+ (layer, i) =>
+ !!layer.img && (
+ <div
+ key={layer.img}
+ className="absolute opacity-90 transition-opacity inset-0 w-full h-full -z-10 group-hover/d1:opacity-100"
+ >
+ <Image
+ src={
+ !!layer.mobileImg && isTablet
+ ? (layer.mobileImg as any)
+ : layer.img
+ }
+ className={cn(
+ 'absolute opacity-90 w-full h-full -z-10 transition-all duration-300',
+ isTablet ? 'object-[50%]' : 'object-[100%_50%]',
+ i == 1 && isTablet ? 'object-contain' : 'object-cover'
+ )}
+ fill
+ sizes="100%"
+ alt=""
+ />
+ </div>
+ )
+ )}
</div>
- <SectionButtons blog={day4.steps[0].blog} />
- {day4.steps[0]?.bg_layers &&
- day4.steps[0]?.bg_layers?.map(
- (layer, i) =>
- !!layer.img && (
- <div
- key={layer.img}
- className="absolute opacity-90 transition-opacity inset-0 w-full h-full -z-10 group-hover/d1:opacity-100"
- >
- <Image
- src={
- !!layer.mobileImg && isTablet ? (layer.mobileImg as any) : layer.img
- }
- className={cn(
- 'absolute opacity-90 w-full h-full -z-10 transition-all duration-300',
- isTablet ? 'object-[50%]' : 'object-[100%_50%]',
- i == 1 && isTablet ? 'object-contain' : 'object-cover'
- )}
- fill
- sizes="100%"
- alt=""
- />
- </div>
- )
- )}
- </div>
- <div
- className={`
+ <div
+ className={`
min-h-[400px] relative overflow-hidden group/d1 flex-1 flex flex-col items-center justify-between
basis-1/2 lg:basis-1/3 border border-[#111718] rounded-xl lg:h-full bg-no-repeat py-10 lg:py-12 px-8 lg:px-10 text-2xl bg-contain shadow-lg
`}
- >
- <div
- className="inset-0 absolute group-hover/d1:scale-105 opacity-60 group-hover/d1:opacity-100 w-full h-full -z-10 transition-all duration-500 pointer-events-none"
- style={{
- background: `radial-gradient(100% 100% at 80% 80%, #6F13A450, #030A0C)`,
- }}
- />
- <div className="flex flex-col items-center gap-2 min-w-[300px] w-full text-center lg:text-left">
- <Link href={day4.steps[1].blog!} className="m-0">
- <CartTitle>{day4.steps[1].title}</CartTitle>
- </Link>
- <p className="text-sm text-slate-900">{day4.steps[1]?.description}</p>
+ >
+ <div
+ className="inset-0 absolute group-hover/d1:scale-105 opacity-60 group-hover/d1:opacity-100 w-full h-full -z-10 transition-all duration-500 pointer-events-none"
+ style={{
+ background: `radial-gradient(100% 100% at 80% 80%, #6F13A450, #030A0C)`,
+ }}
+ />
+ <div className="flex flex-col items-center gap-2 min-w-[300px] w-full text-center lg:text-left">
+ <Link href={day4.steps[1].blog!} className="m-0">
+ <CartTitle>{day4.steps[1].title}</CartTitle>
+ </Link>
+ <p className="text-sm text-slate-900">{day4.steps[1]?.description}</p>
+ </div>
+ <SectionButtons blog={day4.steps[1].blog} />
+ {day4.steps[1]?.bg_layers &&
+ day4.steps[1]?.bg_layers?.map(
+ (layer, i) =>
+ !!layer.img && (
+ <div
+ key={layer.img}
+ className="absolute opacity-90 transition-opacity inset-0 w-full h-full -z-10 group-hover/d1:opacity-100"
+ >
+ <Image
+ src={
+ !!layer.mobileImg && isTablet
+ ? (layer.mobileImg as any)
+ : layer.img
+ }
+ className="absolute opacity-90 w-full h-full -z-10 transition-all duration-300 object-cover"
+ fill
+ sizes="100%"
+ alt=""
+ />
+ </div>
+ )
+ )}
</div>
- <SectionButtons blog={day4.steps[1].blog} />
- {day4.steps[1]?.bg_layers &&
- day4.steps[1]?.bg_layers?.map(
- (layer, i) =>
- !!layer.img && (
- <div
- key={layer.img}
- className="absolute opacity-90 transition-opacity inset-0 w-full h-full -z-10 group-hover/d1:opacity-100"
- >
- <Image
- src={
- !!layer.mobileImg && isTablet ? (layer.mobileImg as any) : layer.img
- }
- className="absolute opacity-90 w-full h-full -z-10 transition-all duration-300 object-cover"
- fill
- sizes="100%"
- alt=""
- />
- </div>
- )
- )}
</div>
- </div>
- )}
- </div>
- <div className="border-b border-[#111718] scroll-mt-16">
+ )}
+ </AccordionContent_Shadcn_>
+ </AccordionItem_Shadcn_>
+ <AccordionItem_Shadcn_
+ key={day5.dd}
+ value={day5.d.toString()}
+ className="border-[#111718]"
+ >
<AccordionHeader
date={day5.date}
day={day5.d}
@@ -506,139 +544,157 @@ export default function LW8Releases() {
youtube_id={day5.youtube_id}
videoThumbnail={day5.videoThumbnail}
/>
-
- {day5.steps.length > 0 && (
- <div className="flex flex-col pb-4">
- <div
- className={`
+ <AccordionContent_Shadcn_>
+ {day5.steps.length > 0 && (
+ <div className="flex flex-col pb-4">
+ <div
+ className={`
min-h-[400px] relative overflow-hidden group/d1 flex-1 flex flex-col items-center lg:items-start justify-between
border border-[#111718] rounded-xl lg:h-full bg-no-repeat py-10 lg:py-12 px-8 lg:px-10 text-2xl bg-contain shadow-lg
`}
- >
- <div
- className="inset-0 absolute group-hover/d1:scale-105 opacity-60 group-hover/d1:opacity-100 w-full h-full -z-10 transition-all duration-500 pointer-events-none"
- style={{
- background: `radial-gradient(100% 100% at 80% 80%, #6F13A450, #030A0C)`,
- }}
- />
- <div className="flex flex-col items-center lg:items-start gap-2 min-w-[300px] w-full text-center lg:text-left">
- <Link href={day5.steps[0].blog!} className="m-0">
- <CartTitle>{day5.steps[0].title}</CartTitle>
- </Link>
- <p className="text-sm text-slate-900">{day5.steps[0]?.description}</p>
+ >
+ <div
+ className="inset-0 absolute group-hover/d1:scale-105 opacity-60 group-hover/d1:opacity-100 w-full h-full -z-10 transition-all duration-500 pointer-events-none"
+ style={{
+ background: `radial-gradient(100% 100% at 80% 80%, #6F13A450, #030A0C)`,
+ }}
+ />
+ <div className="flex flex-col items-center lg:items-start gap-2 min-w-[300px] w-full text-center lg:text-left">
+ <Link href={day5.steps[0].blog!} className="m-0">
+ <CartTitle>{day5.steps[0].title}</CartTitle>
+ </Link>
+ <p className="text-sm text-slate-900">{day5.steps[0]?.description}</p>
+ </div>
+ <SectionButtons
+ blog={day5.steps[0].blog}
+ hackernews={day5.steps[0].hackernews}
+ />
+ {day5.steps[0]?.bg_layers &&
+ day5.steps[0]?.bg_layers?.map(
+ (layer, i) =>
+ !!layer.img && (
+ <div
+ key={layer.img}
+ className="absolute opacity-90 transition-opacity inset-0 w-full h-full -z-10 group-hover/d1:opacity-100"
+ >
+ <Image
+ src={
+ !!layer.mobileImg && isTablet
+ ? (layer.mobileImg as any)
+ : layer.img
+ }
+ className="absolute opacity-90 w-full h-full -z-10 transition-all duration-300 object-cover"
+ fill
+ sizes="100%"
+ alt=""
+ />
+ </div>
+ )
+ )}
</div>
- <SectionButtons blog={day5.steps[0].blog} hackernews={day5.steps[0].hackernews} />
- {day5.steps[0]?.bg_layers &&
- day5.steps[0]?.bg_layers?.map(
- (layer, i) =>
- !!layer.img && (
- <div
- key={layer.img}
- className="absolute opacity-90 transition-opacity inset-0 w-full h-full -z-10 group-hover/d1:opacity-100"
- >
- <Image
- src={
- !!layer.mobileImg && isTablet ? (layer.mobileImg as any) : layer.img
- }
- className="absolute opacity-90 w-full h-full -z-10 transition-all duration-300 object-cover"
- fill
- sizes="100%"
- alt=""
- />
- </div>
- )
- )}
- </div>
- <MultistepSectionHeader title="Community" />
- <div
- className={`
+ <MultistepSectionHeader title="Community" />
+ <div
+ className={`
min-h-[400px] relative overflow-hidden group/d1 flex-1 flex flex-col items-center lg:items-start justify-between
border border-[#111718] rounded-xl lg:h-full bg-no-repeat py-10 lg:py-12 px-8 lg:px-10 text-2xl bg-contain shadow-lg
`}
- >
- <div
- className="inset-0 absolute group-hover/d1:scale-105 opacity-60 group-hover/d1:opacity-100 w-full h-full -z-10 transition-all duration-500 pointer-events-none"
- style={{
- background: `radial-gradient(100% 100% at 80% 80%, #6F13A450, #030A0C)`,
- }}
- />
- <div className="flex flex-col items-center lg:items-start gap-2 min-w-[300px] w-full text-center lg:text-left">
- <Link href={day5.steps[1].blog!} className="m-0">
- <CartTitle>{day5.steps[1].title}</CartTitle>
- </Link>
- <p className="text-sm text-slate-900">{day5.steps[1]?.description}</p>
+ >
+ <div
+ className="inset-0 absolute group-hover/d1:scale-105 opacity-60 group-hover/d1:opacity-100 w-full h-full -z-10 transition-all duration-500 pointer-events-none"
+ style={{
+ background: `radial-gradient(100% 100% at 80% 80%, #6F13A450, #030A0C)`,
+ }}
+ />
+ <div className="flex flex-col items-center lg:items-start gap-2 min-w-[300px] w-full text-center lg:text-left">
+ <Link href={day5.steps[1].blog!} className="m-0">
+ <CartTitle>{day5.steps[1].title}</CartTitle>
+ </Link>
+ <p className="text-sm text-slate-900">{day5.steps[1]?.description}</p>
+ </div>
+ <SectionButtons
+ blog={day5.steps[1].blog}
+ hackernews={day5.steps[1].hackernews}
+ />
+ {day5.steps[1]?.bg_layers &&
+ day5.steps[1]?.bg_layers?.map(
+ (layer, i) =>
+ !!layer.img && (
+ <div
+ key={layer.img}
+ className="absolute opacity-90 transition-opacity inset-0 w-full h-full -z-10 group-hover/d1:opacity-100"
+ >
+ <Image
+ src={
+ !!layer.mobileImg && isTablet
+ ? (layer.mobileImg as any)
+ : layer.img
+ }
+ className="absolute opacity-90 w-full h-full -z-10 transition-all duration-300 object-cover"
+ fill
+ sizes="100%"
+ alt=""
+ />
+ </div>
+ )
+ )}
</div>
- <SectionButtons blog={day5.steps[1].blog} hackernews={day5.steps[1].hackernews} />
- {day5.steps[1]?.bg_layers &&
- day5.steps[1]?.bg_layers?.map(
- (layer, i) =>
- !!layer.img && (
- <div
- key={layer.img}
- className="absolute opacity-90 transition-opacity inset-0 w-full h-full -z-10 group-hover/d1:opacity-100"
- >
- <Image
- src={
- !!layer.mobileImg && isTablet ? (layer.mobileImg as any) : layer.img
- }
- className="absolute opacity-90 w-full h-full -z-10 transition-all duration-300 object-cover"
- fill
- sizes="100%"
- alt=""
- />
- </div>
- )
- )}
- </div>
- <MultistepSectionHeader title="One more thing" />
- <div
- className={`
+ <MultistepSectionHeader title="One more thing" />
+ <div
+ className={`
min-h-[400px] relative overflow-hidden group/d1 flex-1 flex flex-col items-center lg:items-start justify-between
border border-[#111718] rounded-xl lg:h-full bg-no-repeat py-10 lg:py-12 px-8 lg:px-10 text-2xl bg-contain shadow-lg
`}
- >
- <div
- className="inset-0 absolute group-hover/d1:scale-105 opacity-60 group-hover/d1:opacity-100 w-full h-full -z-10 transition-all duration-500 pointer-events-none"
- style={{
- background: `radial-gradient(100% 100% at 80% 80%, #6F13A450, #030A0C)`,
- }}
- />
- <div className="flex flex-col items-center lg:items-start gap-2 min-w-[300px] w-full text-center lg:text-left">
- <Link href={day5.steps[2].blog!} className="m-0">
- <CartTitle>{day5.steps[2].title}</CartTitle>
- </Link>
- <p className="text-sm text-slate-900">{day5.steps[2]?.description}</p>
+ >
+ <div
+ className="inset-0 absolute group-hover/d1:scale-105 opacity-60 group-hover/d1:opacity-100 w-full h-full -z-10 transition-all duration-500 pointer-events-none"
+ style={{
+ background: `radial-gradient(100% 100% at 80% 80%, #6F13A450, #030A0C)`,
+ }}
+ />
+ <div className="flex flex-col items-center lg:items-start gap-2 min-w-[300px] w-full text-center lg:text-left">
+ <Link href={day5.steps[2].blog!} className="m-0">
+ <CartTitle>{day5.steps[2].title}</CartTitle>
+ </Link>
+ <p className="text-sm text-slate-900">{day5.steps[2]?.description}</p>
+ </div>
+ <SectionButtons
+ blog={day5.steps[2].blog}
+ hackernews={day5.steps[0].hackernews}
+ />
+ {day5.steps[2]?.bg_layers &&
+ day5.steps[2]?.bg_layers?.map(
+ (layer, i) =>
+ !!layer.img && (
+ <div
+ key={layer.img}
+ className="absolute opacity-90 transition-opacity inset-0 w-full h-full -z-10 group-hover/d1:opacity-100"
+ >
+ <Image
+ src={
+ !!layer.mobileImg && isTablet
+ ? (layer.mobileImg as any)
+ : layer.img
+ }
+ className={cn(
+ 'absolute opacity-90 w-full h-full -z-10 transition-all duration-300 object-cover',
+ isTablet ? 'object-[50%]' : 'object-[100%_50%]'
+ )}
+ fill
+ sizes="100%"
+ alt=""
+ />
+ </div>
+ )
+ )}
</div>
- <SectionButtons blog={day5.steps[2].blog} hackernews={day5.steps[0].hackernews} />
- {day5.steps[2]?.bg_layers &&
- day5.steps[2]?.bg_layers?.map(
- (layer, i) =>
- !!layer.img && (
- <div
- key={layer.img}
- className="absolute opacity-90 transition-opacity inset-0 w-full h-full -z-10 group-hover/d1:opacity-100"
- >
- <Image
- src={
- !!layer.mobileImg && isTablet ? (layer.mobileImg as any) : layer.img
- }
- className={cn(
- 'absolute opacity-90 w-full h-full -z-10 transition-all duration-300 object-cover',
- isTablet ? 'object-[50%]' : 'object-[100%_50%]'
- )}
- fill
- sizes="100%"
- alt=""
- />
- </div>
- )
- )}
</div>
- </div>
- )}
- </div>
- </Accordion>
+ )}
+ </AccordionContent_Shadcn_>
+ </AccordionItem_Shadcn_>
+ </Accordion_Shadcn_>
</SectionContainer>
</>
)
}
+
+export default LW8Releases
diff --git a/apps/www/components/Nav/MobileMenu.tsx b/apps/www/components/Nav/MobileMenu.tsx
index 666f97c96fc..a64a3195ef5 100644
--- a/apps/www/components/Nav/MobileMenu.tsx
+++ b/apps/www/components/Nav/MobileMenu.tsx
@@ -1,16 +1,22 @@
'use client'
import { useIsLoggedIn, useIsUserLoading } from 'common'
-import SupabaseWordmark from './SupabaseWordmark'
import { AnimatePresence, domAnimation, LazyMotion, m } from 'framer-motion'
import { ChevronRight } from 'lucide-react'
import Link from 'next/link'
import { useEffect } from 'react'
import type { Dispatch, SetStateAction } from 'react'
-import { Accordion, Button } from 'ui'
+import {
+ Accordion_Shadcn_,
+ AccordionContent_Shadcn_,
+ AccordionItem_Shadcn_,
+ AccordionTrigger_Shadcn_,
+ Button,
+} from 'ui'
import { TextLink } from 'ui-patterns/TextLink'
import MenuItem from './MenuItem'
+import SupabaseWordmark from './SupabaseWordmark'
import staticContent from '@/.generated/staticContent/_index.json'
import ProductModulesData from '@/data/ProductModules'
import { DEFAULT_EASE } from '@/lib/animations'
@@ -51,7 +57,7 @@ const MobileMenu = ({ open, setOpen, menu }: Props) => {
}, [setOpen])
const AccordionMenuItem = ({ menuItem }: any) => (
- <>
+ <AccordionContent_Shadcn_ className="p-0">
{menuItem.title === 'Product' ? (
<>
{Object.values(menuItem.subMenu)?.map((component: any) => (
@@ -165,28 +171,24 @@ const MobileMenu = ({ open, setOpen, menu }: Props) => {
))}
</div>
) : null}
- </>
+ </AccordionContent_Shadcn_>
)
const Menu = () => (
- <Accordion
- type="default"
- openBehaviour="multiple"
- size="large"
- className="space-y-1"
- justified
- chevronAlign="right"
- >
+ <Accordion_Shadcn_ type="multiple" className="px-0">
{menu.primaryNav.map((menuItem: any) => (
- <m.div variants={listItem} className="border-b [&>div]:rounded-none!" key={menuItem.title}>
+ <m.div variants={listItem} className="border-b [&>div]:rounded-none!">
{menuItem.hasDropdown ? (
- <Accordion.Item
- header={menuItem.title}
+ <AccordionItem_Shadcn_
id={menuItem.title}
- className="block relative py-2 pl-3 pr-4 text-base font-medium text-foreground hover:bg-surface-200"
+ value={menuItem.title}
+ className="border-none"
>
+ <AccordionTrigger_Shadcn_ className="py-2 pl-2 pr-4 text-base font-medium text-foreground hover:bg-surface-200">
+ {menuItem.title}
+ </AccordionTrigger_Shadcn_>
<AccordionMenuItem menuItem={menuItem} />
- </Accordion.Item>
+ </AccordionItem_Shadcn_>
) : (
<Link
href={menuItem.url}
@@ -197,7 +199,7 @@ const MobileMenu = ({ open, setOpen, menu }: Props) => {
)}
</m.div>
))}
- </Accordion>
+ </Accordion_Shadcn_>
)
return (
diff --git a/apps/www/components/Pricing/PricingFAQs.tsx b/apps/www/components/Pricing/PricingFAQs.tsx
index 9506486bc6e..1c81dcf853d 100644
--- a/apps/www/components/Pricing/PricingFAQs.tsx
+++ b/apps/www/components/Pricing/PricingFAQs.tsx
@@ -3,7 +3,12 @@
import pricingFaq from '~/data/PricingFAQ.json'
import React from 'react'
import ReactMarkdown from 'react-markdown'
-import { Accordion } from 'ui'
+import {
+ Accordion_Shadcn_,
+ AccordionContent_Shadcn_,
+ AccordionItem_Shadcn_,
+ AccordionTrigger_Shadcn_,
+} from 'ui'
const PricingFAQs = () => {
return (
@@ -11,29 +16,24 @@ const PricingFAQs = () => {
<div className="sm:py-18 mx-auto px-6 py-16 md:py-24 lg:px-16 lg:py-24 xl:px-20">
<h2 className="h3 text-center">Frequently asked questions</h2>
<div className="my-16">
- <Accordion
- type="default"
- openBehaviour="multiple"
- chevronAlign="right"
- justified
- size="medium"
- className="text-foreground-light"
- >
+ <Accordion_Shadcn_ type="multiple" className="text-foreground-light">
{pricingFaq.map((faq, i) => {
return (
<div className="border-b py-2" key={i}>
- <Accordion.Item
- header={<span className="text-foreground">{faq.question}</span>}
- id={`faq--${i.toString()}`}
- >
- <div className="prose text-foreground-lighter">
- <ReactMarkdown>{faq.answer}</ReactMarkdown>
- </div>
- </Accordion.Item>
+ <AccordionItem_Shadcn_ value={`faq--${i.toString()}`} className="border-none">
+ <AccordionTrigger_Shadcn_>
+ <span className="text-foreground">{faq.question}</span>
+ </AccordionTrigger_Shadcn_>
+ <AccordionContent_Shadcn_>
+ <div className="prose text-foreground-lighter">
+ <ReactMarkdown>{faq.answer}</ReactMarkdown>
+ </div>
+ </AccordionContent_Shadcn_>
+ </AccordionItem_Shadcn_>
</div>
)
})}
- </Accordion>
+ </Accordion_Shadcn_>
</div>
<p className="p text-center">
Can&apos;t find the answer to your question?{' '}
diff --git a/apps/www/pages/launch-week/6/index.tsx b/apps/www/pages/launch-week/6/index.tsx
index 496df84cada..cfea44c9771 100644
--- a/apps/www/pages/launch-week/6/index.tsx
+++ b/apps/www/pages/launch-week/6/index.tsx
@@ -1,21 +1,25 @@
// @ts-nocheck
-import { ExternalLink } from 'lucide-react'
-import { NextSeo } from 'next-seo'
-import Image from 'next/image'
-
+import { createClient, SupabaseClient } from '@supabase/supabase-js'
import _days from '~/components/LaunchWeek/6/lw6_days.json'
import DefaultLayout from '~/components/Layouts/Default'
import SectionContainer from '~/components/Layouts/SectionContainer'
-
-import { createClient, SupabaseClient } from '@supabase/supabase-js'
+import { SITE_ORIGIN } from '~/lib/constants'
+import type { WeekDayProps } from '~/types/launch-week-6'
import classNames from 'classnames'
+import { ExternalLink } from 'lucide-react'
+import { NextSeo } from 'next-seo'
import { useTheme } from 'next-themes'
+import Image from 'next/image'
import { useRouter } from 'next/router'
import { useEffect, useState } from 'react'
-import { Accordion, Badge } from 'ui'
-import { SITE_ORIGIN } from '~/lib/constants'
-import type { WeekDayProps } from '~/types/launch-week-6'
+import {
+ Accordion_Shadcn_,
+ AccordionContent_Shadcn_,
+ AccordionItem_Shadcn_,
+ AccordionTrigger_Shadcn_,
+ Badge,
+} from 'ui'
import styles from './styles/launchWeek6.module.css'
import styleUtils from './styles/utils6.module.css'
@@ -268,14 +272,9 @@ export default function launchweek() {
</div>
</SectionContainer>
<SectionContainer className="pt-0!">
- <Accordion
- type="default"
- openBehaviour="multiple"
- size="large"
+ <Accordion_Shadcn_
+ type="multiple"
className="text-white"
- justified={false}
- bordered={false}
- chevronAlign="right"
defaultValue={[
day1.d.toString(),
day2.d.toString(),
@@ -284,20 +283,16 @@ export default function launchweek() {
day5.d?.toString(),
]}
>
- <div className="border-b border-[#2E2E2E] pb-3">
- <Accordion.Item
- header={
- <AccordionHeader
- date={day1.date}
- day={day1.dd}
- title={day1.title}
- shipped={day1.shipped}
- />
- }
- disabled={!day1.shipped}
- className="h-[79px]"
- id={day1.d.toString()}
- >
+ <AccordionItem_Shadcn_ key={day1.dd} disabled={!day1.shipped} value={day1.d.toString()}>
+ <AccordionTrigger_Shadcn_ className="py-8 font-normal hover:no-underline">
+ <AccordionHeader
+ date={day1.date}
+ day={day1.dd}
+ title={day1.title}
+ shipped={day1.shipped}
+ />
+ </AccordionTrigger_Shadcn_>
+ <AccordionContent_Shadcn_>
{day1.steps.length > 0 && (
<div className="h-[400px] flex flex-col lg:flex-row group/day1 relative overflow-hidden">
<div
@@ -323,22 +318,18 @@ export default function launchweek() {
</div>
</div>
)}
- </Accordion.Item>
- </div>
- <div className="border-b border-[#2E2E2E] pb-3">
- <Accordion.Item
- header={
- <AccordionHeader
- date={day2.date}
- day={day2.dd}
- title={day2.title}
- shipped={day2.shipped}
- />
- }
- disabled={!day2.shipped}
- className="h-[79px]"
- id={day2.d.toString()}
- >
+ </AccordionContent_Shadcn_>
+ </AccordionItem_Shadcn_>
+ <AccordionItem_Shadcn_ key={day2.dd} disabled={!day2.shipped} value={day2.d.toString()}>
+ <AccordionTrigger_Shadcn_ className="py-8 font-normal hover:no-underline">
+ <AccordionHeader
+ date={day2.date}
+ day={day2.dd}
+ title={day2.title}
+ shipped={day2.shipped}
+ />
+ </AccordionTrigger_Shadcn_>
+ <AccordionContent_Shadcn_>
{day2.steps.length > 0 && (
<div className="h-[800px] lg:h-[400px] flex flex-col gap-5 lg:flex-row">
<div
@@ -378,22 +369,18 @@ export default function launchweek() {
</div>
</div>
)}
- </Accordion.Item>
- </div>
- <div className="border-b border-[#2E2E2E] pb-3">
- <Accordion.Item
- header={
- <AccordionHeader
- date={day3.date}
- day={day3.dd}
- title={day3.title}
- shipped={day3.shipped}
- />
- }
- disabled={!day3.shipped}
- className="h-[79px]"
- id={day3.d.toString()}
- >
+ </AccordionContent_Shadcn_>
+ </AccordionItem_Shadcn_>
+ <AccordionItem_Shadcn_ key={day3.dd} disabled={!day3.shipped} value={day3.d.toString()}>
+ <AccordionTrigger_Shadcn_ className="py-8 font-normal hover:no-underline">
+ <AccordionHeader
+ date={day3.date}
+ day={day3.dd}
+ title={day3.title}
+ shipped={day3.shipped}
+ />
+ </AccordionTrigger_Shadcn_>
+ <AccordionContent_Shadcn_>
{day3.steps.length > 0 && (
<div className="h-[400px] flex gap-5 group">
<div
@@ -427,22 +414,18 @@ export default function launchweek() {
</div>
</div>
)}
- </Accordion.Item>
- </div>
- <div className="border-b border-[#2E2E2E] pb-3">
- <Accordion.Item
- header={
- <AccordionHeader
- date={day4.date}
- day={day4.dd}
- title={day4.title}
- shipped={day4.shipped}
- />
- }
- disabled={!day4.shipped}
- className="h-[79px]"
- id={day4.d.toString()}
- >
+ </AccordionContent_Shadcn_>
+ </AccordionItem_Shadcn_>
+ <AccordionItem_Shadcn_ key={day4.dd} disabled={!day4.shipped} value={day4.d.toString()}>
+ <AccordionTrigger_Shadcn_ className="py-8 font-normal hover:no-underline">
+ <AccordionHeader
+ date={day4.date}
+ day={day4.dd}
+ title={day4.title}
+ shipped={day4.shipped}
+ />
+ </AccordionTrigger_Shadcn_>
+ <AccordionContent_Shadcn_>
{day4.steps.length > 0 && (
<div className="h-[400px] flex flex-col gap-5 lg:flex-row group/day4 relative overflow-hidden">
<div
@@ -483,22 +466,18 @@ export default function launchweek() {
</div>
</div>
)}
- </Accordion.Item>
- </div>
- <div className="border-b border-[#2E2E2E] pb-3" id="currentDay">
- <Accordion.Item
- header={
- <AccordionHeader
- date={day5.date}
- day={day5.dd}
- title={day5.title}
- shipped={day5.shipped}
- />
- }
- disabled={!day5.shipped}
- className="h-[79px]"
- id={day5.d.toString()}
- >
+ </AccordionContent_Shadcn_>
+ </AccordionItem_Shadcn_>
+ <AccordionItem_Shadcn_ key={day5.dd} disabled={!day5.shipped} value={day5.d.toString()}>
+ <AccordionTrigger_Shadcn_ className="py-8 font-normal hover:no-underline">
+ <AccordionHeader
+ date={day5.date}
+ day={day5.dd}
+ title={day5.title}
+ shipped={day5.shipped}
+ />
+ </AccordionTrigger_Shadcn_>
+ <AccordionContent_Shadcn_>
{day5.steps.length > 0 && (
<>
<div className="h-[800px] lg:h-[400px] flex flex-col gap-5 lg:flex-row">
@@ -865,9 +844,9 @@ export default function launchweek() {
</div>
</>
)}
- </Accordion.Item>
- </div>
- </Accordion>
+ </AccordionContent_Shadcn_>
+ </AccordionItem_Shadcn_>
+ </Accordion_Shadcn_>
</SectionContainer>
<SectionContainer className="py-20! sm:pb-40! sm:pt-10!"></SectionContainer>
diff --git a/packages/ui/index.tsx b/packages/ui/index.tsx
index 81222c181fb..3d07bf994c3 100644
--- a/packages/ui/index.tsx
+++ b/packages/ui/index.tsx
@@ -6,7 +6,6 @@ export * from './src/components/Icon/IconBackground'
// DISPLAYS
export * from './src/components/Tabs'
-export * from './src/components/Accordion'
// NAV
diff --git a/packages/ui/src/components/Accordion/Accordion.tsx b/packages/ui/src/components/Accordion/Accordion.tsx
deleted file mode 100644
index b67ca5309ec..00000000000
--- a/packages/ui/src/components/Accordion/Accordion.tsx
+++ /dev/null
@@ -1,148 +0,0 @@
-'use client'
-
-import { ChevronDown } from 'lucide-react'
-import { Accordion as RadixAccordion } from 'radix-ui'
-import React, { createContext, useContext, useState } from 'react'
-
-import styleHandler from '../../lib/theme/styleHandler'
-
-type Type = 'default' | 'bordered'
-type Size = 'tiny' | 'small' | 'medium' | 'large' | 'xlarge'
-type Align = 'left' | 'right'
-
-interface ContextValue {
- bordered?: boolean
- type: Type
- justified: Boolean
- chevronAlign: Align
-}
-
-const AccordionContext = createContext<ContextValue>({
- chevronAlign: 'left',
- justified: true,
- type: 'default',
-})
-
-export interface AccordionProps {
- children?: React.ReactNode
- className?: string
- defaultActiveId?: (string | number)[]
- icon?: React.ReactNode
- iconPosition?: Align
- onChange?: (item: string | string[]) => void
- openBehaviour: 'single' | 'multiple'
- type?: Type
- size?: Size
- defaultValue?: string | string[] | undefined
- justified?: Boolean
- chevronAlign?: Align
-}
-
-/**
- * @deprecated Use `import { Accordion_Shadcn_ } from "ui"` instead
- */
-function Accordion({
- children,
- className,
- onChange,
- openBehaviour = 'multiple',
- type = 'default',
- defaultValue = undefined,
- justified = false,
- chevronAlign = 'left',
-}: AccordionProps) {
- const __styles = styleHandler('accordion')
-
- let containerClasses = [__styles.variants[type].base]
-
- if (className) {
- containerClasses.push(className)
- }
-
- const contextValue = {
- chevronAlign,
- justified,
- type,
- defaultValue,
- }
-
- function handleOnChange(e: string | string[]) {
- if (onChange) onChange(e)
- // setCurrentItems(e)
- // console.log('about to change state')
- // currentItems = e
- // console.log('currentItems', currentItems)
- }
-
- return (
- <>
- {/* @ts-expect-error */}
- <RadixAccordion.Root
- type={openBehaviour}
- onValueChange={handleOnChange}
- defaultValue={defaultValue}
- className={containerClasses.join(' ')}
- >
- <AccordionContext.Provider value={{ ...contextValue }}>
- <div>{children}</div>
- </AccordionContext.Provider>
- </RadixAccordion.Root>
- </>
- )
-}
-
-interface ItemProps {
- children?: React.ReactNode
- className?: string
- header: React.ReactNode
- id: string
- icon?: React.ReactNode
- disabled?: boolean
-}
-
-/**
- * @deprecated Use ./AccordionItem_Shadcn_ instead
- */
-export function Item({ children, className, header, id, disabled }: ItemProps) {
- const __styles = styleHandler('accordion')
- const [open, setOpen] = useState(false)
-
- const { type, justified, chevronAlign } = useContext(AccordionContext)
-
- let triggerClasses = [__styles.variants[type].trigger]
- if (justified) triggerClasses.push(__styles.justified)
- if (className) triggerClasses.push(className)
-
- let chevronClasses = [__styles.chevron.base, __styles.chevron.align[chevronAlign]]
-
- if (open && !disabled) {
- chevronClasses.unshift('rotate-180!')
- }
-
- return (
- // @ts-ignore TODO: investigate why this is making TS angry
- <RadixAccordion.Item
- value={id}
- className={__styles.variants[type].container}
- disabled={disabled}
- onClick={() => {
- setOpen(!open)
- }}
- >
- {/* @ts-ignore TODO: investigate why this is making TS angry */}
- <RadixAccordion.Trigger className={triggerClasses.join(' ')}>
- {header}
- {!disabled && (
- <ChevronDown aria-hidden className={chevronClasses.join(' ')} strokeWidth={2} />
- )}
- </RadixAccordion.Trigger>
- {/* @ts-ignore TODO: investigate why this is making TS angry */}
- <RadixAccordion.Content className={__styles.variants[type].content}>
- <div className={__styles.variants[type].panel}>{children}</div>
- </RadixAccordion.Content>
- </RadixAccordion.Item>
- )
-}
-
-Accordion.Item = Item
-export default Accordion
diff --git a/packages/ui/src/components/Accordion/index.tsx b/packages/ui/src/components/Accordion/index.tsx
deleted file mode 100644
index 971fd8afcd7..00000000000
--- a/packages/ui/src/components/Accordion/index.tsx
+++ /dev/null
@@ -1 +0,0 @@
-export { default as Accordion } from './Accordion'
diff --git a/packages/ui/src/lib/theme/defaultTheme.ts b/packages/ui/src/lib/theme/defaultTheme.ts
index 97387a3aeb6..eed1660ab06 100644
--- a/packages/ui/src/lib/theme/defaultTheme.ts
+++ b/packages/ui/src/lib/theme/defaultTheme.ts
@@ -74,138 +74,12 @@ const with_icon_spacing_sizes = {
xlarge: 'pl-11',
}
-/*
- * Animations
- *
- */
-
-const default___animations = {
- accordion: {
- enter: 'transition-max-height ease-in-out duration-700 overflow-hidden',
- enterFrom: 'max-h-0',
- enterTo: 'max-h-screen',
- leave: 'transition-max-height ease-in-out duration-300 overflow-hidden',
- leaveFrom: 'max-h-screen',
- leaveTo: 'max-h-0',
- },
-}
-
/*
* Main tailwind utility classes output
*
*/
export default {
- /*
- * Accordion
- *
- */
-
- accordion: {
- variants: {
- default: {
- base: `
- flex flex-col
- space-y-3
- `,
- container: `
- group
- first:rounded-tl-md first:rounded-tr-md
- last:rounded-bl-md last:rounded-br-md
- overflow-hidden
- will-change-transform
- `,
- trigger: `
- flex flex-row
- gap-3
- items-center
- w-full
- text-left
- cursor-pointer
-
- outline-hidden
- focus-visible:ring-1
- focus-visible:z-10
- ring-foreground-light
- `,
- content: `
- data-open:animate-slide-down
- data-closed:animate-slide-up
- `,
- panel: `
- py-3
- `,
- },
- bordered: {
- base: `
- flex flex-col
- -space-y-px
- `,
- container: `
- group
- border
- border-default
-
- first:rounded-tl-md first:rounded-tr-md
- last:rounded-bl-md last:rounded-br-md
- `,
- trigger: `
- flex flex-row
- items-center
- px-6 py-4
- w-full
- text-left
- cursor-pointer
-
- font-medium
- text-base
- bg-transparent
-
- outline-hidden
- focus-visible:ring-1
- focus-visible:z-10
- ring-foreground-light
-
- transition-colors
- hover:bg-background
-
- overflow-hidden
-
- group-first:rounded-tl-md group-first:rounded-tr-md
- group-last:rounded-bl-md group-last:rounded-br-md
- `,
- content: `
- data-open:animate-slide-down
- data-closed:animate-slide-up
- `,
- panel: `
- px-6 py-3
- border-t border-strong
- bg-background
- `,
- },
- },
- justified: `justify-between`,
- chevron: {
- base: `
- text-foreground-lighter
- rotate-0
- group-state-open:rotate-180
- group-data-[state=open]:rotate-180
- ease-&lsqb;cubic-bezier(0.87,_0,_0.13,_1)&rsqb;
- transition-transform duration-300
- duration-200
- `,
- align: {
- left: 'order-first',
- right: 'order-last',
- },
- },
- animate: {
- ...default___animations.accordion,
- },
- },
-
/*
* Card
*/
diff --git a/packages/ui/src/lib/theme/styleHandler.ts b/packages/ui/src/lib/theme/styleHandler.ts
index 24976519de7..017b6735bf0 100644
--- a/packages/ui/src/lib/theme/styleHandler.ts
+++ b/packages/ui/src/lib/theme/styleHandler.ts
@@ -10,8 +10,6 @@ export default function styleHandler(target: Keys) {
theme: { [target]: __styles },
}: any = useContext(ThemeContext)
- if (!__styles) __styles = defaultTheme.accordion
-
// console.log(__styles)
// __styles.replace(/\s+/g, ' ')