From e3f39a0313d3cffbd90ddc75210aa5967438a629 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Rafael=20Siqueira?= Date: Fri, 21 Feb 2025 19:39:38 -0300 Subject: [PATCH] add container --- dashboard_js/app/components/container.jsx | 18 ++++++++++++++++++ dashboard_js/app/components/form.jsx | 16 +++++++--------- dashboard_js/app/layouts/app.jsx | 22 +++++++++++++++++++++- 3 files changed, 46 insertions(+), 10 deletions(-) create mode 100644 dashboard_js/app/components/container.jsx diff --git a/dashboard_js/app/components/container.jsx b/dashboard_js/app/components/container.jsx new file mode 100644 index 0000000..3661015 --- /dev/null +++ b/dashboard_js/app/components/container.jsx @@ -0,0 +1,18 @@ +import clsx from 'clsx' + +export function Container({ children, className }) { + return ( +
+ {children} +
+ ) +} diff --git a/dashboard_js/app/components/form.jsx b/dashboard_js/app/components/form.jsx index 9b8c7fd..9df6e84 100644 --- a/dashboard_js/app/components/form.jsx +++ b/dashboard_js/app/components/form.jsx @@ -1,4 +1,4 @@ -import React, { forwardRef, useContext, useId } from 'react' +import React, { createElement, forwardRef, useContext, useId } from 'react' import { ExclamationCircleIcon } from '@heroicons/react/24/outline' import { omit } from 'ramda' import { Loader } from './loader' @@ -42,7 +42,7 @@ export function Button({ props['disabled'] = isLoading } - return React.createElement( + return createElement( as, { className: clsx( @@ -90,15 +90,13 @@ export const Input = forwardRef(function Input( const { className: _, ...field } = useControl(props) const sizes = { base: 'h-12' } - return React.createElement( + return createElement( as, { className: clsx( 'bg-white outline-none px-4 rounded-lg transition', 'border border-green-light dark:border-gray-700 dark:bg-gray-800', 'focus:ring-1 focus:border-green-secondary focus:ring-green-secondary focus:placeholder:text-transparent', - // Tailwind's won't inherit focus behavior; you must define it explicitly for both modes. - 'dark:focus:border-green-secondary', 'aria-[invalid=true]:border-red-400 aria-[invalid=true]:ring-red-400', 'dark:aria-[invalid=true]:border-red-500 dark:aria-[invalid=true]:ring-red-500', 'disabled:text-gray-400 disabled:border-gray-300 disabled:bg-gray-200', @@ -123,10 +121,10 @@ export const Checkbox = forwardRef(function Checkbox( - {isNavigating ? <>Loading... : } + {isNavigating ? : } ) } + +function Loading() { + return ( + +
+
+
+
+
+
+
+
+
+
+
+
+ + ) +}