Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Sistent] Missing instructions related to the NPM packages and their use #5486

Open
leecalcote opened this issue Apr 12, 2024 · 18 comments · May be fixed by #5549
Open

[Sistent] Missing instructions related to the NPM packages and their use #5486

leecalcote opened this issue Apr 12, 2024 · 18 comments · May be fixed by #5549
Assignees
Labels
area/projects An issue relating to Layer5 initiatives (projects) framework/react React related good first issue Good for newcomers help wanted Extra attention is needed kind/chore Necessary task

Comments

@leecalcote
Copy link
Member

Current Behavior

Consumers (users) of the Sistent components are not offered instructions on where the NPM packages are or how to incorporate their use.

https://layer5.io/projects/sistent/about


Contributor Resources and Handbook

The layer5.io website uses Gatsby, React, and GitHub Pages. Site content is found under the master branch.

Join the Layer5 Community by submitting your community member form.

@leecalcote leecalcote added help wanted Extra attention is needed good first issue Good for newcomers kind/chore Necessary task area/projects An issue relating to Layer5 initiatives (projects) framework/react React related labels Apr 12, 2024
@KunyueXing
Copy link

Hi, I'm interested in this issue. Could you please assign this to me?

@leecalcote
Copy link
Member Author

Excellent, @KunyueXing. Sounds great.

Here is a recent description and details that will help - https://discuss.layer5.io/t/what-exactly-is-this-sistent-design-system-project/4934

@leecalcote
Copy link
Member Author

@lakshz FYI

@KunyueXing
Copy link

@leecalcote Thanks for the reference.

I'm starting working on this and will keep you updated.

@KunyueXing
Copy link

Hi, Lee @leecalcote . I found this website - https://www.npmjs.com/package/@layer5/sistent?activeTab=readme

Is this the place where the Sistent's NPM packages are?

Copy link
Member Author

Yes.

Lakshay, please assist as needed.

@KunyueXing
Copy link

Some updates.

Since I'm completely new to this community and front-end development, here's some homework that I did:

  • What is NPM?
  • What is Sistent?

From my understanding, Sistent uses MUI v5 components, so I researched on how to incorporate the NPM packages of MUI v5, hoping it would give me some insights on Sistent because I think they may have some similarities. Here's what I found:

From the NPM registry of Sistent, I found this command to install the package.

> npm i @layer5/sistent

@leecalcote and @lakshz, about this task, specifically "instructions on where the NPM packages are or how to incorporate their use", could you please provide some clarification? Is it about installation of Sistent, which is the NPM command above?

@lakshz
Copy link
Contributor

lakshz commented Apr 23, 2024

@KunyueXing You are somewhat in the right direction, I believe. The command npm i @layer5/sistent installs the sistent package in the code. However, the layer5/layer5 codebase already has this package installed.

Your task is to write instructions to allow other contributors to use this package. Starting from installing the package to importing its components. The instructions would be something like this:

  1. Run npm i @layer5/sistent
  2. import {SistentThemeProvider} from "@layer5/sistent" This is a wrapper component that imports the Sistent Theme.
  3. Import component and put them inside SistentThemeProvider. For example,
 <SistentThemeProvider>
       <Button variant="contained">Filled</Button>
  </SistentThemeProvider>

Above is just an overview of instructions to help you. The actual instructions can be more detailed and better.

PS: You can look src/sections/Projects/Sistent/components/button/code.js file, to see how sistent components are being imported and used.

@KunyueXing
Copy link

@lakshz Thank you for all the details! I'll keep investigating.

@vishalvivekm
Copy link
Member

@lakshz Thank you for all the details! I'll keep investigating.

@KunyueXing,
Monday's websites meeting is a great place to talk about your progress so far, get feedback and any help, if required.
Let's discuss this in next Website call [Monday 29th, 7 AM CT].
Meeting calender: https://meet.layer5.io/
Meeting minutes: https://docs.google.com/document/d/1XczAHXVe2FIWPqiF57ospJ43zw5cZQ7ui8mn39v5EvA/edit#heading=h.69qskjv558bk

@KunyueXing
Copy link

Here's my updates,

I used Button as an example to learn about importing and using a component from Sistent. As @lakshz mentioned, src/sections/Projects/Sistent/components/button/code.js is a good reference. After reading through the document, I’m curious about where you learn the usages of a certain component, such as Button. I guess the source code may give me some information, so I searched for all the files in Sistent repo that have ‘button’ in the file name:

  • sistent/src/base/Button/Button.tsx
  • sistent/src/base/Button/index.tsx
  • sistent/src/theme/components/button.modifier.ts

I thought the task is to document how to import and use a certain component, similar to the doc of Button. So I picked up a component, Checkbox, and explored its usages. I installed Sistent on my computer and was able to create a page with various kinds of checkboxes. Here's a draft,

  • To install Sistent package, run npm i @layer5/sistent
  • Import the Sistent Theme, import { SistentThemeProvider } from "@layer5/sistent"
  • Import Checkbox, import { Checkbox } from "@layer5/sistent"
  • How to use basic checkboxes,
import { Checkbox, SistentThemeProvider } from "@layer5/sistent";

<SistentThemeProvider>
   <div>
      <Checkbox disabled/>
      <Checkbox />
      <Checkbox defaultChecked/>
   </div>
</SistentThemeProvider>
  • How to use checkbox with labels,
import { Checkbox, SistentThemeProvider, FormGroup, FormControlLabel } from "@layer5/sistent";

<SistentThemeProvider>
   <FormGroup>
      <FormControlLabel required control={<Checkbox/>} label="Required" />
      <FormControlLabel disabled control={<Checkbox/>} label="Disabled" />
      <FormControlLabel control={<Checkbox defaultChecked/>} label="Label" />
   </FormGroup>
</SistentThemeProvider>
  • And other usages

My questions so far:

  1. I'm still not clear about what exactly this task is. Am I supposed to write a doc about a specific component, such as Checkbox, similar to Button?
  2. While learning how to use Checkbox, I checked the files below,

The usages of Checkbox above are mostly from what I learned about MUI v5. In order for me to get familiar with Sistent, as well as to complete this task, could you tell me how to find the usage of a Sistent component without its doc?

@KunyueXing
Copy link

Hi @vishalvivekm,

I'm not able to join the meeting since I'm in Pacific Time, which would be 5 am here. Can we reschedule the meeting to 8 pm PDT, or some other time?

@KunyueXing
Copy link

Hi @lakshz, could you please respond to my comment?

@lakshz
Copy link
Contributor

lakshz commented May 6, 2024

For component-specific variants, there is a dedicated https://layer5.io/projects/sistent/components page.
Your task is add a more "general" instruction, that the user might need before trying to import a component from sistent.

You may take one component and show it as an example. (not emphasizing on its variants)

So, to summarize:

  • To install Sistent package, run npm i @layer5/sistent

  • Import the Sistent Theme, import { SistentThemeProvider } from "@layer5/sistent"

  • To import any component you can import it from "@layer5/sistent". For example you can import Checkbox with the following code:
    Import Checkbox, import { Checkbox } from "@layer5/sistent"
    For more component specific instruction variants, check https://layer5.io/projects/sistent/components

  • Put the imported component inside SistentThemeProvider

All of this needs to added under Installation heading on projects/sistent/about.

I hope this clears everything. I would request you to please create a PR and we can discuss further there, based on what is implemented.

@KunyueXing
Copy link

Sounds good, I'll work on the PR.

@KunyueXing
Copy link

I'm making slow progress due to family emergency for the past 2 weeks. I'm hoping to post the PR by the end of next week.

@KunyueXing KunyueXing linked a pull request May 28, 2024 that will close this issue
1 task
@KunyueXing
Copy link

I just created a pull request.

@leecalcote @lakshz Who will be my reviewers?

@leecalcote
Copy link
Member Author

Great! @nebula-aac will be a reviewer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/projects An issue relating to Layer5 initiatives (projects) framework/react React related good first issue Good for newcomers help wanted Extra attention is needed kind/chore Necessary task
Development

Successfully merging a pull request may close this issue.

4 participants