Git Product home page Git Product logo

gnui's People

Contributors

aittomakia avatar alinalihassan avatar allcontributors[bot] avatar andrev321 avatar bahroze-dev avatar bosmanfrx avatar daniel-choinski avatar debaraj-barua avatar ernestaszaloga avatar gagansingh5 avatar horay avatar idirmosh avatar ievavizg avatar ignasveleckisnc avatar janosio avatar jeremy-walton avatar jphawk avatar khola avatar matassp avatar mxmilian avatar mykolakolotylo avatar ninja-yujin avatar nowydev avatar petesiudak avatar raczyk avatar renovate[bot] avatar roertbb avatar tdi avatar tdp17 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

Watchers

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

gnui's Issues

Add InputHTMLAttributes into Button

What problem does this feature solve?

There is a lack of HTML attributes in Button types src/components/button/Button.tsx

What is expected?

The button should accept all HTML attributes and all existing custom props.

Storybook showRoots option location deprecated

The parameters.options.showRoots option is deprecated and set to change in v7 for StoryBook. The current location changes to be under sidebar namespace. I have made a PR to address these changes as well.

Create setColor

What problem does this feature solve?

There is a duplication, setColor function has been declared in all components where is used.

What is expected?

Global setColor function in utils. Refactor all usage of this function and replace it to the global one.

Improve Prop types for Button Component

Prop types need to be improved, so Typescript takes props from element passed as polymorphic component ("as").
This could be tricky considering linkTo prop.
Useful resource: https://react-typescript-cheatsheet.netlify.app/docs/advanced/patterns_by_usecase#polymorphic-components-eg-with-as-props

download attribute should be available when we pass anchor as a polymorphic element.

<Button as="a" download />

It shouldn't be available when the default element ("button") is used, e.g.

// This throws error
<Button download />

Make components out of icon paths

File src/utils/svgicons.tsx

contains React jsx icon paths, the paths should be moved to the IconPaths folder inside components/, then imported and returned inside svgicons.tsx file.

Pass props into native elements

Some components take only a few props that are required for logic inside their code, they should spread all of the remaining props that was passed into them to the native html element, you should also remove redundant native attributes/event handlers from props type interface and extend it with the one provided by React.

You can see how it should be done inside
src/components/checkbox/Checkbox.tsx
src/components/switch/Switch.tsx

Components to refactor:

  • src/components/toggle
  • src/components/text (fix types)
  • src/components/svgicon (fix types)
  • src/components/selectbutton (fix types)
  • src/components/message/Message.tsx (fix types)

Popover does not change visibility when clicking on icons

Recently, when using Klarity on API keys view, I've stumbled upon the case when Popover does not change it's visibility when clicking on other Popovers triggers.

I was able to reproduce the behaviour in Storybook with multiple Popovers and by clicking the triggers including their icons. Posting recording below.

Screen.Recording.2022-01-10.at.22.30.54.mov

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • Update dependency @rollup/plugin-commonjs to ^25.0.8
  • Update dependency eslint to ^8.57.0
  • Update dependency polished to ^4.3.1
  • Update dependency typescript to ^5.4.5
  • Update Storybook updates to v8 (major) (@storybook/addon-essentials, @storybook/addon-mdx-gfm, @storybook/blocks, @storybook/react, @storybook/react-vite, @storybook/theming, storybook)
  • Update Stylelint packages to v14 (major) (stylelint, stylelint-config-recommended)
  • Update dependency @rollup/plugin-commonjs to v26
  • Update dependency @testing-library/user-event to v14
  • Update dependency @types/node to v20
  • Update dependency date-fns to v3
  • Update dependency eslint to v9
  • Update dependency husky to v9
  • Update dependency jsdom to v23
  • Update dependency jsdom to v24
  • Update dependency knip to v3
  • Update dependency knip to v4
  • Update dependency knip to v5
  • Update dependency lint-staged to v14
  • Update dependency lint-staged to v15
  • Update dependency patch-package to v7
  • Update dependency patch-package to v8
  • Update dependency react-awesome-styled-grid to v4
  • Update dependency react-content-loader to v7
  • Update dependency rollup to v4
  • Update dependency styled-components to v6
  • Update dependency stylelint to v15
  • Update dependency stylelint to v16
  • Update dependency stylelint-config-recommended to v10
  • Update dependency stylelint-config-recommended to v11
  • Update dependency stylelint-config-recommended to v12
  • Update dependency stylelint-config-recommended to v13
  • Update dependency stylelint-config-recommended to v6
  • Update dependency stylelint-config-recommended to v7
  • Update dependency stylelint-config-recommended to v8
  • Update dependency stylelint-config-recommended to v9
  • Update dependency vitest to v1
  • ๐Ÿ” Create all rate-limited PRs at once ๐Ÿ”

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

npm
package.json
  • @types/styled-system ^5.1.22
  • date-fns ^2.30.0
  • lodash.clonedeep ^4.5.0
  • polished ^4.2.2
  • react-content-loader ^6.2.1
  • react-day-picker ^8.8.2
  • react-helmet ^6.1.0
  • react-if ^4.1.5
  • react-select ^5.7.7
  • styled-components-breakpoint ^3.0.0-preview.20
  • styled-system ^5.1.5
  • @nordcloud/eslint-config-pat ^9.3.0
  • @rollup/plugin-commonjs ^25.0.7
  • @rollup/plugin-node-resolve ^15.2.3
  • @storybook/addon-essentials ^7.6.7
  • @storybook/addon-mdx-gfm ^7.6.7
  • @storybook/addons ^7.6.7
  • @storybook/blocks ^7.6.7
  • @storybook/react ^7.6.7
  • @storybook/react-vite ^7.6.7
  • @storybook/theming ^7.6.7
  • @testing-library/jest-dom ^6.3.0
  • @testing-library/react ^14.0.0
  • @testing-library/user-event ^13.5.0
  • @types/lodash.clonedeep ^4.5.9
  • @types/node ^18.19.4
  • @types/react ^18.2.23
  • @types/react-copy-to-clipboard ^5.0.7
  • @types/react-dom ^18.2.8
  • @types/react-helmet ^6.1.11
  • @types/styled-components ^5.1.34
  • eslint ^8.56.0
  • husky ^8.0.3
  • jsdom ^22.1.0
  • knip ^2.43.0
  • lint-staged ^13.3.0
  • lockfile-lint ^4.12.1
  • npm-run-all ^4.1.5
  • patch-package ^6.5.1
  • prettier ^3.1.1
  • react ^18.2.0
  • react-awesome-styled-grid ^3.1.4
  • react-copy-to-clipboard ^5.1.0
  • react-dom ^18.2.0
  • rollup ^3.29.4
  • rollup-plugin-typescript2 ^0.36.0
  • storybook ^7.6.7
  • styled-components ^5.3.11
  • stylelint ^13.13.1
  • stylelint-config-recommended ^5.0.0
  • stylelint-config-styled-components ^0.1.1
  • stylelint-processor-styled-components ^1.10.0
  • typescript ^5.2.2
  • vite ^4.4.9
  • vitest ^0.34.6
  • node ~18.12.0 || ~18.13.0
  • @babel/traverse ~7.23.7
  • minimist ~1.2.8
  • shell-quote ~1.7.3
  • terser ~4.8.1
  • tmpl ~1.0.5
  • trim ~0.0.3
  • y18n ~4.0.3
  • hosted-git-info ~2.8.9
  • ssri ~6.0.2
  • elliptic ~6.5.4
  • path-parse ~1.0.7
  • json5 ^1.0.2
  • decode-uri-component ^0.2.1

  • Check this box to trigger a request for Renovate to run again on this repository

Storybook Switch example throwing React error

The Switch component's last example in Storybook didn't include a readyOnly attribute and React was giving an error about assuming mutability instead of the developer making it explicit. I have made a PR to address these changes as well.

Reorganize stories

Right now, all of the *.stories.mdx files reside inside src/stories folder,
please move every story to its component folder.

Improve theme types

Most of our types inside src/theme/index.tsx are very generic right now, e.g.

type Borders = { [key: string]: string };

they should be strongly typed according to possible values, the video below might be helpful in this task:

Add proper bundling

Right now, we use Typescript compilation to create dist folder that gets published.
"compile:publish": "tsc --project tsconfig.publish.json"

We should introduce proper bundler (https://rollupjs.org/ is preferred for libraries) and create proper config for bundling & releasing the package.

Storybook Input example throwing React error

The Input component example in Storybook didn't include a readyOnly attribute and React was giving an error about assuming mutability instead of the developer making it explicit. I have made a PR to address these changes as well.

Refactor all types

What problem does this feature solve?

There is no consistency in types.

What is expected?

Change all types if possible from an interface to type.
Change naming convention to Pascal Case and Props or Data prefix.

Fix accessibility issues with Inputs

  • when clicking on a label, input does not focus
  • label/input props are not spread on native elements that block the possibility to provide accessible attributes (such as aria-)

Fix typo in src/components/modal/types.ts

What problem does this feature solve?

There is a typo in the word IBackgroudProps src/components/modal/types.ts and other places where this type is imported.

What is expected?

To remove typo.

Unify React imports and usage

The goal of this task is to create universal style of importing React and using React apis to be easily distinguished from the rest of the code (e.g. built-in hooks vs custom hooks).

  • Refactor React imports to namespace import - import * as React from React;
  • Refactor React api usages to the new import style e.g.
    React.useEffect(() => instead of useEffect(() => or React.ReactNode instead of ReactNode

https://epicreact.dev/importing-react-through-the-ages/

Add useDisclosure hook for boolean states

There's a handy hook that we use in our internal projects that is used to handle boolean states.

import { useCallback, useState } from "react";

export function useDisclosure(isOpenDefault = false) {
  const [isOpen, setIsOpen] = useState(isOpenDefault);

  const open = useCallback(() => setIsOpen(true), []);
  const close = useCallback(() => setIsOpen(false), []);

  const toggle = useCallback((toSet?: boolean) => {
    if (typeof toSet === "undefined") {
      setIsOpen((state) => !state);
    } else {
      setIsOpen(toSet);
    }
  }, []);

  return { isOpen, open, close, toggle };
}

Tasks:

  • Add above hook to src/hooks
  • Refactor usages of boolean states inside the codebase to useDisclosure
  • To find code that requires refactor, make use of global search and search for useState(false) or useState(true)

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.