Skip to content

Commit

Permalink
[docs] Migrate inline demos to @mantine/demos
Browse files Browse the repository at this point in the history
  • Loading branch information
rtivital committed Jan 30, 2022
1 parent 9e50d49 commit 313518d
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -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)' },
Expand Down Expand Up @@ -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 (
Expand Down
Original file line number Diff line number Diff line change
@@ -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 (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)';
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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 (
<Paper shadow="md" radius="md" padding={30}>
Expand Down
7 changes: 7 additions & 0 deletions src/mantine-demos/src/index.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down

0 comments on commit 313518d

Please sign in to comment.