diff --git a/apps/demo/src/Views/Form/components/FileInput/_components/index.ts b/apps/demo/src/Views/Form/components/FileInput/_components/index.ts
index d65add18a..7eed33f66 100644
--- a/apps/demo/src/Views/Form/components/FileInput/_components/index.ts
+++ b/apps/demo/src/Views/Form/components/FileInput/_components/index.ts
@@ -1,5 +1,5 @@
export * from "./FileAttachDemo";
export * from "./FileInputButton";
export * from "./FileUpload";
-export * from "./FormWithFileInput";
export * from "./FormFileInputButton";
+export * from "./FormWithFileInput";
diff --git a/apps/demo/src/Views/Form/components/FormInput/FormInput.tsx b/apps/demo/src/Views/Form/components/FormInput/FormInput.tsx
index 725225529..04aa738b7 100644
--- a/apps/demo/src/Views/Form/components/FormInput/FormInput.tsx
+++ b/apps/demo/src/Views/Form/components/FormInput/FormInput.tsx
@@ -1,7 +1,7 @@
import {
- Provider,
emailSchema,
passwordSchema,
+ Provider,
} from "@prefabs.tech/react-form";
import { useTranslation } from "@prefabs.tech/react-i18n";
import { Button, Page } from "@prefabs.tech/react-ui";
@@ -9,22 +9,35 @@ import { useState } from "react";
import { useNavigate } from "react-router-dom";
import * as zod from "zod";
-import { FormInputFields } from "./FormInputFields";
import { CodeBlock, Section } from "../../../../components/Demo";
+import { FormInputFields } from "./FormInputFields";
export const FormInputDemo = () => {
- const { t, i18n } = useTranslation("form");
+ const { i18n, t } = useTranslation("form");
const navigate = useNavigate();
const [formData, setFormData] = useState("");
const [filledInput, setFilledInput] = useState(false);
const FormSchema = zod.object({
+ checkboxInput: zod.string().array(),
+ currencyPicker: zod
+ .string()
+ .nonempty({ message: t("formInput.message.required") }),
+ date: zod.string().date(),
email: emailSchema({
invalid: t("formInput.message.invalid"),
required: t("formInput.message.required"),
}),
name: zod.string().min(1, t("formInput.message.required")),
+ number: zod
+ .number({
+ required_error: t("formInput.message.required"),
+ })
+ .nullable()
+ .refine((data) => data !== null, {
+ message: t("formInput.message.required"),
+ }),
password: passwordSchema(
{
required: t("formInput.message.required"),
@@ -34,29 +47,16 @@ export const FormInputDemo = () => {
minLength: 0,
},
),
- number: zod
- .number({
- required_error: t("formInput.message.required"),
- })
- .nullable()
- .refine((data) => data !== null, {
- message: t("formInput.message.required"),
- }),
- text: zod.string().min(1, t("formInput.message.required")),
+ radioInput: zod.string(),
select: zod
.string()
.array()
.nonempty({ message: t("formInput.message.required") }),
- currencyPicker: zod
- .string()
- .nonempty({ message: t("formInput.message.required") }),
- typeahead: zod.string().min(1, t("formInput.message.required")),
- date: zod.string().date(),
- radioInput: zod.string(),
- checkboxInput: zod.string().array(),
terms: zod.boolean().refine((value) => value === true, {
message: t("formInput.message.required"),
}),
+ text: zod.string().min(1, t("formInput.message.required")),
+ typeahead: zod.string().min(1, t("formInput.message.required")),
});
// eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -72,26 +72,26 @@ export const FormInputDemo = () => {
}
+ label={t("buttons.back")}
onClick={() => navigate("..")}
+ variant="textOnly"
/>
}
>
@@ -99,8 +99,8 @@ export const FormInputDemo = () => {
{formData && (
)}
diff --git a/apps/demo/src/Views/Form/components/FormInput/FormInputFields.tsx b/apps/demo/src/Views/Form/components/FormInput/FormInputFields.tsx
index bdc3274cd..40f3238ae 100644
--- a/apps/demo/src/Views/Form/components/FormInput/FormInputFields.tsx
+++ b/apps/demo/src/Views/Form/components/FormInput/FormInputFields.tsx
@@ -28,9 +28,9 @@ export const FormInputFields = ({ checkFilledState }: Properties) => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const [options, setOptions] = useState([]);
const {
- register,
- getFieldState,
formState: { errors, submitCount }, // eslint-disable-line @typescript-eslint/no-unused-vars
+ getFieldState,
+ register,
watch,
} = useFormContext();
@@ -61,60 +61,62 @@ export const FormInputFields = ({ checkFilledState }: Properties) => {
label={t("formInput.label.email")}
name="email"
placeholder={t("formInput.placeHolder.email")}
- submitCount={submitCount}
- showValidState={valid}
showInvalidState={invalid}
+ showValidState={valid}
+ submitCount={submitCount}
/>
{
{ code: "EUR", label: "Euro", symbol: "€", value: "EUR" },
{ code: "JPY", label: "Japanese Yen", symbol: "¥", value: "JPY" },
]}
- label={t("formInput.label.currencyPicker")}
- name="currencyPicker"
placeholder={t("formInput.placeHolder.currencyPicker")}
showInvalidState={invalid}
showValidState={valid}
submitCount={submitCount}
/>
{
]}
/>
{
{ label: "Two", value: "value 2" },
{ label: "Three", value: "value 3" },
]}
- direction={"horizontal"}
/>
{
}
+ label={t("buttons.back")}
onClick={() => navigate("..")}
+ variant="textOnly"
/>
}
>
diff --git a/apps/demo/src/Views/Form/components/LoginForm/LoginFormFields.tsx b/apps/demo/src/Views/Form/components/LoginForm/LoginFormFields.tsx
index c30091de6..719088707 100644
--- a/apps/demo/src/Views/Form/components/LoginForm/LoginFormFields.tsx
+++ b/apps/demo/src/Views/Form/components/LoginForm/LoginFormFields.tsx
@@ -4,23 +4,23 @@ import { useTranslation } from "@prefabs.tech/react-i18n";
export const LoginFormFields = () => {
const [t] = useTranslation("form");
const {
- register,
- getFieldState,
formState: { errors, submitCount }, // eslint-disable-line @typescript-eslint/no-unused-vars
+ getFieldState,
+ register,
} = useFormContext();
return (
<>
diff --git a/apps/demo/src/Views/Form/index.ts b/apps/demo/src/Views/Form/index.ts
index 2f8ab46dc..3f2a7c38a 100644
--- a/apps/demo/src/Views/Form/index.ts
+++ b/apps/demo/src/Views/Form/index.ts
@@ -1,2 +1,2 @@
-export * from "./pages";
export * from "./FormPage";
+export * from "./pages";
diff --git a/apps/demo/src/Views/Form/pages.tsx b/apps/demo/src/Views/Form/pages.tsx
index 33e413466..21e9382c3 100644
--- a/apps/demo/src/Views/Form/pages.tsx
+++ b/apps/demo/src/Views/Form/pages.tsx
@@ -1,33 +1,33 @@
import { useTranslation } from "@prefabs.tech/react-i18n";
import { Outlet } from "react-router-dom";
+import { Demo } from "../../components/Demo";
import { FileInputDemo } from "./components/FileInput";
import { FormInputDemo } from "./components/FormInput";
import { LoginForm } from "./components/LoginForm/LoginForm";
-import { Demo } from "../../components/Demo";
export const FORM_ROUTES = {
- GET_STARTED: "/form",
FILE_INPUT: "/form/file-input",
FORM_INPUT: "/form/form-input",
+ GET_STARTED: "/form",
LOGIN_FORM: "/form/login",
};
export const routes = [
{
- path: FORM_ROUTES.FILE_INPUT,
- key: "fileInput.title",
element: ,
+ key: "fileInput.title",
+ path: FORM_ROUTES.FILE_INPUT,
},
{
- path: FORM_ROUTES.FORM_INPUT,
- key: "formInput.title",
element: ,
+ key: "formInput.title",
+ path: FORM_ROUTES.FORM_INPUT,
},
{
- path: FORM_ROUTES.LOGIN_FORM,
- key: "loginForm.title",
element: ,
+ key: "loginForm.title",
+ path: FORM_ROUTES.LOGIN_FORM,
},
];
@@ -39,15 +39,15 @@ export const Pages = () => {
{
label: t("headers.examples"),
submenu: [
- ...routes.map(({ path, key }) => {
- return { route: path, label: t(key) };
+ ...routes.map(({ key, path }) => {
+ return { label: t(key), route: path };
}),
],
},
];
return (
-
+
);
diff --git a/apps/demo/src/Views/Home/components/Package.tsx b/apps/demo/src/Views/Home/components/Package.tsx
index 9492fcfff..1aec0e6f4 100644
--- a/apps/demo/src/Views/Home/components/Package.tsx
+++ b/apps/demo/src/Views/Home/components/Package.tsx
@@ -1,20 +1,20 @@
interface Properties {
className?: string;
- title: string;
description: string;
onClick: () => void;
+ title: string;
}
export const Package = ({
className,
- title,
description,
onClick,
+ title,
}: Properties) => {
const classNames = ["package", className].filter((c) => !!c).join(" ");
return (
-
+
diff --git a/apps/demo/src/Views/Home/index.tsx b/apps/demo/src/Views/Home/index.tsx
index ecb9a3979..6eebb2d89 100644
--- a/apps/demo/src/Views/Home/index.tsx
+++ b/apps/demo/src/Views/Home/index.tsx
@@ -1,5 +1,5 @@
import { useTranslation } from "@prefabs.tech/react-i18n";
-import { Page, GridContainer } from "@prefabs.tech/react-ui";
+import { GridContainer, Page } from "@prefabs.tech/react-ui";
import React from "react";
import { useNavigate } from "react-router-dom";
@@ -11,43 +11,43 @@ const Home: React.FC = () => {
const packages = [
{
+ description: "@prefabs.tech/react-ui components and utilities",
name: "ui",
route: "/ui",
- description: "@prefabs.tech/react-ui components and utilities",
},
{
+ description: "@prefabs.tech/react-user components and utilities",
name: "user",
route: "/user",
- description: "@prefabs.tech/react-user components and utilities",
},
{
+ description: "@prefabs.tech/react-form components and utilities",
name: "form",
route: "/form",
- description: "@prefabs.tech/react-form components and utilities",
},
{
+ description: "@prefabs.tech/react-layout components and utilities",
name: "layout",
route: "/layout",
- description: "@prefabs.tech/react-layout components and utilities",
},
{
+ description: "@prefabs.tech/react-i18n components and utilities",
name: "i18n",
route: "/i18n",
- description: "@prefabs.tech/react-i18n components and utilities",
},
];
return (
-
+
{packages.map((package_) => {
return (
navigate(package_.route)}
+ title={t(`header.menu.${package_.name}`)}
/>
);
})}
diff --git a/apps/demo/src/Views/I18n/index.ts b/apps/demo/src/Views/I18n/index.ts
index 0f976e34c..bada6250d 100644
--- a/apps/demo/src/Views/I18n/index.ts
+++ b/apps/demo/src/Views/I18n/index.ts
@@ -1,2 +1,2 @@
-export * from "./pages";
export * from "./I18nPage";
+export * from "./pages";
diff --git a/apps/demo/src/Views/I18n/pages.tsx b/apps/demo/src/Views/I18n/pages.tsx
index f2bf672b6..a97c6421f 100644
--- a/apps/demo/src/Views/I18n/pages.tsx
+++ b/apps/demo/src/Views/I18n/pages.tsx
@@ -14,13 +14,13 @@ export const Pages = () => {
const subnav = [
{ label: t("app:getStarted"), route: I18n_ROUTES.GET_STARTED },
- ...routes.map(({ path, key }) => {
- return { route: path, label: t(key) };
+ ...routes.map(({ key, path }) => {
+ return { label: t(key), route: path };
}),
];
return (
-
+
);
diff --git a/apps/demo/src/Views/Layout/components/StickyCollapsibleFooterDemo.tsx b/apps/demo/src/Views/Layout/components/StickyCollapsibleFooterDemo.tsx
index 09becb946..2a9cc704f 100644
--- a/apps/demo/src/Views/Layout/components/StickyCollapsibleFooterDemo.tsx
+++ b/apps/demo/src/Views/Layout/components/StickyCollapsibleFooterDemo.tsx
@@ -15,18 +15,18 @@ import { CodeBlock, Section } from "../../../components/Demo";
const data = [
{
+ description:
+ "The content to be displayed inside the sticky collapsible footer.",
id: 1,
prop: "children",
type: "ReactNode",
- description:
- "The content to be displayed inside the sticky collapsible footer.",
},
{
+ description:
+ "If false, indicates that the sticky collapsible footer is positioned at the bottom of the parent container, otherwise fixed at the bottom of viewport. Defaults to 'true'.",
id: 2,
prop: "fixed",
type: "boolean",
- description:
- "If false, indicates that the sticky collapsible footer is positioned at the bottom of the parent container, otherwise fixed at the bottom of viewport. Defaults to 'true'.",
},
];
@@ -38,14 +38,14 @@ export const StickyCollapsibleFooterDemo = () => {
return (
}
+ label={t("buttons.back")}
onClick={() => navigate("..")}
+ variant="textOnly"
/>
}
>
@@ -104,20 +104,20 @@ export const StickyCollapsibleFooterDemo = () => {
/>
setInputValue(event.target.value)}
+ placeholder="Input placeholder"
/>
diff --git a/apps/demo/src/Views/Layout/index.ts b/apps/demo/src/Views/Layout/index.ts
index 31b677f7d..07c56735d 100644
--- a/apps/demo/src/Views/Layout/index.ts
+++ b/apps/demo/src/Views/Layout/index.ts
@@ -1,2 +1,2 @@
-export * from "./pages";
export * from "./LayoutPage";
+export * from "./pages";
diff --git a/apps/demo/src/Views/Layout/pages.tsx b/apps/demo/src/Views/Layout/pages.tsx
index 04523089d..f9d768532 100644
--- a/apps/demo/src/Views/Layout/pages.tsx
+++ b/apps/demo/src/Views/Layout/pages.tsx
@@ -1,8 +1,8 @@
import { useTranslation } from "@prefabs.tech/react-i18n";
import { Outlet } from "react-router-dom";
-import { StickyCollapsibleFooterDemo } from "./components/StickyCollapsibleFooterDemo";
import { Demo } from "../../components/Demo";
+import { StickyCollapsibleFooterDemo } from "./components/StickyCollapsibleFooterDemo";
export const LAYOUT_ROUTES = {
GET_STARTED: "/layout",
@@ -11,9 +11,9 @@ export const LAYOUT_ROUTES = {
export const routes = [
{
- path: LAYOUT_ROUTES.STICKY_COLLAPSIBLE_FOOTER,
- key: "stickyCollapsibleFooter.title",
element: ,
+ key: "stickyCollapsibleFooter.title",
+ path: LAYOUT_ROUTES.STICKY_COLLAPSIBLE_FOOTER,
},
];
@@ -21,19 +21,19 @@ export const Pages = () => {
const [t] = useTranslation("layout");
const subnav = [
- { route: "/layout", label: t("app:getStarted") },
+ { label: t("app:getStarted"), route: "/layout" },
{
label: t("headers.components"),
submenu: [
- ...routes.map(({ path, key }) => {
- return { route: path, label: t(key) };
+ ...routes.map(({ key, path }) => {
+ return { label: t(key), route: path };
}),
],
},
];
return (
-
+
);
diff --git a/apps/demo/src/Views/Ui/components/AccordionDemo.tsx b/apps/demo/src/Views/Ui/components/AccordionDemo.tsx
index 1d1706b86..7c09e3303 100644
--- a/apps/demo/src/Views/Ui/components/AccordionDemo.tsx
+++ b/apps/demo/src/Views/Ui/components/AccordionDemo.tsx
@@ -66,53 +66,53 @@ export const AccordionDemo = () => {
const propertiesData = [
{
+ default: "-",
+ description: t("accordion.propertiesDescription.activeIcon"),
id: 1,
prop: "activeIcon",
type: "string | ReactNode",
- default: "-",
- description: t("accordion.propertiesDescription.activeIcon"),
},
{
+ default: "false",
+ description: t("accordion.propertiesDescription.canSelfCollapse"),
id: 2,
prop: "canSelfCollapse",
type: "boolean",
- default: "false",
- description: t("accordion.propertiesDescription.canSelfCollapse"),
},
{
+ default: "-",
+ description: t("accordion.propertiesDescription.children"),
id: 3,
prop: "children",
type: "ReactElement | ReactElement[]",
- default: "-",
- description: t("accordion.propertiesDescription.children"),
},
{
+ default: "-",
+ description: t("accordion.propertiesDescription.className"),
id: 4,
prop: "className",
type: "string",
- default: "-",
- description: t("accordion.propertiesDescription.className"),
},
{
+ default: "-",
+ description: t("accordion.propertiesDescription.defaultActiveIndex"),
id: 5,
prop: "defaultActiveIndex",
type: "number",
- default: "-",
- description: t("accordion.propertiesDescription.defaultActiveIndex"),
},
{
+ default: `"vertical"`,
+ description: t("accordion.propertiesDescription.direction"),
id: 6,
prop: "direction",
type: `"horizontal" | "vertical"`,
- default: `"vertical"`,
- description: t("accordion.propertiesDescription.direction"),
},
{
+ default: "-",
+ description: t("accordion.propertiesDescription.inactiveIcon"),
id: 7,
prop: "inactiveIcon",
type: "string | ReactNode",
- default: "-",
- description: t("accordion.propertiesDescription.inactiveIcon"),
},
];
@@ -122,10 +122,10 @@ export const AccordionDemo = () => {
title={t("accordion.title")}
toolbar={
}
+ label={t("buttons.back")}
onClick={() => navigate("..")}
+ variant="textOnly"
/>
}
>
@@ -168,8 +168,8 @@ import { Accordion, SubPane } from "@prefabs.tech/react-ui";
{accordionItems.map((item, index) => {
return (
{item.content}
@@ -201,7 +201,7 @@ import { Accordion, SubPane } from "@prefabs.tech/react-ui";
-
+
{data.map((item, index) => {
return (
diff --git a/apps/demo/src/Views/Ui/components/Button/Button.tsx b/apps/demo/src/Views/Ui/components/Button/Button.tsx
index c223a0412..a8dc64c0f 100644
--- a/apps/demo/src/Views/Ui/components/Button/Button.tsx
+++ b/apps/demo/src/Views/Ui/components/Button/Button.tsx
@@ -1,101 +1,101 @@
import { useTranslation } from "@prefabs.tech/react-i18n";
-import { TDataTable, Page, Button } from "@prefabs.tech/react-ui";
+import { Button, Page, TDataTable } from "@prefabs.tech/react-ui";
import { useNavigate } from "react-router-dom";
-import { Basic, Icons, Link, Severity, Size, Variant } from "./components";
import { CodeBlock, Section } from "../../../../components/Demo";
+import { Basic, Icons, Link, Severity, Size, Variant } from "./components";
const data = [
{
+ description: "The content to be displayed inside the button.",
id: 1,
prop: "children",
type: "string | ReactNode",
- description: "The content to be displayed inside the button.",
},
{
+ description: "Additional CSS classes to apply to the button.",
id: 2,
prop: "className",
type: "string",
- description: "Additional CSS classes to apply to the button.",
},
{
+ description: "If true, the button will be disabled and non-interactive.",
id: 3,
prop: "disabled",
type: "boolean",
- description: "If true, the button will be disabled and non-interactive.",
},
{
+ description:
+ "Icon to be displayed on the left side of the button. Can be a string (class name) or a ReactNode.",
id: 4,
prop: "iconLeft",
type: "string | ReactNode",
- description:
- "Icon to be displayed on the left side of the button. Can be a string (class name) or a ReactNode.",
},
{
+ description:
+ "Icon to be displayed on the right side of the button. Can be a string (class name) or a ReactNode.",
id: 5,
prop: "iconRight",
type: "string | ReactNode",
- description:
- "Icon to be displayed on the right side of the button. Can be a string (class name) or a ReactNode.",
},
{
+ description:
+ "Text to be displayed in the button when `children` is not provided.",
id: 6,
prop: "label",
type: "string",
- description:
- "Text to be displayed in the button when `children` is not provided.",
},
{
+ description:
+ "If true, indicates that the button is in a loading state and disables user interaction.",
id: 7,
prop: "loading",
type: "boolean",
- description:
- "If true, indicates that the button is in a loading state and disables user interaction.",
},
{
+ description: "Function to be called when the button is clicked.",
id: 8,
prop: "onClick",
type: "() => void",
- description: "Function to be called when the button is clicked.",
},
{
+ description:
+ "Defines the styling severity of the button. Defaults to 'primary'.",
id: 9,
prop: "severity",
type: '"primary" | "secondary" | "alternate" | "success" | "danger" | "warning"',
- description:
- "Defines the styling severity of the button. Defaults to 'primary'.",
},
{
+ description: "Sets the size of the button. Defaults to 'medium'.",
id: 10,
prop: "size",
type: '"small" | "medium" | "large"',
- description: "Sets the size of the button. Defaults to 'medium'.",
},
{
+ description:
+ "If provided, the button will act as a `Link` to the specified path instead of a regular button.",
id: 11,
prop: "to",
type: "string",
- description:
- "If provided, the button will act as a `Link` to the specified path instead of a regular button.",
},
{
+ description: "Tooltip text that appears on hover.",
id: 12,
prop: "title",
type: "string",
- description: "Tooltip text that appears on hover.",
},
{
+ description: "Specifies the button variant. Defaults to 'filled'.",
id: 13,
prop: "variant",
type: '"outlined" | "filled" | "textOnly"',
- description: "Specifies the button variant. Defaults to 'filled'.",
},
{
+ description:
+ "Specifies the button border-radius to be rounded when set to `true`. Defaults to 'false'.",
id: 14,
prop: "rounded",
type: "boolean",
- description:
- "Specifies the button border-radius to be rounded when set to `true`. Defaults to 'false'.",
},
];
@@ -106,14 +106,14 @@ export const ButtonDemo = () => {
return (
}
+ label={t("buttons.back")}
onClick={() => navigate("..")}
+ variant="textOnly"
/>
}
>
diff --git a/apps/demo/src/Views/Ui/components/Button/components.tsx b/apps/demo/src/Views/Ui/components/Button/components.tsx
index 2ac6913b3..f07457056 100644
--- a/apps/demo/src/Views/Ui/components/Button/components.tsx
+++ b/apps/demo/src/Views/Ui/components/Button/components.tsx
@@ -70,14 +70,14 @@ const Size = ({
return (
-
+
-
+
);
};
@@ -136,66 +136,66 @@ const Icons = ({
<>
-
+
-
+
-
+
-
+
>
@@ -222,4 +222,4 @@ const Link = ({
);
};
-export { Basic, Severity, Size, Variant, Icons, Link };
+export { Basic, Icons, Link, Severity, Size, Variant };
diff --git a/apps/demo/src/Views/Ui/components/CardDemo.tsx b/apps/demo/src/Views/Ui/components/CardDemo.tsx
index c4479c7d6..43ab036bd 100644
--- a/apps/demo/src/Views/Ui/components/CardDemo.tsx
+++ b/apps/demo/src/Views/Ui/components/CardDemo.tsx
@@ -14,27 +14,27 @@ import { CodeBlock, Section } from "../../../components/Demo";
const data = [
{
+ default: "-",
+ description: "Additional CSS classes to apply to the card.",
id: 1,
prop: " className",
type: "string",
- default: "-",
- description: "Additional CSS classes to apply to the card.",
},
{
- id: 2,
- prop: "children",
- type: "ReactNode",
default: "-",
description:
"The content of the card. Typically includes child components like `CardHeader`, `CardBody` and `CardFooter`.",
+ id: 2,
+ prop: "children",
+ type: "ReactNode",
},
{
- id: 3,
- prop: "outlined",
- type: "boolean",
default: "false",
description:
"Whether to render the card in an outlined style (e.g. with a border)",
+ id: 3,
+ prop: "outlined",
+ type: "boolean",
},
];
@@ -47,10 +47,10 @@ export const CardDemo = () => {
title={t("card.title")}
toolbar={
}
+ label={t("buttons.back")}
onClick={() => navigate("..")}
+ variant="textOnly"
/>
}
>
diff --git a/apps/demo/src/Views/Ui/components/ConfirmationModal.tsx b/apps/demo/src/Views/Ui/components/ConfirmationModal.tsx
index 1d36a6aeb..55d72de50 100644
--- a/apps/demo/src/Views/Ui/components/ConfirmationModal.tsx
+++ b/apps/demo/src/Views/Ui/components/ConfirmationModal.tsx
@@ -16,23 +16,23 @@ export const ConfirmationModalDemo = () => {
title={t("confirmationModal.title")}
toolbar={
}
+ label={t("buttons.back")}
onClick={() => navigate("..")}
+ variant="textOnly"
/>
}
>
setShowModal(true)}
label={t("confirmationModal.buttonLabel")}
+ onClick={() => setShowModal(true)}
>
setShowModal(false)}
+ visible={showModal}
/>
diff --git a/apps/demo/src/Views/Ui/components/CountryDisplay/CountryDisplayDemo.tsx b/apps/demo/src/Views/Ui/components/CountryDisplay/CountryDisplayDemo.tsx
index f9b9fa736..5c2821b01 100644
--- a/apps/demo/src/Views/Ui/components/CountryDisplay/CountryDisplayDemo.tsx
+++ b/apps/demo/src/Views/Ui/components/CountryDisplay/CountryDisplayDemo.tsx
@@ -1,11 +1,11 @@
import { i18n, useTranslation } from "@prefabs.tech/react-i18n";
-import { Button, Page, TDataTable, Country } from "@prefabs.tech/react-ui";
+import { Button, Country, Page, TDataTable } from "@prefabs.tech/react-ui";
import { useNavigate } from "react-router-dom";
-import englishData from "./en.json";
import { CodeBlock, Section } from "../../../../components/Demo";
import frenchData from "../FormWidgets/fr.json";
import nepaliData from "../FormWidgets/np.json";
+import englishData from "./en.json";
import "../../../../assets/css/country.css";
export const CountryDisplayDemo = () => {
@@ -21,74 +21,74 @@ export const CountryDisplayDemo = () => {
const data = [
{
+ default: '""',
+ description: t("countryDisplay.propertiesDescription.className"),
id: 1,
prop: "className",
type: "string",
- default: '""',
- description: t("countryDisplay.propertiesDescription.className"),
},
{
+ default: "-",
+ description: t("countryDisplay.propertiesDescription.code"),
id: 2,
prop: "code",
type: "string",
- default: "-",
- description: t("countryDisplay.propertiesDescription.code"),
},
{
+ default: '"en"',
+ description: t("countryDisplay.propertiesDescription.fallbackLocale"),
id: 3,
prop: "fallbackLocale",
type: "string",
- default: '"en"',
- description: t("countryDisplay.propertiesDescription.fallbackLocale"),
},
{
+ default: "undefined",
+ description: t("countryDisplay.propertiesDescription.flagsPath"),
id: 4,
prop: "flagsPath",
type: "(code: string) => string",
- default: "undefined",
- description: t("countryDisplay.propertiesDescription.flagsPath"),
},
{
+ default: '"left"',
+ description: t("countryDisplay.propertiesDescription.flagsPosition"),
id: 5,
prop: "flagsPosition",
type: '"left" | "right" | "right-edge"',
- default: '"left"',
- description: t("countryDisplay.propertiesDescription.flagsPosition"),
},
{
+ default: '"rectangular"',
+ description: t("countryDisplay.propertiesDescription.flagsStyle"),
id: 6,
prop: "flagsStyle",
type: '"circle" | "rectangular" | "square"',
- default: '"rectangular"',
- description: t("countryDisplay.propertiesDescription.flagsStyle"),
},
{
+ default: "en",
+ description: t("countryDisplay.propertiesDescription.locale"),
id: 7,
prop: "locale",
type: "string",
- default: "en",
- description: t("countryDisplay.propertiesDescription.locale"),
},
{
+ default: "{}",
+ description: t("countryDisplay.propertiesDescription.i18n"),
id: 8,
prop: "locales",
type: "Record>",
- default: "{}",
- description: t("countryDisplay.propertiesDescription.i18n"),
},
{
+ default: "undefined",
+ description: t("countryDisplay.propertiesDescription.renderOption"),
id: 9,
prop: "renderOption",
type: "(code: string, label: string) => ReactNode",
- default: "undefined",
- description: t("countryDisplay.propertiesDescription.renderOption"),
},
{
+ default: "true",
+ description: t("countryDisplay.propertiesDescription.showFlag"),
id: 10,
prop: "showFlag",
type: "boolean",
- default: "true",
- description: t("countryDisplay.propertiesDescription.showFlag"),
},
];
@@ -99,8 +99,8 @@ export const CountryDisplayDemo = () => {
}
label={t("buttons.back", "Back")}
- variant="textOnly"
onClick={() => navigate("..")}
+ variant="textOnly"
/>
}
>
@@ -142,7 +142,7 @@ const selectedLocale = "np";
{
return (
}
+ label={t("buttons.back")}
onClick={() => navigate("..")}
+ variant="textOnly"
/>
}
>
@@ -94,8 +94,8 @@ export const DataDemo = () => {
diff --git a/apps/demo/src/Views/Ui/components/EditableTitleDemo.tsx b/apps/demo/src/Views/Ui/components/EditableTitleDemo.tsx
index 44d68df2a..4749a492f 100644
--- a/apps/demo/src/Views/Ui/components/EditableTitleDemo.tsx
+++ b/apps/demo/src/Views/Ui/components/EditableTitleDemo.tsx
@@ -14,64 +14,64 @@ import { CodeBlock, Section } from "../../../components/Demo";
const PROPERTIES_DATA = [
{
+ default: "true",
+ description: "Enables or disables the editing functionality.",
id: 1,
prop: "allowEdit",
type: "boolean",
- default: "true",
- description: "Enables or disables the editing functionality.",
},
{
- id: 2,
- prop: "onChange",
- type: "(event: ChangeEvent) => void",
default: "undefined",
description:
"Callback function triggered when the title input changes i.e `onchange` event.",
+ id: 2,
+ prop: "onChange",
+ type: "(event: ChangeEvent) => void",
},
{
- id: 3,
- prop: "handleUpdate",
- type: "(title: string) => void",
default: "undefined",
description:
"Callback function triggered when the title is updated after leaving the input field i.e `onblur` event.",
+ id: 3,
+ prop: "handleUpdate",
+ type: "(title: string) => void",
},
{
+ default: "undefined",
+ description: "Placeholder text for the input field when in edit mode.",
id: 4,
prop: "placeholder",
type: "string",
- default: "undefined",
- description: "Placeholder text for the input field when in edit mode.",
},
{
+ default: "undefined",
+ description: "The initial title to display.",
id: 5,
prop: "title",
type: "string",
- default: "undefined",
- description: "The initial title to display.",
},
{
+ default: '"h1"',
+ description: "Specifies the HTML heading level for the displayed title.",
id: 6,
prop: "titleLevel",
type: '"h1" | "h2" | "h3" | "h4" | "h5" | "h6"',
- default: '"h1"',
- description: "Specifies the HTML heading level for the displayed title.",
},
{
- id: 7,
- prop: "toggler",
- type: "JSX.Element",
default: "",
description:
"A custom toggle button element that activates edit mode. If not provided, a default button will be rendered.",
+ id: 7,
+ prop: "toggler",
+ type: "JSX.Element",
},
{
- id: 8,
- prop: "showToggler",
- type: "boolean",
default: "true",
description:
"Display toggle button to toggle between editing and display mode. Otherwise, title itself will handle the functionality on `click event`",
+ id: 8,
+ prop: "showToggler",
+ type: "boolean",
},
];
@@ -92,14 +92,14 @@ export const EditableTitleDemo = () => {
return (
}
+ label={t("buttons.back")}
onClick={() => navigate("..")}
+ variant="textOnly"
/>
}
>
@@ -139,9 +139,9 @@ export const EditableTitleDemo = () => {
@@ -153,9 +153,9 @@ export const EditableTitleDemo = () => {
{value ? : null}
@@ -167,7 +167,7 @@ export const EditableTitleDemo = () => {
{t("editableTitle.usage.disabled.description")}
-
+
diff --git a/apps/demo/src/Views/Ui/components/ExportButton.tsx b/apps/demo/src/Views/Ui/components/ExportButton.tsx
index 4a0665d83..72ccf2f54 100644
--- a/apps/demo/src/Views/Ui/components/ExportButton.tsx
+++ b/apps/demo/src/Views/Ui/components/ExportButton.tsx
@@ -22,15 +22,15 @@ export const ExportButtonDemo = () => {
title={t("exportButton.title")}
toolbar={
}
+ label={t("buttons.back")}
onClick={() => navigate("..")}
+ variant="textOnly"
/>
}
>
);
diff --git a/apps/demo/src/Views/Ui/components/FileCard.tsx b/apps/demo/src/Views/Ui/components/FileCard.tsx
index 13eb047c0..e1c5dff40 100644
--- a/apps/demo/src/Views/Ui/components/FileCard.tsx
+++ b/apps/demo/src/Views/Ui/components/FileCard.tsx
@@ -13,31 +13,31 @@ export const FileCardDemo = () => {
title={t("fileCard.title")}
toolbar={
}
+ label={t("buttons.back")}
onClick={() => navigate("..")}
+ variant="textOnly"
/>
}
>
{}}
- onView={() => {}}
- onShare={() => {}}
onArchive={() => {}}
onDelete={() => {}}
+ onDownload={() => {}}
+ onShare={() => {}}
+ onView={() => {}}
/>
diff --git a/apps/demo/src/Views/Ui/components/FilesList.tsx b/apps/demo/src/Views/Ui/components/FilesList.tsx
index 93d7ac8e1..3158b1bac 100644
--- a/apps/demo/src/Views/Ui/components/FilesList.tsx
+++ b/apps/demo/src/Views/Ui/components/FilesList.tsx
@@ -13,10 +13,10 @@ export const FilesListDemo = () => {
title={t("filesList.title")}
toolbar={
}
+ label={t("buttons.back")}
onClick={() => navigate("..")}
+ variant="textOnly"
/>
}
>
@@ -24,36 +24,36 @@ export const FilesListDemo = () => {
{
title={t("filesPresentation.title")}
toolbar={
}
+ label={t("buttons.back")}
onClick={() => navigate("..")}
+ variant="textOnly"
/>
}
>
{}}
- onFileDownload={() => {}}
- onFileView={() => {}}
files={[
{
+ description: "Important file for proposal",
+ downloadCount: 5,
id: 0,
+ lastDownloadedAt: Date.now(),
originalFileName: "file1.png",
- uploadedBy: { givenName: "Manish", surname: "Aryal" },
- uploadedAt: new Date("2025-04-14").getTime(),
- downloadCount: 5,
- description: "Important file for proposal",
size: 1000,
- lastDownloadedAt: Date.now(),
+ uploadedAt: new Date("2025-04-14").getTime(),
+ uploadedBy: { givenName: "Manish", surname: "Aryal" },
},
{
+ description: "Initial project proposal for client review",
+ downloadCount: 4,
id: 1,
+ lastDownloadedAt: new Date("2025-03-26").getTime(),
originalFileName: "document.pdf",
- uploadedBy: { givenName: "Gaurav", surname: "Sapkota" },
- uploadedAt: new Date("2025-03-02").getTime(),
- downloadCount: 4,
- description: "Initial project proposal for client review",
size: 500,
- lastDownloadedAt: new Date("2025-03-26").getTime(),
+ uploadedAt: new Date("2025-03-02").getTime(),
+ uploadedBy: { givenName: "Gaurav", surname: "Sapkota" },
},
{
+ description: "Proposal for project",
+ downloadCount: 6,
id: 2,
+ lastDownloadedAt: new Date("2025-03-12").getTime(),
originalFileName: "photo.jpeg",
- uploadedBy: { givenName: "Deepak", surname: "Aryal" },
- uploadedAt: new Date("2025-02-20").getTime(),
- downloadCount: 6,
- description: "Proposal for project",
size: 1500,
- lastDownloadedAt: new Date("2025-03-12").getTime(),
+ uploadedAt: new Date("2025-02-20").getTime(),
+ uploadedBy: { givenName: "Deepak", surname: "Aryal" },
},
{
+ description: "File containing client list",
+ downloadCount: 3,
id: 3,
+ lastDownloadedAt: new Date("2025-03-08").getTime(),
originalFileName: "manish.png",
- uploadedBy: { givenName: "Lamdiki", surname: "Sherpa" },
- uploadedAt: new Date("2025-02-17").getTime(),
- downloadCount: 3,
- description: "File containing client list",
size: 2000,
- lastDownloadedAt: new Date("2025-03-08").getTime(),
+ uploadedAt: new Date("2025-02-17").getTime(),
+ uploadedBy: { givenName: "Lamdiki", surname: "Sherpa" },
},
]}
+ locale={i18n?.language}
+ onEditDescription={() => {}}
+ onFileDownload={() => {}}
+ onFileView={() => {}}
+ presentation="table"
+ visibleFileDetails={[
+ "originalFileName",
+ "description",
+ "size",
+ "uploadedBy",
+ "uploadedAt",
+ "downloadCount",
+ "lastDownloadedAt",
+ "actions",
+ ]}
/>
diff --git a/apps/demo/src/Views/Ui/components/FilesTable.tsx b/apps/demo/src/Views/Ui/components/FilesTable.tsx
index 307ce4525..f436ecf83 100644
--- a/apps/demo/src/Views/Ui/components/FilesTable.tsx
+++ b/apps/demo/src/Views/Ui/components/FilesTable.tsx
@@ -13,38 +13,54 @@ export const FilesTableDemo = () => {
title={t("filesTable.title")}
toolbar={
}
+ label={t("buttons.back")}
onClick={() => navigate("..")}
+ variant="textOnly"
/>
}
>
{}}
- onFileArchive={() => {}}
+ columns={[
+ {
+ id: "uploadedBy",
+ tooltip: ({ row: { original } }) => {
+ return `${original.uploadedBy.givenName} ${original.uploadedBy.lastName}`;
+ },
+ },
+ {
+ accessorKey: "uploadedAt",
+ tooltip: true,
+ },
+ ]}
files={[
{
+ description: "Initial project proposal for client review",
+ downloadCount: 10,
id: 0,
+ lastDownloadedAt: new Date("2025-01-26").getTime(),
originalFileName: "my file",
- description: "Initial project proposal for client review",
- uploadedBy: { givenName: "Manish", surname: "Aryal" },
uploadedAt: new Date("2025-01-14").getTime(),
- lastDownloadedAt: new Date("2025-01-26").getTime(),
- downloadCount: 10,
+ uploadedBy: { givenName: "Manish", surname: "Aryal" },
},
{
+ description: "Final logo design for branding",
+ downloadCount: 12,
id: 1,
+ lastDownloadedAt: Date.now(),
originalFileName: "logo",
- description: "Final logo design for branding",
- uploadedBy: { givenName: "Nabin", surname: "Dhital" },
uploadedAt: new Date("2025-02-17").getTime(),
- lastDownloadedAt: Date.now(),
- downloadCount: 12,
+ uploadedBy: { givenName: "Nabin", surname: "Dhital" },
},
]}
locale={i18n?.language}
+ onFileArchive={() => {}}
+ onFileDelete={() => {}}
+ paginationOptions={{
+ itemsPerPageControlLabel: t("filesTable.pagination.rowsPerPage"),
+ pageInputLabel: t("filesTable.pagination.pageControl"),
+ }}
visibleColumns={[
"originalFileName",
"description",
@@ -54,22 +70,6 @@ export const FilesTableDemo = () => {
"downloadCount",
"actions",
]}
- columns={[
- {
- id: "uploadedBy",
- tooltip: ({ row: { original } }) => {
- return `${original.uploadedBy.givenName} ${original.uploadedBy.lastName}`;
- },
- },
- {
- accessorKey: "uploadedAt",
- tooltip: true,
- },
- ]}
- paginationOptions={{
- pageInputLabel: t("filesTable.pagination.pageControl"),
- itemsPerPageControlLabel: t("filesTable.pagination.rowsPerPage"),
- }}
/>
diff --git a/apps/demo/src/Views/Ui/components/FormWidgets/Checkbox.tsx b/apps/demo/src/Views/Ui/components/FormWidgets/Checkbox.tsx
index ce15ec5da..6d9e01ce3 100644
--- a/apps/demo/src/Views/Ui/components/FormWidgets/Checkbox.tsx
+++ b/apps/demo/src/Views/Ui/components/FormWidgets/Checkbox.tsx
@@ -13,10 +13,10 @@ export const CheckboxDemo = () => {
title={t("checkbox.title")}
toolbar={
}
+ label={t("buttons.back")}
onClick={() => navigate("..")}
+ variant="textOnly"
/>
}
>
diff --git a/apps/demo/src/Views/Ui/components/FormWidgets/CheckboxInput.tsx b/apps/demo/src/Views/Ui/components/FormWidgets/CheckboxInput.tsx
index 0feafb415..ed44281fc 100644
--- a/apps/demo/src/Views/Ui/components/FormWidgets/CheckboxInput.tsx
+++ b/apps/demo/src/Views/Ui/components/FormWidgets/CheckboxInput.tsx
@@ -2,6 +2,7 @@ import { useTranslation } from "@prefabs.tech/react-i18n";
import { Button, Page, TDataTable } from "@prefabs.tech/react-ui";
import { useNavigate } from "react-router-dom";
+import { CodeBlock, Section } from "../../../../components/Demo";
import {
CustomLabelMultiCheckboxDemo,
CustomLabelSingleCheckboxDemo,
@@ -9,106 +10,105 @@ import {
MultiCheckboxDemo,
SingleCheckboxDemo,
} from "./CheckboxInputUsage";
-import { CodeBlock, Section } from "../../../../components/Demo";
const data = [
{
+ default: "false",
+ description: "Determines the checked state of a single checkbox.",
id: 1,
name: "checked",
type: "boolean",
- default: "false",
- description: "Determines the checked state of a single checkbox.",
},
{
+ default: "-",
+ description: "Additional CSS classes for styling.",
id: 2,
name: "className",
type: "string",
- default: "-",
- description: "Additional CSS classes for styling.",
},
{
+ default: '"vertical"',
+ description: "Defines the layout direction for multiple checkboxes.",
id: 3,
name: "direction",
type: '"horizontal" | "vertical"',
- default: '"vertical"',
- description: "Defines the layout direction for multiple checkboxes.",
},
{
+ default: "-",
+ description: "Disables the checkbox input.",
id: 4,
name: "disabled",
type: "boolean",
- default: "-",
- description: "Disables the checkbox input.",
},
{
+ default: "-",
+ description: "Displays an error message below the component.",
id: 5,
name: "errorMessage",
type: "string",
- default: "-",
- description: "Displays an error message below the component.",
},
{
+ default: "-",
+ description: "Displays a helper text below the component.",
id: 6,
name: "helperText",
type: "string",
- default: "-",
- description: "Displays a helper text below the component.",
},
{
+ default: "-",
+ description: "Label for the single checkbox.",
id: 7,
name: "inputLabel",
type: "string | React.ReactNode",
- default: "-",
- description: "Label for the single checkbox.",
},
{
+ default: "-",
+ description: "Label for the group of checkboxes.",
id: 8,
name: "label",
type: "string | React.ReactNode",
- default: "-",
- description: "Label for the group of checkboxes.",
},
{
+ default: "-",
+ description: "The name attribute for the checkbox input.",
id: 9,
name: "name",
type: "string",
- default: "-",
- description: "The name attribute for the checkbox input.",
},
{
+ default: "-",
+ description: "Callback function that returns the updated values.",
id: 10,
name: "onChange",
type: "(newValue: T[]) => void",
- default: "-",
- description: "Callback function that returns the updated values.",
},
{
+ default: "[]",
+ description: "Options for multiple checkboxes.",
id: 11,
name: "options",
type: "Array<{ value, label }>",
- default: "[]",
- description: "Options for multiple checkboxes.",
},
{
+ default: "-",
+ description: "Placeholder text (not applicable to checkboxes).",
id: 12,
name: "placeholder",
type: "string",
- default: "-",
- description: "Placeholder text (not applicable to checkboxes).",
},
{
+ default: "[]",
+ description: "Array of selected values for multiple checkboxes.",
id: 13,
name: "value",
type: "T[]",
- default: "[]",
- description: "Array of selected values for multiple checkboxes.",
},
{
+ default: "-",
+ description: "Custom render label for multiple checkboxes.",
id: 14,
name: "renderOptionsLabel",
type: "(option: Option) => React.ReactNode",
- default: "-",
- description: "Custom render label for multiple checkboxes.",
},
];
@@ -119,14 +119,14 @@ export const CheckboxInputDemo = () => {
return (
}
+ label={t("buttons.back")}
onClick={() => navigate("..")}
+ variant="textOnly"
/>
}
>
diff --git a/apps/demo/src/Views/Ui/components/FormWidgets/CheckboxInputUsage.tsx b/apps/demo/src/Views/Ui/components/FormWidgets/CheckboxInputUsage.tsx
index 3d17b1f37..646e1ba83 100644
--- a/apps/demo/src/Views/Ui/components/FormWidgets/CheckboxInputUsage.tsx
+++ b/apps/demo/src/Views/Ui/components/FormWidgets/CheckboxInputUsage.tsx
@@ -22,9 +22,9 @@ const SingleCheckboxDemo = ({
return (
setChecked(newChecked as boolean)}
/>
);
@@ -55,13 +55,13 @@ const CustomLabelSingleCheckboxDemo = ({
return (
Accept terms and conditions
}
- checked={checked}
+ name="custom-single-checkbox"
onChange={(newChecked) => setChecked(newChecked as boolean)}
/>
);
@@ -75,9 +75,9 @@ const MultiCheckboxDemo = ({
const [selectedValues, setSelectedValues] = useState([]);
const options = [
- { value: 1, label: "Bike" },
- { value: 2, label: "Car" },
- { value: 3, label: "Truck" },
+ { label: "Bike", value: 1 },
+ { label: "Car", value: 2 },
+ { label: "Truck", value: 3 },
];
if (isString) {
@@ -103,12 +103,12 @@ const MultiCheckboxDemo = ({
return (
setSelectedValues(newValues as number[])}
options={options}
value={selectedValues}
- onChange={(newValues) => setSelectedValues(newValues as number[])}
/>
);
};
@@ -121,9 +121,9 @@ const CustomLabelMultiCheckboxDemo = ({
const [selectedValues, setSelectedValues] = useState([]);
const options = [
- { value: 1, label: "Bike" },
- { value: 2, label: "Car" },
- { value: 3, label: "Truck" },
+ { label: "Bike", value: 1 },
+ { label: "Car", value: 2 },
+ { label: "Truck", value: 3 },
];
const renderOptionsLabel = (option: (typeof options)[0]) => {
@@ -170,13 +170,13 @@ const CustomLabelMultiCheckboxDemo = ({
return (
setSelectedValues(newValues as number[])}
options={options}
+ renderOptionsLabel={renderOptionsLabel}
value={selectedValues}
- onChange={(newValues) => setSelectedValues(newValues as number[])}
/>
);
};
@@ -187,9 +187,9 @@ const DisabledDemo = ({
isString?: boolean;
}): JSX.Element | string => {
const options = [
- { value: 1, label: "Bike" },
- { value: 2, label: "Car" },
- { value: 3, label: "Truck" },
+ { label: "Bike", value: 1 },
+ { label: "Car", value: 2 },
+ { label: "Truck", value: 3 },
];
if (isString) {
@@ -214,20 +214,20 @@ const DisabledDemo = ({
return (
);
};
export {
- CustomLabelSingleCheckboxDemo,
CustomLabelMultiCheckboxDemo,
- SingleCheckboxDemo,
- MultiCheckboxDemo,
+ CustomLabelSingleCheckboxDemo,
DisabledDemo,
+ MultiCheckboxDemo,
+ SingleCheckboxDemo,
};
diff --git a/apps/demo/src/Views/Ui/components/FormWidgets/CountryPicker.tsx b/apps/demo/src/Views/Ui/components/FormWidgets/CountryPicker.tsx
index d3a6f02ce..91ca06711 100644
--- a/apps/demo/src/Views/Ui/components/FormWidgets/CountryPicker.tsx
+++ b/apps/demo/src/Views/Ui/components/FormWidgets/CountryPicker.tsx
@@ -1,17 +1,17 @@
import { useTranslation } from "@prefabs.tech/react-i18n";
import {
+ Button,
CountryPicker,
Page,
- Button,
TDataTable,
} from "@prefabs.tech/react-ui";
import { useState } from "react";
import { useNavigate } from "react-router-dom";
+import { CodeBlock, Section } from "../../../../components/Demo";
import englishData from "./en.json";
import frenchData from "./fr.json";
import nepaliData from "./np.json";
-import { CodeBlock, Section } from "../../../../components/Demo";
export const CountryPickerDemo = () => {
import("@prefabs.tech/react-ui/dist/PrefabsTechFlagIcon.css");
@@ -22,13 +22,13 @@ export const CountryPickerDemo = () => {
const frenchTranslation = {
...frenchData,
- EU: "Union Européenne",
ASEAN: "ASEAN",
+ EU: "Union Européenne",
};
const englishTranslation = {
...englishData,
- EU: "European Union",
ASEAN: "ASEAN",
+ EU: "European Union",
};
const data = [
@@ -195,10 +195,10 @@ export const CountryPickerDemo = () => {
title={t("countryPicker.title")}
toolbar={
}
+ label={t("buttons.back")}
onClick={() => navigate("..")}
+ variant="textOnly"
/>
}
>
@@ -212,9 +212,9 @@ export const CountryPickerDemo = () => {
label={t("countryPicker.labels.single")}
locale={locale}
name="countryPickerSingle"
+ onChange={(value: string) => setSingleSelectValue(value)}
placeholder={t("countryPicker.placeholders.single")}
value={singleSelectValue}
- onChange={(value: string) => setSingleSelectValue(value)}
/>
setNepaliValue(value)}
placeholder={t("countryPicker.placeholders.single")}
value={nepaliValue}
- onChange={(value: string) => setNepaliValue(value)}
/>
setFlagsSelectValue(value)}
placeholder={t("countryPicker.placeholders.single")}
value={flagsSelectValue}
- onChange={(value: string) => setFlagsSelectValue(value)}
/>
setFavoriteValue(value)}
placeholder={t("countryPicker.placeholders.single")}
value={favoriteValue}
- onChange={(value: string) => setFavoriteValue(value)}
/>
+ onChange={(value: (number | string)[] | number | string) =>
setCustomGroupValue(value as string)
}
+ placeholder={t("countryPicker.placeholders.single")}
+ value={customGroupValue}
/>
+ onChange={(value: (number | string)[] | number | string) =>
setFavoriteGroupValue(value as string)
}
+ placeholder={t("countryPicker.placeholders.single")}
+ value={favoriteGroupValue}
/>
}}
+ i18nKey={"ui:select.autoSortOptionsInfo"}
>
setMultiSelectCurrencyValue(value)}
+ options={options}
placeholder={t("currencyPicker.multiSelectPlaceholder")}
+ value={multiSelectCurrencyValue}
/>
{
title={t("input.title")}
toolbar={
}
+ label={t("buttons.back")}
onClick={() => navigate("..")}
+ variant="textOnly"
/>
}
>
diff --git a/apps/demo/src/Views/Ui/components/FormWidgets/Select.tsx b/apps/demo/src/Views/Ui/components/FormWidgets/Select.tsx
index dc94f1257..52c7f09f8 100644
--- a/apps/demo/src/Views/Ui/components/FormWidgets/Select.tsx
+++ b/apps/demo/src/Views/Ui/components/FormWidgets/Select.tsx
@@ -1,16 +1,16 @@
import { Trans, useTranslation } from "@prefabs.tech/react-i18n";
-import { Select, Page, Button, Tag } from "@prefabs.tech/react-ui";
+import { Button, Page, Select, Tag } from "@prefabs.tech/react-ui";
import { TDataTable } from "@prefabs.tech/react-ui";
import { useState } from "react";
import { useNavigate } from "react-router-dom";
import { CodeBlock, Section } from "../../../../components/Demo";
-type Option = {
- value?: T;
- label?: string;
- disabled?: boolean;
+type Option = {
[key: string]: unknown;
+ disabled?: boolean;
+ label?: string;
+ value?: T;
};
export const SelectDemo = () => {
@@ -19,182 +19,182 @@ export const SelectDemo = () => {
const data = [
{
+ default: "true",
+ description: t("select.propertiesDescription.autoSortOptions"),
id: 1,
prop: "autoSortOptions",
type: "boolean",
- default: "true",
- description: t("select.propertiesDescription.autoSortOptions"),
},
{
+ default: "false",
+ description: t("select.propertiesDescription.autoSelectSingleOption"),
id: 2,
prop: "autoSelectSingleOption",
type: "boolean",
- default: "false",
- description: t("select.propertiesDescription.autoSelectSingleOption"),
},
{
+ default: "-",
+ description: t("select.propertiesDescription.className"),
id: 3,
prop: "className",
type: "string",
- default: "-",
- description: t("select.propertiesDescription.className"),
},
{
+ default: "-",
+ description: t("select.propertiesDescription.disabled"),
id: 4,
prop: "disabled",
type: "boolean",
- default: "-",
- description: t("select.propertiesDescription.disabled"),
},
{
+ default: "-",
+ description: t("select.propertiesDescription.disableGroupSelect"),
id: 5,
prop: "disableGroupSelect",
type: "boolean",
- default: "-",
- description: t("select.propertiesDescription.disableGroupSelect"),
},
{
+ default: "false",
+ description: t("select.propertiesDescription.disableSearch"),
id: 6,
prop: "disableSearch",
type: "boolean",
- default: "false",
- description: t("select.propertiesDescription.disableSearch"),
},
{
+ default: "-",
+ description: t("select.propertiesDescription.errorMessage"),
id: 7,
prop: "errorMessage",
type: "string",
- default: "-",
- description: t("select.propertiesDescription.errorMessage"),
},
{
+ default: "false",
+ description: t("select.propertiesDescription.enableTooltip"),
id: 8,
prop: "enableTooltip",
type: "boolean",
- default: "false",
- description: t("select.propertiesDescription.enableTooltip"),
},
{
+ default: "-",
+ description: t("select.propertiesDescription.hasError"),
id: 9,
prop: "hasError",
type: "boolean",
- default: "-",
- description: t("select.propertiesDescription.hasError"),
},
{
+ default: "-",
+ description: t("select.propertiesDescription.helperText"),
id: 10,
prop: "helperText",
type: "string",
- default: "-",
- description: t("select.propertiesDescription.helperText"),
},
{
+ default: "false",
+ description: t("select.propertiesDescription.hideIfSingleOption"),
id: 11,
prop: "hideIfSingleOption",
type: "boolean",
- default: "false",
- description: t("select.propertiesDescription.hideIfSingleOption"),
},
{
+ default: "-",
+ description: t("select.propertiesDescription.label"),
id: 12,
prop: "label",
type: "string",
- default: "-",
- description: t("select.propertiesDescription.label"),
},
{
+ default: "-",
+ description: t("select.propertiesDescription.labelKey"),
id: 13,
prop: "labelKey",
type: "string",
- default: "-",
- description: t("select.propertiesDescription.labelKey"),
},
{
+ default: "false",
+ description: t("select.propertiesDescription.multiple"),
id: 14,
prop: "multiple",
type: "boolean",
- default: "false",
- description: t("select.propertiesDescription.multiple"),
},
{
+ default: "-",
+ description: t("select.propertiesDescription.name"),
id: 15,
prop: "name",
type: "string",
- default: "-",
- description: t("select.propertiesDescription.name"),
},
{
+ default: "-",
+ description: t("select.propertiesDescription.options"),
id: 16,
prop: "options",
type: "Option[] | GroupedOption[]",
- default: "-",
- description: t("select.propertiesDescription.options"),
},
{
+ default: "-",
+ description: t("select.propertiesDescription.placeholder"),
id: 17,
prop: "placeholder",
type: "string",
- default: "-",
- description: t("select.propertiesDescription.placeholder"),
},
{
+ default: "Select all",
+ description: t("select.propertiesDescription.selectAllLabel"),
id: 18,
prop: "selectAllLabel",
type: "string",
- default: "Select all",
- description: t("select.propertiesDescription.selectAllLabel"),
},
{
+ default: "true",
+ description: t("select.propertiesDescription.showRemoveSelection"),
id: 19,
prop: "showRemoveSelection",
type: "boolean",
- default: "true",
- description: t("select.propertiesDescription.showRemoveSelection"),
},
{
+ default: "-",
+ description: t("select.propertiesDescription.tooltipOptions"),
id: 20,
prop: "tooltipOptions",
type: "TooltipOptions",
- default: "-",
- description: t("select.propertiesDescription.tooltipOptions"),
},
{
+ default: "-",
+ description: t("select.propertiesDescription.value"),
id: 21,
prop: "value",
type: "Value",
- default: "-",
- description: t("select.propertiesDescription.value"),
},
{
+ default: "-",
+ description: t("select.propertiesDescription.valueKey"),
id: 22,
prop: "valueKey",
type: "string",
- default: "-",
- description: t("select.propertiesDescription.valueKey"),
},
{
+ default: "-",
+ description: t("select.propertiesDescription.renderOption"),
id: 23,
prop: "renderOption",
type: "(option: Option | GroupedOption) => React.ReactNode",
- default: "-",
- description: t("select.propertiesDescription.renderOption"),
},
{
+ default: "-",
+ description: t("select.propertiesDescription.renderValue"),
id: 24,
prop: "renderValue",
type: `(
value?: T | T[],
options?: Option[] | GroupedOption[]
) => React.ReactNode`,
- default: "-",
- description: t("select.propertiesDescription.renderValue"),
},
{
+ default: "-",
+ description: t("select.propertiesDescription.onChange"),
id: 25,
prop: "onChange",
type: " (newValue: T | T[]) => void",
- default: "-",
- description: t("select.propertiesDescription.onChange"),
},
];
@@ -312,10 +312,10 @@ export const SelectDemo = () => {
title={t("select.title")}
toolbar={
}
+ label={t("buttons.back")}
onClick={() => navigate("..")}
+ variant="textOnly"
/>
}
>
@@ -328,6 +328,7 @@ export const SelectDemo = () => {
diff --git a/apps/demo/src/Views/Ui/components/Stepper/index.css b/apps/demo/src/Views/Ui/components/Stepper/index.css
index c7a944260..792f99d6f 100644
--- a/apps/demo/src/Views/Ui/components/Stepper/index.css
+++ b/apps/demo/src/Views/Ui/components/Stepper/index.css
@@ -10,13 +10,13 @@
}
.demo-stepper-button-wrapper {
- margin-top: 3rem;
display: flex;
- justify-content: flex-start;
gap: 1rem;
+ justify-content: flex-start;
+ margin-top: 3rem;
}
-@media screen and (min-width: 576px) {
+@media screen and (width >= 576px) {
.demo-stepper-wrapper {
flex-direction: row;
}
diff --git a/apps/demo/src/Views/Ui/components/SubmitButton.tsx b/apps/demo/src/Views/Ui/components/SubmitButton.tsx
index c70bad6d5..255392362 100644
--- a/apps/demo/src/Views/Ui/components/SubmitButton.tsx
+++ b/apps/demo/src/Views/Ui/components/SubmitButton.tsx
@@ -7,23 +7,23 @@ import { CodeBlock, Section } from "../../../components/Demo";
const data = [
{
+ description: "If true, the button will be disabled and non-interactive.",
id: 1,
prop: "disabled",
type: "boolean",
- description: "If true, the button will be disabled and non-interactive.",
},
{
+ description: "Text to be displayed in the button.",
id: 2,
prop: "label",
type: "string",
- description: "Text to be displayed in the button.",
},
{
+ description:
+ "If true, indicates that the button is in a loading state and disables user interaction.",
id: 3,
prop: "loading",
type: "boolean",
- description:
- "If true, indicates that the button is in a loading state and disables user interaction.",
},
];
@@ -36,10 +36,10 @@ export const SubmitButtonDemo = () => {
title={t("submitButton.title")}
toolbar={