From 16baa822cc897fa8764c14861f7869f46ca50e30 Mon Sep 17 00:00:00 2001 From: Furkan Sahin Date: Mon, 30 May 2022 21:11:40 -0500 Subject: Compress results gif --- components/Box/index.tsx | 26 ++ components/BreadCrumbs/breadcrumbs.module.scss | 15 + components/BreadCrumbs/index.tsx | 56 ++++ components/Breadcrumbs/breadcrumbs.module.scss | 15 - components/Breadcrumbs/index.tsx | 50 --- components/Button/index.tsx | 39 +++ components/Code/index.tsx | 10 + components/Input/index.tsx | 22 ++ components/Link/index.tsx | 23 ++ components/Link/link.module.scss | 11 + components/List/index.tsx | 52 +++ components/List/list.module.scss | 41 +++ components/Markdown/index.tsx | 18 +- components/Markdown/markdown.module.scss | 111 ------- components/Markdown/markdown.scss | 418 +++++++++++++++++++++++++ components/PathCrumbs/index.tsx | 61 ++++ components/TextArea/index.tsx | 22 ++ components/Typ/index.tsx | 47 +++ components/Typ/typo.module.scss | 3 + components/ViewPort/index.tsx | 34 +- components/utils/inputElementStyle.tsx | 16 + components/utils/systemProps.tsx | 107 +++++++ 22 files changed, 998 insertions(+), 199 deletions(-) create mode 100644 components/Box/index.tsx create mode 100644 components/BreadCrumbs/breadcrumbs.module.scss create mode 100644 components/BreadCrumbs/index.tsx delete mode 100644 components/Breadcrumbs/breadcrumbs.module.scss delete mode 100644 components/Breadcrumbs/index.tsx create mode 100644 components/Button/index.tsx create mode 100644 components/Code/index.tsx create mode 100644 components/Input/index.tsx create mode 100644 components/Link/index.tsx create mode 100644 components/Link/link.module.scss create mode 100644 components/List/index.tsx create mode 100644 components/List/list.module.scss delete mode 100644 components/Markdown/markdown.module.scss create mode 100644 components/Markdown/markdown.scss create mode 100644 components/PathCrumbs/index.tsx create mode 100644 components/TextArea/index.tsx create mode 100644 components/Typ/index.tsx create mode 100644 components/Typ/typo.module.scss create mode 100644 components/utils/inputElementStyle.tsx create mode 100644 components/utils/systemProps.tsx (limited to 'components') diff --git a/components/Box/index.tsx b/components/Box/index.tsx new file mode 100644 index 0000000..f81fa5b --- /dev/null +++ b/components/Box/index.tsx @@ -0,0 +1,26 @@ +import { getSystemStyle, SystemProps } from '../utils/systemProps'; + +interface BoxProps extends SystemProps { + style?: React.CSSProperties; + children?: React.ReactNode; + el?: keyof React.ReactHTML; +}; + +const Box: React.FC = ({ el, style, children, ...props}) => { + const systemStyle = getSystemStyle(props, style); + + let Tag = el; + + if(!el) { + Tag = 'div' as keyof React.ReactHTML; + } + + return ( + // @ts-ignore + + { children } + + ); +}; + +export default Box; diff --git a/components/BreadCrumbs/breadcrumbs.module.scss b/components/BreadCrumbs/breadcrumbs.module.scss new file mode 100644 index 0000000..6facea4 --- /dev/null +++ b/components/BreadCrumbs/breadcrumbs.module.scss @@ -0,0 +1,15 @@ +.crumb { + font-size: 1.10rem; +} + +.divider { + font-size: 1.0rem; +} + +.crumb { + align-content: center; +} + +.divider { + margin: 0 0.3rem; +} diff --git a/components/BreadCrumbs/index.tsx b/components/BreadCrumbs/index.tsx new file mode 100644 index 0000000..98b20b4 --- /dev/null +++ b/components/BreadCrumbs/index.tsx @@ -0,0 +1,56 @@ +import React, { Children, FC } from "react"; +import Link from '../Link'; +import styles from './breadcrumbs.module.scss'; +import clsx from 'clsx'; + +export type BreadCrumbsProps = { + className?: string; + style?: object; + children: React.ReactNode; +}; + +const BreadCrumbs : FC = ({children, className, style, ...props}) => ( + + {Children.map(children, (child, index) => { + return ( + <> + { + index !== 0 ? ( + / + ) : undefined + } + {child} + + ); + })} + +); + +export type CrumbProps = { + children: React.ReactNode; +}; + +const Crumb : FC = ({children, ...props}) => ( + + {children} + +); + +export type LinkCrumbProps = { + href: string; + children: React.ReactNode; +} + +const LinkCrumb : FC = ({children, href, ...props}) => ( + + + {children} + + +); + +export { + Crumb, + BreadCrumbs, + LinkCrumb +}; diff --git a/components/Breadcrumbs/breadcrumbs.module.scss b/components/Breadcrumbs/breadcrumbs.module.scss deleted file mode 100644 index 6facea4..0000000 --- a/components/Breadcrumbs/breadcrumbs.module.scss +++ /dev/null @@ -1,15 +0,0 @@ -.crumb { - font-size: 1.10rem; -} - -.divider { - font-size: 1.0rem; -} - -.crumb { - align-content: center; -} - -.divider { - margin: 0 0.3rem; -} diff --git a/components/Breadcrumbs/index.tsx b/components/Breadcrumbs/index.tsx deleted file mode 100644 index c5a17b8..0000000 --- a/components/Breadcrumbs/index.tsx +++ /dev/null @@ -1,50 +0,0 @@ -import React, { Children, FC } from "react"; -import Link from "next/link"; -import styles from './breadcrumbs.module.scss'; -import clsx from 'clsx'; - -export type BreadcrumbsProps = { - className?: string; - style?: object; -}; - -const Breadcrumbs : FC = ({children, className, ...props}) => ( - - {Children.map(children, (child, index) => { - return ( - <> - { - index !== 0 ? ( - / - ) : undefined - } - {child} - - ); - })} - -); - -const Crumb : FC = ({children, ...props}) => ( - - {children} - -); - -export type LinkCrumbProps = { - href: string; -} - -const LinkCrumb : FC = ({children, href, ...props}) => ( - - - {children} - - -); - -export { - Crumb, - Breadcrumbs, - LinkCrumb -}; \ No newline at end of file diff --git a/components/Button/index.tsx b/components/Button/index.tsx new file mode 100644 index 0000000..9eb2e95 --- /dev/null +++ b/components/Button/index.tsx @@ -0,0 +1,39 @@ +import React, { TextareaHTMLAttributes } from 'react'; +import { getSystemStyle, SystemProps } from '../utils/systemProps'; + +interface ButtonProps + extends React.ButtonHTMLAttributes, + SystemProps +{ } + +const Button: React.FC = ({ style, ...props }) => { + style = { + margin: '0.25rem 0.125rem', + cursor: 'pointer', + padding: '0.375rem 0.75rem', + borderRadius: '0.25rem', + textAlign: 'center', + verticalAlign: 'middle', + display: 'inline-block', + userSelect: 'none', + + fontFamily: 'inherit', + fontSize: '.95rem', + lineHeight: '1.15', + + // Color + color: '#fff', + backgroundColor: '#1473ff', + border: '1px solid #1473ff', + boxSizing: 'border-box', + + transition: 'color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out', + ...style, + }; + + const systemStyle = getSystemStyle(props, style); + + return (