From 313518d1881736938c56fb6c7ecc59f14f1506c2 Mon Sep 17 00:00:00 2001 From: Vitaly Rtishchev Date: Sun, 30 Jan 2022 22:34:44 +0300 Subject: [PATCH] [docs] Migrate inline demos to @mantine/demos --- .../HomePage/Explore/Animations/AnimationsDemo.tsx | 5 ++--- .../HomePage/Explore/CoreComponents/core/ContentDemos.tsx | 3 +-- .../HomePage/Explore/CoreComponents/core/InputsDemo.tsx | 3 +-- .../HomePage/Explore/CoreComponents/core/OverlaysDemos.tsx | 5 ++--- src/mantine-demos/src/index.ts | 7 +++++++ 5 files changed, 13 insertions(+), 10 deletions(-) diff --git a/docs/src/components/HomePage/Explore/Animations/AnimationsDemo.tsx b/docs/src/components/HomePage/Explore/Animations/AnimationsDemo.tsx index 338ea126bc1..5a259cba706 100644 --- a/docs/src/components/HomePage/Explore/Animations/AnimationsDemo.tsx +++ b/docs/src/components/HomePage/Explore/Animations/AnimationsDemo.tsx @@ -1,8 +1,7 @@ import React, { useState } from 'react'; import { Prism } from '@mantine/prism'; import { Title, Modal, Button, Paper, createStyles } from '@mantine/core'; -import { AuthenticationForm } from '@mantine/core/demos/AuthenticationForm/AuthenticationForm'; -import { transitions as TransitionDemo } from '@mantine/core/src/components/Tooltip/demos/transitions'; +import { AuthenticationForm, TooltipDemos } from '@mantine/demos'; const scaleY = { in: { opacity: 1, transform: 'scaleY(1)' }, @@ -41,7 +40,7 @@ const useStyles = createStyles((theme) => ({ })); export function AnimationsDemo() { - const Transitions = TransitionDemo.component; + const Transitions = TooltipDemos.transitions.component; const [modalOpened, setModalOpened] = useState(false); const { classes } = useStyles(); return ( diff --git a/docs/src/components/HomePage/Explore/CoreComponents/core/ContentDemos.tsx b/docs/src/components/HomePage/Explore/CoreComponents/core/ContentDemos.tsx index 611bf31a8bf..45d57b3228e 100644 --- a/docs/src/components/HomePage/Explore/CoreComponents/core/ContentDemos.tsx +++ b/docs/src/components/HomePage/Explore/CoreComponents/core/ContentDemos.tsx @@ -1,7 +1,6 @@ import React from 'react'; import { Text, Paper } from '@mantine/core'; -import { AccordionDemo } from '@mantine/core/src/components/Accordion/demos/label'; -import { TimelineBase } from '@mantine/core/src/components/Timeline/demos/_base'; +import { AccordionDemo, TimelineBase } from '@mantine/demos'; export function ContentDemos() { return ( diff --git a/docs/src/components/HomePage/Explore/CoreComponents/core/InputsDemo.tsx b/docs/src/components/HomePage/Explore/CoreComponents/core/InputsDemo.tsx index e182971a7bd..c000cc05c36 100644 --- a/docs/src/components/HomePage/Explore/CoreComponents/core/InputsDemo.tsx +++ b/docs/src/components/HomePage/Explore/CoreComponents/core/InputsDemo.tsx @@ -15,8 +15,7 @@ import { createStyles, Paper, } from '@mantine/core'; -import { CustomSelectDemo } from '@mantine/core/src/components/Select/demos/itemComponent'; -import { CountriesSelect } from '@mantine/core/src/components/MultiSelect/demos/countries'; +import { CustomSelectDemo, CountriesSelect } from '@mantine/demos'; import { DatePicker, DateRangePicker } from '@mantine/dates'; const BREAKPOINT = '@media (max-width: 960px)'; diff --git a/docs/src/components/HomePage/Explore/CoreComponents/core/OverlaysDemos.tsx b/docs/src/components/HomePage/Explore/CoreComponents/core/OverlaysDemos.tsx index 83990828d37..5cfc3a5239d 100644 --- a/docs/src/components/HomePage/Explore/CoreComponents/core/OverlaysDemos.tsx +++ b/docs/src/components/HomePage/Explore/CoreComponents/core/OverlaysDemos.tsx @@ -1,8 +1,7 @@ import React, { useState } from 'react'; import { Text, Group, Button, Modal, Drawer, Divider, CloseButton, Paper } from '@mantine/core'; import { Prism } from '@mantine/prism'; -import { form as FormPopoverDemo } from '@mantine/core/src/components/Popover/demos/form'; -import { AuthenticationForm } from '@mantine/core/demos/AuthenticationForm/AuthenticationForm'; +import { AuthenticationForm, PopoverDemos } from '@mantine/demos'; const code = ` import { useState } from 'react'; @@ -25,7 +24,7 @@ function Demo() { export function OverlaysDemos() { const [modalOpened, setModalOpened] = useState(false); const [drawerOpened, setDrawerOpened] = useState(false); - const PopoverDemo = FormPopoverDemo.component; + const PopoverDemo = PopoverDemos.form.component; return ( diff --git a/src/mantine-demos/src/index.ts b/src/mantine-demos/src/index.ts index 1b484f642bb..2b2edea515d 100644 --- a/src/mantine-demos/src/index.ts +++ b/src/mantine-demos/src/index.ts @@ -1,3 +1,10 @@ +// Inline demos +export { AuthenticationForm } from './shared/AuthenticationForm/AuthenticationForm'; +export { AccordionDemo } from './demos/Accordion/label'; +export { TimelineBase } from './demos/Timeline/_base'; +export { CustomSelectDemo } from './demos/Select/itemComponent'; +export { CountriesSelect } from './demos/MultiSelect/countries'; + // @mantine/core export * as AccordionDemos from './demos/Accordion'; export * as ActionIconDemos from './demos/ActionIcon';