diff --git a/design-system/website/components/Navigation.tsx b/design-system/website/components/Navigation.tsx index f93a7e9ea14..858370aca59 100644 --- a/design-system/website/components/Navigation.tsx +++ b/design-system/website/components/Navigation.tsx @@ -6,7 +6,7 @@ import { jsx, useTheme } from '@keystone-ui/core' import Link from 'next/link' import { useRouter } from 'next/router' -const Brand = () => { +function Brand () { const { palette } = useTheme() return (

@@ -25,7 +25,7 @@ const Brand = () => { } type SectionProps = { label: string, children: ReactNode } -const Section = ({ label, children }: SectionProps) => { +function Section ({ label, children }: SectionProps) { return (

{label}

@@ -35,7 +35,7 @@ const Section = ({ label, children }: SectionProps) => { } type NavItemProps = { href: string, children: ReactNode } -const NavItem = ({ href, children }: NavItemProps) => { +function NavItem ({ href, children }: NavItemProps) { const { palette, radii, spacing } = useTheme() const router = useRouter() const isSelected = router.pathname === href @@ -68,7 +68,7 @@ const NavItem = ({ href, children }: NavItemProps) => { ) } -export const Navigation = () => { +export function Navigation () { return ( diff --git a/packages/core/src/___internal-do-not-use-will-break-in-patch/admin-ui/id-field-view.tsx b/packages/core/src/___internal-do-not-use-will-break-in-patch/admin-ui/id-field-view.tsx index 9c1eba2faaf..a112ca8da38 100644 --- a/packages/core/src/___internal-do-not-use-will-break-in-patch/admin-ui/id-field-view.tsx +++ b/packages/core/src/___internal-do-not-use-will-break-in-patch/admin-ui/id-field-view.tsx @@ -4,7 +4,6 @@ import { TextField } from '@keystar/ui/text-field' import { jsx } from '@keystone-ui/core' -import { TextInput } from '@keystone-ui/fields' import type { CellComponent, FieldController, diff --git a/packages/core/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/CreateItemPage/index.tsx b/packages/core/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/CreateItemPage/index.tsx index b45b3078531..ac237695945 100644 --- a/packages/core/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/CreateItemPage/index.tsx +++ b/packages/core/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/CreateItemPage/index.tsx @@ -1,8 +1,8 @@ +import React from 'react' import { useRouter } from 'next/router' import { Button } from '@keystar/ui/button' import { VStack } from '@keystar/ui/layout' - import { LoadingDots } from '@keystone-ui/loading' import { Fields } from '../../../../admin-ui/utils' @@ -14,8 +14,7 @@ import { BaseToolbar, ColumnLayout, ItemPageHeader } from '../ItemPage/common' type CreateItemPageProps = { listKey: string } -export const getCreateItemPage = (props: CreateItemPageProps) => () => - +export const getCreateItemPage = (props: CreateItemPageProps) => () => function CreateItemPage (props: CreateItemPageProps) { const router = useRouter() diff --git a/packages/core/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/HomePage/index.tsx b/packages/core/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/HomePage/index.tsx index 1f93537b4d2..4ccccc276e0 100644 --- a/packages/core/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/HomePage/index.tsx +++ b/packages/core/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/HomePage/index.tsx @@ -1,4 +1,9 @@ -import { type PropsWithChildren, useId, useMemo, useRef } from 'react' +import React, { + type PropsWithChildren, + useId, + useMemo, + useRef +} from 'react' import { ActionButton } from '@keystar/ui/button' import { Icon } from '@keystar/ui/icon' diff --git a/packages/core/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ItemPage/index.tsx b/packages/core/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ItemPage/index.tsx index 5b2639750cb..1e07fb28ad5 100644 --- a/packages/core/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ItemPage/index.tsx +++ b/packages/core/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ItemPage/index.tsx @@ -1,6 +1,4 @@ -import copyToClipboard from 'clipboard-copy' -import { useRouter } from 'next/router' -import { +import React, { type PropsWithChildren, type ReactElement, Fragment, @@ -11,6 +9,8 @@ import { useRef, useState, } from 'react' +import copyToClipboard from 'clipboard-copy' +import { useRouter } from 'next/router' import { ActionButton, Button } from '@keystar/ui/button' import { Icon } from '@keystar/ui/icon' @@ -31,12 +31,12 @@ import type { ListMeta, FieldMeta } from '../../../../types' import { type DataGetter, type DeepNullable, - makeDataGetter, - deserializeValue, type ItemData, - useInvalidFields, Fields, + deserializeValue, + makeDataGetter, useChangedFieldsAndDataForUpdate, + useInvalidFields, } from '../../../../admin-ui/utils' import { gql, useMutation, useQuery } from '../../../../admin-ui/apollo' import { useList } from '../../../../admin-ui/context' diff --git a/packages/core/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/FieldSelection.tsx b/packages/core/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/FieldSelection.tsx index ac1a79567f9..12a4437085c 100644 --- a/packages/core/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/FieldSelection.tsx +++ b/packages/core/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/FieldSelection.tsx @@ -1,5 +1,8 @@ +import React, { + type Key, + useMemo, +} from 'react' import { useRouter } from 'next/router' -import { useMemo, type Key } from 'react' import { ActionButton } from '@keystar/ui/button' import { Icon } from '@keystar/ui/icon' @@ -7,7 +10,7 @@ import { chevronDownIcon } from '@keystar/ui/icon/icons/chevronDownIcon' import { MenuTrigger, Menu, Item } from '@keystar/ui/menu' import { Text } from '@keystar/ui/typography' -import { type ListMeta } from '../../../../types' +import type { ListMeta } from '../../../../types' import { useSelectedFields } from './useSelectedFields' export function FieldSelection ({ @@ -41,7 +44,7 @@ export function FieldSelection ({ isDisabled: selectedFields.size === 1 && selectedFields.has(fieldPath), })) }, [fieldModesByFieldPath, list.fields, selectedFields]) - + return ( diff --git a/packages/core/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/FilterAdd.tsx b/packages/core/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/FilterAdd.tsx index f96bc4f908e..85f78d88aa8 100644 --- a/packages/core/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/FilterAdd.tsx +++ b/packages/core/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/FilterAdd.tsx @@ -1,11 +1,11 @@ import { useRouter } from 'next/router' -import { type FormEvent, Fragment, useMemo, useState, useRef } from 'react' +import React, { type FormEvent, Fragment, useMemo, useState, useRef } from 'react' import { ActionButton, ButtonGroup, Button } from '@keystar/ui/button' import { Dialog, DialogTrigger } from '@keystar/ui/dialog' import { Icon } from '@keystar/ui/icon' import { chevronDownIcon } from '@keystar/ui/icon/icons/chevronDownIcon' -import { Grid, VStack } from '@keystar/ui/layout' +import { Grid } from '@keystar/ui/layout' import { MenuTrigger, Menu, Item } from '@keystar/ui/menu' import { Picker } from '@keystar/ui/picker' import { Content } from '@keystar/ui/slots' @@ -117,7 +117,7 @@ export function FilterAdd (props: { ) } - + return ( diff --git a/packages/core/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/FilterList.tsx b/packages/core/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/FilterList.tsx index 9ad87c5bd7d..646e1b3f4e4 100644 --- a/packages/core/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/FilterList.tsx +++ b/packages/core/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/FilterList.tsx @@ -1,5 +1,5 @@ import { useRouter } from 'next/router' -import { type FormEvent, useState } from 'react' +import React, { type FormEvent, useState } from 'react' import { ButtonGroup, Button } from '@keystar/ui/button' import { Dialog, DialogTrigger } from '@keystar/ui/dialog' @@ -108,4 +108,4 @@ function FilterDialog ({ ) -} \ No newline at end of file +} diff --git a/packages/core/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/Pagination.tsx b/packages/core/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/Pagination.tsx index 575bcac5b69..d21a53786cd 100644 --- a/packages/core/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/Pagination.tsx +++ b/packages/core/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/Pagination.tsx @@ -1,5 +1,5 @@ import { useRouter } from 'next/router' -import React, { type Key, type ReactNode, useEffect, useId, useMemo } from 'react' +import React, { type Key, useEffect, useMemo } from 'react' import { ActionButton } from '@keystar/ui/button' import { Icon } from '@keystar/ui/icon' @@ -7,9 +7,7 @@ import { chevronLeftIcon } from '@keystar/ui/icon/icons/chevronLeftIcon' import { chevronRightIcon } from '@keystar/ui/icon/icons/chevronRightIcon' import { HStack } from '@keystar/ui/layout' import { Item, Picker } from '@keystar/ui/picker' -import { css, tokenSchema } from '@keystar/ui/style' import { Text } from '@keystar/ui/typography' -import { composeId } from '@keystar/ui/utils' type PaginationProps = { pageSize: number @@ -213,4 +211,4 @@ function snapValueToClosest (input: number, range = PAGE_SIZES) { } function snapValueToNextAvailable (input: number, range = PAGE_SIZES) { return range.find(value => input <= value) ?? range[range.length - 1] -} \ No newline at end of file +} diff --git a/packages/core/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/index.tsx b/packages/core/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/index.tsx index 2fc9b56a0b0..2055cf46c62 100644 --- a/packages/core/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/index.tsx +++ b/packages/core/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/index.tsx @@ -1,13 +1,11 @@ -import { useRouter } from 'next/router' -import { +import React, { type Key, - type HTMLAttributes, - type ReactNode, Fragment, useEffect, useMemo, useState } from 'react' +import { useRouter } from 'next/router' import { ActionBar, ActionBarContainer, Item } from '@keystar/ui/action-bar' import { ActionButton } from '@keystar/ui/button' @@ -17,7 +15,7 @@ import { textSelectIcon } from '@keystar/ui/icon/icons/textSelectIcon' import { searchXIcon } from '@keystar/ui/icon/icons/searchXIcon' import { trash2Icon } from '@keystar/ui/icon/icons/trash2Icon' import { undo2Icon } from '@keystar/ui/icon/icons/undo2Icon' -import { Box, HStack, VStack } from '@keystar/ui/layout' +import { HStack, VStack } from '@keystar/ui/layout' import { ProgressCircle } from '@keystar/ui/progress' import { SearchField } from '@keystar/ui/search-field' import { css, tokenSchema } from '@keystar/ui/style' @@ -34,21 +32,12 @@ import { toastQueue } from '@keystar/ui/toast' import { TooltipTrigger, Tooltip } from '@keystar/ui/tooltip' import { Heading, Text } from '@keystar/ui/typography' -import { Button } from '@keystone-ui/button' -import { jsx, useTheme } from '@keystone-ui/core' -import { CheckboxControl } from '@keystone-ui/fields' -import { ArrowRightCircleIcon } from '@keystone-ui/icons/icons/ArrowRightCircleIcon' -import { useToasts } from '@keystone-ui/toast' - -import { type ListMeta } from '../../../../types' import { - getRootGraphQLFieldsFromFieldController, type DataGetter, type DeepNullable, makeDataGetter, } from '../../../../admin-ui/utils' import { gql, type TypedDocumentNode, useMutation, useQuery } from '../../../../admin-ui/apollo' -import { CellLink } from '../../../../admin-ui/components' import { PageContainer } from '../../../../admin-ui/components/PageContainer' import { useList } from '../../../../admin-ui/context' import { EmptyState } from '../../../../admin-ui/components/EmptyState' @@ -276,10 +265,10 @@ function ListPage ({ listKey }: ListPageProps) { {error?.graphQLErrors.length || error?.networkError ? ( ) : null} - + {/* FIXME: consolidate error messages. */} {/* {metaQuery.error ? 'Error...' : null} */} - + {data && metaQuery.data ? ( {/* FIXME: this is really weird; not sure where it should live. */} @@ -380,12 +369,7 @@ function ListTable ({ }) { const list = useList(listKey) const router = useRouter() - const shouldShowLinkIcon = - !list.fields[selectedFields.keys().next().value].views.Cell.supportsLinkTo - - // New stuff - const [selectedKeys, setSelectedKeys] = useState(() => new Set([]) - ) + const [selectedKeys, setSelectedKeys] = useState(() => new Set([])) const onSortChange = (sortDescriptor: SortDescriptor) => { const sortBy = sortDescriptor.direction === 'ascending' ? `-${sortDescriptor.column}` : sortDescriptor.column router.push({ query: { ...router.query, sortBy } }) @@ -453,9 +437,8 @@ function ListTable ({ return ( {key => { - const field = list.fields[key] - const CellValue = field.views.Cell - + // TODO: FIXME + // const field = list.fields[key] return ( {row[key]?.toString()} @@ -476,7 +459,7 @@ function ListTable ({ ) }} - ) + ) }} @@ -504,7 +487,7 @@ function ListTable ({ ids.push(item.id) } } - + setIdsForDeletion(new Set(ids)) } else { setIdsForDeletion(selectedKeys) @@ -556,7 +539,7 @@ function parseSortQuery (queryString?: string | string[]): SortDescriptor { const column = queryString.startsWith('-') ? queryString.slice(1) : queryString const direction = queryString.startsWith('-') ? 'ascending' : 'descending' - + return { column, direction } } @@ -564,7 +547,7 @@ function DeleteItemsDialog (props: { items: Set, listKey: string, refetch: const { items, listKey, refetch } = props const list = useList(listKey) - const [deleteItems, deleteItemsState] = useMutation( + const [deleteItems] = useMutation( useMemo( () => gql` @@ -590,7 +573,7 @@ function DeleteItemsDialog (props: { items: Set, listKey: string, refetch: Run a reduce to count success and failure as well as to generate the success message to be passed to the success toast */ - const { successfulItems, unsuccessfulItems, successMessage } = data[ + const { successfulItems, unsuccessfulItems } = data[ list.gqlNames.deleteManyMutationName ].reduce( ( diff --git a/packages/core/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/NoAccessPage/index.tsx b/packages/core/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/NoAccessPage/index.tsx index c26088f9b4c..f5ca90b5968 100644 --- a/packages/core/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/NoAccessPage/index.tsx +++ b/packages/core/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/NoAccessPage/index.tsx @@ -1,3 +1,4 @@ +import React from 'react' import { Icon } from '@keystar/ui/icon' import { shieldAlertIcon } from '@keystar/ui/icon/icons/shieldAlertIcon' import { Heading, Text } from '@keystar/ui/typography' @@ -9,7 +10,7 @@ type NoAccessPage = { sessionsEnabled: boolean } export const getNoAccessPage = (props: NoAccessPage) => () => -export const NoAccessPage = ({ sessionsEnabled }: NoAccessPage) => { +export function NoAccessPage ({ sessionsEnabled }: NoAccessPage) { return ( diff --git a/packages/core/src/admin-ui/components/Container.tsx b/packages/core/src/admin-ui/components/Container.tsx index f5e434c537c..4494318a695 100644 --- a/packages/core/src/admin-ui/components/Container.tsx +++ b/packages/core/src/admin-ui/components/Container.tsx @@ -1,11 +1,11 @@ +import React from 'react' import { type PropsWithChildren } from 'react' - import { type BoxProps, Box } from '@keystar/ui/layout' -export const Container = (props: PropsWithChildren) => ( - ) { + return -) +} diff --git a/packages/core/src/admin-ui/components/CreateButtonLink.tsx b/packages/core/src/admin-ui/components/CreateButtonLink.tsx index df704a02967..b5663881b47 100644 --- a/packages/core/src/admin-ui/components/CreateButtonLink.tsx +++ b/packages/core/src/admin-ui/components/CreateButtonLink.tsx @@ -1,3 +1,4 @@ +import React from 'react' import { Button } from '@keystar/ui/button' import { Text } from '@keystar/ui/typography' diff --git a/packages/core/src/admin-ui/components/Errors.tsx b/packages/core/src/admin-ui/components/Errors.tsx index 0eb9a146d91..a21be3adab2 100644 --- a/packages/core/src/admin-ui/components/Errors.tsx +++ b/packages/core/src/admin-ui/components/Errors.tsx @@ -1,4 +1,4 @@ -import { Component, type ReactNode } from 'react' +import React, { Component, type ReactNode } from 'react' import { Button } from '@keystar/ui/button' import { Icon } from '@keystar/ui/icon' diff --git a/packages/core/src/admin-ui/components/Logo.tsx b/packages/core/src/admin-ui/components/Logo.tsx index fae71acf19d..d064f56af8c 100644 --- a/packages/core/src/admin-ui/components/Logo.tsx +++ b/packages/core/src/admin-ui/components/Logo.tsx @@ -1,5 +1,5 @@ +import React from 'react' import Link from 'next/link' - import { css, tokenSchema } from '@keystar/ui/style' import { Heading } from '@keystar/ui/typography' @@ -7,11 +7,7 @@ import { useKeystone } from '../context' export function Logo () { const { adminConfig } = useKeystone() - - if (adminConfig.components?.Logo) { - return - } - + if (adminConfig.components?.Logo) return return } diff --git a/packages/core/src/admin-ui/components/Navigation.tsx b/packages/core/src/admin-ui/components/Navigation.tsx index fbe55cbe8de..0ce86a4aa31 100644 --- a/packages/core/src/admin-ui/components/Navigation.tsx +++ b/packages/core/src/admin-ui/components/Navigation.tsx @@ -1,4 +1,4 @@ -import { type ReactNode, Fragment, useMemo } from 'react' +import React, { type ReactNode, Fragment, useMemo } from 'react' import { useRouter } from 'next/router' import { ActionButton } from '@keystar/ui/button' @@ -8,8 +8,8 @@ import { constructionIcon } from '@keystar/ui/icon/icons/constructionIcon' import { githubIcon } from '@keystar/ui/icon/icons/githubIcon' import { fileJson2Icon } from '@keystar/ui/icon/icons/fileJson2Icon' import { MenuTrigger, Menu, Item } from '@keystar/ui/menu' -import { Box, Divider, HStack, VStack } from '@keystar/ui/layout' -import { NavList, NavItem as KeystarNavItem, NavGroup as KeystarNavGroup } from '@keystar/ui/nav-list' +import { Box, HStack, VStack } from '@keystar/ui/layout' +import { NavList, NavItem as KeystarNavItem } from '@keystar/ui/nav-list' import { Notice } from '@keystar/ui/notice' import { TooltipTrigger, Tooltip } from '@keystar/ui/tooltip' import { Text } from '@keystar/ui/typography' @@ -51,20 +51,20 @@ type ListNavItemsProps = Pick & { * Group related navigation items together into categories, under a * common title. */ -export const NavGroup = KeystarNavGroup +export { NavGroup } from '@keystar/ui/nav-list' + /** * Dividers can be used to separate navigation items. Prefer `NavGroup` for * grouping related items under a common title. */ -export const NavDivider = Divider - +import { Divider } from '@keystar/ui/layout' /** * A navigation item represents a page in the admin UI. Prefer `ListNavItems` * for managing navigation between lists. */ -export const NavItem = (props: NavItemProps) => { +export function NavItem (props: NavItemProps) { const { children, href, isSelected: isSelectedProp } = props const router = useRouter() @@ -93,7 +93,7 @@ export const NavItem = (props: NavItemProps) => { * markup around navigation items, as well as the different states of * the `authenticatedItem` element. */ -export const NavigationContainer = ({ authenticatedItem, children }: NavigationContainerProps) => { +export function NavigationContainer ({ authenticatedItem, children }: NavigationContainerProps) { return ( @@ -108,7 +108,7 @@ export const NavigationContainer = ({ authenticatedItem, children }: NavigationC * Render navigation items for the provided lists. Optionally filter the lists * to include only those with specific keys. */ -export const ListNavItems = ({ lists = [], include = [] }: ListNavItemsProps) => { +export function ListNavItems ({ lists = [], include = [] }: ListNavItemsProps) { const filteredLists = useMemo(() => { if (include.length === 0) { return lists @@ -130,7 +130,7 @@ export const ListNavItems = ({ lists = [], include = [] }: ListNavItemsProps) => /** * @private Exported for internal consumption only. */ -export const Navigation = () => { +export function Navigation () { const { adminMeta: { lists }, adminConfig, diff --git a/packages/core/src/admin-ui/components/Pagination.tsx b/packages/core/src/admin-ui/components/Pagination.tsx index 2f6a6f859f1..59e1de252ab 100644 --- a/packages/core/src/admin-ui/components/Pagination.tsx +++ b/packages/core/src/admin-ui/components/Pagination.tsx @@ -1,9 +1,9 @@ /** @jsxRuntime classic */ /** @jsx jsx */ +import { useEffect } from 'react' import Link from 'next/link' import { useRouter } from 'next/router' -import { useEffect } from 'react' import { jsx, Stack, useTheme } from '@keystone-ui/core' import { Select } from '@keystone-ui/fields' diff --git a/packages/core/src/admin-ui/components/SignoutButton.tsx b/packages/core/src/admin-ui/components/SignoutButton.tsx index 5955ccf9bc8..6e3eaba4748 100644 --- a/packages/core/src/admin-ui/components/SignoutButton.tsx +++ b/packages/core/src/admin-ui/components/SignoutButton.tsx @@ -1,5 +1,8 @@ -import { ActionButton, type ActionButtonProps } from '@keystar/ui/button' -import { useEffect } from 'react' +import React, { useEffect } from 'react' +import { + type ActionButtonProps, + ActionButton, +} from '@keystar/ui/button' import { useMutation, gql } from '../apollo' diff --git a/packages/core/src/admin-ui/components/index.ts b/packages/core/src/admin-ui/components/index.ts index 5c77031c715..cf1d5f5a128 100644 --- a/packages/core/src/admin-ui/components/index.ts +++ b/packages/core/src/admin-ui/components/index.ts @@ -10,7 +10,6 @@ export { ErrorBoundary, ErrorContainer } from './Errors' export { Logo } from './Logo' export { ListNavItems, - NavDivider, NavGroup, NavigationContainer, NavItem, diff --git a/packages/core/src/fields/types/checkbox/views/index.tsx b/packages/core/src/fields/types/checkbox/views/index.tsx index 05da4709d44..1b8f8b35748 100644 --- a/packages/core/src/fields/types/checkbox/views/index.tsx +++ b/packages/core/src/fields/types/checkbox/views/index.tsx @@ -1,10 +1,8 @@ +import React from 'react' import { Badge } from '@keystar/ui/badge' import { Checkbox } from '@keystar/ui/checkbox' -import { FieldLabel } from '@keystar/ui/field' -import { VStack } from '@keystar/ui/layout' import { Text } from '@keystar/ui/typography' -import { jsx, useTheme } from '@keystone-ui/core' import type { CellComponent, FieldController, diff --git a/packages/core/src/fields/types/relationship/views/RelationshipSelect.tsx b/packages/core/src/fields/types/relationship/views/RelationshipSelect.tsx index d08e29888b6..112e6f3b491 100644 --- a/packages/core/src/fields/types/relationship/views/RelationshipSelect.tsx +++ b/packages/core/src/fields/types/relationship/views/RelationshipSelect.tsx @@ -1,5 +1,5 @@ import 'intersection-observer' -import { useEffect, useMemo, useState } from 'react' +import React, { useEffect, useMemo, useState } from 'react' import { Combobox, Item } from '@keystar/ui/combobox' import { type ListMeta } from '../../../../types' diff --git a/packages/core/src/fields/types/select/views/SegmentedControl.tsx b/packages/core/src/fields/types/select/views/SegmentedControl.tsx index 61f5b4ece3a..f75c5ecf367 100644 --- a/packages/core/src/fields/types/select/views/SegmentedControl.tsx +++ b/packages/core/src/fields/types/select/views/SegmentedControl.tsx @@ -1,8 +1,14 @@ -import { useField } from '@react-aria/label' import React from 'react' +import { useField } from '@react-aria/label' -import { type ActionGroupProps, ActionGroup, Item } from '@keystar/ui/action-group' -import { type FieldProps, FieldPrimitive } from '@keystar/ui/field' +import { + type ActionGroupProps, + ActionGroup +} from '@keystar/ui/action-group' +import { + type FieldProps, + FieldPrimitive +} from '@keystar/ui/field' import { TextField } from '@keystar/ui/text-field' type Key = number | string // React.Key now includes bigint, which isn't supported by @react-aria @@ -65,4 +71,4 @@ export function SegmentedControl (props: SegmentedControlProps) { ) -} \ No newline at end of file +} diff --git a/packages/core/src/fields/types/select/views/index.tsx b/packages/core/src/fields/types/select/views/index.tsx index fe7e97bd4e7..48eb3403ac4 100644 --- a/packages/core/src/fields/types/select/views/index.tsx +++ b/packages/core/src/fields/types/select/views/index.tsx @@ -1,4 +1,4 @@ -import { type Key, useMemo, useRef, useState } from 'react' +import React, { type Key, useMemo, useRef, useState } from 'react' import { useListFormatter } from '@react-aria/i18n' import { ListView } from '@keystar/ui/list-view' @@ -7,7 +7,6 @@ import { VStack } from '@keystar/ui/layout' import { Item, Picker } from '@keystar/ui/picker' import { Radio, RadioGroup } from '@keystar/ui/radio' import { tokenSchema } from '@keystar/ui/style' -import { Text } from '@keystar/ui/typography' import { NullableFieldWrapper } from '../../../../admin-ui/components' import { SegmentedControl } from './SegmentedControl' diff --git a/packages/core/src/fields/types/text/views/index.tsx b/packages/core/src/fields/types/text/views/index.tsx index e16499568a8..f041165e984 100644 --- a/packages/core/src/fields/types/text/views/index.tsx +++ b/packages/core/src/fields/types/text/views/index.tsx @@ -1,9 +1,5 @@ -import { useState } from 'react' - -import { FieldLabel } from '@keystar/ui/field' -import { VStack } from '@keystar/ui/layout' +import React, { useState } from 'react' import { TextArea, TextField } from '@keystar/ui/text-field' -import { Text } from '@keystar/ui/typography' import type { CellComponent, @@ -12,7 +8,7 @@ import type { FieldProps, } from '../../../../types' import { CellContainer, CellLink, NullableFieldWrapper } from '../../../../admin-ui/components' -import { type TextFieldMeta } from '..' +import type { TextFieldMeta } from '..' export function Field (props: FieldProps) { const { autoFocus, field, forceValidation, onChange, value } = props diff --git a/packages/core/src/types/admin-meta.ts b/packages/core/src/types/admin-meta.ts index f06fc9d8eaf..847583f463b 100644 --- a/packages/core/src/types/admin-meta.ts +++ b/packages/core/src/types/admin-meta.ts @@ -1,5 +1,5 @@ import type { GraphQLError } from 'graphql' -import type { ReactElement, ReactNode } from 'react' +import type { ReactElement } from 'react' import type { InitialisedList } from '../lib/core/initialise-lists' import type { JSONValue } from './utils' diff --git a/packages/core/tsconfig.json b/packages/core/tsconfig.json deleted file mode 100644 index b2e6ab1879c..00000000000 --- a/packages/core/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "esModuleInterop": true, - "jsx": "preserve", - "lib": ["esnext", "dom"], - "outDir": "dist", - "sourceMap": true, - "strict": true, - "target": "es2015", - "allowJs": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true, - "noEmit": true, - "module": "esnext", - "moduleResolution": "bundler", - "resolveJsonModule": true, - "isolatedModules": true, - "incremental": true - }, - "exclude": ["node_modules"], - "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"] -}