diff --git a/apps/design-system/config/docs.ts b/apps/design-system/config/docs.ts index a43abe06a40..a74316e46d3 100644 --- a/apps/design-system/config/docs.ts +++ b/apps/design-system/config/docs.ts @@ -132,11 +132,6 @@ export const docsConfig: DocsConfig = { href: '/docs/fragments/empty-state-presentational', items: [], }, - { - title: 'Modal', - href: '/docs/fragments/modal', - items: [], - }, { title: 'Page Container', href: '/docs/fragments/page-container', diff --git a/apps/design-system/registry/default/example/modal-aligned-footer.tsx b/apps/design-system/registry/default/example/modal-aligned-footer.tsx deleted file mode 100644 index cd8c6b239ca..00000000000 --- a/apps/design-system/registry/default/example/modal-aligned-footer.tsx +++ /dev/null @@ -1,43 +0,0 @@ -import { Link2 } from 'lucide-react' -import { useState } from 'react' -import { Button, Modal } from 'ui' - -export default function ModalVerticalAlignedFooter() { - const [visible, setVisible] = useState(false) - - return ( - <> - - setVisible(!visible)} - onConfirm={() => setVisible(!visible)} - title="This is the title of the modal" - description="And i am the description" - alignFooter="right" - size="medium" - hideClose={false} - header={ -
-
- -
-
-

This is the title

- This is the title -
-
- } - > - -

- Modal content is inserted here, if you need to insert anything into the Modal you can do - so via `children`. -

-
-
- - ) -} diff --git a/apps/design-system/registry/default/example/modal-custom-footer.tsx b/apps/design-system/registry/default/example/modal-custom-footer.tsx deleted file mode 100644 index e9012c3d1b2..00000000000 --- a/apps/design-system/registry/default/example/modal-custom-footer.tsx +++ /dev/null @@ -1,51 +0,0 @@ -import { Link2 } from 'lucide-react' -import { useState } from 'react' -import { Badge, Button, Modal } from 'ui' - -export default function ModalVerticalCustomFooter() { - const [visible, setVisible] = useState(false) - - return ( - <> - - setVisible(!visible)} - onConfirm={() => setVisible(!visible)} - title="This is the title of the modal" - description="And i am the description" - size="medium" - hideClose={false} - header={ -
-
- -
-
-

This is the title

- This is the title -
-
- } - customFooter={ -
-
- Proceed with caution -
- - -
- } - > - -

- Modal content is inserted here, if you need to insert anything into the Modal you can do - so via `children`. -

-
-
- - ) -} diff --git a/apps/design-system/registry/default/example/modal-hide-footer.tsx b/apps/design-system/registry/default/example/modal-hide-footer.tsx deleted file mode 100644 index ff14e8bf566..00000000000 --- a/apps/design-system/registry/default/example/modal-hide-footer.tsx +++ /dev/null @@ -1,43 +0,0 @@ -import { Link2 } from 'lucide-react' -import { useState } from 'react' -import { Button, Modal } from 'ui' - -export default function ModalVerticalHideFooter() { - const [visible, setVisible] = useState(false) - - return ( - <> - - setVisible(!visible)} - onConfirm={() => setVisible(!visible)} - title="This is the title of the modal" - description="And i am the description" - hideFooter={true} - size="medium" - hideClose={false} - header={ -
-
- -
-
-

This is the title

- This is the title -
-
- } - > - -

- Modal content is inserted here, if you need to insert anything into the Modal you can do - so via `children`. -

-
-
- - ) -} diff --git a/apps/design-system/registry/default/example/modal-vertical-layout.tsx b/apps/design-system/registry/default/example/modal-vertical-layout.tsx deleted file mode 100644 index e1578fb2660..00000000000 --- a/apps/design-system/registry/default/example/modal-vertical-layout.tsx +++ /dev/null @@ -1,43 +0,0 @@ -import { Link2 } from 'lucide-react' -import { useState } from 'react' -import { Button, Modal } from 'ui' - -export default function ModalVerticalLayout() { - const [visible, setVisible] = useState(false) - - return ( - <> - - setVisible(!visible)} - onConfirm={() => setVisible(!visible)} - title="This is the title of the modal" - description="And i am the description" - layout="vertical" - size="medium" - hideClose={false} - header={ -
-
- -
-
-

This is the title

- This is the title -
-
- } - > - -

- Modal content is inserted here, if you need to insert anything into the Modal you can do - so via `children`. -

-
-
- - ) -} diff --git a/apps/docs/components/Feedback/Feedback.tsx b/apps/docs/components/Feedback/Feedback.tsx index 74ed2947dbf..d62a9f0f475 100644 --- a/apps/docs/components/Feedback/Feedback.tsx +++ b/apps/docs/components/Feedback/Feedback.tsx @@ -1,25 +1,24 @@ 'use client' import { createClient } from '@supabase/supabase-js' +import { IS_PLATFORM } from '~/lib/constants' +import { useSendFeedbackMutation } from '~/lib/fetch/feedback' +import { useSendTelemetryEvent } from '~/lib/telemetry' +import { useConstant, useIsLoggedIn, type Database } from 'common' import { Check, MessageSquareQuote, X } from 'lucide-react' import { usePathname } from 'next/navigation' import { - type CSSProperties, - type MouseEventHandler, forwardRef, useReducer, useRef, useState, + type CSSProperties, + type MouseEventHandler, } from 'react' - -import { type Database, useConstant, useIsLoggedIn } from 'common' import { Button, cn } from 'ui' -import { IS_PLATFORM } from '~/lib/constants' -import { useSendFeedbackMutation } from '~/lib/fetch/feedback' -import { useSendTelemetryEvent } from '~/lib/telemetry' import { getLinearTeam, getSanitizedTabParams } from './Feedback.utils' -import { type FeedbackFields, FeedbackModal } from './FeedbackModal' +import { FeedbackModal, type FeedbackFields } from './FeedbackModal' const FeedbackButton = forwardRef< HTMLButtonElement, diff --git a/apps/docs/components/Feedback/FeedbackModal.tsx b/apps/docs/components/Feedback/FeedbackModal.tsx index 8667fff80ff..8022817fb61 100644 --- a/apps/docs/components/Feedback/FeedbackModal.tsx +++ b/apps/docs/components/Feedback/FeedbackModal.tsx @@ -1,6 +1,20 @@ import { zodResolver } from '@hookform/resolvers/zod' import { SubmitHandler, useForm } from 'react-hook-form' -import { Button, Form, FormControl, FormField, Input, Modal, Textarea } from 'ui' +import { + Button, + Dialog, + DialogContent, + DialogFooter, + DialogHeader, + DialogSection, + DialogSectionSeparator, + DialogTitle, + Form, + FormControl, + FormField, + Input, + Textarea, +} from 'ui' import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout' import * as z from 'zod' @@ -24,6 +38,7 @@ function FeedbackModal({ visible, page, onCancel, onSubmit }: FeedbackModalProps defaultValues: { page, title: '', comment: '' }, resolver: zodResolver(formSchema), }) + const formId = 'feedback-form' const { reset } = form const { isSubmitting } = form.formState @@ -38,75 +53,69 @@ function FeedbackModal({ visible, page, onCancel, onSubmit }: FeedbackModalProps } return ( - -
- - - - ( - - - - - - )} - /> - ( - - -