diff --git a/src/components/FloatingActionButton.tsx b/src/components/FloatingActionButton.tsx new file mode 100644 index 0000000..53e1767 --- /dev/null +++ b/src/components/FloatingActionButton.tsx @@ -0,0 +1,68 @@ +import React from 'react'; +import { createComponent } from '@lit/react'; +import { MdFab as MdFabWebComponent } from '@material/web/fab/fab'; +import { MdBrandedFab as MdBrandedFabWebComponent } from '@material/web/fab/branded-fab'; + +const MdFab = createComponent({ + react: React, + tagName: 'md-fab', + elementClass: MdFabWebComponent, +}); + +type FABProps = { + children: React.ReactNode; + className?: string; + id?: string; + ariaLabel?: string; + variant?: 'surface' | 'primary' | 'secondary' | 'tertiary'; + size?: 'medium' | 'large'; + label?: string; + lowered?: boolean; +} + +export const FAB = (props: FABProps) => { + const { children, className, ...rest } = props; + + const variant = props.variant || 'surface'; + const size = props.size || 'medium'; + const label = props.label || ''; + const lowered = props.lowered || false; + + return ( + + {children} + + ) +} + +const MdBrandedFab = createComponent({ + react: React, + tagName: 'md-branded-fab', + elementClass: MdBrandedFabWebComponent, +}); + +type BrandedFABProps = { + children: React.ReactNode; + className?: string; + id?: string; + ariaLabel?: string; + variant?: 'surface' | 'primary' | 'secondary' | 'tertiary'; + size?: 'medium' | 'large'; + label?: string; + lowered?: boolean; +} + +export const BrandedFAB = (props: BrandedFABProps) => { + const { children, className, ...rest } = props; + + const variant = props.variant || 'surface'; + const size = props.size || 'medium'; + const label = props.label || ''; + const lowered = props.lowered || false; + + return ( + + {children} + + ) +} diff --git a/src/components/List.tsx b/src/components/List.tsx new file mode 100644 index 0000000..4ea9360 --- /dev/null +++ b/src/components/List.tsx @@ -0,0 +1,53 @@ +import React from 'react'; +import { createComponent } from '@lit/react'; +import { MdList as MdListWebComponent } from '@material/web/list/list'; +import { MdListItem as MdListItemWebComponent } from '@material/web/list/list-item'; + +const MdList = createComponent({ + react: React, + tagName: 'md-list', + elementClass: MdListWebComponent, +}); + +type ListProps = { + children: React.ReactNode; +} + +export const List = (props: ListProps) => { + const { children, ...rest } = props; + + return ( + + {children} + + ); +} + +const MdListItem = createComponent({ + react: React, + tagName: 'md-list-item', + elementClass: MdListItemWebComponent, +}); + +type ListItemProps = { + children: React.ReactNode; + className?: string; + id?: string; + ariaLabel?: string; + disabled?: boolean; + type?: 'text' | 'link' | 'button'; + href?: string; + target?: '_blank' | '_self' | '_parent' | '_top'; +} + +export const ListItem = (props: ListItemProps) => { + const { children, ...rest } = props; + + const type = props.type || 'text'; + + return ( + + {children} + + ) +} \ No newline at end of file diff --git a/src/hooks/useTheme.tsx b/src/hooks/useTheme.tsx index 1532e27..f82b742 100644 --- a/src/hooks/useTheme.tsx +++ b/src/hooks/useTheme.tsx @@ -3,6 +3,8 @@ import React from "react"; import { createContext, useContext } from "react"; import { useScheme } from "./useScheme"; +import '../../fonts/roboto.css'; + const ThemeContext = createContext(undefined); export function ThemeProvider({ children, theme, scheme }: { children: React.ReactNode, theme: Theme, scheme: 'dark' | 'light' }) { diff --git a/src/index.tsx b/src/index.tsx index 3254c17..97121f9 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -11,6 +11,10 @@ import { FormLabel } from "./components/Forms"; import { Paper } from "./components/Paper"; import { AssistChip, InputChip } from "./components/Chip"; import { Dialog, DialogActions, DialogContent, DialogTitle } from "./components/Dialog"; +import { IconButton } from "./components/IconButton"; +import { BrandedFAB } from "./components/FloatingActionButton"; +import { List, ListItem } from "./components/List"; + const mountApp = async () => { const rootContainer = document.getElementById('root'); @@ -24,28 +28,17 @@ const mountApp = async () => { const root = createRoot(rootContainer); root.render( - Hello - - - - Hello - - - Hello - - - Hello - - - - - - Hello - Hello - - - - + + + Item 1 + + + Item 2 + + + Item 3 + + ); };