mirror of
https://github.com/phuoc-ng/csslayout.git
synced 2025-10-24 11:16:27 +02:00
Add typescript types for patterns
This commit is contained in:
@@ -1,6 +1,10 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
const Heading = ({ title }) => {
|
interface HeadingProps {
|
||||||
|
title: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const Heading: React.FC<HeadingProps> = ({ title }) => {
|
||||||
return (
|
return (
|
||||||
<div className="bt b--black-20 relative">
|
<div className="bt b--black-20 relative">
|
||||||
<h3 className="absolute bg-white f4 left-2 lh-copy ma0 ph2 top-0 ttu" style={{ transform: 'translate(0, -50%)' }}>{title}</h3>
|
<h3 className="absolute bg-white f4 left-2 lh-copy ma0 ph2 top-0 ttu" style={{ transform: 'translate(0, -50%)' }}>{title}</h3>
|
||||||
|
|||||||
@@ -3,7 +3,11 @@ import React, { useEffect } from 'react';
|
|||||||
import CoverCard from './CoverCard';
|
import CoverCard from './CoverCard';
|
||||||
import Heading from './Heading';
|
import Heading from './Heading';
|
||||||
|
|
||||||
const RelatedPatterns = ({ patterns }) => {
|
interface RelatedPatternsProps {
|
||||||
|
patterns: string[];
|
||||||
|
}
|
||||||
|
|
||||||
|
const RelatedPatterns: React.FC<RelatedPatternsProps> = ({ patterns }) => {
|
||||||
return (
|
return (
|
||||||
<section>
|
<section>
|
||||||
<Heading title="Related patterns" />
|
<Heading title="Related patterns" />
|
||||||
|
|||||||
@@ -2,7 +2,12 @@ import React from 'react';
|
|||||||
|
|
||||||
import highlight from '../helpers/highlight';
|
import highlight from '../helpers/highlight';
|
||||||
|
|
||||||
const SampleCode = ({ code, lang }) => {
|
interface SampleCodeProps {
|
||||||
|
code: string;
|
||||||
|
lang: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const SampleCode: React.FC<SampleCodeProps> = ({ code, lang }) => {
|
||||||
return code === ''
|
return code === ''
|
||||||
? <></>
|
? <></>
|
||||||
: (
|
: (
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import html from 'highlight.js/lib/languages/xml';
|
|||||||
|
|
||||||
hljs.registerLanguage('html', html);
|
hljs.registerLanguage('html', html);
|
||||||
|
|
||||||
const highlight = (input, language) => {
|
const highlight = (input: string, language: string) => {
|
||||||
const lang = language || 'html';
|
const lang = language || 'html';
|
||||||
const { value } = hljs.highlight(lang, input);
|
const { value } = hljs.highlight(lang, input);
|
||||||
const highlighted = value.replace('&', '&').trim();
|
const highlighted = value.replace('&', '&').trim();
|
||||||
|
|||||||
@@ -1,2 +1,3 @@
|
|||||||
const random = (min, max) => min + Math.round(Math.random() * (max - min));
|
const random = (min: number, max: number) => min + Math.round(Math.random() * (max - min));
|
||||||
|
|
||||||
export default random;
|
export default random;
|
||||||
|
|||||||
@@ -1,2 +1,3 @@
|
|||||||
const randomFromArray = (array) => array[Math.floor(Math.random() * array.length)];
|
const randomFromArray = (array: number[]) => array[Math.floor(Math.random() * array.length)];
|
||||||
|
|
||||||
export default randomFromArray;
|
export default randomFromArray;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
const shuffe = (array) => {
|
const shuffe = (array: number[]) => {
|
||||||
array.sort(() => Math.random() - 0.5);
|
array.sort(() => Math.random() - 0.5);
|
||||||
return array;
|
return array;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,2 +1,3 @@
|
|||||||
const slug = item => item.toLowerCase().split(' ').join('-');
|
const slug = (item: string) => item.toLowerCase().split(' ').join('-');
|
||||||
|
|
||||||
export default slug;
|
export default slug;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { useEffect } from 'react';
|
import { useEffect } from 'react';
|
||||||
|
|
||||||
const useDocumentTitle = (title) => {
|
const useDocumentTitle = (title: string) => {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
document.title = title;
|
document.title = title;
|
||||||
}, [title]);
|
}, [title]);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { useEffect } from 'react';
|
import { useEffect } from 'react';
|
||||||
|
|
||||||
const useInterval = (callback, delay) => {
|
const useInterval = (callback: () => void, delay?: number) => {
|
||||||
useEffect(
|
useEffect(
|
||||||
() => {
|
() => {
|
||||||
const handler = () => callback();
|
const handler = () => callback();
|
||||||
|
|||||||
@@ -4,7 +4,11 @@ import { Link } from 'react-router-dom';
|
|||||||
import useDocumentTitle from '../hooks/useDocumentTitle';
|
import useDocumentTitle from '../hooks/useDocumentTitle';
|
||||||
import Layout from './Layout';
|
import Layout from './Layout';
|
||||||
|
|
||||||
const DetailsLayout = ({ title, children }) => {
|
interface DetailsLayoutProps {
|
||||||
|
title: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const DetailsLayout: React.FC<DetailsLayoutProps> = ({ title, children }) => {
|
||||||
useDocumentTitle(`CSS Layout ∙ ${title}`);
|
useDocumentTitle(`CSS Layout ∙ ${title}`);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import React from 'react';
|
|||||||
|
|
||||||
import Heading from '../components/Heading';
|
import Heading from '../components/Heading';
|
||||||
|
|
||||||
const Footer = () => {
|
const Footer: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<div className="bl br bb b--black-20 flex justify-between br4 br--bottom">
|
<div className="bl br bb b--black-20 flex justify-between br4 br--bottom">
|
||||||
<div className="br b--black-20" style={{ flex: 1 }}>
|
<div className="br b--black-20" style={{ flex: 1 }}>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import React, { useEffect } from 'react';
|
|||||||
|
|
||||||
import Footer from './Footer';
|
import Footer from './Footer';
|
||||||
|
|
||||||
const Layout = ({ children }) => {
|
const Layout: React.FC<{}> = ({ children }) => {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
window.scrollTo(0, 0);
|
window.scrollTo(0, 0);
|
||||||
}, []);
|
}, []);
|
||||||
|
|||||||
@@ -1,9 +1,13 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import loadable from '@loadable/component';
|
import loadable, { LoadableComponent } from '@loadable/component';
|
||||||
|
|
||||||
import './spinner.css';
|
import './spinner.css';
|
||||||
|
|
||||||
const slug = item => item.toLowerCase().split(' ').join('-');
|
interface DetailsLoaderProps {
|
||||||
|
pattern: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const slug = (item: string) => item.toLowerCase().split(' ').join('-');
|
||||||
|
|
||||||
// In order to create a link to another page that is dynamically loaded (via <Link to="...">),
|
// In order to create a link to another page that is dynamically loaded (via <Link to="...">),
|
||||||
// the page chunks have to be loadable by @loadable.
|
// the page chunks have to be loadable by @loadable.
|
||||||
@@ -12,9 +16,9 @@ const slug = item => item.toLowerCase().split(' ').join('-');
|
|||||||
// {
|
// {
|
||||||
// "plugins": ["@loadable/babel-plugin"],
|
// "plugins": ["@loadable/babel-plugin"],
|
||||||
// }
|
// }
|
||||||
const loadDetails = /* #__LOADABLE__ */ (props) => import(`../patterns/${slug(props.pattern)}/Details`)
|
const loadDetails = /* #__LOADABLE__ */ (props: DetailsLoaderProps) => import(`../patterns/${slug(props.pattern)}/Details`)
|
||||||
|
|
||||||
const DetailsLoader = loadable(loadDetails, {
|
const DetailsLoader: LoadableComponent<DetailsLoaderProps> = loadable(loadDetails, {
|
||||||
fallback: (
|
fallback: (
|
||||||
<div className="w100 h-100 flex items-center justify-center">
|
<div className="w100 h-100 flex items-center justify-center">
|
||||||
<svg className="spinner" width="64px" height="64px" viewBox="0 0 32 32">
|
<svg className="spinner" width="64px" height="64px" viewBox="0 0 32 32">
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import React from 'react';
|
|||||||
|
|
||||||
import Frame from '../../placeholders/Frame';
|
import Frame from '../../placeholders/Frame';
|
||||||
|
|
||||||
const Cover = () => {
|
const Cover: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<Frame>
|
<Frame>
|
||||||
<div className="h-100 flex flex-column items-center justify-center">
|
<div className="h-100 flex flex-column items-center justify-center">
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import React from 'react';
|
|||||||
import DetailsLayout from '../../layouts/DetailsLayout';
|
import DetailsLayout from '../../layouts/DetailsLayout';
|
||||||
import BrowserFrame from '../../placeholders/BrowserFrame';
|
import BrowserFrame from '../../placeholders/BrowserFrame';
|
||||||
|
|
||||||
const Details = () => {
|
const Details: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<DetailsLayout title="Badge">
|
<DetailsLayout title="Badge">
|
||||||
<div className="ph4 pv5">
|
<div className="ph4 pv5">
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import React from 'react';
|
|||||||
import Frame from '../../placeholders/Frame';
|
import Frame from '../../placeholders/Frame';
|
||||||
import Rectangle from '../../placeholders/Rectangle';
|
import Rectangle from '../../placeholders/Rectangle';
|
||||||
|
|
||||||
const Cover = () => {
|
const Cover: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<Frame>
|
<Frame>
|
||||||
<div className="h-100 flex flex-column items-center justify-center">
|
<div className="h-100 flex flex-column items-center justify-center">
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import DetailsLayout from '../../layouts/DetailsLayout';
|
|||||||
import BrowserFrame from '../../placeholders/BrowserFrame';
|
import BrowserFrame from '../../placeholders/BrowserFrame';
|
||||||
import Rectangle from '../../placeholders/Rectangle';
|
import Rectangle from '../../placeholders/Rectangle';
|
||||||
|
|
||||||
const Details = () => {
|
const Details: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<DetailsLayout title="Breadcrumb">
|
<DetailsLayout title="Breadcrumb">
|
||||||
<div className="ph4 pv5">
|
<div className="ph4 pv5">
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import Circle from '../../placeholders/Circle';
|
|||||||
import Frame from '../../placeholders/Frame';
|
import Frame from '../../placeholders/Frame';
|
||||||
import Rectangle from '../../placeholders/Rectangle';
|
import Rectangle from '../../placeholders/Rectangle';
|
||||||
|
|
||||||
const Cover = () => {
|
const Cover: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<Frame>
|
<Frame>
|
||||||
<div className="h-100 flex flex-column items-center justify-center pa2">
|
<div className="h-100 flex flex-column items-center justify-center pa2">
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import BrowserFrame from '../../placeholders/BrowserFrame';
|
|||||||
import Circle from '../../placeholders/Circle';
|
import Circle from '../../placeholders/Circle';
|
||||||
import Rectangle from '../../placeholders/Rectangle';
|
import Rectangle from '../../placeholders/Rectangle';
|
||||||
|
|
||||||
const Details = () => {
|
const Details: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<DetailsLayout title="Button with icon">
|
<DetailsLayout title="Button with icon">
|
||||||
<div className="ph4 pv5">
|
<div className="ph4 pv5">
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import Frame from '../../placeholders/Frame';
|
|||||||
import Line from '../../placeholders/Line';
|
import Line from '../../placeholders/Line';
|
||||||
import Rectangle from '../../placeholders/Rectangle';
|
import Rectangle from '../../placeholders/Rectangle';
|
||||||
|
|
||||||
const Cover = () => {
|
const Cover: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<Frame>
|
<Frame>
|
||||||
<div className="flex flex-column h-100 pa2">
|
<div className="flex flex-column h-100 pa2">
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import Block from '../../placeholders/Block';
|
|||||||
import BrowserFrame from '../../placeholders/BrowserFrame';
|
import BrowserFrame from '../../placeholders/BrowserFrame';
|
||||||
import Rectangle from '../../placeholders/Rectangle';
|
import Rectangle from '../../placeholders/Rectangle';
|
||||||
|
|
||||||
const Details = () => {
|
const Details: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<DetailsLayout title="Card">
|
<DetailsLayout title="Card">
|
||||||
<div className="ph4 pv5">
|
<div className="ph4 pv5">
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import Circle from '../../placeholders/Circle';
|
|||||||
import Frame from '../../placeholders/Frame';
|
import Frame from '../../placeholders/Frame';
|
||||||
import Line from '../../placeholders/Line';
|
import Line from '../../placeholders/Line';
|
||||||
|
|
||||||
const Cover = () => {
|
const Cover: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<Frame>
|
<Frame>
|
||||||
<div className="h-100 flex flex-column items-center justify-center">
|
<div className="h-100 flex flex-column items-center justify-center">
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import BrowserFrame from '../../placeholders/BrowserFrame';
|
|||||||
import Circle from '../../placeholders/Circle';
|
import Circle from '../../placeholders/Circle';
|
||||||
import Rectangle from '../../placeholders/Rectangle';
|
import Rectangle from '../../placeholders/Rectangle';
|
||||||
|
|
||||||
const Details = () => {
|
const Details: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<DetailsLayout title="Centering">
|
<DetailsLayout title="Centering">
|
||||||
<div className="ph4 pv5">
|
<div className="ph4 pv5">
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import React from 'react';
|
|||||||
|
|
||||||
import Frame from '../../placeholders/Frame';
|
import Frame from '../../placeholders/Frame';
|
||||||
|
|
||||||
const Cover = () => {
|
const Cover: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<Frame>
|
<Frame>
|
||||||
<div className="h-100 flex flex-column items-center justify-center">
|
<div className="h-100 flex flex-column items-center justify-center">
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import DetailsLayout from '../../layouts/DetailsLayout';
|
|||||||
import BrowserFrame from '../../placeholders/BrowserFrame';
|
import BrowserFrame from '../../placeholders/BrowserFrame';
|
||||||
import Rectangle from '../../placeholders/Rectangle';
|
import Rectangle from '../../placeholders/Rectangle';
|
||||||
|
|
||||||
const Details = () => {
|
const Details: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<DetailsLayout title="Docked at corner">
|
<DetailsLayout title="Docked at corner">
|
||||||
<div className="ph4 pv5">
|
<div className="ph4 pv5">
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import React from 'react';
|
|||||||
|
|
||||||
import Frame from '../../placeholders/Frame';
|
import Frame from '../../placeholders/Frame';
|
||||||
|
|
||||||
const Cover = () => {
|
const Cover: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<Frame>
|
<Frame>
|
||||||
<div className="h-100 flex flex-column items-center justify-center">
|
<div className="h-100 flex flex-column items-center justify-center">
|
||||||
|
|||||||
@@ -3,10 +3,14 @@ import React, { useState } from 'react';
|
|||||||
import DetailsLayout from '../../layouts/DetailsLayout';
|
import DetailsLayout from '../../layouts/DetailsLayout';
|
||||||
import BrowserFrame from '../../placeholders/BrowserFrame';
|
import BrowserFrame from '../../placeholders/BrowserFrame';
|
||||||
|
|
||||||
const Details = () => {
|
interface DotProps {
|
||||||
|
index: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
const Details: React.FC<{}> = () => {
|
||||||
const [activeItem, setActiveItem] = useState(0);
|
const [activeItem, setActiveItem] = useState(0);
|
||||||
|
|
||||||
const Dot = ({ index }) => {
|
const Dot: React.FC<DotProps> = ({ index }) => {
|
||||||
const isActive = index === activeItem;
|
const isActive = index === activeItem;
|
||||||
const click = () => setActiveItem(index);
|
const click = () => setActiveItem(index);
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import Frame from '../../placeholders/Frame';
|
|||||||
import Line from '../../placeholders/Line';
|
import Line from '../../placeholders/Line';
|
||||||
import Rectangle from '../../placeholders/Rectangle';
|
import Rectangle from '../../placeholders/Rectangle';
|
||||||
|
|
||||||
const Cover = () => {
|
const Cover: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<Frame>
|
<Frame>
|
||||||
<div className="flex flex-column justify-center h-100 pa2 w-100">
|
<div className="flex flex-column justify-center h-100 pa2 w-100">
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import BrowserFrame from '../../placeholders/BrowserFrame';
|
|||||||
import Circle from '../../placeholders/Circle';
|
import Circle from '../../placeholders/Circle';
|
||||||
import Rectangle from '../../placeholders/Rectangle';
|
import Rectangle from '../../placeholders/Rectangle';
|
||||||
|
|
||||||
const Details = () => {
|
const Details: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<DetailsLayout title="Feature list">
|
<DetailsLayout title="Feature list">
|
||||||
<div className="ph4 pv5">
|
<div className="ph4 pv5">
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import React from 'react';
|
|||||||
import Frame from '../../placeholders/Frame';
|
import Frame from '../../placeholders/Frame';
|
||||||
import Triangle from '../../placeholders/Triangle';
|
import Triangle from '../../placeholders/Triangle';
|
||||||
|
|
||||||
const Cover = () => {
|
const Cover: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<Frame>
|
<Frame>
|
||||||
<div className="relative">
|
<div className="relative">
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import DetailsLayout from '../../layouts/DetailsLayout';
|
|||||||
import BrowserFrame from '../../placeholders/BrowserFrame';
|
import BrowserFrame from '../../placeholders/BrowserFrame';
|
||||||
import Triangle from '../../placeholders/Triangle';
|
import Triangle from '../../placeholders/Triangle';
|
||||||
|
|
||||||
const Details = () => {
|
const Details: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<DetailsLayout title="Fixed at corner">
|
<DetailsLayout title="Fixed at corner">
|
||||||
<div className="ph4 pv5">
|
<div className="ph4 pv5">
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import React from 'react';
|
|||||||
import Frame from '../../placeholders/Frame';
|
import Frame from '../../placeholders/Frame';
|
||||||
import Line from '../../placeholders/Line';
|
import Line from '../../placeholders/Line';
|
||||||
|
|
||||||
const Cover = () => {
|
const Cover: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<Frame>
|
<Frame>
|
||||||
<div className="h-100 flex flex-column">
|
<div className="h-100 flex flex-column">
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import Block from '../../placeholders/Block';
|
|||||||
import BrowserFrame from '../../placeholders/BrowserFrame';
|
import BrowserFrame from '../../placeholders/BrowserFrame';
|
||||||
import Rectangle from '../../placeholders/Rectangle';
|
import Rectangle from '../../placeholders/Rectangle';
|
||||||
|
|
||||||
const Details = () => {
|
const Details: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<DetailsLayout title="Holy grail">
|
<DetailsLayout title="Holy grail">
|
||||||
<div className="ph4 pv5">
|
<div className="ph4 pv5">
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import React from 'react';
|
|||||||
import Frame from '../../placeholders/Frame';
|
import Frame from '../../placeholders/Frame';
|
||||||
import Line from '../../placeholders/Line';
|
import Line from '../../placeholders/Line';
|
||||||
|
|
||||||
const Cover = () => {
|
const Cover: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<Frame>
|
<Frame>
|
||||||
<div className="h-100 flex items-center justify-center pa2">
|
<div className="h-100 flex items-center justify-center pa2">
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import DetailsLayout from '../../layouts/DetailsLayout';
|
|||||||
import BrowserFrame from '../../placeholders/BrowserFrame';
|
import BrowserFrame from '../../placeholders/BrowserFrame';
|
||||||
import Rectangle from '../../placeholders/Rectangle';
|
import Rectangle from '../../placeholders/Rectangle';
|
||||||
|
|
||||||
const Details = () => {
|
const Details: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<DetailsLayout title="Input add-on">
|
<DetailsLayout title="Input add-on">
|
||||||
<div className="ph4 pv5">
|
<div className="ph4 pv5">
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import Frame from '../../placeholders/Frame';
|
|||||||
import Line from '../../placeholders/Line';
|
import Line from '../../placeholders/Line';
|
||||||
import Square from '../../placeholders/Square';
|
import Square from '../../placeholders/Square';
|
||||||
|
|
||||||
const Cover = () => {
|
const Cover: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<Frame>
|
<Frame>
|
||||||
<div className="flex h-100 items-start pa2 w-100">
|
<div className="flex h-100 items-start pa2 w-100">
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import BrowserFrame from '../../placeholders/BrowserFrame';
|
|||||||
import Rectangle from '../../placeholders/Rectangle';
|
import Rectangle from '../../placeholders/Rectangle';
|
||||||
import Square from '../../placeholders/Square';
|
import Square from '../../placeholders/Square';
|
||||||
|
|
||||||
const Details = () => {
|
const Details: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<DetailsLayout title="Media object">
|
<DetailsLayout title="Media object">
|
||||||
<div className="ph4 pv5">
|
<div className="ph4 pv5">
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import React from 'react';
|
|||||||
import Frame from '../../placeholders/Frame';
|
import Frame from '../../placeholders/Frame';
|
||||||
import Line from '../../placeholders/Line';
|
import Line from '../../placeholders/Line';
|
||||||
|
|
||||||
const Cover = () => {
|
const Cover: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<Frame>
|
<Frame>
|
||||||
<div className="h-100 flex flex-column items-center justify-center pa3">
|
<div className="h-100 flex flex-column items-center justify-center pa3">
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import BrowserFrame from '../../placeholders/BrowserFrame';
|
|||||||
import Circle from '../../placeholders/Circle';
|
import Circle from '../../placeholders/Circle';
|
||||||
import Rectangle from '../../placeholders/Rectangle';
|
import Rectangle from '../../placeholders/Rectangle';
|
||||||
|
|
||||||
const Details = () => {
|
const Details: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<DetailsLayout title="Menu">
|
<DetailsLayout title="Menu">
|
||||||
<div className="ph4 pv5">
|
<div className="ph4 pv5">
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import Frame from '../../placeholders/Frame';
|
|||||||
import Line from '../../placeholders/Line';
|
import Line from '../../placeholders/Line';
|
||||||
import Rectangle from '../../placeholders/Rectangle';
|
import Rectangle from '../../placeholders/Rectangle';
|
||||||
|
|
||||||
const Cover = () => {
|
const Cover: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<Frame>
|
<Frame>
|
||||||
<div className="flex flex-column h-100 items-center justify-center pa3">
|
<div className="flex flex-column h-100 items-center justify-center pa3">
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import BrowserFrame from '../../placeholders/BrowserFrame';
|
|||||||
import Circle from '../../placeholders/Circle';
|
import Circle from '../../placeholders/Circle';
|
||||||
import Rectangle from '../../placeholders/Rectangle';
|
import Rectangle from '../../placeholders/Rectangle';
|
||||||
|
|
||||||
const Details = () => {
|
const Details: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<DetailsLayout title="Modal">
|
<DetailsLayout title="Modal">
|
||||||
<div className="ph4 pv5">
|
<div className="ph4 pv5">
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import React from 'react';
|
|||||||
import Frame from '../../placeholders/Frame';
|
import Frame from '../../placeholders/Frame';
|
||||||
import Rectangle from '../../placeholders/Rectangle';
|
import Rectangle from '../../placeholders/Rectangle';
|
||||||
|
|
||||||
const Cover = () => {
|
const Cover: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<Frame>
|
<Frame>
|
||||||
<div className="h-100 flex flex-column items-center justify-center">
|
<div className="h-100 flex flex-column items-center justify-center">
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import Block from '../../placeholders/Block';
|
|||||||
import BrowserFrame from '../../placeholders/BrowserFrame';
|
import BrowserFrame from '../../placeholders/BrowserFrame';
|
||||||
import Circle from '../../placeholders/Circle';
|
import Circle from '../../placeholders/Circle';
|
||||||
|
|
||||||
const Details = () => {
|
const Details: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<DetailsLayout title="Notification">
|
<DetailsLayout title="Notification">
|
||||||
<div className="ph4 pv5">
|
<div className="ph4 pv5">
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import Frame from '../../placeholders/Frame';
|
|||||||
import Circle from '../../placeholders/Circle';
|
import Circle from '../../placeholders/Circle';
|
||||||
import Rectangle from '../../placeholders/Rectangle';
|
import Rectangle from '../../placeholders/Rectangle';
|
||||||
|
|
||||||
const Cover = () => {
|
const Cover: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<Frame>
|
<Frame>
|
||||||
<div className="h-100 flex flex-column items-center justify-center pa2">
|
<div className="h-100 flex flex-column items-center justify-center pa2">
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import BrowserFrame from '../../placeholders/BrowserFrame';
|
|||||||
import Circle from '../../placeholders/Circle';
|
import Circle from '../../placeholders/Circle';
|
||||||
import Rectangle from '../../placeholders/Rectangle';
|
import Rectangle from '../../placeholders/Rectangle';
|
||||||
|
|
||||||
const Details = () => {
|
const Details: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<DetailsLayout title="Pagination">
|
<DetailsLayout title="Pagination">
|
||||||
<div className="ph4 pv5">
|
<div className="ph4 pv5">
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import React from 'react';
|
|||||||
import Frame from '../../placeholders/Frame';
|
import Frame from '../../placeholders/Frame';
|
||||||
import Rectangle from '../../placeholders/Rectangle';
|
import Rectangle from '../../placeholders/Rectangle';
|
||||||
|
|
||||||
const Cover = () => {
|
const Cover: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<Frame>
|
<Frame>
|
||||||
<div className="h-100 flex flex-column items-center justify-center">
|
<div className="h-100 flex flex-column items-center justify-center">
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import DetailsLayout from '../../layouts/DetailsLayout';
|
|||||||
import BrowserFrame from '../../placeholders/BrowserFrame';
|
import BrowserFrame from '../../placeholders/BrowserFrame';
|
||||||
import Rectangle from '../../placeholders/Rectangle';
|
import Rectangle from '../../placeholders/Rectangle';
|
||||||
|
|
||||||
const Details = () => {
|
const Details: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<DetailsLayout title="Previous and next buttons">
|
<DetailsLayout title="Previous and next buttons">
|
||||||
<div className="ph4 pv5">
|
<div className="ph4 pv5">
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import Frame from '../../placeholders/Frame';
|
|||||||
import Line from '../../placeholders/Line';
|
import Line from '../../placeholders/Line';
|
||||||
import Rectangle from '../../placeholders/Rectangle';
|
import Rectangle from '../../placeholders/Rectangle';
|
||||||
|
|
||||||
const Cover = () => {
|
const Cover: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<Frame>
|
<Frame>
|
||||||
<div className="h-100 flex items-center justify-center ph2">
|
<div className="h-100 flex items-center justify-center ph2">
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import Block from '../../placeholders/Block';
|
|||||||
import BrowserFrame from '../../placeholders/BrowserFrame';
|
import BrowserFrame from '../../placeholders/BrowserFrame';
|
||||||
import Rectangle from '../../placeholders/Rectangle';
|
import Rectangle from '../../placeholders/Rectangle';
|
||||||
|
|
||||||
const Details = () => {
|
const Details: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<DetailsLayout title="Pricing table">
|
<DetailsLayout title="Pricing table">
|
||||||
<div className="ph4 pv5">
|
<div className="ph4 pv5">
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import React from 'react';
|
|||||||
|
|
||||||
import Frame from '../../placeholders/Frame';
|
import Frame from '../../placeholders/Frame';
|
||||||
|
|
||||||
const Cover = () => {
|
const Cover: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<Frame>
|
<Frame>
|
||||||
<div className="h-100 flex flex-column items-center justify-center pa2">
|
<div className="h-100 flex flex-column items-center justify-center pa2">
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import DetailsLayout from '../../layouts/DetailsLayout';
|
|||||||
import BrowserFrame from '../../placeholders/BrowserFrame';
|
import BrowserFrame from '../../placeholders/BrowserFrame';
|
||||||
import useInterval from '../../hooks/useInterval';
|
import useInterval from '../../hooks/useInterval';
|
||||||
|
|
||||||
const Details = () => {
|
const Details: React.FC<{}> = () => {
|
||||||
const [progress, setProgress] = useState(0);
|
const [progress, setProgress] = useState(0);
|
||||||
useInterval(() => {
|
useInterval(() => {
|
||||||
setProgress(v => v === 100 ? 0 : v + 1);
|
setProgress(v => v === 100 ? 0 : v + 1);
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import Line from '../../placeholders/Line';
|
|||||||
import Rectangle from '../../placeholders/Rectangle';
|
import Rectangle from '../../placeholders/Rectangle';
|
||||||
import Triangle from '../../placeholders/Triangle';
|
import Triangle from '../../placeholders/Triangle';
|
||||||
|
|
||||||
const Cover = () => {
|
const Cover: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<Frame>
|
<Frame>
|
||||||
<div className="h-100 flex flex-column items-center justify-center pa2">
|
<div className="h-100 flex flex-column items-center justify-center pa2">
|
||||||
|
|||||||
@@ -6,10 +6,15 @@ import BrowserFrame from '../../placeholders/BrowserFrame';
|
|||||||
import Rectangle from '../../placeholders/Rectangle';
|
import Rectangle from '../../placeholders/Rectangle';
|
||||||
import Triangle from '../../placeholders/Triangle';
|
import Triangle from '../../placeholders/Triangle';
|
||||||
|
|
||||||
const Details = () => {
|
interface ItemProps {
|
||||||
|
index: number;
|
||||||
|
title: React.ReactNode;
|
||||||
|
}
|
||||||
|
|
||||||
|
const Details: React.FC<{}> = () => {
|
||||||
const [activeItem, setActiveItem] = useState(-1);
|
const [activeItem, setActiveItem] = useState(-1);
|
||||||
|
|
||||||
const Item = ({ index, title, children }) => {
|
const Item: React.FC<ItemProps> = ({ index, title, children }) => {
|
||||||
const isOpened = (index === activeItem);
|
const isOpened = (index === activeItem);
|
||||||
const click = () => setActiveItem(isOpened ? -1 : index);
|
const click = () => setActiveItem(isOpened ? -1 : index);
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import React from 'react';
|
|||||||
import Frame from '../../placeholders/Frame';
|
import Frame from '../../placeholders/Frame';
|
||||||
import Rectangle from '../../placeholders/Rectangle';
|
import Rectangle from '../../placeholders/Rectangle';
|
||||||
|
|
||||||
const Cover = () => {
|
const Cover: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<Frame>
|
<Frame>
|
||||||
<div className="h-100 flex flex-column items-center justify-center pa2">
|
<div className="h-100 flex flex-column items-center justify-center pa2">
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import RelatedPatterns from '../../components/RelatedPatterns';
|
|||||||
import DetailsLayout from '../../layouts/DetailsLayout';
|
import DetailsLayout from '../../layouts/DetailsLayout';
|
||||||
import BrowserFrame from '../../placeholders/BrowserFrame';
|
import BrowserFrame from '../../placeholders/BrowserFrame';
|
||||||
|
|
||||||
const Details = () => {
|
const Details: React.FC<{}> = () => {
|
||||||
const [isFirstChecked, setFirstChecked] = useState(false);
|
const [isFirstChecked, setFirstChecked] = useState(false);
|
||||||
const toggle = () => setFirstChecked(c => !c);
|
const toggle = () => setFirstChecked(c => !c);
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import Frame from '../../placeholders/Frame';
|
|||||||
import Line from '../../placeholders/Line';
|
import Line from '../../placeholders/Line';
|
||||||
import Square from '../../placeholders/Square';
|
import Square from '../../placeholders/Square';
|
||||||
|
|
||||||
const Cover = () => {
|
const Cover: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<Frame>
|
<Frame>
|
||||||
<div className="flex h-100 pa2">
|
<div className="flex h-100 pa2">
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import Block from '../../placeholders/Block';
|
|||||||
import BrowserFrame from '../../placeholders/BrowserFrame';
|
import BrowserFrame from '../../placeholders/BrowserFrame';
|
||||||
import Rectangle from '../../placeholders/Rectangle';
|
import Rectangle from '../../placeholders/Rectangle';
|
||||||
|
|
||||||
const Details = () => {
|
const Details: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<DetailsLayout title="Same height columns">
|
<DetailsLayout title="Same height columns">
|
||||||
<div className="ph4 pv5">
|
<div className="ph4 pv5">
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import React from 'react';
|
|||||||
import Circle from '../../placeholders/Circle';
|
import Circle from '../../placeholders/Circle';
|
||||||
import Frame from '../../placeholders/Frame';
|
import Frame from '../../placeholders/Frame';
|
||||||
|
|
||||||
const Cover = () => {
|
const Cover: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<Frame>
|
<Frame>
|
||||||
<div className="h-100 flex flex-column items-center justify-center pa2">
|
<div className="h-100 flex flex-column items-center justify-center pa2">
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import DetailsLayout from '../../layouts/DetailsLayout';
|
|||||||
import BrowserFrame from '../../placeholders/BrowserFrame';
|
import BrowserFrame from '../../placeholders/BrowserFrame';
|
||||||
import Circle from '../../placeholders/Circle';
|
import Circle from '../../placeholders/Circle';
|
||||||
|
|
||||||
const Details = () => {
|
const Details: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<DetailsLayout title="Search box">
|
<DetailsLayout title="Search box">
|
||||||
<div className="ph4 pv5">
|
<div className="ph4 pv5">
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import Frame from '../../placeholders/Frame';
|
|||||||
import Line from '../../placeholders/Line';
|
import Line from '../../placeholders/Line';
|
||||||
import Rectangle from '../../placeholders/Rectangle';
|
import Rectangle from '../../placeholders/Rectangle';
|
||||||
|
|
||||||
const Cover = () => {
|
const Cover: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<Frame>
|
<Frame>
|
||||||
<div className="h-100 flex flex-column items-center justify-center">
|
<div className="h-100 flex flex-column items-center justify-center">
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import DetailsLayout from '../../layouts/DetailsLayout';
|
|||||||
import BrowserFrame from '../../placeholders/BrowserFrame';
|
import BrowserFrame from '../../placeholders/BrowserFrame';
|
||||||
import Rectangle from '../../placeholders/Rectangle';
|
import Rectangle from '../../placeholders/Rectangle';
|
||||||
|
|
||||||
const Details = () => {
|
const Details: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<DetailsLayout title="Separator">
|
<DetailsLayout title="Separator">
|
||||||
<div className="ph4 pv5">
|
<div className="ph4 pv5">
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import React from 'react';
|
|||||||
import Frame from '../../placeholders/Frame';
|
import Frame from '../../placeholders/Frame';
|
||||||
import Line from '../../placeholders/Line';
|
import Line from '../../placeholders/Line';
|
||||||
|
|
||||||
const Cover = () => {
|
const Cover: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<Frame>
|
<Frame>
|
||||||
<div className="h-100 flex">
|
<div className="h-100 flex">
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import DetailsLayout from '../../layouts/DetailsLayout';
|
|||||||
import BrowserFrame from '../../placeholders/BrowserFrame';
|
import BrowserFrame from '../../placeholders/BrowserFrame';
|
||||||
import Block from '../../placeholders/Block';
|
import Block from '../../placeholders/Block';
|
||||||
|
|
||||||
const Details = () => {
|
const Details: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<DetailsLayout title="Sidebar">
|
<DetailsLayout title="Sidebar">
|
||||||
<div className="ph4 pv5">
|
<div className="ph4 pv5">
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import React from 'react';
|
|||||||
import Frame from '../../placeholders/Frame';
|
import Frame from '../../placeholders/Frame';
|
||||||
import Rectangle from '../../placeholders/Rectangle';
|
import Rectangle from '../../placeholders/Rectangle';
|
||||||
|
|
||||||
const Cover = () => {
|
const Cover: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<Frame>
|
<Frame>
|
||||||
<div className="h-100 flex flex-column items-center justify-center">
|
<div className="h-100 flex flex-column items-center justify-center">
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import DetailsLayout from '../../layouts/DetailsLayout';
|
|||||||
import BrowserFrame from '../../placeholders/BrowserFrame';
|
import BrowserFrame from '../../placeholders/BrowserFrame';
|
||||||
import Rectangle from '../../placeholders/Rectangle';
|
import Rectangle from '../../placeholders/Rectangle';
|
||||||
|
|
||||||
const Details = () => {
|
const Details: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<DetailsLayout title="Simple grid">
|
<DetailsLayout title="Simple grid">
|
||||||
<div className="ph4 pv5">
|
<div className="ph4 pv5">
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import Circle from '../../placeholders/Circle';
|
|||||||
import Frame from '../../placeholders/Frame';
|
import Frame from '../../placeholders/Frame';
|
||||||
import Line from '../../placeholders/Line';
|
import Line from '../../placeholders/Line';
|
||||||
|
|
||||||
const Cover = () => {
|
const Cover: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<Frame>
|
<Frame>
|
||||||
<div className="h-100 flex flex-column items-center justify-center">
|
<div className="h-100 flex flex-column items-center justify-center">
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import Circle from '../../placeholders/Circle';
|
|||||||
import BrowserFrame from '../../placeholders/BrowserFrame';
|
import BrowserFrame from '../../placeholders/BrowserFrame';
|
||||||
import Rectangle from '../../placeholders/Rectangle';
|
import Rectangle from '../../placeholders/Rectangle';
|
||||||
|
|
||||||
const Details = () => {
|
const Details: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<DetailsLayout title="Slider">
|
<DetailsLayout title="Slider">
|
||||||
<div className="ph4 pv5">
|
<div className="ph4 pv5">
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import React from 'react';
|
|||||||
import Frame from '../../placeholders/Frame';
|
import Frame from '../../placeholders/Frame';
|
||||||
import Rectangle from '../../placeholders/Rectangle';
|
import Rectangle from '../../placeholders/Rectangle';
|
||||||
|
|
||||||
const Cover = () => {
|
const Cover: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<Frame>
|
<Frame>
|
||||||
<div className="h-100 flex flex-column items-center justify-center">
|
<div className="h-100 flex flex-column items-center justify-center">
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import DetailsLayout from '../../layouts/DetailsLayout';
|
|||||||
import BrowserFrame from '../../placeholders/BrowserFrame';
|
import BrowserFrame from '../../placeholders/BrowserFrame';
|
||||||
import Rectangle from '../../placeholders/Rectangle';
|
import Rectangle from '../../placeholders/Rectangle';
|
||||||
|
|
||||||
const Details = () => {
|
const Details: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<DetailsLayout title="Split navigation">
|
<DetailsLayout title="Split navigation">
|
||||||
<div className="ph4 pv5">
|
<div className="ph4 pv5">
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import Circle from '../../placeholders/Circle';
|
|||||||
import Frame from '../../placeholders/Frame';
|
import Frame from '../../placeholders/Frame';
|
||||||
import Line from '../../placeholders/Line';
|
import Line from '../../placeholders/Line';
|
||||||
|
|
||||||
const Cover = () => {
|
const Cover: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<Frame>
|
<Frame>
|
||||||
<div className="h-100 flex">
|
<div className="h-100 flex">
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import Block from '../../placeholders/Block';
|
|||||||
import Circle from '../../placeholders/Circle';
|
import Circle from '../../placeholders/Circle';
|
||||||
import Rectangle from '../../placeholders/Rectangle';
|
import Rectangle from '../../placeholders/Rectangle';
|
||||||
|
|
||||||
const Details = () => {
|
const Details: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<DetailsLayout title="Split screen">
|
<DetailsLayout title="Split screen">
|
||||||
<div className="ph4 pv5">
|
<div className="ph4 pv5">
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import React from 'react';
|
|||||||
|
|
||||||
import Frame from '../../placeholders/Frame';
|
import Frame from '../../placeholders/Frame';
|
||||||
|
|
||||||
const Cover = () => {
|
const Cover: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<Frame>
|
<Frame>
|
||||||
<div className="h-100 flex items-center justify-center pa2">
|
<div className="h-100 flex items-center justify-center pa2">
|
||||||
|
|||||||
@@ -4,11 +4,11 @@ import { Link } from 'react-router-dom';
|
|||||||
import DetailsLayout from '../../layouts/DetailsLayout';
|
import DetailsLayout from '../../layouts/DetailsLayout';
|
||||||
import BrowserFrame from '../../placeholders/BrowserFrame';
|
import BrowserFrame from '../../placeholders/BrowserFrame';
|
||||||
|
|
||||||
const Details = () => {
|
const Details: React.FC<{}> = () => {
|
||||||
const [value, setValue] = useState(0);
|
const [value, setValue] = useState(0);
|
||||||
const decrease = () => setValue(value - 1);
|
const decrease = () => setValue(value - 1);
|
||||||
const increase = () => setValue(value + 1);
|
const increase = () => setValue(value + 1);
|
||||||
const change = (e) => setValue(parseInt(e.target.value, 10));
|
const change = (e: React.ChangeEvent<HTMLInputElement>) => setValue(parseInt(e.target.value, 10));
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DetailsLayout title="Stepper input">
|
<DetailsLayout title="Stepper input">
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import React from 'react';
|
|||||||
import Frame from '../../placeholders/Frame';
|
import Frame from '../../placeholders/Frame';
|
||||||
import Line from '../../placeholders/Line';
|
import Line from '../../placeholders/Line';
|
||||||
|
|
||||||
const Cover = () => {
|
const Cover: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<Frame>
|
<Frame>
|
||||||
<div className="h-100 flex flex-column">
|
<div className="h-100 flex flex-column">
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import Block from '../../placeholders/Block';
|
|||||||
import BrowserFrame from '../../placeholders/BrowserFrame';
|
import BrowserFrame from '../../placeholders/BrowserFrame';
|
||||||
import Rectangle from '../../placeholders/Rectangle';
|
import Rectangle from '../../placeholders/Rectangle';
|
||||||
|
|
||||||
const Details = () => {
|
const Details: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<DetailsLayout title="Sticky footer">
|
<DetailsLayout title="Sticky footer">
|
||||||
<div className="ph4 pv5">
|
<div className="ph4 pv5">
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import React from 'react';
|
|||||||
import Frame from '../../placeholders/Frame';
|
import Frame from '../../placeholders/Frame';
|
||||||
import Line from '../../placeholders/Line';
|
import Line from '../../placeholders/Line';
|
||||||
|
|
||||||
const Cover = () => {
|
const Cover: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<Frame>
|
<Frame>
|
||||||
<div className="h-100 flex flex-column">
|
<div className="h-100 flex flex-column">
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import Block from '../../placeholders/Block';
|
|||||||
import BrowserFrame from '../../placeholders/BrowserFrame';
|
import BrowserFrame from '../../placeholders/BrowserFrame';
|
||||||
import Rectangle from '../../placeholders/Rectangle';
|
import Rectangle from '../../placeholders/Rectangle';
|
||||||
|
|
||||||
const Details = () => {
|
const Details: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<DetailsLayout title="Sticky header">
|
<DetailsLayout title="Sticky header">
|
||||||
<div className="ph4 pv5">
|
<div className="ph4 pv5">
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import React from 'react';
|
|||||||
|
|
||||||
import Frame from '../../placeholders/Frame';
|
import Frame from '../../placeholders/Frame';
|
||||||
|
|
||||||
const Cover = () => {
|
const Cover: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<Frame>
|
<Frame>
|
||||||
<div className="h-100 flex flex-column items-center justify-center pa2">
|
<div className="h-100 flex flex-column items-center justify-center pa2">
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import RelatedPatterns from '../../components/RelatedPatterns';
|
|||||||
import DetailsLayout from '../../layouts/DetailsLayout';
|
import DetailsLayout from '../../layouts/DetailsLayout';
|
||||||
import BrowserFrame from '../../placeholders/BrowserFrame';
|
import BrowserFrame from '../../placeholders/BrowserFrame';
|
||||||
|
|
||||||
const Details = () => {
|
const Details: React.FC<{}> = () => {
|
||||||
const [checked, setChecked] = useState(false);
|
const [checked, setChecked] = useState(false);
|
||||||
const toggle = () => setChecked(c => !c);
|
const toggle = () => setChecked(c => !c);
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import React from 'react';
|
|||||||
import Circle from '../../placeholders/Circle';
|
import Circle from '../../placeholders/Circle';
|
||||||
import Frame from '../../placeholders/Frame';
|
import Frame from '../../placeholders/Frame';
|
||||||
|
|
||||||
const Cover = () => {
|
const Cover: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<Frame>
|
<Frame>
|
||||||
<div className="h-100 flex flex-column items-center justify-center">
|
<div className="h-100 flex flex-column items-center justify-center">
|
||||||
|
|||||||
@@ -4,10 +4,14 @@ import DetailsLayout from '../../layouts/DetailsLayout';
|
|||||||
import BrowserFrame from '../../placeholders/BrowserFrame';
|
import BrowserFrame from '../../placeholders/BrowserFrame';
|
||||||
import Rectangle from '../../placeholders/Rectangle';
|
import Rectangle from '../../placeholders/Rectangle';
|
||||||
|
|
||||||
const Details = () => {
|
interface TabProps {
|
||||||
|
tabIndex: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
const Details: React.FC<{}> = () => {
|
||||||
const [activeTab, setActiveTab] = useState(0);
|
const [activeTab, setActiveTab] = useState(0);
|
||||||
|
|
||||||
const Tab = ({ tabIndex, children }) => {
|
const Tab: React.FC<TabProps> = ({ tabIndex, children }) => {
|
||||||
const isActive = tabIndex === activeTab;
|
const isActive = tabIndex === activeTab;
|
||||||
const click = () => setActiveTab(tabIndex);
|
const click = () => setActiveTab(tabIndex);
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import React from 'react';
|
|||||||
import Circle from '../../placeholders/Circle';
|
import Circle from '../../placeholders/Circle';
|
||||||
import Frame from '../../placeholders/Frame';
|
import Frame from '../../placeholders/Frame';
|
||||||
|
|
||||||
const Cover = () => {
|
const Cover: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<Frame>
|
<Frame>
|
||||||
<div className="h-100 flex flex-column items-center justify-center pa2">
|
<div className="h-100 flex flex-column items-center justify-center pa2">
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import React, { useState } from 'react';
|
|||||||
import DetailsLayout from '../../layouts/DetailsLayout';
|
import DetailsLayout from '../../layouts/DetailsLayout';
|
||||||
import BrowserFrame from '../../placeholders/BrowserFrame';
|
import BrowserFrame from '../../placeholders/BrowserFrame';
|
||||||
|
|
||||||
const Details = () => {
|
const Details: React.FC<{}> = () => {
|
||||||
const [visible, setVisible] = useState(false);
|
const [visible, setVisible] = useState(false);
|
||||||
const toggle = () => setVisible(v => !v);
|
const toggle = () => setVisible(v => !v);
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import React from 'react';
|
|||||||
import Frame from '../../placeholders/Frame';
|
import Frame from '../../placeholders/Frame';
|
||||||
import Line from '../../placeholders/Line';
|
import Line from '../../placeholders/Line';
|
||||||
|
|
||||||
const Cover = () => {
|
const Cover: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<Frame>
|
<Frame>
|
||||||
<div className="h-100 flex flex-column items-center justify-center">
|
<div className="h-100 flex flex-column items-center justify-center">
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import BrowserFrame from '../../placeholders/BrowserFrame';
|
|||||||
import Circle from '../../placeholders/Circle';
|
import Circle from '../../placeholders/Circle';
|
||||||
import Line from '../../placeholders/Line';
|
import Line from '../../placeholders/Line';
|
||||||
|
|
||||||
const Details = () => {
|
const Details: React.FC<{}> = () => {
|
||||||
return (
|
return (
|
||||||
<DetailsLayout title="Wizard">
|
<DetailsLayout title="Wizard">
|
||||||
<div className="ph4 pv5">
|
<div className="ph4 pv5">
|
||||||
|
|||||||
15
package-lock.json
generated
15
package-lock.json
generated
@@ -1977,6 +1977,21 @@
|
|||||||
"@types/node": "*"
|
"@types/node": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"@types/highlight.js": {
|
||||||
|
"version": "9.12.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/highlight.js/-/highlight.js-9.12.3.tgz",
|
||||||
|
"integrity": "sha512-pGF/zvYOACZ/gLGWdQH8zSwteQS1epp68yRcVLJMgUck/MjEn/FBYmPub9pXT8C1e4a8YZfHo1CKyV8q1vKUnQ==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"@types/highlightjs": {
|
||||||
|
"version": "9.12.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/highlightjs/-/highlightjs-9.12.0.tgz",
|
||||||
|
"integrity": "sha512-MmUcjkDtCBfx2BPeLLTtJ5mFmGgWk9nAgZmNesixaGHOr0tCecsTU2iUgYvhRsWJSts2WbcpAtVPuIzZ0ybJ1A==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@types/highlight.js": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
"@types/history": {
|
"@types/history": {
|
||||||
"version": "4.7.3",
|
"version": "4.7.3",
|
||||||
"resolved": "https://registry.npmjs.org/@types/history/-/history-4.7.3.tgz",
|
"resolved": "https://registry.npmjs.org/@types/history/-/history-4.7.3.tgz",
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
"@babel/preset-env": "^7.7.4",
|
"@babel/preset-env": "^7.7.4",
|
||||||
"@babel/preset-react": "^7.7.4",
|
"@babel/preset-react": "^7.7.4",
|
||||||
"@loadable/babel-plugin": "^5.10.3",
|
"@loadable/babel-plugin": "^5.10.3",
|
||||||
|
"@types/highlightjs": "^9.12.0",
|
||||||
"@types/loadable__component": "^5.10.0",
|
"@types/loadable__component": "^5.10.0",
|
||||||
"@types/react": "^16.9.13",
|
"@types/react": "^16.9.13",
|
||||||
"@types/react-dom": "^16.9.4",
|
"@types/react-dom": "^16.9.4",
|
||||||
|
|||||||
Reference in New Issue
Block a user