From 0017a47ddff4f1d106a03548da9c7142f8423a95 Mon Sep 17 00:00:00 2001 From: Johan Date: Sun, 14 Jan 2024 01:20:22 +0100 Subject: [PATCH] to tailwind (mostly) --- index.html | 13 +- src/components/badge/index.tsx | 8 +- src/components/buttons/with-action.tsx | 8 +- src/components/card/index.tsx | 8 +- src/components/card/no-frame.tsx | 8 +- src/components/code/index.tsx | 17 +-- src/components/form/date-range.tsx | 20 +-- src/components/form/file-upload.tsx | 12 +- src/components/form/generator.tsx | 5 +- src/components/form/inputs.tsx | 19 ++- src/components/layout/utils-ui.tsx | 18 +-- src/components/list-assign.tsx | 19 +-- src/components/notifications/banner.tsx | 20 ++- src/components/notifications/toast/index.tsx | 28 ++-- src/components/notifications/toast/unit.tsx | 19 ++- src/components/spinner.tsx | 5 +- src/components/status-change/index.tsx | 15 +- src/components/table/ui/index.tsx | 43 ++++-- src/components/table/ui/pagination.tsx | 73 ++++------ src/components/tabs/utils-ui.tsx | 26 ++-- src/components/tabs/utils.ts | 11 +- src/components/toggle.tsx | 13 +- src/components/view.tsx | 15 +- src/examples/detail/index.tsx | 1 + src/examples/simple-list/index.tsx | 18 +-- src/examples/simple-list/list-item.tsx | 10 +- src/layout/footer.tsx | 14 +- src/layout/header.tsx | 48 +++---- src/layout/index.tsx | 12 +- src/lib/components/index.tsx | 34 +++-- src/lib/detail/index.tsx | 2 +- src/lib/form/file-upload.tsx | 9 +- .../form/generator2/components/buttons.tsx | 57 ++++++++ src/lib/form/generator2/components/index.tsx | 112 +++++++++++++++ src/lib/form/generator2/components/inputs.tsx | 130 ++++++++++++++++++ .../form/generator2/components/spinner.tsx | 13 ++ src/lib/form/generator2/components/type.ts | 59 ++++++++ src/lib/form/generator2/components/utils.ts | 6 + src/lib/form/generator2/index.tsx | 112 +++++++++++++++ src/lib/form/generator2/type.ts | 59 ++++++++ src/lib/form/generator2/utils.ts | 6 + src/links.ts | 10 +- 42 files changed, 849 insertions(+), 286 deletions(-) create mode 100644 src/lib/form/generator2/components/buttons.tsx create mode 100644 src/lib/form/generator2/components/index.tsx create mode 100644 src/lib/form/generator2/components/inputs.tsx create mode 100644 src/lib/form/generator2/components/spinner.tsx create mode 100644 src/lib/form/generator2/components/type.ts create mode 100644 src/lib/form/generator2/components/utils.ts create mode 100644 src/lib/form/generator2/index.tsx create mode 100644 src/lib/form/generator2/type.ts create mode 100644 src/lib/form/generator2/utils.ts diff --git a/index.html b/index.html index 8fe8e7c..e3521be 100644 --- a/index.html +++ b/index.html @@ -5,20 +5,15 @@ + - - React-headless diff --git a/src/components/badge/index.tsx b/src/components/badge/index.tsx index 01dbbd4..1898556 100644 --- a/src/components/badge/index.tsx +++ b/src/components/badge/index.tsx @@ -1,3 +1,7 @@ -const Badge = ({children}:{children:JSX.Element}) => {children} +const Badge = ({ children }: { children: JSX.Element }) => ( + + {children} + +); -export default Badge \ No newline at end of file +export default Badge; diff --git a/src/components/buttons/with-action.tsx b/src/components/buttons/with-action.tsx index 4988470..f6b6904 100644 --- a/src/components/buttons/with-action.tsx +++ b/src/components/buttons/with-action.tsx @@ -1,11 +1,13 @@ -import React from 'react'; +import React from "react"; -import BtnWithActionGeneric, { BtnProps } from '../../lib/buttons/with-action'; +import BtnWithActionGeneric, { BtnProps } from "../../lib/buttons/with-action"; const Btn = ({ children, disabled, onClick }: BtnProps) => { return ( )} diff --git a/src/components/form/date-range.tsx b/src/components/form/date-range.tsx index 310d5dc..7ff8ef8 100644 --- a/src/components/form/date-range.tsx +++ b/src/components/form/date-range.tsx @@ -3,18 +3,22 @@ import Headless from "../../lib/form/date-range"; const UI = ({ dateRange, setDateRange, handleSubmit, errors }: UIProps) => (
-
+
setDateRange({ ...dateRange, start: v.target.value })} /> - - + - setDateRange({ ...dateRange, end: v.target.value })} @@ -22,12 +26,12 @@ const UI = ({ dateRange, setDateRange, handleSubmit, errors }: UIProps) => ( -
+
{errors.start?.join(" ")} {errors.end?.join(" ")}
diff --git a/src/components/form/file-upload.tsx b/src/components/form/file-upload.tsx index 728c6df..57c1535 100644 --- a/src/components/form/file-upload.tsx +++ b/src/components/form/file-upload.tsx @@ -1,14 +1,14 @@ -import React from 'react'; +import React from "react"; -import Spinner from '../spinner'; +import Spinner from "../spinner"; import FileUploadHeadless, { - FileComponentProps -} from '../../lib/form/file-upload'; + FileComponentProps, +} from "../../lib/form/file-upload"; const FileComponent = ({ onChange }: FileComponentProps) => ( -