diff --git a/packages/lsd-react/src/components/CSSBaseline/CSSBaseline.tsx b/packages/lsd-react/src/components/CSSBaseline/CSSBaseline.tsx index 84421ae..20833cb 100644 --- a/packages/lsd-react/src/components/CSSBaseline/CSSBaseline.tsx +++ b/packages/lsd-react/src/components/CSSBaseline/CSSBaseline.tsx @@ -1,11 +1,12 @@ import { Global, SerializedStyles } from '@emotion/react' import React, { useMemo } from 'react' import { ButtonStyles } from '../Button/Button.styles' +import { LsdIconStyles } from '../Icons/LsdIcon/LsdIcon.styles' import { defaultThemes, Theme, withTheme } from '../Theme' import { TypographyStyles } from '../Typography/Typography.styles' const componentStyles: Array | SerializedStyles> = - [ButtonStyles, TypographyStyles] + [ButtonStyles, TypographyStyles, LsdIconStyles] export const CSSBaseline: React.FC<{ theme?: Theme }> = ({ theme = defaultThemes.light, diff --git a/packages/lsd-react/src/components/Icons/AddIcon/AddIcon.tsx b/packages/lsd-react/src/components/Icons/AddIcon/AddIcon.tsx new file mode 100644 index 0000000..2d0282b --- /dev/null +++ b/packages/lsd-react/src/components/Icons/AddIcon/AddIcon.tsx @@ -0,0 +1,17 @@ +import { LsdIcon } from '../LsdIcon' + +export const AddIcon = LsdIcon((props) => ( + + + +)) diff --git a/packages/lsd-react/src/components/Icons/AddIcon/index.ts b/packages/lsd-react/src/components/Icons/AddIcon/index.ts new file mode 100644 index 0000000..d62133a --- /dev/null +++ b/packages/lsd-react/src/components/Icons/AddIcon/index.ts @@ -0,0 +1 @@ +export * from './AddIcon' diff --git a/packages/lsd-react/src/components/Icons/ArrowDownIcon/ArrowDownIcon.tsx b/packages/lsd-react/src/components/Icons/ArrowDownIcon/ArrowDownIcon.tsx new file mode 100644 index 0000000..7ad38fc --- /dev/null +++ b/packages/lsd-react/src/components/Icons/ArrowDownIcon/ArrowDownIcon.tsx @@ -0,0 +1,22 @@ +import { LsdIcon } from '../LsdIcon' + +export const ArrowDownIcon = LsdIcon( + (props) => ( + + + + ), + { + filled: true, + }, +) diff --git a/packages/lsd-react/src/components/Icons/ArrowDownIcon/index.ts b/packages/lsd-react/src/components/Icons/ArrowDownIcon/index.ts new file mode 100644 index 0000000..462c44a --- /dev/null +++ b/packages/lsd-react/src/components/Icons/ArrowDownIcon/index.ts @@ -0,0 +1 @@ +export * from './ArrowDownIcon' diff --git a/packages/lsd-react/src/components/Icons/ArrowForwardIcon/ArrowForwardIcon.tsx b/packages/lsd-react/src/components/Icons/ArrowForwardIcon/ArrowForwardIcon.tsx new file mode 100644 index 0000000..6292880 --- /dev/null +++ b/packages/lsd-react/src/components/Icons/ArrowForwardIcon/ArrowForwardIcon.tsx @@ -0,0 +1,17 @@ +import { LsdIcon } from '../LsdIcon' + +export const ArrowForwardIcon = LsdIcon((props) => ( + + + +)) diff --git a/packages/lsd-react/src/components/Icons/ArrowForwardIcon/index.ts b/packages/lsd-react/src/components/Icons/ArrowForwardIcon/index.ts new file mode 100644 index 0000000..3ed1249 --- /dev/null +++ b/packages/lsd-react/src/components/Icons/ArrowForwardIcon/index.ts @@ -0,0 +1 @@ +export * from './ArrowForwardIcon' diff --git a/packages/lsd-react/src/components/Icons/ArrowUpIcon/ArrowUpIcon.tsx b/packages/lsd-react/src/components/Icons/ArrowUpIcon/ArrowUpIcon.tsx new file mode 100644 index 0000000..a36d196 --- /dev/null +++ b/packages/lsd-react/src/components/Icons/ArrowUpIcon/ArrowUpIcon.tsx @@ -0,0 +1,22 @@ +import { LsdIcon } from '../LsdIcon' + +export const ArrowUpIcon = LsdIcon( + (props) => ( + + + + ), + { + filled: true, + }, +) diff --git a/packages/lsd-react/src/components/Icons/ArrowUpIcon/index.ts b/packages/lsd-react/src/components/Icons/ArrowUpIcon/index.ts new file mode 100644 index 0000000..c20a747 --- /dev/null +++ b/packages/lsd-react/src/components/Icons/ArrowUpIcon/index.ts @@ -0,0 +1 @@ +export * from './ArrowUpIcon' diff --git a/packages/lsd-react/src/components/Icons/CheckIcon/CheckIcon.tsx b/packages/lsd-react/src/components/Icons/CheckIcon/CheckIcon.tsx new file mode 100644 index 0000000..d1a56a0 --- /dev/null +++ b/packages/lsd-react/src/components/Icons/CheckIcon/CheckIcon.tsx @@ -0,0 +1,17 @@ +import { LsdIcon } from '../LsdIcon' + +export const CheckIcon = LsdIcon((props) => ( + + + +)) diff --git a/packages/lsd-react/src/components/Icons/CheckIcon/index.ts b/packages/lsd-react/src/components/Icons/CheckIcon/index.ts new file mode 100644 index 0000000..d779150 --- /dev/null +++ b/packages/lsd-react/src/components/Icons/CheckIcon/index.ts @@ -0,0 +1 @@ +export * from './CheckIcon' diff --git a/packages/lsd-react/src/components/Icons/CheckboxFilledIcon/CheckboxFilledIcon.tsx b/packages/lsd-react/src/components/Icons/CheckboxFilledIcon/CheckboxFilledIcon.tsx new file mode 100644 index 0000000..f09e34c --- /dev/null +++ b/packages/lsd-react/src/components/Icons/CheckboxFilledIcon/CheckboxFilledIcon.tsx @@ -0,0 +1,24 @@ +import { LsdIcon } from '../LsdIcon' + +export const CheckboxFilledIcon = LsdIcon( + (props) => ( + + + + ), + { + filled: true, + }, +) diff --git a/packages/lsd-react/src/components/Icons/CheckboxFilledIcon/index.ts b/packages/lsd-react/src/components/Icons/CheckboxFilledIcon/index.ts new file mode 100644 index 0000000..0c3d5b6 --- /dev/null +++ b/packages/lsd-react/src/components/Icons/CheckboxFilledIcon/index.ts @@ -0,0 +1 @@ +export * from './CheckboxFilledIcon' diff --git a/packages/lsd-react/src/components/Icons/CheckboxIcon/CheckboxIcon.tsx b/packages/lsd-react/src/components/Icons/CheckboxIcon/CheckboxIcon.tsx new file mode 100644 index 0000000..e056a5a --- /dev/null +++ b/packages/lsd-react/src/components/Icons/CheckboxIcon/CheckboxIcon.tsx @@ -0,0 +1,22 @@ +import { LsdIcon } from '../LsdIcon' + +export const CheckboxIcon = LsdIcon( + (props) => ( + + + + ), + { + filled: true, + }, +) diff --git a/packages/lsd-react/src/components/Icons/CheckboxIcon/index.ts b/packages/lsd-react/src/components/Icons/CheckboxIcon/index.ts new file mode 100644 index 0000000..fe78e7f --- /dev/null +++ b/packages/lsd-react/src/components/Icons/CheckboxIcon/index.ts @@ -0,0 +1 @@ +export * from './CheckboxIcon' diff --git a/packages/lsd-react/src/components/Icons/CloseIcon/CloseIcon.tsx b/packages/lsd-react/src/components/Icons/CloseIcon/CloseIcon.tsx new file mode 100644 index 0000000..e251855 --- /dev/null +++ b/packages/lsd-react/src/components/Icons/CloseIcon/CloseIcon.tsx @@ -0,0 +1,17 @@ +import { LsdIcon } from '../LsdIcon' + +export const CloseIcon = LsdIcon((props) => ( + + + +)) diff --git a/packages/lsd-react/src/components/Icons/CloseIcon/index.ts b/packages/lsd-react/src/components/Icons/CloseIcon/index.ts new file mode 100644 index 0000000..c4f6c90 --- /dev/null +++ b/packages/lsd-react/src/components/Icons/CloseIcon/index.ts @@ -0,0 +1 @@ +export * from './CloseIcon' diff --git a/packages/lsd-react/src/components/Icons/ErrorIcon/ErrorIcon.tsx b/packages/lsd-react/src/components/Icons/ErrorIcon/ErrorIcon.tsx new file mode 100644 index 0000000..4690b43 --- /dev/null +++ b/packages/lsd-react/src/components/Icons/ErrorIcon/ErrorIcon.tsx @@ -0,0 +1,24 @@ +import { LsdIcon } from '../LsdIcon' + +export const ErrorIcon = LsdIcon( + (props) => ( + + + + ), + { + filled: true, + }, +) diff --git a/packages/lsd-react/src/components/Icons/ErrorIcon/index.ts b/packages/lsd-react/src/components/Icons/ErrorIcon/index.ts new file mode 100644 index 0000000..8dd0c34 --- /dev/null +++ b/packages/lsd-react/src/components/Icons/ErrorIcon/index.ts @@ -0,0 +1 @@ +export * from './ErrorIcon' diff --git a/packages/lsd-react/src/components/Icons/FolderIcon/FolderIcon.tsx b/packages/lsd-react/src/components/Icons/FolderIcon/FolderIcon.tsx new file mode 100644 index 0000000..6dbf638 --- /dev/null +++ b/packages/lsd-react/src/components/Icons/FolderIcon/FolderIcon.tsx @@ -0,0 +1,17 @@ +import { LsdIcon } from '../LsdIcon' + +export const FolderIcon = LsdIcon((props) => ( + + + +)) diff --git a/packages/lsd-react/src/components/Icons/FolderIcon/index.ts b/packages/lsd-react/src/components/Icons/FolderIcon/index.ts new file mode 100644 index 0000000..6ceaad1 --- /dev/null +++ b/packages/lsd-react/src/components/Icons/FolderIcon/index.ts @@ -0,0 +1 @@ +export * from './FolderIcon' diff --git a/packages/lsd-react/src/components/Icons/KeyboardReturnIcon/KeyboardReturnIcon.tsx b/packages/lsd-react/src/components/Icons/KeyboardReturnIcon/KeyboardReturnIcon.tsx new file mode 100644 index 0000000..702f4a1 --- /dev/null +++ b/packages/lsd-react/src/components/Icons/KeyboardReturnIcon/KeyboardReturnIcon.tsx @@ -0,0 +1,17 @@ +import { LsdIcon } from '../LsdIcon' + +export const KeyboardReturnIcon = LsdIcon((props) => ( + + + +)) diff --git a/packages/lsd-react/src/components/Icons/KeyboardReturnIcon/index.ts b/packages/lsd-react/src/components/Icons/KeyboardReturnIcon/index.ts new file mode 100644 index 0000000..f990f87 --- /dev/null +++ b/packages/lsd-react/src/components/Icons/KeyboardReturnIcon/index.ts @@ -0,0 +1 @@ +export * from './KeyboardReturnIcon' diff --git a/packages/lsd-react/src/components/Icons/LsdIcon/LsdIcon.classes.ts b/packages/lsd-react/src/components/Icons/LsdIcon/LsdIcon.classes.ts new file mode 100644 index 0000000..6b61c77 --- /dev/null +++ b/packages/lsd-react/src/components/Icons/LsdIcon/LsdIcon.classes.ts @@ -0,0 +1,8 @@ +export const lsdIconClasses = { + root: 'lsd-icon', + small: 'lsd-icon--small', + filled: 'lsd-icon--filled', + stroked: 'lsd-icon--stroked', + primary: 'lsd-icon--primary', + secondary: 'lsd-icon--secondary', +} diff --git a/packages/lsd-react/src/components/Icons/LsdIcon/LsdIcon.styles.ts b/packages/lsd-react/src/components/Icons/LsdIcon/LsdIcon.styles.ts new file mode 100644 index 0000000..2ccf1b3 --- /dev/null +++ b/packages/lsd-react/src/components/Icons/LsdIcon/LsdIcon.styles.ts @@ -0,0 +1,39 @@ +import { css } from '@emotion/react' +import { lsdIconClasses } from './LsdIcon.classes' + +export const LsdIconStyles = css` + .${lsdIconClasses.root} { + } + + .${lsdIconClasses.primary} { + &.${lsdIconClasses.filled} { + &, + * { + fill: rgb(var(--lsd-icon-primary)); + } + } + + $.${lsdIconClasses.stroked} { + &, + * { + fill: rgb(var(--lsd-icon-primary)); + } + } + } + + .${lsdIconClasses.secondary} { + &.${lsdIconClasses.filled} { + &, + * { + fill: rgb(var(--lsd-icon-secondary)); + } + } + + $.${lsdIconClasses.stroked} { + &, + * { + fill: rgb(var(--lsd-icon-secondary)); + } + } + } +` diff --git a/packages/lsd-react/src/components/Icons/LsdIcon/LsdIcon.tsx b/packages/lsd-react/src/components/Icons/LsdIcon/LsdIcon.tsx new file mode 100644 index 0000000..04fa70f --- /dev/null +++ b/packages/lsd-react/src/components/Icons/LsdIcon/LsdIcon.tsx @@ -0,0 +1,46 @@ +import clsx from 'clsx' +import React from 'react' +import { lsdIconClasses } from './LsdIcon.classes' + +export type LsdIconProps = React.SVGAttributes & { + size?: 'small' + color?: 'primary' | 'secondary' +} + +type LsdIconComponent = React.FC & { + classes: typeof lsdIconClasses +} + +export const LsdIcon = ( + Component: React.ComponentType>, + metadata?: { + filled?: boolean + stroked?: boolean + }, +): LsdIconComponent => { + const IconComponent: LsdIconComponent = ({ + color, + size = 'small', + className, + ...props + }) => { + return ( + + ) + } + + IconComponent.displayName = Component.displayName + IconComponent.classes = lsdIconClasses + + return IconComponent +} diff --git a/packages/lsd-react/src/components/Icons/LsdIcon/index.ts b/packages/lsd-react/src/components/Icons/LsdIcon/index.ts new file mode 100644 index 0000000..e65cfd8 --- /dev/null +++ b/packages/lsd-react/src/components/Icons/LsdIcon/index.ts @@ -0,0 +1 @@ +export * from './LsdIcon' diff --git a/packages/lsd-react/src/components/Icons/MenuIcon/MenuIcon.tsx b/packages/lsd-react/src/components/Icons/MenuIcon/MenuIcon.tsx new file mode 100644 index 0000000..129d302 --- /dev/null +++ b/packages/lsd-react/src/components/Icons/MenuIcon/MenuIcon.tsx @@ -0,0 +1,24 @@ +import { LsdIcon } from '../LsdIcon' + +export const MenuIcon = LsdIcon( + (props) => ( + + + + ), + { + filled: true, + }, +) diff --git a/packages/lsd-react/src/components/Icons/MenuIcon/index.ts b/packages/lsd-react/src/components/Icons/MenuIcon/index.ts new file mode 100644 index 0000000..0319bb4 --- /dev/null +++ b/packages/lsd-react/src/components/Icons/MenuIcon/index.ts @@ -0,0 +1 @@ +export * from './MenuIcon' diff --git a/packages/lsd-react/src/components/Icons/MoreIcon/MoreIcon.tsx b/packages/lsd-react/src/components/Icons/MoreIcon/MoreIcon.tsx new file mode 100644 index 0000000..efc56ea --- /dev/null +++ b/packages/lsd-react/src/components/Icons/MoreIcon/MoreIcon.tsx @@ -0,0 +1,19 @@ +import { LsdIcon } from '../LsdIcon' + +export const MoreIcon = LsdIcon((props) => ( + + + +)) diff --git a/packages/lsd-react/src/components/Icons/MoreIcon/index.ts b/packages/lsd-react/src/components/Icons/MoreIcon/index.ts new file mode 100644 index 0000000..c304821 --- /dev/null +++ b/packages/lsd-react/src/components/Icons/MoreIcon/index.ts @@ -0,0 +1 @@ +export * from './MoreIcon' diff --git a/packages/lsd-react/src/components/Icons/NavigateBeforeIcon/NavigateBeforeIcon.tsx b/packages/lsd-react/src/components/Icons/NavigateBeforeIcon/NavigateBeforeIcon.tsx new file mode 100644 index 0000000..62fc3cf --- /dev/null +++ b/packages/lsd-react/src/components/Icons/NavigateBeforeIcon/NavigateBeforeIcon.tsx @@ -0,0 +1,17 @@ +import { LsdIcon } from '../LsdIcon' + +export const NavigateBeforeIcon = LsdIcon((props) => ( + + + +)) diff --git a/packages/lsd-react/src/components/Icons/NavigateBeforeIcon/index.ts b/packages/lsd-react/src/components/Icons/NavigateBeforeIcon/index.ts new file mode 100644 index 0000000..6662488 --- /dev/null +++ b/packages/lsd-react/src/components/Icons/NavigateBeforeIcon/index.ts @@ -0,0 +1 @@ +export * from './NavigateBeforeIcon' diff --git a/packages/lsd-react/src/components/Icons/NavigateNextIcon/NavigateNextIcon.tsx b/packages/lsd-react/src/components/Icons/NavigateNextIcon/NavigateNextIcon.tsx new file mode 100644 index 0000000..c5cb19f --- /dev/null +++ b/packages/lsd-react/src/components/Icons/NavigateNextIcon/NavigateNextIcon.tsx @@ -0,0 +1,17 @@ +import { LsdIcon } from '../LsdIcon' + +export const NavigateNextIcon = LsdIcon((props) => ( + + + +)) diff --git a/packages/lsd-react/src/components/Icons/NavigateNextIcon/index.ts b/packages/lsd-react/src/components/Icons/NavigateNextIcon/index.ts new file mode 100644 index 0000000..17d193d --- /dev/null +++ b/packages/lsd-react/src/components/Icons/NavigateNextIcon/index.ts @@ -0,0 +1 @@ +export * from './NavigateNextIcon' diff --git a/packages/lsd-react/src/components/Icons/NewPageIcon/NewPageIcon.tsx b/packages/lsd-react/src/components/Icons/NewPageIcon/NewPageIcon.tsx new file mode 100644 index 0000000..e431e8b --- /dev/null +++ b/packages/lsd-react/src/components/Icons/NewPageIcon/NewPageIcon.tsx @@ -0,0 +1,19 @@ +import { LsdIcon } from '../LsdIcon' + +export const NewPageIcon = LsdIcon((props) => ( + + + +)) diff --git a/packages/lsd-react/src/components/Icons/NewPageIcon/index.ts b/packages/lsd-react/src/components/Icons/NewPageIcon/index.ts new file mode 100644 index 0000000..87719f9 --- /dev/null +++ b/packages/lsd-react/src/components/Icons/NewPageIcon/index.ts @@ -0,0 +1 @@ +export * from './NewPageIcon' diff --git a/packages/lsd-react/src/components/Icons/SearchIcon/SearchIcon.tsx b/packages/lsd-react/src/components/Icons/SearchIcon/SearchIcon.tsx new file mode 100644 index 0000000..e1db86c --- /dev/null +++ b/packages/lsd-react/src/components/Icons/SearchIcon/SearchIcon.tsx @@ -0,0 +1,19 @@ +import { LsdIcon } from '../LsdIcon' + +export const SearchIcon = LsdIcon((props) => ( + + + +)) diff --git a/packages/lsd-react/src/components/Icons/SearchIcon/index.ts b/packages/lsd-react/src/components/Icons/SearchIcon/index.ts new file mode 100644 index 0000000..e87db02 --- /dev/null +++ b/packages/lsd-react/src/components/Icons/SearchIcon/index.ts @@ -0,0 +1 @@ +export * from './SearchIcon' diff --git a/packages/lsd-react/src/components/Icons/index.ts b/packages/lsd-react/src/components/Icons/index.ts new file mode 100644 index 0000000..d046975 --- /dev/null +++ b/packages/lsd-react/src/components/Icons/index.ts @@ -0,0 +1,18 @@ +export * from './AddIcon' +export * from './ArrowDownIcon' +export * from './ArrowForwardIcon' +export * from './ArrowUpIcon' +export * from './CheckboxFilledIcon' +export * from './CheckboxIcon' +export * from './CheckIcon' +export * from './CloseIcon' +export * from './ErrorIcon' +export * from './FolderIcon' +export * from './KeyboardReturnIcon' +export * from './LsdIcon' +export * from './MenuIcon' +export * from './MoreIcon' +export * from './NavigateBeforeIcon' +export * from './NavigateNextIcon' +export * from './NewPageIcon' +export * from './SearchIcon' diff --git a/packages/lsd-react/src/index.ts b/packages/lsd-react/src/index.ts index f7691c0..ce6362a 100644 --- a/packages/lsd-react/src/index.ts +++ b/packages/lsd-react/src/index.ts @@ -1,2 +1,3 @@ export * from './components/Button' +export * from './components/Icons' export * from './components/Theme'