Git Product home page Git Product logo

vuestorefront / storefront-ui Goto Github PK

View Code? Open in Web Editor NEW
2.3K 69.0 454.0 94.25 MB

A frontend library for Vue and React that helps developers quickly build fast, accessible, and beautiful storefronts. Made with πŸ’š by Vue Storefront team and contributors.

Home Page: https://storefrontui.io

License: MIT License

JavaScript 1.33% HTML 0.20% Vue 37.81% SCSS 0.47% Dockerfile 0.13% Shell 0.02% EJS 0.42% TypeScript 59.54% CSS 0.08%
vue ecommerce ui-kit ui pwa vuejs vuejs2 ui-components vue-components javascript

storefront-ui's Introduction

Storefront UI

Framework-agnostic UI library and Design System for eCommerce based on TailwindCSS.

Chat with us on Discord npm Commitizen friendly License PRs Welcome


Vue Installation React Installation

What problems does Storefront UI solve?

Like any UI Library / Design System the main goal of Storefront UI is to accelerate the development process by providing an opinionated set of premade components, utilities and patterns.

There is a lot of the things you have to take care of to build good user interfaces:

πŸ”Ή Developer/Designer workflow - Storefront UI comes out of the box with Figma files - a pixel-perfect representation of your code that your design and engineering teams needs to stay aligned.

πŸ”Ή Performance - Poorly written and overcomplicated components are often the performance bottleneck ruining the experience of your users. All standard eCommerce pages that we've built with Storefront UI hit 95-100 on Lighthouse! (mobile performance measured using PSI)

πŸ”Ή Accessibility - Web accessibility is more than an ethical requirement in the United States: it’s also legally mandated and you risk fines if the justice department determines your website is non-compliant. At the same time building accessible components takes a lot of time and requires specific domain knowledge. Storefront UI components are WCAG AA compliant out of the box!

But let's be honest, almost all established UI libraries can solve that. Here's what's Storefront UI is best at::

πŸ”Έ Customization - Most of the UI libraries out there fail when components need to be heavily customized. You suddenly find yourself working against your library just to achieve the desired look. Storefront UI is built for complex cases. We ship a set of small and flexible base components like Button, Checkbox or Modal that can be used to build more complex ones. We also deliver more complex examples (aka Blocks) like ProductCard or a different checkout steps as copy-pasteable code using Storefront UI components and Tailwind utilities.

In addition, Storefront UI fits perfectly complex UI setups where one library is inherited and customized by multiple projects differing visually.

πŸ”Έ Scaling - The more your application grows the less maintainable your UI becomes. By providing the right building blocks and using Tailwind CSS we made sure that your UI will be easy to maintain and won't negatively impact your performance even on a large scale.

πŸ”Έ Focus on eCommerce - Storefront UI comes out of the box with components specific to eCommerce like ProductCard, QuantitySelector and even checkout components

What comes out of the box? 🎁

  • Base Components - beautiful, fast and fully accessible components like Input Checkbox Button that you can use to quickly build more complex structures
  • Blocks - complex, copy-pasteable examples like ProductCard or checkout steps.
  • Composables like useDropdown that abstract complex UI interactions
  • Tailwind preset that maps tailwind config to CSS variables and provides few SFUI-specific defaults
  • Typography package simplifying usage of 3rd party fonts
  • Figma file with pixel-perfect representation of SFUI components based on tailwind properties

Contributing

We believe that the best software is made when a lot of people with different views collaborate on it. We welcome all contributions to Storefront UI.

You can become contributor not only by writing code:

  • Contribute to documentation
  • Write an article or tutorial
  • Help others on our Discord server
  • Report a bug
  • Do a talk about Storefront UI at your local meetup

We are grateful for all kind of contributions. If you don't know where to start check out our contribution guide or ask for help on Discord

How to run project locally

In the root directory of this project run yarn command to install all needed dependencies. After dependencies has been installed run yarn dev command to run this project. Now both (Nuxt preview for Vue and Next preview for React) projects are running locally and you can start working on them. If you need to run only one of them, you need to run a desired preview from its directory, so you need to go for Vue: /apps/preview/nuxt and for React: /apps/preview/next.

NOTE: Subdependencies have to be build, such as

  • @storefront-ui/shared located in /packages/sfui/shared
  • @storefront-ui/tw-plugin-peer-next located in /packages/sfui/tw-plugin-peer-next
  • @storefront-ui/typography located in /packages/sfui/typography

Knowing this we recommend using yarn dev in root directory.

Links

storefront-ui's People

Contributors

adampawlinski avatar aniamusial avatar baroshem avatar dependabot[bot] avatar dkacper avatar donnicojs avatar dz3n avatar eduarddopler avatar filrak avatar frsgit avatar github-actions[bot] avatar juanfrantomaswac avatar justyna-13 avatar leomp12 avatar lorenaramonda avatar martaradziszewska avatar mattmaribojoc avatar mayashavin avatar michal-dziedzinski avatar patzick avatar peoray avatar pspaczek avatar rakowskiprzemyslaw avatar renovate[bot] avatar runyasak avatar shatanov avatar szymon-dziewonski avatar talissonf avatar thiagoabreudev avatar ymaheshwari1 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  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

storefront-ui's Issues

[ Storybook ] Adjust Storybook stories to common format

Every available component stories should be adjusted to common format. If they don't exist they should be created.

The format is described here

In short words we should have at least those stories for every component:

  • one with props (as knobs)
  • one or more for different usage examples
  • one for slots
  • one for CSS modifiers

[ Mobile / Desktop ] Loading component and directive

I think we should implement SfLoading component to handle loading spinners inside other components, but we may also append a spinner on body and create a v-loading directive to toggle this global loading spinner.
Not a necessity, but I believe it would be comfortable to use in this way, waiting for opinions...

[FEAT] MegaMenu component

Create mega menu component (desktop only)
This component is only a wrapper for other components so the task does not involve creating the components inside of it.

image

Proposed API:

  • just a default slot

Visibility properties shouldn't be a part of the component itself so the task is to make static MegaMenu component without any content, just a slot + write basic unit tests:

  • if it renders
  • if the slot content is rendered.

Designs: https://www.figma.com/file/hrwE3VsMBHgdJoS86rVr4W/Desktop-%26-Mobile-Vue-Storefront?node-id=99%3A0

[Desktop / Mobile ] Implement SfTabNavigation

Desktop
image
image
Mobile
There is no strict design for mobile view so please copy font styles from Steps (can eb found on mobile checkout)
image

Can be found on designs on product page (desktop)


Proposed API to implement

Second one treats nav as a totally separate component

<SfTabNavigation :nav="navItems" current="currentTab" @change="newVal => currentTab = newVal">
  • slot item for nav item

navItem format

{ id: string, label: string }

[ Desktop / Mobile ] Implement SfInputNumber

Figma designs on product page.

Imho it should have 2 chevrons (up and down), for best usability, even though it was otherwise suggested in Figma.
I think it's important that the native <input> have type="tel" to open the number keyboard by default on mobile (good practice) and skip design problems (varying by browser) created by type="number".


Proposed API

Props

  • step - incremental step, 1 by default
  • value / v-model - input value, 0 by default
  • min - min value
  • max - max value
  • placeholder - placeholder for the native input element
  • precision - decimal precision, 0 by default (for integers)
  • name - native input name

When max is 0, native input should be disabled.

Slots

  • default - slot with input element, should bind the value
  • up - arrow (control) up
  • down - arrow (control) down

Events

  • change
  • focus
  • blur

Methods

  • focus
  • blur
  • select

Events and methods same as in native input.

[ Mobile / Desktop ] Implement SfSidebar

Mobile
image
Desktop
image

The task involves creating just a sidebar with an empty default slot
CSS modifiers:
--left or --right depending which one you will choose as default (i suggest right).

Can be found on designs in various boards like productFiltering (desktop) and iPhone/MoreActions (mobile)

License?

Hello,
I'm really interested on this project and also want to contribute here, but first I have to know if you are planning to release it open sourced (as Vue Storefront is), are you?
Thanks!

[ Mobile / Desktop ] implement SfCircleButton

image

Create rounded button component. Please make sure you implement hover state properly too.

Proposed API

  • default slot for content
  • css modifiers --primary --secondary for colors

Please mind that it's just a proposal. We're open to discussion regarding component API.

Can be found in designs under "style guide" table.

[ Mobile / Desktop ] Implement SfCheckbox

image
image

Use alpaca component as a base (already included as a dependency)
https://alpaca-storybook-ebth12xpx.now.sh/components/?path=/story/elements-form-checkbox--default. (https://github.com/SnowdogApps/alpaca-storybook/tree/develop/components/src/02-elements/checkbox)

You can safely import JS part and just override HTML SCSS to match our design

Read more in Working with Alpaca

It should incude

  • prop label to fill default slot with label
  • default slot with content of "label" slot that can be used to add custom markup

Can be found on designs on IPhoneChackoutPersonal Details and IPhone/Checkout/Review Order (checked)

[ Mobile / Desktop ] Implement SfBadge

Figma designs on Mobile Guide > Urgency Elements.

Proposed API

  • default slot (for content);
  • CSS modifiers --info, --alert and --warning, defaults to primary color (the green);

No props, no methods, no events (pretty simple πŸ˜„ ).
Take a look on SfAlert as reference.

Please mind that it's just a proposal. We're open to discussion regarding component API.

[ Mobile / Desktop ] Implement SfAccordion

Mobile:iPhone/More actions THE ARROW SHOULD HAVE TOP/BOTTOM DIRECTION DEPENDING OIN STATE
image
Desktop (category page)
image

In both cases it's just a toggle using fade and slide down animation.
It should contain:

  • Title prop
  • Content slot
  • Title slot
    can be found on designs

[ Mobile / Desktop ] Implement SfGallery

Desktop:
image
Mobile:
image

Implement mobile and desktop gallery component.
On mobile it should support touch events and be swappable.

Proposed API:

  • images - (prop )Array of objects containing main image and optionally a thumbnail
  • active (prop) - id of active image

Optional (if you don't handle it we can make separate issues)

  • if there is a separate image for thumbnail main image should be loaded lazily
  • add autoScroll prop and functionality

Please mind that it's just a proposal. We're open to discussion regarding component API.

Can be found on designs on product pages.

Using inline SVGs instead of img tags for icons

First of all: We are currently evaluating VS for new projects and I have clicked through here a little bit. I think storefront ui is a very solid foundation, especially for theme 2.0. I would have some thoughts about that, i hope it's ok.

I've seen that currently simple img tags are used for icons and want to ask if there have ever been any thoughts about using inline SVG's. For example with the help of the vue-svg-loader

I have already used it in some projects and could also help with the implementation.

I see limitations by using img tags for icons. If you use the SVG's directly you can style them e.g. via css. There is a lot more scope for customization (Custom colors, Hover styles).

I am looking forward to feedback and your thoughts!

[ Mobile / Desktop ] Implement SfRadio component

image
image

Component should be based on alpaca's one (which is in our dependencys) but with applied changes to match our designs.
https://alpaca-storybook.now.sh/

Read more in Working with Alpaca

Once you adjust the design the current alpaka api should remain as simpel customization option (pass everything through :options) but it also should expose slots-based configuration

<!-- Prop-based with our html -->
<SfRadio :options="options" />
<!-- With custom template, scoped slot -->
<SfRadio :options="options">
  <template #label="option"> Option: {{ option.label }} </template>
  <template #description="option"> Option: {{ option.description }} </template>
</SfRadio>

By default we are not implementing the bold part

Here reference to docs to understand it better https://vuejs.org/v2/guide/components-slots.html#Other-Examples

Can be found on designs under IPhone/Checkout boards

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.