Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
b3127e2
docs(anchor): categorize under Typography
WesSouza Jul 30, 2022
c2fdbf1
chore(appbar): categorize under Environment
WesSouza Jul 31, 2022
4c8fc2c
docs(avatar): categorize under Other
WesSouza Jul 31, 2022
c6028f1
refactor(handle): categorize under Controls, rename Bar to Handle
WesSouza Jul 31, 2022
43fdc92
docs(button): categorize under Controls
WesSouza Jul 31, 2022
fb0007b
docs(checkbox): categorize under Controls
WesSouza Jul 31, 2022
0b492f4
docs(colorinput): categorize under Controls
WesSouza Jul 31, 2022
598ef72
docs(counter): categorize under Other
WesSouza Jul 31, 2022
3490280
refactor(separator): categorize under Layout, rename Divider to Separ…
WesSouza Aug 1, 2022
f8b0b08
refactor(scrollview): categorize under Layout, rename Cutout to Scrol…
WesSouza Jul 31, 2022
b408e1e
refactor(monitor): categorize under Other, rename Desktop to Monitor
WesSouza Jul 31, 2022
b3e5158
refactor(groupbox): categorize under Controls, rename Fieldset to Gro…
WesSouza Jul 31, 2022
b3afb1a
docs(hourglass): categorize under Other
WesSouza Jul 31, 2022
9b7afa1
refactor(menulist): categorize under Controls, rename List to MenuList
WesSouza Jul 31, 2022
ad639ed
docs(progressbar): categorize under Controls
WesSouza Jul 31, 2022
c5202e1
chore(loadingindicator): remove LoadingIndicator
WesSouza Aug 4, 2022
6ee09f1
refactor(numberinput): categorize under Controls, rename from NumberF…
WesSouza Jul 31, 2022
ed741a5
docs(tabs): categorize under Controls
WesSouza Jul 31, 2022
d8f307d
refactor(frame): categorize under Layout, rename Panel to Frame
WesSouza Jul 31, 2022
099ae3a
docs(radio): categorize under Controls
WesSouza Jul 31, 2022
b185b0c
docs(select): categorize under Controls
WesSouza Jul 31, 2022
0bddef0
docs(slider): categorize under Controls
WesSouza Jul 31, 2022
0b73769
docs(table): categorize under Controls
WesSouza Jul 31, 2022
f5cdf4a
refactor(textinput): categorize under Controls, rename TextField to T…
WesSouza Aug 1, 2022
367e04f
docs(tooltip): categorize under Controls
WesSouza Aug 1, 2022
5add98c
refactor(treeview): categorize under Controls, rename Tree to TreeView
WesSouza Aug 1, 2022
b3f0eca
docs(window): categorize under Environment
WesSouza Aug 1, 2022
c03db1c
chore(datepicker): add displayName to component
WesSouza Aug 1, 2022
e151203
refactor(common): move SwitchBase to common folder
WesSouza Aug 1, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Apply style reset, wrap your app with ThemeProvider with theme of your choice...
import React from 'react';
import { createGlobalStyle, ThemeProvider } from 'styled-components';

import { Divider, List, ListItem, styleReset } from 'react95';
import { MenuList, MenuListItem, Separator, styleReset } from 'react95';
// pick a theme of your choice
import original from 'react95/dist/themes/original';
// original Windows95 font (optionally)
Expand Down Expand Up @@ -72,12 +72,12 @@ const App = () => (
<div>
<GlobalStyles />
<ThemeProvider theme={original}>
<List>
<ListItem>🎤 Sing</ListItem>
<ListItem>💃🏻 Dance</ListItem>
<Divider />
<ListItem disabled>😴 Sleep</ListItem>
</List>
<MenuList>
<MenuListItem>🎤 Sing</MenuListItem>
<MenuListItem>💃🏻 Dance</MenuListItem>
<Separator />
<MenuListItem disabled>😴 Sleep</MenuListItem>
</MenuList>
</ThemeProvider>
</div>
);
Expand Down
14 changes: 7 additions & 7 deletions docs/Getting-Started.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ choice... and you are ready to go! 🚀

```jsx
import React from 'react';
import { Divider, List, ListItem, styleReset } from 'react95';
import { MenuList, MenuListItem, Separator, styleReset } from 'react95';
import { createGlobalStyle, ThemeProvider } from 'styled-components';

/* Pick a theme of your choice */
Expand Down Expand Up @@ -62,12 +62,12 @@ const App = () => (
<div>
<GlobalStyles />
<ThemeProvider theme={original}>
<List>
<ListItem>🎤 Sing</ListItem>
<ListItem>💃🏻 Dance</ListItem>
<Divider />
<ListItem disabled>😴 Sleep</ListItem>
</List>
<MenuList>
<MenuListItem>🎤 Sing</MenuListItem>
<MenuListItem>💃🏻 Dance</MenuListItem>
<Separator />
<MenuListItem disabled>😴 Sleep</MenuListItem>
</MenuList>
</ThemeProvider>
</div>
);
Expand Down
28 changes: 0 additions & 28 deletions src/Anchor/Anchor.mdx

This file was deleted.

8 changes: 3 additions & 5 deletions src/Anchor/Anchor.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
import { ComponentMeta } from '@storybook/react';
import React from 'react';
import { Anchor } from 'react95';
import styled from 'styled-components';

import { Anchor } from './Anchor';

const Wrapper = styled.div`
padding: 5rem;
background: ${({ theme }) => theme.material};
`;

export default {
title: 'Anchor',
title: 'Typography/Anchor',
component: Anchor,
decorators: [story => <Wrapper>{story()}</Wrapper>]
} as ComponentMeta<typeof Anchor>;

export function Default() {
return (
<h1>
Everybody likes
Everybody likes{' '}
<Anchor href='https://expensive.toys' target='_blank'>
{' '}
https://expensive.toys
</Anchor>
</h1>
Expand Down
31 changes: 16 additions & 15 deletions src/Anchor/Anchor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ import styled from 'styled-components';

import { CommonStyledProps } from '../types';

const StyledAnchor = styled.a`
type AnchorProps = {
children: React.ReactNode;
} & React.AnchorHTMLAttributes<HTMLAnchorElement> &
CommonStyledProps;

const StyledAnchor = styled.a<{ underline: boolean }>`
color: ${({ theme }) => theme.anchor};
font-size: inherit;
text-decoration: underline;
Expand All @@ -12,20 +17,16 @@ const StyledAnchor = styled.a`
}
`;

type AnchorProps = {
children: React.ReactNode;
} & React.AnchorHTMLAttributes<HTMLAnchorElement> &
CommonStyledProps;
const Anchor = forwardRef<HTMLAnchorElement, AnchorProps>(
({ children, ...otherProps }: AnchorProps, ref) => {
return (
<StyledAnchor ref={ref} {...otherProps}>
{children}
</StyledAnchor>
);
}
);

const Anchor = forwardRef<HTMLAnchorElement, AnchorProps>(function Anchor(
{ children, ...otherProps }: AnchorProps,
ref
) {
return (
<StyledAnchor ref={ref} {...otherProps}>
{children}
</StyledAnchor>
);
});
Anchor.displayName = 'Anchor';

export { Anchor, AnchorProps };
90 changes: 0 additions & 90 deletions src/AppBar/AppBar.mdx

This file was deleted.

30 changes: 15 additions & 15 deletions src/AppBar/AppBar.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import React, { useState } from 'react';
import {
AppBar,
Button,
Divider,
List,
ListItem,
TextField,
MenuList,
MenuListItem,
Separator,
TextInput,
Toolbar
} from 'react95';
import styled from 'styled-components';
Expand All @@ -18,7 +18,7 @@ const Wrapper = styled.div`
`;

export default {
title: 'AppBar',
title: 'Environment/AppBar',
component: AppBar,
decorators: [story => <Wrapper>{story()}</Wrapper>]
} as ComponentMeta<typeof AppBar>;
Expand All @@ -43,38 +43,38 @@ export function Default() {
Start
</Button>
{open && (
<List
<MenuList
style={{
position: 'absolute',
left: '0',
top: '100%'
}}
onClick={() => setOpen(false)}
>
<ListItem>
<MenuListItem>
<span role='img' aria-label='👨‍💻'>
👨‍💻
</span>
Profile
</ListItem>
<ListItem>
</MenuListItem>
<MenuListItem>
<span role='img' aria-label='📁'>
📁
</span>
My account
</ListItem>
<Divider />
<ListItem disabled>
</MenuListItem>
<Separator />
<MenuListItem disabled>
<span role='img' aria-label='🔙'>
🔙
</span>
Logout
</ListItem>
</List>
</MenuListItem>
</MenuList>
)}
</div>

<TextField placeholder='Search...' width={150} />
<TextInput placeholder='Search...' width={150} />
</Toolbar>
</AppBar>
);
Expand Down
24 changes: 13 additions & 11 deletions src/AppBar/AppBar.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React, { forwardRef } from 'react';
import styled from 'styled-components';
import { CommonStyledProps } from '../types';

import { createBorderStyles, createBoxStyles } from '../common';
import { CommonStyledProps } from '../types';

type AppBarProps = {
children: React.ReactNode;
Expand All @@ -22,15 +23,16 @@ const StyledAppBar = styled.header<AppBarProps>`
width: 100%;
`;

const AppBar = forwardRef<HTMLElement, AppBarProps>(function AppBar(
{ children, fixed = true, ...otherProps },
ref
) {
return (
<StyledAppBar fixed={fixed} ref={ref} {...otherProps}>
{children}
</StyledAppBar>
);
});
const AppBar = forwardRef<HTMLElement, AppBarProps>(
({ children, fixed = true, ...otherProps }, ref) => {
return (
<StyledAppBar fixed={fixed} ref={ref} {...otherProps}>
{children}
</StyledAppBar>
);
}
);

AppBar.displayName = 'AppBar';

export { AppBar, AppBarProps };
Loading