Skip to content

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

remove old test component

Jonathan Summers-Muir94408cc53614
diff --git a/packages/ui/.storybook/main.js b/packages/ui/.storybook/main.js
index a163a0f971a..6eec6659784 100644
--- a/packages/ui/.storybook/main.js
+++ b/packages/ui/.storybook/main.js
@@ -1,5 +1,3 @@
-// const path = require('path')
-
module.exports = {
// // stories: [
// // '../src/components/**/*.stories.mdx',
@@ -16,7 +14,6 @@ module.exports = {
'../src/components/Collapsible/Collapsible.stories.tsx',
'../src/components/ContextMenu/ContextMenu.stories.tsx',
'../src/components/Dropdown/Dropdown.stories.tsx',
- '../src/components/DropdownTest/Dropdown-test2.stories.tsx',
],
addons: [
// '@storybook/addon-links',
@@ -43,61 +40,3 @@ module.exports = {
options: {},
},
}
-
-// module.exports = {
-// // stories: [
-// // '../src/components/**/*.stories.mdx',
-// // '../src/components/**/*.stories.@(js|jsx|ts|tsx)',
-// // ],
-// // TODO: Temporally Import one by one story and fix build issue.
-// // After all stories are cleaned, revert to wildcard import.
-// stories: [
-// '../src/components/Accordion/Accordion.stories.tsx',
-// '../src/components/Alert/Alert.stories.tsx',
-// '../src/components/Avatar/Avatar.stories.tsx',
-// '../src/components/Button/Button.stories.tsx',
-// '../src/components/Checkbox/Checkbox.stories.tsx',
-// '../src/components/Collapsible/Collapsible.stories.tsx',
-// '../src/components/ContextMenu/ContextMenu.stories.tsx',
-// '../src/components/Dropdown/Dropdown.stories.tsx',
-// ],
-
-// // addons: [
-// // '@storybook/addon-links',
-// // '@storybook/addon-essentials',
-// // '@storybook/addon-interactions',
-// // 'storybook-dark-mode',
-// // {
-// // name: '@storybook/addon-postcss',
-// // options: {
-// // postcssLoaderOptions: {
-// // implementation: require('postcss'),
-// // },
-// // },
-// // },
-// // ],
-// addons: [
-// // '@storybook/addon-links',
-// // '@storybook/addon-essentials',
-// // '@storybook/addon-interactions',
-// 'storybook-dark-mode',
-// // {
-// // name: '@storybook/addon-styling',
-// // options: {
-// // // Check out https://github.com/storybookjs/addon-styling/blob/main/docs/api.md
-// // // For more details on this addon's options.
-// // postCss: true,
-// // },
-// // },
-// '@storybook/addon-mdx-gfm',
-// ],
-// framework: {
-// name: '@storybook/react-webpack5',
-// options: {},
-// },
-//
-// // ,
-// docs: {
-// autodocs: true,
-// },
-// }
diff --git a/packages/ui/src/components/DropdownTest/Dropdown-test.stories.tsx b/packages/ui/src/components/DropdownTest/Dropdown-test.stories.tsx
deleted file mode 100644
index 75057be1fc6..00000000000
--- a/packages/ui/src/components/DropdownTest/Dropdown-test.stories.tsx
+++ /dev/null
@@ -1,323 +0,0 @@
-import React, { useState } from 'react'
-import { Dropdown } from '.'
-import { Button } from '../Button'
-import { Input } from '../Input'
-
-import { IconSettings } from '../Icon/icons/IconSettings'
-import { IconLogOut } from '../Icon/icons/IconLogOut'
-import { IconChevronDown } from '../Icon/icons/IconChevronDown'
-import { IconChevronRight } from '../Icon/icons/IconChevronRight'
-import { IconHardDrive } from '../Icon/icons/IconHardDrive'
-import { IconLogIn } from '../Icon/icons/IconLogIn'
-import { IconSearch } from '../Icon/icons/IconSearch'
-
-export default {
- title: 'Navigation/DropdownTest',
- component: Dropdown,
-}
-
-const DemoContainer = ({ children }: { children: React.ReactNode }) => (
- <div
- className="
- flex justify-center items-center
- w-screen h-screen
- "
- >
- <div
- className="
- p-3 px-5
- bg-scale-300 border border-scale-600 rounded flex gap-4
- justify-between
- items-center
- w-3/4
- "
- >
- <div>
- <h4 className="text-scale-1200 text-base">Shall we nest some components?</h4>
- <p className="text-scale-1100 text-sm">yea sure, go on then.</p>
- </div>
- <div className="relative">{children}</div>
- </div>
- </div>
-)
-
-export const DefaultFull = (args: any) => {
- const [checked, setChecked] = useState(false)
- const [value, setValue] = useState('red')
-
- return (
- <DemoContainer>
- <Dropdown
- side="bottom"
- align="end"
- overlay={[
- <Dropdown.Misc>
- <div>
- <span className="block">Signed in as </span>
-
- <span>[email protected] </span>
- </div>
- </Dropdown.Misc>,
- <Dropdown.Separator />,
- <Dropdown.Label>Group label</Dropdown.Label>,
- <Dropdown.Item onClick={() => console.log('clicked')}>Account</Dropdown.Item>,
- <Dropdown.Item>
- Settings <Dropdown.RightSlot>⌘+T</Dropdown.RightSlot>
- </Dropdown.Item>,
- <Dropdown.Separator />,
- <Dropdown.Checkbox checked={checked} onChange={setChecked}>
- Show subtitles
- </Dropdown.Checkbox>,
- <Dropdown.Separator />,
- <Dropdown.RadioGroup value={value} onChange={setValue}>
- <Dropdown.Radio value={'red'}>Red</Dropdown.Radio>
- <Dropdown.Radio value={'blue'}>Blue</Dropdown.Radio>
- <Dropdown.Radio value={'green'}>Green</Dropdown.Radio>
- </Dropdown.RadioGroup>,
- <Dropdown.Separator />,
- <Dropdown
- isNested
- overlay={[
- <Dropdown.RadioGroup value={value} onChange={setValue}>
- <Dropdown.Radio value={'red'}>Red</Dropdown.Radio>
- <Dropdown.Radio value={'blue'}>Blue</Dropdown.Radio>
- <Dropdown.Radio value={'green'}>Green</Dropdown.Radio>
- </Dropdown.RadioGroup>,
- <Dropdown.Separator />,
- <Dropdown.Label>Group label</Dropdown.Label>,
- <Dropdown.Item onClick={() => console.log('clicked')}>Account</Dropdown.Item>,
- <Dropdown.Item>
- Settings <Dropdown.RightSlot>⌘+T</Dropdown.RightSlot>
- </Dropdown.Item>,
- ]}
- >
- <Dropdown.TriggerItem icon={<IconHardDrive />}>
- Open sub menu{' '}
- <Dropdown.RightSlot>
- <IconChevronRight size={14} />
- </Dropdown.RightSlot>
- </Dropdown.TriggerItem>
- </Dropdown>,
- <Dropdown.Separator />,
- <Dropdown.Item icon={<IconLogIn size="tiny" />}>Log out</Dropdown.Item>,
- ]}
- >
- <Button as="span" type="default" iconRight={<IconChevronDown />}>
- Click for dropdown
- </Button>
- </Dropdown>
- </DemoContainer>
- )
-}
-
-export const Default = (args: any) => (
- <div style={{ margin: '0 auto', minHeight: '420px', marginTop: '220px' }}>
- <Dropdown
- {...args}
- overlay={[
- <Dropdown.Misc>
- <div>
- <span className="block">Signed in as </span>
-
- <span>[email protected] </span>
- </div>
- </Dropdown.Misc>,
- <Dropdown.Separator />,
- <Dropdown.Label>Group label</Dropdown.Label>,
- <Dropdown.Item onClick={() => console.log('clicked')}>Account</Dropdown.Item>,
- <Dropdown.Item>
- Settings <Dropdown.RightSlot>⌘+T</Dropdown.RightSlot>
- </Dropdown.Item>,
- <Dropdown.Separator />,
- <Dropdown.Item icon={<IconLogIn size="tiny" />}>Log out</Dropdown.Item>,
- ]}
- >
- <Button as="span" type="secondary" iconRight={<IconChevronDown />}>
- Click for dropdown
- </Button>
- </Dropdown>
- </div>
-)
-
-Default.args = {}
-
-export const doNotcloseOverlay = (args: any) => (
- <div style={{ margin: '0 auto', minHeight: '420px', marginTop: '220px' }}>
- <Dropdown
- {...args}
- overlay={[
- <Dropdown.Misc>
- <span>Signed in as </span>
- <span>[email protected] </span>
- </Dropdown.Misc>,
- <Dropdown.Separator />,
- <Dropdown.Item>Account</Dropdown.Item>,
- <Dropdown.Item>Settings</Dropdown.Item>,
- <Dropdown.Item>
- <Button icon={<IconLogOut />}>Log out</Button>
- </Dropdown.Item>,
- ]}
- >
- <Button as="span" type="outline" iconRight={<IconChevronDown />}>
- Click for dropdown
- </Button>
- </Dropdown>
- </div>
-)
-
-doNotcloseOverlay.args = {}
-
-export const withCustomStyles = (args: any) => (
- <div
- style={{
- margin: '0 auto',
- minHeight: '420px',
- marginTop: '220px',
- marginLeft: '400px',
- }}
- >
- <Dropdown
- overlayStyle={{ minWidth: '500px' }}
- placement="bottomRight"
- {...args}
- overlay={[
- <Dropdown.Item>
- <span>Signed in as </span>
- <span>[email protected] </span>
- </Dropdown.Item>,
- <Dropdown.Separator />,
- <Dropdown.Item>Account</Dropdown.Item>,
- <Dropdown.Item>Settings</Dropdown.Item>,
- <Dropdown.Separator />,
- <Dropdown.Item>
- <Button type="default" icon={<IconLogOut />}>
- Log out
- </Button>
- </Dropdown.Item>,
- ]}
- >
- <Button as="span" type="outline" iconRight={<IconChevronDown />}>
- Click for dropdown
- </Button>
- </Dropdown>
- </div>
-)
-
-withCustomStyles.args = {}
-
-export const SearchList = (args: any) => (
- <div style={{ margin: '0 auto', minHeight: '420px', marginTop: '220px' }}>
- <Dropdown
- {...args}
- overlay={[
- <Dropdown.Misc>
- <Input size="tiny" icon={<IconSearch size={14} />} autoFocus={false} />
- </Dropdown.Misc>,
- <Dropdown.Item>
- <span>Signed in as </span>
- <span>[email protected] </span>
- </Dropdown.Item>,
- <Dropdown.Item>
- <span>Signed in as </span>
- <span>[email protected] </span>
- </Dropdown.Item>,
- <Dropdown.Separator />,
- <Dropdown.Item icon={<IconLogIn />}>
- <span>Log out</span>
- </Dropdown.Item>,
- ]}
- >
- <Button as="span" type="outline" iconRight={<IconChevronDown />}>
- Click for dropdown
- </Button>
- </Dropdown>
- </div>
-)
-
-SearchList.args = {}
-
-export const Checkbox = (args: any) => {
- const [checked, setChecked] = useState(false)
-
- return (
- <div style={{ margin: '0 auto', minHeight: '420px', marginTop: '220px' }}>
- <Dropdown
- {...args}
- overlay={[
- <Dropdown.Item icon={<IconSettings size="small" />}>Account</Dropdown.Item>,
- <Dropdown.Item>Settings</Dropdown.Item>,
- <Dropdown.Separator />,
- <Dropdown.Checkbox checked={checked} onChange={setChecked}>
- Show subtitles
- </Dropdown.Checkbox>,
- ]}
- >
- <Button as="span" type="outline" iconRight={<IconChevronDown />}>
- Click for dropdown
- </Button>
- </Dropdown>
- </div>
- )
-}
-
-export const Radio = (args: any) => {
- const [value, setValue] = useState('red')
-
- return (
- <div style={{ margin: '0 auto', minHeight: '420px', marginTop: '220px' }}>
- <Dropdown
- {...args}
- overlay={[
- <Dropdown.RadioGroup value={value} onChange={setValue}>
- <Dropdown.Radio value={'red'}>Red</Dropdown.Radio>
- <Dropdown.Radio value={'blue'}>Blue</Dropdown.Radio>
- <Dropdown.Radio value={'green'}>Green</Dropdown.Radio>
- </Dropdown.RadioGroup>,
- ]}
- >
- <Button as="span" type="outline" iconRight={<IconChevronDown />}>
- Click for dropdown
- </Button>
- </Dropdown>
- </div>
- )
-}
-
-export const Nested = (args: any) => {
- const [value, setValue] = useState('red')
-
- return (
- <div style={{ margin: '0 auto', minHeight: '420px', marginTop: '220px' }}>
- <Dropdown
- {...args}
- overlay={
- <>
- <Dropdown.RadioGroup value={value} onChange={setValue}>
- <Dropdown.Radio value={'red'}>Red</Dropdown.Radio>
- <Dropdown.Radio value={'blue'}>Blue</Dropdown.Radio>
- <Dropdown.Radio value={'green'}>Green</Dropdown.Radio>
- </Dropdown.RadioGroup>
-
- <Dropdown
- isNested
- overlay={[
- <Dropdown.RadioGroup value={value} onChange={setValue}>
- <Dropdown.Radio value={'red'}>Red</Dropdown.Radio>
- <Dropdown.Radio value={'blue'}>Blue</Dropdown.Radio>
- <Dropdown.Radio value={'green'}>Green</Dropdown.Radio>
- </Dropdown.RadioGroup>,
- ]}
- >
- <Dropdown.TriggerItem>Open sub menu</Dropdown.TriggerItem>
- </Dropdown>
- <Dropdown.Item>hello</Dropdown.Item>
- </>
- }
- >
- <Button as="span" type="outline" iconRight={<IconChevronDown />}>
- Click for dropdown
- </Button>
- </Dropdown>
- </div>
- )
-}
diff --git a/packages/ui/src/components/DropdownTest/Dropdown-test2.stories.tsx b/packages/ui/src/components/DropdownTest/Dropdown-test2.stories.tsx
deleted file mode 100644
index 09a352b7382..00000000000
--- a/packages/ui/src/components/DropdownTest/Dropdown-test2.stories.tsx
+++ /dev/null
@@ -1,131 +0,0 @@
-import {
- Cloud,
- CreditCard,
- Github,
- Keyboard,
- LifeBuoy,
- LogOut,
- Mail,
- MessageSquare,
- Plus,
- PlusCircle,
- Settings,
- User,
- UserPlus,
- Users,
-} from 'lucide-react'
-
-import { Button } from './../Button'
-import {
- DropdownMenu,
- DropdownMenuContent,
- DropdownMenuGroup,
- DropdownMenuItem,
- DropdownMenuLabel,
- DropdownMenuPortal,
- DropdownMenuSeparator,
- DropdownMenuShortcut,
- DropdownMenuSub,
- DropdownMenuSubContent,
- DropdownMenuSubTrigger,
- DropdownMenuTrigger,
-} from './Dropdown'
-
-import { Dropdown } from '.'
-
-export default {
- title: 'Navigation/DropdownTest',
- component: Dropdown,
-}
-
-export const DropdownMenuDemo = () => {
- return (
- <div>
- <DropdownMenu>
- <DropdownMenuTrigger asChild>
- <Button type="outline">Open</Button>
- </DropdownMenuTrigger>
- <DropdownMenuContent className="w-56">
- <DropdownMenuLabel>My Account</DropdownMenuLabel>
- <DropdownMenuSeparator />
- <DropdownMenuGroup>
- <DropdownMenuItem>
- <User className="mr-2 h-4 w-4" />
- <span>Profile</span>
- <DropdownMenuShortcut>⇧⌘P</DropdownMenuShortcut>
- </DropdownMenuItem>
- <DropdownMenuItem>
- <CreditCard className="mr-2 h-4 w-4" />
- <span>Billing</span>
- <DropdownMenuShortcut>⌘B</DropdownMenuShortcut>
- </DropdownMenuItem>
- <DropdownMenuItem>
- <Settings className="mr-2 h-4 w-4" />
- <span>Settings</span>
- <DropdownMenuShortcut>⌘S</DropdownMenuShortcut>
- </DropdownMenuItem>
- <DropdownMenuItem>
- <Keyboard className="mr-2 h-4 w-4" />
- <span>Keyboard shortcuts</span>
- <DropdownMenuShortcut>⌘K</DropdownMenuShortcut>
- </DropdownMenuItem>
- </DropdownMenuGroup>
- <DropdownMenuSeparator />
- <DropdownMenuGroup>
- <DropdownMenuItem>
- <Users className="mr-2 h-4 w-4" />
- <span>Team</span>
- </DropdownMenuItem>
- <DropdownMenuSub>
- <DropdownMenuSubTrigger>
- <UserPlus className="mr-2 h-4 w-4" />
- <span>Invite users</span>
- </DropdownMenuSubTrigger>
- <DropdownMenuPortal>
- <DropdownMenuSubContent>
- <DropdownMenuItem>
- <Mail className="mr-2 h-4 w-4" />
- <span>Email</span>
- </DropdownMenuItem>
- <DropdownMenuItem>
- <MessageSquare className="mr-2 h-4 w-4" />
- <span>Message</span>
- </DropdownMenuItem>
- <DropdownMenuSeparator />
- <DropdownMenuItem>
- <PlusCircle className="mr-2 h-4 w-4" />
- <span>More...</span>
- </DropdownMenuItem>
- </DropdownMenuSubContent>
- </DropdownMenuPortal>
- </DropdownMenuSub>
- <DropdownMenuItem>
- <Plus className="mr-2 h-4 w-4" />
- <span>New Team</span>
- <DropdownMenuShortcut>⌘+T</DropdownMenuShortcut>
- </DropdownMenuItem>
- </DropdownMenuGroup>
- <DropdownMenuSeparator />
- <DropdownMenuItem>
- <Github className="mr-2 h-4 w-4" />
- <span>GitHub</span>
- </DropdownMenuItem>
- <DropdownMenuItem>
- <LifeBuoy className="mr-2 h-4 w-4" />
- <span>Support</span>
- </DropdownMenuItem>
- <DropdownMenuItem disabled>
- <Cloud className="mr-2 h-4 w-4" />
- <span>API</span>
- </DropdownMenuItem>
- <DropdownMenuSeparator />
- <DropdownMenuItem>
- <LogOut className="mr-2 h-4 w-4" />
- <span>Log out</span>
- <DropdownMenuShortcut>⇧⌘Q</DropdownMenuShortcut>
- </DropdownMenuItem>
- </DropdownMenuContent>
- </DropdownMenu>
- </div>
- )
-}
diff --git a/packages/ui/src/components/DropdownTest/Dropdown.module.css b/packages/ui/src/components/DropdownTest/Dropdown.module.css
deleted file mode 100644
index 751546ff202..00000000000
--- a/packages/ui/src/components/DropdownTest/Dropdown.module.css
+++ /dev/null
@@ -1,112 +0,0 @@
-/* .sbui-dropdown-item {
- @apply text-xs;
- @apply text-typography-body-light dark:text-typography-body-dark;
- @apply px-4 py-1.5 flex items-center space-x-2;
- @apply cursor-pointer;
- @apply focus:bg-bg-secondary-light dark:focus:bg-bg-primary-dark border-none;
- cursor: 'default';
-
- user-select: none;
-}
-
-/* .sbui-dropdown-item svg {
- @apply text-typography-body-secondary-light dark:text-typography-body-secondary-dark;
-} */
-
-/* .sbui-dropdown-label {
- @apply text-typography-body-secondary-light dark:text-typography-body-secondary-dark;
- @apply px-4 py-1.5 flex items-center space-x-2;
- font-size: 0.65rem;
-}
-
-.sbui-dropdown-misc {
- @apply px-4 py-1.5;
-}
-
-.sbui-dropdown-item:focus-visible {
- border: none;
- outline: none;
-}
-
-.sbui-dropdown-input {
- @apply flex items-center space-x-0 pl-8 pr-4;
-}
-
-.sbui-dropdown-input__check {
- @apply absolute left-2;
- @apply flex items-center;
-} */
-
-/* .sbui-dropdown__content {
- @apply bg-bg-primary-light dark:bg-bg-secondary-dark p-0;
- @apply border border-lightmode dark:border-darkmode;
- @apply rounded;
- @apply shadow;
- border-style: solid;
- border-width: 1px;
-} */
-
-/* @keyframes fadeIn {
- from {
- transform: scale(0.95);
- opacity: 0;
- }
- to {
- transform: scale(1);
- opacity: 1;
- }
-}
-
-@keyframes fadeOut {
- from {
- transform: scale(1);
- opacity: 1;
- }
- to {
- transform: scale(0.95);
- opacity: 0;
- }
-} */
-/* .sbui-dropdown__content {
- transform-origin: 'var(--radix-dropdown-menu-content-transform-origin)';
-} */
-
-/* .sbui-dropdown__content[data-state='open'] {
- animation: fadeIn 50ms ease-out;
-}
-
-.sbui-dropdown__content[data-state='closed'] {
- animation: fadeOut 50ms ease-in;
-} */
-
-/* .sbui-dropdown__trigger {
- @apply border-none bg-transparent p-0 focus:ring-0;
-} */
-
-/* .sbui-dropdown__arrow {
- @apply fill-current text-bg-primary-light dark:text-bg-secondary-dark;
- @apply border-0 border-t;
- border-style: solid;
-
-}
-
-.sbui-dropdown-item-trigger {
- @apply text-xs;
- @apply text-typography-body-light dark:text-typography-body-dark;
- @apply px-4 py-1.5 flex items-center space-x-2;
- @apply cursor-pointer;
- cursor: 'default';
-}
-
-.sbui-dropdown-item-trigger svg {
- @apply text-typography-body-secondary-light dark:text-typography-body-secondary-dark;
-}
-
-.sbui-dropdown-item-trigger:focus-visible {
- border: none;
- outline: none;
-} */
-
-/* .sbui-dropdown__trigger-item[data-state='open'] {
- @apply bg-bg-secondary-light dark:bg-bg-primary-dark border-none;
-} */
diff --git a/packages/ui/src/components/DropdownTest/Dropdown.tsx b/packages/ui/src/components/DropdownTest/Dropdown.tsx
deleted file mode 100644
index 34103d1a039..00000000000
--- a/packages/ui/src/components/DropdownTest/Dropdown.tsx
+++ /dev/null
@@ -1,183 +0,0 @@
-import * as React from 'react'
-import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu'
-import { Check, ChevronRight, Circle } from 'lucide-react'
-
-import { cn } from './../../utils/cn'
-
-const DropdownMenu = DropdownMenuPrimitive.Root
-
-const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger
-
-const DropdownMenuGroup = DropdownMenuPrimitive.Group
-
-const DropdownMenuPortal = DropdownMenuPrimitive.Portal
-
-const DropdownMenuSub = DropdownMenuPrimitive.Sub
-
-const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup
-
-const DropdownMenuSubTrigger = React.forwardRef<
- React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {
- inset?: boolean
- }
->(({ className, inset, children, ...props }, ref) => (
- <DropdownMenuPrimitive.SubTrigger
- ref={ref}
- className={cn(
- 'flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent',
- inset && 'pl-8',
- className
- )}
- {...props}
- >
- {children}
- <ChevronRight className="ml-auto h-4 w-4" />
- </DropdownMenuPrimitive.SubTrigger>
-))
-DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName
-
-const DropdownMenuSubContent = React.forwardRef<
- React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>
->(({ className, ...props }, ref) => (
- <DropdownMenuPrimitive.SubContent
- ref={ref}
- className={cn(
- 'z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1',
- className
- )}
- {...props}
- />
-))
-DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName
-
-const DropdownMenuContent = React.forwardRef<
- React.ElementRef<typeof DropdownMenuPrimitive.Content>,
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>
->(({ className, sideOffset = 4, ...props }, ref) => (
- <DropdownMenuPrimitive.Portal>
- <DropdownMenuPrimitive.Content
- ref={ref}
- sideOffset={sideOffset}
- className={cn(
- 'z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
- className
- )}
- {...props}
- />
- </DropdownMenuPrimitive.Portal>
-))
-DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName
-
-const DropdownMenuItem = React.forwardRef<
- React.ElementRef<typeof DropdownMenuPrimitive.Item>,
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {
- inset?: boolean
- }
->(({ className, inset, ...props }, ref) => (
- <DropdownMenuPrimitive.Item
- ref={ref}
- className={cn(
- 'relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
- inset && 'pl-8',
- className
- )}
- {...props}
- />
-))
-DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName
-
-const DropdownMenuCheckboxItem = React.forwardRef<
- React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>
->(({ className, children, checked, ...props }, ref) => (
- <DropdownMenuPrimitive.CheckboxItem
- ref={ref}
- className={cn(
- 'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
- className
- )}
- checked={checked}
- {...props}
- >
- <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
- <DropdownMenuPrimitive.ItemIndicator>
- <Check className="h-4 w-4" />
- </DropdownMenuPrimitive.ItemIndicator>
- </span>
- {children}
- </DropdownMenuPrimitive.CheckboxItem>
-))
-DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName
-
-const DropdownMenuRadioItem = React.forwardRef<
- React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>
->(({ className, children, ...props }, ref) => (
- <DropdownMenuPrimitive.RadioItem
- ref={ref}
- className={cn(
- 'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
- className
- )}
- {...props}
- >
- <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
- <DropdownMenuPrimitive.ItemIndicator>
- <Circle className="h-2 w-2 fill-current" />
- </DropdownMenuPrimitive.ItemIndicator>
- </span>
- {children}
- </DropdownMenuPrimitive.RadioItem>
-))
-DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName
-
-const DropdownMenuLabel = React.forwardRef<
- React.ElementRef<typeof DropdownMenuPrimitive.Label>,
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {
- inset?: boolean
- }
->(({ className, inset, ...props }, ref) => (
- <DropdownMenuPrimitive.Label
- ref={ref}
- className={cn('px-2 py-1.5 text-sm font-semibold', inset && 'pl-8', className)}
- {...props}
- />
-))
-DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName
-
-const DropdownMenuSeparator = React.forwardRef<
- React.ElementRef<typeof DropdownMenuPrimitive.Separator>,
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>
->(({ className, ...props }, ref) => (
- <DropdownMenuPrimitive.Separator
- ref={ref}
- className={cn('-mx-1 my-1 h-px bg-muted', className)}
- {...props}
- />
-))
-DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName
-
-const DropdownMenuShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {
- return <span className={cn('ml-auto text-xs tracking-widest opacity-60', className)} {...props} />
-}
-DropdownMenuShortcut.displayName = 'DropdownMenuShortcut'
-
-export {
- DropdownMenu,
- DropdownMenuTrigger,
- DropdownMenuContent,
- DropdownMenuItem,
- DropdownMenuCheckboxItem,
- DropdownMenuRadioItem,
- DropdownMenuLabel,
- DropdownMenuSeparator,
- DropdownMenuShortcut,
- DropdownMenuGroup,
- DropdownMenuPortal,
- DropdownMenuSub,
- DropdownMenuSubContent,
- DropdownMenuSubTrigger,
- DropdownMenuRadioGroup,
-}
diff --git a/packages/ui/src/components/DropdownTest/index.tsx b/packages/ui/src/components/DropdownTest/index.tsx
deleted file mode 100644
index a34974dee8c..00000000000
--- a/packages/ui/src/components/DropdownTest/index.tsx
+++ /dev/null
@@ -1 +0,0 @@
-export { default as Dropdown } from './Dropdown'