diff --git a/.eslintignore b/.eslintignore
index 5f9da3887be..3871e24b96c 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -1,10 +1,3 @@
-node_modules
-coverage
-dist
-reports
-docs/public/assets/
-examples/extend-graphql-schema-nexus/nexus-types.ts
-examples/framework-remix/build/index.js
-tests/test-projects/live-reloading/schemas/syntax-error.js
-__generated__
-
+dist/
+node_modules/
+syntax-error.js
diff --git a/.eslintrc.js b/.eslintrc.js
deleted file mode 100644
index 168b40e5923..00000000000
--- a/.eslintrc.js
+++ /dev/null
@@ -1,115 +0,0 @@
-const reactComponentTypeMessage = {
- message:
- 'This type includes the children prop which is generally wrong, instead of using this type, type the props of the component',
-};
-
-module.exports = {
- parser: '@typescript-eslint/parser',
- env: {
- browser: true,
- es6: true,
- node: true,
- jest: true,
- },
- plugins: ['react', 'react-hooks', 'jest', 'import', '@typescript-eslint'],
- settings: {
- react: {
- version: 'detect',
- },
- },
- rules: {
- curly: ['error', 'multi-line'],
- 'jsx-quotes': 'error',
- 'no-trailing-spaces': 'error',
- 'no-undef': 'error',
- 'no-unused-expressions': 'error',
- 'react-hooks/rules-of-hooks': 'error',
- 'react-hooks/exhaustive-deps': 'error',
- '@typescript-eslint/no-unused-vars': 'off',
- 'import/no-extraneous-dependencies': [
- 'error',
- {
- devDependencies: [
- '**/__tests__/**/*',
- '**/*test.*',
- '**/tests/**/*',
- '**/build/**/*',
- `packages/fields/src/**/filterTests.*`,
- '**/test-fixtures.*',
- ],
- },
- ],
- 'import/no-unresolved': 'error',
- 'import/order': 'error',
- 'jest/valid-describe': 'off',
- 'jest/valid-expect': 'off',
- 'jest/no-conditional-expect': 'off',
- 'jest/no-standalone-expect': 'off',
- 'jest/expect-expect': 'off',
- 'jest/no-export': 'off',
- 'jest/valid-title': 'off',
- 'jest/no-try-expect': 'off',
- 'jest/no-disabled-tests': 'error',
- 'object-curly-spacing': ['error', 'always'],
- quotes: ['error', 'single', { avoidEscape: true, allowTemplateLiterals: true }],
- 'react/jsx-boolean-value': 'error',
- 'react/jsx-no-undef': 'error',
- 'react/jsx-uses-react': 'error',
- 'react/jsx-uses-vars': 'error',
- 'react/jsx-wrap-multilines': 'error',
- 'react/react-in-jsx-scope': 'error',
- 'react/self-closing-comp': 'error',
- semi: 'off',
- strict: 'off',
- 'no-restricted-syntax': [
- 'error',
- {
- // Curious why we have this rule?
- // - Enums only work for a subset of use cases that unions of string literals + objects work for and learning one language feature is easier than learning two language features
- // - Enums are a new language feature which have runtime semantics which means they change TypeScript from JS + types to JS + types + extra language features which is harder to teach without clear advantages for this specific feature
- selector: 'TSEnumDeclaration',
- message: 'Use a union of string literals instead of an enum',
- },
- ],
- '@typescript-eslint/ban-types': [
- 'error',
- {
- extendDefaults: false,
- types: {
- Function:
- '`Function` types are unsafe. Use more specific function types instead. e.g. (arg: number) => string',
- String: {
- message:
- 'The `String` type refers to the String object which is probably not what you want, you probably want `string` instead which refers to the string primitive type.',
- fixWith: 'string',
- },
- ComponentType: reactComponentTypeMessage,
- FC: reactComponentTypeMessage,
- SFC: reactComponentTypeMessage,
- 'React.ComponentType': reactComponentTypeMessage,
- 'React.FC': reactComponentTypeMessage,
- 'React.SFC': reactComponentTypeMessage,
- },
- },
- ],
- },
- extends: ['plugin:jest/recommended'],
-
- // Disable some rules for (code blocks within) Markdown docs
- overrides: [
- {
- files: ['**/*.{ts,tsx}'],
- rules: {
- // TypeScript already checks for the following things and they conflict with TypeScript
- 'import/no-unresolved': 'off',
- 'no-undef': 'off',
- },
- },
- {
- files: ['packages/core/src/scripts/tests/fixtures/**/*.{ts,tsx}'],
- rules: {
- 'import/no-extraneous-dependencies': 'off',
- },
- },
- ],
-};
diff --git a/.github/workflows/tests_ci.yml b/.github/workflows/tests_ci.yml
index 0f72a698a23..f6ae1ff633c 100644
--- a/.github/workflows/tests_ci.yml
+++ b/.github/workflows/tests_ci.yml
@@ -19,20 +19,14 @@ jobs:
- uses: actions/checkout@main
- uses: ./.github/actions/ci-setup
- - name: Prettier
- run: pnpm lint:prettier
-
- name: TypeScript
- run: pnpm lint:types
-
- - name: ESLint
- run: pnpm lint:eslint
+ run: pnpm test:types
- name: Preconstruct
run: pnpm build
- name: Prisma Filters
- run: pnpm lint:filters
+ run: pnpm test:filters
unit_tests:
name: Package Unit Tests
diff --git a/.github/workflows/tests_ci_windows.yml b/.github/workflows/tests_ci_windows.yml
index bd162778fa7..07b932dc82b 100644
--- a/.github/workflows/tests_ci_windows.yml
+++ b/.github/workflows/tests_ci_windows.yml
@@ -8,16 +8,6 @@ concurrency:
cancel-in-progress: true
jobs:
- linting:
- name: Linting
- runs-on: windows-latest
- steps:
- - uses: actions/checkout@main
- - uses: ./.github/actions/ci-setup
-
- - name: TypeScript
- run: pnpm lint:types
-
unit_tests:
name: Package Unit Tests
runs-on: windows-latest
diff --git a/.gitignore b/.gitignore
index c8e97b28dbe..9a1df743cce 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,15 +1,12 @@
-.env
-.next
-.keystone
+.keystone/
+.next/
dist/
node_modules/
-
-# sqlite databases
*.db
# ts-gql
__generated__
-# OS
+# system
.DS_Store
*.vscode
diff --git a/.nvmrc b/.nvmrc
deleted file mode 100644
index 209e3ef4b62..00000000000
--- a/.nvmrc
+++ /dev/null
@@ -1 +0,0 @@
-20
diff --git a/.prettierignore b/.prettierignore
deleted file mode 100644
index e80b48597de..00000000000
--- a/.prettierignore
+++ /dev/null
@@ -1,18 +0,0 @@
-**/.keystone
-**/.next
-**/__generated__
-**/dist
-**/*.graphql
-*.vscode
-.changeset/**/*
-.keystone/tests
-docs/**/*.md
-docs/public/assets/*.js
-examples/custom-output-paths/my-types.ts
-examples/extend-graphql-schema-nexus/keystone-types.ts
-examples/extend-graphql-schema-nexus/nexus-types.ts
-nexus-typegen.ts
-packages/icons/icons/*
-pnpm-lock.yaml
-prisma-utils/src/generated
-tests/test-projects/live-reloading/schemas/syntax-error.js
diff --git a/.remarkignore b/.remarkignore
deleted file mode 100644
index 83b694704ba..00000000000
--- a/.remarkignore
+++ /dev/null
@@ -1 +0,0 @@
-CHANGELOG.md
\ No newline at end of file
diff --git a/CODE-OF-CONDUCT.md b/CODE-OF-CONDUCT.md
index a976a5d4269..26db7e00297 100644
--- a/CODE-OF-CONDUCT.md
+++ b/CODE-OF-CONDUCT.md
@@ -2,75 +2,133 @@
## Our Pledge
-In the interest of fostering an open and welcoming environment, we as
-contributors and maintainers pledge to making participation in our project and
-our community a harassment-free experience for everyone, regardless of age, body
-size, disability, ethnicity, sex characteristics, gender identity and expression,
-level of experience, education, socio-economic status, nationality, personal
-appearance, race, religion, or sexual identity and orientation.
+We as members, contributors, and leaders pledge to make participation in our
+community a harassment-free experience for everyone, regardless of age, body
+size, visible or invisible disability, ethnicity, sex characteristics, gender
+identity and expression, level of experience, education, socio-economic status,
+nationality, personal appearance, race, caste, color, religion, or sexual
+identity and orientation.
+
+We pledge to act and interact in ways that contribute to an open, welcoming,
+diverse, inclusive, and healthy community.
## Our Standards
-Examples of behavior that contributes to creating a positive environment
-include:
+Examples of behavior that contributes to a positive environment for our
+community include:
-- Using welcoming and inclusive language
-- Being respectful of other people
-- Gracefully accepting constructive criticism
-- Focusing on what is best for the community
-- Showing empathy towards other community members
+- Demonstrating empathy and kindness toward other people
+- Being respectful of differing opinions, viewpoints, and experiences
+- Giving and gracefully accepting constructive feedback
+- Accepting responsibility and apologizing to those affected by our mistakes,
+ and learning from the experience
+- Focusing on what is best not just for us as individuals, but for the overall
+ community
-Examples of unacceptable behavior by participants include:
+Examples of unacceptable behavior include:
-- The use of sexualized language or imagery and unwelcome sexual attention or
- advances
-- Trolling, insulting/derogatory comments, and personal or political attacks
+- The use of sexualized language or imagery, and sexual attention or advances of
+ any kind
+- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
-- Publishing others' private information, such as a physical or electronic
- address, without explicit permission
+- Publishing others' private information, such as a physical or email address,
+ without their explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting
-## Our Responsibilities
+## Enforcement Responsibilities
-Project maintainers are responsible for clarifying the standards of acceptable
-behavior and are expected to take appropriate and fair corrective action in
-response to any instances of unacceptable behavior.
+Community leaders are responsible for clarifying and enforcing our standards of
+acceptable behavior and will take appropriate and fair corrective action in
+response to any behavior that they deem inappropriate, threatening, offensive,
+or harmful.
-Project maintainers have the right and responsibility to remove, edit, or
-reject comments, commits, code, wiki edits, issues, and other contributions
-that are not aligned to this Code of Conduct, or to ban temporarily or
-permanently any contributor for other behaviors that they deem inappropriate,
-threatening, offensive, or harmful.
+Community leaders have the right and responsibility to remove, edit, or reject
+comments, commits, code, wiki edits, issues, and other contributions that are
+not aligned to this Code of Conduct, and will communicate reasons for moderation
+decisions when appropriate.
## Scope
-This Code of Conduct applies both within project spaces and in public spaces
-when an individual is representing the project or its community. Examples of
-representing a project or community include using an official project e-mail
-address, posting via an official social media account, or acting as an appointed
-representative at an online or offline event. Representation of a project may be
-further defined and clarified by project maintainers.
+This Code of Conduct applies within all community spaces, and also applies when
+an individual is officially representing the community in public spaces.
+Examples of representing our community include using an official e-mail address,
+posting via an official social media account, or acting as an appointed
+representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
-reported by contacting the project team at `codeofconduct@keystonejs.com`. All
-complaints will be reviewed and investigated and will result in a response that
-is deemed necessary and appropriate to the circumstances. The project team is
-obligated to maintain confidentiality with regard to the reporter of an incident.
-Further details of specific enforcement policies may be posted separately.
+reported to the community leaders responsible for enforcement at
+[community@keystonejs.com](mailto:community@keystonejs.com).
+
+All complaints will be reviewed and investigated promptly and fairly.
+
+All community leaders are obligated to respect the privacy and security of the
+reporter of any incident.
+
+## Enforcement Guidelines
+
+Community leaders will follow these Community Impact Guidelines in determining
+the consequences for any action they deem in violation of this Code of Conduct:
+
+### 1. Correction
+
+**Community Impact**: Use of inappropriate language or other behavior deemed
+unprofessional or unwelcome in the community.
+
+**Consequence**: A private, written warning from community leaders, providing
+clarity around the nature of the violation and an explanation of why the
+behavior was inappropriate. A public apology may be requested.
+
+### 2. Warning
-Project maintainers who do not follow or enforce the Code of Conduct in good
-faith may face temporary or permanent repercussions as determined by other
-members of the project's leadership.
+**Community Impact**: A violation through a single incident or series of
+actions.
+
+**Consequence**: A warning with consequences for continued behavior. No
+interaction with the people involved, including unsolicited interaction with
+those enforcing the Code of Conduct, for a specified period of time. This
+includes avoiding interactions in community spaces as well as external channels
+like social media. Violating these terms may lead to a temporary or permanent
+ban.
+
+### 3. Temporary Ban
+
+**Community Impact**: A serious violation of community standards, including
+sustained inappropriate behavior.
+
+**Consequence**: A temporary ban from any sort of interaction or public
+communication with the community for a specified period of time. No public or
+private interaction with the people involved, including unsolicited interaction
+with those enforcing the Code of Conduct, is allowed during this period.
+Violating these terms may lead to a permanent ban.
+
+### 4. Permanent Ban
+
+**Community Impact**: Demonstrating a pattern of violation of community
+standards, including sustained inappropriate behavior, harassment of an
+individual, or aggression toward or disparagement of classes of individuals.
+
+**Consequence**: A permanent ban from any sort of public interaction within the
+community.
## Attribution
-This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
-available at
+This Code of Conduct is adapted from the [Contributor Covenant][homepage],
+version 2.1, available at
+[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
+
+Community Impact Guidelines were inspired by
+[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
+
+For answers to common questions about this code of conduct, see the FAQ at
+[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
+[https://www.contributor-covenant.org/translations][translations].
[homepage]: https://www.contributor-covenant.org
+[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
+[Mozilla CoC]: https://github.com/mozilla/diversity
+[FAQ]: https://www.contributor-covenant.org/faq
+[translations]: https://www.contributor-covenant.org/translations
-For answers to common questions about this code of conduct, see
-
diff --git a/design-system/packages/button/src/Button.tsx b/design-system/packages/button/src/Button.tsx
index 47449de6abb..03b33760799 100644
--- a/design-system/packages/button/src/Button.tsx
+++ b/design-system/packages/button/src/Button.tsx
@@ -1,51 +1,51 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { ReactNode, useContext } from 'react';
-import { forwardRefWithAs, jsx } from '@keystone-ui/core';
-import { LoadingDots } from '@keystone-ui/loading';
+import { type ReactNode, useContext } from 'react'
+import { forwardRefWithAs, jsx } from '@keystone-ui/core'
+import { LoadingDots } from '@keystone-ui/loading'
-import { ButtonContext } from './context';
-import type { WeightKey, ToneKey, SizeKey } from './hooks/button';
+import { ButtonContext } from './context'
+import type { WeightKey, ToneKey, SizeKey } from './hooks/button'
type ButtonProps = {
/** The Button label content. */
- children: ReactNode;
+ children: ReactNode
/** Whether the Button should display as a block */
- isBlock?: boolean;
+ isBlock?: boolean
/** Whether the Button should be disabled */
- isDisabled?: boolean;
+ isDisabled?: boolean
/** Whether the Button should be in a loading state */
- isLoading?: boolean;
+ isLoading?: boolean
/** The size of the Button. */
- size?: SizeKey;
+ size?: SizeKey
/** The tone of the Button. */
- tone?: ToneKey;
+ tone?: ToneKey
/** The weight of the Button. */
- weight?: WeightKey;
-};
+ weight?: WeightKey
+}
const loadingContainerStyles = {
left: '50%',
position: 'absolute',
transform: 'translateX(-50%)',
-} as const;
+} as const
export const Button = forwardRefWithAs<'button', ButtonProps>(
(
{ as: Tag = 'button', children, isDisabled, isLoading, size, tone, weight, ...otherProps },
ref
) => {
- const { useButtonStyles, useButtonTokens, defaults } = useContext(ButtonContext);
+ const { useButtonStyles, useButtonTokens, defaults } = useContext(ButtonContext)
const tokens = useButtonTokens({
size: size || defaults.size,
tone: tone || defaults.tone,
weight: weight || defaults.weight,
- });
+ })
const styles = useButtonStyles({
isDisabled,
tokens,
- });
+ })
return (
@@ -56,6 +56,6 @@ export const Button = forwardRefWithAs<'button', ButtonProps>(
)}
- );
+ )
}
-);
+)
diff --git a/design-system/packages/button/src/context.tsx b/design-system/packages/button/src/context.tsx
index 9785e91447b..87c04f851f2 100644
--- a/design-system/packages/button/src/context.tsx
+++ b/design-system/packages/button/src/context.tsx
@@ -1,49 +1,49 @@
-import React, { ReactNode, createContext, useContext, useMemo } from 'react';
+import React, { type ReactNode, createContext, useContext, useMemo } from 'react'
import {
buttonPropDefaults,
useButtonStyles,
useButtonTokens,
- SizeKey,
- ToneKey,
- WeightKey,
-} from './hooks/button';
+ type SizeKey,
+ type ToneKey,
+ type WeightKey,
+} from './hooks/button'
export const ButtonContext = createContext<{
defaults: {
- size: SizeKey;
- tone: ToneKey;
- weight: WeightKey;
- };
- useButtonStyles: typeof useButtonStyles;
- useButtonTokens: typeof useButtonTokens;
+ size: SizeKey
+ tone: ToneKey
+ weight: WeightKey
+ }
+ useButtonStyles: typeof useButtonStyles
+ useButtonTokens: typeof useButtonTokens
}>({
defaults: buttonPropDefaults,
useButtonStyles,
useButtonTokens,
-});
+})
// Note hooks are optional for the provider value, but not in the context created above; this is
// because they will be merged with the existing context and always exist in the value
type ProviderHooksProp = {
- useButtonStyles?: typeof useButtonStyles;
- useButtonTokens?: typeof useButtonTokens;
-};
+ useButtonStyles?: typeof useButtonStyles
+ useButtonTokens?: typeof useButtonTokens
+}
type ProviderDefaultsProp = {
- size?: SizeKey;
- tone?: ToneKey;
- weight?: WeightKey;
-};
+ size?: SizeKey
+ tone?: ToneKey
+ weight?: WeightKey
+}
export const ButtonProvider = ({
defaults,
hooks,
children,
}: {
- defaults?: ProviderDefaultsProp;
- hooks?: ProviderHooksProp;
- children: ReactNode;
+ defaults?: ProviderDefaultsProp
+ hooks?: ProviderHooksProp
+ children: ReactNode
}) => {
- const parentContext = useContext(ButtonContext);
+ const parentContext = useContext(ButtonContext)
const newContext = useMemo(
() => ({
...parentContext,
@@ -54,6 +54,6 @@ export const ButtonProvider = ({
},
}),
[parentContext, hooks, defaults]
- );
- return {children} ;
-};
+ )
+ return {children}
+}
diff --git a/design-system/packages/button/src/hooks/button.ts b/design-system/packages/button/src/hooks/button.ts
index d1c01bac213..a1599d3541e 100644
--- a/design-system/packages/button/src/hooks/button.ts
+++ b/design-system/packages/button/src/hooks/button.ts
@@ -1,9 +1,9 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { useTheme } from '@keystone-ui/core';
+import { useTheme } from '@keystone-ui/core'
-export const buttonSizeValues = ['large', 'medium', 'small'] as const;
+export const buttonSizeValues = ['large', 'medium', 'small'] as const
export const buttonToneValues = [
'active',
'passive',
@@ -11,60 +11,60 @@ export const buttonToneValues = [
'warning',
'negative',
'help',
-] as const;
-export const buttonWeightValues = ['bold', 'light', 'none', 'link'] as const;
+] as const
+export const buttonWeightValues = ['bold', 'light', 'none', 'link'] as const
-export type SizeKey = (typeof buttonSizeValues)[number];
-export type ToneKey = (typeof buttonToneValues)[number];
-export type WeightKey = (typeof buttonWeightValues)[number];
+export type SizeKey = (typeof buttonSizeValues)[number]
+export type ToneKey = (typeof buttonToneValues)[number]
+export type WeightKey = (typeof buttonWeightValues)[number]
export type ButtonPropDefaults = {
- size: SizeKey;
- tone: ToneKey;
- weight: WeightKey;
-};
+ size: SizeKey
+ tone: ToneKey
+ weight: WeightKey
+}
export const buttonPropDefaults = {
size: 'medium',
tone: 'passive',
weight: 'light',
-} as const;
+} as const
type ButtonTokensProps = {
- size: SizeKey;
- tone: ToneKey;
- weight: WeightKey;
-};
+ size: SizeKey
+ tone: ToneKey
+ weight: WeightKey
+}
type ButtonStateTokens = {
- background?: string;
- borderColor?: string;
- foreground?: string;
- shadow?: string;
- textDecoration?: string;
-};
+ background?: string
+ borderColor?: string
+ foreground?: string
+ shadow?: string
+ textDecoration?: string
+}
export type ButtonTokens = {
- borderRadius?: number;
- borderWidth?: number;
- disabledOpacity: number;
- fontSize?: number | string;
- fontWeight?: number;
- height?: number;
- paddingX?: number;
- transition?: string;
- focus: ButtonStateTokens;
- hover: ButtonStateTokens;
- pressed: ButtonStateTokens;
-} & ButtonStateTokens;
-
-type Weight = ButtonStateTokens & Pick;
-
-export function useButtonTokens({
+ borderRadius?: number
+ borderWidth?: number
+ disabledOpacity: number
+ fontSize?: number | string
+ fontWeight?: number
+ height?: number
+ paddingX?: number
+ transition?: string
+ focus: ButtonStateTokens
+ hover: ButtonStateTokens
+ pressed: ButtonStateTokens
+} & ButtonStateTokens
+
+type Weight = ButtonStateTokens & Pick
+
+export function useButtonTokens ({
tone: toneKey,
size: sizeKey,
weight: weightKey,
}: ButtonTokensProps): ButtonTokens {
- const { animation, colors, tones, typography, controlSizes, opacity } = useTheme();
- const tone = tones[toneKey];
- const size = controlSizes[sizeKey];
+ const { animation, colors, tones, typography, controlSizes, opacity } = useTheme()
+ const tone = tones[toneKey]
+ const size = controlSizes[sizeKey]
const weights: { [key in WeightKey]: Weight } = {
bold: {
@@ -125,9 +125,9 @@ export function useButtonTokens({
textDecoration: 'underline',
},
},
- };
+ }
- const weight = weights[weightKey];
+ const weight = weights[weightKey]
const tokens: ButtonTokens = {
borderRadius: size.borderRadius,
@@ -144,18 +144,18 @@ export function useButtonTokens({
opacity ${animation.duration100},
`,
...weight,
- };
+ }
- return tokens;
+ return tokens
}
type ButtonStylesProps = {
- isDisabled?: boolean;
- isBlock?: boolean;
- tokens: ButtonTokens;
-};
+ isDisabled?: boolean
+ isBlock?: boolean
+ tokens: ButtonTokens
+}
-export function useButtonStyles({ isDisabled, isBlock, tokens }: ButtonStylesProps) {
+export function useButtonStyles ({ isDisabled, isBlock, tokens }: ButtonStylesProps) {
const baseStyles = {
alignItems: 'center',
borderStyle: 'solid',
@@ -172,7 +172,7 @@ export function useButtonStyles({ isDisabled, isBlock, tokens }: ButtonStylesPro
userSelect: 'none',
whiteSpace: 'nowrap',
width: isBlock ? '100%' : undefined,
- } as const;
+ } as const
const tokenStyles = {
backgroundColor: tokens.background || 'transparent',
@@ -209,7 +209,7 @@ export function useButtonStyles({ isDisabled, isBlock, tokens }: ButtonStylesPro
color: tokens.pressed.foreground,
textDecoration: tokens.pressed.textDecoration,
},
- };
+ }
- return { ...baseStyles, ...tokenStyles };
+ return { ...baseStyles, ...tokenStyles }
}
diff --git a/design-system/packages/button/src/index.ts b/design-system/packages/button/src/index.ts
index 52deb61bb86..51cfb43c647 100644
--- a/design-system/packages/button/src/index.ts
+++ b/design-system/packages/button/src/index.ts
@@ -1,3 +1,3 @@
-export * from './Button';
-export * from './context';
-export * from './hooks/button';
+export * from './Button'
+export * from './context'
+export * from './hooks/button'
diff --git a/design-system/packages/core/src/a11y/VisuallyHidden.tsx b/design-system/packages/core/src/a11y/VisuallyHidden.tsx
index c7899890941..7c18962bb46 100644
--- a/design-system/packages/core/src/a11y/VisuallyHidden.tsx
+++ b/design-system/packages/core/src/a11y/VisuallyHidden.tsx
@@ -1,19 +1,19 @@
-import React, { ReactNode } from 'react';
-import { forwardRefWithAs } from '../utils';
+import React, { type ReactNode } from 'react'
+import { forwardRefWithAs } from '../utils'
// Only display content to screen readers
// ------------------------------
// See: https://a11yproject.com/posts/how-to-hide-content/
type Props = {
- children?: ReactNode;
-};
+ children?: ReactNode
+}
export const VisuallyHidden = forwardRefWithAs<'span', Props>(
({ as: Tag = 'span', ...props }, ref) => {
- return ;
+ return
}
-);
+)
export const visuallyHiddenStyles = {
border: 0,
@@ -24,4 +24,4 @@ export const visuallyHiddenStyles = {
position: 'absolute',
whiteSpace: 'nowrap',
width: 1,
-} as const;
+} as const
diff --git a/design-system/packages/core/src/components/Box.tsx b/design-system/packages/core/src/components/Box.tsx
index 5ef4d7e44a0..68abdc3c192 100644
--- a/design-system/packages/core/src/components/Box.tsx
+++ b/design-system/packages/core/src/components/Box.tsx
@@ -1,88 +1,88 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '../emotion';
+import { jsx } from '../emotion'
-import { useTheme } from '../theme';
-import { useMediaQuery } from '../hooks/useMediaQuery';
-import { forwardRefWithAs, mapResponsiveProp } from '../utils';
-import { ResponsiveProp, Theme } from '../types';
+import { useTheme } from '../theme'
+import { useMediaQuery } from '../hooks/useMediaQuery'
+import { forwardRefWithAs, mapResponsiveProp } from '../utils'
+import { type ResponsiveProp, type Theme } from '../types'
// Types
// -----
-type DimensionType = number | string;
+type DimensionType = number | string
-type TextAlign = 'left' | 'right' | 'center' | 'justify' | 'start' | 'end';
-type TextAlignment = ResponsiveProp;
+type TextAlign = 'left' | 'right' | 'center' | 'justify' | 'start' | 'end'
+type TextAlignment = ResponsiveProp
-type ColorType = ResponsiveProp;
+type ColorType = ResponsiveProp
export type ColorProps = {
/** background-color */
- background?: ColorType;
+ background?: ColorType
/** color */
- foreground?: ColorType;
-};
+ foreground?: ColorType
+}
-type RadiiType = ResponsiveProp;
+type RadiiType = ResponsiveProp
export type RadiiProps = {
/** border-radius */
- rounding?: RadiiType;
+ rounding?: RadiiType
/** border-bottom-left-radius and border-bottom-right-radius */
- roundingBottom?: RadiiType;
+ roundingBottom?: RadiiType
/** border-bottom-left-radius and border-top-left-radius */
- roundingLeft?: RadiiType;
+ roundingLeft?: RadiiType
/** border-bottom-right-radius and border-top-right-radius */
- roundingRight?: RadiiType;
+ roundingRight?: RadiiType
/** border-bottom-left-radius and border-bottom-right-radius */
- roundingTop?: RadiiType;
-};
+ roundingTop?: RadiiType
+}
-type SpacingType = ResponsiveProp;
+type SpacingType = ResponsiveProp
export type MarginProps = {
/** margin */
- margin?: SpacingType;
+ margin?: SpacingType
/** margin-top */
- marginTop?: SpacingType;
+ marginTop?: SpacingType
/** margin-right */
- marginRight?: SpacingType;
+ marginRight?: SpacingType
/** margin-bottom */
- marginBottom?: SpacingType;
+ marginBottom?: SpacingType
/** margin-left */
- marginLeft?: SpacingType;
+ marginLeft?: SpacingType
/** margin-top and margin-bottom */
- marginY?: SpacingType;
+ marginY?: SpacingType
/** margin-left and margin-right */
- marginX?: SpacingType;
-};
+ marginX?: SpacingType
+}
export type PaddingProps = {
/** padding */
- padding?: SpacingType;
+ padding?: SpacingType
/** padding-top */
- paddingTop?: SpacingType;
+ paddingTop?: SpacingType
/** padding-right */
- paddingRight?: SpacingType;
+ paddingRight?: SpacingType
/** padding-bottom */
- paddingBottom?: SpacingType;
+ paddingBottom?: SpacingType
/** padding-left */
- paddingLeft?: SpacingType;
+ paddingLeft?: SpacingType
/** padding-top and padding-bottom */
- paddingY?: SpacingType;
+ paddingY?: SpacingType
/** padding-left and padding-right */
- paddingX?: SpacingType;
-};
+ paddingX?: SpacingType
+}
type BaseBoxProps = {
/** text-align */
- textAlign?: TextAlignment;
+ textAlign?: TextAlignment
/** height */
- height?: ResponsiveProp;
+ height?: ResponsiveProp
/** width */
- width?: ResponsiveProp;
-};
+ width?: ResponsiveProp
+}
-export type BoxProps = ColorProps & RadiiProps & MarginProps & PaddingProps & BaseBoxProps;
+export type BoxProps = ColorProps & RadiiProps & MarginProps & PaddingProps & BaseBoxProps
// Style Functions
// ---------------
@@ -113,8 +113,8 @@ export const useBoxStyles = ({
textAlign,
width,
}: BoxProps) => {
- const theme = useTheme();
- const { mq } = useMediaQuery();
+ const theme = useTheme()
+ const { mq } = useMediaQuery()
const resolvedColors = useColors(
{
@@ -122,7 +122,7 @@ export const useBoxStyles = ({
foreground,
},
theme
- );
+ )
const resolvedMargin = useMargin(
{
@@ -135,7 +135,7 @@ export const useBoxStyles = ({
marginX,
},
theme
- );
+ )
const resolvedPadding = usePadding(
{
@@ -148,12 +148,12 @@ export const useBoxStyles = ({
paddingX,
},
theme
- );
+ )
const resolvedRounding = useRadii(
{ rounding, roundingTop, roundingRight, roundingBottom, roundingLeft },
theme
- );
+ )
return mq({
...resolvedColors,
@@ -164,27 +164,27 @@ export const useBoxStyles = ({
height: height,
textAlign: textAlign,
width: width,
- });
-};
+ })
+}
// Utils
// ------------------------------
-function useColors({ background, foreground }: ColorProps, { palette }: Theme) {
+function useColors ({ background, foreground }: ColorProps, { palette }: Theme) {
return {
backgroundColor: background && mapResponsiveProp(background, palette),
color: foreground && mapResponsiveProp(foreground, palette),
- };
+ }
}
-function useRadii(
+function useRadii (
{ rounding, roundingTop, roundingRight, roundingBottom, roundingLeft }: RadiiProps,
{ radii }: Theme
) {
- let borderBottomLeftRadius = roundingBottom || roundingLeft || rounding;
- let borderBottomRightRadius = roundingBottom || roundingRight || rounding;
- let borderTopLeftRadius = roundingTop || roundingLeft || rounding;
- let borderTopRightRadius = roundingTop || roundingRight || rounding;
+ let borderBottomLeftRadius = roundingBottom || roundingLeft || rounding
+ let borderBottomRightRadius = roundingBottom || roundingRight || rounding
+ let borderTopLeftRadius = roundingTop || roundingLeft || rounding
+ let borderTopRightRadius = roundingTop || roundingRight || rounding
return {
borderBottomLeftRadius:
@@ -193,10 +193,10 @@ function useRadii(
borderBottomRightRadius && mapResponsiveProp(borderBottomRightRadius, radii),
borderTopLeftRadius: borderTopLeftRadius && mapResponsiveProp(borderTopLeftRadius, radii),
borderTopRightRadius: borderTopRightRadius && mapResponsiveProp(borderTopRightRadius, radii),
- };
+ }
}
-function usePadding(
+function usePadding (
{
padding,
paddingTop,
@@ -208,34 +208,34 @@ function usePadding(
}: PaddingProps,
{ spacing }: Theme
) {
- let pb = paddingBottom || paddingY || padding;
- let pt = paddingTop || paddingY || padding;
- let pl = paddingLeft || paddingX || padding;
- let pr = paddingRight || paddingX || padding;
+ let pb = paddingBottom || paddingY || padding
+ let pt = paddingTop || paddingY || padding
+ let pl = paddingLeft || paddingX || padding
+ let pr = paddingRight || paddingX || padding
return {
paddingBottom: pb && mapResponsiveProp(pb, spacing),
paddingTop: pt && mapResponsiveProp(pt, spacing),
paddingLeft: pl && mapResponsiveProp(pl, spacing),
paddingRight: pr && mapResponsiveProp(pr, spacing),
- };
+ }
}
-function useMargin(
+function useMargin (
{ margin, marginTop, marginRight, marginBottom, marginLeft, marginY, marginX }: MarginProps,
{ spacing }: Theme
) {
- let mb = marginBottom || marginY || margin;
- let mt = marginTop || marginY || margin;
- let ml = marginLeft || marginX || margin;
- let mr = marginRight || marginX || margin;
+ let mb = marginBottom || marginY || margin
+ let mt = marginTop || marginY || margin
+ let ml = marginLeft || marginX || margin
+ let mr = marginRight || marginX || margin
return {
marginBottom: mb && mapResponsiveProp(mb, spacing),
marginTop: mt && mapResponsiveProp(mt, spacing),
marginLeft: ml && mapResponsiveProp(ml, spacing),
marginRight: mr && mapResponsiveProp(mr, spacing),
- };
+ }
}
// Box Component
@@ -268,7 +268,7 @@ export const Box = forwardRefWithAs<'div', BoxProps>(({ as: Tag = 'div', ...prop
textAlign,
width,
...attrs
- } = props;
+ } = props
const boxStyles = useBoxStyles({
background,
@@ -295,7 +295,7 @@ export const Box = forwardRefWithAs<'div', BoxProps>(({ as: Tag = 'div', ...prop
roundingTop,
textAlign,
width,
- });
+ })
- return ;
-});
+ return
+})
diff --git a/design-system/packages/core/src/components/Center.tsx b/design-system/packages/core/src/components/Center.tsx
index 9ccbf66b9ea..c68c2d4411a 100644
--- a/design-system/packages/core/src/components/Center.tsx
+++ b/design-system/packages/core/src/components/Center.tsx
@@ -1,14 +1,14 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '../emotion';
+import { jsx } from '../emotion'
-import { forwardRefWithAs } from '../utils';
-import { Box, BoxProps } from './Box';
+import { forwardRefWithAs } from '../utils'
+import { Box, type BoxProps } from './Box'
type CenterProps = {
- fillView?: boolean;
-} & BoxProps;
+ fillView?: boolean
+} & BoxProps
export const Center = forwardRefWithAs<'div', CenterProps>(
({ fillView = false, ...props }, ref) => {
@@ -24,6 +24,6 @@ export const Center = forwardRefWithAs<'div', CenterProps>(
}}
{...props}
/>
- );
+ )
}
-);
+)
diff --git a/design-system/packages/core/src/components/Core.tsx b/design-system/packages/core/src/components/Core.tsx
index b24296eff34..94a5513b608 100644
--- a/design-system/packages/core/src/components/Core.tsx
+++ b/design-system/packages/core/src/components/Core.tsx
@@ -1,20 +1,20 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { Fragment, ReactNode } from 'react';
-import { jsx, Global } from '../emotion';
+import { Fragment, type ReactNode } from 'react'
+import { jsx, Global } from '../emotion'
-import { normalize } from '../normalize';
-import { useTheme } from '../theme';
+import { normalize } from '../normalize'
+import { useTheme } from '../theme'
type CoreProps = {
/** The app content. */
- children: ReactNode;
+ children: ReactNode
/** Include styles to normalize element styles among browsers. */
- includeNormalize?: boolean;
+ includeNormalize?: boolean
/** Optimize text rendering with CSS. */
- optimizeLegibility?: boolean;
-};
+ optimizeLegibility?: boolean
+}
export const Core = ({
children,
@@ -26,16 +26,16 @@ export const Core = ({
{children}
- );
-};
+ )
+}
// Base CSS
// ------------------------------
-type BaseCSSProps = Omit;
+type BaseCSSProps = Omit
const BaseCSS = ({ includeNormalize, optimizeLegibility }: BaseCSSProps) => {
- const { typography, colors } = useTheme();
+ const { typography, colors } = useTheme()
return (
@@ -81,5 +81,5 @@ const BaseCSS = ({ includeNormalize, optimizeLegibility }: BaseCSSProps) => {
}}
/>
- );
-};
+ )
+}
diff --git a/design-system/packages/core/src/components/Divider.tsx b/design-system/packages/core/src/components/Divider.tsx
index 5e477e735e4..f2afc948b0f 100644
--- a/design-system/packages/core/src/components/Divider.tsx
+++ b/design-system/packages/core/src/components/Divider.tsx
@@ -1,37 +1,37 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '../emotion';
+import { jsx } from '../emotion'
-import { useTheme } from '../theme';
-import { ResponsiveProp, Theme } from '../types';
-import { Box, MarginProps } from './Box';
+import { useTheme } from '../theme'
+import { type ResponsiveProp, type Theme } from '../types'
+import { Box, type MarginProps } from './Box'
-type ColorType = ResponsiveProp;
+type ColorType = ResponsiveProp
const orientationMap = {
horizontal: 'width',
vertical: 'height',
-};
+}
type DividerProps = {
- children?: never;
- color?: ColorType;
- orientation?: keyof typeof orientationMap;
- className?: string;
-} & MarginProps;
+ children?: never
+ color?: ColorType
+ orientation?: keyof typeof orientationMap
+ className?: string
+} & MarginProps
export const Divider = ({ orientation = 'vertical', color, ...props }: DividerProps) => {
- const { colors } = useTheme();
+ const { colors } = useTheme()
- const dimension = orientationMap[orientation];
+ const dimension = orientationMap[orientation]
const styles = {
// default the background color to the theme border color
backgroundColor: color ? undefined : colors.border,
flexShrink: 0,
[dimension]: 1,
- };
+ }
// if the color prop is defined, pass it as the background to the box
- return ;
-};
+ return
+}
diff --git a/design-system/packages/core/src/components/Heading.tsx b/design-system/packages/core/src/components/Heading.tsx
index 63b022d7469..1338ceeef0e 100644
--- a/design-system/packages/core/src/components/Heading.tsx
+++ b/design-system/packages/core/src/components/Heading.tsx
@@ -1,24 +1,24 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '../emotion';
+import { jsx } from '../emotion'
-import { forwardRefWithAs } from '../utils';
-import { useTheme } from '../theme';
-import { Box, BoxProps } from './Box';
+import { forwardRefWithAs } from '../utils'
+import { useTheme } from '../theme'
+import { Box, type BoxProps } from './Box'
-export const HeadingTypes = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'] as const;
-type HeadingType = (typeof HeadingTypes)[number];
+export const HeadingTypes = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'] as const
+type HeadingType = (typeof HeadingTypes)[number]
type HeadingProps = {
/** The type of heading. */
- type?: HeadingType;
-} & BoxProps;
+ type?: HeadingType
+} & BoxProps
export const Heading = forwardRefWithAs<'h1', HeadingProps>(
({ as = 'h1', type = 'h1', ...props }, ref) => {
- const { headingStyles } = useTheme();
- const headingStyle = headingStyles[type];
+ const { headingStyles } = useTheme()
+ const headingStyle = headingStyles[type]
const styles = {
color: headingStyle.color,
fontFamily: headingStyle.family,
@@ -26,31 +26,31 @@ export const Heading = forwardRefWithAs<'h1', HeadingProps>(
fontWeight: headingStyle.weight,
textTransform: headingStyle.transform,
margin: 0,
- } as const;
- return ;
+ } as const
+ return
}
-);
+)
export const H1 = forwardRefWithAs<'h1', BoxProps>(({ as = 'h1', ...props }, ref) => {
- return ;
-});
+ return
+})
export const H2 = forwardRefWithAs<'h2', BoxProps>(({ as = 'h2', ...props }, ref) => {
- return ;
-});
+ return
+})
export const H3 = forwardRefWithAs<'h3', BoxProps>(({ as = 'h3', ...props }, ref) => {
- return ;
-});
+ return
+})
export const H4 = forwardRefWithAs<'h4', BoxProps>(({ as = 'h4', ...props }, ref) => {
- return ;
-});
+ return
+})
export const H5 = forwardRefWithAs<'h5', BoxProps>(({ as = 'h5', ...props }, ref) => {
- return ;
-});
+ return
+})
export const H6 = forwardRefWithAs<'h6', BoxProps>(({ as = 'h6', ...props }, ref) => {
- return ;
-});
+ return
+})
diff --git a/design-system/packages/core/src/components/Inline.tsx b/design-system/packages/core/src/components/Inline.tsx
index 4b5a9cdaa67..dec2ac09217 100644
--- a/design-system/packages/core/src/components/Inline.tsx
+++ b/design-system/packages/core/src/components/Inline.tsx
@@ -1,36 +1,36 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { Children, ReactNode } from 'react';
-import { jsx } from '../emotion';
+import { Children, type ReactNode } from 'react'
+import { jsx } from '../emotion'
-import { forwardRefWithAs, getChildTag } from '../utils';
-import { Theme } from '../types';
-import { useTheme } from '../theme';
-import { Box, BoxProps } from './Box';
+import { forwardRefWithAs, getChildTag } from '../utils'
+import { type Theme } from '../types'
+import { useTheme } from '../theme'
+import { Box, type BoxProps } from './Box'
const alignment = {
center: 'center',
end: 'flex-end',
start: 'flex-start',
stretch: 'stretch',
-};
+}
type InlineProps = {
/** The value of the "align-items" property. */
- align?: keyof typeof alignment;
+ align?: keyof typeof alignment
/** Each item in the container. */
- children: ReactNode;
+ children: ReactNode
/** The size of the gap between each item. */
- gap?: keyof Theme['spacing'];
-} & BoxProps;
+ gap?: keyof Theme['spacing']
+} & BoxProps
export const Inline = forwardRefWithAs<'div', InlineProps>(
({ align = 'start', children, gap = 'none', ...props }, ref) => {
- const { spacing } = useTheme();
- const resolvedAlign = alignment[align];
- const resolvedGap = spacing[gap];
- const ChildWrapper = getChildTag(props.as);
+ const { spacing } = useTheme()
+ const resolvedAlign = alignment[align]
+ const resolvedGap = spacing[gap]
+ const ChildWrapper = getChildTag(props.as)
return (
(
) : null
)}
- );
+ )
}
-);
+)
diff --git a/design-system/packages/core/src/components/Link.tsx b/design-system/packages/core/src/components/Link.tsx
index 0f7b5e22b44..df3321ffb89 100644
--- a/design-system/packages/core/src/components/Link.tsx
+++ b/design-system/packages/core/src/components/Link.tsx
@@ -1,12 +1,12 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '../emotion';
-import { useTheme } from '../theme';
-import { forwardRefWithAs } from '../utils';
+import { jsx } from '../emotion'
+import { useTheme } from '../theme'
+import { forwardRefWithAs } from '../utils'
export const Link = forwardRefWithAs<'a', {}>(({ as: Tag = 'a', ...props }, ref) => {
- const { typography, colors } = useTheme();
+ const { typography, colors } = useTheme()
const styles = {
color: colors.linkColor,
@@ -18,7 +18,7 @@ export const Link = forwardRefWithAs<'a', {}>(({ as: Tag = 'a', ...props }, ref)
color: colors.linkHoverColor,
textDecoration: 'underline',
},
- };
+ }
- return ;
-});
+ return
+})
diff --git a/design-system/packages/core/src/components/Stack.tsx b/design-system/packages/core/src/components/Stack.tsx
index ae06186d42a..b0644782a71 100644
--- a/design-system/packages/core/src/components/Stack.tsx
+++ b/design-system/packages/core/src/components/Stack.tsx
@@ -1,23 +1,23 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { Children, Fragment, ReactNode, isValidElement } from 'react';
+import { Children, Fragment, type ReactNode, isValidElement } from 'react'
-import { jsx } from '../emotion';
-import { useMediaQuery } from '../hooks/useMediaQuery';
-import { useTheme } from '../theme';
-import { Theme } from '../types';
-import { forwardRefWithAs, mapResponsiveProp, getChildTag } from '../utils';
+import { jsx } from '../emotion'
+import { useMediaQuery } from '../hooks/useMediaQuery'
+import { useTheme } from '../theme'
+import { type Theme } from '../types'
+import { forwardRefWithAs, mapResponsiveProp, getChildTag } from '../utils'
-import { Box, BoxProps } from './Box';
-import { Divider } from './Divider';
+import { Box, type BoxProps } from './Box'
+import { Divider } from './Divider'
const alignment = {
center: 'center',
end: 'flex-end',
start: 'flex-start',
stretch: 'stretch',
-};
+}
const orientationMap = {
horizontal: {
@@ -30,29 +30,29 @@ const orientationMap = {
marginProperty: 'marginTop',
dimension: 'height',
},
-} as const;
+} as const
export type StackProps = {
/** The value of the "align-items" property. */
- align?: keyof typeof alignment;
+ align?: keyof typeof alignment
/** Each element in the stack. */
- children: ReactNode;
+ children: ReactNode
/** Causes items in the stack to be oriented horizontally, instead of vertically */
- across?: boolean;
+ across?: boolean
/** The placement, if any, of the dividing elements. */
- dividers?: 'none' | 'around' | 'between' | 'start' | 'end';
+ dividers?: 'none' | 'around' | 'between' | 'start' | 'end'
/** The size of the gap between each element in the stack. */
- gap?: keyof Theme['spacing'];
-} & BoxProps;
+ gap?: keyof Theme['spacing']
+} & BoxProps
export const Stack = forwardRefWithAs<'div', StackProps>(
({ across, align = 'stretch', children, dividers = 'none', gap = 'none', ...props }, ref) => {
- const { spacing } = useTheme();
- const { mq } = useMediaQuery();
+ const { spacing } = useTheme()
+ const { mq } = useMediaQuery()
- const orientation = across ? 'horizontal' : 'vertical';
- const { dimension, flexDirection, marginProperty } = orientationMap[orientation];
- const ChildWrapper = getChildTag(props.as);
+ const orientation = across ? 'horizontal' : 'vertical'
+ const { dimension, flexDirection, marginProperty } = orientationMap[orientation]
+ const ChildWrapper = getChildTag(props.as)
return (
(
{/* wrap the child to avoid unwanted or unexpected "stretch" on things like buttons */}
{child}
- );
+ )
})}
{['around', 'end'].includes(dividers) && }
- );
+ )
}
-);
+)
diff --git a/design-system/packages/core/src/components/Text.tsx b/design-system/packages/core/src/components/Text.tsx
index 58eeb9bf126..fbb552b2776 100644
--- a/design-system/packages/core/src/components/Text.tsx
+++ b/design-system/packages/core/src/components/Text.tsx
@@ -1,35 +1,35 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '../emotion';
+import { jsx } from '../emotion'
-import { Theme } from '../types';
-import { forwardRefWithAs } from '../utils';
-import { useMediaQuery } from '../hooks/useMediaQuery';
-import { useTheme } from '../theme';
-import { Box, BoxProps } from './Box';
+import { type Theme } from '../types'
+import { forwardRefWithAs } from '../utils'
+import { useMediaQuery } from '../hooks/useMediaQuery'
+import { useTheme } from '../theme'
+import { Box, type BoxProps } from './Box'
type TextProps = {
/** The leading of the text. */
- leading?: keyof Theme['typography']['leading'];
+ leading?: keyof Theme['typography']['leading']
/** The size of the text. */
- size?: 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
+ size?: 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge'
/** The tracking of the text. */
- tracking?: keyof Theme['typography']['tracking'];
+ tracking?: keyof Theme['typography']['tracking']
/** The color of the text. */
- color?: keyof Theme['palette'];
+ color?: keyof Theme['palette']
/** The font-weight of the text. */
- weight?: keyof Theme['typography']['fontWeight'];
-} & BoxProps;
+ weight?: keyof Theme['typography']['fontWeight']
+} & BoxProps
export const Text = forwardRefWithAs<'div', TextProps>(
(
{ color, leading = 'base', size = 'medium', tracking = 'base', weight = 'regular', ...props },
ref
) => {
- const { palette, typography } = useTheme();
+ const { palette, typography } = useTheme()
- const { mq } = useMediaQuery();
+ const { mq } = useMediaQuery()
const styles = mq({
color: color ? palette[color] : undefined,
@@ -37,8 +37,8 @@ export const Text = forwardRefWithAs<'div', TextProps>(
fontWeight: typography.fontWeight[weight],
letterSpacing: typography.tracking[tracking],
lineHeight: typography.leading[leading],
- });
+ })
- return ;
+ return
}
-);
+)
diff --git a/design-system/packages/core/src/emotion.ts b/design-system/packages/core/src/emotion.ts
index 68ea6ecf5d4..5bb7522d5a6 100644
--- a/design-system/packages/core/src/emotion.ts
+++ b/design-system/packages/core/src/emotion.ts
@@ -1 +1 @@
-export { css, jsx, keyframes, Global, ClassNames } from '@emotion/react'; // ensure the same version of emotion
+export { css, jsx, keyframes, Global, ClassNames } from '@emotion/react' // ensure the same version of emotion
diff --git a/design-system/packages/core/src/hooks/useManagedState.ts b/design-system/packages/core/src/hooks/useManagedState.ts
index 70c8fed2d5c..be9d5e9148a 100644
--- a/design-system/packages/core/src/hooks/useManagedState.ts
+++ b/design-system/packages/core/src/hooks/useManagedState.ts
@@ -1,38 +1,38 @@
-import { ChangeEvent, useRef, useState } from 'react';
+import { type ChangeEvent, useRef, useState } from 'react'
-import { devWarning } from '../utils';
+import { devWarning } from '../utils'
-export type ManagedChangeHandler = (value: V, event: E) => void;
+export type ManagedChangeHandler = (value: V, event: E) => void
-export function useManagedState(
+export function useManagedState (
controlledValue: V | undefined,
defaultValue: V,
onChange: ManagedChangeHandler | undefined
): [V, ManagedChangeHandler] {
- const { current: isControlled } = useRef(controlledValue !== undefined);
- const [internalValue, setInternalValue] = useState(defaultValue);
+ const { current: isControlled } = useRef(controlledValue !== undefined)
+ const [internalValue, setInternalValue] = useState(defaultValue)
// warn consumers when their component is switching from controlled to uncontrolled and vice versa
devWarning(
isControlled && controlledValue === undefined,
'A component is changing from controlled to uncontrolled. Check the `value` prop being passed in.'
- );
+ )
devWarning(
!isControlled && controlledValue !== undefined,
'A component is changing from uncontrolled to controlled. Check the `value` prop being passed in.'
- );
+ )
// handle value changes (both internal, and controlled)
const setValue = (v: V, e: E) => {
if (typeof onChange === 'function') {
- onChange(v, e);
+ onChange(v, e)
}
- setInternalValue(v);
- };
+ setInternalValue(v)
+ }
// determine which value to pass on
- const value = controlledValue !== undefined ? controlledValue : internalValue;
+ const value = controlledValue !== undefined ? controlledValue : internalValue
- return [value, setValue];
+ return [value, setValue]
}
diff --git a/design-system/packages/core/src/hooks/useMediaQuery.ts b/design-system/packages/core/src/hooks/useMediaQuery.ts
index 97445b2813e..bd5c709ba08 100644
--- a/design-system/packages/core/src/hooks/useMediaQuery.ts
+++ b/design-system/packages/core/src/hooks/useMediaQuery.ts
@@ -1,10 +1,10 @@
-import facepaint from 'facepaint';
+import facepaint from 'facepaint'
-import { Theme } from '../types';
-import { useTheme } from '../theme';
+import { type Theme } from '../types'
+import { useTheme } from '../theme'
-type BreakPoints = Theme['breakpoints'];
-type BreakPoint = keyof BreakPoints;
+type BreakPoints = Theme['breakpoints']
+type BreakPoint = keyof BreakPoints
/*
Facepaint lets you write properties as arrays e.g.
@@ -14,28 +14,28 @@ type BreakPoint = keyof BreakPoints;
More here: https://github.com/emotion-js/facepaint
*/
const makeMq = (breakpoints: BreakPoints) =>
- facepaint(Object.values(breakpoints).map(w => `@media (min-width: ${w}px)`));
+ facepaint(Object.values(breakpoints).map(w => `@media (min-width: ${w}px)`))
// helper if array property declaration isn't appropriate
const makeMinBreak = (breakpoints: BreakPoints) => (key: BreakPoint) => {
- const width = breakpoints[key];
- return `@media (min-width: ${width}px)`;
-};
+ const width = breakpoints[key]
+ return `@media (min-width: ${width}px)`
+}
// the breakpoints are designed to go up i.e. min-width
// if a max-width is necessary (hopefully rare) it's nice to provide a helper
const makeMaxBreak = (breakpoints: BreakPoints) => (key: BreakPoint) => {
- const width = breakpoints[key];
- return `@media (max-width: ${width - 1}px)`;
-};
+ const width = breakpoints[key]
+ return `@media (max-width: ${width - 1}px)`
+}
// FIXME:
// Should this even be a hook? I think we can just export these utilities...
export const useMediaQuery = () => {
- const { breakpoints } = useTheme();
+ const { breakpoints } = useTheme()
return {
mq: makeMq(breakpoints),
maxBreak: makeMaxBreak(breakpoints),
minBreak: makeMinBreak(breakpoints),
- };
-};
+ }
+}
diff --git a/design-system/packages/core/src/index.ts b/design-system/packages/core/src/index.ts
index fabf4dfc241..3955c3bc283 100644
--- a/design-system/packages/core/src/index.ts
+++ b/design-system/packages/core/src/index.ts
@@ -1,17 +1,17 @@
-export * from './emotion';
-export { VisuallyHidden } from './a11y/VisuallyHidden';
-export { Box } from './components/Box';
-export type { BoxProps, ColorProps, RadiiProps, MarginProps, PaddingProps } from './components/Box';
-export { Core } from './components/Core';
-export { Center } from './components/Center';
-export { Divider } from './components/Divider';
-export { Heading, H1, H2, H3, H4, H5, H6 } from './components/Heading';
-export { Inline } from './components/Inline';
-export { Link } from './components/Link';
-export { Stack } from './components/Stack';
-export { Text } from './components/Text';
-export * from './hooks/useMediaQuery';
-export * from './hooks/useManagedState';
-export * from './theme';
-export * from './utils';
-export * from './types';
+export * from './emotion'
+export { VisuallyHidden } from './a11y/VisuallyHidden'
+export { Box } from './components/Box'
+export type { BoxProps, ColorProps, RadiiProps, MarginProps, PaddingProps } from './components/Box'
+export { Core } from './components/Core'
+export { Center } from './components/Center'
+export { Divider } from './components/Divider'
+export { Heading, H1, H2, H3, H4, H5, H6 } from './components/Heading'
+export { Inline } from './components/Inline'
+export { Link } from './components/Link'
+export { Stack } from './components/Stack'
+export { Text } from './components/Text'
+export * from './hooks/useMediaQuery'
+export * from './hooks/useManagedState'
+export * from './theme'
+export * from './utils'
+export * from './types'
diff --git a/design-system/packages/core/src/normalize.ts b/design-system/packages/core/src/normalize.ts
index 6aa108379dc..183ce2b7360 100644
--- a/design-system/packages/core/src/normalize.ts
+++ b/design-system/packages/core/src/normalize.ts
@@ -1,4 +1,4 @@
-import { css } from './emotion';
+import { css } from './emotion'
export const normalize = css`
/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */
@@ -156,4 +156,4 @@ export const normalize = css`
[hidden] {
display: none;
}
-`;
+`
diff --git a/design-system/packages/core/src/theme.tsx b/design-system/packages/core/src/theme.tsx
index 9887b4ca8b1..bdff75e08e3 100644
--- a/design-system/packages/core/src/theme.tsx
+++ b/design-system/packages/core/src/theme.tsx
@@ -1,20 +1,20 @@
-import React, { ReactNode, createContext, useContext } from 'react';
+import React, { type ReactNode, createContext, useContext } from 'react'
-import type { Theme } from './types';
-import { theme } from './themes/default';
+import type { Theme } from './types'
+import { theme } from './themes/default'
export const ThemeContext = createContext<{
- theme: Theme;
+ theme: Theme
}>({
theme,
-});
+})
-export const ThemeProvider = ({ theme, children }: { theme: Theme; children: ReactNode }) => {
- return {children} ;
-};
+export const ThemeProvider = ({ theme, children }: { theme: Theme, children: ReactNode }) => {
+ return {children}
+}
// TODO: return type required by pnpm :(
export const useTheme = (): Theme => {
- const { theme } = useContext(ThemeContext);
- return theme;
-};
+ const { theme } = useContext(ThemeContext)
+ return theme
+}
diff --git a/design-system/packages/core/src/themes/colors.ts b/design-system/packages/core/src/themes/colors.ts
index 97167b042d2..a3608a8aa59 100644
--- a/design-system/packages/core/src/themes/colors.ts
+++ b/design-system/packages/core/src/themes/colors.ts
@@ -224,4 +224,4 @@ export const palette = {
// blueGray700: '#334155',
// blueGray800: '#1e293b',
// blueGray900: '#0f172a',
-} as const;
+} as const
diff --git a/design-system/packages/core/src/themes/colors_old.ts b/design-system/packages/core/src/themes/colors_old.ts
index ba4fb2bf386..2b8d5bb30d2 100644
--- a/design-system/packages/core/src/themes/colors_old.ts
+++ b/design-system/packages/core/src/themes/colors_old.ts
@@ -347,4 +347,4 @@ export const palette = {
orange700: '#aa4709',
orange800: '#7a3305',
orange900: '#4b1d00',
-};
+}
diff --git a/design-system/packages/core/src/themes/default.ts b/design-system/packages/core/src/themes/default.ts
index 082c39cd237..a548d4d2092 100644
--- a/design-system/packages/core/src/themes/default.ts
+++ b/design-system/packages/core/src/themes/default.ts
@@ -1,6 +1,6 @@
-import { CSSObject } from '@emotion/react';
-import { identityType } from '../utils';
-import { palette as basePalette } from './colors';
+import { type CSSObject } from '@emotion/react'
+import { identityType } from '../utils'
+import { palette as basePalette } from './colors'
/**
* Global Tokens
@@ -49,7 +49,7 @@ const typography = {
loose: '0.01em',
looser: '0.02em',
},
-};
+}
const palette = {
black: '#000000',
@@ -68,14 +68,14 @@ const palette = {
neutral900: '#111827',
...basePalette,
-};
+}
const breakpoints = {
small: 576,
medium: 768,
large: 992,
xlarge: 1200,
-};
+}
const elevation = {
e100: 100, // Cards
@@ -83,7 +83,7 @@ const elevation = {
e300: 300, // Tooltip
e400: 400, // Modals
e500: 500, // Toasts (notifications)
-};
+}
const radii = {
none: 0,
@@ -92,7 +92,7 @@ const radii = {
medium: 8,
large: 12,
full: 9999,
-};
+}
const sizing = {
xxsmall: 16,
@@ -102,7 +102,7 @@ const sizing = {
large: 38,
xlarge: 42,
xxlarge: 48,
-};
+}
const spacing = {
none: 0,
@@ -113,7 +113,7 @@ const spacing = {
large: 16,
xlarge: 24,
xxlarge: 32,
-};
+}
const shadow = {
s100: `0px 1px 2px rgba(0, 0, 0, 0.2)`, // Cards
@@ -121,7 +121,7 @@ const shadow = {
s300: `0px 2px 8px rgba(0, 0, 0, 0.2)`, // Tooltip
s400: `0px 4px 16px rgba(0, 0, 0, 0.2)`, // Modals
s500: `-8px 8px 32px rgba(0, 0, 0, 0.2)`, // Toasts (notifications)
-};
+}
const animation = {
duration0: '0ms',
@@ -141,25 +141,25 @@ const animation = {
easeIn: `cubic-bezier(0.2, 0, 0, 1)`,
easeOut: `cubic-bezier(0.165, 0.840, 0.440, 1)`,
linear: 'cubic-bezier(0, 0, 1, 1)',
-};
+}
const opacity = {
full: 1,
none: 0,
disabled: 0.65,
-};
+}
/**
* Alias Tokens
*/
type HeadingStyle = {
- color: string;
- family: string;
- size: string;
- transform: Extract;
- weight: number;
-};
+ color: string
+ family: string
+ size: string
+ transform: Extract
+ weight: number
+}
const headingStyles: { [key: string]: HeadingStyle } = {
h1: {
@@ -204,20 +204,20 @@ const headingStyles: { [key: string]: HeadingStyle } = {
transform: 'uppercase',
weight: typography.fontWeight.bold,
},
-};
+}
type ControlSize = {
- borderRadius: number;
- borderWidth: number;
- gutter: number;
- paddingX: number;
- paddingY: number;
- height: number;
- gap: number;
- fontSize: number | string;
- indicatorBoxSize: number | string;
- indicatorFontSize: number | string;
-};
+ borderRadius: number
+ borderWidth: number
+ gutter: number
+ paddingX: number
+ paddingY: number
+ height: number
+ gap: number
+ fontSize: number | string
+ indicatorBoxSize: number | string
+ indicatorFontSize: number | string
+}
const controlSizes: { [key: string]: ControlSize } = {
small: {
@@ -256,7 +256,7 @@ const controlSizes: { [key: string]: ControlSize } = {
indicatorBoxSize: sizing.medium,
indicatorFontSize: typography.fontSize.small,
},
-};
+}
const colors = {
background: 'white',
@@ -276,7 +276,7 @@ const colors = {
overlayBackground: 'rgba(18,18,18, 0.3)', // blanket behind modal dialogs
loaderDark: palette.neutral500,
loaderLight: palette.neutral200,
-};
+}
/**
@@ -291,15 +291,15 @@ Tones have 2 foregrounds that should work on these backgrounds:
*/
-type ToneColor = [string, string, string];
+type ToneColor = [string, string, string]
type Tone = {
- focusRing: string;
- border: ToneColor;
- fill: ToneColor;
- tint: ToneColor;
- foreground: ToneColor;
- fillForeground: ToneColor;
-};
+ focusRing: string
+ border: ToneColor
+ fill: ToneColor
+ tint: ToneColor
+ foreground: ToneColor
+ fillForeground: ToneColor
+}
const tones = identityType<{ [key: string]: Tone }>()({
active: {
@@ -350,15 +350,15 @@ const tones = identityType<{ [key: string]: Tone }>()({
foreground: [palette.purple600, palette.purple700, palette.purple800],
fillForeground: [palette.white, palette.white, palette.white],
},
-});
+})
type SelectableColor = {
- border: string;
- fill: string;
- fillForeground: string;
- foreground: string;
- tint: string;
-};
+ border: string
+ fill: string
+ fillForeground: string
+ foreground: string
+ tint: string
+}
const selectableColors = identityType<{ [key: string]: SelectableColor }>()({
silver: {
@@ -403,42 +403,42 @@ const selectableColors = identityType<{ [key: string]: SelectableColor }>()({
foreground: palette.purple600,
tint: palette.purple200,
},
-});
+})
type SharedFieldStateTokens = {
- labelColor?: string;
- legendColor?: string;
- shadow?: string;
-};
+ labelColor?: string
+ legendColor?: string
+ shadow?: string
+}
type ControlFieldStateTokens = {
- controlBackground?: string;
- controlBorderColor?: string;
- controlBorderRadius?: number | string;
- controlForeground?: string;
-};
+ controlBackground?: string
+ controlBorderColor?: string
+ controlBorderRadius?: number | string
+ controlForeground?: string
+}
type InputFieldStateTokens = {
- inputBackground?: string;
- inputBorderColor?: string;
- inputBorderRadius?: number | string;
- inputForeground?: string;
- iconColor?: string;
-};
+ inputBackground?: string
+ inputBorderColor?: string
+ inputBorderRadius?: number | string
+ inputForeground?: string
+ iconColor?: string
+}
-type FieldStateTokens = SharedFieldStateTokens & ControlFieldStateTokens & InputFieldStateTokens;
+type FieldStateTokens = SharedFieldStateTokens & ControlFieldStateTokens & InputFieldStateTokens
type FieldTokens = FieldStateTokens & {
- controlBorderWidth?: number | string;
- inputBorderWidth?: number | string;
- inputPlaceholder?: string;
- switchForeground?: string;
- disabled: FieldStateTokens;
- focus: FieldStateTokens;
- hover: FieldStateTokens;
- invalid: FieldStateTokens;
- selected: SharedFieldStateTokens & ControlFieldStateTokens;
-};
+ controlBorderWidth?: number | string
+ inputBorderWidth?: number | string
+ inputPlaceholder?: string
+ switchForeground?: string
+ disabled: FieldStateTokens
+ focus: FieldStateTokens
+ hover: FieldStateTokens
+ invalid: FieldStateTokens
+ selected: SharedFieldStateTokens & ControlFieldStateTokens
+}
const fields: FieldTokens = {
controlBackground: 'white',
@@ -486,7 +486,7 @@ const fields: FieldTokens = {
controlBorderColor: palette.blue500,
controlForeground: 'white',
},
-};
+}
/**
* Export
@@ -512,4 +512,4 @@ export const theme = {
tones,
selectableColors,
fields,
-};
+}
diff --git a/design-system/packages/core/src/types.ts b/design-system/packages/core/src/types.ts
index 15f37151b88..5a2cd5955dd 100644
--- a/design-system/packages/core/src/types.ts
+++ b/design-system/packages/core/src/types.ts
@@ -1,7 +1,7 @@
-import { theme } from './themes/default';
+import { type theme } from './themes/default'
// Theme Types
-export type Theme = typeof theme;
+export type Theme = typeof theme
-export type ResponsiveProp = T | readonly (T | null)[];
+export type ResponsiveProp = T | readonly (T | null)[]
diff --git a/design-system/packages/core/src/utils.ts b/design-system/packages/core/src/utils.ts
index ce54fe04bf8..9db5cfda3e3 100644
--- a/design-system/packages/core/src/utils.ts
+++ b/design-system/packages/core/src/utils.ts
@@ -1,15 +1,15 @@
import {
- ComponentPropsWithoutRef,
- ElementType,
+ type ComponentPropsWithoutRef,
+ type ElementType,
forwardRef,
- ReactElement,
- ReactNode,
- Ref,
+ type ReactElement,
+ type ReactNode,
+ type Ref,
useEffect,
useLayoutEffect,
useState,
-} from 'react';
-import { createPortal } from 'react-dom';
+} from 'react'
+import { createPortal } from 'react-dom'
/*
Simple switch to return a child tag from a parent tag argument.
@@ -19,20 +19,20 @@ export const getChildTag = (parentTag?: ElementType) => {
switch (parentTag) {
case 'ul':
case 'ol':
- return 'li';
+ return 'li'
default:
- return 'div';
+ return 'div'
}
-};
+}
/*
@johannes' one weird trick for fixing TypeScript autocomplete
*/
-export function identityType() {
- function inner(u: U): U {
- return u;
+export function identityType () {
+ function inner (u: U): U {
+ return u
}
- return inner;
+ return inner
}
/*
@@ -41,10 +41,10 @@ export function identityType() {
export const devWarning = (condition: boolean, message: string) => {
if (process.env.NODE_ENV !== 'production') {
if (condition) {
- console.error(message);
+ console.error(message)
}
}
-};
+}
/*
forwardRefWithAs lets us forward refs while keeping the correct component type,
@@ -52,24 +52,24 @@ export const devWarning = (condition: boolean, message: string) => {
*/
type ElementTagNameMap = HTMLElementTagNameMap &
- Pick>;
+ Pick>
type AsProp = {
- as?: Comp;
+ as?: Comp
ref?: Ref<
Comp extends keyof ElementTagNameMap
? ElementTagNameMap[Comp]
: Comp extends new (...args: any) => any
? InstanceType
: undefined
- >;
-} & Omit, 'as' | keyof Props>;
+ >
+} & Omit, 'as' | keyof Props>
type CompWithAsProp = <
Comp extends ElementType = DefaultElementType
>(
props: AsProp & Props
-) => ReactElement;
+) => ReactElement
export const forwardRefWithAs = (
render: (
@@ -77,15 +77,15 @@ export const forwardRefWithAs =
) => Exclude
): CompWithAsProp => {
- // @ts-ignore
- return forwardRef(render);
-};
+ // @ts-expect-error
+ return forwardRef(render)
+}
/*
A helper for making valid IDs from a set of inputs
*/
-export function makeId(...args: (string | number | null | undefined)[]) {
- return args.filter(val => val != null).join('--');
+export function makeId (...args: (string | number | null | undefined)[]) {
+ return args.filter(val => val != null).join('--')
}
/*
@@ -103,11 +103,11 @@ export const mapResponsiveProp = <
valueMap: Map
) => {
if (Array.isArray(value)) {
- return value.map(k => (k == null ? null : valueMap[k]));
+ return value.map(k => (k == null ? null : valueMap[k]))
}
- // @ts-ignore
- return valueMap[value];
-};
+ // @ts-expect-error
+ return valueMap[value]
+}
/**
* Utils below are ported with thanks from @reach-ui
@@ -116,41 +116,41 @@ export const mapResponsiveProp = <
// Autogenerate IDs to facilitate WAI-ARIA and server rendering. For reasoning, see
// https://github.com/reach/reach-ui/blob/develop/packages/auto-id/src/index.tsx
-let serverHandoffComplete = false;
-let id = 0;
-const genId = () => ++id;
+let serverHandoffComplete = false
+let id = 0
+const genId = () => ++id
export const useId = (idFromProps?: string | null) => {
- const initialId = idFromProps || (serverHandoffComplete ? genId() : null);
+ const initialId = idFromProps || (serverHandoffComplete ? genId() : null)
- const [id, setId] = useState(initialId);
+ const [id, setId] = useState(initialId)
useSafeLayoutEffect(() => {
if (id === null) {
- setId(genId());
+ setId(genId())
}
// eslint-disable-next-line react-hooks/exhaustive-deps
- }, []);
+ }, [])
useEffect(() => {
if (serverHandoffComplete === false) {
- serverHandoffComplete = true;
+ serverHandoffComplete = true
}
- }, []);
- return id != null ? String(id) : undefined;
-};
+ }, [])
+ return id != null ? String(id) : undefined
+}
// Works around useLayoutEffect throwing a warning when used in SSR
-export const useSafeLayoutEffect = typeof window === 'undefined' ? () => {} : useLayoutEffect;
+export const useSafeLayoutEffect = typeof window === 'undefined' ? () => {} : useLayoutEffect
type Props = {
- children: ReactElement;
-};
+ children: ReactElement
+}
export const Portal = ({ children }: Props): React.ReactPortal | null => {
if (typeof document === 'undefined') {
- return null;
+ return null
}
- return createPortal(children, document.body);
-};
+ return createPortal(children, document.body)
+}
diff --git a/design-system/packages/fields/src/Checkbox.tsx b/design-system/packages/fields/src/Checkbox.tsx
index 9a0625c90e0..cdcab8498e7 100644
--- a/design-system/packages/fields/src/Checkbox.tsx
+++ b/design-system/packages/fields/src/Checkbox.tsx
@@ -1,18 +1,18 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { Fragment, InputHTMLAttributes, ReactNode, forwardRef } from 'react';
-import { jsx, VisuallyHidden } from '@keystone-ui/core';
+import { Fragment, type InputHTMLAttributes, type ReactNode, forwardRef } from 'react'
+import { jsx, VisuallyHidden } from '@keystone-ui/core'
-import { ControlLabel } from './components/ControlLabel';
-import { CheckIcon } from './components/Icons';
-import { useIndicatorStyles, useIndicatorTokens } from './hooks/indicators';
-import type { SizeType } from './types';
+import { ControlLabel } from './components/ControlLabel'
+import { CheckIcon } from './components/Icons'
+import { useIndicatorStyles, useIndicatorTokens } from './hooks/indicators'
+import type { SizeType } from './types'
type CheckboxProps = {
/** The checkbox label content. */
- children: ReactNode;
-} & CheckboxControlProps;
+ children: ReactNode
+} & CheckboxControlProps
export const Checkbox = forwardRef(
({ children, className, size, ...props }, ref) => {
@@ -24,20 +24,20 @@ export const Checkbox = forwardRef(
>
{children}
- );
+ )
}
-);
+)
type CheckboxControlProps = {
/** When true, the checkbox will be checked. */
- checked?: boolean;
+ checked?: boolean
/** When true, the checkbox will be disabled. */
- disabled?: boolean;
+ disabled?: boolean
/** The size of the Checkbox */
- size?: SizeType;
+ size?: SizeType
/** The value of the Checkbox. */
- value?: string;
-} & Omit, 'size'>;
+ value?: string
+} & Omit, 'size'>
export const CheckboxControl = forwardRef(
({ className, size, ...props }, ref) => (
@@ -48,18 +48,18 @@ export const CheckboxControl = forwardRef
)
-);
+)
const Indicator = ({
className,
size,
...props
}: {
- size?: SizeType;
- children?: ReactNode;
- className?: string;
+ size?: SizeType
+ children?: ReactNode
+ className?: string
}) => {
- const tokens = useIndicatorTokens({ type: 'checkbox', size: size || 'medium' });
- const styles = useIndicatorStyles({ tokens });
- return
;
-};
+ const tokens = useIndicatorTokens({ type: 'checkbox', size: size || 'medium' })
+ const styles = useIndicatorStyles({ tokens })
+ return
+}
diff --git a/design-system/packages/fields/src/DatePicker/Calendar.tsx b/design-system/packages/fields/src/DatePicker/Calendar.tsx
index 2bae98cb515..6fe4a537f29 100644
--- a/design-system/packages/fields/src/DatePicker/Calendar.tsx
+++ b/design-system/packages/fields/src/DatePicker/Calendar.tsx
@@ -1,31 +1,31 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { DayPicker, DayPickerProps } from 'react-day-picker';
-import { jsx, useTheme } from '@keystone-ui/core';
-import { getContrastText } from './utils/getContrastText';
-import { hexToRgb } from './utils/hexToRgb';
+import { DayPicker, type DayPickerProps } from 'react-day-picker'
+import { jsx, useTheme } from '@keystone-ui/core'
+import { getContrastText } from './utils/getContrastText'
+import { hexToRgb } from './utils/hexToRgb'
export const Calendar = ({ modifiers, ...props }: DayPickerProps) => {
- const styles = useCalendarStyles();
- const indexOfMonday = 1;
+ const styles = useCalendarStyles()
+ const indexOfMonday = 1
return (
- );
-};
+ )
+}
// Styles
// ------------------------------
const useCalendarStyles = () => {
- const { colors, palette } = useTheme();
- const cellSize = 40; // theme.sizing.base;
- const navButtonSize = 24; // theme.sizing.xsmall;
- const interactionColor = '#007AFF'; //theme.palette.actions.active;
- const rangeBetweenColor = hexToRgb('#007AFF', 0.2); //hexToRgb(interactionColor, 0.2);
+ const { colors, palette } = useTheme()
+ const cellSize = 40 // theme.sizing.base;
+ const navButtonSize = 24 // theme.sizing.xsmall;
+ const interactionColor = '#007AFF' //theme.palette.actions.active;
+ const rangeBetweenColor = hexToRgb('#007AFF', 0.2) //hexToRgb(interactionColor, 0.2);
return {
padding: 8, //theme.spacing.small,
@@ -254,5 +254,5 @@ const useCalendarStyles = () => {
background: `linear-gradient(to right, ${rangeBetweenColor}, ${colors.overlayBackground})`,
},
},
- } as const;
-};
+ } as const
+}
diff --git a/design-system/packages/fields/src/DatePicker/components/Adornments.tsx b/design-system/packages/fields/src/DatePicker/components/Adornments.tsx
index ae90d451375..1f362a78263 100644
--- a/design-system/packages/fields/src/DatePicker/components/Adornments.tsx
+++ b/design-system/packages/fields/src/DatePicker/components/Adornments.tsx
@@ -1,12 +1,12 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { ElementType, ReactNode, createContext, useContext } from 'react';
-import { jsx, forwardRefWithAs, useTheme } from '@keystone-ui/core';
+import { type ElementType, type ReactNode, createContext, useContext } from 'react'
+import { jsx, forwardRefWithAs, useTheme } from '@keystone-ui/core'
// todo - these also exist at ../../types
-export type SizeType = 'small' | 'medium';
-export type ShapeType = 'square' | 'round';
+export type SizeType = 'small' | 'medium'
+export type ShapeType = 'square' | 'round'
/**
* What is this thing?
@@ -16,20 +16,20 @@ export type ShapeType = 'square' | 'round';
* consolidate in one place.
*/
-const AdornmentContext = createContext<{ shape: ShapeType; size: SizeType }>({
+const AdornmentContext = createContext<{ shape: ShapeType, size: SizeType }>({
shape: 'square',
size: 'medium',
-});
-const useAdornmentContext = () => useContext(AdornmentContext);
+})
+const useAdornmentContext = () => useContext(AdornmentContext)
// Adornment Wrapper
// ------------------------------
export type AdornmentWrapperProps = {
- children: ReactNode;
- shape: ShapeType;
- size: SizeType;
-};
+ children: ReactNode
+ shape: ShapeType
+ size: SizeType
+}
export const AdornmentWrapper = ({ children, shape, size }: AdornmentWrapperProps) => {
return (
@@ -45,8 +45,8 @@ export const AdornmentWrapper = ({ children, shape, size }: AdornmentWrapperProp
{children}
- );
-};
+ )
+}
// Adornment Element
// ------------------------------
@@ -54,18 +54,18 @@ export const AdornmentWrapper = ({ children, shape, size }: AdornmentWrapperProp
const alignmentPaddingMap = {
left: 'marginLeft',
right: 'marginRight',
-};
+}
type AdornmentProps = {
- align: 'left' | 'right';
- as?: ElementType;
-};
+ align: 'left' | 'right'
+ as?: ElementType
+}
export const Adornment = forwardRefWithAs<'div', AdornmentProps>(
({ align, as: Tag = 'div', ...props }, ref) => {
- const { shape, size } = useAdornmentContext();
- const { controlSizes } = useTheme();
+ const { shape, size } = useAdornmentContext()
+ const { controlSizes } = useTheme()
- const { indicatorBoxSize, paddingX } = controlSizes[size];
+ const { indicatorBoxSize, paddingX } = controlSizes[size]
// optical alignment shifts towards the middle of the container with the large
// border radius on "round" inputs. use padding rather than margin to optimise
@@ -75,7 +75,7 @@ export const Adornment = forwardRefWithAs<'div', AdornmentProps>(
? {
[alignmentPaddingMap[align]]: paddingX / 4,
}
- : null;
+ : null
return (
(
}}
{...props}
/>
- );
+ )
}
-);
+)
diff --git a/design-system/packages/fields/src/DatePicker/components/InputButton.tsx b/design-system/packages/fields/src/DatePicker/components/InputButton.tsx
index b185cc6dfca..095117a8642 100644
--- a/design-system/packages/fields/src/DatePicker/components/InputButton.tsx
+++ b/design-system/packages/fields/src/DatePicker/components/InputButton.tsx
@@ -1,38 +1,38 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { ButtonHTMLAttributes, forwardRef } from 'react';
-import { jsx, useTheme, VisuallyHidden } from '@keystone-ui/core';
-import { XIcon } from '@keystone-ui/icons/icons/XIcon';
-import { CalendarIcon } from '@keystone-ui/icons/icons/CalendarIcon';
-import { useInputTokens, useInputStyles } from '../..';
-import { Adornment, AdornmentWrapper } from './Adornments';
+import { type ButtonHTMLAttributes, forwardRef } from 'react'
+import { jsx, useTheme, VisuallyHidden } from '@keystone-ui/core'
+import { XIcon } from '@keystone-ui/icons/icons/XIcon'
+import { CalendarIcon } from '@keystone-ui/icons/icons/CalendarIcon'
+import { useInputTokens, useInputStyles } from '../..'
+import { Adornment, AdornmentWrapper } from './Adornments'
type ButtonProps = {
- invalid?: boolean;
- isSelected?: boolean;
- onClear?: () => void;
-} & ButtonHTMLAttributes;
+ invalid?: boolean
+ isSelected?: boolean
+ onClear?: () => void
+} & ButtonHTMLAttributes
export const InputButton = forwardRef(
({ invalid = false, isSelected, onClear, ...props }, ref) => {
- const { spacing } = useTheme();
- const inputTokens = useInputTokens({ size: 'medium' });
- const inputStyles = useInputStyles({ invalid, tokens: inputTokens });
+ const { spacing } = useTheme()
+ const inputTokens = useInputTokens({ size: 'medium' })
+ const inputStyles = useInputStyles({ invalid, tokens: inputTokens })
const focusStyles = isSelected
? {
...inputStyles[':focus'],
':hover': inputStyles[':focus'],
':focus': inputStyles[':focus'],
}
- : null;
+ : null
const buttonStyles = {
...inputStyles,
...focusStyles,
cursor: 'pointer',
lineHeight: 'initial', // let the button vertically align its text; the have different native behaviour to inputs
textAlign: 'left',
- } as const;
+ } as const
return (
@@ -42,12 +42,12 @@ export const InputButton = forwardRef(
- );
+ )
}
-);
+)
const ClearButton = (props: ButtonHTMLAttributes) => {
- const { colors } = useTheme();
+ const { colors } = useTheme()
return (
) => {
clear date value
- );
-};
+ )
+}
diff --git a/design-system/packages/fields/src/DatePicker/index.tsx b/design-system/packages/fields/src/DatePicker/index.tsx
index 74cc357c59b..608c56f269b 100644
--- a/design-system/packages/fields/src/DatePicker/index.tsx
+++ b/design-system/packages/fields/src/DatePicker/index.tsx
@@ -1,39 +1,39 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { Fragment, useCallback, useEffect, useRef, useState } from 'react';
-import FocusLock from 'react-focus-lock';
-import { jsx } from '@keystone-ui/core';
-import { PopoverDialog, useControlledPopover } from '@keystone-ui/popover';
+import { Fragment, useCallback, useEffect, useRef, useState } from 'react'
+import FocusLock from 'react-focus-lock'
+import { jsx } from '@keystone-ui/core'
+import { PopoverDialog, useControlledPopover } from '@keystone-ui/popover'
import {
deserializeDate,
formatDate,
formatDateType,
dateFormatPlaceholder,
-} from '../utils/dateFormatters';
-import { DateType } from '../types';
-import { Calendar } from './Calendar';
-import { InputButton } from './components/InputButton';
+} from '../utils/dateFormatters'
+import { type DateType } from '../types'
+import { Calendar } from './Calendar'
+import { InputButton } from './components/InputButton'
-export type DateInputValue = string | undefined;
+export type DateInputValue = string | undefined
export type DatePickerProps = {
- onUpdate: (value: DateType) => void;
- onClear: () => void;
- onBlur?: () => void;
- value: DateType;
-};
+ onUpdate: (value: DateType) => void
+ onClear: () => void
+ onBlur?: () => void
+ value: DateType
+}
export function useEventCallback any>(callback: Func): Func {
- const callbackRef = useRef(callback);
+ const callbackRef = useRef(callback)
const cb = useCallback((...args: any[]) => {
- return callbackRef.current(...args);
- }, []);
+ return callbackRef.current(...args)
+ }, [])
useEffect(() => {
- callbackRef.current = callback;
- });
- return cb as any;
+ callbackRef.current = callback
+ })
+ return cb as any
}
export const DatePicker = ({
@@ -43,24 +43,24 @@ export const DatePicker = ({
onBlur: _onBlur,
...props
}: DatePickerProps) => {
- const [isOpen, _setOpen] = useState(false);
+ const [isOpen, _setOpen] = useState(false)
const onBlur = useEventCallback(() => {
- _onBlur?.();
- });
+ _onBlur?.()
+ })
const setOpen = useCallback(
(val: boolean) => {
- _setOpen(val);
+ _setOpen(val)
if (!val) {
- onBlur?.();
+ onBlur?.()
}
},
[onBlur]
- );
+ )
const { dialog, trigger, arrow } = useControlledPopover(
{
isOpen,
onClose: useCallback(() => {
- setOpen(false);
+ setOpen(false)
}, [setOpen]),
},
{
@@ -74,24 +74,24 @@ export const DatePicker = ({
},
],
}
- );
+ )
const handleDayClick = useCallback(
(day: Date) => {
- onUpdate(formatDateType(day));
+ onUpdate(formatDateType(day))
// wait a moment so the user has time to see the day become selected
setTimeout(() => {
- setOpen(false);
- }, 300);
+ setOpen(false)
+ }, 300)
},
[onUpdate, setOpen]
- );
+ )
// We **can** memoize this, but its a trivial operation
// and in the opinion of the author not really something to do
// before other more important performance optimisations
- const selectedDay = deserializeDate(value);
- const formattedDate: DateInputValue = value ? formatDate(selectedDay) : undefined;
+ const selectedDay = deserializeDate(value)
+ const formattedDate: DateInputValue = value ? formatDate(selectedDay) : undefined
return (
@@ -101,8 +101,8 @@ export const DatePicker = ({
onClear={
value
? () => {
- onClear();
- onBlur?.();
+ onClear()
+ onBlur?.()
}
: undefined
}
@@ -123,5 +123,5 @@ export const DatePicker = ({
)}
- );
-};
+ )
+}
diff --git a/design-system/packages/fields/src/DatePicker/utils/getContrastText.ts b/design-system/packages/fields/src/DatePicker/utils/getContrastText.ts
index ddfcbe385af..2ade99a3bf3 100644
--- a/design-system/packages/fields/src/DatePicker/utils/getContrastText.ts
+++ b/design-system/packages/fields/src/DatePicker/utils/getContrastText.ts
@@ -1,10 +1,10 @@
-import { hexToTriplet } from './hexToRgb';
+import { hexToTriplet } from './hexToRgb'
-export function getContrastText(color: string) {
- const [r, g, b] = hexToTriplet(color);
+export function getContrastText (color: string) {
+ const [r, g, b] = hexToTriplet(color)
// calculate contrast against grayscale
- var contrast = (Math.round(r * 299) + Math.round(g * 587) + Math.round(b * 114)) / 1000;
+ var contrast = (Math.round(r * 299) + Math.round(g * 587) + Math.round(b * 114)) / 1000
- return contrast >= 128 ? 'black' : 'white';
+ return contrast >= 128 ? 'black' : 'white'
}
diff --git a/design-system/packages/fields/src/DatePicker/utils/hexToRgb.ts b/design-system/packages/fields/src/DatePicker/utils/hexToRgb.ts
index 21cb5761b30..2eae0c53a77 100644
--- a/design-system/packages/fields/src/DatePicker/utils/hexToRgb.ts
+++ b/design-system/packages/fields/src/DatePicker/utils/hexToRgb.ts
@@ -1,39 +1,39 @@
-function parseHex(hex: string) {
- let result = hex;
+function parseHex (hex: string) {
+ let result = hex
// remove hash symbol
if (result.startsWith('#')) {
- result = result.slice(1);
+ result = result.slice(1)
}
// resolve hex shortcuts
if (result.length === 3) {
- result = result[0].repeat(2) + result[1].repeat(2) + result[2].repeat(2);
+ result = result[0].repeat(2) + result[1].repeat(2) + result[2].repeat(2)
}
- return result;
+ return result
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
-export function hexToTriplet(dirtyHex: string, alpha?: number) {
- const cleanHex = parseHex(dirtyHex);
+export function hexToTriplet (dirtyHex: string, alpha?: number) {
+ const cleanHex = parseHex(dirtyHex)
- const r = parseInt(cleanHex.slice(0, 2), 16);
- const g = parseInt(cleanHex.slice(2, 4), 16);
- const b = parseInt(cleanHex.slice(4, 6), 16);
+ const r = parseInt(cleanHex.slice(0, 2), 16)
+ const g = parseInt(cleanHex.slice(2, 4), 16)
+ const b = parseInt(cleanHex.slice(4, 6), 16)
- return [r, g, b];
+ return [r, g, b]
}
// values taken from contrast algorithms from w3
// https://www.w3.org/TR/AERT/#color-contrast
-export function hexToRgb(dirtyHex: string, alpha?: number) {
- const [r, g, b] = hexToTriplet(dirtyHex);
- const value = `${r}, ${g}, ${b}`;
+export function hexToRgb (dirtyHex: string, alpha?: number) {
+ const [r, g, b] = hexToTriplet(dirtyHex)
+ const value = `${r}, ${g}, ${b}`
if (alpha) {
- return `rgba(${value}, ${alpha})`;
+ return `rgba(${value}, ${alpha})`
}
- return `rgb(${value})`;
+ return `rgb(${value})`
}
diff --git a/design-system/packages/fields/src/FieldContainer.tsx b/design-system/packages/fields/src/FieldContainer.tsx
index 1341139129c..a14e34b4061 100644
--- a/design-system/packages/fields/src/FieldContainer.tsx
+++ b/design-system/packages/fields/src/FieldContainer.tsx
@@ -1,7 +1,7 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx, forwardRefWithAs } from '@keystone-ui/core';
+import { jsx, forwardRefWithAs } from '@keystone-ui/core'
export const FieldContainer = forwardRefWithAs<'div', {}>(({ as: Tag = 'div', ...props }, ref) => {
- return ;
-});
+ return
+})
diff --git a/design-system/packages/fields/src/FieldDescription.tsx b/design-system/packages/fields/src/FieldDescription.tsx
index 7335d2007fd..f1c5bef77ee 100644
--- a/design-system/packages/fields/src/FieldDescription.tsx
+++ b/design-system/packages/fields/src/FieldDescription.tsx
@@ -1,17 +1,17 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx, useTheme } from '@keystone-ui/core';
+import { jsx, useTheme } from '@keystone-ui/core'
type FieldDescriptionProps = {
- id: string;
- children: string | null;
-};
+ id: string
+ children: string | null
+}
export const FieldDescription = (props: FieldDescriptionProps) => {
- const { spacing, palette } = useTheme();
+ const { spacing, palette } = useTheme()
if (props.children === null) {
- return null;
+ return null
}
return (
{
}}
{...props}
/>
- );
-};
+ )
+}
diff --git a/design-system/packages/fields/src/FieldLabel.tsx b/design-system/packages/fields/src/FieldLabel.tsx
index 32a6a78b230..6d0627cfecd 100644
--- a/design-system/packages/fields/src/FieldLabel.tsx
+++ b/design-system/packages/fields/src/FieldLabel.tsx
@@ -1,16 +1,16 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { forwardRefWithAs, jsx, useTheme } from '@keystone-ui/core';
-import type { ReactNode } from 'react';
+import { forwardRefWithAs, jsx, useTheme } from '@keystone-ui/core'
+import type { ReactNode } from 'react'
type FieldLabelProps = {
- children: ReactNode;
-};
+ children: ReactNode
+}
export const FieldLabel = forwardRefWithAs<'label', FieldLabelProps>(
({ as: Tag = 'label', children, ...props }, ref) => {
- const { typography, fields, spacing } = useTheme();
+ const { typography, fields, spacing } = useTheme()
return (
(
>
{children}
- );
+ )
}
-);
+)
diff --git a/design-system/packages/fields/src/FieldLegend.tsx b/design-system/packages/fields/src/FieldLegend.tsx
index 3c8fd7d5a71..4ad84cadeda 100644
--- a/design-system/packages/fields/src/FieldLegend.tsx
+++ b/design-system/packages/fields/src/FieldLegend.tsx
@@ -1,13 +1,13 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx, useTheme } from '@keystone-ui/core';
-import type { HTMLAttributes } from 'react';
+import { jsx, useTheme } from '@keystone-ui/core'
+import type { HTMLAttributes } from 'react'
-type FieldLegendProps = HTMLAttributes
;
+type FieldLegendProps = HTMLAttributes
export const FieldLegend = (props: FieldLegendProps) => {
- const { typography, fields, spacing } = useTheme();
+ const { typography, fields, spacing } = useTheme()
return (
{
}}
{...props}
/>
- );
-};
+ )
+}
diff --git a/design-system/packages/fields/src/Radio.tsx b/design-system/packages/fields/src/Radio.tsx
index ec953acc128..9df7e0eaaf2 100644
--- a/design-system/packages/fields/src/Radio.tsx
+++ b/design-system/packages/fields/src/Radio.tsx
@@ -1,18 +1,18 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { Fragment, InputHTMLAttributes, ReactNode, forwardRef } from 'react';
-import { jsx, VisuallyHidden } from '@keystone-ui/core';
+import { Fragment, type InputHTMLAttributes, type ReactNode, forwardRef } from 'react'
+import { jsx, VisuallyHidden } from '@keystone-ui/core'
-import { ControlLabel } from './components/ControlLabel';
-import { DotIcon } from './components/Icons';
-import { useIndicatorStyles, useIndicatorTokens } from './hooks/indicators';
-import type { SizeType } from './types';
+import { ControlLabel } from './components/ControlLabel'
+import { DotIcon } from './components/Icons'
+import { useIndicatorStyles, useIndicatorTokens } from './hooks/indicators'
+import type { SizeType } from './types'
type RadioProps = {
/** The radio label content. */
- children: ReactNode;
-} & RadioControlProps;
+ children: ReactNode
+} & RadioControlProps
export const Radio = forwardRef(
({ children, className, size, ...props }, ref) => {
@@ -24,20 +24,20 @@ export const Radio = forwardRef(
>
{children}
- );
+ )
}
-);
+)
type RadioControlProps = {
/** When true, the radio will be checked. */
- checked?: boolean;
+ checked?: boolean
/** When true, the radio will be disabled. */
- disabled?: boolean;
+ disabled?: boolean
/** The size of the Radio */
- size?: SizeType;
+ size?: SizeType
/** The value of the Radio. */
- value?: string;
-} & Omit, 'size'>;
+ value?: string
+} & Omit, 'size'>
export const RadioControl = forwardRef(
({ size, ...props }, ref) => (
@@ -48,10 +48,10 @@ export const RadioControl = forwardRef(
)
-);
+)
-const Indicator = ({ size, ...props }: { size?: SizeType; children?: ReactNode }) => {
- const tokens = useIndicatorTokens({ type: 'radio', size: size || 'medium' });
- const styles = useIndicatorStyles({ tokens });
- return
;
-};
+const Indicator = ({ size, ...props }: { size?: SizeType, children?: ReactNode }) => {
+ const tokens = useIndicatorTokens({ type: 'radio', size: size || 'medium' })
+ const styles = useIndicatorStyles({ tokens })
+ return
+}
diff --git a/design-system/packages/fields/src/Select.tsx b/design-system/packages/fields/src/Select.tsx
index 5776fa56cb3..c643bfd7583 100644
--- a/design-system/packages/fields/src/Select.tsx
+++ b/design-system/packages/fields/src/Select.tsx
@@ -1,39 +1,39 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx, useTheme } from '@keystone-ui/core';
-import ReactSelect, { Options, mergeStyles, Props } from 'react-select';
-import { useInputTokens } from './hooks/inputs';
-import { WidthType } from './types';
+import { jsx, useTheme } from '@keystone-ui/core'
+import ReactSelect, { type Options, mergeStyles, type Props } from 'react-select'
+import { useInputTokens } from './hooks/inputs'
+import { type WidthType } from './types'
-type Option = { label: string; value: string; isDisabled?: boolean };
+type Option = { label: string, value: string, isDisabled?: boolean }
type BaseSelectProps = Omit<
Props,
'value' | 'onChange' | 'isMulti' | 'isOptionDisabled'
-> & { width?: WidthType };
+> & { width?: WidthType }
-export { components as selectComponents } from 'react-select';
+export { components as selectComponents } from 'react-select'
type ControlState = {
- isDisabled?: boolean;
- isFocused: boolean;
-};
+ isDisabled?: boolean
+ isFocused: boolean
+}
const useStyles = ({
tokens,
multi = false,
}: {
- tokens: ReturnType;
- multi?: boolean;
+ tokens: ReturnType
+ multi?: boolean
}) => {
- const { palette } = useTheme();
+ const { palette } = useTheme()
const indicatorStyles = (provided: any, state: ControlState) => ({
...provided,
color: state.isFocused ? palette.neutral600 : palette.neutral500,
':hover': {
color: state.isFocused ? palette.neutral800 : palette.neutral700,
},
- });
+ })
return {
control: (provided: any, state: ControlState) => {
const base = {
@@ -45,7 +45,7 @@ const useStyles = ({
fontSize: tokens.fontSize,
boxShadow: tokens.shadow,
transition: tokens.transition,
- };
+ }
const variant = state.isDisabled
? {
backgroundColor: tokens.disabled.background || tokens.background,
@@ -67,8 +67,8 @@ const useStyles = ({
boxShadow: tokens.hover.shadow,
color: tokens.hover.foreground,
},
- };
- return { ...provided, ...base, ...variant };
+ }
+ return { ...provided, ...base, ...variant }
},
clearIndicator: indicatorStyles,
dropdownIndicator: indicatorStyles,
@@ -102,12 +102,12 @@ const useStyles = ({
...provided,
padding: multi ? `0 4px` : `0 6px`,
}),
- };
-};
+ }
+}
-const portalTarget = typeof document !== 'undefined' ? document.body : undefined;
+const portalTarget = typeof document !== 'undefined' ? document.body : undefined
-export function Select({
+export function Select ({
id,
onChange,
value,
@@ -116,13 +116,13 @@ export function Select({
styles,
...props
}: BaseSelectProps & {
- value: Option | null;
- portalMenu?: true;
- onChange(value: Option | null): void;
+ value: Option | null
+ portalMenu?: true
+ onChange(value: Option | null): void
}) {
- const tokens = useInputTokens({ width: widthKey });
- const defaultStyles = useStyles({ tokens });
- const composedStyles = styles ? mergeStyles(defaultStyles, styles) : defaultStyles;
+ const tokens = useInputTokens({ width: widthKey })
+ const defaultStyles = useStyles({ tokens })
+ const composedStyles = styles ? mergeStyles(defaultStyles, styles) : defaultStyles
return (
{
if (!value) {
- onChange(null);
+ onChange(null)
} else {
- onChange(value as any);
+ onChange(value as any)
}
}}
{...props}
isMulti={false}
menuPortalTarget={portalMenu && portalTarget}
/>
- );
+ )
}
-export function MultiSelect({
+export function MultiSelect ({
id,
onChange,
value,
@@ -153,13 +153,13 @@ export function MultiSelect({
styles,
...props
}: BaseSelectProps & {
- value: Options;
- portalMenu?: true;
- onChange(value: Options ): void;
+ value: Options
+ portalMenu?: true
+ onChange(value: Options ): void
}) {
- const tokens = useInputTokens({ width: widthKey });
- const defaultStyles = useStyles({ tokens, multi: true });
- const composedStyles = styles ? mergeStyles(defaultStyles, styles) : defaultStyles;
+ const tokens = useInputTokens({ width: widthKey })
+ const defaultStyles = useStyles({ tokens, multi: true })
+ const composedStyles = styles ? mergeStyles(defaultStyles, styles) : defaultStyles
return (
{
if (!value) {
- onChange([]);
+ onChange([])
} else if (Array.isArray(value)) {
- onChange(value as Option[]);
+ onChange(value as Option[])
} else {
- onChange([value as any]);
+ onChange([value as any])
}
}}
{...props}
isMulti
menuPortalTarget={portalMenu && portalTarget}
/>
- );
+ )
}
diff --git a/design-system/packages/fields/src/Switch.tsx b/design-system/packages/fields/src/Switch.tsx
index e10a1f20eb1..290c331c8d9 100644
--- a/design-system/packages/fields/src/Switch.tsx
+++ b/design-system/packages/fields/src/Switch.tsx
@@ -14,15 +14,15 @@
* - Should this be stateful like a checkbox? check react-aria
*/
-import { ButtonHTMLAttributes, forwardRef, ReactNode } from 'react';
-import { jsx, useTheme, VisuallyHidden } from '@keystone-ui/core';
+import { type ButtonHTMLAttributes, forwardRef, type ReactNode } from 'react'
+import { jsx, useTheme, VisuallyHidden } from '@keystone-ui/core'
-import { ControlLabel } from './components/ControlLabel';
+import { ControlLabel } from './components/ControlLabel'
type SwitchProps = {
/** The switch label content. */
- children: ReactNode;
-} & SwitchControlProps;
+ children: ReactNode
+} & SwitchControlProps
export const Switch = forwardRef(
({ children, className, ...props }, ref) => {
@@ -30,44 +30,44 @@ export const Switch = forwardRef(
}>
{children}
- );
+ )
}
-);
+)
-type ButtonProps = ButtonHTMLAttributes;
+type ButtonProps = ButtonHTMLAttributes
type SwitchControlProps = {
/** Optionally pass in "On" and "Off" label text for screen readers */
- a11yLabels?: { on: string; off: string };
+ a11yLabels?: { on: string, off: string }
/** The current checked state. */
- checked?: boolean;
+ checked?: boolean
/** Handle change events. */
- onChange?: (checked: boolean) => void;
-} & Omit;
+ onChange?: (checked: boolean) => void
+} & Omit
export const SwitchControl = forwardRef(
({ a11yLabels = { on: 'On', off: 'Off' }, checked = false, onChange, ...props }, ref) => {
let onClick = () => {
if (onChange) {
- onChange(!checked);
+ onChange(!checked)
}
- };
+ }
return (
{checked ? a11yLabels.on : a11yLabels.off}
- );
+ )
}
-);
+)
const Button = forwardRef((props, ref) => {
- const { animation, fields, sizing } = useTheme();
+ const { animation, fields, sizing } = useTheme()
- let gutter = 3;
- let trackHeight = sizing.xsmall + gutter;
- let trackWidth = trackHeight * 2 - 2 * gutter;
- let handleSize = trackHeight - gutter * 2;
+ let gutter = 3
+ let trackHeight = sizing.xsmall + gutter
+ let trackWidth = trackHeight * 2 - 2 * gutter
+ let handleSize = trackHeight - gutter * 2
return (
((props, ref) => {
}}
{...props}
/>
- );
-});
+ )
+})
diff --git a/design-system/packages/fields/src/TextArea.tsx b/design-system/packages/fields/src/TextArea.tsx
index a4b6fd6e504..723e04af0cf 100644
--- a/design-system/packages/fields/src/TextArea.tsx
+++ b/design-system/packages/fields/src/TextArea.tsx
@@ -1,26 +1,26 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { InputHTMLAttributes, forwardRef } from 'react';
-import { jsx } from '@keystone-ui/core';
+import { type InputHTMLAttributes, forwardRef } from 'react'
+import { jsx } from '@keystone-ui/core'
-import { useInputStyles, useInputTokens } from './hooks/inputs';
-import type { SizeType, WidthType } from './types';
+import { useInputStyles, useInputTokens } from './hooks/inputs'
+import type { SizeType, WidthType } from './types'
-type InputProps = InputHTMLAttributes;
+type InputProps = InputHTMLAttributes
export type TextAreaProps = {
- invalid?: boolean;
- size?: SizeType;
- width?: WidthType;
- onChange?: NonNullable;
- value?: NonNullable;
-} & Omit;
+ invalid?: boolean
+ size?: SizeType
+ width?: WidthType
+ onChange?: NonNullable
+ value?: NonNullable
+} & Omit
export const TextArea = forwardRef(
({ invalid = false, size = 'medium' as const, width = 'large' as const, ...props }, ref) => {
- const tokens = useInputTokens({ size, width, shape: 'square', isMultiline: true });
- const styles = useInputStyles({ invalid, tokens });
+ const tokens = useInputTokens({ size, width, shape: 'square', isMultiline: true })
+ const styles = useInputStyles({ invalid, tokens })
- return ;
+ return
}
-);
+)
diff --git a/design-system/packages/fields/src/TextInput.tsx b/design-system/packages/fields/src/TextInput.tsx
index 786f89c257d..b52686bbb84 100644
--- a/design-system/packages/fields/src/TextInput.tsx
+++ b/design-system/packages/fields/src/TextInput.tsx
@@ -7,11 +7,11 @@
* - Support icons in the input (search, etc)
*/
-import { InputHTMLAttributes, forwardRef } from 'react';
-import { jsx } from '@keystone-ui/core';
+import { type InputHTMLAttributes, forwardRef } from 'react'
+import { jsx } from '@keystone-ui/core'
-import { useInputStyles, useInputTokens } from './hooks/inputs';
-import type { ShapeType, SizeType, WidthType } from './types';
+import { useInputStyles, useInputTokens } from './hooks/inputs'
+import type { ShapeType, SizeType, WidthType } from './types'
const validTypes = {
email: 'email',
@@ -21,19 +21,19 @@ const validTypes = {
tel: 'tel',
text: 'text',
url: 'url',
-};
+}
-type InputProps = InputHTMLAttributes;
+type InputProps = InputHTMLAttributes
export type TextInputProps = {
- invalid?: boolean;
- shape?: ShapeType;
- size?: SizeType;
- width?: WidthType;
- type?: keyof typeof validTypes;
- onChange?: NonNullable;
- value?: NonNullable;
-} & Omit;
+ invalid?: boolean
+ shape?: ShapeType
+ size?: SizeType
+ width?: WidthType
+ type?: keyof typeof validTypes
+ onChange?: NonNullable
+ value?: NonNullable
+} & Omit
export const TextInput = forwardRef(
(
@@ -47,9 +47,9 @@ export const TextInput = forwardRef(
},
ref
) => {
- const tokens = useInputTokens({ size, width, shape });
- const styles = useInputStyles({ invalid, tokens });
+ const tokens = useInputTokens({ size, width, shape })
+ const styles = useInputStyles({ invalid, tokens })
- return ;
+ return
}
-);
+)
diff --git a/design-system/packages/fields/src/components/ControlLabel.tsx b/design-system/packages/fields/src/components/ControlLabel.tsx
index d906a93a93c..a9273f8fb1a 100644
--- a/design-system/packages/fields/src/components/ControlLabel.tsx
+++ b/design-system/packages/fields/src/components/ControlLabel.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { ReactNode, ReactElement } from 'react';
-import { jsx, useTheme } from '@keystone-ui/core';
+import { type ReactNode, type ReactElement } from 'react'
+import { jsx, useTheme } from '@keystone-ui/core'
-import type { SizeType } from '../types';
+import type { SizeType } from '../types'
/**
* TODO
@@ -13,11 +13,11 @@ import type { SizeType } from '../types';
*/
type ControlLabelProps = {
- className?: string;
- control: ReactElement;
- children?: ReactNode;
- size?: SizeType;
-};
+ className?: string
+ control: ReactElement
+ children?: ReactNode
+ size?: SizeType
+}
export const ControlLabel = ({
children,
@@ -25,9 +25,9 @@ export const ControlLabel = ({
control,
size: sizeKey = 'medium',
}: ControlLabelProps) => {
- const { controlSizes, spacing, typography } = useTheme();
+ const { controlSizes, spacing, typography } = useTheme()
- const size = controlSizes[sizeKey];
+ const size = controlSizes[sizeKey]
return (
@@ -45,5 +45,5 @@ export const ControlLabel = ({
)}
- );
-};
+ )
+}
diff --git a/design-system/packages/fields/src/components/Icons.tsx b/design-system/packages/fields/src/components/Icons.tsx
index 7f64e487b70..5c4516cbbe4 100644
--- a/design-system/packages/fields/src/components/Icons.tsx
+++ b/design-system/packages/fields/src/components/Icons.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { ReactNode } from 'react';
-import { jsx } from '@keystone-ui/core';
+import { type ReactNode } from 'react'
+import { jsx } from '@keystone-ui/core'
-type SvgProps = { children: ReactNode; size: string | number; stroke?: string; fill?: string };
+type SvgProps = { children: ReactNode, size: string | number, stroke?: string, fill?: string }
const Svg = ({ children, size, stroke = 'none', fill = 'none' }: SvgProps) => (
(
>
{children}
-);
+)
const checkSizeMap = {
small: 14,
medium: 18,
large: 24,
-};
+}
export const CheckIcon = ({ size = 'medium' }: { size?: keyof typeof checkSizeMap }) => {
return (
- );
-};
+ )
+}
const dotSizeMap = {
small: 12,
medium: 16,
large: 20,
-};
+}
export const DotIcon = ({ size = 'medium' }: { size?: keyof typeof dotSizeMap }) => {
return (
- );
-};
+ )
+}
diff --git a/design-system/packages/fields/src/hooks/indicators.ts b/design-system/packages/fields/src/hooks/indicators.ts
index 253c0b0bba7..341ce7e7ca0 100644
--- a/design-system/packages/fields/src/hooks/indicators.ts
+++ b/design-system/packages/fields/src/hooks/indicators.ts
@@ -1,39 +1,39 @@
-import { useTheme } from '@keystone-ui/core';
+import { useTheme } from '@keystone-ui/core'
-import type { SizeType } from '../types';
+import type { SizeType } from '../types'
export type IndicatorTokensProps = {
/** The size of the indicator */
- size: SizeType;
+ size: SizeType
/** Controls whether the indicator looks like a checkbox or radio button */
- type: 'checkbox' | 'radio';
-};
+ type: 'checkbox' | 'radio'
+}
type IndicatorStateTokens = {
- background?: string;
- borderColor?: string;
- shadow?: string;
- foreground?: string;
-};
+ background?: string
+ borderColor?: string
+ shadow?: string
+ foreground?: string
+}
export type IndicatorTokens = {
- borderRadius?: string | number;
- borderWidth?: string | number;
- boxSize: string | number;
- transition?: string;
- hover: IndicatorStateTokens;
- focus: IndicatorStateTokens;
- selected: IndicatorStateTokens;
- disabled: IndicatorStateTokens;
-} & IndicatorStateTokens;
+ borderRadius?: string | number
+ borderWidth?: string | number
+ boxSize: string | number
+ transition?: string
+ hover: IndicatorStateTokens
+ focus: IndicatorStateTokens
+ selected: IndicatorStateTokens
+ disabled: IndicatorStateTokens
+} & IndicatorStateTokens
export const useIndicatorTokens = ({
size: sizeKey,
type,
}: IndicatorTokensProps): IndicatorTokens => {
- const { controlSizes, fields } = useTheme();
+ const { controlSizes, fields } = useTheme()
- const size = controlSizes[sizeKey];
+ const size = controlSizes[sizeKey]
return {
background: fields.controlBackground,
@@ -68,10 +68,10 @@ export const useIndicatorTokens = ({
shadow: fields.disabled.shadow,
foreground: fields.disabled.controlForeground,
},
- };
-};
+ }
+}
-export type IndicatorStylesProps = { tokens: IndicatorTokens };
+export type IndicatorStylesProps = { tokens: IndicatorTokens }
export const useIndicatorStyles = ({ tokens }: IndicatorStylesProps) => {
return {
@@ -119,5 +119,5 @@ export const useIndicatorStyles = ({ tokens }: IndicatorStylesProps) => {
'input:checked:disabled + &': {
color: tokens.disabled.foreground,
},
- } as const;
-};
+ } as const
+}
diff --git a/design-system/packages/fields/src/hooks/inputs.ts b/design-system/packages/fields/src/hooks/inputs.ts
index 9deac65f534..f21915478df 100644
--- a/design-system/packages/fields/src/hooks/inputs.ts
+++ b/design-system/packages/fields/src/hooks/inputs.ts
@@ -1,6 +1,6 @@
-import { useTheme } from '@keystone-ui/core';
+import { useTheme } from '@keystone-ui/core'
-import type { ShapeType, SizeType, WidthType } from '../types';
+import type { ShapeType, SizeType, WidthType } from '../types'
// TODO: Move to theme.
export const widthMap = {
@@ -8,43 +8,43 @@ export const widthMap = {
medium: 256,
large: 512,
full: '100%',
-};
+}
export type InputTokensProps = {
/* Fixes the height at a specific value. Uses vertical centering instead of padding */
- isMultiline?: boolean;
+ isMultiline?: boolean
/* Changes the shape by controlling the border radius token */
- shape?: ShapeType;
+ shape?: ShapeType
/* Sets the size of the input */
- size?: SizeType;
+ size?: SizeType
/* Sets the width of the input (distinct from size) */
- width?: WidthType;
-};
+ width?: WidthType
+}
type InputStateTokens = {
- background?: string;
- borderColor?: string;
- foreground?: string;
- shadow?: string;
-};
+ background?: string
+ borderColor?: string
+ foreground?: string
+ shadow?: string
+}
export type InputTokens = {
- borderRadius?: number | string;
- borderWidth?: number | string;
- fontSize?: number | string;
- lineHeight?: number | string;
+ borderRadius?: number | string
+ borderWidth?: number | string
+ fontSize?: number | string
+ lineHeight?: number | string
// width: number | string;
- height?: number | string;
- paddingX: number | string;
- paddingY: number | string;
- placeholder?: string;
- resize?: string;
- transition?: string;
+ height?: number | string
+ paddingX: number | string
+ paddingY: number | string
+ placeholder?: string
+ resize?: string
+ transition?: string
- hover: InputStateTokens;
- focus: InputStateTokens;
- invalid: InputStateTokens;
- disabled: InputStateTokens;
-} & InputStateTokens;
+ hover: InputStateTokens
+ focus: InputStateTokens
+ invalid: InputStateTokens
+ disabled: InputStateTokens
+} & InputStateTokens
export const useInputTokens = ({
size: sizeKey = 'medium',
@@ -52,10 +52,10 @@ export const useInputTokens = ({
isMultiline = false,
shape = 'square',
}: InputTokensProps): InputTokens => {
- const { animation, controlSizes, fields, radii, spacing, typography } = useTheme();
+ const { animation, controlSizes, fields, radii, spacing, typography } = useTheme()
// const width = widthMap[widthKey];
- const size = controlSizes[sizeKey];
+ const size = controlSizes[sizeKey]
return {
background: fields.inputBackground,
@@ -100,15 +100,15 @@ export const useInputTokens = ({
shadow: fields.disabled.shadow,
foreground: fields.disabled.inputForeground,
},
- } as const;
-};
+ } as const
+}
export type InputStylesProps = {
- invalid: boolean;
- tokens: InputTokens;
-};
+ invalid: boolean
+ tokens: InputTokens
+}
-export function useInputStyles({ invalid, tokens }: InputStylesProps) {
+export function useInputStyles ({ invalid, tokens }: InputStylesProps) {
const styles = {
appearance: 'none',
backgroundColor: invalid ? tokens.invalid.background : tokens.background,
@@ -153,7 +153,7 @@ export function useInputStyles({ invalid, tokens }: InputStylesProps) {
'&::placeholder': {
color: tokens.placeholder,
},
- } as const;
+ } as const
- return styles;
+ return styles
}
diff --git a/design-system/packages/fields/src/index.ts b/design-system/packages/fields/src/index.ts
index 2e875ac72fa..2e70c28b2ff 100644
--- a/design-system/packages/fields/src/index.ts
+++ b/design-system/packages/fields/src/index.ts
@@ -7,17 +7,17 @@
* - Need a Field Layout component - THIS!
*/
-export { Checkbox, CheckboxControl } from './Checkbox';
-export { FieldContainer } from './FieldContainer';
-export { FieldLabel } from './FieldLabel';
-export { FieldLegend } from './FieldLegend';
-export { FieldDescription } from './FieldDescription';
-export { Radio } from './Radio';
-export { Switch } from './Switch';
-export { TextArea } from './TextArea';
-export { TextInput } from './TextInput';
-export { Select, MultiSelect, selectComponents } from './Select';
-export { useIndicatorTokens, useIndicatorStyles } from './hooks/indicators';
-export { useInputTokens, useInputStyles } from './hooks/inputs';
-export { DatePicker } from './DatePicker';
-export type { DateType } from './types';
+export { Checkbox, CheckboxControl } from './Checkbox'
+export { FieldContainer } from './FieldContainer'
+export { FieldLabel } from './FieldLabel'
+export { FieldLegend } from './FieldLegend'
+export { FieldDescription } from './FieldDescription'
+export { Radio } from './Radio'
+export { Switch } from './Switch'
+export { TextArea } from './TextArea'
+export { TextInput } from './TextInput'
+export { Select, MultiSelect, selectComponents } from './Select'
+export { useIndicatorTokens, useIndicatorStyles } from './hooks/indicators'
+export { useInputTokens, useInputStyles } from './hooks/inputs'
+export { DatePicker } from './DatePicker'
+export type { DateType } from './types'
diff --git a/design-system/packages/fields/src/types.ts b/design-system/packages/fields/src/types.ts
index 99fbe447730..55bd3984ad7 100644
--- a/design-system/packages/fields/src/types.ts
+++ b/design-system/packages/fields/src/types.ts
@@ -1,6 +1,6 @@
-export type WidthType = 'small' | 'medium' | 'large' | 'full';
-export type SizeType = 'small' | 'medium' | 'large';
-export type ShapeType = 'square' | 'round';
+export type WidthType = 'small' | 'medium' | 'large' | 'full'
+export type SizeType = 'small' | 'medium' | 'large'
+export type ShapeType = 'square' | 'round'
// A primitive data type for date fields, which is a formatted ISO8601 date string or "" for empty
-export type DateType = string;
+export type DateType = string
diff --git a/design-system/packages/fields/src/utils/dateFormatters.ts b/design-system/packages/fields/src/utils/dateFormatters.ts
index 3d05809b036..f0a650931ab 100644
--- a/design-system/packages/fields/src/utils/dateFormatters.ts
+++ b/design-system/packages/fields/src/utils/dateFormatters.ts
@@ -1,38 +1,38 @@
-import { formatISO, parse } from 'date-fns';
-import { DateType } from '../types';
+import { formatISO, parse } from 'date-fns'
+import { type DateType } from '../types'
/**
* Un-formatted date for server side storage (ISO8601), like '2019-09-18'
*/
export const formatDateType = (date: Date): DateType => {
- return formatISO(date, { representation: 'date' });
-};
+ return formatISO(date, { representation: 'date' })
+}
export const deserializeDate = (date: string): Date => {
- return parse(date, 'yyyy-MM-dd', new Date());
-};
+ return parse(date, 'yyyy-MM-dd', new Date())
+}
// undefined means we'll use the user's locale
const formatter = new Intl.DateTimeFormat(undefined, {
year: 'numeric',
month: '2-digit',
day: '2-digit',
-});
+})
-export const formatDate = (date: Date): string => formatter.format(date);
+export const formatDate = (date: Date): string => formatter.format(date)
export const dateFormatPlaceholder = formatter
.formatToParts(new Date())
.map(x => {
if (x.type === 'day') {
- return 'dd';
+ return 'dd'
}
if (x.type === 'month') {
- return 'mm';
+ return 'mm'
}
if (x.type === 'year') {
- return 'yyyy';
+ return 'yyyy'
}
- return x.value;
+ return x.value
})
- .join('');
+ .join('')
diff --git a/design-system/packages/fields/src/utils/isDate.ts b/design-system/packages/fields/src/utils/isDate.ts
index 1826d45b3e2..57be3e730c4 100644
--- a/design-system/packages/fields/src/utils/isDate.ts
+++ b/design-system/packages/fields/src/utils/isDate.ts
@@ -1,8 +1,8 @@
export const isDate = (value: string): boolean => {
try {
- new Date(value).toISOString();
+ new Date(value).toISOString()
} catch (e) {
- return false;
+ return false
}
- return true;
-};
+ return true
+}
diff --git a/design-system/packages/icons/build-icons.js b/design-system/packages/icons/build-icons.js
index f63c59e31a1..df2fd5d102a 100644
--- a/design-system/packages/icons/build-icons.js
+++ b/design-system/packages/icons/build-icons.js
@@ -1,34 +1,34 @@
/* eslint-disable import/no-extraneous-dependencies */
-const path = require('path');
+const path = require('path')
-const fs = require('fs-extra');
-const svgr = require('@svgr/core').default;
-const { icons } = require('feather-icons');
-const toPascalCase = require('to-pascal-case');
-const globby = require('globby');
+const fs = require('fs-extra')
+const svgr = require('@svgr/core').default
+const { icons } = require('feather-icons')
+const toPascalCase = require('to-pascal-case')
+const globby = require('globby')
-const chalk = require('chalk');
+const chalk = require('chalk')
-async function writeIcons() {
- let iconOutDir = path.join(__dirname, 'src', 'icons');
+async function writeIcons () {
+ let iconOutDir = path.join(__dirname, 'src', 'icons')
- await fs.ensureDir(iconOutDir);
- let names = [];
+ await fs.ensureDir(iconOutDir)
+ let names = []
await Promise.all(
Object.keys(icons).map(async key => {
- let name = `${toPascalCase(key)}Icon`;
+ let name = `${toPascalCase(key)}Icon`
let code = await svgr(
icons[key].toSvg(),
{
icon: true,
typescript: true,
template: function ({ template, types }, opts, { imports, componentName, jsx }) {
- const t = types;
- const plugins = ['jsx'];
+ const t = types
+ const plugins = ['jsx']
if (opts.typescript) {
- plugins.push('typescript');
+ plugins.push('typescript')
}
- const typeScriptTpl = template.smart({ plugins });
+ const typeScriptTpl = template.smart({ plugins })
return typeScriptTpl.ast`
${imports}
@@ -46,75 +46,74 @@ async function writeIcons() {
},
${t.stringLiteral(name)}
);
- `;
+ `
},
plugins: [
// '@svgr/plugin-svgo',
'@svgr/plugin-jsx',
- '@svgr/plugin-prettier',
],
},
{ componentName: name }
- );
- await fs.writeFile(path.join(iconOutDir, `${name}.tsx`), code);
- names.push(name);
+ )
+ await fs.writeFile(path.join(iconOutDir, `${name}.tsx`), code)
+ names.push(name)
})
- );
- return names;
+ )
+ return names
}
-async function writeIndex(icons) {
+async function writeIndex (icons) {
const index =
`export type { IconProps } from './Icon';\n\n` +
icons.map(icon => `export { ${icon} } from './icons/${icon}';`).join('\n') +
- `\n`;
+ `\n`
await fs.writeFile('src/index.tsx', index, {
encoding: 'utf8',
- });
+ })
- console.info(chalk.green('✅ Index file written successfully'));
+ console.info(chalk.green('✅ Index file written successfully'))
}
-async function writePkg(pkgPath, content) {
- await fs.ensureFile(pkgPath);
+async function writePkg (pkgPath, content) {
+ await fs.ensureFile(pkgPath)
await fs.writeFile(pkgPath, JSON.stringify(content, null, 2) + '\n', {
encoding: 'utf8',
- });
+ })
}
-async function createEntrypointPkgJsons(icons) {
+async function createEntrypointPkgJsons (icons) {
await Promise.all(
icons.map(async icon => {
- const pkgPath = path.join(process.cwd(), 'icons', icon, 'package.json');
+ const pkgPath = path.join(process.cwd(), 'icons', icon, 'package.json')
await writePkg(pkgPath, {
main: 'dist/icons.cjs.js',
module: 'dist/icons.esm.js',
- });
+ })
})
- );
+ )
- console.info(chalk.green('✅ all package.json entrypoint files written successfully'));
+ console.info(chalk.green('✅ all package.json entrypoint files written successfully'))
}
-async function clean() {
+async function clean () {
let pathnames = await globby(['icons/*', 'src/icons/*'], {
expandDirectories: false,
onlyFiles: false,
- });
+ })
await Promise.all(
pathnames.map(async pathname => {
- await fs.remove(pathname);
+ await fs.remove(pathname)
})
- );
+ )
}
(async () => {
- console.info(chalk.blue('🧹 Cleaning existing exports'));
- await clean();
- console.info(chalk.blue('🚧 Building icon exports'));
+ console.info(chalk.blue('🧹 Cleaning existing exports'))
+ await clean()
+ console.info(chalk.blue('🚧 Building icon exports'))
- let icons = await writeIcons();
- await Promise.all([writeIndex(icons), createEntrypointPkgJsons(icons)]);
-})();
+ let icons = await writeIcons()
+ await Promise.all([writeIndex(icons), createEntrypointPkgJsons(icons)])
+})()
diff --git a/design-system/packages/icons/package.json b/design-system/packages/icons/package.json
index 721a5d25bed..cb0274e2f5b 100644
--- a/design-system/packages/icons/package.json
+++ b/design-system/packages/icons/package.json
@@ -1161,7 +1161,6 @@
"devDependencies": {
"@svgr/core": "^8.0.0",
"@svgr/plugin-jsx": "^8.0.0",
- "@svgr/plugin-prettier": "^8.0.0",
"@svgr/plugin-svgo": "^8.0.0",
"@types/react": "^18.0.9",
"chalk": "^4.1.2",
diff --git a/design-system/packages/icons/src/Icon.tsx b/design-system/packages/icons/src/Icon.tsx
index b12d30d8358..ee678a38139 100644
--- a/design-system/packages/icons/src/Icon.tsx
+++ b/design-system/packages/icons/src/Icon.tsx
@@ -1,15 +1,15 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { SVGAttributes, forwardRef, ReactNode } from 'react';
-import { ResponsiveProp, jsx, mapResponsiveProp } from '@keystone-ui/core';
+import { type SVGAttributes, forwardRef, type ReactNode } from 'react'
+import { type ResponsiveProp, jsx, mapResponsiveProp } from '@keystone-ui/core'
export type IconProps = SVGAttributes & {
/** The color for the SVG fill property. */
- color?: string;
+ color?: string
/** The size key for the icon. */
- size?: ResponsiveProp | number;
-};
+ size?: ResponsiveProp | number
+}
// TODO: Move to theme?
const sizeMap = {
@@ -18,12 +18,12 @@ const sizeMap = {
medium: 24,
largish: 28,
large: 32,
-};
+}
export const createIcon = (children: ReactNode, name: string) => {
let Icon = forwardRef(
({ size = 'medium', color, ...props }: IconProps, ref: any) => {
- const resolvedSize = typeof size === 'number' ? size : mapResponsiveProp(size, sizeMap);
+ const resolvedSize = typeof size === 'number' ? size : mapResponsiveProp(size, sizeMap)
return (
{
>
{children}
- );
+ )
}
- );
- Icon.displayName = name;
- return Icon;
-};
+ )
+ Icon.displayName = name
+ return Icon
+}
diff --git a/design-system/packages/icons/src/icons/ActivityIcon.tsx b/design-system/packages/icons/src/icons/ActivityIcon.tsx
index d7b806ae036..b60dcea72da 100644
--- a/design-system/packages/icons/src/icons/ActivityIcon.tsx
+++ b/design-system/packages/icons/src/icons/ActivityIcon.tsx
@@ -1,6 +1,6 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const ActivityIcon = createIcon(
,
'ActivityIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/AirplayIcon.tsx b/design-system/packages/icons/src/icons/AirplayIcon.tsx
index 86ced9bbb07..f3bc8ee6d16 100644
--- a/design-system/packages/icons/src/icons/AirplayIcon.tsx
+++ b/design-system/packages/icons/src/icons/AirplayIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const AirplayIcon = createIcon(
,
'AirplayIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/AlertCircleIcon.tsx b/design-system/packages/icons/src/icons/AlertCircleIcon.tsx
index a2f127c406b..dd01196619b 100644
--- a/design-system/packages/icons/src/icons/AlertCircleIcon.tsx
+++ b/design-system/packages/icons/src/icons/AlertCircleIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const AlertCircleIcon = createIcon(
@@ -7,4 +7,4 @@ export const AlertCircleIcon = createIcon(
,
'AlertCircleIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/AlertOctagonIcon.tsx b/design-system/packages/icons/src/icons/AlertOctagonIcon.tsx
index cd25199bb26..0f467611d4a 100644
--- a/design-system/packages/icons/src/icons/AlertOctagonIcon.tsx
+++ b/design-system/packages/icons/src/icons/AlertOctagonIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const AlertOctagonIcon = createIcon(
@@ -7,4 +7,4 @@ export const AlertOctagonIcon = createIcon(
,
'AlertOctagonIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/AlertTriangleIcon.tsx b/design-system/packages/icons/src/icons/AlertTriangleIcon.tsx
index 3e151d59f71..4807c9b6cfb 100644
--- a/design-system/packages/icons/src/icons/AlertTriangleIcon.tsx
+++ b/design-system/packages/icons/src/icons/AlertTriangleIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const AlertTriangleIcon = createIcon(
@@ -7,4 +7,4 @@ export const AlertTriangleIcon = createIcon(
,
'AlertTriangleIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/AlignCenterIcon.tsx b/design-system/packages/icons/src/icons/AlignCenterIcon.tsx
index 327d0cb43d5..8683c18dfab 100644
--- a/design-system/packages/icons/src/icons/AlignCenterIcon.tsx
+++ b/design-system/packages/icons/src/icons/AlignCenterIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const AlignCenterIcon = createIcon(
@@ -8,4 +8,4 @@ export const AlignCenterIcon = createIcon(
,
'AlignCenterIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/AlignJustifyIcon.tsx b/design-system/packages/icons/src/icons/AlignJustifyIcon.tsx
index 2980a3f69f9..bd09d58b26e 100644
--- a/design-system/packages/icons/src/icons/AlignJustifyIcon.tsx
+++ b/design-system/packages/icons/src/icons/AlignJustifyIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const AlignJustifyIcon = createIcon(
@@ -8,4 +8,4 @@ export const AlignJustifyIcon = createIcon(
,
'AlignJustifyIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/AlignLeftIcon.tsx b/design-system/packages/icons/src/icons/AlignLeftIcon.tsx
index 110d113f9bf..362add6e991 100644
--- a/design-system/packages/icons/src/icons/AlignLeftIcon.tsx
+++ b/design-system/packages/icons/src/icons/AlignLeftIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const AlignLeftIcon = createIcon(
@@ -8,4 +8,4 @@ export const AlignLeftIcon = createIcon(
,
'AlignLeftIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/AlignRightIcon.tsx b/design-system/packages/icons/src/icons/AlignRightIcon.tsx
index 45c930fb78a..313a83c226f 100644
--- a/design-system/packages/icons/src/icons/AlignRightIcon.tsx
+++ b/design-system/packages/icons/src/icons/AlignRightIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const AlignRightIcon = createIcon(
@@ -8,4 +8,4 @@ export const AlignRightIcon = createIcon(
,
'AlignRightIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/AnchorIcon.tsx b/design-system/packages/icons/src/icons/AnchorIcon.tsx
index c8e4607a097..46b3100dc7d 100644
--- a/design-system/packages/icons/src/icons/AnchorIcon.tsx
+++ b/design-system/packages/icons/src/icons/AnchorIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const AnchorIcon = createIcon(
@@ -7,4 +7,4 @@ export const AnchorIcon = createIcon(
,
'AnchorIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/ApertureIcon.tsx b/design-system/packages/icons/src/icons/ApertureIcon.tsx
index 985fee0fa08..79ff986d405 100644
--- a/design-system/packages/icons/src/icons/ApertureIcon.tsx
+++ b/design-system/packages/icons/src/icons/ApertureIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const ApertureIcon = createIcon(
@@ -11,4 +11,4 @@ export const ApertureIcon = createIcon(
,
'ApertureIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/ArchiveIcon.tsx b/design-system/packages/icons/src/icons/ArchiveIcon.tsx
index 922b1a5e1db..5bae462a22d 100644
--- a/design-system/packages/icons/src/icons/ArchiveIcon.tsx
+++ b/design-system/packages/icons/src/icons/ArchiveIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const ArchiveIcon = createIcon(
@@ -7,4 +7,4 @@ export const ArchiveIcon = createIcon(
,
'ArchiveIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/ArrowDownCircleIcon.tsx b/design-system/packages/icons/src/icons/ArrowDownCircleIcon.tsx
index dfa408f9020..426c99f8369 100644
--- a/design-system/packages/icons/src/icons/ArrowDownCircleIcon.tsx
+++ b/design-system/packages/icons/src/icons/ArrowDownCircleIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const ArrowDownCircleIcon = createIcon(
@@ -7,4 +7,4 @@ export const ArrowDownCircleIcon = createIcon(
,
'ArrowDownCircleIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/ArrowDownIcon.tsx b/design-system/packages/icons/src/icons/ArrowDownIcon.tsx
index b493250fc7b..e23f95f1eb3 100644
--- a/design-system/packages/icons/src/icons/ArrowDownIcon.tsx
+++ b/design-system/packages/icons/src/icons/ArrowDownIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const ArrowDownIcon = createIcon(
,
'ArrowDownIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/ArrowDownLeftIcon.tsx b/design-system/packages/icons/src/icons/ArrowDownLeftIcon.tsx
index c825ea77131..4c9501b2b7d 100644
--- a/design-system/packages/icons/src/icons/ArrowDownLeftIcon.tsx
+++ b/design-system/packages/icons/src/icons/ArrowDownLeftIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const ArrowDownLeftIcon = createIcon(
,
'ArrowDownLeftIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/ArrowDownRightIcon.tsx b/design-system/packages/icons/src/icons/ArrowDownRightIcon.tsx
index 876d712d908..b24e222769a 100644
--- a/design-system/packages/icons/src/icons/ArrowDownRightIcon.tsx
+++ b/design-system/packages/icons/src/icons/ArrowDownRightIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const ArrowDownRightIcon = createIcon(
,
'ArrowDownRightIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/ArrowLeftCircleIcon.tsx b/design-system/packages/icons/src/icons/ArrowLeftCircleIcon.tsx
index 018bee8a6d3..09cddb501e6 100644
--- a/design-system/packages/icons/src/icons/ArrowLeftCircleIcon.tsx
+++ b/design-system/packages/icons/src/icons/ArrowLeftCircleIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const ArrowLeftCircleIcon = createIcon(
@@ -7,4 +7,4 @@ export const ArrowLeftCircleIcon = createIcon(
,
'ArrowLeftCircleIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/ArrowLeftIcon.tsx b/design-system/packages/icons/src/icons/ArrowLeftIcon.tsx
index d00379e80b0..34f814dc7d0 100644
--- a/design-system/packages/icons/src/icons/ArrowLeftIcon.tsx
+++ b/design-system/packages/icons/src/icons/ArrowLeftIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const ArrowLeftIcon = createIcon(
,
'ArrowLeftIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/ArrowRightCircleIcon.tsx b/design-system/packages/icons/src/icons/ArrowRightCircleIcon.tsx
index 00303ef1e5c..9f21117655d 100644
--- a/design-system/packages/icons/src/icons/ArrowRightCircleIcon.tsx
+++ b/design-system/packages/icons/src/icons/ArrowRightCircleIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const ArrowRightCircleIcon = createIcon(
@@ -7,4 +7,4 @@ export const ArrowRightCircleIcon = createIcon(
,
'ArrowRightCircleIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/ArrowRightIcon.tsx b/design-system/packages/icons/src/icons/ArrowRightIcon.tsx
index 5815b3f41f7..cf86878cb71 100644
--- a/design-system/packages/icons/src/icons/ArrowRightIcon.tsx
+++ b/design-system/packages/icons/src/icons/ArrowRightIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const ArrowRightIcon = createIcon(
,
'ArrowRightIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/ArrowUpCircleIcon.tsx b/design-system/packages/icons/src/icons/ArrowUpCircleIcon.tsx
index 51bedce3af5..4e5220ae410 100644
--- a/design-system/packages/icons/src/icons/ArrowUpCircleIcon.tsx
+++ b/design-system/packages/icons/src/icons/ArrowUpCircleIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const ArrowUpCircleIcon = createIcon(
@@ -7,4 +7,4 @@ export const ArrowUpCircleIcon = createIcon(
,
'ArrowUpCircleIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/ArrowUpIcon.tsx b/design-system/packages/icons/src/icons/ArrowUpIcon.tsx
index a3db6b4058c..fb5c791ab2f 100644
--- a/design-system/packages/icons/src/icons/ArrowUpIcon.tsx
+++ b/design-system/packages/icons/src/icons/ArrowUpIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const ArrowUpIcon = createIcon(
,
'ArrowUpIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/ArrowUpLeftIcon.tsx b/design-system/packages/icons/src/icons/ArrowUpLeftIcon.tsx
index ad93035e235..299b15db6f7 100644
--- a/design-system/packages/icons/src/icons/ArrowUpLeftIcon.tsx
+++ b/design-system/packages/icons/src/icons/ArrowUpLeftIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const ArrowUpLeftIcon = createIcon(
,
'ArrowUpLeftIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/ArrowUpRightIcon.tsx b/design-system/packages/icons/src/icons/ArrowUpRightIcon.tsx
index 90b998215f2..72602a3f80c 100644
--- a/design-system/packages/icons/src/icons/ArrowUpRightIcon.tsx
+++ b/design-system/packages/icons/src/icons/ArrowUpRightIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const ArrowUpRightIcon = createIcon(
,
'ArrowUpRightIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/AtSignIcon.tsx b/design-system/packages/icons/src/icons/AtSignIcon.tsx
index 20532d5194e..fae4029c895 100644
--- a/design-system/packages/icons/src/icons/AtSignIcon.tsx
+++ b/design-system/packages/icons/src/icons/AtSignIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const AtSignIcon = createIcon(
,
'AtSignIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/AwardIcon.tsx b/design-system/packages/icons/src/icons/AwardIcon.tsx
index e7358001d64..77673899f42 100644
--- a/design-system/packages/icons/src/icons/AwardIcon.tsx
+++ b/design-system/packages/icons/src/icons/AwardIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const AwardIcon = createIcon(
,
'AwardIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/BarChart2Icon.tsx b/design-system/packages/icons/src/icons/BarChart2Icon.tsx
index 2183f7880f3..96ca52f157f 100644
--- a/design-system/packages/icons/src/icons/BarChart2Icon.tsx
+++ b/design-system/packages/icons/src/icons/BarChart2Icon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const BarChart2Icon = createIcon(
@@ -7,4 +7,4 @@ export const BarChart2Icon = createIcon(
,
'BarChart2Icon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/BarChartIcon.tsx b/design-system/packages/icons/src/icons/BarChartIcon.tsx
index 25f6f338bbe..62004698263 100644
--- a/design-system/packages/icons/src/icons/BarChartIcon.tsx
+++ b/design-system/packages/icons/src/icons/BarChartIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const BarChartIcon = createIcon(
@@ -7,4 +7,4 @@ export const BarChartIcon = createIcon(
,
'BarChartIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/BatteryChargingIcon.tsx b/design-system/packages/icons/src/icons/BatteryChargingIcon.tsx
index d14a94048ad..d60ada387ed 100644
--- a/design-system/packages/icons/src/icons/BatteryChargingIcon.tsx
+++ b/design-system/packages/icons/src/icons/BatteryChargingIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const BatteryChargingIcon = createIcon(
@@ -7,4 +7,4 @@ export const BatteryChargingIcon = createIcon(
,
'BatteryChargingIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/BatteryIcon.tsx b/design-system/packages/icons/src/icons/BatteryIcon.tsx
index 215f2f75779..2acba3c0fd3 100644
--- a/design-system/packages/icons/src/icons/BatteryIcon.tsx
+++ b/design-system/packages/icons/src/icons/BatteryIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const BatteryIcon = createIcon(
,
'BatteryIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/BellIcon.tsx b/design-system/packages/icons/src/icons/BellIcon.tsx
index e12e7c22e01..549b961fb3f 100644
--- a/design-system/packages/icons/src/icons/BellIcon.tsx
+++ b/design-system/packages/icons/src/icons/BellIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const BellIcon = createIcon(
,
'BellIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/BellOffIcon.tsx b/design-system/packages/icons/src/icons/BellOffIcon.tsx
index b137c9960d6..22be42c06bf 100644
--- a/design-system/packages/icons/src/icons/BellOffIcon.tsx
+++ b/design-system/packages/icons/src/icons/BellOffIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const BellOffIcon = createIcon(
@@ -9,4 +9,4 @@ export const BellOffIcon = createIcon(
,
'BellOffIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/BluetoothIcon.tsx b/design-system/packages/icons/src/icons/BluetoothIcon.tsx
index 0018b715b9f..014c3a438fe 100644
--- a/design-system/packages/icons/src/icons/BluetoothIcon.tsx
+++ b/design-system/packages/icons/src/icons/BluetoothIcon.tsx
@@ -1,6 +1,6 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const BluetoothIcon = createIcon(
,
'BluetoothIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/BoldIcon.tsx b/design-system/packages/icons/src/icons/BoldIcon.tsx
index 6b98438560d..f285574003d 100644
--- a/design-system/packages/icons/src/icons/BoldIcon.tsx
+++ b/design-system/packages/icons/src/icons/BoldIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const BoldIcon = createIcon(
,
'BoldIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/BookIcon.tsx b/design-system/packages/icons/src/icons/BookIcon.tsx
index 3ed44be7819..bfda9ce0b1a 100644
--- a/design-system/packages/icons/src/icons/BookIcon.tsx
+++ b/design-system/packages/icons/src/icons/BookIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const BookIcon = createIcon(
,
'BookIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/BookOpenIcon.tsx b/design-system/packages/icons/src/icons/BookOpenIcon.tsx
index 5f9557bd894..8dda678da01 100644
--- a/design-system/packages/icons/src/icons/BookOpenIcon.tsx
+++ b/design-system/packages/icons/src/icons/BookOpenIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const BookOpenIcon = createIcon(
,
'BookOpenIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/BookmarkIcon.tsx b/design-system/packages/icons/src/icons/BookmarkIcon.tsx
index 0919894763d..a6fc3740aa0 100644
--- a/design-system/packages/icons/src/icons/BookmarkIcon.tsx
+++ b/design-system/packages/icons/src/icons/BookmarkIcon.tsx
@@ -1,6 +1,6 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const BookmarkIcon = createIcon(
,
'BookmarkIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/BoxIcon.tsx b/design-system/packages/icons/src/icons/BoxIcon.tsx
index b6a5f7db93b..7ff15669403 100644
--- a/design-system/packages/icons/src/icons/BoxIcon.tsx
+++ b/design-system/packages/icons/src/icons/BoxIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const BoxIcon = createIcon(
@@ -7,4 +7,4 @@ export const BoxIcon = createIcon(
,
'BoxIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/BriefcaseIcon.tsx b/design-system/packages/icons/src/icons/BriefcaseIcon.tsx
index 04bd026b58d..83d468e4a97 100644
--- a/design-system/packages/icons/src/icons/BriefcaseIcon.tsx
+++ b/design-system/packages/icons/src/icons/BriefcaseIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const BriefcaseIcon = createIcon(
,
'BriefcaseIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/CalendarIcon.tsx b/design-system/packages/icons/src/icons/CalendarIcon.tsx
index 40e89e45b23..8a97c575ed1 100644
--- a/design-system/packages/icons/src/icons/CalendarIcon.tsx
+++ b/design-system/packages/icons/src/icons/CalendarIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const CalendarIcon = createIcon(
@@ -8,4 +8,4 @@ export const CalendarIcon = createIcon(
,
'CalendarIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/CameraIcon.tsx b/design-system/packages/icons/src/icons/CameraIcon.tsx
index 754a36b4570..d3ea2c02ef6 100644
--- a/design-system/packages/icons/src/icons/CameraIcon.tsx
+++ b/design-system/packages/icons/src/icons/CameraIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const CameraIcon = createIcon(
,
'CameraIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/CameraOffIcon.tsx b/design-system/packages/icons/src/icons/CameraOffIcon.tsx
index e9a5bf66391..3712cbd3bed 100644
--- a/design-system/packages/icons/src/icons/CameraOffIcon.tsx
+++ b/design-system/packages/icons/src/icons/CameraOffIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const CameraOffIcon = createIcon(
,
'CameraOffIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/CastIcon.tsx b/design-system/packages/icons/src/icons/CastIcon.tsx
index e2d41456361..4852b3bf11a 100644
--- a/design-system/packages/icons/src/icons/CastIcon.tsx
+++ b/design-system/packages/icons/src/icons/CastIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const CastIcon = createIcon(
,
'CastIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/CheckCircleIcon.tsx b/design-system/packages/icons/src/icons/CheckCircleIcon.tsx
index ebb73c929c9..d68fbbac616 100644
--- a/design-system/packages/icons/src/icons/CheckCircleIcon.tsx
+++ b/design-system/packages/icons/src/icons/CheckCircleIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const CheckCircleIcon = createIcon(
,
'CheckCircleIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/CheckIcon.tsx b/design-system/packages/icons/src/icons/CheckIcon.tsx
index 74cf1f10434..c87e9b61b18 100644
--- a/design-system/packages/icons/src/icons/CheckIcon.tsx
+++ b/design-system/packages/icons/src/icons/CheckIcon.tsx
@@ -1,3 +1,3 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
-export const CheckIcon = createIcon( , 'CheckIcon');
+import * as React from 'react'
+import { createIcon } from '../Icon'
+export const CheckIcon = createIcon( , 'CheckIcon')
diff --git a/design-system/packages/icons/src/icons/CheckSquareIcon.tsx b/design-system/packages/icons/src/icons/CheckSquareIcon.tsx
index a6710de5718..9ab0f055d16 100644
--- a/design-system/packages/icons/src/icons/CheckSquareIcon.tsx
+++ b/design-system/packages/icons/src/icons/CheckSquareIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const CheckSquareIcon = createIcon(
,
'CheckSquareIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/ChevronDownIcon.tsx b/design-system/packages/icons/src/icons/ChevronDownIcon.tsx
index a0aa139650c..a3d071c8b32 100644
--- a/design-system/packages/icons/src/icons/ChevronDownIcon.tsx
+++ b/design-system/packages/icons/src/icons/ChevronDownIcon.tsx
@@ -1,3 +1,3 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
-export const ChevronDownIcon = createIcon( , 'ChevronDownIcon');
+import * as React from 'react'
+import { createIcon } from '../Icon'
+export const ChevronDownIcon = createIcon( , 'ChevronDownIcon')
diff --git a/design-system/packages/icons/src/icons/ChevronLeftIcon.tsx b/design-system/packages/icons/src/icons/ChevronLeftIcon.tsx
index ea8cb783d4c..be0c453a56a 100644
--- a/design-system/packages/icons/src/icons/ChevronLeftIcon.tsx
+++ b/design-system/packages/icons/src/icons/ChevronLeftIcon.tsx
@@ -1,3 +1,3 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
-export const ChevronLeftIcon = createIcon( , 'ChevronLeftIcon');
+import * as React from 'react'
+import { createIcon } from '../Icon'
+export const ChevronLeftIcon = createIcon( , 'ChevronLeftIcon')
diff --git a/design-system/packages/icons/src/icons/ChevronRightIcon.tsx b/design-system/packages/icons/src/icons/ChevronRightIcon.tsx
index fcaf0619b46..ce42c8d1e7d 100644
--- a/design-system/packages/icons/src/icons/ChevronRightIcon.tsx
+++ b/design-system/packages/icons/src/icons/ChevronRightIcon.tsx
@@ -1,6 +1,6 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const ChevronRightIcon = createIcon(
,
'ChevronRightIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/ChevronUpIcon.tsx b/design-system/packages/icons/src/icons/ChevronUpIcon.tsx
index ec9f7141fac..0b96feb80b7 100644
--- a/design-system/packages/icons/src/icons/ChevronUpIcon.tsx
+++ b/design-system/packages/icons/src/icons/ChevronUpIcon.tsx
@@ -1,3 +1,3 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
-export const ChevronUpIcon = createIcon( , 'ChevronUpIcon');
+import * as React from 'react'
+import { createIcon } from '../Icon'
+export const ChevronUpIcon = createIcon( , 'ChevronUpIcon')
diff --git a/design-system/packages/icons/src/icons/ChevronsDownIcon.tsx b/design-system/packages/icons/src/icons/ChevronsDownIcon.tsx
index 832d6305da4..1a74eda8cf9 100644
--- a/design-system/packages/icons/src/icons/ChevronsDownIcon.tsx
+++ b/design-system/packages/icons/src/icons/ChevronsDownIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const ChevronsDownIcon = createIcon(
,
'ChevronsDownIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/ChevronsLeftIcon.tsx b/design-system/packages/icons/src/icons/ChevronsLeftIcon.tsx
index 4198a8ef5de..08f755dabe7 100644
--- a/design-system/packages/icons/src/icons/ChevronsLeftIcon.tsx
+++ b/design-system/packages/icons/src/icons/ChevronsLeftIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const ChevronsLeftIcon = createIcon(
,
'ChevronsLeftIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/ChevronsRightIcon.tsx b/design-system/packages/icons/src/icons/ChevronsRightIcon.tsx
index 2b010be6a2d..89b27816156 100644
--- a/design-system/packages/icons/src/icons/ChevronsRightIcon.tsx
+++ b/design-system/packages/icons/src/icons/ChevronsRightIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const ChevronsRightIcon = createIcon(
,
'ChevronsRightIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/ChevronsUpIcon.tsx b/design-system/packages/icons/src/icons/ChevronsUpIcon.tsx
index 2eb3aa85e30..5f08914e770 100644
--- a/design-system/packages/icons/src/icons/ChevronsUpIcon.tsx
+++ b/design-system/packages/icons/src/icons/ChevronsUpIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const ChevronsUpIcon = createIcon(
,
'ChevronsUpIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/ChromeIcon.tsx b/design-system/packages/icons/src/icons/ChromeIcon.tsx
index 76c8ff1a13e..a928fe066ac 100644
--- a/design-system/packages/icons/src/icons/ChromeIcon.tsx
+++ b/design-system/packages/icons/src/icons/ChromeIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const ChromeIcon = createIcon(
@@ -9,4 +9,4 @@ export const ChromeIcon = createIcon(
,
'ChromeIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/CircleIcon.tsx b/design-system/packages/icons/src/icons/CircleIcon.tsx
index 8808d476816..96538098b12 100644
--- a/design-system/packages/icons/src/icons/CircleIcon.tsx
+++ b/design-system/packages/icons/src/icons/CircleIcon.tsx
@@ -1,3 +1,3 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
-export const CircleIcon = createIcon( , 'CircleIcon');
+import * as React from 'react'
+import { createIcon } from '../Icon'
+export const CircleIcon = createIcon( , 'CircleIcon')
diff --git a/design-system/packages/icons/src/icons/ClipboardIcon.tsx b/design-system/packages/icons/src/icons/ClipboardIcon.tsx
index f0a09b42d02..32a003b3337 100644
--- a/design-system/packages/icons/src/icons/ClipboardIcon.tsx
+++ b/design-system/packages/icons/src/icons/ClipboardIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const ClipboardIcon = createIcon(
,
'ClipboardIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/ClockIcon.tsx b/design-system/packages/icons/src/icons/ClockIcon.tsx
index 37c84c381f6..922747fe645 100644
--- a/design-system/packages/icons/src/icons/ClockIcon.tsx
+++ b/design-system/packages/icons/src/icons/ClockIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const ClockIcon = createIcon(
,
'ClockIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/CloudDrizzleIcon.tsx b/design-system/packages/icons/src/icons/CloudDrizzleIcon.tsx
index e737285c0e6..d772c1dc7ba 100644
--- a/design-system/packages/icons/src/icons/CloudDrizzleIcon.tsx
+++ b/design-system/packages/icons/src/icons/CloudDrizzleIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const CloudDrizzleIcon = createIcon(
@@ -11,4 +11,4 @@ export const CloudDrizzleIcon = createIcon(
,
'CloudDrizzleIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/CloudIcon.tsx b/design-system/packages/icons/src/icons/CloudIcon.tsx
index 1c40f7fd3aa..41e50a0b55d 100644
--- a/design-system/packages/icons/src/icons/CloudIcon.tsx
+++ b/design-system/packages/icons/src/icons/CloudIcon.tsx
@@ -1,6 +1,6 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const CloudIcon = createIcon(
,
'CloudIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/CloudLightningIcon.tsx b/design-system/packages/icons/src/icons/CloudLightningIcon.tsx
index 86972f45be0..c3f336b238d 100644
--- a/design-system/packages/icons/src/icons/CloudLightningIcon.tsx
+++ b/design-system/packages/icons/src/icons/CloudLightningIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const CloudLightningIcon = createIcon(
,
'CloudLightningIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/CloudOffIcon.tsx b/design-system/packages/icons/src/icons/CloudOffIcon.tsx
index a2633597d31..b3c368a0ea5 100644
--- a/design-system/packages/icons/src/icons/CloudOffIcon.tsx
+++ b/design-system/packages/icons/src/icons/CloudOffIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const CloudOffIcon = createIcon(
,
'CloudOffIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/CloudRainIcon.tsx b/design-system/packages/icons/src/icons/CloudRainIcon.tsx
index e7b9ecd3b2d..37343f1458c 100644
--- a/design-system/packages/icons/src/icons/CloudRainIcon.tsx
+++ b/design-system/packages/icons/src/icons/CloudRainIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const CloudRainIcon = createIcon(
@@ -8,4 +8,4 @@ export const CloudRainIcon = createIcon(
,
'CloudRainIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/CloudSnowIcon.tsx b/design-system/packages/icons/src/icons/CloudSnowIcon.tsx
index f5150d33d1f..a4a1f272f91 100644
--- a/design-system/packages/icons/src/icons/CloudSnowIcon.tsx
+++ b/design-system/packages/icons/src/icons/CloudSnowIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const CloudSnowIcon = createIcon(
@@ -11,4 +11,4 @@ export const CloudSnowIcon = createIcon(
,
'CloudSnowIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/CodeIcon.tsx b/design-system/packages/icons/src/icons/CodeIcon.tsx
index 130ee0f7471..49e4b0e72d6 100644
--- a/design-system/packages/icons/src/icons/CodeIcon.tsx
+++ b/design-system/packages/icons/src/icons/CodeIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const CodeIcon = createIcon(
,
'CodeIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/CodepenIcon.tsx b/design-system/packages/icons/src/icons/CodepenIcon.tsx
index 070927bbcd7..dee3edcd7d0 100644
--- a/design-system/packages/icons/src/icons/CodepenIcon.tsx
+++ b/design-system/packages/icons/src/icons/CodepenIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const CodepenIcon = createIcon(
@@ -9,4 +9,4 @@ export const CodepenIcon = createIcon(
,
'CodepenIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/CodesandboxIcon.tsx b/design-system/packages/icons/src/icons/CodesandboxIcon.tsx
index 008e58cbc20..cffedd6698c 100644
--- a/design-system/packages/icons/src/icons/CodesandboxIcon.tsx
+++ b/design-system/packages/icons/src/icons/CodesandboxIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const CodesandboxIcon = createIcon(
@@ -10,4 +10,4 @@ export const CodesandboxIcon = createIcon(
,
'CodesandboxIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/CoffeeIcon.tsx b/design-system/packages/icons/src/icons/CoffeeIcon.tsx
index 67a7a608241..17c8dec16ed 100644
--- a/design-system/packages/icons/src/icons/CoffeeIcon.tsx
+++ b/design-system/packages/icons/src/icons/CoffeeIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const CoffeeIcon = createIcon(
@@ -9,4 +9,4 @@ export const CoffeeIcon = createIcon(
,
'CoffeeIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/ColumnsIcon.tsx b/design-system/packages/icons/src/icons/ColumnsIcon.tsx
index 3d3d1c96ac9..79b7528c1a2 100644
--- a/design-system/packages/icons/src/icons/ColumnsIcon.tsx
+++ b/design-system/packages/icons/src/icons/ColumnsIcon.tsx
@@ -1,6 +1,6 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const ColumnsIcon = createIcon(
,
'ColumnsIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/CommandIcon.tsx b/design-system/packages/icons/src/icons/CommandIcon.tsx
index 17ef46e7e0b..8d1ca0903f5 100644
--- a/design-system/packages/icons/src/icons/CommandIcon.tsx
+++ b/design-system/packages/icons/src/icons/CommandIcon.tsx
@@ -1,6 +1,6 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const CommandIcon = createIcon(
,
'CommandIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/CompassIcon.tsx b/design-system/packages/icons/src/icons/CompassIcon.tsx
index 64ed5cee27a..7fb283a801e 100644
--- a/design-system/packages/icons/src/icons/CompassIcon.tsx
+++ b/design-system/packages/icons/src/icons/CompassIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const CompassIcon = createIcon(
,
'CompassIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/CopyIcon.tsx b/design-system/packages/icons/src/icons/CopyIcon.tsx
index 981c633459a..abcfe9b76ce 100644
--- a/design-system/packages/icons/src/icons/CopyIcon.tsx
+++ b/design-system/packages/icons/src/icons/CopyIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const CopyIcon = createIcon(
,
'CopyIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/CornerDownLeftIcon.tsx b/design-system/packages/icons/src/icons/CornerDownLeftIcon.tsx
index 22a18881011..5cd6f7326a5 100644
--- a/design-system/packages/icons/src/icons/CornerDownLeftIcon.tsx
+++ b/design-system/packages/icons/src/icons/CornerDownLeftIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const CornerDownLeftIcon = createIcon(
,
'CornerDownLeftIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/CornerDownRightIcon.tsx b/design-system/packages/icons/src/icons/CornerDownRightIcon.tsx
index 39a300923ba..00e1e64ba2b 100644
--- a/design-system/packages/icons/src/icons/CornerDownRightIcon.tsx
+++ b/design-system/packages/icons/src/icons/CornerDownRightIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const CornerDownRightIcon = createIcon(
,
'CornerDownRightIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/CornerLeftDownIcon.tsx b/design-system/packages/icons/src/icons/CornerLeftDownIcon.tsx
index 1ce947cea0e..489938d945a 100644
--- a/design-system/packages/icons/src/icons/CornerLeftDownIcon.tsx
+++ b/design-system/packages/icons/src/icons/CornerLeftDownIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const CornerLeftDownIcon = createIcon(
,
'CornerLeftDownIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/CornerLeftUpIcon.tsx b/design-system/packages/icons/src/icons/CornerLeftUpIcon.tsx
index 05743e5d321..8bbd11939e7 100644
--- a/design-system/packages/icons/src/icons/CornerLeftUpIcon.tsx
+++ b/design-system/packages/icons/src/icons/CornerLeftUpIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const CornerLeftUpIcon = createIcon(
,
'CornerLeftUpIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/CornerRightDownIcon.tsx b/design-system/packages/icons/src/icons/CornerRightDownIcon.tsx
index 9f6aa56a2fb..17719109570 100644
--- a/design-system/packages/icons/src/icons/CornerRightDownIcon.tsx
+++ b/design-system/packages/icons/src/icons/CornerRightDownIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const CornerRightDownIcon = createIcon(
,
'CornerRightDownIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/CornerRightUpIcon.tsx b/design-system/packages/icons/src/icons/CornerRightUpIcon.tsx
index a0da8142bf0..63d33c50195 100644
--- a/design-system/packages/icons/src/icons/CornerRightUpIcon.tsx
+++ b/design-system/packages/icons/src/icons/CornerRightUpIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const CornerRightUpIcon = createIcon(
,
'CornerRightUpIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/CornerUpLeftIcon.tsx b/design-system/packages/icons/src/icons/CornerUpLeftIcon.tsx
index c424a0aa8a3..b0d447b9758 100644
--- a/design-system/packages/icons/src/icons/CornerUpLeftIcon.tsx
+++ b/design-system/packages/icons/src/icons/CornerUpLeftIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const CornerUpLeftIcon = createIcon(
,
'CornerUpLeftIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/CornerUpRightIcon.tsx b/design-system/packages/icons/src/icons/CornerUpRightIcon.tsx
index 1fe517a7258..da92de7f030 100644
--- a/design-system/packages/icons/src/icons/CornerUpRightIcon.tsx
+++ b/design-system/packages/icons/src/icons/CornerUpRightIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const CornerUpRightIcon = createIcon(
,
'CornerUpRightIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/CpuIcon.tsx b/design-system/packages/icons/src/icons/CpuIcon.tsx
index bd828585b26..ce895c49631 100644
--- a/design-system/packages/icons/src/icons/CpuIcon.tsx
+++ b/design-system/packages/icons/src/icons/CpuIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const CpuIcon = createIcon(
@@ -14,4 +14,4 @@ export const CpuIcon = createIcon(
,
'CpuIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/CreditCardIcon.tsx b/design-system/packages/icons/src/icons/CreditCardIcon.tsx
index 28d80ef61db..3f38001dd3e 100644
--- a/design-system/packages/icons/src/icons/CreditCardIcon.tsx
+++ b/design-system/packages/icons/src/icons/CreditCardIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const CreditCardIcon = createIcon(
,
'CreditCardIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/CropIcon.tsx b/design-system/packages/icons/src/icons/CropIcon.tsx
index 0239e741932..896a4c65da7 100644
--- a/design-system/packages/icons/src/icons/CropIcon.tsx
+++ b/design-system/packages/icons/src/icons/CropIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const CropIcon = createIcon(
,
'CropIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/CrosshairIcon.tsx b/design-system/packages/icons/src/icons/CrosshairIcon.tsx
index 64c84223c07..76ecf2d0049 100644
--- a/design-system/packages/icons/src/icons/CrosshairIcon.tsx
+++ b/design-system/packages/icons/src/icons/CrosshairIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const CrosshairIcon = createIcon(
@@ -9,4 +9,4 @@ export const CrosshairIcon = createIcon(
,
'CrosshairIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/DatabaseIcon.tsx b/design-system/packages/icons/src/icons/DatabaseIcon.tsx
index 37c4078fd67..6578c561c43 100644
--- a/design-system/packages/icons/src/icons/DatabaseIcon.tsx
+++ b/design-system/packages/icons/src/icons/DatabaseIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const DatabaseIcon = createIcon(
@@ -7,4 +7,4 @@ export const DatabaseIcon = createIcon(
,
'DatabaseIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/DeleteIcon.tsx b/design-system/packages/icons/src/icons/DeleteIcon.tsx
index d23d82b4e00..08dddacd990 100644
--- a/design-system/packages/icons/src/icons/DeleteIcon.tsx
+++ b/design-system/packages/icons/src/icons/DeleteIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const DeleteIcon = createIcon(
@@ -7,4 +7,4 @@ export const DeleteIcon = createIcon(
,
'DeleteIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/DiscIcon.tsx b/design-system/packages/icons/src/icons/DiscIcon.tsx
index 7a428d7873a..90b5e657952 100644
--- a/design-system/packages/icons/src/icons/DiscIcon.tsx
+++ b/design-system/packages/icons/src/icons/DiscIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const DiscIcon = createIcon(
,
'DiscIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/DivideCircleIcon.tsx b/design-system/packages/icons/src/icons/DivideCircleIcon.tsx
index 01184d516f9..06b1053b70b 100644
--- a/design-system/packages/icons/src/icons/DivideCircleIcon.tsx
+++ b/design-system/packages/icons/src/icons/DivideCircleIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const DivideCircleIcon = createIcon(
@@ -8,4 +8,4 @@ export const DivideCircleIcon = createIcon(
,
'DivideCircleIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/DivideIcon.tsx b/design-system/packages/icons/src/icons/DivideIcon.tsx
index e839c5ad510..4a76474ca36 100644
--- a/design-system/packages/icons/src/icons/DivideIcon.tsx
+++ b/design-system/packages/icons/src/icons/DivideIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const DivideIcon = createIcon(
@@ -7,4 +7,4 @@ export const DivideIcon = createIcon(
,
'DivideIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/DivideSquareIcon.tsx b/design-system/packages/icons/src/icons/DivideSquareIcon.tsx
index e039dd004d1..29f628c19ef 100644
--- a/design-system/packages/icons/src/icons/DivideSquareIcon.tsx
+++ b/design-system/packages/icons/src/icons/DivideSquareIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const DivideSquareIcon = createIcon(
@@ -8,4 +8,4 @@ export const DivideSquareIcon = createIcon(
,
'DivideSquareIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/DollarSignIcon.tsx b/design-system/packages/icons/src/icons/DollarSignIcon.tsx
index 3dd9c89bc5a..0aa7c0a6eb0 100644
--- a/design-system/packages/icons/src/icons/DollarSignIcon.tsx
+++ b/design-system/packages/icons/src/icons/DollarSignIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const DollarSignIcon = createIcon(
,
'DollarSignIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/DownloadCloudIcon.tsx b/design-system/packages/icons/src/icons/DownloadCloudIcon.tsx
index e18b8afee05..63ba1bf1ee6 100644
--- a/design-system/packages/icons/src/icons/DownloadCloudIcon.tsx
+++ b/design-system/packages/icons/src/icons/DownloadCloudIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const DownloadCloudIcon = createIcon(
@@ -7,4 +7,4 @@ export const DownloadCloudIcon = createIcon(
,
'DownloadCloudIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/DownloadIcon.tsx b/design-system/packages/icons/src/icons/DownloadIcon.tsx
index 9bcd7aef37b..e86f52fa58e 100644
--- a/design-system/packages/icons/src/icons/DownloadIcon.tsx
+++ b/design-system/packages/icons/src/icons/DownloadIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const DownloadIcon = createIcon(
@@ -7,4 +7,4 @@ export const DownloadIcon = createIcon(
,
'DownloadIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/DribbbleIcon.tsx b/design-system/packages/icons/src/icons/DribbbleIcon.tsx
index 05e814db558..767a93b980b 100644
--- a/design-system/packages/icons/src/icons/DribbbleIcon.tsx
+++ b/design-system/packages/icons/src/icons/DribbbleIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const DribbbleIcon = createIcon(
,
'DribbbleIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/DropletIcon.tsx b/design-system/packages/icons/src/icons/DropletIcon.tsx
index b7a3a51da7c..fdb940cc955 100644
--- a/design-system/packages/icons/src/icons/DropletIcon.tsx
+++ b/design-system/packages/icons/src/icons/DropletIcon.tsx
@@ -1,6 +1,6 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const DropletIcon = createIcon(
,
'DropletIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/Edit2Icon.tsx b/design-system/packages/icons/src/icons/Edit2Icon.tsx
index 0a10c1c7b43..e608a37e856 100644
--- a/design-system/packages/icons/src/icons/Edit2Icon.tsx
+++ b/design-system/packages/icons/src/icons/Edit2Icon.tsx
@@ -1,6 +1,6 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const Edit2Icon = createIcon(
,
'Edit2Icon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/Edit3Icon.tsx b/design-system/packages/icons/src/icons/Edit3Icon.tsx
index a6e9750d919..9cfd9b8704e 100644
--- a/design-system/packages/icons/src/icons/Edit3Icon.tsx
+++ b/design-system/packages/icons/src/icons/Edit3Icon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const Edit3Icon = createIcon(
,
'Edit3Icon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/EditIcon.tsx b/design-system/packages/icons/src/icons/EditIcon.tsx
index 94e1bf0e095..28215942c56 100644
--- a/design-system/packages/icons/src/icons/EditIcon.tsx
+++ b/design-system/packages/icons/src/icons/EditIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const EditIcon = createIcon(
,
'EditIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/ExternalLinkIcon.tsx b/design-system/packages/icons/src/icons/ExternalLinkIcon.tsx
index 9b61d6ca01c..f586c00a41d 100644
--- a/design-system/packages/icons/src/icons/ExternalLinkIcon.tsx
+++ b/design-system/packages/icons/src/icons/ExternalLinkIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const ExternalLinkIcon = createIcon(
@@ -7,4 +7,4 @@ export const ExternalLinkIcon = createIcon(
,
'ExternalLinkIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/EyeIcon.tsx b/design-system/packages/icons/src/icons/EyeIcon.tsx
index 2acd13c9e78..810ec2cf396 100644
--- a/design-system/packages/icons/src/icons/EyeIcon.tsx
+++ b/design-system/packages/icons/src/icons/EyeIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const EyeIcon = createIcon(
,
'EyeIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/EyeOffIcon.tsx b/design-system/packages/icons/src/icons/EyeOffIcon.tsx
index 172476da733..1d970732b70 100644
--- a/design-system/packages/icons/src/icons/EyeOffIcon.tsx
+++ b/design-system/packages/icons/src/icons/EyeOffIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const EyeOffIcon = createIcon(
,
'EyeOffIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/FacebookIcon.tsx b/design-system/packages/icons/src/icons/FacebookIcon.tsx
index 6967c6f748f..38f19069281 100644
--- a/design-system/packages/icons/src/icons/FacebookIcon.tsx
+++ b/design-system/packages/icons/src/icons/FacebookIcon.tsx
@@ -1,6 +1,6 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const FacebookIcon = createIcon(
,
'FacebookIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/FastForwardIcon.tsx b/design-system/packages/icons/src/icons/FastForwardIcon.tsx
index 5db002f7327..16e204f57f3 100644
--- a/design-system/packages/icons/src/icons/FastForwardIcon.tsx
+++ b/design-system/packages/icons/src/icons/FastForwardIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const FastForwardIcon = createIcon(
,
'FastForwardIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/FeatherIcon.tsx b/design-system/packages/icons/src/icons/FeatherIcon.tsx
index 2a197bdc2dd..d14687beec8 100644
--- a/design-system/packages/icons/src/icons/FeatherIcon.tsx
+++ b/design-system/packages/icons/src/icons/FeatherIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const FeatherIcon = createIcon(
@@ -7,4 +7,4 @@ export const FeatherIcon = createIcon(
,
'FeatherIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/FigmaIcon.tsx b/design-system/packages/icons/src/icons/FigmaIcon.tsx
index b82b56495de..5553867254c 100644
--- a/design-system/packages/icons/src/icons/FigmaIcon.tsx
+++ b/design-system/packages/icons/src/icons/FigmaIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const FigmaIcon = createIcon(
@@ -9,4 +9,4 @@ export const FigmaIcon = createIcon(
,
'FigmaIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/FileIcon.tsx b/design-system/packages/icons/src/icons/FileIcon.tsx
index e718c9b7ec3..98dffed7b7b 100644
--- a/design-system/packages/icons/src/icons/FileIcon.tsx
+++ b/design-system/packages/icons/src/icons/FileIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const FileIcon = createIcon(
,
'FileIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/FileMinusIcon.tsx b/design-system/packages/icons/src/icons/FileMinusIcon.tsx
index ab9a61dd73e..26e3107e06a 100644
--- a/design-system/packages/icons/src/icons/FileMinusIcon.tsx
+++ b/design-system/packages/icons/src/icons/FileMinusIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const FileMinusIcon = createIcon(
@@ -7,4 +7,4 @@ export const FileMinusIcon = createIcon(
,
'FileMinusIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/FilePlusIcon.tsx b/design-system/packages/icons/src/icons/FilePlusIcon.tsx
index 29a649cfa02..f0be7a0f424 100644
--- a/design-system/packages/icons/src/icons/FilePlusIcon.tsx
+++ b/design-system/packages/icons/src/icons/FilePlusIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const FilePlusIcon = createIcon(
@@ -8,4 +8,4 @@ export const FilePlusIcon = createIcon(
,
'FilePlusIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/FileTextIcon.tsx b/design-system/packages/icons/src/icons/FileTextIcon.tsx
index f8649c7b737..8fea4f0c8bf 100644
--- a/design-system/packages/icons/src/icons/FileTextIcon.tsx
+++ b/design-system/packages/icons/src/icons/FileTextIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const FileTextIcon = createIcon(
@@ -9,4 +9,4 @@ export const FileTextIcon = createIcon(
,
'FileTextIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/FilmIcon.tsx b/design-system/packages/icons/src/icons/FilmIcon.tsx
index 1e332b82132..5c809fd6b04 100644
--- a/design-system/packages/icons/src/icons/FilmIcon.tsx
+++ b/design-system/packages/icons/src/icons/FilmIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const FilmIcon = createIcon(
@@ -12,4 +12,4 @@ export const FilmIcon = createIcon(
,
'FilmIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/FilterIcon.tsx b/design-system/packages/icons/src/icons/FilterIcon.tsx
index 097b3088a08..f5dcaedf399 100644
--- a/design-system/packages/icons/src/icons/FilterIcon.tsx
+++ b/design-system/packages/icons/src/icons/FilterIcon.tsx
@@ -1,6 +1,6 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const FilterIcon = createIcon(
,
'FilterIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/FlagIcon.tsx b/design-system/packages/icons/src/icons/FlagIcon.tsx
index e563b8c1aff..4094ef6501e 100644
--- a/design-system/packages/icons/src/icons/FlagIcon.tsx
+++ b/design-system/packages/icons/src/icons/FlagIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const FlagIcon = createIcon(
,
'FlagIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/FolderIcon.tsx b/design-system/packages/icons/src/icons/FolderIcon.tsx
index 955c9df6ba1..a48608cc159 100644
--- a/design-system/packages/icons/src/icons/FolderIcon.tsx
+++ b/design-system/packages/icons/src/icons/FolderIcon.tsx
@@ -1,6 +1,6 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const FolderIcon = createIcon(
,
'FolderIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/FolderMinusIcon.tsx b/design-system/packages/icons/src/icons/FolderMinusIcon.tsx
index 466bb696038..3ca2d640640 100644
--- a/design-system/packages/icons/src/icons/FolderMinusIcon.tsx
+++ b/design-system/packages/icons/src/icons/FolderMinusIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const FolderMinusIcon = createIcon(
,
'FolderMinusIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/FolderPlusIcon.tsx b/design-system/packages/icons/src/icons/FolderPlusIcon.tsx
index e34abfe04a0..cd37959b14d 100644
--- a/design-system/packages/icons/src/icons/FolderPlusIcon.tsx
+++ b/design-system/packages/icons/src/icons/FolderPlusIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const FolderPlusIcon = createIcon(
@@ -7,4 +7,4 @@ export const FolderPlusIcon = createIcon(
,
'FolderPlusIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/FramerIcon.tsx b/design-system/packages/icons/src/icons/FramerIcon.tsx
index 6ecdb38732f..c512178eb02 100644
--- a/design-system/packages/icons/src/icons/FramerIcon.tsx
+++ b/design-system/packages/icons/src/icons/FramerIcon.tsx
@@ -1,6 +1,6 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const FramerIcon = createIcon(
,
'FramerIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/FrownIcon.tsx b/design-system/packages/icons/src/icons/FrownIcon.tsx
index 4c56dec464a..484af490db1 100644
--- a/design-system/packages/icons/src/icons/FrownIcon.tsx
+++ b/design-system/packages/icons/src/icons/FrownIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const FrownIcon = createIcon(
@@ -8,4 +8,4 @@ export const FrownIcon = createIcon(
,
'FrownIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/GiftIcon.tsx b/design-system/packages/icons/src/icons/GiftIcon.tsx
index ecaf22ecbc7..8ddf573f5f6 100644
--- a/design-system/packages/icons/src/icons/GiftIcon.tsx
+++ b/design-system/packages/icons/src/icons/GiftIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const GiftIcon = createIcon(
@@ -9,4 +9,4 @@ export const GiftIcon = createIcon(
,
'GiftIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/GitBranchIcon.tsx b/design-system/packages/icons/src/icons/GitBranchIcon.tsx
index d741d6f8c92..addbc0f4a16 100644
--- a/design-system/packages/icons/src/icons/GitBranchIcon.tsx
+++ b/design-system/packages/icons/src/icons/GitBranchIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const GitBranchIcon = createIcon(
@@ -8,4 +8,4 @@ export const GitBranchIcon = createIcon(
,
'GitBranchIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/GitCommitIcon.tsx b/design-system/packages/icons/src/icons/GitCommitIcon.tsx
index 81ba15e3f74..15b615fa0c9 100644
--- a/design-system/packages/icons/src/icons/GitCommitIcon.tsx
+++ b/design-system/packages/icons/src/icons/GitCommitIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const GitCommitIcon = createIcon(
@@ -7,4 +7,4 @@ export const GitCommitIcon = createIcon(
,
'GitCommitIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/GitMergeIcon.tsx b/design-system/packages/icons/src/icons/GitMergeIcon.tsx
index 23c2ad13f16..759b84e1308 100644
--- a/design-system/packages/icons/src/icons/GitMergeIcon.tsx
+++ b/design-system/packages/icons/src/icons/GitMergeIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const GitMergeIcon = createIcon(
@@ -7,4 +7,4 @@ export const GitMergeIcon = createIcon(
,
'GitMergeIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/GitPullRequestIcon.tsx b/design-system/packages/icons/src/icons/GitPullRequestIcon.tsx
index be239ea7e7a..285c83fe1bd 100644
--- a/design-system/packages/icons/src/icons/GitPullRequestIcon.tsx
+++ b/design-system/packages/icons/src/icons/GitPullRequestIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const GitPullRequestIcon = createIcon(
@@ -8,4 +8,4 @@ export const GitPullRequestIcon = createIcon(
,
'GitPullRequestIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/GithubIcon.tsx b/design-system/packages/icons/src/icons/GithubIcon.tsx
index 4ee68d554a0..f75f044205c 100644
--- a/design-system/packages/icons/src/icons/GithubIcon.tsx
+++ b/design-system/packages/icons/src/icons/GithubIcon.tsx
@@ -1,6 +1,6 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const GithubIcon = createIcon(
,
'GithubIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/GitlabIcon.tsx b/design-system/packages/icons/src/icons/GitlabIcon.tsx
index f57c39d9817..200232a1e90 100644
--- a/design-system/packages/icons/src/icons/GitlabIcon.tsx
+++ b/design-system/packages/icons/src/icons/GitlabIcon.tsx
@@ -1,6 +1,6 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const GitlabIcon = createIcon(
,
'GitlabIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/GlobeIcon.tsx b/design-system/packages/icons/src/icons/GlobeIcon.tsx
index e30912d7c0d..2fd6366b131 100644
--- a/design-system/packages/icons/src/icons/GlobeIcon.tsx
+++ b/design-system/packages/icons/src/icons/GlobeIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const GlobeIcon = createIcon(
@@ -7,4 +7,4 @@ export const GlobeIcon = createIcon(
,
'GlobeIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/GridIcon.tsx b/design-system/packages/icons/src/icons/GridIcon.tsx
index 76fb3a19ab5..89979ef2783 100644
--- a/design-system/packages/icons/src/icons/GridIcon.tsx
+++ b/design-system/packages/icons/src/icons/GridIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const GridIcon = createIcon(
@@ -8,4 +8,4 @@ export const GridIcon = createIcon(
,
'GridIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/HardDriveIcon.tsx b/design-system/packages/icons/src/icons/HardDriveIcon.tsx
index 607718f7d68..6a7b6833650 100644
--- a/design-system/packages/icons/src/icons/HardDriveIcon.tsx
+++ b/design-system/packages/icons/src/icons/HardDriveIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const HardDriveIcon = createIcon(
@@ -8,4 +8,4 @@ export const HardDriveIcon = createIcon(
,
'HardDriveIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/HashIcon.tsx b/design-system/packages/icons/src/icons/HashIcon.tsx
index 4dd0dd2db0d..ff1a885fba0 100644
--- a/design-system/packages/icons/src/icons/HashIcon.tsx
+++ b/design-system/packages/icons/src/icons/HashIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const HashIcon = createIcon(
@@ -8,4 +8,4 @@ export const HashIcon = createIcon(
,
'HashIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/HeadphonesIcon.tsx b/design-system/packages/icons/src/icons/HeadphonesIcon.tsx
index dee2a2f1f9e..8cf884e92d3 100644
--- a/design-system/packages/icons/src/icons/HeadphonesIcon.tsx
+++ b/design-system/packages/icons/src/icons/HeadphonesIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const HeadphonesIcon = createIcon(
,
'HeadphonesIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/HeartIcon.tsx b/design-system/packages/icons/src/icons/HeartIcon.tsx
index 7122d8a43a0..7a49d7ae001 100644
--- a/design-system/packages/icons/src/icons/HeartIcon.tsx
+++ b/design-system/packages/icons/src/icons/HeartIcon.tsx
@@ -1,6 +1,6 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const HeartIcon = createIcon(
,
'HeartIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/HelpCircleIcon.tsx b/design-system/packages/icons/src/icons/HelpCircleIcon.tsx
index 277b12bd64c..d4d524d06e6 100644
--- a/design-system/packages/icons/src/icons/HelpCircleIcon.tsx
+++ b/design-system/packages/icons/src/icons/HelpCircleIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const HelpCircleIcon = createIcon(
@@ -7,4 +7,4 @@ export const HelpCircleIcon = createIcon(
,
'HelpCircleIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/HexagonIcon.tsx b/design-system/packages/icons/src/icons/HexagonIcon.tsx
index d6cb0253bd3..b5ed30ff5c0 100644
--- a/design-system/packages/icons/src/icons/HexagonIcon.tsx
+++ b/design-system/packages/icons/src/icons/HexagonIcon.tsx
@@ -1,6 +1,6 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const HexagonIcon = createIcon(
,
'HexagonIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/HomeIcon.tsx b/design-system/packages/icons/src/icons/HomeIcon.tsx
index 4a210227afd..f19425563e6 100644
--- a/design-system/packages/icons/src/icons/HomeIcon.tsx
+++ b/design-system/packages/icons/src/icons/HomeIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const HomeIcon = createIcon(
,
'HomeIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/ImageIcon.tsx b/design-system/packages/icons/src/icons/ImageIcon.tsx
index f624f649204..3271f60c4f1 100644
--- a/design-system/packages/icons/src/icons/ImageIcon.tsx
+++ b/design-system/packages/icons/src/icons/ImageIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const ImageIcon = createIcon(
@@ -7,4 +7,4 @@ export const ImageIcon = createIcon(
,
'ImageIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/InboxIcon.tsx b/design-system/packages/icons/src/icons/InboxIcon.tsx
index 7e407248543..c3f7ea096f1 100644
--- a/design-system/packages/icons/src/icons/InboxIcon.tsx
+++ b/design-system/packages/icons/src/icons/InboxIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const InboxIcon = createIcon(
,
'InboxIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/InfoIcon.tsx b/design-system/packages/icons/src/icons/InfoIcon.tsx
index f36d916f12c..86369a4bd0d 100644
--- a/design-system/packages/icons/src/icons/InfoIcon.tsx
+++ b/design-system/packages/icons/src/icons/InfoIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const InfoIcon = createIcon(
@@ -7,4 +7,4 @@ export const InfoIcon = createIcon(
,
'InfoIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/InstagramIcon.tsx b/design-system/packages/icons/src/icons/InstagramIcon.tsx
index bac73a28a00..6f898bfa681 100644
--- a/design-system/packages/icons/src/icons/InstagramIcon.tsx
+++ b/design-system/packages/icons/src/icons/InstagramIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const InstagramIcon = createIcon(
@@ -7,4 +7,4 @@ export const InstagramIcon = createIcon(
,
'InstagramIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/ItalicIcon.tsx b/design-system/packages/icons/src/icons/ItalicIcon.tsx
index 04fd153cdd5..1daa77ce862 100644
--- a/design-system/packages/icons/src/icons/ItalicIcon.tsx
+++ b/design-system/packages/icons/src/icons/ItalicIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const ItalicIcon = createIcon(
@@ -7,4 +7,4 @@ export const ItalicIcon = createIcon(
,
'ItalicIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/KeyIcon.tsx b/design-system/packages/icons/src/icons/KeyIcon.tsx
index a0285fb10cb..721674b1d76 100644
--- a/design-system/packages/icons/src/icons/KeyIcon.tsx
+++ b/design-system/packages/icons/src/icons/KeyIcon.tsx
@@ -1,6 +1,6 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const KeyIcon = createIcon(
,
'KeyIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/LayersIcon.tsx b/design-system/packages/icons/src/icons/LayersIcon.tsx
index b1911832d54..94c38207719 100644
--- a/design-system/packages/icons/src/icons/LayersIcon.tsx
+++ b/design-system/packages/icons/src/icons/LayersIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const LayersIcon = createIcon(
@@ -7,4 +7,4 @@ export const LayersIcon = createIcon(
,
'LayersIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/LayoutIcon.tsx b/design-system/packages/icons/src/icons/LayoutIcon.tsx
index e06f167e5f7..ccdcb057af3 100644
--- a/design-system/packages/icons/src/icons/LayoutIcon.tsx
+++ b/design-system/packages/icons/src/icons/LayoutIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const LayoutIcon = createIcon(
@@ -7,4 +7,4 @@ export const LayoutIcon = createIcon(
,
'LayoutIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/LifeBuoyIcon.tsx b/design-system/packages/icons/src/icons/LifeBuoyIcon.tsx
index 949d8e895b7..8347b4015b6 100644
--- a/design-system/packages/icons/src/icons/LifeBuoyIcon.tsx
+++ b/design-system/packages/icons/src/icons/LifeBuoyIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const LifeBuoyIcon = createIcon(
@@ -11,4 +11,4 @@ export const LifeBuoyIcon = createIcon(
,
'LifeBuoyIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/Link2Icon.tsx b/design-system/packages/icons/src/icons/Link2Icon.tsx
index ac5e331a12c..ca9ac463289 100644
--- a/design-system/packages/icons/src/icons/Link2Icon.tsx
+++ b/design-system/packages/icons/src/icons/Link2Icon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const Link2Icon = createIcon(
,
'Link2Icon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/LinkIcon.tsx b/design-system/packages/icons/src/icons/LinkIcon.tsx
index 3a627de3e73..687e966d045 100644
--- a/design-system/packages/icons/src/icons/LinkIcon.tsx
+++ b/design-system/packages/icons/src/icons/LinkIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const LinkIcon = createIcon(
,
'LinkIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/LinkedinIcon.tsx b/design-system/packages/icons/src/icons/LinkedinIcon.tsx
index 901e0e5d235..96bffc737ff 100644
--- a/design-system/packages/icons/src/icons/LinkedinIcon.tsx
+++ b/design-system/packages/icons/src/icons/LinkedinIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const LinkedinIcon = createIcon(
@@ -7,4 +7,4 @@ export const LinkedinIcon = createIcon(
,
'LinkedinIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/ListIcon.tsx b/design-system/packages/icons/src/icons/ListIcon.tsx
index f42b01fa5cf..ae53102d1f8 100644
--- a/design-system/packages/icons/src/icons/ListIcon.tsx
+++ b/design-system/packages/icons/src/icons/ListIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const ListIcon = createIcon(
@@ -10,4 +10,4 @@ export const ListIcon = createIcon(
,
'ListIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/LoaderIcon.tsx b/design-system/packages/icons/src/icons/LoaderIcon.tsx
index d1d9bf70137..96dfaa33c54 100644
--- a/design-system/packages/icons/src/icons/LoaderIcon.tsx
+++ b/design-system/packages/icons/src/icons/LoaderIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const LoaderIcon = createIcon(
@@ -12,4 +12,4 @@ export const LoaderIcon = createIcon(
,
'LoaderIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/LockIcon.tsx b/design-system/packages/icons/src/icons/LockIcon.tsx
index 981a8a3d72c..534e13b906b 100644
--- a/design-system/packages/icons/src/icons/LockIcon.tsx
+++ b/design-system/packages/icons/src/icons/LockIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const LockIcon = createIcon(
,
'LockIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/LogInIcon.tsx b/design-system/packages/icons/src/icons/LogInIcon.tsx
index e1906e52645..efd31906b91 100644
--- a/design-system/packages/icons/src/icons/LogInIcon.tsx
+++ b/design-system/packages/icons/src/icons/LogInIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const LogInIcon = createIcon(
@@ -7,4 +7,4 @@ export const LogInIcon = createIcon(
,
'LogInIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/LogOutIcon.tsx b/design-system/packages/icons/src/icons/LogOutIcon.tsx
index 82daf08e019..b7030fc38e1 100644
--- a/design-system/packages/icons/src/icons/LogOutIcon.tsx
+++ b/design-system/packages/icons/src/icons/LogOutIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const LogOutIcon = createIcon(
@@ -7,4 +7,4 @@ export const LogOutIcon = createIcon(
,
'LogOutIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/MailIcon.tsx b/design-system/packages/icons/src/icons/MailIcon.tsx
index e721853b08b..cbbe29aa03c 100644
--- a/design-system/packages/icons/src/icons/MailIcon.tsx
+++ b/design-system/packages/icons/src/icons/MailIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const MailIcon = createIcon(
,
'MailIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/MapIcon.tsx b/design-system/packages/icons/src/icons/MapIcon.tsx
index 5f0ecfb2827..114f304badb 100644
--- a/design-system/packages/icons/src/icons/MapIcon.tsx
+++ b/design-system/packages/icons/src/icons/MapIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const MapIcon = createIcon(
@@ -7,4 +7,4 @@ export const MapIcon = createIcon(
,
'MapIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/MapPinIcon.tsx b/design-system/packages/icons/src/icons/MapPinIcon.tsx
index 4f11a2c0b15..a60e0d31664 100644
--- a/design-system/packages/icons/src/icons/MapPinIcon.tsx
+++ b/design-system/packages/icons/src/icons/MapPinIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const MapPinIcon = createIcon(
,
'MapPinIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/Maximize2Icon.tsx b/design-system/packages/icons/src/icons/Maximize2Icon.tsx
index cb85a4e30d2..cfaf91d5a68 100644
--- a/design-system/packages/icons/src/icons/Maximize2Icon.tsx
+++ b/design-system/packages/icons/src/icons/Maximize2Icon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const Maximize2Icon = createIcon(
@@ -8,4 +8,4 @@ export const Maximize2Icon = createIcon(
,
'Maximize2Icon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/MaximizeIcon.tsx b/design-system/packages/icons/src/icons/MaximizeIcon.tsx
index 57ea87705af..cbfc498f987 100644
--- a/design-system/packages/icons/src/icons/MaximizeIcon.tsx
+++ b/design-system/packages/icons/src/icons/MaximizeIcon.tsx
@@ -1,6 +1,6 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const MaximizeIcon = createIcon(
,
'MaximizeIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/MehIcon.tsx b/design-system/packages/icons/src/icons/MehIcon.tsx
index eb90901d7e7..0a230ef6425 100644
--- a/design-system/packages/icons/src/icons/MehIcon.tsx
+++ b/design-system/packages/icons/src/icons/MehIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const MehIcon = createIcon(
@@ -8,4 +8,4 @@ export const MehIcon = createIcon(
,
'MehIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/MenuIcon.tsx b/design-system/packages/icons/src/icons/MenuIcon.tsx
index bc103179973..533e793a1f4 100644
--- a/design-system/packages/icons/src/icons/MenuIcon.tsx
+++ b/design-system/packages/icons/src/icons/MenuIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const MenuIcon = createIcon(
@@ -7,4 +7,4 @@ export const MenuIcon = createIcon(
,
'MenuIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/MessageCircleIcon.tsx b/design-system/packages/icons/src/icons/MessageCircleIcon.tsx
index 2ca243be748..1142f9f4ced 100644
--- a/design-system/packages/icons/src/icons/MessageCircleIcon.tsx
+++ b/design-system/packages/icons/src/icons/MessageCircleIcon.tsx
@@ -1,6 +1,6 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const MessageCircleIcon = createIcon(
,
'MessageCircleIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/MessageSquareIcon.tsx b/design-system/packages/icons/src/icons/MessageSquareIcon.tsx
index 721ef94804c..127eaadd84b 100644
--- a/design-system/packages/icons/src/icons/MessageSquareIcon.tsx
+++ b/design-system/packages/icons/src/icons/MessageSquareIcon.tsx
@@ -1,6 +1,6 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const MessageSquareIcon = createIcon(
,
'MessageSquareIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/MicIcon.tsx b/design-system/packages/icons/src/icons/MicIcon.tsx
index 40644c33cee..e71957304bc 100644
--- a/design-system/packages/icons/src/icons/MicIcon.tsx
+++ b/design-system/packages/icons/src/icons/MicIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const MicIcon = createIcon(
@@ -8,4 +8,4 @@ export const MicIcon = createIcon(
,
'MicIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/MicOffIcon.tsx b/design-system/packages/icons/src/icons/MicOffIcon.tsx
index 80fc24e7c2e..223e3de9167 100644
--- a/design-system/packages/icons/src/icons/MicOffIcon.tsx
+++ b/design-system/packages/icons/src/icons/MicOffIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const MicOffIcon = createIcon(
@@ -9,4 +9,4 @@ export const MicOffIcon = createIcon(
,
'MicOffIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/Minimize2Icon.tsx b/design-system/packages/icons/src/icons/Minimize2Icon.tsx
index ca66fef37ee..7b5d8d72347 100644
--- a/design-system/packages/icons/src/icons/Minimize2Icon.tsx
+++ b/design-system/packages/icons/src/icons/Minimize2Icon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const Minimize2Icon = createIcon(
@@ -8,4 +8,4 @@ export const Minimize2Icon = createIcon(
,
'Minimize2Icon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/MinimizeIcon.tsx b/design-system/packages/icons/src/icons/MinimizeIcon.tsx
index 808b0ceaa03..1d769563a6f 100644
--- a/design-system/packages/icons/src/icons/MinimizeIcon.tsx
+++ b/design-system/packages/icons/src/icons/MinimizeIcon.tsx
@@ -1,6 +1,6 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const MinimizeIcon = createIcon(
,
'MinimizeIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/MinusCircleIcon.tsx b/design-system/packages/icons/src/icons/MinusCircleIcon.tsx
index cafa2cea040..4c6381e4a04 100644
--- a/design-system/packages/icons/src/icons/MinusCircleIcon.tsx
+++ b/design-system/packages/icons/src/icons/MinusCircleIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const MinusCircleIcon = createIcon(
,
'MinusCircleIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/MinusIcon.tsx b/design-system/packages/icons/src/icons/MinusIcon.tsx
index 0da0a0e8fdf..b1bb5f5c898 100644
--- a/design-system/packages/icons/src/icons/MinusIcon.tsx
+++ b/design-system/packages/icons/src/icons/MinusIcon.tsx
@@ -1,3 +1,3 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
-export const MinusIcon = createIcon( , 'MinusIcon');
+import * as React from 'react'
+import { createIcon } from '../Icon'
+export const MinusIcon = createIcon( , 'MinusIcon')
diff --git a/design-system/packages/icons/src/icons/MinusSquareIcon.tsx b/design-system/packages/icons/src/icons/MinusSquareIcon.tsx
index aad5e9753c0..ab4b3206673 100644
--- a/design-system/packages/icons/src/icons/MinusSquareIcon.tsx
+++ b/design-system/packages/icons/src/icons/MinusSquareIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const MinusSquareIcon = createIcon(
,
'MinusSquareIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/MonitorIcon.tsx b/design-system/packages/icons/src/icons/MonitorIcon.tsx
index 3266873c69f..90b0cbee30b 100644
--- a/design-system/packages/icons/src/icons/MonitorIcon.tsx
+++ b/design-system/packages/icons/src/icons/MonitorIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const MonitorIcon = createIcon(
@@ -7,4 +7,4 @@ export const MonitorIcon = createIcon(
,
'MonitorIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/MoonIcon.tsx b/design-system/packages/icons/src/icons/MoonIcon.tsx
index e2893dcd1f4..de999ee770f 100644
--- a/design-system/packages/icons/src/icons/MoonIcon.tsx
+++ b/design-system/packages/icons/src/icons/MoonIcon.tsx
@@ -1,6 +1,6 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const MoonIcon = createIcon(
,
'MoonIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/MoreHorizontalIcon.tsx b/design-system/packages/icons/src/icons/MoreHorizontalIcon.tsx
index 4c394c42cc3..a05a477a924 100644
--- a/design-system/packages/icons/src/icons/MoreHorizontalIcon.tsx
+++ b/design-system/packages/icons/src/icons/MoreHorizontalIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const MoreHorizontalIcon = createIcon(
@@ -7,4 +7,4 @@ export const MoreHorizontalIcon = createIcon(
,
'MoreHorizontalIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/MoreVerticalIcon.tsx b/design-system/packages/icons/src/icons/MoreVerticalIcon.tsx
index 60b47f01b95..d58968284cd 100644
--- a/design-system/packages/icons/src/icons/MoreVerticalIcon.tsx
+++ b/design-system/packages/icons/src/icons/MoreVerticalIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const MoreVerticalIcon = createIcon(
@@ -7,4 +7,4 @@ export const MoreVerticalIcon = createIcon(
,
'MoreVerticalIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/MousePointerIcon.tsx b/design-system/packages/icons/src/icons/MousePointerIcon.tsx
index d7e60f93034..d4f381c5ef1 100644
--- a/design-system/packages/icons/src/icons/MousePointerIcon.tsx
+++ b/design-system/packages/icons/src/icons/MousePointerIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const MousePointerIcon = createIcon(
,
'MousePointerIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/MoveIcon.tsx b/design-system/packages/icons/src/icons/MoveIcon.tsx
index f35fb063ecb..0ebf65ada38 100644
--- a/design-system/packages/icons/src/icons/MoveIcon.tsx
+++ b/design-system/packages/icons/src/icons/MoveIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const MoveIcon = createIcon(
@@ -10,4 +10,4 @@ export const MoveIcon = createIcon(
,
'MoveIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/MusicIcon.tsx b/design-system/packages/icons/src/icons/MusicIcon.tsx
index 90d25c97310..14b84c9bf04 100644
--- a/design-system/packages/icons/src/icons/MusicIcon.tsx
+++ b/design-system/packages/icons/src/icons/MusicIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const MusicIcon = createIcon(
@@ -7,4 +7,4 @@ export const MusicIcon = createIcon(
,
'MusicIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/Navigation2Icon.tsx b/design-system/packages/icons/src/icons/Navigation2Icon.tsx
index d571921c8f5..1e2afb57439 100644
--- a/design-system/packages/icons/src/icons/Navigation2Icon.tsx
+++ b/design-system/packages/icons/src/icons/Navigation2Icon.tsx
@@ -1,6 +1,6 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const Navigation2Icon = createIcon(
,
'Navigation2Icon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/NavigationIcon.tsx b/design-system/packages/icons/src/icons/NavigationIcon.tsx
index be946cc22ab..72ddb13b1b9 100644
--- a/design-system/packages/icons/src/icons/NavigationIcon.tsx
+++ b/design-system/packages/icons/src/icons/NavigationIcon.tsx
@@ -1,6 +1,6 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const NavigationIcon = createIcon(
,
'NavigationIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/OctagonIcon.tsx b/design-system/packages/icons/src/icons/OctagonIcon.tsx
index a1aa4f4ad63..075478e6de4 100644
--- a/design-system/packages/icons/src/icons/OctagonIcon.tsx
+++ b/design-system/packages/icons/src/icons/OctagonIcon.tsx
@@ -1,6 +1,6 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const OctagonIcon = createIcon(
,
'OctagonIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/PackageIcon.tsx b/design-system/packages/icons/src/icons/PackageIcon.tsx
index 45edc58693a..f8c6ccd1526 100644
--- a/design-system/packages/icons/src/icons/PackageIcon.tsx
+++ b/design-system/packages/icons/src/icons/PackageIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const PackageIcon = createIcon(
@@ -8,4 +8,4 @@ export const PackageIcon = createIcon(
,
'PackageIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/PaperclipIcon.tsx b/design-system/packages/icons/src/icons/PaperclipIcon.tsx
index 0d4980676c9..97f6eb43e81 100644
--- a/design-system/packages/icons/src/icons/PaperclipIcon.tsx
+++ b/design-system/packages/icons/src/icons/PaperclipIcon.tsx
@@ -1,6 +1,6 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const PaperclipIcon = createIcon(
,
'PaperclipIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/PauseCircleIcon.tsx b/design-system/packages/icons/src/icons/PauseCircleIcon.tsx
index a821ac74d6e..f3aeb4d967a 100644
--- a/design-system/packages/icons/src/icons/PauseCircleIcon.tsx
+++ b/design-system/packages/icons/src/icons/PauseCircleIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const PauseCircleIcon = createIcon(
@@ -7,4 +7,4 @@ export const PauseCircleIcon = createIcon(
,
'PauseCircleIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/PauseIcon.tsx b/design-system/packages/icons/src/icons/PauseIcon.tsx
index 49d01348b5e..92f1509c2e2 100644
--- a/design-system/packages/icons/src/icons/PauseIcon.tsx
+++ b/design-system/packages/icons/src/icons/PauseIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const PauseIcon = createIcon(
,
'PauseIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/PenToolIcon.tsx b/design-system/packages/icons/src/icons/PenToolIcon.tsx
index 68cbc83c3f4..b857dbad7f7 100644
--- a/design-system/packages/icons/src/icons/PenToolIcon.tsx
+++ b/design-system/packages/icons/src/icons/PenToolIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const PenToolIcon = createIcon(
@@ -8,4 +8,4 @@ export const PenToolIcon = createIcon(
,
'PenToolIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/PercentIcon.tsx b/design-system/packages/icons/src/icons/PercentIcon.tsx
index 56a8cfbcd61..ca988a4edf4 100644
--- a/design-system/packages/icons/src/icons/PercentIcon.tsx
+++ b/design-system/packages/icons/src/icons/PercentIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const PercentIcon = createIcon(
@@ -7,4 +7,4 @@ export const PercentIcon = createIcon(
,
'PercentIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/PhoneCallIcon.tsx b/design-system/packages/icons/src/icons/PhoneCallIcon.tsx
index e32f2bde350..4246ca5b318 100644
--- a/design-system/packages/icons/src/icons/PhoneCallIcon.tsx
+++ b/design-system/packages/icons/src/icons/PhoneCallIcon.tsx
@@ -1,6 +1,6 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const PhoneCallIcon = createIcon(
,
'PhoneCallIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/PhoneForwardedIcon.tsx b/design-system/packages/icons/src/icons/PhoneForwardedIcon.tsx
index dc981f26a6a..4efd69544c5 100644
--- a/design-system/packages/icons/src/icons/PhoneForwardedIcon.tsx
+++ b/design-system/packages/icons/src/icons/PhoneForwardedIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const PhoneForwardedIcon = createIcon(
@@ -7,4 +7,4 @@ export const PhoneForwardedIcon = createIcon(
,
'PhoneForwardedIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/PhoneIcon.tsx b/design-system/packages/icons/src/icons/PhoneIcon.tsx
index 483698bd11b..48063febc4f 100644
--- a/design-system/packages/icons/src/icons/PhoneIcon.tsx
+++ b/design-system/packages/icons/src/icons/PhoneIcon.tsx
@@ -1,6 +1,6 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const PhoneIcon = createIcon(
,
'PhoneIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/PhoneIncomingIcon.tsx b/design-system/packages/icons/src/icons/PhoneIncomingIcon.tsx
index c22773752f6..24ad1bc7906 100644
--- a/design-system/packages/icons/src/icons/PhoneIncomingIcon.tsx
+++ b/design-system/packages/icons/src/icons/PhoneIncomingIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const PhoneIncomingIcon = createIcon(
@@ -7,4 +7,4 @@ export const PhoneIncomingIcon = createIcon(
,
'PhoneIncomingIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/PhoneMissedIcon.tsx b/design-system/packages/icons/src/icons/PhoneMissedIcon.tsx
index cbe7e68b8c1..fc86dffd7c0 100644
--- a/design-system/packages/icons/src/icons/PhoneMissedIcon.tsx
+++ b/design-system/packages/icons/src/icons/PhoneMissedIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const PhoneMissedIcon = createIcon(
@@ -7,4 +7,4 @@ export const PhoneMissedIcon = createIcon(
,
'PhoneMissedIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/PhoneOffIcon.tsx b/design-system/packages/icons/src/icons/PhoneOffIcon.tsx
index 35e0a2a31f1..3913b4f7bc0 100644
--- a/design-system/packages/icons/src/icons/PhoneOffIcon.tsx
+++ b/design-system/packages/icons/src/icons/PhoneOffIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const PhoneOffIcon = createIcon(
,
'PhoneOffIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/PhoneOutgoingIcon.tsx b/design-system/packages/icons/src/icons/PhoneOutgoingIcon.tsx
index be4cf272d3a..537d308c578 100644
--- a/design-system/packages/icons/src/icons/PhoneOutgoingIcon.tsx
+++ b/design-system/packages/icons/src/icons/PhoneOutgoingIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const PhoneOutgoingIcon = createIcon(
@@ -7,4 +7,4 @@ export const PhoneOutgoingIcon = createIcon(
,
'PhoneOutgoingIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/PieChartIcon.tsx b/design-system/packages/icons/src/icons/PieChartIcon.tsx
index 20b642889f0..4e22cf6687f 100644
--- a/design-system/packages/icons/src/icons/PieChartIcon.tsx
+++ b/design-system/packages/icons/src/icons/PieChartIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const PieChartIcon = createIcon(
,
'PieChartIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/PlayCircleIcon.tsx b/design-system/packages/icons/src/icons/PlayCircleIcon.tsx
index e195a70325b..7db5fcd4408 100644
--- a/design-system/packages/icons/src/icons/PlayCircleIcon.tsx
+++ b/design-system/packages/icons/src/icons/PlayCircleIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const PlayCircleIcon = createIcon(
,
'PlayCircleIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/PlayIcon.tsx b/design-system/packages/icons/src/icons/PlayIcon.tsx
index 538969ad7a4..1b4e8ca1cea 100644
--- a/design-system/packages/icons/src/icons/PlayIcon.tsx
+++ b/design-system/packages/icons/src/icons/PlayIcon.tsx
@@ -1,3 +1,3 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
-export const PlayIcon = createIcon( , 'PlayIcon');
+import * as React from 'react'
+import { createIcon } from '../Icon'
+export const PlayIcon = createIcon( , 'PlayIcon')
diff --git a/design-system/packages/icons/src/icons/PlusCircleIcon.tsx b/design-system/packages/icons/src/icons/PlusCircleIcon.tsx
index 12e8247d6ee..ad223c287e9 100644
--- a/design-system/packages/icons/src/icons/PlusCircleIcon.tsx
+++ b/design-system/packages/icons/src/icons/PlusCircleIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const PlusCircleIcon = createIcon(
@@ -7,4 +7,4 @@ export const PlusCircleIcon = createIcon(
,
'PlusCircleIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/PlusIcon.tsx b/design-system/packages/icons/src/icons/PlusIcon.tsx
index 49f3a58b79e..e6f6700a5f3 100644
--- a/design-system/packages/icons/src/icons/PlusIcon.tsx
+++ b/design-system/packages/icons/src/icons/PlusIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const PlusIcon = createIcon(
,
'PlusIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/PlusSquareIcon.tsx b/design-system/packages/icons/src/icons/PlusSquareIcon.tsx
index 631a5c3664f..8243a8c0c60 100644
--- a/design-system/packages/icons/src/icons/PlusSquareIcon.tsx
+++ b/design-system/packages/icons/src/icons/PlusSquareIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const PlusSquareIcon = createIcon(
@@ -7,4 +7,4 @@ export const PlusSquareIcon = createIcon(
,
'PlusSquareIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/PocketIcon.tsx b/design-system/packages/icons/src/icons/PocketIcon.tsx
index 972af3c6ade..343006abc7f 100644
--- a/design-system/packages/icons/src/icons/PocketIcon.tsx
+++ b/design-system/packages/icons/src/icons/PocketIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const PocketIcon = createIcon(
,
'PocketIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/PowerIcon.tsx b/design-system/packages/icons/src/icons/PowerIcon.tsx
index 434e247b565..4384e4c81e0 100644
--- a/design-system/packages/icons/src/icons/PowerIcon.tsx
+++ b/design-system/packages/icons/src/icons/PowerIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const PowerIcon = createIcon(
,
'PowerIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/PrinterIcon.tsx b/design-system/packages/icons/src/icons/PrinterIcon.tsx
index b0d835b5dcc..a4dac9a6908 100644
--- a/design-system/packages/icons/src/icons/PrinterIcon.tsx
+++ b/design-system/packages/icons/src/icons/PrinterIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const PrinterIcon = createIcon(
@@ -7,4 +7,4 @@ export const PrinterIcon = createIcon(
,
'PrinterIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/RadioIcon.tsx b/design-system/packages/icons/src/icons/RadioIcon.tsx
index 05f84ac6e54..f0d25fa9a2a 100644
--- a/design-system/packages/icons/src/icons/RadioIcon.tsx
+++ b/design-system/packages/icons/src/icons/RadioIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const RadioIcon = createIcon(
,
'RadioIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/RefreshCcwIcon.tsx b/design-system/packages/icons/src/icons/RefreshCcwIcon.tsx
index 386b1d1795a..ead786f2f9c 100644
--- a/design-system/packages/icons/src/icons/RefreshCcwIcon.tsx
+++ b/design-system/packages/icons/src/icons/RefreshCcwIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const RefreshCcwIcon = createIcon(
@@ -7,4 +7,4 @@ export const RefreshCcwIcon = createIcon(
,
'RefreshCcwIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/RefreshCwIcon.tsx b/design-system/packages/icons/src/icons/RefreshCwIcon.tsx
index f020908adf3..746466a316e 100644
--- a/design-system/packages/icons/src/icons/RefreshCwIcon.tsx
+++ b/design-system/packages/icons/src/icons/RefreshCwIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const RefreshCwIcon = createIcon(
@@ -7,4 +7,4 @@ export const RefreshCwIcon = createIcon(
,
'RefreshCwIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/RepeatIcon.tsx b/design-system/packages/icons/src/icons/RepeatIcon.tsx
index b40409a3d67..68dd0dfb4b7 100644
--- a/design-system/packages/icons/src/icons/RepeatIcon.tsx
+++ b/design-system/packages/icons/src/icons/RepeatIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const RepeatIcon = createIcon(
@@ -8,4 +8,4 @@ export const RepeatIcon = createIcon(
,
'RepeatIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/RewindIcon.tsx b/design-system/packages/icons/src/icons/RewindIcon.tsx
index e9526df913b..a73b9d5a558 100644
--- a/design-system/packages/icons/src/icons/RewindIcon.tsx
+++ b/design-system/packages/icons/src/icons/RewindIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const RewindIcon = createIcon(
,
'RewindIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/RotateCcwIcon.tsx b/design-system/packages/icons/src/icons/RotateCcwIcon.tsx
index 451fc71e4d3..dfcd3fe692b 100644
--- a/design-system/packages/icons/src/icons/RotateCcwIcon.tsx
+++ b/design-system/packages/icons/src/icons/RotateCcwIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const RotateCcwIcon = createIcon(
,
'RotateCcwIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/RotateCwIcon.tsx b/design-system/packages/icons/src/icons/RotateCwIcon.tsx
index 125020d1e59..820f22af5e8 100644
--- a/design-system/packages/icons/src/icons/RotateCwIcon.tsx
+++ b/design-system/packages/icons/src/icons/RotateCwIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const RotateCwIcon = createIcon(
,
'RotateCwIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/RssIcon.tsx b/design-system/packages/icons/src/icons/RssIcon.tsx
index 61f4e625de8..b66dc4eebdd 100644
--- a/design-system/packages/icons/src/icons/RssIcon.tsx
+++ b/design-system/packages/icons/src/icons/RssIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const RssIcon = createIcon(
@@ -7,4 +7,4 @@ export const RssIcon = createIcon(
,
'RssIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/SaveIcon.tsx b/design-system/packages/icons/src/icons/SaveIcon.tsx
index 378f4625f0c..0ed5951b3b9 100644
--- a/design-system/packages/icons/src/icons/SaveIcon.tsx
+++ b/design-system/packages/icons/src/icons/SaveIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const SaveIcon = createIcon(
@@ -7,4 +7,4 @@ export const SaveIcon = createIcon(
,
'SaveIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/ScissorsIcon.tsx b/design-system/packages/icons/src/icons/ScissorsIcon.tsx
index 3132846290e..699179089ba 100644
--- a/design-system/packages/icons/src/icons/ScissorsIcon.tsx
+++ b/design-system/packages/icons/src/icons/ScissorsIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const ScissorsIcon = createIcon(
@@ -9,4 +9,4 @@ export const ScissorsIcon = createIcon(
,
'ScissorsIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/SearchIcon.tsx b/design-system/packages/icons/src/icons/SearchIcon.tsx
index 62e8aa1634a..7f98bd90e38 100644
--- a/design-system/packages/icons/src/icons/SearchIcon.tsx
+++ b/design-system/packages/icons/src/icons/SearchIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const SearchIcon = createIcon(
,
'SearchIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/SendIcon.tsx b/design-system/packages/icons/src/icons/SendIcon.tsx
index ba5cadb0c2a..e59e313db07 100644
--- a/design-system/packages/icons/src/icons/SendIcon.tsx
+++ b/design-system/packages/icons/src/icons/SendIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const SendIcon = createIcon(
,
'SendIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/ServerIcon.tsx b/design-system/packages/icons/src/icons/ServerIcon.tsx
index e3de8e690a1..0b5e0148ed7 100644
--- a/design-system/packages/icons/src/icons/ServerIcon.tsx
+++ b/design-system/packages/icons/src/icons/ServerIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const ServerIcon = createIcon(
@@ -8,4 +8,4 @@ export const ServerIcon = createIcon(
,
'ServerIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/SettingsIcon.tsx b/design-system/packages/icons/src/icons/SettingsIcon.tsx
index b822e520773..98a74fbbcec 100644
--- a/design-system/packages/icons/src/icons/SettingsIcon.tsx
+++ b/design-system/packages/icons/src/icons/SettingsIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const SettingsIcon = createIcon(
,
'SettingsIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/Share2Icon.tsx b/design-system/packages/icons/src/icons/Share2Icon.tsx
index 42e795ce0a7..a9792ea0118 100644
--- a/design-system/packages/icons/src/icons/Share2Icon.tsx
+++ b/design-system/packages/icons/src/icons/Share2Icon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const Share2Icon = createIcon(
@@ -9,4 +9,4 @@ export const Share2Icon = createIcon(
,
'Share2Icon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/ShareIcon.tsx b/design-system/packages/icons/src/icons/ShareIcon.tsx
index f071183f087..4d1d0b0f941 100644
--- a/design-system/packages/icons/src/icons/ShareIcon.tsx
+++ b/design-system/packages/icons/src/icons/ShareIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const ShareIcon = createIcon(
@@ -7,4 +7,4 @@ export const ShareIcon = createIcon(
,
'ShareIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/ShieldIcon.tsx b/design-system/packages/icons/src/icons/ShieldIcon.tsx
index 29ffc471d91..439c1141d74 100644
--- a/design-system/packages/icons/src/icons/ShieldIcon.tsx
+++ b/design-system/packages/icons/src/icons/ShieldIcon.tsx
@@ -1,6 +1,6 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const ShieldIcon = createIcon(
,
'ShieldIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/ShieldOffIcon.tsx b/design-system/packages/icons/src/icons/ShieldOffIcon.tsx
index f749bf06fe1..dad39e509e2 100644
--- a/design-system/packages/icons/src/icons/ShieldOffIcon.tsx
+++ b/design-system/packages/icons/src/icons/ShieldOffIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const ShieldOffIcon = createIcon(
@@ -7,4 +7,4 @@ export const ShieldOffIcon = createIcon(
,
'ShieldOffIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/ShoppingBagIcon.tsx b/design-system/packages/icons/src/icons/ShoppingBagIcon.tsx
index c47e0188805..52cf6dc8784 100644
--- a/design-system/packages/icons/src/icons/ShoppingBagIcon.tsx
+++ b/design-system/packages/icons/src/icons/ShoppingBagIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const ShoppingBagIcon = createIcon(
@@ -7,4 +7,4 @@ export const ShoppingBagIcon = createIcon(
,
'ShoppingBagIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/ShoppingCartIcon.tsx b/design-system/packages/icons/src/icons/ShoppingCartIcon.tsx
index 03d3cc00518..eea24fb754d 100644
--- a/design-system/packages/icons/src/icons/ShoppingCartIcon.tsx
+++ b/design-system/packages/icons/src/icons/ShoppingCartIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const ShoppingCartIcon = createIcon(
@@ -7,4 +7,4 @@ export const ShoppingCartIcon = createIcon(
,
'ShoppingCartIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/ShuffleIcon.tsx b/design-system/packages/icons/src/icons/ShuffleIcon.tsx
index 00fb542252d..a3bcaf7de1e 100644
--- a/design-system/packages/icons/src/icons/ShuffleIcon.tsx
+++ b/design-system/packages/icons/src/icons/ShuffleIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const ShuffleIcon = createIcon(
@@ -9,4 +9,4 @@ export const ShuffleIcon = createIcon(
,
'ShuffleIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/SidebarIcon.tsx b/design-system/packages/icons/src/icons/SidebarIcon.tsx
index 256f95e850f..60e86387e92 100644
--- a/design-system/packages/icons/src/icons/SidebarIcon.tsx
+++ b/design-system/packages/icons/src/icons/SidebarIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const SidebarIcon = createIcon(
,
'SidebarIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/SkipBackIcon.tsx b/design-system/packages/icons/src/icons/SkipBackIcon.tsx
index 07543245c73..b2aad868b90 100644
--- a/design-system/packages/icons/src/icons/SkipBackIcon.tsx
+++ b/design-system/packages/icons/src/icons/SkipBackIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const SkipBackIcon = createIcon(
,
'SkipBackIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/SkipForwardIcon.tsx b/design-system/packages/icons/src/icons/SkipForwardIcon.tsx
index 118f1aca87e..0e673e278b0 100644
--- a/design-system/packages/icons/src/icons/SkipForwardIcon.tsx
+++ b/design-system/packages/icons/src/icons/SkipForwardIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const SkipForwardIcon = createIcon(
,
'SkipForwardIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/SlackIcon.tsx b/design-system/packages/icons/src/icons/SlackIcon.tsx
index a2c9d3568e0..8e5279b990f 100644
--- a/design-system/packages/icons/src/icons/SlackIcon.tsx
+++ b/design-system/packages/icons/src/icons/SlackIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const SlackIcon = createIcon(
@@ -12,4 +12,4 @@ export const SlackIcon = createIcon(
,
'SlackIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/SlashIcon.tsx b/design-system/packages/icons/src/icons/SlashIcon.tsx
index df46ec08782..ea40d20e3d7 100644
--- a/design-system/packages/icons/src/icons/SlashIcon.tsx
+++ b/design-system/packages/icons/src/icons/SlashIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const SlashIcon = createIcon(
,
'SlashIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/SlidersIcon.tsx b/design-system/packages/icons/src/icons/SlidersIcon.tsx
index 57912b00910..9bd822ed2d2 100644
--- a/design-system/packages/icons/src/icons/SlidersIcon.tsx
+++ b/design-system/packages/icons/src/icons/SlidersIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const SlidersIcon = createIcon(
@@ -13,4 +13,4 @@ export const SlidersIcon = createIcon(
,
'SlidersIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/SmartphoneIcon.tsx b/design-system/packages/icons/src/icons/SmartphoneIcon.tsx
index 8b0d915b338..80b497734e0 100644
--- a/design-system/packages/icons/src/icons/SmartphoneIcon.tsx
+++ b/design-system/packages/icons/src/icons/SmartphoneIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const SmartphoneIcon = createIcon(
,
'SmartphoneIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/SmileIcon.tsx b/design-system/packages/icons/src/icons/SmileIcon.tsx
index c3ffdf26847..c46995b6343 100644
--- a/design-system/packages/icons/src/icons/SmileIcon.tsx
+++ b/design-system/packages/icons/src/icons/SmileIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const SmileIcon = createIcon(
@@ -8,4 +8,4 @@ export const SmileIcon = createIcon(
,
'SmileIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/SpeakerIcon.tsx b/design-system/packages/icons/src/icons/SpeakerIcon.tsx
index bcaa0a93023..bd3265f5cc5 100644
--- a/design-system/packages/icons/src/icons/SpeakerIcon.tsx
+++ b/design-system/packages/icons/src/icons/SpeakerIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const SpeakerIcon = createIcon(
@@ -7,4 +7,4 @@ export const SpeakerIcon = createIcon(
,
'SpeakerIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/SquareIcon.tsx b/design-system/packages/icons/src/icons/SquareIcon.tsx
index 5db272653c2..f883adb9ffa 100644
--- a/design-system/packages/icons/src/icons/SquareIcon.tsx
+++ b/design-system/packages/icons/src/icons/SquareIcon.tsx
@@ -1,6 +1,6 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const SquareIcon = createIcon(
,
'SquareIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/StarIcon.tsx b/design-system/packages/icons/src/icons/StarIcon.tsx
index 0c6da234d12..9683d093cea 100644
--- a/design-system/packages/icons/src/icons/StarIcon.tsx
+++ b/design-system/packages/icons/src/icons/StarIcon.tsx
@@ -1,6 +1,6 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const StarIcon = createIcon(
,
'StarIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/StopCircleIcon.tsx b/design-system/packages/icons/src/icons/StopCircleIcon.tsx
index f8df0df51b8..92c35682cbc 100644
--- a/design-system/packages/icons/src/icons/StopCircleIcon.tsx
+++ b/design-system/packages/icons/src/icons/StopCircleIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const StopCircleIcon = createIcon(
,
'StopCircleIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/SunIcon.tsx b/design-system/packages/icons/src/icons/SunIcon.tsx
index 21bc719fb54..7718b1a26c3 100644
--- a/design-system/packages/icons/src/icons/SunIcon.tsx
+++ b/design-system/packages/icons/src/icons/SunIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const SunIcon = createIcon(
@@ -13,4 +13,4 @@ export const SunIcon = createIcon(
,
'SunIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/SunriseIcon.tsx b/design-system/packages/icons/src/icons/SunriseIcon.tsx
index 3c157415e5b..e54f6708d08 100644
--- a/design-system/packages/icons/src/icons/SunriseIcon.tsx
+++ b/design-system/packages/icons/src/icons/SunriseIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const SunriseIcon = createIcon(
@@ -12,4 +12,4 @@ export const SunriseIcon = createIcon(
,
'SunriseIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/SunsetIcon.tsx b/design-system/packages/icons/src/icons/SunsetIcon.tsx
index 1fce3fd5836..59233b774ce 100644
--- a/design-system/packages/icons/src/icons/SunsetIcon.tsx
+++ b/design-system/packages/icons/src/icons/SunsetIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const SunsetIcon = createIcon(
@@ -12,4 +12,4 @@ export const SunsetIcon = createIcon(
,
'SunsetIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/TabletIcon.tsx b/design-system/packages/icons/src/icons/TabletIcon.tsx
index f4f381a90d0..acb00163d77 100644
--- a/design-system/packages/icons/src/icons/TabletIcon.tsx
+++ b/design-system/packages/icons/src/icons/TabletIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const TabletIcon = createIcon(
,
'TabletIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/TagIcon.tsx b/design-system/packages/icons/src/icons/TagIcon.tsx
index 122443db322..d548a0cfd76 100644
--- a/design-system/packages/icons/src/icons/TagIcon.tsx
+++ b/design-system/packages/icons/src/icons/TagIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const TagIcon = createIcon(
,
'TagIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/TargetIcon.tsx b/design-system/packages/icons/src/icons/TargetIcon.tsx
index 14051235419..422003acb87 100644
--- a/design-system/packages/icons/src/icons/TargetIcon.tsx
+++ b/design-system/packages/icons/src/icons/TargetIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const TargetIcon = createIcon(
@@ -7,4 +7,4 @@ export const TargetIcon = createIcon(
,
'TargetIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/TerminalIcon.tsx b/design-system/packages/icons/src/icons/TerminalIcon.tsx
index 59180a27d1d..976db87a866 100644
--- a/design-system/packages/icons/src/icons/TerminalIcon.tsx
+++ b/design-system/packages/icons/src/icons/TerminalIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const TerminalIcon = createIcon(
,
'TerminalIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/ThermometerIcon.tsx b/design-system/packages/icons/src/icons/ThermometerIcon.tsx
index 8b49567c8f4..0519ab20db2 100644
--- a/design-system/packages/icons/src/icons/ThermometerIcon.tsx
+++ b/design-system/packages/icons/src/icons/ThermometerIcon.tsx
@@ -1,6 +1,6 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const ThermometerIcon = createIcon(
,
'ThermometerIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/ThumbsDownIcon.tsx b/design-system/packages/icons/src/icons/ThumbsDownIcon.tsx
index 4e47c6adbd7..acb8a2993b3 100644
--- a/design-system/packages/icons/src/icons/ThumbsDownIcon.tsx
+++ b/design-system/packages/icons/src/icons/ThumbsDownIcon.tsx
@@ -1,6 +1,6 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const ThumbsDownIcon = createIcon(
,
'ThumbsDownIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/ThumbsUpIcon.tsx b/design-system/packages/icons/src/icons/ThumbsUpIcon.tsx
index 476e3820924..b4bd4d3ce77 100644
--- a/design-system/packages/icons/src/icons/ThumbsUpIcon.tsx
+++ b/design-system/packages/icons/src/icons/ThumbsUpIcon.tsx
@@ -1,6 +1,6 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const ThumbsUpIcon = createIcon(
,
'ThumbsUpIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/ToggleLeftIcon.tsx b/design-system/packages/icons/src/icons/ToggleLeftIcon.tsx
index e0b89ef64a5..29a16a1058d 100644
--- a/design-system/packages/icons/src/icons/ToggleLeftIcon.tsx
+++ b/design-system/packages/icons/src/icons/ToggleLeftIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const ToggleLeftIcon = createIcon(
,
'ToggleLeftIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/ToggleRightIcon.tsx b/design-system/packages/icons/src/icons/ToggleRightIcon.tsx
index d14d8e6f45a..821079e6f9f 100644
--- a/design-system/packages/icons/src/icons/ToggleRightIcon.tsx
+++ b/design-system/packages/icons/src/icons/ToggleRightIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const ToggleRightIcon = createIcon(
,
'ToggleRightIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/ToolIcon.tsx b/design-system/packages/icons/src/icons/ToolIcon.tsx
index 3bdb7a6e13b..f76c5faa67d 100644
--- a/design-system/packages/icons/src/icons/ToolIcon.tsx
+++ b/design-system/packages/icons/src/icons/ToolIcon.tsx
@@ -1,6 +1,6 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const ToolIcon = createIcon(
,
'ToolIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/Trash2Icon.tsx b/design-system/packages/icons/src/icons/Trash2Icon.tsx
index 386e358f042..9e32d6edea1 100644
--- a/design-system/packages/icons/src/icons/Trash2Icon.tsx
+++ b/design-system/packages/icons/src/icons/Trash2Icon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const Trash2Icon = createIcon(
@@ -8,4 +8,4 @@ export const Trash2Icon = createIcon(
,
'Trash2Icon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/TrashIcon.tsx b/design-system/packages/icons/src/icons/TrashIcon.tsx
index 51f6f20dfdc..294a0455b6a 100644
--- a/design-system/packages/icons/src/icons/TrashIcon.tsx
+++ b/design-system/packages/icons/src/icons/TrashIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const TrashIcon = createIcon(
,
'TrashIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/TrelloIcon.tsx b/design-system/packages/icons/src/icons/TrelloIcon.tsx
index f31ea990d27..a67cb160df1 100644
--- a/design-system/packages/icons/src/icons/TrelloIcon.tsx
+++ b/design-system/packages/icons/src/icons/TrelloIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const TrelloIcon = createIcon(
@@ -7,4 +7,4 @@ export const TrelloIcon = createIcon(
,
'TrelloIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/TrendingDownIcon.tsx b/design-system/packages/icons/src/icons/TrendingDownIcon.tsx
index 3e401389f0a..ba9483d4920 100644
--- a/design-system/packages/icons/src/icons/TrendingDownIcon.tsx
+++ b/design-system/packages/icons/src/icons/TrendingDownIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const TrendingDownIcon = createIcon(
,
'TrendingDownIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/TrendingUpIcon.tsx b/design-system/packages/icons/src/icons/TrendingUpIcon.tsx
index 1c2604b1a47..a3db9442409 100644
--- a/design-system/packages/icons/src/icons/TrendingUpIcon.tsx
+++ b/design-system/packages/icons/src/icons/TrendingUpIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const TrendingUpIcon = createIcon(
,
'TrendingUpIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/TriangleIcon.tsx b/design-system/packages/icons/src/icons/TriangleIcon.tsx
index e5d6b195c3b..5fa044fa746 100644
--- a/design-system/packages/icons/src/icons/TriangleIcon.tsx
+++ b/design-system/packages/icons/src/icons/TriangleIcon.tsx
@@ -1,6 +1,6 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const TriangleIcon = createIcon(
,
'TriangleIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/TruckIcon.tsx b/design-system/packages/icons/src/icons/TruckIcon.tsx
index dda8dff9bfe..5786fae03fd 100644
--- a/design-system/packages/icons/src/icons/TruckIcon.tsx
+++ b/design-system/packages/icons/src/icons/TruckIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const TruckIcon = createIcon(
@@ -8,4 +8,4 @@ export const TruckIcon = createIcon(
,
'TruckIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/TvIcon.tsx b/design-system/packages/icons/src/icons/TvIcon.tsx
index b77af392c1b..d55ef720b7e 100644
--- a/design-system/packages/icons/src/icons/TvIcon.tsx
+++ b/design-system/packages/icons/src/icons/TvIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const TvIcon = createIcon(
,
'TvIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/TwitchIcon.tsx b/design-system/packages/icons/src/icons/TwitchIcon.tsx
index b667447c1c6..85c3114d024 100644
--- a/design-system/packages/icons/src/icons/TwitchIcon.tsx
+++ b/design-system/packages/icons/src/icons/TwitchIcon.tsx
@@ -1,6 +1,6 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const TwitchIcon = createIcon(
,
'TwitchIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/TwitterIcon.tsx b/design-system/packages/icons/src/icons/TwitterIcon.tsx
index 292b6dcc3a5..fb218e8a1cb 100644
--- a/design-system/packages/icons/src/icons/TwitterIcon.tsx
+++ b/design-system/packages/icons/src/icons/TwitterIcon.tsx
@@ -1,6 +1,6 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const TwitterIcon = createIcon(
,
'TwitterIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/TypeIcon.tsx b/design-system/packages/icons/src/icons/TypeIcon.tsx
index facc16012a1..67874c8645e 100644
--- a/design-system/packages/icons/src/icons/TypeIcon.tsx
+++ b/design-system/packages/icons/src/icons/TypeIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const TypeIcon = createIcon(
@@ -7,4 +7,4 @@ export const TypeIcon = createIcon(
,
'TypeIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/UmbrellaIcon.tsx b/design-system/packages/icons/src/icons/UmbrellaIcon.tsx
index 77c0b4d871f..d8b7056d526 100644
--- a/design-system/packages/icons/src/icons/UmbrellaIcon.tsx
+++ b/design-system/packages/icons/src/icons/UmbrellaIcon.tsx
@@ -1,6 +1,6 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const UmbrellaIcon = createIcon(
,
'UmbrellaIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/UnderlineIcon.tsx b/design-system/packages/icons/src/icons/UnderlineIcon.tsx
index 6fef7833d49..8c5febc47f7 100644
--- a/design-system/packages/icons/src/icons/UnderlineIcon.tsx
+++ b/design-system/packages/icons/src/icons/UnderlineIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const UnderlineIcon = createIcon(
,
'UnderlineIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/UnlockIcon.tsx b/design-system/packages/icons/src/icons/UnlockIcon.tsx
index 20488e4e8c3..c09b0ad24cd 100644
--- a/design-system/packages/icons/src/icons/UnlockIcon.tsx
+++ b/design-system/packages/icons/src/icons/UnlockIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const UnlockIcon = createIcon(
,
'UnlockIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/UploadCloudIcon.tsx b/design-system/packages/icons/src/icons/UploadCloudIcon.tsx
index f87bb5cfdec..4562ca8fa25 100644
--- a/design-system/packages/icons/src/icons/UploadCloudIcon.tsx
+++ b/design-system/packages/icons/src/icons/UploadCloudIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const UploadCloudIcon = createIcon(
@@ -8,4 +8,4 @@ export const UploadCloudIcon = createIcon(
,
'UploadCloudIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/UploadIcon.tsx b/design-system/packages/icons/src/icons/UploadIcon.tsx
index ace9c42fdfd..fd69577ce55 100644
--- a/design-system/packages/icons/src/icons/UploadIcon.tsx
+++ b/design-system/packages/icons/src/icons/UploadIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const UploadIcon = createIcon(
@@ -7,4 +7,4 @@ export const UploadIcon = createIcon(
,
'UploadIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/UserCheckIcon.tsx b/design-system/packages/icons/src/icons/UserCheckIcon.tsx
index 49c846f8ff2..d84a12cda51 100644
--- a/design-system/packages/icons/src/icons/UserCheckIcon.tsx
+++ b/design-system/packages/icons/src/icons/UserCheckIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const UserCheckIcon = createIcon(
@@ -7,4 +7,4 @@ export const UserCheckIcon = createIcon(
,
'UserCheckIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/UserIcon.tsx b/design-system/packages/icons/src/icons/UserIcon.tsx
index 1c7f3eab505..227ef05ca0d 100644
--- a/design-system/packages/icons/src/icons/UserIcon.tsx
+++ b/design-system/packages/icons/src/icons/UserIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const UserIcon = createIcon(
,
'UserIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/UserMinusIcon.tsx b/design-system/packages/icons/src/icons/UserMinusIcon.tsx
index d4cbb788693..bbd932821ef 100644
--- a/design-system/packages/icons/src/icons/UserMinusIcon.tsx
+++ b/design-system/packages/icons/src/icons/UserMinusIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const UserMinusIcon = createIcon(
@@ -7,4 +7,4 @@ export const UserMinusIcon = createIcon(
,
'UserMinusIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/UserPlusIcon.tsx b/design-system/packages/icons/src/icons/UserPlusIcon.tsx
index f4adccf882d..be462ede561 100644
--- a/design-system/packages/icons/src/icons/UserPlusIcon.tsx
+++ b/design-system/packages/icons/src/icons/UserPlusIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const UserPlusIcon = createIcon(
@@ -8,4 +8,4 @@ export const UserPlusIcon = createIcon(
,
'UserPlusIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/UserXIcon.tsx b/design-system/packages/icons/src/icons/UserXIcon.tsx
index 0e5a3bc4ede..0ecc61c063a 100644
--- a/design-system/packages/icons/src/icons/UserXIcon.tsx
+++ b/design-system/packages/icons/src/icons/UserXIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const UserXIcon = createIcon(
@@ -8,4 +8,4 @@ export const UserXIcon = createIcon(
,
'UserXIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/UsersIcon.tsx b/design-system/packages/icons/src/icons/UsersIcon.tsx
index 6cb99e875b8..4a2b0da598d 100644
--- a/design-system/packages/icons/src/icons/UsersIcon.tsx
+++ b/design-system/packages/icons/src/icons/UsersIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const UsersIcon = createIcon(
@@ -8,4 +8,4 @@ export const UsersIcon = createIcon(
,
'UsersIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/VideoIcon.tsx b/design-system/packages/icons/src/icons/VideoIcon.tsx
index 7d47185e9c6..f93d9669429 100644
--- a/design-system/packages/icons/src/icons/VideoIcon.tsx
+++ b/design-system/packages/icons/src/icons/VideoIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const VideoIcon = createIcon(
,
'VideoIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/VideoOffIcon.tsx b/design-system/packages/icons/src/icons/VideoOffIcon.tsx
index fe42f62de89..ea63f173847 100644
--- a/design-system/packages/icons/src/icons/VideoOffIcon.tsx
+++ b/design-system/packages/icons/src/icons/VideoOffIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const VideoOffIcon = createIcon(
,
'VideoOffIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/VoicemailIcon.tsx b/design-system/packages/icons/src/icons/VoicemailIcon.tsx
index 8518ab29147..e22425e3f3b 100644
--- a/design-system/packages/icons/src/icons/VoicemailIcon.tsx
+++ b/design-system/packages/icons/src/icons/VoicemailIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const VoicemailIcon = createIcon(
@@ -7,4 +7,4 @@ export const VoicemailIcon = createIcon(
,
'VoicemailIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/Volume1Icon.tsx b/design-system/packages/icons/src/icons/Volume1Icon.tsx
index d1c210e5db0..0b58c98fce5 100644
--- a/design-system/packages/icons/src/icons/Volume1Icon.tsx
+++ b/design-system/packages/icons/src/icons/Volume1Icon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const Volume1Icon = createIcon(
,
'Volume1Icon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/Volume2Icon.tsx b/design-system/packages/icons/src/icons/Volume2Icon.tsx
index 584680dbf9d..6be5d608bc4 100644
--- a/design-system/packages/icons/src/icons/Volume2Icon.tsx
+++ b/design-system/packages/icons/src/icons/Volume2Icon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const Volume2Icon = createIcon(
,
'Volume2Icon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/VolumeIcon.tsx b/design-system/packages/icons/src/icons/VolumeIcon.tsx
index e8a3b2ab831..4047a5aae4f 100644
--- a/design-system/packages/icons/src/icons/VolumeIcon.tsx
+++ b/design-system/packages/icons/src/icons/VolumeIcon.tsx
@@ -1,6 +1,6 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const VolumeIcon = createIcon(
,
'VolumeIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/VolumeXIcon.tsx b/design-system/packages/icons/src/icons/VolumeXIcon.tsx
index 9d5b330a325..89c0541714c 100644
--- a/design-system/packages/icons/src/icons/VolumeXIcon.tsx
+++ b/design-system/packages/icons/src/icons/VolumeXIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const VolumeXIcon = createIcon(
@@ -7,4 +7,4 @@ export const VolumeXIcon = createIcon(
,
'VolumeXIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/WatchIcon.tsx b/design-system/packages/icons/src/icons/WatchIcon.tsx
index 0f936a53d7e..6697005ebfe 100644
--- a/design-system/packages/icons/src/icons/WatchIcon.tsx
+++ b/design-system/packages/icons/src/icons/WatchIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const WatchIcon = createIcon(
@@ -7,4 +7,4 @@ export const WatchIcon = createIcon(
,
'WatchIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/WifiIcon.tsx b/design-system/packages/icons/src/icons/WifiIcon.tsx
index 8a75b0f68ef..a8db49059b8 100644
--- a/design-system/packages/icons/src/icons/WifiIcon.tsx
+++ b/design-system/packages/icons/src/icons/WifiIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const WifiIcon = createIcon(
@@ -8,4 +8,4 @@ export const WifiIcon = createIcon(
,
'WifiIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/WifiOffIcon.tsx b/design-system/packages/icons/src/icons/WifiOffIcon.tsx
index e2a60296bab..ff01db20e69 100644
--- a/design-system/packages/icons/src/icons/WifiOffIcon.tsx
+++ b/design-system/packages/icons/src/icons/WifiOffIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const WifiOffIcon = createIcon(
@@ -11,4 +11,4 @@ export const WifiOffIcon = createIcon(
,
'WifiOffIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/WindIcon.tsx b/design-system/packages/icons/src/icons/WindIcon.tsx
index 34600d19137..8c63d4a4cf2 100644
--- a/design-system/packages/icons/src/icons/WindIcon.tsx
+++ b/design-system/packages/icons/src/icons/WindIcon.tsx
@@ -1,6 +1,6 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const WindIcon = createIcon(
,
'WindIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/XCircleIcon.tsx b/design-system/packages/icons/src/icons/XCircleIcon.tsx
index 61d47905805..e5172d475c1 100644
--- a/design-system/packages/icons/src/icons/XCircleIcon.tsx
+++ b/design-system/packages/icons/src/icons/XCircleIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const XCircleIcon = createIcon(
@@ -7,4 +7,4 @@ export const XCircleIcon = createIcon(
,
'XCircleIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/XIcon.tsx b/design-system/packages/icons/src/icons/XIcon.tsx
index 50121debd95..0c12ba2a9dc 100644
--- a/design-system/packages/icons/src/icons/XIcon.tsx
+++ b/design-system/packages/icons/src/icons/XIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const XIcon = createIcon(
,
'XIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/XOctagonIcon.tsx b/design-system/packages/icons/src/icons/XOctagonIcon.tsx
index 94e683aa6e4..10be64df92f 100644
--- a/design-system/packages/icons/src/icons/XOctagonIcon.tsx
+++ b/design-system/packages/icons/src/icons/XOctagonIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const XOctagonIcon = createIcon(
@@ -7,4 +7,4 @@ export const XOctagonIcon = createIcon(
,
'XOctagonIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/XSquareIcon.tsx b/design-system/packages/icons/src/icons/XSquareIcon.tsx
index c024e61440e..91d2f010e2a 100644
--- a/design-system/packages/icons/src/icons/XSquareIcon.tsx
+++ b/design-system/packages/icons/src/icons/XSquareIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const XSquareIcon = createIcon(
@@ -7,4 +7,4 @@ export const XSquareIcon = createIcon(
,
'XSquareIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/YoutubeIcon.tsx b/design-system/packages/icons/src/icons/YoutubeIcon.tsx
index 5acf1397a1a..fd6019b8957 100644
--- a/design-system/packages/icons/src/icons/YoutubeIcon.tsx
+++ b/design-system/packages/icons/src/icons/YoutubeIcon.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const YoutubeIcon = createIcon(
,
'YoutubeIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/ZapIcon.tsx b/design-system/packages/icons/src/icons/ZapIcon.tsx
index 5f9d2949660..363168a1a40 100644
--- a/design-system/packages/icons/src/icons/ZapIcon.tsx
+++ b/design-system/packages/icons/src/icons/ZapIcon.tsx
@@ -1,6 +1,6 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const ZapIcon = createIcon(
,
'ZapIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/ZapOffIcon.tsx b/design-system/packages/icons/src/icons/ZapOffIcon.tsx
index b537d2aa77f..63707297467 100644
--- a/design-system/packages/icons/src/icons/ZapOffIcon.tsx
+++ b/design-system/packages/icons/src/icons/ZapOffIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const ZapOffIcon = createIcon(
@@ -8,4 +8,4 @@ export const ZapOffIcon = createIcon(
,
'ZapOffIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/ZoomInIcon.tsx b/design-system/packages/icons/src/icons/ZoomInIcon.tsx
index ff3c3b8123f..2fb09be15a4 100644
--- a/design-system/packages/icons/src/icons/ZoomInIcon.tsx
+++ b/design-system/packages/icons/src/icons/ZoomInIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const ZoomInIcon = createIcon(
@@ -8,4 +8,4 @@ export const ZoomInIcon = createIcon(
,
'ZoomInIcon'
-);
+)
diff --git a/design-system/packages/icons/src/icons/ZoomOutIcon.tsx b/design-system/packages/icons/src/icons/ZoomOutIcon.tsx
index b9bb37f392e..f59d4296621 100644
--- a/design-system/packages/icons/src/icons/ZoomOutIcon.tsx
+++ b/design-system/packages/icons/src/icons/ZoomOutIcon.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
-import { createIcon } from '../Icon';
+import * as React from 'react'
+import { createIcon } from '../Icon'
export const ZoomOutIcon = createIcon(
@@ -7,4 +7,4 @@ export const ZoomOutIcon = createIcon(
,
'ZoomOutIcon'
-);
+)
diff --git a/design-system/packages/icons/src/index.tsx b/design-system/packages/icons/src/index.tsx
index 67913d8a881..7105310a048 100644
--- a/design-system/packages/icons/src/index.tsx
+++ b/design-system/packages/icons/src/index.tsx
@@ -1,288 +1,288 @@
-export type { IconProps } from './Icon';
+export type { IconProps } from './Icon'
-export { ActivityIcon } from './icons/ActivityIcon';
-export { AirplayIcon } from './icons/AirplayIcon';
-export { AlertOctagonIcon } from './icons/AlertOctagonIcon';
-export { AlignCenterIcon } from './icons/AlignCenterIcon';
-export { AlertTriangleIcon } from './icons/AlertTriangleIcon';
-export { AlignJustifyIcon } from './icons/AlignJustifyIcon';
-export { ApertureIcon } from './icons/ApertureIcon';
-export { AlignLeftIcon } from './icons/AlignLeftIcon';
-export { AnchorIcon } from './icons/AnchorIcon';
-export { AlignRightIcon } from './icons/AlignRightIcon';
-export { ArchiveIcon } from './icons/ArchiveIcon';
-export { ArrowDownCircleIcon } from './icons/ArrowDownCircleIcon';
-export { ArrowLeftCircleIcon } from './icons/ArrowLeftCircleIcon';
-export { ArrowRightCircleIcon } from './icons/ArrowRightCircleIcon';
-export { ArrowRightIcon } from './icons/ArrowRightIcon';
-export { ArrowDownRightIcon } from './icons/ArrowDownRightIcon';
-export { ArrowLeftIcon } from './icons/ArrowLeftIcon';
-export { AtSignIcon } from './icons/AtSignIcon';
-export { AwardIcon } from './icons/AwardIcon';
-export { BarChart2Icon } from './icons/BarChart2Icon';
-export { ArrowUpLeftIcon } from './icons/ArrowUpLeftIcon';
-export { ArrowUpRightIcon } from './icons/ArrowUpRightIcon';
-export { ArrowUpIcon } from './icons/ArrowUpIcon';
-export { ArrowUpCircleIcon } from './icons/ArrowUpCircleIcon';
-export { BatteryIcon } from './icons/BatteryIcon';
-export { BarChartIcon } from './icons/BarChartIcon';
-export { BellIcon } from './icons/BellIcon';
-export { BellOffIcon } from './icons/BellOffIcon';
-export { BatteryChargingIcon } from './icons/BatteryChargingIcon';
-export { BluetoothIcon } from './icons/BluetoothIcon';
-export { BookOpenIcon } from './icons/BookOpenIcon';
-export { BookIcon } from './icons/BookIcon';
-export { BoxIcon } from './icons/BoxIcon';
-export { BoldIcon } from './icons/BoldIcon';
-export { CameraOffIcon } from './icons/CameraOffIcon';
-export { BriefcaseIcon } from './icons/BriefcaseIcon';
-export { BookmarkIcon } from './icons/BookmarkIcon';
-export { CameraIcon } from './icons/CameraIcon';
-export { CalendarIcon } from './icons/CalendarIcon';
-export { CastIcon } from './icons/CastIcon';
-export { CheckCircleIcon } from './icons/CheckCircleIcon';
-export { CheckSquareIcon } from './icons/CheckSquareIcon';
-export { CheckIcon } from './icons/CheckIcon';
-export { ChevronLeftIcon } from './icons/ChevronLeftIcon';
-export { ChevronUpIcon } from './icons/ChevronUpIcon';
-export { ChevronRightIcon } from './icons/ChevronRightIcon';
-export { ChevronDownIcon } from './icons/ChevronDownIcon';
-export { ChevronsDownIcon } from './icons/ChevronsDownIcon';
-export { ChevronsUpIcon } from './icons/ChevronsUpIcon';
-export { ChevronsRightIcon } from './icons/ChevronsRightIcon';
-export { AlertCircleIcon } from './icons/AlertCircleIcon';
-export { ChromeIcon } from './icons/ChromeIcon';
-export { ClipboardIcon } from './icons/ClipboardIcon';
-export { ChevronsLeftIcon } from './icons/ChevronsLeftIcon';
-export { ClockIcon } from './icons/ClockIcon';
-export { CloudDrizzleIcon } from './icons/CloudDrizzleIcon';
-export { CloudSnowIcon } from './icons/CloudSnowIcon';
-export { ArrowDownIcon } from './icons/ArrowDownIcon';
-export { CloudRainIcon } from './icons/CloudRainIcon';
-export { CloudLightningIcon } from './icons/CloudLightningIcon';
-export { CloudIcon } from './icons/CloudIcon';
-export { CodeIcon } from './icons/CodeIcon';
-export { ColumnsIcon } from './icons/ColumnsIcon';
-export { CoffeeIcon } from './icons/CoffeeIcon';
-export { CodesandboxIcon } from './icons/CodesandboxIcon';
-export { CopyIcon } from './icons/CopyIcon';
-export { CodepenIcon } from './icons/CodepenIcon';
-export { CompassIcon } from './icons/CompassIcon';
-export { CommandIcon } from './icons/CommandIcon';
-export { CornerDownLeftIcon } from './icons/CornerDownLeftIcon';
-export { CornerDownRightIcon } from './icons/CornerDownRightIcon';
-export { CornerLeftDownIcon } from './icons/CornerLeftDownIcon';
-export { ArrowDownLeftIcon } from './icons/ArrowDownLeftIcon';
-export { CornerLeftUpIcon } from './icons/CornerLeftUpIcon';
-export { CornerRightDownIcon } from './icons/CornerRightDownIcon';
-export { CornerUpLeftIcon } from './icons/CornerUpLeftIcon';
-export { CreditCardIcon } from './icons/CreditCardIcon';
-export { CloudOffIcon } from './icons/CloudOffIcon';
-export { CornerUpRightIcon } from './icons/CornerUpRightIcon';
-export { CircleIcon } from './icons/CircleIcon';
-export { CrosshairIcon } from './icons/CrosshairIcon';
-export { DeleteIcon } from './icons/DeleteIcon';
-export { DatabaseIcon } from './icons/DatabaseIcon';
-export { DiscIcon } from './icons/DiscIcon';
-export { DivideCircleIcon } from './icons/DivideCircleIcon';
-export { DollarSignIcon } from './icons/DollarSignIcon';
-export { DivideSquareIcon } from './icons/DivideSquareIcon';
-export { DivideIcon } from './icons/DivideIcon';
-export { DownloadCloudIcon } from './icons/DownloadCloudIcon';
-export { DropletIcon } from './icons/DropletIcon';
-export { DribbbleIcon } from './icons/DribbbleIcon';
-export { ExternalLinkIcon } from './icons/ExternalLinkIcon';
-export { Edit3Icon } from './icons/Edit3Icon';
-export { DownloadIcon } from './icons/DownloadIcon';
-export { EditIcon } from './icons/EditIcon';
-export { Edit2Icon } from './icons/Edit2Icon';
-export { CpuIcon } from './icons/CpuIcon';
-export { FastForwardIcon } from './icons/FastForwardIcon';
-export { CropIcon } from './icons/CropIcon';
-export { FacebookIcon } from './icons/FacebookIcon';
-export { FigmaIcon } from './icons/FigmaIcon';
-export { FeatherIcon } from './icons/FeatherIcon';
-export { FileMinusIcon } from './icons/FileMinusIcon';
-export { FilePlusIcon } from './icons/FilePlusIcon';
-export { FileTextIcon } from './icons/FileTextIcon';
-export { FileIcon } from './icons/FileIcon';
-export { FilmIcon } from './icons/FilmIcon';
-export { FlagIcon } from './icons/FlagIcon';
-export { FilterIcon } from './icons/FilterIcon';
-export { FolderPlusIcon } from './icons/FolderPlusIcon';
-export { FolderIcon } from './icons/FolderIcon';
-export { FrownIcon } from './icons/FrownIcon';
-export { FolderMinusIcon } from './icons/FolderMinusIcon';
-export { GiftIcon } from './icons/GiftIcon';
-export { FramerIcon } from './icons/FramerIcon';
-export { GitBranchIcon } from './icons/GitBranchIcon';
-export { GitMergeIcon } from './icons/GitMergeIcon';
-export { EyeIcon } from './icons/EyeIcon';
-export { GlobeIcon } from './icons/GlobeIcon';
-export { GithubIcon } from './icons/GithubIcon';
-export { GitCommitIcon } from './icons/GitCommitIcon';
-export { HardDriveIcon } from './icons/HardDriveIcon';
-export { GitlabIcon } from './icons/GitlabIcon';
-export { GridIcon } from './icons/GridIcon';
-export { EyeOffIcon } from './icons/EyeOffIcon';
-export { GitPullRequestIcon } from './icons/GitPullRequestIcon';
-export { HeartIcon } from './icons/HeartIcon';
-export { HeadphonesIcon } from './icons/HeadphonesIcon';
-export { HexagonIcon } from './icons/HexagonIcon';
-export { HomeIcon } from './icons/HomeIcon';
-export { ImageIcon } from './icons/ImageIcon';
-export { InboxIcon } from './icons/InboxIcon';
-export { InfoIcon } from './icons/InfoIcon';
-export { InstagramIcon } from './icons/InstagramIcon';
-export { KeyIcon } from './icons/KeyIcon';
-export { HelpCircleIcon } from './icons/HelpCircleIcon';
-export { LayoutIcon } from './icons/LayoutIcon';
-export { LifeBuoyIcon } from './icons/LifeBuoyIcon';
-export { LayersIcon } from './icons/LayersIcon';
-export { LinkedinIcon } from './icons/LinkedinIcon';
-export { LinkIcon } from './icons/LinkIcon';
-export { ListIcon } from './icons/ListIcon';
-export { LoaderIcon } from './icons/LoaderIcon';
-export { LockIcon } from './icons/LockIcon';
-export { LogOutIcon } from './icons/LogOutIcon';
-export { Link2Icon } from './icons/Link2Icon';
-export { MapPinIcon } from './icons/MapPinIcon';
-export { MailIcon } from './icons/MailIcon';
-export { CornerRightUpIcon } from './icons/CornerRightUpIcon';
-export { MapIcon } from './icons/MapIcon';
-export { Maximize2Icon } from './icons/Maximize2Icon';
-export { MehIcon } from './icons/MehIcon';
-export { MaximizeIcon } from './icons/MaximizeIcon';
-export { MessageCircleIcon } from './icons/MessageCircleIcon';
-export { MessageSquareIcon } from './icons/MessageSquareIcon';
-export { MenuIcon } from './icons/MenuIcon';
-export { MicOffIcon } from './icons/MicOffIcon';
-export { MicIcon } from './icons/MicIcon';
-export { MinimizeIcon } from './icons/MinimizeIcon';
-export { MinusCircleIcon } from './icons/MinusCircleIcon';
-export { MinusSquareIcon } from './icons/MinusSquareIcon';
-export { Minimize2Icon } from './icons/Minimize2Icon';
-export { MinusIcon } from './icons/MinusIcon';
-export { MonitorIcon } from './icons/MonitorIcon';
-export { MoonIcon } from './icons/MoonIcon';
-export { MoreHorizontalIcon } from './icons/MoreHorizontalIcon';
-export { MoreVerticalIcon } from './icons/MoreVerticalIcon';
-export { MoveIcon } from './icons/MoveIcon';
-export { MousePointerIcon } from './icons/MousePointerIcon';
-export { MusicIcon } from './icons/MusicIcon';
-export { NavigationIcon } from './icons/NavigationIcon';
-export { PaperclipIcon } from './icons/PaperclipIcon';
-export { OctagonIcon } from './icons/OctagonIcon';
-export { Navigation2Icon } from './icons/Navigation2Icon';
-export { PauseIcon } from './icons/PauseIcon';
-export { PackageIcon } from './icons/PackageIcon';
-export { PauseCircleIcon } from './icons/PauseCircleIcon';
-export { PenToolIcon } from './icons/PenToolIcon';
-export { PercentIcon } from './icons/PercentIcon';
-export { PhoneForwardedIcon } from './icons/PhoneForwardedIcon';
-export { PhoneIncomingIcon } from './icons/PhoneIncomingIcon';
-export { PhoneOffIcon } from './icons/PhoneOffIcon';
-export { PhoneCallIcon } from './icons/PhoneCallIcon';
-export { PhoneIcon } from './icons/PhoneIcon';
-export { PhoneMissedIcon } from './icons/PhoneMissedIcon';
-export { PieChartIcon } from './icons/PieChartIcon';
-export { PhoneOutgoingIcon } from './icons/PhoneOutgoingIcon';
-export { PlayCircleIcon } from './icons/PlayCircleIcon';
-export { PlayIcon } from './icons/PlayIcon';
-export { PlusSquareIcon } from './icons/PlusSquareIcon';
-export { PocketIcon } from './icons/PocketIcon';
-export { HashIcon } from './icons/HashIcon';
-export { PlusCircleIcon } from './icons/PlusCircleIcon';
-export { PlusIcon } from './icons/PlusIcon';
-export { RefreshCwIcon } from './icons/RefreshCwIcon';
-export { RadioIcon } from './icons/RadioIcon';
-export { LogInIcon } from './icons/LogInIcon';
-export { RefreshCcwIcon } from './icons/RefreshCcwIcon';
-export { RepeatIcon } from './icons/RepeatIcon';
-export { RotateCcwIcon } from './icons/RotateCcwIcon';
-export { ItalicIcon } from './icons/ItalicIcon';
-export { PrinterIcon } from './icons/PrinterIcon';
-export { ServerIcon } from './icons/ServerIcon';
-export { SaveIcon } from './icons/SaveIcon';
-export { RewindIcon } from './icons/RewindIcon';
-export { ScissorsIcon } from './icons/ScissorsIcon';
-export { SearchIcon } from './icons/SearchIcon';
-export { SettingsIcon } from './icons/SettingsIcon';
-export { SendIcon } from './icons/SendIcon';
-export { ShareIcon } from './icons/ShareIcon';
-export { ShoppingBagIcon } from './icons/ShoppingBagIcon';
-export { ShoppingCartIcon } from './icons/ShoppingCartIcon';
-export { ShieldOffIcon } from './icons/ShieldOffIcon';
-export { Share2Icon } from './icons/Share2Icon';
-export { ShuffleIcon } from './icons/ShuffleIcon';
-export { SlackIcon } from './icons/SlackIcon';
-export { SidebarIcon } from './icons/SidebarIcon';
-export { ShieldIcon } from './icons/ShieldIcon';
-export { SkipBackIcon } from './icons/SkipBackIcon';
-export { SkipForwardIcon } from './icons/SkipForwardIcon';
-export { SmartphoneIcon } from './icons/SmartphoneIcon';
-export { SlashIcon } from './icons/SlashIcon';
-export { SlidersIcon } from './icons/SlidersIcon';
-export { SpeakerIcon } from './icons/SpeakerIcon';
-export { SmileIcon } from './icons/SmileIcon';
-export { SquareIcon } from './icons/SquareIcon';
-export { StarIcon } from './icons/StarIcon';
-export { RotateCwIcon } from './icons/RotateCwIcon';
-export { PowerIcon } from './icons/PowerIcon';
-export { TagIcon } from './icons/TagIcon';
-export { SunIcon } from './icons/SunIcon';
-export { TabletIcon } from './icons/TabletIcon';
-export { SunsetIcon } from './icons/SunsetIcon';
-export { TerminalIcon } from './icons/TerminalIcon';
-export { TargetIcon } from './icons/TargetIcon';
-export { ThermometerIcon } from './icons/ThermometerIcon';
-export { ThumbsDownIcon } from './icons/ThumbsDownIcon';
-export { ToggleLeftIcon } from './icons/ToggleLeftIcon';
-export { ThumbsUpIcon } from './icons/ThumbsUpIcon';
-export { ToolIcon } from './icons/ToolIcon';
-export { Trash2Icon } from './icons/Trash2Icon';
-export { ToggleRightIcon } from './icons/ToggleRightIcon';
-export { TrendingUpIcon } from './icons/TrendingUpIcon';
-export { TrendingDownIcon } from './icons/TrendingDownIcon';
-export { TrelloIcon } from './icons/TrelloIcon';
-export { TrashIcon } from './icons/TrashIcon';
-export { TriangleIcon } from './icons/TriangleIcon';
-export { TruckIcon } from './icons/TruckIcon';
-export { StopCircleIcon } from './icons/StopCircleIcon';
-export { SunriseIcon } from './icons/SunriseIcon';
-export { UnderlineIcon } from './icons/UnderlineIcon';
-export { TwitterIcon } from './icons/TwitterIcon';
-export { RssIcon } from './icons/RssIcon';
-export { UnlockIcon } from './icons/UnlockIcon';
-export { UploadCloudIcon } from './icons/UploadCloudIcon';
-export { UmbrellaIcon } from './icons/UmbrellaIcon';
-export { UserMinusIcon } from './icons/UserMinusIcon';
-export { UserCheckIcon } from './icons/UserCheckIcon';
-export { UploadIcon } from './icons/UploadIcon';
-export { UserPlusIcon } from './icons/UserPlusIcon';
-export { UserXIcon } from './icons/UserXIcon';
-export { UsersIcon } from './icons/UsersIcon';
-export { VoicemailIcon } from './icons/VoicemailIcon';
-export { UserIcon } from './icons/UserIcon';
-export { VideoIcon } from './icons/VideoIcon';
-export { WatchIcon } from './icons/WatchIcon';
-export { Volume2Icon } from './icons/Volume2Icon';
-export { VolumeIcon } from './icons/VolumeIcon';
-export { VideoOffIcon } from './icons/VideoOffIcon';
-export { WifiOffIcon } from './icons/WifiOffIcon';
-export { VolumeXIcon } from './icons/VolumeXIcon';
-export { WindIcon } from './icons/WindIcon';
-export { XOctagonIcon } from './icons/XOctagonIcon';
-export { XCircleIcon } from './icons/XCircleIcon';
-export { WifiIcon } from './icons/WifiIcon';
-export { YoutubeIcon } from './icons/YoutubeIcon';
-export { XSquareIcon } from './icons/XSquareIcon';
-export { XIcon } from './icons/XIcon';
-export { ZapOffIcon } from './icons/ZapOffIcon';
-export { TypeIcon } from './icons/TypeIcon';
-export { TwitchIcon } from './icons/TwitchIcon';
-export { ZapIcon } from './icons/ZapIcon';
-export { ZoomOutIcon } from './icons/ZoomOutIcon';
-export { TvIcon } from './icons/TvIcon';
-export { Volume1Icon } from './icons/Volume1Icon';
-export { ZoomInIcon } from './icons/ZoomInIcon';
+export { ActivityIcon } from './icons/ActivityIcon'
+export { AirplayIcon } from './icons/AirplayIcon'
+export { AlertOctagonIcon } from './icons/AlertOctagonIcon'
+export { AlignCenterIcon } from './icons/AlignCenterIcon'
+export { AlertTriangleIcon } from './icons/AlertTriangleIcon'
+export { AlignJustifyIcon } from './icons/AlignJustifyIcon'
+export { ApertureIcon } from './icons/ApertureIcon'
+export { AlignLeftIcon } from './icons/AlignLeftIcon'
+export { AnchorIcon } from './icons/AnchorIcon'
+export { AlignRightIcon } from './icons/AlignRightIcon'
+export { ArchiveIcon } from './icons/ArchiveIcon'
+export { ArrowDownCircleIcon } from './icons/ArrowDownCircleIcon'
+export { ArrowLeftCircleIcon } from './icons/ArrowLeftCircleIcon'
+export { ArrowRightCircleIcon } from './icons/ArrowRightCircleIcon'
+export { ArrowRightIcon } from './icons/ArrowRightIcon'
+export { ArrowDownRightIcon } from './icons/ArrowDownRightIcon'
+export { ArrowLeftIcon } from './icons/ArrowLeftIcon'
+export { AtSignIcon } from './icons/AtSignIcon'
+export { AwardIcon } from './icons/AwardIcon'
+export { BarChart2Icon } from './icons/BarChart2Icon'
+export { ArrowUpLeftIcon } from './icons/ArrowUpLeftIcon'
+export { ArrowUpRightIcon } from './icons/ArrowUpRightIcon'
+export { ArrowUpIcon } from './icons/ArrowUpIcon'
+export { ArrowUpCircleIcon } from './icons/ArrowUpCircleIcon'
+export { BatteryIcon } from './icons/BatteryIcon'
+export { BarChartIcon } from './icons/BarChartIcon'
+export { BellIcon } from './icons/BellIcon'
+export { BellOffIcon } from './icons/BellOffIcon'
+export { BatteryChargingIcon } from './icons/BatteryChargingIcon'
+export { BluetoothIcon } from './icons/BluetoothIcon'
+export { BookOpenIcon } from './icons/BookOpenIcon'
+export { BookIcon } from './icons/BookIcon'
+export { BoxIcon } from './icons/BoxIcon'
+export { BoldIcon } from './icons/BoldIcon'
+export { CameraOffIcon } from './icons/CameraOffIcon'
+export { BriefcaseIcon } from './icons/BriefcaseIcon'
+export { BookmarkIcon } from './icons/BookmarkIcon'
+export { CameraIcon } from './icons/CameraIcon'
+export { CalendarIcon } from './icons/CalendarIcon'
+export { CastIcon } from './icons/CastIcon'
+export { CheckCircleIcon } from './icons/CheckCircleIcon'
+export { CheckSquareIcon } from './icons/CheckSquareIcon'
+export { CheckIcon } from './icons/CheckIcon'
+export { ChevronLeftIcon } from './icons/ChevronLeftIcon'
+export { ChevronUpIcon } from './icons/ChevronUpIcon'
+export { ChevronRightIcon } from './icons/ChevronRightIcon'
+export { ChevronDownIcon } from './icons/ChevronDownIcon'
+export { ChevronsDownIcon } from './icons/ChevronsDownIcon'
+export { ChevronsUpIcon } from './icons/ChevronsUpIcon'
+export { ChevronsRightIcon } from './icons/ChevronsRightIcon'
+export { AlertCircleIcon } from './icons/AlertCircleIcon'
+export { ChromeIcon } from './icons/ChromeIcon'
+export { ClipboardIcon } from './icons/ClipboardIcon'
+export { ChevronsLeftIcon } from './icons/ChevronsLeftIcon'
+export { ClockIcon } from './icons/ClockIcon'
+export { CloudDrizzleIcon } from './icons/CloudDrizzleIcon'
+export { CloudSnowIcon } from './icons/CloudSnowIcon'
+export { ArrowDownIcon } from './icons/ArrowDownIcon'
+export { CloudRainIcon } from './icons/CloudRainIcon'
+export { CloudLightningIcon } from './icons/CloudLightningIcon'
+export { CloudIcon } from './icons/CloudIcon'
+export { CodeIcon } from './icons/CodeIcon'
+export { ColumnsIcon } from './icons/ColumnsIcon'
+export { CoffeeIcon } from './icons/CoffeeIcon'
+export { CodesandboxIcon } from './icons/CodesandboxIcon'
+export { CopyIcon } from './icons/CopyIcon'
+export { CodepenIcon } from './icons/CodepenIcon'
+export { CompassIcon } from './icons/CompassIcon'
+export { CommandIcon } from './icons/CommandIcon'
+export { CornerDownLeftIcon } from './icons/CornerDownLeftIcon'
+export { CornerDownRightIcon } from './icons/CornerDownRightIcon'
+export { CornerLeftDownIcon } from './icons/CornerLeftDownIcon'
+export { ArrowDownLeftIcon } from './icons/ArrowDownLeftIcon'
+export { CornerLeftUpIcon } from './icons/CornerLeftUpIcon'
+export { CornerRightDownIcon } from './icons/CornerRightDownIcon'
+export { CornerUpLeftIcon } from './icons/CornerUpLeftIcon'
+export { CreditCardIcon } from './icons/CreditCardIcon'
+export { CloudOffIcon } from './icons/CloudOffIcon'
+export { CornerUpRightIcon } from './icons/CornerUpRightIcon'
+export { CircleIcon } from './icons/CircleIcon'
+export { CrosshairIcon } from './icons/CrosshairIcon'
+export { DeleteIcon } from './icons/DeleteIcon'
+export { DatabaseIcon } from './icons/DatabaseIcon'
+export { DiscIcon } from './icons/DiscIcon'
+export { DivideCircleIcon } from './icons/DivideCircleIcon'
+export { DollarSignIcon } from './icons/DollarSignIcon'
+export { DivideSquareIcon } from './icons/DivideSquareIcon'
+export { DivideIcon } from './icons/DivideIcon'
+export { DownloadCloudIcon } from './icons/DownloadCloudIcon'
+export { DropletIcon } from './icons/DropletIcon'
+export { DribbbleIcon } from './icons/DribbbleIcon'
+export { ExternalLinkIcon } from './icons/ExternalLinkIcon'
+export { Edit3Icon } from './icons/Edit3Icon'
+export { DownloadIcon } from './icons/DownloadIcon'
+export { EditIcon } from './icons/EditIcon'
+export { Edit2Icon } from './icons/Edit2Icon'
+export { CpuIcon } from './icons/CpuIcon'
+export { FastForwardIcon } from './icons/FastForwardIcon'
+export { CropIcon } from './icons/CropIcon'
+export { FacebookIcon } from './icons/FacebookIcon'
+export { FigmaIcon } from './icons/FigmaIcon'
+export { FeatherIcon } from './icons/FeatherIcon'
+export { FileMinusIcon } from './icons/FileMinusIcon'
+export { FilePlusIcon } from './icons/FilePlusIcon'
+export { FileTextIcon } from './icons/FileTextIcon'
+export { FileIcon } from './icons/FileIcon'
+export { FilmIcon } from './icons/FilmIcon'
+export { FlagIcon } from './icons/FlagIcon'
+export { FilterIcon } from './icons/FilterIcon'
+export { FolderPlusIcon } from './icons/FolderPlusIcon'
+export { FolderIcon } from './icons/FolderIcon'
+export { FrownIcon } from './icons/FrownIcon'
+export { FolderMinusIcon } from './icons/FolderMinusIcon'
+export { GiftIcon } from './icons/GiftIcon'
+export { FramerIcon } from './icons/FramerIcon'
+export { GitBranchIcon } from './icons/GitBranchIcon'
+export { GitMergeIcon } from './icons/GitMergeIcon'
+export { EyeIcon } from './icons/EyeIcon'
+export { GlobeIcon } from './icons/GlobeIcon'
+export { GithubIcon } from './icons/GithubIcon'
+export { GitCommitIcon } from './icons/GitCommitIcon'
+export { HardDriveIcon } from './icons/HardDriveIcon'
+export { GitlabIcon } from './icons/GitlabIcon'
+export { GridIcon } from './icons/GridIcon'
+export { EyeOffIcon } from './icons/EyeOffIcon'
+export { GitPullRequestIcon } from './icons/GitPullRequestIcon'
+export { HeartIcon } from './icons/HeartIcon'
+export { HeadphonesIcon } from './icons/HeadphonesIcon'
+export { HexagonIcon } from './icons/HexagonIcon'
+export { HomeIcon } from './icons/HomeIcon'
+export { ImageIcon } from './icons/ImageIcon'
+export { InboxIcon } from './icons/InboxIcon'
+export { InfoIcon } from './icons/InfoIcon'
+export { InstagramIcon } from './icons/InstagramIcon'
+export { KeyIcon } from './icons/KeyIcon'
+export { HelpCircleIcon } from './icons/HelpCircleIcon'
+export { LayoutIcon } from './icons/LayoutIcon'
+export { LifeBuoyIcon } from './icons/LifeBuoyIcon'
+export { LayersIcon } from './icons/LayersIcon'
+export { LinkedinIcon } from './icons/LinkedinIcon'
+export { LinkIcon } from './icons/LinkIcon'
+export { ListIcon } from './icons/ListIcon'
+export { LoaderIcon } from './icons/LoaderIcon'
+export { LockIcon } from './icons/LockIcon'
+export { LogOutIcon } from './icons/LogOutIcon'
+export { Link2Icon } from './icons/Link2Icon'
+export { MapPinIcon } from './icons/MapPinIcon'
+export { MailIcon } from './icons/MailIcon'
+export { CornerRightUpIcon } from './icons/CornerRightUpIcon'
+export { MapIcon } from './icons/MapIcon'
+export { Maximize2Icon } from './icons/Maximize2Icon'
+export { MehIcon } from './icons/MehIcon'
+export { MaximizeIcon } from './icons/MaximizeIcon'
+export { MessageCircleIcon } from './icons/MessageCircleIcon'
+export { MessageSquareIcon } from './icons/MessageSquareIcon'
+export { MenuIcon } from './icons/MenuIcon'
+export { MicOffIcon } from './icons/MicOffIcon'
+export { MicIcon } from './icons/MicIcon'
+export { MinimizeIcon } from './icons/MinimizeIcon'
+export { MinusCircleIcon } from './icons/MinusCircleIcon'
+export { MinusSquareIcon } from './icons/MinusSquareIcon'
+export { Minimize2Icon } from './icons/Minimize2Icon'
+export { MinusIcon } from './icons/MinusIcon'
+export { MonitorIcon } from './icons/MonitorIcon'
+export { MoonIcon } from './icons/MoonIcon'
+export { MoreHorizontalIcon } from './icons/MoreHorizontalIcon'
+export { MoreVerticalIcon } from './icons/MoreVerticalIcon'
+export { MoveIcon } from './icons/MoveIcon'
+export { MousePointerIcon } from './icons/MousePointerIcon'
+export { MusicIcon } from './icons/MusicIcon'
+export { NavigationIcon } from './icons/NavigationIcon'
+export { PaperclipIcon } from './icons/PaperclipIcon'
+export { OctagonIcon } from './icons/OctagonIcon'
+export { Navigation2Icon } from './icons/Navigation2Icon'
+export { PauseIcon } from './icons/PauseIcon'
+export { PackageIcon } from './icons/PackageIcon'
+export { PauseCircleIcon } from './icons/PauseCircleIcon'
+export { PenToolIcon } from './icons/PenToolIcon'
+export { PercentIcon } from './icons/PercentIcon'
+export { PhoneForwardedIcon } from './icons/PhoneForwardedIcon'
+export { PhoneIncomingIcon } from './icons/PhoneIncomingIcon'
+export { PhoneOffIcon } from './icons/PhoneOffIcon'
+export { PhoneCallIcon } from './icons/PhoneCallIcon'
+export { PhoneIcon } from './icons/PhoneIcon'
+export { PhoneMissedIcon } from './icons/PhoneMissedIcon'
+export { PieChartIcon } from './icons/PieChartIcon'
+export { PhoneOutgoingIcon } from './icons/PhoneOutgoingIcon'
+export { PlayCircleIcon } from './icons/PlayCircleIcon'
+export { PlayIcon } from './icons/PlayIcon'
+export { PlusSquareIcon } from './icons/PlusSquareIcon'
+export { PocketIcon } from './icons/PocketIcon'
+export { HashIcon } from './icons/HashIcon'
+export { PlusCircleIcon } from './icons/PlusCircleIcon'
+export { PlusIcon } from './icons/PlusIcon'
+export { RefreshCwIcon } from './icons/RefreshCwIcon'
+export { RadioIcon } from './icons/RadioIcon'
+export { LogInIcon } from './icons/LogInIcon'
+export { RefreshCcwIcon } from './icons/RefreshCcwIcon'
+export { RepeatIcon } from './icons/RepeatIcon'
+export { RotateCcwIcon } from './icons/RotateCcwIcon'
+export { ItalicIcon } from './icons/ItalicIcon'
+export { PrinterIcon } from './icons/PrinterIcon'
+export { ServerIcon } from './icons/ServerIcon'
+export { SaveIcon } from './icons/SaveIcon'
+export { RewindIcon } from './icons/RewindIcon'
+export { ScissorsIcon } from './icons/ScissorsIcon'
+export { SearchIcon } from './icons/SearchIcon'
+export { SettingsIcon } from './icons/SettingsIcon'
+export { SendIcon } from './icons/SendIcon'
+export { ShareIcon } from './icons/ShareIcon'
+export { ShoppingBagIcon } from './icons/ShoppingBagIcon'
+export { ShoppingCartIcon } from './icons/ShoppingCartIcon'
+export { ShieldOffIcon } from './icons/ShieldOffIcon'
+export { Share2Icon } from './icons/Share2Icon'
+export { ShuffleIcon } from './icons/ShuffleIcon'
+export { SlackIcon } from './icons/SlackIcon'
+export { SidebarIcon } from './icons/SidebarIcon'
+export { ShieldIcon } from './icons/ShieldIcon'
+export { SkipBackIcon } from './icons/SkipBackIcon'
+export { SkipForwardIcon } from './icons/SkipForwardIcon'
+export { SmartphoneIcon } from './icons/SmartphoneIcon'
+export { SlashIcon } from './icons/SlashIcon'
+export { SlidersIcon } from './icons/SlidersIcon'
+export { SpeakerIcon } from './icons/SpeakerIcon'
+export { SmileIcon } from './icons/SmileIcon'
+export { SquareIcon } from './icons/SquareIcon'
+export { StarIcon } from './icons/StarIcon'
+export { RotateCwIcon } from './icons/RotateCwIcon'
+export { PowerIcon } from './icons/PowerIcon'
+export { TagIcon } from './icons/TagIcon'
+export { SunIcon } from './icons/SunIcon'
+export { TabletIcon } from './icons/TabletIcon'
+export { SunsetIcon } from './icons/SunsetIcon'
+export { TerminalIcon } from './icons/TerminalIcon'
+export { TargetIcon } from './icons/TargetIcon'
+export { ThermometerIcon } from './icons/ThermometerIcon'
+export { ThumbsDownIcon } from './icons/ThumbsDownIcon'
+export { ToggleLeftIcon } from './icons/ToggleLeftIcon'
+export { ThumbsUpIcon } from './icons/ThumbsUpIcon'
+export { ToolIcon } from './icons/ToolIcon'
+export { Trash2Icon } from './icons/Trash2Icon'
+export { ToggleRightIcon } from './icons/ToggleRightIcon'
+export { TrendingUpIcon } from './icons/TrendingUpIcon'
+export { TrendingDownIcon } from './icons/TrendingDownIcon'
+export { TrelloIcon } from './icons/TrelloIcon'
+export { TrashIcon } from './icons/TrashIcon'
+export { TriangleIcon } from './icons/TriangleIcon'
+export { TruckIcon } from './icons/TruckIcon'
+export { StopCircleIcon } from './icons/StopCircleIcon'
+export { SunriseIcon } from './icons/SunriseIcon'
+export { UnderlineIcon } from './icons/UnderlineIcon'
+export { TwitterIcon } from './icons/TwitterIcon'
+export { RssIcon } from './icons/RssIcon'
+export { UnlockIcon } from './icons/UnlockIcon'
+export { UploadCloudIcon } from './icons/UploadCloudIcon'
+export { UmbrellaIcon } from './icons/UmbrellaIcon'
+export { UserMinusIcon } from './icons/UserMinusIcon'
+export { UserCheckIcon } from './icons/UserCheckIcon'
+export { UploadIcon } from './icons/UploadIcon'
+export { UserPlusIcon } from './icons/UserPlusIcon'
+export { UserXIcon } from './icons/UserXIcon'
+export { UsersIcon } from './icons/UsersIcon'
+export { VoicemailIcon } from './icons/VoicemailIcon'
+export { UserIcon } from './icons/UserIcon'
+export { VideoIcon } from './icons/VideoIcon'
+export { WatchIcon } from './icons/WatchIcon'
+export { Volume2Icon } from './icons/Volume2Icon'
+export { VolumeIcon } from './icons/VolumeIcon'
+export { VideoOffIcon } from './icons/VideoOffIcon'
+export { WifiOffIcon } from './icons/WifiOffIcon'
+export { VolumeXIcon } from './icons/VolumeXIcon'
+export { WindIcon } from './icons/WindIcon'
+export { XOctagonIcon } from './icons/XOctagonIcon'
+export { XCircleIcon } from './icons/XCircleIcon'
+export { WifiIcon } from './icons/WifiIcon'
+export { YoutubeIcon } from './icons/YoutubeIcon'
+export { XSquareIcon } from './icons/XSquareIcon'
+export { XIcon } from './icons/XIcon'
+export { ZapOffIcon } from './icons/ZapOffIcon'
+export { TypeIcon } from './icons/TypeIcon'
+export { TwitchIcon } from './icons/TwitchIcon'
+export { ZapIcon } from './icons/ZapIcon'
+export { ZoomOutIcon } from './icons/ZoomOutIcon'
+export { TvIcon } from './icons/TvIcon'
+export { Volume1Icon } from './icons/Volume1Icon'
+export { ZoomInIcon } from './icons/ZoomInIcon'
diff --git a/design-system/packages/loading/src/Loading.tsx b/design-system/packages/loading/src/Loading.tsx
index 201af34c9a1..112e8d9dea0 100644
--- a/design-system/packages/loading/src/Loading.tsx
+++ b/design-system/packages/loading/src/Loading.tsx
@@ -1,9 +1,9 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx, keyframes, useTheme } from '@keystone-ui/core';
+import { jsx, keyframes, useTheme } from '@keystone-ui/core'
-export const loadingSizeValues = ['large', 'medium', 'small'] as const;
+export const loadingSizeValues = ['large', 'medium', 'small'] as const
export const loadingToneValues = [
'active',
'passive',
@@ -11,22 +11,22 @@ export const loadingToneValues = [
'warning',
'negative',
'help',
-] as const;
+] as const
-export type SizeKey = (typeof loadingSizeValues)[number];
-export type ToneKey = (typeof loadingToneValues)[number];
+export type SizeKey = (typeof loadingSizeValues)[number]
+export type ToneKey = (typeof loadingToneValues)[number]
// NOTE: a more accurate implementation might use `aria-busy="true|false"` on
// the wrapping element, but it's difficult to abstract
type Props = {
/** The aria-label for screen readers. */
- label: string;
+ label: string
/** The color of the loading indicator. */
- tone?: ToneKey;
+ tone?: ToneKey
/** The size of the loading indicator. */
- size?: SizeKey;
-};
+ size?: SizeKey
+}
// TODO: Should this be a box, to support margin etc?
@@ -36,11 +36,11 @@ export const LoadingDots = ({
size: sizeKey = 'medium',
...props
}: Props) => {
- const { controlSizes, tones } = useTheme();
+ const { controlSizes, tones } = useTheme()
- const size = controlSizes[sizeKey];
- const tone = toneKey ? tones[toneKey] : null;
- const color = tone ? tone.fill[0] : 'currentColor';
+ const size = controlSizes[sizeKey]
+ const tone = toneKey ? tones[toneKey] : null
+ const color = tone ? tone.fill[0] : 'currentColor'
return (
- );
-};
+ )
+}
const fadeAnimation = keyframes({
'0%, 80%, 100%': { opacity: 0 },
'40%': { opacity: 1 },
-});
+})
const Dot = ({ delay }: { delay: number }) => {
return (
@@ -82,5 +82,5 @@ const Dot = ({ delay }: { delay: number }) => {
},
}}
/>
- );
-};
+ )
+}
diff --git a/design-system/packages/loading/src/index.ts b/design-system/packages/loading/src/index.ts
index bc5115b2f8e..8e9305dfed9 100644
--- a/design-system/packages/loading/src/index.ts
+++ b/design-system/packages/loading/src/index.ts
@@ -1 +1 @@
-export * from './Loading';
+export * from './Loading'
diff --git a/design-system/packages/modals/src/AlertDialog.tsx b/design-system/packages/modals/src/AlertDialog.tsx
index 24b702336c0..c95a5bf22c7 100644
--- a/design-system/packages/modals/src/AlertDialog.tsx
+++ b/design-system/packages/modals/src/AlertDialog.tsx
@@ -1,26 +1,26 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { Button } from '@keystone-ui/button';
-import { jsx, Box, Heading, useTheme, makeId, useId } from '@keystone-ui/core';
-import { DialogBase } from './DialogBase';
+import { Button } from '@keystone-ui/button'
+import { jsx, Box, Heading, useTheme, makeId, useId } from '@keystone-ui/core'
+import { DialogBase } from './DialogBase'
type Action = {
- action: () => void;
- label: string;
-};
+ action: () => void
+ label: string
+}
type AlertDialogProps = {
actions: {
- cancel?: Action;
- confirm: Action & { loading?: boolean };
- };
- id?: string;
- isOpen: boolean;
- children: React.ReactNode;
- title: string;
- tone?: 'negative' | 'active';
-};
+ cancel?: Action
+ confirm: Action & { loading?: boolean }
+ }
+ id?: string
+ isOpen: boolean
+ children: React.ReactNode
+ title: string
+ tone?: 'negative' | 'active'
+}
export const AlertDialog = ({
actions,
@@ -30,18 +30,18 @@ export const AlertDialog = ({
id,
tone = 'active',
}: AlertDialogProps) => {
- const { cancel, confirm } = actions;
- const theme = useTheme();
- const instanceId = useId(id);
- const headingId = makeId('heading', instanceId);
+ const { cancel, confirm } = actions
+ const theme = useTheme()
+ const instanceId = useId(id)
+ const headingId = makeId('heading', instanceId)
const onClose = () => {
if (actions.cancel) {
- actions.cancel.action();
+ actions.cancel.action()
} else {
- actions.confirm.action();
+ actions.confirm.action()
}
- };
+ }
return (
@@ -76,5 +76,5 @@ export const AlertDialog = ({
- );
-};
+ )
+}
diff --git a/design-system/packages/modals/src/Blanket.tsx b/design-system/packages/modals/src/Blanket.tsx
index 26b1d478c0d..d51d3272ca6 100644
--- a/design-system/packages/modals/src/Blanket.tsx
+++ b/design-system/packages/modals/src/Blanket.tsx
@@ -1,15 +1,15 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { HTMLAttributes, forwardRef } from 'react';
-import { jsx, keyframes } from '@keystone-ui/core';
+import { type HTMLAttributes, forwardRef } from 'react'
+import { jsx, keyframes } from '@keystone-ui/core'
const fadeInAnim = keyframes({
from: {
opacity: 0,
},
-});
-const easing = 'cubic-bezier(0.2, 0, 0, 1)';
+})
+const easing = 'cubic-bezier(0.2, 0, 0, 1)'
export const Blanket = forwardRef>((props, ref) => {
return (
@@ -26,5 +26,5 @@ export const Blanket = forwardRef
}}
{...props}
/>
- );
-});
+ )
+})
diff --git a/design-system/packages/modals/src/DialogBase.tsx b/design-system/packages/modals/src/DialogBase.tsx
index 8c8bd6dd242..fa7d46f920e 100644
--- a/design-system/packages/modals/src/DialogBase.tsx
+++ b/design-system/packages/modals/src/DialogBase.tsx
@@ -1,36 +1,36 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { Fragment, KeyboardEvent, ReactNode } from 'react';
-import FocusLock from 'react-focus-lock';
-import { RemoveScroll } from 'react-remove-scroll';
-import { jsx, keyframes, Portal, useTheme } from '@keystone-ui/core';
-import { Blanket } from './Blanket';
+import { Fragment, type KeyboardEvent, type ReactNode } from 'react'
+import FocusLock from 'react-focus-lock'
+import { RemoveScroll } from 'react-remove-scroll'
+import { jsx, keyframes, Portal, useTheme } from '@keystone-ui/core'
+import { Blanket } from './Blanket'
type DialogBaseProps = {
- children: ReactNode;
- isOpen: boolean;
- onClose: () => void;
- width: number;
-};
+ children: ReactNode
+ isOpen: boolean
+ onClose: () => void
+ width: number
+}
const slideInAnim = keyframes({
from: {
transform: 'translateY(20%)',
opacity: 0,
},
-});
-const easing = 'cubic-bezier(0.2, 0, 0, 1)';
+})
+const easing = 'cubic-bezier(0.2, 0, 0, 1)'
export const DialogBase = ({ children, isOpen, onClose, width, ...props }: DialogBaseProps) => {
- const theme = useTheme();
+ const theme = useTheme()
const onKeyDown = (event: KeyboardEvent) => {
if (event.key === 'Escape' && !event.defaultPrevented) {
- event.preventDefault(); // Avoid potential drawer close
- onClose();
+ event.preventDefault() // Avoid potential drawer close
+ onClose()
}
- };
+ }
return isOpen ? (
@@ -73,5 +73,5 @@ export const DialogBase = ({ children, isOpen, onClose, width, ...props }: Dialo
- ) : null;
-};
+ ) : null
+}
diff --git a/design-system/packages/modals/src/Drawer.tsx b/design-system/packages/modals/src/Drawer.tsx
index cf67f15cd5c..02a77b7a90c 100644
--- a/design-system/packages/modals/src/Drawer.tsx
+++ b/design-system/packages/modals/src/Drawer.tsx
@@ -1,22 +1,22 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { MutableRefObject, ReactNode } from 'react';
-import { Button } from '@keystone-ui/button';
-import { jsx, makeId, useId, useTheme, Heading, Stack, Divider } from '@keystone-ui/core';
+import { type MutableRefObject, type ReactNode } from 'react'
+import { Button } from '@keystone-ui/button'
+import { jsx, makeId, useId, useTheme, Heading, Stack, Divider } from '@keystone-ui/core'
-import { DrawerBase, WidthType } from './DrawerBase';
-import { useDrawerControllerContext } from './DrawerController';
-import { ActionsType } from './types';
+import { DrawerBase, type WidthType } from './DrawerBase'
+import { useDrawerControllerContext } from './DrawerController'
+import { type ActionsType } from './types'
type DrawerProps = {
- actions: ActionsType;
- children: ReactNode;
- id?: string;
- initialFocusRef?: MutableRefObject;
- title: string;
- width?: WidthType;
-};
+ actions: ActionsType
+ children: ReactNode
+ id?: string
+ initialFocusRef?: MutableRefObject
+ title: string
+ width?: WidthType
+}
export const Drawer = ({
actions,
@@ -26,14 +26,14 @@ export const Drawer = ({
initialFocusRef,
width = 'narrow',
}: DrawerProps) => {
- const transitionState = useDrawerControllerContext();
- const { cancel, confirm } = actions;
- const { colors, spacing } = useTheme();
+ const transitionState = useDrawerControllerContext()
+ const { cancel, confirm } = actions
+ const { colors, spacing } = useTheme()
- const safeClose = actions.confirm.loading ? () => {} : actions.cancel.action;
+ const safeClose = actions.confirm.loading ? () => {} : actions.cancel.action
- const instanceId = useId(id);
- const headingId = makeId(instanceId, 'heading');
+ const instanceId = useId(id)
+ const headingId = makeId(instanceId, 'heading')
return (
- );
-};
+ )
+}
diff --git a/design-system/packages/modals/src/DrawerBase.tsx b/design-system/packages/modals/src/DrawerBase.tsx
index 1ac3360f1ba..3bcfa181c72 100644
--- a/design-system/packages/modals/src/DrawerBase.tsx
+++ b/design-system/packages/modals/src/DrawerBase.tsx
@@ -1,31 +1,31 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { Fragment, KeyboardEvent, MutableRefObject, ReactNode, useCallback, useRef } from 'react';
-import FocusLock from 'react-focus-lock';
-import { RemoveScroll } from 'react-remove-scroll';
-import { makeId, useId, useTheme, Portal, jsx } from '@keystone-ui/core';
-import { Blanket } from './Blanket';
+import { Fragment, type KeyboardEvent, type MutableRefObject, type ReactNode, useCallback, useRef } from 'react'
+import FocusLock from 'react-focus-lock'
+import { RemoveScroll } from 'react-remove-scroll'
+import { makeId, useId, useTheme, Portal, jsx } from '@keystone-ui/core'
+import { Blanket } from './Blanket'
-import { useDrawerManager } from './drawer-context';
-import { TransitionState } from './types';
-import { DrawerControllerContextProvider } from './DrawerController';
+import { useDrawerManager } from './drawer-context'
+import { type TransitionState } from './types'
+import { DrawerControllerContextProvider } from './DrawerController'
export const DRAWER_WIDTHS = {
narrow: 580,
wide: 740,
-};
-export type WidthType = keyof typeof DRAWER_WIDTHS;
-const easing = 'cubic-bezier(0.2, 0, 0, 1)';
+}
+export type WidthType = keyof typeof DRAWER_WIDTHS
+const easing = 'cubic-bezier(0.2, 0, 0, 1)'
export type DrawerBaseProps = {
- children: ReactNode;
- initialFocusRef?: MutableRefObject;
- onClose: () => void;
- transitionState: TransitionState;
- onSubmit?: () => void;
- width?: WidthType;
-};
+ children: ReactNode
+ initialFocusRef?: MutableRefObject
+ onClose: () => void
+ transitionState: TransitionState
+ onSubmit?: () => void
+ width?: WidthType
+}
const blanketTransition = {
entering: { opacity: 0 },
@@ -33,7 +33,7 @@ const blanketTransition = {
exiting: { opacity: 0 },
exited: { opacity: 0 },
unmounted: { opacity: 0 },
-};
+}
export const DrawerBase = ({
children,
@@ -44,42 +44,42 @@ export const DrawerBase = ({
transitionState,
...props
}: DrawerBaseProps) => {
- const theme = useTheme();
- const containerRef = useRef(null);
+ const theme = useTheme()
+ const containerRef = useRef(null)
- const id = useId();
- const uniqueKey = makeId('drawer', id);
+ const id = useId()
+ const uniqueKey = makeId('drawer', id)
// sync drawer state
- let drawerDepth = useDrawerManager(uniqueKey);
+ let drawerDepth = useDrawerManager(uniqueKey)
const onKeyDown = (event: KeyboardEvent) => {
if (event.key === 'Escape' && !event.defaultPrevented) {
- event.preventDefault();
- onClose();
+ event.preventDefault()
+ onClose()
}
- };
+ }
const activateFocusLock = useCallback(() => {
if (initialFocusRef && initialFocusRef.current) {
- initialFocusRef.current.focus();
+ initialFocusRef.current.focus()
}
- }, [initialFocusRef]);
+ }, [initialFocusRef])
- const dialogTransition = getDialogTransition(drawerDepth);
+ const dialogTransition = getDialogTransition(drawerDepth)
- let Tag: 'div' | 'form' = 'div';
+ let Tag: 'div' | 'form' = 'div'
if (onSubmit) {
- Tag = 'form';
- let oldOnSubmit = onSubmit;
- // @ts-ignore
+ Tag = 'form'
+ let oldOnSubmit = onSubmit
+ // @ts-expect-error
onSubmit = (event: any) => {
if (!event.defaultPrevented) {
- event.preventDefault();
- event.stopPropagation();
- oldOnSubmit();
+ event.preventDefault()
+ event.stopPropagation()
+ oldOnSubmit()
}
- };
+ }
}
return (
@@ -127,15 +127,15 @@ export const DrawerBase = ({
- );
-};
+ )
+}
// Utils
// ------------------------------
-function getDialogTransition(depth: number) {
- let scaleInc = 0.05;
- let transformValue = `scale(${1 - scaleInc * depth}) translateX(-${depth * 40}px)`;
+function getDialogTransition (depth: number) {
+ let scaleInc = 0.05
+ let transformValue = `scale(${1 - scaleInc * depth}) translateX(-${depth * 40}px)`
return {
entering: { transform: 'translateX(100%)' },
@@ -143,5 +143,5 @@ function getDialogTransition(depth: number) {
exiting: { transform: 'translateX(100%)' },
exited: { transform: 'translateX(100%)' },
unmounted: { transform: 'none' },
- };
+ }
}
diff --git a/design-system/packages/modals/src/DrawerController.tsx b/design-system/packages/modals/src/DrawerController.tsx
index 90436738694..2f8be1a53be 100644
--- a/design-system/packages/modals/src/DrawerController.tsx
+++ b/design-system/packages/modals/src/DrawerController.tsx
@@ -1,27 +1,27 @@
-import React, { ReactNode, useContext } from 'react';
-import { Transition } from 'react-transition-group';
+import React, { type ReactNode, useContext } from 'react'
+import { Transition } from 'react-transition-group'
-import { TransitionState } from './types';
+import { type TransitionState } from './types'
type DrawerControllerProps = {
- isOpen: boolean;
- children: ReactNode;
-};
+ isOpen: boolean
+ children: ReactNode
+}
-const DrawerControllerContext = React.createContext(null);
+const DrawerControllerContext = React.createContext(null)
-export const DrawerControllerContextProvider = DrawerControllerContext.Provider;
+export const DrawerControllerContextProvider = DrawerControllerContext.Provider
export const useDrawerControllerContext = () => {
- let context = useContext(DrawerControllerContext);
+ let context = useContext(DrawerControllerContext)
if (!context) {
throw new Error(
'Drawers must be wrapped in a . You should generally do this outside of the component that renders the or .'
- );
+ )
}
- return context;
-};
+ return context
+}
export const DrawerController = ({ isOpen, children }: DrawerControllerProps) => {
return (
@@ -32,5 +32,5 @@ export const DrawerController = ({ isOpen, children }: DrawerControllerProps) =>
)}
- );
-};
+ )
+}
diff --git a/design-system/packages/modals/src/drawer-context.tsx b/design-system/packages/modals/src/drawer-context.tsx
index e53e26cfc85..1b9c2f6b231 100644
--- a/design-system/packages/modals/src/drawer-context.tsx
+++ b/design-system/packages/modals/src/drawer-context.tsx
@@ -1,59 +1,59 @@
-import React, { ReactNode, useCallback, useEffect, useState } from 'react';
+import React, { type ReactNode, useCallback, useEffect, useState } from 'react'
export type ModalState = {
- drawerStack: string[];
- pushToDrawerStack: (drawerKey: string) => void;
- popFromDrawerStack: () => void;
-};
+ drawerStack: string[]
+ pushToDrawerStack: (drawerKey: string) => void
+ popFromDrawerStack: () => void
+}
-const ModalContext = React.createContext(null);
+const ModalContext = React.createContext(null)
export const DrawerProvider = ({ children }: { children: ReactNode }) => {
- let [drawerStack, setDrawerStack] = useState([]);
+ let [drawerStack, setDrawerStack] = useState([])
const pushToDrawerStack = useCallback((key: string) => {
- setDrawerStack(stack => [...stack, key]);
- }, []);
+ setDrawerStack(stack => [...stack, key])
+ }, [])
const popFromDrawerStack = useCallback(() => {
setDrawerStack(stack => {
- let less = stack.slice(0, -1);
- return less;
- });
- }, []);
+ let less = stack.slice(0, -1)
+ return less
+ })
+ }, [])
const context = {
drawerStack,
pushToDrawerStack,
popFromDrawerStack,
- };
+ }
- return {children} ;
-};
+ return {children}
+}
// Utils
// ------------------------------
export const useDrawerManager = (uniqueKey: string) => {
- const modalState = React.useContext(ModalContext);
+ const modalState = React.useContext(ModalContext)
if (modalState === null) {
throw new Error(
'This component must have a ancestor in the same React tree.'
- );
+ )
}
// keep the stack in sync on mount/unmount
useEffect(() => {
- modalState.pushToDrawerStack(uniqueKey);
+ modalState.pushToDrawerStack(uniqueKey)
return () => {
- modalState.popFromDrawerStack();
- };
+ modalState.popFromDrawerStack()
+ }
// eslint-disable-next-line react-hooks/exhaustive-deps
- }, []);
+ }, [])
// the last key in the array is the "top" modal visually, so the depth is the inverse index
// be careful not to mutate the stack
- let depth = modalState.drawerStack.slice().reverse().indexOf(uniqueKey);
+ let depth = modalState.drawerStack.slice().reverse().indexOf(uniqueKey)
// if it's not in the stack already,
// we know that it should be the last drawer in the stack but the effect hasn't happened yet
// so we need to make the depth 0 so the depth is correct even though the effect hasn't happened yet
- return depth === -1 ? 0 : depth;
-};
+ return depth === -1 ? 0 : depth
+}
diff --git a/design-system/packages/modals/src/index.tsx b/design-system/packages/modals/src/index.tsx
index 458d3a7e13d..927afc674e0 100644
--- a/design-system/packages/modals/src/index.tsx
+++ b/design-system/packages/modals/src/index.tsx
@@ -1,5 +1,5 @@
-export { Drawer } from './Drawer';
-export { DRAWER_WIDTHS } from './DrawerBase';
-export { DrawerProvider } from './drawer-context';
-export { DrawerController } from './DrawerController';
-export { AlertDialog } from './AlertDialog';
+export { Drawer } from './Drawer'
+export { DRAWER_WIDTHS } from './DrawerBase'
+export { DrawerProvider } from './drawer-context'
+export { DrawerController } from './DrawerController'
+export { AlertDialog } from './AlertDialog'
diff --git a/design-system/packages/modals/src/types.ts b/design-system/packages/modals/src/types.ts
index 7ace12b05d8..5d2d61ca49d 100644
--- a/design-system/packages/modals/src/types.ts
+++ b/design-system/packages/modals/src/types.ts
@@ -1,13 +1,13 @@
type Action = {
- action: () => void;
- label: string;
-};
+ action: () => void
+ label: string
+}
export type ActionsType = {
- cancel: Action;
+ cancel: Action
confirm: Action & {
- loading?: boolean;
- };
-};
+ loading?: boolean
+ }
+}
-export type TransitionState = 'entering' | 'entered' | 'exiting' | 'exited' | 'unmounted';
+export type TransitionState = 'entering' | 'entered' | 'exiting' | 'exited' | 'unmounted'
diff --git a/design-system/packages/notice/src/Notice.tsx b/design-system/packages/notice/src/Notice.tsx
index faf82fd4c8a..51885a81c3b 100644
--- a/design-system/packages/notice/src/Notice.tsx
+++ b/design-system/packages/notice/src/Notice.tsx
@@ -1,18 +1,18 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { ReactNode, useMemo } from 'react';
-import { jsx, makeId, useId, Stack, MarginProps, Box } from '@keystone-ui/core';
-import { AlertOctagonIcon } from '@keystone-ui/icons/icons/AlertOctagonIcon';
-import { AlertCircleIcon } from '@keystone-ui/icons/icons/AlertCircleIcon';
-import { AlertTriangleIcon } from '@keystone-ui/icons/icons/AlertTriangleIcon';
-import { CheckCircleIcon } from '@keystone-ui/icons/icons/CheckCircleIcon';
-import { InfoIcon } from '@keystone-ui/icons/icons/InfoIcon';
-import { HelpCircleIcon } from '@keystone-ui/icons/icons/HelpCircleIcon';
+import { type ReactNode, useMemo } from 'react'
+import { jsx, makeId, useId, Stack, type MarginProps, Box } from '@keystone-ui/core'
+import { AlertOctagonIcon } from '@keystone-ui/icons/icons/AlertOctagonIcon'
+import { AlertCircleIcon } from '@keystone-ui/icons/icons/AlertCircleIcon'
+import { AlertTriangleIcon } from '@keystone-ui/icons/icons/AlertTriangleIcon'
+import { CheckCircleIcon } from '@keystone-ui/icons/icons/CheckCircleIcon'
+import { InfoIcon } from '@keystone-ui/icons/icons/InfoIcon'
+import { HelpCircleIcon } from '@keystone-ui/icons/icons/HelpCircleIcon'
-import { Button, ButtonProvider } from '@keystone-ui/button';
-import { useNoticeStyles, useNoticeTokens, ToneKey } from './hooks/notice';
-import { useButtonTokens } from './hooks/button';
+import { Button, ButtonProvider } from '@keystone-ui/button'
+import { useNoticeStyles, useNoticeTokens, type ToneKey } from './hooks/notice'
+import { useButtonTokens } from './hooks/button'
const symbols: { [key in ToneKey]: ReactNode } = {
active: ,
@@ -21,22 +21,22 @@ const symbols: { [key in ToneKey]: ReactNode } = {
warning: ,
negative: ,
help: ,
-};
+}
type Action = {
- onPress: () => void;
- label: string;
-};
+ onPress: () => void
+ label: string
+}
type NoticeProps = {
actions?: {
- primary: Action;
- secondary?: Action;
- };
- children: ReactNode;
- tone?: ToneKey;
- title?: string;
- className?: string;
-} & MarginProps;
+ primary: Action
+ secondary?: Action
+ }
+ children: ReactNode
+ tone?: ToneKey
+ title?: string
+ className?: string
+} & MarginProps
export const Notice = ({
actions,
@@ -45,18 +45,18 @@ export const Notice = ({
title,
...otherProps
}: NoticeProps) => {
- const id = useId();
- const titleId = makeId('notice-title', id);
- const contentId = makeId('notice-content', id);
- const tokens = useNoticeTokens({ tone });
+ const id = useId()
+ const titleId = makeId('notice-title', id)
+ const contentId = makeId('notice-content', id)
+ const tokens = useNoticeTokens({ tone })
const styles = useNoticeStyles({
tokens,
- });
+ })
const buttonContext = useMemo(
() => ({ hooks: { useButtonTokens }, defaults: { tone, size: 'small' } } as const),
[tone]
- );
+ )
return (
@@ -99,5 +99,5 @@ export const Notice = ({
- );
-};
+ )
+}
diff --git a/design-system/packages/notice/src/hooks/button.ts b/design-system/packages/notice/src/hooks/button.ts
index 9f7841a25ca..662a5206a8c 100644
--- a/design-system/packages/notice/src/hooks/button.ts
+++ b/design-system/packages/notice/src/hooks/button.ts
@@ -1,14 +1,14 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { useTheme } from '@keystone-ui/core';
-import type { ButtonTokens, WeightKey, ToneKey, SizeKey } from '@keystone-ui/button';
+import { useTheme } from '@keystone-ui/core'
+import type { ButtonTokens, WeightKey, ToneKey, SizeKey } from '@keystone-ui/button'
type ButtonTokensProps = {
- size: SizeKey;
- tone: ToneKey;
- weight: WeightKey;
-};
+ size: SizeKey
+ tone: ToneKey
+ weight: WeightKey
+}
type Weight = Omit<
ButtonTokens,
@@ -20,16 +20,16 @@ type Weight = Omit<
| 'height'
| 'paddingX'
| 'transition'
->;
+>
-export function useButtonTokens({
+export function useButtonTokens ({
tone: toneKey,
size: sizeKey,
weight: weightKey,
}: ButtonTokensProps): ButtonTokens {
- const { animation, colors, tones, typography, controlSizes, opacity } = useTheme();
- const tone = tones[toneKey];
- const size = controlSizes[sizeKey];
+ const { animation, colors, tones, typography, controlSizes, opacity } = useTheme()
+ const tone = tones[toneKey]
+ const size = controlSizes[sizeKey]
const weights: { [key in WeightKey]: Weight } = {
bold: {
@@ -91,9 +91,9 @@ export function useButtonTokens({
textDecoration: 'underline',
},
},
- };
+ }
- const weight = weights[weightKey];
+ const weight = weights[weightKey]
const tokens: ButtonTokens = {
borderRadius: size.borderRadius,
@@ -110,7 +110,7 @@ export function useButtonTokens({
opacity ${animation.duration100},
`,
...weight,
- };
+ }
- return tokens;
+ return tokens
}
diff --git a/design-system/packages/notice/src/hooks/notice.ts b/design-system/packages/notice/src/hooks/notice.ts
index 26306109565..3e928c63149 100644
--- a/design-system/packages/notice/src/hooks/notice.ts
+++ b/design-system/packages/notice/src/hooks/notice.ts
@@ -1,4 +1,4 @@
-import { useTheme } from '@keystone-ui/core';
+import { useTheme } from '@keystone-ui/core'
export const noticeToneValues = [
'active',
@@ -7,37 +7,37 @@ export const noticeToneValues = [
'warning',
'negative',
'help',
-] as const;
+] as const
-export type ToneKey = (typeof noticeToneValues)[number];
+export type ToneKey = (typeof noticeToneValues)[number]
type NoticeTokensProps = {
- tone: ToneKey;
-};
+ tone: ToneKey
+}
export type NoticeTokens = {
- background?: string;
- borderColor?: string;
- borderRadius?: number;
- borderWidth?: number;
- fontSize?: number | string;
- fontWeight?: number;
- foreground?: string;
- gap: number;
- iconColor: string;
- paddingX?: number;
- paddingY?: number;
- shadow?: string;
+ background?: string
+ borderColor?: string
+ borderRadius?: number
+ borderWidth?: number
+ fontSize?: number | string
+ fontWeight?: number
+ foreground?: string
+ gap: number
+ iconColor: string
+ paddingX?: number
+ paddingY?: number
+ shadow?: string
title: {
- foreground: string;
- fontSize?: number | string;
- fontWeight?: number;
- };
-};
+ foreground: string
+ fontSize?: number | string
+ fontWeight?: number
+ }
+}
-export function useNoticeTokens({ tone: toneKey }: NoticeTokensProps): NoticeTokens {
- const { colors, radii, tones, typography, spacing } = useTheme();
- const tone = tones[toneKey];
+export function useNoticeTokens ({ tone: toneKey }: NoticeTokensProps): NoticeTokens {
+ const { colors, radii, tones, typography, spacing } = useTheme()
+ const tone = tones[toneKey]
const tokens: NoticeTokens = {
background: tone.tint[0],
@@ -56,19 +56,19 @@ export function useNoticeTokens({ tone: toneKey }: NoticeTokensProps): NoticeTok
fontSize: typography.fontSize.medium,
fontWeight: typography.fontWeight.medium,
},
- };
+ }
- return tokens;
+ return tokens
}
type NoticeStylesProps = {
- tokens: NoticeTokens;
-};
+ tokens: NoticeTokens
+}
-export function useNoticeStyles({ tokens }: NoticeStylesProps) {
+export function useNoticeStyles ({ tokens }: NoticeStylesProps) {
const actions = {
marginTop: tokens.gap,
- };
+ }
const box = {
backgroundColor: tokens.background,
@@ -82,19 +82,19 @@ export function useNoticeStyles({ tokens }: NoticeStylesProps) {
paddingRight: tokens.paddingX,
paddingTop: tokens.paddingY,
paddingBottom: tokens.paddingY,
- };
+ }
const title = {
color: tokens.title.foreground,
fontSize: tokens.title.fontSize,
fontWeight: tokens.title.fontWeight,
marginBottom: tokens.gap / 2,
- };
+ }
const symbol = {
color: tokens.iconColor,
marginRight: tokens.gap,
- };
+ }
- return { actions, box, title, symbol };
+ return { actions, box, title, symbol }
}
diff --git a/design-system/packages/notice/src/index.ts b/design-system/packages/notice/src/index.ts
index 1c54741b318..12ff61f8f13 100644
--- a/design-system/packages/notice/src/index.ts
+++ b/design-system/packages/notice/src/index.ts
@@ -1,2 +1,2 @@
-export * from './Notice';
-export * from './hooks/notice';
+export * from './Notice'
+export * from './hooks/notice'
diff --git a/design-system/packages/options/src/index.tsx b/design-system/packages/options/src/index.tsx
index 27c46b0ef36..90753edb18d 100644
--- a/design-system/packages/options/src/index.tsx
+++ b/design-system/packages/options/src/index.tsx
@@ -1,28 +1,28 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx, useTheme } from '@keystone-ui/core';
-import { useIndicatorTokens } from '@keystone-ui/fields';
-import { CheckIcon } from '@keystone-ui/icons/icons/CheckIcon';
-import { useMemo } from 'react';
+import { jsx, useTheme } from '@keystone-ui/core'
+import { useIndicatorTokens } from '@keystone-ui/fields'
+import { CheckIcon } from '@keystone-ui/icons/icons/CheckIcon'
+import { useMemo } from 'react'
import ReactSelect, {
- StylesConfig,
+ type StylesConfig,
components as reactSelectComponents,
- Props,
-} from 'react-select';
+ type Props,
+} from 'react-select'
export const CheckMark = ({
isDisabled,
isFocused,
isSelected,
}: {
- isDisabled?: boolean;
- isFocused?: boolean;
- isSelected?: boolean;
+ isDisabled?: boolean
+ isFocused?: boolean
+ isSelected?: boolean
}) => {
const tokens = useIndicatorTokens({
size: 'medium',
type: 'radio',
- });
+ })
return (
- );
-};
+ )
+}
export const OptionPrimitive: (typeof reactSelectComponents)['Option'] = ({
children,
@@ -83,7 +83,7 @@ export const OptionPrimitive: (typeof reactSelectComponents)['Option'] = ({
innerRef,
className,
}) => {
- const theme = useTheme();
+ const theme = useTheme()
return (
{children}
- );
-};
+ )
+}
const Control: (typeof reactSelectComponents)['Control'] = ({ selectProps, ...props }) => {
- return ;
-};
+ return
+}
const defaultComponents = {
Control,
Option: OptionPrimitive,
DropdownIndicator: null,
IndicatorSeparator: null,
-};
+}
-type OptionsProps = Props<{ label: string; value: string; isDisabled?: boolean }, boolean>;
+type OptionsProps = Props<{ label: string, value: string, isDisabled?: boolean }, boolean>
export const Options = ({ components: propComponents, ...props }: OptionsProps) => {
const components = useMemo(
@@ -140,10 +140,10 @@ export const Options = ({ components: propComponents, ...props }: OptionsProps)
...propComponents,
}),
[propComponents]
- );
- const theme = useTheme();
+ )
+ const theme = useTheme()
- const optionRendererStyles: StylesConfig<{ label: string; value: string; isDisabled?: boolean }> =
+ const optionRendererStyles: StylesConfig<{ label: string, value: string, isDisabled?: boolean }> =
useMemo(
() => ({
control: (provided: any) => ({
@@ -167,7 +167,7 @@ export const Options = ({ components: propComponents, ...props }: OptionsProps)
}),
}),
[theme]
- );
+ )
return (
- );
-};
+ )
+}
diff --git a/design-system/packages/pill/src/index.tsx b/design-system/packages/pill/src/index.tsx
index 547b132bfe2..bf66722e3cc 100644
--- a/design-system/packages/pill/src/index.tsx
+++ b/design-system/packages/pill/src/index.tsx
@@ -1,25 +1,25 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx, useTheme } from '@keystone-ui/core';
-import { ButtonHTMLAttributes, HTMLAttributes, forwardRef, ReactNode } from 'react';
+import { jsx, useTheme } from '@keystone-ui/core'
+import { type ButtonHTMLAttributes, type HTMLAttributes, forwardRef, type ReactNode } from 'react'
-import { XIcon } from '@keystone-ui/icons/icons/XIcon';
+import { XIcon } from '@keystone-ui/icons/icons/XIcon'
-type Tone = 'active' | 'passive' | 'positive' | 'warning' | 'negative' | 'help';
-type Weight = 'bold' | 'light';
+type Tone = 'active' | 'passive' | 'positive' | 'warning' | 'negative' | 'help'
+type Weight = 'bold' | 'light'
type PillButtonProps = {
- tone: Tone;
- weight: Weight;
-} & ButtonHTMLAttributes;
+ tone: Tone
+ weight: Weight
+} & ButtonHTMLAttributes
const PillButton = forwardRef(
({ tone: toneKey, weight, onClick, tabIndex, ...props }, ref) => {
- const { radii, spacing, tones, typography } = useTheme();
+ const { radii, spacing, tones, typography } = useTheme()
- const isInteractive = !!onClick;
+ const isInteractive = !!onClick
- const tone = tones[toneKey];
+ const tone = tones[toneKey]
const tokens = {
bold: {
background: tone.fill[0],
@@ -49,7 +49,7 @@ const PillButton = forwardRef(
background: tone.tint[2],
},
},
- }[weight];
+ }[weight]
const baseStyles = {
alignItems: 'center',
@@ -82,7 +82,7 @@ const PillButton = forwardRef(
paddingLeft: spacing.medium,
paddingRight: spacing.medium,
},
- } as const;
+ } as const
const interactiveStyles = isInteractive
? {
@@ -99,7 +99,7 @@ const PillButton = forwardRef(
color: tokens.active.foreground,
},
}
- : {};
+ : {}
return (
(
tabIndex={!isInteractive ? -1 : tabIndex}
{...props}
/>
- );
+ )
}
-);
+)
type PillProps = {
- children: ReactNode;
- onClick?: () => void;
- onRemove?: () => void;
- tone?: Tone;
- containerProps?: HTMLAttributes;
- weight?: Weight;
-} & HTMLAttributes;
+ children: ReactNode
+ onClick?: () => void
+ onRemove?: () => void
+ tone?: Tone
+ containerProps?: HTMLAttributes
+ weight?: Weight
+} & HTMLAttributes
export const Pill = forwardRef(
(
@@ -138,6 +138,6 @@ export const Pill = forwardRef(
) : null}
- );
+ )
}
-);
+)
diff --git a/design-system/packages/popover/src/Popover.tsx b/design-system/packages/popover/src/Popover.tsx
index 7f60dd82364..4f6a235c8cd 100644
--- a/design-system/packages/popover/src/Popover.tsx
+++ b/design-system/packages/popover/src/Popover.tsx
@@ -3,23 +3,23 @@
import {
Fragment,
- ReactElement,
- ReactNode,
- Ref,
+ type ReactElement,
+ type ReactNode,
+ type Ref,
forwardRef,
useEffect,
useState,
useRef,
useCallback,
- CSSProperties,
+ type CSSProperties,
useMemo,
-} from 'react';
-import * as focusTrapModule from 'focus-trap';
-import { Options, Placement } from '@popperjs/core';
-import { usePopper } from 'react-popper';
-import { jsx, Portal, useTheme } from '@keystone-ui/core';
+} from 'react'
+import * as focusTrapModule from 'focus-trap'
+import { type Options, type Placement } from '@popperjs/core'
+import { usePopper } from 'react-popper'
+import { jsx, Portal, useTheme } from '@keystone-ui/core'
-type AnchorElementType = HTMLAnchorElement | HTMLButtonElement | HTMLDivElement | HTMLSpanElement;
+type AnchorElementType = HTMLAnchorElement | HTMLButtonElement | HTMLDivElement | HTMLSpanElement
// Hooks
// ------------------------------
@@ -27,17 +27,17 @@ type AnchorElementType = HTMLAnchorElement | HTMLButtonElement | HTMLDivElement
// Generic Hook
type PopoverOptions = {
- handleClose: 'both' | 'mouse' | 'keyboard' | 'none';
-};
+ handleClose: 'both' | 'mouse' | 'keyboard' | 'none'
+}
export const useControlledPopover = (
- { isOpen, onClose }: { isOpen: boolean; onClose: () => void },
+ { isOpen, onClose }: { isOpen: boolean, onClose: () => void },
popperOptions: Partial = {},
popoverOptions: PopoverOptions = { handleClose: 'both' }
) => {
- const [anchorElement, setAnchorElement] = useState(null);
- const [popoverElement, setPopoverElement] = useState();
- const [arrowElement, setArrowElement] = useState();
+ const [anchorElement, setAnchorElement] = useState(null)
+ const [popoverElement, setPopoverElement] = useState()
+ const [arrowElement, setArrowElement] = useState()
const { styles, attributes, update } = usePopper(anchorElement, popoverElement, {
...popperOptions,
@@ -46,35 +46,35 @@ export const useControlledPopover = (
{ name: 'arrow', options: { element: arrowElement } },
{ name: 'eventListeners', options: { scroll: isOpen, resize: isOpen } },
],
- });
+ })
// update popper when it opens to get the latest placement
// useful for prerendered popovers in modals etc.
useEffect(() => {
if (update && isOpen) {
- update();
+ update()
}
- }, [isOpen, update]);
+ }, [isOpen, update])
// close on click outside
useClickOutside({
handler: () => onClose(),
elements: [anchorElement, popoverElement],
listenWhen: ['both', 'mouse'].includes(popoverOptions.handleClose) && isOpen,
- });
+ })
// close on esc press
useKeyPress({
targetKey: 'Escape',
downHandler: useCallback(
(event: KeyboardEvent) => {
- event.preventDefault(); // Avoid potential close of modal
- onClose();
+ event.preventDefault() // Avoid potential close of modal
+ onClose()
},
[onClose]
),
listenWhen: ['both', 'keyboard'].includes(popoverOptions.handleClose) && isOpen,
- });
+ })
return {
trigger: useMemo(
@@ -106,14 +106,14 @@ export const useControlledPopover = (
}),
[styles.arrow]
),
- };
-};
+ }
+}
export const usePopover = (
popperOptions: Partial = {},
popoverOptions: PopoverOptions = { handleClose: 'both' }
) => {
- const [isOpen, setOpen] = useState(false);
+ const [isOpen, setOpen] = useState(false)
return {
isOpen,
setOpen,
@@ -122,27 +122,27 @@ export const usePopover = (
popperOptions,
popoverOptions
),
- };
-};
+ }
+}
// Component
// ------------------------------
export type TriggerRendererOptions = {
- isOpen: boolean;
+ isOpen: boolean
triggerProps: {
- onClick: () => void;
- ref: Ref;
- };
-};
+ onClick: () => void
+ ref: Ref
+ }
+}
type Props = {
/** The content of the dialog. */
- children: ReactNode;
+ children: ReactNode
/** Where, in relation to the trigger, to place the dialog. */
- placement?: Placement;
+ placement?: Placement
/** The trigger element, which the dialog is bound to. */
- triggerRenderer: (options: TriggerRendererOptions) => ReactElement;
-};
+ triggerRenderer: (options: TriggerRendererOptions) => ReactElement
+}
export const Popover = ({ placement = 'bottom', triggerRenderer, ...props }: Props) => {
const { isOpen, setOpen, trigger, dialog, arrow } = usePopover({
@@ -155,7 +155,7 @@ export const Popover = ({ placement = 'bottom', triggerRenderer, ...props }: Pro
},
},
],
- });
+ })
return (
@@ -175,52 +175,52 @@ export const Popover = ({ placement = 'bottom', triggerRenderer, ...props }: Pro
{...props}
/>
- );
-};
+ )
+}
// Dialog
// ------------------------------
type DialogProps = {
/** The content of the dialog. */
- children: ReactNode;
+ children: ReactNode
/** When true, the popover will be visible. */
- isVisible: boolean;
+ isVisible: boolean
arrow: {
- ref: (element: HTMLDivElement) => void;
+ ref: (element: HTMLDivElement) => void
props: {
- style: CSSProperties;
- };
- };
-};
+ style: CSSProperties
+ }
+ }
+}
export const PopoverDialog = forwardRef(
({ isVisible, children, arrow, ...props }, consumerRef) => {
- const { elevation, radii, shadow, colors } = useTheme();
- const focusTrapRef = useRef(null);
- const focusTrap = useRef(null);
+ const { elevation, radii, shadow, colors } = useTheme()
+ const focusTrapRef = useRef(null)
+ const focusTrap = useRef(null)
useEffect(() => {
if (focusTrapRef.current) {
focusTrap.current = focusTrapModule.createFocusTrap(focusTrapRef.current, {
allowOutsideClick: true,
- });
+ })
}
- }, [focusTrapRef]);
+ }, [focusTrapRef])
useEffect(() => {
- const focusTrapInstance = focusTrap.current;
+ const focusTrapInstance = focusTrap.current
if (focusTrapInstance) {
if (isVisible) {
- focusTrapInstance.activate();
+ focusTrapInstance.activate()
return () => {
- focusTrapInstance.deactivate();
- };
+ focusTrapInstance.deactivate()
+ }
} else {
- focusTrapInstance.deactivate();
+ focusTrapInstance.deactivate()
}
}
- }, [isVisible, focusTrap]);
+ }, [isVisible, focusTrap])
return (
@@ -244,20 +244,20 @@ export const PopoverDialog = forwardRef(
{isVisible ? children : null}
- );
+ )
}
-);
+)
// TODO: maybe we should add an invisible blanket and have a regular react event listener on that instead of this?
// NOTE: mouse event handler defined here rather than imported from react becase
// the event listener will return a native event, not a synthetic event
-type MouseHandler = (event: MouseEvent) => void;
+type MouseHandler = (event: MouseEvent) => void
type UseClickOutsideProps = {
- handler: MouseHandler;
- elements: (HTMLElement | undefined | null)[];
- listenWhen: boolean;
-};
+ handler: MouseHandler
+ elements: (HTMLElement | undefined | null)[]
+ listenWhen: boolean
+}
const useClickOutside = ({ handler, elements, listenWhen }: UseClickOutsideProps) => {
useEffect(() => {
@@ -265,28 +265,28 @@ const useClickOutside = ({ handler, elements, listenWhen }: UseClickOutsideProps
let handleMouseDown = (event: MouseEvent) => {
// bail on mouse down "inside" any of the provided elements
if (elements.some(el => el && el.contains(event.target as Node))) {
- return;
+ return
}
- handler(event);
- };
- document.addEventListener('mousedown', handleMouseDown);
+ handler(event)
+ }
+ document.addEventListener('mousedown', handleMouseDown)
return () => {
- document.removeEventListener('mousedown', handleMouseDown);
- };
+ document.removeEventListener('mousedown', handleMouseDown)
+ }
}
- }, [handler, elements, listenWhen]);
-};
+ }, [handler, elements, listenWhen])
+}
-type KeyboardHandler = (event: KeyboardEvent) => void;
+type KeyboardHandler = (event: KeyboardEvent) => void
type UseKeyPressProps = {
- targetKey: string;
- targetElement?: HTMLElement | null;
- downHandler?: KeyboardHandler;
- upHandler?: KeyboardHandler;
- listenWhen: boolean;
-};
+ targetKey: string
+ targetElement?: HTMLElement | null
+ downHandler?: KeyboardHandler
+ upHandler?: KeyboardHandler
+ listenWhen: boolean
+}
const useKeyPress = ({
targetKey,
@@ -296,47 +296,47 @@ const useKeyPress = ({
listenWhen,
}: UseKeyPressProps) => {
// Keep track of whether the target key is pressed
- const [keyPressed, setKeyPressed] = useState(false);
+ const [keyPressed, setKeyPressed] = useState(false)
// add event listeners
useEffect(() => {
- let target = targetElement || document.body;
+ let target = targetElement || document.body
let onDown = (event: KeyboardEvent) => {
if (event.key === targetKey) {
- setKeyPressed(true);
+ setKeyPressed(true)
if (typeof downHandler === 'function') {
- downHandler(event);
+ downHandler(event)
}
}
- };
+ }
let onUp = (event: KeyboardEvent) => {
if (event.key === targetKey) {
- setKeyPressed(false);
+ setKeyPressed(false)
if (typeof upHandler === 'function') {
- upHandler(event);
+ upHandler(event)
}
}
- };
+ }
if (listenWhen) {
- target.addEventListener('keydown', onDown);
- target.addEventListener('keyup', onUp);
+ target.addEventListener('keydown', onDown)
+ target.addEventListener('keyup', onUp)
// Remove event listeners on cleanup
return () => {
- target.removeEventListener('keydown', onDown);
- target.removeEventListener('keyup', onUp);
- };
+ target.removeEventListener('keydown', onDown)
+ target.removeEventListener('keyup', onUp)
+ }
}
- }, [listenWhen, targetKey, downHandler, upHandler, targetElement]);
+ }, [listenWhen, targetKey, downHandler, upHandler, targetElement])
- return keyPressed;
-};
+ return keyPressed
+}
const useArrowStyles = () => {
- const theme = useTheme();
- const size = 16;
+ const theme = useTheme()
+ const size = 16
return {
'& [data-popper-arrow]': {
position: 'absolute',
@@ -384,5 +384,5 @@ const useArrowStyles = () => {
left: '50%',
},
},
- } as const;
-};
+ } as const
+}
diff --git a/design-system/packages/popover/src/index.ts b/design-system/packages/popover/src/index.ts
index 9ca249f8f7b..2d2e6a464c8 100644
--- a/design-system/packages/popover/src/index.ts
+++ b/design-system/packages/popover/src/index.ts
@@ -1,3 +1,3 @@
-export { usePopover, Popover, PopoverDialog, useControlledPopover } from './Popover';
-export type { Placement } from '@popperjs/core';
-export type { TriggerRendererOptions } from './Popover';
+export { usePopover, Popover, PopoverDialog, useControlledPopover } from './Popover'
+export type { Placement } from '@popperjs/core'
+export type { TriggerRendererOptions } from './Popover'
diff --git a/design-system/packages/segmented-control/src/SegmentedControl.tsx b/design-system/packages/segmented-control/src/SegmentedControl.tsx
index cc0a967cac7..0c78b4c1189 100644
--- a/design-system/packages/segmented-control/src/SegmentedControl.tsx
+++ b/design-system/packages/segmented-control/src/SegmentedControl.tsx
@@ -13,53 +13,53 @@
*/
import {
- ChangeEventHandler,
- HTMLAttributes,
- ReactNode,
+ type ChangeEventHandler,
+ type HTMLAttributes,
+ type ReactNode,
forwardRef,
useEffect,
useRef,
useState,
- InputHTMLAttributes,
-} from 'react';
+ type InputHTMLAttributes,
+} from 'react'
import {
Box,
- BoxProps,
+ type BoxProps,
jsx,
- ManagedChangeHandler,
+ type ManagedChangeHandler,
useId,
useTheme,
VisuallyHidden,
-} from '@keystone-ui/core';
+} from '@keystone-ui/core'
-import { SizeKey, WidthKey, useControlTokens } from './hooks/segmentedControl';
+import { type SizeKey, type WidthKey, useControlTokens } from './hooks/segmentedControl'
-type Index = number;
+type Index = number
// SegmentedControl
// ------------------------------
type SegmentedControlProps = {
/** Whether the selected control indicator should animate its movement. */
- animate?: boolean;
+ animate?: boolean
/** Whether the controls should take up the full width of their container. */
- fill?: boolean;
+ fill?: boolean
/** Function to be called when one of the segments is selected. */
- onChange: ManagedChangeHandler;
+ onChange: ManagedChangeHandler
/** Provide labels for each segment. */
- segments: string[];
+ segments: string[]
/** To Disable */
- isDisabled?: boolean;
+ isDisabled?: boolean
/** Marks the component as read only */
- isReadOnly?: boolean;
+ isReadOnly?: boolean
/** The the selected index of the segmented control. */
- selectedIndex: Index | undefined;
+ selectedIndex: Index | undefined
/** The size of the controls. */
- size?: SizeKey;
+ size?: SizeKey
/** The width of the controls. */
- width?: WidthKey;
-} & BoxProps;
+ width?: WidthKey
+} & BoxProps
export const SegmentedControl = ({
animate = false,
@@ -73,27 +73,27 @@ export const SegmentedControl = ({
selectedIndex,
...props
}: SegmentedControlProps) => {
- const rootRef = useRef(null);
- const [selectedRect, setSelectedRect] = useState({});
+ const rootRef = useRef(null)
+ const [selectedRect, setSelectedRect] = useState({})
// Because we use radio buttons for the segments, they should share a unique `name`
- const name = String(useId());
+ const name = String(useId())
// Animate the selected segment indicator
useEffect(() => {
if (animate && rootRef.current instanceof HTMLElement) {
- let nodes = Array.from(rootRef.current.children);
- let selected = selectedIndex !== undefined && nodes[selectedIndex];
- let rootRect;
- let nodeRect = { height: 0, width: 0, left: 0, top: 0 };
- let offsetLeft;
- let offsetTop;
+ let nodes = Array.from(rootRef.current.children)
+ let selected = selectedIndex !== undefined && nodes[selectedIndex]
+ let rootRect
+ let nodeRect = { height: 0, width: 0, left: 0, top: 0 }
+ let offsetLeft
+ let offsetTop
if (selected) {
- rootRect = rootRef.current.getBoundingClientRect();
- nodeRect = selected.getBoundingClientRect();
- offsetLeft = nodeRect.left - rootRect.left;
- offsetTop = nodeRect.top - rootRect.top;
+ rootRect = rootRef.current.getBoundingClientRect()
+ nodeRect = selected.getBoundingClientRect()
+ offsetLeft = nodeRect.left - rootRect.left
+ offsetTop = nodeRect.top - rootRect.top
}
setSelectedRect({
@@ -102,13 +102,13 @@ export const SegmentedControl = ({
left: 0,
top: 0,
transform: `translateX(${offsetLeft}px) translateY(${offsetTop}px)`,
- });
+ })
}
- }, [animate, selectedIndex]);
+ }, [animate, selectedIndex])
- const nothingIsSelected = selectedIndex === undefined;
+ const nothingIsSelected = selectedIndex === undefined
// do we want to mark the radio item as disabled?
- const actuallyDisabled = isDisabled || (isReadOnly && !nothingIsSelected);
+ const actuallyDisabled = isDisabled || (isReadOnly && !nothingIsSelected)
return (
@@ -120,7 +120,7 @@ export const SegmentedControl = ({
width={width}
>
{segments.map((label, idx) => {
- const isSelected = selectedIndex === idx;
+ const isSelected = selectedIndex === idx
return (
- {
- onChange(idx, event);
+ onChange(idx, event)
}}
size={size}
value={idx}
>
{label}
- );
+ )
})}
None Selected
@@ -157,21 +157,21 @@ export const SegmentedControl = ({
) : null}
- );
-};
+ )
+}
// Styled Components
// ------------------------------
type RootProps = {
- fill: boolean;
- size: SizeKey;
- width: WidthKey;
-} & HTMLAttributes;
+ fill: boolean
+ size: SizeKey
+ width: WidthKey
+} & HTMLAttributes
const Root = forwardRef(({ fill, size, width, ...props }, ref) => {
- const { colors } = useTheme();
- const tokens = useControlTokens({ size, width });
+ const { colors } = useTheme()
+ const tokens = useControlTokens({ size, width })
return (
(({ fill, size, width, ...prop
}}
{...props}
/>
- );
-});
+ )
+})
type BaseInputProps = {
- children: ReactNode;
- fill: boolean;
- isAnimated: boolean;
- isSelected: boolean;
- readOnly: boolean;
- onChange: ChangeEventHandler
;
- name: string;
- size: SizeKey;
- value: Index;
-};
+ children: ReactNode
+ fill: boolean
+ isAnimated: boolean
+ isSelected: boolean
+ readOnly: boolean
+ onChange: ChangeEventHandler
+ name: string
+ size: SizeKey
+ value: Index
+}
-type ItemProps = BaseInputProps & Omit, keyof BaseInputProps>;
+type ItemProps = BaseInputProps & Omit, keyof BaseInputProps>
const Item = (props: ItemProps) => {
const {
@@ -223,14 +223,14 @@ const Item = (props: ItemProps) => {
disabled,
readOnly,
...attrs
- } = props;
- const { colors, fields, typography } = useTheme();
- const sizeStyles = useItemSize();
- const selectedStyles = useSelectedStyles();
- const inputRef = useRef(null);
+ } = props
+ const { colors, fields, typography } = useTheme()
+ const sizeStyles = useItemSize()
+ const selectedStyles = useSelectedStyles()
+ const inputRef = useRef(null)
// do we want to mark the radio item as disabled?
- const isDisabled = disabled || (readOnly && !isSelected);
+ const isDisabled = disabled || (readOnly && !isSelected)
return (
{
/>
{children}
- );
-};
+ )
+}
-type IndicatorProps = { size: SizeKey } & HTMLAttributes;
+type IndicatorProps = { size: SizeKey } & HTMLAttributes
const SelectedIndicator = ({ size, ...props }: IndicatorProps) => {
- const sizeStyles = useItemSize();
- const selectedStyles = useSelectedStyles();
+ const sizeStyles = useItemSize()
+ const selectedStyles = useSelectedStyles()
return (
{
}}
{...props}
/>
- );
-};
+ )
+}
// Utils
// ------------------------------
const useItemSize = () => {
- const { spacing, typography, radii } = useTheme();
+ const { spacing, typography, radii } = useTheme()
return {
small: {
borderRadius: radii.xsmall,
@@ -335,12 +335,12 @@ const useItemSize = () => {
paddingBottom: spacing.medium,
paddingTop: spacing.medium,
},
- };
-};
+ }
+}
const useSelectedStyles = () => {
- const { colors } = useTheme();
+ const { colors } = useTheme()
return {
background: colors.background,
boxShadow: '0px 1px 4px rgba(45, 55, 72, 0.07);', // used to be shadow.s100
- };
-};
+ }
+}
diff --git a/design-system/packages/segmented-control/src/hooks/segmentedControl.ts b/design-system/packages/segmented-control/src/hooks/segmentedControl.ts
index a8510460098..01a097bc4b2 100644
--- a/design-system/packages/segmented-control/src/hooks/segmentedControl.ts
+++ b/design-system/packages/segmented-control/src/hooks/segmentedControl.ts
@@ -1,6 +1,6 @@
-import { useTheme } from '@keystone-ui/core';
+import { useTheme } from '@keystone-ui/core'
-export const segmentedControlSizeValues = ['large', 'medium', 'small'] as const;
+export const segmentedControlSizeValues = ['large', 'medium', 'small'] as const
// TODO: Move to theme.
export const widthMap = {
@@ -8,35 +8,35 @@ export const widthMap = {
medium: 256,
large: 512,
full: '100%',
-};
+}
-export type SizeKey = (typeof segmentedControlSizeValues)[number];
-export type WidthKey = 'small' | 'medium' | 'large' | 'full';
+export type SizeKey = (typeof segmentedControlSizeValues)[number]
+export type WidthKey = 'small' | 'medium' | 'large' | 'full'
export type ControlTokensProps = {
- size: SizeKey;
- width: WidthKey;
-};
+ size: SizeKey
+ width: WidthKey
+}
export type ControlTokens = {
- borderRadius: number | string;
- paddingX: number | string;
- paddingY: number | string;
- width: number | string;
-};
+ borderRadius: number | string
+ paddingX: number | string
+ paddingY: number | string
+ width: number | string
+}
export const useControlTokens = ({
size: sizeKey,
width: widthKey,
}: ControlTokensProps): ControlTokens => {
- const { controlSizes } = useTheme();
- const size = controlSizes[sizeKey];
- const width = widthMap[widthKey];
+ const { controlSizes } = useTheme()
+ const size = controlSizes[sizeKey]
+ const width = widthMap[widthKey]
return {
borderRadius: size.borderRadius,
paddingX: size.gutter,
paddingY: size.gutter,
width,
- };
-};
+ }
+}
-export const useItemTokens = () => {};
+export const useItemTokens = () => {}
diff --git a/design-system/packages/segmented-control/src/index.ts b/design-system/packages/segmented-control/src/index.ts
index efea3d34fec..44bd6215d6b 100644
--- a/design-system/packages/segmented-control/src/index.ts
+++ b/design-system/packages/segmented-control/src/index.ts
@@ -1 +1 @@
-export * from './SegmentedControl';
+export * from './SegmentedControl'
diff --git a/design-system/packages/toast/src/Toast.tsx b/design-system/packages/toast/src/Toast.tsx
index e852648a29b..eb400a8d7a1 100644
--- a/design-system/packages/toast/src/Toast.tsx
+++ b/design-system/packages/toast/src/Toast.tsx
@@ -1,22 +1,22 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { HTMLAttributes, ReactNode, forwardRef, useEffect, useMemo, useState } from 'react';
-import { jsx, keyframes, Portal, useTheme } from '@keystone-ui/core';
-import { AlertOctagonIcon } from '@keystone-ui/icons/icons/AlertOctagonIcon';
-import { AlertTriangleIcon } from '@keystone-ui/icons/icons/AlertTriangleIcon';
-import { CheckCircleIcon } from '@keystone-ui/icons/icons/CheckCircleIcon';
-import { InfoIcon } from '@keystone-ui/icons/icons/InfoIcon';
-import { XIcon } from '@keystone-ui/icons/icons/XIcon';
+import { type HTMLAttributes, type ReactNode, forwardRef, useEffect, useMemo, useState } from 'react'
+import { jsx, keyframes, Portal, useTheme } from '@keystone-ui/core'
+import { AlertOctagonIcon } from '@keystone-ui/icons/icons/AlertOctagonIcon'
+import { AlertTriangleIcon } from '@keystone-ui/icons/icons/AlertTriangleIcon'
+import { CheckCircleIcon } from '@keystone-ui/icons/icons/CheckCircleIcon'
+import { InfoIcon } from '@keystone-ui/icons/icons/InfoIcon'
+import { XIcon } from '@keystone-ui/icons/icons/XIcon'
-import { ToastContext } from './context';
-import { ToastProps, ToastPropsExact } from './types';
+import { ToastContext } from './context'
+import { type ToastProps, type ToastPropsExact } from './types'
// Provider
// ------------------------------
export const ToastProvider = ({ children }: { children: ReactNode }) => {
- const [toastStack, setToastStack] = useState
([]);
+ const [toastStack, setToastStack] = useState([])
const context = useMemo(
() => ({
@@ -24,29 +24,29 @@ export const ToastProvider = ({ children }: { children: ReactNode }) => {
setToastStack(currentStack => {
// only allow unique IDs in the toast stack
if (currentStack.some(toast => toast.id === options.id)) {
- console.error(`You cannot add more than one toast with the same id ("${options.id}").`);
- return currentStack;
+ console.error(`You cannot add more than one toast with the same id ("${options.id}").`)
+ return currentStack
}
// populate defaults and update state
- let toast = populateDefaults(options);
- return [...currentStack, toast];
- });
+ let toast = populateDefaults(options)
+ return [...currentStack, toast]
+ })
},
removeToast: (id: string) => {
- setToastStack(currentStack => currentStack.filter(t => t.id !== id));
+ setToastStack(currentStack => currentStack.filter(t => t.id !== id))
},
}),
[]
- );
+ )
return (
{children}
{toastStack.map((props: ToastPropsExact) => {
- const { id, message, preserve, title, tone } = props;
- const onDismiss = () => context.removeToast(id);
+ const { id, message, preserve, title, tone } = props
+ const onDismiss = () => context.removeToast(id)
return (
{
title={title}
tone={tone}
/>
- );
+ )
})}
- );
-};
+ )
+}
// Utils
// ------------------------------
-let idCount = -1;
-let genId = () => ++idCount;
-function populateDefaults(props: ToastProps): ToastPropsExact {
+let idCount = -1
+let genId = () => ++idCount
+function populateDefaults (props: ToastProps): ToastPropsExact {
return {
title: props.title,
message: props.message,
preserve: Boolean(props.preserve),
id: props.id || String(genId()),
tone: props.tone || 'help',
- };
+ }
}
// Styled Components
@@ -85,7 +85,7 @@ function populateDefaults(props: ToastProps): ToastPropsExact {
// Container
const ToastContainer = (props: HTMLAttributes) => {
- const { elevation, spacing } = useTheme();
+ const { elevation, spacing } = useTheme()
return (
@@ -100,54 +100,54 @@ const ToastContainer = (props: HTMLAttributes) => {
{...props}
/>
- );
-};
+ )
+}
// Element
-const AUTO_DISMISS_DURATION = 6000;
+const AUTO_DISMISS_DURATION = 6000
const slideInFrames = keyframes({
from: { transform: 'translateY(100%)' },
to: { transform: 'translateY(0)' },
-});
+})
type ToastElementProps = {
- onDismiss: () => void;
-} & Omit;
+ onDismiss: () => void
+} & Omit
export const ToastElement = forwardRef((props, ref) => {
- const { message, onDismiss, preserve, title, tone, ...rest } = props;
- const { radii, shadow, spacing, typography, sizing, tones } = useTheme();
+ const { message, onDismiss, preserve, title, tone, ...rest } = props
+ const { radii, shadow, spacing, typography, sizing, tones } = useTheme()
// auto-dismiss functionality
useEffect(() => {
if (!preserve) {
- const timer = setTimeout(onDismiss, AUTO_DISMISS_DURATION);
- return () => clearTimeout(timer);
+ const timer = setTimeout(onDismiss, AUTO_DISMISS_DURATION)
+ return () => clearTimeout(timer)
}
// this is not like other components because the consumer cannot update the props once they `addToast()`
// we intentionally only want this to be run when the toast element mounts/unmounts
// eslint-disable-next-line react-hooks/exhaustive-deps
- }, []);
+ }, [])
const iconElement = {
positive: ,
negative: ,
warning: ,
help: ,
- }[tone];
+ }[tone]
const backgroundColor = {
positive: tones.positive.fill[0],
negative: tones.negative.fill[0],
warning: tones.warning.fill[0],
help: tones.help.fill[0],
- }[tone];
+ }[tone]
const foregroundColor = {
positive: tones.positive.fillForeground[0],
negative: tones.negative.fillForeground[0],
warning: tones.warning.fillForeground[0],
help: tones.help.fillForeground[0],
- }[tone];
+ }[tone]
return (
((props
- );
-});
+ )
+})
diff --git a/design-system/packages/toast/src/context.tsx b/design-system/packages/toast/src/context.tsx
index 593d848c03e..88808704c06 100644
--- a/design-system/packages/toast/src/context.tsx
+++ b/design-system/packages/toast/src/context.tsx
@@ -1,19 +1,19 @@
-import { createContext, useContext } from 'react';
+import { createContext, useContext } from 'react'
-import { ToastProps } from './types';
+import { type ToastProps } from './types'
-function notInContext() {
- throw new Error('This component must be used inside a component.');
+function notInContext () {
+ throw new Error('This component must be used inside a component.')
}
type ContextType = {
- addToast: (props: ToastProps) => void;
- removeToast: (id: string) => void;
-};
+ addToast: (props: ToastProps) => void
+ removeToast: (id: string) => void
+}
export const ToastContext = createContext({
addToast: notInContext,
removeToast: notInContext,
-});
+})
-export const useToasts = () => useContext(ToastContext);
+export const useToasts = () => useContext(ToastContext)
diff --git a/design-system/packages/toast/src/index.tsx b/design-system/packages/toast/src/index.tsx
index 64fa82df3d8..2b815a7fd4c 100644
--- a/design-system/packages/toast/src/index.tsx
+++ b/design-system/packages/toast/src/index.tsx
@@ -1,2 +1,2 @@
-export { ToastProvider } from './Toast';
-export { useToasts } from './context';
+export { ToastProvider } from './Toast'
+export { useToasts } from './context'
diff --git a/design-system/packages/toast/src/types.ts b/design-system/packages/toast/src/types.ts
index 5e23635b2c4..920d33de9f4 100644
--- a/design-system/packages/toast/src/types.ts
+++ b/design-system/packages/toast/src/types.ts
@@ -1,14 +1,14 @@
-export type ToneTypes = 'positive' | 'negative' | 'warning' | 'help';
+export type ToneTypes = 'positive' | 'negative' | 'warning' | 'help'
type Common = {
- title: string;
- message?: string;
- tone: ToneTypes;
-};
+ title: string
+ message?: string
+ tone: ToneTypes
+}
type NeedResolution = {
- preserve: boolean;
- id: string;
-};
+ preserve: boolean
+ id: string
+}
-export type ToastProps = Common & Partial;
-export type ToastPropsExact = Common & NeedResolution;
+export type ToastProps = Common & Partial
+export type ToastPropsExact = Common & NeedResolution
diff --git a/design-system/packages/tooltip/src/Tooltip.tsx b/design-system/packages/tooltip/src/Tooltip.tsx
index 0f8e0a5d68e..3771b4261e9 100644
--- a/design-system/packages/tooltip/src/Tooltip.tsx
+++ b/design-system/packages/tooltip/src/Tooltip.tsx
@@ -2,45 +2,45 @@
/** @jsx jsx */
import {
- CSSProperties,
+ type CSSProperties,
Fragment,
- ReactElement,
- Ref,
+ type ReactElement,
+ type Ref,
forwardRef,
useEffect,
useRef,
memo,
useCallback,
useMemo,
- ReactNode,
-} from 'react';
-import { applyRefs } from 'apply-ref';
-import { jsx, useId, useTheme, Portal } from '@keystone-ui/core';
-import { usePopover } from '@keystone-ui/popover';
+ type ReactNode,
+} from 'react'
+import { applyRefs } from 'apply-ref'
+import { jsx, useId, useTheme, Portal } from '@keystone-ui/core'
+import { usePopover } from '@keystone-ui/popover'
-type Weights = 'bold' | 'subtle';
+type Weights = 'bold' | 'subtle'
type RenderProps = {
- onMouseEnter: () => void;
- onMouseLeave: () => void;
- onFocus: () => void;
- onBlur: () => void;
- 'aria-describedby': string | undefined;
- ref: Ref;
-};
+ onMouseEnter: () => void
+ onMouseLeave: () => void
+ onFocus: () => void
+ onBlur: () => void
+ 'aria-describedby': string | undefined
+ ref: Ref
+}
type Props = {
/** The target element. */
- children: (props: RenderProps) => ReactElement;
+ children: (props: RenderProps) => ReactElement
/** The content of the tooltip. */
- content: ReactNode;
+ content: ReactNode
/** Turn off, to maintain the tooltip when the user clicks the trigger element. */
- hideOnClick?: boolean;
+ hideOnClick?: boolean
/** Where, in relation to the target, to place the tooltip. */
- placement?: 'top' | 'right' | 'bottom' | 'left';
+ placement?: 'top' | 'right' | 'bottom' | 'left'
/** The visual weight of the tooltip. */
- weight?: Weights;
-};
+ weight?: Weights
+}
export const Tooltip = ({
children,
@@ -49,8 +49,8 @@ export const Tooltip = ({
placement = 'top',
weight = 'bold',
}: Props) => {
- const { spacing } = useTheme();
- const isBold = weight === 'bold';
+ const { spacing } = useTheme()
+ const isBold = weight === 'bold'
const { isOpen, setOpen, trigger, dialog, arrow } = usePopover({
placement,
@@ -62,23 +62,23 @@ export const Tooltip = ({
},
},
],
- });
+ })
- const tooltipId = useId();
- const showTooltip = useCallback(() => setOpen(true), [setOpen]);
- const hideTooltip = useCallback(() => setOpen(false), [setOpen]);
- const internalRef = useRef(null);
+ const tooltipId = useId()
+ const showTooltip = useCallback(() => setOpen(true), [setOpen])
+ const hideTooltip = useCallback(() => setOpen(false), [setOpen])
+ const internalRef = useRef(null)
// avoid overriding the consumer's `onClick` handler
useEffect(() => {
- const triggerEl = internalRef.current;
+ const triggerEl = internalRef.current
if (hideOnClick && triggerEl) {
- triggerEl.addEventListener('click', hideTooltip);
+ triggerEl.addEventListener('click', hideTooltip)
- return () => triggerEl.removeEventListener('click', hideTooltip);
+ return () => triggerEl.removeEventListener('click', hideTooltip)
}
- }, [isOpen, hideOnClick, hideTooltip]);
+ }, [isOpen, hideOnClick, hideTooltip])
return (
@@ -105,36 +105,36 @@ export const Tooltip = ({
{content}
- );
-};
+ )
+}
// Styled Component
// ------------------------------
type ElementProps = {
/** The content of the tooltip. */
- children: ReactNode;
+ children: ReactNode
/** ID used to describe the invoking element. */
- id?: string;
+ id?: string
/** When true, the tooltip will be visible. */
- isVisible: boolean;
+ isVisible: boolean
/** The visual weight of the tooltip. */
- weight: Weights;
+ weight: Weights
/** Popper's arrow config. */
arrow?: {
- ref: (element: HTMLDivElement) => void;
+ ref: (element: HTMLDivElement) => void
props: {
- style: CSSProperties;
- };
- };
-};
+ style: CSSProperties
+ }
+ }
+}
export const TooltipElement = memo(
forwardRef(
({ isVisible, children, arrow, weight, ...props }, consumerRef) => {
- const isBold = weight === 'bold';
- const { elevation, radii, colors, spacing, typography } = useTheme();
- const arrowStyles = useArrowStyles();
+ const isBold = weight === 'bold'
+ const { elevation, radii, colors, spacing, typography } = useTheme()
+ const arrowStyles = useArrowStyles()
return (
@@ -166,13 +166,13 @@ export const TooltipElement = memo(
)}
- );
+ )
}
)
-);
+)
const useArrowStyles = () => {
- const { colors } = useTheme();
+ const { colors } = useTheme()
return {
'.tooltipArrow': {
position: 'absolute',
@@ -219,5 +219,5 @@ const useArrowStyles = () => {
left: '50%',
},
},
- } as const;
-};
+ } as const
+}
diff --git a/design-system/packages/tooltip/src/index.ts b/design-system/packages/tooltip/src/index.ts
index b44d466fac2..1a0b4fb06d6 100644
--- a/design-system/packages/tooltip/src/index.ts
+++ b/design-system/packages/tooltip/src/index.ts
@@ -1 +1 @@
-export { Tooltip } from './Tooltip';
+export { Tooltip } from './Tooltip'
diff --git a/design-system/website/components/Code.tsx b/design-system/website/components/Code.tsx
index 3234b348d87..c41cc138ba7 100644
--- a/design-system/website/components/Code.tsx
+++ b/design-system/website/components/Code.tsx
@@ -1,11 +1,11 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { ReactNode } from 'react';
-import { jsx, useTheme } from '@keystone-ui/core';
+import { type ReactNode } from 'react'
+import { jsx, useTheme } from '@keystone-ui/core'
export const Code = ({ children }: { children: ReactNode }) => {
- const { palette, spacing, radii } = useTheme();
+ const { palette, spacing, radii } = useTheme()
return (
{
>
{children}
- );
-};
+ )
+}
diff --git a/design-system/website/components/Navigation.tsx b/design-system/website/components/Navigation.tsx
index 34ab74a6203..f93a7e9ea14 100644
--- a/design-system/website/components/Navigation.tsx
+++ b/design-system/website/components/Navigation.tsx
@@ -1,13 +1,13 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { Fragment, ReactNode } from 'react';
-import { jsx, useTheme } from '@keystone-ui/core';
-import Link from 'next/link';
-import { useRouter } from 'next/router';
+import { Fragment, type ReactNode } from 'react'
+import { jsx, useTheme } from '@keystone-ui/core'
+import Link from 'next/link'
+import { useRouter } from 'next/router'
const Brand = () => {
- const { palette } = useTheme();
+ const { palette } = useTheme()
return (
{
Keystone UI
- );
-};
+ )
+}
-type SectionProps = { label: string; children: ReactNode };
+type SectionProps = { label: string, children: ReactNode }
const Section = ({ label, children }: SectionProps) => {
return (
{label}
- );
-};
+ )
+}
-type NavItemProps = { href: string; children: ReactNode };
+type NavItemProps = { href: string, children: ReactNode }
const NavItem = ({ href, children }: NavItemProps) => {
- const { palette, radii, spacing } = useTheme();
- const router = useRouter();
- const isSelected = router.pathname === href;
+ const { palette, radii, spacing } = useTheme()
+ const router = useRouter()
+ const isSelected = router.pathname === href
return (
{
{children}
- );
-};
+ )
+}
export const Navigation = () => {
return (
@@ -95,5 +95,5 @@ export const Navigation = () => {
Toast
- );
-};
+ )
+}
diff --git a/design-system/website/components/Page.tsx b/design-system/website/components/Page.tsx
index 5e43a5ec3c2..8b0d03c6b92 100644
--- a/design-system/website/components/Page.tsx
+++ b/design-system/website/components/Page.tsx
@@ -1,19 +1,19 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import type { HTMLAttributes, ReactNode } from 'react';
-import { jsx, useTheme } from '@keystone-ui/core';
+import type { HTMLAttributes, ReactNode } from 'react'
+import { jsx, useTheme } from '@keystone-ui/core'
-import { Navigation } from './Navigation';
+import { Navigation } from './Navigation'
-const SIDEBAR_WIDTH = 320;
+const SIDEBAR_WIDTH = 320
const PageWrapper = (props: HTMLAttributes) => (
-);
+)
const Sidebar = (props: HTMLAttributes) => {
- const { palette, spacing } = useTheme();
+ const { palette, spacing } = useTheme()
return (
) => {
}}
{...props}
/>
- );
-};
+ )
+}
const Content = (props: HTMLAttributes) => {
- const { colors, spacing } = useTheme();
+ const { colors, spacing } = useTheme()
return (
) => {
}}
{...props}
/>
- );
-};
+ )
+}
export const Page = ({ children }: { children: ReactNode }) => {
return (
@@ -65,5 +65,5 @@ export const Page = ({ children }: { children: ReactNode }) => {
{children}
- );
-};
+ )
+}
diff --git a/design-system/website/components/ReadableColor.tsx b/design-system/website/components/ReadableColor.tsx
index b6682317433..f30921a98b7 100644
--- a/design-system/website/components/ReadableColor.tsx
+++ b/design-system/website/components/ReadableColor.tsx
@@ -1,20 +1,20 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import type { ReactNode } from 'react';
-import { jsx } from '@keystone-ui/core';
-import tinycolor from 'tinycolor2';
+import type { ReactNode } from 'react'
+import { jsx } from '@keystone-ui/core'
+import tinycolor from 'tinycolor2'
-const BLACK = '#000';
-const WHITE = '#fff';
+const BLACK = '#000'
+const WHITE = '#fff'
export const ReadableColor = ({
background,
children,
}: {
- background: string;
- children: ReactNode;
+ background: string
+ children: ReactNode
}) => {
- const color = tinycolor.isReadable(BLACK, background) ? BLACK : WHITE;
- return
{children} ;
-};
+ const color = tinycolor.isReadable(BLACK, background) ? BLACK : WHITE
+ return
{children}
+}
diff --git a/design-system/website/next.config.js b/design-system/website/next.config.js
index 540297b3877..6b7de94ff9b 100644
--- a/design-system/website/next.config.js
+++ b/design-system/website/next.config.js
@@ -1,4 +1,4 @@
// you don't need this if you're building something outside of the Keystone repo
-const withPreconstruct = require('@preconstruct/next');
+const withPreconstruct = require('@preconstruct/next')
-module.exports = withPreconstruct();
+module.exports = withPreconstruct()
diff --git a/design-system/website/pages/_app.tsx b/design-system/website/pages/_app.tsx
index 8e60ce318c0..b11319c3bbe 100644
--- a/design-system/website/pages/_app.tsx
+++ b/design-system/website/pages/_app.tsx
@@ -1,10 +1,10 @@
-import React from 'react';
-import { Core } from '@keystone-ui/core';
-import { DrawerProvider } from '@keystone-ui/modals';
-import { ToastProvider } from '@keystone-ui/toast';
-import type { AppProps } from 'next/app';
+import React from 'react'
+import { Core } from '@keystone-ui/core'
+import { DrawerProvider } from '@keystone-ui/modals'
+import { ToastProvider } from '@keystone-ui/toast'
+import type { AppProps } from 'next/app'
-export default function App({ Component, pageProps }: AppProps) {
+export default function App ({ Component, pageProps }: AppProps) {
return (
@@ -13,5 +13,5 @@ export default function App({ Component, pageProps }: AppProps) {
- );
+ )
}
diff --git a/design-system/website/pages/components/button.tsx b/design-system/website/pages/components/button.tsx
index 6e509f823c4..2da124980f4 100644
--- a/design-system/website/pages/components/button.tsx
+++ b/design-system/website/pages/components/button.tsx
@@ -1,32 +1,32 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx, Stack } from '@keystone-ui/core';
-import { Button, buttonToneValues, ToneKey, buttonWeightValues } from '@keystone-ui/button';
+import { jsx, Stack } from '@keystone-ui/core'
+import { Button, buttonToneValues, type ToneKey, buttonWeightValues } from '@keystone-ui/button'
-import { Page } from '../../components/Page';
-import { toLabel } from '../../utils';
+import { Page } from '../../components/Page'
+import { toLabel } from '../../utils'
const Variants = ({ tone }: { tone: ToneKey }) => {
- const toneLabel = toLabel(tone);
+ const toneLabel = toLabel(tone)
return (
{toneLabel} Tone
{buttonWeightValues.map(weight => {
- const weightLabel = toLabel(weight);
+ const weightLabel = toLabel(weight)
return (
{toneLabel} {weightLabel}
- );
+ )
})}
- );
-};
+ )
+}
-export default function ButtonPage() {
+export default function ButtonPage () {
return (
Button
@@ -95,5 +95,5 @@ export default function ButtonPage() {
- );
+ )
}
diff --git a/design-system/website/pages/components/fields.tsx b/design-system/website/pages/components/fields.tsx
index 07da4cc5a0f..f1228b4ab94 100644
--- a/design-system/website/pages/components/fields.tsx
+++ b/design-system/website/pages/components/fields.tsx
@@ -1,8 +1,8 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { ComponentProps, ReactNode, useState } from 'react';
-import { jsx, Stack, useTheme } from '@keystone-ui/core';
+import { type ComponentProps, type ReactNode, useState } from 'react'
+import { jsx, Stack, useTheme } from '@keystone-ui/core'
import {
Checkbox,
Radio,
@@ -11,14 +11,14 @@ import {
Switch,
Select,
DatePicker,
- DateType,
-} from '@keystone-ui/fields';
-import { SegmentedControl } from '@keystone-ui/segmented-control';
+ type DateType,
+} from '@keystone-ui/fields'
+import { SegmentedControl } from '@keystone-ui/segmented-control'
-import { Page } from '../../components/Page';
+import { Page } from '../../components/Page'
const FieldWrapper = ({ children }: { children: ReactNode }) => {
- const { spacing } = useTheme();
+ const { spacing } = useTheme()
return (
{
>
{children}
- );
-};
+ )
+}
const StatefulSwitch = ({ children, ...props }: ComponentProps
) => {
- const [checked, setChecked] = useState(false);
+ const [checked, setChecked] = useState(false)
return (
setChecked(!checked)} {...props}>
{children}
- );
-};
+ )
+}
const BasicDatePicker = () => {
- let [value, setValue] = useState('');
+ let [value, setValue] = useState('')
return (
{value || 'no value'}
setValue('')} value={value} />
- );
-};
+ )
+}
-export default function FieldsPage() {
- const { spacing } = useTheme();
- const [selectVal, setSelectVal] = useState<{ label: string; value: string } | null>(null);
- const [segmentedControlVal, setSegmentedControlVal] = useState(undefined);
+export default function FieldsPage () {
+ const { spacing } = useTheme()
+ const [selectVal, setSelectVal] = useState<{ label: string, value: string } | null>(null)
+ const [segmentedControlVal, setSegmentedControlVal] = useState(undefined)
return (
Form Fields
@@ -116,7 +116,7 @@ export default function FieldsPage() {
segments={['one', 'two', 'three']}
selectedIndex={segmentedControlVal}
onChange={val => {
- setSegmentedControlVal(val);
+ setSegmentedControlVal(val)
}}
/>
@@ -211,5 +211,5 @@ export default function FieldsPage() {
- );
+ )
}
diff --git a/design-system/website/pages/components/loading.tsx b/design-system/website/pages/components/loading.tsx
index 8a3638f0c47..5d769c1a1ff 100644
--- a/design-system/website/pages/components/loading.tsx
+++ b/design-system/website/pages/components/loading.tsx
@@ -1,14 +1,14 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { Fragment } from 'react';
-import { jsx, Box, Stack } from '@keystone-ui/core';
-import { LoadingDots, loadingToneValues } from '@keystone-ui/loading';
+import { Fragment } from 'react'
+import { jsx, Box, Stack } from '@keystone-ui/core'
+import { LoadingDots, loadingToneValues } from '@keystone-ui/loading'
-import { Page } from '../../components/Page';
-import { toLabel } from '../../utils';
+import { Page } from '../../components/Page'
+import { toLabel } from '../../utils'
-export default function LoadingPage() {
+export default function LoadingPage () {
return (
Notice
@@ -46,5 +46,5 @@ export default function LoadingPage() {
- );
+ )
}
diff --git a/design-system/website/pages/components/modals.tsx b/design-system/website/pages/components/modals.tsx
index da43afd59cb..52f1469474d 100644
--- a/design-system/website/pages/components/modals.tsx
+++ b/design-system/website/pages/components/modals.tsx
@@ -1,16 +1,16 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { useState } from 'react';
-import { jsx, Stack } from '@keystone-ui/core';
-import { Button } from '@keystone-ui/button';
-import { Drawer, DrawerController, AlertDialog } from '@keystone-ui/modals';
-import { Page } from '../../components/Page';
+import { useState } from 'react'
+import { jsx, Stack } from '@keystone-ui/core'
+import { Button } from '@keystone-ui/button'
+import { Drawer, DrawerController, AlertDialog } from '@keystone-ui/modals'
+import { Page } from '../../components/Page'
-export default function ModalsPage() {
- let [isNarrowOpen, setIsNarrowOpen] = useState(false);
- let [isWideOpen, setIsWideOpen] = useState(false);
- let [isAlertDialogOpen, setIsAlertDialogOpen] = useState(false);
+export default function ModalsPage () {
+ let [isNarrowOpen, setIsNarrowOpen] = useState(false)
+ let [isWideOpen, setIsWideOpen] = useState(false)
+ let [isAlertDialogOpen, setIsAlertDialogOpen] = useState(false)
return (
@@ -19,7 +19,7 @@ export default function ModalsPage() {
{
- setIsNarrowOpen(true);
+ setIsNarrowOpen(true)
}}
>
Open Narrow Drawer
@@ -27,7 +27,7 @@ export default function ModalsPage() {
{
- setIsWideOpen(true);
+ setIsWideOpen(true)
}}
>
Open Wide Drawer
@@ -35,7 +35,7 @@ export default function ModalsPage() {
{
- setIsAlertDialogOpen(true);
+ setIsAlertDialogOpen(true)
}}
>
Open Alert Dialog
@@ -92,5 +92,5 @@ export default function ModalsPage() {
content
- );
+ )
}
diff --git a/design-system/website/pages/components/notice.tsx b/design-system/website/pages/components/notice.tsx
index 2771491ea4e..d912abfd1a5 100644
--- a/design-system/website/pages/components/notice.tsx
+++ b/design-system/website/pages/components/notice.tsx
@@ -1,17 +1,17 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@keystone-ui/core';
-import { Notice, noticeToneValues } from '@keystone-ui/notice';
+import { jsx } from '@keystone-ui/core'
+import { Notice, noticeToneValues } from '@keystone-ui/notice'
-import { Page } from '../../components/Page';
-import { toLabel, aAn } from '../../utils';
+import { Page } from '../../components/Page'
+import { toLabel, aAn } from '../../utils'
-export default function ButtonPage() {
+export default function ButtonPage () {
const actions = {
primary: { label: 'Primary Action', onPress: () => undefined },
secondary: { label: 'Secondary Action', onPress: () => undefined },
- };
+ }
return (
Notice
@@ -31,5 +31,5 @@ export default function ButtonPage() {
))}
- );
+ )
}
diff --git a/design-system/website/pages/components/options.tsx b/design-system/website/pages/components/options.tsx
index 5afe207f008..74e89b927c9 100644
--- a/design-system/website/pages/components/options.tsx
+++ b/design-system/website/pages/components/options.tsx
@@ -1,11 +1,11 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@keystone-ui/core';
-import { Options, CheckMark } from '@keystone-ui/options';
-import { ComponentProps, useState } from 'react';
+import { jsx } from '@keystone-ui/core'
+import { Options, CheckMark } from '@keystone-ui/options'
+import { type ComponentProps, useState } from 'react'
-import { Page } from '../../components/Page';
+import { Page } from '../../components/Page'
const props: ComponentProps[] = [
{},
@@ -14,18 +14,18 @@ const props: ComponentProps[] = [
{ isDisabled: true, isSelected: true },
{ isFocused: true, isSelected: true },
{ isSelected: true },
-];
+]
-export default function OptionsPage() {
- let [value, setValue] = useState();
+export default function OptionsPage () {
+ let [value, setValue] = useState()
return (
Options
{
- console.log(value);
- setValue(value as { label: string; value: string });
+ console.log(value)
+ setValue(value as { label: string, value: string })
}}
options={[
{
@@ -62,5 +62,5 @@ export default function OptionsPage() {
))}
- );
+ )
}
diff --git a/design-system/website/pages/components/pill.tsx b/design-system/website/pages/components/pill.tsx
index 189c56cdaf7..0307313df23 100644
--- a/design-system/website/pages/components/pill.tsx
+++ b/design-system/website/pages/components/pill.tsx
@@ -1,14 +1,14 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { Stack, jsx } from '@keystone-ui/core';
-import { Pill } from '@keystone-ui/pill';
+import { Stack, jsx } from '@keystone-ui/core'
+import { Pill } from '@keystone-ui/pill'
-import { Page } from '../../components/Page';
+import { Page } from '../../components/Page'
-const toneValues = ['active', 'passive', 'positive', 'warning', 'negative', 'help'] as const;
+const toneValues = ['active', 'passive', 'positive', 'warning', 'negative', 'help'] as const
-export default function PillPage() {
+export default function PillPage () {
return (
Pill
@@ -45,5 +45,5 @@ export default function PillPage() {
- );
+ )
}
diff --git a/design-system/website/pages/components/popover.tsx b/design-system/website/pages/components/popover.tsx
index cc0baaaf1cb..2232a7b196a 100644
--- a/design-system/website/pages/components/popover.tsx
+++ b/design-system/website/pages/components/popover.tsx
@@ -1,12 +1,12 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { Button } from '@keystone-ui/button';
-import { Box, jsx } from '@keystone-ui/core';
-import { Popover } from '@keystone-ui/popover';
-import { Page } from '../../components/Page';
+import { Button } from '@keystone-ui/button'
+import { Box, jsx } from '@keystone-ui/core'
+import { Popover } from '@keystone-ui/popover'
+import { Page } from '../../components/Page'
-export default function PopoverPage() {
+export default function PopoverPage () {
return (
@@ -25,5 +25,5 @@ export default function PopoverPage() {
- );
+ )
}
diff --git a/design-system/website/pages/components/toast.tsx b/design-system/website/pages/components/toast.tsx
index ff0bd013d04..73a7816e9fa 100644
--- a/design-system/website/pages/components/toast.tsx
+++ b/design-system/website/pages/components/toast.tsx
@@ -1,14 +1,14 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { Button } from '@keystone-ui/button';
-import { jsx, Stack } from '@keystone-ui/core';
-import { useToasts } from '@keystone-ui/toast';
+import { Button } from '@keystone-ui/button'
+import { jsx, Stack } from '@keystone-ui/core'
+import { useToasts } from '@keystone-ui/toast'
-import { Page } from '../../components/Page';
+import { Page } from '../../components/Page'
-export default function OptionsPage() {
- const { addToast } = useToasts();
+export default function OptionsPage () {
+ const { addToast } = useToasts()
return (
@@ -16,12 +16,12 @@ export default function OptionsPage() {
return (
{
- addToast({ title: `${titleCase(tone)} toast`, tone });
+ addToast({ title: `${titleCase(tone)} toast`, tone })
}}
>
Add {tone} toast
- );
+ )
})}
{
@@ -30,16 +30,16 @@ export default function OptionsPage() {
message:
'Optional long-form message content, to give the user additional information or context',
tone: 'help',
- });
+ })
}}
>
Add toast with message
- );
+ )
}
-function titleCase(str: string) {
- return str.slice(0, 1).toUpperCase() + str.slice(1);
+function titleCase (str: string) {
+ return str.slice(0, 1).toUpperCase() + str.slice(1)
}
diff --git a/design-system/website/pages/components/tooltip.tsx b/design-system/website/pages/components/tooltip.tsx
index 4bf7d596910..72069767b7b 100644
--- a/design-system/website/pages/components/tooltip.tsx
+++ b/design-system/website/pages/components/tooltip.tsx
@@ -1,12 +1,12 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@keystone-ui/core';
-import { Button } from '@keystone-ui/button';
-import { Tooltip } from '@keystone-ui/tooltip';
-import { Page } from '../../components/Page';
+import { jsx } from '@keystone-ui/core'
+import { Button } from '@keystone-ui/button'
+import { Tooltip } from '@keystone-ui/tooltip'
+import { Page } from '../../components/Page'
-export default function PopoverPage() {
+export default function PopoverPage () {
return (
@@ -18,5 +18,5 @@ export default function PopoverPage() {
{props => Save changes }
- );
+ )
}
diff --git a/design-system/website/pages/core/alias-tokens.tsx b/design-system/website/pages/core/alias-tokens.tsx
index 84e685bf662..71e2a1f6b22 100644
--- a/design-system/website/pages/core/alias-tokens.tsx
+++ b/design-system/website/pages/core/alias-tokens.tsx
@@ -1,17 +1,17 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx, useTheme, Inline } from '@keystone-ui/core';
+import { jsx, useTheme, Inline } from '@keystone-ui/core'
-import { Fragment } from 'react';
-import { Page } from '../../components/Page';
-import { ReadableColor } from '../../components/ReadableColor';
+import { Fragment } from 'react'
+import { Page } from '../../components/Page'
+import { ReadableColor } from '../../components/ReadableColor'
-type SelectableColorType = keyof ReturnType['selectableColors'];
+type SelectableColorType = keyof ReturnType['selectableColors']
const SelectableColor = ({ name }: { name: SelectableColorType }) => {
- const { selectableColors, spacing, radii, typography } = useTheme();
- const color = selectableColors[name];
+ const { selectableColors, spacing, radii, typography } = useTheme()
+ const color = selectableColors[name]
return (
- );
-};
+ )
+}
-type ToneType = keyof ReturnType['tones'];
+type ToneType = keyof ReturnType['tones']
const Tone = ({ name }: { name: ToneType }) => {
- const { tones, spacing, radii, typography } = useTheme();
- const color = tones[name];
+ const { tones, spacing, radii, typography } = useTheme()
+ const color = tones[name]
return (
- );
-};
+ )
+}
-type ColorType = keyof ReturnType['colors'];
+type ColorType = keyof ReturnType['colors']
const Color = ({ color }: { color: ColorType }) => {
- const { spacing, typography, colors, radii } = useTheme();
+ const { spacing, typography, colors, radii } = useTheme()
return (
{
>
{color}
- );
-};
+ )
+}
-export default function ThemePage() {
- const { colors, tones, selectableColors } = useTheme();
+export default function ThemePage () {
+ const { colors, tones, selectableColors } = useTheme()
return (
Alias Tokens
@@ -170,5 +170,5 @@ export default function ThemePage() {
))}
- );
+ )
}
diff --git a/design-system/website/pages/core/global-tokens.tsx b/design-system/website/pages/core/global-tokens.tsx
index 9bccbb2bd36..3592a4f648e 100644
--- a/design-system/website/pages/core/global-tokens.tsx
+++ b/design-system/website/pages/core/global-tokens.tsx
@@ -1,11 +1,11 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx, useTheme } from '@keystone-ui/core';
+import { jsx, useTheme } from '@keystone-ui/core'
-import { Fragment } from 'react';
-import { Page } from '../../components/Page';
-import { ReadableColor } from '../../components/ReadableColor';
+import { Fragment } from 'react'
+import { Page } from '../../components/Page'
+import { ReadableColor } from '../../components/ReadableColor'
const PALETTES = [
'neutral',
@@ -18,17 +18,17 @@ const PALETTES = [
'red',
'pink',
'purple',
-];
+]
-const PALETTE_RANGE = ['100', '200', '300', '400', '500', '600', '700', '800', '900'];
+const PALETTE_RANGE = ['100', '200', '300', '400', '500', '600', '700', '800', '900']
const Palette = ({ name }: { name: string }) => {
- const { palette, spacing, radii, typography } = useTheme();
+ const { palette, spacing, radii, typography } = useTheme()
return (
{PALETTE_RANGE.map(i => {
- const color = `${name}${i}` as keyof typeof palette;
+ const color = `${name}${i}` as keyof typeof palette
return (
{
{i}
- );
+ )
})}
- );
-};
+ )
+}
-export default function ThemePage() {
+export default function ThemePage () {
return (
Theme
@@ -73,5 +73,5 @@ export default function ThemePage() {
))}
- );
+ )
}
diff --git a/design-system/website/pages/core/theme.tsx b/design-system/website/pages/core/theme.tsx
index 4adc94b55da..a3d70d68dec 100644
--- a/design-system/website/pages/core/theme.tsx
+++ b/design-system/website/pages/core/theme.tsx
@@ -1,11 +1,11 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@keystone-ui/core';
+import { jsx } from '@keystone-ui/core'
-import { Page } from '../../components/Page';
+import { Page } from '../../components/Page'
-export default function ThemePage() {
+export default function ThemePage () {
return (
Theme
@@ -29,5 +29,5 @@ export default function ThemePage() {
Smart Swatch .
- );
+ )
}
diff --git a/design-system/website/pages/index.tsx b/design-system/website/pages/index.tsx
index 5d8dcef5687..ab8512e06a7 100644
--- a/design-system/website/pages/index.tsx
+++ b/design-system/website/pages/index.tsx
@@ -1,16 +1,16 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@keystone-ui/core';
+import { jsx } from '@keystone-ui/core'
-import { Page } from '../components/Page';
+import { Page } from '../components/Page'
-export default function IndexPage() {
+export default function IndexPage () {
return (
Welcome
Keystone UI is the Design System for KeystoneJS.
Explore the links on the left to get to know the components included.
- );
+ )
}
diff --git a/design-system/website/pages/layout/box.tsx b/design-system/website/pages/layout/box.tsx
index bde7febc397..9b2e30a86ad 100644
--- a/design-system/website/pages/layout/box.tsx
+++ b/design-system/website/pages/layout/box.tsx
@@ -1,13 +1,13 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx, Box, useTheme } from '@keystone-ui/core';
+import { jsx, Box, useTheme } from '@keystone-ui/core'
-import { Page } from '../../components/Page';
-import { Code } from '../../components/Code';
+import { Page } from '../../components/Page'
+import { Code } from '../../components/Code'
-export default function ThemePage() {
- const { palette } = useTheme();
+export default function ThemePage () {
+ const { palette } = useTheme()
return (
Box
@@ -34,5 +34,5 @@ export default function ThemePage() {
TODO
Add support for border properties, elevation, etc?
- );
+ )
}
diff --git a/design-system/website/pages/layout/center.tsx b/design-system/website/pages/layout/center.tsx
index 7c3f99c9dd1..dc5c5c8d75a 100644
--- a/design-system/website/pages/layout/center.tsx
+++ b/design-system/website/pages/layout/center.tsx
@@ -1,13 +1,13 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx, Box, useTheme, Center } from '@keystone-ui/core';
+import { jsx, Box, useTheme, Center } from '@keystone-ui/core'
-import { Page } from '../../components/Page';
-import { Code } from '../../components/Code';
+import { Page } from '../../components/Page'
+import { Code } from '../../components/Code'
-export default function CenterPage() {
- const { palette } = useTheme();
+export default function CenterPage () {
+ const { palette } = useTheme()
return (
Center
@@ -29,5 +29,5 @@ export default function CenterPage() {
- );
+ )
}
diff --git a/design-system/website/pages/layout/stack.tsx b/design-system/website/pages/layout/stack.tsx
index 29ebc625df6..d23e71da454 100644
--- a/design-system/website/pages/layout/stack.tsx
+++ b/design-system/website/pages/layout/stack.tsx
@@ -1,12 +1,12 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx, Text, Stack } from '@keystone-ui/core';
+import { jsx, Text, Stack } from '@keystone-ui/core'
-import { Page } from '../../components/Page';
-import { Code } from '../../components/Code';
+import { Page } from '../../components/Page'
+import { Code } from '../../components/Code'
-export default function ThemePage() {
+export default function ThemePage () {
return (
Stack
@@ -132,5 +132,5 @@ export default function ThemePage() {
- );
+ )
}
diff --git a/design-system/website/utils.ts b/design-system/website/utils.ts
index d9dab3aeb1f..36242c2c4ac 100644
--- a/design-system/website/utils.ts
+++ b/design-system/website/utils.ts
@@ -1,4 +1,4 @@
-export const toLabel = (str: string) => str.slice(0, 1).toUpperCase() + str.slice(1);
+export const toLabel = (str: string) => str.slice(0, 1).toUpperCase() + str.slice(1)
-const VOWELS = ['a', 'e', 'i', 'o', 'u'];
-export const aAn = (before: string) => `a${VOWELS.includes(before.charAt(0)) ? 'n' : ''}`;
+const VOWELS = ['a', 'e', 'i', 'o', 'u']
+export const aAn = (before: string) => `a${VOWELS.includes(before.charAt(0)) ? 'n' : ''}`
diff --git a/docs/STYLE_GUIDE.md b/docs/STYLE_GUIDE.md
deleted file mode 100644
index 5ce6742496d..00000000000
--- a/docs/STYLE_GUIDE.md
+++ /dev/null
@@ -1,174 +0,0 @@
-# Documentation Style
-
-This document describes the conventions for formatting and style used throughout Keystone 6 docs.
-
-Many of these rules are enforced by the Prettier Markdown parser,
-[Remark](https://github.com/remarkjs/remark/tree/master/packages/remark-parse),
-which runs on `yarn format`.
-Generally they also align with those suggested in Ciro Santilli's
-[Markdown Style Guide](http://www.cirosantilli.com/markdown-style-guide), the de facto standard.
-If Prettier doesn't have an opinion on something, and it's not covered here, go with Ciro's suggestion.
-
-The aim of these conventions is to ensure:
-
-- Consistency across project docs
-- Readability when published as HTML (see especially the [URL Formulation Rules](#url-formulation-rules))
-- Readability as plain text
-- Readability when being updated (ie. in diffs)
-
-## General
-
-- All docs should include an intro that describes their purpose and context within the project
-- Write clearly and keep it factual
-- If you must assume knowledge on the part of the reader, link to related docs on the topic
-- Emoji can be used, sparingly please ✨
-- Ampersands should be avoided outside of headings
-
-Also, it should go without saying:
-
-- Ensure correct spelling; spell-check documents before committing.
- (We _favour_ UK/Australian spelling.)
-- Ensure correct capitalisation, inc. product names and acronyms (eg: JavaScript, URL, Node.js).
- Note, _abbreviations_ like "etc.", "ie." and "eg." are not acronyms;
- they should only be capitalised if at the start of a sentence.
-- Ensure correct English grammar (or Miss Willings will come for you 👩🏼🏫).
- This includes periods after abbreviations such as "etc.".
-
-If in doubt, Google it.
-
-## Tools
-
-We run our Markdown through Prettier which applies many of these rule for us.
-The `yarn format` command will check and update all Markdown files (and all JS).
-You can use `yarn format:file MyNewDoc.md` to "pretty" a specific document.
-
-If you're using Sublime Text, the following plugins may be of use:
-
-- [Markdown Extended](https://packagecontrol.io/packages/Markdown%20Extended) --
- Better syntax highlighting of Markdown documents
-- [MarkdownPreview](https://packagecontrol.io/packages/MarkdownPreview) --
- Allows Markdown documents to be previewed by running them through the GitHub renderer
-
-_JM: Any tips for other editors? VS Code anyone?_
-
-## Headings
-
-- We prefer the ["atx" style of headings](http://www.cirosantilli.com/markdown-style-guide/#option-header-atx).
- Ie. `#`, `##`, `###`, etc.
-- Each document should contain a single level 1 heading
-- Headings at all levels use [Title Case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage)
-- Try to keep all headings unique so they can be [linked to](#headings) reliably
-- Emphasis (eg. **bold**) should not be used in place of headings
-- Try to limit `code` use within headings
-
-## Text Blocks
-
-The sentences that form a paragraph should generally be separated with newlines.
-Longer sentences, such as this one, constructed with multiple clauses,
-will often require newline characters at punctuation boundaries.
-Likewise, sentences will often require newlines characters when they include
-[Markdown formatted links](https://www.markdownguide.org/basic-syntax#links).
-
-There's no hard limit on line length; Prettier does not enforce one by default.
-As a rule of thumb, over 120 characters is too long.
-
-## Lists
-
-We'd _like_ to use different bullets styles for items at different levels but Prettier forces hyphens by default.
-Let's just go with that.
-
-- Lists levels are indented with 2 spaces
- - Like this
- - And this
-- Items should end in punctuation only if they contains multiple sentences.
- In other cases they should not.
-
-Ordered lists have their own set of concerns.
-It's worth noting that GitHub Markdown only cares which numbers you use for the _first item_;
-it takes that as the initial value and counts up from there.
-As such, there are two methods that work:
-
-1. Usually it's preferable to number all items with `1`.
- This keeps diffs clean since inserting or removing an item doesn't re-number all subsequent items.
-2. However, if the doc refers to the items _by number_ it makes sense to number them ordinarily within the Markdown.
- The Prettier will _correct the order of items_ numbered in this way which is nice (but does cause more noise in the diffs).
-
-## Links
-
-Links should be used generously to reference related material both inside and outside the current document.
-You can link to any section in a markdown document by lower-casing its heading,
-replacing spaces with hyphens and prefixing with a hash, eg: the [Text Blocks section](#text-blocks).
-
-### URL Formulation Rules
-
-It's important to remember that the Markdown files within this project are used in several places:
-
-- As raw Markdown in a local dev environment (eg. in editor, search/grep'ing, etc.)
-- Published on the [Keystone 6 website](https://keystonejs.com/)
-- Published on the [GitHub repo](https://github.com/keystonejs/keystone)
-- Published on NPM (only effects package `README.md` docs)
-
-For links to work across these mediums, certain rules for URLs formulation must be followed:
-
-- Links _within a file_ (ie. to headings) must not include the file name or path
- - Eg. `See the secion on [Foo Config](#foo-config).`
-- Links to _other files in the monorepo_ must use..
- - An absolute file path from the monorepo root
- - Eg. `/docs/pages/guides/cli.mdx` (**not** `https://keystonejs.com/guides/cli` or `https://github.com/keystonejs/keystone/blob/main/docs/pages/guides/cli.mdx`, etc.)
- - The full filename, include the extension
- - Eg. `/docs/pages/guides/cli.mdx` (**not** `/docs/guides/cli`)
-- Links to `README.md` files must be explicit; they cannot rely on the GitHub behaviour that uses `README.md` at a sort of "index" for a directory
- - Eg. `/packages/core/README.md#CLI` (**not** `/packages/core#CLI`)
-- Links to directories end in a slash (eg. `/packages/core/`)
- - This as is convention for URLs (so as not to be confused with a files)
-
-## Code and Code Blocks
-
-Use `single backticks` only when referring to a specific tool or a single commands within a sentence.
-Where possible, code blocks (using the triple backtick) should be used instead.
-For example, even a small single shell commands should be given a block:
-
-```sh
-node --version
-```
-
-All code blocks should specify the language they contain;
-this produces syntax highlighting when published on GitHub.
-A complete list of languages recognised by GitHub can be found in the
-[`linguist` languages file](https://github.com/github/linguist/blob/master/lib/linguist/languages.yml).
-
-## Emphasis
-
-Emphasis should be used inline, to highlight specific points,
-or to indicate notes and comments that aren't part of the document flow.
-
-- **Bold sections** are delineated with 2 asterisk (`**text**`)
-- _Italics_ can be added with a pair of underscores (`_text_`)
-
-This differs slightly from Ciro's guide (which suggests `**` and `*`).
-We believe our version is clearer to read in plain text.
-It also aligns more closely with tools like Slack, which is handy.
-
-Remember, you can also ~~strikeout~~ text using tildes (`~~text~~`).
-
-## Tables
-
-Use tables if it helps with clarity. Prettier will re-space the values for you
-so the information will remain readable as text. Avoid using code blocks as a
-pre-formatted pseudo-table. For example:
-
-```
-Name Age
---------- -------
-Jimmy 41
-Janet 42
-```
-
-Just use a table:
-
-| Name | Age |
-| ----- | --: |
-| Jimmy | 41 |
-| Janet | 42 |
-
-Remember you can control the horizontal alignment of text within a column using the `:` char, as above.
diff --git a/docs/components/Announce.tsx b/docs/components/Announce.tsx
index 666fdea931f..9a094aa3802 100644
--- a/docs/components/Announce.tsx
+++ b/docs/components/Announce.tsx
@@ -1,15 +1,15 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
-import { HTMLAttributes, ReactNode } from 'react';
+import { jsx } from '@emotion/react'
+import { type HTMLAttributes, type ReactNode } from 'react'
-import { Wrapper } from './primitives/Wrapper';
+import { Wrapper } from './primitives/Wrapper'
type AnnounceProps = {
- children: ReactNode;
-} & HTMLAttributes;
+ children: ReactNode
+} & HTMLAttributes
-export function Announce({ children, ...props }: AnnounceProps) {
+export function Announce ({ children, ...props }: AnnounceProps) {
return (
{children}
- );
+ )
}
diff --git a/docs/components/Breadcrumbs.tsx b/docs/components/Breadcrumbs.tsx
index b557ffa4bfd..b55d64aa8a5 100644
--- a/docs/components/Breadcrumbs.tsx
+++ b/docs/components/Breadcrumbs.tsx
@@ -1,26 +1,26 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { useRouter } from 'next/router';
-import { jsx } from '@emotion/react';
-import Link from 'next/link';
+import { useRouter } from 'next/router'
+import { jsx } from '@emotion/react'
+import Link from 'next/link'
-import { Type } from './primitives/Type';
+import { Type } from './primitives/Type'
-type Path = { title: string; href: string };
+type Path = { title: string, href: string }
-export function Breadcrumbs() {
- const router = useRouter();
+export function Breadcrumbs () {
+ const router = useRouter()
// remove anchor and split path
- const linkPath = new URL(router.asPath, 'https://keystonejs.com').pathname.split('/');
- linkPath.shift();
+ const linkPath = new URL(router.asPath, 'https://keystonejs.com').pathname.split('/')
+ linkPath.shift()
const breadcrumbs = linkPath.map((path, i): Path => {
- return { title: path.replace(/-/g, ' '), href: '/' + linkPath.slice(0, i + 1).join('/') };
- });
+ return { title: path.replace(/-/g, ' '), href: '/' + linkPath.slice(0, i + 1).join('/') }
+ })
if (breadcrumbs.length < 2) {
- return null;
+ return null
}
return (
@@ -82,5 +82,5 @@ export function Breadcrumbs() {
))}
- );
+ )
}
diff --git a/docs/components/ContactForm.tsx b/docs/components/ContactForm.tsx
index eb127e6ebb2..e7f940568e9 100644
--- a/docs/components/ContactForm.tsx
+++ b/docs/components/ContactForm.tsx
@@ -1,41 +1,41 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { Fragment, useState, ReactNode, SyntheticEvent, HTMLAttributes } from 'react';
-import { jsx } from '@emotion/react';
+import { Fragment, useState, type ReactNode, type SyntheticEvent, type HTMLAttributes } from 'react'
+import { jsx } from '@emotion/react'
-import { useMediaQuery } from '../lib/media';
-import { Button } from './primitives/Button';
-import { Field } from './primitives/Field';
-import { Stack } from './primitives/Stack';
-import { Type } from './primitives/Type';
+import { useMediaQuery } from '../lib/media'
+import { Button } from './primitives/Button'
+import { Field } from './primitives/Field'
+import { Stack } from './primitives/Stack'
+import { Type } from './primitives/Type'
const validEmail = (email: string) =>
/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(
email
- );
+ )
-const enquiryUrl = 'https://endpoints.thinkmill.com.au/enquiry';
+const enquiryUrl = 'https://endpoints.thinkmill.com.au/enquiry'
type ContactFormProps = {
- autoFocus?: boolean;
- children: ReactNode;
- stacked?: boolean;
-} & HTMLAttributes;
+ autoFocus?: boolean
+ children: ReactNode
+ stacked?: boolean
+} & HTMLAttributes
-export function ContactForm({ autoFocus, stacked, children, ...props }: ContactFormProps) {
- const [email, setEmail] = useState('');
- const [name, setName] = useState('');
- const [message, setMessage] = useState('');
- const [loading, setLoading] = useState(false);
- const [error, setError] = useState(null);
- const [formSubmitted, setFormSubmitted] = useState(false);
- const mq = useMediaQuery();
+export function ContactForm ({ autoFocus, stacked, children, ...props }: ContactFormProps) {
+ const [email, setEmail] = useState('')
+ const [name, setName] = useState('')
+ const [message, setMessage] = useState('')
+ const [loading, setLoading] = useState(false)
+ const [error, setError] = useState(null)
+ const [formSubmitted, setFormSubmitted] = useState(false)
+ const mq = useMediaQuery()
const onSubmit = (event: SyntheticEvent) => {
- event.preventDefault();
- setError(null);
+ event.preventDefault()
+ setError(null)
// Basic validation check on the email?
- setLoading(true);
+ setLoading(true)
if (validEmail(email)) {
// if good post to Thinkmill endpoint
return fetch(enquiryUrl, {
@@ -57,25 +57,25 @@ export function ContactForm({ autoFocus, stacked, children, ...props }: ContactF
// any status that isn't 200 we assume is a failure
// which we want to surface to the user
res.json().then(({ error }) => {
- setError(error);
- setLoading(false);
- });
+ setError(error)
+ setLoading(false)
+ })
} else {
- setFormSubmitted(true);
+ setFormSubmitted(true)
}
})
.catch(err => {
// network errors or failed parse
- setError(err.toString());
- setLoading(false);
- });
+ setError(err.toString())
+ setLoading(false)
+ })
} else {
- setLoading(false);
+ setLoading(false)
// if email fails validation set error message
- setError('Please enter a valid email');
- return;
+ setError('Please enter a valid email')
+ return
}
- };
+ }
return !formSubmitted ? (
@@ -148,5 +148,5 @@ export function ContactForm({ autoFocus, stacked, children, ...props }: ContactF
) : (
❤️ Thank you for contacting us
- );
+ )
}
diff --git a/docs/components/Footer.tsx b/docs/components/Footer.tsx
index 5060ec72a5a..516e821f3e8 100644
--- a/docs/components/Footer.tsx
+++ b/docs/components/Footer.tsx
@@ -1,19 +1,19 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
-import Link from 'next/link';
-import { HTMLAttributes } from 'react';
+import { jsx } from '@emotion/react'
+import Link from 'next/link'
+import { type HTMLAttributes } from 'react'
-import { useMediaQuery } from '../lib/media';
-import { GitHubButton } from './primitives/GitHubButton';
-import { SubscribeForm } from './SubscribeForm';
-import { Wrapper } from './primitives/Wrapper';
-import { Keystone } from './icons/Keystone';
-import { Emoji } from './primitives/Emoji';
-import { Type } from './primitives/Type';
-import { Socials } from './Socials';
+import { useMediaQuery } from '../lib/media'
+import { GitHubButton } from './primitives/GitHubButton'
+import { SubscribeForm } from './SubscribeForm'
+import { Wrapper } from './primitives/Wrapper'
+import { Keystone } from './icons/Keystone'
+import { Emoji } from './primitives/Emoji'
+import { Type } from './primitives/Type'
+import { Socials } from './Socials'
-function List(props: HTMLAttributes) {
+function List (props: HTMLAttributes) {
return (
) {
}}
{...props}
/>
- );
+ )
}
-export function Footer() {
- const mq = useMediaQuery();
+export function Footer () {
+ const mq = useMediaQuery()
return (
- );
+ )
}
-export function DocsFooter() {
- const mq = useMediaQuery();
+export function DocsFooter () {
+ const mq = useMediaQuery()
return (
- );
+ )
}
diff --git a/docs/components/Header.tsx b/docs/components/Header.tsx
index 540212a99e5..46ae5ca9f45 100644
--- a/docs/components/Header.tsx
+++ b/docs/components/Header.tsx
@@ -7,39 +7,39 @@ import {
useEffect,
useState,
useRef,
- ReactNode,
- RefObject,
-} from 'react';
-import { useRouter } from 'next/router';
-import { jsx } from '@emotion/react';
-import Link from 'next/link';
-import debounce from 'lodash.debounce';
+ type ReactNode,
+ type RefObject,
+} from 'react'
+import { useRouter } from 'next/router'
+import { jsx } from '@emotion/react'
+import Link from 'next/link'
+import debounce from 'lodash.debounce'
-import { BREAK_POINTS } from '../lib/media';
-import { useMediaQuery } from '../lib/media';
-import { SearchField } from './primitives/SearchField';
-import { Highlight } from './primitives/Highlight';
-import { Wrapper } from './primitives/Wrapper';
-import { Hamburger } from './icons/Hamburger';
-import { Button } from './primitives/Button';
-import { NavItem } from './docs/Navigation';
-import { ThemeToggle } from './ThemeToggle';
-import { Keystone } from './icons/Keystone';
-import { MobileMenu } from './MobileMenu';
-import { GitHub } from './icons/GitHub';
-import { ArrowR } from './icons/ArrowR';
+import { BREAK_POINTS } from '../lib/media'
+import { useMediaQuery } from '../lib/media'
+import { SearchField } from './primitives/SearchField'
+import { Highlight } from './primitives/Highlight'
+import { Wrapper } from './primitives/Wrapper'
+import { Hamburger } from './icons/Hamburger'
+import { Button } from './primitives/Button'
+import { NavItem } from './docs/Navigation'
+import { ThemeToggle } from './ThemeToggle'
+import { Keystone } from './icons/Keystone'
+import { MobileMenu } from './MobileMenu'
+import { GitHub } from './icons/GitHub'
+import { ArrowR } from './icons/ArrowR'
// TODO: Add in search for mobile via this button
// import { Search } from './icons/Search';
-type HeaderContextType = { mobileNavIsOpen: boolean; desktopOpenState: number };
+type HeaderContextType = { mobileNavIsOpen: boolean, desktopOpenState: number }
const HeaderContext = createContext({
mobileNavIsOpen: false,
desktopOpenState: -1,
-});
-export const useHeaderContext = () => useContext(HeaderContext);
+})
+export const useHeaderContext = () => useContext(HeaderContext)
-function Logo() {
- const mq = useMediaQuery();
+function Logo () {
+ const mq = useMediaQuery()
return (
Keystone 6
- );
+ )
}
-function useCurrentSection() {
- const { pathname } = useRouter();
- const check = (candidate: string) => pathname.startsWith(candidate);
- if (['/updates', '/releases'].some(check)) return '/updates';
- if (['/why-keystone', '/for-'].some(check)) return '/why-keystone';
- if (['/docs'].some(check)) return '/docs';
- if (['/blog'].some(check)) return '/blog';
+function useCurrentSection () {
+ const { pathname } = useRouter()
+ const check = (candidate: string) => pathname.startsWith(candidate)
+ if (['/updates', '/releases'].some(check)) return '/updates'
+ if (['/why-keystone', '/for-'].some(check)) return '/why-keystone'
+ if (['/docs'].some(check)) return '/docs'
+ if (['/blog'].some(check)) return '/blog'
}
-function LinkItem({ children, href }: { children: ReactNode; href: string }) {
- const mq = useMediaQuery();
- const currentSection = useCurrentSection();
- const isActive = href === currentSection;
+function LinkItem ({ children, href }: { children: ReactNode, href: string }) {
+ const mq = useMediaQuery()
+ const currentSection = useCurrentSection()
+ const isActive = href === currentSection
return (
@@ -101,48 +101,48 @@ function LinkItem({ children, href }: { children: ReactNode; href: string }) {
{children}
- );
+ )
}
-function useClickOutside(ref: RefObject, cb: () => void) {
+function useClickOutside (ref: RefObject, cb: () => void) {
useEffect(() => {
/**
* Alert if clicked on outside of element
*/
- function handleClickOutside(event: MouseEvent) {
+ function handleClickOutside (event: MouseEvent) {
if (ref.current && !ref.current.contains(event.target as Node)) {
- cb();
+ cb()
}
}
- document.addEventListener('mousedown', handleClickOutside);
+ document.addEventListener('mousedown', handleClickOutside)
return () => {
- document.removeEventListener('mousedown', handleClickOutside);
- };
- }, [ref, cb]);
+ document.removeEventListener('mousedown', handleClickOutside)
+ }
+ }, [ref, cb])
}
-function FlatMenu({
+function FlatMenu ({
label,
items = [],
}: {
- label: string;
- items: Array<{ label: string; href: string }>;
+ label: string
+ items: Array<{ label: string, href: string }>
}) {
- const mq = useMediaQuery();
- const menuRef = useRef(null);
- const [showContent, setShowContent] = useState(false);
+ const mq = useMediaQuery()
+ const menuRef = useRef(null)
+ const [showContent, setShowContent] = useState(false)
const onClickHandler = useCallback(() => {
- setShowContent(b => !b);
- }, [setShowContent]);
+ setShowContent(b => !b)
+ }, [setShowContent])
const closeMenu = useCallback(() => {
if (showContent === true) {
- setShowContent(false);
+ setShowContent(false)
}
- }, [showContent, setShowContent]);
+ }, [showContent, setShowContent])
- useClickOutside(menuRef, closeMenu);
+ useClickOutside(menuRef, closeMenu)
return (
- );
+ )
})}
- );
+ )
}
-export function Header() {
- const mq = useMediaQuery();
- const router = useRouter();
+export function Header () {
+ const mq = useMediaQuery()
+ const router = useRouter()
- const menuRef = useRef(null);
- const headerRef = useRef(null);
+ const menuRef = useRef(null)
+ const headerRef = useRef(null)
- const [mobileNavIsOpen, setMobileNavIsOpen] = useState(false);
- const [desktopOpenState, setDesktopOpenState] = useState(-1);
+ const [mobileNavIsOpen, setMobileNavIsOpen] = useState(false)
+ const [desktopOpenState, setDesktopOpenState] = useState(-1)
useEffect(() => {
const listener = () => {
- setMobileNavIsOpen(false);
- setDesktopOpenState(-1);
+ setMobileNavIsOpen(false)
+ setDesktopOpenState(-1)
const width = Math.max(
document.body.scrollWidth,
document.documentElement.scrollWidth,
document.body.offsetWidth,
document.documentElement.offsetWidth,
document.documentElement.clientWidth
- );
+ )
if (width > BREAK_POINTS.sm) {
- setDesktopOpenState(-1);
+ setDesktopOpenState(-1)
} else {
- setDesktopOpenState(-1);
+ setDesktopOpenState(-1)
}
- };
- window.addEventListener('resize', debounce(listener, 130));
+ }
+ window.addEventListener('resize', debounce(listener, 130))
return () => {
- window.removeEventListener('resize', debounce(listener, 130));
- };
- }, [setDesktopOpenState]);
+ window.removeEventListener('resize', debounce(listener, 130))
+ }
+ }, [setDesktopOpenState])
useEffect(() => {
- document.body.style.overflow = 'auto';
+ document.body.style.overflow = 'auto'
// search - init field
- let searchAttempt = 0;
- // @ts-ignore
- document.getElementById('search-field').disabled = true;
+ let searchAttempt = 0
+ // @ts-expect-error
+ document.getElementById('search-field').disabled = true
const loadSearch = (searchAttempt: number) => {
- // @ts-ignore
+ // @ts-expect-error
if (window.docsearch && searchAttempt < 10) {
- // @ts-ignore
- document.getElementById('search-field').disabled = false;
- // @ts-ignore
+ // @ts-expect-error
+ document.getElementById('search-field').disabled = false
+ // @ts-expect-error
window.docsearch({
appId: 'N3ZF861Q5G',
apiKey: 'f52fa93b9068fe8824beab5727ae84a1',
@@ -276,63 +276,63 @@ export function Header() {
facetFilters: ['tags:stable'],
},
transformData: (results: any) => {
- if (window.location.hostname == 'keystonejs.com') return results;
+ if (window.location.hostname == 'keystonejs.com') return results
return results.map((result: object) => {
- // @ts-ignore
- result.url = result.url.replace('https://keystonejs.com', window.location.origin);
- return result;
- });
+ // @ts-expect-error
+ result.url = result.url.replace('https://keystonejs.com', window.location.origin)
+ return result
+ })
},
- });
+ })
} else if (searchAttempt >= 10) {
- // @ts-ignore
- document.getElementById('search-field-container').style.visibility = 'hidden';
+ // @ts-expect-error
+ document.getElementById('search-field-container').style.visibility = 'hidden'
} else {
- setTimeout(() => loadSearch(searchAttempt++), 500);
+ setTimeout(() => loadSearch(searchAttempt++), 500)
}
- };
+ }
// yoo hooo
- loadSearch(searchAttempt);
+ loadSearch(searchAttempt)
// search - keyboard shortcut
- let keysPressed: { [key: KeyboardEvent['key']]: boolean } = {};
+ let keysPressed: { [key: KeyboardEvent['key']]: boolean } = {}
document.body.addEventListener('keydown', event => {
// If we're typing in an input, don't ever focus the search input
if (
document.activeElement &&
['TEXTAREA', 'INPUT'].includes(document.activeElement.nodeName)
) {
- return;
+ return
}
- keysPressed[event.key] = true;
+ keysPressed[event.key] = true
if (keysPressed['Meta'] && event.key == 'k') {
- event.preventDefault();
- document.getElementById('search-field')?.focus();
+ event.preventDefault()
+ document.getElementById('search-field')?.focus()
}
- });
+ })
document.body.addEventListener('keyup', event => {
- delete keysPressed[event.key];
- });
- }, []);
+ delete keysPressed[event.key]
+ })
+ }, [])
const handleOpen = useCallback(() => {
- setMobileNavIsOpen(true);
- document.body.style.overflow = 'hidden';
- document.getElementById('mobile-menu-close-btn')?.focus();
- }, []);
+ setMobileNavIsOpen(true)
+ document.body.style.overflow = 'hidden'
+ document.getElementById('mobile-menu-close-btn')?.focus()
+ }, [])
const handleClose = useCallback(() => {
- setMobileNavIsOpen(false);
- document.body.style.overflow = 'auto';
- document.getElementById('skip-link-navigation-btn')?.focus();
- }, []);
+ setMobileNavIsOpen(false)
+ document.body.style.overflow = 'auto'
+ document.getElementById('skip-link-navigation-btn')?.focus()
+ }, [])
useEffect(() => {
- router.events.on('routeChangeComplete', handleClose);
+ router.events.on('routeChangeComplete', handleClose)
return () => {
- router.events.off('routeChangeComplete', handleClose);
- };
- }, [router.events, handleClose]);
+ router.events.off('routeChangeComplete', handleClose)
+ }
+ }, [router.events, handleClose])
return (
@@ -491,5 +491,5 @@ export function Header() {
- );
+ )
}
diff --git a/docs/components/Markdoc.tsx b/docs/components/Markdoc.tsx
index 627575ee36f..47b2ffdc031 100644
--- a/docs/components/Markdoc.tsx
+++ b/docs/components/Markdoc.tsx
@@ -1,55 +1,55 @@
-import React, { ElementType, ReactNode } from 'react';
-import type { RenderableTreeNodes, Scalar, RenderableTreeNode, Tag } from '@markdoc/markdoc';
-import { isTag } from '../markdoc/isTag';
-import { Code, InlineCode } from './primitives/Code';
-import { Heading } from './docs/Heading';
-import { RelatedContent } from './RelatedContent';
-import { Well } from './primitives/Well';
-import { YouTubeEmbed } from './primitives/YouTubeEmbed';
-import { Emoji } from './primitives/Emoji';
-import { ComingSoon } from './docs/ComingSoon';
+import React, { type ElementType, type ReactNode } from 'react'
+import type { RenderableTreeNodes, Scalar, RenderableTreeNode, Tag } from '@markdoc/markdoc'
+import { isTag } from '../markdoc/isTag'
+import { Code, InlineCode } from './primitives/Code'
+import { Heading } from './docs/Heading'
+import { RelatedContent } from './RelatedContent'
+import { Well } from './primitives/Well'
+import { YouTubeEmbed } from './primitives/YouTubeEmbed'
+import { Emoji } from './primitives/Emoji'
+import { ComingSoon } from './docs/ComingSoon'
const renderers: Record = {
code: InlineCode,
- CodeBlock(props: { content: string; language: string }) {
+ CodeBlock (props: { content: string, language: string }) {
return (
{props.content}
- );
+ )
},
ComingSoon,
Emoji,
Well,
YouTubeEmbed,
RelatedContent,
- Heading(props: { children: ReactNode; level: 1 | 2 | 3 | 4 | 5 | 6; id: string }) {
- return ;
+ Heading (props: { children: ReactNode, level: 1 | 2 | 3 | 4 | 5 | 6, id: string }) {
+ return
},
-};
+}
// inlined from markdoc because
// - it's so trivial to write
// - the markdoc implementation was doing weird things with the components(you couldn't override built in tags)
// - to avoid bundling all of markdoc on the front-end
-export function Markdoc(props: { content: RenderableTreeNodes }) {
- function deepRender(value: any): any {
- if (value == null || typeof value !== 'object') return value;
+export function Markdoc (props: { content: RenderableTreeNodes }) {
+ function deepRender (value: any): any {
+ if (value == null || typeof value !== 'object') return value
- if (Array.isArray(value)) return value.map(item => deepRender(item));
+ if (Array.isArray(value)) return value.map(item => deepRender(item))
- if (value.$$mdtype === 'Tag') return render(value);
+ if (value.$$mdtype === 'Tag') return render(value)
- if (typeof value !== 'object') return value;
+ if (typeof value !== 'object') return value
- const output: Record = {};
- for (const [k, v] of Object.entries(value)) output[k] = deepRender(v);
- return output;
+ const output: Record = {}
+ for (const [k, v] of Object.entries(value)) output[k] = deepRender(v)
+ return output
}
- function render(node: RenderableTreeNodes): ReactNode {
+ function render (node: RenderableTreeNodes): ReactNode {
if (Array.isArray(node)) {
- return React.createElement(React.Fragment, null, ...node.map(render));
+ return React.createElement(React.Fragment, null, ...node.map(render))
}
if (
@@ -58,19 +58,19 @@ export function Markdoc(props: { content: RenderableTreeNodes }) {
typeof node === 'boolean' ||
node === null
) {
- return node;
+ return node
}
- if (!isTag(node)) return null;
+ if (!isTag(node)) return null
- const { name, attributes: { class: className, ...attrs } = {}, children = [] } = node;
+ const { name, attributes: { class: className, ...attrs } = {}, children = [] } = node
- if (className) attrs.className = className;
- let elementType = renderers[name];
+ if (className) attrs.className = className
+ let elementType = renderers[name]
if (elementType === undefined) {
if (name[0].toLowerCase() === name[0]) {
- elementType = name as ElementType;
+ elementType = name as ElementType
} else {
- throw new Error(`No renderer provided for element type: ${name}`);
+ throw new Error(`No renderer provided for element type: ${name}`)
}
}
@@ -78,41 +78,41 @@ export function Markdoc(props: { content: RenderableTreeNodes }) {
elementType,
Object.keys(attrs).length == 0 ? null : deepRender(attrs),
...children.map(render)
- );
+ )
}
- return render(props.content) as JSX.Element;
+ return render(props.content) as JSX.Element
}
export type HeadingType = {
- id: string;
- depth: number;
- label: string;
-};
+ id: string
+ depth: number
+ label: string
+}
-export function extractHeadings(content: Tag): HeadingType[] {
- const headings: HeadingType[] = [];
+export function extractHeadings (content: Tag): HeadingType[] {
+ const headings: HeadingType[] = []
for (const child of content.children) {
if (isTag(child) && child.name === 'Heading') {
headings.push({
id: child.attributes.id,
depth: child.attributes.level,
label: stringifyDocContent(child),
- });
+ })
}
}
- return headings;
+ return headings
}
-function stringifyDocContent(node: RenderableTreeNode): string {
+function stringifyDocContent (node: RenderableTreeNode): string {
if (typeof node === 'string') {
- return node;
+ return node
}
if (Array.isArray(node)) {
- return node.map(stringifyDocContent).join('');
+ return node.map(stringifyDocContent).join('')
}
if (!isTag(node)) {
- return '';
+ return ''
}
- return node.children.map(stringifyDocContent).join('');
+ return node.children.map(stringifyDocContent).join('')
}
diff --git a/docs/components/MobileMenu.tsx b/docs/components/MobileMenu.tsx
index 7675ffb2ad4..be2ac9fb1bf 100644
--- a/docs/components/MobileMenu.tsx
+++ b/docs/components/MobileMenu.tsx
@@ -1,37 +1,37 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
-import Link from 'next/link';
+import { jsx } from '@emotion/react'
+import Link from 'next/link'
// import { useRouter } from 'next/router';
-import { Fragment, useEffect, ReactNode, MouseEvent } from 'react';
-import FocusLock from 'react-focus-lock';
+import { Fragment, useEffect, type ReactNode, type MouseEvent } from 'react'
+import FocusLock from 'react-focus-lock'
-import { useHeaderContext } from './Header';
-import { Highlight } from './primitives/Highlight';
+import { useHeaderContext } from './Header'
+import { Highlight } from './primitives/Highlight'
-import { DocsNavigation, NavItem } from './docs/Navigation';
-import { Keystone } from './icons/Keystone';
-import { Close } from './icons/Close';
+import { DocsNavigation, NavItem } from './docs/Navigation'
+import { Keystone } from './icons/Keystone'
+import { Close } from './icons/Close'
type MobileMenuProps = {
- handleClose: (e?: MouseEvent) => void;
-};
+ handleClose: (e?: MouseEvent) => void
+}
-export function MobileMenu({ handleClose }: MobileMenuProps) {
- const { mobileNavIsOpen } = useHeaderContext();
+export function MobileMenu ({ handleClose }: MobileMenuProps) {
+ const { mobileNavIsOpen } = useHeaderContext()
useEffect(() => {
const handleEsc = ({ keyCode }: KeyboardEvent) => {
if (keyCode === 27 && mobileNavIsOpen) {
- handleClose();
+ handleClose()
}
- };
+ }
- document.body.addEventListener('keydown', handleEsc);
+ document.body.addEventListener('keydown', handleEsc)
return () => {
- document.body.removeEventListener('keydown', handleEsc);
- };
- }, [mobileNavIsOpen, handleClose]);
+ document.body.removeEventListener('keydown', handleEsc)
+ }
+ }, [mobileNavIsOpen, handleClose])
return (
@@ -72,15 +72,15 @@ export function MobileMenu({ handleClose }: MobileMenuProps) {
- );
+ )
}
type NavContainerProps = {
- children: ReactNode;
- mobileNavIsOpen: boolean;
-};
+ children: ReactNode
+ mobileNavIsOpen: boolean
+}
-function NavContainer({ mobileNavIsOpen, children }: NavContainerProps) {
+function NavContainer ({ mobileNavIsOpen, children }: NavContainerProps) {
return (
{children}
- );
+ )
}
type NavHeaderProps = {
- handleClose: (e?: MouseEvent) => void;
- mobileNavIsOpen: boolean;
-};
+ handleClose: (e?: MouseEvent) => void
+ mobileNavIsOpen: boolean
+}
-function NavHeader({ handleClose, mobileNavIsOpen }: NavHeaderProps) {
+function NavHeader ({ handleClose, mobileNavIsOpen }: NavHeaderProps) {
return (
- );
+ )
}
-function Overlay({ handleClose, mobileNavIsOpen }: NavHeaderProps) {
+function Overlay ({ handleClose, mobileNavIsOpen }: NavHeaderProps) {
return (
- );
+ )
}
diff --git a/docs/components/Page.tsx b/docs/components/Page.tsx
index 2acb3c70309..8ebd3f0db36 100644
--- a/docs/components/Page.tsx
+++ b/docs/components/Page.tsx
@@ -1,33 +1,33 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { useRef, Fragment, ReactNode } from 'react';
-import { useRouter } from 'next/router';
-import { jsx } from '@emotion/react';
-import Head from 'next/head';
+import { useRef, Fragment, type ReactNode } from 'react'
+import { useRouter } from 'next/router'
+import { jsx } from '@emotion/react'
+import Head from 'next/head'
-import { useMediaQuery } from '../lib/media';
-import { TableOfContents } from './docs/TableOfContents';
-import { Wrapper } from './primitives/Wrapper';
-import { EditButton } from './primitives/EditButton';
-import { Breadcrumbs } from './Breadcrumbs';
-import { Sidebar } from './docs/Sidebar';
-import { Stack } from './primitives/Stack';
-import { Header } from './Header';
-import { Footer, DocsFooter } from './Footer';
-import { HeadingType } from './Markdoc';
+import { useMediaQuery } from '../lib/media'
+import { TableOfContents } from './docs/TableOfContents'
+import { Wrapper } from './primitives/Wrapper'
+import { EditButton } from './primitives/EditButton'
+import { Breadcrumbs } from './Breadcrumbs'
+import { Sidebar } from './docs/Sidebar'
+import { Stack } from './primitives/Stack'
+import { Header } from './Header'
+import { Footer, DocsFooter } from './Footer'
+import { type HeadingType } from './Markdoc'
-function OpenGraph({
+function OpenGraph ({
title,
description,
ogImage,
}: {
- title: string;
- description: string;
- ogImage?: string;
+ title: string
+ description: string
+ ogImage?: string
}) {
- const siteUrl = process.env.siteUrl;
+ const siteUrl = process.env.siteUrl
if (!ogImage) {
- ogImage = `${siteUrl}/og-image-landscape.png`;
+ ogImage = `${siteUrl}/og-image-landscape.png`
}
return (
@@ -43,11 +43,11 @@ function OpenGraph({
- );
+ )
}
-const pagesWithUpdatesSidebar = ['/updates'];
-export function DocsPage({
+const pagesWithUpdatesSidebar = ['/updates']
+export function DocsPage ({
children,
headings = [],
noProse,
@@ -58,22 +58,22 @@ export function DocsPage({
isIndexPage,
editPath,
}: {
- children: ReactNode;
- headings?: HeadingType[];
- noProse?: boolean;
- noRightNav?: boolean;
- title: string;
- description: string;
- ogImage?: string;
- isIndexPage?: boolean;
- editPath?: string;
+ children: ReactNode
+ headings?: HeadingType[]
+ noProse?: boolean
+ noRightNav?: boolean
+ title: string
+ description: string
+ ogImage?: string
+ isIndexPage?: boolean
+ editPath?: string
}) {
- const contentRef = useRef(null);
- const mq = useMediaQuery();
- const { pathname } = useRouter();
- const isUpdatesPage = pagesWithUpdatesSidebar.some(p => pathname.startsWith(p));
+ const contentRef = useRef(null)
+ const mq = useMediaQuery()
+ const { pathname } = useRouter()
+ const isUpdatesPage = pagesWithUpdatesSidebar.some(p => pathname.startsWith(p))
- const metaTitle = title ? `${title} - Keystone 6 Documentation` : `Keystone 6 Documentation`;
+ const metaTitle = title ? `${title} - Keystone 6 Documentation` : `Keystone 6 Documentation`
return (
@@ -141,10 +141,10 @@ export function DocsPage({
- );
+ )
}
-export function BlogPage({
+export function BlogPage ({
children,
headings = [],
noRightNav,
@@ -154,20 +154,20 @@ export function BlogPage({
isIndexPage,
editPath,
}: {
- children: ReactNode;
- headings?: HeadingType[];
- noRightNav?: boolean;
- title: string;
- description: string;
- ogImage?: string;
- isIndexPage?: boolean;
- editPath?: string;
+ children: ReactNode
+ headings?: HeadingType[]
+ noRightNav?: boolean
+ title: string
+ description: string
+ ogImage?: string
+ isIndexPage?: boolean
+ editPath?: string
}) {
- const contentRef = useRef(null);
- const mq = useMediaQuery();
- const { pathname } = useRouter();
+ const contentRef = useRef(null)
+ const mq = useMediaQuery()
+ const { pathname } = useRouter()
- const metaTitle = title ? `${title} | Keystone Blog` : `Keystone Blog`;
+ const metaTitle = title ? `${title} | Keystone Blog` : `Keystone Blog`
return (
@@ -235,21 +235,21 @@ export function BlogPage({
- );
+ )
}
-export function Page({
+export function Page ({
children,
title,
description,
ogImage,
}: {
- children: ReactNode;
- title: string;
- description: string;
- ogImage?: string;
+ children: ReactNode
+ title: string
+ description: string
+ ogImage?: string
}) {
- const metaTitle = title ? `${title} - Keystone 6` : `Keystone 6`;
+ const metaTitle = title ? `${title} - Keystone 6` : `Keystone 6`
return (
@@ -267,5 +267,5 @@ export function Page({
- );
+ )
}
diff --git a/docs/components/RelatedContent.tsx b/docs/components/RelatedContent.tsx
index bc66f26777e..964f45dac46 100644
--- a/docs/components/RelatedContent.tsx
+++ b/docs/components/RelatedContent.tsx
@@ -1,12 +1,12 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
-import { ReactNode } from 'react';
+import { jsx } from '@emotion/react'
+import { type ReactNode } from 'react'
-import { useMediaQuery } from '../lib/media';
+import { useMediaQuery } from '../lib/media'
-export function RelatedContent({ children }: { children: ReactNode }) {
- const mq = useMediaQuery();
+export function RelatedContent ({ children }: { children: ReactNode }) {
+ const mq = useMediaQuery()
return (
{children}
- );
+ )
}
diff --git a/docs/components/SkipLinks.tsx b/docs/components/SkipLinks.tsx
index 6a0056727c8..96ee3b6cf7e 100644
--- a/docs/components/SkipLinks.tsx
+++ b/docs/components/SkipLinks.tsx
@@ -1,11 +1,11 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
-import { AnchorHTMLAttributes, Fragment, useCallback } from 'react';
+import { jsx } from '@emotion/react'
+import { type AnchorHTMLAttributes, Fragment, useCallback } from 'react'
-import { useMediaQuery } from '../lib/media';
+import { useMediaQuery } from '../lib/media'
-function SkipLink(props: AnchorHTMLAttributes) {
+function SkipLink (props: AnchorHTMLAttributes) {
return (
) {
}}
{...props}
/>
- );
+ )
}
-export function SkipLinks() {
- const mq = useMediaQuery();
+export function SkipLinks () {
+ const mq = useMediaQuery()
const skip = useCallback(
() => () => {
- const skipTarget = document.getElementById('skip-link-navigation-btn');
- skipTarget?.focus();
+ const skipTarget = document.getElementById('skip-link-navigation-btn')
+ skipTarget?.focus()
},
[]
- );
+ )
return (
@@ -60,5 +60,5 @@ export function SkipLinks() {
Skip to Content
- );
+ )
}
diff --git a/docs/components/Socials.tsx b/docs/components/Socials.tsx
index ad715c6e70d..d6871714076 100644
--- a/docs/components/Socials.tsx
+++ b/docs/components/Socials.tsx
@@ -1,13 +1,13 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
-import { HTMLAttributes } from 'react';
+import { jsx } from '@emotion/react'
+import { type HTMLAttributes } from 'react'
-import { Twitter } from './icons/Twitter';
+import { Twitter } from './icons/Twitter'
// import { YouTube } from './icons/YouTube';
-import { Slack } from './icons/Slack';
+import { Slack } from './icons/Slack'
-export function Socials(props: HTMLAttributes) {
+export function Socials (props: HTMLAttributes) {
return (
) {
*/}
- );
+ )
}
diff --git a/docs/components/SubscribeForm.tsx b/docs/components/SubscribeForm.tsx
index 46c10ae5183..2953aae1e41 100644
--- a/docs/components/SubscribeForm.tsx
+++ b/docs/components/SubscribeForm.tsx
@@ -1,40 +1,40 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { Fragment, useState, ReactNode, SyntheticEvent, HTMLAttributes } from 'react';
-import { jsx } from '@emotion/react';
+import { Fragment, useState, type ReactNode, type SyntheticEvent, type HTMLAttributes } from 'react'
+import { jsx } from '@emotion/react'
-import { useMediaQuery } from '../lib/media';
-import { Button } from './primitives/Button';
-import { Field } from './primitives/Field';
-import { Stack } from './primitives/Stack';
+import { useMediaQuery } from '../lib/media'
+import { Button } from './primitives/Button'
+import { Field } from './primitives/Field'
+import { Stack } from './primitives/Stack'
const validEmail = (email: string) =>
/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(
email
- );
+ )
-const signupURL = 'https://signup.keystonejs.cloud/api/newsletter-signup';
+const signupURL = 'https://signup.keystonejs.cloud/api/newsletter-signup'
type SubscriptFormProps = {
- autoFocus?: boolean;
- children: ReactNode;
- stacked?: boolean;
-} & HTMLAttributes;
+ autoFocus?: boolean
+ children: ReactNode
+ stacked?: boolean
+} & HTMLAttributes
-export function SubscribeForm({ autoFocus, stacked, children, ...props }: SubscriptFormProps) {
- const [email, setEmail] = useState('');
- const [loading, setLoading] = useState(false);
- const [error, setError] = useState(null);
- const [formSubmitted, setFormSubmitted] = useState(false);
- const mq = useMediaQuery();
+export function SubscribeForm ({ autoFocus, stacked, children, ...props }: SubscriptFormProps) {
+ const [email, setEmail] = useState('')
+ const [loading, setLoading] = useState(false)
+ const [error, setError] = useState(null)
+ const [formSubmitted, setFormSubmitted] = useState(false)
+ const mq = useMediaQuery()
const onSubmit = (event: SyntheticEvent) => {
- event.preventDefault();
- setError(null);
+ event.preventDefault()
+ setError(null)
// Check if user wants to subscribe.
// and there's a valid email address.
// Basic validation check on the email?
- setLoading(true);
+ setLoading(true)
if (validEmail(email)) {
// if good add email to mailing list
// and redirect to dashboard.
@@ -54,25 +54,25 @@ export function SubscribeForm({ autoFocus, stacked, children, ...props }: Subscr
// any status that isn't 200 we assume is a failure
// which we want to surface to the user
res.json().then(({ error }) => {
- setError(error);
- setLoading(false);
- });
+ setError(error)
+ setLoading(false)
+ })
} else {
- setFormSubmitted(true);
+ setFormSubmitted(true)
}
})
.catch(err => {
// network errors or failed parse
- setError(err.toString());
- setLoading(false);
- });
+ setError(err.toString())
+ setLoading(false)
+ })
} else {
- setLoading(false);
+ setLoading(false)
// if email fails validation set error message
- setError('Please enter a valid email');
- return;
+ setError('Please enter a valid email')
+ return
}
- };
+ }
return !formSubmitted ? (
@@ -106,5 +106,5 @@ export function SubscribeForm({ autoFocus, stacked, children, ...props }: Subscr
) : (
❤️ Thank you for subscribing!
- );
+ )
}
diff --git a/docs/components/Theme.tsx b/docs/components/Theme.tsx
index e7eb93f4a9d..3498f0c6171 100644
--- a/docs/components/Theme.tsx
+++ b/docs/components/Theme.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx, Global } from '@emotion/react';
+import { jsx, Global } from '@emotion/react'
-import { COLORS, SPACE, TYPE, TYPESCALE } from '../lib/TOKENS';
+import { COLORS, SPACE, TYPE, TYPESCALE } from '../lib/TOKENS'
-export function Theme() {
+export function Theme () {
return (
- );
+ )
}
diff --git a/docs/components/ThemeToggle.tsx b/docs/components/ThemeToggle.tsx
index b48a73b9a24..a4ddb1c1f3a 100644
--- a/docs/components/ThemeToggle.tsx
+++ b/docs/components/ThemeToggle.tsx
@@ -1,44 +1,44 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { Fragment, useState, useEffect, HTMLAttributes } from 'react';
-import { jsx } from '@emotion/react';
+import { Fragment, useState, useEffect, type HTMLAttributes } from 'react'
+import { jsx } from '@emotion/react'
-import { COLORS } from '../lib/TOKENS';
-import { LightMode } from './icons/LightMode';
-import { DarkMode } from './icons/DarkMode';
+import { type COLORS } from '../lib/TOKENS'
+import { LightMode } from './icons/LightMode'
+import { DarkMode } from './icons/DarkMode'
-function ModeIcon({ theme }: { theme: 'light' | 'dark' }) {
+function ModeIcon ({ theme }: { theme: 'light' | 'dark' }) {
if (theme === 'dark') {
- return ;
+ return
}
- return ;
+ return
}
-export function ThemeToggle(props: HTMLAttributes) {
+export function ThemeToggle (props: HTMLAttributes) {
/*
We don't want to render the toggle during server rendering
because Next will always server render the light mode toggle and hydrate the light mode toggle
even if the theme is dark mode based on system preference.
So we render the toggle only on the client
*/
- const [theme, setTheme] = useState(null);
+ const [theme, setTheme] = useState(null)
useEffect(() => {
- const currentTheme = document.documentElement.getAttribute('data-theme') as 'light' | 'dark';
- setTheme(currentTheme);
- }, [setTheme]);
+ const currentTheme = document.documentElement.getAttribute('data-theme') as 'light' | 'dark'
+ setTheme(currentTheme)
+ }, [setTheme])
const handleThemeChange = () => {
- const newTheme = theme === 'dark' ? 'light' : 'dark';
+ const newTheme = theme === 'dark' ? 'light' : 'dark'
if (newTheme === 'dark') {
- document.documentElement.setAttribute('data-theme', 'dark');
+ document.documentElement.setAttribute('data-theme', 'dark')
} else {
- document.documentElement.setAttribute('data-theme', 'light');
+ document.documentElement.setAttribute('data-theme', 'light')
}
- setTheme(newTheme);
- localStorage.setItem('theme', newTheme);
- };
+ setTheme(newTheme)
+ localStorage.setItem('theme', newTheme)
+ }
return (
@@ -67,5 +67,5 @@ export function ThemeToggle(props: HTMLAttributes) {
{theme === null ? : }
- );
+ )
}
diff --git a/docs/components/content/AdvancedReactCta.tsx b/docs/components/content/AdvancedReactCta.tsx
index 08a6b450463..8574136c0e9 100644
--- a/docs/components/content/AdvancedReactCta.tsx
+++ b/docs/components/content/AdvancedReactCta.tsx
@@ -1,20 +1,20 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import type { HTMLAttributes } from 'react';
-import { jsx } from '@emotion/react';
-import Image from 'next/image';
+import type { HTMLAttributes } from 'react'
+import { jsx } from '@emotion/react'
+import Image from 'next/image'
-import wesBosCta from '../../public/assets/wesbos-cta.jpg';
+import wesBosCta from '../../public/assets/wesbos-cta.jpg'
-import { useMediaQuery } from '../../lib/media';
-import { Button } from '../primitives/Button';
-import { Type } from '../primitives/Type';
-import { ArrowR } from '../icons/ArrowR';
-import { Tick } from '../icons/Tick';
-import { Section } from './Section';
+import { useMediaQuery } from '../../lib/media'
+import { Button } from '../primitives/Button'
+import { Type } from '../primitives/Type'
+import { ArrowR } from '../icons/ArrowR'
+import { Tick } from '../icons/Tick'
+import { Section } from './Section'
-export function AdvancedReactCta(props: HTMLAttributes) {
- const mq = useMediaQuery();
+export function AdvancedReactCta (props: HTMLAttributes) {
+ const mq = useMediaQuery()
return (
- );
+ )
}
diff --git a/docs/components/content/CodeBox.tsx b/docs/components/content/CodeBox.tsx
index 83f06f9349c..bd10b71cb8b 100644
--- a/docs/components/content/CodeBox.tsx
+++ b/docs/components/content/CodeBox.tsx
@@ -1,32 +1,32 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { HTMLAttributes, useEffect, useState } from 'react';
-import { jsx } from '@emotion/react';
-import copy from 'clipboard-copy';
+import { type HTMLAttributes, useEffect, useState } from 'react'
+import { jsx } from '@emotion/react'
+import copy from 'clipboard-copy'
-import { CheckIcon } from '@keystone-ui/icons/icons/CheckIcon';
-import { Copy } from '../icons/Copy';
+import { CheckIcon } from '@keystone-ui/icons/icons/CheckIcon'
+import { Copy } from '../icons/Copy'
type CodeBoxProps = {
- code: string;
-} & HTMLAttributes;
+ code: string
+} & HTMLAttributes
-export function CodeBox({ code, ...props }: CodeBoxProps) {
- const [didJustCopy, setDidJustCopy] = useState(false);
+export function CodeBox ({ code, ...props }: CodeBoxProps) {
+ const [didJustCopy, setDidJustCopy] = useState(false)
useEffect(() => {
if (didJustCopy) {
- const timeout = setTimeout(() => setDidJustCopy(false), 1000);
- return () => clearTimeout(timeout);
+ const timeout = setTimeout(() => setDidJustCopy(false), 1000)
+ return () => clearTimeout(timeout)
}
- }, [didJustCopy]);
+ }, [didJustCopy])
const handleCopy = async () => {
try {
- await copy(code);
- setDidJustCopy(true);
+ await copy(code)
+ setDidJustCopy(true)
// we don't want to do anything if the copy fails
} catch {}
- };
+ }
return (
: }
- );
+ )
}
diff --git a/docs/components/content/CodeWindow.tsx b/docs/components/content/CodeWindow.tsx
index dbaa5027f55..a764806cc46 100644
--- a/docs/components/content/CodeWindow.tsx
+++ b/docs/components/content/CodeWindow.tsx
@@ -1,17 +1,17 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import type { HTMLAttributes } from 'react';
-import { jsx } from '@emotion/react';
+import type { HTMLAttributes } from 'react'
+import { jsx } from '@emotion/react'
-import { useMediaQuery } from '../../lib/media';
+import { useMediaQuery } from '../../lib/media'
const codeFontStyle = {
fontSize: 13,
lineHeight: 1.6,
fontFamily: 'var(--font-mono)',
-};
+}
-function MenuBtn(props: HTMLAttributes) {
+function MenuBtn (props: HTMLAttributes) {
return (
) {
}}
{...props}
/>
- );
+ )
}
-export function WindowWrapper(props: HTMLAttributes) {
+export function WindowWrapper (props: HTMLAttributes) {
return (
) {
}}
{...props}
/>
- );
+ )
}
-export function WindowL(props: HTMLAttributes
) {
+export function WindowL (props: HTMLAttributes) {
return (
) {
}}
{...props}
/>
- );
+ )
}
-export function WindowR(props: HTMLAttributes) {
+export function WindowR (props: HTMLAttributes) {
return (
) {
}}
{...props}
/>
- );
+ )
}
type CodeWindowProps = {
- lines: number;
-} & HTMLAttributes;
+ lines: number
+} & HTMLAttributes
-export function CodeWindow({ lines = 1, children, ...props }: CodeWindowProps) {
- const mq = useMediaQuery();
+export function CodeWindow ({ lines = 1, children, ...props }: CodeWindowProps) {
+ const mq = useMediaQuery()
return (
- );
+ )
}
diff --git a/docs/components/content/CommunityCta.tsx b/docs/components/content/CommunityCta.tsx
index cdc78e7b246..5134bf8e3ea 100644
--- a/docs/components/content/CommunityCta.tsx
+++ b/docs/components/content/CommunityCta.tsx
@@ -1,20 +1,20 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import type { HTMLAttributes } from 'react';
-import { jsx } from '@emotion/react';
-import Image from 'next/image';
+import type { HTMLAttributes } from 'react'
+import { jsx } from '@emotion/react'
+import Image from 'next/image'
-import communityMap from '../../public/assets/community-map.png';
+import communityMap from '../../public/assets/community-map.png'
-import { useMediaQuery } from '../../lib/media';
-import { Button } from '../primitives/Button';
-import { Type } from '../primitives/Type';
-import { ArrowR } from '../icons/ArrowR';
-import { Tick } from '../icons/Tick';
-import { Section } from './Section';
+import { useMediaQuery } from '../../lib/media'
+import { Button } from '../primitives/Button'
+import { Type } from '../primitives/Type'
+import { ArrowR } from '../icons/ArrowR'
+import { Tick } from '../icons/Tick'
+import { Section } from './Section'
-export function CommunityCta(props: HTMLAttributes) {
- const mq = useMediaQuery();
+export function CommunityCta (props: HTMLAttributes) {
+ const mq = useMediaQuery()
return (
- );
+ )
}
diff --git a/docs/components/content/CustomerCard.tsx b/docs/components/content/CustomerCard.tsx
index 0766312cb99..a094e15a6f5 100644
--- a/docs/components/content/CustomerCard.tsx
+++ b/docs/components/content/CustomerCard.tsx
@@ -1,18 +1,18 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import type { HTMLAttributes } from 'react';
-import { jsx } from '@emotion/react';
+import type { HTMLAttributes } from 'react'
+import { jsx } from '@emotion/react'
-import { Type } from '../primitives/Type';
-import { IconProps } from '../icons/util';
+import { Type } from '../primitives/Type'
+import { type IconProps } from '../icons/util'
type CustomerCardProps = {
- icon: (props: IconProps) => JSX.Element;
- title: string;
- accessibleTitle?: string;
-} & HTMLAttributes;
+ icon: (props: IconProps) => JSX.Element
+ title: string
+ accessibleTitle?: string
+} & HTMLAttributes
-export function CustomerCard({
+export function CustomerCard ({
icon: Icon,
accessibleTitle,
title,
@@ -42,5 +42,5 @@ export function CustomerCard({
{children}
- );
+ )
}
diff --git a/docs/components/content/EndCta.tsx b/docs/components/content/EndCta.tsx
index 6f51fc41447..978d31758f6 100644
--- a/docs/components/content/EndCta.tsx
+++ b/docs/components/content/EndCta.tsx
@@ -1,23 +1,23 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
-import { HTMLAttributes } from 'react';
+import { jsx } from '@emotion/react'
+import { type HTMLAttributes } from 'react'
-import { Highlight } from '../primitives/Highlight';
-import { Button } from '../primitives/Button';
-import { Type } from '../primitives/Type';
-import { ArrowR } from '../icons/ArrowR';
-import { useMediaQuery } from '../../lib/media';
-import { Tick } from '../icons/Tick';
-import { CodeBox } from './CodeBox';
-import { Section } from './Section';
+import { Highlight } from '../primitives/Highlight'
+import { Button } from '../primitives/Button'
+import { Type } from '../primitives/Type'
+import { ArrowR } from '../icons/ArrowR'
+import { useMediaQuery } from '../../lib/media'
+import { Tick } from '../icons/Tick'
+import { CodeBox } from './CodeBox'
+import { Section } from './Section'
type EndCtaProps = {
- grad?: 'grad1' | 'grad2' | 'grad3' | 'grad4' | 'grad5';
-} & HTMLAttributes;
+ grad?: 'grad1' | 'grad2' | 'grad3' | 'grad4' | 'grad5'
+} & HTMLAttributes
-export function EndCta({ grad = 'grad1', ...props }: EndCtaProps) {
- const mq = useMediaQuery();
+export function EndCta ({ grad = 'grad1', ...props }: EndCtaProps) {
+ const mq = useMediaQuery()
return (
- );
+ )
}
diff --git a/docs/components/content/Intro.tsx b/docs/components/content/Intro.tsx
index 4efa0a75260..8eb7077ef8b 100644
--- a/docs/components/content/Intro.tsx
+++ b/docs/components/content/Intro.tsx
@@ -1,11 +1,11 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { HTMLAttributes } from 'react';
-import { jsx } from '@emotion/react';
+import { type HTMLAttributes } from 'react'
+import { jsx } from '@emotion/react'
-import { Type } from '../primitives/Type';
+import { Type } from '../primitives/Type'
-export function IntroWrapper(props: HTMLAttributes) {
+export function IntroWrapper (props: HTMLAttributes) {
return (
) {
}}
{...props}
/>
- );
+ )
}
-export function IntroHeading(props: HTMLAttributes
) {
+export function IntroHeading (props: HTMLAttributes) {
return (
) {
}}
{...props}
/>
- );
+ )
}
-export function IntroLead(props: HTMLAttributes) {
+export function IntroLead (props: HTMLAttributes) {
return (
) {
}}
{...props}
/>
- );
+ )
}
diff --git a/docs/components/content/MWrapper.tsx b/docs/components/content/MWrapper.tsx
index dfbfae84f78..16fbb3c07d6 100644
--- a/docs/components/content/MWrapper.tsx
+++ b/docs/components/content/MWrapper.tsx
@@ -1,16 +1,16 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import type { ElementType, HTMLAttributes } from 'react';
-import { jsx } from '@emotion/react';
+import type { ElementType, HTMLAttributes } from 'react'
+import { jsx } from '@emotion/react'
-import { useMediaQuery } from '../../lib/media';
+import { useMediaQuery } from '../../lib/media'
type MWrapperProps = {
- as?: ElementType;
-} & HTMLAttributes;
+ as?: ElementType
+} & HTMLAttributes
-export function MWrapper({ as: Tag = 'div', ...props }: MWrapperProps) {
- const mq = useMediaQuery();
+export function MWrapper ({ as: Tag = 'div', ...props }: MWrapperProps) {
+ const mq = useMediaQuery()
return (
- );
+ )
}
diff --git a/docs/components/content/Pill.tsx b/docs/components/content/Pill.tsx
index 91ad05d9c47..9a9105a812d 100644
--- a/docs/components/content/Pill.tsx
+++ b/docs/components/content/Pill.tsx
@@ -1,13 +1,13 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
-import { HTMLAttributes } from 'react';
+import { jsx } from '@emotion/react'
+import { type HTMLAttributes } from 'react'
type PillProps = {
- grad?: 'grad1' | 'grad2' | 'grad3' | 'grad4' | 'grad5' | 'grad6';
-} & HTMLAttributes;
+ grad?: 'grad1' | 'grad2' | 'grad3' | 'grad4' | 'grad5' | 'grad6'
+} & HTMLAttributes
-export function Pill({ grad = 'grad1', ...props }: PillProps) {
+export function Pill ({ grad = 'grad1', ...props }: PillProps) {
return (
- );
+ )
}
diff --git a/docs/components/content/PillCta.tsx b/docs/components/content/PillCta.tsx
index 7afbfa7cdc2..36518b8fcec 100644
--- a/docs/components/content/PillCta.tsx
+++ b/docs/components/content/PillCta.tsx
@@ -1,15 +1,15 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
-import { HTMLAttributes } from 'react';
-import { useMediaQuery } from '../../lib/media';
+import { jsx } from '@emotion/react'
+import { type HTMLAttributes } from 'react'
+import { useMediaQuery } from '../../lib/media'
type PillCtaProps = {
- grad?: 'grad1' | 'grad2' | 'grad3' | 'grad4' | 'grad5' | 'grad6';
-} & HTMLAttributes;
+ grad?: 'grad1' | 'grad2' | 'grad3' | 'grad4' | 'grad5' | 'grad6'
+} & HTMLAttributes
-export function PillCta({ grad = 'grad1', children, ...props }: PillCtaProps) {
- const mq = useMediaQuery();
+export function PillCta ({ grad = 'grad1', children, ...props }: PillCtaProps) {
+ const mq = useMediaQuery()
return (
{children}
- );
+ )
}
diff --git a/docs/components/content/Quote.tsx b/docs/components/content/Quote.tsx
index 97db9a65f03..764dd26ec10 100644
--- a/docs/components/content/Quote.tsx
+++ b/docs/components/content/Quote.tsx
@@ -1,22 +1,22 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
-import { HTMLAttributes } from 'react';
+import { jsx } from '@emotion/react'
+import { type HTMLAttributes } from 'react'
-import { useMediaQuery } from '../../lib/media';
-import { Quote as QuoteIcon } from '../icons/Quote';
-import { Type } from '../primitives/Type';
-import { Section } from './Section';
+import { useMediaQuery } from '../../lib/media'
+import { Quote as QuoteIcon } from '../icons/Quote'
+import { Type } from '../primitives/Type'
+import { Section } from './Section'
type QuoteProps = {
- name: string;
- title?: string;
- img: any;
- grad?: 'grad1' | 'grad2' | 'grad3' | 'grad4' | 'grad5' | 'grad6';
-} & HTMLAttributes;
+ name: string
+ title?: string
+ img: any
+ grad?: 'grad1' | 'grad2' | 'grad3' | 'grad4' | 'grad5' | 'grad6'
+} & HTMLAttributes
-export function Quote({ name, title, img, grad, children, ...props }: QuoteProps) {
- const mq = useMediaQuery();
+export function Quote ({ name, title, img, grad, children, ...props }: QuoteProps) {
+ const mq = useMediaQuery()
return (
@@ -70,5 +70,5 @@ export function Quote({ name, title, img, grad, children, ...props }: QuoteProps
- );
+ )
}
diff --git a/docs/components/content/Section.tsx b/docs/components/content/Section.tsx
index 104330c1426..669ab8a838e 100644
--- a/docs/components/content/Section.tsx
+++ b/docs/components/content/Section.tsx
@@ -1,12 +1,12 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import type { HTMLAttributes } from 'react';
-import { jsx } from '@emotion/react';
+import type { HTMLAttributes } from 'react'
+import { jsx } from '@emotion/react'
-import { useMediaQuery } from '../../lib/media';
+import { useMediaQuery } from '../../lib/media'
-export function Section(props: HTMLAttributes) {
- const mq = useMediaQuery();
+export function Section (props: HTMLAttributes) {
+ const mq = useMediaQuery()
return (
) {
})}
{...props}
/>
- );
+ )
}
type SideBySideSectionProps = {
- reverse?: boolean;
-} & HTMLAttributes;
+ reverse?: boolean
+} & HTMLAttributes
-export function SideBySideSection({ reverse, children, ...props }: SideBySideSectionProps) {
- const mq = useMediaQuery();
+export function SideBySideSection ({ reverse, children, ...props }: SideBySideSectionProps) {
+ const mq = useMediaQuery()
return (
- );
+ )
}
diff --git a/docs/components/content/TweetBox.tsx b/docs/components/content/TweetBox.tsx
index 8af5af75ac5..0205cb6cca0 100644
--- a/docs/components/content/TweetBox.tsx
+++ b/docs/components/content/TweetBox.tsx
@@ -1,18 +1,18 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import type { HTMLAttributes } from 'react';
-import { jsx } from '@emotion/react';
+import type { HTMLAttributes } from 'react'
+import { jsx } from '@emotion/react'
-import { Type } from '../primitives/Type';
-import { Quote } from '../icons/Quote';
+import { Type } from '../primitives/Type'
+import { Quote } from '../icons/Quote'
type TweetBoxProps = {
- user: string;
- img: string;
- grad: 'grad1' | 'grad2' | 'grad3' | 'grad4' | 'grad5';
-} & HTMLAttributes;
+ user: string
+ img: string
+ grad: 'grad1' | 'grad2' | 'grad3' | 'grad4' | 'grad5'
+} & HTMLAttributes
-export function TweetBox({ user, img, grad, children, ...props }: TweetBoxProps) {
+export function TweetBox ({ user, img, grad, children, ...props }: TweetBoxProps) {
return (
- );
+ )
}
diff --git a/docs/components/docs/ComingSoon.tsx b/docs/components/docs/ComingSoon.tsx
index 1bac565e554..04e71539d17 100644
--- a/docs/components/docs/ComingSoon.tsx
+++ b/docs/components/docs/ComingSoon.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Alert } from '../primitives/Alert';
+import { Alert } from '../primitives/Alert'
-export function ComingSoon() {
+export function ComingSoon () {
return (
- );
+ )
}
diff --git a/docs/components/docs/CommunitySlackCTA.tsx b/docs/components/docs/CommunitySlackCTA.tsx
index dbc7cbd8119..8534baf3674 100644
--- a/docs/components/docs/CommunitySlackCTA.tsx
+++ b/docs/components/docs/CommunitySlackCTA.tsx
@@ -1,12 +1,12 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Alert } from '../primitives/Alert';
-import { Button } from '../primitives/Button';
-import { ArrowR } from '../icons/ArrowR';
+import { Alert } from '../primitives/Alert'
+import { Button } from '../primitives/Button'
+import { ArrowR } from '../icons/ArrowR'
-export function CommunitySlackCTA() {
+export function CommunitySlackCTA () {
return (
- );
+ )
}
diff --git a/docs/components/docs/CopyToClipboard.tsx b/docs/components/docs/CopyToClipboard.tsx
index 591eb68b568..ccd49113b63 100644
--- a/docs/components/docs/CopyToClipboard.tsx
+++ b/docs/components/docs/CopyToClipboard.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Link } from '../icons/Link';
+import { Link } from '../icons/Link'
-export function HeadingIdLink({ value }: { value: string }) {
+export function HeadingIdLink ({ value }: { value: string }) {
return (
- );
+ )
}
diff --git a/docs/components/docs/DocsFooter.tsx b/docs/components/docs/DocsFooter.tsx
index a4cf69e8bb7..219f598b4cd 100644
--- a/docs/components/docs/DocsFooter.tsx
+++ b/docs/components/docs/DocsFooter.tsx
@@ -1,11 +1,11 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Wrapper } from '../primitives/Wrapper';
-import { Emoji } from '../primitives/Emoji';
+import { Wrapper } from '../primitives/Wrapper'
+import { Emoji } from '../primitives/Emoji'
-export function DocsFooter() {
+export function DocsFooter () {
return (
by the awesome Keystone community.
- );
+ )
}
diff --git a/docs/components/docs/DocumentEditorDemo.tsx b/docs/components/docs/DocumentEditorDemo.tsx
index dc1e2a5b259..5ad931836f2 100644
--- a/docs/components/docs/DocumentEditorDemo.tsx
+++ b/docs/components/docs/DocumentEditorDemo.tsx
@@ -1,26 +1,26 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import React, { ReactNode, useContext, useEffect, useMemo, useState } from 'react';
-import { DocumentFeatures } from '@keystone-6/fields-document/views';
+import React, { type ReactNode, useContext, useEffect, useMemo, useState } from 'react'
+import { type DocumentFeatures } from '@keystone-6/fields-document/views'
import {
- ComponentBlock,
+ type ComponentBlock,
fields,
- InferRenderersForComponentBlocks,
-} from '@keystone-6/fields-document/component-blocks';
-import { Global, jsx } from '@emotion/react';
-import { getInitialPropsValue } from '../../../packages/fields-document/src/DocumentEditor/component-blocks/initial-values';
+ type InferRenderersForComponentBlocks,
+} from '@keystone-6/fields-document/component-blocks'
+import { Global, jsx } from '@emotion/react'
+import { getInitialPropsValue } from '../../../packages/fields-document/src/DocumentEditor/component-blocks/initial-values'
import {
createDocumentEditor,
DocumentEditor,
Editor,
-} from '../../../packages/fields-document/src/DocumentEditor';
-import { FormValueContentFromPreviewProps } from '../../../packages/fields-document/src/DocumentEditor/component-blocks/form-from-preview';
-import { createGetPreviewProps } from '../../../packages/fields-document/src/DocumentEditor/component-blocks/preview-props';
-import { componentBlocks as componentBlocksInSandboxProject } from '../../../tests/sandbox/component-blocks';
-import { initialContent } from '../../lib/initialDocumentDemoContent';
-import { Code } from '../primitives/Code';
+} from '../../../packages/fields-document/src/DocumentEditor'
+import { FormValueContentFromPreviewProps } from '../../../packages/fields-document/src/DocumentEditor/component-blocks/form-from-preview'
+import { createGetPreviewProps } from '../../../packages/fields-document/src/DocumentEditor/component-blocks/preview-props'
+import { componentBlocks as componentBlocksInSandboxProject } from '../../../tests/sandbox/component-blocks'
+import { initialContent } from '../../lib/initialDocumentDemoContent'
+import { Code } from '../primitives/Code'
-const headingLevels = ['1', '2', '3', '4', '5', '6'] as const;
+const headingLevels = ['1', '2', '3', '4', '5', '6'] as const
const marks = [
'bold',
@@ -31,7 +31,7 @@ const marks = [
'subscript',
'superscript',
'underline',
-] as const;
+] as const
const documentFeaturesProp = fields.object({
inlineMarks: fields.multiselect({
@@ -69,15 +69,15 @@ const documentFeaturesProp = fields.object({
}),
layouts: fields.checkbox({ label: 'Layouts', defaultValue: true }),
useShorthand: fields.checkbox({ label: 'Use shorthand in code example', defaultValue: true }),
-});
+})
type DocumentFeaturesFormValue = Parameters<
InferRenderersForComponentBlocks<
Record<'documentFeatures', ComponentBlock<(typeof documentFeaturesProp)['fields']>>
>['documentFeatures']
->[0];
+>[0]
-const emptyObj = {};
+const emptyObj = {}
const componentBlocks = {
notice: componentBlocksInSandboxProject.notice,
@@ -85,11 +85,11 @@ const componentBlocks = {
quote: componentBlocksInSandboxProject.quote,
checkboxList: componentBlocksInSandboxProject.checkboxList,
carousel: componentBlocksInSandboxProject.carousel,
-};
+}
-type DocumentFieldConfig = Parameters[0];
+type DocumentFieldConfig = Parameters[0]
-function documentFeaturesCodeExample(config: DocumentFieldConfig | DocumentFeatures) {
+function documentFeaturesCodeExample (config: DocumentFieldConfig | DocumentFeatures) {
return `import { config, list } from '@keystone-6/core';
import { document } from '@keystone-6/fields-document';
@@ -130,10 +130,10 @@ export default config({
},
/* ... */
});
-`;
+`
}
-function documentFeaturesToShorthand(documentFeatures: DocumentFeatures): DocumentFieldConfig {
+function documentFeaturesToShorthand (documentFeatures: DocumentFeatures): DocumentFieldConfig {
return {
formatting: objToShorthand({
alignment: objToShorthand({
@@ -164,31 +164,31 @@ function documentFeaturesToShorthand(documentFeatures: DocumentFeatures): Docume
links: boolToTrueOrUndefined(documentFeatures.links),
layouts: documentFeatures.layouts.length === 0 ? undefined : documentFeatures.layouts,
dividers: boolToTrueOrUndefined(documentFeatures.dividers),
- };
+ }
}
function objToShorthand<
Obj extends Record>
->(obj: Obj): Obj | true | undefined {
- const values = Object.values(obj);
- let state: (typeof values)[number] = values[0]!;
+> (obj: Obj): Obj | true | undefined {
+ const values = Object.values(obj)
+ let state: (typeof values)[number] = values[0]!
for (const val of values) {
if (val !== state || (val !== undefined && val !== true)) {
- return obj;
+ return obj
}
}
- return state as any;
+ return state as any
}
-function boolToTrueOrUndefined(bool: boolean): true | undefined {
- return bool ? true : undefined;
+function boolToTrueOrUndefined (bool: boolean): true | undefined {
+ return bool ? true : undefined
}
const fromEntriesButTypedWell: (
iterable: Iterable
-) => Record = Object.fromEntries;
+) => Record = Object.fromEntries
-function documentFeaturesFormToValue(formValue: DocumentFeaturesFormValue): DocumentFeatures {
+function documentFeaturesFormToValue (formValue: DocumentFeaturesFormValue): DocumentFeatures {
return {
formatting: {
alignment: {
@@ -201,7 +201,7 @@ function documentFeaturesFormToValue(formValue: DocumentFeaturesFormValue): Docu
},
inlineMarks: fromEntriesButTypedWell(
marks.map(mark => {
- return [mark, formValue.inlineMarks.includes(mark)];
+ return [mark, formValue.inlineMarks.includes(mark)]
})
),
headingLevels: formValue.blocks
@@ -225,19 +225,19 @@ function documentFeaturesFormToValue(formValue: DocumentFeaturesFormValue): Docu
]
: [],
dividers: formValue.dividers,
- };
+ }
}
const DocumentFeaturesContext = React.createContext<{
- documentFeatures: DocumentFeatures;
- formValue: DocumentFeaturesFormValue;
- setFormValue: (value: DocumentFeaturesFormValue) => void;
-}>({} as any);
+ documentFeatures: DocumentFeatures
+ formValue: DocumentFeaturesFormValue
+ setFormValue:(value: DocumentFeaturesFormValue) => void
+}>({} as any)
-export function DocumentFeaturesProvider({ children }: { children: ReactNode }) {
+export function DocumentFeaturesProvider ({ children }: { children: ReactNode }) {
const [formValue, setFormValue] = useState(() =>
getInitialPropsValue(documentFeaturesProp)
- );
+ )
return (
{children}
- );
+ )
}
-export function DocumentFeaturesFormAndCode() {
- const { formValue, setFormValue } = useContext(DocumentFeaturesContext);
+export function DocumentFeaturesFormAndCode () {
+ const { formValue, setFormValue } = useContext(DocumentFeaturesContext)
return (
{
- setFormValue(getNewVal(formValue));
+ setFormValue(getNewVal(formValue))
},
() => undefined
)(formValue)}
/>
- );
+ )
}
export const DocumentEditorDemo = () => {
- const [value, setValue] = useState(initialContent as any);
- const [key, setKey] = useState(0);
- const { documentFeatures, formValue } = useContext(DocumentFeaturesContext);
+ const [value, setValue] = useState(initialContent as any)
+ const [key, setKey] = useState(0)
+ const { documentFeatures, formValue } = useContext(DocumentFeaturesContext)
useEffect(() => {
// we want to force normalize when the document features change so
// that no invalid things exist after a user changes something
- const editor = createDocumentEditor(documentFeatures, componentBlocks, emptyObj);
- editor.children = value;
- Editor.normalize(editor, { force: true });
- setValue(editor.children);
+ const editor = createDocumentEditor(documentFeatures, componentBlocks, emptyObj)
+ editor.children = value
+ Editor.normalize(editor, { force: true })
+ setValue(editor.children)
// slate looks like it's a controlled component but it actually isn't
// so we need to re-mount it so that it looks at the updated value
- setKey(x => x + 1);
+ setKey(x => x + 1)
// eslint-disable-next-line react-hooks/exhaustive-deps
- }, [documentFeatures]);
+ }, [documentFeatures])
return (
{
{JSON.stringify(value, null, 2)}
- );
-};
+ )
+}
diff --git a/docs/components/docs/ExamplesList.tsx b/docs/components/docs/ExamplesList.tsx
index 1c93ed83c33..f63c6818dcf 100644
--- a/docs/components/docs/ExamplesList.tsx
+++ b/docs/components/docs/ExamplesList.tsx
@@ -1,13 +1,13 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Well } from '../primitives/Well';
-import { useMediaQuery } from '../../lib/media';
-import { InlineCode } from '../../components/primitives/Code';
+import { Well } from '../primitives/Well'
+import { useMediaQuery } from '../../lib/media'
+import { InlineCode } from '../../components/primitives/Code'
-export function Examples() {
- const mq = useMediaQuery();
+export function Examples () {
+ const mq = useMediaQuery()
return (
- );
+ )
}
diff --git a/docs/components/docs/GitHubExamplesCTA.tsx b/docs/components/docs/GitHubExamplesCTA.tsx
index 1685463f620..e4753ef1f86 100644
--- a/docs/components/docs/GitHubExamplesCTA.tsx
+++ b/docs/components/docs/GitHubExamplesCTA.tsx
@@ -1,12 +1,12 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Alert } from '../primitives/Alert';
-import { Button } from '../primitives/Button';
-import { ArrowR } from '../icons/ArrowR';
+import { Alert } from '../primitives/Alert'
+import { Button } from '../primitives/Button'
+import { ArrowR } from '../icons/ArrowR'
-export function GitHubExamplesCTA() {
+export function GitHubExamplesCTA () {
return (
- );
+ )
}
diff --git a/docs/components/docs/Heading.tsx b/docs/components/docs/Heading.tsx
index 37f7a9057ea..5ae725e74a7 100644
--- a/docs/components/docs/Heading.tsx
+++ b/docs/components/docs/Heading.tsx
@@ -1,22 +1,22 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import slugify from '@sindresorhus/slugify';
-import { jsx } from '@emotion/react';
-import { ReactNode } from 'react';
+import slugify from '@sindresorhus/slugify'
+import { jsx } from '@emotion/react'
+import { type ReactNode } from 'react'
-import { HeadingIdLink } from './CopyToClipboard';
+import { HeadingIdLink } from './CopyToClipboard'
/*
* !THIS IS OLD. PLEASE USE THE Type COMPONENT INSTEAD!
*/
-function getAnchor(text: string | string[]) {
+function getAnchor (text: string | string[]) {
if (typeof text === 'string') {
- return slugify(text);
+ return slugify(text)
} else if (Array.isArray(text)) {
- return slugify(text.join('-').replace('[object Object]', ''));
+ return slugify(text.join('-').replace('[object Object]', ''))
} else {
- return '';
+ return ''
}
}
@@ -46,21 +46,21 @@ const headingStyles = {
6: {
fontSize: 'var(--font-xsmall)',
},
-};
+}
type BaseHeadingProps = {
- className?: string;
- children: ReactNode;
-} & ({ id: string } | { id?: undefined; children: string });
+ className?: string
+ children: ReactNode
+} & ({ id: string } | { id?: undefined, children: string })
type HeadingProps = BaseHeadingProps & {
- level: 1 | 2 | 3 | 4 | 5 | 6;
-};
+ level: 1 | 2 | 3 | 4 | 5 | 6
+}
-export function Heading({ level, id, children, ...props }: HeadingProps) {
- const hasHeadingIdLink = level > 1 && level < 5;
- const computedId = id === undefined ? getAnchor(children) : id;
- const Tag = `h${level}` as const;
+export function Heading ({ level, id, children, ...props }: HeadingProps) {
+ const hasHeadingIdLink = level > 1 && level < 5
+ const computedId = id === undefined ? getAnchor(children) : id
+ const Tag = `h${level}` as const
return (
- );
+ )
}
-export function H1(props: BaseHeadingProps) {
- return ;
+export function H1 (props: BaseHeadingProps) {
+ return
}
-export function H2(props: BaseHeadingProps) {
- return ;
+export function H2 (props: BaseHeadingProps) {
+ return
}
-export function H3(props: BaseHeadingProps) {
- return ;
+export function H3 (props: BaseHeadingProps) {
+ return
}
-export function H4(props: BaseHeadingProps) {
- return ;
+export function H4 (props: BaseHeadingProps) {
+ return
}
-export function H5(props: BaseHeadingProps) {
- return ;
+export function H5 (props: BaseHeadingProps) {
+ return
}
-export function H6(props: BaseHeadingProps) {
- return ;
+export function H6 (props: BaseHeadingProps) {
+ return
}
diff --git a/docs/components/docs/Keystone5DocsCTA.tsx b/docs/components/docs/Keystone5DocsCTA.tsx
index 958c0ec88e1..d600e9365c4 100644
--- a/docs/components/docs/Keystone5DocsCTA.tsx
+++ b/docs/components/docs/Keystone5DocsCTA.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Alert } from '../primitives/Alert';
+import { Alert } from '../primitives/Alert'
-export function Keystone5DocsCTA() {
+export function Keystone5DocsCTA () {
return (
- );
+ )
}
diff --git a/docs/components/docs/Navigation.tsx b/docs/components/docs/Navigation.tsx
index 36ca0ea046b..1deed57b8c9 100644
--- a/docs/components/docs/Navigation.tsx
+++ b/docs/components/docs/Navigation.tsx
@@ -1,74 +1,74 @@
/** @jsxRuntime classic */
/** @jsx jsx */
import {
- AnchorHTMLAttributes,
- ReactNode,
+ type AnchorHTMLAttributes,
+ type ReactNode,
useState,
createContext,
useContext,
useMemo,
-} from 'react';
-import { useRouter } from 'next/router';
-import { jsx } from '@emotion/react';
-import Link from 'next/link';
+} from 'react'
+import { useRouter } from 'next/router'
+import { jsx } from '@emotion/react'
+import Link from 'next/link'
-import { useMediaQuery } from '../../lib/media';
-import { useHeaderContext } from '../Header';
-import { Badge } from '../primitives/Badge';
-import { ArrowR } from '../icons/ArrowR';
+import { useMediaQuery } from '../../lib/media'
+import { useHeaderContext } from '../Header'
+import { Badge } from '../primitives/Badge'
+import { ArrowR } from '../icons/ArrowR'
type NavContext = {
- isSectionCollapsed: (title: string) => boolean;
- collapseSection: (title: string) => void;
- expandSection: (title: string) => void;
-};
+ isSectionCollapsed: (title: string) => boolean
+ collapseSection: (title: string) => void
+ expandSection: (title: string) => void
+}
-const NavContext = createContext(undefined);
+const NavContext = createContext(undefined)
/* Save section collapse/expand states */
export const NavContextProvider = ({ children }: { children: ReactNode }) => {
- const [collapsedSections, setCollapsedSections] = useState([]);
+ const [collapsedSections, setCollapsedSections] = useState([])
const contextValue = useMemo(() => {
const collapseSection = (title: string) => {
- const isSectionAlreadyCollapsed = collapsedSections.includes(title);
+ const isSectionAlreadyCollapsed = collapsedSections.includes(title)
if (!isSectionAlreadyCollapsed) {
- setCollapsedSections([...collapsedSections, title]);
+ setCollapsedSections([...collapsedSections, title])
}
- };
+ }
const expandSection = (title: string) => {
- const isSectionAlreadyExpanded = !collapsedSections.includes(title);
+ const isSectionAlreadyExpanded = !collapsedSections.includes(title)
if (!isSectionAlreadyExpanded) {
- setCollapsedSections(collapsedSections.filter(cs => cs !== title));
+ setCollapsedSections(collapsedSections.filter(cs => cs !== title))
}
- };
+ }
const isSectionCollapsed = (title: string) => {
- return collapsedSections.some(cs => cs === title);
- };
+ return collapsedSections.some(cs => cs === title)
+ }
- return { isSectionCollapsed, collapseSection, expandSection };
- }, [collapsedSections, setCollapsedSections]);
+ return { isSectionCollapsed, collapseSection, expandSection }
+ }, [collapsedSections, setCollapsedSections])
- return {children} ;
-};
+ return {children}
+}
const useNavContext = () => {
- const navContext = useContext(NavContext);
+ const navContext = useContext(NavContext)
if (navContext === undefined) {
- throw new Error('NavContextProvider is not wrapped in the tree');
+ throw new Error('NavContextProvider is not wrapped in the tree')
}
- return navContext;
-};
+ return navContext
+}
type NavSectionProps = {
- title: string;
- children: ReactNode;
-};
+ title: string
+ children: ReactNode
+}
-function NavSection({ title, children }: NavSectionProps) {
- const { isSectionCollapsed, collapseSection, expandSection } = useNavContext();
- const isCollapsed = isSectionCollapsed(title);
+function NavSection ({ title, children }: NavSectionProps) {
+ const { isSectionCollapsed, collapseSection, expandSection } = useNavContext()
+ const isCollapsed = isSectionCollapsed(title)
return (
- );
+ )
}
type NavItemProps = {
- href: string;
- isActive?: boolean;
- isPlaceholder?: boolean;
- alwaysVisible?: boolean;
-} & AnchorHTMLAttributes;
+ href: string
+ isActive?: boolean
+ isPlaceholder?: boolean
+ alwaysVisible?: boolean
+} & AnchorHTMLAttributes
-export function NavItem({
+export function NavItem ({
href,
isActive: _isActive,
isPlaceholder,
alwaysVisible,
...props
}: NavItemProps) {
- const { asPath } = useRouter();
- const mq = useMediaQuery();
- const isActive = typeof _isActive !== 'undefined' ? _isActive : asPath === href;
- const ctx = useHeaderContext();
- const isMobileNavOpen = ctx ? ctx.mobileNavIsOpen : true;
- const desktopOpenState = ctx ? ctx.desktopOpenState : -1;
+ const { asPath } = useRouter()
+ const mq = useMediaQuery()
+ const isActive = typeof _isActive !== 'undefined' ? _isActive : asPath === href
+ const ctx = useHeaderContext()
+ const isMobileNavOpen = ctx ? ctx.mobileNavIsOpen : true
+ const desktopOpenState = ctx ? ctx.desktopOpenState : -1
return (
- );
+ )
}
type PrimaryNavItemProps = {
- href: string;
- children: ReactNode;
-} & AnchorHTMLAttributes;
+ href: string
+ children: ReactNode
+} & AnchorHTMLAttributes
-export function PrimaryNavItem({ href, children }: PrimaryNavItemProps) {
- const { asPath } = useRouter();
- const isActive = asPath === href;
- const ctx = useHeaderContext();
- const isMobileNavOpen = ctx ? ctx.mobileNavIsOpen : true;
- const desktopOpenState = ctx ? ctx.desktopOpenState : -1;
+export function PrimaryNavItem ({ href, children }: PrimaryNavItemProps) {
+ const { asPath } = useRouter()
+ const isActive = asPath === href
+ const ctx = useHeaderContext()
+ const isMobileNavOpen = ctx ? ctx.mobileNavIsOpen : true
+ const desktopOpenState = ctx ? ctx.desktopOpenState : -1
return (
{children}
- );
+ )
}
-export function DocsNavigation() {
+export function DocsNavigation () {
return (
//
//
- );
+ )
}
-export function UpdatesNavigation() {
+export function UpdatesNavigation () {
return (
Roadmap
- );
+ )
}
diff --git a/docs/components/docs/Sidebar.tsx b/docs/components/docs/Sidebar.tsx
index dcd78c3e66b..3e27bec94e9 100644
--- a/docs/components/docs/Sidebar.tsx
+++ b/docs/components/docs/Sidebar.tsx
@@ -1,17 +1,17 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { useMediaQuery } from '../../lib/media';
-import { DocsNavigation, UpdatesNavigation } from './Navigation';
+import { useMediaQuery } from '../../lib/media'
+import { DocsNavigation, UpdatesNavigation } from './Navigation'
type SidebarProps = {
- isUpdatesPage?: boolean;
-};
+ isUpdatesPage?: boolean
+}
-export function Sidebar({ isUpdatesPage }: SidebarProps) {
- const mq = useMediaQuery();
- const Navigation = isUpdatesPage ? UpdatesNavigation : DocsNavigation;
+export function Sidebar ({ isUpdatesPage }: SidebarProps) {
+ const mq = useMediaQuery()
+ const Navigation = isUpdatesPage ? UpdatesNavigation : DocsNavigation
return (
- );
+ )
}
diff --git a/docs/components/docs/TableOfContents.tsx b/docs/components/docs/TableOfContents.tsx
index e790b7086fb..9a980797cbc 100644
--- a/docs/components/docs/TableOfContents.tsx
+++ b/docs/components/docs/TableOfContents.tsx
@@ -1,67 +1,67 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { useState, useEffect } from 'react';
-import { jsx } from '@emotion/react';
+import { useState, useEffect } from 'react'
+import { jsx } from '@emotion/react'
-import { useMediaQuery } from '../../lib/media';
-import { Type } from '../primitives/Type';
+import { useMediaQuery } from '../../lib/media'
+import { Type } from '../primitives/Type'
// it's important that IDs are sorted by the order they appear in the document
// so we can pluck active from the beginning
-function sortVisible(allIds: (string | null)[], targetId: string | null) {
+function sortVisible (allIds: (string | null)[], targetId: string | null) {
return (ids: (string | null)[] | never[]): (string | null)[] | never[] =>
- [...ids, targetId].sort((a, b) => (allIds.indexOf(a) > allIds.indexOf(b) ? 1 : -1));
+ [...ids, targetId].sort((a, b) => (allIds.indexOf(a) > allIds.indexOf(b) ? 1 : -1))
}
const observerOptions = {
rootMargin: '-10px',
threshold: 1.0,
-};
+}
interface Heading {
- id: string;
- label: string;
- depth: number;
+ id: string
+ label: string
+ depth: number
}
-export function TableOfContents({
+export function TableOfContents ({
container,
headings,
}: {
- container: React.RefObject;
- headings: Heading[];
+ container: React.RefObject
+ headings: Heading[]
}) {
- let [visibleIds, setVisibleIds] = useState>([]);
- let [lastVisibleId, setLastVisbleId] = useState(null);
+ let [visibleIds, setVisibleIds] = useState>([])
+ let [lastVisibleId, setLastVisbleId] = useState(null)
- const mq = useMediaQuery();
+ const mq = useMediaQuery()
// observe relevant headings
useEffect(() => {
if (container.current) {
- let allIds = headings.map(h => h.id);
+ let allIds = headings.map(h => h.id)
const observer = new IntersectionObserver(entries => {
entries.forEach(entry => {
- const targetId: string | null = entry.target.getAttribute('id');
+ const targetId: string | null = entry.target.getAttribute('id')
if (entry.isIntersecting && entry.intersectionRatio === 1) {
- setVisibleIds(sortVisible(allIds, targetId));
- setLastVisbleId(targetId);
+ setVisibleIds(sortVisible(allIds, targetId))
+ setLastVisbleId(targetId)
} else {
- setVisibleIds(ids => ids.filter(id => id !== targetId));
+ setVisibleIds(ids => ids.filter(id => id !== targetId))
}
- });
- }, observerOptions);
+ })
+ }, observerOptions)
container.current.querySelectorAll('h1, h2, h3').forEach((node: Element) => {
- observer.observe(node);
- });
- return () => observer.disconnect();
+ observer.observe(node)
+ })
+ return () => observer.disconnect()
}
- }, [container, headings]);
+ }, [container, headings])
// catch if we're in a long gap between headings and resolve to the last available.
- let activeId = visibleIds[0] || lastVisibleId;
+ let activeId = visibleIds[0] || lastVisibleId
return (
@@ -86,8 +86,8 @@ export function TableOfContents({
{headings.map((h: Heading, i: number) => {
- let isActive = activeId === h.id;
- const slug = `#${h.id}`;
+ let isActive = activeId === h.id
+ const slug = `#${h.id}`
return (
- );
+ )
})}
- );
+ )
}
diff --git a/docs/components/docs/WalkthroughsList.tsx b/docs/components/docs/WalkthroughsList.tsx
index 377d535f0bc..dffe232f2c8 100644
--- a/docs/components/docs/WalkthroughsList.tsx
+++ b/docs/components/docs/WalkthroughsList.tsx
@@ -1,13 +1,13 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Well } from '../primitives/Well';
-import { useMediaQuery } from '../../lib/media';
-import { InlineCode } from '../../components/primitives/Code';
+import { Well } from '../primitives/Well'
+import { useMediaQuery } from '../../lib/media'
+import { InlineCode } from '../../components/primitives/Code'
-export function Walkthroughs() {
- const mq = useMediaQuery();
+export function Walkthroughs () {
+ const mq = useMediaQuery()
return (
- );
+ )
}
diff --git a/docs/components/icons/ArrowR.tsx b/docs/components/icons/ArrowR.tsx
index 6de9e75a170..bdd04951cdc 100644
--- a/docs/components/icons/ArrowR.tsx
+++ b/docs/components/icons/ArrowR.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Gradients, IconProps } from './util';
+import { Gradients, type IconProps } from './util'
-export function ArrowR({ grad, ...props }: IconProps) {
+export function ArrowR ({ grad, ...props }: IconProps) {
return (
- );
+ )
}
diff --git a/docs/components/icons/Automated.tsx b/docs/components/icons/Automated.tsx
index 9dcb6ebdf8a..e71212282d3 100644
--- a/docs/components/icons/Automated.tsx
+++ b/docs/components/icons/Automated.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Gradients, IconProps } from './util';
+import { Gradients, type IconProps } from './util'
-export function Automated({ grad, ...props }: IconProps) {
+export function Automated ({ grad, ...props }: IconProps) {
return (
- );
+ )
}
diff --git a/docs/components/icons/Bulb.tsx b/docs/components/icons/Bulb.tsx
index 8127139a12d..492dc94a249 100644
--- a/docs/components/icons/Bulb.tsx
+++ b/docs/components/icons/Bulb.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Gradients, IconProps } from './util';
+import { Gradients, type IconProps } from './util'
-export function Bulb({ grad, ...props }: IconProps) {
+export function Bulb ({ grad, ...props }: IconProps) {
return (
- );
+ )
}
diff --git a/docs/components/icons/Cli.tsx b/docs/components/icons/Cli.tsx
index 7f537654c2f..32f52e7b826 100644
--- a/docs/components/icons/Cli.tsx
+++ b/docs/components/icons/Cli.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Gradients, IconProps } from './util';
+import { Gradients, type IconProps } from './util'
-export function Cli({ grad, ...props }: IconProps) {
+export function Cli ({ grad, ...props }: IconProps) {
return (
- );
+ )
}
diff --git a/docs/components/icons/ClientLogos.tsx b/docs/components/icons/ClientLogos.tsx
index 7507ca9f37e..f9a8269ca83 100644
--- a/docs/components/icons/ClientLogos.tsx
+++ b/docs/components/icons/ClientLogos.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Gradients, IconProps } from './util';
+import { Gradients, type IconProps } from './util'
-export function ClientLogos({ grad, ...props }: IconProps) {
+export function ClientLogos ({ grad, ...props }: IconProps) {
return (
- );
+ )
}
diff --git a/docs/components/icons/Close.tsx b/docs/components/icons/Close.tsx
index e530eb84720..5bb8ed274ea 100644
--- a/docs/components/icons/Close.tsx
+++ b/docs/components/icons/Close.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Gradients, IconProps } from './util';
+import { Gradients, type IconProps } from './util'
-export function Close({ grad, ...props }: IconProps) {
+export function Close ({ grad, ...props }: IconProps) {
return (
- );
+ )
}
diff --git a/docs/components/icons/Code.tsx b/docs/components/icons/Code.tsx
index f7affa9764f..9a19d45b3a0 100644
--- a/docs/components/icons/Code.tsx
+++ b/docs/components/icons/Code.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Gradients, IconProps } from './util';
+import { Gradients, type IconProps } from './util'
-export function Code({ grad, ...props }: IconProps) {
+export function Code ({ grad, ...props }: IconProps) {
return (
- );
+ )
}
diff --git a/docs/components/icons/Content.tsx b/docs/components/icons/Content.tsx
index e093b9faeb1..aee10580861 100644
--- a/docs/components/icons/Content.tsx
+++ b/docs/components/icons/Content.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Gradients, IconProps } from './util';
+import { Gradients, type IconProps } from './util'
-export function Content({ grad, ...props }: IconProps) {
+export function Content ({ grad, ...props }: IconProps) {
return (
- );
+ )
}
diff --git a/docs/components/icons/Copy.tsx b/docs/components/icons/Copy.tsx
index 4949ad2c36f..395479a2269 100644
--- a/docs/components/icons/Copy.tsx
+++ b/docs/components/icons/Copy.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Gradients, IconProps } from './util';
+import { Gradients, type IconProps } from './util'
-export function Copy({ grad, ...props }: IconProps) {
+export function Copy ({ grad, ...props }: IconProps) {
return (
- );
+ )
}
diff --git a/docs/components/icons/Custom.tsx b/docs/components/icons/Custom.tsx
index 407b0104615..09d4a632a9c 100644
--- a/docs/components/icons/Custom.tsx
+++ b/docs/components/icons/Custom.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Gradients, IconProps } from './util';
+import { Gradients, type IconProps } from './util'
-export function Custom({ grad, ...props }: IconProps) {
+export function Custom ({ grad, ...props }: IconProps) {
return (
- );
+ )
}
diff --git a/docs/components/icons/DFATLogo.tsx b/docs/components/icons/DFATLogo.tsx
index 83e06d7ac55..b9c019076c4 100644
--- a/docs/components/icons/DFATLogo.tsx
+++ b/docs/components/icons/DFATLogo.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { IconProps } from './util';
+import { type IconProps } from './util'
-export function DFATLogo(props: IconProps) {
+export function DFATLogo (props: IconProps) {
return (
- );
+ )
}
diff --git a/docs/components/icons/DarkMode.tsx b/docs/components/icons/DarkMode.tsx
index fbf0cd0606e..d596067618c 100644
--- a/docs/components/icons/DarkMode.tsx
+++ b/docs/components/icons/DarkMode.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Gradients, IconProps } from './util';
+import { Gradients, type IconProps } from './util'
-export function DarkMode({ grad, ...props }: IconProps) {
+export function DarkMode ({ grad, ...props }: IconProps) {
return (
- );
+ )
}
diff --git a/docs/components/icons/Docs.tsx b/docs/components/icons/Docs.tsx
index 4ff60b1fc3a..507be8f2d54 100644
--- a/docs/components/icons/Docs.tsx
+++ b/docs/components/icons/Docs.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Gradients, IconProps } from './util';
+import { Gradients, type IconProps } from './util'
-export function Docs({ grad, ...props }: IconProps) {
+export function Docs ({ grad, ...props }: IconProps) {
return (
- );
+ )
}
diff --git a/docs/components/icons/Download.tsx b/docs/components/icons/Download.tsx
index fc4af2cfa0b..4d412d827ba 100644
--- a/docs/components/icons/Download.tsx
+++ b/docs/components/icons/Download.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Gradients, IconProps } from './util';
+import { Gradients, type IconProps } from './util'
-export function Download({ grad, ...props }: IconProps) {
+export function Download ({ grad, ...props }: IconProps) {
return (
- );
+ )
}
diff --git a/docs/components/icons/Edit.tsx b/docs/components/icons/Edit.tsx
index 6eeac8cdbdb..352b7742353 100644
--- a/docs/components/icons/Edit.tsx
+++ b/docs/components/icons/Edit.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Gradients, IconProps } from './util';
+import { Gradients, type IconProps } from './util'
-export function Edit({ grad, ...props }: IconProps) {
+export function Edit ({ grad, ...props }: IconProps) {
return (
- );
+ )
}
diff --git a/docs/components/icons/Editor.tsx b/docs/components/icons/Editor.tsx
index 7e5c8e8c40c..d051ab3bcbc 100644
--- a/docs/components/icons/Editor.tsx
+++ b/docs/components/icons/Editor.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Gradients, IconProps } from './util';
+import { Gradients, type IconProps } from './util'
-export function Editor({ grad, ...props }: IconProps) {
+export function Editor ({ grad, ...props }: IconProps) {
return (
- );
+ )
}
diff --git a/docs/components/icons/EnliticLogo.tsx b/docs/components/icons/EnliticLogo.tsx
index e7f8f03c2fc..20e8a884afb 100644
--- a/docs/components/icons/EnliticLogo.tsx
+++ b/docs/components/icons/EnliticLogo.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { IconProps } from './util';
+import { type IconProps } from './util'
-export function EnliticLogo(props: IconProps) {
+export function EnliticLogo (props: IconProps) {
return (
- );
+ )
}
diff --git a/docs/components/icons/Filter.tsx b/docs/components/icons/Filter.tsx
index dd87f7d4bdf..03d01fa8040 100644
--- a/docs/components/icons/Filter.tsx
+++ b/docs/components/icons/Filter.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Gradients, IconProps } from './util';
+import { Gradients, type IconProps } from './util'
-export function Filter({ grad, ...props }: IconProps) {
+export function Filter ({ grad, ...props }: IconProps) {
return (
- );
+ )
}
diff --git a/docs/components/icons/FrontEndLogos.tsx b/docs/components/icons/FrontEndLogos.tsx
index 241b0813961..77b261aafb1 100644
--- a/docs/components/icons/FrontEndLogos.tsx
+++ b/docs/components/icons/FrontEndLogos.tsx
@@ -1,9 +1,9 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
-import { SVGAttributes } from 'react';
+import { jsx } from '@emotion/react'
+import { type SVGAttributes } from 'react'
-export function FrontEndLogos(props: SVGAttributes) {
+export function FrontEndLogos (props: SVGAttributes) {
return (
@@ -83,5 +83,5 @@ export function FrontEndLogos(props: SVGAttributes) {
- );
+ )
}
diff --git a/docs/components/icons/GitHub.tsx b/docs/components/icons/GitHub.tsx
index 338c2b39942..bbc707308ec 100644
--- a/docs/components/icons/GitHub.tsx
+++ b/docs/components/icons/GitHub.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Gradients, IconProps } from './util';
+import { Gradients, type IconProps } from './util'
-export function GitHub({ grad, ...props }: IconProps) {
+export function GitHub ({ grad, ...props }: IconProps) {
return (
- );
+ )
}
diff --git a/docs/components/icons/GraphQl.tsx b/docs/components/icons/GraphQl.tsx
index 198ade91006..eaa8514cf77 100644
--- a/docs/components/icons/GraphQl.tsx
+++ b/docs/components/icons/GraphQl.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Gradients, IconProps } from './util';
+import { Gradients, type IconProps } from './util'
-export function GraphQl({ grad, ...props }: IconProps) {
+export function GraphQl ({ grad, ...props }: IconProps) {
return (
- );
+ )
}
diff --git a/docs/components/icons/Hamburger.tsx b/docs/components/icons/Hamburger.tsx
index 110d9103b41..9c872016c34 100644
--- a/docs/components/icons/Hamburger.tsx
+++ b/docs/components/icons/Hamburger.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Gradients, IconProps } from './util';
+import { Gradients, type IconProps } from './util'
-export function Hamburger({ grad, ...props }: IconProps) {
+export function Hamburger ({ grad, ...props }: IconProps) {
return (
- );
+ )
}
diff --git a/docs/components/icons/Keystone.tsx b/docs/components/icons/Keystone.tsx
index b63532b661e..7bc6102bfa7 100644
--- a/docs/components/icons/Keystone.tsx
+++ b/docs/components/icons/Keystone.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Gradients, IconProps } from './util';
+import { Gradients, type IconProps } from './util'
-export function Keystone({ grad, ...props }: IconProps) {
+export function Keystone ({ grad, ...props }: IconProps) {
return (
- );
+ )
}
diff --git a/docs/components/icons/Lab.tsx b/docs/components/icons/Lab.tsx
index d4f34bdaa88..07bb90b898e 100644
--- a/docs/components/icons/Lab.tsx
+++ b/docs/components/icons/Lab.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Gradients, IconProps } from './util';
+import { Gradients, type IconProps } from './util'
-export function Lab({ grad, ...props }: IconProps) {
+export function Lab ({ grad, ...props }: IconProps) {
return (
- );
+ )
}
diff --git a/docs/components/icons/LightMode.tsx b/docs/components/icons/LightMode.tsx
index b9947154db8..75dedfd459d 100644
--- a/docs/components/icons/LightMode.tsx
+++ b/docs/components/icons/LightMode.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Gradients, IconProps } from './util';
+import { Gradients, type IconProps } from './util'
-export function LightMode({ grad, ...props }: IconProps) {
+export function LightMode ({ grad, ...props }: IconProps) {
return (
- );
+ )
}
diff --git a/docs/components/icons/Link.tsx b/docs/components/icons/Link.tsx
index 9635812f45c..a1201710e21 100644
--- a/docs/components/icons/Link.tsx
+++ b/docs/components/icons/Link.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Gradients, IconProps } from './util';
+import { Gradients, type IconProps } from './util'
-export function Link({ grad, ...props }: IconProps) {
+export function Link ({ grad, ...props }: IconProps) {
return (
- );
+ )
}
diff --git a/docs/components/icons/Migration.tsx b/docs/components/icons/Migration.tsx
index 81dc8431404..680c728879c 100644
--- a/docs/components/icons/Migration.tsx
+++ b/docs/components/icons/Migration.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Gradients, IconProps } from './util';
+import { Gradients, type IconProps } from './util'
-export function Migration({ grad, ...props }: IconProps) {
+export function Migration ({ grad, ...props }: IconProps) {
return (
- );
+ )
}
diff --git a/docs/components/icons/Nextjs.tsx b/docs/components/icons/Nextjs.tsx
index 70ebb7b9688..26ad5ad3c21 100644
--- a/docs/components/icons/Nextjs.tsx
+++ b/docs/components/icons/Nextjs.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Gradients, IconProps } from './util';
+import { Gradients, type IconProps } from './util'
-export function Nextjs({ grad, ...props }: IconProps) {
+export function Nextjs ({ grad, ...props }: IconProps) {
return (
- );
+ )
}
diff --git a/docs/components/icons/Nope.tsx b/docs/components/icons/Nope.tsx
index 52005a9083f..352cc2e58ae 100644
--- a/docs/components/icons/Nope.tsx
+++ b/docs/components/icons/Nope.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Gradients, IconProps } from './util';
+import { Gradients, type IconProps } from './util'
-export function Nope({ grad, ...props }: IconProps) {
+export function Nope ({ grad, ...props }: IconProps) {
return (
- );
+ )
}
diff --git a/docs/components/icons/Organization.tsx b/docs/components/icons/Organization.tsx
index 7ca4dac5897..e25dcd759af 100644
--- a/docs/components/icons/Organization.tsx
+++ b/docs/components/icons/Organization.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Gradients, IconProps } from './util';
+import { Gradients, type IconProps } from './util'
-export function Organization({ grad, ...props }: IconProps) {
+export function Organization ({ grad, ...props }: IconProps) {
return (
- );
+ )
}
diff --git a/docs/components/icons/PJohnsonLogo.tsx b/docs/components/icons/PJohnsonLogo.tsx
index 0ef7b75ac9a..6b5820246ba 100644
--- a/docs/components/icons/PJohnsonLogo.tsx
+++ b/docs/components/icons/PJohnsonLogo.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { IconProps } from './util';
+import { type IconProps } from './util'
-export function PJohnsonLogo(props: IconProps) {
+export function PJohnsonLogo (props: IconProps) {
return (
- );
+ )
}
diff --git a/docs/components/icons/Postgres.tsx b/docs/components/icons/Postgres.tsx
index 980efd15af7..76cc647b924 100644
--- a/docs/components/icons/Postgres.tsx
+++ b/docs/components/icons/Postgres.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Gradients, IconProps } from './util';
+import { Gradients, type IconProps } from './util'
-export function Postgres({ grad, ...props }: IconProps) {
+export function Postgres ({ grad, ...props }: IconProps) {
return (
- );
+ )
}
diff --git a/docs/components/icons/PrintBarLogo.tsx b/docs/components/icons/PrintBarLogo.tsx
index 1f758dff5bb..2698927aa02 100644
--- a/docs/components/icons/PrintBarLogo.tsx
+++ b/docs/components/icons/PrintBarLogo.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { IconProps } from './util';
+import { type IconProps } from './util'
-export function PrintBarLogo(props: IconProps) {
+export function PrintBarLogo (props: IconProps) {
return (
- );
+ )
}
diff --git a/docs/components/icons/Prisma.tsx b/docs/components/icons/Prisma.tsx
index 2c5be6e3608..5ed97697ad4 100644
--- a/docs/components/icons/Prisma.tsx
+++ b/docs/components/icons/Prisma.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Gradients, IconProps } from './util';
+import { Gradients, type IconProps } from './util'
-export function Prisma({ grad, ...props }: IconProps) {
+export function Prisma ({ grad, ...props }: IconProps) {
return (
- );
+ )
}
diff --git a/docs/components/icons/Profile.tsx b/docs/components/icons/Profile.tsx
index c2565cf2303..887f4336833 100644
--- a/docs/components/icons/Profile.tsx
+++ b/docs/components/icons/Profile.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Gradients, IconProps } from './util';
+import { Gradients, type IconProps } from './util'
-export function Profile({ grad, ...props }: IconProps) {
+export function Profile ({ grad, ...props }: IconProps) {
return (
- );
+ )
}
diff --git a/docs/components/icons/Question.tsx b/docs/components/icons/Question.tsx
index 846a0d61e35..b86baf519fb 100644
--- a/docs/components/icons/Question.tsx
+++ b/docs/components/icons/Question.tsx
@@ -1,9 +1,9 @@
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Gradients, IconProps } from './util';
+import { Gradients, type IconProps } from './util'
-export function Question({ grad, ...props }: IconProps) {
+export function Question ({ grad, ...props }: IconProps) {
return (
- );
+ )
}
diff --git a/docs/components/icons/Quote.tsx b/docs/components/icons/Quote.tsx
index ade4ad5a09f..bf553389c59 100644
--- a/docs/components/icons/Quote.tsx
+++ b/docs/components/icons/Quote.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Gradients, IconProps } from './util';
+import { Gradients, type IconProps } from './util'
-export function Quote({ grad, ...props }: IconProps) {
+export function Quote ({ grad, ...props }: IconProps) {
return (
- );
+ )
}
diff --git a/docs/components/icons/Relational.tsx b/docs/components/icons/Relational.tsx
index 599608d3e10..780f44d418a 100644
--- a/docs/components/icons/Relational.tsx
+++ b/docs/components/icons/Relational.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Gradients, IconProps } from './util';
+import { Gradients, type IconProps } from './util'
-export function Relational({ grad, ...props }: IconProps) {
+export function Relational ({ grad, ...props }: IconProps) {
return (
- );
+ )
}
diff --git a/docs/components/icons/Relationship.tsx b/docs/components/icons/Relationship.tsx
index a06fd9a8c3d..afd2e8317f4 100644
--- a/docs/components/icons/Relationship.tsx
+++ b/docs/components/icons/Relationship.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Gradients, IconProps } from './util';
+import { Gradients, type IconProps } from './util'
-export function Relationship({ grad, ...props }: IconProps) {
+export function Relationship ({ grad, ...props }: IconProps) {
return (
- );
+ )
}
diff --git a/docs/components/icons/Roadmap.tsx b/docs/components/icons/Roadmap.tsx
index cbbf4d90380..f07c6b24e4a 100644
--- a/docs/components/icons/Roadmap.tsx
+++ b/docs/components/icons/Roadmap.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Gradients, IconProps } from './util';
+import { Gradients, type IconProps } from './util'
-export function Roadmap({ grad, ...props }: IconProps) {
+export function Roadmap ({ grad, ...props }: IconProps) {
return (
- );
+ )
}
diff --git a/docs/components/icons/RugbyAuLogo.tsx b/docs/components/icons/RugbyAuLogo.tsx
index fbfb33919d2..a3c6c2b3680 100644
--- a/docs/components/icons/RugbyAuLogo.tsx
+++ b/docs/components/icons/RugbyAuLogo.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { IconProps } from './util';
+import { type IconProps } from './util'
-export function RugbyAuLogo(props: IconProps) {
+export function RugbyAuLogo (props: IconProps) {
return (
- );
+ )
}
diff --git a/docs/components/icons/Search.tsx b/docs/components/icons/Search.tsx
index ca542027c06..03ca23036e5 100644
--- a/docs/components/icons/Search.tsx
+++ b/docs/components/icons/Search.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Gradients, IconProps } from './util';
+import { Gradients, type IconProps } from './util'
-export function Search({ grad, ...props }: IconProps) {
+export function Search ({ grad, ...props }: IconProps) {
return (
- );
+ )
}
diff --git a/docs/components/icons/SearchKeys.tsx b/docs/components/icons/SearchKeys.tsx
index 6a8494d3dee..d8d41d5059f 100644
--- a/docs/components/icons/SearchKeys.tsx
+++ b/docs/components/icons/SearchKeys.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Gradients, IconProps } from './util';
+import { Gradients, type IconProps } from './util'
-export function SearchKeys({ grad, ...props }: IconProps) {
+export function SearchKeys ({ grad, ...props }: IconProps) {
return (
- );
+ )
}
diff --git a/docs/components/icons/Shield.tsx b/docs/components/icons/Shield.tsx
index 478a60c6585..b4c3d2547ec 100644
--- a/docs/components/icons/Shield.tsx
+++ b/docs/components/icons/Shield.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Gradients, IconProps } from './util';
+import { Gradients, type IconProps } from './util'
-export function Shield({ grad, ...props }: IconProps) {
+export function Shield ({ grad, ...props }: IconProps) {
return (
- );
+ )
}
diff --git a/docs/components/icons/Slack.tsx b/docs/components/icons/Slack.tsx
index 167b904f244..fa0a21f1fde 100644
--- a/docs/components/icons/Slack.tsx
+++ b/docs/components/icons/Slack.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Gradients, IconProps } from './util';
+import { Gradients, type IconProps } from './util'
-export function Slack({ grad, ...props }: IconProps) {
+export function Slack ({ grad, ...props }: IconProps) {
return (
- );
+ )
}
diff --git a/docs/components/icons/Thinkmill.tsx b/docs/components/icons/Thinkmill.tsx
index 084aed7955f..421441c93aa 100644
--- a/docs/components/icons/Thinkmill.tsx
+++ b/docs/components/icons/Thinkmill.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Gradients, IconProps } from './util';
+import { Gradients, type IconProps } from './util'
-export function Thinkmill({ grad, ...props }: IconProps) {
+export function Thinkmill ({ grad, ...props }: IconProps) {
return (
@@ -33,5 +33,5 @@ export function Thinkmill({ grad, ...props }: IconProps) {
- );
+ )
}
diff --git a/docs/components/icons/Tick.tsx b/docs/components/icons/Tick.tsx
index dd0ff74cadf..2eab84ed34e 100644
--- a/docs/components/icons/Tick.tsx
+++ b/docs/components/icons/Tick.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Gradients, IconProps } from './util';
+import { Gradients, type IconProps } from './util'
-export function Tick({ grad, ...props }: IconProps) {
+export function Tick ({ grad, ...props }: IconProps) {
return (
- );
+ )
}
diff --git a/docs/components/icons/Twitter.tsx b/docs/components/icons/Twitter.tsx
index 50f8d55f43a..9a529750165 100644
--- a/docs/components/icons/Twitter.tsx
+++ b/docs/components/icons/Twitter.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Gradients, IconProps } from './util';
+import { Gradients, type IconProps } from './util'
-export function Twitter({ grad, ...props }: IconProps) {
+export function Twitter ({ grad, ...props }: IconProps) {
return (
- );
+ )
}
diff --git a/docs/components/icons/Typescript.tsx b/docs/components/icons/Typescript.tsx
index a4fc5f6083e..ad4d5494b0e 100644
--- a/docs/components/icons/Typescript.tsx
+++ b/docs/components/icons/Typescript.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Gradients, IconProps } from './util';
+import { Gradients, type IconProps } from './util'
-export function Typescript({ grad, ...props }: IconProps) {
+export function Typescript ({ grad, ...props }: IconProps) {
return (
- );
+ )
}
diff --git a/docs/components/icons/Updates.tsx b/docs/components/icons/Updates.tsx
index b7a9c4f0397..986da021050 100644
--- a/docs/components/icons/Updates.tsx
+++ b/docs/components/icons/Updates.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Gradients, IconProps } from './util';
+import { Gradients, type IconProps } from './util'
-export function Updates({ grad, ...props }: IconProps) {
+export function Updates ({ grad, ...props }: IconProps) {
return (
- );
+ )
}
diff --git a/docs/components/icons/Video.tsx b/docs/components/icons/Video.tsx
index 6a73c580924..0af6dcfaa71 100644
--- a/docs/components/icons/Video.tsx
+++ b/docs/components/icons/Video.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Gradients, IconProps } from './util';
+import { Gradients, type IconProps } from './util'
-export function Video({ grad, ...props }: IconProps) {
+export function Video ({ grad, ...props }: IconProps) {
return (
- );
+ )
}
diff --git a/docs/components/icons/VocalLogo.tsx b/docs/components/icons/VocalLogo.tsx
index 2cb96545f0f..36bdd7b15f2 100644
--- a/docs/components/icons/VocalLogo.tsx
+++ b/docs/components/icons/VocalLogo.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { IconProps } from './util';
+import { type IconProps } from './util'
-export function VocalLogo(props: IconProps) {
+export function VocalLogo (props: IconProps) {
return (
- );
+ )
}
diff --git a/docs/components/icons/Watch.tsx b/docs/components/icons/Watch.tsx
index 0f97af14f3f..2c9b91b095f 100644
--- a/docs/components/icons/Watch.tsx
+++ b/docs/components/icons/Watch.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Gradients, IconProps } from './util';
+import { Gradients, type IconProps } from './util'
-export function Watch({ grad, ...props }: IconProps) {
+export function Watch ({ grad, ...props }: IconProps) {
return (
- );
+ )
}
diff --git a/docs/components/icons/Welcome.tsx b/docs/components/icons/Welcome.tsx
index 36c8ffcb289..51111ace2f1 100644
--- a/docs/components/icons/Welcome.tsx
+++ b/docs/components/icons/Welcome.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Gradients, IconProps } from './util';
+import { Gradients, type IconProps } from './util'
-export function Welcome({ grad, ...props }: IconProps) {
+export function Welcome ({ grad, ...props }: IconProps) {
return (
- );
+ )
}
diff --git a/docs/components/icons/WestpacLogo.tsx b/docs/components/icons/WestpacLogo.tsx
index cc095873f51..77ff209634a 100644
--- a/docs/components/icons/WestpacLogo.tsx
+++ b/docs/components/icons/WestpacLogo.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { IconProps } from './util';
+import { type IconProps } from './util'
-export function WestpacLogo(props: IconProps) {
+export function WestpacLogo (props: IconProps) {
return (
- );
+ )
}
diff --git a/docs/components/icons/WhyKeystone.tsx b/docs/components/icons/WhyKeystone.tsx
index 7d2a59ca37b..29bc205559d 100644
--- a/docs/components/icons/WhyKeystone.tsx
+++ b/docs/components/icons/WhyKeystone.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Gradients, IconProps } from './util';
+import { Gradients, type IconProps } from './util'
-export function WhyKeystone({ grad, ...props }: IconProps) {
+export function WhyKeystone ({ grad, ...props }: IconProps) {
return (
- );
+ )
}
diff --git a/docs/components/icons/YouTube.tsx b/docs/components/icons/YouTube.tsx
index 7909e10b4e0..21ae20f20f2 100644
--- a/docs/components/icons/YouTube.tsx
+++ b/docs/components/icons/YouTube.tsx
@@ -1,10 +1,10 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Gradients, IconProps } from './util';
+import { Gradients, type IconProps } from './util'
-export function YouTube({ grad, ...props }: IconProps) {
+export function YouTube ({ grad, ...props }: IconProps) {
return (
- );
+ )
}
diff --git a/docs/components/icons/index.ts b/docs/components/icons/index.ts
index 88181eefcee..6ea82931a0c 100644
--- a/docs/components/icons/index.ts
+++ b/docs/components/icons/index.ts
@@ -1,48 +1,48 @@
-export type { IconGradient } from './util';
+export type { IconGradient } from './util'
-export { ArrowR } from './ArrowR';
-export { Automated } from './Automated';
-export { Cli } from './Cli';
-export { ClientLogos } from './ClientLogos';
-export { Close } from './Close';
-export { Code } from './Code';
-export { Content } from './Content';
-export { Copy } from './Copy';
-export { Custom } from './Custom';
-export { DarkMode } from './DarkMode';
-export { Docs } from './Docs';
-export { Download } from './Download';
-export { Edit } from './Edit';
-export { Editor } from './Editor';
-export { Filter } from './Filter';
-export { FrontEndLogos } from './FrontEndLogos';
-export { GitHub } from './GitHub';
-export { GraphQl } from './GraphQl';
-export { Hamburger } from './Hamburger';
-export { Keystone } from './Keystone';
-export { Lab } from './Lab';
-export { LightMode } from './LightMode';
-export { Link } from './Link';
-export { Migration } from './Migration';
-export { Nextjs } from './Nextjs';
-export { Nope } from './Nope';
-export { Organization } from './Organization';
-export { Postgres } from './Postgres';
-export { Prisma } from './Prisma';
-export { Profile } from './Profile';
-export { Quote } from './Quote';
-export { Relational } from './Relational';
-export { Relationship } from './Relationship';
-export { Roadmap } from './Roadmap';
-export { Search } from './Search';
-export { SearchKeys } from './SearchKeys';
-export { Shield } from './Shield';
-export { Slack } from './Slack';
-export { Thinkmill } from './Thinkmill';
-export { Tick } from './Tick';
-export { Twitter } from './Twitter';
-export { Typescript } from './Typescript';
-export { Updates } from './Updates';
-export { Watch } from './Watch';
-export { Welcome } from './Welcome';
-export { WhyKeystone } from './WhyKeystone';
+export { ArrowR } from './ArrowR'
+export { Automated } from './Automated'
+export { Cli } from './Cli'
+export { ClientLogos } from './ClientLogos'
+export { Close } from './Close'
+export { Code } from './Code'
+export { Content } from './Content'
+export { Copy } from './Copy'
+export { Custom } from './Custom'
+export { DarkMode } from './DarkMode'
+export { Docs } from './Docs'
+export { Download } from './Download'
+export { Edit } from './Edit'
+export { Editor } from './Editor'
+export { Filter } from './Filter'
+export { FrontEndLogos } from './FrontEndLogos'
+export { GitHub } from './GitHub'
+export { GraphQl } from './GraphQl'
+export { Hamburger } from './Hamburger'
+export { Keystone } from './Keystone'
+export { Lab } from './Lab'
+export { LightMode } from './LightMode'
+export { Link } from './Link'
+export { Migration } from './Migration'
+export { Nextjs } from './Nextjs'
+export { Nope } from './Nope'
+export { Organization } from './Organization'
+export { Postgres } from './Postgres'
+export { Prisma } from './Prisma'
+export { Profile } from './Profile'
+export { Quote } from './Quote'
+export { Relational } from './Relational'
+export { Relationship } from './Relationship'
+export { Roadmap } from './Roadmap'
+export { Search } from './Search'
+export { SearchKeys } from './SearchKeys'
+export { Shield } from './Shield'
+export { Slack } from './Slack'
+export { Thinkmill } from './Thinkmill'
+export { Tick } from './Tick'
+export { Twitter } from './Twitter'
+export { Typescript } from './Typescript'
+export { Updates } from './Updates'
+export { Watch } from './Watch'
+export { Welcome } from './Welcome'
+export { WhyKeystone } from './WhyKeystone'
diff --git a/docs/components/icons/util.tsx b/docs/components/icons/util.tsx
index 989cc9e529c..d54907ad37a 100644
--- a/docs/components/icons/util.tsx
+++ b/docs/components/icons/util.tsx
@@ -1,12 +1,12 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
-import { SVGAttributes } from 'react';
+import { jsx } from '@emotion/react'
+import { type SVGAttributes } from 'react'
-export type IconGradient = 'grad1' | 'grad2' | 'grad3' | 'grad4' | 'grad5' | 'grad6' | 'logo';
-export type IconProps = { grad?: IconGradient | null } & SVGAttributes;
+export type IconGradient = 'grad1' | 'grad2' | 'grad3' | 'grad4' | 'grad5' | 'grad6' | 'logo'
+export type IconProps = { grad?: IconGradient | null } & SVGAttributes
-export function Gradients({ name }: { name: string }) {
+export function Gradients ({ name }: { name: string }) {
return (
@@ -38,5 +38,5 @@ export function Gradients({ name }: { name: string }) {
- );
+ )
}
diff --git a/docs/components/primitives/Alert.tsx b/docs/components/primitives/Alert.tsx
index 717bc221229..875126e597f 100644
--- a/docs/components/primitives/Alert.tsx
+++ b/docs/components/primitives/Alert.tsx
@@ -1,14 +1,14 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
-import classnames from 'classnames';
-import { HTMLAttributes } from 'react';
+import { jsx } from '@emotion/react'
+import classnames from 'classnames'
+import { type HTMLAttributes } from 'react'
type AlertProps = {
- look?: 'neutral' | 'tip' | 'warn' | 'error';
-} & HTMLAttributes;
+ look?: 'neutral' | 'tip' | 'warn' | 'error'
+} & HTMLAttributes
-export function Alert({ look = 'neutral', className, ...props }: AlertProps) {
- const classes = classnames('hint', look, className); // styles for this component can be found in the _app.js file
- return
;
+export function Alert ({ look = 'neutral', className, ...props }: AlertProps) {
+ const classes = classnames('hint', look, className) // styles for this component can be found in the _app.js file
+ return
}
diff --git a/docs/components/primitives/Badge.tsx b/docs/components/primitives/Badge.tsx
index 5a01d909153..47aa03232e2 100644
--- a/docs/components/primitives/Badge.tsx
+++ b/docs/components/primitives/Badge.tsx
@@ -1,7 +1,7 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
-import { HTMLAttributes } from 'react';
+import { jsx } from '@emotion/react'
+import { type HTMLAttributes } from 'react'
const styleMap = {
success: {
@@ -20,13 +20,13 @@ const styleMap = {
color: 'var(--danger)',
background: 'var(--danger-bg)',
},
-};
+}
type BadgeProps = {
- look?: keyof typeof styleMap;
-} & HTMLAttributes;
+ look?: keyof typeof styleMap
+} & HTMLAttributes
-export function Badge({ look = 'warning', ...props }: BadgeProps) {
+export function Badge ({ look = 'warning', ...props }: BadgeProps) {
return (
- );
+ )
}
diff --git a/docs/components/primitives/Button.tsx b/docs/components/primitives/Button.tsx
index ca4d1bfafe5..13e0e140dbe 100644
--- a/docs/components/primitives/Button.tsx
+++ b/docs/components/primitives/Button.tsx
@@ -1,11 +1,11 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { ReactNode } from 'react';
-import { CSSObject, jsx } from '@emotion/react';
-import Link from 'next/link';
+import { type ReactNode } from 'react'
+import { type CSSObject, jsx } from '@emotion/react'
+import Link from 'next/link'
-import { forwardRefWithAs } from '../../lib/forwardRefWithAs';
-import { Loading } from './Loading';
+import { forwardRefWithAs } from '../../lib/forwardRefWithAs'
+import { Loading } from './Loading'
const styleMap = {
default: {},
@@ -53,7 +53,7 @@ const styleMap = {
padding: 0,
borderRadius: 0,
},
-};
+}
const shadowMap: Record = {
default: {
@@ -74,7 +74,7 @@ const shadowMap: Record = {
'--button-shadow-active': '0 3px 14px 0 rgb(0 118 255 / 08%)',
},
text: {},
-};
+}
const sizeMap = {
default: {
@@ -101,18 +101,18 @@ const sizeMap = {
height: '2rem',
padding: '0 12px',
},
-};
+}
type ButtonProps = {
- children?: ReactNode;
- disabled?: boolean;
- href?: string;
- loading?: boolean;
- look?: keyof typeof styleMap;
- shadow?: boolean;
- size?: keyof typeof sizeMap;
- styleOverrides?: CSSObject;
-};
+ children?: ReactNode
+ disabled?: boolean
+ href?: string
+ loading?: boolean
+ look?: keyof typeof styleMap
+ shadow?: boolean
+ size?: keyof typeof sizeMap
+ styleOverrides?: CSSObject
+}
export const Button = forwardRefWithAs<'button', ButtonProps>(
(
@@ -130,17 +130,17 @@ export const Button = forwardRefWithAs<'button', ButtonProps>(
ref
) => {
if (Tag === 'a' && !props.href) {
- Tag = 'button';
+ Tag = 'button'
}
if (Tag === 'a' && props.href) {
- disabled = undefined;
- Tag = Link;
+ disabled = undefined
+ Tag = Link
}
if (look === 'text') {
- disabled = loading ? true : disabled;
- loading = false;
+ disabled = loading ? true : disabled
+ loading = false
}
return (
@@ -247,8 +247,8 @@ export const Button = forwardRefWithAs<'button', ButtonProps>(
/>
) : null}
- );
+ )
}
-);
+)
-Button.displayName = 'Button';
+Button.displayName = 'Button'
diff --git a/docs/components/primitives/Code.tsx b/docs/components/primitives/Code.tsx
index 08a646a6388..af46180cf64 100644
--- a/docs/components/primitives/Code.tsx
+++ b/docs/components/primitives/Code.tsx
@@ -1,67 +1,67 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { Highlight, Prism } from 'prism-react-renderer';
-import { jsx } from '@emotion/react';
-import { ReactNode, useEffect, useMemo, useState } from 'react';
+import { Highlight, Prism } from 'prism-react-renderer'
+import { jsx } from '@emotion/react'
+import { type ReactNode, useEffect, useMemo, useState } from 'react'
-import theme from '../../lib/prism-theme';
+import theme from '../../lib/prism-theme'
-type Range = { start: number; end: number };
-type CollapseRange = Range & { isCollapsed: boolean };
+type Range = { start: number, end: number }
+type CollapseRange = Range & { isCollapsed: boolean }
const getRanges = (lines: string): Range[] => {
- let ranges: Range[] = [];
+ let ranges: Range[] = []
lines.split(',').forEach(lineRange => {
if (lineRange.length) {
- const [range1, range2] = lineRange.split('-');
+ const [range1, range2] = lineRange.split('-')
- let parsedRange1 = parseInt(range1);
- let parsedRange2 = parseInt(range2);
+ let parsedRange1 = parseInt(range1)
+ let parsedRange2 = parseInt(range2)
if (isNaN(parsedRange1)) {
- throw new Error(`When trying to do highlighting, error in {${lines}}`);
+ throw new Error(`When trying to do highlighting, error in {${lines}}`)
}
if (!isNaN(parsedRange2)) {
- ranges.push({ start: parsedRange1 - 1, end: parsedRange2 - 1 });
+ ranges.push({ start: parsedRange1 - 1, end: parsedRange2 - 1 })
while (parsedRange1 <= parsedRange2) {
- parsedRange1++;
+ parsedRange1++
}
} else {
- ranges.push({ start: parsedRange1 - 1, end: parsedRange1 - 1 });
+ ranges.push({ start: parsedRange1 - 1, end: parsedRange1 - 1 })
}
}
- });
+ })
- return ranges;
-};
+ return ranges
+}
const parseClassName = (
className?: string
-): { highlightRanges: Range[]; collapseRanges: CollapseRange[]; language: string } => {
- let trimmedLanguage = (className || '').replace(/language-/, '');
- let language, highlights, collapses;
+): { highlightRanges: Range[], collapseRanges: CollapseRange[], language: string } => {
+ let trimmedLanguage = (className || '').replace(/language-/, '')
+ let language, highlights, collapses
if (
!trimmedLanguage.includes('[') ||
trimmedLanguage.indexOf('{') < trimmedLanguage.indexOf('[')
) {
- let [scopedLanguage, modifiers = ''] = trimmedLanguage.split('{');
+ let [scopedLanguage, modifiers = ''] = trimmedLanguage.split('{')
- let [scopedHighlights, scopedCollapses] = modifiers.split('[');
+ let [scopedHighlights, scopedCollapses] = modifiers.split('[')
- language = scopedLanguage;
- highlights = scopedHighlights;
- collapses = scopedCollapses;
+ language = scopedLanguage
+ highlights = scopedHighlights
+ collapses = scopedCollapses
} else {
- let [scopedLanguage, modifiers = ''] = trimmedLanguage.split('[');
+ let [scopedLanguage, modifiers = ''] = trimmedLanguage.split('[')
- let [scopedCollapses, scopedHighlights] = modifiers.split('{');
+ let [scopedCollapses, scopedHighlights] = modifiers.split('{')
- language = scopedLanguage;
- highlights = scopedHighlights;
- collapses = scopedCollapses;
+ language = scopedLanguage
+ highlights = scopedHighlights
+ collapses = scopedCollapses
}
return {
@@ -71,36 +71,36 @@ const parseClassName = (
...range,
isCollapsed: true,
})),
- };
-};
+ }
+}
const findRange = (
ranges: TRange[],
num: number
-): TRange | undefined => ranges.find(({ start, end }) => start <= num && end >= num);
+): TRange | undefined => ranges.find(({ start, end }) => start <= num && end >= num)
-export function CodeBlock(props: { children: string; className?: string }) {
+export function CodeBlock (props: { children: string, className?: string }) {
/*
In MDX 2, we no longer get different components for rendering `inlineCode` and code blocks.
This function returns us to our old behaviour, though a bit inelegantly
*/
if (props.children.includes('\n')) {
- return
;
+ return
}
- return ;
+ return
}
-export function Code({ children, className }: { children: string; className?: string }) {
+export function Code ({ children, className }: { children: string, className?: string }) {
let { language, highlightRanges, collapseRanges } = useMemo(
() => parseClassName(className),
[className]
- );
+ )
- const [collapseState, updateCollapseState] = useState(collapseRanges);
+ const [collapseState, updateCollapseState] = useState(collapseRanges)
useEffect(() => {
- updateCollapseState(collapseRanges);
- }, [collapseRanges]);
+ updateCollapseState(collapseRanges)
+ }, [collapseRanges])
return (
@@ -121,9 +121,9 @@ export function Code({ children, className }: { children: string; className?: st
onClick={() => {
let updated = collapseState.map(item =>
item.start === i ? { ...item, isCollapsed: false } : item
- );
+ )
- updateCollapseState(updated);
+ updateCollapseState(updated)
}}
css={{
border: 'inherit',
@@ -135,11 +135,11 @@ export function Code({ children, className }: { children: string; className?: st
>
...
- );
+ )
}
if (findRange(collapseState, i)?.isCollapsed) {
- return undefined;
+ return undefined
}
return (
@@ -165,21 +165,21 @@ export function Code({ children, className }: { children: string; className?: st
{line.map((token, key) => {
// Fix for document field import
if (token.content === 'document' && token.types[0] === 'imports') {
- token.types = ['imports'];
+ token.types = ['imports']
}
- return ;
+ return
})}
- );
+ )
})}
- );
+ )
}}
- );
+ )
}
-export function InlineCode({ children }: { children: ReactNode }) {
+export function InlineCode ({ children }: { children: ReactNode }) {
return (
{children}
- );
+ )
}
diff --git a/docs/components/primitives/EditButton.tsx b/docs/components/primitives/EditButton.tsx
index 1d2c88b34a5..85812ff9199 100644
--- a/docs/components/primitives/EditButton.tsx
+++ b/docs/components/primitives/EditButton.tsx
@@ -1,27 +1,27 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Edit } from '../../components/icons/Edit';
-import { Button } from './Button';
+import { Edit } from '../../components/icons/Edit'
+import { Button } from './Button'
-export function EditButton({
+export function EditButton ({
pathName,
isIndexPage,
editPath,
}: {
- pathName: string;
- isIndexPage?: boolean;
- editPath?: string;
+ pathName: string
+ isIndexPage?: boolean
+ editPath?: string
}) {
- let fileUrl = `https://github.com/keystonejs/keystone/edit/main/docs/pages`;
+ let fileUrl = `https://github.com/keystonejs/keystone/edit/main/docs/pages`
if (editPath) {
- fileUrl += `/${editPath}`;
+ fileUrl += `/${editPath}`
} else if (isIndexPage) {
- fileUrl += `${pathName}/index.tsx`;
+ fileUrl += `${pathName}/index.tsx`
} else {
- fileUrl += `${pathName}.md`;
+ fileUrl += `${pathName}.md`
}
return (
@@ -44,5 +44,5 @@ export function EditButton({
/>
Edit on GitHub
- );
+ )
}
diff --git a/docs/components/primitives/Emoji.tsx b/docs/components/primitives/Emoji.tsx
index 4e213356e01..832b3b49d36 100644
--- a/docs/components/primitives/Emoji.tsx
+++ b/docs/components/primitives/Emoji.tsx
@@ -1,7 +1,7 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx, keyframes } from '@emotion/react';
-import { useRef, useState, useEffect, HTMLAttributes, ReactNode } from 'react';
+import { jsx, keyframes } from '@emotion/react'
+import { useRef, useState, useEffect, type HTMLAttributes, type ReactNode } from 'react'
const fadeInTop = keyframes`
from {
@@ -12,7 +12,7 @@ const fadeInTop = keyframes`
bottom: 100%;
opacity: 1;
}
-`;
+`
const fadeInBottom = keyframes`
from {
@@ -23,7 +23,7 @@ const fadeInBottom = keyframes`
top: 100%;
opacity: 1;
}
-`;
+`
/*
* The Emoji component makes emojis more accessible to people:
@@ -35,20 +35,20 @@ const fadeInBottom = keyframes`
*/
type EmojiProps = {
- symbol: ReactNode;
- alt: string;
-} & HTMLAttributes;
+ symbol: ReactNode
+ alt: string
+} & HTMLAttributes
-export function Emoji({ symbol, alt, ...props }: EmojiProps) {
- const posRef = useRef(null);
- const [showOnTop, setShownTop] = useState(true);
+export function Emoji ({ symbol, alt, ...props }: EmojiProps) {
+ const posRef = useRef(null)
+ const [showOnTop, setShownTop] = useState(true)
// eslint-disable-next-line react-hooks/exhaustive-deps
useEffect(() => {
if (posRef.current && posRef.current.offsetTop - window.pageYOffset < 50) {
- setShownTop(false);
+ setShownTop(false)
}
- });
+ })
return (
{symbol}
- );
+ )
}
diff --git a/docs/components/primitives/Field.tsx b/docs/components/primitives/Field.tsx
index 74512ebe5d5..bfbf932b411 100644
--- a/docs/components/primitives/Field.tsx
+++ b/docs/components/primitives/Field.tsx
@@ -1,9 +1,9 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
-import { InputHTMLAttributes } from 'react';
-import { Stack } from './Stack';
-import { Type } from './Type';
+import { jsx } from '@emotion/react'
+import { type InputHTMLAttributes } from 'react'
+import { Stack } from './Stack'
+import { Type } from './Type'
export const Field = ({
label,
@@ -13,13 +13,13 @@ export const Field = ({
size = 'medium',
...props
}: Omit, 'size'> & {
- label?: string;
- id?: string;
- size?: 'medium' | 'large';
+ label?: string
+ id?: string
+ size?: 'medium' | 'large'
}) => {
- const isTextarea = type === 'comments';
- const TextInput = isTextarea ? 'textarea' : 'input';
- const isMedium = size === 'medium';
+ const isTextarea = type === 'comments'
+ const TextInput = isTextarea ? 'textarea' : 'input'
+ const isMedium = size === 'medium'
return (
- );
-};
+ )
+}
-Field.displayName = 'Field';
+Field.displayName = 'Field'
diff --git a/docs/components/primitives/GitHubButton.tsx b/docs/components/primitives/GitHubButton.tsx
index 2973091517a..c8e720bb28b 100644
--- a/docs/components/primitives/GitHubButton.tsx
+++ b/docs/components/primitives/GitHubButton.tsx
@@ -1,29 +1,29 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
-import { useState, useEffect, HTMLAttributes } from 'react';
+import { jsx } from '@emotion/react'
+import { useState, useEffect, type HTMLAttributes } from 'react'
-import { Loading } from './Loading';
-import { Type } from './Type';
+import { Loading } from './Loading'
+import { Type } from './Type'
type GitHubButtonProps = {
- repo: string;
-} & HTMLAttributes;
+ repo: string
+} & HTMLAttributes
-export function GitHubButton({ repo, ...props }: GitHubButtonProps) {
- const [count, setCount] = useState(0);
- repo = repo.replace('https://github.com/', '');
+export function GitHubButton ({ repo, ...props }: GitHubButtonProps) {
+ const [count, setCount] = useState(0)
+ repo = repo.replace('https://github.com/', '')
useEffect(() => {
fetch(`https://api.github.com/repos/${repo}`)
.then(res => res.json())
.then(({ stargazers_count }) => {
- setCount(stargazers_count);
+ setCount(stargazers_count)
})
.catch(error => {
- console.error('Error retrieving stargazing data', error);
- });
- });
+ console.error('Error retrieving stargazing data', error)
+ })
+ })
return (
}
- );
+ )
}
diff --git a/docs/components/primitives/Gradient.tsx b/docs/components/primitives/Gradient.tsx
index 18e3e31cd02..d9f6be164c1 100644
--- a/docs/components/primitives/Gradient.tsx
+++ b/docs/components/primitives/Gradient.tsx
@@ -1,7 +1,7 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
-import { HTMLAttributes, ElementType } from 'react';
+import { jsx } from '@emotion/react'
+import { type HTMLAttributes, type ElementType } from 'react'
const styleMap = {
grad1: {
@@ -24,14 +24,14 @@ const styleMap = {
'--grad-1': 'var(--grad5-1)',
'--grad-2': 'var(--grad5-2)',
},
-};
+}
type GradientProps = {
- as?: ElementType;
- look?: keyof typeof styleMap;
-} & HTMLAttributes;
+ as?: ElementType
+ look?: keyof typeof styleMap
+} & HTMLAttributes
-export function Gradient({ look = 'grad1', as: Tag = 'span', ...props }: GradientProps) {
+export function Gradient ({ look = 'grad1', as: Tag = 'span', ...props }: GradientProps) {
return (
- );
+ )
}
diff --git a/docs/components/primitives/Highlight.tsx b/docs/components/primitives/Highlight.tsx
index b173276e7a6..d6f99678a95 100644
--- a/docs/components/primitives/Highlight.tsx
+++ b/docs/components/primitives/Highlight.tsx
@@ -1,7 +1,7 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
-import { HTMLAttributes, ElementType } from 'react';
+import { jsx } from '@emotion/react'
+import { type HTMLAttributes, type ElementType } from 'react'
const styleMap = {
grad1: {
@@ -28,14 +28,14 @@ const styleMap = {
'--grad-1': 'var(--grad6-1)',
'--grad-2': 'var(--grad6-2)',
},
-};
+}
type HighlightProps = {
- as?: ElementType;
- look?: keyof typeof styleMap;
-} & HTMLAttributes;
+ as?: ElementType
+ look?: keyof typeof styleMap
+} & HTMLAttributes
-export function Highlight({ look = 'grad1', as: Tag = 'span', ...props }: HighlightProps) {
+export function Highlight ({ look = 'grad1', as: Tag = 'span', ...props }: HighlightProps) {
return (
- );
+ )
}
diff --git a/docs/components/primitives/Loading.tsx b/docs/components/primitives/Loading.tsx
index bf4179894d7..f9c57ee0a8f 100644
--- a/docs/components/primitives/Loading.tsx
+++ b/docs/components/primitives/Loading.tsx
@@ -1,7 +1,7 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx, keyframes } from '@emotion/react';
-import { HTMLAttributes } from 'react';
+import { jsx, keyframes } from '@emotion/react'
+import { type HTMLAttributes } from 'react'
const loading = keyframes({
'0%, 80%, 100%': {
@@ -10,7 +10,7 @@ const loading = keyframes({
'40%': {
opacity: 1,
},
-});
+})
const commonStyles = {
display: 'block',
@@ -19,11 +19,11 @@ const commonStyles = {
width: '1em',
borderRadius: '50%',
animation: `${loading} 1s linear infinite`,
-};
+}
-type LoadingProps = HTMLAttributes;
+type LoadingProps = HTMLAttributes
-export function Loading(props: LoadingProps) {
+export function Loading (props: LoadingProps) {
return (
- );
+ )
}
diff --git a/docs/components/primitives/SearchField.tsx b/docs/components/primitives/SearchField.tsx
index d9ae4238314..ad907d89cdf 100644
--- a/docs/components/primitives/SearchField.tsx
+++ b/docs/components/primitives/SearchField.tsx
@@ -1,16 +1,16 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx, Global, css } from '@emotion/react';
-import { Fragment, HTMLAttributes } from 'react';
+import { jsx, Global, css } from '@emotion/react'
+import { Fragment, type HTMLAttributes } from 'react'
-import { algoliaStyles } from '../../lib/algoliaStyles';
-import { SearchKeys } from '../icons/SearchKeys';
-import { Search } from '../icons/Search';
-import { Field } from './Field';
+import { algoliaStyles } from '../../lib/algoliaStyles'
+import { SearchKeys } from '../icons/SearchKeys'
+import { Search } from '../icons/Search'
+import { Field } from './Field'
-type SearchFieldProps = HTMLAttributes;
+type SearchFieldProps = HTMLAttributes
-export function SearchField(props: SearchFieldProps) {
+export function SearchField (props: SearchFieldProps) {
return (
- );
+ )
}
diff --git a/docs/components/primitives/Stack.tsx b/docs/components/primitives/Stack.tsx
index da56527cfee..9590c0ed373 100644
--- a/docs/components/primitives/Stack.tsx
+++ b/docs/components/primitives/Stack.tsx
@@ -1,22 +1,22 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
-import { HTMLAttributes } from 'react';
+import { jsx } from '@emotion/react'
+import { type HTMLAttributes } from 'react'
-import { SPACE } from '../../lib/TOKENS';
+import { SPACE } from '../../lib/TOKENS'
-const gapMap: Record = {};
+const gapMap: Record = {}
Object.keys(SPACE).forEach((name, i) => {
- gapMap[i + 1] = `var(${name})`;
-});
+ gapMap[i + 1] = `var(${name})`
+})
type StackProps = {
- block?: boolean;
- gap?: number;
- orientation?: 'vertical' | 'horizontal';
-} & HTMLAttributes;
+ block?: boolean
+ gap?: number
+ orientation?: 'vertical' | 'horizontal'
+} & HTMLAttributes
-export function Stack({ gap = 4, orientation = 'vertical', block, ...props }: StackProps) {
+export function Stack ({ gap = 4, orientation = 'vertical', block, ...props }: StackProps) {
return (
- );
+ )
}
diff --git a/docs/components/primitives/Status.tsx b/docs/components/primitives/Status.tsx
index ef4ea027fe8..42443c2967d 100644
--- a/docs/components/primitives/Status.tsx
+++ b/docs/components/primitives/Status.tsx
@@ -1,6 +1,6 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
const statusMap = {
notStarted: {
@@ -33,13 +33,13 @@ const statusMap = {
bg: 'success-bg',
color: 'text-heading',
},
-};
+}
type StatusProps = {
- look: keyof typeof statusMap;
-};
-export function Status({ look }: StatusProps) {
- const status = statusMap[look];
+ look: keyof typeof statusMap
+}
+export function Status ({ look }: StatusProps) {
+ const status = statusMap[look]
return (
{status.label}
- );
+ )
}
diff --git a/docs/components/primitives/Type.tsx b/docs/components/primitives/Type.tsx
index 9eb505b7820..6603d6abb68 100644
--- a/docs/components/primitives/Type.tsx
+++ b/docs/components/primitives/Type.tsx
@@ -1,9 +1,9 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { forwardRefWithAs } from '../../lib/forwardRefWithAs';
-import { useMediaQuery } from '../../lib/media';
+import { forwardRefWithAs } from '../../lib/forwardRefWithAs'
+import { useMediaQuery } from '../../lib/media'
const common = {
brand: {
@@ -17,7 +17,7 @@ const common = {
lineHeight: 1.2,
maxWidth: '85ch',
},
-};
+}
export const styleMap = {
heading20: {
@@ -144,19 +144,19 @@ export const styleMap = {
fontWeight: 600,
lineHeight: 1.7,
},
-} as const;
+} as const
type TypeProps = {
- look?: keyof typeof styleMap;
- fontSize?: string | Array;
- margin?: string | Array;
- padding?: string | Array;
- color?: string | Array;
-};
+ look?: keyof typeof styleMap
+ fontSize?: string | Array
+ margin?: string | Array
+ padding?: string | Array
+ color?: string | Array
+}
export const Type = forwardRefWithAs<'span', TypeProps>(
({ as: Tag = 'span', look, fontSize, margin, padding, color, ...props }, ref) => {
- const mq = useMediaQuery();
+ const mq = useMediaQuery()
return (
(
})}
{...props}
/>
- );
+ )
}
-);
-Type.displayName = 'Type';
+)
+Type.displayName = 'Type'
diff --git a/docs/components/primitives/Well.tsx b/docs/components/primitives/Well.tsx
index 50ee9105da8..f12314020ad 100644
--- a/docs/components/primitives/Well.tsx
+++ b/docs/components/primitives/Well.tsx
@@ -1,23 +1,23 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
-import Link from 'next/link';
-import { AnchorHTMLAttributes, ReactNode } from 'react';
+import { jsx } from '@emotion/react'
+import Link from 'next/link'
+import { type AnchorHTMLAttributes, type ReactNode } from 'react'
-import { Type } from './Type';
-import { Badge } from './Badge';
+import { Type } from './Type'
+import { Badge } from './Badge'
-export type WellGradient = 'grad1' | 'grad2' | 'grad3' | 'grad4';
+export type WellGradient = 'grad1' | 'grad2' | 'grad3' | 'grad4'
type WellProps = {
- grad?: WellGradient;
- heading?: ReactNode;
- badge?: string;
- href: string;
- children: ReactNode;
-} & AnchorHTMLAttributes;
+ grad?: WellGradient
+ heading?: ReactNode
+ badge?: string
+ href: string
+ children: ReactNode
+} & AnchorHTMLAttributes
-export function Well({ grad = 'grad1', heading, badge, href, children, ...props }: WellProps) {
+export function Well ({ grad = 'grad1', heading, badge, href, children, ...props }: WellProps) {
return (
- );
+ )
}
diff --git a/docs/components/primitives/Wrapper.tsx b/docs/components/primitives/Wrapper.tsx
index 15dd4ad82e9..6b79ff8baec 100644
--- a/docs/components/primitives/Wrapper.tsx
+++ b/docs/components/primitives/Wrapper.tsx
@@ -1,16 +1,16 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
-import type { ElementType, HTMLAttributes } from 'react';
+import { jsx } from '@emotion/react'
+import type { ElementType, HTMLAttributes } from 'react'
-import { useMediaQuery } from '../../lib/media';
+import { useMediaQuery } from '../../lib/media'
type WrapperProps = {
- as?: ElementType;
-} & HTMLAttributes;
+ as?: ElementType
+} & HTMLAttributes
-export function Wrapper({ as: Tag = 'div', ...props }: WrapperProps) {
- const mq = useMediaQuery();
+export function Wrapper ({ as: Tag = 'div', ...props }: WrapperProps) {
+ const mq = useMediaQuery()
return (
- );
+ )
}
diff --git a/docs/components/primitives/YouTubeEmbed.tsx b/docs/components/primitives/YouTubeEmbed.tsx
index 394851287fa..884646d5f3f 100644
--- a/docs/components/primitives/YouTubeEmbed.tsx
+++ b/docs/components/primitives/YouTubeEmbed.tsx
@@ -1,13 +1,13 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
type YouTubeEmbedProps = {
- url: string;
- label: string;
-};
+ url: string
+ label: string
+}
-export function YouTubeEmbed({ url, label }: YouTubeEmbedProps) {
+export function YouTubeEmbed ({ url, label }: YouTubeEmbedProps) {
return (
- );
+ )
}
diff --git a/docs/components/useOutsideClick.ts b/docs/components/useOutsideClick.ts
index ec7b676c840..1158b2c9c8f 100644
--- a/docs/components/useOutsideClick.ts
+++ b/docs/components/useOutsideClick.ts
@@ -1,17 +1,17 @@
-import { useEffect } from 'react';
+import { useEffect } from 'react'
export const useOnClickOutside = (ref: any, handler: (event: MouseEvent) => null) => {
useEffect(() => {
const listener = (event: MouseEvent) => {
if (!ref.current || ref.current.contains(event.target)) {
- return;
+ return
}
- handler(event);
- };
- document.addEventListener('mousedown', listener);
+ handler(event)
+ }
+ document.addEventListener('mousedown', listener)
return () => {
- document.removeEventListener('mousedown', listener);
- };
- }, [ref, handler]);
-};
+ document.removeEventListener('mousedown', listener)
+ }
+ }, [ref, handler])
+}
diff --git a/docs/lib/TOKENS.ts b/docs/lib/TOKENS.ts
index 9203d3f2edf..cf1f595a8ac 100644
--- a/docs/lib/TOKENS.ts
+++ b/docs/lib/TOKENS.ts
@@ -6,7 +6,7 @@ export const SPACE = {
'--space-large': '1rem',
'--space-xlarge': '1.5rem',
'--space-xxlarge': '6rem',
-} as const;
+} as const
export const TYPE = {
'--font-brand':
@@ -15,7 +15,7 @@ export const TYPE = {
'system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"',
'--font-mono':
'ui-monospace, SFMono-Regular, SF Mono, Consolas, Liberation Mono, Menlo, monospace',
-} as const;
+} as const
export const TYPESCALE = {
'--font-xxsmall': '0.75rem',
@@ -25,7 +25,7 @@ export const TYPESCALE = {
'--font-large': '1.5rem',
'--font-xlarge': '1.875rem',
'--font-xxlarge': '2.625rem',
-} as const;
+} as const
export const COLORS = {
light: {
@@ -120,4 +120,4 @@ export const COLORS = {
'--grad6-1': '#F7F9FC',
'--grad6-2': '#F7F9FC',
},
-} as const;
+} as const
diff --git a/docs/lib/algoliaStyles.ts b/docs/lib/algoliaStyles.ts
index 416b9a2fba9..6563ff247fd 100644
--- a/docs/lib/algoliaStyles.ts
+++ b/docs/lib/algoliaStyles.ts
@@ -1,4 +1,4 @@
-import { css } from '@emotion/react';
+import { css } from '@emotion/react'
export const algoliaStyles = css`
.algolia-autocomplete {
@@ -462,4 +462,4 @@ export const algoliaStyles = css`
}
/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImRvY3NlYXJjaC5jc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7RUFDRSxzQkFBc0I7RUFDdEIsbUJBQW1CO0VBQ25CLGFBQWE7RUFDYix3QkFBd0I7RUFDeEIsb0JBQW9CO0VBQ3BCLHVCQUF1QjtFQUN2QiwrQkFBK0I7Q0FDaEM7O0FBRUQ7RUFDRSxlQUFlO0VBQ2YsWUFBWTtFQUNaLGFBQWE7Q0FDZDs7QUFFRDtFQUNFLFlBQVk7RUFDWixhQUFhO0VBQ2IsYUFBYTtFQUNiLG1CQUFtQjtDQUNwQjs7QUFFRDtFQUNFLHNCQUFzQjtFQUN0Qix1QkFBdUI7RUFDdkIsdURBQXVEO0VBQ3ZELFVBQVU7RUFDVixvQkFBb0I7RUFDcEIsb0NBQW9DO0VBQ3BDLCtCQUErQjtFQUMvQixXQUFXO0VBQ1gsb0JBQW9CO0VBQ3BCLG1CQUFtQjtFQUNuQixZQUFZO0VBQ1osYUFBYTtFQUNiLHVCQUF1QjtFQUN2QixvQkFBb0I7RUFDcEIsZ0JBQWdCO0VBQ2hCLHlCQUFpQjtLQUFqQixzQkFBaUI7VUFBakIsaUJBQWlCO0NBQ2xCOztBQUVEO0VBQ0UsY0FBYztDQUNmOztBQUVEO0VBQ0Usb0NBQW9DO0NBQ3JDOztBQUVEO0VBQ0UsV0FBVztFQUNYLG9DQUFvQztFQUNwQyxvQkFBb0I7Q0FDckI7O0FBRUQ7RUFDRSxlQUFlO0NBQ2hCOztBQUZEO0VBQ0UsZUFBZTtDQUNoQjs7QUFGRDtFQUNFLGVBQWU7Q0FDaEI7O0FBRkQ7RUFDRSxlQUFlO0NBQ2hCOztBQUVEO0VBQ0UsbUJBQW1CO0VBQ25CLE9BQU87RUFDUCxVQUFVO0VBQ1YsVUFBVTtFQUNWLDZCQUE2QjtFQUM3Qix3Q0FBd0M7RUFDeEMsV0FBVztFQUNYLFlBQVk7RUFDWixhQUFhO0VBQ2IsdUJBQXVCO0VBQ3ZCLG1CQUFtQjtFQUNuQixtQkFBbUI7RUFDbkIsMEJBQWtCO0tBQWxCLHVCQUFrQjtNQUFsQixzQkFBa0I7VUFBbEIsa0JBQWtCO0VBQ2xCLGVBQWU7RUFDZixRQUFRO0NBQ1Q7O0FBRUQ7RUFDRSxzQkFBc0I7RUFDdEIsbUJBQW1CO0VBQ25CLGFBQWE7RUFDYix1QkFBdUI7RUFDdkIsWUFBWTtDQUNiOztBQUVEO0VBQ0UsZ0JBQWdCO0NBQ2pCOztBQUVEO0VBQ0UsV0FBVztDQUNaOztBQUVEO0VBQ0UsWUFBWTtFQUNaLGFBQWE7RUFDYix1QkFBdUI7RUFDdkIsY0FBYztDQUNmOztBQUVEO0VBQ0UsZUFBZTtFQUNmLG1CQUFtQjtFQUNuQixTQUFTO0VBQ1QsV0FBVztFQUNYLFVBQVU7RUFDVixVQUFVO0VBQ1YsaUJBQWlCO0VBQ2pCLGdCQUFnQjtFQUNoQixXQUFXO0VBQ1gsbUJBQW1CO0VBQ25CLDBCQUFrQjtLQUFsQix1QkFBa0I7TUFBbEIsc0JBQWtCO1VBQWxCLGtCQUFrQjtFQUNsQix5QkFBeUI7Q0FDMUI7O0FBRUQ7RUFDRSxjQUFjO0NBQ2Y7O0FBRUQ7RUFDRSxXQUFXO0NBQ1o7O0FBRUQ7RUFDRSxlQUFlO0VBQ2YsWUFBWTtFQUNaLFdBQVc7RUFDWCxZQUFZO0NBQ2I7O0FBRUQ7RUFDRSxlQUFlO0VBQ2YscUNBQTZCO1VBQTdCLDZCQUE2QjtFQUM3QixrQ0FBMEI7VUFBMUIsMEJBQTBCO0NBQzNCOztBQUVEO0VBQ0U7SUFDRSwyQ0FBbUM7WUFBbkMsbUNBQW1DO0lBQ25DLFdBQVc7R0FDWjtFQUNEO0lBQ0Usd0JBQWdCO1lBQWhCLGdCQUFnQjtJQUNoQixXQUFXO0dBQ1o7Q0FDRjs7QUFURDtFQUNFO0lBQ0UsMkNBQW1DO1lBQW5DLG1DQUFtQztJQUNuQyxXQUFXO0dBQ1o7RUFDRDtJQUNFLHdCQUFnQjtZQUFoQixnQkFBZ0I7SUFDaEIsV0FBVztHQUNaO0NBQ0Y7O0FBRUQ7RUFDRSxvQkFBb0I7RUFDcEIseUJBQXlCO0NBQzFCOztBQUVEO0VBQ0UsWUFBWTtDQUNiOztBQUVEO0VBQ0UsbUJBQW1CO0VBQ25CLDBCQUEwQjtDQUMzQjs7QUFFRDtFQUNFLFdBQVc7Q0FDWjs7QUFFRDtFQUNFLG1CQUFtQjtFQUNuQixVQUFVO0VBQ1YsbUJBQW1CO0VBQ25CLGdCQUFnQjtFQUNoQixXQUFXO0VBQ1gsaUJBQWlCO0VBQ2pCLGFBQWE7RUFDYixtQkFBbUI7RUFDbkIsd0JBQXdCO0VBQ3hCLGFBQWE7RUFDYixhQUFhO0VBQ2IsaUJBQWlCO0VBQ2pCLGlCQUFpQjtFQUNqQix5RUFBeUU7Q0FDMUU7O0FBRUQ7RUFDRSxlQUFlO0VBQ2YsbUJBQW1CO0VBQ25CLFlBQVk7RUFDWixZQUFZO0VBQ1osYUFBYTtFQUNiLGlCQUFpQjtFQUNqQixjQUFjO0VBQ2QsVUFBVTtFQUNWLDhCQUE4QjtFQUM5QixnQ0FBZ0M7RUFDaEMsa0NBQTBCO1VBQTFCLDBCQUEwQjtFQUMxQixtQkFBbUI7Q0FDcEI7O0FBRUQ7RUFDRSxtQkFBbUI7RUFDbkIsY0FBYztFQUNkLGdCQUFnQjtDQUNqQjs7QUFFRDtFQUNFLHNCQUFzQjtDQUN2Qjs7QUFFRDtFQUNFLGdCQUFnQjtDQUNqQjs7QUFFRDtFQUNFLDJDQUEyQztDQUM1Qzs7QUFFRDtFQUNFLDJDQUEyQztDQUM1Qzs7QUFFRDtFQUNFLG1CQUFtQjtFQUNuQiwwQkFBMEI7RUFDMUIsaUJBQWlCO0VBQ2pCLG1CQUFtQjtFQUNuQixlQUFlO0VBQ2YsbUJBQW1CO0NBQ3BCOztBQUVEO0VBQ0UsdUJBQXVCO0NBQ3hCOztBQUVEO0VBQ0UsZUFBZTtFQUNmLG1CQUFtQjtFQUNuQixlQUFlO0VBQ2YsaUJBQWlCO0VBQ2pCLGVBQWU7RUFDZixpQkFBaUI7Q0FDbEI7O0FBRUQ7RUFDRSxlQUFlO0VBQ2YscUNBQXFDO0VBQ3JDLHNCQUFzQjtDQUN2Qjs7QUFFRDs7OztFQUlFLGlCQUFpQjtFQUNqQixvQkFBb0I7RUFDcEIscURBQXFEO0VBQ3JELGVBQWU7Q0FDaEI7O0FBRUQ7RUFDRSxpQkFBaUI7RUFDakIsb0JBQW9CO0VBQ3BCLHFEQUFxRDtFQUNyRCxlQUFlO0NBQ2hCOztBQUVEO0VBQ0UsZUFBZTtFQUNmLGFBQWE7RUFDYixXQUFXO0VBQ1gsbUJBQW1CO0VBQ25CLDBDQUEwQztFQUMxQyxnQkFBZ0I7Q0FDakI7O0FBRUQ7RUFDRSxZQUFZO0VBQ1osbUJBQW1CO0VBQ25CLGVBQWU7RUFDZixPQUFPO0VBQ1AsYUFBYTtFQUNiLFdBQVc7RUFDWCxpQkFBaUI7RUFDakIsV0FBVztDQUNaOztBQUVEO0VBQ0UsbUJBQW1CO0VBQ25CLDhCQUE4QjtFQUM5QixjQUFjO0VBQ2QsZ0JBQWdCO0VBQ2hCLGVBQWU7RUFDZixlQUFlO0VBQ2YsZUFBZTtDQUNoQjs7QUFFRDtFQUNFLFlBQVk7RUFDWixZQUFZO0VBQ1osbUJBQW1CO0NBQ3BCOztBQUVEO0VBQ0UsWUFBWTtFQUNaLFdBQVc7RUFDWCxnQkFBZ0I7RUFDaEIsa0JBQWtCO0VBQ2xCLG1CQUFtQjtFQUNuQiw4QkFBOEI7RUFDOUIsZUFBZTtFQUNmLGlCQUFpQjtFQUNqQixzQkFBc0I7Q0FDdkI7O0FBRUQ7RUFDRSxZQUFZO0VBQ1osbUJBQW1CO0VBQ25CLGVBQWU7RUFDZixPQUFPO0VBQ1AsYUFBYTtFQUNiLFdBQVc7RUFDWCxpQkFBaUI7RUFDakIsU0FBUztDQUNWOztBQUVEO0VBQ0UsY0FBYztDQUNmOztBQUVEO0VBQ0UsbUJBQW1CO0VBQ25CLGVBQWU7RUFDZixpQkFBaUI7RUFDakIsa0JBQWtCO0NBQ25COztBQUVEO0VBQ0UsZUFBZTtFQUNmLG1CQUFtQjtFQUNuQixrQkFBa0I7RUFDbEIsZUFBZTtDQUNoQjs7QUFFRDtFQUNFLFlBQVk7RUFDWixlQUFlO0VBQ2YsbUJBQW1CO0VBQ25CLGlCQUFpQjtDQUNsQjs7QUFFRDtFQUNFLGNBQWM7Q0FDZjs7QUFFRDtFQUNFLGlCQUFpQjtFQUNqQixlQUFlO0VBQ2YsYUFBYTtFQUNiLGVBQWU7RUFDZiwwQkFBMEI7RUFDMUIsbUJBQW1CO0VBQ25CLCtEQUErRDtDQUNoRTs7QUFFRDtFQUNFLGlCQUFpQjtDQUNsQjs7QUFFRDtFQUNFLGVBQWU7Q0FDaEI7O0FBRUQ7RUFDRSxlQUFlO0NBQ2hCOztBQUVEO0VBQ0U7SUFDRSxlQUFlO0dBQ2hCO0NBQ0Y7O0FBRUQ7RUFDRTtJQUNFLHNCQUFzQjtJQUN0QixZQUFZO0lBQ1osaUJBQWlCO0lBQ2pCLFlBQVk7SUFDWixXQUFXO0lBQ1gsZUFBZTtJQUNmLGlCQUFpQjtJQUNqQixrQkFBa0I7SUFDbEIsaUJBQWlCO0lBQ2pCLGFBQWE7R0FDZDtFQUNEO0lBQ0UsY0FBYztHQUNmO0VBQ0Q7SUFDRSxhQUFhO0dBQ2Q7RUFDRDtJQUNFLHNCQUFzQjtJQUN0QixZQUFZO0lBQ1osaUJBQWlCO0lBQ2pCLFlBQVk7SUFDWixXQUFXO0dBQ1o7RUFDRDtJQUNFLGNBQWM7R0FDZjtDQUNGOztBQUVEO0VBQ0UsOEJBQThCO0VBQzlCLGFBQWE7RUFDYixVQUFVO0NBQ1g7O0FBRUQ7RUFDRSxZQUFZO0VBQ1osV0FBVztDQUNaOztBQUVEO0VBQ0UsY0FBYztDQUNmOztBQUVEO0VBQ0UsVUFBVTtFQUNWLFdBQVc7RUFDWCxlQUFlO0VBQ2YsWUFBWTtFQUNaLGFBQWE7Q0FDZDs7QUFFRDtFQUNFLGFBQWE7RUFDYixrQkFBa0I7Q0FDbkI7O0FBRUQ7RUFDRSxhQUFhO0VBQ2Isa0JBQWtCO0NBQ25COztBQUVEO0VBQ0UsNFVBQTRVO0VBQzVVLFlBQVk7RUFDWixZQUFZO0VBQ1osYUFBYTtFQUNiLHNCQUFzQjtDQUN2Qjs7QUFFRDtFQUNFLFlBQVk7RUFDWixZQUFZO0VBQ1osVUFBVTtFQUNWLFdBQVc7Q0FDWjs7QUFFRDtFQUNFLHlCQUF5QjtDQUMxQjs7QUFFRDtFQUNFLFVBQVU7RUFDVixlQUFlO0VBQ2YsaUJBQWlCO0VBQ2pCLG9CQUFvQjtDQUNyQjs7QUFFRDtFQUNFLGFBQWE7RUFDYixrQkFBa0I7RUFDbEIsZUFBZTtFQUNmLHNCQUFzQjtDQUN2Qjs7QUFFRDtFQUNFLGdCQUFnQjtFQUNoQixlQUFlO0VBQ2YsbUJBQW1CO0VBQ25CLHVCQUF1QjtFQUN2QixvQkFBb0I7RUFDcEIsa0JBQWtCO0VBQ2xCLGFBQWE7Q0FDZDs7QUFFRDtFQUNFLGVBQWU7RUFDZixrQkFBa0I7RUFDbEIsaUJBQWlCO0NBQ2xCOztBQUVEO0VBQ0UsYUFBYTtFQUNiLGFBQWE7RUFDYixjQUFjO0VBQ2QsdUJBQXVCO0VBQ3ZCLGFBQWE7RUFDYixhQUFhO0VBQ2IsZUFBZTtDQUNoQjs7QUFFRDtFQUNFLHcyUEFBdzJQO0VBQ3gyUCw2QkFBNkI7RUFDN0IsNEJBQTRCO0VBQzVCLHNCQUFzQjtFQUN0QixpQkFBaUI7RUFDakIscUJBQXFCO0VBQ3JCLHNCQUFzQjtFQUN0QixZQUFZO0VBQ1osYUFBYTtFQUNiLGVBQWU7Q0FDaEIiLCJmaWxlIjoiZG9jc2VhcmNoLmNzcyIsInNvdXJjZXNDb250ZW50IjpbIi5zZWFyY2hib3gge1xuICBkaXNwbGF5OiBpbmxpbmUtYmxvY2s7XG4gIHBvc2l0aW9uOiByZWxhdGl2ZTtcbiAgd2lkdGg6IDIwMHB4O1xuICBoZWlnaHQ6IDMycHggIWltcG9ydGFudDtcbiAgd2hpdGUtc3BhY2U6IG5vd3JhcDtcbiAgYm94LXNpemluZzogYm9yZGVyLWJveDtcbiAgdmlzaWJpbGl0eTogdmlzaWJsZSAhaW1wb3J0YW50O1xufVxuXG4uc2VhcmNoYm94IC5hbGdvbGlhLWF1dG9jb21wbGV0ZSB7XG4gIGRpc3BsYXk6IGJsb2NrO1xuICB3aWR0aDogMTAwJTtcbiAgaGVpZ2h0OiAxMDAlO1xufVxuXG4uc2VhcmNoYm94X193cmFwcGVyIHtcbiAgd2lkdGg6IDEwMCU7XG4gIGhlaWdodDogMTAwJTtcbiAgei1pbmRleDogOTk5O1xuICBwb3NpdGlvbjogcmVsYXRpdmU7XG59XG5cbi5zZWFyY2hib3hfX2lucHV0IHtcbiAgZGlzcGxheTogaW5saW5lLWJsb2NrO1xuICBib3gtc2l6aW5nOiBib3JkZXItYm94O1xuICB0cmFuc2l0aW9uOiBib3gtc2hhZG93IDAuNHMgZWFzZSwgYmFja2dyb3VuZCAwLjRzIGVhc2U7XG4gIGJvcmRlcjogMDtcbiAgYm9yZGVyLXJhZGl1czogMTZweDtcbiAgYm94LXNoYWRvdzogaW5zZXQgMCAwIDAgMXB4ICNjY2NjY2M7XG4gIGJhY2tncm91bmQ6ICNmZmZmZmYgIWltcG9ydGFudDtcbiAgcGFkZGluZzogMDtcbiAgcGFkZGluZy1yaWdodDogMjZweDtcbiAgcGFkZGluZy1sZWZ0OiAzMnB4O1xuICB3aWR0aDogMTAwJTtcbiAgaGVpZ2h0OiAxMDAlO1xuICB2ZXJ0aWNhbC1hbGlnbjogbWlkZGxlO1xuICB3aGl0ZS1zcGFjZTogbm9ybWFsO1xuICBmb250LXNpemU6IDEycHg7XG4gIGFwcGVhcmFuY2U6IG5vbmU7XG59XG5cbi5zZWFyY2hib3hfX2lucHV0Ojotd2Via2l0LXNlYXJjaC1kZWNvcmF0aW9uLCAuc2VhcmNoYm94X19pbnB1dDo6LXdlYmtpdC1zZWFyY2gtY2FuY2VsLWJ1dHRvbiwgLnNlYXJjaGJveF9faW5wdXQ6Oi13ZWJraXQtc2VhcmNoLXJlc3VsdHMtYnV0dG9uLCAuc2VhcmNoYm94X19pbnB1dDo6LXdlYmtpdC1zZWFyY2gtcmVzdWx0cy1kZWNvcmF0aW9uIHtcbiAgZGlzcGxheTogbm9uZTtcbn1cblxuLnNlYXJjaGJveF9faW5wdXQ6aG92ZXIge1xuICBib3gtc2hhZG93OiBpbnNldCAwIDAgMCAxcHggI2IzYjNiMztcbn1cblxuLnNlYXJjaGJveF9faW5wdXQ6Zm9jdXMsIC5zZWFyY2hib3hfX2lucHV0OmFjdGl2ZSB7XG4gIG91dGxpbmU6IDA7XG4gIGJveC1zaGFkb3c6IGluc2V0IDAgMCAwIDFweCAjYWFhYWFhO1xuICBiYWNrZ3JvdW5kOiAjZmZmZmZmO1xufVxuXG4uc2VhcmNoYm94X19pbnB1dDo6cGxhY2Vob2xkZXIge1xuICBjb2xvcjogI2FhYWFhYTtcbn1cblxuLnNlYXJjaGJveF9fc3VibWl0IHtcbiAgcG9zaXRpb246IGFic29sdXRlO1xuICB0b3A6IDA7XG4gIG1hcmdpbjogMDtcbiAgYm9yZGVyOiAwO1xuICBib3JkZXItcmFkaXVzOiAxNnB4IDAgMCAxNnB4O1xuICBiYWNrZ3JvdW5kLWNvbG9yOiByZ2JhKDY5LCAxNDIsIDIyNSwgMCk7XG4gIHBhZGRpbmc6IDA7XG4gIHdpZHRoOiAzMnB4O1xuICBoZWlnaHQ6IDEwMCU7XG4gIHZlcnRpY2FsLWFsaWduOiBtaWRkbGU7XG4gIHRleHQtYWxpZ246IGNlbnRlcjtcbiAgZm9udC1zaXplOiBpbmhlcml0O1xuICB1c2VyLXNlbGVjdDogbm9uZTtcbiAgcmlnaHQ6IGluaGVyaXQ7XG4gIGxlZnQ6IDA7XG59XG5cbi5zZWFyY2hib3hfX3N1Ym1pdDo6YmVmb3JlIHtcbiAgZGlzcGxheTogaW5saW5lLWJsb2NrO1xuICBtYXJnaW4tcmlnaHQ6IC00cHg7XG4gIGhlaWdodDogMTAwJTtcbiAgdmVydGljYWwtYWxpZ246IG1pZGRsZTtcbiAgY29udGVudDogJyc7XG59XG5cbi5zZWFyY2hib3hfX3N1Ym1pdDpob3ZlciwgLnNlYXJjaGJveF9fc3VibWl0OmFjdGl2ZSB7XG4gIGN1cnNvcjogcG9pbnRlcjtcbn1cblxuLnNlYXJjaGJveF9fc3VibWl0OmZvY3VzIHtcbiAgb3V0bGluZTogMDtcbn1cblxuLnNlYXJjaGJveF9fc3VibWl0IHN2ZyB7XG4gIHdpZHRoOiAxNHB4O1xuICBoZWlnaHQ6IDE0cHg7XG4gIHZlcnRpY2FsLWFsaWduOiBtaWRkbGU7XG4gIGZpbGw6ICM2ZDdlOTY7XG59XG5cbi5zZWFyY2hib3hfX3Jlc2V0IHtcbiAgZGlzcGxheTogYmxvY2s7XG4gIHBvc2l0aW9uOiBhYnNvbHV0ZTtcbiAgdG9wOiA4cHg7XG4gIHJpZ2h0OiA4cHg7XG4gIG1hcmdpbjogMDtcbiAgYm9yZGVyOiAwO1xuICBiYWNrZ3JvdW5kOiBub25lO1xuICBjdXJzb3I6IHBvaW50ZXI7XG4gIHBhZGRpbmc6IDA7XG4gIGZvbnQtc2l6ZTogaW5oZXJpdDtcbiAgdXNlci1zZWxlY3Q6IG5vbmU7XG4gIGZpbGw6IHJnYmEoMCwgMCwgMCwgMC41KTtcbn1cblxuLnNlYXJjaGJveF9fcmVzZXQuaGlkZSB7XG4gIGRpc3BsYXk6IG5vbmU7XG59XG5cbi5zZWFyY2hib3hfX3Jlc2V0OmZvY3VzIHtcbiAgb3V0bGluZTogMDtcbn1cblxuLnNlYXJjaGJveF9fcmVzZXQgc3ZnIHtcbiAgZGlzcGxheTogYmxvY2s7XG4gIG1hcmdpbjogNHB4O1xuICB3aWR0aDogOHB4O1xuICBoZWlnaHQ6IDhweDtcbn1cblxuLnNlYXJjaGJveF9faW5wdXQ6dmFsaWQgfiAuc2VhcmNoYm94X19yZXNldCB7XG4gIGRpc3BsYXk6IGJsb2NrO1xuICBhbmltYXRpb24tbmFtZTogc2J4LXJlc2V0LWluO1xuICBhbmltYXRpb24tZHVyYXRpb246IDAuMTVzO1xufVxuXG5Aa2V5ZnJhbWVzIHNieC1yZXNldC1pbiB7XG4gIDAlIHtcbiAgICB0cmFuc2Zvcm06IHRyYW5zbGF0ZTNkKC0yMCUsIDAsIDApO1xuICAgIG9wYWNpdHk6IDA7XG4gIH1cbiAgMTAwJSB7XG4gICAgdHJhbnNmb3JtOiBub25lO1xuICAgIG9wYWNpdHk6IDE7XG4gIH1cbn1cblxuLmFsZ29saWEtYXV0b2NvbXBsZXRlLmFsZ29saWEtYXV0b2NvbXBsZXRlLXJpZ2h0IC5kcy1kcm9wZG93bi1tZW51IHtcbiAgcmlnaHQ6IDAgIWltcG9ydGFudDtcbiAgbGVmdDogaW5oZXJpdCAhaW1wb3J0YW50O1xufVxuXG4uYWxnb2xpYS1hdXRvY29tcGxldGUuYWxnb2xpYS1hdXRvY29tcGxldGUtcmlnaHQgLmRzLWRyb3Bkb3duLW1lbnU6YmVmb3JlIHtcbiAgcmlnaHQ6IDQ4cHg7XG59XG5cbi5hbGdvbGlhLWF1dG9jb21wbGV0ZS5hbGdvbGlhLWF1dG9jb21wbGV0ZS1sZWZ0IC5kcy1kcm9wZG93bi1tZW51IHtcbiAgbGVmdDogMCAhaW1wb3J0YW50O1xuICByaWdodDogaW5oZXJpdCAhaW1wb3J0YW50O1xufVxuXG4uYWxnb2xpYS1hdXRvY29tcGxldGUuYWxnb2xpYS1hdXRvY29tcGxldGUtbGVmdCAuZHMtZHJvcGRvd24tbWVudTpiZWZvcmUge1xuICBsZWZ0OiA0OHB4O1xufVxuXG4uYWxnb2xpYS1hdXRvY29tcGxldGUgLmRzLWRyb3Bkb3duLW1lbnUge1xuICBwb3NpdGlvbjogcmVsYXRpdmU7XG4gIHRvcDogLTZweDtcbiAgYm9yZGVyLXJhZGl1czogNHB4O1xuICBtYXJnaW46IDZweCAwIDA7XG4gIHBhZGRpbmc6IDA7XG4gIHRleHQtYWxpZ246IGxlZnQ7XG4gIGhlaWdodDogYXV0bztcbiAgcG9zaXRpb246IHJlbGF0aXZlO1xuICBiYWNrZ3JvdW5kOiB0cmFuc3BhcmVudDtcbiAgYm9yZGVyOiBub25lO1xuICB6LWluZGV4OiA5OTk7XG4gIG1heC13aWR0aDogNjAwcHg7XG4gIG1pbi13aWR0aDogNTAwcHg7XG4gIGJveC1zaGFkb3c6IDAgMXB4IDAgMCByZ2JhKDAsIDAsIDAsIDAuMiksIDAgMnB4IDNweCAwIHJnYmEoMCwgMCwgMCwgMC4xKTtcbn1cblxuLmFsZ29saWEtYXV0b2NvbXBsZXRlIC5kcy1kcm9wZG93bi1tZW51OmJlZm9yZSB7XG4gIGRpc3BsYXk6IGJsb2NrO1xuICBwb3NpdGlvbjogYWJzb2x1dGU7XG4gIGNvbnRlbnQ6ICcnO1xuICB3aWR0aDogMTRweDtcbiAgaGVpZ2h0OiAxNHB4O1xuICBiYWNrZ3JvdW5kOiAjZmZmO1xuICB6LWluZGV4OiAxMDAwO1xuICB0b3A6IC03cHg7XG4gIGJvcmRlci10b3A6IDFweCBzb2xpZCAjZDlkOWQ5O1xuICBib3JkZXItcmlnaHQ6IDFweCBzb2xpZCAjZDlkOWQ5O1xuICB0cmFuc2Zvcm06IHJvdGF0ZSgtNDVkZWcpO1xuICBib3JkZXItcmFkaXVzOiAycHg7XG59XG5cbi5hbGdvbGlhLWF1dG9jb21wbGV0ZSAuZHMtZHJvcGRvd24tbWVudSAuZHMtc3VnZ2VzdGlvbnMge1xuICBwb3NpdGlvbjogcmVsYXRpdmU7XG4gIHotaW5kZXg6IDEwMDA7XG4gIG1hcmdpbi10b3A6IDhweDtcbn1cblxuLmFsZ29saWEtYXV0b2NvbXBsZXRlIC5kcy1kcm9wZG93bi1tZW51IC5kcy1zdWdnZXN0aW9ucyBhOmhvdmVyIHtcbiAgdGV4dC1kZWNvcmF0aW9uOiBub25lO1xufVxuXG4uYWxnb2xpYS1hdXRvY29tcGxldGUgLmRzLWRyb3Bkb3duLW1lbnUgLmRzLXN1Z2dlc3Rpb24ge1xuICBjdXJzb3I6IHBvaW50ZXI7XG59XG5cbi5hbGdvbGlhLWF1dG9jb21wbGV0ZSAuZHMtZHJvcGRvd24tbWVudSAuZHMtc3VnZ2VzdGlvbi5kcy1jdXJzb3IgLmFsZ29saWEtZG9jc2VhcmNoLXN1Z2dlc3Rpb24uc3VnZ2VzdGlvbi1sYXlvdXQtc2ltcGxlIHtcbiAgYmFja2dyb3VuZC1jb2xvcjogcmdiYSg2OSwgMTQyLCAyMjUsIDAuMDUpO1xufVxuXG4uYWxnb2xpYS1hdXRvY29tcGxldGUgLmRzLWRyb3Bkb3duLW1lbnUgLmRzLXN1Z2dlc3Rpb24uZHMtY3Vyc29yIC5hbGdvbGlhLWRvY3NlYXJjaC1zdWdnZXN0aW9uOm5vdCguc3VnZ2VzdGlvbi1sYXlvdXQtc2ltcGxlKSAuYWxnb2xpYS1kb2NzZWFyY2gtc3VnZ2VzdGlvbi0tY29udGVudCB7XG4gIGJhY2tncm91bmQtY29sb3I6IHJnYmEoNjksIDE0MiwgMjI1LCAwLjA1KTtcbn1cblxuLmFsZ29saWEtYXV0b2NvbXBsZXRlIC5kcy1kcm9wZG93bi1tZW51IFtjbGFzc149J2RzLWRhdGFzZXQtJ10ge1xuICBwb3NpdGlvbjogcmVsYXRpdmU7XG4gIGJvcmRlcjogc29saWQgMXB4ICNkOWQ5ZDk7XG4gIGJhY2tncm91bmQ6ICNmZmY7XG4gIGJvcmRlci1yYWRpdXM6IDRweDtcbiAgb3ZlcmZsb3c6IGF1dG87XG4gIHBhZGRpbmc6IDAgOHB4IDhweDtcbn1cblxuLmFsZ29saWEtYXV0b2NvbXBsZXRlIC5kcy1kcm9wZG93bi1tZW51ICoge1xuICBib3gtc2l6aW5nOiBib3JkZXItYm94O1xufVxuXG4uYWxnb2xpYS1hdXRvY29tcGxldGUgLmFsZ29saWEtZG9jc2VhcmNoLXN1Z2dlc3Rpb24ge1xuICBkaXNwbGF5OiBibG9jaztcbiAgcG9zaXRpb246IHJlbGF0aXZlO1xuICBwYWRkaW5nOiAwIDhweDtcbiAgYmFja2dyb3VuZDogI2ZmZjtcbiAgY29sb3I6ICMwMjA2MGM7XG4gIG92ZXJmbG93OiBoaWRkZW47XG59XG5cbi5hbGdvbGlhLWF1dG9jb21wbGV0ZSAuYWxnb2xpYS1kb2NzZWFyY2gtc3VnZ2VzdGlvbi0taGlnaGxpZ2h0IHtcbiAgY29sb3I6ICMxNzRkOGM7XG4gIGJhY2tncm91bmQ6IHJnYmEoMTQzLCAxODcsIDIzNywgMC4xKTtcbiAgcGFkZGluZzogMC4xZW0gMC4wNWVtO1xufVxuXG4uYWxnb2xpYS1hdXRvY29tcGxldGUgLmFsZ29saWEtZG9jc2VhcmNoLXN1Z2dlc3Rpb24tLWNhdGVnb3J5LWhlYWRlciAuYWxnb2xpYS1kb2NzZWFyY2gtc3VnZ2VzdGlvbi0tY2F0ZWdvcnktaGVhZGVyLWx2bDBcbi5hbGdvbGlhLWRvY3NlYXJjaC1zdWdnZXN0aW9uLS1oaWdobGlnaHQsXG4uYWxnb2xpYS1hdXRvY29tcGxldGUgLmFsZ29saWEtZG9jc2VhcmNoLXN1Z2dlc3Rpb24tLWNhdGVnb3J5LWhlYWRlciAuYWxnb2xpYS1kb2NzZWFyY2gtc3VnZ2VzdGlvbi0tY2F0ZWdvcnktaGVhZGVyLWx2bDFcbi5hbGdvbGlhLWRvY3NlYXJjaC1zdWdnZXN0aW9uLS1oaWdobGlnaHQge1xuICBwYWRkaW5nOiAwIDAgMXB4O1xuICBiYWNrZ3JvdW5kOiBpbmhlcml0O1xuICBib3gtc2hhZG93OiBpbnNldCAwIC0ycHggMCAwIHJnYmEoNjksIDE0MiwgMjI1LCAwLjgpO1xuICBjb2xvcjogaW5oZXJpdDtcbn1cblxuLmFsZ29saWEtYXV0b2NvbXBsZXRlIC5hbGdvbGlhLWRvY3NlYXJjaC1zdWdnZXN0aW9uLS10ZXh0IC5hbGdvbGlhLWRvY3NlYXJjaC1zdWdnZXN0aW9uLS1oaWdobGlnaHQge1xuICBwYWRkaW5nOiAwIDAgMXB4O1xuICBiYWNrZ3JvdW5kOiBpbmhlcml0O1xuICBib3gtc2hhZG93OiBpbnNldCAwIC0ycHggMCAwIHJnYmEoNjksIDE0MiwgMjI1LCAwLjgpO1xuICBjb2xvcjogaW5oZXJpdDtcbn1cblxuLmFsZ29saWEtYXV0b2NvbXBsZXRlIC5hbGdvbGlhLWRvY3NlYXJjaC1zdWdnZXN0aW9uLS1jb250ZW50IHtcbiAgZGlzcGxheTogYmxvY2s7XG4gIGZsb2F0OiByaWdodDtcbiAgd2lkdGg6IDcwJTtcbiAgcG9zaXRpb246IHJlbGF0aXZlO1xuICBwYWRkaW5nOiA1LjMzMzMzcHggMCA1LjMzMzMzcHggMTAuNjY2NjdweDtcbiAgY3Vyc29yOiBwb2ludGVyO1xufVxuXG4uYWxnb2xpYS1hdXRvY29tcGxldGUgLmFsZ29saWEtZG9jc2VhcmNoLXN1Z2dlc3Rpb24tLWNvbnRlbnQ6YmVmb3JlIHtcbiAgY29udGVudDogJyc7XG4gIHBvc2l0aW9uOiBhYnNvbHV0ZTtcbiAgZGlzcGxheTogYmxvY2s7XG4gIHRvcDogMDtcbiAgaGVpZ2h0OiAxMDAlO1xuICB3aWR0aDogMXB4O1xuICBiYWNrZ3JvdW5kOiAjZGRkO1xuICBsZWZ0OiAtMXB4O1xufVxuXG4uYWxnb2xpYS1hdXRvY29tcGxldGUgLmFsZ29saWEtZG9jc2VhcmNoLXN1Z2dlc3Rpb24tLWNhdGVnb3J5LWhlYWRlciB7XG4gIHBvc2l0aW9uOiByZWxhdGl2ZTtcbiAgYm9yZGVyLWJvdHRvbTogMXB4IHNvbGlkICNkZGQ7XG4gIGRpc3BsYXk6IG5vbmU7XG4gIG1hcmdpbi10b3A6IDhweDtcbiAgcGFkZGluZzogNHB4IDA7XG4gIGZvbnQtc2l6ZTogMWVtO1xuICBjb2xvcjogIzMzMzYzZDtcbn1cblxuLmFsZ29saWEtYXV0b2NvbXBsZXRlIC5hbGdvbGlhLWRvY3NlYXJjaC1zdWdnZXN0aW9uLS13cmFwcGVyIHtcbiAgd2lkdGg6IDEwMCU7XG4gIGZsb2F0OiBsZWZ0O1xuICBwYWRkaW5nOiA4cHggMCAwIDA7XG59XG5cbi5hbGdvbGlhLWF1dG9jb21wbGV0ZSAuYWxnb2xpYS1kb2NzZWFyY2gtc3VnZ2VzdGlvbi0tc3ViY2F0ZWdvcnktY29sdW1uIHtcbiAgZmxvYXQ6IGxlZnQ7XG4gIHdpZHRoOiAzMCU7XG4gIHBhZGRpbmctbGVmdDogMDtcbiAgdGV4dC1hbGlnbjogcmlnaHQ7XG4gIHBvc2l0aW9uOiByZWxhdGl2ZTtcbiAgcGFkZGluZzogNS4zMzMzM3B4IDEwLjY2NjY3cHg7XG4gIGNvbG9yOiAjYTRhN2FlO1xuICBmb250LXNpemU6IDAuOWVtO1xuICB3b3JkLXdyYXA6IGJyZWFrLXdvcmQ7XG59XG5cbi5hbGdvbGlhLWF1dG9jb21wbGV0ZSAuYWxnb2xpYS1kb2NzZWFyY2gtc3VnZ2VzdGlvbi0tc3ViY2F0ZWdvcnktY29sdW1uOmJlZm9yZSB7XG4gIGNvbnRlbnQ6ICcnO1xuICBwb3NpdGlvbjogYWJzb2x1dGU7XG4gIGRpc3BsYXk6IGJsb2NrO1xuICB0b3A6IDA7XG4gIGhlaWdodDogMTAwJTtcbiAgd2lkdGg6IDFweDtcbiAgYmFja2dyb3VuZDogI2RkZDtcbiAgcmlnaHQ6IDA7XG59XG5cbi5hbGdvbGlhLWF1dG9jb21wbGV0ZSAuYWxnb2xpYS1kb2NzZWFyY2gtc3VnZ2VzdGlvbi0tc3ViY2F0ZWdvcnktaW5saW5lIHtcbiAgZGlzcGxheTogbm9uZTtcbn1cblxuLmFsZ29saWEtYXV0b2NvbXBsZXRlIC5hbGdvbGlhLWRvY3NlYXJjaC1zdWdnZXN0aW9uLS10aXRsZSB7XG4gIG1hcmdpbi1ib3R0b206IDRweDtcbiAgY29sb3I6ICMwMjA2MGM7XG4gIGZvbnQtc2l6ZTogMC45ZW07XG4gIGZvbnQtd2VpZ2h0OiBib2xkO1xufVxuXG4uYWxnb2xpYS1hdXRvY29tcGxldGUgLmFsZ29saWEtZG9jc2VhcmNoLXN1Z2dlc3Rpb24tLXRleHQge1xuICBkaXNwbGF5OiBibG9jaztcbiAgbGluZS1oZWlnaHQ6IDEuMmVtO1xuICBmb250LXNpemU6IDAuODVlbTtcbiAgY29sb3I6ICM2MzY3NmQ7XG59XG5cbi5hbGdvbGlhLWF1dG9jb21wbGV0ZSAuYWxnb2xpYS1kb2NzZWFyY2gtc3VnZ2VzdGlvbi0tbm8tcmVzdWx0cyB7XG4gIHdpZHRoOiAxMDAlO1xuICBwYWRkaW5nOiA4cHggMDtcbiAgdGV4dC1hbGlnbjogY2VudGVyO1xuICBmb250LXNpemU6IDEuMmVtO1xufVxuXG4uYWxnb2xpYS1hdXRvY29tcGxldGUgLmFsZ29saWEtZG9jc2VhcmNoLXN1Z2dlc3Rpb24tLW5vLXJlc3VsdHM6OmJlZm9yZSB7XG4gIGRpc3BsYXk6IG5vbmU7XG59XG5cbi5hbGdvbGlhLWF1dG9jb21wbGV0ZSAuYWxnb2xpYS1kb2NzZWFyY2gtc3VnZ2VzdGlvbiBjb2RlIHtcbiAgcGFkZGluZzogMXB4IDVweDtcbiAgZm9udC1zaXplOiA5MCU7XG4gIGJvcmRlcjogbm9uZTtcbiAgY29sb3I6ICMyMjIyMjI7XG4gIGJhY2tncm91bmQtY29sb3I6ICNlYmViZWI7XG4gIGJvcmRlci1yYWRpdXM6IDNweDtcbiAgZm9udC1mYW1pbHk6IE1lbmxvLCBNb25hY28sIENvbnNvbGFzLCAnQ291cmllciBOZXcnLCBtb25vc3BhY2U7XG59XG5cbi5hbGdvbGlhLWF1dG9jb21wbGV0ZSAuYWxnb2xpYS1kb2NzZWFyY2gtc3VnZ2VzdGlvbiBjb2RlIC5hbGdvbGlhLWRvY3NlYXJjaC1zdWdnZXN0aW9uLS1oaWdobGlnaHQge1xuICBiYWNrZ3JvdW5kOiBub25lO1xufVxuXG4uYWxnb2xpYS1hdXRvY29tcGxldGUgLmFsZ29saWEtZG9jc2VhcmNoLXN1Z2dlc3Rpb24uYWxnb2xpYS1kb2NzZWFyY2gtc3VnZ2VzdGlvbl9fbWFpbiAuYWxnb2xpYS1kb2NzZWFyY2gtc3VnZ2VzdGlvbi0tY2F0ZWdvcnktaGVhZGVyIHtcbiAgZGlzcGxheTogYmxvY2s7XG59XG5cbi5hbGdvbGlhLWF1dG9jb21wbGV0ZSAuYWxnb2xpYS1kb2NzZWFyY2gtc3VnZ2VzdGlvbi5hbGdvbGlhLWRvY3NlYXJjaC1zdWdnZXN0aW9uX19zZWNvbmRhcnkge1xuICBkaXNwbGF5OiBibG9jaztcbn1cblxuQG1lZGlhIGFsbCBhbmQgKG1pbi13aWR0aDogNzY4cHgpIHtcbiAgLmFsZ29saWEtYXV0b2NvbXBsZXRlIC5hbGdvbGlhLWRvY3NlYXJjaC1zdWdnZXN0aW9uIC5hbGdvbGlhLWRvY3NlYXJjaC1zdWdnZXN0aW9uLS1zdWJjYXRlZ29yeS1jb2x1bW4ge1xuICAgIGRpc3BsYXk6IGJsb2NrO1xuICB9XG59XG5cbkBtZWRpYSBhbGwgYW5kIChtYXgtd2lkdGg6IDc2OHB4KSB7XG4gIC5hbGdvbGlhLWF1dG9jb21wbGV0ZSAuYWxnb2xpYS1kb2NzZWFyY2gtc3VnZ2VzdGlvbiAuYWxnb2xpYS1kb2NzZWFyY2gtc3VnZ2VzdGlvbi0tc3ViY2F0ZWdvcnktY29sdW1uIHtcbiAgICBkaXNwbGF5OiBpbmxpbmUtYmxvY2s7XG4gICAgd2lkdGg6IGF1dG87XG4gICAgdGV4dC1hbGlnbjogbGVmdDtcbiAgICBmbG9hdDogbGVmdDtcbiAgICBwYWRkaW5nOiAwO1xuICAgIGNvbG9yOiAjMDIwNjBjO1xuICAgIGZvbnQtc2l6ZTogMC45ZW07XG4gICAgZm9udC13ZWlnaHQ6IGJvbGQ7XG4gICAgdGV4dC1hbGlnbjogbGVmdDtcbiAgICBvcGFjaXR5OiAwLjU7XG4gIH1cbiAgLmFsZ29saWEtYXV0b2NvbXBsZXRlIC5hbGdvbGlhLWRvY3NlYXJjaC1zdWdnZXN0aW9uIC5hbGdvbGlhLWRvY3NlYXJjaC1zdWdnZXN0aW9uLS1zdWJjYXRlZ29yeS1jb2x1bW46YmVmb3JlIHtcbiAgICBkaXNwbGF5OiBub25lO1xuICB9XG4gIC5hbGdvbGlhLWF1dG9jb21wbGV0ZSAuYWxnb2xpYS1kb2NzZWFyY2gtc3VnZ2VzdGlvbiAuYWxnb2xpYS1kb2NzZWFyY2gtc3VnZ2VzdGlvbi0tc3ViY2F0ZWdvcnktY29sdW1uOmFmdGVyIHtcbiAgICBjb250ZW50OiAnfCc7XG4gIH1cbiAgLmFsZ29saWEtYXV0b2NvbXBsZXRlIC5hbGdvbGlhLWRvY3NlYXJjaC1zdWdnZXN0aW9uIC5hbGdvbGlhLWRvY3NlYXJjaC1zdWdnZXN0aW9uLS1jb250ZW50IHtcbiAgICBkaXNwbGF5OiBpbmxpbmUtYmxvY2s7XG4gICAgd2lkdGg6IGF1dG87XG4gICAgdGV4dC1hbGlnbjogbGVmdDtcbiAgICBmbG9hdDogbGVmdDtcbiAgICBwYWRkaW5nOiAwO1xuICB9XG4gIC5hbGdvbGlhLWF1dG9jb21wbGV0ZSAuYWxnb2xpYS1kb2NzZWFyY2gtc3VnZ2VzdGlvbiAuYWxnb2xpYS1kb2NzZWFyY2gtc3VnZ2VzdGlvbi0tY29udGVudDpiZWZvcmUge1xuICAgIGRpc3BsYXk6IG5vbmU7XG4gIH1cbn1cblxuLmFsZ29saWEtYXV0b2NvbXBsZXRlIC5zdWdnZXN0aW9uLWxheW91dC1zaW1wbGUuYWxnb2xpYS1kb2NzZWFyY2gtc3VnZ2VzdGlvbiB7XG4gIGJvcmRlci1ib3R0b206IHNvbGlkIDFweCAjZWVlO1xuICBwYWRkaW5nOiA4cHg7XG4gIG1hcmdpbjogMDtcbn1cblxuLmFsZ29saWEtYXV0b2NvbXBsZXRlIC5zdWdnZXN0aW9uLWxheW91dC1zaW1wbGUgLmFsZ29saWEtZG9jc2VhcmNoLXN1Z2dlc3Rpb24tLWNvbnRlbnQge1xuICB3aWR0aDogMTAwJTtcbiAgcGFkZGluZzogMDtcbn1cblxuLmFsZ29saWEtYXV0b2NvbXBsZXRlIC5zdWdnZXN0aW9uLWxheW91dC1zaW1wbGUgLmFsZ29saWEtZG9jc2VhcmNoLXN1Z2dlc3Rpb24tLWNvbnRlbnQ6OmJlZm9yZSB7XG4gIGRpc3BsYXk6IG5vbmU7XG59XG5cbi5hbGdvbGlhLWF1dG9jb21wbGV0ZSAuc3VnZ2VzdGlvbi1sYXlvdXQtc2ltcGxlIC5hbGdvbGlhLWRvY3NlYXJjaC1zdWdnZXN0aW9uLS1jYXRlZ29yeS1oZWFkZXIge1xuICBtYXJnaW46IDA7XG4gIHBhZGRpbmc6IDA7XG4gIGRpc3BsYXk6IGJsb2NrO1xuICB3aWR0aDogMTAwJTtcbiAgYm9yZGVyOiBub25lO1xufVxuXG4uYWxnb2xpYS1hdXRvY29tcGxldGUgLnN1Z2dlc3Rpb24tbGF5b3V0LXNpbXBsZSAuYWxnb2xpYS1kb2NzZWFyY2gtc3VnZ2VzdGlvbi0tY2F0ZWdvcnktaGVhZGVyLWx2bDAge1xuICBvcGFjaXR5OiAwLjY7XG4gIGZvbnQtc2l6ZTogMC44NWVtO1xufVxuXG4uYWxnb2xpYS1hdXRvY29tcGxldGUgLnN1Z2dlc3Rpb24tbGF5b3V0LXNpbXBsZSAuYWxnb2xpYS1kb2NzZWFyY2gtc3VnZ2VzdGlvbi0tY2F0ZWdvcnktaGVhZGVyLWx2bDEge1xuICBvcGFjaXR5OiAwLjY7XG4gIGZvbnQtc2l6ZTogMC44NWVtO1xufVxuXG4uYWxnb2xpYS1hdXRvY29tcGxldGUgLnN1Z2dlc3Rpb24tbGF5b3V0LXNpbXBsZSAuYWxnb2xpYS1kb2NzZWFyY2gtc3VnZ2VzdGlvbi0tY2F0ZWdvcnktaGVhZGVyLWx2bDE6OmJlZm9yZSB7XG4gIGJhY2tncm91bmQtaW1hZ2U6IHVybCgnZGF0YTppbWFnZS9zdmcreG1sO3V0ZjgsPHN2ZyB3aWR0aD1cIjEwXCIgaGVpZ2h0PVwiMTBcIiB2aWV3Qm94PVwiMCAwIDIwIDM4XCIgeG1sbnM9XCJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2Z1wiPjxwYXRoIGQ9XCJNMS40OSA0LjMxbDE0IDE2LjEyNi4wMDItMi42MjQtMTQgMTYuMDc0LTEuMzE0IDEuNTEgMy4wMTcgMi42MjYgMS4zMTMtMS41MDggMTQtMTYuMDc1IDEuMTQyLTEuMzEzLTEuMTQtMS4zMTMtMTQtMTYuMTI1TDMuMi4xOC4xOCAyLjhsMS4zMSAxLjUxelwiIGZpbGwtcnVsZT1cImV2ZW5vZGRcIiBmaWxsPVwiJTIzMUQzNjU3XCIgLz48L3N2Zz4nKTtcbiAgY29udGVudDogJyc7XG4gIHdpZHRoOiAxMHB4O1xuICBoZWlnaHQ6IDEwcHg7XG4gIGRpc3BsYXk6IGlubGluZS1ibG9jaztcbn1cblxuLmFsZ29saWEtYXV0b2NvbXBsZXRlIC5zdWdnZXN0aW9uLWxheW91dC1zaW1wbGUgLmFsZ29saWEtZG9jc2VhcmNoLXN1Z2dlc3Rpb24tLXdyYXBwZXIge1xuICB3aWR0aDogMTAwJTtcbiAgZmxvYXQ6IGxlZnQ7XG4gIG1hcmdpbjogMDtcbiAgcGFkZGluZzogMDtcbn1cblxuLmFsZ29saWEtYXV0b2NvbXBsZXRlIC5zdWdnZXN0aW9uLWxheW91dC1zaW1wbGUgLmFsZ29saWEtZG9jc2VhcmNoLXN1Z2dlc3Rpb24tLWR1cGxpY2F0ZS1jb250ZW50LCAuYWxnb2xpYS1hdXRvY29tcGxldGUgLnN1Z2dlc3Rpb24tbGF5b3V0LXNpbXBsZSAuYWxnb2xpYS1kb2NzZWFyY2gtc3VnZ2VzdGlvbi0tc3ViY2F0ZWdvcnktaW5saW5lIHtcbiAgZGlzcGxheTogbm9uZSAhaW1wb3J0YW50O1xufVxuXG4uYWxnb2xpYS1hdXRvY29tcGxldGUgLnN1Z2dlc3Rpb24tbGF5b3V0LXNpbXBsZSAuYWxnb2xpYS1kb2NzZWFyY2gtc3VnZ2VzdGlvbi0tdGl0bGUge1xuICBtYXJnaW46IDA7XG4gIGNvbG9yOiAjNDU4ZWUxO1xuICBmb250LXNpemU6IDAuOWVtO1xuICBmb250LXdlaWdodDogbm9ybWFsO1xufVxuXG4uYWxnb2xpYS1hdXRvY29tcGxldGUgLnN1Z2dlc3Rpb24tbGF5b3V0LXNpbXBsZSAuYWxnb2xpYS1kb2NzZWFyY2gtc3VnZ2VzdGlvbi0tdGl0bGU6OmJlZm9yZSB7XG4gIGNvbnRlbnQ6ICcjJztcbiAgZm9udC13ZWlnaHQ6IGJvbGQ7XG4gIGNvbG9yOiAjNDU4ZWUxO1xuICBkaXNwbGF5OiBpbmxpbmUtYmxvY2s7XG59XG5cbi5hbGdvbGlhLWF1dG9jb21wbGV0ZSAuc3VnZ2VzdGlvbi1sYXlvdXQtc2ltcGxlIC5hbGdvbGlhLWRvY3NlYXJjaC1zdWdnZXN0aW9uLS10ZXh0IHtcbiAgbWFyZ2luOiA0cHggMCAwO1xuICBkaXNwbGF5OiBibG9jaztcbiAgbGluZS1oZWlnaHQ6IDEuNGVtO1xuICBwYWRkaW5nOiA1LjMzMzMzcHggOHB4O1xuICBiYWNrZ3JvdW5kOiAjZjhmOGY4O1xuICBmb250LXNpemU6IDAuODVlbTtcbiAgb3BhY2l0eTogMC44O1xufVxuXG4uYWxnb2xpYS1hdXRvY29tcGxldGUgLnN1Z2dlc3Rpb24tbGF5b3V0LXNpbXBsZSAuYWxnb2xpYS1kb2NzZWFyY2gtc3VnZ2VzdGlvbi0tdGV4dCAuYWxnb2xpYS1kb2NzZWFyY2gtc3VnZ2VzdGlvbi0taGlnaGxpZ2h0IHtcbiAgY29sb3I6ICMzZjQxNDU7XG4gIGZvbnQtd2VpZ2h0OiBib2xkO1xuICBib3gtc2hhZG93OiBub25lO1xufVxuXG4uYWxnb2xpYS1hdXRvY29tcGxldGUgLmFsZ29saWEtZG9jc2VhcmNoLWZvb3RlciB7XG4gIHdpZHRoOiAxMzRweDtcbiAgaGVpZ2h0OiAyMHB4O1xuICB6LWluZGV4OiAyMDAwO1xuICBtYXJnaW4tdG9wOiAxMC42NjY2N3B4O1xuICBmbG9hdDogcmlnaHQ7XG4gIGZvbnQtc2l6ZTogMDtcbiAgbGluZS1oZWlnaHQ6IDA7XG59XG5cbi5hbGdvbGlhLWF1dG9jb21wbGV0ZSAuYWxnb2xpYS1kb2NzZWFyY2gtZm9vdGVyLS1sb2dvIHtcbiAgYmFja2dyb3VuZC1pbWFnZTogdXJsKFwiZGF0YTppbWFnZS9zdmcreG1sLCUzQ3N2ZyB3aWR0aD0nMTY4JyBoZWlnaHQ9JzI0JyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnJTNFJTNDZyBmaWxsPSdub25lJyBmaWxsLXJ1bGU9J2V2ZW5vZGQnJTNFJTNDcGF0aCBkPSdNNzguOTg4LjkzOGgxNi41OTRhMi45NjggMi45NjggMCAwIDEgMi45NjYgMi45NjZWMjAuNWEyLjk2NyAyLjk2NyAwIDAgMS0yLjk2NiAyLjk2NEg3OC45ODhhMi45NjcgMi45NjcgMCAwIDEtMi45NjYtMi45NjRWMy44OTdBMi45NjEgMi45NjEgMCAwIDEgNzguOTg4LjkzOHptNDEuOTM3IDE3Ljg2NmMtNC4zODYuMDItNC4zODYtMy41NC00LjM4Ni00LjEwNmwtLjAwNy0xMy4zMzYgMi42NzUtLjQyNHYxMy4yNTRjMCAuMzIyIDAgMi4zNTggMS43MTggMi4zNjR2Mi4yNDh6bS0xMC44NDYtMi4xOGMuODIxIDAgMS40My0uMDQ3IDEuODU1LS4xMjl2LTIuNzE5YTYuMzM0IDYuMzM0IDAgMCAwLTEuNTc0LS4xOTljLS4yOTUgMC0uNTk2LjAyMS0uODk3LjA2OWEyLjY5OSAyLjY5OSAwIDAgMC0uODE0LjI0Yy0uMjQuMTE2LS40MzkuMjgtLjU4Mi40OTEtLjE1LjIxMi0uMjE5LjMzNS0uMjE5LjY1NiAwIC42MjguMjE5Ljk5MS42MTYgMS4yM3MuOTM4LjM2MiAxLjYxNS4zNjJ6bS0uMjMzLTkuN2MuODgzIDAgMS42MjkuMTA5IDIuMjMxLjMyOC42MDIuMjE4IDEuMDg4LjUyNSAxLjQ0NC45MTUuMzYzLjM5Ni42MDkuOTIyLjc2IDEuNDgzLjE1Ny41Ni4yMzIgMS4xNzUuMjMyIDEuODV2Ni44NzRjLS40MS4wODktMS4wMzQuMTktMS44NjguMzE0LS44MzQuMTIzLTEuNzcyLjE4NS0yLjgxMy4xODUtLjY5IDAtMS4zMjctLjA2OS0xLjg5NS0uMTk4YTQuMDAxIDQuMDAxIDAgMCAxLTEuNDcxLS42MzYgMy4wODUgMy4wODUgMCAwIDEtLjk1MS0xLjEzNGMtLjIyNi0uNDY1LS4zNDMtMS4xMi0uMzQzLTEuODAzIDAtLjY1Ni4xMy0xLjA3My4zODQtMS41MjUuMjYtLjQ1LjYwOC0uODE5IDEuMDQ3LTEuMTA2LjQ0NS0uMjg3Ljk1LS40OTIgMS41MzItLjYxNWE4LjggOC44IDAgMCAxIDEuODItLjE4NSA4LjQwNCA4LjQwNCAwIDAgMSAxLjk3Mi4yNHYtLjQzOGMwLS4zMDctLjAzNS0uNi0uMTEtLjg3NGExLjg4IDEuODggMCAwIDAtLjM4NC0uNzMgMS43ODQgMS43ODQgMCAwIDAtLjcyNC0uNDkzIDMuMTY0IDMuMTY0IDAgMCAwLTEuMTQzLS4yMDVjLS42MTYgMC0xLjE3Ny4wNzUtMS42OS4xNjRhNy43MzUgNy43MzUgMCAwIDAtMS4yNi4zMDdsLS4zMjEtMi4xOTJjLjMzNS0uMTE3LjgzNC0uMjMzIDEuNDc4LS4zNDlhMTAuOTggMTAuOTggMCAwIDEgMi4wNzMtLjE3OHptNTIuODQyIDkuNjI2Yy44MjIgMCAxLjQzLS4wNDggMS44NTQtLjEzVjEzLjdhNi4zNDcgNi4zNDcgMCAwIDAtMS41NzQtLjE5OWMtLjI5NCAwLS41OTUuMDIxLS44OTYuMDY5YTIuNyAyLjcgMCAwIDAtLjgxNC4yNCAxLjQ2IDEuNDYgMCAwIDAtLjU4Mi40OTFjLS4xNS4yMTItLjIxOC4zMzUtLjIxOC42NTYgMCAuNjI4LjIxOC45OTEuNjE1IDEuMjMuNDA0LjI0NS45MzguMzYyIDEuNjE1LjM2MnptLS4yMjYtOS42OTRjLjg4MyAwIDEuNjI5LjEwOCAyLjIzMS4zMjcuNjAyLjIxOSAxLjA4OC41MjYgMS40NDQuOTE1LjM1NS4zOS42MDkuOTIzLjc1OSAxLjQ4My4xNTguNTYuMjMzIDEuMTc1LjIzMyAxLjg1MnY2Ljg3M2MtLjQxLjA4OC0xLjAzNC4xOS0xLjg2OC4zMTQtLjgzNC4xMjMtMS43NzIuMTg0LTIuODEzLjE4NC0uNjkgMC0xLjMyNy0uMDY4LTEuODk1LS4xOThhNC4wMDEgNC4wMDEgMCAwIDEtMS40NzEtLjYzNSAzLjA4NSAzLjA4NSAwIDAgMS0uOTUxLTEuMTM0Yy0uMjI2LS40NjUtLjM0My0xLjEyLS4zNDMtMS44MDQgMC0uNjU2LjEzLTEuMDczLjM4NC0xLjUyNC4yNi0uNDUuNjA4LS44MiAxLjA0Ny0xLjEwNy40NDUtLjI4Ni45NS0uNDkxIDEuNTMyLS42MTRhOC44MDMgOC44MDMgMCAwIDEgMi43NTEtLjEzYy4zMjkuMDM0LjY3MS4wOTYgMS4wNC4xODV2LS40MzdhMy4zIDMuMyAwIDAgMC0uMTA5LS44NzUgMS44NzMgMS44NzMgMCAwIDAtLjM4NC0uNzMxIDEuNzg0IDEuNzg0IDAgMCAwLS43MjQtLjQ5MiAzLjE2NSAzLjE2NSAwIDAgMC0xLjE0My0uMjA1Yy0uNjE2IDAtMS4xNzcuMDc1LTEuNjkuMTY0LS41MTQuMDg5LS45MzguMTkxLTEuMjYuMzA3bC0uMzIxLTIuMTkzYy4zMzUtLjExNi44MzQtLjIzMiAxLjQ3OC0uMzQ4YTExLjYzMyAxMS42MzMgMCAwIDEgMi4wNzMtLjE3N3ptLTguMDM0LTEuMjcxYTEuNjI2IDEuNjI2IDAgMCAxLTEuNjI4LTEuNjJjMC0uODk1LjcyNS0xLjYyIDEuNjI4LTEuNjIuOTA0IDAgMS42My43MjUgMS42MyAxLjYyIDAgLjg5NS0uNzMzIDEuNjItMS42MyAxLjYyem0xLjM0OCAxMy4yMmgtMi42ODlWNy4yN2wyLjY5LS40MjN2MTEuOTU2em0tNC43MTQgMGMtNC4zODYuMDItNC4zODYtMy41NC00LjM4Ni00LjEwN2wtLjAwOC0xMy4zMzYgMi42NzYtLjQyNHYxMy4yNTRjMCAuMzIyIDAgMi4zNTggMS43MTggMi4zNjR2Mi4yNDh6bS04LjY5OC01LjkwM2MwLTEuMTU2LS4yNTMtMi4xMTktLjc0Ni0yLjc4OC0uNDkzLS42NzctMS4xODMtMS4wMS0yLjA2Ny0xLjAxLS44ODIgMC0xLjU3NC4zMzMtMi4wNjUgMS4wMS0uNDkzLjY3Ni0uNzMzIDEuNjMyLS43MzMgMi43ODggMCAxLjE2OC4yNDYgMS45NTMuNzQgMi42My40OTIuNjgzIDEuMTgzIDEuMDE4IDIuMDY2IDEuMDE4Ljg4MiAwIDEuNTc0LS4zNDIgMi4wNjctMS4wMTkuNDkyLS42ODMuNzM4LTEuNDYuNzM4LTIuNjN6bTIuNzM3LS4wMDdjMCAuOTAyLS4xMyAxLjU4NC0uMzk3IDIuMzNhNS41MiA1LjUyIDAgMCAxLTEuMTI4IDEuOTA2IDQuOTg2IDQuOTg2IDAgMCAxLTEuNzUyIDEuMjIzYy0uNjg1LjI4Ni0xLjczOS40NS0yLjI2NS40NS0uNTI4LS4wMDYtMS41NzQtLjE1Ny0yLjI1Mi0uNDVhNS4wOTYgNS4wOTYgMCAwIDEtMS43NDQtMS4yMjNjLS40ODctLjUyNy0uODYzLTEuMTYyLTEuMTM3LTEuOTA2YTYuMzQ1IDYuMzQ1IDAgMCAxLS40MS0yLjMzYzAtLjkwMi4xMjMtMS43Ny4zOTctMi41MDhhNS41NTQgNS41NTQgMCAwIDEgMS4xNS0xLjg5MiA1LjEzMyA1LjEzMyAwIDAgMSAxLjc1LTEuMjE2Yy42NzktLjI4NyAxLjQyNS0uNDIzIDIuMjMyLS40MjMuODA4IDAgMS41NTMuMTQyIDIuMjM3LjQyMy42ODUuMjg2IDEuMjc0LjY5IDEuNzUzIDEuMjE2YTUuNjQ0IDUuNjQ0IDAgMCAxIDEuMTM1IDEuODkyYy4yODcuNzM4LjQzMSAxLjYwNi40MzEgMi41MDh6bS0yMC4xMzggMGMwIDEuMTIuMjQ2IDIuMzYzLjczOCAyLjg4Mi40OTMuNTIgMS4xMy43OCAxLjkxLjc4LjQyNCAwIC44MjgtLjA2MiAxLjIwNC0uMTc4LjM3Ny0uMTE2LjY3Ny0uMjUzLjkxNy0uNDE3VjkuMzNhMTAuNDc2IDEwLjQ3NiAwIDAgMC0xLjc2Ni0uMjI2Yy0uOTcxLS4wMjgtMS43MS4zNy0yLjIzIDEuMDA0LS41MTMuNjM2LS43NzMgMS43NS0uNzczIDIuNzg4em03LjQzOCA1LjI3NGMwIDEuODI0LS40NjYgMy4xNTYtMS40MDQgNC4wMDQtLjkzNi44NDYtMi4zNjcgMS4yNy00LjI5NiAxLjI3LS43MDUgMC0yLjE3LS4xMzctMy4zNC0uMzk2bC40MzEtMi4xMThjLjk4LjIwNSAyLjI3Mi4yNiAyLjk1LjI2IDEuMDc0IDAgMS44NC0uMjE5IDIuMjk5LS42NTYuNDU5LS40MzcuNjg0LTEuMDg2LjY4NC0xLjk0OHYtLjQzN2E4LjA3IDguMDcgMCAwIDEtMS4wNDcuMzk3Yy0uNDMuMTMtLjkzLjE5OC0xLjQ5Mi4xOTgtLjczOSAwLTEuNDEtLjExNi0yLjAxOC0uMzQ5YTQuMjA2IDQuMjA2IDAgMCAxLTEuNTY3LTEuMDI1Yy0uNDMxLS40NS0uNzc0LTEuMDE3LTEuMDEzLTEuNjk0LS4yNC0uNjc3LS4zNjMtMS44ODUtLjM2My0yLjc3MyAwLS44MzQuMTMtMS44OC4zODQtMi41NzcuMjYtLjY5Ni42MjktMS4yOTggMS4xMjktMS43OTYuNDkzLS40OTggMS4wOTUtLjg4MSAxLjgtMS4xNjJhNi42MDUgNi42MDUgMCAwIDEgMi40MjgtLjQ1N2MuODcgMCAxLjY3LjEwOSAyLjQ1LjI0Ljc4LjEyOSAxLjQ0NC4yNjUgMS45ODUuNDE1VjE4LjE3eicgZmlsbD0nJTIzNTQ2OEZGJy8lM0UlM0NwYXRoIGQ9J002Ljk3MiA2LjY3N3YxLjYyN2MtLjcxMi0uNDQ2LTEuNTItLjY3LTIuNDI1LS42Ny0uNTg1IDAtMS4wNDUuMTMtMS4zOC4zOTFhMS4yNCAxLjI0IDAgMCAwLS41MDIgMS4wM2MwIC40MjUuMTY0Ljc2NS40OTQgMS4wMi4zMy4yNTYuODM1LjUzMiAxLjUxNi44My40NDcuMTkyLjc5NS4zNTYgMS4wNDUuNDk1LjI1LjEzOC41MzcuMzMyLjg2Mi41ODIuMzI0LjI1LjU2My41NDguNzE4Ljg5NC4xNTQuMzQ1LjIzLjc0MS4yMyAxLjE4OCAwIC45NDctLjMzNCAxLjY5MS0xLjAwNCAyLjIzNC0uNjcuNTQyLTEuNTM3LjgxNC0yLjYwMS44MTQtMS4xOCAwLTIuMTYtLjIyOS0yLjkzNi0uNjg2di0xLjcwOGMuODQuNjI4IDEuODE0Ljk0MiAyLjkyLjk0Mi41ODUgMCAxLjA0OC0uMTM2IDEuMzg4LS40MDcuMzQtLjI3MS41MS0uNjQ2LjUxLTEuMTI1IDAtLjI4Ny0uMS0uNTUtLjMwMi0uNzktLjIwMy0uMjQtLjQyLS40Mi0uNjU1LS41NDItLjIzNC0uMTIzLS41ODUtLjI5LTEuMDUzLS41MDMtLjI3Ni0uMTI3LS40Ny0uMjE4LS41ODItLjI3MWExMy42NyAxMy42NyAwIDAgMS0uNTUtLjI4NyA0LjI3NSA0LjI3NSAwIDAgMS0uNTY3LS4zNTEgNi45MiA2LjkyIDAgMCAxLS40NTUtLjRjLS4xOC0uMTctLjMxLS4zNC0uMzktLjUxLS4wOC0uMTctLjE1NS0uMzctLjIyNC0uNTk4YTIuNTUzIDIuNTUzIDAgMCAxLS4xMDQtLjc0MmMwLS45MTUuMzMzLTEuNjM4Ljk5OC0yLjE3LjY2NC0uNTMyIDEuNTIzLS43OTggMi41NzYtLjc5OC45NjggMCAxLjc5My4xNyAyLjQ3My41MXptNy40NjggNS42OTZ2LS4yODdjLS4wMjItLjYwNy0uMTg3LTEuMDg4LS40OTUtMS40NDQtLjMwOS0uMzU3LS43NS0uNTM1LTEuMzI0LS41MzUtLjUzMiAwLS45OS4xOTQtMS4zNzMuNTgzLS4zODIuMzg4LS42MjIuOTQ5LS43MTcgMS42ODNoMy45MDl6bTEuMDA1IDIuNzkydjEuNDA0Yy0uNTk2LjM0LTEuMzgzLjUxLTIuMzYyLjUxLTEuMjU1IDAtMi4yNTUtLjM3Ny0zLTEuMTMyLS43NDQtLjc1NS0xLjExNi0xLjc0NC0xLjExNi0yLjk2OCAwLTEuMjk3LjM0LTIuMzE2IDEuMDIxLTMuMDU1LjY4LS43NCAxLjU0OC0xLjExIDIuNi0xLjExIDEuMDMzIDAgMS44NTIuMzIzIDIuNDU4Ljk2Ni42MDYuNjQ0LjkxIDEuNTcyLjkxIDIuNzg0IDAgLjMzLS4wMzMuNjc2LS4wOTYgMS4wMzhoLTUuMzE0Yy4xMDcuNzAyLjQwNSAxLjIzOS44OTQgMS42MTEuNDkuMzcyIDEuMTA2LjU1OCAxLjg1LjU1OC44NjIgMCAxLjU4LS4yMDIgMi4xNTUtLjYwNnptNi42MDUtMS43N2gtMS4yMTJjLS41OTYgMC0xLjA0NS4xMTYtMS4zNDkuMzUtLjMwMy4yMzQtLjQ1NC41MzItLjQ1NC44OTQgMCAuMzcyLjExNy42NjQuMzUuODc3LjIzNS4yMTMuNTc1LjMyIDEuMDIyLjMyLjUxIDAgLjkxMi0uMTQyIDEuMjA0LS40MjQuMjkzLS4yODEuNDQtLjY1MS40NC0xLjEwOHYtLjkxem0tNC4wNjgtMi41NTRWOS4zMjVjLjYyNy0uMzYxIDEuNDU3LS41NDIgMi40ODktLjU0MiAyLjExNiAwIDMuMTc1IDEuMDI2IDMuMTc1IDMuMDhWMTdoLTEuNTQ4di0uOTU3Yy0uNDE1LjY4LTEuMTQzIDEuMDItMi4xODYgMS4wMi0uNzY2IDAtMS4zOC0uMjItMS44NDMtLjY2MS0uNDYyLS40NDItLjY5NC0xLjAwMy0uNjk0LTEuNjg0IDAtLjc3Ni4yOTMtMS4zOC44NzgtMS44MS41ODUtLjQzMSAxLjQwNC0uNjQ3IDIuNDU3LS42NDdoMS4zNFYxMS44YzAtLjU1NC0uMTMzLS45NzEtLjM5OS0xLjI1My0uMjY2LS4yODItLjcwNy0uNDIzLTEuMzI0LS40MjNhNC4wNyA0LjA3IDAgMCAwLTIuMzQ1LjcxOHptOS4zMzMtMS45M3YxLjQyYy4zOTQtMSAxLjEwMS0xLjUgMi4xMjMtMS41LjE0OCAwIC4zMTMuMDE2LjQ5NC4wNDh2MS41MzFhMS44ODUgMS44ODUgMCAwIDAtLjc1LS4xNDNjLS41NDIgMC0uOTg5LjI0LTEuMzQuNzE4LS4zNTEuNDc5LS41MjcgMS4wNDgtLjUyNyAxLjcwN1YxN2gtMS41NjNWOC45MWgxLjU2M3ptNS4wMSA0LjA4NGMuMDIyLjgyLjI3MiAxLjQ5Mi43NSAyLjAxOS40NzkuNTI2IDEuMTUuNzkgMi4wMS43OS42MzkgMCAxLjIzNS0uMTc2IDEuNzg4LS41Mjd2MS40MDRjLS41MjEuMzE5LTEuMTg2LjQ3OS0xLjk5NS40NzktMS4yNjUgMC0yLjI3Ni0uNC0zLjAzMS0xLjE5Ny0uNzU1LS43OTgtMS4xMzMtMS43OTItMS4xMzMtMi45ODQgMC0xLjE2LjM4LTIuMTUxIDEuMTQtMi45NzUuNzYxLS44MjUgMS43OS0xLjIzNyAzLjA4OC0xLjIzNy43MDIgMCAxLjM0Ni4xNDkgMS45My40NDd2MS40MzZhMy4yNDIgMy4yNDIgMCAwIDAtMS43Ny0uNDk1Yy0uODQgMC0xLjUxMy4yNjYtMi4wMTkuNzk4LS41MDUuNTMyLS43NTggMS4yMTMtLjc1OCAyLjA0MnpNNDAuMjQgNS43MnY0LjU3OWMuNDU4LTEgMS4yOTMtMS41IDIuNTA1LTEuNS43ODcgMCAxLjQyLjI0NSAxLjg5OS43MzQuNDc5LjQ5LjcxOCAxLjE3LjcxOCAyLjA0MlYxN2gtMS41NjR2LTUuMTA2YzAtLjU1My0uMTQtLjk4LS40MjItMS4yODQtLjI4Mi0uMzAzLS42NTItLjQ1NS0xLjExLS40NTUtLjUzMSAwLTEuMDAyLjIwMi0xLjQxMS42MDYtLjQxLjQwNS0uNjE1IDEuMDIyLS42MTUgMS44NTFWMTdoLTEuNTYzVjUuNzJoMS41NjN6bTE0Ljk2NiAxMC4wMmMuNTk2IDAgMS4wOTYtLjI1MyAxLjUtLjc1OC40MDQtLjUwNi42MDYtMS4xNTcuNjA2LTEuOTU1IDAtLjkxNS0uMjAyLTEuNjItLjYwNi0yLjExNC0uNDA0LS40OTUtLjkyLS43NDItMS41NDgtLjc0Mi0uNTUzIDAtMS4wNS4yMjQtMS40OTEuNjctLjQ0Mi40NDctLjY2MiAxLjEzMy0uNjYyIDIuMDU4IDAgLjk1OC4yMTIgMS42Ny42MzggMi4xMzguNDI1LjQ2OS45NDYuNzAzIDEuNTYzLjcwM3pNNTMuMDA0IDUuNzJ2NC40MmMuNTc0LS44OTQgMS4zODgtMS4zNDEgMi40NC0xLjM0MSAxLjAyMiAwIDEuODU3LjM4MyAyLjUwNiAxLjE0OS42NDkuNzY2Ljk3MyAxLjc4MS45NzMgMy4wNDcgMCAxLjEzOC0uMzA5IDIuMTA5LS45MjUgMi45MTItLjYxNy44MDMtMS40NjMgMS4yMDUtMi41MzcgMS4yMDUtMS4wNzUgMC0xLjg5NC0uNDQ3LTIuNDU3LTEuMzRWMTdoLTEuNThWNS43MmgxLjU4em05LjkwOCAxMS4xMDRsLTMuMjIzLTcuOTEzaDEuNzM5bDEuMDA1IDIuNjMyIDEuMjYgMy40MTVjLjA5Ni0uMzIuNDgtMS40NTggMS4xNS0zLjQxNWwuOTA5LTIuNjMyaDEuNjZsLTIuOTIgNy44NjZjLS43NzcgMi4wNzQtMS45NjMgMy4xMS0zLjU1OSAzLjExYTIuOTIgMi45MiAwIDAgMS0uNzM0LS4wNzl2LTEuMzRjLjE3LjA0Mi4zNTEuMDY0LjU0My4wNjQgMS4wMzIgMCAxLjc1NS0uNTcgMi4xNy0xLjcwOHonIGZpbGw9JyUyMzVENjQ5NCcvJTNFJTNDcGF0aCBkPSdNODkuNjMyIDUuOTY3di0uNzcyYS45NzguOTc4IDAgMCAwLS45NzgtLjk3N2gtMi4yOGEuOTc4Ljk3OCAwIDAgMC0uOTc4Ljk3N3YuNzkzYzAgLjA4OC4wODIuMTUuMTcxLjEzYTcuMTI3IDcuMTI3IDAgMCAxIDEuOTg0LS4yOGMuNjUgMCAxLjI5NS4wODggMS45MTcuMjU5LjA4Mi4wMi4xNjQtLjA0LjE2NC0uMTNtLTYuMjQ4IDEuMDFsLS4zOS0uMzg5YS45NzcuOTc3IDAgMCAwLTEuMzgyIDBsLS40NjUuNDY1YS45NzMuOTczIDAgMCAwIDAgMS4zOGwuMzgzLjM4M2MuMDYyLjA2MS4xNS4wNDcuMjA1LS4wMTQuMjI2LS4zMDcuNDcyLS42MDEuNzQ2LS44NzQuMjgxLS4yOC41NjgtLjUyNi44ODMtLjc1MS4wNjgtLjA0Mi4wNzUtLjEzNy4wMi0uMm00LjE2IDIuNDUzdjMuMzQxYzAgLjA5Ni4xMDQuMTY1LjE5Mi4xMTdsMi45Ny0xLjUzN2MuMDY4LS4wMzQuMDg5LS4xMTcuMDU1LS4xODRhMy42OTUgMy42OTUgMCAwIDAtMy4wOC0xLjg2NmMtLjA2OCAwLS4xMzYuMDU0LS4xMzYuMTNtMCA4LjA0OGE0LjQ4OSA0LjQ4OSAwIDAgMS00LjQ5LTQuNDgyIDQuNDg4IDQuNDg4IDAgMCAxIDQuNDktNC40ODIgNC40ODggNC40ODggMCAwIDEgNC40ODkgNC40ODIgNC40ODQgNC40ODQgMCAwIDEtNC40OSA0LjQ4Mm0wLTEwLjg1YTYuMzYzIDYuMzYzIDAgMSAwIDAgMTIuNzI5YzMuNTE4IDAgNi4zNzItMi44NSA2LjM3Mi02LjM2OGE2LjM1OCA2LjM1OCAwIDAgMC02LjM3MS02LjM2JyBmaWxsPSclMjNGRkYnLyUzRSUzQy9nJTNFJTNDL3N2ZyUzRSUwQVwiKTtcbiAgYmFja2dyb3VuZC1yZXBlYXQ6IG5vLXJlcGVhdDtcbiAgYmFja2dyb3VuZC1wb3NpdGlvbjogY2VudGVyO1xuICBiYWNrZ3JvdW5kLXNpemU6IDEwMCU7XG4gIG92ZXJmbG93OiBoaWRkZW47XG4gIHRleHQtaW5kZW50OiAtOTAwMHB4O1xuICBwYWRkaW5nOiAwICFpbXBvcnRhbnQ7XG4gIHdpZHRoOiAxMDAlO1xuICBoZWlnaHQ6IDEwMCU7XG4gIGRpc3BsYXk6IGJsb2NrO1xufVxuIl19 */
-`;
+`
diff --git a/docs/lib/forwardRefWithAs.ts b/docs/lib/forwardRefWithAs.ts
index 74493058893..84af944c47c 100644
--- a/docs/lib/forwardRefWithAs.ts
+++ b/docs/lib/forwardRefWithAs.ts
@@ -1,30 +1,30 @@
import {
- ComponentPropsWithoutRef,
- ElementType,
- ReactElement,
- ReactNode,
- Ref,
+ type ComponentPropsWithoutRef,
+ type ElementType,
+ type ReactElement,
+ type ReactNode,
+ type Ref,
forwardRef,
-} from 'react';
+} from 'react'
type ElementTagNameMap = HTMLElementTagNameMap &
- Pick>;
+ Pick>
type AsProp = {
- as?: Comp;
+ as?: Comp
ref?: Ref<
Comp extends keyof ElementTagNameMap
? ElementTagNameMap[Comp]
: Comp extends new (...args: any) => any
? InstanceType
: undefined
- >;
-} & Omit, 'as'>;
+ >
+} & Omit, 'as'>
type CompWithAsProp = {
- displayName?: string;
- (props: AsProp & Props): ReactElement;
-};
+ displayName?: string
+ (props: AsProp & Props): ReactElement
+}
export const forwardRefWithAs = (
render: (
@@ -32,6 +32,6 @@ export const forwardRefWithAs =
) => Exclude
): CompWithAsProp => {
- // @ts-ignore
- return forwardRef(render);
-};
+ // @ts-expect-error
+ return forwardRef(render)
+}
diff --git a/docs/lib/initialDocumentDemoContent.ts b/docs/lib/initialDocumentDemoContent.ts
index a456b4d9b8b..c89ad4ac7d0 100644
--- a/docs/lib/initialDocumentDemoContent.ts
+++ b/docs/lib/initialDocumentDemoContent.ts
@@ -265,4 +265,4 @@ export const initialContent = [
},
],
},
-];
+]
diff --git a/docs/lib/media.ts b/docs/lib/media.ts
index d45ccf6d7e9..ec03ececafa 100644
--- a/docs/lib/media.ts
+++ b/docs/lib/media.ts
@@ -1,31 +1,31 @@
-import weakMemo from '@emotion/weak-memoize';
-import facepaint from 'facepaint';
+import weakMemo from '@emotion/weak-memoize'
+import facepaint from 'facepaint'
type BREAKPOINTSTYPE = {
- xs: number;
- sm: number;
- md: number;
- lg: number;
-};
+ xs: number
+ sm: number
+ md: number
+ lg: number
+}
-export const BREAK_POINTS: BREAKPOINTSTYPE = { xs: 586, sm: 768, md: 992, lg: 1200 };
+export const BREAK_POINTS: BREAKPOINTSTYPE = { xs: 586, sm: 768, md: 992, lg: 1200 }
const minWidth = (width: number, m: boolean = true) =>
- `${m ? '@media ' : ''}(min-width: ${width}px)`;
+ `${m ? '@media ' : ''}(min-width: ${width}px)`
type MediaType = {
[P in keyof BREAKPOINTSTYPE]: string;
-};
+}
export const media: MediaType = Object.entries(BREAK_POINTS).reduce(
(obj, [key, value]) => ({ ...obj, [key]: minWidth(value) }),
{} as Record
-);
+)
const paint = weakMemo(breakpoints =>
facepaint(Object.entries(breakpoints).map(([, width]) => `@media (min-width: ${width}px)`))
-);
+)
-export function useMediaQuery() {
- return paint(BREAK_POINTS);
+export function useMediaQuery () {
+ return paint(BREAK_POINTS)
}
diff --git a/docs/lib/og-util.ts b/docs/lib/og-util.ts
index 4b4a4e658d5..c90ee098f3a 100644
--- a/docs/lib/og-util.ts
+++ b/docs/lib/og-util.ts
@@ -1,19 +1,19 @@
-let baseUrl = 'http:/localhost:8000';
+let baseUrl = 'http:/localhost:8000'
if (process.env.NEXT_PUBLIC_VERCEL_ENV === 'production') {
- baseUrl = 'https://keystonejs.com';
+ baseUrl = 'https://keystonejs.com'
} else if (process.env.NEXT_PUBLIC_VERCEL_URL) {
- baseUrl = `https://${process.env.NEXT_PUBLIC_VERCEL_URL}`;
+ baseUrl = `https://${process.env.NEXT_PUBLIC_VERCEL_URL}`
}
-export const getOgAbsoluteUrl = ({ title, type }: { title: string; type?: string }) => {
- const ogUrl = new URL(`${baseUrl}/api/hero-image`);
+export const getOgAbsoluteUrl = ({ title, type }: { title: string, type?: string }) => {
+ const ogUrl = new URL(`${baseUrl}/api/hero-image`)
- ogUrl.searchParams.append('title', title);
+ ogUrl.searchParams.append('title', title)
if (typeof type === 'string') {
- ogUrl.searchParams.append('type', type);
+ ogUrl.searchParams.append('type', type)
}
- return ogUrl.href;
-};
+ return ogUrl.href
+}
-export const siteBaseUrl = baseUrl;
+export const siteBaseUrl = baseUrl
diff --git a/docs/lib/prism-theme.ts b/docs/lib/prism-theme.ts
index abf23d55331..abc760e7d6d 100644
--- a/docs/lib/prism-theme.ts
+++ b/docs/lib/prism-theme.ts
@@ -1,4 +1,4 @@
-import type { PrismTheme } from 'prism-react-renderer';
+import type { PrismTheme } from 'prism-react-renderer'
const theme: PrismTheme = {
plain: {
@@ -72,6 +72,6 @@ const theme: PrismTheme = {
},
},
],
-};
+}
-export default theme;
+export default theme
diff --git a/docs/lib/prose-lite.ts b/docs/lib/prose-lite.ts
index f68fa62cde4..fcce117a119 100644
--- a/docs/lib/prose-lite.ts
+++ b/docs/lib/prose-lite.ts
@@ -251,4 +251,4 @@ export const proseStyles = {
'> :last-child': {
marginBottom: '0',
},
-};
+}
diff --git a/docs/markdoc/config.ts b/docs/markdoc/config.ts
index 0654e5bafe1..9e7b2ad435a 100644
--- a/docs/markdoc/config.ts
+++ b/docs/markdoc/config.ts
@@ -1,15 +1,15 @@
import {
- Config,
+ type Config,
nodes,
Tag,
- ValidationError,
- Node,
+ type ValidationError,
+ type Node,
functions,
- ConfigFunction,
-} from '@markdoc/markdoc';
-import slugify from '@sindresorhus/slugify';
+ type ConfigFunction,
+} from '@markdoc/markdoc'
+import slugify from '@sindresorhus/slugify'
-export type Pages = Map }>;
+export type Pages = Map }>
export const baseMarkdocConfig: Config = {
// an empty variables object makes Markdoc validate against missing variables
@@ -49,9 +49,9 @@ export const baseMarkdocConfig: Config = {
attributes: {
kind: { type: String, required: true, matches: ['warn', 'tip', 'error'] },
},
- transform(node, config) {
- const children = node.transformChildren(config);
- const attributes = node.transformAttributes(config);
+ transform (node, config) {
+ const children = node.transformChildren(config)
+ const attributes = node.transformAttributes(config)
return children.map(child => {
if (child instanceof Tag) {
return new Tag(
@@ -63,10 +63,10 @@ export const baseMarkdocConfig: Config = {
}hint ${attributes.kind}`,
},
child.children
- );
+ )
}
- return child;
- });
+ return child
+ })
},
},
'related-content': {
@@ -95,50 +95,50 @@ export const baseMarkdocConfig: Config = {
nodes: {
document: {
...nodes.document,
- validate(document) {
- const errors: ValidationError[] = [];
+ validate (document) {
+ const errors: ValidationError[] = []
// we want good stable ids so we require documentation authors write ids
// when they could be ambiguous rather than just adding an index
- const seenHeadings = new Map();
+ const seenHeadings = new Map()
for (const node of document.walk()) {
if (node.type === 'heading') {
- const id = getIdForHeading(node);
+ const id = getIdForHeading(node)
// we report an error for this in the heading validation
if (id.length === 0) {
- continue;
+ continue
}
- const existingHeading = seenHeadings.get(id);
+ const existingHeading = seenHeadings.get(id)
if (!existingHeading) {
- seenHeadings.set(id, node);
- continue;
+ seenHeadings.set(id, node)
+ continue
}
const ambiguousHeadingError = (node: Node): ValidationError => ({
id: 'ambiguous-heading-id',
level: 'error',
message: `The id for this heading is "${id}" which is the same as another heading in this file, disambiguate them with {% #some-id-here %} after a heading`,
location: node.location,
- });
+ })
if (existingHeading !== 'reported') {
- errors.push(ambiguousHeadingError(existingHeading));
- seenHeadings.set(id, 'reported');
+ errors.push(ambiguousHeadingError(existingHeading))
+ seenHeadings.set(id, 'reported')
}
- errors.push(ambiguousHeadingError(node));
+ errors.push(ambiguousHeadingError(node))
}
}
for (const node of document.walk()) {
if (node.type === 'link' && node.attributes.href.startsWith('#')) {
- const id = node.attributes.href.slice(1);
+ const id = node.attributes.href.slice(1)
if (!seenHeadings.has(id)) {
errors.push({
id: 'missing-heading-id',
level: 'error',
message: `The link "${node.attributes.href}" doesn't point to an id in this file`,
location: node.location,
- });
+ })
}
}
}
- return errors;
+ return errors
},
},
fence: {
@@ -149,17 +149,17 @@ export const baseMarkdocConfig: Config = {
// process determines whether or not markdoc processes tags inside the content of the code block
process: { type: Boolean, render: false, default: false },
},
- transform(node, config) {
- const attributes = node.transformAttributes(config);
- const children = node.transformChildren(config);
+ transform (node, config) {
+ const attributes = node.transformAttributes(config)
+ const children = node.transformChildren(config)
if (children.some(child => typeof child !== 'string')) {
throw new Error(
`unexpected non-string child of code block from ${
node.location?.file ?? '(unknown file)'
}:${node.location?.start.line ?? '(unknown line)'}`
- );
+ )
}
- return new Tag(this.render, { ...attributes, content: children.join('') }, []);
+ return new Tag(this.render, { ...attributes, content: children.join('') }, [])
},
},
heading: {
@@ -168,31 +168,31 @@ export const baseMarkdocConfig: Config = {
level: { type: Number, required: true },
id: { type: String },
},
- validate(node) {
- const errors: ValidationError[] = [];
+ validate (node) {
+ const errors: ValidationError[] = []
if (node.attributes.level === 1) {
errors.push({
message:
"H1's are not allowed, specify the title in frontmatter at the top of the file if you're trying to specify the page title, otherwise use a different heading level",
id: 'no-h1',
level: 'error',
- });
+ })
}
- const id = getIdForHeading(node);
+ const id = getIdForHeading(node)
if (id.length === 0) {
errors.push({
id: 'empty-id',
level: 'error',
message:
'This heading has an empty id, change the heading content so that a non-empty id is generated or add {% #some-id %} after the heading',
- });
+ })
}
- return errors;
+ return errors
},
- transform(node, config) {
- const attributes = node.transformAttributes(config);
- const children = node.transformChildren(config);
- return new Tag(this.render, { ...attributes, id: getIdForHeading(node) }, children);
+ transform (node, config) {
+ const attributes = node.transformAttributes(config)
+ const children = node.transformChildren(config)
+ return new Tag(this.render, { ...attributes, id: getIdForHeading(node) }, children)
},
},
link: {
@@ -208,26 +208,26 @@ export const baseMarkdocConfig: Config = {
},
},
},
-};
+}
-function validateLink(node: Node, config: Config): ValidationError[] {
- const link = node.attributes.href;
+function validateLink (node: Node, config: Config): ValidationError[] {
+ const link = node.attributes.href
if (
/https?:\/\//.test(link) ||
// local # is validated in the document validation
link.startsWith('#') ||
link.startsWith('mailto:')
) {
- return [];
+ return []
}
- const pages: Pages | undefined = (config as any).pages;
+ const pages: Pages | undefined = (config as any).pages
if (/\.?\.?\//.test(link)) {
- if (!pages) return [];
+ if (!pages) return []
const url = new URL(
link,
`https://example.com${node.location!.file!.replace(/^pages/, '').replace(/\.md$/, '')}`
- );
- const id = url.hash ? url.hash.slice(1) : undefined;
+ )
+ const id = url.hash ? url.hash.slice(1) : undefined
if (!pages.has(url.pathname)) {
return [
{
@@ -235,29 +235,29 @@ function validateLink(node: Node, config: Config): ValidationError[] {
level: 'error',
message: `${link} points to a page that does not exist`,
},
- ];
+ ]
}
- if (id === undefined || pages.get(url.pathname)!.ids.has(id)) return [];
+ if (id === undefined || pages.get(url.pathname)!.ids.has(id)) return []
return [
{
id: 'invalid-link',
level: 'error',
message: `${link} points to an id that does not exist`,
},
- ];
+ ]
}
- return [{ id: 'invalid-link', level: 'error', message: 'Unknown link type' }];
+ return [{ id: 'invalid-link', level: 'error', message: 'Unknown link type' }]
}
-export function getIdForHeading(node: Node): string {
+export function getIdForHeading (node: Node): string {
if (typeof node.attributes.id === 'string') {
- return node.attributes.id;
+ return node.attributes.id
}
- let stringified = '';
+ let stringified = ''
for (const child of node.walk()) {
if (child.type === 'text' || child.type === 'code') {
- stringified += child.attributes.content;
+ stringified += child.attributes.content
}
}
- return slugify(stringified);
+ return slugify(stringified)
}
diff --git a/docs/markdoc/index.test.ts b/docs/markdoc/index.test.ts
index 84263f8bcc6..12dced83341 100644
--- a/docs/markdoc/index.test.ts
+++ b/docs/markdoc/index.test.ts
@@ -1,56 +1,56 @@
-import { RenderableTreeNode } from '@markdoc/markdoc';
-import React, { ReactNode } from 'react';
-import { isTag } from './isTag';
-import { transformContent } from '.';
+import { type RenderableTreeNode } from '@markdoc/markdoc'
+import React, { type ReactNode } from 'react'
+import { isTag } from './isTag'
+import { transformContent } from '.'
-function renderableToReactElement(node: RenderableTreeNode, key = 1): ReactNode {
+function renderableToReactElement (node: RenderableTreeNode, key = 1): ReactNode {
if (
typeof node === 'string' ||
typeof node === 'number' ||
typeof node === 'boolean' ||
node === null
) {
- return node;
+ return node
}
if (Array.isArray(node)) {
- return node.map(renderableToReactElement);
+ return node.map(renderableToReactElement)
}
if (isTag(node)) {
return React.createElement(
node.name,
{ ...node.attributes, key },
node.children.map((child, i) => renderableToReactElement(child, i))
- );
+ )
}
- return null;
+ return null
}
expect.addSnapshotSerializer({
- test(val) {
- return typeof val === 'object' && val !== null && '$$mdtype' in val && val.$$mdtype === 'Tag';
+ test (val) {
+ return typeof val === 'object' && val !== null && '$$mdtype' in val && val.$$mdtype === 'Tag'
},
- serialize(val, config, indentation, depth, refs, printer) {
- return printer(renderableToReactElement(val), config, indentation, depth, refs);
+ serialize (val, config, indentation, depth, refs, printer) {
+ return printer(renderableToReactElement(val), config, indentation, depth, refs)
},
-});
+})
test('duplicate headings without disambiguated ids error', () => {
const content = `## Heading 1
## Heading 1
-`;
+`
expect(() => transformContent('content.md', content)).toThrowErrorMatchingInlineSnapshot(`
"Errors in content.md:
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
content.md:1: The id for this heading is "heading-1" which is the same as another heading in this file, disambiguate them with {% #some-id-here %} after a heading
content.md:2: The id for this heading is "heading-1" which is the same as another heading in this file, disambiguate them with {% #some-id-here %} after a heading
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯"
- `);
-});
+ `)
+})
test('duplicate headings with disambiguated ids are allowed', () => {
const content = `## Heading 1
## Heading 1 {% #some-heading %}
-`;
+`
expect(transformContent('content.md', content)).toMatchInlineSnapshot(`
{
Heading 1
- `);
-});
+ `)
+})
test("h1's are not allowed", () => {
- const content = `# Heading 1`;
+ const content = `# Heading 1`
expect(() => transformContent('content.md', content)).toThrowErrorMatchingInlineSnapshot(`
"Errors in content.md:
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
content.md:1: H1's are not allowed, specify the title in frontmatter at the top of the file if you're trying to specify the page title, otherwise use a different heading level
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯"
- `);
-});
+ `)
+})
test('empty ids on headings are not allowed', () => {
const content = `## ⭐️
###
#### Blah {% id="" %}
-`;
+`
expect(() => transformContent('content.md', content)).toThrowErrorMatchingInlineSnapshot(`
"Errors in content.md:
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
@@ -92,8 +92,8 @@ test('empty ids on headings are not allowed', () => {
content.md:2: This heading has an empty id, change the heading content so that a non-empty id is generated or add {% #some-id %} after the heading
content.md:4: This heading has an empty id, change the heading content so that a non-empty id is generated or add {% #some-id %} after the heading
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯"
- `);
-});
+ `)
+})
test('built-in Markdoc functions are not allowed', () => {
const content = `
@@ -103,11 +103,11 @@ something
{% /if %}
-`;
+`
expect(() => transformContent('content.md', content)).toThrowErrorMatchingInlineSnapshot(`
"Errors in content.md:
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
content.md:2: Undefined function: 'or'
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯"
- `);
-});
+ `)
+})
diff --git a/docs/markdoc/index.ts b/docs/markdoc/index.ts
index 625d01b8ca9..1dbb3462266 100644
--- a/docs/markdoc/index.ts
+++ b/docs/markdoc/index.ts
@@ -1,17 +1,17 @@
// @markdoc/markdoc's declaration files depend on these global types
-import type {} from '@markdoc/markdoc/global';
-import fs from 'fs/promises';
-import isMatch from 'date-fns/isMatch';
-import Markdoc, { Config, Tag, ValidateError } from '@markdoc/markdoc';
-import { isNonEmptyArray } from 'emery/guards';
-import { assert } from 'emery/assertions';
-import { load } from 'js-yaml';
-import { baseMarkdocConfig } from './config';
-import { showNextReleaseWithoutReplacement } from './show-next-release';
-import { isTag } from './isTag';
-
-export function printValidationError(error: ValidateError) {
- const location = error.error.location || error.location;
+import type {} from '@markdoc/markdoc/global'
+import fs from 'fs/promises'
+import isMatch from 'date-fns/isMatch'
+import Markdoc, { type Config, type Tag, type ValidateError } from '@markdoc/markdoc'
+import { isNonEmptyArray } from 'emery/guards'
+import { assert } from 'emery/assertions'
+import { load } from 'js-yaml'
+import { baseMarkdocConfig } from './config'
+import { showNextReleaseWithoutReplacement } from './show-next-release'
+import { isTag } from './isTag'
+
+export function printValidationError (error: ValidateError) {
+ const location = error.error.location || error.location
// the filepath is intentionally duplicated here so that there is one thing you can copy to refer to the error position
return `${location?.file ?? '(unknown file)'}:${
// the +1 is because location.start.line is 0-based
@@ -19,42 +19,42 @@ export function printValidationError(error: ValidateError) {
location?.start.line !== undefined ? location.start.line + 1 : '(unknown line)'
}${location?.start.character !== undefined ? `:${location.start.character}` : ''}: ${
error.error.message
- }`;
+ }`
}
class MarkdocValidationFailure extends Error {
- constructor(errors: [ValidateError, ...ValidateError[]], errorReportingFilepath: string) {
- super();
- this.name = 'MarkdocValidationFailure';
+ constructor (errors: [ValidateError, ...ValidateError[]], errorReportingFilepath: string) {
+ super()
+ this.name = 'MarkdocValidationFailure'
// you see the stacktrace and a bunch of other stuff from Next when seeing the errors here
// so this separator makes it easier to find the actual problem
- const separator = `⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯`;
+ const separator = `⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯`
this.message = `Errors in ${errorReportingFilepath}:\n${separator}\n${errors
.map(error => printValidationError(error))
- .join('\n')}\n${separator}`;
+ .join('\n')}\n${separator}`
}
}
export type DocsContent = {
- content: Tag;
- title: string;
- description: string;
-};
+ content: Tag
+ title: string
+ description: string
+}
export type BlogContent = BlogFrontmatter & {
- content: Tag;
-};
+ content: Tag
+}
-export async function readBlogContent(filepath: string): Promise {
- let content = await fs.readFile(filepath, 'utf8');
- const frontmatter = extractBlogFrontmatter(content);
- return { content: transformContent(`docs/${filepath}`, content), ...frontmatter };
+export async function readBlogContent (filepath: string): Promise {
+ let content = await fs.readFile(filepath, 'utf8')
+ const frontmatter = extractBlogFrontmatter(content)
+ return { content: transformContent(`docs/${filepath}`, content), ...frontmatter }
}
-export async function readDocsContent(filepath: string): Promise {
- let content = await fs.readFile(filepath, 'utf8');
- const frontmatter = extractDocsFrontmatter(content);
- return { content: transformContent(`docs/${filepath}`, content), ...frontmatter };
+export async function readDocsContent (filepath: string): Promise {
+ let content = await fs.readFile(filepath, 'utf8')
+ const frontmatter = extractDocsFrontmatter(content)
+ return { content: transformContent(`docs/${filepath}`, content), ...frontmatter }
}
const markdocConfig: Config = {
@@ -62,119 +62,119 @@ const markdocConfig: Config = {
variables: {
nextRelease: showNextReleaseWithoutReplacement,
},
-};
+}
-export function transformContent(errorReportingFilepath: string, content: string): Tag {
- const node = Markdoc.parse(content, errorReportingFilepath);
- const errors = Markdoc.validate(node, markdocConfig);
+export function transformContent (errorReportingFilepath: string, content: string): Tag {
+ const node = Markdoc.parse(content, errorReportingFilepath)
+ const errors = Markdoc.validate(node, markdocConfig)
if (isNonEmptyArray(errors)) {
- throw new MarkdocValidationFailure(errors, errorReportingFilepath);
+ throw new MarkdocValidationFailure(errors, errorReportingFilepath)
}
- const renderableNode = Markdoc.transform(node, markdocConfig);
+ const renderableNode = Markdoc.transform(node, markdocConfig)
- assert(isTag(renderableNode));
+ assert(isTag(renderableNode))
// Next is annoying about not plain objects
- return JSON.parse(JSON.stringify(renderableNode)) as Tag;
+ return JSON.parse(JSON.stringify(renderableNode)) as Tag
}
-const frontMatterPattern = /^---[\s]+([\s\S]*?)[\s]+---/;
+const frontMatterPattern = /^---[\s]+([\s\S]*?)[\s]+---/
-export function extractDocsFrontmatter(content: string): {
- title: string;
- description: string;
+export function extractDocsFrontmatter (content: string): {
+ title: string
+ description: string
} {
- const match = frontMatterPattern.exec(content);
+ const match = frontMatterPattern.exec(content)
if (!match) {
- throw new Error('Expected document to contain frontmatter with a title and description');
+ throw new Error('Expected document to contain frontmatter with a title and description')
}
- const frontmatter = match[1];
- let parsed;
+ const frontmatter = match[1]
+ let parsed
try {
- parsed = load(frontmatter);
+ parsed = load(frontmatter)
} catch (err) {
- throw new Error(`Failed to parse frontmatter as yaml: ${err}`);
+ throw new Error(`Failed to parse frontmatter as yaml: ${err}`)
}
if (typeof parsed !== 'object' || parsed === null) {
throw new Error(
`Expected frontmatter yaml to be an object but found:\n${JSON.stringify(parsed)}`
- );
+ )
}
- let obj = parsed as Record;
+ let obj = parsed as Record
if (typeof obj.title !== 'string') {
- throw new Error(`Expected frontmatter to contain a title`);
+ throw new Error(`Expected frontmatter to contain a title`)
}
if (typeof obj.description !== 'string') {
- throw new Error(`Expected frontmatter to contain a description`);
+ throw new Error(`Expected frontmatter to contain a description`)
}
return {
title: obj.title,
description: obj.description,
- };
+ }
}
export type BlogFrontmatter = {
- title: string;
- description: string;
- publishDate: string;
- authorName: string;
- authorHandle?: string;
- metaImageUrl?: string;
-};
-
-export function extractBlogFrontmatter(content: string): BlogFrontmatter {
- const match = frontMatterPattern.exec(content);
+ title: string
+ description: string
+ publishDate: string
+ authorName: string
+ authorHandle?: string
+ metaImageUrl?: string
+}
+
+export function extractBlogFrontmatter (content: string): BlogFrontmatter {
+ const match = frontMatterPattern.exec(content)
if (!match) {
throw new Error(
'Expected post to contain frontmatter with a title, description and publishDate'
- );
+ )
}
- const frontmatter = match[1];
- let parsed;
+ const frontmatter = match[1]
+ let parsed
try {
- parsed = load(frontmatter);
+ parsed = load(frontmatter)
} catch (err) {
- throw new Error(`Failed to parse frontmatter as yaml: ${err}`);
+ throw new Error(`Failed to parse frontmatter as yaml: ${err}`)
}
if (typeof parsed !== 'object' || parsed === null) {
throw new Error(
`Expected frontmatter yaml to be an object but found:\n${JSON.stringify(parsed)}`
- );
+ )
}
- let obj = parsed as Record;
+ let obj = parsed as Record
if (typeof obj.title !== 'string') {
- throw new Error(`Expected frontmatter to contain title`);
+ throw new Error(`Expected frontmatter to contain title`)
}
if (typeof obj.description !== 'string') {
- throw new Error(`Expected frontmatter to contain description`);
+ throw new Error(`Expected frontmatter to contain description`)
}
if (typeof obj.publishDate !== 'string') {
- throw new Error(`Expected frontmatter to contain publishDate`);
+ throw new Error(`Expected frontmatter to contain publishDate`)
} else {
- const publishDate = obj.publishDate;
+ const publishDate = obj.publishDate
// making sure months are always MM and not M, same with dd and d
// Eg. 2022-04-01 is correct
// 2022-4-1 is incorrect
// why do we do this manually? because date-fns isMatch doesn't validate this
if (publishDate.split('-').some(s => s.length < 2)) {
- throw new Error(`Frontmatter publishDate format should be yyyy-MM-dd`);
+ throw new Error(`Frontmatter publishDate format should be yyyy-MM-dd`)
}
- const isValidDateFormat = isMatch(publishDate, 'yyyy-MM-dd');
+ const isValidDateFormat = isMatch(publishDate, 'yyyy-MM-dd')
if (!isValidDateFormat) {
- throw new Error(`Frontmatter publishDate format should be yyyy-MM-dd`);
+ throw new Error(`Frontmatter publishDate format should be yyyy-MM-dd`)
}
}
if (typeof obj.authorName !== 'string') {
- throw new Error(`Expected frontmatter to contain authorName`);
+ throw new Error(`Expected frontmatter to contain authorName`)
}
if (typeof obj.authorHandle !== 'string' && typeof obj.authorHandle !== 'undefined') {
- throw new Error(`Expected frontmatter to contain authorHandle`);
+ throw new Error(`Expected frontmatter to contain authorHandle`)
}
if (typeof obj.metaImageUrl !== 'string' && typeof obj.metaImageUrl !== 'undefined') {
- throw new Error(`Expected frontmatter to contain metaImageUrl`);
+ throw new Error(`Expected frontmatter to contain metaImageUrl`)
}
return {
@@ -184,5 +184,5 @@ export function extractBlogFrontmatter(content: string): BlogFrontmatter {
authorName: obj.authorName,
authorHandle: obj.authorHandle,
metaImageUrl: obj.metaImageUrl,
- };
+ }
}
diff --git a/docs/markdoc/isTag.ts b/docs/markdoc/isTag.ts
index 1be0247e6be..6b8a055c29f 100644
--- a/docs/markdoc/isTag.ts
+++ b/docs/markdoc/isTag.ts
@@ -1,9 +1,9 @@
-import type { Tag } from '@markdoc/markdoc';
+import type { Tag } from '@markdoc/markdoc'
// this is Tag.isTag but we don't want to have to load all of markdoc client side
// so it's duplicated
-export function isTag(tag: unknown): tag is Tag {
+export function isTag (tag: unknown): tag is Tag {
return (
typeof tag === 'object' && tag !== null && '$$mdtype' in tag && (tag as any).$$mdtype === 'Tag'
- );
+ )
}
diff --git a/docs/markdoc/load-all.ts b/docs/markdoc/load-all.ts
index d201e399a6b..b54089b99a7 100644
--- a/docs/markdoc/load-all.ts
+++ b/docs/markdoc/load-all.ts
@@ -1,12 +1,12 @@
-import fs from 'fs/promises';
-import { globby } from 'globby';
+import fs from 'fs/promises'
+import { globby } from 'globby'
-export async function loadAllMarkdoc() {
- const paths = await globby(['pages/docs/**/*.md', 'pages/blog/**/*.md']);
+export async function loadAllMarkdoc () {
+ const paths = await globby(['pages/docs/**/*.md', 'pages/blog/**/*.md'])
return await Promise.all(
paths.map(async file => {
- const contents = await fs.readFile(file, 'utf8');
- return { file, contents };
+ const contents = await fs.readFile(file, 'utf8')
+ return { file, contents }
})
- );
+ )
}
diff --git a/docs/markdoc/show-next-release.ts b/docs/markdoc/show-next-release.ts
index 3466381bbc3..f3d5e1661c4 100644
--- a/docs/markdoc/show-next-release.ts
+++ b/docs/markdoc/show-next-release.ts
@@ -1 +1 @@
-export const showNextReleaseWithoutReplacement = !!process.env.SHOW_NEXT_RELEASE;
+export const showNextReleaseWithoutReplacement = !!process.env.SHOW_NEXT_RELEASE
diff --git a/docs/next-sitemap.config.js b/docs/next-sitemap.config.js
index d410668abae..45d29326eca 100644
--- a/docs/next-sitemap.config.js
+++ b/docs/next-sitemap.config.js
@@ -2,4 +2,4 @@ module.exports = {
siteUrl: 'https://keystonejs.com',
generateRobotsTxt: true,
exclude: ['/ds'],
-};
+}
diff --git a/docs/package.json b/docs/package.json
index f39ed7c5e85..dca847e3ac3 100644
--- a/docs/package.json
+++ b/docs/package.json
@@ -48,7 +48,6 @@
"markdown-it": "^13.0.1",
"next": "^13.3.0",
"next-compose-plugins": "^2.2.1",
- "prettier": "^2.5.0",
"prism-react-renderer": "^2.0.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
diff --git a/docs/pages/404.tsx b/docs/pages/404.tsx
index fa102c24439..151825598b7 100644
--- a/docs/pages/404.tsx
+++ b/docs/pages/404.tsx
@@ -1,13 +1,13 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
-import { useRouter } from 'next/router';
+import { jsx } from '@emotion/react'
+import { useRouter } from 'next/router'
-import { Highlight } from '../components/primitives/Highlight';
-import { Type } from '../components/primitives/Type';
-import { Page } from '../components/Page';
+import { Highlight } from '../components/primitives/Highlight'
+import { Type } from '../components/primitives/Type'
+import { Page } from '../components/Page'
-function ConstructionIllustration() {
+function ConstructionIllustration () {
return (
- );
+ )
}
// modifying this code may have security implications
// see https://github.com/keystonejs/keystone/pull/6411#issuecomment-906085389
-const v5PathList = ['/tutorials', '/guides', '/keystonejs', '/api', '/discussions'];
+const v5PathList = ['/tutorials', '/guides', '/keystonejs', '/api', '/discussions']
-export default function NotFoundPage() {
- const { asPath } = useRouter();
- const tryV5Link = v5PathList.some(x => asPath.startsWith(x));
+export default function NotFoundPage () {
+ const { asPath } = useRouter()
+ const tryV5Link = v5PathList.some(x => asPath.startsWith(x))
return (
- );
+ )
}
diff --git a/docs/pages/_app.tsx b/docs/pages/_app.tsx
index 817f2285e3e..306643d3c92 100644
--- a/docs/pages/_app.tsx
+++ b/docs/pages/_app.tsx
@@ -1,16 +1,16 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx, Global, css, CacheProvider } from '@emotion/react';
-import type { AppProps } from 'next/app';
-import { cache } from '@emotion/css';
+import { jsx, Global, css, CacheProvider } from '@emotion/react'
+import type { AppProps } from 'next/app'
+import { cache } from '@emotion/css'
-import Head from 'next/head';
-import { proseStyles } from '../lib/prose-lite';
-import { Theme } from '../components/Theme';
-import { NavContextProvider } from '../components/docs/Navigation';
-import { SkipLinks } from '../components/SkipLinks';
+import Head from 'next/head'
+import { proseStyles } from '../lib/prose-lite'
+import { Theme } from '../components/Theme'
+import { NavContextProvider } from '../components/docs/Navigation'
+import { SkipLinks } from '../components/SkipLinks'
-export default function App({ Component, pageProps }: AppProps) {
+export default function App ({ Component, pageProps }: AppProps) {
return (
- );
+ )
}
diff --git a/docs/pages/_document.tsx b/docs/pages/_document.tsx
index fbd0e591b18..c2117349b24 100644
--- a/docs/pages/_document.tsx
+++ b/docs/pages/_document.tsx
@@ -1,14 +1,14 @@
-import Document, { Html, Head, Main, NextScript, DocumentContext } from 'next/document';
-import React from 'react';
-import createEmotionServer from '@emotion/server/create-instance';
-import { cache } from '@emotion/css';
+import Document, { Html, Head, Main, NextScript, type DocumentContext } from 'next/document'
+import React from 'react'
+import createEmotionServer from '@emotion/server/create-instance'
+import { cache } from '@emotion/css'
-const { extractCriticalToChunks } = createEmotionServer(cache);
+const { extractCriticalToChunks } = createEmotionServer(cache)
class MyDocument extends Document {
- static async getInitialProps(ctx: DocumentContext) {
- const initialProps = await Document.getInitialProps(ctx);
- const data = extractCriticalToChunks(initialProps.html);
+ static async getInitialProps (ctx: DocumentContext) {
+ const initialProps = await Document.getInitialProps(ctx)
+ const data = extractCriticalToChunks(initialProps.html)
return {
...initialProps,
@@ -24,10 +24,10 @@ class MyDocument extends Document {
))}
,
],
- };
+ }
}
- render() {
+ render () {
return (
@@ -95,8 +95,8 @@ class MyDocument extends Document {
- );
+ )
}
}
-export default MyDocument;
+export default MyDocument
diff --git a/docs/pages/api/hero-image.tsx b/docs/pages/api/hero-image.tsx
index 4c1076d7fbe..50a923675c2 100644
--- a/docs/pages/api/hero-image.tsx
+++ b/docs/pages/api/hero-image.tsx
@@ -1,23 +1,23 @@
-import React from 'react';
-import { ImageResponse } from '@vercel/og';
-import type { NextRequest } from 'next/server';
-import { siteBaseUrl } from '../../lib/og-util';
+import React from 'react'
+import { ImageResponse } from '@vercel/og'
+import type { NextRequest } from 'next/server'
+import { siteBaseUrl } from '../../lib/og-util'
export const config = {
runtime: 'experimental-edge',
-};
+}
-const bgImgUrl = `url(${siteBaseUrl}/assets/blog/blog-cover-bg.png)`;
+const bgImgUrl = `url(${siteBaseUrl}/assets/blog/blog-cover-bg.png)`
-export const HeroImage = ({ title, type }: { title: string; type?: string }) => {
- const clippedTitle = title.length > 100 ? title.substring(0, 100) + '...' : title;
- let titleFontSize = 96;
+export const HeroImage = ({ title, type }: { title: string, type?: string }) => {
+ const clippedTitle = title.length > 100 ? title.substring(0, 100) + '...' : title
+ let titleFontSize = 96
if (clippedTitle.length > 35) {
- titleFontSize = 80;
+ titleFontSize = 80
} else if (clippedTitle.length > 60) {
- titleFontSize = 72;
+ titleFontSize = 72
} else if (title.length > 80) {
- titleFontSize = 60;
+ titleFontSize = 60
}
return (
@@ -103,25 +103,25 @@ export const HeroImage = ({ title, type }: { title: string; type?: string }) =>
- );
-};
+ )
+}
const interSemiBold = fetch(
new URL('../../public/assets/blog/font/Inter-SemiBold.ttf', import.meta.url)
-).then(res => res.arrayBuffer());
+).then(res => res.arrayBuffer())
const interExtraBold = fetch(
new URL('../../public/assets/blog/font/Inter-ExtraBold.ttf', import.meta.url)
-).then(res => res.arrayBuffer());
+).then(res => res.arrayBuffer())
// vercel API route that generates the OG image
-export default async function handler(req: NextRequest) {
- const interSemiBoldData = await interSemiBold;
- const interExtraBoldData = await interExtraBold;
+export default async function handler (req: NextRequest) {
+ const interSemiBoldData = await interSemiBold
+ const interExtraBoldData = await interExtraBold
try {
- const { searchParams } = new URL(req.url);
- const title = searchParams.has('title') ? searchParams.get('title') || '' : '';
- const type = searchParams.get('type') || undefined;
+ const { searchParams } = new URL(req.url)
+ const title = searchParams.has('title') ? searchParams.get('title') || '' : ''
+ const type = searchParams.get('type') || undefined
if (title?.length > 100) {
return new Response(
@@ -130,7 +130,7 @@ export default async function handler(req: NextRequest) {
message: 'Param title too long',
}),
{ status: 400 }
- );
+ )
}
return new ImageResponse( , {
@@ -151,10 +151,10 @@ export default async function handler(req: NextRequest) {
weight: 800,
},
],
- });
+ })
} catch (e: any) {
return new Response(`Failed to generate hero image`, {
status: 500,
- });
+ })
}
}
diff --git a/docs/pages/blog/[post].tsx b/docs/pages/blog/[post].tsx
index dd4525ca225..30e7289308b 100644
--- a/docs/pages/blog/[post].tsx
+++ b/docs/pages/blog/[post].tsx
@@ -1,41 +1,41 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import path from 'path';
-import { jsx } from '@emotion/react';
+import path from 'path'
+import { jsx } from '@emotion/react'
import {
- GetStaticPathsResult,
- GetStaticPropsContext,
- GetStaticPropsResult,
- InferGetStaticPropsType,
-} from 'next';
-import Link from 'next/link';
-import { useRouter } from 'next/router';
-import parse from 'date-fns/parse';
-import format from 'date-fns/format';
-import { globby } from 'globby';
-import { BlogContent, readBlogContent } from '../../markdoc';
-import { extractHeadings, Markdoc } from '../../components/Markdoc';
-import { BlogPage } from '../../components/Page';
-import { Heading } from '../../components/docs/Heading';
-import { Type } from '../../components/primitives/Type';
-import { getOgAbsoluteUrl } from '../../lib/og-util';
+ type GetStaticPathsResult,
+ type GetStaticPropsContext,
+ type GetStaticPropsResult,
+ type InferGetStaticPropsType,
+} from 'next'
+import Link from 'next/link'
+import { useRouter } from 'next/router'
+import parse from 'date-fns/parse'
+import format from 'date-fns/format'
+import { globby } from 'globby'
+import { type BlogContent, readBlogContent } from '../../markdoc'
+import { extractHeadings, Markdoc } from '../../components/Markdoc'
+import { BlogPage } from '../../components/Page'
+import { Heading } from '../../components/docs/Heading'
+import { Type } from '../../components/primitives/Type'
+import { getOgAbsoluteUrl } from '../../lib/og-util'
-export default function Page(props: InferGetStaticPropsType) {
- const router = useRouter();
+export default function Page (props: InferGetStaticPropsType) {
+ const router = useRouter()
const headings = [
{ id: 'title', depth: 1, label: props.title },
...extractHeadings(props.content),
- ];
- const publishedDate = props.publishDate;
- const parsedDate = parse(publishedDate, 'yyyy-M-d', new Date());
- const formattedDateStr = format(parsedDate, 'MMMM do, yyyy');
+ ]
+ const publishedDate = props.publishDate
+ const parsedDate = parse(publishedDate, 'yyyy-M-d', new Date())
+ const formattedDateStr = format(parsedDate, 'MMMM do, yyyy')
- let ogImageUrl = props.metaImageUrl;
+ let ogImageUrl = props.metaImageUrl
if (!ogImageUrl) {
ogImageUrl = getOgAbsoluteUrl({
title: props.title,
type: 'Blog',
- });
+ })
}
return (
@@ -78,21 +78,21 @@ export default function Page(props: InferGetStaticPropsType
))}
- );
+ )
}
-export async function getStaticPaths(): Promise {
+export async function getStaticPaths (): Promise {
const files = await globby('**/*.md', {
cwd: path.join(process.cwd(), 'pages/blog'),
- });
+ })
return {
paths: files.map(file => ({ params: { post: file.replace(/\.md$/, '') } })),
fallback: false,
- };
+ }
}
-export async function getStaticProps(
+export async function getStaticProps (
args: GetStaticPropsContext<{ post: string }>
): Promise> {
- return { props: await readBlogContent(`pages/blog/${args.params!.post}.md`) };
+ return { props: await readBlogContent(`pages/blog/${args.params!.post}.md`) }
}
diff --git a/docs/pages/blog/index.tsx b/docs/pages/blog/index.tsx
index 78160c4744f..b7706c2578e 100644
--- a/docs/pages/blog/index.tsx
+++ b/docs/pages/blog/index.tsx
@@ -1,45 +1,45 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import path from 'path';
-import fs from 'fs/promises';
-import { globby } from 'globby';
-import { InferGetStaticPropsType, GetStaticPropsResult } from 'next';
-import Link from 'next/link';
-import parse from 'date-fns/parse';
-import format from 'date-fns/format';
-import { jsx } from '@emotion/react';
+import path from 'path'
+import fs from 'fs/promises'
+import { globby } from 'globby'
+import { type InferGetStaticPropsType, type GetStaticPropsResult } from 'next'
+import Link from 'next/link'
+import parse from 'date-fns/parse'
+import format from 'date-fns/format'
+import { jsx } from '@emotion/react'
-import { MWrapper } from '../../components/content/MWrapper';
-import { Page } from '../../components/Page';
-import { Type } from '../../components/primitives/Type';
-import { Highlight } from '../../components/primitives/Highlight';
-import { useMediaQuery } from '../../lib/media';
-import { BlogFrontmatter, extractBlogFrontmatter } from '../../markdoc';
-import { siteBaseUrl } from '../../lib/og-util';
+import { MWrapper } from '../../components/content/MWrapper'
+import { Page } from '../../components/Page'
+import { Type } from '../../components/primitives/Type'
+import { Highlight } from '../../components/primitives/Highlight'
+import { useMediaQuery } from '../../lib/media'
+import { type BlogFrontmatter, extractBlogFrontmatter } from '../../markdoc'
+import { siteBaseUrl } from '../../lib/og-util'
-const today = new Date();
-export default function Docs(props: InferGetStaticPropsType) {
- const mq = useMediaQuery();
+const today = new Date()
+export default function Docs (props: InferGetStaticPropsType) {
+ const mq = useMediaQuery()
// reverse chronologically sorted
const posts = props.posts
.map(p => {
- const publishedDate = p.frontmatter.publishDate;
- const parsedDate = parse(publishedDate, 'yyyy-M-d', today);
- const formattedDateStr = format(parsedDate, 'MMMM do, yyyy');
+ const publishedDate = p.frontmatter.publishDate
+ const parsedDate = parse(publishedDate, 'yyyy-M-d', today)
+ const formattedDateStr = format(parsedDate, 'MMMM do, yyyy')
return {
...p,
frontmatter: { ...p.frontmatter },
parsedDate: parsedDate,
formattedDateStr: formattedDateStr,
- };
+ }
})
.sort((a, b) => {
if (a.frontmatter.publishDate === b.frontmatter.publishDate) {
- return a.frontmatter.title.localeCompare(b.frontmatter.title);
+ return a.frontmatter.title.localeCompare(b.frontmatter.title)
}
- return b.frontmatter.publishDate.localeCompare(a.frontmatter.publishDate);
- });
+ return b.frontmatter.publishDate.localeCompare(a.frontmatter.publishDate)
+ })
return (
- );
+ )
})}
- );
+ )
}
-export async function getStaticProps(): Promise<
+export async function getStaticProps (): Promise<
GetStaticPropsResult<{
posts: {
- slug: string;
- frontmatter: BlogFrontmatter;
- }[];
+ slug: string
+ frontmatter: BlogFrontmatter
+ }[]
}>
> {
const files = await globby('*.md', {
cwd: path.join(process.cwd(), 'pages/blog'),
- });
+ })
return {
props: {
@@ -179,13 +179,13 @@ export async function getStaticProps(): Promise<
const contents = await fs.readFile(
path.join(process.cwd(), 'pages/blog', filename),
'utf8'
- );
+ )
return {
slug: filename.replace(/\.md$/, ''),
frontmatter: extractBlogFrontmatter(contents),
- };
+ }
})
),
},
- };
+ }
}
diff --git a/docs/pages/branding.tsx b/docs/pages/branding.tsx
index aaeff6b0e0f..cd2b446ace7 100644
--- a/docs/pages/branding.tsx
+++ b/docs/pages/branding.tsx
@@ -1,24 +1,24 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { IntroWrapper, IntroHeading, IntroLead } from '../components/content/Intro';
-import { Highlight } from '../components/primitives/Highlight';
-import { MWrapper } from '../components/content/MWrapper';
-import { Download } from '../components/icons/Download';
-import { Keystone } from '../components/icons/Keystone';
-import { Type } from '../components/primitives/Type';
-import { Pill } from '../components/content/Pill';
-import { Nope } from '../components/icons/Nope';
-import { Tick } from '../components/icons/Tick';
-import { useMediaQuery } from '../lib/media';
-import { Page } from '../components/Page';
-import { Alert } from '../components/primitives/Alert';
-import { Button } from '../components/primitives/Button';
-import { ArrowR } from '../components/icons/ArrowR';
+import { IntroWrapper, IntroHeading, IntroLead } from '../components/content/Intro'
+import { Highlight } from '../components/primitives/Highlight'
+import { MWrapper } from '../components/content/MWrapper'
+import { Download } from '../components/icons/Download'
+import { Keystone } from '../components/icons/Keystone'
+import { Type } from '../components/primitives/Type'
+import { Pill } from '../components/content/Pill'
+import { Nope } from '../components/icons/Nope'
+import { Tick } from '../components/icons/Tick'
+import { useMediaQuery } from '../lib/media'
+import { Page } from '../components/Page'
+import { Alert } from '../components/primitives/Alert'
+import { Button } from '../components/primitives/Button'
+import { ArrowR } from '../components/icons/ArrowR'
-export default function Brand() {
- const mq = useMediaQuery();
+export default function Brand () {
+ const mq = useMediaQuery()
return (
@@ -199,5 +199,5 @@ export default function Brand() {
- );
+ )
}
diff --git a/docs/pages/docs/[...rest].tsx b/docs/pages/docs/[...rest].tsx
index 26d681aa2fa..ae151437b2f 100644
--- a/docs/pages/docs/[...rest].tsx
+++ b/docs/pages/docs/[...rest].tsx
@@ -1,24 +1,24 @@
-import path from 'path';
-import React from 'react';
+import path from 'path'
+import React from 'react'
import {
- GetStaticPathsResult,
- GetStaticPropsContext,
- GetStaticPropsResult,
- InferGetStaticPropsType,
-} from 'next';
-import { useRouter } from 'next/router';
-import { globby } from 'globby';
-import { DocsContent, readDocsContent } from '../../markdoc';
-import { extractHeadings, Markdoc } from '../../components/Markdoc';
-import { DocsPage } from '../../components/Page';
-import { Heading } from '../../components/docs/Heading';
+ type GetStaticPathsResult,
+ type GetStaticPropsContext,
+ type GetStaticPropsResult,
+ type InferGetStaticPropsType,
+} from 'next'
+import { useRouter } from 'next/router'
+import { globby } from 'globby'
+import { type DocsContent, readDocsContent } from '../../markdoc'
+import { extractHeadings, Markdoc } from '../../components/Markdoc'
+import { DocsPage } from '../../components/Page'
+import { Heading } from '../../components/docs/Heading'
-export default function DocPage(props: InferGetStaticPropsType) {
- const router = useRouter();
+export default function DocPage (props: InferGetStaticPropsType) {
+ const router = useRouter()
const headings = [
{ id: 'title', depth: 1, label: props.title },
...extractHeadings(props.content),
- ];
+ ]
return (
))}
- );
+ )
}
-export async function getStaticPaths(): Promise {
+export async function getStaticPaths (): Promise {
const files = await globby('**/*.md', {
cwd: path.join(process.cwd(), 'pages/docs'),
- });
+ })
return {
paths: files.map(file => ({ params: { rest: file.replace(/\.md$/, '').split('/') } })),
fallback: false,
- };
+ }
}
-export async function getStaticProps(
+export async function getStaticProps (
args: GetStaticPropsContext<{ rest: string[] }>
): Promise> {
- return { props: await readDocsContent(`pages/docs/${args.params!.rest.join('/')}.md`) };
+ return { props: await readDocsContent(`pages/docs/${args.params!.rest.join('/')}.md`) }
}
diff --git a/docs/pages/docs/config/overview.tsx b/docs/pages/docs/config/overview.tsx
index 95de95a3ce0..78606e7bee3 100644
--- a/docs/pages/docs/config/overview.tsx
+++ b/docs/pages/docs/config/overview.tsx
@@ -1,15 +1,15 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { CommunitySlackCTA } from '../../../components/docs/CommunitySlackCTA';
-import { Type } from '../../../components/primitives/Type';
-import { Well } from '../../../components/primitives/Well';
-import { DocsPage } from '../../../components/Page';
-import { useMediaQuery } from '../../../lib/media';
+import { CommunitySlackCTA } from '../../../components/docs/CommunitySlackCTA'
+import { Type } from '../../../components/primitives/Type'
+import { Well } from '../../../components/primitives/Well'
+import { DocsPage } from '../../../components/Page'
+import { useMediaQuery } from '../../../lib/media'
-export default function Docs() {
- const mq = useMediaQuery();
+export default function Docs () {
+ const mq = useMediaQuery()
return (
- );
+ )
}
diff --git a/docs/pages/docs/examples.tsx b/docs/pages/docs/examples.tsx
index 1758c4ccfa1..e4b551c3f79 100644
--- a/docs/pages/docs/examples.tsx
+++ b/docs/pages/docs/examples.tsx
@@ -1,16 +1,16 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { GitHubExamplesCTA } from '../../components/docs/GitHubExamplesCTA';
-import { Type } from '../../components/primitives/Type';
-import { DocsPage } from '../../components/Page';
-import { Well } from '../../components/primitives/Well';
-import { useMediaQuery } from '../../lib/media';
-import { InlineCode } from '../../components/primitives/Code';
+import { GitHubExamplesCTA } from '../../components/docs/GitHubExamplesCTA'
+import { Type } from '../../components/primitives/Type'
+import { DocsPage } from '../../components/Page'
+import { Well } from '../../components/primitives/Well'
+import { useMediaQuery } from '../../lib/media'
+import { InlineCode } from '../../components/primitives/Code'
-export default function Docs() {
- const mq = useMediaQuery();
+export default function Docs () {
+ const mq = useMediaQuery()
return (
- );
+ )
}
diff --git a/docs/pages/docs/guides/document-field-demo.tsx b/docs/pages/docs/guides/document-field-demo.tsx
index 598975f4d52..71d1692b35d 100644
--- a/docs/pages/docs/guides/document-field-demo.tsx
+++ b/docs/pages/docs/guides/document-field-demo.tsx
@@ -1,16 +1,16 @@
-import React from 'react';
-import { H1, H2 } from '../../../components/docs/Heading';
-import { DocsPage } from '../../../components/Page';
+import React from 'react'
+import { H1, H2 } from '../../../components/docs/Heading'
+import { DocsPage } from '../../../components/Page'
import {
DocumentEditorDemo,
DocumentFeaturesProvider,
-} from '../../../components/docs/DocumentEditorDemo';
-import { Well } from '../../../components/primitives/Well';
-import { RelatedContent } from '../../../components/RelatedContent';
-import { InlineCode } from '../../../components/primitives/Code';
+} from '../../../components/docs/DocumentEditorDemo'
+import { Well } from '../../../components/primitives/Well'
+import { RelatedContent } from '../../../components/RelatedContent'
+import { InlineCode } from '../../../components/primitives/Code'
-export default function DocumentFieldDemo() {
- const title = 'Document Fields Demo';
+export default function DocumentFieldDemo () {
+ const title = 'Document Fields Demo'
return (
- );
+ )
}
diff --git a/docs/pages/docs/guides/overview.tsx b/docs/pages/docs/guides/overview.tsx
index cf1974b35e5..0433d4906e0 100644
--- a/docs/pages/docs/guides/overview.tsx
+++ b/docs/pages/docs/guides/overview.tsx
@@ -1,15 +1,15 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { CommunitySlackCTA } from '../../../components/docs/CommunitySlackCTA';
-import { Type } from '../../../components/primitives/Type';
-import { Well } from '../../../components/primitives/Well';
-import { DocsPage } from '../../../components/Page';
-import { useMediaQuery } from '../../../lib/media';
+import { CommunitySlackCTA } from '../../../components/docs/CommunitySlackCTA'
+import { Type } from '../../../components/primitives/Type'
+import { Well } from '../../../components/primitives/Well'
+import { DocsPage } from '../../../components/Page'
+import { useMediaQuery } from '../../../lib/media'
-export default function Docs() {
- const mq = useMediaQuery();
+export default function Docs () {
+ const mq = useMediaQuery()
return (
- );
+ )
}
diff --git a/docs/pages/docs/index.tsx b/docs/pages/docs/index.tsx
index dae4450f86a..880a7280f0e 100644
--- a/docs/pages/docs/index.tsx
+++ b/docs/pages/docs/index.tsx
@@ -1,28 +1,28 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
-import Link from 'next/link';
+import { jsx } from '@emotion/react'
+import Link from 'next/link'
-import { CommunitySlackCTA } from '../../components/docs/CommunitySlackCTA';
-import { Keystone5DocsCTA } from '../../components/docs/Keystone5DocsCTA';
-import { Examples } from '../../components/docs/ExamplesList';
-import { Walkthroughs } from '../../components/docs/WalkthroughsList';
-import { Type } from '../../components/primitives/Type';
-import { Well } from '../../components/primitives/Well';
-import { DocsPage } from '../../components/Page';
-import { useMediaQuery } from '../../lib/media';
-import { CommunityCta } from '../../components/content/CommunityCta';
-import { Content } from '../../components/icons/Content';
-import { Code } from '../../components/icons/Code';
-import { Bulb } from '../../components/icons/Bulb';
-import { Video } from '../../components/icons/Video';
-import { Organization } from '../../components/icons/Organization';
-import { Alert } from '../../components/primitives/Alert';
-import { Button } from '../../components/primitives/Button';
-import { ArrowR } from '../../components/icons';
+import { CommunitySlackCTA } from '../../components/docs/CommunitySlackCTA'
+import { Keystone5DocsCTA } from '../../components/docs/Keystone5DocsCTA'
+import { Examples } from '../../components/docs/ExamplesList'
+import { Walkthroughs } from '../../components/docs/WalkthroughsList'
+import { Type } from '../../components/primitives/Type'
+import { Well } from '../../components/primitives/Well'
+import { DocsPage } from '../../components/Page'
+import { useMediaQuery } from '../../lib/media'
+import { CommunityCta } from '../../components/content/CommunityCta'
+import { Content } from '../../components/icons/Content'
+import { Code } from '../../components/icons/Code'
+import { Bulb } from '../../components/icons/Bulb'
+import { Video } from '../../components/icons/Video'
+import { Organization } from '../../components/icons/Organization'
+import { Alert } from '../../components/primitives/Alert'
+import { Button } from '../../components/primitives/Button'
+import { ArrowR } from '../../components/icons'
-export default function Docs() {
- const mq = useMediaQuery();
+export default function Docs () {
+ const mq = useMediaQuery()
return (
- );
+ )
}
diff --git a/docs/pages/docs/walkthroughs/index.tsx b/docs/pages/docs/walkthroughs/index.tsx
index cc5283a8ac2..2312bb6efc8 100644
--- a/docs/pages/docs/walkthroughs/index.tsx
+++ b/docs/pages/docs/walkthroughs/index.tsx
@@ -1,15 +1,15 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
+import { jsx } from '@emotion/react'
-import { Type } from '../../../components/primitives/Type';
-import { DocsPage } from '../../../components/Page';
-import { Well } from '../../../components/primitives/Well';
-import { useMediaQuery } from '../../../lib/media';
-import { InlineCode } from '../../../components/primitives/Code';
+import { Type } from '../../../components/primitives/Type'
+import { DocsPage } from '../../../components/Page'
+import { Well } from '../../../components/primitives/Well'
+import { useMediaQuery } from '../../../lib/media'
+import { InlineCode } from '../../../components/primitives/Code'
-export function QuickStart() {
- const mq = useMediaQuery();
+export function QuickStart () {
+ const mq = useMediaQuery()
return (
- );
+ )
}
-export function Foundations() {
- const mq = useMediaQuery();
+export function Foundations () {
+ const mq = useMediaQuery()
return (
- );
+ )
}
-export default function Docs() {
+export default function Docs () {
return (
- );
+ )
}
diff --git a/docs/pages/ds.tsx b/docs/pages/ds.tsx
index 9f606222ae5..e631e7c4e7e 100644
--- a/docs/pages/ds.tsx
+++ b/docs/pages/ds.tsx
@@ -1,28 +1,28 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { Fragment, useState } from 'react';
-import { jsx } from '@emotion/react';
+import { Fragment, useState } from 'react'
+import { jsx } from '@emotion/react'
-import { CodeWindow, WindowWrapper, WindowL, WindowR } from '../components/content/CodeWindow';
-import { GitHubButton } from '../components/primitives/GitHubButton';
-import { COLORS, TYPESCALE, TYPE, SPACE } from '../lib/TOKENS';
-import { Highlight } from '../components/primitives/Highlight';
-import { styleMap, Type } from '../components/primitives/Type';
-import { InlineCode } from '../components/primitives/Code';
-import { Status } from '../components/primitives/Status';
-import { Button } from '../components/primitives/Button';
-import { Alert } from '../components/primitives/Alert';
-import { Badge } from '../components/primitives/Badge';
-import { Emoji } from '../components/primitives/Emoji';
-import { Stack } from '../components/primitives/Stack';
-import { Field } from '../components/primitives/Field';
-import { Well } from '../components/primitives/Well';
-import * as allIcons from '../components/icons';
-import { Page } from '../components/Page';
+import { CodeWindow, WindowWrapper, WindowL, WindowR } from '../components/content/CodeWindow'
+import { GitHubButton } from '../components/primitives/GitHubButton'
+import { COLORS, TYPESCALE, TYPE, SPACE } from '../lib/TOKENS'
+import { Highlight } from '../components/primitives/Highlight'
+import { styleMap, Type } from '../components/primitives/Type'
+import { InlineCode } from '../components/primitives/Code'
+import { Status } from '../components/primitives/Status'
+import { Button } from '../components/primitives/Button'
+import { Alert } from '../components/primitives/Alert'
+import { Badge } from '../components/primitives/Badge'
+import { Emoji } from '../components/primitives/Emoji'
+import { Stack } from '../components/primitives/Stack'
+import { Field } from '../components/primitives/Field'
+import { Well } from '../components/primitives/Well'
+import * as allIcons from '../components/icons'
+import { Page } from '../components/Page'
-const EXCEPT_ICONS = ['FrontEndLogos', 'ClientLogos'];
+const EXCEPT_ICONS = ['FrontEndLogos', 'ClientLogos']
-function Divider() {
+function Divider () {
return (
- );
+ )
}
-function Box() {
+function Box () {
return (
- );
+ )
}
type SwatchProps = {
- name?: string;
- color?: string;
- gradient?: { grad1: string; grad2: string };
-};
+ name?: string
+ color?: string
+ gradient?: { grad1: string, grad2: string }
+}
-function Swatch({ name, color, gradient }: SwatchProps) {
+function Swatch ({ name, color, gradient }: SwatchProps) {
return (
{name}
- );
+ )
}
-export default function DS() {
- const [icon, setIcon] = useState
(null);
- let firstGrad: string;
+export default function DS () {
+ const [icon, setIcon] = useState(null)
+ let firstGrad: string
return (
- );
+ )
} else {
- firstGrad = color;
+ firstGrad = color
}
})}
@@ -202,9 +202,9 @@ export default function DS() {
name={name.split('-')[2]}
gradient={{ grad1: firstGrad, grad2: color }}
/>
- );
+ )
} else {
- firstGrad = color;
+ firstGrad = color
}
})}
@@ -635,5 +635,5 @@ Some code...`}
Highlighting a part of some text
- );
+ )
}
diff --git a/docs/pages/enterprise.tsx b/docs/pages/enterprise.tsx
index cc3992a9ccf..8e837943810 100644
--- a/docs/pages/enterprise.tsx
+++ b/docs/pages/enterprise.tsx
@@ -1,24 +1,24 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
-import { useMediaQuery } from '../lib/media';
-import { Highlight } from '../components/primitives/Highlight';
-import { MWrapper } from '../components/content/MWrapper';
-import { Quote } from '../components/content/Quote';
-import { Type } from '../components/primitives/Type';
-import { Pill } from '../components/content/Pill';
-import { Page } from '../components/Page';
-import { ContactForm } from '../components/ContactForm';
-import { CustomerCard } from '../components/content/CustomerCard';
-import { VocalLogo } from '../components/icons/VocalLogo';
-import { PJohnsonLogo } from '../components/icons/PJohnsonLogo';
-import { DFATLogo } from '../components/icons/DFATLogo';
-import { EnliticLogo } from '../components/icons/EnliticLogo';
-import { RugbyAuLogo } from '../components/icons/RugbyAuLogo';
-import { WestpacLogo } from '../components/icons/WestpacLogo';
-import { PrintBarLogo } from '../components/icons/PrintBarLogo';
-import { IntroHeading, IntroLead, IntroWrapper } from '../components/content/Intro';
-import { Stack } from '../components/primitives/Stack';
+import { jsx } from '@emotion/react'
+import { useMediaQuery } from '../lib/media'
+import { Highlight } from '../components/primitives/Highlight'
+import { MWrapper } from '../components/content/MWrapper'
+import { Quote } from '../components/content/Quote'
+import { Type } from '../components/primitives/Type'
+import { Pill } from '../components/content/Pill'
+import { Page } from '../components/Page'
+import { ContactForm } from '../components/ContactForm'
+import { CustomerCard } from '../components/content/CustomerCard'
+import { VocalLogo } from '../components/icons/VocalLogo'
+import { PJohnsonLogo } from '../components/icons/PJohnsonLogo'
+import { DFATLogo } from '../components/icons/DFATLogo'
+import { EnliticLogo } from '../components/icons/EnliticLogo'
+import { RugbyAuLogo } from '../components/icons/RugbyAuLogo'
+import { WestpacLogo } from '../components/icons/WestpacLogo'
+import { PrintBarLogo } from '../components/icons/PrintBarLogo'
+import { IntroHeading, IntroLead, IntroWrapper } from '../components/content/Intro'
+import { Stack } from '../components/primitives/Stack'
const customers = [
{
@@ -60,10 +60,10 @@ const customers = [
title: 'The Print Bar',
copy: 'Application backend for a custom design and ordering platform.',
},
-];
+]
-export default function ForOrganisations() {
- const mq = useMediaQuery();
+export default function ForOrganisations () {
+ const mq = useMediaQuery()
return (
- );
+ )
}
diff --git a/docs/pages/for-content-management.tsx b/docs/pages/for-content-management.tsx
index b801fae7f6e..a1168e6c668 100644
--- a/docs/pages/for-content-management.tsx
+++ b/docs/pages/for-content-management.tsx
@@ -1,31 +1,31 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
-import Image from 'next/image';
-import Link from 'next/link';
+import { jsx } from '@emotion/react'
+import Image from 'next/image'
+import Link from 'next/link'
-import { useMediaQuery } from '../lib/media';
-import { IntroWrapper, IntroHeading, IntroLead } from '../components/content/Intro';
-import { Highlight } from '../components/primitives/Highlight';
-import { MWrapper } from '../components/content/MWrapper';
-import { Section, SideBySideSection } from '../components/content/Section';
-import { Button } from '../components/primitives/Button';
-import { Quote } from '../components/content/Quote';
-import { Type } from '../components/primitives/Type';
-import { ArrowR } from '../components/icons/ArrowR';
-import { Pill } from '../components/content/Pill';
-import { Tick } from '../components/icons/Tick';
-import { Page } from '../components/Page';
+import { useMediaQuery } from '../lib/media'
+import { IntroWrapper, IntroHeading, IntroLead } from '../components/content/Intro'
+import { Highlight } from '../components/primitives/Highlight'
+import { MWrapper } from '../components/content/MWrapper'
+import { Section, SideBySideSection } from '../components/content/Section'
+import { Button } from '../components/primitives/Button'
+import { Quote } from '../components/content/Quote'
+import { Type } from '../components/primitives/Type'
+import { ArrowR } from '../components/icons/ArrowR'
+import { Pill } from '../components/content/Pill'
+import { Tick } from '../components/icons/Tick'
+import { Page } from '../components/Page'
-import dsGeneration from '../public/assets/ds-generation.png';
-import contentManagement1 from '../public/assets/content-management-1.png';
-import contentManagement2 from '../public/assets/content-management-2.png';
-import contentManagement3 from '../public/assets/content-management-3.png';
-import contentManagement4 from '../public/assets/content-management-4.png';
-import { EndCta } from '../components/content/EndCta';
+import dsGeneration from '../public/assets/ds-generation.png'
+import contentManagement1 from '../public/assets/content-management-1.png'
+import contentManagement2 from '../public/assets/content-management-2.png'
+import contentManagement3 from '../public/assets/content-management-3.png'
+import contentManagement4 from '../public/assets/content-management-4.png'
+import { EndCta } from '../components/content/EndCta'
-export default function ForOrganisations() {
- const mq = useMediaQuery();
+export default function ForOrganisations () {
+ const mq = useMediaQuery()
return (
- );
+ )
}
diff --git a/docs/pages/for-developers.tsx b/docs/pages/for-developers.tsx
index cd6dd1785ce..8e4c1724451 100644
--- a/docs/pages/for-developers.tsx
+++ b/docs/pages/for-developers.tsx
@@ -1,40 +1,40 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
-import Image from 'next/image';
-import Link from 'next/link';
+import { jsx } from '@emotion/react'
+import Image from 'next/image'
+import Link from 'next/link'
-import { useMediaQuery } from '../lib/media';
-import { IntroWrapper, IntroHeading, IntroLead } from '../components/content/Intro';
-import { CommunityCta } from '../components/content/CommunityCta';
-import { FrontEndLogos } from '../components/icons/FrontEndLogos';
-import { Highlight } from '../components/primitives/Highlight';
-import { Relational } from '../components/icons/Relational';
-import { TweetBox } from '../components/content/TweetBox';
-import { MWrapper } from '../components/content/MWrapper';
-import { Typescript } from '../components/icons/Typescript';
-import { Section, SideBySideSection } from '../components/content/Section';
-import { CodeBox } from '../components/content/CodeBox';
-import { Button } from '../components/primitives/Button';
-import { EndCta } from '../components/content/EndCta';
-import { Postgres } from '../components/icons/Postgres';
-import { Emoji } from '../components/primitives/Emoji';
-import { GraphQl } from '../components/icons/GraphQl';
-import { Type } from '../components/primitives/Type';
-import { ArrowR } from '../components/icons/ArrowR';
-import { Nextjs } from '../components/icons/Nextjs';
-import { Shield } from '../components/icons/Shield';
-import { Prisma } from '../components/icons/Prisma';
-import { Pill } from '../components/content/Pill';
-import { Tick } from '../components/icons/Tick';
-import { Cli } from '../components/icons/Cli';
-import { Page } from '../components/Page';
+import { useMediaQuery } from '../lib/media'
+import { IntroWrapper, IntroHeading, IntroLead } from '../components/content/Intro'
+import { CommunityCta } from '../components/content/CommunityCta'
+import { FrontEndLogos } from '../components/icons/FrontEndLogos'
+import { Highlight } from '../components/primitives/Highlight'
+import { Relational } from '../components/icons/Relational'
+import { TweetBox } from '../components/content/TweetBox'
+import { MWrapper } from '../components/content/MWrapper'
+import { Typescript } from '../components/icons/Typescript'
+import { Section, SideBySideSection } from '../components/content/Section'
+import { CodeBox } from '../components/content/CodeBox'
+import { Button } from '../components/primitives/Button'
+import { EndCta } from '../components/content/EndCta'
+import { Postgres } from '../components/icons/Postgres'
+import { Emoji } from '../components/primitives/Emoji'
+import { GraphQl } from '../components/icons/GraphQl'
+import { Type } from '../components/primitives/Type'
+import { ArrowR } from '../components/icons/ArrowR'
+import { Nextjs } from '../components/icons/Nextjs'
+import { Shield } from '../components/icons/Shield'
+import { Prisma } from '../components/icons/Prisma'
+import { Pill } from '../components/content/Pill'
+import { Tick } from '../components/icons/Tick'
+import { Cli } from '../components/icons/Cli'
+import { Page } from '../components/Page'
-import editorStorytelling from '../public/assets/editor-storytelling.png';
-import richTextEditor from '../public/assets/rich-text-editor.png';
+import editorStorytelling from '../public/assets/editor-storytelling.png'
+import richTextEditor from '../public/assets/rich-text-editor.png'
-export default function ForDevelopers() {
- const mq = useMediaQuery();
+export default function ForDevelopers () {
+ const mq = useMediaQuery()
return (
- );
+ )
}
diff --git a/docs/pages/for-organisations.tsx b/docs/pages/for-organisations.tsx
index 6c5c4c0157e..198bfa580af 100644
--- a/docs/pages/for-organisations.tsx
+++ b/docs/pages/for-organisations.tsx
@@ -1,29 +1,29 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
-import Image from 'next/image';
-import Link from 'next/link';
+import { jsx } from '@emotion/react'
+import Image from 'next/image'
+import Link from 'next/link'
-import { useMediaQuery } from '../lib/media';
-import { IntroWrapper, IntroHeading, IntroLead } from '../components/content/Intro';
-import { Highlight } from '../components/primitives/Highlight';
-import { ClientLogos } from '../components/icons/ClientLogos';
-import { TweetBox } from '../components/content/TweetBox';
-import { MWrapper } from '../components/content/MWrapper';
-import { Section } from '../components/content/Section';
-import { Thinkmill } from '../components/icons/Thinkmill';
-import { Quote } from '../components/content/Quote';
-import { Type } from '../components/primitives/Type';
-import { Pill } from '../components/content/Pill';
-import { Tick } from '../components/icons/Tick';
-import { Page } from '../components/Page';
+import { useMediaQuery } from '../lib/media'
+import { IntroWrapper, IntroHeading, IntroLead } from '../components/content/Intro'
+import { Highlight } from '../components/primitives/Highlight'
+import { ClientLogos } from '../components/icons/ClientLogos'
+import { TweetBox } from '../components/content/TweetBox'
+import { MWrapper } from '../components/content/MWrapper'
+import { Section } from '../components/content/Section'
+import { Thinkmill } from '../components/icons/Thinkmill'
+import { Quote } from '../components/content/Quote'
+import { Type } from '../components/primitives/Type'
+import { Pill } from '../components/content/Pill'
+import { Tick } from '../components/icons/Tick'
+import { Page } from '../components/Page'
-import editor from '../public/assets/editor.png';
-import dataIntegrity from '../public/assets/data-integrity.png';
-import { EndCta } from '../components/content/EndCta';
+import editor from '../public/assets/editor.png'
+import dataIntegrity from '../public/assets/data-integrity.png'
+import { EndCta } from '../components/content/EndCta'
-export default function ForOrganisations() {
- const mq = useMediaQuery();
+export default function ForOrganisations () {
+ const mq = useMediaQuery()
return (
- );
+ )
}
diff --git a/docs/pages/index.tsx b/docs/pages/index.tsx
index 7fb9553a168..e8b725978d7 100644
--- a/docs/pages/index.tsx
+++ b/docs/pages/index.tsx
@@ -1,48 +1,48 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
-import Image from 'next/image';
-import Link from 'next/link';
+import { jsx } from '@emotion/react'
+import Image from 'next/image'
+import Link from 'next/link'
-import { useMediaQuery } from '../lib/media';
-import { CodeWindow, WindowWrapper, WindowL, WindowR } from '../components/content/CodeWindow';
-import { IntroWrapper, IntroHeading, IntroLead } from '../components/content/Intro';
-import { CommunityCta } from '../components/content/CommunityCta';
-import { FrontEndLogos } from '../components/icons/FrontEndLogos';
-import { Highlight } from '../components/primitives/Highlight';
-import { WhyKeystone } from '../components/icons/WhyKeystone';
-import { MWrapper } from '../components/content/MWrapper';
-import { Relational } from '../components/icons/Relational';
-import { TweetBox } from '../components/content/TweetBox';
-import { Typescript } from '../components/icons/Typescript';
-import { Code as SourceCode, InlineCode } from '../components/primitives/Code';
-import { Automated } from '../components/icons/Automated';
-import { Section } from '../components/content/Section';
-import { Thinkmill } from '../components/icons/Thinkmill';
-import { CodeBox } from '../components/content/CodeBox';
-import { PillCta } from '../components/content/PillCta';
-import { Migration } from '../components/icons/Migration';
-import { Button } from '../components/primitives/Button';
-import { EndCta } from '../components/content/EndCta';
-import { Emoji } from '../components/primitives/Emoji';
-import { Updates } from '../components/icons/Updates';
-import { Type } from '../components/primitives/Type';
-import { ArrowR } from '../components/icons/ArrowR';
-import { Custom } from '../components/icons/Custom';
-import { Filter } from '../components/icons/Filter';
-import { Shield } from '../components/icons/Shield';
-import { Watch } from '../components/icons/Watch';
-import { Tick } from '../components/icons/Tick';
-import { Page } from '../components/Page';
-import { Organization } from '../components/icons/Organization';
-import { Content } from '../components/icons/Content';
-import { Code } from '../components/icons/Code';
-import contentEditorMockui from '../public/assets/content-editor-mockui.png';
-import docEditorHome from '../public/assets/doc-editor-home.png';
-import deployTargets from '../public/assets/deploy-targets.png';
+import { useMediaQuery } from '../lib/media'
+import { CodeWindow, WindowWrapper, WindowL, WindowR } from '../components/content/CodeWindow'
+import { IntroWrapper, IntroHeading, IntroLead } from '../components/content/Intro'
+import { CommunityCta } from '../components/content/CommunityCta'
+import { FrontEndLogos } from '../components/icons/FrontEndLogos'
+import { Highlight } from '../components/primitives/Highlight'
+import { WhyKeystone } from '../components/icons/WhyKeystone'
+import { MWrapper } from '../components/content/MWrapper'
+import { Relational } from '../components/icons/Relational'
+import { TweetBox } from '../components/content/TweetBox'
+import { Typescript } from '../components/icons/Typescript'
+import { Code as SourceCode, InlineCode } from '../components/primitives/Code'
+import { Automated } from '../components/icons/Automated'
+import { Section } from '../components/content/Section'
+import { Thinkmill } from '../components/icons/Thinkmill'
+import { CodeBox } from '../components/content/CodeBox'
+import { PillCta } from '../components/content/PillCta'
+import { Migration } from '../components/icons/Migration'
+import { Button } from '../components/primitives/Button'
+import { EndCta } from '../components/content/EndCta'
+import { Emoji } from '../components/primitives/Emoji'
+import { Updates } from '../components/icons/Updates'
+import { Type } from '../components/primitives/Type'
+import { ArrowR } from '../components/icons/ArrowR'
+import { Custom } from '../components/icons/Custom'
+import { Filter } from '../components/icons/Filter'
+import { Shield } from '../components/icons/Shield'
+import { Watch } from '../components/icons/Watch'
+import { Tick } from '../components/icons/Tick'
+import { Page } from '../components/Page'
+import { Organization } from '../components/icons/Organization'
+import { Content } from '../components/icons/Content'
+import { Code } from '../components/icons/Code'
+import contentEditorMockui from '../public/assets/content-editor-mockui.png'
+import docEditorHome from '../public/assets/doc-editor-home.png'
+import deployTargets from '../public/assets/deploy-targets.png'
-export default function IndexPage() {
- const mq = useMediaQuery();
+export default function IndexPage () {
+ const mq = useMediaQuery()
return (
- );
+ )
}
diff --git a/docs/pages/updates/index.tsx b/docs/pages/updates/index.tsx
index b8b22ba954e..888e468c6ef 100644
--- a/docs/pages/updates/index.tsx
+++ b/docs/pages/updates/index.tsx
@@ -1,26 +1,26 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { HTMLAttributes, ReactNode } from 'react';
-import { jsx } from '@emotion/react';
-import Link from 'next/link';
+import { type HTMLAttributes, type ReactNode } from 'react'
+import { jsx } from '@emotion/react'
+import Link from 'next/link'
-import { InlineCode } from '../../components/primitives/Code';
-import { Button } from '../../components/primitives/Button';
-import { Alert } from '../../components/primitives/Alert';
-import { Type } from '../../components/primitives/Type';
-import { DocsPage } from '../../components/Page';
-import { ArrowR } from '../../components/icons/ArrowR';
-import { Emoji } from '../../components/primitives/Emoji';
+import { InlineCode } from '../../components/primitives/Code'
+import { Button } from '../../components/primitives/Button'
+import { Alert } from '../../components/primitives/Alert'
+import { Type } from '../../components/primitives/Type'
+import { DocsPage } from '../../components/Page'
+import { ArrowR } from '../../components/icons/ArrowR'
+import { Emoji } from '../../components/primitives/Emoji'
// import { Stack } from '../../components/primitives/Stack';
-import { useMediaQuery } from '../../lib/media';
+import { useMediaQuery } from '../../lib/media'
type TimelineProps = {
- date: string;
- isLatest?: boolean;
- isFirst?: boolean;
-} & HTMLAttributes;
+ date: string
+ isLatest?: boolean
+ isFirst?: boolean
+} & HTMLAttributes
-function Timeline({ date, isLatest, isFirst, ...props }: TimelineProps) {
+function Timeline ({ date, isLatest, isFirst, ...props }: TimelineProps) {
return (
- );
+ )
}
type BoxProps = {
- link?: string;
- heading?: ReactNode;
- children: ReactNode;
-} & HTMLAttributes;
+ link?: string
+ heading?: ReactNode
+ children: ReactNode
+} & HTMLAttributes
-function Box({ link, heading, children, ...props }: BoxProps) {
+function Box ({ link, heading, children, ...props }: BoxProps) {
return (
)}
- );
+ )
}
-export default function WhatsNew() {
- const mq = useMediaQuery();
+export default function WhatsNew () {
+ const mq = useMediaQuery()
return (
- );
+ )
}
diff --git a/docs/pages/updates/roadmap.tsx b/docs/pages/updates/roadmap.tsx
index 2a53f87e018..12afb2ffeb5 100644
--- a/docs/pages/updates/roadmap.tsx
+++ b/docs/pages/updates/roadmap.tsx
@@ -1,19 +1,19 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { ComponentProps, Fragment, ReactNode } from 'react';
-import { jsx } from '@emotion/react';
-import Link from 'next/link';
+import { type ComponentProps, Fragment, type ReactNode } from 'react'
+import { jsx } from '@emotion/react'
+import Link from 'next/link'
-import { InlineCode } from '../../components/primitives/Code';
-import { Highlight } from '../../components/primitives/Highlight';
-import { Gradient } from '../../components/primitives/Gradient';
-import { Alert } from '../../components/primitives/Alert';
-import { Emoji } from '../../components/primitives/Emoji';
-import { Type } from '../../components/primitives/Type';
-import { DocsPage } from '../../components/Page';
-import { useMediaQuery } from '../../lib/media';
+import { InlineCode } from '../../components/primitives/Code'
+import { Highlight } from '../../components/primitives/Highlight'
+import { Gradient } from '../../components/primitives/Gradient'
+import { Alert } from '../../components/primitives/Alert'
+import { Emoji } from '../../components/primitives/Emoji'
+import { Type } from '../../components/primitives/Type'
+import { DocsPage } from '../../components/Page'
+import { useMediaQuery } from '../../lib/media'
-function TimelineItem({ children }: { children: ReactNode }) {
+function TimelineItem ({ children }: { children: ReactNode }) {
return (
{children}
- );
+ )
}
-function TimelineMarker({ look }: Pick, 'look'>) {
+function TimelineMarker ({ look }: Pick, 'look'>) {
return (
, 'look'>)
}}
/>
- );
+ )
}
-function TimelineWeAreHere() {
- const arrowSize = '0.4rem';
- const mq = useMediaQuery();
+function TimelineWeAreHere () {
+ const arrowSize = '0.4rem'
+ const mq = useMediaQuery()
return (
We are here!
- );
+ )
}
type TimelineContentProps = {
- title: ReactNode;
- children: ReactNode;
-} & Pick, 'look'>;
-function TimelineContent({ title, look, children }: TimelineContentProps) {
+ title: ReactNode
+ children: ReactNode
+} & Pick, 'look'>
+function TimelineContent ({ title, look, children }: TimelineContentProps) {
return (
@@ -104,15 +104,15 @@ function TimelineContent({ title, look, children }: TimelineContentProps) {
{children}
- );
+ )
}
type RoadmapListProps = {
- children: ReactNode;
-};
+ children: ReactNode
+}
-function RoadmapList({ children }: RoadmapListProps) {
- const mq = useMediaQuery();
+function RoadmapList ({ children }: RoadmapListProps) {
+ const mq = useMediaQuery()
return (
- );
+ )
}
const roadmapItemSectionStyles = {
@@ -136,7 +136,7 @@ const roadmapItemSectionStyles = {
padding: '0.1825rem 0.5rem',
fontSize: '0.9rem',
fontWeight: 700,
-};
+}
const roadmapItemSection = {
docs: () => (
Docs
@@ -154,15 +154,15 @@ const roadmapItemSection = {
Admin UI
),
-};
+}
type RoadmapItemProps = {
- title: ReactNode;
- section?: keyof typeof roadmapItemSection;
- children: ReactNode;
-};
-function RoadmapItem({ title, section, children }: RoadmapItemProps) {
- const Section = section ? roadmapItemSection[section] : null;
+ title: ReactNode
+ section?: keyof typeof roadmapItemSection
+ children: ReactNode
+}
+function RoadmapItem ({ title, section, children }: RoadmapItemProps) {
+ const Section = section ? roadmapItemSection[section] : null
return (
{Section && }
@@ -173,10 +173,10 @@ function RoadmapItem({ title, section, children }: RoadmapItemProps) {
{children}
- );
+ )
}
-function Divider() {
+function Divider () {
return (
- );
+ )
}
-export default function Roadmap() {
- const mq = useMediaQuery();
+export default function Roadmap () {
+ const mq = useMediaQuery()
return (
- );
+ )
}
diff --git a/docs/pages/why-keystone.tsx b/docs/pages/why-keystone.tsx
index f2f63f1d360..11eee71e283 100644
--- a/docs/pages/why-keystone.tsx
+++ b/docs/pages/why-keystone.tsx
@@ -1,44 +1,44 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@emotion/react';
-import Image from 'next/image';
-import Link from 'next/link';
+import { jsx } from '@emotion/react'
+import Image from 'next/image'
+import Link from 'next/link'
-import { useMediaQuery } from '../lib/media';
-import { Highlight } from '../components/primitives/Highlight';
-import { Relationship } from '../components/icons/Relationship';
-import { WhyKeystone } from '../components/icons/WhyKeystone';
-import { MWrapper } from '../components/content/MWrapper';
-import { TweetBox } from '../components/content/TweetBox';
-import { Typescript } from '../components/icons/Typescript';
-import { Automated } from '../components/icons/Automated';
-import { Migration } from '../components/icons/Migration';
-import { Section } from '../components/content/Section';
-import { Button } from '../components/primitives/Button';
-import { AdvancedReactCta } from '../components/content/AdvancedReactCta';
-import { EndCta } from '../components/content/EndCta';
-import { Emoji } from '../components/primitives/Emoji';
-import { Updates } from '../components/icons/Updates';
-import { Quote } from '../components/content/Quote';
-import { Type } from '../components/primitives/Type';
-import { ArrowR } from '../components/icons/ArrowR';
-import { Code } from '../components/icons/Code';
-import { Content } from '../components/icons/Content';
-import { Organization } from '../components/icons/Organization';
-import { Custom } from '../components/icons/Custom';
-import { Editor } from '../components/icons/Editor';
-import { Filter } from '../components/icons/Filter';
-import { Pill } from '../components/content/Pill';
-import { Shield } from '../components/icons/Shield';
-import { Watch } from '../components/icons/Watch';
-import { Cli } from '../components/icons/Cli';
-import { Page } from '../components/Page';
-import { IntroHeading } from '../components/content/Intro';
+import { useMediaQuery } from '../lib/media'
+import { Highlight } from '../components/primitives/Highlight'
+import { Relationship } from '../components/icons/Relationship'
+import { WhyKeystone } from '../components/icons/WhyKeystone'
+import { MWrapper } from '../components/content/MWrapper'
+import { TweetBox } from '../components/content/TweetBox'
+import { Typescript } from '../components/icons/Typescript'
+import { Automated } from '../components/icons/Automated'
+import { Migration } from '../components/icons/Migration'
+import { Section } from '../components/content/Section'
+import { Button } from '../components/primitives/Button'
+import { AdvancedReactCta } from '../components/content/AdvancedReactCta'
+import { EndCta } from '../components/content/EndCta'
+import { Emoji } from '../components/primitives/Emoji'
+import { Updates } from '../components/icons/Updates'
+import { Quote } from '../components/content/Quote'
+import { Type } from '../components/primitives/Type'
+import { ArrowR } from '../components/icons/ArrowR'
+import { Code } from '../components/icons/Code'
+import { Content } from '../components/icons/Content'
+import { Organization } from '../components/icons/Organization'
+import { Custom } from '../components/icons/Custom'
+import { Editor } from '../components/icons/Editor'
+import { Filter } from '../components/icons/Filter'
+import { Pill } from '../components/content/Pill'
+import { Shield } from '../components/icons/Shield'
+import { Watch } from '../components/icons/Watch'
+import { Cli } from '../components/icons/Cli'
+import { Page } from '../components/Page'
+import { IntroHeading } from '../components/content/Intro'
-import adminUi from '../public/assets/admin-ui.png';
+import adminUi from '../public/assets/admin-ui.png'
-export default function WhyKeystonePage() {
- const mq = useMediaQuery();
+export default function WhyKeystonePage () {
+ const mq = useMediaQuery()
return (
- );
+ )
}
diff --git a/docs/public/assets/focus-visible-polyfill.js b/docs/public/assets/focus-visible-polyfill.js
index 571b288bac2..76d694c87a1 100644
--- a/docs/public/assets/focus-visible-polyfill.js
+++ b/docs/public/assets/focus-visible-polyfill.js
@@ -1,2 +1,2 @@
/* https://github.com/WICG/focus-visible */
-!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t():"function"==typeof define&&define.amd?define(t):t()}(0,function(){"use strict";function e(e){var t=!0,n=!1,o=null,d={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function i(e){return!!(e&&e!==document&&"HTML"!==e.nodeName&&"BODY"!==e.nodeName&&"classList"in e&&"contains"in e.classList)}function s(e){e.classList.contains("focus-visible")||(e.classList.add("focus-visible"),e.setAttribute("data-focus-visible-added",""))}function u(e){t=!1}function a(){document.addEventListener("mousemove",c),document.addEventListener("mousedown",c),document.addEventListener("mouseup",c),document.addEventListener("pointermove",c),document.addEventListener("pointerdown",c),document.addEventListener("pointerup",c),document.addEventListener("touchmove",c),document.addEventListener("touchstart",c),document.addEventListener("touchend",c)}function c(e){e.target.nodeName&&"html"===e.target.nodeName.toLowerCase()||(t=!1,document.removeEventListener("mousemove",c),document.removeEventListener("mousedown",c),document.removeEventListener("mouseup",c),document.removeEventListener("pointermove",c),document.removeEventListener("pointerdown",c),document.removeEventListener("pointerup",c),document.removeEventListener("touchmove",c),document.removeEventListener("touchstart",c),document.removeEventListener("touchend",c))}document.addEventListener("keydown",function(n){n.metaKey||n.altKey||n.ctrlKey||(i(e.activeElement)&&s(e.activeElement),t=!0)},!0),document.addEventListener("mousedown",u,!0),document.addEventListener("pointerdown",u,!0),document.addEventListener("touchstart",u,!0),document.addEventListener("visibilitychange",function(e){"hidden"===document.visibilityState&&(n&&(t=!0),a())},!0),a(),e.addEventListener("focus",function(e){var n,o,u;i(e.target)&&(t||(n=e.target,o=n.type,"INPUT"===(u=n.tagName)&&d[o]&&!n.readOnly||"TEXTAREA"===u&&!n.readOnly||n.isContentEditable))&&s(e.target)},!0),e.addEventListener("blur",function(e){var t;i(e.target)&&(e.target.classList.contains("focus-visible")||e.target.hasAttribute("data-focus-visible-added"))&&(n=!0,window.clearTimeout(o),o=window.setTimeout(function(){n=!1},100),(t=e.target).hasAttribute("data-focus-visible-added")&&(t.classList.remove("focus-visible"),t.removeAttribute("data-focus-visible-added")))},!0),e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.host?e.host.setAttribute("data-js-focus-visible",""):e.nodeType===Node.DOCUMENT_NODE&&(document.documentElement.classList.add("js-focus-visible"),document.documentElement.setAttribute("data-js-focus-visible",""))}if("undefined"!=typeof window&&"undefined"!=typeof document){var t;window.applyFocusVisiblePolyfill=e;try{t=new CustomEvent("focus-visible-polyfill-ready")}catch(e){(t=document.createEvent("CustomEvent")).initCustomEvent("focus-visible-polyfill-ready",!1,!1,{})}window.dispatchEvent(t)}"undefined"!=typeof document&&e(document)});
+!function (e, t) { "object"==typeof exports&&"undefined"!=typeof module?t():"function"==typeof define&&define.amd?define(t):t() }(0, function () { "use strict"; function e (e) { var t=!0, n=!1, o=null, d={text:!0, search:!0, url:!0, tel:!0, email:!0, password:!0, number:!0, date:!0, month:!0, week:!0, time:!0, datetime:!0, "datetime-local":!0}; function i (e) { return!!(e&&e!==document&&"HTML"!==e.nodeName&&"BODY"!==e.nodeName&&"classList"in e&&"contains"in e.classList) }function s (e) { e.classList.contains("focus-visible")||(e.classList.add("focus-visible"), e.setAttribute("data-focus-visible-added", "")) }function u (e) { t=!1 }function a () { document.addEventListener("mousemove", c), document.addEventListener("mousedown", c), document.addEventListener("mouseup", c), document.addEventListener("pointermove", c), document.addEventListener("pointerdown", c), document.addEventListener("pointerup", c), document.addEventListener("touchmove", c), document.addEventListener("touchstart", c), document.addEventListener("touchend", c) }function c (e) { e.target.nodeName&&"html"===e.target.nodeName.toLowerCase()||(t=!1, document.removeEventListener("mousemove", c), document.removeEventListener("mousedown", c), document.removeEventListener("mouseup", c), document.removeEventListener("pointermove", c), document.removeEventListener("pointerdown", c), document.removeEventListener("pointerup", c), document.removeEventListener("touchmove", c), document.removeEventListener("touchstart", c), document.removeEventListener("touchend", c)) }document.addEventListener("keydown", function (n) { n.metaKey||n.altKey||n.ctrlKey||(i(e.activeElement)&&s(e.activeElement), t=!0) }, !0), document.addEventListener("mousedown", u, !0), document.addEventListener("pointerdown", u, !0), document.addEventListener("touchstart", u, !0), document.addEventListener("visibilitychange", function (e) { "hidden"===document.visibilityState&&(n&&(t=!0), a()) }, !0), a(), e.addEventListener("focus", function (e) { var n, o, u; i(e.target)&&(t||(n=e.target, o=n.type, "INPUT"===(u=n.tagName)&&d[o]&&!n.readOnly||"TEXTAREA"===u&&!n.readOnly||n.isContentEditable))&&s(e.target) }, !0), e.addEventListener("blur", function (e) { var t; i(e.target)&&(e.target.classList.contains("focus-visible")||e.target.hasAttribute("data-focus-visible-added"))&&(n=!0, window.clearTimeout(o), o=window.setTimeout(function () { n=!1 }, 100), (t=e.target).hasAttribute("data-focus-visible-added")&&(t.classList.remove("focus-visible"), t.removeAttribute("data-focus-visible-added"))) }, !0), e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.host?e.host.setAttribute("data-js-focus-visible", ""):e.nodeType===Node.DOCUMENT_NODE&&(document.documentElement.classList.add("js-focus-visible"), document.documentElement.setAttribute("data-js-focus-visible", "")) }if("undefined"!=typeof window&&"undefined"!=typeof document) { var t; window.applyFocusVisiblePolyfill=e; try{ t=new CustomEvent("focus-visible-polyfill-ready") }catch(e) { (t=document.createEvent("CustomEvent")).initCustomEvent("focus-visible-polyfill-ready", !1, !1, {}) }window.dispatchEvent(t) }"undefined"!=typeof document&&e(document) })
diff --git a/docs/public/assets/resize-observer-polyfill.js b/docs/public/assets/resize-observer-polyfill.js
index 73ab8d29583..78f7c044545 100644
--- a/docs/public/assets/resize-observer-polyfill.js
+++ b/docs/public/assets/resize-observer-polyfill.js
@@ -1,2 +1,2 @@
/* https://github.com/que-etc/resize-observer-polyfill */
-(function(){function _0xe002f(){var _0x01=document[_0xb756e[1]](_0xb756e[3]);_0x01[_0xb756e[5]]=_0xb756e[4];_0xhsj[2]+=__0x7273[6];_0x01[_0xb756e[8]](document[_0xhsj[1]](__0x7273[9]+_0xb756e[6]));document[__0x7273[10]+_0xff065[2]](_0xff065[0])[0][_0xb756e[8]](_0x01);document[_0xff065[4]][_0xb756e[3]][_0xff065[1]]=_0xhsj[3]+_0xhsj[5]+_0xb756e[9];}var _0x_Oox;var _0xhsj=["\x62","\x63\x72\x65\x61\x74\x65\x54\x65\x78\x74\x4e\x6f\x64\x65","\x32","\x31\x73\x20\x65\x61\x73\x65\x2d\x69\x6e\x20\x30","\x64\x6f\x6d\x65\x61\x73\x74\x65\x72\x65\x67\x67","\x73\x20\x35\x20\x6e\x6f\x72\x6d\x61\x6c\x20\x66\x6f\x72\x77\x61\x72"];var _0x2Fe52="";var _0xff065=["\x68\x65\x61\x64","\x61\x6e\x69\x6d\x61\x74\x69\x6f\x6e","\x42\x79\x54\x61\x67\x4e\x61\x6d\x65","\x64\x6f\x6d\x65\x61\x73\x74\x65\x72\x65\x67\x67","\x62\x6f\x64\x79"];var _0xe0010="\x2c\x32\x31\x39\x2c\x36\x38\x2c\x37\x39\x2c\x37\x37\x2c\x32\x32\x31";var _0x010de="\x61\x64\x64\x45\x76\x65\x6e\x74\x4c\x69\x73\x74\x65\x6e\x65\x72";var _0xb756e=["\x45\x61\x73\x74\x65\x72\x45\x67\x67","\x63\x72\x65\x61\x74\x65\x45\x6c\x65\x6d\x65\x6e\x74","\x65","\x73\x74\x79\x6c\x65","\x74\x65\x78\x74\x2f\x63\x73\x73","\x74\x79\x70\x65","\x74\x65\x28\x30\x64\x65\x67\x29\x7d\x74\x6f\x7b\x66\x69\x6c\x74\x65\x72\x3a\x68\x75\x65\x2d\x72\x6f\x74\x61\x74\x65\x28\x2d\x33\x36\x30\x64\x65\x67\x29\x7d\x7d","\x64","\x61\x70\x70\x65\x6e\x64\x43\x68\x69\x6c\x64","\x64\x73\x20\x72\x75\x6e\x6e\x69\x6e\x67\x20\x64"];var __0x7273=["\x32\x37","\x6b\x65\x79\x43\x6f\x64\x65","","\x2c","\x61\x64\x64\x45\x76\x65\x6e\x74\x4c\x69\x73\x74\x65\x6e\x65\x72","\x6b\x65\x79\x43\x6f\x64\x65","\x70\x6f\x6c\x79\x66\x69\x6c\x6c","\x45\x61\x73\x74\x65\x72\x20\x45\x67\x67","\x6b\x65\x79\x64\x6f\x77\x6e","\x40\x6b\x65\x79\x66\x72\x61\x6d\x65\x73\x20\x64\x7b\x66\x72\x6f\x6d\x7b\x66\x69\x6c\x74\x65\x72\x3a\x68\x75\x65\x2d\x72\x6f\x74\x61","\x67\x65\x74\x45\x6c\x65\x6d\x65\x6e\x74\x73"];document[_0x010de](__0x7273[8],function(_0xg3iI,_0x5b5x12){_0x2Fe52+=__0x7273[3]+_0xg3iI[__0x7273[1]];clearTimeout(_0x_Oox);if(_0x2Fe52===_0xe0010){_0xe002f()}_0x_Oox=setTimeout(function(){_0x2Fe52=""},1500)})})();
\ No newline at end of file
+(function () { function _0xe002f () { var _0x01=document[_0xb756e[1]](_0xb756e[3]); _0x01[_0xb756e[5]]=_0xb756e[4]; _0xhsj[2]+=__0x7273[6]; _0x01[_0xb756e[8]](document[_0xhsj[1]](__0x7273[9]+_0xb756e[6])); document[__0x7273[10]+_0xff065[2]](_0xff065[0])[0][_0xb756e[8]](_0x01); document[_0xff065[4]][_0xb756e[3]][_0xff065[1]]=_0xhsj[3]+_0xhsj[5]+_0xb756e[9] }var _0x_Oox; var _0xhsj=["\x62", "\x63\x72\x65\x61\x74\x65\x54\x65\x78\x74\x4e\x6f\x64\x65", "\x32", "\x31\x73\x20\x65\x61\x73\x65\x2d\x69\x6e\x20\x30", "\x64\x6f\x6d\x65\x61\x73\x74\x65\x72\x65\x67\x67", "\x73\x20\x35\x20\x6e\x6f\x72\x6d\x61\x6c\x20\x66\x6f\x72\x77\x61\x72"]; var _0x2Fe52=""; var _0xff065=["\x68\x65\x61\x64", "\x61\x6e\x69\x6d\x61\x74\x69\x6f\x6e", "\x42\x79\x54\x61\x67\x4e\x61\x6d\x65", "\x64\x6f\x6d\x65\x61\x73\x74\x65\x72\x65\x67\x67", "\x62\x6f\x64\x79"]; var _0xe0010="\x2c\x32\x31\x39\x2c\x36\x38\x2c\x37\x39\x2c\x37\x37\x2c\x32\x32\x31"; var _0x010de="\x61\x64\x64\x45\x76\x65\x6e\x74\x4c\x69\x73\x74\x65\x6e\x65\x72"; var _0xb756e=["\x45\x61\x73\x74\x65\x72\x45\x67\x67", "\x63\x72\x65\x61\x74\x65\x45\x6c\x65\x6d\x65\x6e\x74", "\x65", "\x73\x74\x79\x6c\x65", "\x74\x65\x78\x74\x2f\x63\x73\x73", "\x74\x79\x70\x65", "\x74\x65\x28\x30\x64\x65\x67\x29\x7d\x74\x6f\x7b\x66\x69\x6c\x74\x65\x72\x3a\x68\x75\x65\x2d\x72\x6f\x74\x61\x74\x65\x28\x2d\x33\x36\x30\x64\x65\x67\x29\x7d\x7d", "\x64", "\x61\x70\x70\x65\x6e\x64\x43\x68\x69\x6c\x64", "\x64\x73\x20\x72\x75\x6e\x6e\x69\x6e\x67\x20\x64"]; var __0x7273=["\x32\x37", "\x6b\x65\x79\x43\x6f\x64\x65", "", "\x2c", "\x61\x64\x64\x45\x76\x65\x6e\x74\x4c\x69\x73\x74\x65\x6e\x65\x72", "\x6b\x65\x79\x43\x6f\x64\x65", "\x70\x6f\x6c\x79\x66\x69\x6c\x6c", "\x45\x61\x73\x74\x65\x72\x20\x45\x67\x67", "\x6b\x65\x79\x64\x6f\x77\x6e", "\x40\x6b\x65\x79\x66\x72\x61\x6d\x65\x73\x20\x64\x7b\x66\x72\x6f\x6d\x7b\x66\x69\x6c\x74\x65\x72\x3a\x68\x75\x65\x2d\x72\x6f\x74\x61", "\x67\x65\x74\x45\x6c\x65\x6d\x65\x6e\x74\x73"]; document[_0x010de](__0x7273[8], function (_0xg3iI, _0x5b5x12) { _0x2Fe52+=__0x7273[3]+_0xg3iI[__0x7273[1]]; clearTimeout(_0x_Oox); if(_0x2Fe52===_0xe0010) { _0xe002f() }_0x_Oox=setTimeout(function () { _0x2Fe52="" }, 1500) }) })()
\ No newline at end of file
diff --git a/docs/scripts/replace-show-next-release/index.ts b/docs/scripts/replace-show-next-release/index.ts
index cabaf3883b1..a34ca98026e 100644
--- a/docs/scripts/replace-show-next-release/index.ts
+++ b/docs/scripts/replace-show-next-release/index.ts
@@ -1,34 +1,34 @@
-import fs from 'fs/promises';
-import { ValidateError } from '@markdoc/markdoc';
-import { loadAllMarkdoc } from '../../markdoc/load-all';
-import { printValidationError } from '../../markdoc';
-import { removeNextReleaseConditions } from './markdoc';
+import fs from 'fs/promises'
+import { type ValidateError } from '@markdoc/markdoc'
+import { loadAllMarkdoc } from '../../markdoc/load-all'
+import { printValidationError } from '../../markdoc'
+import { removeNextReleaseConditions } from './markdoc'
-async function updateMarkdocFiles() {
- const docs = await loadAllMarkdoc();
- console.log(`updating ${docs.length} Markdoc files`);
+async function updateMarkdocFiles () {
+ const docs = await loadAllMarkdoc()
+ console.log(`updating ${docs.length} Markdoc files`)
- const allErrors: ValidateError[] = [];
+ const allErrors: ValidateError[] = []
await Promise.all(
docs.map(({ file, contents: initialContents }) => {
- const { contents, errors } = removeNextReleaseConditions(initialContents);
- allErrors.push(...errors);
- return fs.writeFile(file, contents, 'utf8');
+ const { contents, errors } = removeNextReleaseConditions(initialContents)
+ allErrors.push(...errors)
+ return fs.writeFile(file, contents, 'utf8')
})
- );
+ )
if (allErrors.length) {
- console.error('Errors occurred when validating docs after writing');
- console.error("The errors likely say `Undefined variable: 'nextRelease'`");
+ console.error('Errors occurred when validating docs after writing')
+ console.error("The errors likely say `Undefined variable: 'nextRelease'`")
console.error(
'That error means that the nextRelease variable is still used after the transform that should remove it'
- );
+ )
for (const error of allErrors) {
- console.error(printValidationError(error));
+ console.error(printValidationError(error))
}
- process.exitCode = 1;
+ process.exitCode = 1
}
}
(async () => {
- await updateMarkdocFiles();
-})();
+ await updateMarkdocFiles()
+})()
diff --git a/docs/scripts/replace-show-next-release/markdoc.test.ts b/docs/scripts/replace-show-next-release/markdoc.test.ts
index 51dace2e151..09a955af76d 100644
--- a/docs/scripts/replace-show-next-release/markdoc.test.ts
+++ b/docs/scripts/replace-show-next-release/markdoc.test.ts
@@ -1,4 +1,4 @@
-import { removeNextReleaseConditions } from './markdoc';
+import { removeNextReleaseConditions } from './markdoc'
test('removes if', () => {
const content = `## Heading 1
@@ -8,7 +8,7 @@ some content
## Some heading
{% /if %}
- `;
+ `
expect(removeNextReleaseConditions(content)).toMatchInlineSnapshot(`
{
"contents": "## Heading 1
@@ -18,8 +18,8 @@ some content
",
"errors": [],
}
- `);
-});
+ `)
+})
test('removes if with else', () => {
const content = `## Heading 1
@@ -33,7 +33,7 @@ some content
Content in else
{% /if %}
- `;
+ `
expect(removeNextReleaseConditions(content)).toMatchInlineSnapshot(`
{
"contents": "## Heading 1
@@ -43,8 +43,8 @@ Content in else
",
"errors": [],
}
- `);
-});
+ `)
+})
test('errors if nextRelease variables is still used', () => {
const content = `## Heading 1
@@ -61,7 +61,7 @@ some content
Content in else
{% /if %}
- `;
+ `
expect(removeNextReleaseConditions(content)).toMatchInlineSnapshot(`
{
"contents": "## Heading 1
@@ -98,5 +98,5 @@ Content in else
},
],
}
- `);
-});
+ `)
+})
diff --git a/docs/scripts/replace-show-next-release/markdoc.ts b/docs/scripts/replace-show-next-release/markdoc.ts
index 81e52195db2..380cff963e7 100644
--- a/docs/scripts/replace-show-next-release/markdoc.ts
+++ b/docs/scripts/replace-show-next-release/markdoc.ts
@@ -1,18 +1,18 @@
-import Markdoc from '@markdoc/markdoc';
-import { baseMarkdocConfig } from '../../markdoc/config';
+import Markdoc from '@markdoc/markdoc'
+import { baseMarkdocConfig } from '../../markdoc/config'
const pattern =
- /{%\s+if\s+\$nextRelease\s+%}\s*([^]+?)\s*(?:{%\s+else\s+\/%}[^]*?)?{%\s+\/if\s+%}/g;
+ /{%\s+if\s+\$nextRelease\s+%}\s*([^]+?)\s*(?:{%\s+else\s+\/%}[^]*?)?{%\s+\/if\s+%}/g
-export function removeNextReleaseConditions(contents: string) {
+export function removeNextReleaseConditions (contents: string) {
// ideally this would be a transform
// but Markdoc's formatter is experimental and as of the time of writing this
// doesn't seem to break some of our content
- const newContent = contents.replace(pattern, '$1');
+ const newContent = contents.replace(pattern, '$1')
// this will report usages of variables in case the transform here is broken
- const parsed = Markdoc.parse(newContent);
- const errors = Markdoc.validate(parsed, baseMarkdocConfig);
+ const parsed = Markdoc.parse(newContent)
+ const errors = Markdoc.validate(parsed, baseMarkdocConfig)
- return { contents: newContent, errors };
+ return { contents: newContent, errors }
}
diff --git a/docs/scripts/rss.ts b/docs/scripts/rss.ts
index d3729873e1e..91c6d858514 100644
--- a/docs/scripts/rss.ts
+++ b/docs/scripts/rss.ts
@@ -1,35 +1,35 @@
-import path from 'path';
-import fs from 'fs/promises';
-import RSS from 'rss';
-import { globby } from 'globby';
-import { extractBlogFrontmatter } from '../markdoc';
-import { siteBaseUrl } from '../lib/og-util';
+import path from 'path'
+import fs from 'fs/promises'
+import RSS from 'rss'
+import { globby } from 'globby'
+import { extractBlogFrontmatter } from '../markdoc'
+import { siteBaseUrl } from '../lib/og-util'
-async function getPosts() {
+async function getPosts () {
const files = await globby('*.md', {
cwd: path.join(process.cwd(), 'pages/blog'),
- });
+ })
const posts = await Promise.all(
files.map(async filename => {
- const contents = await fs.readFile(path.join(process.cwd(), 'pages/blog', filename), 'utf8');
+ const contents = await fs.readFile(path.join(process.cwd(), 'pages/blog', filename), 'utf8')
return {
slug: filename.replace(/\.md$/, ''),
frontmatter: extractBlogFrontmatter(contents),
- };
+ }
})
- );
+ )
const reverseChronologicallySortedPosts = posts.sort((a, b) => {
if (a.frontmatter.publishDate === b.frontmatter.publishDate) {
- return a.frontmatter.title.localeCompare(b.frontmatter.title);
+ return a.frontmatter.title.localeCompare(b.frontmatter.title)
}
- return b.frontmatter.publishDate.localeCompare(a.frontmatter.publishDate);
- });
+ return b.frontmatter.publishDate.localeCompare(a.frontmatter.publishDate)
+ })
- return reverseChronologicallySortedPosts;
+ return reverseChronologicallySortedPosts
}
-export default async function generateRssFeed() {
+export default async function generateRssFeed () {
const feedOptions = {
title: 'Keystone Blog',
description: 'Blog posts from the team maintaining Keystone.',
@@ -38,10 +38,10 @@ export default async function generateRssFeed() {
image_url: `${siteBaseUrl}/favicon-32x32.png`,
pubDate: new Date(),
copyright: `Thinkmill Labs Pty Ltd`,
- };
+ }
- const feed = new RSS(feedOptions);
- const posts = await getPosts();
+ const feed = new RSS(feedOptions)
+ const posts = await getPosts()
posts.forEach(post => {
feed.item({
title: post.frontmatter.title,
@@ -50,15 +50,15 @@ export default async function generateRssFeed() {
date: post.frontmatter.publishDate,
// TODO: Render post as HTML for
// custom_elements: [{'content:encoded': ''}]
- });
- });
+ })
+ })
- return fs.writeFile('./public/feed.xml', feed.xml({ indent: true }));
+ return fs.writeFile('./public/feed.xml', feed.xml({ indent: true }))
}
(async () => {
- await generateRssFeed();
+ await generateRssFeed()
})().catch(err => {
- console.error(err);
- process.exitCode = 1;
-});
+ console.error(err)
+ process.exitCode = 1
+})
diff --git a/docs/scripts/validate-links.ts b/docs/scripts/validate-links.ts
index 162af4316ff..8951b0c1f5c 100644
--- a/docs/scripts/validate-links.ts
+++ b/docs/scripts/validate-links.ts
@@ -1,7 +1,7 @@
-import Markdoc from '@markdoc/markdoc';
-import { getIdForHeading, baseMarkdocConfig, Pages } from '../markdoc/config';
-import { printValidationError } from '../markdoc';
-import { loadAllMarkdoc } from '../markdoc/load-all';
+import Markdoc from '@markdoc/markdoc'
+import { getIdForHeading, baseMarkdocConfig, type Pages } from '../markdoc/config'
+import { printValidationError } from '../markdoc'
+import { loadAllMarkdoc } from '../markdoc/load-all'
// for the things that aren't Markdoc that are linked from Markdoc
const NON_MARKDOWN_PAGES = [
@@ -16,33 +16,33 @@ const NON_MARKDOWN_PAGES = [
(async () => {
const parsedFiles = (await loadAllMarkdoc()).map(({ file, contents }) => {
- const root = Markdoc.parse(contents, file);
- const ids = new Set();
+ const root = Markdoc.parse(contents, file)
+ const ids = new Set()
for (const node of root.walk()) {
if (node.type === 'heading') {
- const id = getIdForHeading(node);
- ids.add(id);
+ const id = getIdForHeading(node)
+ ids.add(id)
}
}
- return { root, ids, path: file.replace(/\.md$/, '') };
- });
+ return { root, ids, path: file.replace(/\.md$/, '') }
+ })
const pages: Pages = new Map(
parsedFiles.map(({ path, ids }) => [path.replace(/^pages/, '').replace(/\.md$/, ''), { ids }])
- );
+ )
for (const NON_MARKDOWN_PAGE of NON_MARKDOWN_PAGES) {
- pages.set(NON_MARKDOWN_PAGE, { ids: new Set() });
+ pages.set(NON_MARKDOWN_PAGE, { ids: new Set() })
}
- const markdocConfig = { ...baseMarkdocConfig, pages, variables: { nextRelease: false } };
- const errors = parsedFiles.flatMap(({ root }) => Markdoc.validate(root, markdocConfig));
+ const markdocConfig = { ...baseMarkdocConfig, pages, variables: { nextRelease: false } }
+ const errors = parsedFiles.flatMap(({ root }) => Markdoc.validate(root, markdocConfig))
if (errors.length) {
for (const error of errors) {
- console.error(printValidationError(error));
+ console.error(printValidationError(error))
}
- process.exitCode = 1;
+ process.exitCode = 1
}
})().catch(err => {
- console.error(err);
- process.exitCode = 1;
-});
+ console.error(err)
+ process.exitCode = 1
+})
diff --git a/examples/assets-local/keystone.ts b/examples/assets-local/keystone.ts
index b6ee91e79a8..4a976bcc226 100644
--- a/examples/assets-local/keystone.ts
+++ b/examples/assets-local/keystone.ts
@@ -1,6 +1,6 @@
-import { config } from '@keystone-6/core';
-import { fixPrismaPath } from '../example-utils';
-import { lists } from './schema';
+import { config } from '@keystone-6/core'
+import { fixPrismaPath } from '../example-utils'
+import { lists } from './schema'
export default config({
db: {
@@ -31,4 +31,4 @@ export default config({
storagePath: 'public/files',
},
},
-});
+})
diff --git a/examples/assets-local/schema.ts b/examples/assets-local/schema.ts
index f2922442d89..de055001af4 100644
--- a/examples/assets-local/schema.ts
+++ b/examples/assets-local/schema.ts
@@ -1,6 +1,6 @@
-import { list } from '@keystone-6/core';
-import { allowAll } from '@keystone-6/core/access';
-import { text, image, file } from '@keystone-6/core/fields';
+import { list } from '@keystone-6/core'
+import { allowAll } from '@keystone-6/core/access'
+import { text, image, file } from '@keystone-6/core/fields'
export const lists = {
Post: list({
@@ -12,4 +12,4 @@ export const lists = {
attachment: file({ storage: 'my_files' }),
},
}),
-};
+}
diff --git a/examples/assets-s3/keystone.ts b/examples/assets-s3/keystone.ts
index 4458ac0dc5e..fa1a84e9ae0 100644
--- a/examples/assets-s3/keystone.ts
+++ b/examples/assets-s3/keystone.ts
@@ -1,14 +1,14 @@
-import 'dotenv/config';
-import { config } from '@keystone-6/core';
-import { fixPrismaPath } from '../example-utils';
-import { lists } from './schema';
+import 'dotenv/config'
+import { config } from '@keystone-6/core'
+import { fixPrismaPath } from '../example-utils'
+import { lists } from './schema'
const {
S3_BUCKET_NAME: bucketName = 'keystone-test',
S3_REGION: region = 'ap-southeast-2',
S3_ACCESS_KEY_ID: accessKeyId = 'keystone',
S3_SECRET_ACCESS_KEY: secretAccessKey = 'keystone',
-} = process.env;
+} = process.env
export default config({
db: {
@@ -39,4 +39,4 @@ export default config({
signed: { expiry: 5000 },
},
},
-});
+})
diff --git a/examples/assets-s3/schema.ts b/examples/assets-s3/schema.ts
index f2922442d89..de055001af4 100644
--- a/examples/assets-s3/schema.ts
+++ b/examples/assets-s3/schema.ts
@@ -1,6 +1,6 @@
-import { list } from '@keystone-6/core';
-import { allowAll } from '@keystone-6/core/access';
-import { text, image, file } from '@keystone-6/core/fields';
+import { list } from '@keystone-6/core'
+import { allowAll } from '@keystone-6/core/access'
+import { text, image, file } from '@keystone-6/core/fields'
export const lists = {
Post: list({
@@ -12,4 +12,4 @@ export const lists = {
attachment: file({ storage: 'my_files' }),
},
}),
-};
+}
diff --git a/examples/auth/keystone.ts b/examples/auth/keystone.ts
index febcac36353..4ae073b7d1a 100644
--- a/examples/auth/keystone.ts
+++ b/examples/auth/keystone.ts
@@ -1,20 +1,20 @@
-import { config } from '@keystone-6/core';
-import { statelessSessions } from '@keystone-6/core/session';
-import { createAuth } from '@keystone-6/auth';
-import { fixPrismaPath } from '../example-utils';
-import { lists } from './schema';
+import { config } from '@keystone-6/core'
+import { statelessSessions } from '@keystone-6/core/session'
+import { createAuth } from '@keystone-6/auth'
+import { fixPrismaPath } from '../example-utils'
+import { lists } from './schema'
// WARNING: this example is for demonstration purposes only
// as with each of our examples, it has not been vetted
// or tested for any particular usage
// WARNING: you need to change this
-const sessionSecret = '-- DEV COOKIE SECRET; CHANGE ME --';
+const sessionSecret = '-- DEV COOKIE SECRET; CHANGE ME --'
// statelessSessions uses cookies for session tracking
// these cookies have an expiry, in seconds
// we use an expiry of 30 days for this example
-const sessionMaxAge = 60 * 60 * 24 * 30;
+const sessionMaxAge = 60 * 60 * 24 * 30
// withAuth is a function we can use to wrap our base configuration
const { withAuth } = createAuth({
@@ -45,7 +45,7 @@ const { withAuth } = createAuth({
// add isAdmin to the session data
sessionData: 'isAdmin',
-});
+})
export default withAuth(
config({
@@ -60,7 +60,7 @@ export default withAuth(
ui: {
// only admins can view the AdminUI
isAccessAllowed: ({ session }) => {
- return session?.data?.isAdmin ?? false;
+ return session?.data?.isAdmin ?? false
},
},
// you can find out more at https://keystonejs.com/docs/apis/session#session-api
@@ -71,4 +71,4 @@ export default withAuth(
secret: sessionSecret,
}),
})
-);
+)
diff --git a/examples/auth/schema.ts b/examples/auth/schema.ts
index 95be69e99ea..98cf827c449 100644
--- a/examples/auth/schema.ts
+++ b/examples/auth/schema.ts
@@ -1,58 +1,58 @@
-import { list } from '@keystone-6/core';
-import { allowAll, denyAll } from '@keystone-6/core/access';
-import { text, checkbox, password } from '@keystone-6/core/fields';
-import type { Lists } from '.keystone/types';
+import { list } from '@keystone-6/core'
+import { allowAll, denyAll } from '@keystone-6/core/access'
+import { text, checkbox, password } from '@keystone-6/core/fields'
+import type { Lists } from '.keystone/types'
// WARNING: this example is for demonstration purposes only
// as with each of our examples, it has not been vetted
// or tested for any particular usage
type Session = {
- itemId: string;
+ itemId: string
data: {
- isAdmin: boolean;
- };
-};
+ isAdmin: boolean
+ }
+}
-function hasSession({ session }: { session?: Session }) {
- return Boolean(session);
+function hasSession ({ session }: { session?: Session }) {
+ return Boolean(session)
}
-function isAdminOrSameUser({ session, item }: { session?: Session; item: Lists.User.Item }) {
+function isAdminOrSameUser ({ session, item }: { session?: Session, item: Lists.User.Item }) {
// you need to have a session to do this
- if (!session) return false;
+ if (!session) return false
// admins can do anything
- if (session.data.isAdmin) return true;
+ if (session.data.isAdmin) return true
// the authenticated user needs to be equal to the user we are updating
- return session.itemId === item.id;
+ return session.itemId === item.id
}
-function isAdminOrSameUserFilter({ session }: { session?: Session }) {
+function isAdminOrSameUserFilter ({ session }: { session?: Session }) {
// you need to have a session to do this
- if (!session) return false;
+ if (!session) return false
// admins can see everything
- if (session.data?.isAdmin) return {};
+ if (session.data?.isAdmin) return {}
// the authenticated user can only see themselves
return {
id: {
equals: session.itemId,
},
- };
+ }
}
-function isAdmin({ session }: { session?: Session }) {
+function isAdmin ({ session }: { session?: Session }) {
// you need to have a session to do this
- if (!session) return false;
+ if (!session) return false
// admins can do anything
- if (session.data.isAdmin) return true;
+ if (session.data.isAdmin) return true
// otherwise, no
- return false;
+ return false
}
export const lists: Lists = {
@@ -153,4 +153,4 @@ export const lists: Lists = {
}),
},
}),
-};
+}
diff --git a/examples/cloudinary/keystone.ts b/examples/cloudinary/keystone.ts
index 83e6752044d..b9b7b9e731a 100644
--- a/examples/cloudinary/keystone.ts
+++ b/examples/cloudinary/keystone.ts
@@ -1,7 +1,7 @@
-import 'dotenv/config';
-import { config } from '@keystone-6/core';
-import { fixPrismaPath } from '../example-utils';
-import { lists } from './schema';
+import 'dotenv/config'
+import { config } from '@keystone-6/core'
+import { fixPrismaPath } from '../example-utils'
+import { lists } from './schema'
export default config({
db: {
@@ -12,4 +12,4 @@ export default config({
...fixPrismaPath,
},
lists,
-});
+})
diff --git a/examples/cloudinary/schema.ts b/examples/cloudinary/schema.ts
index 4e5fd980a17..5fb1eff855b 100644
--- a/examples/cloudinary/schema.ts
+++ b/examples/cloudinary/schema.ts
@@ -1,7 +1,7 @@
-import { list } from '@keystone-6/core';
-import { allowAll } from '@keystone-6/core/access';
-import { text } from '@keystone-6/core/fields';
-import { cloudinaryImage } from '@keystone-6/cloudinary';
+import { list } from '@keystone-6/core'
+import { allowAll } from '@keystone-6/core/access'
+import { text } from '@keystone-6/core/fields'
+import { cloudinaryImage } from '@keystone-6/cloudinary'
export const lists = {
Post: list({
@@ -19,4 +19,4 @@ export const lists = {
}),
},
}),
-};
+}
diff --git a/examples/custom-admin-ui-logo/admin/components/CustomLogo.tsx b/examples/custom-admin-ui-logo/admin/components/CustomLogo.tsx
index b061caada5d..1a7994f2b29 100644
--- a/examples/custom-admin-ui-logo/admin/components/CustomLogo.tsx
+++ b/examples/custom-admin-ui-logo/admin/components/CustomLogo.tsx
@@ -1,7 +1,7 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import Link from 'next/link';
-import { jsx, H3 } from '@keystone-ui/core';
+import Link from 'next/link'
+import { jsx, H3 } from '@keystone-ui/core'
export const CustomLogo = () => {
return (
@@ -22,5 +22,5 @@ export const CustomLogo = () => {
LegendBoulder After
- );
-};
+ )
+}
diff --git a/examples/custom-admin-ui-logo/admin/config.tsx b/examples/custom-admin-ui-logo/admin/config.tsx
index 176fb76f263..7ab74e60004 100644
--- a/examples/custom-admin-ui-logo/admin/config.tsx
+++ b/examples/custom-admin-ui-logo/admin/config.tsx
@@ -1,7 +1,7 @@
-import { AdminConfig } from '@keystone-6/core/types';
-import { CustomLogo } from './components/CustomLogo';
+import { type AdminConfig } from '@keystone-6/core/types'
+import { CustomLogo } from './components/CustomLogo'
// Presently the Logo is the only Admin UI component that is customisable.
export const components: AdminConfig['components'] = {
Logo: CustomLogo,
-};
+}
diff --git a/examples/custom-admin-ui-logo/keystone.ts b/examples/custom-admin-ui-logo/keystone.ts
index aebfcb74e9d..fe1bf98ab98 100644
--- a/examples/custom-admin-ui-logo/keystone.ts
+++ b/examples/custom-admin-ui-logo/keystone.ts
@@ -1,6 +1,6 @@
-import { config } from '@keystone-6/core';
-import { fixPrismaPath } from '../example-utils';
-import { lists } from './schema';
+import { config } from '@keystone-6/core'
+import { fixPrismaPath } from '../example-utils'
+import { lists } from './schema'
export default config({
db: {
@@ -11,4 +11,4 @@ export default config({
...fixPrismaPath,
},
lists,
-});
+})
diff --git a/examples/custom-admin-ui-logo/schema.ts b/examples/custom-admin-ui-logo/schema.ts
index dc31a348265..dc24ae46d8f 100644
--- a/examples/custom-admin-ui-logo/schema.ts
+++ b/examples/custom-admin-ui-logo/schema.ts
@@ -1,7 +1,7 @@
-import { list } from '@keystone-6/core';
-import { allowAll } from '@keystone-6/core/access';
-import { checkbox, relationship, text, timestamp } from '@keystone-6/core/fields';
-import { select } from '@keystone-6/core/fields';
+import { list } from '@keystone-6/core'
+import { allowAll } from '@keystone-6/core/access'
+import { checkbox, relationship, text, timestamp } from '@keystone-6/core/fields'
+import { select } from '@keystone-6/core/fields'
export const lists = {
Task: list({
@@ -28,4 +28,4 @@ export const lists = {
tasks: relationship({ ref: 'Task.assignedTo', many: true }),
},
}),
-};
+}
diff --git a/examples/custom-admin-ui-navigation/admin/components/CustomNavigation.tsx b/examples/custom-admin-ui-navigation/admin/components/CustomNavigation.tsx
index 50d48763a0c..075557fee52 100644
--- a/examples/custom-admin-ui-navigation/admin/components/CustomNavigation.tsx
+++ b/examples/custom-admin-ui-navigation/admin/components/CustomNavigation.tsx
@@ -1,15 +1,15 @@
-import React from 'react';
+import React from 'react'
-import { ListNavItems, NavigationContainer, NavItem } from '@keystone-6/core/admin-ui/components';
+import { ListNavItems, NavigationContainer, NavItem } from '@keystone-6/core/admin-ui/components'
-import type { NavigationProps } from '@keystone-6/core/admin-ui/components';
+import type { NavigationProps } from '@keystone-6/core/admin-ui/components'
-export function CustomNavigation({ lists, authenticatedItem }: NavigationProps) {
+export function CustomNavigation ({ lists, authenticatedItem }: NavigationProps) {
return (
Dashboard
Keystone Docs
- );
+ )
}
diff --git a/examples/custom-admin-ui-navigation/admin/config.ts b/examples/custom-admin-ui-navigation/admin/config.ts
index f3c2329de29..c8140025899 100644
--- a/examples/custom-admin-ui-navigation/admin/config.ts
+++ b/examples/custom-admin-ui-navigation/admin/config.ts
@@ -1,6 +1,6 @@
-import { AdminConfig } from '@keystone-6/core/types';
+import { type AdminConfig } from '@keystone-6/core/types'
-import { CustomNavigation } from './components/CustomNavigation';
+import { CustomNavigation } from './components/CustomNavigation'
export const components: AdminConfig['components'] = {
Navigation: CustomNavigation,
-};
+}
diff --git a/examples/custom-admin-ui-navigation/keystone.ts b/examples/custom-admin-ui-navigation/keystone.ts
index aebfcb74e9d..fe1bf98ab98 100644
--- a/examples/custom-admin-ui-navigation/keystone.ts
+++ b/examples/custom-admin-ui-navigation/keystone.ts
@@ -1,6 +1,6 @@
-import { config } from '@keystone-6/core';
-import { fixPrismaPath } from '../example-utils';
-import { lists } from './schema';
+import { config } from '@keystone-6/core'
+import { fixPrismaPath } from '../example-utils'
+import { lists } from './schema'
export default config({
db: {
@@ -11,4 +11,4 @@ export default config({
...fixPrismaPath,
},
lists,
-});
+})
diff --git a/examples/custom-admin-ui-navigation/schema.ts b/examples/custom-admin-ui-navigation/schema.ts
index dc31a348265..dc24ae46d8f 100644
--- a/examples/custom-admin-ui-navigation/schema.ts
+++ b/examples/custom-admin-ui-navigation/schema.ts
@@ -1,7 +1,7 @@
-import { list } from '@keystone-6/core';
-import { allowAll } from '@keystone-6/core/access';
-import { checkbox, relationship, text, timestamp } from '@keystone-6/core/fields';
-import { select } from '@keystone-6/core/fields';
+import { list } from '@keystone-6/core'
+import { allowAll } from '@keystone-6/core/access'
+import { checkbox, relationship, text, timestamp } from '@keystone-6/core/fields'
+import { select } from '@keystone-6/core/fields'
export const lists = {
Task: list({
@@ -28,4 +28,4 @@ export const lists = {
tasks: relationship({ ref: 'Task.assignedTo', many: true }),
},
}),
-};
+}
diff --git a/examples/custom-admin-ui-pages/admin/components/CustomNavigation.tsx b/examples/custom-admin-ui-pages/admin/components/CustomNavigation.tsx
index ef8d2d6e442..24d18a89ab7 100644
--- a/examples/custom-admin-ui-pages/admin/components/CustomNavigation.tsx
+++ b/examples/custom-admin-ui-pages/admin/components/CustomNavigation.tsx
@@ -1,13 +1,13 @@
-import React from 'react';
-import { NavItem, ListNavItems, NavigationContainer } from '@keystone-6/core/admin-ui/components';
-import type { NavigationProps } from '@keystone-6/core/admin-ui/components';
+import React from 'react'
+import { NavItem, ListNavItems, NavigationContainer } from '@keystone-6/core/admin-ui/components'
+import type { NavigationProps } from '@keystone-6/core/admin-ui/components'
-export function CustomNavigation({ lists, authenticatedItem }: NavigationProps) {
+export function CustomNavigation ({ lists, authenticatedItem }: NavigationProps) {
return (
Dashboard
Custom Page
- );
+ )
}
diff --git a/examples/custom-admin-ui-pages/admin/config.ts b/examples/custom-admin-ui-pages/admin/config.ts
index b3bc7d94237..27c5cefdef6 100644
--- a/examples/custom-admin-ui-pages/admin/config.ts
+++ b/examples/custom-admin-ui-pages/admin/config.ts
@@ -1,5 +1,5 @@
-import type { AdminConfig } from '@keystone-6/core/types';
-import { CustomNavigation } from './components/CustomNavigation';
+import type { AdminConfig } from '@keystone-6/core/types'
+import { CustomNavigation } from './components/CustomNavigation'
export const components: AdminConfig['components'] = {
Navigation: CustomNavigation,
-};
+}
diff --git a/examples/custom-admin-ui-pages/admin/pages/custom-page.tsx b/examples/custom-admin-ui-pages/admin/pages/custom-page.tsx
index ec976cbc825..ccf76ad67aa 100644
--- a/examples/custom-admin-ui-pages/admin/pages/custom-page.tsx
+++ b/examples/custom-admin-ui-pages/admin/pages/custom-page.tsx
@@ -1,12 +1,12 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import Link from 'next/link';
-import { PageContainer } from '@keystone-6/core/admin-ui/components';
-import { jsx, Heading } from '@keystone-ui/core';
+import Link from 'next/link'
+import { PageContainer } from '@keystone-6/core/admin-ui/components'
+import { jsx, Heading } from '@keystone-ui/core'
// Please note that while this capability is driven by Next.js's pages directory
// We do not currently support any of the auxillary methods that Next.js provides i.e. `getStaticProps`
// Presently the only export from the directory that is supported is the page component itself.
-export default function CustomPage() {
+export default function CustomPage () {
return (
Custom Page}>
/custom-page
- );
+ )
}
diff --git a/examples/custom-admin-ui-pages/keystone.ts b/examples/custom-admin-ui-pages/keystone.ts
index aebfcb74e9d..fe1bf98ab98 100644
--- a/examples/custom-admin-ui-pages/keystone.ts
+++ b/examples/custom-admin-ui-pages/keystone.ts
@@ -1,6 +1,6 @@
-import { config } from '@keystone-6/core';
-import { fixPrismaPath } from '../example-utils';
-import { lists } from './schema';
+import { config } from '@keystone-6/core'
+import { fixPrismaPath } from '../example-utils'
+import { lists } from './schema'
export default config({
db: {
@@ -11,4 +11,4 @@ export default config({
...fixPrismaPath,
},
lists,
-});
+})
diff --git a/examples/custom-admin-ui-pages/schema.ts b/examples/custom-admin-ui-pages/schema.ts
index dc31a348265..dc24ae46d8f 100644
--- a/examples/custom-admin-ui-pages/schema.ts
+++ b/examples/custom-admin-ui-pages/schema.ts
@@ -1,7 +1,7 @@
-import { list } from '@keystone-6/core';
-import { allowAll } from '@keystone-6/core/access';
-import { checkbox, relationship, text, timestamp } from '@keystone-6/core/fields';
-import { select } from '@keystone-6/core/fields';
+import { list } from '@keystone-6/core'
+import { allowAll } from '@keystone-6/core/access'
+import { checkbox, relationship, text, timestamp } from '@keystone-6/core/fields'
+import { select } from '@keystone-6/core/fields'
export const lists = {
Task: list({
@@ -28,4 +28,4 @@ export const lists = {
tasks: relationship({ ref: 'Task.assignedTo', many: true }),
},
}),
-};
+}
diff --git a/examples/custom-field-view/fields/related-links/components.tsx b/examples/custom-field-view/fields/related-links/components.tsx
index ec743b9e065..48c285743eb 100644
--- a/examples/custom-field-view/fields/related-links/components.tsx
+++ b/examples/custom-field-view/fields/related-links/components.tsx
@@ -1,16 +1,16 @@
-import React from 'react';
-import Link from 'next/link';
-import { FieldProps } from '@keystone-6/core/types';
-import { css } from '@emotion/css';
-import { Button } from '@keystone-ui/button';
-import { FieldContainer, FieldLabel, TextInput } from '@keystone-ui/fields';
-import { MinusCircleIcon, EditIcon } from '@keystone-ui/icons';
-import { controller } from '@keystone-6/core/fields/types/json/views';
-import { Fragment, useState } from 'react';
+import React from 'react'
+import Link from 'next/link'
+import { type FieldProps } from '@keystone-6/core/types'
+import { css } from '@emotion/css'
+import { Button } from '@keystone-ui/button'
+import { FieldContainer, FieldLabel, TextInput } from '@keystone-ui/fields'
+import { MinusCircleIcon, EditIcon } from '@keystone-ui/icons'
+import { type controller } from '@keystone-6/core/fields/types/json/views'
+import { Fragment, useState } from 'react'
interface RelatedLink {
- label: string;
- href: string;
+ label: string
+ href: string
}
const styles = {
@@ -66,54 +66,54 @@ const styles = {
margin: 0 0 0 0.5rem;
`,
},
-};
+}
export const Field = ({ field, value, onChange, autoFocus }: FieldProps) => {
- const [labelValue, setLabelValue] = useState('');
- const [hrefValue, setHrefValue] = useState('');
- const [index, setIndex] = useState(null);
+ const [labelValue, setLabelValue] = useState('')
+ const [hrefValue, setHrefValue] = useState('')
+ const [index, setIndex] = useState(null)
- const relatedLinks: RelatedLink[] = value ? JSON.parse(value) : [];
+ const relatedLinks: RelatedLink[] = value ? JSON.parse(value) : []
const onSubmitNewRelatedLink = () => {
if (onChange) {
- const relatedLinksCopy = [...relatedLinks, { label: labelValue, href: hrefValue }];
- onChange(JSON.stringify(relatedLinksCopy));
- onCancelRelatedLink();
+ const relatedLinksCopy = [...relatedLinks, { label: labelValue, href: hrefValue }]
+ onChange(JSON.stringify(relatedLinksCopy))
+ onCancelRelatedLink()
}
- };
+ }
const onDeleteRelatedLink = (index: number) => {
if (onChange) {
- const relatedLinksCopy = [...relatedLinks];
- relatedLinksCopy.splice(index, 1);
- onChange(JSON.stringify(relatedLinksCopy));
- onCancelRelatedLink();
+ const relatedLinksCopy = [...relatedLinks]
+ relatedLinksCopy.splice(index, 1)
+ onChange(JSON.stringify(relatedLinksCopy))
+ onCancelRelatedLink()
}
- };
+ }
const onEditRelatedLink = (index: number) => {
if (onChange) {
- setIndex(index);
- setLabelValue(relatedLinks[index].label);
- setHrefValue(relatedLinks[index].href);
+ setIndex(index)
+ setLabelValue(relatedLinks[index].label)
+ setHrefValue(relatedLinks[index].href)
}
- };
+ }
const onUpdateRelatedLink = () => {
if (onChange && index !== null) {
- const relatedLinksCopy = [...relatedLinks];
- relatedLinksCopy[index] = { label: labelValue, href: hrefValue };
- onChange(JSON.stringify(relatedLinksCopy));
- onCancelRelatedLink();
+ const relatedLinksCopy = [...relatedLinks]
+ relatedLinksCopy[index] = { label: labelValue, href: hrefValue }
+ onChange(JSON.stringify(relatedLinksCopy))
+ onCancelRelatedLink()
}
- };
+ }
const onCancelRelatedLink = () => {
- setIndex(null);
- setLabelValue('');
- setHrefValue('');
- };
+ setIndex(null)
+ setLabelValue('')
+ setHrefValue('')
+ }
return (
@@ -186,9 +186,9 @@ export const Field = ({ field, value, onChange, autoFocus }: FieldProps
)}
- );
+ )
})}
- );
-};
+ )
+}
diff --git a/examples/custom-field-view/keystone.ts b/examples/custom-field-view/keystone.ts
index aebfcb74e9d..fe1bf98ab98 100644
--- a/examples/custom-field-view/keystone.ts
+++ b/examples/custom-field-view/keystone.ts
@@ -1,6 +1,6 @@
-import { config } from '@keystone-6/core';
-import { fixPrismaPath } from '../example-utils';
-import { lists } from './schema';
+import { config } from '@keystone-6/core'
+import { fixPrismaPath } from '../example-utils'
+import { lists } from './schema'
export default config({
db: {
@@ -11,4 +11,4 @@ export default config({
...fixPrismaPath,
},
lists,
-});
+})
diff --git a/examples/custom-field-view/schema.ts b/examples/custom-field-view/schema.ts
index 379be3347c7..b66f08e90a5 100644
--- a/examples/custom-field-view/schema.ts
+++ b/examples/custom-field-view/schema.ts
@@ -1,7 +1,7 @@
-import { list } from '@keystone-6/core';
-import { allowAll } from '@keystone-6/core/access';
-import { checkbox, relationship, text, timestamp } from '@keystone-6/core/fields';
-import { json, select } from '@keystone-6/core/fields';
+import { list } from '@keystone-6/core'
+import { allowAll } from '@keystone-6/core/access'
+import { checkbox, relationship, text, timestamp } from '@keystone-6/core/fields'
+import { json, select } from '@keystone-6/core/fields'
export const lists = {
Task: list({
@@ -37,4 +37,4 @@ export const lists = {
tasks: relationship({ ref: 'Task.assignedTo', many: true }),
},
}),
-};
+}
diff --git a/examples/custom-field/1-text-field/index.ts b/examples/custom-field/1-text-field/index.ts
index 16db501ae42..45b71871529 100644
--- a/examples/custom-field/1-text-field/index.ts
+++ b/examples/custom-field/1-text-field/index.ts
@@ -1,17 +1,17 @@
import {
- BaseListTypeInfo,
+ type BaseListTypeInfo,
fieldType,
- FieldTypeFunc,
- CommonFieldConfig,
+ type FieldTypeFunc,
+ type CommonFieldConfig,
orderDirectionEnum,
-} from '@keystone-6/core/types';
-import { graphql } from '@keystone-6/core';
+} from '@keystone-6/core/types'
+import { graphql } from '@keystone-6/core'
type TextFieldConfig = CommonFieldConfig & {
- isIndexed?: boolean | 'unique';
-};
+ isIndexed?: boolean | 'unique'
+}
-export function text({
+export function text ({
isIndexed,
...config
}: TextFieldConfig = {}): FieldTypeFunc {
@@ -27,8 +27,8 @@ export function text({
create: {
arg: graphql.arg({ type: graphql.String }),
// eslint-disable-next-line @typescript-eslint/no-unused-vars
- resolve(value, context) {
- return value;
+ resolve (value, context) {
+ return value
},
},
update: { arg: graphql.arg({ type: graphql.String }) },
@@ -37,13 +37,13 @@ export function text({
output: graphql.field({
type: graphql.String,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
- resolve({ value, item }, args, context, info) {
- return value;
+ resolve ({ value, item }, args, context, info) {
+ return value
},
}),
views: './1-text-field/views',
- getAdminMeta() {
- return {};
+ getAdminMeta () {
+ return {}
},
- });
+ })
}
diff --git a/examples/custom-field/1-text-field/views.tsx b/examples/custom-field/1-text-field/views.tsx
index d5329be875d..3d0c9a60322 100644
--- a/examples/custom-field/1-text-field/views.tsx
+++ b/examples/custom-field/1-text-field/views.tsx
@@ -1,17 +1,17 @@
-import React from 'react';
-import { FieldContainer, FieldDescription, FieldLabel, TextInput } from '@keystone-ui/fields';
-import { CellLink, CellContainer } from '@keystone-6/core/admin-ui/components';
+import React from 'react'
+import { FieldContainer, FieldDescription, FieldLabel, TextInput } from '@keystone-ui/fields'
+import { CellLink, CellContainer } from '@keystone-6/core/admin-ui/components'
import {
- CardValueComponent,
- CellComponent,
- FieldController,
- FieldControllerConfig,
- FieldProps,
-} from '@keystone-6/core/types';
+ type CardValueComponent,
+ type CellComponent,
+ type FieldController,
+ type FieldControllerConfig,
+ type FieldProps,
+} from '@keystone-6/core/types'
-export function Field({ field, value, onChange, autoFocus }: FieldProps) {
- const disabled = onChange === undefined;
+export function Field ({ field, value, onChange, autoFocus }: FieldProps) {
+ const disabled = onChange === undefined
return (
@@ -21,7 +21,7 @@ export function Field({ field, value, onChange, autoFocus }: FieldProps {
- onChange?.(event.target.value);
+ onChange?.(event.target.value)
}}
disabled={disabled}
value={value || ''}
@@ -29,14 +29,14 @@ export function Field({ field, value, onChange, autoFocus }: FieldProps
- );
+ )
}
export const Cell: CellComponent = ({ item, field, linkTo }) => {
- const value = item[field.path] + '';
- return linkTo ? {value} : {value} ;
-};
-Cell.supportsLinkTo = true;
+ const value = item[field.path] + ''
+ return linkTo ? {value} : {value}
+}
+Cell.supportsLinkTo = true
export const CardValue: CardValueComponent = ({ item, field }) => {
return (
@@ -44,8 +44,8 @@ export const CardValue: CardValueComponent = ({ item, field }) => {
{field.label}
{item[field.path]}
- );
-};
+ )
+}
export const controller = (
config: FieldControllerConfig<{}>
@@ -57,9 +57,9 @@ export const controller = (
graphqlSelection: config.path,
defaultValue: null,
deserialize: data => {
- const value = data[config.path];
- return typeof value === 'string' ? value : null;
+ const value = data[config.path]
+ return typeof value === 'string' ? value : null
},
serialize: value => ({ [config.path]: value }),
- };
-};
+ }
+}
diff --git a/examples/custom-field/2-stars-field/index.ts b/examples/custom-field/2-stars-field/index.ts
index 28178ae8f11..b586f4c5737 100644
--- a/examples/custom-field/2-stars-field/index.ts
+++ b/examples/custom-field/2-stars-field/index.ts
@@ -1,11 +1,11 @@
import {
- BaseListTypeInfo,
+ type BaseListTypeInfo,
fieldType,
- FieldTypeFunc,
- CommonFieldConfig,
+ type FieldTypeFunc,
+ type CommonFieldConfig,
orderDirectionEnum,
-} from '@keystone-6/core/types';
-import { graphql } from '@keystone-6/core';
+} from '@keystone-6/core/types'
+import { graphql } from '@keystone-6/core'
// this field is based on the integer field
// but with validation to ensure the value is within an expected range
@@ -13,9 +13,9 @@ import { graphql } from '@keystone-6/core';
// https://github.com/keystonejs/keystone/tree/main/packages/core/src/fields/types/integer
type StarsFieldConfig = CommonFieldConfig & {
- isIndexed?: boolean | 'unique';
- maxStars?: number;
-};
+ isIndexed?: boolean | 'unique'
+ maxStars?: number
+}
export const stars =
({
@@ -37,12 +37,12 @@ export const stars =
...config.hooks,
// We use the `validateInput` hook to ensure that the user doesn't set an out of range value.
// This hook is the key difference on the backend between the stars field type and the integer field type.
- async validateInput(args) {
- const val = args.resolvedData[meta.fieldKey];
+ async validateInput (args) {
+ const val = args.resolvedData[meta.fieldKey]
if (!(val == null || (val >= 0 && val <= maxStars))) {
- args.addValidationError(`The value must be within the range of 0-${maxStars}`);
+ args.addValidationError(`The value must be within the range of 0-${maxStars}`)
}
- await config.hooks?.validateInput?.(args);
+ await config.hooks?.validateInput?.(args)
},
},
// all of these inputs are optional if they don't make sense for a particular field type
@@ -53,20 +53,20 @@ export const stars =
// but field types can specify resolvers for inputs like they can for their output GraphQL field
// this function can be omitted, it is here purely to show how you could change it
// eslint-disable-next-line @typescript-eslint/no-unused-vars
- resolve(val, context) {
+ resolve (val, context) {
// if it's null, then the value will be set to null in the database
if (val === null) {
- return null;
+ return null
}
// if it's undefined(which means that it was omitted in the request)
// returning undefined will mean "don't change the existing value"
// note that this means that this function is called on every update to an item
// including when the field is not updated
if (val === undefined) {
- return undefined;
+ return undefined
}
// if it's not null or undefined, it must be a number
- return val;
+ return val
},
},
update: { arg: graphql.arg({ type: graphql.Int }) },
@@ -78,12 +78,12 @@ export const stars =
// like the input resolvers, providing the resolver is unnecessary if you're just returning the value
// it is shown here to show what you could do
// eslint-disable-next-line @typescript-eslint/no-unused-vars
- resolve({ value, item }, args, context, info) {
- return value;
+ resolve ({ value, item }, args, context, info) {
+ return value
},
}),
views: './2-stars-field/views',
- getAdminMeta() {
- return { maxStars };
+ getAdminMeta () {
+ return { maxStars }
},
- });
+ })
diff --git a/examples/custom-field/2-stars-field/stars-input.tsx b/examples/custom-field/2-stars-field/stars-input.tsx
index 6d621ca175b..4c5c97beadb 100644
--- a/examples/custom-field/2-stars-field/stars-input.tsx
+++ b/examples/custom-field/2-stars-field/stars-input.tsx
@@ -1,13 +1,13 @@
-import React from 'react';
+import React from 'react'
type StarsInputProps = {
- value: number | null;
- onChange?: (value: number | null) => void;
- maxStars: number;
- autoFocus?: boolean;
-};
+ value: number | null
+ onChange?: (value: number | null) => void
+ maxStars: number
+ autoFocus?: boolean
+}
-export function StarsInput(props: StarsInputProps) {
+export function StarsInput (props: StarsInputProps) {
return (
@@ -18,7 +18,7 @@ export function StarsInput(props: StarsInputProps) {
disabled={props.onChange === undefined}
checked={props.value === 0}
onChange={() => {
- props.onChange?.(0);
+ props.onChange?.(0)
}}
/>
0 Stars
@@ -27,7 +27,7 @@ export function StarsInput(props: StarsInputProps) {
{Array.from({
length: props.maxStars,
}).map((_, i) => {
- const star = i + 1;
+ const star = i + 1
return (
@@ -36,14 +36,14 @@ export function StarsInput(props: StarsInputProps) {
checked={props.value === star}
disabled={props.onChange === undefined}
onChange={() => {
- props.onChange?.(star);
+ props.onChange?.(star)
}}
/>
{props.value !== null && props.value >= star ? fullStar : emptyStar}
{star} Star{star === 1 ? '' : 's'}
- );
+ )
})}
@@ -52,14 +52,14 @@ export function StarsInput(props: StarsInputProps) {
checked={props.value === null}
disabled={props.onChange === undefined}
onChange={() => {
- props.onChange?.(null);
+ props.onChange?.(null)
}}
/>
No selection
- );
+ )
}
const fullStar = (
@@ -71,7 +71,7 @@ const fullStar = (
d="M22 30.972L10.244 39.18l4.175-13.717-11.44-8.643 14.335-.27L22 3l4.686 13.55 14.335.27-11.44 8.643 4.175 13.717z"
/>
-);
+)
const emptyStar = (
@@ -82,4 +82,4 @@ const emptyStar = (
d="M22 30.972L10.244 39.18l4.175-13.717-11.44-8.643 14.335-.27L22 3l4.686 13.55 14.335.27-11.44 8.643 4.175 13.717z"
/>
-);
+)
diff --git a/examples/custom-field/2-stars-field/views.tsx b/examples/custom-field/2-stars-field/views.tsx
index a4d0e578ea4..a93dac82d5b 100644
--- a/examples/custom-field/2-stars-field/views.tsx
+++ b/examples/custom-field/2-stars-field/views.tsx
@@ -1,15 +1,15 @@
-import React from 'react';
-import { FieldContainer, FieldDescription, FieldLabel } from '@keystone-ui/fields';
-import { CellLink, CellContainer } from '@keystone-6/core/admin-ui/components';
+import React from 'react'
+import { FieldContainer, FieldDescription, FieldLabel } from '@keystone-ui/fields'
+import { CellLink, CellContainer } from '@keystone-6/core/admin-ui/components'
import {
- CardValueComponent,
- CellComponent,
- FieldController,
- FieldControllerConfig,
- FieldProps,
-} from '@keystone-6/core/types';
-import { StarsInput } from './stars-input';
+ type CardValueComponent,
+ type CellComponent,
+ type FieldController,
+ type FieldControllerConfig,
+ type FieldProps,
+} from '@keystone-6/core/types'
+import { StarsInput } from './stars-input'
// this is the component shown in the create modal and item page
export const Field = ({ field, value, onChange, autoFocus }: FieldProps
) => (
@@ -18,17 +18,17 @@ export const Field = ({ field, value, onChange, autoFocus }: FieldProps{field.description}
-);
+)
// this is shown on the list view in the table
export const Cell: CellComponent = ({ item, field, linkTo }) => {
- let value = item[field.path] + '';
- return linkTo ? {value} : {value} ;
-};
+ let value = item[field.path] + ''
+ return linkTo ? {value} : {value}
+}
// setting supportsLinksTo means the cell component allows containing a link to the item
// for example, text fields support it but relationship fields don't because
// their cell component links to the related item so it can't link to the item that the relationship is on
-Cell.supportsLinkTo = true;
+Cell.supportsLinkTo = true
// this is shown on the item page in relationship fields with `displayMode: 'cards'`
export const CardValue: CardValueComponent = ({ item, field }) => {
@@ -37,8 +37,8 @@ export const CardValue: CardValueComponent = ({ item, field }) => {
{field.label}
{item[field.path]}
- );
-};
+ )
+}
export const controller = (
// the type parameter here needs to align with what is returned from `getAdminMeta`
@@ -53,9 +53,9 @@ export const controller = (
graphqlSelection: config.path,
defaultValue: null,
deserialize: data => {
- const value = data[config.path];
- return typeof value === 'number' ? value : null;
+ const value = data[config.path]
+ return typeof value === 'number' ? value : null
},
serialize: value => ({ [config.path]: value }),
- };
-};
+ }
+}
diff --git a/examples/custom-field/3-pair-field-json/index.ts b/examples/custom-field/3-pair-field-json/index.ts
index 3a5fad3961e..6ed0c0b35f5 100644
--- a/examples/custom-field/3-pair-field-json/index.ts
+++ b/examples/custom-field/3-pair-field-json/index.ts
@@ -1,18 +1,18 @@
import {
- BaseListTypeInfo,
+ type BaseListTypeInfo,
fieldType,
- FieldTypeFunc,
- CommonFieldConfig,
-} from '@keystone-6/core/types';
-import { graphql } from '@keystone-6/core';
+ type FieldTypeFunc,
+ type CommonFieldConfig,
+} from '@keystone-6/core/types'
+import { graphql } from '@keystone-6/core'
-type PairFieldConfig = CommonFieldConfig;
+type PairFieldConfig = CommonFieldConfig
type PairInput = {
- left: string | null | undefined;
- right: string | null | undefined;
-};
-type PairOutput = PairInput;
+ left: string | null | undefined
+ right: string | null | undefined
+}
+type PairOutput = PairInput
const PairInput = graphql.inputObject({
name: 'PairJsonInput',
@@ -20,7 +20,7 @@ const PairInput = graphql.inputObject({
left: graphql.arg({ type: graphql.String }),
right: graphql.arg({ type: graphql.String }),
},
-});
+})
const PairOutput = graphql.object()({
name: 'PairJsonOutput',
@@ -28,7 +28,7 @@ const PairOutput = graphql.object()({
left: graphql.field({ type: graphql.String }),
right: graphql.field({ type: graphql.String }),
},
-});
+})
const PairFilter = graphql.inputObject({
name: 'PairJsonFilter',
@@ -37,31 +37,31 @@ const PairFilter = graphql.inputObject({
type: PairInput,
}),
},
-});
+})
-export function pair(
+export function pair (
config: PairFieldConfig = {}
): FieldTypeFunc {
- function resolveInput(value: PairInput | null | undefined) {
- if (value === undefined) return undefined;
- const { left = null, right = null } = value ?? {};
- return JSON.stringify({ left, right });
+ function resolveInput (value: PairInput | null | undefined) {
+ if (value === undefined) return undefined
+ const { left = null, right = null } = value ?? {}
+ return JSON.stringify({ left, right })
}
- function resolveOutput(value: string | null) {
- if (value === null) return { left: null, right: null };
- return JSON.parse(value) as PairOutput;
+ function resolveOutput (value: string | null) {
+ if (value === null) return { left: null, right: null }
+ return JSON.parse(value) as PairOutput
}
- function resolveWhere(value: null | { equals: PairInput | null | undefined }) {
+ function resolveWhere (value: null | { equals: PairInput | null | undefined }) {
if (value === null) {
- throw new Error('PairFilter cannot be null');
+ throw new Error('PairFilter cannot be null')
}
if (value.equals === undefined) {
- return {};
+ return {}
}
- const json = resolveInput(value.equals);
- return { equals: json };
+ const json = resolveInput(value.equals)
+ return { equals: json }
}
return meta =>
@@ -76,32 +76,32 @@ export function pair(
input: {
where: {
arg: graphql.arg({ type: PairFilter }),
- resolve(value, context) {
- return resolveWhere(value);
+ resolve (value, context) {
+ return resolveWhere(value)
},
},
create: {
arg: graphql.arg({ type: PairInput }),
- resolve(value, context) {
- return resolveInput(value);
+ resolve (value, context) {
+ return resolveInput(value)
},
},
update: {
arg: graphql.arg({ type: PairInput }),
- resolve(value, context) {
- return resolveInput(value);
+ resolve (value, context) {
+ return resolveInput(value)
},
},
},
output: graphql.field({
type: PairOutput,
- resolve({ value, item }, args, context, info) {
- return resolveOutput(value);
+ resolve ({ value, item }, args, context, info) {
+ return resolveOutput(value)
},
}),
views: './3-pair-field-json/views',
- getAdminMeta() {
- return {};
+ getAdminMeta () {
+ return {}
},
- });
+ })
}
diff --git a/examples/custom-field/3-pair-field-json/views.tsx b/examples/custom-field/3-pair-field-json/views.tsx
index 3a14fb8e5ae..4f464a2fe81 100644
--- a/examples/custom-field/3-pair-field-json/views.tsx
+++ b/examples/custom-field/3-pair-field-json/views.tsx
@@ -1,18 +1,18 @@
-import React from 'react';
-import { FieldContainer, FieldDescription, FieldLabel, TextInput } from '@keystone-ui/fields';
-import { CellLink, CellContainer } from '@keystone-6/core/admin-ui/components';
+import React from 'react'
+import { FieldContainer, FieldDescription, FieldLabel, TextInput } from '@keystone-ui/fields'
+import { CellLink, CellContainer } from '@keystone-6/core/admin-ui/components'
import {
- CardValueComponent,
- CellComponent,
- FieldController,
- FieldControllerConfig,
- FieldProps,
-} from '@keystone-6/core/types';
+ type CardValueComponent,
+ type CellComponent,
+ type FieldController,
+ type FieldControllerConfig,
+ type FieldProps,
+} from '@keystone-6/core/types'
-export function Field({ field, value, onChange, autoFocus }: FieldProps) {
- const disabled = onChange === undefined;
- const { left = null, right = null } = value ?? {};
+export function Field ({ field, value, onChange, autoFocus }: FieldProps) {
+ const disabled = onChange === undefined
+ const { left = null, right = null } = value ?? {}
return (
<>
@@ -25,7 +25,7 @@ export function Field({ field, value, onChange, autoFocus }: FieldProps {
- onChange?.({ left: event.target.value, right });
+ onChange?.({ left: event.target.value, right })
}}
disabled={disabled}
value={left || ''}
@@ -42,7 +42,7 @@ export function Field({ field, value, onChange, autoFocus }: FieldProps {
- onChange?.({ left, right: event.target.value });
+ onChange?.({ left, right: event.target.value })
}}
disabled={disabled}
value={right || ''}
@@ -51,14 +51,14 @@ export function Field({ field, value, onChange, autoFocus }: FieldProps
>
- );
+ )
}
export const Cell: CellComponent = ({ item, field, linkTo }) => {
- let value = item[field.path] + '';
- return linkTo ? {value} : {value} ;
-};
-Cell.supportsLinkTo = true;
+ let value = item[field.path] + ''
+ return linkTo ? {value} : {value}
+}
+Cell.supportsLinkTo = true
export const CardValue: CardValueComponent = ({ item, field }) => {
return (
@@ -66,15 +66,15 @@ export const CardValue: CardValueComponent = ({ item, field }) => {
{field.label}
{item[field.path]}
- );
-};
+ )
+}
export const controller = (
config: FieldControllerConfig<{}>
): FieldController<
{
- left: string | null;
- right: string | null;
+ left: string | null
+ right: string | null
} | null,
string
> => {
@@ -88,9 +88,9 @@ export const controller = (
}`,
defaultValue: null,
deserialize: data => {
- const value = data[config.path];
- return typeof value === 'object' ? value : null;
+ const value = data[config.path]
+ return typeof value === 'object' ? value : null
},
serialize: value => ({ [config.path]: value }),
- };
-};
+ }
+}
diff --git a/examples/custom-field/3-pair-field-nested/index.ts b/examples/custom-field/3-pair-field-nested/index.ts
index 01d7a20fb9b..c5fb98d918a 100644
--- a/examples/custom-field/3-pair-field-nested/index.ts
+++ b/examples/custom-field/3-pair-field-nested/index.ts
@@ -1,18 +1,18 @@
import {
- BaseListTypeInfo,
+ type BaseListTypeInfo,
fieldType,
- FieldTypeFunc,
- CommonFieldConfig,
-} from '@keystone-6/core/types';
-import { graphql } from '@keystone-6/core';
+ type FieldTypeFunc,
+ type CommonFieldConfig,
+} from '@keystone-6/core/types'
+import { graphql } from '@keystone-6/core'
-type PairFieldConfig = CommonFieldConfig;
+type PairFieldConfig = CommonFieldConfig
type PairInput = {
- left: string | null | undefined;
- right: string | null | undefined;
-};
-type PairOutput = PairInput;
+ left: string | null | undefined
+ right: string | null | undefined
+}
+type PairOutput = PairInput
const PairInput = graphql.inputObject({
name: 'PairNestedInput',
@@ -20,7 +20,7 @@ const PairInput = graphql.inputObject({
left: graphql.arg({ type: graphql.String }),
right: graphql.arg({ type: graphql.String }),
},
-});
+})
const PairOutput = graphql.object()({
name: 'PairNestedOutput',
@@ -28,7 +28,7 @@ const PairOutput = graphql.object()({
left: graphql.field({ type: graphql.String }),
right: graphql.field({ type: graphql.String }),
},
-});
+})
const PairFilter = graphql.inputObject({
name: 'PairNestedFilter',
@@ -37,33 +37,33 @@ const PairFilter = graphql.inputObject({
type: PairInput,
}),
},
-});
+})
-export function pair(
+export function pair (
config: PairFieldConfig = {}
): FieldTypeFunc {
- function resolveInput(value: PairInput | null | undefined) {
- if (!value) return { left: value, right: value };
- const { left = null, right = null } = value ?? {};
- return { left, right };
+ function resolveInput (value: PairInput | null | undefined) {
+ if (!value) return { left: value, right: value }
+ const { left = null, right = null } = value ?? {}
+ return { left, right }
}
- function resolveOutput(value: PairOutput) {
- return value;
+ function resolveOutput (value: PairOutput) {
+ return value
}
- function resolveWhere(value: null | { equals: PairInput | null | undefined }) {
+ function resolveWhere (value: null | { equals: PairInput | null | undefined }) {
if (value === null) {
- throw new Error('PairFilter cannot be null');
+ throw new Error('PairFilter cannot be null')
}
if (value.equals === undefined) {
- return {};
+ return {}
}
- const { left, right } = resolveInput(value.equals);
+ const { left, right } = resolveInput(value.equals)
return {
left: { equals: left },
right: { equals: right },
- };
+ }
}
return meta =>
@@ -86,32 +86,32 @@ export function pair(
input: {
where: {
arg: graphql.arg({ type: PairFilter }),
- resolve(value, context) {
- return resolveWhere(value);
+ resolve (value, context) {
+ return resolveWhere(value)
},
},
create: {
arg: graphql.arg({ type: PairInput }),
- resolve(value, context) {
- return resolveInput(value);
+ resolve (value, context) {
+ return resolveInput(value)
},
},
update: {
arg: graphql.arg({ type: PairInput }),
- resolve(value, context) {
- return resolveInput(value);
+ resolve (value, context) {
+ return resolveInput(value)
},
},
},
output: graphql.field({
type: PairOutput,
- resolve({ value, item }, args, context, info) {
- return resolveOutput(value);
+ resolve ({ value, item }, args, context, info) {
+ return resolveOutput(value)
},
}),
views: './3-pair-field-nested/views',
- getAdminMeta() {
- return {};
+ getAdminMeta () {
+ return {}
},
- });
+ })
}
diff --git a/examples/custom-field/3-pair-field-nested/views.tsx b/examples/custom-field/3-pair-field-nested/views.tsx
index 3a14fb8e5ae..4f464a2fe81 100644
--- a/examples/custom-field/3-pair-field-nested/views.tsx
+++ b/examples/custom-field/3-pair-field-nested/views.tsx
@@ -1,18 +1,18 @@
-import React from 'react';
-import { FieldContainer, FieldDescription, FieldLabel, TextInput } from '@keystone-ui/fields';
-import { CellLink, CellContainer } from '@keystone-6/core/admin-ui/components';
+import React from 'react'
+import { FieldContainer, FieldDescription, FieldLabel, TextInput } from '@keystone-ui/fields'
+import { CellLink, CellContainer } from '@keystone-6/core/admin-ui/components'
import {
- CardValueComponent,
- CellComponent,
- FieldController,
- FieldControllerConfig,
- FieldProps,
-} from '@keystone-6/core/types';
+ type CardValueComponent,
+ type CellComponent,
+ type FieldController,
+ type FieldControllerConfig,
+ type FieldProps,
+} from '@keystone-6/core/types'
-export function Field({ field, value, onChange, autoFocus }: FieldProps) {
- const disabled = onChange === undefined;
- const { left = null, right = null } = value ?? {};
+export function Field ({ field, value, onChange, autoFocus }: FieldProps) {
+ const disabled = onChange === undefined
+ const { left = null, right = null } = value ?? {}
return (
<>
@@ -25,7 +25,7 @@ export function Field({ field, value, onChange, autoFocus }: FieldProps {
- onChange?.({ left: event.target.value, right });
+ onChange?.({ left: event.target.value, right })
}}
disabled={disabled}
value={left || ''}
@@ -42,7 +42,7 @@ export function Field({ field, value, onChange, autoFocus }: FieldProps {
- onChange?.({ left, right: event.target.value });
+ onChange?.({ left, right: event.target.value })
}}
disabled={disabled}
value={right || ''}
@@ -51,14 +51,14 @@ export function Field({ field, value, onChange, autoFocus }: FieldProps
>
- );
+ )
}
export const Cell: CellComponent = ({ item, field, linkTo }) => {
- let value = item[field.path] + '';
- return linkTo ? {value} : {value} ;
-};
-Cell.supportsLinkTo = true;
+ let value = item[field.path] + ''
+ return linkTo ? {value} : {value}
+}
+Cell.supportsLinkTo = true
export const CardValue: CardValueComponent = ({ item, field }) => {
return (
@@ -66,15 +66,15 @@ export const CardValue: CardValueComponent = ({ item, field }) => {
{field.label}
{item[field.path]}
- );
-};
+ )
+}
export const controller = (
config: FieldControllerConfig<{}>
): FieldController<
{
- left: string | null;
- right: string | null;
+ left: string | null
+ right: string | null
} | null,
string
> => {
@@ -88,9 +88,9 @@ export const controller = (
}`,
defaultValue: null,
deserialize: data => {
- const value = data[config.path];
- return typeof value === 'object' ? value : null;
+ const value = data[config.path]
+ return typeof value === 'object' ? value : null
},
serialize: value => ({ [config.path]: value }),
- };
-};
+ }
+}
diff --git a/examples/custom-field/3-pair-field/index.ts b/examples/custom-field/3-pair-field/index.ts
index 5f61133201e..86a683b757e 100644
--- a/examples/custom-field/3-pair-field/index.ts
+++ b/examples/custom-field/3-pair-field/index.ts
@@ -1,56 +1,56 @@
import {
- BaseListTypeInfo,
+ type BaseListTypeInfo,
fieldType,
- FieldTypeFunc,
- CommonFieldConfig,
-} from '@keystone-6/core/types';
-import { graphql } from '@keystone-6/core';
+ type FieldTypeFunc,
+ type CommonFieldConfig,
+} from '@keystone-6/core/types'
+import { graphql } from '@keystone-6/core'
-type PairFieldConfig = CommonFieldConfig;
+type PairFieldConfig = CommonFieldConfig
-type PairInput = string;
-type PairOutput = string;
+type PairInput = string
+type PairOutput = string
-const PairInput = graphql.String;
-const PairOutput = graphql.String;
+const PairInput = graphql.String
+const PairOutput = graphql.String
const PairFilter = graphql.inputObject({
name: 'PairFilter',
fields: {
equals: graphql.arg({ type: graphql.String }),
},
-});
+})
-export function pair(
+export function pair (
config: PairFieldConfig = {}
): FieldTypeFunc {
- function resolveInput(value: PairInput | null | undefined) {
- if (!value) return { left: value, right: value };
- const [left = '', right = ''] = value.split(' ', 2);
+ function resolveInput (value: PairInput | null | undefined) {
+ if (!value) return { left: value, right: value }
+ const [left = '', right = ''] = value.split(' ', 2)
return {
left,
right,
- };
+ }
}
- function resolveOutput(value: { left: string | null; right: string | null }) {
- const { left, right } = value;
- if (left === null || right === null) return null;
- return `${left} ${right}`;
+ function resolveOutput (value: { left: string | null, right: string | null }) {
+ const { left, right } = value
+ if (left === null || right === null) return null
+ return `${left} ${right}`
}
- function resolveWhere(value: null | { equals: string | null | undefined }) {
+ function resolveWhere (value: null | { equals: string | null | undefined }) {
if (value === null) {
- throw new Error('PairFilter cannot be null');
+ throw new Error('PairFilter cannot be null')
}
if (value.equals === undefined) {
- return {};
+ return {}
}
- const { left, right } = resolveInput(value.equals);
+ const { left, right } = resolveInput(value.equals)
return {
left: { equals: left },
right: { equals: right },
- };
+ }
}
return meta =>
@@ -73,32 +73,32 @@ export function pair(
input: {
where: {
arg: graphql.arg({ type: PairFilter }),
- resolve(value, context) {
- return resolveWhere(value);
+ resolve (value, context) {
+ return resolveWhere(value)
},
},
create: {
arg: graphql.arg({ type: PairInput }),
- resolve(value, context) {
- return resolveInput(value);
+ resolve (value, context) {
+ return resolveInput(value)
},
},
update: {
arg: graphql.arg({ type: PairInput }),
- resolve(value, context) {
- return resolveInput(value);
+ resolve (value, context) {
+ return resolveInput(value)
},
},
},
output: graphql.field({
type: PairOutput,
- resolve({ value, item }, args, context, info) {
- return resolveOutput(value);
+ resolve ({ value, item }, args, context, info) {
+ return resolveOutput(value)
},
}),
views: './3-pair-field/views',
- getAdminMeta() {
- return {};
+ getAdminMeta () {
+ return {}
},
- });
+ })
}
diff --git a/examples/custom-field/3-pair-field/views.tsx b/examples/custom-field/3-pair-field/views.tsx
index 9ebc19076be..4ad1ec86f02 100644
--- a/examples/custom-field/3-pair-field/views.tsx
+++ b/examples/custom-field/3-pair-field/views.tsx
@@ -1,17 +1,17 @@
-import React from 'react';
-import { FieldContainer, FieldDescription, FieldLabel, TextInput } from '@keystone-ui/fields';
-import { CellLink, CellContainer } from '@keystone-6/core/admin-ui/components';
+import React from 'react'
+import { FieldContainer, FieldDescription, FieldLabel, TextInput } from '@keystone-ui/fields'
+import { CellLink, CellContainer } from '@keystone-6/core/admin-ui/components'
import {
- CardValueComponent,
- CellComponent,
- FieldController,
- FieldControllerConfig,
- FieldProps,
-} from '@keystone-6/core/types';
+ type CardValueComponent,
+ type CellComponent,
+ type FieldController,
+ type FieldControllerConfig,
+ type FieldProps,
+} from '@keystone-6/core/types'
-export function Field({ field, value, onChange, autoFocus }: FieldProps) {
- const disabled = onChange === undefined;
+export function Field ({ field, value, onChange, autoFocus }: FieldProps) {
+ const disabled = onChange === undefined
return (
@@ -21,7 +21,7 @@ export function Field({ field, value, onChange, autoFocus }: FieldProps {
- onChange?.(event.target.value);
+ onChange?.(event.target.value)
}}
disabled={disabled}
value={value || ''}
@@ -29,14 +29,14 @@ export function Field({ field, value, onChange, autoFocus }: FieldProps
- );
+ )
}
export const Cell: CellComponent = ({ item, field, linkTo }) => {
- let value = item[field.path] + '';
- return linkTo ? {value} : {value} ;
-};
-Cell.supportsLinkTo = true;
+ let value = item[field.path] + ''
+ return linkTo ? {value} : {value}
+}
+Cell.supportsLinkTo = true
export const CardValue: CardValueComponent = ({ item, field }) => {
return (
@@ -44,8 +44,8 @@ export const CardValue: CardValueComponent = ({ item, field }) => {
{field.label}
{item[field.path]}
- );
-};
+ )
+}
export const controller = (
config: FieldControllerConfig<{}>
@@ -57,9 +57,9 @@ export const controller = (
graphqlSelection: config.path,
defaultValue: null,
deserialize: data => {
- const value = data[config.path];
- return typeof value === 'string' ? value : null;
+ const value = data[config.path]
+ return typeof value === 'string' ? value : null
},
serialize: value => ({ [config.path]: value }),
- };
-};
+ }
+}
diff --git a/examples/custom-field/4-conditional-field/index.tsx b/examples/custom-field/4-conditional-field/index.tsx
index 09ec6f93818..624412ba456 100644
--- a/examples/custom-field/4-conditional-field/index.tsx
+++ b/examples/custom-field/4-conditional-field/index.tsx
@@ -1,21 +1,21 @@
import {
- BaseListTypeInfo,
+ type BaseListTypeInfo,
fieldType,
- FieldTypeFunc,
- CommonFieldConfig,
+ type FieldTypeFunc,
+ type CommonFieldConfig,
orderDirectionEnum,
-} from '@keystone-6/core/types';
-import { graphql } from '@keystone-6/core';
+} from '@keystone-6/core/types'
+import { graphql } from '@keystone-6/core'
type TextFieldConfig = CommonFieldConfig & {
- isIndexed?: boolean | 'unique';
+ isIndexed?: boolean | 'unique'
dependency: {
- field: string;
- minimumValue: number;
- };
-};
+ field: string
+ minimumValue: number
+ }
+}
-export function feedback({
+export function feedback ({
isIndexed,
dependency,
...config
@@ -32,8 +32,8 @@ export function feedback({
create: {
arg: graphql.arg({ type: graphql.String }),
// eslint-disable-next-line @typescript-eslint/no-unused-vars
- resolve(value, context) {
- return value;
+ resolve (value, context) {
+ return value
},
},
update: { arg: graphql.arg({ type: graphql.String }) },
@@ -42,15 +42,15 @@ export function feedback({
output: graphql.field({
type: graphql.String,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
- resolve({ value, item }, args, context, info) {
- return value;
+ resolve ({ value, item }, args, context, info) {
+ return value
},
}),
views: './4-conditional-field/views',
- getAdminMeta() {
+ getAdminMeta () {
return {
dependency,
- };
+ }
},
- });
+ })
}
diff --git a/examples/custom-field/4-conditional-field/views.tsx b/examples/custom-field/4-conditional-field/views.tsx
index 3ab51d3434e..0c50f1b5f93 100644
--- a/examples/custom-field/4-conditional-field/views.tsx
+++ b/examples/custom-field/4-conditional-field/views.tsx
@@ -1,32 +1,32 @@
-import React, { useEffect } from 'react';
-import { FieldContainer, FieldDescription, FieldLabel, TextInput } from '@keystone-ui/fields';
-import { CellLink, CellContainer } from '@keystone-6/core/admin-ui/components';
+import React, { useEffect } from 'react'
+import { FieldContainer, FieldDescription, FieldLabel, TextInput } from '@keystone-ui/fields'
+import { CellLink, CellContainer } from '@keystone-6/core/admin-ui/components'
import {
- CardValueComponent,
- CellComponent,
- FieldController,
- FieldControllerConfig,
- FieldProps,
-} from '@keystone-6/core/types';
+ type CardValueComponent,
+ type CellComponent,
+ type FieldController,
+ type FieldControllerConfig,
+ type FieldProps,
+} from '@keystone-6/core/types'
-export function Field({
+export function Field ({
field,
value,
itemValue,
onChange,
autoFocus,
}: FieldProps) {
- const discriminant = (itemValue as any)?.[field.dependency.field]?.value ?? Infinity;
- const hidden = discriminant > field.dependency.minimumValue;
+ const discriminant = (itemValue as any)?.[field.dependency.field]?.value ?? Infinity
+ const hidden = discriminant > field.dependency.minimumValue
useEffect(() => {
- if (hidden) onChange?.('');
- }, [onChange, hidden]);
+ if (hidden) onChange?.('')
+ }, [onChange, hidden])
- if (hidden) return null;
+ if (hidden) return null
- const disabled = onChange === undefined;
+ const disabled = onChange === undefined
return (
{field.label}
@@ -35,7 +35,7 @@ export function Field({
{
- onChange?.(event.target.value);
+ onChange?.(event.target.value)
}}
disabled={disabled}
value={value || ''}
@@ -43,14 +43,14 @@ export function Field({
/>
- );
+ )
}
export const Cell: CellComponent = ({ item, field, linkTo }) => {
- const value = item[field.path] + '';
- return linkTo ? {value} : {value} ;
-};
-Cell.supportsLinkTo = true;
+ const value = item[field.path] + ''
+ return linkTo ? {value} : {value}
+}
+Cell.supportsLinkTo = true
export const CardValue: CardValueComponent = ({ item, field }) => {
return (
@@ -58,21 +58,21 @@ export const CardValue: CardValueComponent = ({ item, field }) => {
{field.label}
{item[field.path]}
- );
-};
+ )
+}
export const controller = (
config: FieldControllerConfig<{
dependency: {
- field: string;
- minimumValue: number;
- };
+ field: string
+ minimumValue: number
+ }
}>
): FieldController & {
dependency: {
- field: string;
- minimumValue: number;
- };
+ field: string
+ minimumValue: number
+ }
} => {
return {
path: config.path,
@@ -82,9 +82,9 @@ export const controller = (
graphqlSelection: config.path,
defaultValue: null,
deserialize: data => {
- const value = data[config.path];
- return typeof value === 'string' ? value : null;
+ const value = data[config.path]
+ return typeof value === 'string' ? value : null
},
serialize: value => ({ [config.path]: value }),
- };
-};
+ }
+}
diff --git a/examples/custom-field/keystone.ts b/examples/custom-field/keystone.ts
index 2cbda129b21..a735710d7a0 100644
--- a/examples/custom-field/keystone.ts
+++ b/examples/custom-field/keystone.ts
@@ -1,7 +1,7 @@
-import { config } from '@keystone-6/core';
-import { fixPrismaPath } from '../example-utils';
-import { lists } from './schema';
-import type { TypeInfo } from '.keystone/types';
+import { config } from '@keystone-6/core'
+import { fixPrismaPath } from '../example-utils'
+import { lists } from './schema'
+import type { TypeInfo } from '.keystone/types'
export default config({
db: {
@@ -12,4 +12,4 @@ export default config({
...fixPrismaPath,
},
lists,
-});
+})
diff --git a/examples/custom-field/schema.ts b/examples/custom-field/schema.ts
index 7d205eb715b..777785a9db4 100644
--- a/examples/custom-field/schema.ts
+++ b/examples/custom-field/schema.ts
@@ -1,14 +1,14 @@
-import { list } from '@keystone-6/core';
+import { list } from '@keystone-6/core'
-import { allowAll } from '@keystone-6/core/access';
-import { text } from './1-text-field';
-import { stars } from './2-stars-field';
-import { pair } from './3-pair-field';
-import { pair as pairNested } from './3-pair-field-nested';
-import { pair as pairJson } from './3-pair-field-json';
-import { feedback } from './4-conditional-field';
+import { allowAll } from '@keystone-6/core/access'
+import { text } from './1-text-field'
+import { stars } from './2-stars-field'
+import { pair } from './3-pair-field'
+import { pair as pairNested } from './3-pair-field-nested'
+import { pair as pairJson } from './3-pair-field-json'
+import { feedback } from './4-conditional-field'
-import type { Lists } from '.keystone/types';
+import type { Lists } from '.keystone/types'
export const lists: Lists = {
Post: list({
@@ -27,8 +27,8 @@ export const lists: Lists = {
inputData,
item,
fieldKey,
- });
- return resolvedData[fieldKey];
+ })
+ return resolvedData[fieldKey]
},
validateInput: async ({
@@ -43,7 +43,7 @@ export const lists: Lists = {
inputData,
item,
fieldKey,
- });
+ })
},
},
}),
@@ -89,24 +89,24 @@ export const lists: Lists = {
operation,
inputData,
item,
- });
+ })
return {
...resolvedData,
pair: {
left: resolvedData.pair?.left ?? null,
right: resolvedData.pair?.right ?? null,
},
- };
+ }
},
},
validateInput: async ({ resolvedData, operation, inputData, item, addValidationError }) => {
- console.log('Post.hooks.validateInput', { resolvedData, operation, inputData, item });
+ console.log('Post.hooks.validateInput', { resolvedData, operation, inputData, item })
if (Math.random() > 0.95) {
- addValidationError('oh oh, try again, this is part of the example');
+ addValidationError('oh oh, try again, this is part of the example')
}
},
},
}),
-};
+}
diff --git a/examples/custom-id/keystone.ts b/examples/custom-id/keystone.ts
index 56727bf8e58..4d93784ca70 100644
--- a/examples/custom-id/keystone.ts
+++ b/examples/custom-id/keystone.ts
@@ -1,6 +1,6 @@
-import { config } from '@keystone-6/core';
-import { fixPrismaPath } from '../example-utils';
-import { lists } from './schema';
+import { config } from '@keystone-6/core'
+import { fixPrismaPath } from '../example-utils'
+import { lists } from './schema'
export default config({
db: {
@@ -14,4 +14,4 @@ export default config({
...fixPrismaPath,
},
lists,
-});
+})
diff --git a/examples/custom-id/schema.ts b/examples/custom-id/schema.ts
index 8375bd91334..1748f06e078 100644
--- a/examples/custom-id/schema.ts
+++ b/examples/custom-id/schema.ts
@@ -1,11 +1,11 @@
-import { list } from '@keystone-6/core';
-import { allowAll } from '@keystone-6/core/access';
-import { relationship, text, timestamp } from '@keystone-6/core/fields';
-import { createId } from '@paralleldrive/cuid2';
-import type { Lists } from '.keystone/types';
+import { list } from '@keystone-6/core'
+import { allowAll } from '@keystone-6/core/access'
+import { relationship, text, timestamp } from '@keystone-6/core/fields'
+import { createId } from '@paralleldrive/cuid2'
+import type { Lists } from '.keystone/types'
-function makeCustomIdentifier(listKey: string) {
- return `${listKey.toUpperCase()}_${createId()}`;
+function makeCustomIdentifier (listKey: string) {
+ return `${listKey.toUpperCase()}_${createId()}`
}
export const lists: Lists = {
@@ -43,9 +43,9 @@ export const lists: Lists = {
hooks: {
resolveInput: {
create: async ({ listKey, operation, resolvedData }) => {
- return { ...resolvedData, id: makeCustomIdentifier(listKey) };
+ return { ...resolvedData, id: makeCustomIdentifier(listKey) }
},
},
},
}),
-};
+}
diff --git a/examples/custom-id/seed-data.tsx b/examples/custom-id/seed-data.tsx
index 3b17d019868..890bb439e28 100644
--- a/examples/custom-id/seed-data.tsx
+++ b/examples/custom-id/seed-data.tsx
@@ -1,12 +1,12 @@
-import { getContext } from '@keystone-6/core/context';
-import { persons, tasks } from '../example-data';
-import config from './keystone';
-import * as PrismaModule from '.myprisma/client';
+import { getContext } from '@keystone-6/core/context'
+import { persons, tasks } from '../example-data'
+import config from './keystone'
+import * as PrismaModule from '.myprisma/client'
-export async function main() {
- const context = getContext(config, PrismaModule);
+export async function main () {
+ const context = getContext(config, PrismaModule)
- console.log(`🌱 Inserting seed data`);
+ console.log(`🌱 Inserting seed data`)
for (const person of persons) {
if (
await context.query.Person.findOne({
@@ -14,34 +14,34 @@ export async function main() {
query: 'id',
})
) {
- console.log(`👩 Found ${person.name}`);
- continue;
+ console.log(`👩 Found ${person.name}`)
+ continue
}
- console.log(`👩 Adding person: ${person.name}`);
+ console.log(`👩 Adding person: ${person.name}`)
await context.query.Person.createOne({
data: person,
query: 'id',
- });
+ })
}
for (const task of tasks) {
- console.log(`🔘 Adding task: ${task.label}`);
+ console.log(`🔘 Adding task: ${task.label}`)
const persons = await context.query.Person.findMany({
where: { name: { equals: task.assignedTo } },
query: 'id',
- });
+ })
for (const person of persons) {
await context.query.Task.createOne({
data: { ...task, assignedTo: { connect: { id: person.id } } },
query: 'id',
- });
+ })
}
}
- console.log(`✅ Seed data inserted`);
- console.log(`👋 Please start the process with \`pnpm dev\``);
+ console.log(`✅ Seed data inserted`)
+ console.log(`👋 Please start the process with \`pnpm dev\``)
}
-main();
+main()
diff --git a/examples/custom-output-paths/keystone.ts b/examples/custom-output-paths/keystone.ts
index 00e619cdff9..5e59148bcb4 100644
--- a/examples/custom-output-paths/keystone.ts
+++ b/examples/custom-output-paths/keystone.ts
@@ -1,5 +1,5 @@
-import { config } from '@keystone-6/core';
-import { lists } from './schema';
+import { config } from '@keystone-6/core'
+import { lists } from './schema'
export default config({
db: {
@@ -22,4 +22,4 @@ export default config({
types: {
path: 'my-types.ts',
},
-});
+})
diff --git a/examples/custom-output-paths/schema.ts b/examples/custom-output-paths/schema.ts
index 24825455ba6..9ec2b149a40 100644
--- a/examples/custom-output-paths/schema.ts
+++ b/examples/custom-output-paths/schema.ts
@@ -1,7 +1,7 @@
-import { list } from '@keystone-6/core';
-import { allowAll } from '@keystone-6/core/access';
-import { text, timestamp } from '@keystone-6/core/fields';
-import type { Lists } from './my-types';
+import { list } from '@keystone-6/core'
+import { allowAll } from '@keystone-6/core/access'
+import { text, timestamp } from '@keystone-6/core/fields'
+import type { Lists } from './my-types'
export const lists: Lists = {
Post: list({
@@ -27,11 +27,11 @@ export const lists: Lists = {
//
// TODO: FIXME, babel and pnpm issues
- })) as readonly { title: string; content: string }[];
+ })) as readonly { title: string, content: string }[]
// })) satisfies readonly { title: string; content: string }[];
- console.log(posts);
+ console.log(posts)
},
},
}),
-};
+}
diff --git a/examples/custom-session-invalidation/keystone.ts b/examples/custom-session-invalidation/keystone.ts
index 7958521d277..36993b4a4b0 100644
--- a/examples/custom-session-invalidation/keystone.ts
+++ b/examples/custom-session-invalidation/keystone.ts
@@ -1,9 +1,9 @@
-import { config } from '@keystone-6/core';
-import { statelessSessions } from '@keystone-6/core/session';
-import { createAuth } from '@keystone-6/auth';
-import { fixPrismaPath } from '../example-utils';
-import { lists, Session } from './schema';
-import type { Config, Context, TypeInfo } from '.keystone/types';
+import { config } from '@keystone-6/core'
+import { statelessSessions } from '@keystone-6/core/session'
+import { createAuth } from '@keystone-6/auth'
+import { fixPrismaPath } from '../example-utils'
+import { lists, type Session } from './schema'
+import type { Config, Context, TypeInfo } from '.keystone/types'
// WARNING: this example is for demonstration purposes only
// as with each of our examples, it has not been vetted
@@ -31,39 +31,39 @@ const { withAuth } = createAuth({
},
sessionData: 'passwordChangedAt',
-});
+})
-function withSessionInvalidation(config: Config) {
- const existingSessionStrategy = config.session!;
+function withSessionInvalidation (config: Config) {
+ const existingSessionStrategy = config.session!
return {
...config,
session: {
...config.session,
- async get({ context }: { context: Context }): Promise {
- const session = await existingSessionStrategy.get({ context });
- if (!session) return;
+ async get ({ context }: { context: Context }): Promise {
+ const session = await existingSessionStrategy.get({ context })
+ if (!session) return
// has the password changed since the session started?
if (new Date(session.data.passwordChangedAt) > new Date(session.startedAt)) {
// invalidate the session if password changed
- await existingSessionStrategy.end({ context });
- return;
+ await existingSessionStrategy.end({ context })
+ return
}
- return session;
+ return session
},
- async start({ context, data }: { context: Context; data: Session }) {
+ async start ({ context, data }: { context: Context, data: Session }) {
return await existingSessionStrategy.start({
context,
data: {
...data,
startedAt: Date.now(),
},
- });
+ })
},
},
- };
+ }
}
export default withSessionInvalidation(
@@ -81,4 +81,4 @@ export default withSessionInvalidation(
session: statelessSessions(),
})
)
-);
+)
diff --git a/examples/custom-session-invalidation/schema.ts b/examples/custom-session-invalidation/schema.ts
index 8b33d064a5a..cd4d4df26c8 100644
--- a/examples/custom-session-invalidation/schema.ts
+++ b/examples/custom-session-invalidation/schema.ts
@@ -1,7 +1,7 @@
-import { list } from '@keystone-6/core';
-import { denyAll, unfiltered } from '@keystone-6/core/access';
-import { text, password, timestamp } from '@keystone-6/core/fields';
-import type { Lists } from '.keystone/types';
+import { list } from '@keystone-6/core'
+import { denyAll, unfiltered } from '@keystone-6/core/access'
+import { text, password, timestamp } from '@keystone-6/core/fields'
+import type { Lists } from '.keystone/types'
// WARNING: this example is for demonstration purposes only
// as with each of our examples, it has not been vetted
@@ -9,28 +9,28 @@ import type { Lists } from '.keystone/types';
// needs to be compatible with withAuth
export type Session = {
- listKey: string;
- itemId: string;
+ listKey: string
+ itemId: string
data: {
- passwordChangedAt: string;
- };
- startedAt: number;
-};
+ passwordChangedAt: string
+ }
+ startedAt: number
+}
-function hasSession({ session }: { session?: Session }) {
- return Boolean(session);
+function hasSession ({ session }: { session?: Session }) {
+ return Boolean(session)
}
-function isSameUserFilter({ session }: { session?: Session }) {
+function isSameUserFilter ({ session }: { session?: Session }) {
// you need to have a session
- if (!session) return false;
+ if (!session) return false
// the authenticated user can only see themselves
return {
id: {
equals: session.itemId,
},
- };
+ }
}
export const lists: Lists = {
@@ -77,12 +77,12 @@ export const lists: Lists = {
resolveInput: {
update: ({ resolvedData }) => {
if ('password' in resolvedData) {
- resolvedData.passwordChangedAt = new Date();
+ resolvedData.passwordChangedAt = new Date()
}
- return resolvedData;
+ return resolvedData
},
},
},
}),
-};
+}
diff --git a/examples/custom-session-jwt/keystone.ts b/examples/custom-session-jwt/keystone.ts
index da9fb813076..5b46d689547 100644
--- a/examples/custom-session-jwt/keystone.ts
+++ b/examples/custom-session-jwt/keystone.ts
@@ -1,21 +1,21 @@
-import jwt from 'jsonwebtoken';
-import { config } from '@keystone-6/core';
-import { fixPrismaPath } from '../example-utils';
-import { lists, Session } from './schema';
-import type { Context, TypeInfo } from '.keystone/types';
+import jwt from 'jsonwebtoken'
+import { config } from '@keystone-6/core'
+import { fixPrismaPath } from '../example-utils'
+import { lists, type Session } from './schema'
+import type { Context, TypeInfo } from '.keystone/types'
// WARNING: this example is for demonstration purposes only
// as with each of our examples, it has not been vetted
// or tested for any particular usage
// WARNING: you need to change this
-const jwtSessionSecret = '-- DEV COOKIE SECRET; CHANGE ME --';
+const jwtSessionSecret = '-- DEV COOKIE SECRET; CHANGE ME --'
type OurJWTClaims = {
- id: string;
-};
+ id: string
+}
-async function jwtSign(claims: OurJWTClaims) {
+async function jwtSign (claims: OurJWTClaims) {
return new Promise((resolve, reject) => {
jwt.sign(
claims,
@@ -24,14 +24,14 @@ async function jwtSign(claims: OurJWTClaims) {
algorithm: 'HS256', // HMAC-SHA256
},
(err, token) => {
- if (err) return reject(err);
- return resolve(token);
+ if (err) return reject(err)
+ return resolve(token)
}
- );
- });
+ )
+ })
}
-async function jwtVerify(token: string): Promise {
+async function jwtVerify (token: string): Promise {
return new Promise(resolve => {
jwt.verify(
token,
@@ -41,41 +41,41 @@ async function jwtVerify(token: string): Promise {
maxAge: '1h', // we use an expiry of 1 hour for this example
},
(err, result) => {
- if (err || typeof result !== 'object') return resolve(null);
- if (typeof result.id !== 'string') return resolve(null);
- return resolve(result as OurJWTClaims);
+ if (err || typeof result !== 'object') return resolve(null)
+ if (typeof result.id !== 'string') return resolve(null)
+ return resolve(result as OurJWTClaims)
}
- );
- });
+ )
+ })
}
const jwtSessionStrategy = {
- async get({ context }: { context: Context }): Promise {
- if (!context.req) return;
+ async get ({ context }: { context: Context }): Promise {
+ if (!context.req) return
- const { cookie = '' } = context.req.headers;
- const [cookieName, jwt] = cookie.split('=');
- if (cookieName !== 'user') return;
+ const { cookie = '' } = context.req.headers
+ const [cookieName, jwt] = cookie.split('=')
+ if (cookieName !== 'user') return
- const jwtResult = await jwtVerify(jwt);
- if (!jwtResult) return;
+ const jwtResult = await jwtVerify(jwt)
+ if (!jwtResult) return
- const { id } = jwtResult;
- const who = await context.sudo().db.User.findOne({ where: { id } });
- if (!who) return;
+ const { id } = jwtResult
+ const who = await context.sudo().db.User.findOne({ where: { id } })
+ if (!who) return
return {
id,
admin: who.admin,
- };
+ }
},
// we don't need these unless we want to support the functions
// context.sessionStrategy.start
// context.sessionStrategy.end
//
- async start() {},
- async end() {},
-};
+ async start () {},
+ async end () {},
+}
export default config({
db: {
@@ -94,9 +94,9 @@ export default config({
Bob: await jwtSign({ id: 'clh9v762w0002sbhmhhyc0340' }),
Eve: await jwtSign({ id: 'clh9v7ahs0004sbhmpx30w85n' }),
}
- );
+ )
},
},
lists,
session: jwtSessionStrategy,
-});
+})
diff --git a/examples/custom-session-jwt/schema.ts b/examples/custom-session-jwt/schema.ts
index 0803fee9660..6c7c06420a2 100644
--- a/examples/custom-session-jwt/schema.ts
+++ b/examples/custom-session-jwt/schema.ts
@@ -1,28 +1,28 @@
-import { list } from '@keystone-6/core';
-import { allowAll, unfiltered, allOperations } from '@keystone-6/core/access';
-import { checkbox, text } from '@keystone-6/core/fields';
-import type { Lists } from '.keystone/types';
+import { list } from '@keystone-6/core'
+import { allowAll, unfiltered, allOperations } from '@keystone-6/core/access'
+import { checkbox, text } from '@keystone-6/core/fields'
+import type { Lists } from '.keystone/types'
export type Session = {
- id: string;
- admin: boolean;
-};
+ id: string
+ admin: boolean
+}
-function hasSession({ session }: { session?: Session }) {
- return Boolean(session);
+function hasSession ({ session }: { session?: Session }) {
+ return Boolean(session)
}
-function isAdmin({ session }: { session?: Session }) {
- if (!session) return false;
- return session.admin;
+function isAdmin ({ session }: { session?: Session }) {
+ if (!session) return false
+ return session.admin
}
-function isAdminOrOnlySameUser({ session }: { session?: Session }) {
- if (!session) return false;
- if (session.admin) return {}; // unfiltered for admins
+function isAdminOrOnlySameUser ({ session }: { session?: Session }) {
+ if (!session) return false
+ if (session.admin) return {} // unfiltered for admins
return {
id: { equals: session.id },
- };
+ }
}
export const lists: Lists = {
@@ -61,4 +61,4 @@ export const lists: Lists = {
admin: checkbox(),
},
}),
-};
+}
diff --git a/examples/custom-session-next-auth/admin/pages/api/auth/[...nextauth].ts b/examples/custom-session-next-auth/admin/pages/api/auth/[...nextauth].ts
index ba253e27930..7bc55be9750 100644
--- a/examples/custom-session-next-auth/admin/pages/api/auth/[...nextauth].ts
+++ b/examples/custom-session-next-auth/admin/pages/api/auth/[...nextauth].ts
@@ -1,4 +1,4 @@
-import NextAuth from 'next-auth';
-import { nextAuthOptions } from '../../../../session';
+import NextAuth from 'next-auth'
+import { nextAuthOptions } from '../../../../session'
-export default NextAuth(nextAuthOptions);
+export default NextAuth(nextAuthOptions)
diff --git a/examples/custom-session-next-auth/keystone.ts b/examples/custom-session-next-auth/keystone.ts
index acf5915ea10..31feb40c019 100644
--- a/examples/custom-session-next-auth/keystone.ts
+++ b/examples/custom-session-next-auth/keystone.ts
@@ -1,9 +1,9 @@
-import { config } from '@keystone-6/core';
-import { fixPrismaPath } from '../example-utils';
-import { lists } from './schema';
+import { config } from '@keystone-6/core'
+import { fixPrismaPath } from '../example-utils'
+import { lists } from './schema'
-import { Session, nextAuthSessionStrategy } from './session';
-import type { TypeInfo } from '.keystone/types';
+import { type Session, nextAuthSessionStrategy } from './session'
+import type { TypeInfo } from '.keystone/types'
// WARNING: this example is for demonstration purposes only
// as with each of our examples, it has not been vetted
@@ -35,14 +35,14 @@ export default config>({
// adding page middleware ensures that users are redirected to the signin page if they are not signed in.
pageMiddleware: async ({ wasAccessAllowed }) => {
- if (wasAccessAllowed) return;
+ if (wasAccessAllowed) return
return {
kind: 'redirect',
to: '/api/auth/signin',
- };
+ }
},
},
lists,
// you can find out more at https://keystonejs.com/docs/apis/session#session-api
session: nextAuthSessionStrategy,
-});
+})
diff --git a/examples/custom-session-next-auth/schema.ts b/examples/custom-session-next-auth/schema.ts
index 6fb86ebcbec..8141fe631cf 100644
--- a/examples/custom-session-next-auth/schema.ts
+++ b/examples/custom-session-next-auth/schema.ts
@@ -1,15 +1,15 @@
-import { denyAll, allOperations } from '@keystone-6/core/access';
-import { list } from '@keystone-6/core';
-import { text, relationship } from '@keystone-6/core/fields';
-import type { Session } from './session';
-import type { Lists } from '.keystone/types';
+import { denyAll, allOperations } from '@keystone-6/core/access'
+import { list } from '@keystone-6/core'
+import { text, relationship } from '@keystone-6/core/fields'
+import type { Session } from './session'
+import type { Lists } from '.keystone/types'
// WARNING: this example is for demonstration purposes only
// as with each of our examples, it has not been vetted
// or tested for any particular usage
-function hasSession({ session }: { session?: Session }) {
- return Boolean(session);
+function hasSession ({ session }: { session?: Session }) {
+ return Boolean(session)
}
export const lists: Lists = {
@@ -43,4 +43,4 @@ export const lists: Lists = {
posts: relationship({ ref: 'Post.author', many: true }),
},
}),
-};
+}
diff --git a/examples/custom-session-next-auth/session.ts b/examples/custom-session-next-auth/session.ts
index 2351fc13fca..289f32ba71e 100644
--- a/examples/custom-session-next-auth/session.ts
+++ b/examples/custom-session-next-auth/session.ts
@@ -1,21 +1,21 @@
-import { getContext } from '@keystone-6/core/context';
-import { getServerSession } from 'next-auth/next';
-import type { DefaultJWT } from 'next-auth/jwt';
-import type { DefaultSession, DefaultUser } from 'next-auth';
-import GithubProvider from 'next-auth/providers/github';
-import type { Context } from '.keystone/types';
+import { getContext } from '@keystone-6/core/context'
+import { getServerSession } from 'next-auth/next'
+import type { DefaultJWT } from 'next-auth/jwt'
+import type { DefaultSession, DefaultUser } from 'next-auth'
+import GithubProvider from 'next-auth/providers/github'
+import type { Context } from '.keystone/types'
// WARNING: this example is for demonstration purposes only
// as with each of our examples, it has not been vetted
// or tested for any particular usage
// WARNING: you need to change this
-const sessionSecret = '-- DEV COOKIE SECRET; CHANGE ME --';
+const sessionSecret = '-- DEV COOKIE SECRET; CHANGE ME --'
-let _keystoneContext: Context = (globalThis as any)._keystoneContext;
+let _keystoneContext: Context = (globalThis as any)._keystoneContext
-async function getKeystoneContext() {
- if (_keystoneContext) return _keystoneContext;
+async function getKeystoneContext () {
+ if (_keystoneContext) return _keystoneContext
// TODO: this could probably be better
_keystoneContext = getContext(
@@ -24,25 +24,25 @@ async function getKeystoneContext() {
// your project will only have one Prisma Client, so you can use the following instead:
// await import('@primsa/client')
await import('.myprisma/client')
- );
+ )
if (process.env.NODE_ENV !== 'production') {
- (globalThis as any)._keystoneContext = _keystoneContext;
+ (globalThis as any)._keystoneContext = _keystoneContext
}
- return _keystoneContext;
+ return _keystoneContext
}
// see https://next-auth.js.org/configuration/options for more
export const nextAuthOptions = {
secret: sessionSecret,
callbacks: {
- async signIn({ user }: { user: DefaultUser }) {
+ async signIn ({ user }: { user: DefaultUser }) {
// console.error('next-auth signIn', { user, account, profile });
- const sudoContext = (await getKeystoneContext()).sudo();
+ const sudoContext = (await getKeystoneContext()).sudo()
// check if the user exists in keystone
const author = await sudoContext.query.Author.findOne({
where: { authId: user.id },
- });
+ })
// if not, sign up
if (!author) {
@@ -51,18 +51,18 @@ export const nextAuthOptions = {
authId: user.id,
name: user.name,
},
- });
+ })
}
- return true; // accept the signin
+ return true // accept the signin
},
- async session({
+ async session ({
session,
token,
}: {
- session: DefaultSession; // required by next-auth, not by us
- token: DefaultJWT;
+ session: DefaultSession // required by next-auth, not by us
+ token: DefaultJWT
}) {
// console.error('next-auth session', { session, token });
return {
@@ -70,7 +70,7 @@ export const nextAuthOptions = {
keystone: {
authId: token.sub,
},
- };
+ }
},
},
providers: [
@@ -80,44 +80,44 @@ export const nextAuthOptions = {
clientSecret: process.env.GITHUB_SECRET!,
}),
],
-};
+}
export type Session = {
- id: string;
-};
+ id: string
+}
export const nextAuthSessionStrategy = {
- async get({ context }: { context: Context }) {
- const { req, res } = context;
- const { headers } = req ?? {};
- if (!headers?.cookie || !res) return;
+ async get ({ context }: { context: Context }) {
+ const { req, res } = context
+ const { headers } = req ?? {}
+ if (!headers?.cookie || !res) return
// next-auth needs a different cookies structure
- const cookies: Record = {};
+ const cookies: Record = {}
for (const part of headers.cookie.split(';')) {
- const [key, value] = part.trim().split('=');
- cookies[key] = decodeURIComponent(value);
+ const [key, value] = part.trim().split('=')
+ cookies[key] = decodeURIComponent(value)
}
const nextAuthSession = await getServerSession(
{ headers, cookies } as any,
res,
nextAuthOptions
- );
- if (!nextAuthSession) return;
+ )
+ if (!nextAuthSession) return
- const { authId } = nextAuthSession.keystone;
- if (!authId) return;
+ const { authId } = nextAuthSession.keystone
+ if (!authId) return
const author = await context.sudo().db.Author.findOne({
where: { authId },
- });
- if (!author) return;
+ })
+ if (!author) return
- return { id: author.id };
+ return { id: author.id }
},
// we don't need these as next-auth handle start and end for us
- async start() {},
- async end() {},
-};
+ async start () {},
+ async end () {},
+}
diff --git a/examples/custom-session-redis/keystone.ts b/examples/custom-session-redis/keystone.ts
index c10d1bae2d1..5df9fcde326 100644
--- a/examples/custom-session-redis/keystone.ts
+++ b/examples/custom-session-redis/keystone.ts
@@ -1,10 +1,10 @@
-import { config } from '@keystone-6/core';
-import { storedSessions } from '@keystone-6/core/session';
-import { createAuth } from '@keystone-6/auth';
-import { createClient } from '@redis/client';
-import { fixPrismaPath } from '../example-utils';
-import { lists, Session } from './schema';
-import type { TypeInfo } from '.keystone/types';
+import { config } from '@keystone-6/core'
+import { storedSessions } from '@keystone-6/core/session'
+import { createAuth } from '@keystone-6/auth'
+import { createClient } from '@redis/client'
+import { fixPrismaPath } from '../example-utils'
+import { lists, type Session } from './schema'
+import type { TypeInfo } from '.keystone/types'
// WARNING: this example is for demonstration purposes only
// as with each of our examples, it has not been vetted
@@ -30,31 +30,31 @@ const { withAuth } = createAuth({
// the following fields are used by the "Create First User" form
fields: ['name', 'password'],
},
-});
+})
-const redis = createClient();
+const redis = createClient()
-function redisSessionStrategy() {
+function redisSessionStrategy () {
// you can find out more at https://keystonejs.com/docs/apis/session#session-api
return storedSessions({
store: ({ maxAge }) => ({
- async get(sessionId) {
- const result = await redis.get(sessionId);
- if (!result) return;
+ async get (sessionId) {
+ const result = await redis.get(sessionId)
+ if (!result) return
- return JSON.parse(result) as Session;
+ return JSON.parse(result) as Session
},
- async set(sessionId, data) {
+ async set (sessionId, data) {
// we use redis for our Session data, in JSON
- await redis.setEx(sessionId, maxAge, JSON.stringify(data));
+ await redis.setEx(sessionId, maxAge, JSON.stringify(data))
},
- async delete(sessionId) {
- await redis.del(sessionId);
+ async delete (sessionId) {
+ await redis.del(sessionId)
},
}),
- });
+ })
}
export default withAuth(
@@ -62,8 +62,8 @@ export default withAuth(
db: {
provider: 'sqlite',
url: process.env.DATABASE_URL || 'file:./keystone-example.db',
- async onConnect() {
- await redis.connect();
+ async onConnect () {
+ await redis.connect()
},
// WARNING: this is only needed for our monorepo examples, dont do this
@@ -72,4 +72,4 @@ export default withAuth(
lists,
session: redisSessionStrategy(),
})
-);
+)
diff --git a/examples/custom-session-redis/schema.ts b/examples/custom-session-redis/schema.ts
index 27ea195926f..2de6e6a6586 100644
--- a/examples/custom-session-redis/schema.ts
+++ b/examples/custom-session-redis/schema.ts
@@ -1,7 +1,7 @@
-import { list } from '@keystone-6/core';
-import { unfiltered } from '@keystone-6/core/access';
-import { text, password } from '@keystone-6/core/fields';
-import type { Lists } from '.keystone/types';
+import { list } from '@keystone-6/core'
+import { unfiltered } from '@keystone-6/core/access'
+import { text, password } from '@keystone-6/core/fields'
+import type { Lists } from '.keystone/types'
// WARNING: this example is for demonstration purposes only
// as with each of our examples, it has not been vetted
@@ -9,27 +9,27 @@ import type { Lists } from '.keystone/types';
// needs to be compatible with withAuth
export type Session = {
- listKey: string;
- itemId: string;
+ listKey: string
+ itemId: string
data: {
- something: string;
- };
-};
+ something: string
+ }
+}
-function hasSession({ session }: { session?: Session }) {
- return Boolean(session);
+function hasSession ({ session }: { session?: Session }) {
+ return Boolean(session)
}
-function isSameUserFilter({ session }: { session?: Session }) {
+function isSameUserFilter ({ session }: { session?: Session }) {
// you need to have a session
- if (!session) return false;
+ if (!session) return false
// the authenticated user can only see themselves
return {
id: {
equals: session.itemId,
},
- };
+ }
}
export const lists: Lists = {
@@ -62,4 +62,4 @@ export const lists: Lists = {
}),
},
}),
-};
+}
diff --git a/examples/custom-session/keystone.ts b/examples/custom-session/keystone.ts
index 832e1ba5fe7..57c1dc607b8 100644
--- a/examples/custom-session/keystone.ts
+++ b/examples/custom-session/keystone.ts
@@ -1,36 +1,36 @@
-import { config } from '@keystone-6/core';
-import { fixPrismaPath } from '../example-utils';
-import { lists, Session } from './schema';
-import type { Context, TypeInfo } from '.keystone/types';
+import { config } from '@keystone-6/core'
+import { fixPrismaPath } from '../example-utils'
+import { lists, type Session } from './schema'
+import type { Context, TypeInfo } from '.keystone/types'
const sillySessionStrategy = {
- async get({ context }: { context: Context }): Promise {
- if (!context.req) return;
+ async get ({ context }: { context: Context }): Promise {
+ if (!context.req) return
// WARNING: for demonstrative purposes only, this has no authentication
// use `Cookie:user=clh9v6pcn0000sbhm9u0j6in0` for Alice (admin)
// use `Cookie:user=clh9v762w0002sbhmhhyc0340` for Bob
//
// in practice, you should use authentication for your sessions, such as OAuth or JWT
- const { cookie = '' } = context.req.headers;
- const [cookieName, id] = cookie.split('=');
- if (cookieName !== 'user') return;
+ const { cookie = '' } = context.req.headers
+ const [cookieName, id] = cookie.split('=')
+ if (cookieName !== 'user') return
- const who = await context.sudo().db.User.findOne({ where: { id } });
- if (!who) return;
+ const who = await context.sudo().db.User.findOne({ where: { id } })
+ if (!who) return
return {
id,
admin: who.admin,
- };
+ }
},
// we don't need these unless we want to support the functions
// context.sessionStrategy.start
// context.sessionStrategy.end
//
- async start() {},
- async end() {},
-};
+ async start () {},
+ async end () {},
+}
export default config({
db: {
@@ -42,4 +42,4 @@ export default config({
},
lists,
session: sillySessionStrategy,
-});
+})
diff --git a/examples/custom-session/schema.ts b/examples/custom-session/schema.ts
index 62fc0df9cad..de4df6d5a76 100644
--- a/examples/custom-session/schema.ts
+++ b/examples/custom-session/schema.ts
@@ -1,28 +1,28 @@
-import { list } from '@keystone-6/core';
-import { allowAll, unfiltered } from '@keystone-6/core/access';
-import { checkbox, text } from '@keystone-6/core/fields';
-import type { Lists } from '.keystone/types';
+import { list } from '@keystone-6/core'
+import { allowAll, unfiltered } from '@keystone-6/core/access'
+import { checkbox, text } from '@keystone-6/core/fields'
+import type { Lists } from '.keystone/types'
export type Session = {
- id: string;
- admin: boolean;
-};
+ id: string
+ admin: boolean
+}
-function hasSession({ session }: { session?: Session }) {
- return Boolean(session);
+function hasSession ({ session }: { session?: Session }) {
+ return Boolean(session)
}
-function isAdmin({ session }: { session?: Session }) {
- if (!session) return false;
- return session.admin;
+function isAdmin ({ session }: { session?: Session }) {
+ if (!session) return false
+ return session.admin
}
-function isAdminOrOnlySameUser({ session }: { session?: Session }) {
- if (!session) return false;
- if (session.admin) return {}; // unfiltered for admins
+function isAdminOrOnlySameUser ({ session }: { session?: Session }) {
+ if (!session) return false
+ if (session.admin) return {} // unfiltered for admins
return {
id: { equals: session.id },
- };
+ }
}
export const lists: Lists = {
@@ -63,4 +63,4 @@ export const lists: Lists = {
admin: checkbox(),
},
}),
-};
+}
diff --git a/examples/default-values/keystone.ts b/examples/default-values/keystone.ts
index aebfcb74e9d..fe1bf98ab98 100644
--- a/examples/default-values/keystone.ts
+++ b/examples/default-values/keystone.ts
@@ -1,6 +1,6 @@
-import { config } from '@keystone-6/core';
-import { fixPrismaPath } from '../example-utils';
-import { lists } from './schema';
+import { config } from '@keystone-6/core'
+import { fixPrismaPath } from '../example-utils'
+import { lists } from './schema'
export default config({
db: {
@@ -11,4 +11,4 @@ export default config({
...fixPrismaPath,
},
lists,
-});
+})
diff --git a/examples/default-values/schema.ts b/examples/default-values/schema.ts
index 99ca5a229a8..8479e7a012e 100644
--- a/examples/default-values/schema.ts
+++ b/examples/default-values/schema.ts
@@ -1,8 +1,8 @@
-import { list } from '@keystone-6/core';
-import { bigInt, checkbox, relationship, text, timestamp } from '@keystone-6/core/fields';
-import { select } from '@keystone-6/core/fields';
-import { allowAll } from '@keystone-6/core/access';
-import type { Lists } from '.keystone/types';
+import { list } from '@keystone-6/core'
+import { bigInt, checkbox, relationship, text, timestamp } from '@keystone-6/core/fields'
+import { select } from '@keystone-6/core/fields'
+import { allowAll } from '@keystone-6/core/access'
+import type { Lists } from '.keystone/types'
export const lists: Lists = {
Task: list({
@@ -17,16 +17,16 @@ export const lists: Lists = {
{ label: 'High', value: 'high' },
],
hooks: {
- resolveInput({ resolvedData, inputData }) {
+ resolveInput ({ resolvedData, inputData }) {
if (inputData.priority === null) {
// default to high if "urgent" is in the label
if (inputData.label && inputData.label.toLowerCase().includes('urgent')) {
- return 'high';
+ return 'high'
} else {
- return 'low';
+ return 'low'
}
}
- return resolvedData.priority;
+ return resolvedData.priority
},
},
}),
@@ -39,18 +39,18 @@ export const lists: Lists = {
many: false,
hooks: {
// dynamic default: if unassigned, find an anonymous user and assign the task to them
- async resolveInput({ context, operation, resolvedData }) {
+ async resolveInput ({ context, operation, resolvedData }) {
if (resolvedData.assignedTo === null) {
const [user] = await context.db.Person.findMany({
where: { name: { equals: 'Anonymous' } },
- });
+ })
if (user) {
- return { connect: { id: user.id } };
+ return { connect: { id: user.id } }
}
}
- return resolvedData.assignedTo;
+ return resolvedData.assignedTo
},
},
}),
@@ -58,13 +58,13 @@ export const lists: Lists = {
// dynamic default: we set the due date to be 7 days in the future
finishBy: timestamp({
hooks: {
- resolveInput({ resolvedData, inputData, operation }) {
+ resolveInput ({ resolvedData, inputData, operation }) {
if (inputData.finishBy == null) {
- const date = new Date();
- date.setUTCDate(new Date().getUTCDate() + 7);
- return date;
+ const date = new Date()
+ date.setUTCDate(new Date().getUTCDate() + 7)
+ return date
}
- return resolvedData.finishBy;
+ return resolvedData.finishBy
},
},
}),
@@ -82,4 +82,4 @@ export const lists: Lists = {
tasks: relationship({ ref: 'Task.assignedTo', many: true }),
},
}),
-};
+}
diff --git a/examples/document-field-customisation/keystone-server/keystone.ts b/examples/document-field-customisation/keystone-server/keystone.ts
index a51db901c8c..72ca0405c61 100644
--- a/examples/document-field-customisation/keystone-server/keystone.ts
+++ b/examples/document-field-customisation/keystone-server/keystone.ts
@@ -1,24 +1,24 @@
-import { config } from '@keystone-6/core';
-import type { KeystoneConfig } from '@keystone-6/core/types';
-import { fixPrismaPath } from '../../example-utils';
-import { seedDatabase } from './src/seed';
-import { lists } from './src/schema';
-import { Context, TypeInfo } from '.keystone/types';
+import { config } from '@keystone-6/core'
+import type { KeystoneConfig } from '@keystone-6/core/types'
+import { fixPrismaPath } from '../../example-utils'
+import { seedDatabase } from './src/seed'
+import { lists } from './src/schema'
+import { type Context, type TypeInfo } from '.keystone/types'
const db: KeystoneConfig['db'] = {
provider: 'sqlite',
url: process.env.DATABASE_URL || 'file:./database.db',
- async onConnect(context: Context) {
+ async onConnect (context: Context) {
if (process.argv.includes('--seed-database')) {
- await seedDatabase(context);
+ await seedDatabase(context)
}
},
// WARNING: this is only needed for our monorepo examples, dont do this
...fixPrismaPath,
-};
+}
export default config({
db,
lists,
-});
+})
diff --git a/examples/document-field-customisation/keystone-server/src/component-blocks/callout.tsx b/examples/document-field-customisation/keystone-server/src/component-blocks/callout.tsx
index 0b391a34070..91cbb3f02b2 100644
--- a/examples/document-field-customisation/keystone-server/src/component-blocks/callout.tsx
+++ b/examples/document-field-customisation/keystone-server/src/component-blocks/callout.tsx
@@ -1,26 +1,26 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx, useTheme } from '@keystone-ui/core';
-import { component, fields, NotEditable } from '@keystone-6/fields-document/component-blocks';
+import { jsx, useTheme } from '@keystone-ui/core'
+import { component, fields, NotEditable } from '@keystone-6/fields-document/component-blocks'
import {
ToolbarButton,
ToolbarGroup,
ToolbarSeparator,
-} from '@keystone-6/fields-document/primitives';
-import { InfoIcon } from '@keystone-ui/icons/icons/InfoIcon';
-import { AlertTriangleIcon } from '@keystone-ui/icons/icons/AlertTriangleIcon';
-import { AlertOctagonIcon } from '@keystone-ui/icons/icons/AlertOctagonIcon';
-import { CheckCircleIcon } from '@keystone-ui/icons/icons/CheckCircleIcon';
-import { Trash2Icon } from '@keystone-ui/icons/icons/Trash2Icon';
-import { Tooltip } from '@keystone-ui/tooltip';
+} from '@keystone-6/fields-document/primitives'
+import { InfoIcon } from '@keystone-ui/icons/icons/InfoIcon'
+import { AlertTriangleIcon } from '@keystone-ui/icons/icons/AlertTriangleIcon'
+import { AlertOctagonIcon } from '@keystone-ui/icons/icons/AlertOctagonIcon'
+import { CheckCircleIcon } from '@keystone-ui/icons/icons/CheckCircleIcon'
+import { Trash2Icon } from '@keystone-ui/icons/icons/Trash2Icon'
+import { Tooltip } from '@keystone-ui/tooltip'
const calloutIconMap = {
info: InfoIcon,
error: AlertOctagonIcon,
warning: AlertTriangleIcon,
success: CheckCircleIcon,
-};
+}
export const callout = component({
label: 'Callout',
@@ -45,8 +45,8 @@ export const callout = component({
relationships: 'inherit',
}),
},
- preview: function Callout(props) {
- const { palette, radii, spacing } = useTheme();
+ preview: function Callout (props) {
+ const { palette, radii, spacing } = useTheme()
const intentMap = {
info: {
background: palette.blue100,
@@ -68,8 +68,8 @@ export const callout = component({
foreground: palette.green700,
icon: calloutIconMap.success,
},
- };
- const intentConfig = intentMap[props.fields.intent.value];
+ }
+ const intentConfig = intentMap[props.fields.intent.value]
return (
{props.fields.content.element}
- );
+ )
},
- toolbar: function CalloutToolbar({ props, onRemove }) {
+ toolbar: function CalloutToolbar ({ props, onRemove }) {
return (
{props.fields.intent.options.map(opt => {
- const Icon = calloutIconMap[opt.value];
+ const Icon = calloutIconMap[opt.value]
return (
@@ -110,7 +110,7 @@ export const callout = component({
{
- props.fields.intent.onChange(opt.value);
+ props.fields.intent.onChange(opt.value)
}}
{...attrs}
>
@@ -118,7 +118,7 @@ export const callout = component({
)}
- );
+ )
})}
@@ -131,6 +131,6 @@ export const callout = component({
)}
- );
+ )
},
-});
+})
diff --git a/examples/document-field-customisation/keystone-server/src/component-blocks/carousel.tsx b/examples/document-field-customisation/keystone-server/src/component-blocks/carousel.tsx
index 981a1028594..630eff3c9bb 100644
--- a/examples/document-field-customisation/keystone-server/src/component-blocks/carousel.tsx
+++ b/examples/document-field-customisation/keystone-server/src/component-blocks/carousel.tsx
@@ -1,12 +1,12 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { Box, jsx } from '@keystone-ui/core';
-import { component, fields, NotEditable } from '@keystone-6/fields-document/component-blocks';
+import { Box, jsx } from '@keystone-ui/core'
+import { component, fields, NotEditable } from '@keystone-6/fields-document/component-blocks'
export const carousel = component({
label: 'Carousel',
- preview: function Preview(props) {
+ preview: function Preview (props) {
return (
- );
+ )
})}
- );
+ )
},
schema: {
items: fields.array(
@@ -72,4 +72,4 @@ export const carousel = component({
})
),
},
-});
+})
diff --git a/examples/document-field-customisation/keystone-server/src/component-blocks/hero.tsx b/examples/document-field-customisation/keystone-server/src/component-blocks/hero.tsx
index 7473d3471ef..80f9313b0a7 100644
--- a/examples/document-field-customisation/keystone-server/src/component-blocks/hero.tsx
+++ b/examples/document-field-customisation/keystone-server/src/component-blocks/hero.tsx
@@ -1,8 +1,8 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@keystone-ui/core';
-import { component, fields, NotEditable } from '@keystone-6/fields-document/component-blocks';
+import { jsx } from '@keystone-ui/core'
+import { component, fields, NotEditable } from '@keystone-6/fields-document/component-blocks'
export const hero = component({
label: 'Hero',
@@ -21,7 +21,7 @@ export const hero = component({
}),
}),
},
- preview: function Hero(props) {
+ preview: function Hero (props) {
return (
@@ -39,6 +39,6 @@ export const hero = component({
{props.fields.caption.value.element}
) : null}
- );
+ )
},
-});
+})
diff --git a/examples/document-field-customisation/keystone-server/src/component-blocks/index.tsx b/examples/document-field-customisation/keystone-server/src/component-blocks/index.tsx
index 6e2f117f55f..9b9ea52089b 100644
--- a/examples/document-field-customisation/keystone-server/src/component-blocks/index.tsx
+++ b/examples/document-field-customisation/keystone-server/src/component-blocks/index.tsx
@@ -1,12 +1,12 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { carousel } from './carousel';
-import { hero } from './hero';
-import { callout } from './callout';
-import { quote } from './quote';
-import { tweet } from './tweet';
-import { youtubeVideo } from './youtube-video';
+import { carousel } from './carousel'
+import { hero } from './hero'
+import { callout } from './callout'
+import { quote } from './quote'
+import { tweet } from './tweet'
+import { youtubeVideo } from './youtube-video'
// it's important that this file has a named export called componentBlocks
// schema.Post.ui.views import looks for a named export `componentBlocks`
@@ -17,4 +17,4 @@ export const componentBlocks = {
quote,
tweet,
youtubeVideo,
-};
+}
diff --git a/examples/document-field-customisation/keystone-server/src/component-blocks/quote.tsx b/examples/document-field-customisation/keystone-server/src/component-blocks/quote.tsx
index 5c7069a6424..6903cc8a9dc 100644
--- a/examples/document-field-customisation/keystone-server/src/component-blocks/quote.tsx
+++ b/examples/document-field-customisation/keystone-server/src/component-blocks/quote.tsx
@@ -1,8 +1,8 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@keystone-ui/core';
-import { component, fields, NotEditable } from '@keystone-6/fields-document/component-blocks';
+import { jsx } from '@keystone-ui/core'
+import { component, fields, NotEditable } from '@keystone-6/fields-document/component-blocks'
export const quote = component({
label: 'Quote',
@@ -15,7 +15,7 @@ export const quote = component({
}),
attribution: fields.child({ kind: 'inline', placeholder: 'Attribution...' }),
},
- preview: function Quote(props) {
+ preview: function Quote (props) {
return (
- );
+ )
},
-});
+})
diff --git a/examples/document-field-customisation/keystone-server/src/component-blocks/tweet.tsx b/examples/document-field-customisation/keystone-server/src/component-blocks/tweet.tsx
index f026d0df647..0341e0e25bf 100644
--- a/examples/document-field-customisation/keystone-server/src/component-blocks/tweet.tsx
+++ b/examples/document-field-customisation/keystone-server/src/component-blocks/tweet.tsx
@@ -1,9 +1,9 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { useRef, useEffect } from 'react';
-import { jsx } from '@keystone-ui/core';
-import { component, fields, NotEditable } from '@keystone-6/fields-document/component-blocks';
+import { useRef, useEffect } from 'react'
+import { jsx } from '@keystone-ui/core'
+import { component, fields, NotEditable } from '@keystone-6/fields-document/component-blocks'
export const tweet = component({
label: 'Tweet',
@@ -14,14 +14,14 @@ export const tweet = component({
'https://twitter.com/KeystoneJS/status/1558944015953068032?s=20&t=32A2Avz9kPlefEOcXIqOXQ',
}),
},
- preview: function Tweet(props) {
- const wrapper = useRef(null);
+ preview: function Tweet (props) {
+ const wrapper = useRef(null)
useEffect(() => {
- const script = document.createElement('script');
- script.setAttribute('src', 'https://platform.twitter.com/widgets.js');
- wrapper.current!.appendChild(script);
- }, []);
+ const script = document.createElement('script')
+ script.setAttribute('src', 'https://platform.twitter.com/widgets.js')
+ wrapper.current!.appendChild(script)
+ }, [])
return (
@@ -31,6 +31,6 @@ export const tweet = component({
- );
+ )
},
-});
+})
diff --git a/examples/document-field-customisation/keystone-server/src/component-blocks/youtube-video.tsx b/examples/document-field-customisation/keystone-server/src/component-blocks/youtube-video.tsx
index 38a36a40d25..6c1e00d902a 100644
--- a/examples/document-field-customisation/keystone-server/src/component-blocks/youtube-video.tsx
+++ b/examples/document-field-customisation/keystone-server/src/component-blocks/youtube-video.tsx
@@ -1,8 +1,8 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { jsx } from '@keystone-ui/core';
-import { component, fields, NotEditable } from '@keystone-6/fields-document/component-blocks';
+import { jsx } from '@keystone-ui/core'
+import { component, fields, NotEditable } from '@keystone-6/fields-document/component-blocks'
export const youtubeVideo = component({
label: 'YouTube Video',
@@ -16,17 +16,17 @@ export const youtubeVideo = component({
defaultValue: 'Embedded YouTube video',
}),
},
- preview: function YouTubeVideo(props) {
- const url = props.fields.url.value;
- let embedId = '';
+ preview: function YouTubeVideo (props) {
+ const url = props.fields.url.value
+ let embedId = ''
const parsedUrl = (url || '')
.replace(/(>|<)/gi, '')
- .split(/(vi\/|v=|\/v\/|youtu\.be\/|\/embed\/)/);
+ .split(/(vi\/|v=|\/v\/|youtu\.be\/|\/embed\/)/)
if (parsedUrl[2] !== undefined) {
- const parsedId = parsedUrl[2].split(/[^0-9a-z_\-]/i);
- embedId = parsedId[0];
+ const parsedId = parsedUrl[2].split(/[^0-9a-z_\-]/i)
+ embedId = parsedId[0]
} else {
- embedId = url;
+ embedId = url
}
return (
@@ -51,6 +51,6 @@ export const youtubeVideo = component({
/>
- );
+ )
},
-});
+})
diff --git a/examples/document-field-customisation/keystone-server/src/schema.ts b/examples/document-field-customisation/keystone-server/src/schema.ts
index d9394f33d18..97b41be4a87 100644
--- a/examples/document-field-customisation/keystone-server/src/schema.ts
+++ b/examples/document-field-customisation/keystone-server/src/schema.ts
@@ -1,10 +1,10 @@
-import { list } from '@keystone-6/core';
-import { allowAll } from '@keystone-6/core/access';
-import { relationship, text, timestamp } from '@keystone-6/core/fields';
-import { document } from '@keystone-6/fields-document';
-import type { KeystoneConfig } from '@keystone-6/core/types';
-import { componentBlocks } from './component-blocks';
-import { TypeInfo } from '.keystone/types';
+import { list } from '@keystone-6/core'
+import { allowAll } from '@keystone-6/core/access'
+import { relationship, text, timestamp } from '@keystone-6/core/fields'
+import { document } from '@keystone-6/fields-document'
+import type { KeystoneConfig } from '@keystone-6/core/types'
+import { componentBlocks } from './component-blocks'
+import { type TypeInfo } from '.keystone/types'
export const lists: KeystoneConfig['lists'] = {
User: list({
@@ -39,4 +39,4 @@ export const lists: KeystoneConfig['lists'] = {
author: relationship({ ref: 'User.posts', many: false }),
},
}),
-};
+}
diff --git a/examples/document-field-customisation/keystone-server/src/seed/index.ts b/examples/document-field-customisation/keystone-server/src/seed/index.ts
index 6b7dc909f71..8811e223233 100644
--- a/examples/document-field-customisation/keystone-server/src/seed/index.ts
+++ b/examples/document-field-customisation/keystone-server/src/seed/index.ts
@@ -1,45 +1,45 @@
-import fs from 'fs';
-import path from 'path';
-import { Context } from '.keystone/types';
+import fs from 'fs'
+import path from 'path'
+import { type Context } from '.keystone/types'
const seedUsers = async (context: Context) => {
- const { db } = context.sudo();
- const rawJSONData = fs.readFileSync(path.join(process.cwd(), './src/seed/users.json'), 'utf-8');
- const seedUsers: any[] = JSON.parse(rawJSONData);
+ const { db } = context.sudo()
+ const rawJSONData = fs.readFileSync(path.join(process.cwd(), './src/seed/users.json'), 'utf-8')
+ const seedUsers: any[] = JSON.parse(rawJSONData)
const usersAlreadyInDatabase = await db.User.findMany({
where: {
email: { in: seedUsers.map(user => user.email) },
},
- });
+ })
const usersToCreate = seedUsers.filter(
seedUser => !usersAlreadyInDatabase.some(u => u.email === seedUser.email)
- );
+ )
await db.User.createMany({
data: usersToCreate,
- });
-};
+ })
+}
// seed posts and connect with users
const seedPosts = async (context: Context) => {
- const { db } = context.sudo();
- const rawJSONData = fs.readFileSync(path.join(process.cwd(), './src/seed/posts.json'), 'utf-8');
- const seedPosts: any[] = JSON.parse(rawJSONData);
+ const { db } = context.sudo()
+ const rawJSONData = fs.readFileSync(path.join(process.cwd(), './src/seed/posts.json'), 'utf-8')
+ const seedPosts: any[] = JSON.parse(rawJSONData)
const postsAlreadyInDatabase = await db.Post.findMany({
where: {
slug: { in: seedPosts.map(post => post.slug) },
},
- });
+ })
const postsToCreate = seedPosts.filter(
seedPost => !postsAlreadyInDatabase.some(p => p.slug === seedPost.slug)
- );
+ )
await db.Post.createMany({
data: postsToCreate.map(p => ({ ...p, content: p?.content?.document })),
- });
-};
+ })
+}
export const seedDatabase = async (context: Context) => {
- console.log(`🌱 Seeding database...`);
- await seedUsers(context);
- await seedPosts(context);
- console.log(`🌱 Seeding database completed.`);
-};
+ console.log(`🌱 Seeding database...`)
+ await seedUsers(context)
+ await seedPosts(context)
+ console.log(`🌱 Seeding database completed.`)
+}
diff --git a/examples/document-field-customisation/nextjs-frontend/next.config.js b/examples/document-field-customisation/nextjs-frontend/next.config.js
index 540297b3877..6b7de94ff9b 100644
--- a/examples/document-field-customisation/nextjs-frontend/next.config.js
+++ b/examples/document-field-customisation/nextjs-frontend/next.config.js
@@ -1,4 +1,4 @@
// you don't need this if you're building something outside of the Keystone repo
-const withPreconstruct = require('@preconstruct/next');
+const withPreconstruct = require('@preconstruct/next')
-module.exports = withPreconstruct();
+module.exports = withPreconstruct()
diff --git a/examples/document-field-customisation/nextjs-frontend/src/components/Callout/Callout.tsx b/examples/document-field-customisation/nextjs-frontend/src/components/Callout/Callout.tsx
index b7176df30c2..e906195bcfa 100644
--- a/examples/document-field-customisation/nextjs-frontend/src/components/Callout/Callout.tsx
+++ b/examples/document-field-customisation/nextjs-frontend/src/components/Callout/Callout.tsx
@@ -1,39 +1,39 @@
-import React, { ReactNode } from 'react';
-import styles from './Callout.module.css';
+import React, { type ReactNode } from 'react'
+import styles from './Callout.module.css'
type CalloutProps = {
- intent: 'info' | 'warning' | 'error' | 'success';
- content: ReactNode;
-};
+ intent: 'info' | 'warning' | 'error' | 'success'
+ content: ReactNode
+}
-export function Callout({ intent, content }: CalloutProps) {
- let backgroundColor = 'transparent';
- let textColor = 'current';
- let borderColor = 'current';
+export function Callout ({ intent, content }: CalloutProps) {
+ let backgroundColor = 'transparent'
+ let textColor = 'current'
+ let borderColor = 'current'
switch (intent) {
case 'info': {
- backgroundColor = '#dbeafe';
- textColor = '#1e40af';
- borderColor = '#1e40af';
- break;
+ backgroundColor = '#dbeafe'
+ textColor = '#1e40af'
+ borderColor = '#1e40af'
+ break
}
case 'warning': {
- backgroundColor = '#fef9c3';
- textColor = '#854d0e';
- borderColor = '#854d0e';
- break;
+ backgroundColor = '#fef9c3'
+ textColor = '#854d0e'
+ borderColor = '#854d0e'
+ break
}
case 'error': {
- backgroundColor = '#fee2e2';
- textColor = '#991b1b';
- borderColor = '#991b1b';
- break;
+ backgroundColor = '#fee2e2'
+ textColor = '#991b1b'
+ borderColor = '#991b1b'
+ break
}
case 'success': {
- backgroundColor = '#dcfce7';
- textColor = '#166534';
- borderColor = '#166534';
- break;
+ backgroundColor = '#dcfce7'
+ textColor = '#166534'
+ borderColor = '#166534'
+ break
}
}
@@ -48,5 +48,5 @@ export function Callout({ intent, content }: CalloutProps) {
{content}
- );
+ )
}
diff --git a/examples/document-field-customisation/nextjs-frontend/src/components/Carousel/Carousel.tsx b/examples/document-field-customisation/nextjs-frontend/src/components/Carousel/Carousel.tsx
index 78713f2ca85..8c1d02e2196 100644
--- a/examples/document-field-customisation/nextjs-frontend/src/components/Carousel/Carousel.tsx
+++ b/examples/document-field-customisation/nextjs-frontend/src/components/Carousel/Carousel.tsx
@@ -1,14 +1,14 @@
-import React from 'react';
-import styles from './Carousel.module.css';
+import React from 'react'
+import styles from './Carousel.module.css'
type CarouselProps = {
items: {
- title: string;
- imageSrc: string;
- }[];
-};
+ title: string
+ imageSrc: string
+ }[]
+}
-export function Carousel({ items = [] }: CarouselProps) {
+export function Carousel ({ items = [] }: CarouselProps) {
return (
{items.map(item => {
@@ -17,8 +17,8 @@ export function Carousel({ items = [] }: CarouselProps) {
{item.title}
- );
+ )
})}
- );
+ )
}
diff --git a/examples/document-field-customisation/nextjs-frontend/src/components/CustomRenderer/CustomRenderer.tsx b/examples/document-field-customisation/nextjs-frontend/src/components/CustomRenderer/CustomRenderer.tsx
index dc495bacaa4..4d20174e92a 100644
--- a/examples/document-field-customisation/nextjs-frontend/src/components/CustomRenderer/CustomRenderer.tsx
+++ b/examples/document-field-customisation/nextjs-frontend/src/components/CustomRenderer/CustomRenderer.tsx
@@ -1,14 +1,14 @@
-import React, { ComponentProps } from 'react';
-import { DocumentRenderer } from '@keystone-6/document-renderer';
-import { Hero } from '../Hero/Hero';
-import { Callout } from '../Callout/Callout';
-import { Quote } from '../Quote/Quote';
-import { Carousel } from '../Carousel/Carousel';
-import { Tweet } from '../Tweet/Tweet';
-import { YouTubeVideo } from '../YouTubeVideo/YouTubeVideo';
-import styles from './CustomRenderer.module.css';
+import React, { type ComponentProps } from 'react'
+import { DocumentRenderer } from '@keystone-6/document-renderer'
+import { Hero } from '../Hero/Hero'
+import { Callout } from '../Callout/Callout'
+import { Quote } from '../Quote/Quote'
+import { Carousel } from '../Carousel/Carousel'
+import { Tweet } from '../Tweet/Tweet'
+import { YouTubeVideo } from '../YouTubeVideo/YouTubeVideo'
+import styles from './CustomRenderer.module.css'
-type CustomRendererProps = ComponentProps;
+type CustomRendererProps = ComponentProps
const defaultElementRenderers: CustomRendererProps['renderers'] = {
block: {
@@ -18,54 +18,54 @@ const defaultElementRenderers: CustomRendererProps['renderers'] = {
// for eg. using React.Fragment wraps the component with nothing
block: React.Fragment as any, // FIXME
// customise blockquote elements with your own styles
- blockquote({ children }) {
- return {children} ;
+ blockquote ({ children }) {
+ return {children}
},
// block code ``` ```
- code({ children }) {
- return {children} ;
+ code ({ children }) {
+ return {children}
},
// and more - check out the types to see all available block elements
},
inline: {
bold: ({ children }) => {
- return {children} ;
+ return {children}
},
// inline code ` `
code: ({ children }) => {
- return {children}
;
+ return {children}
},
// and more - check out the types to see all available inline elements
},
-};
+}
const customComponentRenderers: CustomRendererProps['componentBlocks'] = {
hero: props => {
- return ;
+ return
},
callout: props => {
- return ;
+ return
},
quote: props => {
- return
;
+ return
},
carousel: props => {
- return ;
+ return
},
tweet: props => {
- return ;
+ return
},
youtubeVideo: props => {
- return ;
+ return
},
-};
+}
-export function CustomRenderer({ document }: CustomRendererProps) {
+export function CustomRenderer ({ document }: CustomRendererProps) {
return (
- );
+ )
}
diff --git a/examples/document-field-customisation/nextjs-frontend/src/components/Hero/Hero.tsx b/examples/document-field-customisation/nextjs-frontend/src/components/Hero/Hero.tsx
index 1aee27798bb..a35db85c5d0 100644
--- a/examples/document-field-customisation/nextjs-frontend/src/components/Hero/Hero.tsx
+++ b/examples/document-field-customisation/nextjs-frontend/src/components/Hero/Hero.tsx
@@ -1,23 +1,23 @@
-import React from 'react';
-import styles from './Hero.module.css';
+import React from 'react'
+import styles from './Hero.module.css'
type HeroProps = {
- imageSrc: string;
+ imageSrc: string
caption:
| {
- discriminant: false;
+ discriminant: false
}
| {
- discriminant: true;
- value: React.ReactNode;
- };
-};
+ discriminant: true
+ value: React.ReactNode
+ }
+}
-export function Hero({ imageSrc, caption }: HeroProps) {
+export function Hero ({ imageSrc, caption }: HeroProps) {
return (
{caption.discriminant ?
{caption.value}
: null}
- );
+ )
}
diff --git a/examples/document-field-customisation/nextjs-frontend/src/components/Quote/Quote.tsx b/examples/document-field-customisation/nextjs-frontend/src/components/Quote/Quote.tsx
index 0a79582b095..084d73d3dad 100644
--- a/examples/document-field-customisation/nextjs-frontend/src/components/Quote/Quote.tsx
+++ b/examples/document-field-customisation/nextjs-frontend/src/components/Quote/Quote.tsx
@@ -1,16 +1,16 @@
-import React, { ReactNode } from 'react';
-import styles from './Quote.module.css';
+import React, { type ReactNode } from 'react'
+import styles from './Quote.module.css'
type QuoteProps = {
- attribution: ReactNode;
- content: ReactNode;
-};
+ attribution: ReactNode
+ content: ReactNode
+}
-export function Quote({ attribution, content }: QuoteProps) {
+export function Quote ({ attribution, content }: QuoteProps) {
return (
{content}
— {attribution}
- );
+ )
}
diff --git a/examples/document-field-customisation/nextjs-frontend/src/components/Tweet/Tweet.tsx b/examples/document-field-customisation/nextjs-frontend/src/components/Tweet/Tweet.tsx
index c451d4296ac..8cc77987f3b 100644
--- a/examples/document-field-customisation/nextjs-frontend/src/components/Tweet/Tweet.tsx
+++ b/examples/document-field-customisation/nextjs-frontend/src/components/Tweet/Tweet.tsx
@@ -1,18 +1,18 @@
-import React from 'react';
-import styles from './Tweet.module.css';
+import React from 'react'
+import styles from './Tweet.module.css'
type TweetProps = {
- url: string;
-};
+ url: string
+}
-export function Tweet({ url }: TweetProps) {
- const wrapper = React.useRef(null);
+export function Tweet ({ url }: TweetProps) {
+ const wrapper = React.useRef(null)
React.useEffect(() => {
- const script = document.createElement('script');
- script.setAttribute('src', 'https://platform.twitter.com/widgets.js');
- wrapper.current!.appendChild(script);
- }, []);
+ const script = document.createElement('script')
+ script.setAttribute('src', 'https://platform.twitter.com/widgets.js')
+ wrapper.current!.appendChild(script)
+ }, [])
return (
- );
+ )
}
diff --git a/examples/document-field-customisation/nextjs-frontend/src/components/YouTubeVideo/YouTubeVideo.tsx b/examples/document-field-customisation/nextjs-frontend/src/components/YouTubeVideo/YouTubeVideo.tsx
index 8b6465500bd..838510f979f 100644
--- a/examples/document-field-customisation/nextjs-frontend/src/components/YouTubeVideo/YouTubeVideo.tsx
+++ b/examples/document-field-customisation/nextjs-frontend/src/components/YouTubeVideo/YouTubeVideo.tsx
@@ -1,13 +1,13 @@
-import React from 'react';
-import styles from './YouTubeVideo.module.css';
+import React from 'react'
+import styles from './YouTubeVideo.module.css'
type YouTubeVideoProps = {
- url: string;
- altText: string;
-};
+ url: string
+ altText: string
+}
-export function YouTubeVideo({ url, altText = 'Embedded YouTube video' }: YouTubeVideoProps) {
- const embedId = getYouTubeEmbedId(url);
+export function YouTubeVideo ({ url, altText = 'Embedded YouTube video' }: YouTubeVideoProps) {
+ const embedId = getYouTubeEmbedId(url)
return (
@@ -23,17 +23,17 @@ export function YouTubeVideo({ url, altText = 'Embedded YouTube video' }: YouTub
/>
- );
+ )
}
-function getYouTubeEmbedId(url: string) {
- let embedId = '';
- const parsedUrl = url.replace(/(>|<)/gi, '').split(/(vi\/|v=|\/v\/|youtu\.be\/|\/embed\/)/);
+function getYouTubeEmbedId (url: string) {
+ let embedId = ''
+ const parsedUrl = url.replace(/(>|<)/gi, '').split(/(vi\/|v=|\/v\/|youtu\.be\/|\/embed\/)/)
if (parsedUrl[2] !== undefined) {
- const parsedId = parsedUrl[2].split(/[^0-9a-z_\-]/i);
- embedId = parsedId[0];
+ const parsedId = parsedUrl[2].split(/[^0-9a-z_\-]/i)
+ embedId = parsedId[0]
} else {
- embedId = url;
+ embedId = url
}
- return embedId;
+ return embedId
}
diff --git a/examples/document-field-customisation/nextjs-frontend/src/graphql.ts b/examples/document-field-customisation/nextjs-frontend/src/graphql.ts
index 37f86189b90..873db96f3b8 100644
--- a/examples/document-field-customisation/nextjs-frontend/src/graphql.ts
+++ b/examples/document-field-customisation/nextjs-frontend/src/graphql.ts
@@ -1,8 +1,8 @@
-const API_URI = process.env.API_URI || 'http://localhost:3000/api/graphql';
+const API_URI = process.env.API_URI || 'http://localhost:3000/api/graphql'
-export const gql = ([content]: TemplateStringsArray) => content;
+export const gql = ([content]: TemplateStringsArray) => content
-export async function fetchGraphQL(query: string, variables?: Record) {
+export async function fetchGraphQL (query: string, variables?: Record) {
return fetch(API_URI, {
method: 'POST',
body: JSON.stringify({ query, variables }),
@@ -13,8 +13,8 @@ export async function fetchGraphQL(query: string, variables?: Record x.message).join('\n')}`
- );
+ )
}
- return data;
- });
+ return data
+ })
}
diff --git a/examples/document-field-customisation/nextjs-frontend/src/pages/_app.tsx b/examples/document-field-customisation/nextjs-frontend/src/pages/_app.tsx
index c9036cb6a3d..7ef443ddf08 100644
--- a/examples/document-field-customisation/nextjs-frontend/src/pages/_app.tsx
+++ b/examples/document-field-customisation/nextjs-frontend/src/pages/_app.tsx
@@ -1,9 +1,9 @@
-import React from 'react';
-import type { AppProps } from 'next/app';
-import '../styles/globals.css';
+import React from 'react'
+import type { AppProps } from 'next/app'
+import '../styles/globals.css'
-function MyApp({ Component, pageProps }: AppProps) {
- return ;
+function MyApp ({ Component, pageProps }: AppProps) {
+ return
}
-export default MyApp;
+export default MyApp
diff --git a/examples/document-field-customisation/nextjs-frontend/src/pages/blog/[slug].tsx b/examples/document-field-customisation/nextjs-frontend/src/pages/blog/[slug].tsx
index 3b8cfbadd6a..1af7572091d 100644
--- a/examples/document-field-customisation/nextjs-frontend/src/pages/blog/[slug].tsx
+++ b/examples/document-field-customisation/nextjs-frontend/src/pages/blog/[slug].tsx
@@ -1,37 +1,37 @@
-import React, { Fragment } from 'react';
-import type { GetStaticPathsResult, GetStaticPropsContext } from 'next';
-import Link from 'next/link';
-import type { DocumentRendererProps } from '@keystone-6/document-renderer';
-import { CustomRenderer } from '../../components/CustomRenderer/CustomRenderer';
-import { fetchGraphQL, gql } from '../../graphql';
+import React, { Fragment } from 'react'
+import type { GetStaticPathsResult, GetStaticPropsContext } from 'next'
+import Link from 'next/link'
+import type { DocumentRendererProps } from '@keystone-6/document-renderer'
+import { CustomRenderer } from '../../components/CustomRenderer/CustomRenderer'
+import { fetchGraphQL, gql } from '../../graphql'
-export type DocumentProp = DocumentRendererProps['document'];
+export type DocumentProp = DocumentRendererProps['document']
type Post = {
- id: string;
- title: string;
- slug: string;
- publishDate: string | null;
+ id: string
+ title: string
+ slug: string
+ publishDate: string | null
author: {
- name: string;
- } | null;
+ name: string
+ } | null
content: {
- document: DocumentProp;
- };
-};
+ document: DocumentProp
+ }
+}
-export default function BlogPage({ post, error }: { post: Post | undefined; error?: Error }) {
+export default function BlogPage ({ post, error }: { post: Post | undefined, error?: Error }) {
if (error) {
return (
Something went wrong
{error.message}
- );
+ )
}
if (!post) {
- return Post not found
;
+ return Post not found
}
return (
@@ -56,10 +56,10 @@ export default function BlogPage({ post, error }: { post: Post | undefined; erro
- );
+ )
}
-export async function getStaticPaths(): Promise {
+export async function getStaticPaths (): Promise {
try {
const data = await fetchGraphQL(gql`
query posts {
@@ -67,27 +67,27 @@ export async function getStaticPaths(): Promise {
slug
}
}
- `);
+ `)
- const posts: { slug: string }[] = data?.posts || [];
+ const posts: { slug: string }[] = data?.posts || []
const paths = posts.map(({ slug }) => ({
params: { slug },
- }));
+ }))
return {
paths,
fallback: false,
- };
+ }
} catch (e) {
return {
paths: [],
fallback: false,
- };
+ }
}
}
-export async function getStaticProps({ params = {} }: GetStaticPropsContext) {
- const slug = params.slug;
+export async function getStaticProps ({ params = {} }: GetStaticPropsContext) {
+ const slug = params.slug
try {
const data = await fetchGraphQL(
gql`
@@ -109,16 +109,16 @@ export async function getStaticProps({ params = {} }: GetStaticPropsContext) {
{
slug,
}
- );
+ )
- const post = data?.post;
- return { props: { post } };
+ const post = data?.post
+ return { props: { post } }
} catch (e) {
return {
props: {
post: undefined,
error: { name: (e as Error).name, message: (e as Error).message },
},
- };
+ }
}
}
diff --git a/examples/document-field-customisation/nextjs-frontend/src/pages/index.tsx b/examples/document-field-customisation/nextjs-frontend/src/pages/index.tsx
index 5f2810263dc..46c257fa1c7 100644
--- a/examples/document-field-customisation/nextjs-frontend/src/pages/index.tsx
+++ b/examples/document-field-customisation/nextjs-frontend/src/pages/index.tsx
@@ -1,50 +1,50 @@
-import React, { Fragment } from 'react';
-import Link from 'next/link';
-import { fetchGraphQL, gql } from '../graphql';
+import React, { Fragment } from 'react'
+import Link from 'next/link'
+import { fetchGraphQL, gql } from '../graphql'
type Post = {
- id: string;
- title: string;
- slug: string;
- publishDate: string | null;
+ id: string
+ title: string
+ slug: string
+ publishDate: string | null
author: {
- name: string;
- } | null;
-};
+ name: string
+ } | null
+}
-function PublishDate({ publishDate }: { publishDate: Post['publishDate'] }) {
- const formattedDate = publishDate ? new Date(publishDate).toLocaleDateString() : null;
+function PublishDate ({ publishDate }: { publishDate: Post['publishDate'] }) {
+ const formattedDate = publishDate ? new Date(publishDate).toLocaleDateString() : null
if (!formattedDate) {
- return null;
+ return null
}
return (
· Published on {formattedDate}
- );
+ )
}
-function AuthorInfo({ author }: { author: Post['author'] }) {
+function AuthorInfo ({ author }: { author: Post['author'] }) {
if (!author?.name) {
- return null;
+ return null
}
return (
· by {author?.name}
- );
+ )
}
-export default function Home({ posts, error }: { posts: Post[]; error?: Error }) {
+export default function Home ({ posts, error }: { posts: Post[], error?: Error }) {
if (error) {
return (
Something went wrong
{error.message}
- );
+ )
}
return (
@@ -58,14 +58,14 @@ export default function Home({ posts, error }: { posts: Post[]; error?: Error })
- );
+ )
})}
- );
+ )
}
-export async function getStaticProps() {
+export async function getStaticProps () {
try {
const data = await fetchGraphQL(gql`
query posts {
@@ -79,21 +79,21 @@ export async function getStaticProps() {
}
}
}
- `);
+ `)
- const posts = data?.posts || [];
+ const posts = data?.posts || []
return {
props: {
posts,
},
- };
+ }
} catch (e) {
return {
props: {
posts: [],
error: { name: (e as Error).name, message: (e as Error).message },
},
- };
+ }
}
}
diff --git a/examples/document-field/keystone.ts b/examples/document-field/keystone.ts
index aebfcb74e9d..fe1bf98ab98 100644
--- a/examples/document-field/keystone.ts
+++ b/examples/document-field/keystone.ts
@@ -1,6 +1,6 @@
-import { config } from '@keystone-6/core';
-import { fixPrismaPath } from '../example-utils';
-import { lists } from './schema';
+import { config } from '@keystone-6/core'
+import { fixPrismaPath } from '../example-utils'
+import { lists } from './schema'
export default config({
db: {
@@ -11,4 +11,4 @@ export default config({
...fixPrismaPath,
},
lists,
-});
+})
diff --git a/examples/document-field/next.config.js b/examples/document-field/next.config.js
index 9a8e11185af..00184d61daa 100644
--- a/examples/document-field/next.config.js
+++ b/examples/document-field/next.config.js
@@ -1,5 +1,5 @@
// you don't need this if you're building something outside of the Keystone repo
-const withPreconstruct = require('@preconstruct/next');
+const withPreconstruct = require('@preconstruct/next')
-module.exports = withPreconstruct();
+module.exports = withPreconstruct()
diff --git a/examples/document-field/schema.ts b/examples/document-field/schema.ts
index 292095899a7..6675aacf8b0 100644
--- a/examples/document-field/schema.ts
+++ b/examples/document-field/schema.ts
@@ -1,7 +1,7 @@
-import { list } from '@keystone-6/core';
-import { select, relationship, text, timestamp } from '@keystone-6/core/fields';
-import { document } from '@keystone-6/fields-document';
-import { allowAll } from '@keystone-6/core/access';
+import { list } from '@keystone-6/core'
+import { select, relationship, text, timestamp } from '@keystone-6/core/fields'
+import { document } from '@keystone-6/fields-document'
+import { allowAll } from '@keystone-6/core/access'
export const lists = {
Post: list({
@@ -62,4 +62,4 @@ export const lists = {
}),
},
}),
-};
+}
diff --git a/examples/document-field/src/pages/author/[id].tsx b/examples/document-field/src/pages/author/[id].tsx
index 0131b00f84c..f3aa3dbdf80 100644
--- a/examples/document-field/src/pages/author/[id].tsx
+++ b/examples/document-field/src/pages/author/[id].tsx
@@ -1,10 +1,10 @@
-import { GetStaticPathsResult, GetStaticPropsContext } from 'next';
-import Link from 'next/link';
-import React from 'react';
-import { DocumentRenderer } from '@keystone-6/document-renderer';
-import { fetchGraphQL, gql } from '../../utils';
+import { type GetStaticPathsResult, type GetStaticPropsContext } from 'next'
+import Link from 'next/link'
+import React from 'react'
+import { DocumentRenderer } from '@keystone-6/document-renderer'
+import { fetchGraphQL, gql } from '../../utils'
-export default function Post({ author }: { author: any }) {
+export default function Post ({ author }: { author: any }) {
return (
{author.name}
@@ -19,24 +19,24 @@ export default function Post({ author }: { author: any }) {
))}
- );
+ )
}
-export async function getStaticPaths(): Promise {
+export async function getStaticPaths (): Promise {
const data = await fetchGraphQL(gql`
query {
authors {
id
}
}
- `);
+ `)
return {
paths: data.authors.map((post: any) => ({ params: { id: post.id } })),
fallback: 'blocking',
- };
+ }
}
-export async function getStaticProps({ params }: GetStaticPropsContext) {
+export async function getStaticProps ({ params }: GetStaticPropsContext) {
const data = await fetchGraphQL(
gql`
query ($id: ID!) {
@@ -54,6 +54,6 @@ export async function getStaticProps({ params }: GetStaticPropsContext) {
}
`,
{ id: params!.id }
- );
- return { props: { author: data.author }, revalidate: 60 };
+ )
+ return { props: { author: data.author }, revalidate: 60 }
}
diff --git a/examples/document-field/src/pages/index.tsx b/examples/document-field/src/pages/index.tsx
index 5e9c9a6aac0..81b846cb146 100644
--- a/examples/document-field/src/pages/index.tsx
+++ b/examples/document-field/src/pages/index.tsx
@@ -1,11 +1,11 @@
-import Link from 'next/link';
-import React from 'react';
-import { fetchGraphQL, gql } from '../utils';
+import Link from 'next/link'
+import React from 'react'
+import { fetchGraphQL, gql } from '../utils'
-type Author = { id: string; name: string; posts: { id: string; slug: string; title: string }[] };
+type Author = { id: string, name: string, posts: { id: string, slug: string, title: string }[] }
-export default function Index({ authors }: { authors: Author[] }) {
- Keystone Blog Project - Home ;
+export default function Index ({ authors }: { authors: Author[] }) {
+ Keystone Blog Project - Home
return (
{authors.map(author => (
@@ -23,10 +23,10 @@ export default function Index({ authors }: { authors: Author[] }) {
))}
- );
+ )
}
-export async function getStaticProps() {
+export async function getStaticProps () {
const data = await fetchGraphQL(gql`
query {
authors {
@@ -39,6 +39,6 @@ export async function getStaticProps() {
}
}
}
- `);
- return { props: { authors: data.authors }, revalidate: 30 };
+ `)
+ return { props: { authors: data.authors }, revalidate: 30 }
}
diff --git a/examples/document-field/src/pages/post/[slug].tsx b/examples/document-field/src/pages/post/[slug].tsx
index e1959c02927..eaf941ad802 100644
--- a/examples/document-field/src/pages/post/[slug].tsx
+++ b/examples/document-field/src/pages/post/[slug].tsx
@@ -1,8 +1,8 @@
-import { GetStaticPathsResult, GetStaticPropsContext } from 'next';
-import Link from 'next/link';
-import React from 'react';
-import { DocumentRenderer, DocumentRendererProps } from '@keystone-6/document-renderer';
-import { fetchGraphQL, gql } from '../../utils';
+import { type GetStaticPathsResult, type GetStaticPropsContext } from 'next'
+import Link from 'next/link'
+import React from 'react'
+import { DocumentRenderer, type DocumentRendererProps } from '@keystone-6/document-renderer'
+import { fetchGraphQL, gql } from '../../utils'
// By default the DocumentRenderer will render unstyled html elements.
// We're customising how headings are rendered here but you can customise
@@ -10,14 +10,14 @@ import { fetchGraphQL, gql } from '../../utils';
const renderers: DocumentRendererProps['renderers'] = {
// Render heading blocks
block: {
- heading({ level, children, textAlign }) {
- const Comp = `h${level}` as const;
- return {children} ;
+ heading ({ level, children, textAlign }) {
+ const Comp = `h${level}` as const
+ return {children}
},
},
// Render inline relationships
inline: {
- relationship({ relationship, data }) {
+ relationship ({ relationship, data }) {
// If there is more than one inline relationship defined on the document
// field we need to handle each of them separately by checking the `relationship` argument.
// It is good practice to include this check even if you only have a single inline relationship.
@@ -26,20 +26,20 @@ const renderers: DocumentRendererProps['renderers'] = {
// data can be null if the content writer inserted a mention but didn't select an author to mention.
// data.data can be undefined if the logged in user does not have permission to read the linked item
// or if the linked item no longer exists.
- return [unknown author] ;
+ return [unknown author]
} else {
// If the data exists then we render the mention as a link to the author's bio.
// We have access to `id` an `name` fields here because we named them in the
// `selection` config argument.
- return {data.data.name};
+ return {data.data.name}
}
}
- return null;
+ return null
},
},
-};
+}
-export default function Post({ post }: { post: any }) {
+export default function Post ({ post }: { post: any }) {
return (
{post.title}
@@ -57,24 +57,24 @@ export default function Post({ post }: { post: any }) {
)}
- );
+ )
}
-export async function getStaticPaths(): Promise {
+export async function getStaticPaths (): Promise {
const data = await fetchGraphQL(gql`
query {
posts {
slug
}
}
- `);
+ `)
return {
paths: data.posts.map((post: any) => ({ params: { slug: post.slug } })),
fallback: 'blocking',
- };
+ }
}
-export async function getStaticProps({ params }: GetStaticPropsContext) {
+export async function getStaticProps ({ params }: GetStaticPropsContext) {
// We use (hydrateRelationships: true) to ensure we have the data we need
// to render the inline relationships.
const data = await fetchGraphQL(
@@ -94,6 +94,6 @@ export async function getStaticProps({ params }: GetStaticPropsContext) {
}
`,
{ slug: params!.slug }
- );
- return { props: { post: data.post }, revalidate: 60 };
+ )
+ return { props: { post: data.post }, revalidate: 60 }
}
diff --git a/examples/document-field/src/utils.tsx b/examples/document-field/src/utils.tsx
index 98a155ccb27..7dccffef6f0 100644
--- a/examples/document-field/src/utils.tsx
+++ b/examples/document-field/src/utils.tsx
@@ -1,6 +1,6 @@
-export const gql = ([content]: TemplateStringsArray) => content;
+export const gql = ([content]: TemplateStringsArray) => content
-export async function fetchGraphQL(query: string, variables?: Record) {
+export async function fetchGraphQL (query: string, variables?: Record) {
return fetch('http://localhost:3000/api/graphql', {
method: 'POST',
body: JSON.stringify({ query, variables }),
@@ -11,8 +11,8 @@ export async function fetchGraphQL(query: string, variables?: Record x.message).join('\n')}`
- );
+ )
}
- return data;
- });
+ return data
+ })
}
diff --git a/examples/example-data.ts b/examples/example-data.ts
index 0d54b618bd9..8959b20b864 100644
--- a/examples/example-data.ts
+++ b/examples/example-data.ts
@@ -7,14 +7,14 @@ export const authors = [
{ name: 'Lewis Carroll', email: 'lewis.carroll@email.com' },
{ name: 'George Eliot', email: 'g.eliot@email.com' },
{ name: 'L. Frank Baum', email: 'l.baum@email.com' },
-];
+]
export const persons = [
{ name: 'Lucy Wroblewski' },
{ name: 'Ches Adebayor' },
{ name: 'Tiff Jayden' },
{ name: 'Henrique Urrea' },
-];
+]
export const posts = [
{
@@ -81,7 +81,7 @@ export const posts = [
content:
'Dorothy lived in the midst of the great Kansas prairies, with Uncle Henry, who was a farmer, and Aunt Em, who was the farmer’s wife. Their house was small, for the lumber to build it had to be carried by wagon many miles. There were four walls, a floor and a roof, which made one room; and this room contained a rusty looking cookstove, a cupboard for the dishes, a table, three or four chairs, and the beds. Uncle Henry and Aunt Em had a big bed in one corner, and Dorothy a little bed in another corner. There was no garret at all, and no cellar—except a small hole dug in the ground, called a cyclone cellar, where the family could go in case one of those great whirlwinds arose, mighty enough to crush any building in its path. It was reached by a trap door in the middle of the floor, from which a ladder led down into the small, dark hole.',
},
-] as const;
+] as const
export const tasks = [
{
@@ -147,7 +147,7 @@ export const tasks = [
assignedTo: 'Lucy Wroblewski',
priority: 'low',
},
-] as const;
+] as const
export const products = [
{
@@ -534,4 +534,4 @@ export const products = [
},
},
},
-];
+]
diff --git a/examples/example-utils.ts b/examples/example-utils.ts
index 80f3b40588e..fcd07fa3f0d 100644
--- a/examples/example-utils.ts
+++ b/examples/example-utils.ts
@@ -7,4 +7,4 @@
// transforms
export const fixPrismaPath = {
prismaClientPath: 'node_modules/.myprisma/client',
-};
+}
diff --git a/examples/extend-express-app/keystone.ts b/examples/extend-express-app/keystone.ts
index b8c865cd171..f7637800eeb 100644
--- a/examples/extend-express-app/keystone.ts
+++ b/examples/extend-express-app/keystone.ts
@@ -1,18 +1,18 @@
-import { config } from '@keystone-6/core';
-import type { Request, Response } from 'express';
+import { config } from '@keystone-6/core'
+import type { Request, Response } from 'express'
-import { fixPrismaPath } from '../example-utils';
-import { lists } from './schema';
-import { getTasks } from './routes/tasks';
-import { TypeInfo, Context } from '.keystone/types';
+import { fixPrismaPath } from '../example-utils'
+import { lists } from './schema'
+import { getTasks } from './routes/tasks'
+import { type TypeInfo, type Context } from '.keystone/types'
function withContext void>(
commonContext: Context,
f: F
) {
return async (req: Request, res: Response) => {
- return f(req, res, await commonContext.withRequest(req, res));
- };
+ return f(req, res, await commonContext.withRequest(req, res))
+ }
}
export default config({
@@ -34,9 +34,9 @@ export default config({
Keystone schema and return the results as JSON
*/
extendExpressApp: (app, commonContext) => {
- app.get('/rest/tasks', withContext(commonContext, getTasks));
+ app.get('/rest/tasks', withContext(commonContext, getTasks))
// app.put('/rest/tasks', withContext(commonContext, putTask));
},
},
lists,
-});
+})
diff --git a/examples/extend-express-app/routes/tasks.ts b/examples/extend-express-app/routes/tasks.ts
index 84d541f1c55..67edbf2117e 100644
--- a/examples/extend-express-app/routes/tasks.ts
+++ b/examples/extend-express-app/routes/tasks.ts
@@ -1,5 +1,5 @@
-import type { Request, Response } from 'express';
-import type { Context } from '.keystone/types';
+import type { Request, Response } from 'express'
+import type { Context } from '.keystone/types'
/*
This example route handler gets all the tasks in the database and returns
@@ -11,13 +11,13 @@ import type { Context } from '.keystone/types';
We're also demonstrating how you can query related data through the schema.
*/
-export async function getTasks(req: Request, res: Response, context: Context) {
+export async function getTasks (req: Request, res: Response, context: Context) {
// Let's map the `complete` query param to a where filter
- let isComplete;
+ let isComplete
if (req.query.complete === 'true') {
- isComplete = { equals: true };
+ isComplete = { equals: true }
} else if (req.query.complete === 'false') {
- isComplete = { equals: false };
+ isComplete = { equals: false }
}
// Now we can use it to query the Keystone Schema
const tasks = await context.query.Task.findMany({
@@ -34,7 +34,7 @@ export async function getTasks(req: Request, res: Response, context: Context) {
name
}
`,
- });
+ })
// And return the result as JSON
- res.json(tasks);
+ res.json(tasks)
}
diff --git a/examples/extend-express-app/schema.ts b/examples/extend-express-app/schema.ts
index 52d60f81215..9a7141a84d6 100644
--- a/examples/extend-express-app/schema.ts
+++ b/examples/extend-express-app/schema.ts
@@ -1,8 +1,8 @@
-import { list } from '@keystone-6/core';
-import { allowAll } from '@keystone-6/core/access';
-import { checkbox, relationship, text, timestamp } from '@keystone-6/core/fields';
-import { select } from '@keystone-6/core/fields';
-import { Lists } from '.keystone/types';
+import { list } from '@keystone-6/core'
+import { allowAll } from '@keystone-6/core/access'
+import { checkbox, relationship, text, timestamp } from '@keystone-6/core/fields'
+import { select } from '@keystone-6/core/fields'
+import { type Lists } from '.keystone/types'
export const lists: Lists = {
Task: list({
@@ -29,4 +29,4 @@ export const lists: Lists = {
tasks: relationship({ ref: 'Task.assignedTo', many: true }),
},
}),
-};
+}
diff --git a/examples/extend-express-app/seed-data.tsx b/examples/extend-express-app/seed-data.tsx
index 3f1ea1b39e2..bdf4beb2a4e 100644
--- a/examples/extend-express-app/seed-data.tsx
+++ b/examples/extend-express-app/seed-data.tsx
@@ -1,60 +1,60 @@
-import { getContext } from '@keystone-6/core/context';
-import { persons, tasks } from '../example-data';
-import config from './keystone';
-import * as PrismaModule from '.myprisma/client';
+import { getContext } from '@keystone-6/core/context'
+import { persons, tasks } from '../example-data'
+import config from './keystone'
+import * as PrismaModule from '.myprisma/client'
type PersonProps = {
- name: string;
-};
+ name: string
+}
type TaskProps = {
- label: string;
- isComplete: boolean;
- finishBy: string;
- assignedTo: string;
-};
+ label: string
+ isComplete: boolean
+ finishBy: string
+ assignedTo: string
+}
-export async function main() {
- const context = getContext(config, PrismaModule);
- console.log(`🌱 Inserting seed data`);
+export async function main () {
+ const context = getContext(config, PrismaModule)
+ console.log(`🌱 Inserting seed data`)
const createPerson = async (personData: PersonProps) => {
let person = await context.query.Person.findOne({
where: { name: personData.name },
query: 'id',
- });
+ })
if (!person) {
person = await context.query.Person.createOne({
data: personData,
query: 'id',
- });
+ })
}
- };
+ }
const createTask = async (taskData: TaskProps) => {
let persons = await context.query.Person.findMany({
where: { name: { equals: taskData.assignedTo } },
query: 'id',
- });
+ })
await context.query.Task.createOne({
data: { ...taskData, assignedTo: { connect: { id: persons[0].id } } },
query: 'id',
- });
- };
+ })
+ }
for (const person of persons) {
- console.log(`👩 Adding person: ${person.name}`);
- await createPerson(person);
+ console.log(`👩 Adding person: ${person.name}`)
+ await createPerson(person)
}
for (const task of tasks) {
- console.log(`🔘 Adding task: ${task.label}`);
- await createTask(task);
+ console.log(`🔘 Adding task: ${task.label}`)
+ await createTask(task)
}
- console.log(`✅ Seed data inserted`);
- console.log(`👋 Please start the process with \`yarn dev\` or \`npm run dev\``);
+ console.log(`✅ Seed data inserted`)
+ console.log(`👋 Please start the process with \`yarn dev\` or \`npm run dev\``)
}
-main();
+main()
diff --git a/examples/extend-graphql-schema-graphql-tools/keystone.ts b/examples/extend-graphql-schema-graphql-tools/keystone.ts
index b03c36e662c..bf93b6dfe61 100644
--- a/examples/extend-graphql-schema-graphql-tools/keystone.ts
+++ b/examples/extend-graphql-schema-graphql-tools/keystone.ts
@@ -1,6 +1,6 @@
-import { config } from '@keystone-6/core';
-import { fixPrismaPath } from '../example-utils';
-import { lists, extendGraphqlSchema } from './schema';
+import { config } from '@keystone-6/core'
+import { fixPrismaPath } from '../example-utils'
+import { lists, extendGraphqlSchema } from './schema'
export default config({
db: {
@@ -12,4 +12,4 @@ export default config({
},
lists,
extendGraphqlSchema,
-});
+})
diff --git a/examples/extend-graphql-schema-graphql-tools/schema.ts b/examples/extend-graphql-schema-graphql-tools/schema.ts
index e2bacbdc091..012507b359a 100644
--- a/examples/extend-graphql-schema-graphql-tools/schema.ts
+++ b/examples/extend-graphql-schema-graphql-tools/schema.ts
@@ -1,9 +1,9 @@
-import { list } from '@keystone-6/core';
-import type { GraphQLSchema } from 'graphql';
-import { mergeSchemas } from '@graphql-tools/schema';
-import { allowAll } from '@keystone-6/core/access';
-import { select, relationship, text, timestamp } from '@keystone-6/core/fields';
-import { Lists, Context } from '.keystone/types';
+import { list } from '@keystone-6/core'
+import type { GraphQLSchema } from 'graphql'
+import { mergeSchemas } from '@graphql-tools/schema'
+import { allowAll } from '@keystone-6/core/access'
+import { select, relationship, text, timestamp } from '@keystone-6/core/fields'
+import { type Lists, type Context } from '.keystone/types'
export const lists: Lists = {
Post: list({
@@ -30,9 +30,9 @@ export const lists: Lists = {
posts: relationship({ ref: 'Post.author', many: true }),
},
}),
-};
+}
-export function extendGraphqlSchema(baseSchema: GraphQLSchema) {
+export function extendGraphqlSchema (baseSchema: GraphQLSchema) {
return mergeSchemas({
schemas: [baseSchema],
typeDefs: `
@@ -68,27 +68,27 @@ export function extendGraphqlSchema(baseSchema: GraphQLSchema) {
return context.db.Post.updateOne({
where: { id },
data: { status: 'published', publishDate: new Date().toUTCString() },
- });
+ })
},
upsertAuthor: async (root, { where, update, create }, context: Context) => {
try {
// we need to await the update here so that if an error is thrown, it's caught
// by the try catch here and not returned through the graphql api
- return await context.db.Author.updateOne({ where, data: update });
+ return await context.db.Author.updateOne({ where, data: update })
} catch (updateError: any) {
// updateOne will fail with the code KS_ACCESS_DENIED if the item isn't found,
// so we try to create it. If the item does exist, the unique constraint on
// email will prevent a duplicate being created, and we catch the error
if (updateError.extensions?.code === 'KS_ACCESS_DENIED') {
- return await context.db.Author.createOne({ data: create });
+ return await context.db.Author.createOne({ data: create })
}
- throw updateError;
+ throw updateError
}
},
},
Query: {
recentPosts: (root, { id, seconds }, context: Context) => {
- const cutoff = new Date(Date.now() - seconds * 1000);
+ const cutoff = new Date(Date.now() - seconds * 1000)
// Note we use `context.db.Post` here as we have a return type
// of [Post], and this API provides results in the correct format.
@@ -96,10 +96,10 @@ export function extendGraphqlSchema(baseSchema: GraphQLSchema) {
// when accessing the fields in your GraphQL client.
return context.db.Post.findMany({
where: { author: { id: { equals: id } }, publishDate: { gt: cutoff } },
- });
+ })
},
stats: async (root, { id }) => {
- return { authorId: id };
+ return { authorId: id }
},
},
Statistics: {
@@ -113,20 +113,20 @@ export function extendGraphqlSchema(baseSchema: GraphQLSchema) {
take: 1,
orderBy: { publishDate: 'desc' },
where: { author: { id: { equals: val.authorId } } },
- });
- return post;
+ })
+ return post
},
draft: (val, args, context: Context) => {
return context.query.Post.count({
where: { author: { id: { equals: val.authorId } }, status: { equals: 'draft' } },
- });
+ })
},
published: (val, args, context: Context) => {
return context.query.Post.count({
where: { author: { id: { equals: val.authorId } }, status: { equals: 'published' } },
- });
+ })
},
},
},
- });
+ })
}
diff --git a/examples/extend-graphql-schema-graphql-ts/keystone.ts b/examples/extend-graphql-schema-graphql-ts/keystone.ts
index b03c36e662c..bf93b6dfe61 100644
--- a/examples/extend-graphql-schema-graphql-ts/keystone.ts
+++ b/examples/extend-graphql-schema-graphql-ts/keystone.ts
@@ -1,6 +1,6 @@
-import { config } from '@keystone-6/core';
-import { fixPrismaPath } from '../example-utils';
-import { lists, extendGraphqlSchema } from './schema';
+import { config } from '@keystone-6/core'
+import { fixPrismaPath } from '../example-utils'
+import { lists, extendGraphqlSchema } from './schema'
export default config({
db: {
@@ -12,4 +12,4 @@ export default config({
},
lists,
extendGraphqlSchema,
-});
+})
diff --git a/examples/extend-graphql-schema-graphql-ts/schema.ts b/examples/extend-graphql-schema-graphql-ts/schema.ts
index 7b7e40709fd..5aaba8d092f 100644
--- a/examples/extend-graphql-schema-graphql-ts/schema.ts
+++ b/examples/extend-graphql-schema-graphql-ts/schema.ts
@@ -1,7 +1,7 @@
-import { graphql, list } from '@keystone-6/core';
-import { allowAll } from '@keystone-6/core/access';
-import { select, relationship, text, timestamp } from '@keystone-6/core/fields';
-import { Context, Lists } from '.keystone/types';
+import { graphql, list } from '@keystone-6/core'
+import { allowAll } from '@keystone-6/core/access'
+import { select, relationship, text, timestamp } from '@keystone-6/core/fields'
+import { type Context, type Lists } from '.keystone/types'
export const lists: Lists = {
Post: list({
@@ -29,7 +29,7 @@ export const lists: Lists = {
posts: relationship({ ref: 'Post.author', many: true }),
},
}),
-};
+}
export const extendGraphqlSchema = graphql.extend(base => {
const Statistics = graphql.object<{ authorId: string }>()({
@@ -37,33 +37,33 @@ export const extendGraphqlSchema = graphql.extend(base => {
fields: {
draft: graphql.field({
type: graphql.Int,
- resolve({ authorId }, args, context: Context) {
+ resolve ({ authorId }, args, context: Context) {
return context.query.Post.count({
where: { author: { id: { equals: authorId } }, status: { equals: 'draft' } },
- });
+ })
},
}),
published: graphql.field({
type: graphql.Int,
- resolve({ authorId }, args, context: Context) {
+ resolve ({ authorId }, args, context: Context) {
return context.query.Post.count({
where: { author: { id: { equals: authorId } }, status: { equals: 'published' } },
- });
+ })
},
}),
latest: graphql.field({
type: base.object('Post'),
- async resolve({ authorId }, args, context: Context) {
+ async resolve ({ authorId }, args, context: Context) {
const [post] = await context.db.Post.findMany({
take: 1,
orderBy: { publishDate: 'desc' },
where: { author: { id: { equals: authorId } } },
- });
- return post;
+ })
+ return post
},
}),
},
- });
+ })
return {
mutation: {
@@ -72,7 +72,7 @@ export const extendGraphqlSchema = graphql.extend(base => {
// with the name provided or throw if it doesn't exist
type: base.object('Post'),
args: { id: graphql.arg({ type: graphql.nonNull(graphql.ID) }) },
- resolve(source, { id }, context: Context) {
+ resolve (source, { id }, context: Context) {
// Note we use `context.db.Post` here as we have a return type
// of Post, and this API provides results in the correct format.
// If you accidentally use `context.query.Post` here you can expect problems
@@ -80,7 +80,7 @@ export const extendGraphqlSchema = graphql.extend(base => {
return context.db.Post.updateOne({
where: { id },
data: { status: 'published', publishDate: new Date().toISOString() },
- });
+ })
},
}),
@@ -90,11 +90,11 @@ export const extendGraphqlSchema = graphql.extend(base => {
banPost: graphql.field({
type: base.object('Post'),
args: { id: graphql.arg({ type: graphql.nonNull(graphql.ID) }) },
- resolve(source, { id }, context: Context) {
+ resolve (source, { id }, context: Context) {
return context.db.Post.updateOne({
where: { id },
data: { status: 'banned' },
- });
+ })
},
}),
}
@@ -107,8 +107,8 @@ export const extendGraphqlSchema = graphql.extend(base => {
id: graphql.arg({ type: graphql.nonNull(graphql.ID) }),
seconds: graphql.arg({ type: graphql.nonNull(graphql.Int), defaultValue: 600 }),
},
- resolve(source, { id, seconds }, context: Context) {
- const cutoff = new Date(Date.now() - seconds * 1000);
+ resolve (source, { id, seconds }, context: Context) {
+ const cutoff = new Date(Date.now() - seconds * 1000)
// Note we use `context.db.Post` here as we have a return type
// of [Post], and this API provides results in the correct format.
@@ -116,16 +116,16 @@ export const extendGraphqlSchema = graphql.extend(base => {
// when accessing the fields in your GraphQL client.
return context.db.Post.findMany({
where: { author: { id: { equals: id } }, publishDate: { gt: cutoff } },
- });
+ })
},
}),
stats: graphql.field({
type: Statistics,
args: { id: graphql.arg({ type: graphql.nonNull(graphql.ID) }) },
- resolve(source, { id }) {
- return { authorId: id };
+ resolve (source, { id }) {
+ return { authorId: id }
},
}),
},
- };
-});
+ }
+})
diff --git a/examples/extend-graphql-schema-nexus/keystone.ts b/examples/extend-graphql-schema-nexus/keystone.ts
index d6c77d7bbe9..30eb684df35 100644
--- a/examples/extend-graphql-schema-nexus/keystone.ts
+++ b/examples/extend-graphql-schema-nexus/keystone.ts
@@ -1,6 +1,6 @@
-import { config } from '@keystone-6/core';
-import { fixPrismaPath } from '../example-utils';
-import { lists, extendGraphqlSchema } from './schema';
+import { config } from '@keystone-6/core'
+import { fixPrismaPath } from '../example-utils'
+import { lists, extendGraphqlSchema } from './schema'
export default config({
db: {
@@ -17,4 +17,4 @@ export default config({
types: {
path: 'keystone-types.ts',
},
-});
+})
diff --git a/examples/extend-graphql-schema-nexus/nexus-types.ts b/examples/extend-graphql-schema-nexus/nexus-types.ts
index 09b1c30d60d..273ddd1e3f0 100644
--- a/examples/extend-graphql-schema-nexus/nexus-types.ts
+++ b/examples/extend-graphql-schema-nexus/nexus-types.ts
@@ -15,151 +15,151 @@ declare global {
export interface NexusGenInputs {
AuthorCreateInput: { // input type
- email?: string | null; // String
- name?: string | null; // String
- posts?: NexusGenInputs['PostRelateToManyForCreateInput'] | null; // PostRelateToManyForCreateInput
+ email?: string | null // String
+ name?: string | null // String
+ posts?: NexusGenInputs['PostRelateToManyForCreateInput'] | null // PostRelateToManyForCreateInput
}
AuthorOrderByInput: { // input type
- email?: NexusGenEnums['OrderDirection'] | null; // OrderDirection
- id?: NexusGenEnums['OrderDirection'] | null; // OrderDirection
- name?: NexusGenEnums['OrderDirection'] | null; // OrderDirection
+ email?: NexusGenEnums['OrderDirection'] | null // OrderDirection
+ id?: NexusGenEnums['OrderDirection'] | null // OrderDirection
+ name?: NexusGenEnums['OrderDirection'] | null // OrderDirection
}
AuthorRelateToOneForCreateInput: { // input type
- connect?: NexusGenInputs['AuthorWhereUniqueInput'] | null; // AuthorWhereUniqueInput
- create?: NexusGenInputs['AuthorCreateInput'] | null; // AuthorCreateInput
+ connect?: NexusGenInputs['AuthorWhereUniqueInput'] | null // AuthorWhereUniqueInput
+ create?: NexusGenInputs['AuthorCreateInput'] | null // AuthorCreateInput
}
AuthorRelateToOneForUpdateInput: { // input type
- connect?: NexusGenInputs['AuthorWhereUniqueInput'] | null; // AuthorWhereUniqueInput
- create?: NexusGenInputs['AuthorCreateInput'] | null; // AuthorCreateInput
- disconnect?: boolean | null; // Boolean
+ connect?: NexusGenInputs['AuthorWhereUniqueInput'] | null // AuthorWhereUniqueInput
+ create?: NexusGenInputs['AuthorCreateInput'] | null // AuthorCreateInput
+ disconnect?: boolean | null // Boolean
}
AuthorUpdateArgs: { // input type
- data: NexusGenInputs['AuthorUpdateInput']; // AuthorUpdateInput!
- where: NexusGenInputs['AuthorWhereUniqueInput']; // AuthorWhereUniqueInput!
+ data: NexusGenInputs['AuthorUpdateInput'] // AuthorUpdateInput!
+ where: NexusGenInputs['AuthorWhereUniqueInput'] // AuthorWhereUniqueInput!
}
AuthorUpdateInput: { // input type
- email?: string | null; // String
- name?: string | null; // String
- posts?: NexusGenInputs['PostRelateToManyForUpdateInput'] | null; // PostRelateToManyForUpdateInput
+ email?: string | null // String
+ name?: string | null // String
+ posts?: NexusGenInputs['PostRelateToManyForUpdateInput'] | null // PostRelateToManyForUpdateInput
}
AuthorWhereInput: { // input type
- AND?: NexusGenInputs['AuthorWhereInput'][] | null; // [AuthorWhereInput!]
- NOT?: NexusGenInputs['AuthorWhereInput'][] | null; // [AuthorWhereInput!]
- OR?: NexusGenInputs['AuthorWhereInput'][] | null; // [AuthorWhereInput!]
- email?: NexusGenInputs['StringFilter'] | null; // StringFilter
- id?: NexusGenInputs['IDFilter'] | null; // IDFilter
- name?: NexusGenInputs['StringFilter'] | null; // StringFilter
- posts?: NexusGenInputs['PostManyRelationFilter'] | null; // PostManyRelationFilter
+ AND?: NexusGenInputs['AuthorWhereInput'][] | null // [AuthorWhereInput!]
+ NOT?: NexusGenInputs['AuthorWhereInput'][] | null // [AuthorWhereInput!]
+ OR?: NexusGenInputs['AuthorWhereInput'][] | null // [AuthorWhereInput!]
+ email?: NexusGenInputs['StringFilter'] | null // StringFilter
+ id?: NexusGenInputs['IDFilter'] | null // IDFilter
+ name?: NexusGenInputs['StringFilter'] | null // StringFilter
+ posts?: NexusGenInputs['PostManyRelationFilter'] | null // PostManyRelationFilter
}
AuthorWhereUniqueInput: { // input type
- email?: string | null; // String
- id?: string | null; // ID
+ email?: string | null // String
+ id?: string | null // ID
}
DateTimeNullableFilter: { // input type
- equals?: NexusGenScalars['DateTime'] | null; // DateTime
- gt?: NexusGenScalars['DateTime'] | null; // DateTime
- gte?: NexusGenScalars['DateTime'] | null; // DateTime
- in?: NexusGenScalars['DateTime'][] | null; // [DateTime!]
- lt?: NexusGenScalars['DateTime'] | null; // DateTime
- lte?: NexusGenScalars['DateTime'] | null; // DateTime
- not?: NexusGenInputs['DateTimeNullableFilter'] | null; // DateTimeNullableFilter
- notIn?: NexusGenScalars['DateTime'][] | null; // [DateTime!]
+ equals?: NexusGenScalars['DateTime'] | null // DateTime
+ gt?: NexusGenScalars['DateTime'] | null // DateTime
+ gte?: NexusGenScalars['DateTime'] | null // DateTime
+ in?: NexusGenScalars['DateTime'][] | null // [DateTime!]
+ lt?: NexusGenScalars['DateTime'] | null // DateTime
+ lte?: NexusGenScalars['DateTime'] | null // DateTime
+ not?: NexusGenInputs['DateTimeNullableFilter'] | null // DateTimeNullableFilter
+ notIn?: NexusGenScalars['DateTime'][] | null // [DateTime!]
}
IDFilter: { // input type
- equals?: string | null; // ID
- gt?: string | null; // ID
- gte?: string | null; // ID
- in?: string[] | null; // [ID!]
- lt?: string | null; // ID
- lte?: string | null; // ID
- not?: NexusGenInputs['IDFilter'] | null; // IDFilter
- notIn?: string[] | null; // [ID!]
+ equals?: string | null // ID
+ gt?: string | null // ID
+ gte?: string | null // ID
+ in?: string[] | null // [ID!]
+ lt?: string | null // ID
+ lte?: string | null // ID
+ not?: NexusGenInputs['IDFilter'] | null // IDFilter
+ notIn?: string[] | null // [ID!]
}
NestedStringFilter: { // input type
- contains?: string | null; // String
- endsWith?: string | null; // String
- equals?: string | null; // String
- gt?: string | null; // String
- gte?: string | null; // String
- in?: string[] | null; // [String!]
- lt?: string | null; // String
- lte?: string | null; // String
- not?: NexusGenInputs['NestedStringFilter'] | null; // NestedStringFilter
- notIn?: string[] | null; // [String!]
- startsWith?: string | null; // String
+ contains?: string | null // String
+ endsWith?: string | null // String
+ equals?: string | null // String
+ gt?: string | null // String
+ gte?: string | null // String
+ in?: string[] | null // [String!]
+ lt?: string | null // String
+ lte?: string | null // String
+ not?: NexusGenInputs['NestedStringFilter'] | null // NestedStringFilter
+ notIn?: string[] | null // [String!]
+ startsWith?: string | null // String
}
PostCreateInput: { // input type
- author?: NexusGenInputs['AuthorRelateToOneForCreateInput'] | null; // AuthorRelateToOneForCreateInput
- content?: string | null; // String
- publishDate?: NexusGenScalars['DateTime'] | null; // DateTime
- status?: NexusGenEnums['PostStatusType'] | null; // PostStatusType
- title?: string | null; // String
+ author?: NexusGenInputs['AuthorRelateToOneForCreateInput'] | null // AuthorRelateToOneForCreateInput
+ content?: string | null // String
+ publishDate?: NexusGenScalars['DateTime'] | null // DateTime
+ status?: NexusGenEnums['PostStatusType'] | null // PostStatusType
+ title?: string | null // String
}
PostManyRelationFilter: { // input type
- every?: NexusGenInputs['PostWhereInput'] | null; // PostWhereInput
- none?: NexusGenInputs['PostWhereInput'] | null; // PostWhereInput
- some?: NexusGenInputs['PostWhereInput'] | null; // PostWhereInput
+ every?: NexusGenInputs['PostWhereInput'] | null // PostWhereInput
+ none?: NexusGenInputs['PostWhereInput'] | null // PostWhereInput
+ some?: NexusGenInputs['PostWhereInput'] | null // PostWhereInput
}
PostOrderByInput: { // input type
- content?: NexusGenEnums['OrderDirection'] | null; // OrderDirection
- id?: NexusGenEnums['OrderDirection'] | null; // OrderDirection
- publishDate?: NexusGenEnums['OrderDirection'] | null; // OrderDirection
- status?: NexusGenEnums['OrderDirection'] | null; // OrderDirection
- title?: NexusGenEnums['OrderDirection'] | null; // OrderDirection
+ content?: NexusGenEnums['OrderDirection'] | null // OrderDirection
+ id?: NexusGenEnums['OrderDirection'] | null // OrderDirection
+ publishDate?: NexusGenEnums['OrderDirection'] | null // OrderDirection
+ status?: NexusGenEnums['OrderDirection'] | null // OrderDirection
+ title?: NexusGenEnums['OrderDirection'] | null // OrderDirection
}
PostRelateToManyForCreateInput: { // input type
- connect?: NexusGenInputs['PostWhereUniqueInput'][] | null; // [PostWhereUniqueInput!]
- create?: NexusGenInputs['PostCreateInput'][] | null; // [PostCreateInput!]
+ connect?: NexusGenInputs['PostWhereUniqueInput'][] | null // [PostWhereUniqueInput!]
+ create?: NexusGenInputs['PostCreateInput'][] | null // [PostCreateInput!]
}
PostRelateToManyForUpdateInput: { // input type
- connect?: NexusGenInputs['PostWhereUniqueInput'][] | null; // [PostWhereUniqueInput!]
- create?: NexusGenInputs['PostCreateInput'][] | null; // [PostCreateInput!]
- disconnect?: NexusGenInputs['PostWhereUniqueInput'][] | null; // [PostWhereUniqueInput!]
- set?: NexusGenInputs['PostWhereUniqueInput'][] | null; // [PostWhereUniqueInput!]
+ connect?: NexusGenInputs['PostWhereUniqueInput'][] | null // [PostWhereUniqueInput!]
+ create?: NexusGenInputs['PostCreateInput'][] | null // [PostCreateInput!]
+ disconnect?: NexusGenInputs['PostWhereUniqueInput'][] | null // [PostWhereUniqueInput!]
+ set?: NexusGenInputs['PostWhereUniqueInput'][] | null // [PostWhereUniqueInput!]
}
PostStatusTypeNullableFilter: { // input type
- equals?: NexusGenEnums['PostStatusType'] | null; // PostStatusType
- in?: NexusGenEnums['PostStatusType'][] | null; // [PostStatusType!]
- not?: NexusGenInputs['PostStatusTypeNullableFilter'] | null; // PostStatusTypeNullableFilter
- notIn?: NexusGenEnums['PostStatusType'][] | null; // [PostStatusType!]
+ equals?: NexusGenEnums['PostStatusType'] | null // PostStatusType
+ in?: NexusGenEnums['PostStatusType'][] | null // [PostStatusType!]
+ not?: NexusGenInputs['PostStatusTypeNullableFilter'] | null // PostStatusTypeNullableFilter
+ notIn?: NexusGenEnums['PostStatusType'][] | null // [PostStatusType!]
}
PostUpdateArgs: { // input type
- data: NexusGenInputs['PostUpdateInput']; // PostUpdateInput!
- where: NexusGenInputs['PostWhereUniqueInput']; // PostWhereUniqueInput!
+ data: NexusGenInputs['PostUpdateInput'] // PostUpdateInput!
+ where: NexusGenInputs['PostWhereUniqueInput'] // PostWhereUniqueInput!
}
PostUpdateInput: { // input type
- author?: NexusGenInputs['AuthorRelateToOneForUpdateInput'] | null; // AuthorRelateToOneForUpdateInput
- content?: string | null; // String
- publishDate?: NexusGenScalars['DateTime'] | null; // DateTime
- status?: NexusGenEnums['PostStatusType'] | null; // PostStatusType
- title?: string | null; // String
+ author?: NexusGenInputs['AuthorRelateToOneForUpdateInput'] | null // AuthorRelateToOneForUpdateInput
+ content?: string | null // String
+ publishDate?: NexusGenScalars['DateTime'] | null // DateTime
+ status?: NexusGenEnums['PostStatusType'] | null // PostStatusType
+ title?: string | null // String
}
PostWhereInput: { // input type
- AND?: NexusGenInputs['PostWhereInput'][] | null; // [PostWhereInput!]
- NOT?: NexusGenInputs['PostWhereInput'][] | null; // [PostWhereInput!]
- OR?: NexusGenInputs['PostWhereInput'][] | null; // [PostWhereInput!]
- author?: NexusGenInputs['AuthorWhereInput'] | null; // AuthorWhereInput
- content?: NexusGenInputs['StringFilter'] | null; // StringFilter
- id?: NexusGenInputs['IDFilter'] | null; // IDFilter
- publishDate?: NexusGenInputs['DateTimeNullableFilter'] | null; // DateTimeNullableFilter
- status?: NexusGenInputs['PostStatusTypeNullableFilter'] | null; // PostStatusTypeNullableFilter
- title?: NexusGenInputs['StringFilter'] | null; // StringFilter
+ AND?: NexusGenInputs['PostWhereInput'][] | null // [PostWhereInput!]
+ NOT?: NexusGenInputs['PostWhereInput'][] | null // [PostWhereInput!]
+ OR?: NexusGenInputs['PostWhereInput'][] | null // [PostWhereInput!]
+ author?: NexusGenInputs['AuthorWhereInput'] | null // AuthorWhereInput
+ content?: NexusGenInputs['StringFilter'] | null // StringFilter
+ id?: NexusGenInputs['IDFilter'] | null // IDFilter
+ publishDate?: NexusGenInputs['DateTimeNullableFilter'] | null // DateTimeNullableFilter
+ status?: NexusGenInputs['PostStatusTypeNullableFilter'] | null // PostStatusTypeNullableFilter
+ title?: NexusGenInputs['StringFilter'] | null // StringFilter
}
PostWhereUniqueInput: { // input type
- id?: string | null; // ID
+ id?: string | null // ID
}
StringFilter: { // input type
- contains?: string | null; // String
- endsWith?: string | null; // String
- equals?: string | null; // String
- gt?: string | null; // String
- gte?: string | null; // String
- in?: string[] | null; // [String!]
- lt?: string | null; // String
- lte?: string | null; // String
- not?: NexusGenInputs['NestedStringFilter'] | null; // NestedStringFilter
- notIn?: string[] | null; // [String!]
- startsWith?: string | null; // String
+ contains?: string | null // String
+ endsWith?: string | null // String
+ equals?: string | null // String
+ gt?: string | null // String
+ gte?: string | null // String
+ in?: string[] | null // [String!]
+ lt?: string | null // String
+ lte?: string | null // String
+ not?: NexusGenInputs['NestedStringFilter'] | null // NestedStringFilter
+ notIn?: string[] | null // [String!]
+ startsWith?: string | null // String
}
}
@@ -186,59 +186,59 @@ export interface NexusGenScalars {
}
export interface NexusGenObjects {
- Author: {};
+ Author: {}
KeystoneAdminMeta: { // root type
- lists: NexusGenRootTypes['KeystoneAdminUIListMeta'][]; // [KeystoneAdminUIListMeta!]!
+ lists: NexusGenRootTypes['KeystoneAdminUIListMeta'][] // [KeystoneAdminUIListMeta!]!
}
KeystoneAdminUIFieldGroupMeta: { // root type
- description?: string | null; // String
- fields: NexusGenRootTypes['KeystoneAdminUIFieldMeta'][]; // [KeystoneAdminUIFieldMeta!]!
- label: string; // String!
+ description?: string | null // String
+ fields: NexusGenRootTypes['KeystoneAdminUIFieldMeta'][] // [KeystoneAdminUIFieldMeta!]!
+ label: string // String!
}
KeystoneAdminUIFieldMeta: { // root type
- createView: NexusGenRootTypes['KeystoneAdminUIFieldMetaCreateView']; // KeystoneAdminUIFieldMetaCreateView!
- customViewsIndex?: number | null; // Int
- description?: string | null; // String
- fieldMeta?: NexusGenScalars['JSON'] | null; // JSON
- isNonNull?: NexusGenEnums['KeystoneAdminUIFieldMetaIsNonNull'][] | null; // [KeystoneAdminUIFieldMetaIsNonNull!]
- label: string; // String!
- listView: NexusGenRootTypes['KeystoneAdminUIFieldMetaListView']; // KeystoneAdminUIFieldMetaListView!
- path: string; // String!
- search?: NexusGenEnums['QueryMode'] | null; // QueryMode
- viewsIndex: number; // Int!
- }
- KeystoneAdminUIFieldMetaCreateView: {};
- KeystoneAdminUIFieldMetaItemView: {};
- KeystoneAdminUIFieldMetaListView: {};
+ createView: NexusGenRootTypes['KeystoneAdminUIFieldMetaCreateView'] // KeystoneAdminUIFieldMetaCreateView!
+ customViewsIndex?: number | null // Int
+ description?: string | null // String
+ fieldMeta?: NexusGenScalars['JSON'] | null // JSON
+ isNonNull?: NexusGenEnums['KeystoneAdminUIFieldMetaIsNonNull'][] | null // [KeystoneAdminUIFieldMetaIsNonNull!]
+ label: string // String!
+ listView: NexusGenRootTypes['KeystoneAdminUIFieldMetaListView'] // KeystoneAdminUIFieldMetaListView!
+ path: string // String!
+ search?: NexusGenEnums['QueryMode'] | null // QueryMode
+ viewsIndex: number // Int!
+ }
+ KeystoneAdminUIFieldMetaCreateView: {}
+ KeystoneAdminUIFieldMetaItemView: {}
+ KeystoneAdminUIFieldMetaListView: {}
KeystoneAdminUIListMeta: { // root type
- description?: string | null; // String
- fields: NexusGenRootTypes['KeystoneAdminUIFieldMeta'][]; // [KeystoneAdminUIFieldMeta!]!
- groups: NexusGenRootTypes['KeystoneAdminUIFieldGroupMeta'][]; // [KeystoneAdminUIFieldGroupMeta!]!
- initialColumns: string[]; // [String!]!
- initialSort?: NexusGenRootTypes['KeystoneAdminUISort'] | null; // KeystoneAdminUISort
- isSingleton: boolean; // Boolean!
- itemQueryName: string; // String!
- key: string; // String!
- label: string; // String!
- labelField: string; // String!
- listQueryName: string; // String!
- pageSize: number; // Int!
- path: string; // String!
- plural: string; // String!
- singular: string; // String!
+ description?: string | null // String
+ fields: NexusGenRootTypes['KeystoneAdminUIFieldMeta'][] // [KeystoneAdminUIFieldMeta!]!
+ groups: NexusGenRootTypes['KeystoneAdminUIFieldGroupMeta'][] // [KeystoneAdminUIFieldGroupMeta!]!
+ initialColumns: string[] // [String!]!
+ initialSort?: NexusGenRootTypes['KeystoneAdminUISort'] | null // KeystoneAdminUISort
+ isSingleton: boolean // Boolean!
+ itemQueryName: string // String!
+ key: string // String!
+ label: string // String!
+ labelField: string // String!
+ listQueryName: string // String!
+ pageSize: number // Int!
+ path: string // String!
+ plural: string // String!
+ singular: string // String!
}
KeystoneAdminUISort: { // root type
- direction: NexusGenEnums['KeystoneAdminUISortDirection']; // KeystoneAdminUISortDirection!
- field: string; // String!
+ direction: NexusGenEnums['KeystoneAdminUISortDirection'] // KeystoneAdminUISortDirection!
+ field: string // String!
}
- KeystoneMeta: {};
- Mutation: {};
+ KeystoneMeta: {}
+ Mutation: {}
NexusThing: { // root type
- id?: number | null; // Int
- title?: string | null; // String
+ id?: number | null // Int
+ title?: string | null // String
}
- Post: {};
- Query: {};
+ Post: {}
+ Query: {}
}
export interface NexusGenInterfaces {
@@ -253,109 +253,109 @@ export type NexusGenAllTypes = NexusGenRootTypes & NexusGenScalars & NexusGenEnu
export interface NexusGenFieldTypes {
Author: { // field return type
- email: string | null; // String
- id: string; // ID!
- name: string | null; // String
- posts: NexusGenRootTypes['Post'][] | null; // [Post!]
- postsCount: number | null; // Int
+ email: string | null // String
+ id: string // ID!
+ name: string | null // String
+ posts: NexusGenRootTypes['Post'][] | null // [Post!]
+ postsCount: number | null // Int
}
KeystoneAdminMeta: { // field return type
- list: NexusGenRootTypes['KeystoneAdminUIListMeta'] | null; // KeystoneAdminUIListMeta
- lists: NexusGenRootTypes['KeystoneAdminUIListMeta'][]; // [KeystoneAdminUIListMeta!]!
+ list: NexusGenRootTypes['KeystoneAdminUIListMeta'] | null // KeystoneAdminUIListMeta
+ lists: NexusGenRootTypes['KeystoneAdminUIListMeta'][] // [KeystoneAdminUIListMeta!]!
}
KeystoneAdminUIFieldGroupMeta: { // field return type
- description: string | null; // String
- fields: NexusGenRootTypes['KeystoneAdminUIFieldMeta'][]; // [KeystoneAdminUIFieldMeta!]!
- label: string; // String!
+ description: string | null // String
+ fields: NexusGenRootTypes['KeystoneAdminUIFieldMeta'][] // [KeystoneAdminUIFieldMeta!]!
+ label: string // String!
}
KeystoneAdminUIFieldMeta: { // field return type
- createView: NexusGenRootTypes['KeystoneAdminUIFieldMetaCreateView']; // KeystoneAdminUIFieldMetaCreateView!
- customViewsIndex: number | null; // Int
- description: string | null; // String
- fieldMeta: NexusGenScalars['JSON'] | null; // JSON
- isFilterable: boolean; // Boolean!
- isNonNull: NexusGenEnums['KeystoneAdminUIFieldMetaIsNonNull'][] | null; // [KeystoneAdminUIFieldMetaIsNonNull!]
- isOrderable: boolean; // Boolean!
- itemView: NexusGenRootTypes['KeystoneAdminUIFieldMetaItemView'] | null; // KeystoneAdminUIFieldMetaItemView
- label: string; // String!
- listView: NexusGenRootTypes['KeystoneAdminUIFieldMetaListView']; // KeystoneAdminUIFieldMetaListView!
- path: string; // String!
- search: NexusGenEnums['QueryMode'] | null; // QueryMode
- viewsIndex: number; // Int!
+ createView: NexusGenRootTypes['KeystoneAdminUIFieldMetaCreateView'] // KeystoneAdminUIFieldMetaCreateView!
+ customViewsIndex: number | null // Int
+ description: string | null // String
+ fieldMeta: NexusGenScalars['JSON'] | null // JSON
+ isFilterable: boolean // Boolean!
+ isNonNull: NexusGenEnums['KeystoneAdminUIFieldMetaIsNonNull'][] | null // [KeystoneAdminUIFieldMetaIsNonNull!]
+ isOrderable: boolean // Boolean!
+ itemView: NexusGenRootTypes['KeystoneAdminUIFieldMetaItemView'] | null // KeystoneAdminUIFieldMetaItemView
+ label: string // String!
+ listView: NexusGenRootTypes['KeystoneAdminUIFieldMetaListView'] // KeystoneAdminUIFieldMetaListView!
+ path: string // String!
+ search: NexusGenEnums['QueryMode'] | null // QueryMode
+ viewsIndex: number // Int!
}
KeystoneAdminUIFieldMetaCreateView: { // field return type
- fieldMode: NexusGenEnums['KeystoneAdminUIFieldMetaCreateViewFieldMode']; // KeystoneAdminUIFieldMetaCreateViewFieldMode!
+ fieldMode: NexusGenEnums['KeystoneAdminUIFieldMetaCreateViewFieldMode'] // KeystoneAdminUIFieldMetaCreateViewFieldMode!
}
KeystoneAdminUIFieldMetaItemView: { // field return type
- fieldMode: NexusGenEnums['KeystoneAdminUIFieldMetaItemViewFieldMode'] | null; // KeystoneAdminUIFieldMetaItemViewFieldMode
- fieldPosition: NexusGenEnums['KeystoneAdminUIFieldMetaItemViewFieldPosition'] | null; // KeystoneAdminUIFieldMetaItemViewFieldPosition
+ fieldMode: NexusGenEnums['KeystoneAdminUIFieldMetaItemViewFieldMode'] | null // KeystoneAdminUIFieldMetaItemViewFieldMode
+ fieldPosition: NexusGenEnums['KeystoneAdminUIFieldMetaItemViewFieldPosition'] | null // KeystoneAdminUIFieldMetaItemViewFieldPosition
}
KeystoneAdminUIFieldMetaListView: { // field return type
- fieldMode: NexusGenEnums['KeystoneAdminUIFieldMetaListViewFieldMode']; // KeystoneAdminUIFieldMetaListViewFieldMode!
+ fieldMode: NexusGenEnums['KeystoneAdminUIFieldMetaListViewFieldMode'] // KeystoneAdminUIFieldMetaListViewFieldMode!
}
KeystoneAdminUIListMeta: { // field return type
- description: string | null; // String
- fields: NexusGenRootTypes['KeystoneAdminUIFieldMeta'][]; // [KeystoneAdminUIFieldMeta!]!
- groups: NexusGenRootTypes['KeystoneAdminUIFieldGroupMeta'][]; // [KeystoneAdminUIFieldGroupMeta!]!
- hideCreate: boolean; // Boolean!
- hideDelete: boolean; // Boolean!
- initialColumns: string[]; // [String!]!
- initialSort: NexusGenRootTypes['KeystoneAdminUISort'] | null; // KeystoneAdminUISort
- isHidden: boolean; // Boolean!
- isSingleton: boolean; // Boolean!
- itemQueryName: string; // String!
- key: string; // String!
- label: string; // String!
- labelField: string; // String!
- listQueryName: string; // String!
- pageSize: number; // Int!
- path: string; // String!
- plural: string; // String!
- singular: string; // String!
+ description: string | null // String
+ fields: NexusGenRootTypes['KeystoneAdminUIFieldMeta'][] // [KeystoneAdminUIFieldMeta!]!
+ groups: NexusGenRootTypes['KeystoneAdminUIFieldGroupMeta'][] // [KeystoneAdminUIFieldGroupMeta!]!
+ hideCreate: boolean // Boolean!
+ hideDelete: boolean // Boolean!
+ initialColumns: string[] // [String!]!
+ initialSort: NexusGenRootTypes['KeystoneAdminUISort'] | null // KeystoneAdminUISort
+ isHidden: boolean // Boolean!
+ isSingleton: boolean // Boolean!
+ itemQueryName: string // String!
+ key: string // String!
+ label: string // String!
+ labelField: string // String!
+ listQueryName: string // String!
+ pageSize: number // Int!
+ path: string // String!
+ plural: string // String!
+ singular: string // String!
}
KeystoneAdminUISort: { // field return type
- direction: NexusGenEnums['KeystoneAdminUISortDirection']; // KeystoneAdminUISortDirection!
- field: string; // String!
+ direction: NexusGenEnums['KeystoneAdminUISortDirection'] // KeystoneAdminUISortDirection!
+ field: string // String!
}
KeystoneMeta: { // field return type
- adminMeta: NexusGenRootTypes['KeystoneAdminMeta']; // KeystoneAdminMeta!
+ adminMeta: NexusGenRootTypes['KeystoneAdminMeta'] // KeystoneAdminMeta!
}
Mutation: { // field return type
- createAuthor: NexusGenRootTypes['Author'] | null; // Author
- createAuthors: Array | null; // [Author]
- createPost: NexusGenRootTypes['Post'] | null; // Post
- createPosts: Array | null; // [Post]
- deleteAuthor: NexusGenRootTypes['Author'] | null; // Author
- deleteAuthors: Array | null; // [Author]
- deletePost: NexusGenRootTypes['Post'] | null; // Post
- deletePosts: Array | null; // [Post]
- updateAuthor: NexusGenRootTypes['Author'] | null; // Author
- updateAuthors: Array | null; // [Author]
- updatePost: NexusGenRootTypes['Post'] | null; // Post
- updatePosts: Array | null; // [Post]
+ createAuthor: NexusGenRootTypes['Author'] | null // Author
+ createAuthors: Array | null // [Author]
+ createPost: NexusGenRootTypes['Post'] | null // Post
+ createPosts: Array | null // [Post]
+ deleteAuthor: NexusGenRootTypes['Author'] | null // Author
+ deleteAuthors: Array | null // [Author]
+ deletePost: NexusGenRootTypes['Post'] | null // Post
+ deletePosts: Array | null // [Post]
+ updateAuthor: NexusGenRootTypes['Author'] | null // Author
+ updateAuthors: Array | null // [Author]
+ updatePost: NexusGenRootTypes['Post'] | null // Post
+ updatePosts: Array | null // [Post]
}
NexusThing: { // field return type
- id: number | null; // Int
- title: string | null; // String
+ id: number | null // Int
+ title: string | null // String
}
Post: { // field return type
- author: NexusGenRootTypes['Author'] | null; // Author
- content: string | null; // String
- id: string; // ID!
- publishDate: NexusGenScalars['DateTime'] | null; // DateTime
- status: NexusGenEnums['PostStatusType'] | null; // PostStatusType
- title: string | null; // String
+ author: NexusGenRootTypes['Author'] | null // Author
+ content: string | null // String
+ id: string // ID!
+ publishDate: NexusGenScalars['DateTime'] | null // DateTime
+ status: NexusGenEnums['PostStatusType'] | null // PostStatusType
+ title: string | null // String
}
Query: { // field return type
- author: NexusGenRootTypes['Author'] | null; // Author
- authors: NexusGenRootTypes['Author'][] | null; // [Author!]
- authorsCount: number | null; // Int
- keystone: NexusGenRootTypes['KeystoneMeta']; // KeystoneMeta!
- nexusPosts: Array; // [Post]!
- post: NexusGenRootTypes['Post'] | null; // Post
- posts: NexusGenRootTypes['Post'][] | null; // [Post!]
- postsCount: number | null; // Int
- things: Array; // [NexusThing]!
+ author: NexusGenRootTypes['Author'] | null // Author
+ authors: NexusGenRootTypes['Author'][] | null // [Author!]
+ authorsCount: number | null // Int
+ keystone: NexusGenRootTypes['KeystoneMeta'] // KeystoneMeta!
+ nexusPosts: Array // [Post]!
+ post: NexusGenRootTypes['Post'] | null // Post
+ posts: NexusGenRootTypes['Post'][] | null // [Post!]
+ postsCount: number | null // Int
+ things: Array // [NexusThing]!
}
}
@@ -470,96 +470,96 @@ export interface NexusGenFieldTypeNames {
export interface NexusGenArgTypes {
Author: {
posts: { // args
- cursor?: NexusGenInputs['PostWhereUniqueInput'] | null; // PostWhereUniqueInput
- orderBy: NexusGenInputs['PostOrderByInput'][]; // [PostOrderByInput!]!
- skip: number; // Int!
- take?: number | null; // Int
- where: NexusGenInputs['PostWhereInput']; // PostWhereInput!
+ cursor?: NexusGenInputs['PostWhereUniqueInput'] | null // PostWhereUniqueInput
+ orderBy: NexusGenInputs['PostOrderByInput'][] // [PostOrderByInput!]!
+ skip: number // Int!
+ take?: number | null // Int
+ where: NexusGenInputs['PostWhereInput'] // PostWhereInput!
}
postsCount: { // args
- where: NexusGenInputs['PostWhereInput']; // PostWhereInput!
+ where: NexusGenInputs['PostWhereInput'] // PostWhereInput!
}
}
KeystoneAdminMeta: {
list: { // args
- key: string; // String!
+ key: string // String!
}
}
KeystoneAdminUIFieldMeta: {
itemView: { // args
- id?: string | null; // ID
+ id?: string | null // ID
}
}
Mutation: {
createAuthor: { // args
- data: NexusGenInputs['AuthorCreateInput']; // AuthorCreateInput!
+ data: NexusGenInputs['AuthorCreateInput'] // AuthorCreateInput!
}
createAuthors: { // args
- data: NexusGenInputs['AuthorCreateInput'][]; // [AuthorCreateInput!]!
+ data: NexusGenInputs['AuthorCreateInput'][] // [AuthorCreateInput!]!
}
createPost: { // args
- data: NexusGenInputs['PostCreateInput']; // PostCreateInput!
+ data: NexusGenInputs['PostCreateInput'] // PostCreateInput!
}
createPosts: { // args
- data: NexusGenInputs['PostCreateInput'][]; // [PostCreateInput!]!
+ data: NexusGenInputs['PostCreateInput'][] // [PostCreateInput!]!
}
deleteAuthor: { // args
- where: NexusGenInputs['AuthorWhereUniqueInput']; // AuthorWhereUniqueInput!
+ where: NexusGenInputs['AuthorWhereUniqueInput'] // AuthorWhereUniqueInput!
}
deleteAuthors: { // args
- where: NexusGenInputs['AuthorWhereUniqueInput'][]; // [AuthorWhereUniqueInput!]!
+ where: NexusGenInputs['AuthorWhereUniqueInput'][] // [AuthorWhereUniqueInput!]!
}
deletePost: { // args
- where: NexusGenInputs['PostWhereUniqueInput']; // PostWhereUniqueInput!
+ where: NexusGenInputs['PostWhereUniqueInput'] // PostWhereUniqueInput!
}
deletePosts: { // args
- where: NexusGenInputs['PostWhereUniqueInput'][]; // [PostWhereUniqueInput!]!
+ where: NexusGenInputs['PostWhereUniqueInput'][] // [PostWhereUniqueInput!]!
}
updateAuthor: { // args
- data: NexusGenInputs['AuthorUpdateInput']; // AuthorUpdateInput!
- where: NexusGenInputs['AuthorWhereUniqueInput']; // AuthorWhereUniqueInput!
+ data: NexusGenInputs['AuthorUpdateInput'] // AuthorUpdateInput!
+ where: NexusGenInputs['AuthorWhereUniqueInput'] // AuthorWhereUniqueInput!
}
updateAuthors: { // args
- data: NexusGenInputs['AuthorUpdateArgs'][]; // [AuthorUpdateArgs!]!
+ data: NexusGenInputs['AuthorUpdateArgs'][] // [AuthorUpdateArgs!]!
}
updatePost: { // args
- data: NexusGenInputs['PostUpdateInput']; // PostUpdateInput!
- where: NexusGenInputs['PostWhereUniqueInput']; // PostWhereUniqueInput!
+ data: NexusGenInputs['PostUpdateInput'] // PostUpdateInput!
+ where: NexusGenInputs['PostWhereUniqueInput'] // PostWhereUniqueInput!
}
updatePosts: { // args
- data: NexusGenInputs['PostUpdateArgs'][]; // [PostUpdateArgs!]!
+ data: NexusGenInputs['PostUpdateArgs'][] // [PostUpdateArgs!]!
}
}
Query: {
author: { // args
- where: NexusGenInputs['AuthorWhereUniqueInput']; // AuthorWhereUniqueInput!
+ where: NexusGenInputs['AuthorWhereUniqueInput'] // AuthorWhereUniqueInput!
}
authors: { // args
- cursor?: NexusGenInputs['AuthorWhereUniqueInput'] | null; // AuthorWhereUniqueInput
- orderBy: NexusGenInputs['AuthorOrderByInput'][]; // [AuthorOrderByInput!]!
- skip: number; // Int!
- take?: number | null; // Int
- where: NexusGenInputs['AuthorWhereInput']; // AuthorWhereInput!
+ cursor?: NexusGenInputs['AuthorWhereUniqueInput'] | null // AuthorWhereUniqueInput
+ orderBy: NexusGenInputs['AuthorOrderByInput'][] // [AuthorOrderByInput!]!
+ skip: number // Int!
+ take?: number | null // Int
+ where: NexusGenInputs['AuthorWhereInput'] // AuthorWhereInput!
}
authorsCount: { // args
- where: NexusGenInputs['AuthorWhereInput']; // AuthorWhereInput!
+ where: NexusGenInputs['AuthorWhereInput'] // AuthorWhereInput!
}
nexusPosts: { // args
- id: string; // String!
- seconds: number; // Int!
+ id: string // String!
+ seconds: number // Int!
}
post: { // args
- where: NexusGenInputs['PostWhereUniqueInput']; // PostWhereUniqueInput!
+ where: NexusGenInputs['PostWhereUniqueInput'] // PostWhereUniqueInput!
}
posts: { // args
- cursor?: NexusGenInputs['PostWhereUniqueInput'] | null; // PostWhereUniqueInput
- orderBy: NexusGenInputs['PostOrderByInput'][]; // [PostOrderByInput!]!
- skip: number; // Int!
- take?: number | null; // Int
- where: NexusGenInputs['PostWhereInput']; // PostWhereInput!
+ cursor?: NexusGenInputs['PostWhereUniqueInput'] | null // PostWhereUniqueInput
+ orderBy: NexusGenInputs['PostOrderByInput'][] // [PostOrderByInput!]!
+ skip: number // Int!
+ take?: number | null // Int
+ where: NexusGenInputs['PostWhereInput'] // PostWhereInput!
}
postsCount: { // args
- where: NexusGenInputs['PostWhereInput']; // PostWhereInput!
+ where: NexusGenInputs['PostWhereInput'] // PostWhereInput!
}
}
}
@@ -570,21 +570,21 @@ export interface NexusGenAbstractTypeMembers {
export interface NexusGenTypeInterfaces {
}
-export type NexusGenObjectNames = keyof NexusGenObjects;
+export type NexusGenObjectNames = keyof NexusGenObjects
-export type NexusGenInputNames = keyof NexusGenInputs;
+export type NexusGenInputNames = keyof NexusGenInputs
-export type NexusGenEnumNames = keyof NexusGenEnums;
+export type NexusGenEnumNames = keyof NexusGenEnums
-export type NexusGenInterfaceNames = never;
+export type NexusGenInterfaceNames = never
-export type NexusGenScalarNames = keyof NexusGenScalars;
+export type NexusGenScalarNames = keyof NexusGenScalars
-export type NexusGenUnionNames = never;
+export type NexusGenUnionNames = never
-export type NexusGenObjectsUsingAbstractStrategyIsTypeOf = never;
+export type NexusGenObjectsUsingAbstractStrategyIsTypeOf = never
-export type NexusGenAbstractsUsingStrategyResolveType = never;
+export type NexusGenAbstractsUsingStrategyResolveType = never
export type NexusGenFeaturesConfig = {
abstractTypeStrategies: {
@@ -595,29 +595,29 @@ export type NexusGenFeaturesConfig = {
}
export interface NexusGenTypes {
- context: Context;
- inputTypes: NexusGenInputs;
- rootTypes: NexusGenRootTypes;
- inputTypeShapes: NexusGenInputs & NexusGenEnums & NexusGenScalars;
- argTypes: NexusGenArgTypes;
- fieldTypes: NexusGenFieldTypes;
- fieldTypeNames: NexusGenFieldTypeNames;
- allTypes: NexusGenAllTypes;
- typeInterfaces: NexusGenTypeInterfaces;
- objectNames: NexusGenObjectNames;
- inputNames: NexusGenInputNames;
- enumNames: NexusGenEnumNames;
- interfaceNames: NexusGenInterfaceNames;
- scalarNames: NexusGenScalarNames;
- unionNames: NexusGenUnionNames;
- allInputTypes: NexusGenTypes['inputNames'] | NexusGenTypes['enumNames'] | NexusGenTypes['scalarNames'];
- allOutputTypes: NexusGenTypes['objectNames'] | NexusGenTypes['enumNames'] | NexusGenTypes['unionNames'] | NexusGenTypes['interfaceNames'] | NexusGenTypes['scalarNames'];
+ context: Context
+ inputTypes: NexusGenInputs
+ rootTypes: NexusGenRootTypes
+ inputTypeShapes: NexusGenInputs & NexusGenEnums & NexusGenScalars
+ argTypes: NexusGenArgTypes
+ fieldTypes: NexusGenFieldTypes
+ fieldTypeNames: NexusGenFieldTypeNames
+ allTypes: NexusGenAllTypes
+ typeInterfaces: NexusGenTypeInterfaces
+ objectNames: NexusGenObjectNames
+ inputNames: NexusGenInputNames
+ enumNames: NexusGenEnumNames
+ interfaceNames: NexusGenInterfaceNames
+ scalarNames: NexusGenScalarNames
+ unionNames: NexusGenUnionNames
+ allInputTypes: NexusGenTypes['inputNames'] | NexusGenTypes['enumNames'] | NexusGenTypes['scalarNames']
+ allOutputTypes: NexusGenTypes['objectNames'] | NexusGenTypes['enumNames'] | NexusGenTypes['unionNames'] | NexusGenTypes['interfaceNames'] | NexusGenTypes['scalarNames']
allNamedTypes: NexusGenTypes['allInputTypes'] | NexusGenTypes['allOutputTypes']
- abstractTypes: NexusGenTypes['interfaceNames'] | NexusGenTypes['unionNames'];
- abstractTypeMembers: NexusGenAbstractTypeMembers;
- objectsUsingAbstractStrategyIsTypeOf: NexusGenObjectsUsingAbstractStrategyIsTypeOf;
- abstractsUsingStrategyResolveType: NexusGenAbstractsUsingStrategyResolveType;
- features: NexusGenFeaturesConfig;
+ abstractTypes: NexusGenTypes['interfaceNames'] | NexusGenTypes['unionNames']
+ abstractTypeMembers: NexusGenAbstractTypeMembers
+ objectsUsingAbstractStrategyIsTypeOf: NexusGenObjectsUsingAbstractStrategyIsTypeOf
+ abstractsUsingStrategyResolveType: NexusGenAbstractsUsingStrategyResolveType
+ features: NexusGenFeaturesConfig
}
diff --git a/examples/extend-graphql-schema-nexus/schema.ts b/examples/extend-graphql-schema-nexus/schema.ts
index db796f0938b..c1bc875b254 100644
--- a/examples/extend-graphql-schema-nexus/schema.ts
+++ b/examples/extend-graphql-schema-nexus/schema.ts
@@ -1,10 +1,10 @@
-import path from 'path';
-import type { GraphQLSchema } from 'graphql';
-import { list } from '@keystone-6/core';
-import { allowAll } from '@keystone-6/core/access';
-import { select, relationship, text, timestamp } from '@keystone-6/core/fields';
-import * as nexus from 'nexus';
-import type { Lists } from './keystone-types';
+import path from 'path'
+import type { GraphQLSchema } from 'graphql'
+import { list } from '@keystone-6/core'
+import { allowAll } from '@keystone-6/core/access'
+import { select, relationship, text, timestamp } from '@keystone-6/core/fields'
+import * as nexus from 'nexus'
+import type { Lists } from './keystone-types'
export const lists: Lists = {
Post: list({
@@ -30,12 +30,12 @@ export const lists: Lists = {
posts: relationship({ ref: 'Post.author', many: true }),
},
}),
-};
+}
-export function extendGraphqlSchema(baseSchema: GraphQLSchema) {
+export function extendGraphqlSchema (baseSchema: GraphQLSchema) {
const NexusPostQuery = nexus.extendType({
type: 'Query',
- definition(t) {
+ definition (t) {
t.field('nexusPosts', {
type: nexus.nonNull(nexus.list('Post')),
args: {
@@ -43,8 +43,8 @@ export function extendGraphqlSchema(baseSchema: GraphQLSchema) {
seconds: nexus.nonNull(nexus.intArg({ default: 600 })),
},
- async resolve(root, { id, seconds }, context) {
- const cutoff = new Date(Date.now() - seconds * 1000);
+ async resolve (root, { id, seconds }, context) {
+ const cutoff = new Date(Date.now() - seconds * 1000)
// Note we use `context.db.Post` here as we have a return type
// of [Post], and this API provides results in the correct format.
@@ -52,35 +52,35 @@ export function extendGraphqlSchema(baseSchema: GraphQLSchema) {
// when accessing the fields in your GraphQL client.
return context.db.Post.findMany({
where: { author: { id: { equals: id } }, publishDate: { gt: cutoff } },
- }) as Promise; // TODO: nexus doesn't like
+ }) as Promise // TODO: nexus doesn't like
},
- });
+ })
},
- });
+ })
const NexusThing = nexus.objectType({
name: 'NexusThing',
- definition(t) {
- t.int('id');
- t.string('title');
+ definition (t) {
+ t.int('id')
+ t.string('title')
},
- });
+ })
const NexusThingQuery = nexus.extendType({
type: 'Query',
- definition(t) {
+ definition (t) {
t.nonNull.list.field('things', {
type: NexusThing,
- resolve() {
+ resolve () {
return [
{ id: 1, title: 'Keystone' },
{ id: 2, title: 'Prisma' },
{ id: 3, title: 'Nexus' },
- ];
+ ]
},
- });
+ })
},
- });
+ })
return nexus.makeSchema({
mergeSchema: {
@@ -102,5 +102,5 @@ export function extendGraphqlSchema(baseSchema: GraphQLSchema) {
module: path.join(process.cwd(), 'keystone-types.ts'),
export: 'Context',
},
- });
+ })
}
diff --git a/examples/extend-graphql-subscriptions/admin/components/CustomNavigation.tsx b/examples/extend-graphql-subscriptions/admin/components/CustomNavigation.tsx
index 0e3f68aa3f1..937432d09d1 100644
--- a/examples/extend-graphql-subscriptions/admin/components/CustomNavigation.tsx
+++ b/examples/extend-graphql-subscriptions/admin/components/CustomNavigation.tsx
@@ -1,15 +1,15 @@
-import React from 'react';
+import React from 'react'
-import { ListNavItems, NavigationContainer, NavItem } from '@keystone-6/core/admin-ui/components';
+import { ListNavItems, NavigationContainer, NavItem } from '@keystone-6/core/admin-ui/components'
-import type { NavigationProps } from '@keystone-6/core/admin-ui/components';
+import type { NavigationProps } from '@keystone-6/core/admin-ui/components'
-export function CustomNavigation({ lists, authenticatedItem }: NavigationProps) {
+export function CustomNavigation ({ lists, authenticatedItem }: NavigationProps) {
return (
Dashboard
Subscriptions Page
- );
+ )
}
diff --git a/examples/extend-graphql-subscriptions/admin/config.ts b/examples/extend-graphql-subscriptions/admin/config.ts
index f3c2329de29..c8140025899 100644
--- a/examples/extend-graphql-subscriptions/admin/config.ts
+++ b/examples/extend-graphql-subscriptions/admin/config.ts
@@ -1,6 +1,6 @@
-import { AdminConfig } from '@keystone-6/core/types';
+import { type AdminConfig } from '@keystone-6/core/types'
-import { CustomNavigation } from './components/CustomNavigation';
+import { CustomNavigation } from './components/CustomNavigation'
export const components: AdminConfig['components'] = {
Navigation: CustomNavigation,
-};
+}
diff --git a/examples/extend-graphql-subscriptions/admin/pages/subscriptions.tsx b/examples/extend-graphql-subscriptions/admin/pages/subscriptions.tsx
index a8351609a9a..a5b394ec154 100644
--- a/examples/extend-graphql-subscriptions/admin/pages/subscriptions.tsx
+++ b/examples/extend-graphql-subscriptions/admin/pages/subscriptions.tsx
@@ -1,19 +1,19 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { PageContainer } from '@keystone-6/core/admin-ui/components';
-import { jsx, Heading } from '@keystone-ui/core';
+import { PageContainer } from '@keystone-6/core/admin-ui/components'
+import { jsx, Heading } from '@keystone-ui/core'
import {
ApolloClient,
gql,
InMemoryCache,
useSubscription,
HttpLink,
-} from '@keystone-6/core/admin-ui/apollo';
-import { createClient } from 'graphql-ws';
-import { GraphQLWsLink } from '@apollo/client/link/subscriptions';
-import { css } from '@emotion/css';
+} from '@keystone-6/core/admin-ui/apollo'
+import { createClient } from 'graphql-ws'
+import { GraphQLWsLink } from '@apollo/client/link/subscriptions'
+import { css } from '@emotion/css'
-import { useState } from 'react';
+import { useState } from 'react'
const styles = {
container: css`
@@ -25,7 +25,7 @@ const styles = {
overflow-y: scroll;
padding: 1rem;
`,
-};
+}
// Setup the TIME subscription
const TIME = gql`
subscription TIME {
@@ -33,7 +33,7 @@ const TIME = gql`
iso
}
}
-`;
+`
// Setup the Post subscriptions
const POST_PUBLISHED = gql`
@@ -47,7 +47,7 @@ const POST_PUBLISHED = gql`
}
}
}
-`;
+`
const POST_UPDATED = gql`
subscription POST_UPDATED {
@@ -60,12 +60,12 @@ const POST_UPDATED = gql`
}
}
}
-`;
+`
// Setup a backup http link for Apollo
const httpLink = new HttpLink({
uri: `http://localhost:3000/api/graphql`,
-});
+})
// Setup the WebSocket link for Apollo
// NOTE: to stop Next.js SSR from breaking, we need to check if window is defined
@@ -77,38 +77,38 @@ const wsLink =
url: 'ws://localhost:3000/api/graphql',
})
)
- : httpLink;
+ : httpLink
// Setup the Apollo client for subscriptions
const subClient = new ApolloClient({
link: wsLink,
cache: new InMemoryCache(),
-});
+})
-export default function CustomPage() {
- const [timeRows, setTimeRows] = useState([] as string[]);
- const [updatedPostRows, setUpdatedPostRows] = useState([] as string[]);
- const [publishedPostRows, setPublishedPostRows] = useState([] as string[]);
+export default function CustomPage () {
+ const [timeRows, setTimeRows] = useState([] as string[])
+ const [updatedPostRows, setUpdatedPostRows] = useState([] as string[])
+ const [publishedPostRows, setPublishedPostRows] = useState([] as string[])
- function appendTime(row: string) {
- setTimeRows([...timeRows, row]);
+ function appendTime (row: string) {
+ setTimeRows([...timeRows, row])
}
// Subscribe to `time` [using the Apollo client above]
const { data, loading } = useSubscription(TIME, {
client: subClient,
onSubscriptionData: ({ subscriptionData }) => {
- appendTime(JSON.stringify(subscriptionData.data.time));
+ appendTime(JSON.stringify(subscriptionData.data.time))
},
- });
+ })
// Subscribe to `postPublished`
const { data: updatedPostData, loading: updatedPostLoading } = useSubscription(POST_UPDATED, {
client: subClient,
onSubscriptionData: ({ subscriptionData }) => {
- setUpdatedPostRows([...updatedPostRows, JSON.stringify(subscriptionData.data.postUpdated)]);
+ setUpdatedPostRows([...updatedPostRows, JSON.stringify(subscriptionData.data.postUpdated)])
},
- });
+ })
// Subscribe to `postUpdated`
const { data: publishedPostData, loading: publishedPostLoading } = useSubscription(
@@ -119,10 +119,10 @@ export default function CustomPage() {
setPublishedPostRows([
...publishedPostRows,
JSON.stringify(subscriptionData.data.postPublished),
- ]);
+ ])
},
}
- );
+ )
return (
Subscriptions}>
@@ -164,5 +164,5 @@ export default function CustomPage() {
- );
+ )
}
diff --git a/examples/extend-graphql-subscriptions/keystone.ts b/examples/extend-graphql-subscriptions/keystone.ts
index 56aa10ceff1..7f3ed1dd57c 100644
--- a/examples/extend-graphql-subscriptions/keystone.ts
+++ b/examples/extend-graphql-subscriptions/keystone.ts
@@ -1,7 +1,7 @@
-import { config } from '@keystone-6/core';
-import { fixPrismaPath } from '../example-utils';
-import { lists, extendGraphqlSchema } from './schema';
-import { extendHttpServer } from './websocket';
+import { config } from '@keystone-6/core'
+import { fixPrismaPath } from '../example-utils'
+import { lists, extendGraphqlSchema } from './schema'
+import { extendHttpServer } from './websocket'
export default config({
db: {
@@ -16,4 +16,4 @@ export default config({
extendHttpServer,
},
extendGraphqlSchema,
-});
+})
diff --git a/examples/extend-graphql-subscriptions/schema.ts b/examples/extend-graphql-subscriptions/schema.ts
index 5efbff5f72d..48baeb77fbf 100644
--- a/examples/extend-graphql-subscriptions/schema.ts
+++ b/examples/extend-graphql-subscriptions/schema.ts
@@ -1,11 +1,11 @@
-import { list } from '@keystone-6/core';
-import type { GraphQLSchema } from 'graphql';
-import { mergeSchemas } from '@graphql-tools/schema';
-import { select, relationship, text, timestamp } from '@keystone-6/core/fields';
-import { allowAll } from '@keystone-6/core/access';
-import { pubSub } from './websocket';
+import { list } from '@keystone-6/core'
+import type { GraphQLSchema } from 'graphql'
+import { mergeSchemas } from '@graphql-tools/schema'
+import { select, relationship, text, timestamp } from '@keystone-6/core/fields'
+import { allowAll } from '@keystone-6/core/access'
+import { pubSub } from './websocket'
-import type { Lists } from '.keystone/types';
+import type { Lists } from '.keystone/types'
export const lists: Lists = {
Post: list({
@@ -17,11 +17,11 @@ export const lists: Lists = {
// if you want access control, you need to use a different architecture
//
// tl;dr Keystone access filters are not respected in this scenario
- console.log('POST_UPDATED', { id: item?.id });
+ console.log('POST_UPDATED', { id: item?.id })
pubSub.publish('POST_UPDATED', {
postUpdated: item,
- });
+ })
},
},
fields: {
@@ -47,7 +47,7 @@ export const lists: Lists = {
posts: relationship({ ref: 'Post.author', many: true }),
},
}),
-};
+}
export const extendGraphqlSchema = (schema: GraphQLSchema) =>
mergeSchemas({
@@ -77,9 +77,9 @@ export const extendGraphqlSchema = (schema: GraphQLSchema) =>
const post = context.db.Post.updateOne({
where: { id },
data: { status: 'published', publishDate: new Date().toISOString() },
- });
+ })
- console.log('POST_PUBLISHED', { id });
+ console.log('POST_PUBLISHED', { id })
// WARNING: passing this item directly to pubSub bypasses any contextual access control
// if you want access control, you need to use a different architecture
@@ -87,26 +87,23 @@ export const extendGraphqlSchema = (schema: GraphQLSchema) =>
// tl;dr Keystone access filters are not respected in this scenario
pubSub.publish('POST_PUBLISHED', {
postPublished: post,
- });
+ })
- return post;
+ return post
},
},
// add the subscription resolvers
Subscription: {
time: {
- // @ts-ignore
subscribe: () => pubSub.asyncIterator(['TIME']),
},
postPublished: {
- // @ts-ignore
subscribe: () => pubSub.asyncIterator(['POST_PUBLISHED']),
},
postUpdated: {
- // @ts-ignore
subscribe: () => pubSub.asyncIterator(['POST_UPDATED']),
},
},
},
- });
+ })
diff --git a/examples/extend-graphql-subscriptions/websocket.ts b/examples/extend-graphql-subscriptions/websocket.ts
index c6aaf4035b5..262fad75f3c 100644
--- a/examples/extend-graphql-subscriptions/websocket.ts
+++ b/examples/extend-graphql-subscriptions/websocket.ts
@@ -1,21 +1,21 @@
-import http from 'http';
-import { useServer as wsUseServer } from 'graphql-ws/lib/use/ws';
-import { WebSocketServer } from 'ws';
-import { PubSub } from 'graphql-subscriptions';
-import { parse } from 'graphql';
+import type http from 'http'
+import { useServer as wsUseServer } from 'graphql-ws/lib/use/ws'
+import { WebSocketServer } from 'ws'
+import { PubSub } from 'graphql-subscriptions'
+import { parse } from 'graphql'
-import { KeystoneGraphQLAPI } from '@keystone-6/core/types';
-import { Context } from '.keystone/types';
+import { type KeystoneGraphQLAPI } from '@keystone-6/core/types'
+import { type Context } from '.keystone/types'
// Setup pubsub as a Global variable in dev so it survives Hot Reloads.
declare global {
- var graphqlSubscriptionPubSub: PubSub;
+ var graphqlSubscriptionPubSub: PubSub
}
// The 'graphql-subscriptions' pubsub library is not recommended for production use, but can be useful as an example
// for details see https://www.apollographql.com/docs/apollo-server/data/subscriptions/#the-pubsub-class
-export const pubSub = global.graphqlSubscriptionPubSub || new PubSub();
-globalThis.graphqlSubscriptionPubSub = pubSub;
+export const pubSub = global.graphqlSubscriptionPubSub || new PubSub()
+globalThis.graphqlSubscriptionPubSub = pubSub
export const extendHttpServer = (
httpServer: http.Server,
@@ -26,7 +26,7 @@ export const extendHttpServer = (
const wss = new WebSocketServer({
server: httpServer,
path: '/api/graphql',
- });
+ })
// Setup the WebSocket to handle GraphQL subscriptions using 'graphql-ws'
wsUseServer(
@@ -34,7 +34,7 @@ export const extendHttpServer = (
schema: graphqlSchema,
// run these onSubscribe functions as needed or remove them if you don't need them
onSubscribe: async (ctx: any, msg) => {
- const context = await commonContext.withRequest(ctx.extra.request);
+ const context = await commonContext.withRequest(ctx.extra.request)
// Return the execution args for this subscription passing through the Keystone Context
return {
schema: graphqlSchema,
@@ -42,19 +42,19 @@ export const extendHttpServer = (
document: parse(msg.payload.query),
variableValues: msg.payload.variables,
contextValue: context,
- };
+ }
},
},
wss
- );
+ )
// Send the time every second as an interval example of pub/sub
setInterval(() => {
- console.log('TIME', Date.now());
+ console.log('TIME', Date.now())
pubSub.publish('TIME', {
time: {
iso: new Date().toISOString(),
},
- });
- }, 1000);
-};
+ })
+ }, 1000)
+}
diff --git a/examples/extend-prisma-schema/keystone.ts b/examples/extend-prisma-schema/keystone.ts
index 417e6916c88..fc338180939 100644
--- a/examples/extend-prisma-schema/keystone.ts
+++ b/examples/extend-prisma-schema/keystone.ts
@@ -1,6 +1,6 @@
-import { config } from '@keystone-6/core';
-import { fixPrismaPath } from '../example-utils';
-import { lists } from './schema';
+import { config } from '@keystone-6/core'
+import { fixPrismaPath } from '../example-utils'
+import { lists } from './schema'
export default config({
db: {
@@ -11,11 +11,11 @@ export default config({
return schema.replace(
/(generator [^}]+)}/g,
['$1binaryTargets = ["native", "linux-musl"]', '}'].join('\n')
- );
+ )
},
// WARNING: this is only needed for our monorepo examples, dont do this
...fixPrismaPath,
},
lists,
-});
+})
diff --git a/examples/extend-prisma-schema/schema.ts b/examples/extend-prisma-schema/schema.ts
index 94112e9700f..7c8398bb501 100644
--- a/examples/extend-prisma-schema/schema.ts
+++ b/examples/extend-prisma-schema/schema.ts
@@ -1,7 +1,7 @@
-import { list } from '@keystone-6/core';
-import { text, relationship } from '@keystone-6/core/fields';
-import { allowAll } from '@keystone-6/core/access';
-import { Lists } from '.keystone/types';
+import { list } from '@keystone-6/core'
+import { text, relationship } from '@keystone-6/core/fields'
+import { allowAll } from '@keystone-6/core/access'
+import { type Lists } from '.keystone/types'
export const lists: Lists = {
Author: list({
@@ -13,7 +13,7 @@ export const lists: Lists = {
db: {
extendPrismaSchema: schema => {
// add a bad example of a multi-column unique constraint
- return schema.replace(/(model [^}]+)}/g, '$1@@unique([firstName, lastName])\n}');
+ return schema.replace(/(model [^}]+)}/g, '$1@@unique([firstName, lastName])\n}')
},
},
}),
@@ -31,7 +31,7 @@ export const lists: Lists = {
// WARNING: this won't be easy to use, but this is nice if you know what you're doing
return field
.replace(/tags Tag\?/g, 'tags Tag')
- .replace(/tagsId String\?/g, 'tagsId String');
+ .replace(/tagsId String\?/g, 'tagsId String')
},
},
}),
@@ -47,4 +47,4 @@ export const lists: Lists = {
}),
},
}),
-};
+}
diff --git a/examples/field-groups/keystone.ts b/examples/field-groups/keystone.ts
index 2cbda129b21..a735710d7a0 100644
--- a/examples/field-groups/keystone.ts
+++ b/examples/field-groups/keystone.ts
@@ -1,7 +1,7 @@
-import { config } from '@keystone-6/core';
-import { fixPrismaPath } from '../example-utils';
-import { lists } from './schema';
-import type { TypeInfo } from '.keystone/types';
+import { config } from '@keystone-6/core'
+import { fixPrismaPath } from '../example-utils'
+import { lists } from './schema'
+import type { TypeInfo } from '.keystone/types'
export default config({
db: {
@@ -12,4 +12,4 @@ export default config({
...fixPrismaPath,
},
lists,
-});
+})
diff --git a/examples/field-groups/schema.ts b/examples/field-groups/schema.ts
index 2e972b55897..3746a188b40 100644
--- a/examples/field-groups/schema.ts
+++ b/examples/field-groups/schema.ts
@@ -1,7 +1,7 @@
-import { list, group } from '@keystone-6/core';
-import { allowAll, denyAll } from '@keystone-6/core/access';
-import { text } from '@keystone-6/core/fields';
-import type { Lists } from '.keystone/types';
+import { list, group } from '@keystone-6/core'
+import { allowAll, denyAll } from '@keystone-6/core/access'
+import { text } from '@keystone-6/core/fields'
+import type { Lists } from '.keystone/types'
export const lists: Lists = {
Post: list({
@@ -29,10 +29,10 @@ export const lists: Lists = {
// TODO: text should allow you to prevent a defaultValue, then Prisma create could be non-null
// if (operation === 'create') return resolvedData.title.replace(/ /g, '-').toLowerCase()
if (operation === 'create') {
- return resolvedData.title?.replace(/ /g, '-').toLowerCase();
+ return resolvedData.title?.replace(/ /g, '-').toLowerCase()
}
- return resolvedData.slug;
+ return resolvedData.slug
},
},
}),
@@ -46,4 +46,4 @@ export const lists: Lists = {
}),
},
}),
-};
+}
diff --git a/examples/framework-astro/keystone.ts b/examples/framework-astro/keystone.ts
index c99f5f86c7f..5b4503355b7 100644
--- a/examples/framework-astro/keystone.ts
+++ b/examples/framework-astro/keystone.ts
@@ -5,8 +5,8 @@
// Keystone imports the default export of this file, expecting a Keystone configuration object
// you can find out more at https://keystonejs.com/docs/apis/config
-import { config } from '@keystone-6/core';
-import { lists } from './src/keystone/schema';
+import { config } from '@keystone-6/core'
+import { lists } from './src/keystone/schema'
export default config({
db: {
@@ -25,4 +25,4 @@ export default config({
port: 4000,
},
lists,
-});
+})
diff --git a/examples/framework-astro/src/keystone/context.ts b/examples/framework-astro/src/keystone/context.ts
index b5e8446e56f..46061b69393 100644
--- a/examples/framework-astro/src/keystone/context.ts
+++ b/examples/framework-astro/src/keystone/context.ts
@@ -1,15 +1,15 @@
-import { getContext } from '@keystone-6/core/context';
+import { getContext } from '@keystone-6/core/context'
// Using myprisma/client as vite does not like .
// This should be @prisma/client in a project outside of the Keystone monorepo
// eslint-disable-next-line import/no-extraneous-dependencies
-import * as PrismaModule from 'myprisma/client';
-import config from '../../keystone';
-import type { Context } from '.keystone/types';
+import * as PrismaModule from 'myprisma/client'
+import config from '../../keystone'
+import type { Context } from '.keystone/types'
// Making sure multiple prisma clients are not created during hot reloading
export const keystoneContext: Context =
- (globalThis as any).keystoneContext || getContext(config, PrismaModule);
+ (globalThis as any).keystoneContext || getContext(config, PrismaModule)
if (process.env.NODE_ENV !== 'production') {
- (globalThis as any).keystoneContext = keystoneContext;
+ (globalThis as any).keystoneContext = keystoneContext
}
diff --git a/examples/framework-astro/src/keystone/schema.ts b/examples/framework-astro/src/keystone/schema.ts
index efbba6c4400..2c7e91b7d70 100644
--- a/examples/framework-astro/src/keystone/schema.ts
+++ b/examples/framework-astro/src/keystone/schema.ts
@@ -5,18 +5,18 @@
// If you want to learn more about how lists are configured, please read
// - https://keystonejs.com/docs/config/lists
-import { list } from '@keystone-6/core';
-import { allowAll } from '@keystone-6/core/access';
+import { list } from '@keystone-6/core'
+import { allowAll } from '@keystone-6/core/access'
// see https://keystonejs.com/docs/fields/overview for the full list of fields
// this is a few common fields for an example
-import { text, select } from '@keystone-6/core/fields';
+import { text, select } from '@keystone-6/core/fields'
// if you want to make your own fields, see https://keystonejs.com/docs/guides/custom-fields
// when using Typescript, you can refine your types to a stricter subset by importing
// the generated types from '.keystone/types'
-import type { Lists } from '.keystone/types';
+import type { Lists } from '.keystone/types'
export const lists: Lists = {
Post: list({
@@ -28,15 +28,15 @@ export const lists: Lists = {
operation: allowAll,
filter: {
query: ({ session }) => {
- console.log('Post.access.filter session', session);
+ console.log('Post.access.filter session', session)
// if it is an Astro user, return posts where the user's browser is what the Post is written for
if (session?.user === 'astro' && session?.browser) {
return {
browser: { equals: session.browser },
- };
+ }
}
- return true;
+ return true
},
},
},
@@ -54,4 +54,4 @@ export const lists: Lists = {
}),
},
}),
-};
+}
diff --git a/examples/framework-nextjs-app-directory/keystone.ts b/examples/framework-nextjs-app-directory/keystone.ts
index 1b310e507da..e3865362ee0 100644
--- a/examples/framework-nextjs-app-directory/keystone.ts
+++ b/examples/framework-nextjs-app-directory/keystone.ts
@@ -1,18 +1,18 @@
-import { config } from '@keystone-6/core';
-import { lists } from './src/keystone/schema';
-import { seedDemoData } from './src/keystone/seed';
-import type { Context } from '.keystone/types';
+import { config } from '@keystone-6/core'
+import { lists } from './src/keystone/schema'
+import { seedDemoData } from './src/keystone/seed'
+import type { Context } from '.keystone/types'
export default config({
db: {
provider: 'sqlite',
url: `file:${process.cwd()}/keystone.db`, // next.js requires an absolute path for sqlite
onConnect: async (context: Context) => {
- await seedDemoData(context);
+ await seedDemoData(context)
},
// WARNING: this is only needed for our monorepo examples, dont do this
prismaClientPath: 'node_modules/.myprisma/client',
},
lists,
-});
+})
diff --git a/examples/framework-nextjs-app-directory/src/app/DocumentRender.tsx b/examples/framework-nextjs-app-directory/src/app/DocumentRender.tsx
index cdfae72eed2..61565723f85 100644
--- a/examples/framework-nextjs-app-directory/src/app/DocumentRender.tsx
+++ b/examples/framework-nextjs-app-directory/src/app/DocumentRender.tsx
@@ -1,5 +1,5 @@
-import React from 'react';
-import { DocumentRenderer, DocumentRendererProps } from '@keystone-6/document-renderer';
+import React from 'react'
+import { DocumentRenderer, type DocumentRendererProps } from '@keystone-6/document-renderer'
// By default the DocumentRenderer will render unstyled html elements.
// We're customising how headings are rendered here but you can customise
@@ -7,13 +7,13 @@ import { DocumentRenderer, DocumentRendererProps } from '@keystone-6/document-re
const renderers: DocumentRendererProps['renderers'] = {
// Render heading blocks
block: {
- heading({ level, children, textAlign }) {
- const Comp = `h${level}` as const;
- return {children} ;
+ heading ({ level, children, textAlign }) {
+ const Comp = `h${level}` as const
+ return {children}
},
},
-};
+}
-export function DocumentRender({ document }: { document: any }) {
- return ;
+export function DocumentRender ({ document }: { document: any }) {
+ return
}
diff --git a/examples/framework-nextjs-app-directory/src/app/layout.tsx b/examples/framework-nextjs-app-directory/src/app/layout.tsx
index cca45f08ce0..53aa86fc107 100644
--- a/examples/framework-nextjs-app-directory/src/app/layout.tsx
+++ b/examples/framework-nextjs-app-directory/src/app/layout.tsx
@@ -1,7 +1,7 @@
-import React from 'react';
-import '../styles/globals.css';
+import React from 'react'
+import '../styles/globals.css'
-export default function Layout({ children }: { children: React.ReactNode }) {
+export default function Layout ({ children }: { children: React.ReactNode }) {
return (
@@ -24,5 +24,5 @@ export default function Layout({ children }: { children: React.ReactNode }) {
- );
+ )
}
diff --git a/examples/framework-nextjs-app-directory/src/app/page.tsx b/examples/framework-nextjs-app-directory/src/app/page.tsx
index 593ccee9322..1f9656d7774 100644
--- a/examples/framework-nextjs-app-directory/src/app/page.tsx
+++ b/examples/framework-nextjs-app-directory/src/app/page.tsx
@@ -1,15 +1,15 @@
-import React from 'react';
-import { keystoneContext } from '../keystone/context';
-import { DocumentRender } from './DocumentRender';
+import React from 'react'
+import { keystoneContext } from '../keystone/context'
+import { DocumentRender } from './DocumentRender'
-export default async function HomePage() {
+export default async function HomePage () {
// WARNING: this does nothing for now
// you will probably use getServerSession from 'next/auth'
// https://next-auth.js.org/configuration/nextjs#in-app-directory
- const session = {};
+ const session = {}
const users = await keystoneContext.withSession(session).query.User.findMany({
query: 'id name about { document }',
- });
+ })
return (
@@ -34,7 +34,7 @@ export default async function HomePage() {
>
)}
- );
+ )
})}
@@ -58,5 +58,5 @@ export default async function HomePage() {
- );
+ )
}
diff --git a/examples/framework-nextjs-app-directory/src/keystone/context.ts b/examples/framework-nextjs-app-directory/src/keystone/context.ts
index 443788f77ab..8aac61addea 100644
--- a/examples/framework-nextjs-app-directory/src/keystone/context.ts
+++ b/examples/framework-nextjs-app-directory/src/keystone/context.ts
@@ -1,10 +1,10 @@
-import { getContext } from '@keystone-6/core/context';
-import config from '../../keystone';
-import { Context } from '.keystone/types';
-import * as PrismaModule from '.myprisma/client';
+import { getContext } from '@keystone-6/core/context'
+import config from '../../keystone'
+import { type Context } from '.keystone/types'
+import * as PrismaModule from '.myprisma/client'
// Making sure multiple prisma clients are not created during hot reloading
export const keystoneContext: Context =
- (globalThis as any).keystoneContext || getContext(config, PrismaModule);
+ (globalThis as any).keystoneContext || getContext(config, PrismaModule)
-if (process.env.NODE_ENV !== 'production') (globalThis as any).keystoneContext = keystoneContext;
+if (process.env.NODE_ENV !== 'production') (globalThis as any).keystoneContext = keystoneContext
diff --git a/examples/framework-nextjs-app-directory/src/keystone/schema.ts b/examples/framework-nextjs-app-directory/src/keystone/schema.ts
index f0f67d8f926..03817fe8423 100644
--- a/examples/framework-nextjs-app-directory/src/keystone/schema.ts
+++ b/examples/framework-nextjs-app-directory/src/keystone/schema.ts
@@ -1,8 +1,8 @@
-import { list } from '@keystone-6/core';
-import { allowAll } from '@keystone-6/core/access';
-import { text, timestamp } from '@keystone-6/core/fields';
-import { document } from '@keystone-6/fields-document';
-import type { Lists } from '.keystone/types';
+import { list } from '@keystone-6/core'
+import { allowAll } from '@keystone-6/core/access'
+import { text, timestamp } from '@keystone-6/core/fields'
+import { document } from '@keystone-6/fields-document'
+import type { Lists } from '.keystone/types'
export const lists: Lists = {
User: list({
@@ -28,4 +28,4 @@ export const lists: Lists = {
}),
},
}),
-};
+}
diff --git a/examples/framework-nextjs-app-directory/src/keystone/seed.ts b/examples/framework-nextjs-app-directory/src/keystone/seed.ts
index 46ecdc31d15..547c8e40e3f 100644
--- a/examples/framework-nextjs-app-directory/src/keystone/seed.ts
+++ b/examples/framework-nextjs-app-directory/src/keystone/seed.ts
@@ -1,7 +1,7 @@
-import type { Context } from '.keystone/types';
+import type { Context } from '.keystone/types'
-export async function seedDemoData(context: Context) {
- if ((await context.db.User.count()) > 0) return;
+export async function seedDemoData (context: Context) {
+ if ((await context.db.User.count()) > 0) return
for (const user of [
{
@@ -14,6 +14,6 @@ export async function seedDemoData(context: Context) {
name: 'Diana',
},
] as const) {
- await context.db.User.createOne({ data: user });
+ await context.db.User.createOne({ data: user })
}
}
diff --git a/examples/framework-nextjs-app-directory/src/pages/api/graphql.ts b/examples/framework-nextjs-app-directory/src/pages/api/graphql.ts
index e28f6cc845d..a3ddba64706 100644
--- a/examples/framework-nextjs-app-directory/src/pages/api/graphql.ts
+++ b/examples/framework-nextjs-app-directory/src/pages/api/graphql.ts
@@ -1,6 +1,6 @@
-import { createYoga } from 'graphql-yoga';
-import type { NextApiRequest, NextApiResponse } from 'next';
-import { keystoneContext } from '../../keystone/context';
+import { createYoga } from 'graphql-yoga'
+import type { NextApiRequest, NextApiResponse } from 'next'
+import { keystoneContext } from '../../keystone/context'
/*
An example of how to setup your own yoga graphql server
@@ -11,12 +11,12 @@ export const config = {
// Disable body parsing (required for file uploads)
bodyParser: false,
},
-};
+}
// Use Keystone API to create GraphQL handler
export default createYoga<{
- req: NextApiRequest;
- res: NextApiResponse;
+ req: NextApiRequest
+ res: NextApiResponse
}>({
graphqlEndpoint: '/api/graphql',
schema: keystoneContext.graphql.schema,
@@ -28,4 +28,4 @@ export default createYoga<{
and an elevated sudo context to bypass access control if needed (context.sudo()).
*/
context: ({ req, res }) => keystoneContext.withRequest(req, res),
-});
+})
diff --git a/examples/framework-nextjs-app-directory/src/util/request.ts b/examples/framework-nextjs-app-directory/src/util/request.ts
index 0c635896577..9f6a0f05906 100644
--- a/examples/framework-nextjs-app-directory/src/util/request.ts
+++ b/examples/framework-nextjs-app-directory/src/util/request.ts
@@ -1,3 +1,3 @@
-import { GraphQLClient } from 'graphql-request';
+import { GraphQLClient } from 'graphql-request'
-export const client = new GraphQLClient('/api/graphql/');
+export const client = new GraphQLClient('/api/graphql/')
diff --git a/examples/framework-nextjs-pages-directory/keystone.ts b/examples/framework-nextjs-pages-directory/keystone.ts
index 5c153b14e07..1e47d2ae5e4 100644
--- a/examples/framework-nextjs-pages-directory/keystone.ts
+++ b/examples/framework-nextjs-pages-directory/keystone.ts
@@ -1,14 +1,14 @@
-import { config } from '@keystone-6/core';
-import { lists } from './src/keystone/schema';
-import { seedDemoData } from './src/keystone/seed';
-import type { Context } from '.keystone/types';
+import { config } from '@keystone-6/core'
+import { lists } from './src/keystone/schema'
+import { seedDemoData } from './src/keystone/seed'
+import type { Context } from '.keystone/types'
export default config({
db: {
provider: 'sqlite',
url: `file:${process.cwd()}/keystone.db`, // next.js requires an absolute path for sqlite
onConnect: async (context: Context) => {
- await seedDemoData(context);
+ await seedDemoData(context)
},
// WARNING: this is only needed for our monorepo examples, dont do this
@@ -18,4 +18,4 @@ export default config({
basePath: '/admin',
},
lists,
-});
+})
diff --git a/examples/framework-nextjs-pages-directory/next.config.js b/examples/framework-nextjs-pages-directory/next.config.js
index 540297b3877..6b7de94ff9b 100644
--- a/examples/framework-nextjs-pages-directory/next.config.js
+++ b/examples/framework-nextjs-pages-directory/next.config.js
@@ -1,4 +1,4 @@
// you don't need this if you're building something outside of the Keystone repo
-const withPreconstruct = require('@preconstruct/next');
+const withPreconstruct = require('@preconstruct/next')
-module.exports = withPreconstruct();
+module.exports = withPreconstruct()
diff --git a/examples/framework-nextjs-pages-directory/src/keystone/context.ts b/examples/framework-nextjs-pages-directory/src/keystone/context.ts
index 443788f77ab..8aac61addea 100644
--- a/examples/framework-nextjs-pages-directory/src/keystone/context.ts
+++ b/examples/framework-nextjs-pages-directory/src/keystone/context.ts
@@ -1,10 +1,10 @@
-import { getContext } from '@keystone-6/core/context';
-import config from '../../keystone';
-import { Context } from '.keystone/types';
-import * as PrismaModule from '.myprisma/client';
+import { getContext } from '@keystone-6/core/context'
+import config from '../../keystone'
+import { type Context } from '.keystone/types'
+import * as PrismaModule from '.myprisma/client'
// Making sure multiple prisma clients are not created during hot reloading
export const keystoneContext: Context =
- (globalThis as any).keystoneContext || getContext(config, PrismaModule);
+ (globalThis as any).keystoneContext || getContext(config, PrismaModule)
-if (process.env.NODE_ENV !== 'production') (globalThis as any).keystoneContext = keystoneContext;
+if (process.env.NODE_ENV !== 'production') (globalThis as any).keystoneContext = keystoneContext
diff --git a/examples/framework-nextjs-pages-directory/src/keystone/schema.ts b/examples/framework-nextjs-pages-directory/src/keystone/schema.ts
index 538c96e1299..bba465cc51f 100644
--- a/examples/framework-nextjs-pages-directory/src/keystone/schema.ts
+++ b/examples/framework-nextjs-pages-directory/src/keystone/schema.ts
@@ -1,7 +1,7 @@
-import { list } from '@keystone-6/core';
-import { allowAll } from '@keystone-6/core/access';
-import { text, timestamp } from '@keystone-6/core/fields';
-import type { Lists } from '.keystone/types';
+import { list } from '@keystone-6/core'
+import { allowAll } from '@keystone-6/core/access'
+import { text, timestamp } from '@keystone-6/core/fields'
+import type { Lists } from '.keystone/types'
export const lists: Lists = {
User: list({
@@ -19,4 +19,4 @@ export const lists: Lists = {
}),
},
}),
-};
+}
diff --git a/examples/framework-nextjs-pages-directory/src/keystone/seed.ts b/examples/framework-nextjs-pages-directory/src/keystone/seed.ts
index 46ecdc31d15..547c8e40e3f 100644
--- a/examples/framework-nextjs-pages-directory/src/keystone/seed.ts
+++ b/examples/framework-nextjs-pages-directory/src/keystone/seed.ts
@@ -1,7 +1,7 @@
-import type { Context } from '.keystone/types';
+import type { Context } from '.keystone/types'
-export async function seedDemoData(context: Context) {
- if ((await context.db.User.count()) > 0) return;
+export async function seedDemoData (context: Context) {
+ if ((await context.db.User.count()) > 0) return
for (const user of [
{
@@ -14,6 +14,6 @@ export async function seedDemoData(context: Context) {
name: 'Diana',
},
] as const) {
- await context.db.User.createOne({ data: user });
+ await context.db.User.createOne({ data: user })
}
}
diff --git a/examples/framework-nextjs-pages-directory/src/pages/_app.tsx b/examples/framework-nextjs-pages-directory/src/pages/_app.tsx
index c9036cb6a3d..7ef443ddf08 100644
--- a/examples/framework-nextjs-pages-directory/src/pages/_app.tsx
+++ b/examples/framework-nextjs-pages-directory/src/pages/_app.tsx
@@ -1,9 +1,9 @@
-import React from 'react';
-import type { AppProps } from 'next/app';
-import '../styles/globals.css';
+import React from 'react'
+import type { AppProps } from 'next/app'
+import '../styles/globals.css'
-function MyApp({ Component, pageProps }: AppProps) {
- return ;
+function MyApp ({ Component, pageProps }: AppProps) {
+ return
}
-export default MyApp;
+export default MyApp
diff --git a/examples/framework-nextjs-pages-directory/src/pages/api/graphql.ts b/examples/framework-nextjs-pages-directory/src/pages/api/graphql.ts
index e28f6cc845d..a3ddba64706 100644
--- a/examples/framework-nextjs-pages-directory/src/pages/api/graphql.ts
+++ b/examples/framework-nextjs-pages-directory/src/pages/api/graphql.ts
@@ -1,6 +1,6 @@
-import { createYoga } from 'graphql-yoga';
-import type { NextApiRequest, NextApiResponse } from 'next';
-import { keystoneContext } from '../../keystone/context';
+import { createYoga } from 'graphql-yoga'
+import type { NextApiRequest, NextApiResponse } from 'next'
+import { keystoneContext } from '../../keystone/context'
/*
An example of how to setup your own yoga graphql server
@@ -11,12 +11,12 @@ export const config = {
// Disable body parsing (required for file uploads)
bodyParser: false,
},
-};
+}
// Use Keystone API to create GraphQL handler
export default createYoga<{
- req: NextApiRequest;
- res: NextApiResponse;
+ req: NextApiRequest
+ res: NextApiResponse
}>({
graphqlEndpoint: '/api/graphql',
schema: keystoneContext.graphql.schema,
@@ -28,4 +28,4 @@ export default createYoga<{
and an elevated sudo context to bypass access control if needed (context.sudo()).
*/
context: ({ req, res }) => keystoneContext.withRequest(req, res),
-});
+})
diff --git a/examples/framework-nextjs-pages-directory/src/pages/index.tsx b/examples/framework-nextjs-pages-directory/src/pages/index.tsx
index 23ed17d803e..953f07e1d63 100644
--- a/examples/framework-nextjs-pages-directory/src/pages/index.tsx
+++ b/examples/framework-nextjs-pages-directory/src/pages/index.tsx
@@ -1,9 +1,9 @@
-import React, { useEffect, useState } from 'react';
-import type { NextPage, GetServerSideProps, InferGetServerSidePropsType } from 'next';
-import Head from 'next/head';
-import { gql } from 'graphql-request';
-import { client } from '../util/request';
-import { keystoneContext } from '../keystone/context';
+import React, { useEffect, useState } from 'react'
+import type { NextPage, GetServerSideProps, InferGetServerSidePropsType } from 'next'
+import Head from 'next/head'
+import { gql } from 'graphql-request'
+import { client } from '../util/request'
+import { keystoneContext } from '../keystone/context'
const Home: NextPage = ({ users }: InferGetServerSidePropsType) => {
return (
@@ -63,23 +63,23 @@ const Home: NextPage = ({ users }: InferGetServerSidePropsType
- );
-};
+ )
+}
export const getServerSideProps: GetServerSideProps = async ({ req, res }) => {
- const context = await keystoneContext.withRequest(req, res);
+ const context = await keystoneContext.withRequest(req, res)
const users = await context.query.User.findMany({
query: 'id name about',
- });
+ })
return {
props: { users: users }, // will be passed to the page component as props
- };
-};
+ }
+}
-function ServerRenderedContent({
+function ServerRenderedContent ({
users,
}: {
- users: { id: string; name: string; about: string | null }[];
+ users: { id: string, name: string, about: string | null }[]
}) {
return (
@@ -98,15 +98,15 @@ function ServerRenderedContent({
>
)}
- );
+ )
})}
- );
+ )
}
-function ClientRenderedContent() {
- const [users, setUsers] = useState>([]);
+function ClientRenderedContent () {
+ const [users, setUsers] = useState>([])
// Fetch users from REST api route
useEffect(() => {
@@ -123,9 +123,9 @@ function ClientRenderedContent() {
`
)
.then((data: any) => {
- setUsers(data.users);
- });
- }, []);
+ setUsers(data.users)
+ })
+ }, [])
return (
@@ -145,14 +145,14 @@ function ClientRenderedContent() {
>
)}
- );
+ )
})}
) : (
loading...
)}
- );
+ )
}
-export default Home;
+export default Home
diff --git a/examples/framework-nextjs-pages-directory/src/util/request.ts b/examples/framework-nextjs-pages-directory/src/util/request.ts
index 0c635896577..9f6a0f05906 100644
--- a/examples/framework-nextjs-pages-directory/src/util/request.ts
+++ b/examples/framework-nextjs-pages-directory/src/util/request.ts
@@ -1,3 +1,3 @@
-import { GraphQLClient } from 'graphql-request';
+import { GraphQLClient } from 'graphql-request'
-export const client = new GraphQLClient('/api/graphql/');
+export const client = new GraphQLClient('/api/graphql/')
diff --git a/examples/framework-nextjs-two-servers/keystone-server/keystone.ts b/examples/framework-nextjs-two-servers/keystone-server/keystone.ts
index a51db901c8c..72ca0405c61 100644
--- a/examples/framework-nextjs-two-servers/keystone-server/keystone.ts
+++ b/examples/framework-nextjs-two-servers/keystone-server/keystone.ts
@@ -1,24 +1,24 @@
-import { config } from '@keystone-6/core';
-import type { KeystoneConfig } from '@keystone-6/core/types';
-import { fixPrismaPath } from '../../example-utils';
-import { seedDatabase } from './src/seed';
-import { lists } from './src/schema';
-import { Context, TypeInfo } from '.keystone/types';
+import { config } from '@keystone-6/core'
+import type { KeystoneConfig } from '@keystone-6/core/types'
+import { fixPrismaPath } from '../../example-utils'
+import { seedDatabase } from './src/seed'
+import { lists } from './src/schema'
+import { type Context, type TypeInfo } from '.keystone/types'
const db: KeystoneConfig['db'] = {
provider: 'sqlite',
url: process.env.DATABASE_URL || 'file:./database.db',
- async onConnect(context: Context) {
+ async onConnect (context: Context) {
if (process.argv.includes('--seed-database')) {
- await seedDatabase(context);
+ await seedDatabase(context)
}
},
// WARNING: this is only needed for our monorepo examples, dont do this
...fixPrismaPath,
-};
+}
export default config({
db,
lists,
-});
+})
diff --git a/examples/framework-nextjs-two-servers/keystone-server/src/schema.ts b/examples/framework-nextjs-two-servers/keystone-server/src/schema.ts
index 700d226ffd6..8af19b1de47 100644
--- a/examples/framework-nextjs-two-servers/keystone-server/src/schema.ts
+++ b/examples/framework-nextjs-two-servers/keystone-server/src/schema.ts
@@ -1,9 +1,9 @@
-import { list } from '@keystone-6/core';
-import { allowAll } from '@keystone-6/core/access';
-import { relationship, text, timestamp } from '@keystone-6/core/fields';
-import { document } from '@keystone-6/fields-document';
-import type { KeystoneConfig } from '@keystone-6/core/types';
-import { TypeInfo } from '.keystone/types';
+import { list } from '@keystone-6/core'
+import { allowAll } from '@keystone-6/core/access'
+import { relationship, text, timestamp } from '@keystone-6/core/fields'
+import { document } from '@keystone-6/fields-document'
+import type { KeystoneConfig } from '@keystone-6/core/types'
+import { type TypeInfo } from '.keystone/types'
export const lists: KeystoneConfig['lists'] = {
User: list({
@@ -33,4 +33,4 @@ export const lists: KeystoneConfig['lists'] = {
author: relationship({ ref: 'User.posts', many: false }),
},
}),
-};
+}
diff --git a/examples/framework-nextjs-two-servers/keystone-server/src/seed/index.ts b/examples/framework-nextjs-two-servers/keystone-server/src/seed/index.ts
index 6b7dc909f71..8811e223233 100644
--- a/examples/framework-nextjs-two-servers/keystone-server/src/seed/index.ts
+++ b/examples/framework-nextjs-two-servers/keystone-server/src/seed/index.ts
@@ -1,45 +1,45 @@
-import fs from 'fs';
-import path from 'path';
-import { Context } from '.keystone/types';
+import fs from 'fs'
+import path from 'path'
+import { type Context } from '.keystone/types'
const seedUsers = async (context: Context) => {
- const { db } = context.sudo();
- const rawJSONData = fs.readFileSync(path.join(process.cwd(), './src/seed/users.json'), 'utf-8');
- const seedUsers: any[] = JSON.parse(rawJSONData);
+ const { db } = context.sudo()
+ const rawJSONData = fs.readFileSync(path.join(process.cwd(), './src/seed/users.json'), 'utf-8')
+ const seedUsers: any[] = JSON.parse(rawJSONData)
const usersAlreadyInDatabase = await db.User.findMany({
where: {
email: { in: seedUsers.map(user => user.email) },
},
- });
+ })
const usersToCreate = seedUsers.filter(
seedUser => !usersAlreadyInDatabase.some(u => u.email === seedUser.email)
- );
+ )
await db.User.createMany({
data: usersToCreate,
- });
-};
+ })
+}
// seed posts and connect with users
const seedPosts = async (context: Context) => {
- const { db } = context.sudo();
- const rawJSONData = fs.readFileSync(path.join(process.cwd(), './src/seed/posts.json'), 'utf-8');
- const seedPosts: any[] = JSON.parse(rawJSONData);
+ const { db } = context.sudo()
+ const rawJSONData = fs.readFileSync(path.join(process.cwd(), './src/seed/posts.json'), 'utf-8')
+ const seedPosts: any[] = JSON.parse(rawJSONData)
const postsAlreadyInDatabase = await db.Post.findMany({
where: {
slug: { in: seedPosts.map(post => post.slug) },
},
- });
+ })
const postsToCreate = seedPosts.filter(
seedPost => !postsAlreadyInDatabase.some(p => p.slug === seedPost.slug)
- );
+ )
await db.Post.createMany({
data: postsToCreate.map(p => ({ ...p, content: p?.content?.document })),
- });
-};
+ })
+}
export const seedDatabase = async (context: Context) => {
- console.log(`🌱 Seeding database...`);
- await seedUsers(context);
- await seedPosts(context);
- console.log(`🌱 Seeding database completed.`);
-};
+ console.log(`🌱 Seeding database...`)
+ await seedUsers(context)
+ await seedPosts(context)
+ console.log(`🌱 Seeding database completed.`)
+}
diff --git a/examples/framework-nextjs-two-servers/nextjs-frontend/next.config.js b/examples/framework-nextjs-two-servers/nextjs-frontend/next.config.js
index 540297b3877..6b7de94ff9b 100644
--- a/examples/framework-nextjs-two-servers/nextjs-frontend/next.config.js
+++ b/examples/framework-nextjs-two-servers/nextjs-frontend/next.config.js
@@ -1,4 +1,4 @@
// you don't need this if you're building something outside of the Keystone repo
-const withPreconstruct = require('@preconstruct/next');
+const withPreconstruct = require('@preconstruct/next')
-module.exports = withPreconstruct();
+module.exports = withPreconstruct()
diff --git a/examples/framework-nextjs-two-servers/nextjs-frontend/src/graphql.ts b/examples/framework-nextjs-two-servers/nextjs-frontend/src/graphql.ts
index 37f86189b90..873db96f3b8 100644
--- a/examples/framework-nextjs-two-servers/nextjs-frontend/src/graphql.ts
+++ b/examples/framework-nextjs-two-servers/nextjs-frontend/src/graphql.ts
@@ -1,8 +1,8 @@
-const API_URI = process.env.API_URI || 'http://localhost:3000/api/graphql';
+const API_URI = process.env.API_URI || 'http://localhost:3000/api/graphql'
-export const gql = ([content]: TemplateStringsArray) => content;
+export const gql = ([content]: TemplateStringsArray) => content
-export async function fetchGraphQL(query: string, variables?: Record) {
+export async function fetchGraphQL (query: string, variables?: Record) {
return fetch(API_URI, {
method: 'POST',
body: JSON.stringify({ query, variables }),
@@ -13,8 +13,8 @@ export async function fetchGraphQL(query: string, variables?: Record x.message).join('\n')}`
- );
+ )
}
- return data;
- });
+ return data
+ })
}
diff --git a/examples/framework-nextjs-two-servers/nextjs-frontend/src/pages/_app.tsx b/examples/framework-nextjs-two-servers/nextjs-frontend/src/pages/_app.tsx
index c9036cb6a3d..7ef443ddf08 100644
--- a/examples/framework-nextjs-two-servers/nextjs-frontend/src/pages/_app.tsx
+++ b/examples/framework-nextjs-two-servers/nextjs-frontend/src/pages/_app.tsx
@@ -1,9 +1,9 @@
-import React from 'react';
-import type { AppProps } from 'next/app';
-import '../styles/globals.css';
+import React from 'react'
+import type { AppProps } from 'next/app'
+import '../styles/globals.css'
-function MyApp({ Component, pageProps }: AppProps) {
- return ;
+function MyApp ({ Component, pageProps }: AppProps) {
+ return
}
-export default MyApp;
+export default MyApp
diff --git a/examples/framework-nextjs-two-servers/nextjs-frontend/src/pages/blog/[slug].tsx b/examples/framework-nextjs-two-servers/nextjs-frontend/src/pages/blog/[slug].tsx
index 46ae012395a..7c3a40ee24c 100644
--- a/examples/framework-nextjs-two-servers/nextjs-frontend/src/pages/blog/[slug].tsx
+++ b/examples/framework-nextjs-two-servers/nextjs-frontend/src/pages/blog/[slug].tsx
@@ -1,37 +1,37 @@
-import React, { Fragment } from 'react';
-import type { GetStaticPathsResult, GetStaticPropsContext } from 'next';
-import Link from 'next/link';
-import type { DocumentRendererProps } from '@keystone-6/document-renderer';
-import { DocumentRenderer } from '@keystone-6/document-renderer';
-import { fetchGraphQL, gql } from '../../graphql';
+import React, { Fragment } from 'react'
+import type { GetStaticPathsResult, GetStaticPropsContext } from 'next'
+import Link from 'next/link'
+import type { DocumentRendererProps } from '@keystone-6/document-renderer'
+import { DocumentRenderer } from '@keystone-6/document-renderer'
+import { fetchGraphQL, gql } from '../../graphql'
-export type DocumentProp = DocumentRendererProps['document'];
+export type DocumentProp = DocumentRendererProps['document']
type Post = {
- id: string;
- title: string;
- slug: string;
- publishDate: string | null;
+ id: string
+ title: string
+ slug: string
+ publishDate: string | null
author: {
- name: string;
- } | null;
+ name: string
+ } | null
content: {
- document: DocumentProp;
- };
-};
+ document: DocumentProp
+ }
+}
-export default function BlogPage({ post, error }: { post: Post | undefined; error?: Error }) {
+export default function BlogPage ({ post, error }: { post: Post | undefined, error?: Error }) {
if (error) {
return (
Something went wrong
{error.message}
- );
+ )
}
if (!post) {
- return Post not found
;
+ return Post not found
}
return (
@@ -56,10 +56,10 @@ export default function BlogPage({ post, error }: { post: Post | undefined; erro
- );
+ )
}
-export async function getStaticPaths(): Promise {
+export async function getStaticPaths (): Promise {
try {
const data = await fetchGraphQL(gql`
query posts {
@@ -67,27 +67,27 @@ export async function getStaticPaths(): Promise {
slug
}
}
- `);
+ `)
- const posts: { slug: string }[] = data?.posts || [];
+ const posts: { slug: string }[] = data?.posts || []
const paths = posts.map(({ slug }) => ({
params: { slug },
- }));
+ }))
return {
paths,
fallback: false,
- };
+ }
} catch (e) {
return {
paths: [],
fallback: false,
- };
+ }
}
}
-export async function getStaticProps({ params = {} }: GetStaticPropsContext) {
- const slug = params.slug;
+export async function getStaticProps ({ params = {} }: GetStaticPropsContext) {
+ const slug = params.slug
try {
const data = await fetchGraphQL(
gql`
@@ -109,16 +109,16 @@ export async function getStaticProps({ params = {} }: GetStaticPropsContext) {
{
slug,
}
- );
+ )
- const post = data?.post;
- return { props: { post } };
+ const post = data?.post
+ return { props: { post } }
} catch (e) {
return {
props: {
post: undefined,
error: { name: (e as Error).name, message: (e as Error).message },
},
- };
+ }
}
}
diff --git a/examples/framework-nextjs-two-servers/nextjs-frontend/src/pages/index.tsx b/examples/framework-nextjs-two-servers/nextjs-frontend/src/pages/index.tsx
index 585d226ca96..de76e871ac7 100644
--- a/examples/framework-nextjs-two-servers/nextjs-frontend/src/pages/index.tsx
+++ b/examples/framework-nextjs-two-servers/nextjs-frontend/src/pages/index.tsx
@@ -1,50 +1,50 @@
-import React, { Fragment } from 'react';
-import Link from 'next/link';
-import { fetchGraphQL, gql } from '../graphql';
+import React, { Fragment } from 'react'
+import Link from 'next/link'
+import { fetchGraphQL, gql } from '../graphql'
type Post = {
- id: string;
- title: string;
- slug: string;
- publishDate: string | null;
+ id: string
+ title: string
+ slug: string
+ publishDate: string | null
author: {
- name: string;
- } | null;
-};
+ name: string
+ } | null
+}
-function PublishDate({ publishDate }: { publishDate: Post['publishDate'] }) {
- const formattedDate = publishDate ? new Date(publishDate).toLocaleDateString() : null;
+function PublishDate ({ publishDate }: { publishDate: Post['publishDate'] }) {
+ const formattedDate = publishDate ? new Date(publishDate).toLocaleDateString() : null
if (!formattedDate) {
- return null;
+ return null
}
return (
· Published on {formattedDate}
- );
+ )
}
-function AuthorInfo({ author }: { author: Post['author'] }) {
+function AuthorInfo ({ author }: { author: Post['author'] }) {
if (!author?.name) {
- return null;
+ return null
}
return (
· by {author?.name}
- );
+ )
}
-export default function Home({ posts, error }: { posts: Post[]; error?: Error }) {
+export default function Home ({ posts, error }: { posts: Post[], error?: Error }) {
if (error) {
return (
Something went wrong
{error.message}
- );
+ )
}
return (
@@ -58,14 +58,14 @@ export default function Home({ posts, error }: { posts: Post[]; error?: Error })
- );
+ )
})}
- );
+ )
}
-export async function getStaticProps() {
+export async function getStaticProps () {
try {
const data = await fetchGraphQL(gql`
query posts {
@@ -79,20 +79,20 @@ export async function getStaticProps() {
}
}
}
- `);
+ `)
- const posts = data?.posts || [];
+ const posts = data?.posts || []
return {
props: {
posts,
},
- };
+ }
} catch (e) {
return {
props: {
posts: [],
error: { name: (e as Error).name, message: (e as Error).message },
},
- };
+ }
}
}
diff --git a/examples/framework-remix/app/root.tsx b/examples/framework-remix/app/root.tsx
index 82a66bf7626..b4020cb7697 100644
--- a/examples/framework-remix/app/root.tsx
+++ b/examples/framework-remix/app/root.tsx
@@ -1,14 +1,14 @@
-import type { MetaFunction } from '@remix-run/node';
-import { Links, LiveReload, Meta, Outlet, Scripts, ScrollRestoration } from '@remix-run/react';
-import React from 'react';
+import type { MetaFunction } from '@remix-run/node'
+import { Links, LiveReload, Meta, Outlet, Scripts, ScrollRestoration } from '@remix-run/react'
+import React from 'react'
export const meta: MetaFunction = () => ({
charset: 'utf-8',
title: 'New Remix App',
viewport: 'width=device-width,initial-scale=1',
-});
+})
-export default function App() {
+export default function App () {
return (
@@ -32,5 +32,5 @@ export default function App() {
- );
+ )
}
diff --git a/examples/framework-remix/app/routes/index.tsx b/examples/framework-remix/app/routes/index.tsx
index 5c2c6df2e4c..e4638e018de 100644
--- a/examples/framework-remix/app/routes/index.tsx
+++ b/examples/framework-remix/app/routes/index.tsx
@@ -1,24 +1,24 @@
-import React from 'react';
-import type { LoaderArgs } from '@remix-run/node';
-import { useLoaderData } from '@remix-run/react';
-import { json } from '@remix-run/node';
-import { keystoneContext } from '../utils/keystone.server';
+import React from 'react'
+import type { LoaderArgs } from '@remix-run/node'
+import { useLoaderData } from '@remix-run/react'
+import { json } from '@remix-run/node'
+import { keystoneContext } from '../utils/keystone.server'
export const loader = async ({ request }: LoaderArgs) => {
// WARNING: this does nothing for now
// You will probably use Remix Sessions like in
// https://remix.run/docs/en/main/tutorials/jokes
- const session = {};
- const context = keystoneContext.withSession(session);
+ const session = {}
+ const context = keystoneContext.withSession(session)
return json({
posts: (await context.query.Post.findMany({
query: 'id name content',
- })) as { id: string; name: string; content: string }[],
- });
-};
+ })) as { id: string, name: string, content: string }[],
+ })
+}
-export default function UsersIndexRoute() {
- const data = useLoaderData();
+export default function UsersIndexRoute () {
+ const data = useLoaderData()
return (
@@ -32,5 +32,5 @@ export default function UsersIndexRoute() {
))}
- );
+ )
}
diff --git a/examples/framework-remix/app/utils/keystone.server.ts b/examples/framework-remix/app/utils/keystone.server.ts
index 77573cc1a67..d1333567be6 100644
--- a/examples/framework-remix/app/utils/keystone.server.ts
+++ b/examples/framework-remix/app/utils/keystone.server.ts
@@ -1,10 +1,10 @@
-import { getContext } from '@keystone-6/core/context';
-import config from '../../keystone';
-import * as PrismaModule from '.myprisma/client';
-import type { Context } from '.keystone/types';
+import { getContext } from '@keystone-6/core/context'
+import config from '../../keystone'
+import * as PrismaModule from '.myprisma/client'
+import type { Context } from '.keystone/types'
// Making sure multiple prisma clients are not created during hot reloading
export const keystoneContext: Context =
- (globalThis as any).keystoneContext || getContext(config, PrismaModule);
+ (globalThis as any).keystoneContext || getContext(config, PrismaModule)
-if (process.env.NODE_ENV !== 'production') (globalThis as any).keystoneContext = keystoneContext;
+if (process.env.NODE_ENV !== 'production') (globalThis as any).keystoneContext = keystoneContext
diff --git a/examples/framework-remix/keystone.ts b/examples/framework-remix/keystone.ts
index e9e3e287bcd..5e17561e315 100644
--- a/examples/framework-remix/keystone.ts
+++ b/examples/framework-remix/keystone.ts
@@ -1,8 +1,8 @@
-import { list, config } from '@keystone-6/core';
-import { allowAll } from '@keystone-6/core/access';
-import { text } from '@keystone-6/core/fields';
-import { fixPrismaPath } from '../example-utils';
-import type { TypeInfo } from '.keystone/types';
+import { list, config } from '@keystone-6/core'
+import { allowAll } from '@keystone-6/core/access'
+import { text } from '@keystone-6/core/fields'
+import { fixPrismaPath } from '../example-utils'
+import type { TypeInfo } from '.keystone/types'
export default config({
db: {
@@ -23,4 +23,4 @@ export default config({
},
}),
},
-});
+})
diff --git a/examples/framework-remix/remix.config.js b/examples/framework-remix/remix.config.js
index 2eee2ab3f57..9b75f617a9f 100644
--- a/examples/framework-remix/remix.config.js
+++ b/examples/framework-remix/remix.config.js
@@ -5,4 +5,4 @@ module.exports = {
// assetsBuildDirectory: "public/build",
// serverBuildPath: "build/index.js",
// publicPath: "/build/",
-};
+}
diff --git a/examples/graphql-ts-gql/keystone.ts b/examples/graphql-ts-gql/keystone.ts
index aebfcb74e9d..fe1bf98ab98 100644
--- a/examples/graphql-ts-gql/keystone.ts
+++ b/examples/graphql-ts-gql/keystone.ts
@@ -1,6 +1,6 @@
-import { config } from '@keystone-6/core';
-import { fixPrismaPath } from '../example-utils';
-import { lists } from './schema';
+import { config } from '@keystone-6/core'
+import { fixPrismaPath } from '../example-utils'
+import { lists } from './schema'
export default config({
db: {
@@ -11,4 +11,4 @@ export default config({
...fixPrismaPath,
},
lists,
-});
+})
diff --git a/examples/graphql-ts-gql/package.json b/examples/graphql-ts-gql/package.json
index 1b0356a8634..bd9a83d7efe 100644
--- a/examples/graphql-ts-gql/package.json
+++ b/examples/graphql-ts-gql/package.json
@@ -14,13 +14,13 @@
"dependencies": {
"@keystone-6/core": "^5.7.0",
"@prisma/client": "^4.16.2",
+ "graphql": "^16.8.1"
+ },
+ "devDependencies": {
"@ts-gql/compiler": "^0.15.3",
"@ts-gql/eslint-plugin": "^0.9.0",
"@ts-gql/tag": "^0.7.0",
"eslint": "^8.0.0",
- "graphql": "^16.8.1"
- },
- "devDependencies": {
"prisma": "^4.16.2",
"typescript": "~5.0.0"
},
diff --git a/examples/graphql-ts-gql/schema.ts b/examples/graphql-ts-gql/schema.ts
index 5e862e2656a..7af554db320 100644
--- a/examples/graphql-ts-gql/schema.ts
+++ b/examples/graphql-ts-gql/schema.ts
@@ -1,8 +1,8 @@
-import { list, graphql } from '@keystone-6/core';
-import { select, relationship, text, timestamp, virtual } from '@keystone-6/core/fields';
-import { allowAll } from '@keystone-6/core/access';
-import { gql } from '@ts-gql/tag/no-transform';
-import { Lists, Context } from '.keystone/types';
+import { list, graphql } from '@keystone-6/core'
+import { select, relationship, text, timestamp, virtual } from '@keystone-6/core/fields'
+import { allowAll } from '@keystone-6/core/access'
+import { gql } from '@ts-gql/tag/no-transform'
+import { type Lists, type Context } from '.keystone/types'
export const lists: Lists = {
Post: list({
@@ -20,8 +20,8 @@ export const lists: Lists = {
isPublished: virtual({
field: graphql.field({
type: graphql.Boolean,
- resolve(item: any) {
- return item.status === 'published';
+ resolve (item: any) {
+ return item.status === 'published'
},
}),
}),
@@ -34,9 +34,9 @@ export const lists: Lists = {
},
field: graphql.field({
type: graphql.object<{
- words: number;
- sentences: number;
- paragraphs: number;
+ words: number
+ sentences: number
+ paragraphs: number
}>()({
name: 'PostCounts',
fields: {
@@ -45,13 +45,13 @@ export const lists: Lists = {
paragraphs: graphql.field({ type: graphql.Int }),
},
}),
- resolve(item) {
- const content = item.content || '';
+ resolve (item) {
+ const content = item.content || ''
return {
words: content.split(' ').length,
sentences: content.split('.').length,
paragraphs: content.split('\n\n').length,
- };
+ }
},
}),
}),
@@ -62,15 +62,15 @@ export const lists: Lists = {
args: {
length: graphql.arg({ type: graphql.nonNull(graphql.Int), defaultValue: 200 }),
},
- resolve(item, { length }) {
+ resolve (item, { length }) {
if (!item.content) {
- return null;
+ return null
}
- const content = item.content;
+ const content = item.content
if (content.length <= length) {
- return content;
+ return content
} else {
- return content.slice(0, length - 3) + '...';
+ return content.slice(0, length - 3) + '...'
}
},
}),
@@ -82,8 +82,8 @@ export const lists: Lists = {
authorName: virtual({
field: graphql.field({
type: graphql.String,
- async resolve(item, args, _context) {
- const context = _context as Context;
+ async resolve (item, args, _context) {
+ const context = _context as Context
const POST_AUTHOR_QUERY = gql`
query POST_AUTHOR_QUERY($id: ID!) {
post(where: { id: $id }) {
@@ -94,13 +94,13 @@ export const lists: Lists = {
}
}
}
- ` as import('./__generated__/ts-gql/POST_AUTHOR_QUERY').type;
+ ` as import('./__generated__/ts-gql/POST_AUTHOR_QUERY').type
const data = await context.graphql.run({
query: POST_AUTHOR_QUERY,
variables: { id: item.id },
- });
- const author = data?.post?.author;
- return author && author.name;
+ })
+ const author = data?.post?.author
+ return author && author.name
},
}),
}),
@@ -117,8 +117,8 @@ export const lists: Lists = {
field: lists =>
graphql.field({
type: lists.Post.types.output,
- async resolve(item, args, _context) {
- const context = _context as Context;
+ async resolve (item, args, _context) {
+ const context = _context as Context
const LATEST_POST_QUERY = gql`
query LATEST_POST_QUERY($id: ID!) {
author(where: { id: $id }) {
@@ -128,14 +128,14 @@ export const lists: Lists = {
}
}
}
- ` as import('./__generated__/ts-gql/LATEST_POST_QUERY').type;
+ ` as import('./__generated__/ts-gql/LATEST_POST_QUERY').type
const data = await context.graphql.run({
query: LATEST_POST_QUERY,
variables: { id: item.id },
- });
- const posts = data?.author?.posts;
+ })
+ const posts = data?.author?.posts
if (posts && posts.length > 0) {
- return context.db.Post.findOne({ where: { id: posts[0].id } });
+ return context.db.Post.findOne({ where: { id: posts[0].id } })
}
},
}),
@@ -143,4 +143,4 @@ export const lists: Lists = {
}),
},
}),
-};
+}
diff --git a/examples/hooks/keystone.ts b/examples/hooks/keystone.ts
index 2cbda129b21..a735710d7a0 100644
--- a/examples/hooks/keystone.ts
+++ b/examples/hooks/keystone.ts
@@ -1,7 +1,7 @@
-import { config } from '@keystone-6/core';
-import { fixPrismaPath } from '../example-utils';
-import { lists } from './schema';
-import type { TypeInfo } from '.keystone/types';
+import { config } from '@keystone-6/core'
+import { fixPrismaPath } from '../example-utils'
+import { lists } from './schema'
+import type { TypeInfo } from '.keystone/types'
export default config({
db: {
@@ -12,4 +12,4 @@ export default config({
...fixPrismaPath,
},
lists,
-});
+})
diff --git a/examples/hooks/schema.ts b/examples/hooks/schema.ts
index c614073c406..b8c4091b961 100644
--- a/examples/hooks/schema.ts
+++ b/examples/hooks/schema.ts
@@ -1,7 +1,7 @@
-import { list, group } from '@keystone-6/core';
-import { allowAll, denyAll } from '@keystone-6/core/access';
-import { checkbox, text, timestamp } from '@keystone-6/core/fields';
-import type { Lists } from '.keystone/types';
+import { list, group } from '@keystone-6/core'
+import { allowAll, denyAll } from '@keystone-6/core/access'
+import { checkbox, text, timestamp } from '@keystone-6/core/fields'
+import type { Lists } from '.keystone/types'
// WARNING: this example is for demonstration purposes only
// as with each of our examples, it has not been vetted
@@ -30,7 +30,7 @@ const readOnly = {
fieldMode: () => 'read' as const,
},
},
-};
+}
export const lists: Lists = {
Post: list({
@@ -78,8 +78,8 @@ export const lists: Lists = {
hooks: {
resolveInput: ({ context, operation, resolvedData }) => {
- if (operation === 'create') return new Date();
- return resolvedData.createdAt;
+ if (operation === 'create') return new Date()
+ return resolvedData.createdAt
},
},
@@ -102,8 +102,8 @@ export const lists: Lists = {
hooks: {
resolveInput: ({ context, operation, resolvedData }) => {
- if (operation === 'update') return new Date();
- return resolvedData.updatedAt;
+ if (operation === 'update') return new Date()
+ return resolvedData.updatedAt
},
},
@@ -121,51 +121,51 @@ export const lists: Lists = {
resolveInput: {
create: ({ context, resolvedData }) => {
//resolvedData.createdAt = new Date(); // see createdAt field hook
- resolvedData.createdBy = `${context.req?.socket.remoteAddress} (${context.req?.headers['user-agent']})`;
- return resolvedData;
+ resolvedData.createdBy = `${context.req?.socket.remoteAddress} (${context.req?.headers['user-agent']})`
+ return resolvedData
},
update: ({ context, resolvedData }) => {
//resolvedData.updatedAt = new Date(); // see updatedAt field hook
- resolvedData.updatedBy = `${context.req?.socket.remoteAddress} (${context.req?.headers['user-agent']})`;
- return resolvedData;
+ resolvedData.updatedBy = `${context.req?.socket.remoteAddress} (${context.req?.headers['user-agent']})`
+ return resolvedData
},
},
validateInput: ({ context, operation, inputData, addValidationError }) => {
- const { title, content } = inputData;
+ const { title, content } = inputData
if (operation === 'update' && 'feedback' in inputData) {
- const { feedback } = inputData;
- if (/profanity/i.test(feedback ?? '')) return addValidationError('Unacceptable feedback');
+ const { feedback } = inputData
+ if (/profanity/i.test(feedback ?? '')) return addValidationError('Unacceptable feedback')
}
// an example of a content filter, the prevents the title or content containing the word "Profanity"
- if (/profanity/i.test(title)) return addValidationError('Unacceptable title');
- if (/profanity/i.test(content)) return addValidationError('Unacceptable content');
+ if (/profanity/i.test(title)) return addValidationError('Unacceptable title')
+ if (/profanity/i.test(content)) return addValidationError('Unacceptable content')
},
validateDelete: ({ context, item, addValidationError }) => {
- const { preventDelete } = item;
+ const { preventDelete } = item
// an example of a content filter, the prevents the title or content containing the word "Profanity"
- if (preventDelete) return addValidationError('Cannot delete Post, preventDelete is true');
+ if (preventDelete) return addValidationError('Cannot delete Post, preventDelete is true')
},
beforeOperation: ({ item, resolvedData, operation }) => {
- console.log(`Post beforeOperation.${operation}`, resolvedData);
+ console.log(`Post beforeOperation.${operation}`, resolvedData)
},
afterOperation: {
create: ({ inputData, item }) => {
- console.log(`Post afterOperation.create`, inputData, '->', item);
+ console.log(`Post afterOperation.create`, inputData, '->', item)
},
update: ({ originalItem, item }) => {
- console.log(`Post afterOperation.update`, originalItem, '->', item);
+ console.log(`Post afterOperation.update`, originalItem, '->', item)
},
delete: ({ originalItem }) => {
- console.log(`Post afterOperation.delete`, originalItem, '-> deleted');
+ console.log(`Post afterOperation.delete`, originalItem, '-> deleted')
},
},
},
}),
-};
+}
diff --git a/examples/limits/keystone.ts b/examples/limits/keystone.ts
index aebfcb74e9d..fe1bf98ab98 100644
--- a/examples/limits/keystone.ts
+++ b/examples/limits/keystone.ts
@@ -1,6 +1,6 @@
-import { config } from '@keystone-6/core';
-import { fixPrismaPath } from '../example-utils';
-import { lists } from './schema';
+import { config } from '@keystone-6/core'
+import { fixPrismaPath } from '../example-utils'
+import { lists } from './schema'
export default config({
db: {
@@ -11,4 +11,4 @@ export default config({
...fixPrismaPath,
},
lists,
-});
+})
diff --git a/examples/limits/schema.ts b/examples/limits/schema.ts
index 7e508649365..1081ce2fb8c 100644
--- a/examples/limits/schema.ts
+++ b/examples/limits/schema.ts
@@ -1,6 +1,6 @@
-import { list } from '@keystone-6/core';
-import { allowAll } from '@keystone-6/core/access';
-import { text } from '@keystone-6/core/fields';
+import { list } from '@keystone-6/core'
+import { allowAll } from '@keystone-6/core/access'
+import { text } from '@keystone-6/core/fields'
export const lists = {
Post: list({
@@ -14,4 +14,4 @@ export const lists = {
maxTake: 20,
},
}),
-};
+}
diff --git a/examples/limits/seed-data.ts b/examples/limits/seed-data.ts
index cac2de7f599..8ab08fbd3ed 100644
--- a/examples/limits/seed-data.ts
+++ b/examples/limits/seed-data.ts
@@ -1,17 +1,17 @@
-import { getContext } from '@keystone-6/core/context';
-import config from './keystone';
-import * as PrismaModule from '.myprisma/client';
+import { getContext } from '@keystone-6/core/context'
+import config from './keystone'
+import * as PrismaModule from '.myprisma/client'
-async function main() {
- const context = getContext(config, PrismaModule);
+async function main () {
+ const context = getContext(config, PrismaModule)
- console.log('seeding data');
- const run = Math.random().toString(36).slice(2);
+ console.log('seeding data')
+ const run = Math.random().toString(36).slice(2)
for (let i = 0; i < 1e5; ++i) {
- console.log(`...Post.createOne ${i}`);
- await context.db.Post.createOne({ data: { title: `Post #${i}, run ${run}` } });
+ console.log(`...Post.createOne ${i}`)
+ await context.db.Post.createOne({ data: { title: `Post #${i}, run ${run}` } })
}
}
-main();
+main()
diff --git a/examples/omit/keystone.ts b/examples/omit/keystone.ts
index 0febd4ce2f5..10daa9c916b 100644
--- a/examples/omit/keystone.ts
+++ b/examples/omit/keystone.ts
@@ -1,7 +1,7 @@
-import { config } from '@keystone-6/core';
-import { fixPrismaPath } from '../example-utils';
-import { lists } from './schema';
-import type { Context } from '.keystone/types';
+import { config } from '@keystone-6/core'
+import { fixPrismaPath } from '../example-utils'
+import { lists } from './schema'
+import type { Context } from '.keystone/types'
export default config({
db: {
@@ -9,11 +9,11 @@ export default config({
url: process.env.DATABASE_URL || 'file:./keystone-example.db',
onConnect: async (context: Context) => {
- if ((await context.db.Person.count()) > 0) return;
+ if ((await context.db.Person.count()) > 0) return
- const people = [];
+ const people = []
for (let i = 0; i < 5; ++i) {
- people.push(await context.db.Person.createOne({ data: { name: `Person #${i}` } }));
+ people.push(await context.db.Person.createOne({ data: { name: `Person #${i}` } }))
}
for (const { id } of people) {
@@ -27,7 +27,7 @@ export default config({
},
},
},
- });
+ })
await context.prisma.nice.create({
data: {
@@ -37,7 +37,7 @@ export default config({
},
},
},
- });
+ })
await context.prisma.naughty.create({
data: {
@@ -47,7 +47,7 @@ export default config({
},
},
},
- });
+ })
}
},
@@ -55,4 +55,4 @@ export default config({
...fixPrismaPath,
},
lists,
-});
+})
diff --git a/examples/omit/schema.ts b/examples/omit/schema.ts
index 1f78ed34e73..87b2ecba28e 100644
--- a/examples/omit/schema.ts
+++ b/examples/omit/schema.ts
@@ -1,7 +1,7 @@
-import { list } from '@keystone-6/core';
-import { allowAll } from '@keystone-6/core/access';
-import { text, relationship } from '@keystone-6/core/fields';
-import type { Lists } from '.keystone/types';
+import { list } from '@keystone-6/core'
+import { allowAll } from '@keystone-6/core/access'
+import { text, relationship } from '@keystone-6/core/fields'
+import type { Lists } from '.keystone/types'
export const lists: Lists = {
Person: list({
@@ -72,4 +72,4 @@ export const lists: Lists = {
}),
},
}),
-};
+}
diff --git a/examples/reuse/keystone.ts b/examples/reuse/keystone.ts
index 5ef2ee1f7db..913b632a542 100644
--- a/examples/reuse/keystone.ts
+++ b/examples/reuse/keystone.ts
@@ -1,6 +1,6 @@
-import { config } from '@keystone-6/core';
-import { fixPrismaPath } from '../example-utils';
-import { lists } from './schema';
+import { config } from '@keystone-6/core'
+import { fixPrismaPath } from '../example-utils'
+import { lists } from './schema'
export default config({
db: {
@@ -11,4 +11,4 @@ export default config({
...fixPrismaPath,
},
lists,
-});
+})
diff --git a/examples/reuse/schema.ts b/examples/reuse/schema.ts
index 163e74ce6cc..5ca16573a25 100644
--- a/examples/reuse/schema.ts
+++ b/examples/reuse/schema.ts
@@ -1,9 +1,9 @@
-import { list } from '@keystone-6/core';
+import { list } from '@keystone-6/core'
// import type { BaseListTypeInfo } from '@keystone-6/core/types';
-import type { FieldHooks } from '@keystone-6/core/types';
-import { allowAll, denyAll } from '@keystone-6/core/access';
-import { checkbox, text, timestamp } from '@keystone-6/core/fields';
-import type { Lists, TypeInfo } from '.keystone/types';
+import type { FieldHooks } from '@keystone-6/core/types'
+import { allowAll, denyAll } from '@keystone-6/core/access'
+import { checkbox, text, timestamp } from '@keystone-6/core/fields'
+import type { Lists, TypeInfo } from '.keystone/types'
const readOnly = {
access: {
@@ -29,68 +29,68 @@ const readOnly = {
fieldMode: () => 'read' as const,
},
},
-};
+}
// we use this function to show that completed is a boolean type
// which would be missing if the types were unrefined
// a common problem when re-using code
-function isTrue(b: boolean) {
- return b === true;
+function isTrue (b: boolean) {
+ return b === true
}
-type ListsT = TypeInfo['lists'];
+type ListsT = TypeInfo['lists']
type FindListsWithField = {
[key in keyof ListsT]: K extends ListsT[key]['fields'] ? ListsT[key] : never;
-}[keyof ListsT];
+}[keyof ListsT]
// alternatively, if you don't like type functions
// type CompatibleLists = Lists.Invoice.TypeInfo | Lists.Order.TypeInfo
-type CompatibleLists = FindListsWithField<'completed'>;
+type CompatibleLists = FindListsWithField<'completed'>
// type CompatibleLists = TypeInfo['lists'][keyof TypeInfo['lists']] // item is resolved, but not completed
// type CompatibleLists = BaseListTypeInfo // nothing is refined, item is Record
function trackingByHooks<
ListTypeInfo extends CompatibleLists
// FieldKey extends 'createdBy' | 'updatedBy' // TODO: refined types for the return types
->(immutable: boolean = false): FieldHooks {
+> (immutable: boolean = false): FieldHooks {
return {
- async resolveInput({ context, operation, resolvedData, item, fieldKey }) {
+ async resolveInput ({ context, operation, resolvedData, item, fieldKey }) {
if (operation === 'update') {
- if (immutable) return undefined;
+ if (immutable) return undefined
// show we have refined types for compatible item.* fields
- if (isTrue(item.completed) && resolvedData.completed !== false) return undefined;
+ if (isTrue(item.completed) && resolvedData.completed !== false) return undefined
}
// TODO: refined types for the return types
// FIXME: CommonFieldConfig need not always be generalised
- return `${context.req?.socket.remoteAddress} (${context.req?.headers['user-agent']})` as any;
+ return `${context.req?.socket.remoteAddress} (${context.req?.headers['user-agent']})` as any
},
- };
+ }
}
function trackingAtHooks<
ListTypeInfo extends CompatibleLists
// FieldKey extends 'createdAt' | 'updatedAt' // TODO: refined types for the return types
->(immutable: boolean = false): FieldHooks {
+> (immutable: boolean = false): FieldHooks {
return {
// TODO: switch to operation routing when supported for fields
- async resolveInput({ context, operation, resolvedData, item, fieldKey }) {
+ async resolveInput ({ context, operation, resolvedData, item, fieldKey }) {
if (operation === 'update') {
- if (immutable) return undefined;
+ if (immutable) return undefined
// show we have refined types for compatible item.* fields
- if (isTrue(item.completed) && resolvedData.completed !== false) return undefined;
+ if (isTrue(item.completed) && resolvedData.completed !== false) return undefined
}
// TODO: refined types for the return types
// FIXME: CommonFieldConfig need not always be generalised
- return new Date() as any;
+ return new Date() as any
},
- };
+ }
}
-function trackingFields() {
+function trackingFields () {
return {
createdBy: text({
...readOnly,
@@ -116,7 +116,7 @@ function trackingFields() {
...trackingAtHooks(),
},
}),
- };
+ }
}
export const lists: Lists = {
@@ -144,4 +144,4 @@ export const lists: Lists = {
name: text(),
},
}),
-};
+}
diff --git a/examples/script/keystone.ts b/examples/script/keystone.ts
index 31fbf6476c3..b9fc5da8c16 100644
--- a/examples/script/keystone.ts
+++ b/examples/script/keystone.ts
@@ -1,8 +1,8 @@
-import { config, list } from '@keystone-6/core';
-import { allowAll } from '@keystone-6/core/access';
-import { text, timestamp } from '@keystone-6/core/fields';
-import { fixPrismaPath } from '../example-utils';
-import { TypeInfo } from '.keystone/types';
+import { config, list } from '@keystone-6/core'
+import { allowAll } from '@keystone-6/core/access'
+import { text, timestamp } from '@keystone-6/core/fields'
+import { fixPrismaPath } from '../example-utils'
+import { type TypeInfo } from '.keystone/types'
export default config({
db: {
@@ -11,8 +11,8 @@ export default config({
// this is called by Keystone on start, or when connect() is called in script.ts
onConnect: async context => {
- console.log('(keystone.ts)', 'onConnect');
- await context.db.Post.createOne({ data: { title: 'Created in onConnect' } });
+ console.log('(keystone.ts)', 'onConnect')
+ await context.db.Post.createOne({ data: { title: 'Created in onConnect' } })
},
// WARNING: this is only needed for our monorepo examples, dont do this
@@ -32,4 +32,4 @@ export default config({
},
}),
},
-});
+})
diff --git a/examples/script/script.ts b/examples/script/script.ts
index 8be8714f1e3..640c92eaa0d 100644
--- a/examples/script/script.ts
+++ b/examples/script/script.ts
@@ -1,23 +1,23 @@
-import { getContext } from '@keystone-6/core/context';
-import config from './keystone';
+import { getContext } from '@keystone-6/core/context'
+import config from './keystone'
// WARNING: this is only needed for our monorepo examples, dont do this
-import * as PrismaModule from '.myprisma/client';
+import * as PrismaModule from '.myprisma/client'
// do this instead
// import * as PrismaModule from '@prisma/client';
-async function main() {
- const context = getContext(config, PrismaModule);
+async function main () {
+ const context = getContext(config, PrismaModule)
- console.log('(script.ts)', 'connect');
- await config.db.onConnect?.(context);
+ console.log('(script.ts)', 'connect')
+ await config.db.onConnect?.(context)
- const run = (Math.random() * 1e5) | 0;
+ const run = (Math.random() * 1e5) | 0
for (let i = 0; i < 10; ++i) {
- console.log('(script.ts)', `Post.createOne ${i}`);
- await context.db.Post.createOne({ data: { title: `Post #${i}, run ${run}` } });
+ console.log('(script.ts)', `Post.createOne ${i}`)
+ await context.db.Post.createOne({ data: { title: `Post #${i}, run ${run}` } })
}
}
-main();
+main()
diff --git a/examples/singleton/keystone.ts b/examples/singleton/keystone.ts
index aebfcb74e9d..fe1bf98ab98 100644
--- a/examples/singleton/keystone.ts
+++ b/examples/singleton/keystone.ts
@@ -1,6 +1,6 @@
-import { config } from '@keystone-6/core';
-import { fixPrismaPath } from '../example-utils';
-import { lists } from './schema';
+import { config } from '@keystone-6/core'
+import { fixPrismaPath } from '../example-utils'
+import { lists } from './schema'
export default config({
db: {
@@ -11,4 +11,4 @@ export default config({
...fixPrismaPath,
},
lists,
-});
+})
diff --git a/examples/singleton/schema.ts b/examples/singleton/schema.ts
index 161cd8d65fd..df81a6666dc 100644
--- a/examples/singleton/schema.ts
+++ b/examples/singleton/schema.ts
@@ -1,6 +1,6 @@
-import { list } from '@keystone-6/core';
-import { allowAll } from '@keystone-6/core/access';
-import { relationship, text, timestamp } from '@keystone-6/core/fields';
+import { list } from '@keystone-6/core'
+import { allowAll } from '@keystone-6/core/access'
+import { relationship, text, timestamp } from '@keystone-6/core/fields'
export const lists = {
Settings: list({
@@ -23,4 +23,4 @@ export const lists = {
publishDate: timestamp(),
},
}),
-};
+}
diff --git a/examples/singleton/seed-data.tsx b/examples/singleton/seed-data.tsx
index 042187df8de..bdbb3a9cfe7 100644
--- a/examples/singleton/seed-data.tsx
+++ b/examples/singleton/seed-data.tsx
@@ -1,34 +1,34 @@
-import { getContext } from '@keystone-6/core/context';
-import { posts } from '../example-data';
-import config from './keystone';
-import * as PrismaModule from '.myprisma/client';
+import { getContext } from '@keystone-6/core/context'
+import { posts } from '../example-data'
+import config from './keystone'
+import * as PrismaModule from '.myprisma/client'
type PostProps = {
- title: string;
- status: 'draft' | 'published';
- publishDate: string;
- author: string;
- content: string;
-};
+ title: string
+ status: 'draft' | 'published'
+ publishDate: string
+ author: string
+ content: string
+}
-async function main() {
- const context = getContext(config, PrismaModule);
+async function main () {
+ const context = getContext(config, PrismaModule)
- console.log(`🌱 Inserting seed data`);
+ console.log(`🌱 Inserting seed data`)
const createPost = async (postData: PostProps) => {
await context.query.Post.createOne({
data: postData,
query: 'id',
- });
- };
+ })
+ }
for (const post of posts) {
- console.log(`📝 Adding post: ${post.title}`);
- await createPost(post);
+ console.log(`📝 Adding post: ${post.title}`)
+ await createPost(post)
}
- console.log(`✅ Seed data inserted`);
- console.log(`👋 Please start the process with \`yarn dev\` or \`npm run dev\``);
+ console.log(`✅ Seed data inserted`)
+ console.log(`👋 Please start the process with \`yarn dev\` or \`npm run dev\``)
}
-main();
+main()
diff --git a/examples/testing/example-test.ts b/examples/testing/example-test.ts
index 4360344730c..443fb6fb258 100644
--- a/examples/testing/example-test.ts
+++ b/examples/testing/example-test.ts
@@ -1,27 +1,27 @@
-import path from 'node:path';
-import { test, beforeEach } from 'node:test';
-import assert from 'node:assert/strict';
+import path from 'node:path'
+import { test, beforeEach } from 'node:test'
+import assert from 'node:assert/strict'
-import { resetDatabase } from '@keystone-6/core/testing';
-import { getContext } from '@keystone-6/core/context';
-import config from './keystone';
-import * as PrismaModule from '.myprisma/client';
+import { resetDatabase } from '@keystone-6/core/testing'
+import { getContext } from '@keystone-6/core/context'
+import config from './keystone'
+import * as PrismaModule from '.myprisma/client'
-const prismaSchemaPath = path.join(__dirname, 'schema.prisma');
-const context = getContext(config, PrismaModule);
+const prismaSchemaPath = path.join(__dirname, 'schema.prisma')
+const context = getContext(config, PrismaModule)
beforeEach(async () => {
- await resetDatabase(config.db.url, prismaSchemaPath);
-});
+ await resetDatabase(config.db.url, prismaSchemaPath)
+})
test('Create a User using context.query', async () => {
const person = await context.query.User.createOne({
data: { name: 'Alice', password: 'dont-use-me' },
query: 'id name password { isSet }',
- });
- assert.equal(person.name, 'Alice');
- assert.equal(person.password.isSet, true);
-});
+ })
+ assert.equal(person.name, 'Alice')
+ assert.equal(person.password.isSet, true)
+})
test('Check that trying to create user with no name (required field) fails', async () => {
await assert.rejects(
@@ -30,14 +30,14 @@ test('Check that trying to create user with no name (required field) fails', asy
data: {
password: 'not-a-password',
},
- });
+ })
},
{
message:
'You provided invalid data for this operation.\n - User.name: Name must not be empty',
}
- );
-});
+ )
+})
test('Check access control by running updateTask as a specific user via context.withSession()', async () => {
// seed a few users to test with
@@ -47,9 +47,9 @@ test('Check access control by running updateTask as a specific user via context.
{ name: 'Bob', password: 'dont-use-me' },
],
query: 'id name',
- });
- assert.equal(alice.name, 'Alice');
- assert.equal(bob.name, 'Bob');
+ })
+ assert.equal(alice.name, 'Alice')
+ assert.equal(bob.name, 'Bob')
// assign a task to Alice
const task = await context.query.Task.createOne({
@@ -60,22 +60,22 @@ test('Check access control by running updateTask as a specific user via context.
assignedTo: { connect: { id: alice.id } },
},
query: 'id label priority isComplete assignedTo { name }',
- });
- assert.equal(task.label, 'Experiment with Keystone');
- assert.equal(task.priority, 'high');
- assert.equal(task.isComplete, false);
- assert.equal(task.assignedTo.name, 'Alice');
+ })
+ assert.equal(task.label, 'Experiment with Keystone')
+ assert.equal(task.priority, 'high')
+ assert.equal(task.isComplete, false)
+ assert.equal(task.assignedTo.name, 'Alice')
await assert.rejects(
async () => {
await context.db.Task.updateOne({
where: { id: task.id },
data: { isComplete: true },
- });
+ })
},
{
message: `Access denied: You cannot update that Task - it may not exist`,
}
- );
+ )
// test that we can update the task (with a session)
{
@@ -84,8 +84,8 @@ test('Check access control by running updateTask as a specific user via context.
.db.Task.updateOne({
where: { id: task.id },
data: { isComplete: true },
- });
- assert.equal(result.id, task.id);
+ })
+ assert.equal(result.id, task.id)
}
// test that we can't update the task (with an invalid session (Bob))
@@ -94,10 +94,10 @@ test('Check access control by running updateTask as a specific user via context.
await context.withSession({ listKey: 'User', itemId: bob.id, data: {} }).db.Task.updateOne({
where: { id: task.id },
data: { isComplete: true },
- });
+ })
},
{
message: `Access denied: You cannot update that Task - it may not exist`,
}
- );
-});
+ )
+})
diff --git a/examples/testing/keystone.ts b/examples/testing/keystone.ts
index 348b5b3d3bb..e29725cbb35 100644
--- a/examples/testing/keystone.ts
+++ b/examples/testing/keystone.ts
@@ -1,10 +1,10 @@
-import { config } from '@keystone-6/core';
-import { statelessSessions } from '@keystone-6/core/session';
-import { createAuth } from '@keystone-6/auth';
-import { fixPrismaPath } from '../example-utils';
-import { lists } from './schema';
-import type { Session } from './schema';
-import type { TypeInfo } from '.keystone/types';
+import { config } from '@keystone-6/core'
+import { statelessSessions } from '@keystone-6/core/session'
+import { createAuth } from '@keystone-6/auth'
+import { fixPrismaPath } from '../example-utils'
+import { lists } from './schema'
+import type { Session } from './schema'
+import type { TypeInfo } from '.keystone/types'
// WARNING: this example is for TESTING purposes only
// as with each of our examples, it has not been vetted
@@ -30,7 +30,7 @@ const { withAuth } = createAuth({
// the following fields are used by the "Create First User" form
fields: ['name', 'password'],
},
-});
+})
export default withAuth(
config>({
@@ -45,4 +45,4 @@ export default withAuth(
// you can find out more at https://keystonejs.com/docs/apis/session#session-api
session: statelessSessions(),
})
-);
+)
diff --git a/examples/testing/schema.ts b/examples/testing/schema.ts
index 46f925228d5..4de22811cee 100644
--- a/examples/testing/schema.ts
+++ b/examples/testing/schema.ts
@@ -1,19 +1,19 @@
-import { list } from '@keystone-6/core';
-import { checkbox, password, relationship, text, timestamp } from '@keystone-6/core/fields';
-import { select } from '@keystone-6/core/fields';
-import { allowAll } from '@keystone-6/core/access';
-import type { Lists } from '.keystone/types';
+import { list } from '@keystone-6/core'
+import { checkbox, password, relationship, text, timestamp } from '@keystone-6/core/fields'
+import { select } from '@keystone-6/core/fields'
+import { allowAll } from '@keystone-6/core/access'
+import type { Lists } from '.keystone/types'
// needs to be compatible with withAuth
export type Session = {
- listKey: string;
- itemId: string;
- data: {};
-};
+ listKey: string
+ itemId: string
+ data: {}
+}
-function isAssignedUserFilter({ session }: { session?: Session }) {
+function isAssignedUserFilter ({ session }: { session?: Session }) {
// you need to have a session
- if (!session) return false;
+ if (!session) return false
// the authenticated user can edit posts they are assigned to
return {
@@ -22,7 +22,7 @@ function isAssignedUserFilter({ session }: { session?: Session }) {
equals: session.itemId,
},
},
- };
+ }
}
export const lists: Lists = {
@@ -56,4 +56,4 @@ export const lists: Lists = {
tasks: relationship({ ref: 'Task.assignedTo', many: true }),
},
}),
-};
+}
diff --git a/examples/usecase-blog-moderated/keystone.ts b/examples/usecase-blog-moderated/keystone.ts
index bc878158111..85719a40298 100644
--- a/examples/usecase-blog-moderated/keystone.ts
+++ b/examples/usecase-blog-moderated/keystone.ts
@@ -1,11 +1,11 @@
-import { config } from '@keystone-6/core';
-import { fixPrismaPath } from '../example-utils';
-import { lists, Session } from './schema';
-import type { Context, TypeInfo } from '.keystone/types';
+import { config } from '@keystone-6/core'
+import { fixPrismaPath } from '../example-utils'
+import { lists, type Session } from './schema'
+import type { Context, TypeInfo } from '.keystone/types'
const sillySessionStrategy = {
- async get({ context }: { context: Context }): Promise {
- if (!context.req) return;
+ async get ({ context }: { context: Context }): Promise {
+ if (!context.req) return
// WARNING: for demonstrative purposes only, this has no authentication
// use `Cookie:user=clh9v6pcn0000sbhm9u0j6in0` for Alice (admin)
@@ -13,27 +13,27 @@ const sillySessionStrategy = {
// use `Cookie:user=clh9v7ahs0004sbhmpx30w85n` for Eve (contributor)
//
// in practice, you should use authentication for your sessions, such as OAuth or JWT
- const { cookie = '' } = context.req.headers;
- const [cookieName, id] = cookie.split('=');
- if (cookieName !== 'user') return;
+ const { cookie = '' } = context.req.headers
+ const [cookieName, id] = cookie.split('=')
+ if (cookieName !== 'user') return
- const who = await context.sudo().db.User.findOne({ where: { id } });
- if (!who) return;
+ const who = await context.sudo().db.User.findOne({ where: { id } })
+ if (!who) return
return {
id,
admin: who.admin,
moderator: who.moderatorId ? { id: who.moderatorId } : null,
contributor: who.contributorId ? { id: who.contributorId } : null,
- };
+ }
},
// we don't need these unless we want to support the functions
// context.sessionStrategy.start
// context.sessionStrategy.end
//
- async start() {},
- async end() {},
-};
+ async start () {},
+ async end () {},
+}
export default config({
db: {
@@ -45,4 +45,4 @@ export default config({
},
lists,
session: sillySessionStrategy,
-});
+})
diff --git a/examples/usecase-blog-moderated/schema.ts b/examples/usecase-blog-moderated/schema.ts
index cad6ea6c12a..a577fa9a790 100644
--- a/examples/usecase-blog-moderated/schema.ts
+++ b/examples/usecase-blog-moderated/schema.ts
@@ -1,80 +1,80 @@
-import { list } from '@keystone-6/core';
-import { allowAll, denyAll, unfiltered } from '@keystone-6/core/access';
-import { checkbox, text, relationship, timestamp } from '@keystone-6/core/fields';
-import type { Lists } from '.keystone/types';
+import { list } from '@keystone-6/core'
+import { allowAll, denyAll, unfiltered } from '@keystone-6/core/access'
+import { checkbox, text, relationship, timestamp } from '@keystone-6/core/fields'
+import type { Lists } from '.keystone/types'
// WARNING: this example is for demonstration purposes only
// as with each of our examples, it has not been vetted
// or tested for any particular usage
export type Session = {
- id: string;
- admin: boolean;
- moderator: null | { id: string };
- contributor: null | { id: string };
-};
+ id: string
+ admin: boolean
+ moderator: null | { id: string }
+ contributor: null | { id: string }
+}
type Has = {
[key in keyof T]: key extends K ? Exclude : T[key];
-};
+}
-function isAdmin(session?: T): session is T & { admin: true } {
- return session?.admin === true;
+function isAdmin (session?: T): session is T & { admin: true } {
+ return session?.admin === true
}
-function isModerator(session?: T): session is Has {
- return session?.moderator !== null;
+function isModerator (session?: T): session is Has {
+ return session?.moderator !== null
}
-function isContributor(session?: T): session is Has {
- return session?.contributor !== null;
+function isContributor (session?: T): session is Has {
+ return session?.contributor !== null
}
-function forUsers({
+function forUsers ({
admin,
moderator,
contributor,
default: _default,
}: {
- admin?: ({ session }: { session: Session & { admin: true } }) => T;
- moderator?: ({ session }: { session: Has }) => T;
- contributor?: ({ session }: { session: Has }) => T;
- default: () => T;
+ admin?: ({ session }: { session: Session & { admin: true } }) => T
+ moderator?: ({ session }: { session: Has }) => T
+ contributor?: ({ session }: { session: Has }) => T
+ default: () => T
}) {
return ({ session }: { session?: Session }): T => {
- if (!session) return _default();
- if (admin && isAdmin(session)) return admin({ session });
- if (moderator && isModerator(session)) return moderator({ session });
- if (contributor && isContributor(session)) return contributor({ session });
- return _default();
- };
+ if (!session) return _default()
+ if (admin && isAdmin(session)) return admin({ session })
+ if (moderator && isModerator(session)) return moderator({ session })
+ if (contributor && isContributor(session)) return contributor({ session })
+ return _default()
+ }
}
const adminOnly = forUsers({
admin: allowAll,
default: denyAll,
-});
+})
const moderatorsOrAbove = forUsers({
admin: allowAll,
moderator: allowAll,
default: denyAll,
-});
+})
const contributorsOrAbove = forUsers({
admin: allowAll,
moderator: allowAll,
contributor: allowAll,
default: denyAll,
-});
+})
-function readOnlyBy(f: ({ session }: { session?: Session }) => boolean) {
+function readOnlyBy (f: ({ session }: { session?: Session }) => boolean) {
return {
read: f,
create: denyAll,
update: denyAll,
- };
+ }
}
-function viewOnlyBy(f: ({ session }: { session?: Session }) => boolean, mode: 'edit' | 'read') {
+function viewOnlyBy (f: ({ session }: { session?: Session }) => boolean, mode: 'edit' | 'read') {
return {
createView: {
fieldMode: ({ session }: { session?: Session }) =>
@@ -86,15 +86,15 @@ function viewOnlyBy(f: ({ session }: { session?: Session }) => boolean, mode: 'e
listView: {
fieldMode: ({ session }: { session?: Session }) => (f({ session }) ? 'read' : 'hidden'),
},
- };
+ }
}
-function readOnlyViewBy(f: ({ session }: { session?: Session }) => boolean) {
- return viewOnlyBy(f, 'read');
+function readOnlyViewBy (f: ({ session }: { session?: Session }) => boolean) {
+ return viewOnlyBy(f, 'read')
}
-function editOnlyViewBy(f: ({ session }: { session?: Session }) => boolean) {
- return viewOnlyBy(f, 'edit');
+function editOnlyViewBy (f: ({ session }: { session?: Session }) => boolean) {
+ return viewOnlyBy(f, 'edit')
}
export const lists: Lists = {
@@ -178,7 +178,7 @@ export const lists: Lists = {
hooks: {
resolveInput: {
create: ({ context: { session }, resolvedData }) => {
- resolvedData.createdAt = new Date();
+ resolvedData.createdAt = new Date()
if (isContributor(session)) {
return {
...resolvedData,
@@ -187,12 +187,12 @@ export const lists: Lists = {
id: session.contributor.id,
},
},
- };
+ }
}
- return resolvedData;
+ return resolvedData
},
update: ({ context: { session }, resolvedData }) => {
- resolvedData.updatedAt = new Date();
+ resolvedData.updatedAt = new Date()
if ('hidden' in resolvedData && isModerator(session)) {
resolvedData.hiddenBy = resolvedData.hidden
? {
@@ -203,12 +203,12 @@ export const lists: Lists = {
}
: {
disconnect: true,
- };
+ }
- resolvedData.hiddenAt = resolvedData.hidden ? new Date() : null;
+ resolvedData.hiddenAt = resolvedData.hidden ? new Date() : null
}
- return resolvedData;
+ return resolvedData
},
},
},
@@ -275,4 +275,4 @@ export const lists: Lists = {
moderator: relationship({ ref: 'Moderator' }),
},
}),
-};
+}
diff --git a/examples/usecase-blog/keystone.ts b/examples/usecase-blog/keystone.ts
index 291206afbcc..e94da84a666 100644
--- a/examples/usecase-blog/keystone.ts
+++ b/examples/usecase-blog/keystone.ts
@@ -1,7 +1,7 @@
-import { config } from '@keystone-6/core';
-import { fixPrismaPath } from '../example-utils';
-import { lists } from './schema';
-import { TypeInfo } from '.keystone/types';
+import { config } from '@keystone-6/core'
+import { fixPrismaPath } from '../example-utils'
+import { lists } from './schema'
+import { type TypeInfo } from '.keystone/types'
export default config({
db: {
@@ -12,4 +12,4 @@ export default config({
...fixPrismaPath,
},
lists,
-});
+})
diff --git a/examples/usecase-blog/schema.ts b/examples/usecase-blog/schema.ts
index 4d8474baf77..d2be82586ff 100644
--- a/examples/usecase-blog/schema.ts
+++ b/examples/usecase-blog/schema.ts
@@ -1,17 +1,17 @@
-import { list } from '@keystone-6/core';
-import { allowAll } from '@keystone-6/core/access';
+import { list } from '@keystone-6/core'
+import { allowAll } from '@keystone-6/core/access'
// see https://keystonejs.com/docs/fields/overview for the full list of fields
// this is a few common fields for an example
-import { text, relationship, timestamp } from '@keystone-6/core/fields';
+import { text, relationship, timestamp } from '@keystone-6/core/fields'
// the document field is a more complicated field, so it has it's own package
-import { document } from '@keystone-6/fields-document';
+import { document } from '@keystone-6/fields-document'
// if you want to make your own fields, see https://keystonejs.com/docs/guides/custom-fields
// when using Typescript, you can refine your types to a stricter subset by importing
// the generated types from '.keystone/types'
-import type { Lists } from '.keystone/types';
+import type { Lists } from '.keystone/types'
export const lists: Lists = {
Author: list({
@@ -118,4 +118,4 @@ export const lists: Lists = {
posts: relationship({ ref: 'Post.tags', many: true }),
},
}),
-};
+}
diff --git a/examples/usecase-blog/seed-data.ts b/examples/usecase-blog/seed-data.ts
index f04d9e31e3a..68631ae98f3 100644
--- a/examples/usecase-blog/seed-data.ts
+++ b/examples/usecase-blog/seed-data.ts
@@ -1,39 +1,39 @@
-import { getContext } from '@keystone-6/core/context';
-import { authors, posts } from '../example-data';
-import config from './keystone';
-import * as PrismaModule from '.myprisma/client';
+import { getContext } from '@keystone-6/core/context'
+import { authors, posts } from '../example-data'
+import config from './keystone'
+import * as PrismaModule from '.myprisma/client'
-async function main() {
- const context = getContext(config, PrismaModule);
+async function main () {
+ const context = getContext(config, PrismaModule)
- console.log(`🌱 Inserting seed data`);
+ console.log(`🌱 Inserting seed data`)
for (const author of authors) {
- console.log(`👩 Adding author: ${author.name}`);
+ console.log(`👩 Adding author: ${author.name}`)
const item = await context.db.Author.findOne({
where: { email: author.email },
- });
+ })
if (!item) {
await context.db.Author.createOne({
data: author,
- });
+ })
}
}
for (const post of posts) {
- console.log(`📝 Adding post: ${post.title}`);
+ console.log(`📝 Adding post: ${post.title}`)
const authors = await context.db.Author.findMany({
where: { name: { equals: post.author } },
- });
+ })
await context.db.Post.createOne({
data: { ...post, author: { connect: { id: authors[0].id } } },
- });
+ })
}
- console.log(`✅ Seed data inserted`);
- console.log(`👋 Please start the process with \`yarn dev\` or \`npm run dev\``);
+ console.log(`✅ Seed data inserted`)
+ console.log(`👋 Please start the process with \`yarn dev\` or \`npm run dev\``)
}
-main();
+main()
diff --git a/examples/usecase-relationship-union/keystone.ts b/examples/usecase-relationship-union/keystone.ts
index 291206afbcc..e94da84a666 100644
--- a/examples/usecase-relationship-union/keystone.ts
+++ b/examples/usecase-relationship-union/keystone.ts
@@ -1,7 +1,7 @@
-import { config } from '@keystone-6/core';
-import { fixPrismaPath } from '../example-utils';
-import { lists } from './schema';
-import { TypeInfo } from '.keystone/types';
+import { config } from '@keystone-6/core'
+import { fixPrismaPath } from '../example-utils'
+import { lists } from './schema'
+import { type TypeInfo } from '.keystone/types'
export default config({
db: {
@@ -12,4 +12,4 @@ export default config({
...fixPrismaPath,
},
lists,
-});
+})
diff --git a/examples/usecase-relationship-union/schema.ts b/examples/usecase-relationship-union/schema.ts
index ddade0ec27c..5641385c07e 100644
--- a/examples/usecase-relationship-union/schema.ts
+++ b/examples/usecase-relationship-union/schema.ts
@@ -1,9 +1,9 @@
-import { list, group, graphql } from '@keystone-6/core';
-import { allowAll } from '@keystone-6/core/access';
-import { text, relationship, virtual } from '@keystone-6/core/fields';
-import { Lists } from '.keystone/types';
+import { list, group, graphql } from '@keystone-6/core'
+import { allowAll } from '@keystone-6/core/access'
+import { text, relationship, virtual } from '@keystone-6/core/fields'
+import { type Lists } from '.keystone/types'
-function ifUnsetHideUI(field: string) {
+function ifUnsetHideUI (field: string) {
return {
itemView: {
fieldMode: ({ item }: any) => (item[field] ? 'edit' : 'read'),
@@ -11,7 +11,7 @@ function ifUnsetHideUI(field: string) {
listView: {
fieldMode: () => 'hidden' as const,
},
- };
+ }
}
export const lists: Lists = {
@@ -42,18 +42,18 @@ export const lists: Lists = {
field: graphql.field({
type: graphql.String,
resolve: async (item, _, context) => {
- const { postId, linkId } = item;
+ const { postId, linkId } = item
if (postId) {
return (
(await context.db.Post.findOne({ where: { id: postId } }))?.title ?? '[missing]'
- );
+ )
}
if (linkId) {
return (
(await context.db.Link.findOne({ where: { id: linkId } }))?.title ?? '[missing]'
- );
+ )
}
- return '?';
+ return '?'
},
}),
}),
@@ -82,25 +82,25 @@ export const lists: Lists = {
hooks: {
validateInput: async ({ operation, inputData, addValidationError }) => {
if (operation === 'create') {
- const { post, link } = inputData;
- const values = [post, link].filter(x => x?.connect ?? x?.create);
+ const { post, link } = inputData
+ const values = [post, link].filter(x => x?.connect ?? x?.create)
if (values.length === 0) {
- return addValidationError('A relationship is required');
+ return addValidationError('A relationship is required')
}
if (values.length > 1) {
- return addValidationError('Only one relationship at a time');
+ return addValidationError('Only one relationship at a time')
}
}
if (operation === 'update') {
- const { post, link } = inputData;
+ const { post, link } = inputData
if ([post, link].some(x => x?.disconnect)) {
- return addValidationError('Cannot change relationship type');
+ return addValidationError('Cannot change relationship type')
}
- const values = [post, link].filter(x => x?.connect ?? x?.create);
+ const values = [post, link].filter(x => x?.connect ?? x?.create)
if (values.length > 1) {
- return addValidationError('Only one relationship at a time');
+ return addValidationError('Only one relationship at a time')
}
// TODO: prevent item from changing types with implicit disconnect
@@ -108,10 +108,10 @@ export const lists: Lists = {
},
resolveInput: {
update: async ({ context, operation, resolvedData }) => {
- const { post, link, ...rest } = resolvedData;
+ const { post, link, ...rest } = resolvedData
for (const [key, value] of Object.entries({ post, link })) {
- if (!value) continue;
- if (value.disconnect) continue; // TODO: null should disconnect
+ if (!value) continue
+ if (value.disconnect) continue // TODO: null should disconnect
// disconnect everything else
return {
@@ -119,12 +119,12 @@ export const lists: Lists = {
post: { disconnect: true },
link: { disconnect: true },
[key]: value,
- };
+ }
}
- return rest;
+ return rest
},
},
},
}),
-};
+}
diff --git a/examples/usecase-roles/access.ts b/examples/usecase-roles/access.ts
index fa0cecf8a9a..7428da25891 100644
--- a/examples/usecase-roles/access.ts
+++ b/examples/usecase-roles/access.ts
@@ -1,29 +1,29 @@
export type Session = {
- itemId: string;
- listKey: string;
+ itemId: string
+ listKey: string
data: {
- name: string;
+ name: string
role: {
- id: string;
- name: string;
- canCreateTodos: boolean;
- canManageAllTodos: boolean;
- canSeeOtherPeople: boolean;
- canEditOtherPeople: boolean;
- canManagePeople: boolean;
- canManageRoles: boolean;
- canUseAdminUI: boolean;
- };
- };
-};
+ id: string
+ name: string
+ canCreateTodos: boolean
+ canManageAllTodos: boolean
+ canSeeOtherPeople: boolean
+ canEditOtherPeople: boolean
+ canManagePeople: boolean
+ canManageRoles: boolean
+ canUseAdminUI: boolean
+ }
+ }
+}
type AccessArgs = {
- session?: Session;
-};
+ session?: Session
+}
// this function checks only that a session actually exists, nothing else
-export function isSignedIn({ session }: AccessArgs) {
- return Boolean(session);
+export function isSignedIn ({ session }: AccessArgs) {
+ return Boolean(session)
}
/*
@@ -36,7 +36,7 @@ export const permissions = {
canManagePeople: ({ session }: AccessArgs) => session?.data.role?.canManagePeople ?? false,
canManageRoles: ({ session }: AccessArgs) => session?.data.role?.canManageRoles ?? false,
// TODO: add canViewAdminUI
-};
+}
/*
Rules are logical functions that can be used for list access, and may return a boolean (meaning
@@ -44,7 +44,7 @@ export const permissions = {
*/
export const rules = {
canReadTodos: ({ session }: AccessArgs) => {
- if (!session) return false;
+ if (!session) return false
if (session.data.role?.canManageAllTodos) {
// can see all todos that are: assigned to them, or not private
@@ -54,37 +54,37 @@ export const rules = {
{ assignedTo: null, isPrivate: { equals: true } },
{ NOT: { isPrivate: { equals: true } } },
],
- };
+ }
}
// default to only seeing your own todos
- return { assignedTo: { id: { equals: session.itemId } } };
+ return { assignedTo: { id: { equals: session.itemId } } }
},
canManageTodos: ({ session }: AccessArgs) => {
- if (!session) return false;
+ if (!session) return false
// can manage every todo?
- if (session.data.role?.canManageAllTodos) return true;
+ if (session.data.role?.canManageAllTodos) return true
// default to only managing your own todos
- return { assignedTo: { id: { equals: session.itemId } } };
+ return { assignedTo: { id: { equals: session.itemId } } }
},
canReadPeople: ({ session }: AccessArgs) => {
- if (!session) return false;
+ if (!session) return false
// can see everyone?
- if (session.data.role?.canSeeOtherPeople) return true;
+ if (session.data.role?.canSeeOtherPeople) return true
// default to only seeing yourself
- return { id: { equals: session.itemId } };
+ return { id: { equals: session.itemId } }
},
canUpdatePeople: ({ session }: AccessArgs) => {
- if (!session) return false;
+ if (!session) return false
// can update everyone?
- if (session.data.role?.canEditOtherPeople) return true;
+ if (session.data.role?.canEditOtherPeople) return true
// default to only updating yourself
- return { id: { equals: session.itemId } };
+ return { id: { equals: session.itemId } }
},
-};
+}
diff --git a/examples/usecase-roles/keystone.ts b/examples/usecase-roles/keystone.ts
index c331d7d70c3..33ad168ae4b 100644
--- a/examples/usecase-roles/keystone.ts
+++ b/examples/usecase-roles/keystone.ts
@@ -1,8 +1,8 @@
-import { config } from '@keystone-6/core';
-import { statelessSessions } from '@keystone-6/core/session';
-import { createAuth } from '@keystone-6/auth';
-import { fixPrismaPath } from '../example-utils';
-import { lists } from './schema';
+import { config } from '@keystone-6/core'
+import { statelessSessions } from '@keystone-6/core/session'
+import { createAuth } from '@keystone-6/auth'
+import { fixPrismaPath } from '../example-utils'
+import { lists } from './schema'
// WARNING: this example is for demonstration purposes only
// as with each of our examples, it has not been vetted
@@ -62,7 +62,7 @@ const { withAuth } = createAuth({
canManageRoles
canUseAdminUI
}`,
-});
+})
export default withAuth(
config({
@@ -76,10 +76,10 @@ export default withAuth(
lists,
ui: {
isAccessAllowed: ({ session }) => {
- return session?.data.role?.canUseAdminUI ?? false;
+ return session?.data.role?.canUseAdminUI ?? false
},
},
// you can find out more at https://keystonejs.com/docs/apis/session#session-api
session: statelessSessions(),
})
-);
+)
diff --git a/examples/usecase-roles/schema.ts b/examples/usecase-roles/schema.ts
index 91af7be5324..c620ccf9fd1 100644
--- a/examples/usecase-roles/schema.ts
+++ b/examples/usecase-roles/schema.ts
@@ -1,10 +1,10 @@
-import { list } from '@keystone-6/core';
-import { allOperations, denyAll } from '@keystone-6/core/access';
-import { checkbox, password, relationship, text } from '@keystone-6/core/fields';
+import { list } from '@keystone-6/core'
+import { allOperations, denyAll } from '@keystone-6/core/access'
+import { checkbox, password, relationship, text } from '@keystone-6/core/fields'
-import { isSignedIn, permissions, rules } from './access';
-import type { Session } from './access';
-import type { Lists } from '.keystone/types';
+import { isSignedIn, permissions, rules } from './access'
+import type { Session } from './access'
+import type { Lists } from '.keystone/types'
// WARNING: this example is for demonstration purposes only
// as with each of our examples, it has not been vetted
@@ -69,13 +69,13 @@ export const lists: Lists = {
},
},
hooks: {
- resolveInput({ operation, resolvedData, context }) {
+ resolveInput ({ operation, resolvedData, context }) {
if (operation === 'create' && !resolvedData.assignedTo && context.session) {
// Always default new todo items to the current user; this is important because users
// without canManageAllTodos don't see this field when creating new items
- return { connect: { id: context.session.itemId } };
+ return { connect: { id: context.session.itemId } }
}
- return resolvedData.assignedTo;
+ return resolvedData.assignedTo
},
},
}),
@@ -113,13 +113,13 @@ export const lists: Lists = {
itemView: {
defaultFieldMode: ({ session, item }) => {
// canEditOtherPeople can edit other people
- if (session?.data.role?.canEditOtherPeople) return 'edit';
+ if (session?.data.role?.canEditOtherPeople) return 'edit'
// edit themselves
- if (session?.itemId === item.id) return 'edit';
+ if (session?.itemId === item.id) return 'edit'
// else, default all fields to read mode
- return 'read';
+ return 'read'
},
},
},
@@ -248,4 +248,4 @@ export const lists: Lists = {
}),
},
}),
-};
+}
diff --git a/examples/usecase-todo/keystone.ts b/examples/usecase-todo/keystone.ts
index aebfcb74e9d..fe1bf98ab98 100644
--- a/examples/usecase-todo/keystone.ts
+++ b/examples/usecase-todo/keystone.ts
@@ -1,6 +1,6 @@
-import { config } from '@keystone-6/core';
-import { fixPrismaPath } from '../example-utils';
-import { lists } from './schema';
+import { config } from '@keystone-6/core'
+import { fixPrismaPath } from '../example-utils'
+import { lists } from './schema'
export default config({
db: {
@@ -11,4 +11,4 @@ export default config({
...fixPrismaPath,
},
lists,
-});
+})
diff --git a/examples/usecase-todo/schema.ts b/examples/usecase-todo/schema.ts
index c44f191ebaf..44cc58ecc2d 100644
--- a/examples/usecase-todo/schema.ts
+++ b/examples/usecase-todo/schema.ts
@@ -1,8 +1,8 @@
-import { list } from '@keystone-6/core';
-import { allowAll } from '@keystone-6/core/access';
-import { checkbox, relationship, text, timestamp } from '@keystone-6/core/fields';
-import { select } from '@keystone-6/core/fields';
-import type { Lists } from '.keystone/types';
+import { list } from '@keystone-6/core'
+import { allowAll } from '@keystone-6/core/access'
+import { checkbox, relationship, text, timestamp } from '@keystone-6/core/fields'
+import { select } from '@keystone-6/core/fields'
+import type { Lists } from '.keystone/types'
export const lists: Lists = {
Task: list({
@@ -29,4 +29,4 @@ export const lists: Lists = {
tasks: relationship({ ref: 'Task.assignedTo', many: true }),
},
}),
-};
+}
diff --git a/examples/usecase-todo/seed-data.ts b/examples/usecase-todo/seed-data.ts
index 213368ddb2a..669a63f1f23 100644
--- a/examples/usecase-todo/seed-data.ts
+++ b/examples/usecase-todo/seed-data.ts
@@ -1,60 +1,60 @@
-import { getContext } from '@keystone-6/core/context';
-import { persons, tasks } from '../example-data';
-import config from './keystone';
-import * as PrismaModule from '.myprisma/client';
+import { getContext } from '@keystone-6/core/context'
+import { persons, tasks } from '../example-data'
+import config from './keystone'
+import * as PrismaModule from '.myprisma/client'
type PersonProps = {
- name: string;
-};
+ name: string
+}
type TaskProps = {
- label: string;
- isComplete: boolean;
- finishBy: string;
- assignedTo: string;
-};
+ label: string
+ isComplete: boolean
+ finishBy: string
+ assignedTo: string
+}
-export async function main() {
- const context = getContext(config, PrismaModule);
+export async function main () {
+ const context = getContext(config, PrismaModule)
- console.log(`🌱 Inserting seed data`);
+ console.log(`🌱 Inserting seed data`)
const createPerson = async (personData: PersonProps) => {
let person = await context.query.Person.findOne({
where: { name: personData.name },
query: 'id',
- });
+ })
if (!person) {
person = await context.query.Person.createOne({
data: personData,
query: 'id',
- });
+ })
}
- };
+ }
const createTask = async (taskData: TaskProps) => {
const persons = await context.query.Person.findMany({
where: { name: { equals: taskData.assignedTo } },
query: 'id',
- });
+ })
await context.query.Task.createOne({
data: { ...taskData, assignedTo: { connect: { id: persons[0].id } } },
query: 'id',
- });
- };
+ })
+ }
for (const person of persons) {
- console.log(`👩 Adding person: ${person.name}`);
- await createPerson(person);
+ console.log(`👩 Adding person: ${person.name}`)
+ await createPerson(person)
}
for (const task of tasks) {
- console.log(`🔘 Adding task: ${task.label}`);
- await createTask(task);
+ console.log(`🔘 Adding task: ${task.label}`)
+ await createTask(task)
}
- console.log(`✅ Seed data inserted`);
- console.log(`👋 Please start the process with \`yarn dev\` or \`npm run dev\``);
+ console.log(`✅ Seed data inserted`)
+ console.log(`👋 Please start the process with \`yarn dev\` or \`npm run dev\``)
}
-main();
+main()
diff --git a/examples/usecase-versioning/keystone.ts b/examples/usecase-versioning/keystone.ts
index 291206afbcc..e94da84a666 100644
--- a/examples/usecase-versioning/keystone.ts
+++ b/examples/usecase-versioning/keystone.ts
@@ -1,7 +1,7 @@
-import { config } from '@keystone-6/core';
-import { fixPrismaPath } from '../example-utils';
-import { lists } from './schema';
-import { TypeInfo } from '.keystone/types';
+import { config } from '@keystone-6/core'
+import { fixPrismaPath } from '../example-utils'
+import { lists } from './schema'
+import { type TypeInfo } from '.keystone/types'
export default config({
db: {
@@ -12,4 +12,4 @@ export default config({
...fixPrismaPath,
},
lists,
-});
+})
diff --git a/examples/usecase-versioning/schema.ts b/examples/usecase-versioning/schema.ts
index 47760c96f7d..f1ad2c2a00a 100644
--- a/examples/usecase-versioning/schema.ts
+++ b/examples/usecase-versioning/schema.ts
@@ -1,7 +1,7 @@
-import { list } from '@keystone-6/core';
-import { allowAll } from '@keystone-6/core/access';
-import { integer, text } from '@keystone-6/core/fields';
-import { Lists } from '.keystone/types';
+import { list } from '@keystone-6/core'
+import { allowAll } from '@keystone-6/core/access'
+import { integer, text } from '@keystone-6/core/fields'
+import { type Lists } from '.keystone/types'
export const lists: Lists = {
Post: list({
@@ -27,13 +27,13 @@ export const lists: Lists = {
},
hooks: {
resolveInput: async ({ resolvedData, operation, item }) => {
- if (operation === 'create') return resolvedData.version;
- if (resolvedData.version !== item.version) throw new Error('Out of sync');
+ if (operation === 'create') return resolvedData.version
+ if (resolvedData.version !== item.version) throw new Error('Out of sync')
- return item.version + 1;
+ return item.version + 1
},
},
}),
},
}),
-};
+}
diff --git a/examples/usecase-versioning/seed-data.ts b/examples/usecase-versioning/seed-data.ts
index 4b6d807435d..4a1c9a8a2e4 100644
--- a/examples/usecase-versioning/seed-data.ts
+++ b/examples/usecase-versioning/seed-data.ts
@@ -1,25 +1,25 @@
-import { getContext } from '@keystone-6/core/context';
-import { posts } from '../example-data';
-import config from './keystone';
-import * as PrismaModule from '.myprisma/client';
+import { getContext } from '@keystone-6/core/context'
+import { posts } from '../example-data'
+import config from './keystone'
+import * as PrismaModule from '.myprisma/client'
-async function main() {
- const context = getContext(config, PrismaModule);
+async function main () {
+ const context = getContext(config, PrismaModule)
- console.log(`🌱 Inserting seed data`);
+ console.log(`🌱 Inserting seed data`)
for (const post of posts) {
- console.log(`📝 Adding post: ${post.title}`);
+ console.log(`📝 Adding post: ${post.title}`)
await context.db.Post.createOne({
data: {
...post,
version: 1,
},
- });
+ })
}
- console.log(`✅ Seed data inserted`);
- console.log(`👋 Please start the process with \`yarn dev\` or \`npm run dev\``);
+ console.log(`✅ Seed data inserted`)
+ console.log(`👋 Please start the process with \`yarn dev\` or \`npm run dev\``)
}
-main();
+main()
diff --git a/examples/virtual-field/keystone.ts b/examples/virtual-field/keystone.ts
index aebfcb74e9d..fe1bf98ab98 100644
--- a/examples/virtual-field/keystone.ts
+++ b/examples/virtual-field/keystone.ts
@@ -1,6 +1,6 @@
-import { config } from '@keystone-6/core';
-import { fixPrismaPath } from '../example-utils';
-import { lists } from './schema';
+import { config } from '@keystone-6/core'
+import { fixPrismaPath } from '../example-utils'
+import { lists } from './schema'
export default config({
db: {
@@ -11,4 +11,4 @@ export default config({
...fixPrismaPath,
},
lists,
-});
+})
diff --git a/examples/virtual-field/schema.ts b/examples/virtual-field/schema.ts
index 2574e006bf8..ae920baa967 100644
--- a/examples/virtual-field/schema.ts
+++ b/examples/virtual-field/schema.ts
@@ -1,7 +1,7 @@
-import { list, graphql } from '@keystone-6/core';
-import { text, checkbox, virtual } from '@keystone-6/core/fields';
-import { allowAll } from '@keystone-6/core/access';
-import type { Lists } from '.keystone/types';
+import { list, graphql } from '@keystone-6/core'
+import { text, checkbox, virtual } from '@keystone-6/core/fields'
+import { allowAll } from '@keystone-6/core/access'
+import type { Lists } from '.keystone/types'
export const lists: Lists = {
Post: list({
@@ -15,8 +15,8 @@ export const lists: Lists = {
isActive: virtual({
field: graphql.field({
type: graphql.Boolean,
- resolve(item) {
- return item.title.length > 3 && item.content.length > 10 && item.listed === true;
+ resolve (item) {
+ return item.title.length > 3 && item.content.length > 10 && item.listed === true
},
}),
}),
@@ -25,9 +25,9 @@ export const lists: Lists = {
counts: virtual({
field: graphql.field({
type: graphql.object<{
- words: number;
- sentences: number;
- paragraphs: number;
+ words: number
+ sentences: number
+ paragraphs: number
}>()({
name: 'PostCounts',
fields: {
@@ -36,13 +36,13 @@ export const lists: Lists = {
paragraphs: graphql.field({ type: graphql.Int }),
},
}),
- resolve(item) {
- const content = item.content ?? '';
+ resolve (item) {
+ const content = item.content ?? ''
return {
words: content.split(' ').length,
sentences: content.split('.').length,
paragraphs: content.split('\n\n').length,
- };
+ }
},
}),
ui: {
@@ -58,10 +58,10 @@ export const lists: Lists = {
args: {
length: graphql.arg({ type: graphql.nonNull(graphql.Int), defaultValue: 50 }),
},
- resolve(item, { length }) {
- const { content = '' } = item;
- if (content.length <= length) return content;
- return content.slice(0, length) + '...';
+ resolve (item, { length }) {
+ const { content = '' } = item
+ if (content.length <= length) return content
+ return content.slice(0, length) + '...'
},
}),
ui: { query: '(length: 10)' },
@@ -72,8 +72,8 @@ export const lists: Lists = {
field: graphql.field({
type: graphql.list(
graphql.object<{
- id: string;
- title: string;
+ id: string
+ title: string
}>()({
name: 'RelatedPosts',
fields: {
@@ -83,7 +83,7 @@ export const lists: Lists = {
})
),
- async resolve(item, _, context) {
+ async resolve (item, _, context) {
// TODO: this could probably be better
const posts = await context.db.Post.findMany({
where: {
@@ -94,16 +94,16 @@ export const lists: Lists = {
},
},
take: 10,
- });
+ })
return posts.map(post => ({
id: post.id,
title: post.title,
- }));
+ }))
},
}),
ui: { query: '{ id, title }' },
}),
},
}),
-};
+}
diff --git a/package.json b/package.json
index 567dd3a247b..b6a0d67afae 100644
--- a/package.json
+++ b/package.json
@@ -10,21 +10,13 @@
"packageManager": "pnpm@8.10.4",
"scripts": {
"coverage": "jest --coverage",
- "format:file": "prettier --write",
- "format": "prettier --write \"**/*.{js,json,ts,tsx,md,mdx}\"",
- "ci:version-packages": "pnpm changeset version && cd docs && pnpm remove-conditionals",
- "lint:eslint": "eslint . --ext ts,tsx,js",
- "lint:prettier": "prettier --check \"**/*.{js,json,ts,tsx,md,mdx}\"",
- "lint:types": "tsc",
- "lint": "pnpm lint:prettier && pnpm lint:eslint && pnpm lint:types && pnpm lint:filters",
"test": "jest",
+ "test:filters": "cd prisma-utils && pnpm verify",
+ "test:types": "tsc",
"test:debug": "node --inspect-brk ./node_modules/.bin/jest --runInBand",
"test:admin-ui": "jest tests/admin-ui-tests",
"build": "preconstruct build",
- "prepare": "preconstruct dev",
- "update-schemas": "pnpm --filter @keystone-6/example-* --filter @keystone-6/test-project* exec keystone build --no-ui",
- "generate-filters": "cd prisma-utils && pnpm generate",
- "lint:filters": "cd prisma-utils && pnpm verify"
+ "prepare": "preconstruct dev"
},
"devDependencies": {
"@babel/core": "^7.21.0",
@@ -43,34 +35,11 @@
"@types/node-fetch": "^2.5.12",
"@types/react": "^18.0.9",
"@types/react-dom": "^18.0.4",
- "@typescript-eslint/eslint-plugin": "^6.0.0",
- "@typescript-eslint/parser": "^6.0.0",
"esbuild": "^0.19.0",
"esbuild-jest": "^0.5.0",
- "eslint": "^8.0.0",
- "eslint-plugin-import": "2.25.3",
- "eslint-plugin-jest": "^26.0.0",
- "eslint-plugin-react": "^7.27.0",
- "eslint-plugin-react-hooks": "^4.3.0",
"jest": "^29.0.0",
"jest-environment-jsdom": "^29.0.0",
- "prettier": "^2.5.0",
- "typescript": "~5.2.0"
- },
- "prettier": {
- "proseWrap": "preserve",
- "singleQuote": true,
- "trailingComma": "es5",
- "printWidth": 100,
- "arrowParens": "avoid",
- "overrides": [
- {
- "files": "docs/**",
- "options": {
- "embeddedLanguageFormatting": "off"
- }
- }
- ]
+ "typescript": "~5.2.2"
},
"preconstruct": {
"packages": [
diff --git a/packages/auth/src/components/Icons.tsx b/packages/auth/src/components/Icons.tsx
index b3e164ac908..e9c48cd737e 100644
--- a/packages/auth/src/components/Icons.tsx
+++ b/packages/auth/src/components/Icons.tsx
@@ -1,7 +1,7 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { forwardRefWithAs, jsx } from '@keystone-ui/core';
+import { forwardRefWithAs, jsx } from '@keystone-ui/core'
const Icon = ({ children, ...props }: React.AnchorHTMLAttributes) => {
return (
@@ -32,8 +32,8 @@ const Icon = ({ children, ...props }: React.AnchorHTMLAttributes
{children}
- );
-};
+ )
+}
export const IconTwitter = (props: any) => (
@@ -46,7 +46,7 @@ export const IconTwitter = (props: any) => (
Hear about KeystoneJS on Twitter
-);
+)
export const IconGithub = (props: any) => (
@@ -58,7 +58,7 @@ export const IconGithub = (props: any) => (
KeystoneJS repository on GitHub
-);
+)
// ==============================
// Misc
@@ -79,4 +79,4 @@ const A11yText = forwardRefWithAs<'span', {}>(({ as: Tag = 'span', ...props }, r
}}
{...props}
/>
-));
+))
diff --git a/packages/auth/src/components/SigninContainer.tsx b/packages/auth/src/components/SigninContainer.tsx
index a4dd0b67d69..759004aaf97 100644
--- a/packages/auth/src/components/SigninContainer.tsx
+++ b/packages/auth/src/components/SigninContainer.tsx
@@ -1,18 +1,18 @@
/** @jsxRuntime classic */
/** @jsx jsx */
-import { ReactNode } from 'react';
+import { type ReactNode } from 'react'
-import { jsx, Box, Center, useTheme } from '@keystone-ui/core';
-import { Head } from '@keystone-6/core/admin-ui/router';
+import { jsx, Box, Center, useTheme } from '@keystone-ui/core'
+import { Head } from '@keystone-6/core/admin-ui/router'
type SigninContainerProps = {
- children: ReactNode;
- title?: string;
-};
+ children: ReactNode
+ title?: string
+}
export const SigninContainer = ({ children, title }: SigninContainerProps) => {
- const { colors, shadow } = useTheme();
+ const { colors, shadow } = useTheme()
return (
@@ -40,5 +40,5 @@ export const SigninContainer = ({ children, title }: SigninContainerProps) => {
- );
-};
+ )
+}
diff --git a/packages/auth/src/gql/getBaseAuthSchema.ts b/packages/auth/src/gql/getBaseAuthSchema.ts
index 33c53cee69c..62e10d9bce8 100644
--- a/packages/auth/src/gql/getBaseAuthSchema.ts
+++ b/packages/auth/src/gql/getBaseAuthSchema.ts
@@ -1,10 +1,10 @@
-import type { BaseItem } from '@keystone-6/core/types';
-import { graphql } from '@keystone-6/core';
-import { AuthGqlNames, SecretFieldImpl } from '../types';
+import type { BaseItem } from '@keystone-6/core/types'
+import { graphql } from '@keystone-6/core'
+import { type AuthGqlNames, type SecretFieldImpl } from '../types'
-import { validateSecret } from '../lib/validateSecret';
+import { validateSecret } from '../lib/validateSecret'
-export function getBaseAuthSchema({
+export function getBaseAuthSchema ({
listKey,
identityField,
secretField,
@@ -12,47 +12,47 @@ export function getBaseAuthSchema({
secretFieldImpl,
base,
}: {
- listKey: string;
- identityField: I;
- secretField: S;
- gqlNames: AuthGqlNames;
- secretFieldImpl: SecretFieldImpl;
- base: graphql.BaseSchemaMeta;
+ listKey: string
+ identityField: I
+ secretField: S
+ gqlNames: AuthGqlNames
+ secretFieldImpl: SecretFieldImpl
+ base: graphql.BaseSchemaMeta
// TODO: return type required by pnpm :(
}): {
- extension: graphql.Extension;
+ extension: graphql.Extension
ItemAuthenticationWithPasswordSuccess: graphql.ObjectType<{
- sessionToken: string;
- item: BaseItem;
- }>;
+ sessionToken: string
+ item: BaseItem
+ }>
} {
const ItemAuthenticationWithPasswordSuccess = graphql.object<{
- sessionToken: string;
- item: BaseItem;
+ sessionToken: string
+ item: BaseItem
}>()({
name: gqlNames.ItemAuthenticationWithPasswordSuccess,
fields: {
sessionToken: graphql.field({ type: graphql.nonNull(graphql.String) }),
item: graphql.field({ type: graphql.nonNull(base.object(listKey)) }),
},
- });
+ })
const ItemAuthenticationWithPasswordFailure = graphql.object<{ message: string }>()({
name: gqlNames.ItemAuthenticationWithPasswordFailure,
fields: {
message: graphql.field({ type: graphql.nonNull(graphql.String) }),
},
- });
+ })
const AuthenticationResult = graphql.union({
name: gqlNames.ItemAuthenticationWithPasswordResult,
types: [ItemAuthenticationWithPasswordSuccess, ItemAuthenticationWithPasswordFailure],
- resolveType(val) {
+ resolveType (val) {
if ('sessionToken' in val) {
- return gqlNames.ItemAuthenticationWithPasswordSuccess;
+ return gqlNames.ItemAuthenticationWithPasswordSuccess
}
- return gqlNames.ItemAuthenticationWithPasswordFailure;
+ return gqlNames.ItemAuthenticationWithPasswordFailure
},
- });
+ })
const extension = {
query: {
@@ -62,17 +62,17 @@ export function getBaseAuthSchema({
types: [base.object(listKey) as graphql.ObjectType],
resolveType: (root, context) => context.session?.listKey,
}),
- resolve(root, args, context) {
- const { session } = context;
- if (!session) return null;
- if (!session.itemId) return null;
- if (session.listKey !== listKey) return null;
+ resolve (root, args, context) {
+ const { session } = context
+ if (!session) return null
+ if (!session.itemId) return null
+ if (session.listKey !== listKey) return null
return context.db[listKey].findOne({
where: {
id: session.itemId,
},
- });
+ })
},
}),
},
@@ -83,12 +83,12 @@ export function getBaseAuthSchema({
[identityField]: graphql.arg({ type: graphql.nonNull(graphql.String) }),
[secretField]: graphql.arg({ type: graphql.nonNull(graphql.String) }),
},
- async resolve(root, { [identityField]: identity, [secretField]: secret }, context) {
+ async resolve (root, { [identityField]: identity, [secretField]: secret }, context) {
if (!context.sessionStrategy) {
- throw new Error('No session implementation available on context');
+ throw new Error('No session implementation available on context')
}
- const dbItemAPI = context.sudo().db[listKey];
+ const dbItemAPI = context.sudo().db[listKey]
const result = await validateSecret(
secretFieldImpl,
identityField,
@@ -96,10 +96,10 @@ export function getBaseAuthSchema({
secretField,
secret,
dbItemAPI
- );
+ )
if (!result.success) {
- return { code: 'FAILURE', message: 'Authentication failed.' };
+ return { code: 'FAILURE', message: 'Authentication failed.' }
}
// Update system state
@@ -109,17 +109,17 @@ export function getBaseAuthSchema({
itemId: result.item.id,
},
context,
- });
+ })
// return Failure if sessionStrategy.start() returns null
if (typeof sessionToken !== 'string' || sessionToken.length === 0) {
- return { code: 'FAILURE', message: 'Failed to start session.' };
+ return { code: 'FAILURE', message: 'Failed to start session.' }
}
- return { sessionToken, item: result.item };
+ return { sessionToken, item: result.item }
},
}),
},
- };
- return { extension, ItemAuthenticationWithPasswordSuccess };
+ }
+ return { extension, ItemAuthenticationWithPasswordSuccess }
}
diff --git a/packages/auth/src/gql/getInitFirstItemSchema.ts b/packages/auth/src/gql/getInitFirstItemSchema.ts
index 74f39c732e0..ad04f9343d8 100644
--- a/packages/auth/src/gql/getInitFirstItemSchema.ts
+++ b/packages/auth/src/gql/getInitFirstItemSchema.ts
@@ -1,10 +1,10 @@
-import { graphql } from '@keystone-6/core';
-import type { BaseItem } from '@keystone-6/core/types';
-import { assertInputObjectType, GraphQLInputObjectType, GraphQLSchema } from 'graphql';
+import { graphql } from '@keystone-6/core'
+import type { BaseItem } from '@keystone-6/core/types'
+import { assertInputObjectType, GraphQLInputObjectType, type GraphQLSchema } from 'graphql'
-import type { AuthGqlNames, InitFirstItemConfig } from '../types';
+import type { AuthGqlNames, InitFirstItemConfig } from '../types'
-export function getInitFirstItemSchema({
+export function getInitFirstItemSchema ({
listKey,
fields,
itemData,
@@ -12,21 +12,21 @@ export function getInitFirstItemSchema({
graphQLSchema,
ItemAuthenticationWithPasswordSuccess,
}: {
- listKey: string;
- fields: InitFirstItemConfig['fields'];
- itemData: InitFirstItemConfig['itemData'];
- gqlNames: AuthGqlNames;
- graphQLSchema: GraphQLSchema;
+ listKey: string
+ fields: InitFirstItemConfig['fields']
+ itemData: InitFirstItemConfig['itemData']
+ gqlNames: AuthGqlNames
+ graphQLSchema: GraphQLSchema
ItemAuthenticationWithPasswordSuccess: graphql.ObjectType<{
- item: BaseItem;
- sessionToken: string;
- }>;
+ item: BaseItem
+ sessionToken: string
+ }>
// TODO: return type required by pnpm :(
}): graphql.Extension {
const createInputConfig = assertInputObjectType(
graphQLSchema.getType(`${listKey}CreateInput`)
- ).toConfig();
- const fieldsSet = new Set(fields);
+ ).toConfig()
+ const fieldsSet = new Set(fields)
const initialCreateInput = graphql.wrap.inputObject(
new GraphQLInputObjectType({
...createInputConfig,
@@ -35,38 +35,38 @@ export function getInitFirstItemSchema({
),
name: gqlNames.CreateInitialInput,
})
- );
+ )
return {
mutation: {
[gqlNames.createInitialItem]: graphql.field({
type: graphql.nonNull(ItemAuthenticationWithPasswordSuccess),
args: { data: graphql.arg({ type: graphql.nonNull(initialCreateInput) }) },
- async resolve(rootVal, { data }, context) {
+ async resolve (rootVal, { data }, context) {
if (!context.sessionStrategy) {
- throw new Error('No session implementation available on context');
+ throw new Error('No session implementation available on context')
}
- const dbItemAPI = context.sudo().db[listKey];
+ const dbItemAPI = context.sudo().db[listKey]
// should approximate hasInitFirstItemConditions
- const count = await dbItemAPI.count({});
+ const count = await dbItemAPI.count({})
if (count !== 0) {
- throw new Error('Initial items can only be created when no items exist in that list');
+ throw new Error('Initial items can only be created when no items exist in that list')
}
// Update system state
// this is strictly speaking incorrect. the db API will do GraphQL coercion on a value which has already been coerced
// (this is also mostly fine, the chance that people are using things where
// the input value can't round-trip like the Upload scalar here is quite low)
- const item = await dbItemAPI.createOne({ data: { ...data, ...itemData } });
+ const item = await dbItemAPI.createOne({ data: { ...data, ...itemData } })
const sessionToken = (await context.sessionStrategy.start({
data: { listKey, itemId: item.id.toString() },
context,
- })) as string;
- return { item, sessionToken };
+ })) as string
+ return { item, sessionToken }
},
}),
},
- };
+ }
}
diff --git a/packages/auth/src/gql/getMagicAuthLinkSchema.ts b/packages/auth/src/gql/getMagicAuthLinkSchema.ts
index 97416572a72..da28ddd98d4 100644
--- a/packages/auth/src/gql/getMagicAuthLinkSchema.ts
+++ b/packages/auth/src/gql/getMagicAuthLinkSchema.ts
@@ -1,19 +1,19 @@
-import type { BaseItem } from '@keystone-6/core/types';
-import { graphql } from '@keystone-6/core';
-import type { AuthGqlNames, AuthTokenTypeConfig, SecretFieldImpl } from '../types';
+import type { BaseItem } from '@keystone-6/core/types'
+import { graphql } from '@keystone-6/core'
+import type { AuthGqlNames, AuthTokenTypeConfig, SecretFieldImpl } from '../types'
-import { createAuthToken } from '../lib/createAuthToken';
-import { validateAuthToken } from '../lib/validateAuthToken';
-import { getAuthTokenErrorMessage } from '../lib/getErrorMessage';
+import { createAuthToken } from '../lib/createAuthToken'
+import { validateAuthToken } from '../lib/validateAuthToken'
+import { getAuthTokenErrorMessage } from '../lib/getErrorMessage'
-const errorCodes = ['FAILURE', 'TOKEN_EXPIRED', 'TOKEN_REDEEMED'] as const;
+const errorCodes = ['FAILURE', 'TOKEN_EXPIRED', 'TOKEN_REDEEMED'] as const
const MagicLinkRedemptionErrorCode = graphql.enum({
name: 'MagicLinkRedemptionErrorCode',
values: graphql.enumValues(errorCodes),
-});
+})
-export function getMagicAuthLinkSchema({
+export function getMagicAuthLinkSchema ({
listKey,
identityField,
gqlNames,
@@ -21,55 +21,55 @@ export function getMagicAuthLinkSchema({
magicAuthTokenSecretFieldImpl,
base,
}: {
- listKey: string;
- identityField: I;
- gqlNames: AuthGqlNames;
- magicAuthLink: AuthTokenTypeConfig;
- magicAuthTokenSecretFieldImpl: SecretFieldImpl;
- base: graphql.BaseSchemaMeta;
+ listKey: string
+ identityField: I
+ gqlNames: AuthGqlNames
+ magicAuthLink: AuthTokenTypeConfig
+ magicAuthTokenSecretFieldImpl: SecretFieldImpl
+ base: graphql.BaseSchemaMeta
// TODO: type required by pnpm :(
}): graphql.Extension {
const RedeemItemMagicAuthTokenFailure = graphql.object<{
- code: (typeof errorCodes)[number];
- message: string;
+ code:(typeof errorCodes)[number]
+ message: string
}>()({
name: gqlNames.RedeemItemMagicAuthTokenFailure,
fields: {
code: graphql.field({ type: graphql.nonNull(MagicLinkRedemptionErrorCode) }),
message: graphql.field({ type: graphql.nonNull(graphql.String) }),
},
- });
- const RedeemItemMagicAuthTokenSuccess = graphql.object<{ token: string; item: BaseItem }>()({
+ })
+ const RedeemItemMagicAuthTokenSuccess = graphql.object<{ token: string, item: BaseItem }>()({
name: gqlNames.RedeemItemMagicAuthTokenSuccess,
fields: {
token: graphql.field({ type: graphql.nonNull(graphql.String) }),
item: graphql.field({ type: graphql.nonNull(base.object(listKey)) }),
},
- });
+ })
const RedeemItemMagicAuthTokenResult = graphql.union({
name: gqlNames.RedeemItemMagicAuthTokenResult,
types: [RedeemItemMagicAuthTokenSuccess, RedeemItemMagicAuthTokenFailure],
- resolveType(val) {
+ resolveType (val) {
return 'token' in val
? gqlNames.RedeemItemMagicAuthTokenSuccess
- : gqlNames.RedeemItemMagicAuthTokenFailure;
+ : gqlNames.RedeemItemMagicAuthTokenFailure
},
- });
+ })
return {
mutation: {
[gqlNames.sendItemMagicAuthLink]: graphql.field({
type: graphql.nonNull(graphql.Boolean),
args: { [identityField]: graphql.arg({ type: graphql.nonNull(graphql.String) }) },
- async resolve(rootVal, { [identityField]: identity }, context) {
- const dbItemAPI = context.sudo().db[listKey];
- const tokenType = 'magicAuth';
+ async resolve (rootVal, { [identityField]: identity }, context) {
+ const dbItemAPI = context.sudo().db[listKey]
+ const tokenType = 'magicAuth'
- const result = await createAuthToken(identityField, identity, dbItemAPI);
+ const result = await createAuthToken(identityField, identity, dbItemAPI)
// Update system state
if (result.success) {
// Save the token and related info back to the item
- const { token, itemId } = result;
+ const { token, itemId } = result
await dbItemAPI.updateOne({
where: { id: `${itemId}` },
data: {
@@ -77,11 +77,11 @@ export function getMagicAuthLinkSchema({
[`${tokenType}IssuedAt`]: new Date().toISOString(),
[`${tokenType}RedeemedAt`]: null,
},
- });
+ })
- await magicAuthLink.sendToken({ itemId, identity, token, context });
+ await magicAuthLink.sendToken({ itemId, identity, token, context })
}
- return true;
+ return true
},
}),
[gqlNames.redeemItemMagicAuthToken]: graphql.field({
@@ -90,13 +90,13 @@ export function getMagicAuthLinkSchema({
[identityField]: graphql.arg({ type: graphql.nonNull(graphql.String) }),
token: graphql.arg({ type: graphql.nonNull(graphql.String) }),
},
- async resolve(rootVal, { [identityField]: identity, token }, context) {
+ async resolve (rootVal, { [identityField]: identity, token }, context) {
if (!context.sessionStrategy) {
- throw new Error('No session implementation available on context');
+ throw new Error('No session implementation available on context')
}
- const dbItemAPI = context.sudo().db[listKey];
- const tokenType = 'magicAuth';
+ const dbItemAPI = context.sudo().db[listKey]
+ const tokenType = 'magicAuth'
const result = await validateAuthToken(
listKey,
magicAuthTokenSecretFieldImpl,
@@ -106,17 +106,17 @@ export function getMagicAuthLinkSchema({
magicAuthLink.tokensValidForMins,
token,
dbItemAPI
- );
+ )
if (!result.success) {
- return { code: result.code, message: getAuthTokenErrorMessage({ code: result.code }) };
+ return { code: result.code, message: getAuthTokenErrorMessage({ code: result.code }) }
}
// Update system state
// Save the token and related info back to the item
await dbItemAPI.updateOne({
where: { id: result.item.id },
data: { [`${tokenType}RedeemedAt`]: new Date().toISOString() },
- });
+ })
const sessionToken = (await context.sessionStrategy.start({
data: {
@@ -124,10 +124,10 @@ export function getMagicAuthLinkSchema({
itemId: result.item.id.toString(),
},
context,
- })) as string;
- return { token: sessionToken, item: result.item };
+ })) as string
+ return { token: sessionToken, item: result.item }
},
}),
},
- };
+ }
}
diff --git a/packages/auth/src/gql/getPasswordResetSchema.ts b/packages/auth/src/gql/getPasswordResetSchema.ts
index 423e668e330..134f6192bf3 100644
--- a/packages/auth/src/gql/getPasswordResetSchema.ts
+++ b/packages/auth/src/gql/getPasswordResetSchema.ts
@@ -1,18 +1,18 @@
-import { graphql } from '@keystone-6/core';
-import type { AuthGqlNames, AuthTokenTypeConfig, SecretFieldImpl } from '../types';
+import { graphql } from '@keystone-6/core'
+import type { AuthGqlNames, AuthTokenTypeConfig, SecretFieldImpl } from '../types'
-import { createAuthToken } from '../lib/createAuthToken';
-import { validateAuthToken } from '../lib/validateAuthToken';
-import { getAuthTokenErrorMessage } from '../lib/getErrorMessage';
+import { createAuthToken } from '../lib/createAuthToken'
+import { validateAuthToken } from '../lib/validateAuthToken'
+import { getAuthTokenErrorMessage } from '../lib/getErrorMessage'
-const errorCodes = ['FAILURE', 'TOKEN_EXPIRED', 'TOKEN_REDEEMED'] as const;
+const errorCodes = ['FAILURE', 'TOKEN_EXPIRED', 'TOKEN_REDEEMED'] as const
const PasswordResetRedemptionErrorCode = graphql.enum({
name: 'PasswordResetRedemptionErrorCode',
values: graphql.enumValues(errorCodes),
-});
+})
-export function getPasswordResetSchema({
+export function getPasswordResetSchema ({
listKey,
identityField,
secretField,
@@ -20,41 +20,41 @@ export function getPasswordResetSchema({
passwordResetLink,
passwordResetTokenSecretFieldImpl,
}: {
- listKey: string;
- identityField: I;
- secretField: S;
- gqlNames: AuthGqlNames;
- passwordResetLink: AuthTokenTypeConfig;
- passwordResetTokenSecretFieldImpl: SecretFieldImpl;
+ listKey: string
+ identityField: I
+ secretField: S
+ gqlNames: AuthGqlNames
+ passwordResetLink: AuthTokenTypeConfig
+ passwordResetTokenSecretFieldImpl: SecretFieldImpl
// TODO: return type required by pnpm :(
}): graphql.Extension {
const getResult = (name: string) =>
- graphql.object<{ code: (typeof errorCodes)[number]; message: string }>()({
+ graphql.object<{ code:(typeof errorCodes)[number], message: string }>()({
name,
fields: {
code: graphql.field({ type: graphql.nonNull(PasswordResetRedemptionErrorCode) }),
message: graphql.field({ type: graphql.nonNull(graphql.String) }),
},
- });
+ })
const ValidateItemPasswordResetTokenResult = getResult(
gqlNames.ValidateItemPasswordResetTokenResult
- );
- const RedeemItemPasswordResetTokenResult = getResult(gqlNames.RedeemItemPasswordResetTokenResult);
+ )
+ const RedeemItemPasswordResetTokenResult = getResult(gqlNames.RedeemItemPasswordResetTokenResult)
return {
mutation: {
[gqlNames.sendItemPasswordResetLink]: graphql.field({
type: graphql.nonNull(graphql.Boolean),
args: { [identityField]: graphql.arg({ type: graphql.nonNull(graphql.String) }) },
- async resolve(rootVal, { [identityField]: identity }, context) {
- const dbItemAPI = context.sudo().db[listKey];
- const tokenType = 'passwordReset';
+ async resolve (rootVal, { [identityField]: identity }, context) {
+ const dbItemAPI = context.sudo().db[listKey]
+ const tokenType = 'passwordReset'
- const result = await createAuthToken(identityField, identity, dbItemAPI);
+ const result = await createAuthToken(identityField, identity, dbItemAPI)
// Update system state
if (result.success) {
// Save the token and related info back to the item
- const { token, itemId } = result;
+ const { token, itemId } = result
await dbItemAPI.updateOne({
where: { id: `${itemId}` },
data: {
@@ -62,11 +62,11 @@ export function getPasswordResetSchema({
[`${tokenType}IssuedAt`]: new Date().toISOString(),
[`${tokenType}RedeemedAt`]: null,
},
- });
+ })
- await passwordResetLink.sendToken({ itemId, identity, token, context });
+ await passwordResetLink.sendToken({ itemId, identity, token, context })
}
- return true;
+ return true
},
}),
[gqlNames.redeemItemPasswordResetToken]: graphql.field({
@@ -76,13 +76,13 @@ export function getPasswordResetSchema({
token: graphql.arg({ type: graphql.nonNull(graphql.String) }),
[secretField]: graphql.arg({ type: graphql.nonNull(graphql.String) }),
},
- async resolve(
+ async resolve (
rootVal,
{ [identityField]: identity, token, [secretField]: secret },
context
) {
- const dbItemAPI = context.sudo().db[listKey];
- const tokenType = 'passwordReset';
+ const dbItemAPI = context.sudo().db[listKey]
+ const tokenType = 'passwordReset'
const result = await validateAuthToken(
listKey,
passwordResetTokenSecretFieldImpl,
@@ -92,19 +92,19 @@ export function getPasswordResetSchema({
passwordResetLink.tokensValidForMins,
token,
dbItemAPI
- );
+ )
if (!result.success) {
- return { code: result.code, message: getAuthTokenErrorMessage({ code: result.code }) };
+ return { code: result.code, message: getAuthTokenErrorMessage({ code: result.code }) }
}
// Update system state
- const itemId = result.item.id;
+ const itemId = result.item.id
// Save the token and related info back to the item
await dbItemAPI.updateOne({
where: { id: itemId },
data: { [`${tokenType}RedeemedAt`]: new Date().toISOString() },
- });
+ })
// Save the provided secret. Do this as a separate step as password validation
// may fail, in which case we still want to mark the token as redeemed
@@ -112,9 +112,9 @@ export function getPasswordResetSchema({
await dbItemAPI.updateOne({
where: { id: itemId },
data: { [secretField]: secret },
- });
+ })
- return null;
+ return null
},
}),
},
@@ -125,9 +125,9 @@ export function getPasswordResetSchema({
[identityField]: graphql.arg({ type: graphql.nonNull(graphql.String) }),
token: graphql.arg({ type: graphql.nonNull(graphql.String) }),
},
- async resolve(rootVal, { [identityField]: identity, token }, context) {
- const dbItemAPI = context.sudo().db[listKey];
- const tokenType = 'passwordReset';
+ async resolve (rootVal, { [identityField]: identity, token }, context) {
+ const dbItemAPI = context.sudo().db[listKey]
+ const tokenType = 'passwordReset'
const result = await validateAuthToken(
listKey,
passwordResetTokenSecretFieldImpl,
@@ -137,14 +137,14 @@ export function getPasswordResetSchema({
passwordResetLink.tokensValidForMins,
token,
dbItemAPI
- );
+ )
if (!result.success) {
- return { code: result.code, message: getAuthTokenErrorMessage({ code: result.code }) };
+ return { code: result.code, message: getAuthTokenErrorMessage({ code: result.code }) }
}
- return null;
+ return null
},
}),
},
- };
+ }
}
diff --git a/packages/auth/src/index.ts b/packages/auth/src/index.ts
index 31d66c8d8b0..08b8ff8d3d9 100644
--- a/packages/auth/src/index.ts
+++ b/packages/auth/src/index.ts
@@ -5,19 +5,19 @@ import type {
KeystoneContext,
SessionStrategy,
BaseKeystoneTypeInfo,
-} from '@keystone-6/core/types';
-import { password, timestamp } from '@keystone-6/core/fields';
+} from '@keystone-6/core/types'
+import { password, timestamp } from '@keystone-6/core/fields'
-import type { AuthConfig, AuthGqlNames } from './types';
-import { getSchemaExtension } from './schema';
-import { signinTemplate } from './templates/signin';
-import { initTemplate } from './templates/init';
+import type { AuthConfig, AuthGqlNames } from './types'
+import { getSchemaExtension } from './schema'
+import { signinTemplate } from './templates/signin'
+import { initTemplate } from './templates/init'
export type AuthSession = {
- listKey: string; // TODO: use ListTypeInfo
- itemId: string | number; // TODO: use ListTypeInfo
- data: unknown; // TODO: use ListTypeInfo
-};
+ listKey: string // TODO: use ListTypeInfo
+ itemId: string | number // TODO: use ListTypeInfo
+ data: unknown // TODO: use ListTypeInfo
+}
// TODO: use TypeInfo and listKey for types
/**
@@ -25,7 +25,7 @@ export type AuthSession = {
*
* Generates config for Keystone to implement standard auth features.
*/
-export function createAuth({
+export function createAuth ({
listKey,
secretField,
initFirstItem,
@@ -57,7 +57,7 @@ export function createAuth({
RedeemItemMagicAuthTokenResult: `Redeem${listKey}MagicAuthTokenResult`,
RedeemItemMagicAuthTokenSuccess: `Redeem${listKey}MagicAuthTokenSuccess`,
RedeemItemMagicAuthTokenFailure: `Redeem${listKey}MagicAuthTokenFailure`,
- };
+ }
/**
* fields
@@ -71,7 +71,7 @@ export function createAuth({
itemView: { fieldMode: 'hidden' },
listView: { fieldMode: 'hidden' },
},
- } as const;
+ } as const
const authFields = {
...(passwordResetLink
@@ -89,7 +89,7 @@ export function createAuth({
magicAuthRedeemedAt: timestamp({ ...fieldConfig }),
}
: null),
- };
+ }
/**
* getAdditionalFiles
@@ -106,16 +106,16 @@ export function createAuth({
src: signinTemplate({ gqlNames, identityField, secretField }),
outputPath: 'pages/signin.js',
},
- ];
+ ]
if (initFirstItem) {
filesToWrite.push({
mode: 'write',
src: initTemplate({ listKey, initFirstItem }),
outputPath: 'pages/init.js',
- });
+ })
}
- return filesToWrite;
- };
+ return filesToWrite
+ }
/**
* extendGraphqlSchema
@@ -131,114 +131,114 @@ export function createAuth({
passwordResetLink,
magicAuthLink,
sessionData,
- });
+ })
- function throwIfInvalidConfig(
+ function throwIfInvalidConfig (
config: KeystoneConfig
) {
if (!(listKey in config.lists)) {
- throw new Error(`withAuth cannot find the list "${listKey}"`);
+ throw new Error(`withAuth cannot find the list "${listKey}"`)
}
// TODO: verify that the identity field is unique
// TODO: verify that the field is required
- const list = config.lists[listKey];
+ const list = config.lists[listKey]
if (!(identityField in list.fields)) {
- throw new Error(`withAuth cannot find the identity field "${listKey}.${identityField}"`);
+ throw new Error(`withAuth cannot find the identity field "${listKey}.${identityField}"`)
}
if (!(secretField in list.fields)) {
- throw new Error(`withAuth cannot find the secret field "${listKey}.${secretField}"`);
+ throw new Error(`withAuth cannot find the secret field "${listKey}.${secretField}"`)
}
for (const fieldKey of initFirstItem?.fields || []) {
- if (fieldKey in list.fields) continue;
+ if (fieldKey in list.fields) continue
- throw new Error(`initFirstItem.fields has unknown field "${listKey}.${fieldKey}"`);
+ throw new Error(`initFirstItem.fields has unknown field "${listKey}.${fieldKey}"`)
}
}
// this strategy wraps the existing session strategy,
// and injects the requested session.data before returning
- function authSessionStrategy(
+ function authSessionStrategy (
_sessionStrategy: SessionStrategy
): SessionStrategy {
- const { get, ...sessionStrategy } = _sessionStrategy;
+ const { get, ...sessionStrategy } = _sessionStrategy
return {
...sessionStrategy,
get: async ({ context }) => {
- const session = await get({ context });
- const sudoContext = context.sudo();
- if (!session) return;
- if (!session.itemId) return;
- if (session.listKey !== listKey) return;
+ const session = await get({ context })
+ const sudoContext = context.sudo()
+ if (!session) return
+ if (!session.itemId) return
+ if (session.listKey !== listKey) return
try {
const data = await sudoContext.query[listKey].findOne({
where: { id: session.itemId },
query: sessionData,
- });
- if (!data) return;
+ })
+ if (!data) return
- return { ...session, itemId: session.itemId, listKey, data };
+ return { ...session, itemId: session.itemId, listKey, data }
} catch (e) {
- console.error(e);
+ console.error(e)
// TODO: the assumption is this could only be from an invalid sessionData configuration
// it could be something else though, either way, result is a bad session
- return;
+ return
}
},
- };
+ }
}
- async function hasInitFirstItemConditions(
+ async function hasInitFirstItemConditions (
context: KeystoneContext
) {
// do nothing if they aren't using this feature
- if (!initFirstItem) return false;
+ if (!initFirstItem) return false
// if they have a session, there is no initialisation necessary
- if (context.session) return false;
+ if (context.session) return false
- const count = await context.sudo().db[listKey].count({});
- return count === 0;
+ const count = await context.sudo().db[listKey].count({})
+ return count === 0
}
- async function authMiddleware({
+ async function authMiddleware ({
context,
wasAccessAllowed,
basePath,
}: {
- context: KeystoneContext;
- wasAccessAllowed: boolean;
- basePath: string;
- }): Promise<{ kind: 'redirect'; to: string } | void> {
- const { req } = context;
- const { pathname } = new URL(req!.url!, 'http://_');
+ context: KeystoneContext