From 6acbf75ed71898e907d127d8d5015c0b8f759de3 Mon Sep 17 00:00:00 2001 From: Madeorsk Date: Sun, 9 Jun 2024 09:22:32 +0200 Subject: [PATCH] TODO list, lists, tables, cards, icon in button, password input, required fields generalization. + Add TODO list. + Add lists style. + Add tables style. + Add cards style. + Add password input. * Generalize required field component. * Fix icon position in buttons. * Fix custom class of boxes. --- demo/DemoApp.tsx | 124 ++++++++++++++++-- src/Components/Card.tsx | 10 ++ src/Components/Forms/Checkbox.tsx | 4 +- src/Components/Forms/PasswordInput.tsx | 23 ++++ src/Components/Forms/Radio.tsx | 4 +- src/Components/Forms/RequiredField.tsx | 6 + src/styles/_components.less | 3 + src/styles/components/_button.less | 11 +- src/styles/components/_card.less | 32 +++++ src/styles/components/_form.less | 1 + src/styles/components/_list.less | 15 +++ src/styles/components/_table.less | 42 ++++++ .../components/forms/_password-input.less | 45 +++++++ 13 files changed, 305 insertions(+), 15 deletions(-) create mode 100644 src/Components/Card.tsx create mode 100644 src/Components/Forms/PasswordInput.tsx create mode 100644 src/Components/Forms/RequiredField.tsx create mode 100644 src/styles/components/_card.less create mode 100644 src/styles/components/_list.less create mode 100644 src/styles/components/_table.less create mode 100644 src/styles/components/forms/_password-input.less diff --git a/demo/DemoApp.tsx b/demo/DemoApp.tsx index a65415f..ee128ea 100644 --- a/demo/DemoApp.tsx +++ b/demo/DemoApp.tsx @@ -2,13 +2,35 @@ import React from "react"; import "../index"; import {Checkbox} from "../src/Components/Forms/Checkbox"; import { Radio } from "../src/Components/Forms/Radio"; +import {FloppyDisk, TrashSimple, XCircle} from "@phosphor-icons/react"; +import {Card} from "../src/Components/Card"; +import {PasswordInput} from "../src/Components/Forms/PasswordInput"; +import {RequiredField} from "../src/Components/Forms/RequiredField"; export function DemoApp() { return ( -
+

KernelUI

+

TODO

+ +
    +
  • Popover / Tooltips
  • +
  • Datepicker / Timepicker
  • +
  • Selects
  • +
  • Loaders
  • +
  • Menu
  • +
  • Tabs / Apps selectors
  • +
  • App steps
  • +
  • Pagination
  • +
  • Apps
  • +
  • Global states
  • +
  • Async
  • +
  • Subapps
  • +
  • Modals
  • +
+

Headings

Demo app

@@ -28,23 +50,27 @@ export function DemoApp() A link button - - - + + +

Forms

+ + Test password + + Checkbox demo Radio box test Radio box test @@ -56,7 +82,13 @@ export function DemoApp() Link test

- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec accumsan pulvinar felis, vitae eleifend augue lacinia tempus. Integer nec iaculis ante. Duis a quam urna. Nullam tincidunt rutrum felis, a efficitur enim facilisis sit amet. Quisque dictum semper sagittis. Maecenas in orci hendrerit, tempor nunc non, tempus mi. Praesent blandit varius rutrum. Nullam quis mauris eros. Vestibulum commodo libero sed pellentesque pharetra. Donec eget fringilla ante. Aliquam id leo massa. Duis dictum nunc ut dolor iaculis malesuada. Nulla elementum justo a sem eleifend finibus. Phasellus bibendum elit nibh, at tempor odio efficitur id. + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec accumsan + pulvinar felis, vitae eleifend augue lacinia tempus. Integer nec iaculis ante. Duis a quam urna. Nullam + tincidunt rutrum felis, a efficitur enim facilisis sit amet. Quisque dictum semper sagittis. Maecenas in orci + hendrerit, tempor nunc non, tempus mi. Praesent blandit varius rutrum. Nullam quis mauris eros. Vestibulum + commodo libero sed pellentesque pharetra. Donec eget fringilla ante. Aliquam id leo massa. Duis dictum nunc ut + dolor iaculis malesuada. Nulla elementum justo a sem eleifend finibus. Phasellus bibendum elit nibh, at tempor + odio efficitur id.

Steps

@@ -66,6 +98,78 @@ export function DemoApp()

Step two

Step three

- + +

Lists

+ + + +
    +
  1. One
  2. +
  3. Two
  4. +
  5. Three
  6. +
  7. Four
  8. +
+ +

Tables

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Column 1Column 2Column 3
ABCD
LoremIpsumDolorAmet
FooBarBazJohn
AliceBobJack
+ +

Cards

+ + +

Card title

+ +

Donec lobortis quam sapien, et efficitur dolor laoreet ut. Ut pretium, lacus at bibendum rutrum, nibh nibh scelerisque nisi, nec semper dolor turpis sed tortor. Nulla massa sapien, accumsan id vestibulum et, elementum eget metus. Morbi quis bibendum purus. Nunc at fermentum tortor. Quisque viverra diam in sem auctor blandit. Vestibulum dignissim bibendum nunc, non tristique quam sollicitudin eu. Ut feugiat lectus tellus, tempus viverra sapien aliquet vel. Morbi ac est mauris. Praesent facilisis ut tellus at cursus. Aenean placerat nulla non mi vulputate hendrerit. Praesent fermentum dui eu gravida pharetra. Quisque rhoncus, magna non congue egestas, leo lorem malesuada felis, eu imperdiet orci magna ultrices est.

+ + + +
+ + +

Another small card

+
+ ); } diff --git a/src/Components/Card.tsx b/src/Components/Card.tsx new file mode 100644 index 0000000..9daf167 --- /dev/null +++ b/src/Components/Card.tsx @@ -0,0 +1,10 @@ +import React, {PropsWithChildren} from "react"; + +export function Card({children, className, ...props}: PropsWithChildren>): React.ReactElement +{ + return ( +
+ {children} +
+ ); +} diff --git a/src/Components/Forms/Checkbox.tsx b/src/Components/Forms/Checkbox.tsx index c5fe183..26f2bf5 100644 --- a/src/Components/Forms/Checkbox.tsx +++ b/src/Components/Forms/Checkbox.tsx @@ -1,10 +1,10 @@ import React from "react"; import {Check} from "@phosphor-icons/react"; -export function Checkbox({children, type, ...inputProps}: React.PropsWithChildren>): React.ReactElement +export function Checkbox({children, className, type, ...inputProps}: React.PropsWithChildren>): React.ReactElement { return ( -