GithubHelp home page GithubHelp logo

arturbien / react95 Goto Github PK

View Code? Open in Web Editor NEW
6.4K 29.0 178.0 66.12 MB

πŸŒˆπŸ•Ή Windows 95 style UI component library for React

Home Page: https://react95.io

License: MIT License

JavaScript 1.06% TypeScript 98.88% CSS 0.06%
component-library react reactjs windows95 styled-components ui vaporwave components design-system ui-kit

react95's Introduction

React95

NPM release status React95 version React95 license React95 license

Refreshed Windows95 UI components for your modern React apps.
Built with styled-components πŸ’…

hero

Support

Getting Started

First, install component library and styled-components in your project directory:

# yarn
$ yarn add react95 styled-components

# npm
$ npm install react95 styled-components

Apply style reset, wrap your app with ThemeProvider with theme of your choice... and you are ready to go! πŸš€

import React from 'react';
import { createGlobalStyle, ThemeProvider } from 'styled-components';

import { MenuList, MenuListItem, Separator, styleReset } from 'react95';
// pick a theme of your choice
import original from 'react95/dist/themes/original';
// original Windows95 font (optionally)
import ms_sans_serif from 'react95/dist/fonts/ms_sans_serif.woff2';
import ms_sans_serif_bold from 'react95/dist/fonts/ms_sans_serif_bold.woff2';

const GlobalStyles = createGlobalStyle`
  ${styleReset}
  @font-face {
    font-family: 'ms_sans_serif';
    src: url('${ms_sans_serif}') format('woff2');
    font-weight: 400;
    font-style: normal
  }
  @font-face {
    font-family: 'ms_sans_serif';
    src: url('${ms_sans_serif_bold}') format('woff2');
    font-weight: bold;
    font-style: normal
  }
  body {
    font-family: 'ms_sans_serif';
  }
`;

const App = () => (
  <div>
    <GlobalStyles />
    <ThemeProvider theme={original}>
      <MenuList>
        <MenuListItem>🎀 Sing</MenuListItem>
        <MenuListItem>πŸ’ƒπŸ» Dance</MenuListItem>
        <Separator />
        <MenuListItem disabled>😴 Sleep</MenuListItem>
      </MenuList>
    </ThemeProvider>
  </div>
);

export default App;

Submit your project

Apps built with React95 will be featured on the official React95 website 🀟🏻

Contributing

Any help from UI / UX designers would be EXTREMELY appreciated. The challenge is to come up with new component designs / layouts that are broadly used in modern UIs, that weren't present back in 95.

If you want to help with the project, feel free to open pull requests and submit issues or component proposals. Let's bring this UI back to life β™₯️

react95's People

Contributors

acimanx avatar afzalzbr avatar alpavlove avatar arturbien avatar branopuzder avatar christoshrousis avatar davidgtu avatar dependabot[bot] avatar ermakoy avatar fsilvaco avatar jdhartley avatar luizbaldi avatar maxquinn avatar mrpanquecas avatar panmona avatar shawnbot avatar sheminusminus avatar tpenguinltg avatar wanderrful avatar wessouza avatar xsu1010 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react95's Issues

Avatar

I'd be happy to work on the Avatar component but would need some visual guidance. Is there anything to reference?

About sharing knowledge

What is the problem with Chinese README's

Firstly, we congratulate you for getting so much star by sharing this repository with humanity.

But it is very disappointing for non-Chinese speakers when one couldn't understand what a trending repository is about.

When we see such a repo on trending, our minds are blurring like Gollum's.

Gollum Image

There is a way you can help to solve this disappointment which I believe is experienced by many people who want to know more about your valuable work and appreciate it.

What we want:

  • Please add English translation of your README so you are sharing your work and knowledge with more people.

How this will help you:

  • More feedback to fix and improve your project.
  • New ideas about your project.
  • Greater fame.
  • SungerBob Image

β€œSharing knowledge is the most fundamental act of friendship. Because it is a way you can give something without loosing something.”

β€” Richard Stallman

Thank you!

This issue created by us/english-please script. Please report on any error. Thank you!

Allow disabling shadow in all components

Currently the 'shadow' prop had to be set to 'false' in order to turn off the shadow in individual component. Find a way to opt out of using shadow in all components.

Icons

Is there icon pack with original icons?

range slider component

Thanks for creating this great project!

It would be nice to have the slider/range selector from windows 95. There are a couple of variants at least, it seems. So nice to have as props would be:

  • barHeight - by default this is 0 (so we just see the border) but in the media player for example it's nonzero.
  • min - the minimum numerical value
  • max - the maximum numerical value
  • step - the numerical step interval
  • ticks - by default displays unlabeled ticks at reasonable intervals but we can pass an array of objects with the form: { value, label } to create something like we see in the media player.

Screenshot from 2019-04-19 17-22-56
Screenshot from 2019-04-19 15-24-27

Rewrite Select component

Currently the <Select /> component keeps its own state under the hood, so its not possible to control it from the outside. (We need to be able to use the component both as a controlled or uncontrolled input)

Also the <Select /> component accepts selectedIndex prop as an indicator which option out of options array is selected and this approach is not very intuitive. Instead it would be better to make similar inteface to the one in Material-UI Select.

  • component should accept value prop for controlled input, or defaultValue prop for uncontrolled input (get rid of selectedIndex prop)
  • rename items prop to options
  • enable keyboard controls for the component
  • allow user to use native select (just like in MUI's Native Select)
  • close dropdown on blur (?)
  • allow users to disable select input:
    image

Cannot import Menu component

The Start menu show in story components is not exportable, so I cant use as the example shown in StoryBook

Doing this way:

import {Menu} from 'react95'

Any suggestion?

Focus management / accessibility

Currently there is no indication which input element has focus on. We need to add dashed border/outline around <Radio />, <Checkbox /> components like so:

Screenshot 2020-01-21 at 23 01 03

For <Select /> component the focus is indicated by highlighting currently selected option:
Screenshot 2020-01-21 at 23 09 30

<Button /> :
Screenshot 2020-01-21 at 23 12 52

<Slider /> :
Screenshot 2020-01-21 at 23 16 47

<Tabs />, <Tab /> :
Screenshot 2020-01-21 at 23 20 51

yarn or npm

There is both a yarn.lock and a package-lock.json. The two don't play well together out of experience. Should we use yarn or npm to contribute to this project?

Prettier configuration

Thinking about code standardization to provide the best developer experience for everybody working on the source code, I was thinking that we could add Prettier to the project, we can use it to enforce the same code pattern across all files.

Thoughts on Prettier?

Allow "100%" width prop in Progress component

Right now <Progress /> component only accepts number as a width prop (which is then converted to px). Width specified in percent should also be allowed. Progress component should be of 100% width by default.

ESLint configuration

That'd be good to have ESLint configured for the project, so we can have a pattern for the codebase and help more new contributors.

Any thoughts on famous JavaScript/React style guides to be followed? (like Airbnb or Standard)

Missing 2px margin right on WindowContent

WindowHeader has a 2px right margin and for consistency it seems like WindowContent should have the same right margin. It looks a bit funny without. (I'm negating padding for my use case since the original player doesn't have any padding).

Without the 2px content margin:

Screenshot from 2019-04-21 01-23-40

With the 2px content margin added:

Screenshot from 2019-04-21 01-23-32

Wrong text color in disabled input fields on iOS

On iOS disabled input fields (TextArea, TextField, NumberField) have wrong text styling:

example

It should look like this:

example2

Adding -webkit-text-fill-color CSS property in disabled component should fix this

TextArea function "onChange" not triggered

The onChange function is not working with TextArea component. Changing to a normal input or Reac95 TextField component as ABA Testing works fine.

Code below:

import React, { useState } from "react";
import { TextArea, Button } from "react95";
import { newMessage } from "../state/action";
import styled from "styled-components";

const ButtonBar = styled.div`
  margin: 10px 0;
`;

function PublishMessage(props) {
  const { dispatch } = props;
  const [text, setText] = useState("");

  const updateText = event => {
    console.log(event.target.value); // **** ISSUE: Never Triggered ****
    setText(event.target.value);
  };

  const publishMessage = () => {
    dispatch(newMessage(text));
  };

  const handleKeyPress = event => {
    if (event.key === "Enter") {
      publishMessage();
    }
  };
  return (
    <div>
      <h3>got something to say? </h3>
      <div
        style={{
          padding: "5px 0",
          background: "#ced0cf"
        }}
      >
        <TextArea // ****changing this to "input" or "TextField" proof that component is ok ****
          value={text}
          onChange={updateText}
          placeholder="Type in here.."
          onKeyPress={handleKeyPress}
        />
        <ButtonBar>
          <Button onClick={publishMessage}>Publish it!</Button>
        </ButtonBar>
      </div>
    </div>
  );
}

export default PublishMessage;

Testing

Can help with this if you lay out some bullet points of what you're looking for.

update to storybook v5

I would recommend to update the Storybook package to its version 5. I can help with that if you want.

Create flat variants of components

Add flat variants to some of the components. This may be useful for example when we would want to use checkboxes inside a Table cell or inside Select option

9

flat

TextArea and TextInput seems not be controlled by "value" prop

After submitting the form and try to reset the value, the input field is not updated to an empty string.

When the Publish it! button is clicked the following function is called:

const publishMessage = () => {
    addMessage(text).then(() => {
      dispatch(newMessage(text))
      setText(' ') // this does not clear the input
    });
  };

The state is updated to empty string, however it does not update the text area to empty string, which remains with the old values.

The function is triggered by the following code:

  <div>
      <h3>got something to say? </h3>
      <div
        style={{
          padding: "5px 0",
          background: "#ced0cf"
        }}
      >
        <TextArea
          value={text}
          onChange={e => updateText(e)}
          placeholder="Type in here.."
          onKeyPress={handleKeyPress}
        />
        <ButtonBar>
          <Button onClick={publishMessage}>Publish it!</Button>
        </ButtonBar>
      </div>
    </div>

Using normal html input field it works.

Create SelectBox component

SelectBox is basically a Select component, but instead of a dropdown, there is a scrollable box of specified height containing all possible options.

Screenshot 2020-03-29 at 19 41 06

List z-index not working

Capture

As you can see in the image, the list items are under the window component. I've tried setting the zIndex of the window to 1 and the List to 2 but nothing worked. Is there a way to achieve this?

Also, is it possible to move the AppBar at the bottom of the page?

Thank you for this well made component.

Vertical divider would be nice

As seen here:

Screenshot from 2019-04-21 16-59-18

I implemented something based on the existing divider component here:

const React = require('react');
const propTypes = require('prop-types');
const { themes } = require('react95');

const style = {
  width: 0,
  borderRight: `2px solid ${themes.default.borderLightest}`,
  borderLeft: `2px solid ${themes.default.borderDark}`,
  margin: 0,
  alignSelf: 'stretch',
  marginTop: -4,
  marginBottom: -4
};

const VerticalDivider = () => {
  return <div style={style} />;
};

module.exports = VerticalDivider;

The negative top/bottom margins are to account for the padding in the Toolbar component.

This is what it looks like:

Screenshot from 2019-04-21 17-31-12

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.