",
+ "scripts": {
+ "example": "cd example && npm run start",
+ "build": "microbundle-crl --compress --no-sourcemap --format cjs",
+ "start": "microbundle-crl watch --no-compress --format modern,cjs",
+ "prepare": "yarn build",
+ "publish:components": "npm publish --tag core-v0.1",
+ "predeploy": "cd example && yarn install && yarn run build",
+ "deploy": "gh-pages -d example/build",
+ "storybook": "start-storybook -p 6006 -s public",
+ "build-storybook": "build-storybook -s public -o dist-storybook",
+ "deploy-storybook": "npm run build-storybook && surge --project dist-storybook --domain svg-components-$npm_package_version.surge.sh"
+ },
+ "peerDependencies": {
+ "react": "17.0.2",
+ "react-dom": "17.0.2",
+ "react-router-dom": "5.3.0"
+ },
+ "devDependencies": {
+ "@storybook/addon-actions": "6.4.20",
+ "@storybook/addon-essentials": "6.4.20",
+ "@storybook/addon-links": "6.4.20",
+ "@storybook/node-logger": "6.4.20",
+ "@storybook/preset-create-react-app": "3.2.0",
+ "@storybook/react": "6.4.20",
+ "@storybook/blocks":"8.3.5",
+ "babel-eslint": "10.1.0",
+ "cross-env": "7.0.3",
+ "gh-pages": "2.2.0",
+ "husky": "7.0.4",
+ "lint-staged": "12.3.7",
+ "microbundle-crl": "0.13.11",
+ "react": "17.0.2",
+ "react-dom": "17.0.2",
+ "react-query": "3.6.1",
+ "react-responsive": "9.0.2",
+ "react-router-dom": "5.3.0",
+ "react-scripts": "^4.0.1"
+ },
+ "files": [
+ "dist"
+ ],
+ "dependencies": {
+ "react-data-table-component": "7.6.2",
+ "@egovernments/digit-ui-components-css": "0.2.1",
+ "@egovernments/digit-ui-libraries": "1.8.11",
+ "@egovernments/digit-ui-svg-components": "1.0.14",
+ "@googlemaps/js-api-loader": "1.13.10",
+ "autoprefixer": "^10.4.15",
+ "postcss-flexbugs-fixes": "^5.0.2",
+ "react-date-range": "1.3.0",
+ "react-hook-form": "6.15.8",
+ "react-i18next": "11.16.2",
+ "react-table": "7.7.0",
+ "react-drag-drop-files": "2.3.10",
+ "@cyntler/react-doc-viewer": "1.10.3",
+ "react-webcam":"7.2.0",
+ "react-lottie":"1.2.4",
+ "styled-components":"5.0.0"
+ },
+ "resolutions": {
+ "styled-components": "5.0.0"
+ },
+ "browserslist": {
+ "production": [
+ ">0.2%",
+ "not dead",
+ "not op_mini all"
+ ],
+ "development": [
+ "last 1 chrome version",
+ "last 1 firefox version",
+ "last 1 safari version"
+ ]
+ },
+ "keywords": [
+ "digit",
+ "core",
+ "components",
+ "dpg"
+ ]
+}
+
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/postcss.config.js b/micro-ui/web/micro-ui-internals/packages/ui-components/postcss.config.js
new file mode 100644
index 00000000..fb81ebad
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/postcss.config.js
@@ -0,0 +1,8 @@
+module.exports = {
+ plugins: [
+ require('postcss-flexbugs-fixes'),
+ require('autoprefixer'),
+ // Add more plugins as needed
+ ],
+ };
+
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/public/index.html b/micro-ui/web/micro-ui-internals/packages/ui-components/public/index.html
new file mode 100644
index 00000000..6ee18937
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/public/index.html
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ DIGIT Component StoryBook
+
+
+
+ You need to enable JavaScript to run this app.
+
+
+
+
+
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms-groups/CustomDropdown.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms-groups/CustomDropdown.js
new file mode 100644
index 00000000..550f629d
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms-groups/CustomDropdown.js
@@ -0,0 +1,71 @@
+import _ from "lodash";
+import React from "react";
+import { Loader } from "../atoms";
+import RadioButtons from "../atoms/RadioButtons";
+import Dropdown from "../atoms/Dropdown";
+
+const CustomDropdown = ({ t, config, inputRef, label, onChange, value, errorStyle, disable, type, additionalWrapperClass = "" }) => {
+ const master = { name: config?.mdmsConfig?.masterName };
+ if (config?.mdmsConfig?.filter) {
+ master["filter"] = config?.mdmsConfig?.filter;
+ }
+ const { isLoading, data } = Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(), config?.mdmsConfig?.moduleName, [master], {
+ select: config?.mdmsConfig?.select
+ ? Digit.Utils.createFunction(config?.mdmsConfig?.select)
+ : (data) => {
+ const optionsData = _.get(data, `${config?.mdmsConfig?.moduleName}.${config?.mdmsConfig?.masterName}`, []);
+ return optionsData
+ .filter((opt) => (opt?.hasOwnProperty("active") ? opt.active : true))
+ .map((opt) => ({ ...opt, name: `${config?.mdmsConfig?.localePrefix}_${Digit.Utils.locale.getTransformedLocale(opt.code)}` }));
+ },
+ enabled: config?.mdmsConfig ? true : false,
+ });
+ if (isLoading) {
+ return ;
+ }
+
+ return (
+
+ {type === "radio" ? (
+ {
+ onChange(e, config.name);
+ }}
+ disable={disable}
+ selectedOption={value}
+ defaultValue={value}
+ t={t}
+ errorStyle={errorStyle}
+ additionalWrapperClass={additionalWrapperClass}
+ innerStyles={config?.innerStyles}
+ />
+ ) : (
+ {
+ onChange(e, config.name);
+ }}
+ disable={disable}
+ selected={value || config.defaultValue}
+ defaultValue={value || config.defaultValue}
+ t={t}
+ errorStyle={errorStyle}
+ optionCardStyles={config?.optionsCustomStyle}
+ />
+ )}
+
+ );
+};
+
+export default CustomDropdown;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms-groups/index.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms-groups/index.js
new file mode 100644
index 00000000..4a8e1d5a
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms-groups/index.js
@@ -0,0 +1,3 @@
+import CustomDropdown from "./CustomDropdown";
+
+export { CustomDropdown };
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Accordion.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Accordion.js
new file mode 100644
index 00000000..7b04e90f
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Accordion.js
@@ -0,0 +1,186 @@
+import React, { useState, useEffect } from "react";
+import PropTypes from "prop-types";
+import { SVG } from "./SVG";
+import { Colors } from "../constants/colors/colorconstants";
+import { iconRender } from "../utils/iconRender";
+import { Spacers } from "../constants/spacers/spacers";
+import Divider from "./Divider";
+import StringManipulator from "./StringManipulator";
+
+const Accordion = ({
+ title,
+ children,
+ icon,
+ iconFill,
+ iconWidth,
+ iconHeight,
+ number,
+ isOpenInitially,
+ onToggle,
+ customClassName,
+ customStyles,
+ hideCardBorder,
+ hideDivider,
+ hideCardBg,
+ hideBorderRadius,
+ isClosed,
+ isChild
+}) => {
+ const [isOpen, setIsOpen] = useState(isOpenInitially);
+
+ const iconColor = Colors.lightTheme.primary[1];
+ const toggleIconColor = Colors.lightTheme.text.primary;
+ const toggleiconSize = Spacers.spacer6;
+ const iconSize = Spacers.spacer6;
+
+ const toggleAccordion = () => {
+ setIsOpen(!isOpen);
+ onToggle && onToggle(!isOpen);
+ };
+
+ useEffect(() => {
+ if (isClosed !== undefined && isClosed) {
+ setIsOpen(false);
+ }
+ }, [isClosed]);
+
+ return (
+
+
+ {icon && (
+
+ {iconRender(
+ icon,
+ iconFill || iconColor,
+ iconWidth || iconSize,
+ iconHeight || iconSize,
+ `digit-accordion-icon`
+ )}
+
+ )}
+ {number && (
+
+ {number}
+ {"."}
+
+ )}
+
{StringManipulator("TOSENTENCECASE", title)}
+
+
+
+
+
+ {children}
+
+
+ );
+};
+
+Accordion.propTypes = {
+ title: PropTypes.string.isRequired,
+ icon: PropTypes.string,
+ iconFill: PropTypes.string,
+ iconWidth: PropTypes.string,
+ iconHeight: PropTypes.string,
+ number: PropTypes.node,
+ isOpenInitially: PropTypes.bool,
+ hideCardBorder: PropTypes.bool,
+ hideDivider: PropTypes.bool,
+ hideCardBg: PropTypes.bool,
+ hideBorderRadius: PropTypes.bool,
+ onToggle: PropTypes.func,
+ customClassName: PropTypes.string,
+ customStyles: PropTypes.object,
+ isClosed: PropTypes.bool,
+};
+
+Accordion.defaultProps = {
+ icon: null,
+ number: null,
+ isOpenInitially: false,
+ customClassName: "",
+ customStyles: {},
+ hideCardBorder: false,
+ hideDivider: false,
+ hideCardBg: false,
+ hideBorderRadius: false,
+ isClosed: false,
+};
+
+const AccordionList = ({
+ children,
+ allowMultipleOpen = true,
+ addDivider,
+ className,
+ styles,
+}) => {
+ const [openIndex, setOpenIndex] = useState(allowMultipleOpen ? [] : -1);
+
+ const handleToggle = (index) => {
+ if (allowMultipleOpen) {
+ setOpenIndex((prevState) =>
+ prevState?.includes(index)
+ ? prevState?.filter((i) => i !== index)
+ : [...prevState, index]
+ );
+ } else {
+ setOpenIndex(index === openIndex ? -1 : index);
+ }
+ };
+
+ useEffect(() => {}, [openIndex]);
+
+ return (
+
+ {React.Children.map(children, (child, index) => (
+
+ {React.cloneElement(child, {
+ isClosed: allowMultipleOpen
+ ? openIndex.length > 0 && !openIndex.includes(index)
+ : openIndex !== index,
+ onToggle: () => handleToggle(index),
+ })}
+ {addDivider && index < React.Children.count(children) - 1 && (
+
+ )}
+
+ ))}
+
+ );
+};
+
+AccordionList.propTypes = {
+ children: PropTypes.node.isRequired,
+ allowMultipleOpen: PropTypes.bool,
+ addDivider: PropTypes.bool,
+ customClassName: PropTypes.string,
+ customStyles: PropTypes.object,
+};
+
+AccordionList.defaultProps = {
+ allowMultipleOpen: true,
+ addDivider: false,
+ customClassName: "",
+ customStyles: {},
+};
+
+export { AccordionList, Accordion };
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/ActionLinks.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/ActionLinks.js
new file mode 100644
index 00000000..dcc282f7
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/ActionLinks.js
@@ -0,0 +1,19 @@
+import React from "react";
+import PropTypes from "prop-types";
+
+const ActionLinks = (props) => (
+
+ {props.children}
+
+);
+
+ActionLinks.propTypes = {
+ /** custom class of the svg icon */
+ className: PropTypes.string,
+ /** custom style of the svg icon */
+ style: PropTypes.object,
+ /** Click Event handler when icon is clicked */
+ children: PropTypes.node,
+};
+
+export default ActionLinks;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/AlertCard.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/AlertCard.js
new file mode 100644
index 00000000..6149323d
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/AlertCard.js
@@ -0,0 +1,73 @@
+import React from "react";
+import { SVG } from "./SVG";
+import StringManipulator from "./StringManipulator";
+import PropTypes from "prop-types";
+import { Colors} from "../constants/colors/colorconstants";
+
+const AlertCard = ({ label, text, variant, style, textStyle, additionalElements, inline, className, headerWrapperClassName,headerClassName}) => {
+
+ const warningIconColor = Colors.lightTheme.alert.warning;
+ const errorIconColor = Colors.lightTheme.alert.error;
+ const successIconColor = Colors.lightTheme.alert.success;
+ const infoIconColor = Colors.lightTheme.alert.info;
+
+
+ const getIconAndLabelByVariant = (variant) => {
+ switch (variant) {
+ case "warning":
+ return { icon: , defaultLabel: "Warning" };
+ case "success":
+ return { icon: , defaultLabel: "Success" };
+ case "error":
+ return { icon: , defaultLabel: "Error" };
+ default:
+ return { icon: , defaultLabel: "Info" };
+ }
+ };
+ const { icon, defaultLabel } = getIconAndLabelByVariant(variant);
+
+ const hasAdditionalElements = additionalElements && additionalElements.length > 0;
+
+ const displayedLabel = StringManipulator("TOTITLECASE", label) || defaultLabel;
+
+ return (
+
+
+ {icon}
+
{displayedLabel}
+
+ {text &&
{StringManipulator("TOSENTENCECASE", text)}
}
+ {hasAdditionalElements && (
+
+ {additionalElements.map((element, index) => (
+
+ {element}
+
+ ))}
+
+ )}
+
+ );
+};
+
+AlertCard.propTypes = {
+ label: PropTypes.string.isRequired,
+ text: PropTypes.string,
+ variant: PropTypes.string,
+ style: PropTypes.object,
+ textStyle: PropTypes.object,
+ additionalElements: PropTypes.arrayOf(PropTypes.node),
+ inline: PropTypes.bool,
+};
+
+AlertCard.defaultProps = {
+ label: "",
+ text: "",
+ varinat: "",
+ style: {},
+ textStyle: {},
+ additionalElements: [],
+ inline: false,
+};
+
+export default AlertCard;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Amount.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Amount.js
new file mode 100644
index 00000000..ce55768d
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Amount.js
@@ -0,0 +1,22 @@
+import React from "react";
+import { formatter } from "../utils/formatter";
+import PropTypes from "prop-types";
+/* Amount component by default round offs and formats for amount */
+
+const Amount = ({ t, roundOff = true, ...props }) => {
+ const value = roundOff ? Math.round(props?.value) : props?.value;
+ return (
+
+ {value ? `${formatter(value, "number")}` : t("ES_COMMON_NA")}
+
+ );
+};
+
+Amount.propTypes = {
+ className: PropTypes.string,
+ style: PropTypes.object,
+ roundOff: PropTypes.bool,
+ value: PropTypes.number,
+};
+
+export default Amount;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Animation.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Animation.js
new file mode 100644
index 00000000..c66c1a59
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Animation.js
@@ -0,0 +1,20 @@
+import React from 'react';
+import Lottie from 'react-lottie';
+
+const Animation = (props) => {
+
+ const defaultOptions = {
+ loop: props?.loop,
+ autoplay: props?.autoplay,
+ animationData: props?.animationData,
+ renderer: 'svg',
+ };
+
+ return (
+
+
+
+ );
+};
+
+export default Animation;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/AppContainer.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/AppContainer.js
new file mode 100644
index 00000000..e94dd122
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/AppContainer.js
@@ -0,0 +1,20 @@
+import React from "react";
+import PropTypes from "prop-types";
+
+const AppContainer = (props) => {
+ return (
+
+
+ {props.children}
+
+
+ );
+};
+
+AppContainer.propTypes = {
+ className: PropTypes.string,
+ style: PropTypes.object,
+ children: PropTypes.node,
+};
+
+export default AppContainer;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/BackLink.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/BackLink.js
new file mode 100644
index 00000000..19be6386
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/BackLink.js
@@ -0,0 +1,89 @@
+import React,{useEffect,useState} from "react";
+import { SVG } from "./SVG";
+import { useTranslation } from "react-i18next";
+import PropTypes from "prop-types";
+import { Colors} from "../constants/colors/colorconstants";
+
+const BackLink = ({
+ style,
+ className = "",
+ variant,
+ onClick,
+ hideIcon = false,
+ hideLabel = false,
+ disabled = false,
+ iconFill,
+ label = ""
+}) => {
+ const { t } = useTranslation();
+
+ const [isMobileView, setIsMobileView] = useState(
+ window.innerWidth <= 480
+ );
+ const onResize = () => {
+ if (window.innerWidth <= 480) {
+ if (!isMobileView) {
+ setIsMobileView(true);
+ }
+ } else {
+ if (isMobileView) {
+ setIsMobileView(false);
+ }
+ }
+ };
+ useEffect(() => {
+ window.addEventListener("resize", onResize);
+ return () => {
+ window.removeEventListener("resize", onResize);
+ };
+ }, []);
+
+ const diabledIconColor = Colors.lightTheme.text.disabled;
+ const iconColor = Colors.lightTheme.primary[2];
+
+ const icon =
+ variant === "primary" ? (
+
+ ) : variant === "secondary" ? (
+
+ ) : (
+
+ );
+ return (
+
+ {!hideIcon &&
{icon}
}
+ {!hideLabel && (
+
+ {label || t("CS_COMMON_BACK")}
+
+ )}
+
+ );
+};
+
+BackLink.propTypes = {
+ className: PropTypes.string,
+ style: PropTypes.object,
+ variant: PropTypes.string,
+ onClick: PropTypes.func,
+};
+
+export default BackLink;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Banner.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Banner.js
new file mode 100644
index 00000000..6f14db5a
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Banner.js
@@ -0,0 +1,108 @@
+import React from "react";
+import { SVG } from "./SVG";
+import PropTypes from "prop-types";
+import { useTranslation } from "react-i18next";
+import { getUserType } from "../utils/digitUtils";
+
+const Successful = (props) => {
+ const { t } = useTranslation();
+ const user_type = getUserType();
+
+ return (
+
+
+
+ {props.props.whichSvg === "tick" ? (
+
+
+
+
+
+ ) : (
+ props?.props?.svg
+ )}
+ {(props?.props?.complaintNumber || props.props.info) && (
+
+ {props?.props?.complaintNumber ? t("CS_PGR_COMPLAINT_NUMBER") : props.props.info}
+
+ )}
+ {(props?.props?.complaintNumber || props?.props?.applicationNumber) && (
+
+ {props?.props?.complaintNumber ? props?.props?.complaintNumber : props?.props?.applicationNumber}
+
+ )}
+ {props?.props?.applicationNumberOne ? (
+
{props.props.infoOne}
+ ) : null}
+ {props?.props?.applicationNumberOne ? (
+
{props?.props?.applicationNumberOne}
+ ) : null}
+ {props?.props?.multipleResponseIDs && (
+
+ {props?.props?.multipleResponseIDs.map((responseIDs) => (
+
{responseIDs}
+ ))}
+
+ )}
+
+
+ );
+};
+
+const Error = (props) => {
+ const { t } = useTranslation();
+ const user_type = getUserType();
+
+ return (
+
+
+
+
+ {props?.props?.complaintNumber ? t("CS_PGR_COMPLAINT_NUMBER") : props.props.info}
+
+
+ {props?.props?.complaintNumber ? props?.props?.complaintNumber : props?.props?.applicationNumber}
+
+ {props?.props?.multipleResponseIDs && (
+
+ {props?.props?.multipleResponseIDs.map((responseIDs) => (
+
{responseIDs}
+ ))}
+
+ )}
+
+ );
+};
+
+const Banner = (props) => {
+ return props.successful ? : ;
+};
+
+Banner.propTypes = {
+ /**
+ * Is banner is successful or error?
+ */
+ successful: PropTypes.bool.isRequired,
+ /**
+ * Banner message
+ */
+ message: PropTypes.any.isRequired,
+ /**
+ * If banner is successful, then show the complaint number
+ */
+ complaintNumber: PropTypes.any,
+};
+
+Banner.defaultProps = {
+ successful: true,
+};
+
+export default Banner;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/BodyContainer.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/BodyContainer.js
new file mode 100644
index 00000000..2a82ca50
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/BodyContainer.js
@@ -0,0 +1,18 @@
+import React from "react";
+import PropTypes from "prop-types";
+
+const BodyContainer = (props) => {
+ return (
+
+ {props.children}
+
+ );
+};
+
+BodyContainer.propTypes = {
+ className: PropTypes.string,
+ style: PropTypes.object,
+ children: PropTypes.node,
+};
+
+export default BodyContainer;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/BreadCrumb.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/BreadCrumb.js
new file mode 100644
index 00000000..c80e25e4
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/BreadCrumb.js
@@ -0,0 +1,134 @@
+import React, { useEffect, useState, Fragment } from "react";
+import PropTypes from "prop-types";
+import { Link } from "react-router-dom";
+
+const BreadCrumb = (props) => {
+ const [expanded, setExpanded] = useState(false);
+ const [crumbsToDisplay, setCrumbsToDisplay] = useState([...props?.crumbs]);
+
+ useEffect(() => {
+ if (props?.maxItems && props?.crumbs.length > props?.maxItems && !expanded) {
+ const startCrumbs = props.crumbs.slice(0, props?.itemsBeforeCollapse || Math.ceil(props.maxItems / 2));
+ const endCrumbs = props.crumbs.slice(
+ -1 * (props?.itemsAfterCollapse || Math.floor(props.maxItems / 2))
+ );
+
+ let updatedCrumbs = startCrumbs.concat(
+ [{ show: true, content: props?.expandText || "..." }],
+ endCrumbs
+ );
+ setCrumbsToDisplay(updatedCrumbs);
+ } else {
+ setCrumbsToDisplay([...props.crumbs]);
+ }
+ }, [props.crumbs, props.maxItems, expanded, props.itemsBeforeCollapse, props.itemsAfterCollapse, props?.expandText]);
+
+ function handleRedirect(path) {
+ const host = window.location.origin; // Dynamically get the base URL
+ window.location.href = `${host}${path}`;
+ }
+
+ function isLast(index) {
+ // Filter crumbs to only include those that are displayed
+ let validCrumbs = crumbsToDisplay?.filter((crumb) => crumb?.show === true);
+
+ // Check if all crumbs have the same `internalLink` or `externalLink`
+ const allHaveSameInternalLink = validCrumbs.every((crumb) => crumb.internalLink === validCrumbs[0].internalLink);
+ const allHaveSameExternalLink = validCrumbs.every((crumb) => crumb.externalLink === validCrumbs[0].externalLink);
+
+ // If all visible crumbs have the same link, determine last crumb by index
+ if (allHaveSameInternalLink || allHaveSameExternalLink) {
+ return index === validCrumbs.length - 1;
+ }
+
+ // Check if the current crumb is the last one in the validCrumbs list
+ return validCrumbs?.findIndex((ob) => {
+ const linkToCheck = ob?.externalLink || ob?.internalLink; // Use externalLink if it exists, else internalLink
+ const currentLink = crumbsToDisplay?.[index]?.externalLink || crumbsToDisplay?.[index]?.internalLink;
+ return linkToCheck === currentLink;
+ }) === validCrumbs?.length - 1;
+ }
+
+ const handleCrumbClick = () => {
+ setExpanded(!expanded);
+ };
+
+ const validCrumbsMain = crumbsToDisplay?.filter((crumb) => crumb?.show === true);
+
+ return (
+
+ {validCrumbsMain?.map((crumb, ci) => {
+ if (!crumb?.show) return null;
+ if (crumb?.isBack)
+ return (
+
+ window.history.back()}>{crumb.content}
+
+ );
+
+ return (
+
+
+ {isLast(ci) || (!crumb?.internalLink && !crumb?.externalLink) ? (
+
+ {crumb?.icon && crumb.icon}
+ {crumb.content}
+
+ ) : crumb?.externalLink ? (
+ handleRedirect(crumb?.externalLink)}
+ >
+ {crumb?.icon && crumb.icon}
+ {crumb.content}
+
+ ) : (
+
+ {crumb?.icon && crumb.icon}
+ {crumb.content}
+
+ )}
+ {!isLast(ci) && (
+
+ {props?.customSeparator ? props?.customSeparator : "/"}
+
+ )}
+
+
+ );
+ })}
+
+ );
+};
+
+BreadCrumb.propTypes = {
+ crumbs: PropTypes.array,
+ className: PropTypes.string,
+ style: PropTypes.object,
+ spanStyle: PropTypes.object,
+ customSeparator: PropTypes.element,
+ maxItems: PropTypes.number,
+ itemsAfterCollapse: PropTypes.number,
+ itemsBeforeCollapse: PropTypes.number,
+ expandText: PropTypes.string
+};
+
+export default BreadCrumb;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/BreakLine.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/BreakLine.js
new file mode 100644
index 00000000..05127ebd
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/BreakLine.js
@@ -0,0 +1,13 @@
+import React from "react";
+import PropTypes from 'prop-types';
+
+const BreakLine = ({ className = "", style = {} }) => {
+ return ;
+};
+
+BreakLine.propTypes = {
+ className: PropTypes.string,
+ style: PropTypes.object,
+};
+
+export default BreakLine;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Button.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Button.js
new file mode 100644
index 00000000..6e5655f9
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Button.js
@@ -0,0 +1,216 @@
+import React, { useState, useRef, useEffect } from "react";
+import PropTypes from "prop-types";
+import StringManipulator from "./StringManipulator";
+import Menu from "./Menu";
+import { Colors } from "../constants/colors/colorconstants";
+import { iconRender } from "../utils/iconRender";
+
+const Button = (props) => {
+ const [dropdownStatus, setDropdownStatus] = useState(false);
+ const actionRef = useRef(null);
+
+ useEffect(() => {
+ const handleClickOutside = (event) => {
+ if (actionRef?.current && !actionRef?.current.contains(event.target)) {
+ setDropdownStatus(false);
+ }
+ };
+
+ if (dropdownStatus) {
+ document.addEventListener("mousedown", handleClickOutside);
+ } else {
+ document.removeEventListener("mousedown", handleClickOutside);
+ }
+
+ return () => {
+ document.removeEventListener("mousedown", handleClickOutside);
+ };
+ }, [dropdownStatus]);
+
+ const diabledIconColor = Colors.lightTheme.text.disabled;
+ const iconColor = Colors.lightTheme.primary[1];
+ const primaryIconColor = Colors.lightTheme.paper.primary;
+
+ //To render the icon
+ const IconRender = () => {
+ const iconFill = props.iconFill
+ ? props.iconFill
+ : props?.variation === "primary"
+ ? primaryIconColor
+ : props?.isDisabled
+ ? diabledIconColor
+ : iconColor;
+ const iconReq =
+ props?.type === "actionButton" &&
+ props?.showBottom &&
+ dropdownStatus &&
+ !props.icon
+ ? "ArrowDropUp"
+ : props?.type === "actionButton" &&
+ props?.showBottom &&
+ !dropdownStatus &&
+ !props?.icon
+ ? "ArrowDropDown"
+ : props?.type === "actionButton" &&
+ !props?.showBottom &&
+ dropdownStatus &&
+ !props.icon
+ ? "ArrowDropDown"
+ : props?.type === "actionButton" &&
+ !props?.showBottom &&
+ !dropdownStatus &&
+ !props?.icon
+ ? "ArrowDropUp"
+ : props?.icon;
+ let width, height;
+
+ if (props.size === "large") {
+ width = props.variation === "link" ? "1.25rem" : "1.5rem";
+ height = props.variation === "link" ? "1.25rem" : "1.5rem";
+ } else if (props.size === "medium") {
+ width = "1.25rem";
+ height = "1.25rem";
+ } else if (props.size === "small") {
+ width = "0.875rem";
+ height = "0.875rem";
+ } else {
+ width = "1.5rem";
+ height = "1.5rem";
+ }
+ return iconRender(
+ iconReq,
+ iconFill,
+ width,
+ height,
+ `digit-button-customIcon ${props?.size ? props?.size : ""} ${
+ props?.variation ? props?.variation : ""
+ }`
+ );
+ };
+
+ const icon = IconRender();
+
+ const formattedLabel = props?.label
+ ? props?.variation === "link"
+ ? props?.label
+ : StringManipulator(
+ "CAPITALIZEFIRSTLETTER",
+ StringManipulator("TRUNCATESTRING", props?.label, {
+ maxLength: 64,
+ })
+ )
+ : "";
+
+ const handleActionButtonClick = (e) => {
+ e.stopPropagation();
+ setDropdownStatus(!dropdownStatus);
+ };
+
+ const buttonElement = (
+ handleActionButtonClick(e)
+ : props?.onClick
+ }
+ disabled={props?.isDisabled || null}
+ title={props?.title || ""}
+ style={props.style ? props.style : null}
+ >
+
+ {!props?.isSuffix && props?.icon && icon}
+
+ {formattedLabel}
+
+ {props?.isSuffix && props?.icon && icon}
+ {props?.type === "actionButton" &&
+ !props?.hideDefaultActionIcon &&
+ !props?.icon &&
+ icon}
+
+
+ );
+
+ return props?.type === "actionButton" ? (
+
+ {buttonElement}
+ {dropdownStatus && (
+
+
+
+ )}
+
+ ) : (
+ buttonElement
+ );
+};
+
+Button.propTypes = {
+ isDisabled: PropTypes.bool,
+ /**
+ * ButtonSelector content
+ */
+ label: PropTypes.string.isRequired,
+ /**
+ * button border theme
+ */
+ variation: PropTypes.string,
+ /**
+ * button icon if any
+ */
+ icon: PropTypes.string,
+ /**
+ * click handler
+ */
+ onClick: PropTypes.func.isRequired,
+ /**
+ * Custom classname
+ */
+ className: PropTypes.string,
+ /**
+ * Custom styles
+ */
+ style: PropTypes.object,
+ /**
+ * Custom label style or h2 style
+ */
+ textStyles: PropTypes.object,
+ /**
+ * button icon position
+ */
+ isSuffix: PropTypes.bool,
+ /**
+ * button size
+ */
+ size: PropTypes.string,
+};
+
+Button.defaultProps = {
+ label: "",
+ variation: "primary",
+ onClick: () => {},
+ size: "large",
+};
+
+export default Button;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/ButtonGroup.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/ButtonGroup.js
new file mode 100644
index 00000000..e798c41a
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/ButtonGroup.js
@@ -0,0 +1,76 @@
+import React, { useRef, useEffect, useState } from "react";
+import PropTypes from "prop-types";
+import Button from "./Button";
+
+const ButtonGroup = ({ buttonsArray ,sortButtons,equalButtons}) => {
+ const [isMobileView, setIsMobileView] = React.useState(
+ window.innerWidth <= 480
+ );
+ const onResize = () => {
+ if (window.innerWidth <= 480) {
+ if (!isMobileView) {
+ setIsMobileView(true);
+ }
+ } else {
+ if (isMobileView) {
+ setIsMobileView(false);
+ }
+ }
+ };
+ useEffect(() => {
+ window.addEventListener("resize", () => {
+ onResize();
+ });
+ return () => {
+ window.addEventListener("resize", () => {
+ onResize();
+ });
+ };
+ });
+
+ const maxWidth = equalButtons ? Math.max(
+ ...buttonsArray.map((button) => button.props.label.length * 14.9)
+ ) : null;
+
+ const updatedButtonsArray = buttonsArray && buttonsArray.length > 1 && equalButtons ? buttonsArray.map((button) => {
+ const buttonProps = {
+ ...button.props,
+ style: { ...(button.props.style || {}), width: `${maxWidth}px` },
+ };
+ return ;
+ }) : buttonsArray;
+
+ const resultArray = isMobileView ? buttonsArray : updatedButtonsArray;
+
+ const sortedButtons = [...resultArray].sort((a, b) => {
+ const typeOrder = { primary: 3, secondary: 2, tertiary: 1 };
+ const getTypeOrder = (button) =>
+ typeOrder[(button.props.variation || "").toLowerCase()];
+ return getTypeOrder(a) - getTypeOrder(b);
+ });
+
+ const finalResultArray = sortButtons ?
+ (isMobileView
+ ? sortedButtons.reverse()
+ : sortedButtons) : resultArray;
+
+ return (
+
+ {finalResultArray.map((button, index) => (
+
{button}
+ ))}
+
+ );
+};
+
+ButtonGroup.propTypes = {
+ buttonsArray: PropTypes.arrayOf(PropTypes.element).isRequired,
+ sortButtons:PropTypes.bool,
+ equalButtons:PropTypes.bool
+};
+
+ButtonGroup.defaultProps = {
+ equalButtons: true,
+}
+export default ButtonGroup;
+
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/ButtonSelector.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/ButtonSelector.js
new file mode 100644
index 00000000..ca33983c
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/ButtonSelector.js
@@ -0,0 +1,49 @@
+import React from "react";
+import PropTypes from "prop-types";
+
+const ButtonSelector = (props) => {
+ let theme = "digit-selector-button-primary";
+ switch (props.theme) {
+ case "border":
+ theme = "digit-selector-button-border";
+ break;
+ default:
+ theme = "digit-selector-button-primary";
+ break;
+ }
+ return (
+
+ {props.label}
+
+ );
+};
+
+ButtonSelector.propTypes = {
+ /**
+ * ButtonSelector content
+ */
+ label: PropTypes.string.isRequired,
+ /**
+ * button border theme
+ */
+ theme: PropTypes.string,
+ /**
+ * click handler
+ */
+ onSubmit: PropTypes.func,
+};
+
+ButtonSelector.defaultProps = {
+ label: "",
+ theme: "",
+ onSubmit: undefined,
+};
+
+export default ButtonSelector;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Card.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Card.js
new file mode 100644
index 00000000..de4301f1
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Card.js
@@ -0,0 +1,47 @@
+import React, { Children } from "react";
+import PropTypes from "prop-types";
+import { useLocation } from "react-router-dom";
+
+const Card = ({
+ type,
+ onClick,
+ style = {},
+ children,
+ className,
+ ReactRef,
+ variant,
+ ...props
+}) => {
+ // const { pathname } = useLocation();
+ // const classname = window?.Digit?.Hooks?.useRouteSubscription(pathname) || "";
+ const info = window?.Digit?.UserService?.getUser()?.info || null;
+ const userType = info?.type || null;
+
+ return (
+
+ {children}
+
+ );
+};
+
+Card.propTypes = {
+ type: PropTypes.string,
+ variant: PropTypes.string,
+ onClick: PropTypes.func,
+ style: PropTypes.object,
+ className: PropTypes.string,
+ children: PropTypes.node,
+};
+export default Card;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/CardBasedOptions.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/CardBasedOptions.js
new file mode 100644
index 00000000..06b2bece
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/CardBasedOptions.js
@@ -0,0 +1,28 @@
+import React from "react";
+
+const Option = ({ name, Icon, onClick, className }) => {
+ return (
+
+ );
+};
+
+const CardBasedOptions = ({ header, sideOption, options, styles = {}, style = {} }) => {
+ return (
+
+
+
{header}
+
{sideOption.name}
+
+
+ {options.map((props, index) => (
+
+ ))}
+
+
+ );
+};
+
+export default CardBasedOptions;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/CardCaption.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/CardCaption.js
new file mode 100644
index 00000000..c7a573e3
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/CardCaption.js
@@ -0,0 +1,11 @@
+import React from "react";
+
+const CardCaption = (props) => {
+ return (
+
+ {props.children}
+
+ );
+};
+
+export default CardCaption;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/CardHeader.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/CardHeader.js
new file mode 100644
index 00000000..3d47c22f
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/CardHeader.js
@@ -0,0 +1,13 @@
+import React from "react";
+
+const CardHeader = (props) => {
+ const variant = props?.variant ? props?.variant : "";
+ const className = props?.className ? props?.className : "";
+ return (
+
+ );
+};
+
+export default CardHeader;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/CardLabel.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/CardLabel.js
new file mode 100644
index 00000000..5913a7c7
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/CardLabel.js
@@ -0,0 +1,17 @@
+import React from "react";
+import PropTypes from "prop-types";
+
+const CardLabel = (props) => {
+ return (
+
+ {props.children}
+
+ );
+};
+CardLabel.propTypes = {
+ className: PropTypes.string, // An optional string for custom class names.
+ style: PropTypes.object, // An optional object for custom styles.
+ children: PropTypes.node.isRequired, // Required prop for the content of the error label.
+};
+
+export default CardLabel;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/CardLabelError.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/CardLabelError.js
new file mode 100644
index 00000000..d430959d
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/CardLabelError.js
@@ -0,0 +1,18 @@
+import React from "react";
+import PropTypes from "prop-types";
+
+const CardLabelError = (props) => {
+ return (
+
+ {props.children}
+
+ );
+};
+
+CardLabelError.propTypes = {
+ className: PropTypes.string, // An optional string for custom class names.
+ style: PropTypes.object, // An optional object for custom styles.
+ children: PropTypes.node.isRequired, // Required prop for the content of the error label.
+};
+
+export default CardLabelError;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/CardText.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/CardText.js
new file mode 100644
index 00000000..55fdf33e
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/CardText.js
@@ -0,0 +1,11 @@
+import React from "react";
+
+const CardText = (props) => {
+ return (
+
+ {props.children}
+
+ );
+};
+
+export default CardText;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/CheckBox.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/CheckBox.js
new file mode 100644
index 00000000..81459582
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/CheckBox.js
@@ -0,0 +1,133 @@
+import React, { Fragment } from "react";
+import { SVG } from "./SVG";
+import StringManipulator from "./StringManipulator";
+import PropTypes from "prop-types";
+import { useTranslation } from "react-i18next";
+import { Colors} from "../constants/colors/colorconstants";
+import { getUserType } from "../utils/digitUtils";
+
+const CheckBox = ({
+ onChange,
+ label,
+ value,
+ disabled,
+ ref,
+ checked,
+ inputRef,
+ pageType,
+ style,
+ index,
+ isLabelFirst,
+ hideLabel,
+ isIntermediate,
+ ...props
+}) => {
+ const { t } = useTranslation();
+ const userType = pageType || getUserType();
+ let styles = props?.styles;
+
+ const sentenceCaseLabel = StringManipulator("TOSENTENCECASE", label);
+
+ const diabledIconColor = Colors.lightTheme.text.disabled;
+ const iconColor = Colors.lightTheme.primary[1];
+
+ return (
+
+ {isLabelFirst && !hideLabel ? (
+
+ {sentenceCaseLabel}
+
+ ) : null}
+
+
+
+ {isIntermediate && !checked ? (
+
+ ) : (
+
+ )}
+
+
+ {!isLabelFirst && !hideLabel ? (
+
+ {sentenceCaseLabel}
+
+ ) : null}
+
+ );
+};
+
+CheckBox.propTypes = {
+ /**
+ * CheckBox content
+ */
+ label: PropTypes.string.isRequired,
+ /**
+ * onChange func
+ */
+ onChange: PropTypes.func,
+ /**
+ * input ref
+ */
+ ref: PropTypes.func,
+ userType: PropTypes.string,
+ hideLabel:PropTypes.bool,
+ isIntermediate: PropTypes.bool,
+};
+
+CheckBox.defaultProps = {
+ label: "Default",
+ isLabelFirst: false,
+ onChange: () => console.log("CLICK"),
+ value: "",
+ checked: false,
+ ref: "ww",
+ // pageType: "EMPLOYEE",
+ index: 0,
+ isIntermediate: false,
+};
+
+export default CheckBox;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Chip.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Chip.js
new file mode 100644
index 00000000..8db000b7
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Chip.js
@@ -0,0 +1,107 @@
+import React from "react";
+import PropTypes from "prop-types";
+import { SVG } from "./SVG";
+import ErrorMessage from "./ErrorMessage";
+import { Colors} from "../constants/colors/colorconstants";
+import { iconRender } from "../utils/iconRender";
+
+const Chip = ({
+ className,
+ text,
+ onTagClick,
+ onClick,
+ extraStyles,
+ disabled = false,
+ isErrorTag,
+ error,
+ hideClose,
+ onErrorClick,
+ iconReq
+}) => {
+ const tagStyles = extraStyles ? extraStyles?.tagStyles : {};
+ const textStyles = extraStyles ? extraStyles?.textStyles : {};
+ const closeIconStyles = extraStyles ? extraStyles?.closeIconStyles : {};
+ const IconColor = Colors.lightTheme.paper.primary;
+
+ const IconRender = (iconReq,isErrorTag) => {
+ const iconFill = isErrorTag ? "#B91900" : "#787878";
+ return iconRender(
+ iconReq,
+ iconFill,
+ "1.25rem",
+ "1.25rem",
+ ""
+ );
+ };
+
+ return (
+
+
+ {iconReq && IconRender(iconReq,isErrorTag)}
+
+ {text}
+
+ {
+ !hideClose &&
+
+
+ }
+
+ {error && (
+
+
+
+ )}
+
+ );
+};
+
+Chip.propTypes = {
+ className: PropTypes.string,
+ text: PropTypes.string.isRequired,
+ onClick: PropTypes.func.isRequired,
+ extraStyles: PropTypes.shape({
+ tagStyles: PropTypes.object,
+ textStyles: PropTypes.object,
+ closeIconStyles: PropTypes.object,
+ }),
+ disabled: PropTypes.bool,
+ isErrorTag: PropTypes.bool,
+ error: PropTypes.string,
+ hideClose:PropTypes.bool
+};
+
+
+Chip.defaultProps = {
+ hideClose:true
+};
+
+
+export default Chip;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/CitizenHomeCard.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/CitizenHomeCard.js
new file mode 100644
index 00000000..f5816206
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/CitizenHomeCard.js
@@ -0,0 +1,26 @@
+import React from "react";
+import { Link } from "react-router-dom";
+
+const CitizenHomeCard = ({ header, links = [], state, Icon, Info, isInfo = false, styles }) => {
+ return (
+
+
+
{header}
+
+
+
+
+ {links.map((e, i) => (
+
+
+ {e.i18nKey}
+
+
+ ))}
+
+
{isInfo ? : null}
+
+ );
+};
+
+export default CitizenHomeCard;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/CitizenInfoLabel.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/CitizenInfoLabel.js
new file mode 100644
index 00000000..082e3347
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/CitizenInfoLabel.js
@@ -0,0 +1,32 @@
+import React from "react";
+import { SVG } from "./SVG";
+import PropTypes from "prop-types";
+
+const CitizenInfoLabel = (props) => {
+ props = props?.props ? props?.props : props;
+ const showInfo = props?.showInfo ? props?.showInfo : true;
+
+ return (
+
+ {showInfo && (
+
+
+
{props?.info}
+
+ )}
+
{props?.text}
+
+ );
+};
+CitizenInfoLabel.propTypes = {
+ props: PropTypes.object, // An optional object of props.
+ showInfo: PropTypes.bool, // An optional boolean to control the visibility of the info banner.
+ className: PropTypes.string, // An optional string for custom class names.
+ style: PropTypes.object, // An optional object for custom styles.
+ fill: PropTypes.string, // An optional string for the icon fill color.
+ textStyle: PropTypes.object, // An optional object for custom text styles.
+ info: PropTypes.string, // An optional string for the info banner text.
+ text: PropTypes.string.isRequired, // A required string for the main text content.
+};
+
+export default CitizenInfoLabel;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/CollapseAndExpandGroups.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/CollapseAndExpandGroups.js
new file mode 100644
index 00000000..840465c9
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/CollapseAndExpandGroups.js
@@ -0,0 +1,44 @@
+import React, { useState } from "react";
+import { useTranslation } from "react-i18next";
+import { SVG } from "./SVG";
+import PropTypes from "prop-types";
+
+const CollapseAndExpandGroups = ({ children, groupElements = false, groupHeader = "", headerLabel = "", headerValue = "", customClass = "" }) => {
+ const { t } = useTranslation();
+ const [collapse, setCollapse] = useState(true);
+ return (
+
+ {groupHeader &&
}
+ {groupElements && (
+
+
{headerLabel}
+
{headerValue}
+
setCollapse((prev) => !prev)} className="digit-icon-toggle ">
+ {!collapse && (
+
+
+
+ )}
+ {collapse && (
+
+
+
+ )}
+
+
+ )}
+
{children}
+
+ );
+};
+
+CollapseAndExpandGroups.propTypes = {
+ children: PropTypes.node,
+ style: PropTypes.object,
+ customClass: PropTypes.string,
+ groupElements: PropTypes.bool,
+ groupHeader: PropTypes.string,
+ headerLabel: PropTypes.string,
+ headerValue: PropTypes.string,
+};
+export default CollapseAndExpandGroups;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/ConnectingCheckPoints.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/ConnectingCheckPoints.js
new file mode 100644
index 00000000..f37605fd
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/ConnectingCheckPoints.js
@@ -0,0 +1,59 @@
+import React from "react";
+import PropTypes from "prop-types";
+
+export const CheckPoint = (props) => {
+ return (
+
+
+
+ {props.label}
+ {props.info ? {props.info}
: null}
+ {props.customChild ? props.customChild : null}
+
+
+ );
+};
+
+export const ConnectingCheckPoints = (props) => {
+ if (props.children && props.children.length >= 1) {
+ return (
+
+ {props.children.map((child, index) => {
+ return props.children.length === ++index ? (
+ {child}
+ ) : (
+
+ );
+ })}
+
+ );
+ } else {
+ return null;
+ }
+};
+
+CheckPoint.propTypes = {
+ /**
+ * Is checkpoint completed or not?
+ */
+ isCompleted: PropTypes.bool,
+ /**
+ * key value
+ */
+ key: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
+ /**
+ * checkpoint content
+ */
+ label: PropTypes.string,
+ info: PropTypes.string,
+};
+
+CheckPoint.defaultProps = {
+ isCompleted: false,
+ key: 0,
+ label: "",
+ info: "",
+};
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/CustomSVG.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/CustomSVG.js
new file mode 100644
index 00000000..1108423d
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/CustomSVG.js
@@ -0,0 +1,3607 @@
+import React from "react";
+
+const CreateEstimateIcon = ({ className, style = {}, fill = "#C84C0E",width = '18',height ='18' }) => (
+
+
+
+);
+
+const GotoInboxIcon = ({ className, style = {}, fill = "#C84C0E",width="15",height="13" }) => (
+
+
+
+);
+
+const ArrowLeft = ({ className,width="19",height="19",fill="black"}) => (
+
+
+
+
+);
+
+const ArrowLeftWhite = ({ className, fill = "white", style = {},width="16",height="16" }) => (
+
+
+
+);
+const PrivacyMaskIcon = ({ className, style = {} ,width="22",height="15",fill="#EEEEEE"}) => (
+
+
+
+);
+
+const ArrowDown = ({ className, onClick, styles, disable,width="18",height="18",fill="black"}) => (
+
+
+
+
+);
+
+const ArrowBack = ({ className, onClick ,width="18",height="18",fill="black"}) => (
+
+
+
+
+);
+
+const ArrowForward = ({ className, onClick,width="18",height = "18",fill ="black" }) => (
+
+
+
+
+);
+
+const ArrowToFirst = ({ className, onClick,width="18",height="18",fill="#505A5F"}) => (
+
+
+
+);
+
+const ArrowToLast = ({ className, onClick,fill="#505A5F",width="18",height="18" }) => (
+
+
+
+);
+
+const DownloadPrefixIcon = ({ className, onClick,width="24",height="24",fill="#C84C0E" }) => (
+
+
+
+
+);
+
+const CameraSvg = ({ className, fill="black", width="46",height="42" }) => (
+
+
+
+
+);
+
+const DeleteBtn = ({ className, onClick, fill="white",width="18",height="18" }) => (
+
+
+
+
+);
+
+const SuccessSvg = ({ className,fill="#00703C" ,width="24",height="24"}) => (
+
+
+
+
+);
+
+const ErrorSvg = ({ className,fill="#D4351C" ,width="24",height="24" }) => (
+
+
+
+
+
+);
+
+const StarFilled = ({ className, id, onClick, styles, percentage = 100,fill="#C84C0E" ,width="48",height="48" }) => (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+);
+
+const StarEmpty = ({ className, onClick, styles,fill="#C84C0E" ,width="48",height="48" }) => (
+
+
+
+
+);
+
+const DownloadImgIcon = ({width="14",height="17",fill="#C84C0E"}) => (
+
+
+
+);
+
+const PrevIcon = ({fill="#0B0C0C" ,width="8",height="12"}) => (
+
+
+
+);
+
+const ViewsIcon = ({fill="#C84C0E" ,width="22",height="16"}) => (
+
+
+
+);
+
+const DocumentIcon = ({fill="#C84C0E" ,width="100",height="100",onClick}) => (
+
+
+
+);
+
+const DocumentIconSolid = ({fill="#FFFFFF" ,width="24",height="24"}) => (
+
+
+
+
+);
+
+const SurveyIconSolid = ({fill="#FFFFFF" ,width="24",height="24"}) => (
+
+
+
+
+);
+
+const PMBIcon = ({fill="#C84C0E" ,width="32",height="16"}) => (
+
+
+
+);
+
+const PMBIconSolid = ({fill="#FFFFFF" ,width="24",height="24"}) => (
+
+
+
+
+
+
+
+
+
+
+);
+
+const EventsIconSolid = ({fill="#FFFFFF" ,width="24",height="24"}) => (
+
+
+
+
+);
+
+const DustbinIcon = ({fill="#C84C0E" ,width="14",height="18"}) => (
+
+
+
+);
+
+const ImageIcon = ({fill="#000000" ,width="24",height="24"}) => (
+
+
+
+
+);
+
+// const DocumentSVG = ({className}) => < path d = "M0 0h24v24H0V0z" fill = "none" />
+// < path d = "M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11z" />
+//
+
+// const PDFSvg = ({className, width = 100, height = 100, style, viewBox="0 0 34 34" }) =>
+//
+//
+
+const DocumentSVG = ({fill="#505A5F" ,width="80",height="80",onClick}) => (
+
+
+
+);
+
+const PDFSvg = ({
+ className,
+ width = 80,
+ height = 80,
+ style = {
+ background: "#f6f6f6",
+ padding: "8px",
+ boxShadow: "0px 2px 0px #d6d5d3",
+ borderRadius: "4px",
+ },
+ viewBox = "0 0 80 80",
+ fill="#505A5F"
+}) => (
+
+
+
+);
+
+const SearchIconSvg = ({ className, onClick,fill="#C84C0E" ,width="24",height="24" }) => (
+
+
+
+
+);
+
+const CheckSvg = ({ className, style = {},fill="#C84C0E" ,width="24",height="24" }) => (
+
+
+
+
+);
+
+const RoundedCheck = ({ className,fill="#FFFFFF" ,width="24",height="24" }) => (
+
+
+
+
+);
+
+const Calender = ({ className, onClick,fill="black" ,width="24",height="24" }) => (
+
+
+
+
+);
+
+const Phone = ({ className, fillcolor, style,fill="#C84C0E" ,width="24",height="24" }) => (
+
+
+
+
+);
+
+const FilterSvg = ({ className,style,onClick,fill="#C84C0E" ,width="24",height="24" }) => (
+
+
+
+);
+
+const SortSvg = ({ className,fill="#505A5F" ,width="24",height="16" }) => (
+
+
+
+);
+
+const Close = ({ className, style,fill="#9E9E9E" ,width="24",height="24" }) => (
+
+
+
+);
+
+const Feedback = ({ className,fill="#C84C0E" ,width="24",height="24" }) => (
+
+
+
+);
+
+// Download Icon
+
+const GetApp = ({ className ,fill="#C84C0E" ,width="24",height="24" }) => (
+
+
+
+);
+
+const HamburgerIcon = ({ className, styles ,fill="#C84C0E" ,width="24",height="24" }) => (
+
+
+
+);
+
+export const HomeIcon = ({ className, styles,fill="#C84C0E" ,width="24",height="24" }) => (
+
+
+
+);
+
+export const LanguageIcon = ({ className, styles,fill="#C84C0E" ,width="24",height="24" }) => (
+
+
+
+);
+
+export const LogoutIcon = ({ className, styles,fill="#C84C0E" ,width="24",height="24" }) => (
+
+
+
+);
+
+const CalendarIcon = (props,fill="black" ,width="24",height="24") => (
+
+
+
+
+);
+
+const SortDown = (style,onClick,fill="#C84C0E" ,width="24",height="24") => (
+
+
+
+
+);
+
+const SortUp = (style,onClick,fill="#C84C0E" ,width="24",height="24") => (
+
+
+
+
+);
+
+const ArrowRightInbox = ({ style,fill="#C84C0E" ,width="20",height="14" }) => (
+
+
+
+);
+
+const ShippingTruck = ({ className, styles,fill="#C84C0E" ,width="24",height="24" }) => (
+
+
+
+
+);
+
+function CloseSvg({ onClick,fill="#C84C0E" ,width="24",height="24" }) {
+ return (
+
+
+
+
+ );
+}
+
+const UpwardArrow = ({ rotate = 0, marginRight = 0,fill="#00703C" ,width="11",height="16" }) => (
+
+
+
+);
+
+const DownwardArrow = (props,fill="#E54D42" ,width="24",height="24") => (
+
+);
+
+const DownloadIcon = ({ styles, className, onClick, fill = "#505A5F",width="19",height="24" }) => (
+
+
+
+);
+
+const GenericFileIcon = ({fill="#505A5F" ,width="80",height="100"}) => (
+
+
+
+);
+
+const ExternalLinkIcon = ({fill="#C84C0E" ,width="18",height="18"}) => (
+
+
+
+);
+
+const PrimaryDownlaodIcon = ({fill="#C84C0E" ,width="24",height="24"}) => (
+
+
+
+);
+
+const Ellipsis = ({ className, onClick,fill="#B1B4B6" ,width="4",height="16" }) => (
+
+
+
+);
+
+const Poll = ({fill="#C84C0E" ,width="40",height="40"}) => (
+
+
+
+
+);
+
+const Details = ({fill="#505A5F" ,width="21",height="16"}) => (
+
+
+
+);
+
+const FilterIcon = ({ onClick,fill="#505A5F" ,width="22",height="22" }) => (
+
+
+
+);
+
+const RefreshIcon = ({fill="#0B0C0C" ,width="16",height="22"}) => (
+
+
+
+);
+
+const RefreshSVG = ({fill="#505A5F" ,width="17",height="17"}) => (
+
+
+
+);
+
+const PrintIcon = ({fill="#505A5F" ,width="20",height="18"}) => (
+
+
+
+);
+function PropertyHouse({ className, styles,fill="#FFFFFF" ,width="24",height="24" }) {
+ return (
+
+
+
+
+ );
+}
+
+const InfoBannerIcon = ({ fill = "#3498DB", styles,width="20",height="20" }) => {
+ return (
+
+
+
+ );
+};
+const ShareIcon = ({ styles, className, fill = "#505A5F" ,width="18",height="20"}) => (
+
+
+
+);
+
+const RupeeIcon = ({ className,fill="#C84C0E" ,width="48",height="48" }) => (
+
+
+
+);
+
+const ComplaintIcon = ({ className, styles,fill="#FFFFFF" ,width="48",height="48" }) => (
+
+
+
+);
+
+const DropIcon = ({ className, styles,fill="#FFFFFF" ,width="28",height="34" }) => (
+
+
+
+);
+
+const Person = (style,fill="white" ,width="24",height="24") => (
+
+
+
+
+);
+
+const WhatsappIcon = ({fill="#C84C0E" ,width="24",height="24"}) => (
+
+
+
+);
+
+const EmailIcon = ({fill="#C84C0E" ,width="20",height="16"}) => (
+
+
+
+);
+
+const CaseIcon = ({ className, styles,fill="#FFFFFF" ,width="24",height="24" }) => (
+
+
+
+);
+
+const TLIcon = ({ className, styles,fill="#FFFFFF" ,width="24",height="24" }) => (
+
+
+
+);
+
+const PersonIcon = ({ className, styles,fill="#FFFFFF" ,width="24",height="24" }) => (
+
+
+
+);
+
+const ReceiptIcon = ({fill="white" ,width="24",height="24"}) => (
+
+
+
+
+);
+
+const AnnouncementIcon = ({width="28",height="28",fill="#C84C0E"}) => (
+
+
+
+);
+
+const PTIcon = ({ className, styles,fill="#FFFFFF" ,width="34",height="30" }) => (
+
+
+
+);
+
+const OBPSIcon = ({ className, styles,fill="#FFFFFF" ,width="34",height="30" }) => (
+
+
+
+);
+
+const OBPSIconSolidBg = ({fill="white" ,width="34",height="30"}) => (
+
+
+
+);
+
+const CitizenTruck = ({ className,fill="#C84C0E" ,width="40",height="40" }) => (
+
+
+
+);
+
+const FSMIcon = ({ className, styles,fill="#FFFFFF" ,width="40",height="40" }) => (
+
+
+
+);
+
+const EDCRIcon = ({ className,fill="#C84C0E" ,width="30",height="32" }) => (
+
+
+
+);
+
+const BPAIcon = ({ className,fill="#C84C0E" ,width="32",height="32" }) => (
+
+
+
+
+
+
+
+);
+
+const BPAHomeIcon = ({ className, styles,fill="#FFFFFF" ,width="34",height="30" }) => (
+
+
+
+);
+
+const HelpIcon = ({fill="#C84C0E" ,width="24",height="18"}) => (
+
+
+
+);
+const EventCalendar = ({fill="#C84C0E" ,width="24",height="27"}) => {
+ return (
+
+
+
+ );
+};
+
+const NotificationBell = ({fill="white" ,width="16",height="20"}) => (
+
+
+
+);
+
+const MapMarker = ({fill="#505A5F" ,width="10",height="14"}) => (
+
+
+
+);
+
+const Clock = ({fill="#505A5F" ,width="16",height="16"}) => (
+
+
+
+);
+
+const TickMark = ({ fill = "white",width="14",height="11" }) => (
+
+
+
+);
+
+const EditIcon = ({ style,fill="#C84C0E" ,width="24",height="24" }) => (
+
+
+
+);
+
+const SearchIcon = ({ className,fill="#505A5F" ,width="18",height="18" }) => (
+
+
+
+);
+
+const DeleteIcon = ({ style, fill,width="14",height="18" }) => (
+
+
+
+);
+
+const CreateLoiIcon = ({ style, fill = "#C84C0E",width="18",height="18" }) => (
+
+
+
+);
+
+const WSICon = ({ className, styles,fill="#FFFFFF" ,width="28",height="34" }) => (
+
+
+
+);
+
+const ArrowVectorDown = ({ className, styles,fill="#C84C0E" ,width="24",height="24" }) => (
+
+
+
+);
+
+const ArrowDirection = ({ className, styles,fill="#C84C0E" ,width="16",height="16" }) => (
+
+
+
+);
+
+const CameraIcon = ({fill="#C84C0E" ,width="40",height="40"}) => (
+
+
+
+
+);
+const RemoveIcon = ({fill="#C84C0E" ,width="24",height="30"}) => (
+
+
+
+);
+
+const GalleryIcon = ({fill="#C84C0E" ,width="40",height="34"}) => (
+
+
+
+);
+
+const EditPencilIcon = ({ className, width = 18, height = 18 ,fill="#505A5F"}) => (
+
+
+
+);
+const AddressBookIcon = ({ styles, className,fill="#B1B4B6",width="20",height="24" }) => (
+
+
+
+);
+
+const LocationIcon = ({ styles, className ,fill="#B1B4B6",width="14",height="20"}) => (
+
+
+
+);
+const CollectionsBookmarIcons = ({ styles, className,fill="#FFFFFF" ,width="22",height="28" }) => (
+
+
+
+);
+
+const FinanceChartIcon = ({ styles, className ,fill="#FFFFFF" ,width="30",height="30"}) => (
+
+
+
+);
+
+const CollectionIcon = ({ styles, className,fill="#FFFFFF" ,width="24",height="27" }) => (
+
+
+
+);
+
+const BillsIcon = ({ styles, className,fill="#FFFFFF", width="24",height="27" }) => (
+
+
+
+);
+
+const MCollectIcon = ({ styles, className,fill="#FFFFFF" ,width="37",height="35" }) => (
+
+
+
+);
+
+const PGRIcon = ({ styles, className,fill="#FFFFFF" ,width="35",height="39" }) => (
+
+
+
+);
+const FirenocIcon = ({ styles, className,fill="#FFFFFF" ,width="35",height="39" }) => (
+
+
+
+);
+const BirthIcon = ({ styles, className,fill="#FFFFFF" ,width="35",height="39" }) => (
+
+
+
+);
+const DeathIcon = ({ styles, className,fill="#FFFFFF" ,width="35",height="39" }) => (
+
+
+
+);
+const ErrorIcon = ({ className,fill="#FFFFFF" ,width="20",height="20" }) => (
+
+
+
+);
+const DownloadBtnCommon = ({fill="#C84C0E" ,width="112",height="32"}) => (
+
+
+
+
+);
+
+const PrintBtnCommon = ({fill="#505A5F" ,width="41",height="41"}) => (
+
+
+
+);
+
+const WhatsappIconGreen = ({ className, styles ,fill="#25D366" ,width="24",height="24"}) => (
+
+
+
+);
+
+const HelpLineIcon = ({ className, styles,fill="#0B0C0C" ,width="24",height="18" }) => (
+
+
+
+);
+
+const ServiceCenterIcon = ({ className, styles,fill="#0B0C0C" ,width="24",height="24" }) => (
+
+
+
+
+
+
+
+);
+
+const TimerIcon = ({ className, styles ,fill="#C84C0E" ,width="20",height="20"}) => (
+
+
+
+);
+
+const RupeeSymbol = ({ className, styles,fill="#C84C0E" ,width="13",height="18" }) => (
+
+
+
+);
+
+const ValidityTimeIcon = ({ className, styles,fill="#C84C0E" ,width="21",height="18" }) => (
+
+
+
+);
+
+const AddIcon = ({ styles, className, fill = "white" ,width="14",height="14"}) => (
+
+
+
+);
+
+const UploadIcon = ({
+ styles,
+ className,
+ fill = "white",
+ height = "64",
+ width = "64",
+}) => (
+
+
+
+
+
+
+
+
+
+
+);
+
+const DeleteIconv2 = ({
+ styles,
+ className,
+ fill = "#C84C0E",
+ height = "24",
+ width = "24",
+}) => (
+
+
+
+
+
+
+
+
+
+
+);
+
+const InfoIconOutline = ({
+ styles,
+ className,
+ fill = "#505A5F",
+ height = "20",
+ width = "20",
+}) => (
+
+
+
+);
+
+const FileIcon = ({
+ styles,
+ className,
+ fill = "white",
+ height = "24",
+ width = "24",
+}) => (
+
+
+
+
+
+
+
+
+
+
+);
+
+const SubtractIcon = ({ styles, className, fill = "white",width="12",height="14" }) => (
+
+
+
+);
+
+const AddNewIcon = ({ style,fill="#C84C0E" ,width="24",height="24" }) => (
+
+
+
+);
+
+const ViewReportIcon = ({fill="#C84C0E" ,width="30",height="30"}) => (
+
+
+
+);
+
+const InboxIcon = ({fill="#C84C0E" ,width="30",height="30"}) => (
+
+
+
+);
+
+const ArrowCollapseUp = ({fill="#0B0C0C",width="13",height="8"}) => (
+
+
+
+);
+
+const ArrowCollapseDown = ({fill="#0B0C0C",width="12",height="8"}) => (
+
+
+
+);
+
+const AddFilled = ({ style = {} ,width="15",height="15",fill="#C84C0E"}) => (
+
+
+
+);
+
+const NoResultsFoundIcon = ({fill="#C84C0E",width="336",height="262"}) => (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+);
+
+const WorksMgmtIcon = ({ fill = "white" ,width="34",height="36"}) => (
+
+
+
+
+);
+
+const BioMetricIcon = ({ fill = "#C84C0E" ,width="30",height="34"}) => (
+
+
+
+);
+
+const AddFileFilled = ({ className = "", fill = "#C84C0E", style = {} ,width="19",height="18"}) => (
+
+
+
+);
+
+const LocateIcon = ({ className = "" ,width="22",height="22",fill="#505A5F"}) => (
+
+
+
+);
+
+const ProjectIcon = ({ className = "", fill = "white", style = {},width="28",height="22" }) => (
+
+
+
+);
+const EstimateIcon = ({ className = "", fill = "none", style = {},width="28",height="31" }) => (
+
+
+
+
+
+);
+const OrganisationIcon = ({ className = "", fill = "none", style = {},width="32",height="32" }) => (
+
+
+
+);
+const WageseekerIcon = ({ className = "", fill = "none", style = {} ,width="32",height="26"}) => (
+
+
+
+);
+const ContractIcon = ({ className = "", fill = "none", style = {} ,width="24",height="27"}) => (
+
+
+
+
+
+
+
+
+
+
+
+
+);
+const DashboardIcon = ({ className = "", fill = "none", style = {},width="24",height="24" }) => (
+
+
+
+);
+const HelperIcon = ({ className = "", fill = "none", style = {},width="32", height="32" }) => (
+
+
+
+
+
+
+
+
+
+
+);
+const AttendanceIcon = ({ className = "", fill = "none", style = {},width="32",height="32" }) => (
+
+
+
+
+
+
+
+
+
+);
+const HRIcon = ({ className = "", fill = "white", style = {},width="28",height="28" }) => (
+
+
+
+);
+const MuktaHomeIcon = ({ className = "", fill = "white", style = {} ,width="28",height="23"}) => (
+
+
+
+);
+const DoubleTickIcon = ({ className = "", fill = "#C84C0E", style = {},width,height }) => (
+
+
+
+);
+const InfoIcon = ({ className = "", fill = "none", style = {},width,height }) => (
+
+
+
+);
+const PaymentIcon = ({ className = "", fill = "none", style = {},width,height }) => (
+
+
+
+
+
+
+
+
+
+
+);
+
+const HistoryIcon = ({ className = "", fill = "#C84C0E", style = {},width,height }) => (
+
+
+
+
+
+
+
+
+
+);
+
+const WarningIcon = ({ className = "", fill = "#C84C0E", style = {},width,height }) => (
+
+
+
+
+
+
+
+
+
+
+);
+
+const AttentionListIcon = ({ className = "", fill = "#C84C0E", style = {},width="36",height="36" }) => (
+
+
+
+);
+
+const XlsxFile = ({ className = "", fill = "none", style = {},width="38",height="38",onClick }) => (
+
+
+
+
+
+
+
+
+
+
+
+);
+
+const DocFile = ({ className = "", fill = "none", styles = {},width="33",height="36" ,onClick}) => (
+
+
+
+
+
+
+
+);
+const PdfFile = ({ className = "", fill = "none", style = {},width="33",height="36",onClick }) => (
+
+
+
+
+
+
+);
+const JpgFile = ({ className = "", fill = "none", style = {} ,width="33",height="36",onClick}) => (
+
+
+
+
+
+
+);
+
+const PngFile = ({ className = "", fill = "none", style = {} ,width="34",height="36",onClick}) => (
+
+
+
+
+
+
+);
+
+const DocUpload = ({ className = "", fill = "none", styles,width="100",height="100" }) => (
+
+
+
+
+
+
+
+
+
+
+
+);
+
+const DocXlsxUpload = ({ className = "", fill = "none", styles,width="100",height="100" }) => (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+);
+
+const DocdocUpload = ({ className = "", fill = "none", styles,width="100",height="100" }) => (
+
+
+
+
+
+
+
+
+
+
+);
+
+const DocPdfUpload = ({ className = "", fill = "none", styles ,width="100",height="100"}) => (
+
+
+
+
+
+
+
+
+
+);
+
+const ProfileIcon = ({ className, styles,width="32",height="32" }) => (
+
+
+
+
+
+);
+
+const ExpenditureIcon = BillsIcon;
+
+const AddIconNew = ({
+ width = "24",
+ height = "24",
+ fill = "#0B0C0C",
+ className = "",
+ style = {},
+ ...props
+}) => (
+
+
+
+);
+
+const PlaceholderSvg = ({width="800",height="800",fill}) => (
+
+
+
+
+);
+
+export const CustomSVG = {
+ PlaceholderSvg,
+ ProfileIcon,
+ AnnouncementIcon,
+ ReceiptIcon,
+ CreateEstimateIcon,
+ GotoInboxIcon,
+ ArrowLeft,
+ ArrowDown,
+ CameraSvg,
+ DeleteBtn,
+ DownloadIcon,
+ Ellipsis,
+ SuccessSvg,
+ ErrorSvg,
+ StarFilled,
+ StarEmpty,
+ SearchIconSvg,
+ CheckSvg,
+ RoundedCheck,
+ Calender,
+ Phone,
+ FilterSvg,
+ SortSvg,
+ Close,
+ Feedback,
+ GetApp,
+ HamburgerIcon,
+ ArrowBack,
+ ArrowForward,
+ ArrowRightInbox,
+ SortDown,
+ SortUp,
+ ShippingTruck,
+ CloseSvg,
+ CalendarIcon,
+ UpwardArrow,
+ DownwardArrow,
+ Poll,
+ FilterIcon,
+ RefreshIcon,
+ RefreshSVG,
+ Details,
+ PrintIcon,
+ PropertyHouse,
+ PrimaryDownlaodIcon,
+ InfoBannerIcon,
+ ShareIcon,
+ RupeeIcon,
+ ComplaintIcon,
+ DropIcon,
+ Person,
+ WhatsappIcon,
+ EmailIcon,
+ DocumentIcon,
+ DocumentIconSolid,
+ EventsIconSolid,
+ SurveyIconSolid,
+ PMBIconSolid,
+ DustbinIcon,
+ ExternalLinkIcon,
+ DownloadImgIcon,
+ ViewsIcon,
+ PrevIcon,
+ DocumentSVG,
+ ArrowToFirst,
+ ArrowToLast,
+ DownloadPrefixIcon,
+ CaseIcon,
+ PersonIcon,
+ PTIcon,
+ OBPSIcon,
+ OBPSIconSolidBg,
+ CitizenTruck,
+ FSMIcon,
+ EDCRIcon,
+ BPAIcon,
+ BPAHomeIcon,
+ HelpIcon,
+ NotificationBell,
+ MapMarker,
+ Clock,
+ EventCalendar,
+ ImageIcon,
+ TickMark,
+ PDFSvg,
+ EditIcon,
+ SearchIcon,
+ DeleteIcon,
+ CreateLoiIcon,
+ PMBIcon,
+ GenericFileIcon,
+ ArrowLeftWhite,
+ WSICon,
+ ArrowVectorDown,
+ ArrowDirection,
+ CameraIcon,
+ RemoveIcon,
+ GalleryIcon,
+ EditPencilIcon,
+ AddressBookIcon,
+ LocationIcon,
+ CollectionsBookmarIcons,
+ FinanceChartIcon,
+ CollectionIcon,
+ MCollectIcon,
+ PGRIcon,
+ TLIcon,
+ BillsIcon,
+ ErrorIcon,
+ DownloadBtnCommon,
+ PrintBtnCommon,
+ WhatsappIconGreen,
+ HelpLineIcon,
+ ServiceCenterIcon,
+ TimerIcon,
+ RupeeSymbol,
+ ValidityTimeIcon,
+ AddIcon,
+ SubtractIcon,
+ AddNewIcon,
+ ViewReportIcon,
+ InboxIcon,
+ PrivacyMaskIcon,
+ FirenocIcon,
+ BirthIcon,
+ DeathIcon,
+ ArrowCollapseUp,
+ ArrowCollapseDown,
+ AddFilled,
+ AddFileFilled,
+ LocateIcon,
+ /* Works Management */
+ NoResultsFoundIcon,
+ WorksMgmtIcon,
+ BioMetricIcon,
+ MuktaHomeIcon,
+ HRIcon,
+ ProjectIcon,
+ EstimateIcon,
+ ContractIcon,
+ AttendanceIcon,
+ WageseekerIcon,
+ OrganisationIcon,
+ HelperIcon,
+ DashboardIcon,
+ ExpenditureIcon,
+ DoubleTickIcon,
+ InfoIcon,
+ PaymentIcon,
+ HistoryIcon,
+ WarningIcon,
+ AttentionListIcon,
+ UploadIcon,
+ FileIcon,
+ DeleteIconv2,
+ InfoIconOutline,
+ XlsxFile,
+ JpgFile,
+ PdfFile,
+ DocFile,
+ PngFile,
+ DocUpload,
+ DocXlsxUpload,
+ DocPdfUpload,
+ DocdocUpload,
+ AddIconNew,
+};
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/DatePicker.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/DatePicker.js
new file mode 100644
index 00000000..edf5ca0b
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/DatePicker.js
@@ -0,0 +1,45 @@
+import React, { useState, useRef } from "react";
+import PropTypes from "prop-types";
+import { getUserType } from "../utils/digitUtils";
+
+const DatePicker = (props) => {
+ const dateInp = useRef();
+ const isCitizen = getUserType() === "citizen" ? true : false;
+
+ const selectDate = (e) => {
+ const date = e.target.value;
+ props?.onChange?.(date);
+ };
+
+ return (
+
+
+
+
+
+ );
+};
+
+DatePicker.propTypes = {
+ disabled: PropTypes.bool,
+ date: PropTypes.any,
+ min: PropTypes.any,
+ max: PropTypes.any,
+ defaultValue: PropTypes.any,
+ onChange: PropTypes.func,
+};
+
+export default DatePicker;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/DisplayPhotos.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/DisplayPhotos.js
new file mode 100644
index 00000000..8a306edd
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/DisplayPhotos.js
@@ -0,0 +1,45 @@
+import React from "react";
+import PropTypes from "prop-types";
+import { SVG } from "./SVG";
+import getFileTypeFromFileStoreURL from "../utils/getFileTypeFromFileStoreURL";
+
+const ImageOrPDFIcon = ({ source, index, last = false, onClick }) => {
+ return getFileTypeFromFileStoreURL(source) === "pdf" ? (
+
+ ) : (
+ onClick(source, index)}>
+ );
+};
+
+const DisplayPhotos = (props) => {
+ return (
+
+ {props.srcs.map((source, index) => {
+ return ;
+ })}
+
+ );
+};
+
+DisplayPhotos.propTypes = {
+ /**
+ * images
+ */
+ srcs: PropTypes.array,
+ /**
+ * optional click handler
+ */
+ onClick: PropTypes.func,
+};
+
+DisplayPhotos.defaultProps = {
+ srcs: [],
+};
+
+export default DisplayPhotos;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Divider.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Divider.js
new file mode 100644
index 00000000..98c4c437
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Divider.js
@@ -0,0 +1,13 @@
+import React from "react";
+import PropTypes from 'prop-types';
+
+const Divider = ({ className = "", style = {}, variant}) => {
+ return ;
+};
+
+Divider.propTypes = {
+ className: PropTypes.string,
+ style: PropTypes.object,
+};
+
+export default Divider;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Dropdown.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Dropdown.js
new file mode 100644
index 00000000..1412d04c
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Dropdown.js
@@ -0,0 +1,690 @@
+import PropTypes from "prop-types";
+import React, { useEffect, useRef, useState } from "react";
+import { SVG } from "./SVG";
+import TreeSelect from "./TreeSelect";
+import { CustomSVG } from "./CustomSVG";
+import Menu from "./Menu";
+import { Colors } from "../constants/colors/colorconstants";
+import { iconRender } from "../utils/iconRender";
+import { getUserType } from "../utils/digitUtils";
+import StringManipulator from "./StringManipulator";
+
+const TextField = (props) => {
+ const [value, setValue] = useState(
+ props.selectedVal ? props.selectedVal : ""
+ );
+
+ useEffect(() => {
+ if (!props.keepNull)
+ if (props.selectedVal) setValue(props.selectedVal);
+ else {
+ setValue("");
+ props.setFilter("");
+ }
+ else setValue("");
+ }, [props.selectedVal, props.forceSet]);
+
+ function inputChange(e) {
+ if (props.freeze) return;
+
+ setValue(e.target.value);
+ // the dropdown searchablility is made configurable through isSearchable prop
+ if (props.isSearchable) {
+ props.setFilter(e.target.value);
+ }
+ }
+
+ function broadcastToOpen() {
+ if (!props.disable) {
+ props.dropdownDisplay(true);
+ }
+ }
+
+ function broadcastToClose() {
+ props.dropdownDisplay(false);
+ }
+
+ const replaceDotWithColon = (inputString) => {
+ if (
+ props?.variant === "nesteddropdown" ||
+ (props?.variant === "treedropdown" && inputString)
+ ) {
+ const updatedInputString = inputString.replace(/\./g, ": ");
+ return updatedInputString;
+ }
+ return inputString;
+ };
+
+ /* Custom function to scroll and select in the dropdowns while using key up and down */
+ const keyChange = (e) => {
+ if (e.key == "ArrowDown") {
+ props.setOptionIndex((state) =>
+ state + 1 == props.addProps.length ? 0 : state + 1
+ );
+ if (props.addProps.currentIndex + 1 == props.addProps.length) {
+ e?.target?.parentElement?.parentElement?.children
+ ?.namedItem("jk-dropdown-unique")
+ ?.scrollTo?.(0, 0);
+ } else {
+ props?.addProps?.currentIndex > 2 &&
+ e?.target?.parentElement?.parentElement?.children
+ ?.namedItem("jk-dropdown-unique")
+ ?.scrollBy?.(0, 45);
+ }
+ e.preventDefault();
+ } else if (e.key == "ArrowUp") {
+ props.setOptionIndex((state) =>
+ state !== 0 ? state - 1 : props.addProps.length - 1
+ );
+ if (props.addProps.currentIndex == 0) {
+ e?.target?.parentElement?.parentElement?.children
+ ?.namedItem("jk-dropdown-unique")
+ ?.scrollTo?.(100000, 100000);
+ } else {
+ props?.addProps?.currentIndex > 2 &&
+ e?.target?.parentElement?.parentElement?.children
+ ?.namedItem("jk-dropdown-unique")
+ ?.scrollBy?.(0, -45);
+ }
+ e.preventDefault();
+ }
+ else if (e.key === "Enter") {
+ if (props.addProps.length === 1) {
+ props.addProps.selectOption(0);
+ }
+ else {
+ props.addProps.selectOption(props.addProps.currentIndex);
+ }
+ e.preventDefault();
+ }
+ };
+
+ return (
+ {
+ broadcastToClose();
+ props?.onBlur?.(e);
+ if (props.selectedVal !== props.filterVal) {
+ setTimeout(() => {
+ props.setforceSet((val) => val + 1);
+ }, 1000);
+ }
+ }}
+ onKeyDown={keyChange}
+ readOnly={props.disable}
+ autoFocus={props.autoFocus}
+ placeholder={props.placeholder}
+ autoComplete={"off"}
+ style={props.style}
+ title={props.showToolTip ? replaceDotWithColon(value) : undefined}
+ />
+ );
+};
+
+const translateDummy = (text) => {
+ return text;
+};
+
+const Dropdown = (props) => {
+ const user_type = getUserType();
+ const [dropdownStatus, setDropdownStatus] = useState(false);
+ const [menuStatus, setMenuStatus] = useState(false);
+ const [selectedOption, setSelectedOption] = useState(
+ props.selected ? props.selected : null
+ );
+ const [filterVal, setFilterVal] = useState("");
+ const [isActive, setIsActive] = useState(-1);
+ const [forceSet, setforceSet] = useState(0);
+ const [optionIndex, setOptionIndex] = useState(-1);
+ const optionRef = useRef(null);
+ const dropdownComponentRef = useRef(null);
+ const menuRef = useRef(null);
+ const selectorRef = useRef(null);
+ const hasCustomSelector = props.customSelector ? true : false;
+ const t = props.t || translateDummy;
+
+
+ const scrollIntoViewIfNeeded = () => {
+ if (dropdownComponentRef.current) {
+ const rect = dropdownComponentRef.current.getBoundingClientRect();
+ const viewportWidth = window.innerWidth;
+ const viewportHeight = window.innerHeight;
+
+ // Check if the component is outside the viewport
+ const isOutsideViewport =
+ rect.top < 0 || rect.left < 0 || rect.bottom > viewportHeight || rect.right > viewportWidth;
+
+ if (isOutsideViewport) {
+ // Scroll to make the component visible
+ dropdownComponentRef.current.scrollIntoView({
+ behavior: "smooth", // Optional: smooth scrolling
+ block: "center", // Scroll to the center vertically
+ inline: "center", // Scroll to the center horizontally
+ });
+ }
+ }
+ };
+
+ useEffect(() => {
+ scrollIntoViewIfNeeded();
+ }, []); // Runs on mount
+
+
+ useEffect(() => {
+ setSelectedOption(props.selected);
+ }, [props.selected]);
+
+ function dropdownSwitch() {
+ if (!props.disabled) {
+ var current = dropdownStatus;
+ if (!current) {
+ document.addEventListener("mousedown", handleClick, false);
+ }
+ setDropdownStatus(!current);
+ props?.onBlur?.();
+ }
+ }
+
+ function menuSwitch(){
+ if(!props.disabled){
+ var current = menuStatus;
+ if (!current) {
+ document.addEventListener("mousedown", handleClickOutside, false);
+ }
+ setMenuStatus(!current);
+ props?.onBlur?.();
+ }
+ }
+
+ function handleClickOutside(e) {
+ if (!menuRef.current || !menuRef.current.contains(e.target)) {
+ if(selectorRef?.current && selectorRef?.current.contains(e.target)){
+ return ;
+ }
+ else{
+ document.removeEventListener("mousedown", handleClickOutside, false);
+ setMenuStatus(false);
+ }
+ }
+ }
+
+ function handleClick(e) {
+ if (!optionRef.current || !optionRef.current.contains(e.target)) {
+ document.removeEventListener("mousedown", handleClick, false);
+ setDropdownStatus(false);
+ }
+ }
+
+ function dropdownOn(val) {
+ const waitForOptions = () => setTimeout(() => setDropdownStatus(val), 500);
+ const timerId = waitForOptions();
+ return () => {
+ clearTimeout(timerId);
+ };
+ }
+
+ function onSelect(val) {
+ if (val !== selectedOption || props.allowMultiselect) {
+ props.select(val);
+ setSelectedOption(val);
+ setDropdownStatus(false);
+ } else {
+ setSelectedOption(val);
+ setforceSet(forceSet + 1);
+ setDropdownStatus(false);
+ }
+ }
+
+ function setFilter(val) {
+ setFilterVal(val);
+ }
+
+ let filteredOption =
+ (props.option &&
+ props.option?.filter(
+ (option) =>
+ t(option[props?.optionKey])
+ ?.toUpperCase()
+ ?.indexOf(filterVal?.toUpperCase()) > -1
+ )) ||
+ [];
+ function selectOption(ind) {
+ const optionsToSelect =
+ props.variant === "nesteddropdown" || props.variant === "treedropdown"
+ ? flattenedOptions
+ : filteredOption;
+ onSelect(optionsToSelect[ind]);
+ }
+
+ if (props.isBPAREG && selectedOption) {
+ let isSelectedSameAsOptions =
+ props.option?.filter((ob) => ob?.code === selectedOption?.code)?.length >
+ 0;
+ if (!isSelectedSameAsOptions) setSelectedOption(null);
+ }
+
+ const inputBorderColor = Colors.lightTheme.generic.inputBorder;
+ const dividerColor = Colors.lightTheme.generic.divider;
+ const primaryColor = Colors.lightTheme.paper.primary;
+
+ const IconRender = (iconReq, isActive) => {
+ const iconFill = isActive ? primaryColor : inputBorderColor;
+ return iconRender(
+ iconReq,
+ iconFill,
+ "1.25rem",
+ "1.25rem",
+ ""
+ );
+ };
+
+ const flattenOptions = (options) => {
+ let flattened = [];
+
+ const flattenNestedOptions = (nestedOptions) => {
+ nestedOptions.forEach((nestedOption) => {
+ flattened.push(nestedOption);
+ if (nestedOption.options) {
+ flattenNestedOptions(nestedOption.options);
+ }
+ });
+ };
+
+ const parentOptionsWithChildren = options.filter(
+ (option) => option.options && option.options.length > 0
+ );
+
+ parentOptionsWithChildren.forEach((option) => {
+ if (option.options) {
+ flattened.push(option);
+ flattenNestedOptions(option.options);
+ } else {
+ flattened.push(option);
+ }
+ });
+
+ return flattened;
+ };
+
+ const flattenedOptions = flattenOptions(filteredOption);
+
+ const renderOption = (option, index) => {
+ const handleMouseDown = (e) => {
+ if (e.button === 0) setIsActive(index);
+ };
+ const handleMouseUp = () => {
+ setIsActive(-1);
+ };
+
+ return (
+ onSelect(option)}
+ onMouseDown={handleMouseDown}
+ onMouseUp={handleMouseUp}
+ >
+ {props?.variant === "profiledropdown" ||
+ props?.variant === "profilenestedtext" ? (
+
+ {!option?.profileIcon && (
+
+ )}
+
+ ) : null}
+
+
+ {props?.showIcon &&
+ option?.icon &&
+ IconRender(option?.icon, index === isActive)}
+ {props.isPropertyAssess ? (
+
+ {props.t
+ ? props.t(option[props?.optionKey])
+ : option[props?.optionKey]}
+
+ ) : (
+
+ {StringManipulator("TOSENTENCECASE", props.t
+ ? props.t(option[props?.optionKey])
+ : option[props?.optionKey])}
+
+ )}
+
+ {(props.variant === "nestedtextdropdown" ||
+ props.variant === "profilenestedtext") &&
+ option.description && (
+
{StringManipulator("TOSENTENCECASE", option.description)}
+ )}
+
+
+ );
+ };
+
+ const optionsToRender =
+ props.variant === "nesteddropdown" || props.variant === "treedropdown"
+ ? flattenedOptions
+ : filteredOption;
+
+ const parentOptionsWithChildren = filteredOption.filter(
+ (option) => option.options && option.options.length > 0
+ );
+
+ const renderOptions = () => {
+ return optionsToRender.map((option, index) => {
+ if (option.options) {
+ return (
+
+
+ {props.variant === "treedropdown" &&
+ option.options.length > 0 && (
+
+ )}
+ {StringManipulator("TOSENTENCECASE",t(option[props?.optionKey]))}
+
+
+ );
+ } else {
+ return renderOption(option, index);
+ }
+ });
+ };
+ return (
+
+ {(hasCustomSelector || props?.profilePic) && (
+
+ {props?.profilePic && (
+
+ {typeof props?.profilePic === "string"
+ ? props?.profilePic?.[0]?.toUpperCase()
+ : props?.profilePic}
+
+ )}
+ {!props?.profilePic && props?.customSelector}
+ {props?.showArrow && (
+
+
+
+ )}
+
+ )}
+
+ {!hasCustomSelector && !props?.profilePic && (
+
+
+ {props.showSearchIcon ? null : (
+
+ )}
+ {props.showSearchIcon ? (
+
+ ) : null}
+
+ )}
+ {(hasCustomSelector || props?.profilePic) && menuStatus && (
+
+
+
+ )}
+ {!hasCustomSelector && !props?.profilePIc && dropdownStatus ? (
+ props.optionKey ? (
+
+ {props.variant === "treedropdown" ? (
+
+ ) : (
+ renderOptions()
+ )}
+ {(props.variant === "nesteddropdown"
+ ? flattenedOptions
+ : filteredOption) &&
+ (props.variant === "nesteddropdown"
+ ? flattenedOptions
+ : filteredOption
+ ).length === 0 && (
+
{}}
+ >
+ { {t("NO_RESULTS_FOUND")} }
+
+ )}
+
+ ) : (
+
+ {props.option
+ ?.filter(
+ (option) =>
+ option?.toUpperCase().indexOf(filterVal?.toUpperCase()) > -1
+ )
+ .map((option, index) => {
+ return (
+
onSelect(option)}
+ >
+ {option}
+
+ );
+ })}
+
+ )
+ ) : null}
+
+ );
+};
+
+Dropdown.propTypes = {
+ customSelector: PropTypes.any,
+ showArrow: PropTypes.bool,
+ selected: PropTypes.any,
+ style: PropTypes.object,
+ option: PropTypes.array,
+ optionKey: PropTypes.any,
+ select: PropTypes.any,
+ t: PropTypes.func,
+};
+
+Dropdown.defaultProps = {
+ customSelector: null,
+ showArrow: true,
+ isSearchable: true,
+};
+
+export default Dropdown;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/ErrorBoundary.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/ErrorBoundary.js
new file mode 100644
index 00000000..075b977b
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/ErrorBoundary.js
@@ -0,0 +1,36 @@
+import Toast from "./Toast";
+import React, { Component } from 'react';
+
+class ErrorBoundary extends Component {
+ state = {
+ hasError: false,
+ error: null,
+ errorInfo: null
+ };
+
+ componentDidCatch(error, errorInfo) {
+ // Log the error to an error reporting service
+ console.error('Error caught by ErrorBoundary:', error, errorInfo);
+ this.setState({
+ hasError: true,
+ error: error,
+ errorInfo: errorInfo
+ });
+ }
+
+ render() {
+ if (this?.state?.hasError) {
+ // Render fallback UI
+ return (
+
+ {this?.state?.error?.toString() && }
+ {this?.props?.children}
+
+ );
+ }
+ // Render children normally
+ return this?.props?.children;
+ }
+}
+
+export default ErrorBoundary;
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/ErrorMessage.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/ErrorMessage.js
new file mode 100644
index 00000000..77d388fc
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/ErrorMessage.js
@@ -0,0 +1,55 @@
+import React from "react";
+import PropTypes from "prop-types";
+import { SVG } from "./SVG";
+import StringManipulator from "./StringManipulator";
+import { Colors} from "../constants/colors/colorconstants";
+
+const ErrorMessage = ({
+ wrapperClassName = "",
+ wrapperStyles = {},
+ showIcon,
+ iconStyles = {},
+ message,
+ className = "",
+ style = {},
+ truncateMessage,
+ maxLength,
+}) => {
+
+ const IconColor = Colors.lightTheme.alert.error;
+
+ return (
+
+ {showIcon && (
+
+
+
+ )}
+
+ {truncateMessage
+ ? StringManipulator(
+ "TOSENTENCECASE",
+ StringManipulator("TRUNCATESTRING", message, {
+ maxLength: maxLength || 256,
+ })
+ )
+ : StringManipulator("TOSENTENCECASE", message)}
+
+
+ );
+};
+
+ErrorMessage.propTypes = {
+ className: PropTypes.string,
+ style: PropTypes.object,
+ message: PropTypes.string,
+ showIcon: PropTypes.bool,
+ truncateMessage: PropTypes.bool,
+};
+
+export default ErrorMessage;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/FileUpload.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/FileUpload.js
new file mode 100644
index 00000000..e6bc285d
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/FileUpload.js
@@ -0,0 +1,553 @@
+import React, { useEffect, useRef, useState, Fragment } from "react";
+import PropTypes from "prop-types";
+import { useTranslation } from "react-i18next";
+import ErrorMessage from "./ErrorMessage";
+import StringManipulator from "./StringManipulator";
+import Chip from "./Chip";
+import { SVG } from "./SVG";
+import UploadWidget from "./UploadWidget";
+import UploadImage from "./UploadImage";
+import Button from "./Button";
+import { Colors} from "../constants/colors/colorconstants";
+import { CustomSVG } from "./CustomSVG";
+import { getUserType } from "../utils/digitUtils";
+
+const getRandomId = () => {
+ return Math.floor((Math.random() || 1) * 139);
+};
+
+const FileUpload = (props) => {
+ const { t } = useTranslation();
+ const inpRef = useRef();
+ const user_type = getUserType();
+ const [buttonLabel, setButtonLabel] = useState("Upload");
+ const [inputLabel, setInputLabel] = useState("");
+ const [uploadedFilesCount, setUploadedFilesCount] = useState(0);
+ const [uploadedFiles, setUploadedFiles] = useState([]);
+ const [previews, setPreviews] = useState([]);
+ const [errors, setErrors] = useState([]);
+
+ const handleFileUpload = async (e) => {
+ const files = props.variant === "uploadField" ? e.target.files : e;
+ const newErrors = [];
+ if (files.length > 0) {
+ const acceptedFiles = [];
+ for (let i = 0; i < files.length; i++) {
+ const file = files[i];
+ const { isValid, error } = validateFile(file, props);
+ if (isValid) {
+ acceptedFiles.push(file);
+ } else {
+ newErrors.push({ file, error });
+ }
+ }
+ let newFiles;
+ if (props.variant === "uploadImage" || props.variant === "uploadWidget") {
+ newFiles = files;
+ } else {
+ newFiles = props?.multiple ? [...uploadedFiles, ...files] : [files[0]];
+ }
+ setUploadedFiles(newFiles);
+ setUploadedFilesCount(newFiles.length);
+ setErrors([...errors, ...newErrors]);
+ }
+
+ if (props?.onUpload) {
+ const uploadResult = await props?.onUpload(uploadedFiles);
+ if (uploadResult && uploadResult.length !== 0) {
+ for (const { file, error } of uploadResult) {
+ const fileIndex = newErrors.findIndex((item) => item.file === file);
+ if (fileIndex !== -1) {
+ newErrors[fileIndex].error = error;
+ } else {
+ newErrors.push({ file, error });
+ }
+ }
+ }
+ }
+ };
+
+ const validateFile = (file, props) => {
+ let isValid = true;
+ let error = "";
+ const maxFileSize = props.validations?.maxSizeAllowedInMB;
+ const minFileSize = props.validations?.minSizeRequiredInMB;
+ const acceptedImageTypes = [
+ "image/png",
+ ".png",
+ ".jpeg",
+ ".jpg",
+ "image/jpeg",
+ "image/jpg",
+ ];
+
+ if (maxFileSize && Math.round(file?.size / 1024 / 1024) > maxFileSize) {
+ isValid = false;
+ error = "File size exceeds the maximum allowed size";
+ } else if (
+ minFileSize &&
+ Math.round(file?.size / 1024 / 1024) < minFileSize
+ ) {
+ isValid = false;
+ error = "File size is below the minimum required size";
+ }
+
+ if (
+ props.variant === "uploadImage" &&
+ !acceptedImageTypes.includes(file.type)
+ ) {
+ isValid = false;
+ error = "File type is not accepted";
+ }
+
+ return { isValid, error };
+ };
+
+ const handleButtonClick = () => {
+ inpRef.current.click();
+ };
+
+ const handleFileRemove = (fileToRemove) => {
+ if (!Array.isArray(uploadedFiles)) {
+ setUploadedFiles([]);
+ setUploadedFilesCount(0);
+ setErrors([]);
+ } else {
+ const updatedFiles = uploadedFiles.filter(
+ (file) => file !== fileToRemove
+ );
+ const updatedErrors = errors.filter(
+ (error) => error.file !== fileToRemove
+ );
+ setUploadedFiles(updatedFiles);
+ setUploadedFilesCount(updatedFiles.length);
+ setErrors(updatedErrors);
+ }
+ props?.removeTargetedFile && props?.removeTargetedFile(fileToRemove);
+ };
+
+ const handleFileDownload = (file) => {
+ if (file && file?.url) {
+ window.location.href = file?.url;
+ }
+ };
+
+ const generatePreview = (file) => {
+ return new Promise((resolve) => {
+ const reader = new FileReader();
+ reader.onload = (e) => {
+ const result = e.target.result;
+ resolve(result);
+ };
+ reader.readAsDataURL(file);
+ });
+ };
+
+ useEffect(() => {
+ const uploadFiles = async () => {
+ if (props?.onUpload) {
+ const uploadResult = await props?.onUpload(uploadedFiles);
+ if (uploadResult && uploadResult.length !== 0) {
+ setErrors((prevErrors) => {
+ const newErrors = [];
+ uploadResult.forEach(({ file, error }) => {
+ const existingErrorIndex = prevErrors.findIndex((item) => item.file === file);
+ if (existingErrorIndex !== -1) {
+ prevErrors[existingErrorIndex].error = error;
+ } else {
+ newErrors.push({ file, error });
+ }
+ });
+ return [...prevErrors, ...newErrors];
+ });
+ }
+ }
+ };
+ if (uploadedFiles.length > 0) {
+ uploadFiles();
+ }
+ }, [uploadedFiles,props?.onUpload]);
+
+ useEffect(() => {
+ setButtonLabel(
+ !props.multiple && uploadedFilesCount > 0 ? "Re-Upload" : "Upload"
+ );
+ }, [uploadedFilesCount, props.multiple]);
+
+ useEffect(() => {
+ setInputLabel(
+ uploadedFilesCount !== 0 ? `${uploadedFilesCount} Uploaded` : ""
+ );
+ }, [uploadedFilesCount]);
+
+ useEffect(() => {
+ const generatePreviews = async () => {
+ const previewsArray = [];
+ for (const file of uploadedFiles) {
+ if (file instanceof Blob) {
+ const preview = await generatePreview(file);
+ if (preview) {
+ const fileErrors = errors.filter((error) => error.file === file);
+ previewsArray.push({
+ file,
+ preview,
+ error: fileErrors.length > 0 ? fileErrors[0].error : null,
+ });
+ } else {
+ console.error("Failed to generate preview for:", file);
+ }
+ } else {
+ const blob = new Blob([file], { type: file?.type });
+ const preview = await generatePreview(blob);
+ if (preview) {
+ const fileErrors = errors.filter((error) => error.file === file);
+ previewsArray.push({
+ file,
+ preview,
+ error: fileErrors.length > 0 ? fileErrors[0].error : null,
+ });
+ } else {
+ console.error("Failed to generate preview for:", file);
+ }
+ console.error("Invalid file object:", file);
+ }
+ }
+ setPreviews(previewsArray);
+ };
+
+ generatePreviews();
+
+ return () => {
+ setPreviews([]);
+ };
+ }, [uploadedFiles]);
+
+ const showHint = props?.showHint || false;
+
+ const showLabel = props?.showLabel || false;
+
+ const { fileUrl, fileName = "Unknown File" } = Digit.Hooks.useQueryParams();
+
+ const changeToBlobAndCreateUrl = (file) => {
+ if (!file) return null;
+ const blob = new Blob([file], { type: file?.type });
+ return URL.createObjectURL(blob);
+ };
+
+ const documents = fileUrl
+ ? [{ uri: fileUrl, fileName }]
+ : uploadedFiles.map((file) => ({
+ uri: changeToBlobAndCreateUrl(file),
+ fileName: file?.name || fileName,
+ }));
+
+ const handleFileClick = (index, file) => {
+ const url = changeToBlobAndCreateUrl(file);
+ window.open(url, "_blank");
+ };
+
+ const primaryColor = Colors.lightTheme.paper.primary;
+ const errorColor = Colors.lightTheme.alert.error;
+
+ const getFileUploadIcon = (fileType, isError) => {
+ switch (fileType) {
+ case "application/pdf":
+ return (
+
+ );
+ case "application/vnd.ms-excel":
+ case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":
+ case "application/excel":
+ case "application/x-excel":
+ case "application/x-msexcel":
+ return (
+
+ );
+ case "application/vnd.openxmlformats-officedocument.wordprocessingml.document":
+ case "application/msword":
+ return (
+
+ );
+ default:
+ return (
+
+ );
+ }
+ };
+
+ const renderVariant = () => {
+ switch (props.variant) {
+ case "uploadWidget":
+ return (
+
+
+
+ );
+ case "uploadImage":
+ return (
+
+
+
+ );
+ case "uploadField":
+ default:
+ return (
+
+
+ {props?.showAsTags && (
+
+ {uploadedFiles?.map((file, index) => {
+ const fileErrors = errors.filter(
+ (error) => error.file === file
+ );
+ const isError = fileErrors.length > 0;
+ return (
+ {
+ e.stopPropagation();
+ handleFileRemove(file);
+ }}
+ isErrorTag={isError}
+ error={fileErrors[0]?.error}
+ onTagClick={() => handleFileClick(index, file)}
+ onErrorClick={(e) => e.stopPropagation()}
+ />
+ );
+ })}
+
+ )}
+ {props?.showAsPreview && (
+
+ {uploadedFiles.map((file, index) => {
+ const fileErrors = errors.filter(
+ (error) => error.file === file
+ );
+ const isError = fileErrors.length > 0;
+
+ return (
+
+ 1 ? " multiple" : "single"
+ } ${file?.type.startsWith("image/") ? "imageFile" : ""} ${isError ? "error" : ""}`}
+ >
+
{
+ handleFileClick(index, file);
+ }}
+ >
+ {file?.type.startsWith("image/") ? (
+
+ ) : (
+ getFileUploadIcon(file?.type, isError)
+ )}
+
+
{
+ handleFileClick(index, file);
+ }}
+ >
+
+ {file?.name && !isError ? file?.name : ""}
+
+
{
+ handleFileRemove(file);
+ }}
+ className={`digit-uploader-close-icon ${
+ isError ? "error" : ""
+ }`}
+ >
+
+
+ {fileErrors[0]?.error && (
+
+ )}
+
+
+ );
+ })}
+
+ )}
+
+ );
+ }
+ };
+
+ return (
+
+
+ {showLabel &&
{t(props?.label)}
}
+ {renderVariant()}
+ {props?.iserror && (
+
+ )}
+ {showHint && (
+
+ {StringManipulator(
+ "toSentenceCase",
+ StringManipulator("truncateString", t(props?.hintText), {
+ maxLength: 256,
+ })
+ )}
+
+ )}
+
+
+ );
+};
+
+FileUpload.propTypes = {
+ hintText: PropTypes.string,
+ showHint: PropTypes.bool,
+ label: PropTypes.string,
+ showLabel: PropTypes.bool,
+ showAsTags: PropTypes.bool,
+ showAsPreview: PropTypes.bool,
+ customClass: PropTypes.string,
+ uploadedFiles: PropTypes.arrayOf(
+ PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.object]))
+ ),
+ disableButton: PropTypes.bool,
+ buttonType: PropTypes.string,
+ onUpload: PropTypes.func,
+ removeTargetedFile: PropTypes.func,
+ onDelete: PropTypes.func,
+ iserror: PropTypes.string,
+ disabled: PropTypes.bool,
+ inputStyles: PropTypes.object,
+ multiple: PropTypes.bool,
+ accept: PropTypes.string,
+ id: PropTypes.string,
+ showDownloadButton: PropTypes.bool,
+ showReUploadButton: PropTypes.bool,
+};
+
+FileUpload.defaultProps = {
+ disableButton: false,
+};
+
+export default FileUpload;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Footer.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Footer.js
new file mode 100644
index 00000000..16b642c5
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Footer.js
@@ -0,0 +1,76 @@
+import React,{useState,useEffect} from "react";
+import PropTypes from "prop-types";
+
+const Footer = (props) => {
+
+ const [isMobileView, setIsMobileView] = useState(window.innerWidth <= 480);
+ const onResize = () => {
+ if (window.innerWidth <= 480) {
+ if (!isMobileView) {
+ setIsMobileView(true);
+ }
+ } else {
+ if (isMobileView) {
+ setIsMobileView(false);
+ }
+ }
+ };
+ useEffect(() => {
+ window.addEventListener("resize", () => {
+ onResize();
+ });
+ return () => {
+ window.removeEventListener("resize", () => {
+ onResize();
+ });
+ };
+ });
+
+ const hasActionFields = props?.actionFields?.length > 0;
+ const allowedActionFields = hasActionFields
+ ? props?.actionFields.slice(0, props?.maxActionFieldsAllowed || 5)
+ : [];
+ const sortedActionFields = [...allowedActionFields].sort((a, b) => {
+ const typeOrder = { primary: 3, secondary: 2, tertiary: 1 };
+ const getTypeOrder = (button) =>
+ typeOrder[(button.props.variation || "").toLowerCase()];
+ return getTypeOrder(a) - getTypeOrder(b);
+ });
+ const finalActionFields = props?.sortActionFields
+ ? isMobileView
+ ? sortedActionFields.reverse()
+ : sortedActionFields
+ : allowedActionFields;
+
+
+
+ return (
+
+ {hasActionFields && (
+
+ {finalActionFields.map((field, index) => (
+
+ {field}
+
+ ))}
+
+ )}
+ {props?.children}
+
+ );
+};
+
+Footer.propTypes = {
+ /** custom class of the svg icon */
+ className: PropTypes.string,
+ /** custom style of the svg icon */
+ style: PropTypes.object,
+};
+
+export default Footer;
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Hamburger.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Hamburger.js
new file mode 100644
index 00000000..910cd06d
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Hamburger.js
@@ -0,0 +1,357 @@
+import React, { useState,Fragment ,useRef,useEffect} from "react";
+import { useTranslation } from "react-i18next";
+import PropTypes from "prop-types";
+import { SVG } from "./SVG";
+import { CustomSVG } from "./CustomSVG";
+import Button from "./Button";
+import TextInput from "./TextInput";
+import { Colors } from "../constants/colors/colorconstants";
+import { iconRender } from "../utils/iconRender";
+import { Spacers } from "../constants/spacers/spacers";
+
+const Hamburger = ({
+ items,
+ profileName,
+ profileNumber,
+ theme,
+ className,
+ styles,
+ hideUserManuals,
+ userManualLabel,
+ profile,
+ usermanuals,
+ onSelect,
+ onLogout,
+ reopenOnLogout,
+ closeOnClickOutside,
+ onOutsideClick
+}) => {
+ const { t } = useTranslation();
+ const [searchTerms, setSearchTerms] = useState({});
+ const [selectedItem, setSelectedItem] = useState({});
+ const [expandedItems, setExpandedItems] = useState({});
+ const [openUserManuals, setOpenUserManuals] = useState(false);
+ const [showHamburger,setShowHamburger] = useState(true);
+ const sidebarRef = useRef(null);
+
+ const iconSize = Spacers.spacer6;
+
+ useEffect(() => {
+ if (!closeOnClickOutside && !onOutsideClick) return;
+
+ const handleClickOutside = (event) => {
+ if (sidebarRef.current && !sidebarRef.current.contains(event.target)) {
+ if (onOutsideClick) {
+ onOutsideClick(event);
+ }
+ if (closeOnClickOutside) {
+ setShowHamburger(false);
+ }
+ }
+ };
+
+ document.addEventListener("mousedown", handleClickOutside);
+
+ return () => {
+ document.removeEventListener("mousedown", handleClickOutside);
+ };
+ }, [closeOnClickOutside, onOutsideClick]);
+
+
+ const handleItemClick = (item, index, parentIndex) => {
+ setSelectedItem({ item: item, index: index, parentIndex: parentIndex });
+ onSelect && onSelect({ item: item, index: index, parentIndex: parentIndex });
+ };
+
+ const handleSearchChange = (index, value) => {
+ setSearchTerms((prev) => ({
+ ...prev,
+ [index]: value,
+ }));
+ };
+
+ const onLogoutClick = () => {
+ setShowHamburger(false);
+ onLogout && onLogout();
+ onLogout && reopenOnLogout && setShowHamburger(true);
+ }
+
+ const filterItems = (items, searchTerm) => {
+ return items?.filter((item) => {
+ if (item?.label?.toLowerCase().includes(searchTerm.toLowerCase())) {
+ return true;
+ }
+ if (item?.children) {
+ item.children = filterItems(item?.children, searchTerm);
+ return item?.children.length > 0;
+ }
+ return false;
+ });
+ };
+
+ const darkThemeIconColor = Colors.lightTheme.paper.primary;
+ const lightThemeIconColor = Colors.lightTheme.primary[2];
+
+ const renderSearch = (index) => (
+
+ handleSearchChange(index, e.target.value)}
+ placeholder="Search"
+ autoFocus={true}
+ iconFill={theme === "dark" ? darkThemeIconColor : lightThemeIconColor}
+ >
+
+ );
+
+ const handleArrowClick = (item, index, parentIndex) => {
+ if (item?.children) {
+ setExpandedItems((prev) => ({
+ ...prev,
+ [index]: !prev[index],
+ }));
+ }
+ else {
+ handleItemClick(item, index, parentIndex);
+ }
+ };
+
+ const userManualsToShow =
+ usermanuals && usermanuals.length > 0
+ ? usermanuals
+ : [
+ {
+ label: "Help",
+ icon: "Home",
+ },
+ {
+ label: "Settings",
+ icon: "Settings",
+ },
+ ];
+
+ const Icon = (icon,className) =>{
+ return (
+ iconRender(
+ icon,
+ theme === "light" ? lightThemeIconColor : darkThemeIconColor,
+ iconSize,
+ iconSize,
+ className
+ )
+ )
+ }
+ const renderItems = (items, parentIndex = -1) => items?.map((item, index) => {
+ const currentIndex = parentIndex >= 0 ? `${parentIndex}-${index}` : index;
+ const isExpanded = expandedItems[currentIndex];
+ const isTopLevel = parentIndex === -1;
+ return (
+ <>
+
+
handleArrowClick(item, currentIndex, parentIndex)}
+ tabIndex={0}
+ >
+ {item?.icon && Icon(item?.icon,"digit-msb-icon")}
+ {{item?.label} }
+ {item?.children && (
+
+ {isExpanded ? (
+
+ ) : (
+
+ )}
+
+ )}
+
+
+ {item?.children && isExpanded && (
+
+ {item?.isSearchable && renderSearch(currentIndex)}
+ {filterItems(item?.children, searchTerms[currentIndex] || "")
+ .length > 0 ? (
+ renderChildItems(
+ filterItems(item?.children, searchTerms[currentIndex] || ""),
+ currentIndex,
+ false
+ )
+ ) : (
+
{t("No Results Found")}
+ )}
+
+ )}
+ >
+ );
+ });
+
+ const renderChildItems = (items, parentIndex = -1, isUserManual) =>
+ items?.map((item, index) => {
+ const currentIndex = parentIndex >= 0 ? `${parentIndex}-${index}` : index;
+ const isExpanded = expandedItems[currentIndex];
+ const icon = item?.icon ? Icon(item?.icon,"digit-icon-msb") : null;
+ return (
+ <>
+
+
handleItemClick(item, currentIndex, parentIndex)}
+ tabIndex={0}
+ >
+ {icon}
+ {/* {item.icon && Icon(item.icon, "digit-icon-msb")} */}
+ {
+
+ {item?.label}
+
+ }
+ {item?.children && (
+ {
+ e.stopPropagation();
+ handleArrowClick(item, currentIndex, parentIndex);
+ }}
+ >
+ {isExpanded ? (
+
+ ) : (
+
+ )}
+
+ )}
+
+
+
+ {item?.children && isExpanded && (
+
+ {renderChildItems(item?.children, currentIndex)}
+
+ )}
+
+ >
+ );
+ });
+
+ const filteredItems = filterItems(items, searchTerms["root"] || "");
+
+ return showHamburger ? (
+
+
+ {!profile &&
}
+ {profile && (
+
+ )}
+
+
{profileName}
+
+ {profileNumber}
+
+
+
+
{renderItems(filteredItems)}
+ {!hideUserManuals && (
+
+
setOpenUserManuals(!openUserManuals)}
+ >
+
+ {
+
+ }
+
+
+ {t(userManualLabel) || t("UserManuals")}
+
+
+
+ )}
+ {
+ openUserManuals && (
+ renderChildItems(userManualsToShow,-1,true)
+ )
+ }
+
+
+
+
+ ) : null;
+};
+
+Hamburger.propTypes = {
+ items: PropTypes.arrayOf(
+ PropTypes.shape({
+ path: PropTypes.string,
+ icon: PropTypes.node.isRequired,
+ label: PropTypes.string.isRequired,
+ })
+ ).isRequired,
+ profileName: PropTypes.string,
+ profileNumber: PropTypes.string,
+ isSearchable:PropTypes.bool,
+ userManualLabel:PropTypes.string,
+ reopenOnLogout:PropTypes.bool
+};
+
+export default Hamburger;
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/HamburgerButton.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/HamburgerButton.js
new file mode 100644
index 00000000..75ad91b9
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/HamburgerButton.js
@@ -0,0 +1,10 @@
+import React from "react";
+import { CustomSVG } from "./CustomSVG";
+
+const HamburgerButton = ({ handleClick, color ,className}) => (
+
+
+
+);
+
+export default HamburgerButton;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Header.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Header.js
new file mode 100644
index 00000000..8c905f31
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Header.js
@@ -0,0 +1,160 @@
+import React, { useEffect, useState, Fragment } from "react";
+import PropTypes from "prop-types";
+import Hamburger from "./Hamburger";
+import { IMAGES} from "../constants/images/images";
+import { Colors} from "../constants/colors/colorconstants";
+
+const Header = ({
+ img,
+ className,
+ style,
+ theme,
+ setImageToLeft,
+ onImageClick,
+ onLogoClick,
+ onHamburgerClick,
+ props,
+ logo,
+ ulb,
+ actionFields,
+}) => {
+ const [isMobileView, setIsMobileView] = useState(window.innerWidth <= 768);
+ const onResize = () => {
+ if (window.innerWidth <= 768) {
+ if (!isMobileView) {
+ setIsMobileView(true);
+ }
+ } else {
+ if (isMobileView) {
+ setIsMobileView(false);
+ }
+ }
+ };
+ useEffect(() => {
+ window.addEventListener("resize", () => {
+ onResize();
+ });
+ return () => {
+ window.addEventListener("resize", () => {
+ onResize();
+ });
+ };
+ });
+
+ const getImageUrl = (imageKey) => {
+ return IMAGES[imageKey] ;
+ };
+
+ const digitImg = img || (theme === "dark" ? getImageUrl('DIGIT_DARK') : getImageUrl('DIGIT_LIGHT'));
+ const darkThemeColor = Colors.lightTheme.paper.primary;
+ const lightThemeColor = Colors.lightTheme.text.primary;
+
+ if (isMobileView) {
+ return (
+
+
+
+
onImageClick()}
+ width={"80px"}
+ height={"19px"}
+ />
+
+
+ {ulb}
+
+
+
+ );
+ }
+
+ return (
+
+ {!setImageToLeft && (
+
+ {logo && (
+
+
onLogoClick()}
+ width={props?.logoWidth || "32px"}
+ height={props?.logoHeight || "32px"}
+ />
+
+ )}
+
{ulb}
+
+ )}
+ {setImageToLeft && (
+
+
onImageClick()}
+ width={"80px"}
+ height={"19px"}
+ />
+
+ )}
+
+ {actionFields && (
+ <>
+ {actionFields.map((field, index) => (
+
+ {field}
+
+ ))}
+ >
+ )}
+ {
+ (!setImageToLeft) && (
+
onImageClick()}
+ width={"80px"}
+ height={"19px"}
+ />
+ )
+ }
+
+
+ );
+};
+Header.propTypes = {
+ img: PropTypes.string,
+ className: PropTypes.string,
+ style: PropTypes.object,
+ theme: PropTypes.string,
+ setImageToLeft: PropTypes.bool,
+ onImageClick: PropTypes.func,
+ onLogoClick: PropTypes.func,
+ onHamburgerClick: PropTypes.func,
+ props: PropTypes.object,
+ logo: PropTypes.string,
+};
+Header.defaultProps = {
+ img: undefined,
+};
+export default Header;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/HeaderBar.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/HeaderBar.js
new file mode 100644
index 00000000..ae8effe4
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/HeaderBar.js
@@ -0,0 +1,26 @@
+import React from "react";
+import PropTypes from "prop-types";
+
+const HeaderBar = (props) => {
+ return (
+
+ {props.start ?
{props.start}
: null}
+ {props.main ?
{props.main}
: null}
+ {props.end ?
{props.end}
: null}
+
+ );
+};
+
+HeaderBar.propTypes = {
+ start: PropTypes.any,
+ main: PropTypes.any,
+ end: PropTypes.any,
+};
+
+HeaderBar.defaultProps = {
+ start: "",
+ main: "",
+ end: "",
+};
+
+export default HeaderBar;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/HeaderComponent.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/HeaderComponent.js
new file mode 100644
index 00000000..2b040f15
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/HeaderComponent.js
@@ -0,0 +1,18 @@
+import React from "react";
+import PropTypes from "prop-types";
+
+const HeaderComponent = (props) => {
+ return (
+
+ );
+};
+
+HeaderComponent.propTypes = {
+ className: PropTypes.string,
+ styles: PropTypes.object,
+ children: PropTypes.node,
+};
+
+export default HeaderComponent;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/HomeFooter.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/HomeFooter.js
new file mode 100644
index 00000000..d47b00b1
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/HomeFooter.js
@@ -0,0 +1,22 @@
+import React from "react";
+
+function HomeFooter(props) {
+ const info = window?.Digit?.UserService?.getUser()?.info || null;
+ const userType = info?.type || null;
+ const additionalClassname = userType === "EMPLOYEE" ? "employee" : "citizen";
+
+ return (
+
+
{
+ window.open(window?.globalConfigs?.getConfig?.("DIGIT_HOME_URL"), "_blank").focus();
+ }}
+ />
+
+ );
+}
+
+export default HomeFooter;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/HorizontalNav.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/HorizontalNav.js
new file mode 100644
index 00000000..430369ae
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/HorizontalNav.js
@@ -0,0 +1,39 @@
+import React, {useState} from 'react'
+import { useTranslation } from 'react-i18next'
+
+const HorizontalNav = ({ configNavItems, activeLink, setActiveLink, showNav = false, children, customStyle = {}, customClassName = "", inFormComposer = true, navClassName = "", navStyles = {} }) => {
+ const { t } = useTranslation()
+
+ const setActive = (item) => {
+ setActiveLink(item.name)
+ }
+
+ const MenuItem = ({ item }) => {
+ let itemComponent = item.code;
+
+ const Item = () => (
+
+ {t(itemComponent)}
+
+ );
+
+ return (
+
+ );
+ };
+ return (
+
+ {showNav &&
+ {configNavItems?.map((item, index) => (
+
setActive(item)}>
+
+
+ ))}
+
+ }
+ {children}
+
+ )
+}
+
+export default HorizontalNav
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Iframe.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Iframe.js
new file mode 100644
index 00000000..0772beb1
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Iframe.js
@@ -0,0 +1,16 @@
+import React from "react";
+
+const Iframe = (props) => {
+ return (
+
+ );
+};
+
+export default Iframe;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/InboxSearchLinks.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/InboxSearchLinks.js
new file mode 100644
index 00000000..43ae10d8
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/InboxSearchLinks.js
@@ -0,0 +1,66 @@
+import React, { useState, useEffect,useMemo } from "react";
+import { useTranslation } from "react-i18next";
+import { Link } from "react-router-dom";
+import { iconRender } from "../utils/iconRender";
+
+const InboxSearchLinks = ({
+ headerText,
+ links,
+ businessService,
+ customClass = "",
+ logoIcon,
+}) => {
+ const { t } = useTranslation();
+ const userRoles = useMemo(() => Digit.UserService.getUser().info.roles, []);
+ const memoizedLinks = useMemo(() => links, [links]);
+ const [linksToShow, setLinksToShow] = useState([]);
+
+ useEffect(() => {
+ let filteredLinks = memoizedLinks.filter(
+ ({ roles }) =>
+ roles.some((role) =>
+ userRoles.map(({ code }) => code).includes(role)
+ ) || !roles?.length
+ );
+
+ if (JSON.stringify(filteredLinks) !== JSON.stringify(linksToShow)) {
+ setLinksToShow(filteredLinks);
+ }
+ }, [memoizedLinks, userRoles]);
+
+ const renderHeader = () => (
+
+
+ {logoIcon?.component &&
+ iconRender(
+ logoIcon?.component,
+ "#C84C0E",
+ "2rem",
+ "2rem",
+ logoIcon?.customClass
+ )}
+
+ {t(headerText)}
+
+ );
+ return (
+
+ {renderHeader()}
+
+ {linksToShow.map(({ url, text, hyperlink = false }, index) => {
+ return (
+
+ { hyperlink ? (
+ {t(text)}
+ ) : (
+ {t(text)}
+ )}
+
+ );
+ })}
+
+
+ );
+};
+
+export default InboxSearchLinks;
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/InfoButton.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/InfoButton.js
new file mode 100644
index 00000000..4b518a2b
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/InfoButton.js
@@ -0,0 +1,117 @@
+import React from "react";
+import PropTypes from "prop-types";
+import StringManipulator from "./StringManipulator";
+import { Colors} from "../constants/colors/colorconstants";
+import { iconRender } from "../utils/iconRender";
+
+const InfoButton = (props) => {
+
+ const primaryIconColor = Colors.lightTheme.paper.primary;
+
+ //To render the icon
+ const IconRender = () => {
+ const iconFill = primaryIconColor
+ const iconReq = props?.icon;
+ let width = "1.5rem";
+ let height = "1.5rem";
+
+ if (props.size === "medium") {
+ width = "1.25rem";
+ height = "1.25rem";
+ } else if (props.size === "small") {
+ width = "0.875rem";
+ height = "0.875rem";
+ }
+ return iconRender(
+ iconReq,
+ iconFill,
+ width,
+ height,
+ `digit-button-customIcon ${props?.size ? props?.size : ""} ${props?.variation ? props?.variation : ""} `
+ );
+ };
+
+ const icon = IconRender();
+
+ const formattedLabel =
+ props?.variation === "link"
+ ? props?.label
+ : StringManipulator(
+ "CAPITALIZEFIRSTLETTER",
+ StringManipulator("TRUNCATESTRING", props?.label, {
+ maxLength: 64,
+ })
+ );
+
+ return (
+
+
+ {!props?.isSuffix && props?.icon && icon}
+
+ {formattedLabel}
+
+ {props?.isSuffix && props?.icon && icon}
+
+
+ );
+};
+
+InfoButton.propTypes = {
+ isDisabled: PropTypes.bool,
+ /**
+ * ButtonSelector content
+ */
+ label: PropTypes.string.isRequired,
+ /**
+ * button icon if any
+ */
+ icon: PropTypes.string,
+ /**
+ * click handler
+ */
+ onClick: PropTypes.func.isRequired,
+ /**
+ * Custom classname
+ */
+ className: PropTypes.string,
+ /**
+ * Custom styles
+ */
+ style: PropTypes.object,
+ /**
+ * Custom label style or h2 style
+ */
+ textStyles: PropTypes.object,
+ /**
+ * button icon position
+ */
+ isSuffix: PropTypes.bool,
+ /**
+ * button size
+ */
+ size: PropTypes.string,
+
+ infobuttontype: PropTypes.string,
+};
+
+InfoButton.defaultProps = {
+ label: "",
+ onClick: () => {},
+ infobuttontype:"info"
+};
+
+export default InfoButton;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/InputTextAmount.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/InputTextAmount.js
new file mode 100644
index 00000000..d4519074
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/InputTextAmount.js
@@ -0,0 +1,29 @@
+import React, { useEffect, useState } from "react";
+import PropTypes from "prop-types";
+import { getIntlConfig } from "../utils/amountFormatter";
+import { InputAmountWrapper } from "../utils/inputAmountWrapper";
+
+const InputTextAmount = ({ value, prefix = "₹ ", intlConfig = getIntlConfig(prefix), onChange, inputRef, variant, ...otherProps }) => {
+ return (
+
+ );
+};
+
+InputTextAmount.propTypes = {
+ value: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
+ prefix: PropTypes.string,
+ intlConfig: PropTypes.object,
+ onChange: PropTypes.func,
+ inputRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({ current: PropTypes.instanceOf(Element) })]),
+ otherProps: PropTypes.object,
+};
+
+export default InputTextAmount;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/KeyNote.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/KeyNote.js
new file mode 100644
index 00000000..d4d60b06
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/KeyNote.js
@@ -0,0 +1,29 @@
+import React from "react";
+import PropTypes from "prop-types";
+
+const KeyNote = ({ keyValue, note, caption, noteStyle, children, privacy, className = "", style = {} }) => {
+ return (
+
+
{keyValue}
+
+
{caption}
+ {children}
+
+ );
+};
+
+KeyNote.propTypes = {
+ keyValue: PropTypes.string,
+ note: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
+ noteStyle: PropTypes.any,
+};
+
+KeyNote.defaultProps = {
+ keyValue: "",
+ note: "",
+ noteStyle: {},
+};
+
+export default KeyNote;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/LabelFieldPair.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/LabelFieldPair.js
new file mode 100644
index 00000000..5e4cb613
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/LabelFieldPair.js
@@ -0,0 +1,20 @@
+import React from "react";
+import PropTypes from "prop-types";
+
+const LabelFieldPair = (props) => {
+ return (
+
+ {props.children}
+
+ );
+};
+
+LabelFieldPair.propTypes = {
+ className: PropTypes.string, // An optional string for custom class names.
+ style: PropTypes.object, // An optional object for custom styles.
+ children: PropTypes.node.isRequired, // Required prop for the content of the label-field pair.
+ vertical:PropTypes.bool,
+ removeMargin:PropTypes.bool
+};
+
+export default LabelFieldPair;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/LinkLabel.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/LinkLabel.js
new file mode 100644
index 00000000..f008e2c7
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/LinkLabel.js
@@ -0,0 +1,11 @@
+import React from "react";
+
+const LinkLabel = (props) => {
+ return (
+
+ {props.children}
+
+ );
+};
+
+export default LinkLabel;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Loader.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Loader.js
new file mode 100644
index 00000000..cb3ec836
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Loader.js
@@ -0,0 +1,62 @@
+import React from "react";
+import PropTypes from "prop-types";
+import Animation from "./Animation";
+import { useTranslation } from "react-i18next";
+import theLoaderPrimary2 from "../constants/animations/theLoaderPrimary2.json";
+import theLoaderWhite from "../constants/animations/theLoaderWhite.json";
+
+const Loader = ({
+ variant,
+ className,
+ style,
+ loaderText,
+ animationStyles,
+}) => {
+ const { t } = useTranslation();
+
+ const renderLoader = () => {
+ const commonProps = {
+ loop: animationStyles?.noLoop !== true,
+ autoplay: animationStyles?.noAutoplay !== true,
+ width: animationStyles?.width || "6.25rem",
+ height: animationStyles?.height || "6.25rem",
+ animationData:
+ animationStyles?.animationData !== undefined && animationStyles?.animationData !== null
+ ? animationStyles.animationData
+ : variant === "OverlayLoader"
+ ? theLoaderWhite
+ : theLoaderPrimary2,
+ };
+
+ return ;
+ };
+
+ return (
+
+ {renderLoader()}
+ {loaderText && (
+
+ {`${t(loaderText)}...`}
+
+ )}
+
+ );
+};
+
+Loader.propTypes = {
+ /** custom class */
+ className: PropTypes.string,
+ /** variant */
+ variant: PropTypes.string,
+ /** custom loader text */
+ loaderText: PropTypes.string,
+ /** custom styles */
+ style: PropTypes.object,
+ /** custom styles for animation */
+ animationStyles: PropTypes.object,
+};
+
+export default Loader;
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Menu.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Menu.js
new file mode 100644
index 00000000..eb8cc37f
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Menu.js
@@ -0,0 +1,104 @@
+import React, { useState} from "react";
+import PropTypes from "prop-types";
+import TextInput from "./TextInput";
+import { useTranslation } from "react-i18next";
+import { Colors} from "../constants/colors/colorconstants";
+import { iconRender } from "../utils/iconRender";
+
+const Menu = (props) => {
+ const [searchTerm, setSearchTerm] = useState("");
+ const [optionIndex, setOptionIndex] = useState(-1);
+ const [isActive, setIsActive] = useState(-1);
+ const { t } = useTranslation();
+
+ const handleSearch = (e) => {
+ setSearchTerm(e.target.value);
+ };
+
+ const searchFilteredOptions = props?.options.filter((option) =>
+ option[props?.optionsKey]?.toLowerCase().includes(searchTerm.toLowerCase())
+ );
+
+ const onSelect = (val) => {
+ props.onSelect(val);
+ props.setDropdownStatus(false);
+ };
+
+ const handleMouseDown = (index) => {
+ setOptionIndex(index);
+ };
+
+
+ const secondaryIconColor = Colors.lightTheme.generic.inputBorder;
+ const primaryIconColor = Colors.lightTheme.paper.primary;
+
+ const IconRender = (iconReq, isActive) => {
+ const iconFill = isActive ? primaryIconColor : secondaryIconColor;
+ return iconRender(
+ iconReq,
+ iconFill,
+ "1.25rem",
+ "1.25rem",
+ ""
+ );
+ };
+
+
+ return (
+
+ {props?.isSearchable && (
+
+
+
+ )}
+
+
+ );
+};
+
+Menu.propTypes = {
+ options: PropTypes.array,
+ showBottom: PropTypes.bool,
+ isSearchable: PropTypes.bool,
+ style: PropTypes.object,
+ optionsKey: PropTypes.string.isRequired,
+ onSelect: PropTypes.func.isRequired
+};
+
+Menu.defaultProps = {
+ options: [],
+ onSelect: () => {},
+};
+
+export default Menu;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/MobileNumber.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/MobileNumber.js
new file mode 100644
index 00000000..6c26cfeb
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/MobileNumber.js
@@ -0,0 +1,84 @@
+import React from "react";
+import PropTypes from "prop-types";
+import TextInput from "./TextInput";
+import { getUserType } from "../utils/digitUtils";
+
+const MobileNumber = (props) => {
+ const user_type = getUserType();
+
+ const onChange = (e) => {
+ let val = e.target.value;
+ if (isNaN(val) || [" ", "e", "E"].some((e) => val.includes(e)) || val.length > (props.maxLength || 10)) {
+ val = val.slice(0, -1);
+ }
+ props?.onChange?.(val);
+ };
+
+ return (
+
+
+
+ );
+};
+
+MobileNumber.propTypes = {
+ userType: PropTypes.string,
+ isMandatory: PropTypes.bool,
+ name: PropTypes.string,
+ placeholder: PropTypes.string,
+ onChange: PropTypes.func,
+ inputRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({ current: PropTypes.instanceOf(Element) })]),
+ value: PropTypes.any,
+ className: PropTypes.string,
+ style: PropTypes.object,
+ maxLength: PropTypes.number,
+ minlength: PropTypes.number,
+ max: PropTypes.number,
+ pattern: PropTypes.string,
+ min: PropTypes.number,
+ disable: PropTypes.bool,
+ errorStyle: PropTypes.bool,
+ hideSpan: PropTypes.bool,
+ title: PropTypes.string,
+ step: PropTypes.string,
+ autoFocus: PropTypes.bool,
+ onBlur: PropTypes.func,
+};
+
+MobileNumber.defaultProps = {
+ isMandatory: false,
+};
+
+export default MobileNumber;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/MultiSelectDropdown.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/MultiSelectDropdown.js
new file mode 100644
index 00000000..e061794e
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/MultiSelectDropdown.js
@@ -0,0 +1,859 @@
+import React, { useEffect, useReducer, useRef, useState } from "react";
+import PropTypes from "prop-types";
+import { useTranslation } from "react-i18next";
+import Chip from "./Chip";
+import { SVG } from "./SVG";
+import Button from "./Button";
+import TreeSelect from "./TreeSelect";
+import { Colors} from "../constants/colors/colorconstants";
+import { iconRender } from "../utils/iconRender";
+
+const MultiSelectDropdown = ({
+ options,
+ optionsKey,
+ selected = [],
+ onSelect,
+ onClose,
+ defaultLabel = "",
+ defaultUnit = "",
+ props,
+ isPropsNeeded = false,
+ ServerStyle = {},
+ config,
+ disabled,
+ variant,
+ addSelectAllCheck = false,
+ addCategorySelectAllCheck = false,
+ selectAllLabel = "",
+ categorySelectAllLabel = "",
+ restrictSelection = false,
+ isSearchable=false,
+ chipsKey,
+ frozenData = [],
+ handleViewMore
+}) => {
+ const [active, setActive] = useState(false);
+ const [searchQuery, setSearchQuery] = useState();
+ const [optionIndex, setOptionIndex] = useState(-1);
+ const [selectAllChecked, setSelectAllChecked] = useState(false);
+ const [categorySelected, setCategorySelected] = useState({});
+ const dropdownRef = useRef();
+ const { t } = useTranslation();
+
+ function reducer(state, action) {
+ switch (action.type) {
+ case "ADD_TO_SELECTED_EVENT_QUEUE":
+ // Check if the item already exists to prevent duplication
+ if (state.some((e) => e.code === action.payload?.[1]?.code)) {
+ return state; // Return state unchanged if item is already in queue
+ }
+ return [
+ ...state,
+ { code: action.payload?.[1]?.code,name: action?.payload?.[1]?.name, propsData: action.payload,},
+ ];
+ case "REMOVE_FROM_SELECTED_EVENT_QUEUE":
+ const newState = state?.filter(
+ (e) => e?.code !== action.payload?.[1]?.code
+ );
+ onSelect(
+ newState.map((e) => e.propsData),
+ getCategorySelectAllState(),
+ props
+ ); // Update the form state here
+ if (onClose && !active) {
+ setSearchQuery("");
+ onClose(
+ newState.map((e) => e.propsData),
+ getCategorySelectAllState(),
+ props
+ );
+ }
+ return newState;
+ case "REPLACE_COMPLETE_STATE":
+ return action.payload;
+ default:
+ return state;
+ }
+ }
+
+ useEffect(() => {
+ dispatch({
+ type: "REPLACE_COMPLETE_STATE",
+ payload: fnToSelectOptionThroughProvidedSelection(selected),
+ });
+ }, [selected?.length]);
+
+ function fnToSelectOptionThroughProvidedSelection(selected) {
+ return selected?.map((e) => ({ code: e?.code, name: e?.name,propsData: [null, e] }));
+ }
+ const [alreadyQueuedSelectedState, dispatch] = useReducer(
+ reducer,
+ selected,
+ fnToSelectOptionThroughProvidedSelection
+ );
+
+ useEffect(() => {
+ if (!active) {
+ setSearchQuery("");
+ onSelect(
+ alreadyQueuedSelectedState?.map((e) => e.propsData),
+ getCategorySelectAllState(),
+ props
+ );
+ }
+ if (onClose) {
+ onClose(
+ alreadyQueuedSelectedState?.map((e) => e.propsData),
+ getCategorySelectAllState(),
+ props
+ );
+ }
+ }, [active]);
+
+ useEffect(() => {
+ const initialCategorySelectedState = options?.reduce((acc, category) => {
+ if (category.options) {
+ var filteredCategoryOptions = category?.options;
+ if (searchQuery?.length > 0) {
+ filteredCategoryOptions = category?.options?.filter((option) => t(option?.code)?.toLowerCase()?.includes(searchQuery?.toLowerCase()));
+ }
+ acc[category.code] = filteredCategoryOptions.every((option) =>
+ alreadyQueuedSelectedState.some((selectedOption) => selectedOption.code === option.code)
+ );
+ }
+ return acc;
+ }, {});
+ setCategorySelected(initialCategorySelectedState);
+ }, [options, alreadyQueuedSelectedState, searchQuery]);
+
+ const checkSelection = (optionstobeiterated) => {
+ if (optionstobeiterated && optionstobeiterated.length > 0) {
+ return optionstobeiterated?.every((option) =>
+ alreadyQueuedSelectedState.some(
+ (selectedOption) => selectedOption.code === option.code
+ )
+ );
+ } else {
+ return false;
+ }
+ };
+
+ useEffect(() => {
+ const allOptionsSelected =
+ variant === "nestedmultiselect"
+ ? checkSelection(flattenedOptions?.filter((option) => !option.options))
+ : checkSelection(options);
+
+ setSelectAllChecked(allOptionsSelected);
+
+ const newCategorySelected = { ...categorySelected };
+ options
+ ?.filter((option) => option.options)
+ ?.forEach((category) => {
+ newCategorySelected[category.code] = undefined;
+ });
+ options
+ ?.filter((option) => option.options)
+ ?.forEach((category) => {
+ // If the category has already been marked as false, skip further processing for this category.
+ if (newCategorySelected[category.code] === false) return;
+ let filteredCategoryOptions = category?.options;
+ if (searchQuery?.length > 0) {
+ filteredCategoryOptions = category?.options?.filter((option) =>
+ t(option?.code)?.toLowerCase()?.includes(searchQuery?.toLowerCase())
+ );
+ }
+ if (filteredCategoryOptions?.length > 0) {
+ const allChildrenSelected = checkSelection(filteredCategoryOptions);
+ if (!allChildrenSelected) {
+ newCategorySelected[category.code] = false; // Mark as false if any child is not selected.
+ } else {
+ newCategorySelected[category.code] = true; // Mark as true if all children are selected.
+ }
+ }
+ });
+ setCategorySelected(newCategorySelected);
+ }, [options, alreadyQueuedSelectedState, searchQuery]);
+
+ function handleOutsideClickAndSubmitSimultaneously() {
+ setActive(false);
+ }
+
+ window?.Digit?.Hooks.useClickOutside(
+ dropdownRef,
+ handleOutsideClickAndSubmitSimultaneously,
+ active,
+ { capture: true }
+ );
+
+ useEffect(() => {
+ setOptionIndex(0);
+ }, [searchQuery]);
+
+ function onSearch(e) {
+ setSearchQuery(e.target.value);
+ }
+
+ function onSelectToAddToQueue(...props) {
+ if (!restrictSelection) {
+ if (variant === "treemultiselect") {
+ const currentoptions = props[0];
+ currentoptions?.forEach((option) => {
+ const isAlreadySelected = alreadyQueuedSelectedState.some(
+ (selectedOption) => selectedOption.code === option.code
+ );
+ if (!isAlreadySelected) {
+ dispatch({
+ type: "ADD_TO_SELECTED_EVENT_QUEUE",
+ payload: [null, option],
+ });
+ } else {
+ dispatch({
+ type: "REMOVE_FROM_SELECTED_EVENT_QUEUE",
+ payload: [null, option],
+ });
+ const parentOption = findParentOption(option, options);
+ if (parentOption) {
+ dispatch({
+ type: "REMOVE_FROM_SELECTED_EVENT_QUEUE",
+ payload: [null, parentOption],
+ });
+ }
+ }
+ });
+ } else {
+ const isChecked = arguments[0].target.checked;
+ isChecked
+ ? dispatch({ type: "ADD_TO_SELECTED_EVENT_QUEUE", payload: arguments })
+ : dispatch({
+ type: "REMOVE_FROM_SELECTED_EVENT_QUEUE",
+ payload: arguments,
+ });
+ }
+ onSelect(
+ alreadyQueuedSelectedState?.map((e) => e.propsData),
+ getCategorySelectAllState(),
+ props
+ );
+ } else {
+ onSelect();
+ }
+ }
+
+ const primaryColor = Colors.lightTheme.paper.primary;
+ const inputBorderColor = Colors.lightTheme.generic.inputBorder;
+ const primaryIconColor = Colors.lightTheme.primary[1];
+ const dividerColor = Colors.lightTheme.generic.divider;
+ const background = Colors.lightTheme.paper.secondary;
+
+ const IconRender = (iconReq, isActive, isSelected) => {
+ const iconFill = isActive || isSelected ? primaryColor : inputBorderColor;
+ return iconRender(
+ iconReq,
+ iconFill,
+ "1.25rem",
+ "1.25rem",
+ ""
+ );
+ };
+
+ const handleClearAll = () => {
+ dispatch({ type: "REPLACE_COMPLETE_STATE", payload: [] });
+ onSelect([], getCategorySelectAllState(), props);
+ if (onClose) {
+ onClose([], getCategorySelectAllState(), props);
+ }
+ };
+
+ const handleSelectAll = () => {
+ if (!restrictSelection) {
+ if (selectAllChecked) {
+ dispatch({ type: "REPLACE_COMPLETE_STATE", payload: [] });
+ setSelectAllChecked(false);
+ } else {
+ const payload =
+ variant === "nestedmultiselect"
+ ? flattenedOptions
+ ?.filter((option) => !option.options)
+ ?.map((option) => ({
+ code: option.code,
+ name: option.name,
+ propsData: [null, option],
+ }))
+ : options.map((option) => ({
+ code: option.code,
+ name: option.name,
+ propsData: [null, option],
+ }));
+ dispatch({
+ type: "REPLACE_COMPLETE_STATE",
+ payload: payload,
+ });
+ setSelectAllChecked(true);
+ }
+ onSelect(
+ alreadyQueuedSelectedState?.map((e) => e.propsData),
+ getCategorySelectAllState(),
+ props
+ );
+ } else {
+ onSelect();
+ }
+ };
+
+ const handleCategorySelection = (parentOption) => {
+ if (!restrictSelection) {
+ const childoptions = parentOption.options;
+ if (!categorySelected[parentOption.code]) {
+ childoptions?.forEach((option) => {
+ const isAlreadySelected = alreadyQueuedSelectedState.some((selectedOption) => selectedOption.code === option.code);
+ if (!isAlreadySelected) {
+ dispatch({
+ type: "ADD_TO_SELECTED_EVENT_QUEUE",
+ payload: [null, option],
+ });
+ }
+ });
+ } else {
+ childoptions?.forEach((option) => {
+ dispatch({
+ type: "REMOVE_FROM_SELECTED_EVENT_QUEUE",
+ payload: [null, option],
+ });
+ });
+ }
+ setCategorySelected((prev) => ({
+ ...prev,
+ [parentOption.code]: !categorySelected[parentOption.code],
+ }));
+ onSelect(
+ alreadyQueuedSelectedState?.map((e) => e.propsData),
+ getCategorySelectAllState(),
+ props
+ );
+ } else {
+ onSelect();
+ }
+ };
+
+ function getCategorySelectAllState() {
+ if (variant === "nestedmultiselect") {
+ const categorySelectAllState = {};
+ options
+ ?.filter((option) => option.options)
+ ?.forEach((category) => {
+ categorySelectAllState[category.code] = {
+ isSelectAllChecked: categorySelected[category.code] || false,
+ };
+ });
+ return categorySelectAllState;
+ }
+ return {};
+ }
+
+
+ const replaceDotWithColon = (inputString) => {
+ if (inputString) {
+ const updatedInputString = inputString.replace(/\./g, ": ");
+ return updatedInputString;
+ }
+ };
+
+ const countFinalChildOptions = (totalselectedOptions) => {
+ let count = 0;
+ totalselectedOptions?.forEach((option) => {
+ if (!option.propsData[1]?.options) {
+ count += 1;
+ }
+ });
+ return count;
+ };
+
+ const selectOptionThroughKeys = (e, option) => {
+ if (!option) return;
+ let checked = alreadyQueuedSelectedState.find(
+ (selectedOption) => selectedOption?.code === option?.code
+ )
+ ? true
+ : false;
+ if (!checked) {
+ dispatch({
+ type: "ADD_TO_SELECTED_EVENT_QUEUE",
+ payload: [null, option],
+ });
+ } else {
+ dispatch({
+ type: "REMOVE_FROM_SELECTED_EVENT_QUEUE",
+ payload: [null, option],
+ });
+ }
+ };
+
+ /* Custom function to scroll and select in the dropdowns while using key up and down */
+ const keyChange = (e) => {
+ const optionToScroll =
+ variant === "nestedmultiselect" ? flattenedOptions : filteredOptions;
+
+ if (optionToScroll.length === 0) {
+ return; // No options to navigate
+ }
+
+ if (e.key == "ArrowDown") {
+ setOptionIndex((state) =>
+ state + 1 == optionToScroll.length ? 0 : state + 1
+ );
+ if (optionIndex + 1 == optionToScroll.length) {
+ e?.target?.parentElement?.parentElement?.children
+ ?.namedItem("jk-dropdown-unique")
+ ?.scrollTo?.(0, 0);
+ } else {
+ optionIndex > 2 &&
+ e?.target?.parentElement?.parentElement?.children
+ ?.namedItem("jk-dropdown-unique")
+ ?.scrollBy?.(0, 45);
+ }
+ e.preventDefault();
+ } else if (e.key == "ArrowUp") {
+ setOptionIndex((state) =>
+ state !== 0 ? state - 1 : optionToScroll.length - 1
+ );
+ if (optionIndex === 0) {
+ e?.target?.parentElement?.parentElement?.children
+ ?.namedItem("jk-dropdown-unique")
+ ?.scrollTo?.(100000, 100000);
+ } else {
+ optionIndex > 2 &&
+ e?.target?.parentElement?.parentElement?.children
+ ?.namedItem("jk-dropdown-unique")
+ ?.scrollBy?.(0, -45);
+ }
+ e.preventDefault();
+ } else if (e.key == "Enter") {
+ selectOptionThroughKeys(e, optionToScroll[optionIndex]);
+ }
+ };
+
+ const filteredOptions =
+ searchQuery?.length > 0
+ ? options
+ ?.map((option) => {
+ if (option?.options && option.options.length > 0) {
+ const matchingNestedOptions = option?.options?.filter(
+ (nestedOption) =>
+ t(nestedOption.code)
+ .toLowerCase()
+ .includes(searchQuery.toLowerCase())
+ );
+
+ if (matchingNestedOptions.length > 0) {
+ return {
+ ...option,
+
+ options: matchingNestedOptions,
+ };
+ }
+ } else if (option?.code) {
+ if (
+ t(option.code).toLowerCase().includes(searchQuery.toLowerCase())
+ ) {
+ return option;
+ }
+ }
+
+ return null;
+ })
+ ?.filter(Boolean)
+ : options;
+
+ const parentOptionsWithChildren = filteredOptions?.filter(
+ (option) => option.options && option.options.length > 0
+ );
+
+ const flattenOptions = (options) => {
+ let flattened = [];
+ options?.forEach((option) => {
+ const existingOption = flattened.find(
+ (flattenedOption) => flattenedOption?.code === option?.code
+ );
+ if (existingOption) {
+ // If the code already exists, merge the new options
+ if (option.options) {
+ existingOption.options = existingOption.options || [];
+ existingOption.options = existingOption.options.concat(option.options);
+ }
+ } else {
+ flattened.push(option);
+ }
+ // Flatten any nested options
+ if (option.options) {
+ flattened = flattened.concat(option.options);
+ }
+ });
+ // Remove duplicates by 'code' within the flattened array
+ flattened = flattened?.filter(
+ (option, index, self) =>
+ index === self.findIndex((o) => o.code === option.code)
+ );
+ flattened.forEach((option) => {
+ if (option.options) {
+ option.options = option?.options?.filter(
+ (opt, idx, arr) => idx === arr.findIndex((o) => o.code === opt.code)
+ );
+ }
+ });
+ return flattened;
+ };
+
+ const flattenedOptions = flattenOptions(parentOptionsWithChildren);
+
+ function findParentOption(childOption, options) {
+ for (const option of options) {
+ if (
+ option.options &&
+ option.options.some((child) => child.code === childOption.code)
+ ) {
+ return option;
+ }
+ if (option.options) {
+ const parentOption = findParentOption(childOption, option.options);
+ if (parentOption) {
+ return parentOption;
+ }
+ }
+ }
+ return null;
+ }
+
+ const MenuItem = ({ option, index }) => {
+ const [isActive, setIsActive] = useState(false);
+ const isFrozen = frozenData.some((frozenOption) => frozenOption.code === option.code);
+ return (
+ selectedOption.code === option.code
+ )
+ ? "checked"
+ : ""
+ } ${
+ index === optionIndex &&
+ !alreadyQueuedSelectedState.find(
+ (selectedOption) => selectedOption.code === option.code
+ )
+ ? "keyChange"
+ : ""
+ } ${isFrozen ? "frozen" : ""}`}
+ onMouseDown={() => setIsActive(true)}
+ onMouseUp={() => setIsActive(false)}
+ onMouseLeave={() => setIsActive(false)}
+ >
+
selectedOption.code === option.code
+ )
+ ? true
+ : false
+ }
+ onChange={(e) => {
+ if (!isFrozen) {
+ isPropsNeeded
+ ? onSelectToAddToQueue(e, option, props)
+ : onSelectToAddToQueue(e, option);
+ }
+ }}
+ className={`digit-multi-select-dropdown-menuitem ${
+ variant ? variant : ""
+ } ${isFrozen ? "disabled" : ""}`}
+ disabled={isFrozen}
+ style={{
+ cursor: isFrozen ? "not-allowed" : "pointer",
+ }}
+ />
+
+
+
+
+
+ {config?.showIcon &&
+ option?.icon &&
+ IconRender(
+ option?.icon,
+ isActive,
+ alreadyQueuedSelectedState.find(
+ (selectedOption) => selectedOption.code === option.code
+ )
+ ? true
+ : false
+ )}
+
+ {t(
+ option[optionsKey] &&
+ typeof option[optionsKey] == "string" &&
+ option[optionsKey]
+ )}
+
+
+ {variant === "nestedtextmultiselect" && option.description && (
+
{option.description}
+ )}
+
+
+ );
+ };
+
+ const selectAllOption = addSelectAllCheck && (
+
+
+
+
+
+
+ {selectAllLabel ? selectAllLabel : t("SELECT_ALL")}
+
+
+ );
+
+ const Menu = () => {
+ const optionsToRender =
+ variant === "nestedmultiselect" ? flattenedOptions : filteredOptions;
+
+ if (!optionsToRender || optionsToRender?.length === 0) {
+ return (
+ {}}
+ >
+ { {t("NO_RESULTS_FOUND")} }
+
+ );
+ }
+
+ return (
+
+ {selectAllOption}
+ {optionsToRender?.map((option, index) => {
+ if (option.options) {
+ return (
+
+
+ {t(option[optionsKey])}
+
+ {addCategorySelectAllCheck && (
+
handleCategorySelection(option)}
+ >
+
+ {categorySelectAllLabel
+ ? categorySelectAllLabel
+ : t("SELECT_ALL")}
+
+
+
+
+
+
+ )}
+
+ );
+ } else {
+ return
;
+ }
+ })}
+
+ );
+ };
+
+ return (
+
+
+
+
setActive(true)}
+ value={searchQuery}
+ onChange={onSearch}
+ />
+
0
+ ? `${variant === "treemultiselect"
+ ? countFinalChildOptions(alreadyQueuedSelectedState)
+ : alreadyQueuedSelectedState.length}
+ ${defaultUnit} Selected`
+ : defaultLabel
+ }
+ >
+ {variant === "treemultiselect" ? (
+
+ {alreadyQueuedSelectedState.length > 0
+ ? `${countFinalChildOptions(
+ alreadyQueuedSelectedState
+ )} ${defaultUnit} Selected`
+ : defaultLabel}
+
+ ) : (
+
+ {alreadyQueuedSelectedState.length > 0
+ ? `${alreadyQueuedSelectedState.length} ${defaultUnit} Selected`
+ : defaultLabel}
+
+ )}
+
setActive(true)} fill={disabled ? dividerColor : inputBorderColor} />
+
+
+ {active ? (
+
+ {variant === "treemultiselect" ? (
+
+ ) : (
+
+ )}
+
+ ) : null}
+
+ {config?.isDropdownWithChip ? (
+
+ {alreadyQueuedSelectedState.length > 0 &&
+ alreadyQueuedSelectedState
+ ?.filter((value) => !value.propsData[1]?.options)
+ ?.slice(0, config?.numberOfChips || alreadyQueuedSelectedState.length )
+ ?.map((value, index) => {
+ const translatedText = t(
+ chipsKey ? value[chipsKey] : value.code
+ );
+ const replacedText = replaceDotWithColon(translatedText);
+ const isClose = frozenData.some(
+ (frozenOption) => frozenOption.code === value.code
+ );
+ return (
+ 64
+ ? `${replacedText.slice(0, 64)}...`
+ : replacedText
+ }
+ onClick={
+ variant === "treemultiselect"
+ ? () => onSelectToAddToQueue([value])
+ : isPropsNeeded
+ ? (e) => onSelectToAddToQueue(e, value, props)
+ : (e) => {
+ onSelectToAddToQueue(e, value);
+ }
+ }
+ hideClose={isClose}
+ className="multiselectdropdown-tag"
+ />
+ );
+ })}
+ {alreadyQueuedSelectedState.length > (config?.numberOfChips || alreadyQueuedSelectedState.length) && (
+ handleViewMore(alreadyQueuedSelectedState)}
+ variation="link"
+ />
+ )}
+ {alreadyQueuedSelectedState.length > 0 && frozenData.length === 0 && (
+
+ )}
+
+ ) : null}
+
+ );
+};
+
+MultiSelectDropdown.propTypes = {
+ options: PropTypes.array.isRequired,
+ optionsKey: PropTypes.string.isRequired,
+ selected: PropTypes.array,
+ onSelect: PropTypes.func.isRequired,
+ defaultLabel: PropTypes.string,
+ defaultUnit: PropTypes.string,
+ props: PropTypes.object,
+ isPropsNeeded: PropTypes.bool,
+ ServerStyle: PropTypes.object,
+ config: PropTypes.object,
+};
+
+export default MultiSelectDropdown;
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/NestedTable.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/NestedTable.js
new file mode 100644
index 00000000..b12af2b6
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/NestedTable.js
@@ -0,0 +1,106 @@
+import React from "react";
+import TableMain from "./TableMain";
+import TableHeader from "./TableHeader";
+import TableBody from "./TableBody";
+import TableCell from "./TableCell";
+import TableRow from "./TableRow";
+import Card from "./Card";
+import { SVG } from "./SVG";
+import PropTypes from 'prop-types';
+
+const NestedTable = ({ nestedData, toggleRowExpansion, rowIndex }) => {
+ const lastNestedData = nestedData[nestedData.length - 1];
+
+ if (!lastNestedData || !lastNestedData.nestedData) {
+ return No nested data available
;
+ }
+
+ const { headerData, rows, tableDetails } = lastNestedData.nestedData;
+
+ if (!rows || rows.length === 0 || !headerData || headerData.length === 0) {
+ return No nested data available
;
+ }
+
+ const renderNestedTable = () => {
+ return (
+
+
+
+
+ {headerData?.map((header, index) => (
+
+ {header?.label}
+
+ ))}
+
+
+
+ {rows?.map((nestedRow, index) => (
+
+ {nestedRow?.map((cell, cellIndex) => (
+ 0
+ ? headerData[cellIndex]?.accessor
+ : null
+ }
+ />
+ ))}
+
+ ))}
+
+
+
+ );
+ };
+
+ return tableDetails?.tableTitle ||
+ tableDetails?.tableDescription ||
+ tableDetails?.addClose ? (
+
+ {(tableDetails?.tableDescription ||
+ tableDetails?.tableTitle ||
+ tableDetails?.addClose) && (
+
+
+ {tableDetails?.tableTitle && (
+
{tableDetails?.tableTitle}
+ )}
+ {tableDetails?.addClose && (
+
toggleRowExpansion(rowIndex)}
+ />
+ )}
+
+ {tableDetails?.tableDescription && (
+
+ {tableDetails?.tableDescription}
+
+ )}
+
+ )}
+ {renderNestedTable()}
+
+ ) : (
+ renderNestedTable()
+ );
+};
+
+
+NestedTable.propTypes = {
+ nestedData: PropTypes.arrayOf(PropTypes.object).isRequired,
+ toggleRowExpansion: PropTypes.func.isRequired,
+ rowIndex: PropTypes.number.isRequired,
+ };
+
+export default NestedTable;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/NoResultsFound.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/NoResultsFound.js
new file mode 100644
index 00000000..74618947
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/NoResultsFound.js
@@ -0,0 +1,29 @@
+import React from "react";
+import PropTypes from "prop-types";
+import { useTranslation } from "react-i18next";
+import { SVG } from "./SVG";
+
+const NoResultsFound = (props) => {
+ const { t } = useTranslation();
+ const iconHeight = props?.height || 262;
+ const iconWidth = props?.width || 336;
+ return (
+
+
+ {t("COMMON_NO_RESULTS_FOUND")}
+
+ );
+};
+NoResultsFound.propTypes = {
+ style: PropTypes.object,
+ className: PropTypes.string,
+ height: PropTypes.number, // Prop for the height of the NoResultsFoundIcon
+ width: PropTypes.number, // Prop for the width of the NoResultsFoundIcon
+};
+
+// Default props for height and width
+NoResultsFound.defaultProps = {
+ height: 262,
+ width: 336,
+};
+export default NoResultsFound;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Numeric.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Numeric.js
new file mode 100644
index 00000000..df13d28d
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Numeric.js
@@ -0,0 +1,54 @@
+import React, { useState } from "react";
+
+const Numeric = (props, customProps) => {
+
+ const [count, setCount] = useState(props?.defaultValues || 0);
+
+ const incrementCount = () => {
+ if (count >= 0) {
+ setCount(count + 1);
+ props.onSelect(count);
+ } else {
+ setCount(0);
+ props.onSelect(0);
+ }
+ };
+
+ const decrementCount = () => {
+ if (count > 0) {
+ setCount(count - 1);
+ props.onSelect(count);
+ } else {
+ setCount(0);
+ props.onSelect(0);
+ }
+ };
+
+ const inputClassName = `Numeric ${props.disable ? "disabled" : ""
+ } ${props?.focused ? "focused" : ""} ${props.noneditable ? "noneditable" : ""} ${props?.errors?.errorMessage ? "error" : ""}`
+
+ return (
+
+
+
+ decrementCount()} className="NumericButton">
+ -
+
+
+ incrementCount()} className="NumericButton">
+ +
+
+
+
+
+ );
+};
+
+export default Numeric;
+
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/OTPInput.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/OTPInput.js
new file mode 100644
index 00000000..a4f34050
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/OTPInput.js
@@ -0,0 +1,156 @@
+import React,{ useState, useRef, useEffect } from "react";
+import { useTranslation } from "react-i18next";
+import ErrorMessage from "./ErrorMessage";
+
+const OTPInput = ({
+ length = 6,
+ type = "numeric",
+ onChange,
+ placeholder,
+ className,
+ style,
+ label,
+ inline,
+ masking = false,
+}) => {
+ const [otp, setOtp] = useState(Array(length).fill(""));
+ const inputRefs = useRef([]);
+ const [error, setError] = useState(null);
+ const { t } = useTranslation();
+
+ useEffect(() => {
+ inputRefs.current[0].focus();
+ }, []);
+
+ const handleInputChange = (e, index) => {
+ const value = e.target.value;
+ const isAlphanumeric = /^[a-zA-Z0-9]*$/;
+
+ if (
+ (type === "numeric" && !isNaN(value) && value !== " ") ||
+ (type === "alphanumeric" && isAlphanumeric.test(value))
+ ) {
+ const newOtp = [...otp];
+ newOtp[index] = value;
+ setOtp(newOtp);
+ if (newOtp.join("").length === length && !newOtp.includes("")) {
+ const finalOtp = newOtp.join("");
+ const callbackError = onChange(finalOtp);
+ setError(callbackError || null);
+ }
+
+ if (value && index < length - 1) {
+ inputRefs.current[index + 1].focus();
+ }
+ }
+ };
+
+ const handlePaste = (e) => {
+ e.preventDefault();
+ const pastedData = e.clipboardData.getData("text").slice(0, length);
+ const newOtp = [...otp];
+ let pasteIndex = 0;
+ for (let i = 0; i < newOtp.length && pasteIndex < pastedData.length; i++) {
+ const char = pastedData[pasteIndex];
+
+ if (
+ (type === "numeric" && !isNaN(char) && char !== " ") ||
+ (type === "alphanumeric" && /^[a-zA-Z0-9]*$/.test(char))
+ ) {
+ newOtp[i] = char;
+ pasteIndex++;
+ }
+ }
+
+ setOtp(newOtp);
+ if (newOtp.join("").length === length && !newOtp.includes("")) {
+ const finalOtp = newOtp.join("");
+ const callbackError = onChange(finalOtp);
+ setError(callbackError || null);
+ }
+
+ // Focusing on the next input after the last pasted character
+ const nextIndex = pasteIndex < length ? pasteIndex : length - 1;
+ inputRefs.current[nextIndex].focus();
+ };
+
+ const handleKeyDown = (e, index) => {
+ if (e.key === "Backspace") {
+ e.preventDefault();
+ const newOtp = [...otp];
+
+ // Remove the current value and shift all subsequent values to the left
+ for (let i = index; i < newOtp.length - 1; i++) {
+ newOtp[i] = newOtp[i + 1];
+ }
+ newOtp[newOtp.length - 1] = "";
+
+ setOtp(newOtp);
+ onChange(newOtp.join(""));
+ if (index > 0) {
+ inputRefs.current[index - 1].focus(); // Move back to the previous input
+ }
+ } else if (e.key === "Enter") {
+ if (index === length - 1) {
+ if (otp.join("").length === length && !otp.includes("")) {
+ const finalOtp = otp.join("");
+ const callbackError = onChange(finalOtp);
+ setError(callbackError || null);
+ }
+ } else {
+ inputRefs.current[index + 1].focus(); // Move to next input on Enter
+ }
+ } else if (e.key === "ArrowRight" && index < length - 1) {
+ inputRefs.current[index + 1].focus(); // Move to next input with ArrowRight
+ } else if (e.key === "ArrowLeft" && index > 0) {
+ inputRefs.current[index - 1].focus(); // Move to previous input with ArrowLeft
+ }
+ };
+
+ const handleBlur = (index) => {
+ if (index === length - 1) {
+ const callbackError = onChange(otp.join("")); // Trigger callback on blur of the last input
+ setError(callbackError || null);
+ }
+ };
+
+ return (
+
+
{label}
+
+
+ {otp.map((data, index) => (
+ (inputRefs.current[index] = el)}
+ onChange={(e) => handleInputChange(e, index)}
+ onKeyDown={(e) => handleKeyDown(e, index)}
+ onBlur={() => handleBlur(index)}
+ onPaste={handlePaste}
+ placeholder={placeholder && placeholder[index]}
+ className={`otp-input ${error ? "error" : ""}`}
+ />
+ ))}
+
+ {error && error.length > 0 && (
+
+ )}
+
+
+ );
+};
+
+export default OTPInput;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/PageBasedInput.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/PageBasedInput.js
new file mode 100644
index 00000000..3804efdf
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/PageBasedInput.js
@@ -0,0 +1,19 @@
+import React from "react";
+import Card from "./Card";
+import Button from "./Button";
+
+const PageBasedInput = ({ children, texts, onSubmit }) => {
+ return (
+
+
+ {children}
+
+
+
+
+
+
+ );
+};
+
+export default PageBasedInput;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Panels.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Panels.js
new file mode 100644
index 00000000..4fbd63f8
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Panels.js
@@ -0,0 +1,161 @@
+import React, { useState, useEffect } from "react";
+import { SVG } from "./SVG";
+import PropTypes from "prop-types";
+import Animation from "./Animation";
+import successAnimation from "../constants/animations/success.json";
+import errorAnimation from "../constants/animations/error.json";
+import { Colors} from "../constants/colors/colorconstants";
+import { iconRender } from "../utils/iconRender";
+
+const Panels = (props) => {
+
+ const primaryColor = Colors.lightTheme.paper.primary;
+
+ const useDeviceType = () => {
+ const [deviceType, setDeviceType] = useState("desktop");
+
+ useEffect(() => {
+ const updateDeviceType = () => {
+ const width = window.innerWidth;
+ if (width <= 480) {
+ setDeviceType("mobile");
+ } else if (width > 481 && width <= 768) {
+ setDeviceType("tablet");
+ } else {
+ setDeviceType("desktop");
+ }
+ };
+
+ updateDeviceType();
+ window.addEventListener("resize", updateDeviceType);
+ return () => window.removeEventListener("resize", updateDeviceType);
+ }, []);
+
+ return deviceType;
+ };
+
+ const deviceType = useDeviceType();
+
+ const getAnimationDimensions = () => {
+ if (props?.animationProps?.width && props?.animationProps?.height) {
+ return {
+ width: props.animationProps.width,
+ height: props.animationProps.height,
+ };
+ }
+ if(props?.type === "success" && !props?.showAsSvg){
+ switch (deviceType) {
+ case "mobile":
+ return { width: 80, height: 80 };
+ case "tablet":
+ return { width: 100, height: 100 };
+ case "desktop":
+ default:
+ return { width: 120, height: 120 };
+ }
+ }
+ switch (deviceType) {
+ case "mobile":
+ return { width: 56, height: 56 };
+ case "tablet":
+ return { width: 64, height: 64 };
+ case "desktop":
+ default:
+ return { width: 74, height: 74 };
+ }
+ };
+
+ const { width, height } = getAnimationDimensions();
+
+ const IconRender = (iconReq, iconFill) => {
+ const fill = iconFill || primaryColor;
+ return iconRender(
+ iconReq,
+ fill,
+ width,
+ height,
+ "digit-panel-customIcon"
+ );
+ };
+
+ const icon = IconRender(props?.customIcon, props?.iconFill);
+
+
+ return (
+
+
+ {props?.type === "success" ? (
+ props?.customIcon ? (
+ icon
+ ) : props?.showAsSvg ? (
+
+ ) : (
+
+ )
+ ) : props?.customIcon ? (
+ icon
+ ) : props?.showAsSvg ? (
+
+ ) : (
+
+ )}
+
{props?.message}
+
+
+
{props?.info}
+
{props?.response}
+ {props?.multipleResponses && (
+
+ {props?.multipleResponses.map((response) => (
+
{response}
+ ))}
+
+ )}
+
+
+ );
+};
+
+Panels.propTypes = {
+ className: PropTypes.string,
+ message: PropTypes.string,
+ type: PropTypes.string,
+ info: PropTypes.string,
+ response: PropTypes.string,
+ customIcon: PropTypes.string,
+ iconFill: PropTypes.string,
+ style: PropTypes.object,
+ multipleResponses: PropTypes.array,
+ showAsSvg:PropTypes.bool
+};
+
+Panels.defaultProps = {
+ type: "success",
+};
+
+export default Panels;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Paragraph.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Paragraph.js
new file mode 100644
index 00000000..0973f4cc
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Paragraph.js
@@ -0,0 +1,11 @@
+import React from "react";
+
+const Paragraph = (props) => {
+ const {value, customClassName, customStyle, inputRef} = props;
+
+ return (
+ {value}
+ )
+}
+
+export default Paragraph;
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/PlusMinusInput.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/PlusMinusInput.js
new file mode 100644
index 00000000..89d7b574
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/PlusMinusInput.js
@@ -0,0 +1,47 @@
+import React, { useState } from "react";
+
+const PlusMinusInput = (props, customProps) => {
+ let count = props?.defaultValues || 1;
+
+ function incrementCount() {
+ if (count >= 1) {
+ count = count + 1;
+ props.onSelect(count);
+ } else {
+ count = 1;
+ props.onSelect(count);
+ }
+ }
+ function decrementCount() {
+ if (count > 1) {
+ count = count - 1;
+ props.onSelect(count);
+ } else {
+ count = 1;
+ props.onSelect(count);
+ }
+ }
+
+ return (
+
+
+ decrementCount(count)} className="PlusMinusbutton">
+ -
+
+
+ incrementCount(count)} className="PlusMinusbutton">
+ +
+
+
+
+ );
+};
+
+export default PlusMinusInput;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/PopUp.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/PopUp.js
new file mode 100644
index 00000000..7fe70bce
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/PopUp.js
@@ -0,0 +1,304 @@
+import React, { useState, Fragment, useRef, useEffect } from "react";
+import PropTypes from "prop-types";
+import { SVG } from "./SVG";
+import StringManipulator from "./StringManipulator";
+import warningOutlineAnimation from "../constants/animations/warningOutline.json";
+import Animation from "./Animation";
+import { Colors } from "../constants/colors/colorconstants";
+import { iconRender } from "../utils/iconRender";
+
+const PopUp = (props) => {
+ const [isOverflowing, setIsOverflowing] = useState(false);
+ const childrenWrapRef = useRef(null);
+ const overlayRef = useRef(null);
+ const [isClosing, setIsClosing] = useState(false);
+
+ const [isMobileView, setIsMobileView] = useState(window.innerWidth <= 480);
+
+ const checkOverflow = () => {
+ if (childrenWrapRef.current) {
+ const isOverflow =
+ childrenWrapRef.current.scrollHeight >
+ childrenWrapRef.current.clientHeight;
+ setIsOverflowing(isOverflow);
+ }
+ };
+
+ const onResize = () => {
+ if (window.innerWidth <= 480) {
+ if (!isMobileView) {
+ setIsMobileView(true);
+ }
+ } else {
+ if (isMobileView) {
+ setIsMobileView(false);
+ }
+ }
+ checkOverflow();
+ };
+
+ useEffect(() => {
+ const handleScroll = () => checkOverflow();
+ const childrenWrap = childrenWrapRef.current;
+
+ if (childrenWrap) {
+ childrenWrap.addEventListener("scroll", handleScroll);
+ checkOverflow();
+ }
+
+ return () => {
+ if (childrenWrap) {
+ childrenWrap.removeEventListener("scroll", handleScroll);
+ }
+ };
+ }, [props.children]);
+
+ useEffect(() => {
+ window.addEventListener("resize", onResize);
+
+ checkOverflow();
+
+ return () => {
+ window.removeEventListener("resize", onResize);
+ };
+ }, []);
+
+ useEffect(() => {
+ if (overlayRef.current) {
+ overlayRef.current.focus();
+ }
+ }, [overlayRef]);
+
+ const iconColor = Colors.lightTheme.alert.error;
+
+ const IconRender = (type, iconReq, iconFill) => {
+ const fill = iconFill || iconColor;
+ const width = type === "alert" ? "48px" : "32px";
+ const height = type === "alert" ? "48px" : "32px";
+ return iconRender(
+ iconReq,
+ fill,
+ width,
+ height,
+ `digit-popup-customIcon ${type ? type : ""}`
+ );
+ };
+
+ const iconGenerated = IconRender(
+ props?.type,
+ props?.customIcon,
+ props?.iconFill
+ );
+
+ const hasFooterChildren = props?.footerChildren?.length > 0;
+
+ const allowedFooter = hasFooterChildren
+ ? props?.footerChildren?.slice(0, props?.maxFooterButtonsAllowed || 5)
+ : [];
+
+ const sortedFooterButtons = [...allowedFooter]?.sort((a, b) => {
+ const typeOrder = { primary: 3, secondary: 2, tertiary: 1 };
+ const getTypeOrder = (button) =>
+ typeOrder[(button.props.variation || "").toLowerCase()];
+ return getTypeOrder(a) - getTypeOrder(b);
+ });
+
+ const finalFooterArray = props?.sortFooterButtons
+ ? isMobileView
+ ? sortedFooterButtons.reverse()
+ : sortedFooterButtons
+ : allowedFooter;
+
+ const handleClose = () => {
+ setIsClosing(true);
+ setTimeout(() => {
+ props?.onClose();
+ }, 300);
+ };
+
+ const handleKeyDown = (event) => {
+ if (event.key === "Escape") {
+ handleClose();
+ }
+ if (event.key === "Enter") {
+ const submitButton = props?.footerChildren?.find(
+ (child) => child.props.type?.toLowerCase() === "submit"
+ );
+ if (submitButton) {
+ submitButton.props.onClick();
+ }
+ }
+ };
+
+ const handleOverlayClick = () => {
+ setIsClosing(true);
+ setTimeout(() => {
+ props?.onOverlayClick();
+ }, 300);
+ };
+
+ return (
+ handleOverlayClick()}
+ ref={overlayRef}
+ onKeyDown={handleKeyDown}
+ tabIndex={0}
+ >
+
e.stopPropagation()}
+ >
+ {props?.type === "alert" ? (
+
+ {!props?.customIcon && props?.showAlertAsSvg && (
+
+ )}
+ {!props?.customIcon && !props?.showAlertAsSvg && (
+
+ )}
+ {props?.customIcon && iconGenerated}
+
+ {props?.alertHeading || "Alert!"}
+
+
+ {props?.alertMessage || "AlertMessage"}
+
+
+ ) : (
+ <>
+
+
+
+ {props?.showIcon && !props?.customIcon && (
+
+ )}
+ {props?.showIcon && props?.customIcon && iconGenerated}
+
+ {props?.heading && (
+
+ {StringManipulator(
+ "TOSENTENCECASE",
+ StringManipulator("TRUNCATESTRING", props?.heading, {
+ maxLength: props?.headerMaxLength || 256,
+ })
+ )}
+
+ )}
+ {props?.subheading && (
+
+ {StringManipulator(
+ "TOSENTENCECASE",
+ StringManipulator(
+ "TRUNCATESTRING",
+ props?.subheading,
+ {
+ maxLength: props?.subHeaderMaxLength || 256,
+ }
+ )
+ )}
+
+ )}
+
+
+
handleClose()}
+ >
+
+
+
+
+ >
+ )}
+
+ {props?.description && (
+
{props?.description}
+ )}
+ {props?.children}
+
+ {hasFooterChildren && (
+
+
+ {finalFooterArray}
+
+
+ )}
+
+
+ );
+};
+
+PopUp.propTypes = {
+ className: PropTypes.string,
+ style: PropTypes.object,
+ children: PropTypes.node,
+ headerclassName: PropTypes.string,
+ footerclassName: PropTypes.string,
+ headerChildren: PropTypes.node,
+ footerChildren: PropTypes.node,
+ onClose: PropTypes.func,
+ type: PropTypes.string,
+ onOverlayClick: PropTypes.func,
+};
+
+export default PopUp;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/PrivateRoute.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/PrivateRoute.js
new file mode 100644
index 00000000..20c8fdc5
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/PrivateRoute.js
@@ -0,0 +1,34 @@
+import React from "react";
+import PropTypes from "prop-types";
+import { Route, Redirect } from "react-router-dom";
+
+export const PrivateRoute = ({ component: Component, roles, ...rest }) => {
+ return (
+ {
+ const user = window?.Digit?.UserService.getUser();
+ const userType = window?.Digit?.UserService.getType();
+ function getLoginRedirectionLink() {
+ if (userType === "employee") {
+ return `/${window?.contextPath}/employee/user/language-selection`;
+ } else {
+ return `/${window?.contextPath}/citizen/login`;
+ }
+ }
+ if (!user || !user.access_token) {
+ // not logged in so redirect to login page with the return url
+ return ;
+ }
+
+ // logged in so return component
+ return ;
+ }}
+ />
+ );
+};
+
+PrivateRoute.propTypes = {
+ component: PropTypes.elementType.isRequired,
+ roles: PropTypes.arrayOf(PropTypes.string),
+};
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/RadioButtons.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/RadioButtons.js
new file mode 100644
index 00000000..abaf32a4
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/RadioButtons.js
@@ -0,0 +1,113 @@
+import React from "react";
+import PropTypes from "prop-types";
+import isEqual from "lodash/isEqual";
+import StringManipulator from "./StringManipulator";
+import { useTranslation } from "react-i18next";
+
+const RadioButtons = (props) => {
+ const { t } = useTranslation();
+
+ var selected = props?.selectedOption;
+ function selectOption(value) {
+ props.onSelect(value);
+ }
+
+ const isAnyPreselected = props?.options?.some(
+ (option) => props?.value === option?.code && props?.disabled
+ );
+
+ return (
+
+ );
+};
+
+RadioButtons.propTypes = {
+ selectedOption: PropTypes.any,
+ onSelect: PropTypes.func,
+ options: PropTypes.any,
+ optionsKey: PropTypes.string,
+ innerStyles: PropTypes.any,
+ style: PropTypes.any,
+};
+
+RadioButtons.defaultProps = {};
+
+export default RadioButtons;
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Rating.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Rating.js
new file mode 100644
index 00000000..2a490f86
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Rating.js
@@ -0,0 +1,79 @@
+import React, { useRef } from "react";
+import PropTypes from "prop-types";
+import { SVG } from "./SVG";
+
+const Rating = (props) => {
+ var stars = [];
+ const star = useRef(null);
+
+ for (var i = 1; i <= props.maxRating; i++) {
+ if (i - props.currentRating <= 0) {
+ const index = i;
+ // stars.push( props.onFeedback(e,ref)}/>)
+ stars.push(
+ props.onFeedback(e, star, index)}
+ />
+ );
+ } else if (i - props.currentRating > 0 && i - props.currentRating < 1) {
+ const index = i;
+ stars.push(
+ props.onFeedback(e, star, index)}
+ percentage={Math.round((props.currentRating - parseInt(props.currentRating)) * 100)}
+ />
+ );
+ } else {
+ const index = i;
+ // stars.push( props.onFeedback(e,ref)}/>)
+ stars.push(
+ props.onFeedback(e, star, index)}
+ />
+ );
+ }
+ }
+
+ return (
+
+ {props.text ? props.text : ""} {stars}
+
+ );
+};
+
+Rating.propTypes = {
+ maxRating: PropTypes.number,
+ currentRating: PropTypes.number,
+ onFeedback: PropTypes.func,
+ id: PropTypes.string,
+ withText: PropTypes.bool,
+ styles: PropTypes.object,
+ className: PropTypes.string,
+ text: PropTypes.string,
+ starStyles: PropTypes.object,
+};
+
+Rating.defaultProps = {
+ maxRating: 5,
+ currentRating: 0,
+ onFeedback: () => {},
+ id: "0",
+ withText: false,
+ styles: {},
+ className: "",
+ text: "",
+ starStyles: {},
+};
+
+export default Rating;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/RoundedLabel.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/RoundedLabel.js
new file mode 100644
index 00000000..aa2fa5e0
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/RoundedLabel.js
@@ -0,0 +1,5 @@
+import React from "react";
+
+const RoundedLabel = ({ count }) => (count ? {count}
: );
+
+export default RoundedLabel;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/SVG.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/SVG.js
new file mode 100644
index 00000000..13d80a14
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/SVG.js
@@ -0,0 +1,1583 @@
+import {
+ Rotation3D,
+ SixFtApart,
+ Rotate360,
+ Accessibility,
+ AccessibilityNew,
+ Accessible,
+ AccessibleForward,
+ AccountBalance,
+ AccountBalanceWallet,
+ AccountBox,
+ AccountCircle,
+ AddAlert,
+ AddBusiness,
+ AddChart,
+ AddExpense,
+ AddExpenseTwo,
+ AddIcCall,
+ AddLocation,
+ AddLocationAlt,
+ AddModerator,
+ AddRoad,
+ AddShoppingCart,
+ AddTask,
+ AddToDrive,
+ AdminPanelSettings,
+ Agriculture,
+ Alarm,
+ AlarmAdd,
+ AlarmOff,
+ AlarmOn,
+ AllInbox,
+ AllOut,
+ AlternateEmail,
+ AltRoute,
+ Analytics,
+ Anchor,
+ Android,
+ Announcement,
+ Api,
+ AppBlocking,
+ AppRegistration,
+ Approval,
+ Apps,
+ AppSettingsAlt,
+ Architecture,
+ ArrowBack,
+ ArrowBackIos,
+ ArrowCircleDown,
+ ArrowCircleUp,
+ ArrowDownward,
+ ArrowDropDown,
+ ArrowDropDownCircle,
+ ArrowDropUp,
+ ArrowForward,
+ ArrowForwardIos,
+ ArrowForwardIosAlt,
+ ArrowLeft,
+ ArrowRight,
+ ArrowRightAlt,
+ ArrowUpward,
+ Article,
+ AspectRatio,
+ Assessment,
+ Assignment,
+ AssignmentInd,
+ AssignmentLate,
+ AssignmentReturn,
+ AssignmentReturned,
+ AssignmentTurnedIn,
+ AssistantDirection,
+ AssistantNavigation,
+ Atm,
+ AttachEmail,
+ Attachment,
+ Attractions,
+ AutoDelete,
+ AutoRenew,
+ Backup,
+ BackupTable,
+ Badge,
+ BakeryDining,
+ BatchPrediction,
+ BeenHere,
+ BikeScooter,
+ Book,
+ Bookmark,
+ BookmarkBorder,
+ Bookmarks,
+ BookOnline,
+ BreakfastDining,
+ BrunchDining,
+ BugReport,
+ Build,
+ BuildCircle,
+ BusAlert,
+ Business,
+ Cached,
+ Cake,
+ CalendarToday,
+ CalendarViewDay,
+ Call,
+ CallEnd,
+ CallMade,
+ CallMerge,
+ CallMissed,
+ CallMissedOutgoing,
+ CallReceived,
+ CallSplit,
+ CameraEnhance,
+ Campaign,
+ Cancel,
+ CancelPresentation,
+ CancelScheduleSend,
+ CardGiftcard,
+ CardMembership,
+ CardTravel,
+ CarRental,
+ CarRepair,
+ Category,
+ Celebration,
+ CellWifi,
+ ChangeHistory,
+ Chat,
+ ChatBubble,
+ ChatBubbleOutline,
+ Check,
+ CheckCircle,
+ CheckCircleOutline,
+ ChevronLeft,
+ ChevronRight,
+ ChromeReaderMode,
+ CircleNotifications,
+ Class,
+ CleanHands,
+ CleaningServices,
+ ClearAll,
+ Clock,
+ Close,
+ CloseFullscreen,
+ Cloud,
+ CloudCircle,
+ CloudDone,
+ CloudDownload,
+ CloudOff,
+ CloudQueue,
+ CloudUpload,
+ Code,
+ Comment,
+ CommentBank,
+ Commute,
+ CompareArrows,
+ CompassCalibration,
+ Compress,
+ ConnectWithoutContact,
+ Construction,
+ Contactless,
+ ContactMail,
+ ContactPage,
+ ContactPhone,
+ Contacts,
+ ContactSupport,
+ Copyright,
+ Coronavirus,
+ CreateNewFolder,
+ CreditCard,
+ Cut,
+ Dangerous,
+ Dashboard,
+ DashboardCustomize,
+ DateRange,
+ Deck,
+ Delete,
+ DeleteForever,
+ DeleteOutline,
+ DeliveryDining,
+ DepartureBoard,
+ Description,
+ DesignServices,
+ DesktopAccessDisabled,
+ DialerSip,
+ Dialpad,
+ DinnerDining,
+ Directions,
+ DirectionsBike,
+ DirectionsBoat,
+ DirectionsBus,
+ DirectionsCar,
+ DirectionsRailway,
+ DirectionsRun,
+ DirectionsSubway,
+ DirectionsTransit,
+ DirectionsWalk,
+ DisabledByDefault,
+ Dns,
+ Domain,
+ DomainDisabled,
+ DomainVerification,
+ Done,
+ DoneAll,
+ DoneOutline,
+ DonutLarge,
+ DonutSmall,
+ DoubleArrow,
+ DragIndicator,
+ DriveFileMove,
+ DriveFileMoveOutline,
+ DriveFileRenameOutline,
+ DriveFolderUpload,
+ DryCleaning,
+ DSOTruck,
+ Duo,
+ DynamicForm,
+ East,
+ Eco,
+ Edit,
+ EditAttributes,
+ EditLocation,
+ EditOff,
+ EditRoad,
+ Eject,
+ Elderly,
+ ElectricalServices,
+ ElectricBike,
+ ElectricCar,
+ ElectricMoped,
+ ElectricRickshaw,
+ ElectricScooter,
+ Email,
+ EmojiEmotions,
+ EmojiEvents,
+ EmojiFlags,
+ EmojiFoodBeverage,
+ EmojiNature,
+ EmojiObjects,
+ EmojiPeople,
+ EmojiSymbols,
+ EmojiTransportation,
+ Engineering,
+ Error,
+ ErrorOutline,
+ EuroSymbol,
+ Event,
+ EventSeat,
+ EvStation,
+ ExitToApp,
+ Expand,
+ ExpandLess,
+ ExpandMore,
+ Explore,
+ ExploreOff,
+ Extension,
+ Face,
+ Facebook,
+ FactCheck,
+ Fastfood,
+ Favorite,
+ FavoriteBorder,
+ Feedback,
+ Festival,
+ File,
+ FileDownload,
+ FileDownloadDone,
+ FilePresent,
+ FileUpload,
+ FilterAlt,
+ FilterListAlt,
+ FindInPage,
+ FindReplace,
+ Fingerprint,
+ Fireplace,
+ FirstPageAlt,
+ FirstPage,
+ FitScreen,
+ Flaky,
+ Flight,
+ FlightLand,
+ FlightTakeoff,
+ FlipToBack,
+ FlipToFront,
+ Folder,
+ FolderOpen,
+ FolderShared,
+ FollowTheSigns,
+ Forum,
+ ForwardToInbox,
+ Fullscreen,
+ FullscreenExit,
+ Gavel,
+ GetApp,
+ Gif,
+ Grade,
+ Grading,
+ GridView,
+ Group,
+ GroupAdd,
+ Groups,
+ GroupWork,
+ GTranslate,
+ Hail,
+ Handyman,
+ Hardware,
+ Help,
+ HelpCenter,
+ HelpOutline,
+ HighlightAlt,
+ HighlightOff,
+ History,
+ HistoryEdu,
+ HistoryToggleOff,
+ Home,
+ HomeFilled,
+ HomeRepairService,
+ HomeWork,
+ HorizontalSplit,
+ Hotel,
+ HourglassBottom,
+ HourglassDisabled,
+ HourglassEmpty,
+ HourglassFull,
+ HourglassTop,
+ Http,
+ Https,
+ Hvac,
+ Icecream,
+ IconSwerage,
+ IconSwerageAlt,
+ ImportantDevices,
+ ImportContacts,
+ ImportExport,
+ Info,
+ InfoOutline,
+ Input,
+ IntegrationInstructions,
+ InvertColors,
+ InvertColorsOff,
+ IosShare,
+ KingBed,
+ Label,
+ LabelImportant,
+ LabelImportantOutline,
+ LabelOff,
+ LabelOutline,
+ TranslateLanguage,
+ Language,
+ LastPageAlt,
+ LastPage,
+ Launch,
+ Layers,
+ LayersClear,
+ Leaderboard,
+ LegendToggle,
+ Lightbulb,
+ LightbulbOutline,
+ LineStyle,
+ LineWeight,
+ Liquor,
+ List,
+ ListAlt,
+ LiveHelp,
+ LocalActivity,
+ LocalAirport,
+ LocalAtm,
+ LocalBar,
+ LocalCafe,
+ LocalCarWash,
+ LocalConvenienceStore,
+ LocalDining,
+ LocalDrink,
+ LocalFireDepartment,
+ LocalFlorist,
+ LocalGasStation,
+ LocalGroceryStore,
+ LocalHospital,
+ LocalHotel,
+ LocalLaundryService,
+ LocalLibrary,
+ LocalMall,
+ LocalMovies,
+ LocalOffer,
+ LocalParking,
+ LocalPharmacy,
+ LocalPhone,
+ LocalPizza,
+ LocalPlay,
+ LocalPolice,
+ LocalPostOffice,
+ LocalPrintshop,
+ LocalSee,
+ LocalShipping,
+ LocalTaxi,
+ LocationCity,
+ LocationOff,
+ LocationOn,
+ LocationPin,
+ Lock,
+ LockClock,
+ LockOpen,
+ LockOutline,
+ Login,
+ Logout,
+ Loyalty,
+ Luggage,
+ LunchDining,
+ MailOutline,
+ Map,
+ MapsUgc,
+ MarkAsUnread,
+ MarkChatRead,
+ MarkChatUnread,
+ MarkEmailRead,
+ MarkEmailUnread,
+ MarkunreadMailbox,
+ Masks,
+ Maximize,
+ Mediation,
+ MedicalServices,
+ Menu,
+ MenuBook,
+ MenuOpen,
+ Message,
+ MilitaryTech,
+ Minimize,
+ MiscellaneousServices,
+ MobileScreenShare,
+ ModelTraining,
+ Money,
+ Mood,
+ MoodBad,
+ Moped,
+ MoreHoriz,
+ MoreTime,
+ MoreVert,
+ MultipleStop,
+ Museum,
+ MyLocation,
+ Nat,
+ Navigation,
+ NearMe,
+ NearMeDisabled,
+ NextPlan,
+ Nightlife,
+ NightlightRound,
+ NightsStay,
+ NoLuggage,
+ NoMeals,
+ NoMealsOuline,
+ North,
+ NorthEast,
+ NorthWest,
+ NoSim,
+ NotAccessible,
+ NoteAdd,
+ NotificationImportant,
+ Notifications,
+ NotificationsActive,
+ NotificationsNone,
+ NotificationsOff,
+ NotificationsPaused,
+ NotListedLocation,
+ NoTransfer,
+ NotStarted,
+ TorchNoun,
+ OfflineBolt,
+ OfflinePin,
+ OfflineShare,
+ OnlinePrediction,
+ Opacity,
+ OpenInBrowser,
+ OpenInFull,
+ OpenInNew,
+ OpenWith,
+ Outbond,
+ Outbox,
+ OutdoorGrill,
+ OutgoingMail,
+ Outlet,
+ Pages,
+ Pageview,
+ PanTool,
+ Park,
+ PartyMode,
+ PausePresentation,
+ Payment,
+ Payments,
+ PedalBike,
+ Pending,
+ PendingActions,
+ People,
+ PeopleAlt,
+ PeopleOutline,
+ PermCameraMic,
+ PermContactCalendar,
+ PermDataSetting,
+ PermDeviceInformation,
+ PermIdentity,
+ PermMedia,
+ PermPhoneMsg,
+ PermScanWifi,
+ Person,
+ PersonAdd,
+ PersonAddAlt,
+ PersonAddSecondary,
+ PersonAddDisabled,
+ PersonOutline,
+ PersonPin,
+ PersonPinCircle,
+ PersonRemove,
+ PersonRemoveAlt,
+ PersonSearch,
+ PestControl,
+ PestControlRodent,
+ Pets,
+ Phone,
+ PhoneDisabled,
+ PhoneEnabled,
+ PhonelinkErase,
+ PhonelinkLock,
+ PhonelinkRing,
+ PhonelinkSetup,
+ PictureInPicture,
+ PictureInPictureAlt,
+ PinDrop,
+ PivotTableChart,
+ Place,
+ Plagiarism,
+ PlayForWork,
+ Plumbing,
+ PlusOne,
+ Poll,
+ Polymer,
+ Population,
+ PortableWifiOff,
+ PowerSettingsNew,
+ PregnantWoman,
+ PresentToAll,
+ Preview,
+ Print,
+ PrintDisabled,
+ PrivacyTip,
+ Psychology,
+ Public,
+ PublicOff,
+ PublishedWithChanges,
+ QrCode,
+ QrCodeScanner,
+ QueryBuilder,
+ QuestionAnswer,
+ Quickreply,
+ RailwayAlert,
+ RamenDining,
+ RateReview,
+ ReadMore,
+ Receipt,
+ Recommend,
+ RecordVoiceOver,
+ Redeem,
+ ReduceCapacity,
+ Refresh,
+ RemoveDone,
+ RemoveModerator,
+ RemoveShoppingCart,
+ Reorder,
+ ReportProblem,
+ RequestPage,
+ RequestQuote,
+ Restaurant,
+ RestaurantMenu,
+ Restore,
+ RestoreFromTrash,
+ RestorePage,
+ RingVolume,
+ Room,
+ RoundedCorner,
+ Rowing,
+ RssFeed,
+ Rtt,
+ Rule,
+ RuleFolder,
+ RunCircle,
+ Sanitizer,
+ Satellite,
+ SavedSearch,
+ Schedule,
+ ScheduleSend,
+ School,
+ Science,
+ ScreenShare,
+ Search,
+ SearchOff,
+ Segment,
+ SelfImprovement,
+ SendAndArchive,
+ SentimentDissatisfied,
+ SentimentNeutral,
+ SentimentSatisfied,
+ SentimentSatisfiedAlt,
+ SentimentVeryDissatisfied,
+ SentimentVerySatisfied,
+ SetMeal,
+ Settings,
+ SettingsApplications,
+ SettingsBackupRestore,
+ SettingsBluetooth,
+ SettingsBrightness,
+ SettingsCell,
+ SettingsEthernet,
+ SettingsInputAntenna,
+ SettingsInputComponent,
+ SettingsInputComposite,
+ SettingsInputHdmi,
+ SettingsInputVideo,
+ SettingsOverscan,
+ SettingsPhone,
+ SettingsPower,
+ SettingsRemote,
+ SettingsVoice,
+ Share,
+ Shop,
+ ShoppingBag,
+ ShoppingBasket,
+ ShoppingCart,
+ ShopAlt,
+ Sick,
+ SingleBed,
+ SmartButton,
+ SnippetFolder,
+ Source,
+ South,
+ SouthEast,
+ SouthWest,
+ SpeakerNotes,
+ SpeakerNotesOff,
+ SpeakerPhone,
+ SpellCheck,
+ Sports,
+ SportsBaseball,
+ SportsBasketball,
+ SportsCricket,
+ SportsEsports,
+ SportsFootball,
+ SportsGolf,
+ SportsHandball,
+ SportsHockey,
+ SportsKabaddi,
+ SportsMma,
+ SportsMotorsports,
+ SportsRugby,
+ SportsSoccer,
+ SportsTennis,
+ SportsVolleyball,
+ StarRate,
+ Stars,
+ StayCurrentLandscape,
+ StayCurrentPortrait,
+ StayPrimaryLandscape,
+ StayPrimaryPortrait,
+ StickyNotesSecondary,
+ ScreenShareStop,
+ Store,
+ StoreMallDirectory,
+ StreetView,
+ SubdirectoryArrowLeft,
+ SubdirectoryArrowRight,
+ Subject,
+ SubtitlesOff,
+ Subway,
+ SupervisedUserCircle,
+ SupervisorAccount,
+ Support,
+ SwapCalls,
+ SwapHorizontal,
+ SwapHorizontalCircle,
+ SwapVertical,
+ SwapVerticalCircle,
+ Swipe,
+ SwitchAccount,
+ SwitchLeft,
+ SwitchRight,
+ SyncAlt,
+ SystemUpdateAlt,
+ Tab,
+ TableView,
+ TabUnselected,
+ TakeOutDining,
+ TaxiAlert,
+ Terrain,
+ TextRotateUp,
+ TextRotateVertical,
+ TextRotationAngleDown,
+ TextRotationAngleUp,
+ TextRotationDown,
+ TextRotationNone,
+ SMSText,
+ TextSnippet,
+ TheaterComedy,
+ Theaters,
+ ThumbDown,
+ ThumbDownAlt,
+ ThumbDownOffAlt,
+ ThumbsUpDown,
+ ThumbUp,
+ ThumbUpAlt,
+ ThumbUpOffAlt,
+ Timeline,
+ Toc,
+ Today,
+ Toll,
+ Topic,
+ Torch,
+ TouchApp,
+ Tour,
+ TrackChanges,
+ Traffic,
+ Train,
+ Tram,
+ TransferWithinStation,
+ TransitEnterExit,
+ Translate,
+ TrendingDown,
+ TrendingFlat,
+ TrendingUp,
+ TripOrigin,
+ TurnedIn,
+ TurnedInNot,
+ TwoWheeler,
+ UnfoldLess,
+ UnfoldMore,
+ Unpublished,
+ Unsubscribe,
+ Update,
+ UpdateExpense,
+ UpdateExpenseSecondary,
+ Upgrade,
+ UploadFile,
+ Verified,
+ VerifiedUser,
+ VerticalSplit,
+ ViewAgenda,
+ ViewArray,
+ ViewCarousel,
+ ViewColumn,
+ ViewDay,
+ ViewHeadline,
+ ViewInAr,
+ ViewList,
+ ViewModule,
+ ViewQuilt,
+ ViewSidebar,
+ ViewStream,
+ ViewWeek,
+ Visibility,
+ VisibilityOff,
+ Voicemail,
+ VoiceOverOff,
+ VolunteerActivism,
+ VpnKey,
+ Warning,
+ WatchLater,
+ WaterfallChart,
+ West,
+ Whatsapp,
+ Whatshot,
+ WifiCalling,
+ WifiProtectedSetup,
+ WineBar,
+ Work,
+ WorkOff,
+ WorkOutline,
+ WorkspacesFilled,
+ WorkspacesOutline,
+ WrongLocation,
+ Wysiwyg,
+ YoutubeSearchedFor,
+ ZoomIn,
+ ZoomOut,
+ ZoomOutMap,
+ Success,
+ TickMark,
+ NoResultsFoundIcon,
+ StarFilled,
+ StarEmpty,
+} from "@egovernments/digit-ui-svg-components";
+import PropTypes from "prop-types";
+
+export const SVG = {
+ NoResultsFoundIcon,
+ Success,
+ TickMark,
+ Rotation3D,
+ SixFtApart,
+ Rotate360,
+ Accessibility,
+ AccessibilityNew,
+ Accessible,
+ AccessibleForward,
+ AccountBalance,
+ AccountBalanceWallet,
+ AccountBox,
+ AccountCircle,
+ AddAlert,
+ AddBusiness,
+ AddChart,
+ AddExpense,
+ AddExpenseTwo,
+ AddIcCall,
+ AddLocation,
+ AddLocationAlt,
+ AddModerator,
+ AddRoad,
+ AddShoppingCart,
+ AddTask,
+ AddToDrive,
+ AdminPanelSettings,
+ Agriculture,
+ Alarm,
+ AlarmAdd,
+ AlarmOff,
+ AlarmOn,
+ AllInbox,
+ AllOut,
+ AlternateEmail,
+ AltRoute,
+ Analytics,
+ Anchor,
+ Android,
+ Announcement,
+ Api,
+ AppBlocking,
+ AppRegistration,
+ Approval,
+ Apps,
+ AppSettingsAlt,
+ Architecture,
+ ArrowBack,
+ ArrowBackIos,
+ ArrowCircleDown,
+ ArrowCircleUp,
+ ArrowDownward,
+ ArrowDropDown,
+ ArrowDropDownCircle,
+ ArrowDropUp,
+ ArrowForward,
+ ArrowForwardIos,
+ ArrowForwardIosAlt,
+ ArrowLeft,
+ ArrowRight,
+ ArrowRightAlt,
+ ArrowUpward,
+ Article,
+ AspectRatio,
+ Assessment,
+ Assignment,
+ AssignmentInd,
+ AssignmentLate,
+ AssignmentReturn,
+ AssignmentReturned,
+ AssignmentTurnedIn,
+ AssistantDirection,
+ AssistantNavigation,
+ Atm,
+ AttachEmail,
+ Attachment,
+ Attractions,
+ AutoDelete,
+ AutoRenew,
+ Backup,
+ BackupTable,
+ Badge,
+ BakeryDining,
+ BatchPrediction,
+ BeenHere,
+ BikeScooter,
+ Book,
+ Bookmark,
+ BookmarkBorder,
+ Bookmarks,
+ BookOnline,
+ BreakfastDining,
+ BrunchDining,
+ BugReport,
+ Build,
+ BuildCircle,
+ BusAlert,
+ Business,
+ Cached,
+ Cake,
+ CalendarToday,
+ CalendarViewDay,
+ Call,
+ CallEnd,
+ CallMade,
+ CallMerge,
+ CallMissed,
+ CallMissedOutgoing,
+ CallReceived,
+ CallSplit,
+ CameraEnhance,
+ Campaign,
+ Cancel,
+ CancelPresentation,
+ CancelScheduleSend,
+ CardGiftcard,
+ CardMembership,
+ CardTravel,
+ CarRental,
+ CarRepair,
+ Category,
+ Celebration,
+ CellWifi,
+ ChangeHistory,
+ Chat,
+ ChatBubble,
+ ChatBubbleOutline,
+ Check,
+ CheckCircle,
+ CheckCircleOutline,
+ ChevronLeft,
+ ChevronRight,
+ ChromeReaderMode,
+ CircleNotifications,
+ Class,
+ CleanHands,
+ CleaningServices,
+ ClearAll,
+ Clock,
+ Close,
+ CloseFullscreen,
+ Cloud,
+ CloudCircle,
+ CloudDone,
+ CloudDownload,
+ CloudOff,
+ CloudQueue,
+ CloudUpload,
+ Code,
+ Comment,
+ CommentBank,
+ Commute,
+ CompareArrows,
+ CompassCalibration,
+ Compress,
+ ConnectWithoutContact,
+ Construction,
+ Contactless,
+ ContactMail,
+ ContactPage,
+ ContactPhone,
+ Contacts,
+ ContactSupport,
+ Copyright,
+ Coronavirus,
+ CreateNewFolder,
+ CreditCard,
+ Cut,
+ Dangerous,
+ Dashboard,
+ DashboardCustomize,
+ DateRange,
+ Deck,
+ Delete,
+ DeleteForever,
+ DeleteOutline,
+ DeliveryDining,
+ DepartureBoard,
+ Description,
+ DesignServices,
+ DesktopAccessDisabled,
+ DialerSip,
+ Dialpad,
+ DinnerDining,
+ Directions,
+ DirectionsBike,
+ DirectionsBoat,
+ DirectionsBus,
+ DirectionsCar,
+ DirectionsRailway,
+ DirectionsRun,
+ DirectionsSubway,
+ DirectionsTransit,
+ DirectionsWalk,
+ DisabledByDefault,
+ Dns,
+ Domain,
+ DomainDisabled,
+ DomainVerification,
+ Done,
+ DoneAll,
+ DoneOutline,
+ DonutLarge,
+ DonutSmall,
+ DoubleArrow,
+ DragIndicator,
+ DriveFileMove,
+ DriveFileMoveOutline,
+ DriveFileRenameOutline,
+ DriveFolderUpload,
+ DryCleaning,
+ DSOTruck,
+ Duo,
+ DynamicForm,
+ East,
+ Eco,
+ Edit,
+ EditAttributes,
+ EditLocation,
+ EditOff,
+ EditRoad,
+ Eject,
+ Elderly,
+ ElectricalServices,
+ ElectricBike,
+ ElectricCar,
+ ElectricMoped,
+ ElectricRickshaw,
+ ElectricScooter,
+ Email,
+ EmojiEmotions,
+ EmojiEvents,
+ EmojiFlags,
+ EmojiFoodBeverage,
+ EmojiNature,
+ EmojiObjects,
+ EmojiPeople,
+ EmojiSymbols,
+ EmojiTransportation,
+ Engineering,
+ Error,
+ ErrorOutline,
+ EuroSymbol,
+ Event,
+ EventSeat,
+ EvStation,
+ ExitToApp,
+ Expand,
+ ExpandLess,
+ ExpandMore,
+ Explore,
+ ExploreOff,
+ Extension,
+ Face,
+ Facebook,
+ FactCheck,
+ Fastfood,
+ Favorite,
+ FavoriteBorder,
+ Feedback,
+ Festival,
+ File,
+ FileDownload,
+ FileDownloadDone,
+ FilePresent,
+ FileUpload,
+ FilterAlt,
+ FilterListAlt,
+ FindInPage,
+ FindReplace,
+ Fingerprint,
+ Fireplace,
+ FirstPageAlt,
+ FirstPage,
+ FitScreen,
+ Flaky,
+ Flight,
+ FlightLand,
+ FlightTakeoff,
+ FlipToBack,
+ FlipToFront,
+ Folder,
+ FolderOpen,
+ FolderShared,
+ FollowTheSigns,
+ Forum,
+ ForwardToInbox,
+ Fullscreen,
+ FullscreenExit,
+ Gavel,
+ GetApp,
+ Gif,
+ Grade,
+ Grading,
+ GridView,
+ Group,
+ GroupAdd,
+ Groups,
+ GroupWork,
+ GTranslate,
+ Hail,
+ Handyman,
+ Hardware,
+ Help,
+ HelpCenter,
+ HelpOutline,
+ HighlightAlt,
+ HighlightOff,
+ History,
+ HistoryEdu,
+ HistoryToggleOff,
+ Home,
+ HomeFilled,
+ HomeRepairService,
+ HomeWork,
+ HorizontalSplit,
+ Hotel,
+ HourglassBottom,
+ HourglassDisabled,
+ HourglassEmpty,
+ HourglassFull,
+ HourglassTop,
+ Http,
+ Https,
+ Hvac,
+ Icecream,
+ IconSwerage,
+ IconSwerageAlt,
+ ImportantDevices,
+ ImportContacts,
+ ImportExport,
+ Info,
+ InfoOutline,
+ Input,
+ IntegrationInstructions,
+ InvertColors,
+ InvertColorsOff,
+ IosShare,
+ KingBed,
+ Label,
+ LabelImportant,
+ LabelImportantOutline,
+ LabelOff,
+ LabelOutline,
+ TranslateLanguage,
+ Language,
+ LastPageAlt,
+ LastPage,
+ Launch,
+ Layers,
+ LayersClear,
+ Leaderboard,
+ LegendToggle,
+ Lightbulb,
+ LightbulbOutline,
+ LineStyle,
+ LineWeight,
+ Liquor,
+ List,
+ ListAlt,
+ LiveHelp,
+ LocalActivity,
+ LocalAirport,
+ LocalAtm,
+ LocalBar,
+ LocalCafe,
+ LocalCarWash,
+ LocalConvenienceStore,
+ LocalDining,
+ LocalDrink,
+ LocalFireDepartment,
+ LocalFlorist,
+ LocalGasStation,
+ LocalGroceryStore,
+ LocalHospital,
+ LocalHotel,
+ LocalLaundryService,
+ LocalLibrary,
+ LocalMall,
+ LocalMovies,
+ LocalOffer,
+ LocalParking,
+ LocalPharmacy,
+ LocalPhone,
+ LocalPizza,
+ LocalPlay,
+ LocalPolice,
+ LocalPostOffice,
+ LocalPrintshop,
+ LocalSee,
+ LocalShipping,
+ LocalTaxi,
+ LocationCity,
+ LocationOff,
+ LocationOn,
+ LocationPin,
+ Lock,
+ LockClock,
+ LockOpen,
+ LockOutline,
+ Login,
+ Logout,
+ Loyalty,
+ Luggage,
+ LunchDining,
+ MailOutline,
+ Map,
+ MapsUgc,
+ MarkAsUnread,
+ MarkChatRead,
+ MarkChatUnread,
+ MarkEmailRead,
+ MarkEmailUnread,
+ MarkunreadMailbox,
+ Masks,
+ Maximize,
+ Mediation,
+ MedicalServices,
+ Menu,
+ MenuBook,
+ MenuOpen,
+ Message,
+ MilitaryTech,
+ Minimize,
+ MiscellaneousServices,
+ MobileScreenShare,
+ ModelTraining,
+ Money,
+ Mood,
+ MoodBad,
+ Moped,
+ MoreHoriz,
+ MoreTime,
+ MoreVert,
+ MultipleStop,
+ Museum,
+ MyLocation,
+ Nat,
+ Navigation,
+ NearMe,
+ NearMeDisabled,
+ NextPlan,
+ Nightlife,
+ NightlightRound,
+ NightsStay,
+ NoLuggage,
+ NoMeals,
+ NoMealsOuline,
+ North,
+ NorthEast,
+ NorthWest,
+ NoSim,
+ NotAccessible,
+ NoteAdd,
+ NotificationImportant,
+ Notifications,
+ NotificationsActive,
+ NotificationsNone,
+ NotificationsOff,
+ NotificationsPaused,
+ NotListedLocation,
+ NoTransfer,
+ NotStarted,
+ TorchNoun,
+ OfflineBolt,
+ OfflinePin,
+ OfflineShare,
+ OnlinePrediction,
+ Opacity,
+ OpenInBrowser,
+ OpenInFull,
+ OpenInNew,
+ OpenWith,
+ Outbond,
+ Outbox,
+ OutdoorGrill,
+ OutgoingMail,
+ Outlet,
+ Pages,
+ Pageview,
+ PanTool,
+ Park,
+ PartyMode,
+ PausePresentation,
+ Payment,
+ Payments,
+ PedalBike,
+ Pending,
+ PendingActions,
+ People,
+ PeopleAlt,
+ PeopleOutline,
+ PermCameraMic,
+ PermContactCalendar,
+ PermDataSetting,
+ PermDeviceInformation,
+ PermIdentity,
+ PermMedia,
+ PermPhoneMsg,
+ PermScanWifi,
+ Person,
+ PersonAdd,
+ PersonAddAlt,
+ PersonAddSecondary,
+ PersonAddDisabled,
+ PersonOutline,
+ PersonPin,
+ PersonPinCircle,
+ PersonRemove,
+ PersonRemoveAlt,
+ PersonSearch,
+ PestControl,
+ PestControlRodent,
+ Pets,
+ Phone,
+ PhoneDisabled,
+ PhoneEnabled,
+ PhonelinkErase,
+ PhonelinkLock,
+ PhonelinkRing,
+ PhonelinkSetup,
+ PictureInPicture,
+ PictureInPictureAlt,
+ PinDrop,
+ PivotTableChart,
+ Place,
+ Plagiarism,
+ PlayForWork,
+ Plumbing,
+ PlusOne,
+ Poll,
+ Polymer,
+ Population,
+ PortableWifiOff,
+ PowerSettingsNew,
+ PregnantWoman,
+ PresentToAll,
+ Preview,
+ Print,
+ PrintDisabled,
+ PrivacyTip,
+ Psychology,
+ Public,
+ PublicOff,
+ PublishedWithChanges,
+ QrCode,
+ QrCodeScanner,
+ QueryBuilder,
+ QuestionAnswer,
+ Quickreply,
+ RailwayAlert,
+ RamenDining,
+ RateReview,
+ ReadMore,
+ Receipt,
+ Recommend,
+ RecordVoiceOver,
+ Redeem,
+ ReduceCapacity,
+ Refresh,
+ RemoveDone,
+ RemoveModerator,
+ RemoveShoppingCart,
+ Reorder,
+ ReportProblem,
+ RequestPage,
+ RequestQuote,
+ Restaurant,
+ RestaurantMenu,
+ Restore,
+ RestoreFromTrash,
+ RestorePage,
+ RingVolume,
+ Room,
+ RoundedCorner,
+ Rowing,
+ RssFeed,
+ Rtt,
+ Rule,
+ RuleFolder,
+ RunCircle,
+ Sanitizer,
+ Satellite,
+ SavedSearch,
+ Schedule,
+ ScheduleSend,
+ School,
+ Science,
+ ScreenShare,
+ Search,
+ SearchOff,
+ Segment,
+ SelfImprovement,
+ SendAndArchive,
+ SentimentDissatisfied,
+ SentimentNeutral,
+ SentimentSatisfied,
+ SentimentSatisfiedAlt,
+ SentimentVeryDissatisfied,
+ SentimentVerySatisfied,
+ SetMeal,
+ Settings,
+ SettingsApplications,
+ SettingsBackupRestore,
+ SettingsBluetooth,
+ SettingsBrightness,
+ SettingsCell,
+ SettingsEthernet,
+ SettingsInputAntenna,
+ SettingsInputComponent,
+ SettingsInputComposite,
+ SettingsInputHdmi,
+ SettingsInputVideo,
+ SettingsOverscan,
+ SettingsPhone,
+ SettingsPower,
+ SettingsRemote,
+ SettingsVoice,
+ Share,
+ Shop,
+ ShoppingBag,
+ ShoppingBasket,
+ ShoppingCart,
+ ShopAlt,
+ Sick,
+ SingleBed,
+ SmartButton,
+ SnippetFolder,
+ Source,
+ South,
+ SouthEast,
+ SouthWest,
+ SpeakerNotes,
+ SpeakerNotesOff,
+ SpeakerPhone,
+ SpellCheck,
+ Sports,
+ SportsBaseball,
+ SportsBasketball,
+ SportsCricket,
+ SportsEsports,
+ SportsFootball,
+ SportsGolf,
+ SportsHandball,
+ SportsHockey,
+ SportsKabaddi,
+ SportsMma,
+ SportsMotorsports,
+ SportsRugby,
+ SportsSoccer,
+ SportsTennis,
+ SportsVolleyball,
+ StarRate,
+ Stars,
+ StayCurrentLandscape,
+ StayCurrentPortrait,
+ StayPrimaryLandscape,
+ StayPrimaryPortrait,
+ StickyNotesSecondary,
+ ScreenShareStop,
+ Store,
+ StoreMallDirectory,
+ StreetView,
+ SubdirectoryArrowLeft,
+ SubdirectoryArrowRight,
+ Subject,
+ SubtitlesOff,
+ Subway,
+ SupervisedUserCircle,
+ SupervisorAccount,
+ Support,
+ SwapCalls,
+ SwapHorizontal,
+ SwapHorizontalCircle,
+ SwapVertical,
+ SwapVerticalCircle,
+ Swipe,
+ SwitchAccount,
+ SwitchLeft,
+ SwitchRight,
+ SyncAlt,
+ SystemUpdateAlt,
+ Tab,
+ TableView,
+ TabUnselected,
+ TakeOutDining,
+ TaxiAlert,
+ Terrain,
+ TextRotateUp,
+ TextRotateVertical,
+ TextRotationAngleDown,
+ TextRotationAngleUp,
+ TextRotationDown,
+ TextRotationNone,
+ SMSText,
+ TextSnippet,
+ TheaterComedy,
+ Theaters,
+ ThumbDown,
+ ThumbDownAlt,
+ ThumbDownOffAlt,
+ ThumbsUpDown,
+ ThumbUp,
+ ThumbUpAlt,
+ ThumbUpOffAlt,
+ Timeline,
+ Toc,
+ Today,
+ Toll,
+ Topic,
+ Torch,
+ TouchApp,
+ Tour,
+ TrackChanges,
+ Traffic,
+ Train,
+ Tram,
+ TransferWithinStation,
+ TransitEnterExit,
+ Translate,
+ TrendingDown,
+ TrendingFlat,
+ TrendingUp,
+ TripOrigin,
+ TurnedIn,
+ TurnedInNot,
+ TwoWheeler,
+ UnfoldLess,
+ UnfoldMore,
+ Unpublished,
+ Unsubscribe,
+ Update,
+ UpdateExpense,
+ UpdateExpenseSecondary,
+ Upgrade,
+ UploadFile,
+ Verified,
+ VerifiedUser,
+ VerticalSplit,
+ ViewAgenda,
+ ViewArray,
+ ViewCarousel,
+ ViewColumn,
+ ViewDay,
+ ViewHeadline,
+ ViewInAr,
+ ViewList,
+ ViewModule,
+ ViewQuilt,
+ ViewSidebar,
+ ViewStream,
+ ViewWeek,
+ Visibility,
+ VisibilityOff,
+ Voicemail,
+ VoiceOverOff,
+ VolunteerActivism,
+ VpnKey,
+ Warning,
+ WatchLater,
+ WaterfallChart,
+ West,
+ Whatsapp,
+ Whatshot,
+ WifiCalling,
+ WifiProtectedSetup,
+ WineBar,
+ Work,
+ WorkOff,
+ WorkOutline,
+ WorkspacesFilled,
+ WorkspacesOutline,
+ WrongLocation,
+ Wysiwyg,
+ YoutubeSearchedFor,
+ ZoomIn,
+ ZoomOut,
+ ZoomOutMap,
+ StarFilled,
+ StarEmpty,
+};
+
+SVG.propTypes = {
+ /** custom width of the svg icon */
+ width: PropTypes.string,
+ /** custom height of the svg icon */
+ height: PropTypes.string,
+ /** custom colour of the svg icon */
+ fill: PropTypes.string,
+ /** custom class of the svg icon */
+ className: PropTypes.string,
+ /** custom style of the svg icon */
+ style: PropTypes.object,
+ /** Click Event handler when icon is clicked */
+ onClick: PropTypes.func,
+};
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/SearchComponent.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/SearchComponent.js
new file mode 100644
index 00000000..d4363a39
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/SearchComponent.js
@@ -0,0 +1,317 @@
+import React, { useContext, useEffect, useState,useMemo,useRef,useLayoutEffect } from "react";
+import { useForm,useWatch} from "react-hook-form";
+import { useTranslation } from "react-i18next";
+import { InboxContext } from "../hoc/InboxSearchComposerContext";
+import RenderFormFields from "../molecules/RenderFormFields";
+import HeaderComponent from "../atoms/HeaderComponent";
+import LinkLabel from '../atoms/LinkLabel';
+import SubmitBar from "../atoms/SubmitBar";
+import Toast from "../atoms/Toast";
+import { CustomSVG } from "./CustomSVG";
+import Tab from "./Tab";
+import Button from "./Button";
+import FilterCard from "../molecules/FilterCard";
+
+const setUIConf = (uiConfig) => {
+ if(uiConfig.additionalTabs)
+ return [{...uiConfig},...uiConfig?.additionalTabs]
+ return [{uiConfig}]
+}
+
+const SearchComponent = ({ uiConfig, header = "", screenType = "search", fullConfig, data,activeLink,browserSession,showTab,showTabCount=false, tabData, onTabChange}) => {
+
+ //whenever activeLink changes we'll change uiConfig
+ // const [activeLink,setActiveLink] = useState(uiConfig?.configNavItems?.filter(row=>row.activeByDefault)?.[0]?.name)
+ const [allUiConfigs,setAllUiConfigs] = useState(setUIConf(uiConfig))
+ const { t } = useTranslation();
+ const { state, dispatch } = useContext(InboxContext)
+ const [showToast,setShowToast] = useState(null)
+ let updatedFields = [];
+ const {apiDetails} = fullConfig
+ const customDefaultPagination = fullConfig?.sections?.searchResult?.uiConfig?.customDefaultPagination || null
+ const [session,setSession,clearSession] = browserSession || []
+ const buttonWrapperRef = useRef(null);
+ const [addMargin, setAddMargin] = useState(false);
+
+ if (fullConfig?.postProcessResult){
+ //conditions can be added while calling postprocess function to pass different params
+ Digit?.Customizations?.[apiDetails?.masterName]?.[apiDetails?.moduleName]?.postProcess(data, uiConfig)
+ }
+
+ const defValuesFromSession = uiConfig?.type === "search" ? session?.searchForm : session?.filterForm
+
+
+ const {
+ register,
+ handleSubmit,
+ setValue,
+ getValues,
+ reset,
+ watch,
+ trigger,
+ control,
+ formState,
+ errors,
+ setError,
+ clearErrors,
+ unregister,
+ } = useForm({
+ defaultValues: uiConfig?.defaultValues,
+ // defaultValues: {...uiConfig?.defaultValues,...defValuesFromSession}
+ // defaultValues:defaultValuesFromSession
+ });
+
+ const formData = watch();
+
+ const checkKeyDown = (e) => {
+ const keyCode = e.keyCode ? e.keyCode : e.key ? e.key : e.which;
+ if (keyCode === 13) {
+ // e.preventDefault();
+ }
+ };
+
+ useEffect(() => {
+ updatedFields = Object.values(formState?.dirtyFields)
+ }, [formState])
+
+ useEffect(() => {
+ clearSearch()
+ }, [activeLink])
+
+ useLayoutEffect(() => {
+ if (buttonWrapperRef.current) {
+ const buttonTop = buttonWrapperRef.current.offsetTop;
+ const formFields = document.querySelectorAll(".digit-search-field-wrapper .digit-label-field-pair");
+ let isAligned = false;
+ formFields.forEach((field) => {
+ if (field?.offsetTop === buttonTop) {
+ isAligned = true;
+ }
+ });
+ setAddMargin(isAligned);
+ }
+ }, []);
+
+ const onSubmit = (data,e) => {
+ e?.preventDefault?.();
+ //here -> added a custom validator function, if required add in UICustomizations
+ const isAnyError = Digit?.Customizations?.[apiDetails?.masterName]?.[apiDetails?.moduleName]?.customValidationCheck ? Digit?.Customizations?.[apiDetails?.masterName]?.[apiDetails?.moduleName]?.customValidationCheck(data) : false
+ if(isAnyError) {
+ setShowToast(isAnyError)
+ setTimeout(closeToast,3000)
+ return
+ }
+
+ if(updatedFields?.length >= (activeLink ? allUiConfigs?.filter(uiConf => activeLink?.name === uiConf.uiConfig.navLink)?.[0]?.uiConfig?.minReqFields : uiConfig?.minReqFields)) {
+ // here based on screenType call respective dispatch fn
+ dispatch({
+ type: uiConfig?.type === "filter" ? "filterForm" : "searchForm",
+ state: {
+ ...data
+ }
+ })
+ //here reset tableForm as well when search
+ dispatch({
+ type: "tableForm",
+ state: { limit:10,offset:0 }
+ })
+ } else {
+ setShowToast({ type:"warning", label: t("ES_COMMON_MIN_SEARCH_CRITERIA_MSG") })
+ setTimeout(closeToast, 3000);
+ }
+ }
+
+ const clearSearch = () => {
+
+ reset(uiConfig?.defaultValues)
+ dispatch({
+ type: uiConfig?.type === "filter"? "clearFilterForm" :"clearSearchForm",
+ state: { ...uiConfig?.defaultValues }
+ //need to pass form with empty strings
+ })
+ //here reset tableForm as well
+ dispatch({
+ type: "tableForm",
+ state: { limit:10,offset:0 }
+ //need to pass form with empty strings
+ })
+ }
+
+ //call this fn whenever session gets updated
+ const setDefaultValues = () => {
+ reset({...uiConfig?.defaultValues,...defValuesFromSession})
+ }
+
+ //adding this effect because simply setting session to default values is not working
+ useEffect(() => {
+ setDefaultValues()
+ }, [session])
+
+
+ const closeToast = () => {
+ setShowToast(null);
+ }
+
+ const handleFilterRefresh = () => {
+ reset(uiConfig?.defaultValues)
+ dispatch({
+ type: "clearFilterForm",
+ state: { ...uiConfig?.defaultValues }
+ //need to pass form with empty strings
+ })
+ }
+
+ const renderHeader = () => {
+ switch(uiConfig?.type) {
+ case "filter" : {
+ return (
+
+ )
+ }
+ default : {
+ return {t(header)}
+ }
+ }
+ }
+
+ const renderContent = () => {
+ return (
+ activeLink?.name === uiConf.uiConfig.navLink
+ )?.[0]?.uiConfig?.fields
+ : uiConfig?.fields
+ }
+ control={control}
+ formData={formData}
+ errors={errors}
+ register={register}
+ setValue={setValue}
+ getValues={getValues}
+ setError={setError}
+ clearErrors={clearErrors}
+ labelStyle={{ fontSize: "16px" }}
+ apiDetails={apiDetails}
+ data={data}
+ />
+ );
+ };
+
+ const navConfigMain = tabData?.map((tab) => ({
+ key: tab.key,
+ label: showTabCount? `${t(tab?.label)}(${data?.count || data?.TotalCount || data?.totalCount})`: t(tab?.label) || `Tab ${tab.key + 1}`,
+ active: tab.active,
+ }));
+
+ const activeTab = tabData?.find((tab) => tab.active)?.key || 0;
+
+ return (
+ 0}
+ configItemKey={"key"}
+ configDisplayKey={"label"}
+ activeLink={activeTab}
+ setActiveLink={(key) => {
+ clearSearch({});
+ onTabChange(key);
+ }}
+ fromSearchComp={true}
+ horizontalLine={uiConfig?.horizontalLine}
+ >
+ {uiConfig?.type === "filter" ? (
+
+ {renderContent()}
+
+ ) : (
+
+ {header && renderHeader()}
+
+ {showToast && (
+
+ )}
+
+ )}
+
+ );
+}
+
+export default SearchComponent
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/SelectionTag.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/SelectionTag.js
new file mode 100644
index 00000000..45b90e59
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/SelectionTag.js
@@ -0,0 +1,120 @@
+import React, { useState} from "react";
+import PropTypes from "prop-types";
+import ErrorMessage from "./ErrorMessage";
+import { useTranslation } from "react-i18next";
+import { Colors } from "../constants/colors/colorconstants";
+import { iconRender } from "../utils/iconRender";
+
+const SelectionTag = ({
+ width,
+ errorMessage,
+ options,
+ onSelectionChanged,
+ allowMultipleSelection = true,
+ selected,
+ withContainer
+}) => {
+ const { t } = useTranslation();
+ const [selectedOptions, setSelectedOptions] = useState(selected || []);
+
+ const handleOptionClick = (option) => {
+ const updatedSelections = [...selectedOptions];
+ const isSelected = updatedSelections.some(
+ (selectedOption) => selectedOption.code === option.code
+ );
+
+ if (allowMultipleSelection) {
+ if (isSelected) {
+ // Remove the option if it's already selected
+ const index = updatedSelections.findIndex(
+ (selectedOption) => selectedOption.code === option.code
+ );
+ updatedSelections.splice(index, 1);
+ } else {
+ updatedSelections.push(option);
+ }
+ } else {
+ if (isSelected) {
+ updatedSelections.length = 0; // Clear selection if already selected
+ } else {
+ updatedSelections.length = 0; // Clear all and select the current option
+ updatedSelections.push(option);
+ }
+ }
+ setSelectedOptions(updatedSelections);
+ onSelectionChanged(updatedSelections);
+ };
+
+ const secondaryIconColor = Colors.lightTheme.generic.inputBorder;
+ const primaryIconColor = Colors.lightTheme.paper.primary;
+
+ const IconRender = (iconReq, isActive) => {
+ const iconFill = isActive ? primaryIconColor : secondaryIconColor;
+ return iconRender(
+ iconReq,
+ iconFill,
+ "1.5rem",
+ "1.5rem",
+ ""
+ );
+ };
+
+ const renderOption = (option) => {
+ const isSelected = selectedOptions.some(
+ (selectedOption) => selectedOption.code === option.code
+ );
+ return (
+ handleOptionClick(option)}
+ >
+ {option.prefixIcon && (
+
+ {IconRender(option?.prefixIcon, isSelected)}
+
+ )}
+ {option.name}
+ {option.suffixIcon && (
+
+ {IconRender(option?.suffixIcon, isSelected)}
+
+ )}
+
+ );
+ };
+
+ return (
+
+
+ {options?.map(renderOption)}
+
+ {errorMessage && (
+
+ )}
+
+ );
+};
+
+SelectionTag.propTypes = {
+ width: PropTypes.number,
+ errorMessage: PropTypes.string,
+ options: PropTypes.arrayOf(
+ PropTypes.shape({
+ name: PropTypes.string.isRequired,
+ code: PropTypes.string.isRequired,
+ prefixIcon: PropTypes.node,
+ suffixIcon: PropTypes.node,
+ })
+ ).isRequired,
+ onSelectionChanged: PropTypes.func.isRequired,
+ allowMultipleSelection: PropTypes.bool,
+};
+
+export default SelectionTag;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/SideNav.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/SideNav.js
new file mode 100644
index 00000000..9d2e4220
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/SideNav.js
@@ -0,0 +1,334 @@
+import React, { useState, useEffect,Fragment } from "react";
+import PropTypes from "prop-types";
+import { useTranslation } from "react-i18next";
+import { SVG, TextInput } from "../atoms";
+import { IMAGES } from "../constants/images/images";
+import { Colors } from "../constants/colors/colorconstants";
+import { iconRender } from "../utils/iconRender";
+import { Spacers } from "../constants/spacers/spacers";
+
+const SideNav = ({
+ items,
+ theme,
+ variant,
+ transitionDuration,
+ className,
+ styles,
+ hideAccessbilityTools,
+ expandedWidth,
+ collapsedWidth,
+ onSelect,
+ onBottomItemClick,
+ enableSearch
+}) => {
+ const { t } = useTranslation();
+ const [hovered, setHovered] = useState(false);
+ const [search, setSearch] = useState("");
+ const [selectedItem, setSelectedItem] = useState({});
+ const [expandedItems, setExpandedItems] = useState({});
+
+ const darkThemeColor = Colors.lightTheme.paper.primary;
+ const lightThemeColor = Colors.lightTheme.primary[2];
+
+ const primaryColor = theme === "dark" ? darkThemeColor : lightThemeColor;
+ const iconSize = Spacers.spacer6;
+ const bottomIconSize = Spacers.spacer4;
+
+ const handleArrowClick = (item, index, parentIndex) => {
+ if (item.children) {
+ setExpandedItems((prev) => ({
+ ...prev,
+ [index]: !prev[index],
+ }));
+ }
+ };
+
+ const handleItemClick = (item, index, parentIndex) => {
+ setSelectedItem({ item: item, index: index, parentIndex: parentIndex });
+ onSelect && onSelect({ item: item, index: index, parentIndex: parentIndex });
+ };
+
+ const isParentOfSelectedItem = (index) => {
+ const { parentIndex } = selectedItem;
+ return parentIndex && parentIndex.toString().startsWith(index);
+ };
+
+ const IconRender = (
+ isSelected,
+ isParentOfSelectedItem,
+ iconReq,
+ iconFill,
+ width = iconSize,
+ height = iconSize
+ ) => {
+ return iconRender(
+ iconReq,
+ iconFill ||
+ (theme === "dark" ||
+ (theme === "light" && variant === "primary" && isSelected && hovered) ||
+ (theme === "light" &&
+ variant === "primary" &&
+ (isSelected || isParentOfSelectedItem) &&
+ !hovered)
+ ? darkThemeColor
+ : lightThemeColor),
+ width,
+ height,
+ `digit-sidebar-item-icon`
+ );
+ };
+
+ const filterItems = (items, query) => {
+ if (!query) {
+ return items;
+ }
+
+ return items
+ .map((item) => {
+ if (item.label.toLowerCase().includes(query.toLowerCase())) {
+ return item;
+ }
+
+ if (item.children) {
+ const filteredChildren = filterItems(item.children, query);
+ if (filteredChildren.length > 0) {
+ return { ...item, children: filteredChildren };
+ }
+ }
+
+ return null;
+ })
+ .filter((item) => item !== null);
+ };
+
+ const renderSearch = () => {
+ return (
+ <>
+ {hovered ? (
+
+ setSearch(e.target.value)}
+ placeholder={t("Search")}
+ autoFocus={true}
+ iconFill={primaryColor}
+ >
+
+ ) : (
+
+
+
+ )}
+ >
+ );
+ };
+
+ const renderItems = (items, parentIndex = -1) =>
+ items?.map((item, index) => {
+ const currentIndex = parentIndex >= 0 ? `${parentIndex}-${index}` : index;
+ const isExpanded = expandedItems[currentIndex];
+ const isSelected = selectedItem.item === item;
+ const isTopLevel = parentIndex === -1;
+
+ return (
+
+
handleItemClick(item, currentIndex, parentIndex)}
+ tabIndex={0}
+ >
+ {(isTopLevel || hovered) && (
+
+ {(isSelected || isParentOfSelectedItem(currentIndex)) &&
+ item?.selectedIcon
+ ? IconRender(
+ isSelected,
+ isParentOfSelectedItem(currentIndex),
+ item?.selectedIcon?.icon,
+ item?.selectedIcon?.iconFill,
+ item?.selectedIcon?.width,
+ item?.selectedIcon?.height
+ )
+ : IconRender(
+ isSelected,
+ isParentOfSelectedItem(currentIndex),
+ item?.icon?.icon,
+ item?.icon?.iconFill,
+ item?.icon?.width,
+ item?.icon?.height
+ )}
+
+ )}
+ {hovered && {item.label} }
+ {item.children && hovered && (
+ {
+ e.stopPropagation();
+ handleArrowClick(item, currentIndex, parentIndex);
+ }}
+ >
+ {isExpanded ? (
+
+ ) : (
+
+ )}
+
+ )}
+
+ {item.children && isExpanded && hovered && (
+
+ {renderItems(item.children, currentIndex)}
+
+ )}
+
+ );
+ });
+
+ const filteredItems = filterItems(items, search);
+
+ const getImageUrl = (imageKey) => {
+ return IMAGES[imageKey];
+ };
+
+ const digitFooterImg =
+ theme === "dark"
+ ? getImageUrl("DIGIT_FOOTER_DARK")
+ : getImageUrl("DIGIT_FOOTER_LIGHT");
+
+ return (
+ setHovered(true)}
+ onMouseLeave={() => setHovered(false)}
+ >
+ {enableSearch && renderSearch()}
+
+ {filteredItems.length > 0 ? (
+ renderItems(filteredItems)
+ ) : (
+ hovered &&
{t("No Results Found")}
+ )}
+
+ {hovered && !hideAccessbilityTools && (
+
+
+
onBottomItemClick && onBottomItemClick("Help")}>
+
+ {t("Help")}
+
+
onBottomItemClick && onBottomItemClick("Settings")}>
+
+ {t("Settings")}
+
+
onBottomItemClick && onBottomItemClick("Logout")}>
+
+ {t("Logout")}
+
+
+
+
{
+ window
+ .open(
+ window?.globalConfigs?.getConfig?.("DIGIT_HOME_URL"),
+ "_blank"
+ )
+ .focus();
+ }}
+ />
+
+ )}
+
+ );
+};
+
+SideNav.propTypes = {
+ items: PropTypes.arrayOf(
+ PropTypes.shape({
+ path: PropTypes.string,
+ icon: PropTypes.object,
+ label: PropTypes.string.isRequired,
+ children: PropTypes.array,
+ })
+ ).isRequired,
+ theme: PropTypes.oneOf(["dark", "light"]),
+ variant: PropTypes.oneOf(["primary", "secondary"]),
+ collapsedWidth: PropTypes.string,
+ expandedWidth: PropTypes.string,
+ transitionDuration: PropTypes.number,
+ styles: PropTypes.object,
+ hideAccessbilityTools: PropTypes.bool,
+ enableSearch: PropTypes.bool,
+};
+
+SideNav.defaultProps = {
+ theme: "dark",
+ variant: "primary",
+ transitionDuration: 0.3,
+ styles: {},
+ enableSearch: true
+};
+
+export default SideNav;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/SidePanel.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/SidePanel.js
new file mode 100644
index 00000000..0f4f34b2
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/SidePanel.js
@@ -0,0 +1,224 @@
+import React, { useEffect, useState, useRef,Fragment } from "react";
+import PropTypes from "prop-types";
+import { SVG } from "./SVG";
+import { Colors } from "../constants/colors/colorconstants";
+import { Spacers } from "../constants/spacers/spacers";
+
+const SidePanel = ({
+ className = "",
+ styles = {},
+ type = "static",
+ position = "right",
+ children,
+ header,
+ footer,
+ bgActive = false,
+ isOverlay = false,
+ isDraggable = false,
+ hideArrow,
+ hideScrollIcon,
+ sections = [],
+ defaultOpenWidth,
+ defaultClosedWidth,
+ addClose,
+ closedContents,
+ closedSections,
+ closedHeader,
+ closedFooter,
+ transitionDuration,
+ onClose = null
+}) => {
+ const [isOpen, setIsOpen] = useState(true);
+ const sliderRef = useRef(null);
+ const [sliderWidth, setSliderWidth] = useState(defaultOpenWidth || 300);
+ const isDragging = useRef(false);
+
+ const iconColor = Colors.lightTheme.text.primary;
+ const iconSize = Spacers.spacer8;
+
+ const toggleSlider = () => {
+ if (type === "static") return;
+ if (isOpen) {
+ setIsOpen(false);
+ setSliderWidth(defaultClosedWidth || 64);
+ return;
+ }
+ setIsOpen((prevState) => !prevState);
+ if (!isOpen) {
+ setSliderWidth(defaultOpenWidth);
+ }
+ };
+
+ const handleClose = () => {
+ onClose ? onClose() : setIsOpen(false);
+ };
+
+ const handleMouseDown = (e) => {
+ if (isDraggable && type === "dynamic" && isOpen) {
+ isDragging.current = true;
+ document.addEventListener("mousemove", handleMouseMove);
+ document.addEventListener("mouseup", handleMouseUp);
+ }
+ };
+
+ const handleMouseMove = (e) => {
+ if (isDragging.current && sliderRef.current && isOpen) {
+ const newWidth =
+ position === "right" ? window.innerWidth - e.clientX : e.clientX;
+ setSliderWidth(
+ newWidth > (defaultClosedWidth || 64)
+ ? newWidth
+ : defaultClosedWidth || 64
+ );
+ }
+ };
+
+ const handleMouseUp = () => {
+ isDragging.current = false;
+ document.removeEventListener("mousemove", handleMouseMove);
+ document.removeEventListener("mouseup", handleMouseUp);
+ };
+
+ useEffect(() => {
+ return () => {
+ document.removeEventListener("mousemove", handleMouseMove);
+ document.removeEventListener("mouseup", handleMouseUp);
+ };
+ }, []);
+
+ useEffect(() => {}, [isOpen]);
+
+ return (
+ <>
+ {!bgActive &&
}
+
+ {type === "dynamic" && (
+
+ {!hideScrollIcon &&
}
+ {!hideArrow && (
+
+
+
+ )}
+
+ )}
+
+ {header && isOpen && (
+
+ {addClose && isOpen && (
+
+
+
+ )}
+ {header}
+
+ )}
+ {
+ closedHeader && !isOpen && (
+
+ {closedHeader}
+
+ )
+ }
+
0 ? "with-sections" : ""
+ }`}
+ >
+ {isOpen
+ ? sections && sections?.length > 0
+ ? sections?.map((section, index) => (
+
+
+ {section}
+
+ {index < sections.length - 1 && (
+
+ )}
+
+ ))
+ : children
+ : sections && sections?.length > 0
+ ? closedSections?.map((section, index) => (
+
+
+ {section}
+
+ {index < sections.length - 1 && (
+
+ )}
+
+ ))
+ : closedContents}
+
+
+ {footer && isOpen &&
{footer}
}
+ {closedFooter && !isOpen &&
{closedFooter}
}
+
+
+ >
+ );
+};
+
+SidePanel.propTypes = {
+ className: PropTypes.string,
+ styles: PropTypes.object,
+ type: PropTypes.oneOf(["static", "dynamic"]),
+ position: PropTypes.oneOf(["left", "right"]),
+ children: PropTypes.node,
+ header: PropTypes.node,
+ footer: PropTypes.node,
+ addClose: PropTypes.bool,
+ closedContents: PropTypes.node,
+ closedSections: PropTypes.arrayOf(PropTypes.node),
+ closedHeader: PropTypes.node,
+ closedFooter: PropTypes.node,
+ transitionDuration: PropTypes.number,
+ bgActive: PropTypes.bool,
+ isOverlay: PropTypes.bool,
+ isDraggable: PropTypes.bool,
+ sections: PropTypes.arrayOf(PropTypes.node),
+ hideArrow: PropTypes.bool,
+ hideScrollIcon: PropTypes.bool,
+ defaultOpenWidth: PropTypes.number,
+ defaultClosedWidth: PropTypes.number,
+};
+
+export default SidePanel;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Stepper.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Stepper.js
new file mode 100644
index 00000000..c75bde5d
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Stepper.js
@@ -0,0 +1,139 @@
+import React,{useState,useEffect,useRef} from "react";
+import PropTypes from "prop-types";
+import { useTranslation } from "react-i18next";
+import { SVG } from "./SVG";
+import StringManipulator from "./StringManipulator";
+import { Colors} from "../constants/colors/colorconstants";
+import Divider from "./Divider";
+
+const Stepper = ({
+ currentStep = 1,
+ onStepClick,
+ totalSteps,
+ customSteps,
+ direction,
+ style,
+ props,
+ className,
+ activeSteps,
+ hideDivider
+}) => {
+ const { t } = useTranslation();
+ const stepRefs = useRef([]);
+
+ const [isMobileView, setIsMobileView] = useState(
+ (window.innerWidth / window.innerHeight <= 9/16)
+ );
+ const onResize = () => {
+ if (window.innerWidth / window.innerHeight <= 9/16) {
+ if (!isMobileView) {
+ setIsMobileView(true);
+ }
+ } else {
+ if (isMobileView) {
+ setIsMobileView(false);
+ }
+ }
+ };
+ useEffect(() => {
+ window.addEventListener("resize", () => {
+ onResize();
+ });
+ return () => {
+ window.addEventListener("resize", () => {
+ onResize();
+ });
+ };
+ });
+
+ useEffect(() => {
+ // Scroll the current step into view when currentStep changes
+ if (stepRefs.current[currentStep]) {
+ stepRefs.current[currentStep].scrollIntoView({
+ behavior: "smooth",
+ block: "center",
+ inline: "center",
+ });
+ }
+ }, [currentStep]);
+
+ useEffect(() => {
+ // This useEffect will trigger a re-render when number of activeSteps changes
+ }, [activeSteps]);
+
+ const Color = Colors.lightTheme.paper.primary;
+
+ const getAction = (totalSteps, customSteps) => {
+ if (customSteps && Object.keys(customSteps).length !== 0) {
+ return Object.values(customSteps);
+ }
+ return Array.from(
+ { length: totalSteps },
+ (_, index) => `Step ${index + 1}`
+ );
+ };
+ const actions = getAction(totalSteps, customSteps);
+
+ return (
+
+ {actions.map((action, index, arr) => (
+
(stepRefs.current[index] = el)}
+ className={`digit-stepper-checkpoint ${direction ? direction : ""}`}
+ style={{ cursor: "pointer" }}
+ key={index}
+ onClick={() => {
+ currentStep = index;
+ onStepClick(index);
+ }}
+ >
+
+
+ {((index < currentStep - 1) || (index < activeSteps) ) ? (
+
+ ) : (
+ index + 1
+ )}
+
+
+ {t(
+ StringManipulator("TRUNCATESTRING", action, { maxLength: 64 })
+ )}
+
+
+ {index < arr.length - 1 && (
+
+ )}
+ {index < arr.length - 1 && direction === "vertical" && !hideDivider && (
+
+ )}
+
+ ))}
+
+ );
+};
+export default Stepper;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/StringManipulator.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/StringManipulator.js
new file mode 100644
index 00000000..d370954c
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/StringManipulator.js
@@ -0,0 +1,61 @@
+import React from "react";
+import PropTypes from "prop-types";
+
+const StringManipulator = (functionName, key, props) => {
+
+
+
+ const isStringManipulated=window?.globalConfigs?.getConfig("IS_STRING_MANIPULATED")|| false;
+ if(!isStringManipulated){
+ return key;
+ }
+ const manipulateString = () => {
+ if (!key) return null;
+
+ switch (functionName) {
+ case "TOSENTENCECASE":
+ return toSentenceCase(key);
+ case "CAPITALIZEFIRSTLETTER":
+ return capitalizeFirstLetter(key);
+ case "TOTITLECASE":
+ return toTitleCase(key);
+ case "TRUNCATESTRING":
+ return truncateString(key, props?.maxLength);
+ default:
+ return key;
+ }
+ };
+
+ const toSentenceCase = (str) => {
+ return str.toLowerCase().replace(/(^\s*\w|[.!?]\s*\w)/g, (match) => {
+ return match.toUpperCase();
+ });
+ };
+
+ const capitalizeFirstLetter = (str) => {
+ return str.replace(/\b\w/g, char => char.toUpperCase());
+ };
+
+ const toTitleCase = (str) => {
+ return str.toLowerCase().replace(/\b\w|\b[^a-zA-Z0-9\s]*\w/g, (c) => {
+ return c.toUpperCase();
+ });
+ };
+
+ const truncateString = (str, maxLength) => {
+ if (str.length > maxLength) {
+ return str.slice(0, maxLength) + "...";
+ }
+ return str;
+ };
+
+ return manipulateString();
+};
+
+StringManipulator.propTypes = {
+ functionName: PropTypes.string,
+ key: PropTypes.string,
+ props: PropTypes.object,
+};
+
+export default StringManipulator;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/SubmitBar.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/SubmitBar.js
new file mode 100644
index 00000000..475d3236
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/SubmitBar.js
@@ -0,0 +1,41 @@
+import React, { forwardRef } from "react";
+import PropTypes from "prop-types";
+
+const SubmitBar = forwardRef((props, ref) => {
+ return (
+
+ {props.label}
+
+ );
+});
+
+SubmitBar.propTypes = {
+ /**
+ * Is it a normal button or submit button?
+ */
+ submit: PropTypes.any,
+ /**
+ * style for the button
+ */
+ style: PropTypes.object,
+ /**
+ * SubmitButton contents
+ */
+ label: PropTypes.string,
+ /**
+ * Optional click handler
+ */
+ onSubmit: PropTypes.func,
+};
+
+SubmitBar.defaultProps = {};
+
+export default SubmitBar;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/SummaryCardFieldPair.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/SummaryCardFieldPair.js
new file mode 100644
index 00000000..c6d6af09
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/SummaryCardFieldPair.js
@@ -0,0 +1,127 @@
+import React from "react";
+import PropTypes from "prop-types";
+import Button from "./Button";
+import { CustomSVG } from "./CustomSVG";
+import { useTranslation } from "react-i18next";
+
+const SummaryCardFieldPair = ({
+ label,
+ value,
+ inline,
+ className,
+ style,
+ type,
+ renderCustomContent,
+}) => {
+ const { t } = useTranslation();
+ const renderFileIcon = (fileType, onClick) => {
+ const handleClick =
+ onClick && typeof onClick === "function" ? onClick : undefined;
+
+ switch (fileType) {
+ case "pdf":
+ return (
+
+ );
+ case "png":
+ return (
+
+ );
+ case "jpeg":
+ case "pjpeg":
+ return (
+
+ );
+ case "excel":
+ return (
+
+ );
+ case "word":
+ return (
+
+ );
+ default:
+ return (
+
+ );
+ }
+ };
+
+ const renderValue = () => {
+ switch (type) {
+ case "text":
+ return {t(value)}
;
+ case "image":
+ return (
+
+ );
+ case "document":
+ return renderFileIcon(value?.fileType, value?.onClick);
+ case "action":
+ return (
+
+ );
+ case "custom":
+ return renderCustomContent ? renderCustomContent(value) : null;
+ default:
+ return {t(value)}
;
+ }
+ };
+
+ return (
+
+
{label}
+ {renderValue()}
+
+ );
+};
+
+SummaryCardFieldPair.propTypes = {
+ label: PropTypes.string,
+ value: PropTypes.string,
+ type: PropTypes.oneOf(["text", "image", "document", "action", "custom"]),
+ inline: PropTypes.bool,
+ className: PropTypes.string,
+ style: PropTypes.object,
+ renderCustomContent: PropTypes.func,
+};
+
+export default SummaryCardFieldPair;
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Switch.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Switch.js
new file mode 100644
index 00000000..27f0b321
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Switch.js
@@ -0,0 +1,77 @@
+import React, { useEffect, useState } from "react";
+import PropTypes from "prop-types";
+
+const Switch = ({
+ isLabelFirst = false,
+ label = "",
+ shapeOnOff = false,
+ isCheckedInitially = false,
+ onToggle = () => {},
+ className,
+ style,
+ disable = false,
+ switchStyle
+}) => {
+ const [isChecked, setIsChecked] = useState(isCheckedInitially);
+ useEffect(() => {
+ setIsChecked(isCheckedInitially);
+ }, [isCheckedInitially]);
+
+ const handleToggle = () => {
+ if (!disable) {
+ setIsChecked(!isChecked);
+ onToggle(!isChecked);
+ }
+ };
+
+ return (
+
+ {isLabelFirst && (
+
{label}
+ )}
+
{
+ if (e.key === 'Enter' || e.key === ' ') {
+ handleToggle();
+ }
+ }}
+ >
+ {shapeOnOff && isChecked && (
+
+ )}
+
+ {shapeOnOff && !isChecked && (
+
+ )}
+
+ {!isLabelFirst && (
+
{label}
+ )}
+
+ );
+};
+
+export default Switch;
+
+Switch.propTypes = {
+ isLabelFirst: PropTypes.bool,
+ label: PropTypes.string,
+ shapeOnOff: PropTypes.bool,
+ isCheckedInitially: PropTypes.bool,
+ onToggle: PropTypes.func,
+ className: PropTypes.string,
+ style: PropTypes.object,
+ switchStyle: PropTypes.object,
+ disable: PropTypes.bool,
+};
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Tab.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Tab.js
new file mode 100644
index 00000000..07612f3f
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Tab.js
@@ -0,0 +1,130 @@
+import React, { useState, useEffect, useRef } from "react";
+import PropTypes from "prop-types";
+import { useTranslation } from "react-i18next";
+import StringManipulator from "./StringManipulator";
+import { iconRender } from "../utils/iconRender";
+import { Colors } from "../constants/colors/colorconstants";
+import { Spacers } from "../constants/spacers/spacers";
+
+const Tab = ({
+ configNavItems,
+ configItemKey,
+ activeLink,
+ setActiveLink,
+ showNav = false,
+ children,
+ style = {},
+ className = "",
+ navClassName = "",
+ navStyles = {},
+ itemStyle = {},
+ onTabClick,
+ configDisplayKey
+}) => {
+ const { t } = useTranslation();
+ const primaryColor = Colors.lightTheme.primary[1];
+ const secondaryColor = Colors.lightTheme.text.secondary;
+ const iconSize = Spacers.spacer6;
+
+ const itemRefs = useRef([]);
+ const [maxWidth, setMaxWidth] = useState(0);
+
+ const setActive = (item) => {
+ setActiveLink(item?.[configItemKey]);
+ onTabClick && onTabClick(item);
+ };
+
+ const calculateMaxWidth = () => {
+ // Calculate the maximum width of all tab items
+ const widths = itemRefs.current.map(
+ (ref) => ref?.getBoundingClientRect().width || 0
+ );
+ const maxItemWidth = Math.max(...widths);
+ setMaxWidth(maxItemWidth);
+ };
+
+ useEffect(() => {
+ calculateMaxWidth();
+ }, [configNavItems, activeLink]);
+
+ return (
+
+ {showNav && (
+
+ {configNavItems?.map((item, index) => (
+
setActive(item)}
+ >
+
(itemRefs.current[index] = el)}
+ className="digit-tab-item"
+ style={
+ maxWidth
+ ? {
+ minWidth: `${maxWidth}px`,
+ ...itemStyle,
+ }
+ : { ...itemStyle }
+ }
+ >
+ {item?.icon && (
+
+ {iconRender(
+ item?.icon,
+ activeLink === item?.[configItemKey]
+ ? primaryColor
+ : secondaryColor,
+ iconSize,
+ iconSize,
+ ``
+ )}
+
+ )}
+
+ {StringManipulator(
+ "CAPITALIZEFIRSTLETTER",
+ configDisplayKey ? t(item?.[configDisplayKey]) : t(item?.[configItemKey])
+ )}
+
+
+
+ ))}
+
+ )}
+ {children}
+
+ );
+};
+
+Tab.propTypes = {
+ items: PropTypes.arrayOf(
+ PropTypes.shape({
+ name: PropTypes.string,
+ code: PropTypes.string,
+ icon: PropTypes.string,
+ })
+ ).isRequired,
+ configItemKey: PropTypes.string,
+ style: PropTypes.object,
+ navStyles: PropTypes.object,
+ itemStyle: PropTypes.object,
+ showNav: PropTypes.bool,
+ className: PropTypes.string,
+ navClassName: PropTypes.string,
+ activeLink: PropTypes.string,
+};
+
+Tab.defaultProps = {
+ showNav: false,
+ style: {},
+ className: "",
+ navClassName: "",
+ navStyles: {},
+ itemStyle: {},
+};
+
+export default Tab;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Table.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Table.js
new file mode 100644
index 00000000..695c7049
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Table.js
@@ -0,0 +1,273 @@
+import { useGlobalFilter, usePagination, useRowSelect, useSortBy, useTable } from "react-table";
+import React, { useEffect, useState, useRef, forwardRef } from "react";
+import { CustomSVG } from "./CustomSVG";
+import CheckBox from "./CheckBox";
+import Footer from "./Footer";
+import Toast from "./Toast";
+import Button from "./Button";
+
+const noop = () => {};
+
+const IndeterminateCheckbox = forwardRef(({ indeterminate, ...rest }, ref) => {
+ const defaultRef = useRef();
+ const resolvedRef = ref || defaultRef;
+
+ useEffect(() => {
+ resolvedRef.current.indeterminate = indeterminate;
+ }, [resolvedRef, indeterminate]);
+
+ return (
+
+
+
+ );
+});
+
+const Table = ({
+ className = "table",
+ t,
+ data,
+ columns,
+ getCellProps,
+ currentPage = 0,
+ pageSizeLimit = 10,
+ disableSort = true,
+ autoSort = false,
+ initSortId = "",
+ onSearch = false,
+ manualPagination = true,
+ totalRecords,
+ onNextPage,
+ onPrevPage,
+ globalSearch,
+ onSort = noop,
+ onPageSizeChange,
+ onLastPage,
+ onFirstPage,
+ isPaginationRequired = true,
+ sortParams = [],
+ showAutoSerialNo = false,
+ customTableWrapperClassName = "",
+ styles = {},
+ tableTopComponent,
+ tableRef,
+ isReportTable = false,
+ showCheckBox = false,
+ actionLabel = "CS_COMMON_DOWNLOAD",
+ tableSelectionHandler = () => {},
+}) => {
+ const {
+ getTableProps,
+ getTableBodyProps,
+ headerGroups,
+ rows,
+ prepareRow,
+ page,
+ canPreviousPage,
+ canNextPage,
+ pageOptions,
+ pageCount,
+ gotoPage,
+ nextPage,
+ previousPage,
+ setPageSize,
+ setGlobalFilter,
+ state: { pageIndex, pageSize, sortBy, globalFilter, selectedRowIds },
+ } = useTable(
+ {
+ columns,
+ data,
+ initialState: { pageIndex: currentPage, pageSize: pageSizeLimit, sortBy: autoSort ? [{ id: initSortId, desc: false }] : sortParams },
+ pageCount: totalRecords > 0 ? Math.ceil(totalRecords / pageSizeLimit) : -1,
+ manualPagination: manualPagination,
+ disableMultiSort: false,
+ disableSortBy: disableSort,
+ manualSortBy: autoSort ? false : true,
+ autoResetPage: false,
+ autoResetSortBy: false,
+ disableSortRemove: true,
+ disableGlobalFilter: onSearch === false ? true : false,
+ globalFilter: globalSearch || "text",
+ useControlledState: (state) => {
+ return React.useMemo(() => ({
+ ...state,
+ pageIndex: manualPagination ? currentPage : state.pageIndex,
+ }));
+ },
+ },
+ useGlobalFilter,
+ useSortBy,
+ usePagination,
+ useRowSelect,
+ (hooks) => {
+ if (showCheckBox) {
+ hooks.visibleColumns.push((columns) => [
+ {
+ id: "selection",
+ Header: ({ getToggleAllPageRowsSelectedProps }) => (
+
+
+
+ ),
+ Cell: ({ row }) => (
+
+
+
+ ),
+ },
+ ...columns,
+ ]);
+ }
+ }
+ );
+ let isTotalColSpanRendered = false;
+ const [toast, setToast] = useState({ show: false, label: "", error: false });
+
+ useEffect(() => {
+ onSort(sortBy);
+ }, [onSort, sortBy]);
+
+ useEffect(() => setGlobalFilter(onSearch), [onSearch, setGlobalFilter, data]);
+
+ const handleSelection = async () => {
+ const selectedRows = rows?.filter((ele) => Object.keys(selectedRowIds)?.includes(ele?.id));
+ const response = await tableSelectionHandler(selectedRows, t);
+ setToast({ show: true, label: t(response?.label), error: !response?.isSuccess });
+ };
+
+ const handleToastClose = () => {
+ setToast({ show: false, label: "", error: false });
+ };
+
+ useEffect(() => {
+ if (toast?.show) {
+ setTimeout(() => {
+ handleToastClose();
+ }, 3000);
+ }
+ }, [toast?.show]);
+
+ //note -> adding data prop in dependency array to trigger filter whenever state of the table changes
+ //use case -> without this if we enter string to search and then click on it's attendence checkbox or skill selector for that matter then the global filtering resets and whole table is shown
+ return (
+
+
+ {tableTopComponent ? tableTopComponent : null}
+
+
+ {headerGroups.map((headerGroup) => (
+
+ {showAutoSerialNo && (
+
+ {showAutoSerialNo && typeof showAutoSerialNo == "string" ? t(showAutoSerialNo) : t("TB_SNO")}
+
+ )}
+ {headerGroup.headers.map((column) => (
+
+ {column.render("Header")}
+ {column.isSorted ? column.isSortedDesc ? : : ""}
+
+ ))}
+
+ ))}
+
+
+ {page.map((row, i) => {
+ // rows.slice(0, 10).map((row, i) => {
+ prepareRow(row);
+ return (
+
+ {showAutoSerialNo && {i + 1} }
+ {row.cells.map((cell) => {
+ return (
+
+ {cell.attachment_link ? (
+
+ {cell.render("Cell")}
+
+ ) : (
+ {cell.render("Cell")}
+ )}
+
+ );
+ })}
+
+ );
+ })}
+
+
+
+ {isPaginationRequired && (
+
+ {`${t("CS_COMMON_ROWS_PER_PAGE")} :`}
+ setPageSize(Number(e.target.value))}
+ >
+ {[10, 20, 30, 40, 50].map((pageSize) => (
+
+ {pageSize}
+
+ ))}
+
+
+
+ {pageIndex * pageSize + 1}
+ {"-"}
+ {manualPagination
+ ? (currentPage + 1) * pageSizeLimit > totalRecords
+ ? totalRecords
+ : (currentPage + 1) * pageSizeLimit
+ : pageIndex * pageSize + page?.length}{" "}
+ {/* {(pageIndex + 1) * pageSizeLimit > rows.length ? rows.length : (pageIndex + 1) * pageSizeLimit}{" "} */}
+ {totalRecords ? `of ${manualPagination ? totalRecords : rows.length}` : ""}
+ {" "}
+
+ {/* to go to first and last page we need to do a manual pagination , it can be updated later*/}
+ {!manualPagination && pageIndex != 0 && gotoPage(0)} className={"cp"} />}
+ {canPreviousPage && manualPagination && onFirstPage && manualPagination && onFirstPage()} className={"cp"} />}
+ {canPreviousPage && (manualPagination ? onPrevPage() : previousPage())} className={"cp"} />}
+ {canNextPage && (manualPagination ? onNextPage() : nextPage())} className={"cp"} />}
+ {!manualPagination && pageIndex != pageCount - 1 && gotoPage(pageCount - 1)} className={"cp"} />}
+ {rows.length == pageSizeLimit && canNextPage && manualPagination && onLastPage && (
+ manualPagination && onLastPage()} className={"cp"} />
+ )}
+ {/* to go to first and last page we need to do a manual pagination , it can be updated later*/}
+
+ )}
+ {Object.keys(selectedRowIds)?.length > 0 && (
+
+ )}
+ {toast?.show && }
+
+ );
+};
+
+export default Table;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/TableBody.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/TableBody.js
new file mode 100644
index 00000000..46627ed0
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/TableBody.js
@@ -0,0 +1,24 @@
+import React from 'react';
+import PropTypes from "prop-types";
+
+const TableBody = ({ children,style,className }) => {
+ return (
+
+ {children}
+
+ );
+};
+
+TableBody.propTypes = {
+ className: PropTypes.string,
+ style: PropTypes.object,
+ children: PropTypes.node
+};
+
+TableBody.defaultProps = {
+ className: "",
+ style: {},
+ children: []
+};
+
+export default TableBody;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/TableCell.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/TableCell.js
new file mode 100644
index 00000000..397bc0a7
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/TableCell.js
@@ -0,0 +1,245 @@
+import React from "react";
+import PropTypes from "prop-types";
+import Switch from "./Switch";
+import CheckBox from "./CheckBox";
+import StringManipulator from "./StringManipulator";
+import Tag from "./Tag";
+import Button from "./Button";
+import TextInput from "./TextInput";
+import Dropdown from "./Dropdown";
+import MultiSelectDropdown from "./MultiSelectDropdown";
+
+const TableCell = ({
+ isHeader,
+ isFooter,
+ colSpan,
+ className,
+ columnType,
+ cellData,
+ children,
+ style,
+ cellref,
+ accessor,
+ updateTableData,
+ tableData,
+ rowIndex,
+ cellIndex,
+}) => {
+ const getValueFromAccessor = (cellData, accessor) => {
+ return accessor
+ ? accessor
+ .split("?.")
+ .reduce((acc, key) => (acc ? acc[key] : undefined), cellData)
+ : cellData;
+ };
+
+ const renderTableCell = () => {
+ switch (columnType) {
+ case "serialno":
+ return accessor ? getValueFromAccessor(cellData, accessor) : cellData;
+ case "numeric":
+ return accessor ? getValueFromAccessor(cellData, accessor) : cellData;
+ case "text":
+ case "description": {
+ const defaultmaxChars = columnType === "text" ? 64 : 256;
+ if (typeof cellData === "object") {
+ return (
+
+ {StringManipulator(
+ "TOSENTENCECASE",
+ StringManipulator(
+ "TRUNCATESTRING",
+ accessor
+ ? getValueFromAccessor(cellData, accessor)
+ : cellData?.label,
+ {
+ maxLength: cellData?.maxLength || defaultmaxChars,
+ }
+ )
+ )}
+
+ );
+ }
+ return cellData;
+ }
+ case "tag":
+ return (
+
+ );
+ case "switch":
+ return (
+ {
+ updateTableData(rowIndex, cellIndex, event);
+ if (cellData?.onToggle) {
+ cellData.onToggle(event);
+ }
+ }}
+ />
+ );
+ case "checkbox":
+ return (
+ {
+ updateTableData(rowIndex, cellIndex, event?.target?.checked);
+ if (cellData?.onChange) {
+ cellData.onChange(event?.target?.checked);
+ }
+ }}
+ label={cellData?.label}
+ value={cellData?.value}
+ disabled={cellData?.disabled}
+ ref={cellData?.ref}
+ checked={tableData?.[rowIndex]?.values?.[cellIndex] || false}
+ inputRef={cellData?.inputRef}
+ pageType={cellData?.pageType}
+ style={cellData?.style}
+ index={cellData?.index}
+ isLabelFirst={cellData?.isLabelFirst}
+ hideLabel={cellData?.hideLabel}
+ props={cellData?.props}
+ mainClassName={cellData?.mainClassName}
+ />
+ );
+ case "button":
+ return (
+
+ );
+ case "textinput":
+ return (
+ {
+ updateTableData(rowIndex, cellIndex, event?.target?.value);
+ if (cellData?.onChange) {
+ cellData.onChange(event?.target?.value);
+ }
+ }}
+ >
+ );
+ case "dropdown":
+ return (
+ {
+ updateTableData(rowIndex, cellIndex, newValue);
+ if (cellData?.select) {
+ cellData.select(newValue);
+ }
+ }}
+ >
+ );
+ case "multiselectdropdown":
+ return (
+ {
+ updateTableData(rowIndex, cellIndex, newValue);
+ if (cellData?.onSelect) {
+ cellData.onSelect(newValue);
+ }
+ }}
+ >
+ );
+ case "custom":
+ default:
+ return accessor ? getValueFromAccessor(cellData, accessor) : cellData;
+ }
+ };
+
+ if (isHeader) {
+ return (
+
+ {children}
+
+ );
+ }
+
+ if (isFooter) {
+ return (
+
+ {children}
+
+ );
+ }
+
+ return (
+
+ {renderTableCell()}
+
+ );
+};
+
+
+TableCell.propTypes = {
+ className: PropTypes.string,
+ style: PropTypes.object,
+ children: PropTypes.node,
+ isHeader: PropTypes.bool,
+ isFooter: PropTypes.bool,
+ colSpan: PropTypes.number,
+ columnType: PropTypes.string,
+ accessor: PropTypes.string,
+ cellData: PropTypes.any,
+ cellref: PropTypes.oneOfType([
+ PropTypes.func,
+ PropTypes.shape({ current: PropTypes.instanceOf(Element) }),
+ ]),
+ updateTableData: PropTypes.func,
+ tableData: PropTypes.array,
+ rowIndex: PropTypes.number,
+ cellIndex: PropTypes.number,
+};
+
+TableCell.defaultProps = {
+ className: "",
+ style: {},
+ children: []
+};
+
+export default TableCell;
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/TableFooter.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/TableFooter.js
new file mode 100644
index 00000000..8ae13bae
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/TableFooter.js
@@ -0,0 +1,24 @@
+import React from 'react';
+import PropTypes from "prop-types";
+
+const TableFooter = ({ children ,className,style}) => {
+ return (
+
+ {children}
+
+ );
+};
+
+TableFooter.propTypes = {
+ className: PropTypes.string,
+ style: PropTypes.object,
+ children: PropTypes.node
+};
+
+TableFooter.defaultProps = {
+ className: "",
+ style: {},
+ children: []
+};
+
+export default TableFooter;
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/TableHeader.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/TableHeader.js
new file mode 100644
index 00000000..d21c84e3
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/TableHeader.js
@@ -0,0 +1,24 @@
+import React from 'react';
+import PropTypes from "prop-types";
+
+const TableHeader = ({ children,className,style }) => {
+ return (
+
+ {children}
+
+ );
+};
+
+TableHeader.propTypes = {
+ className: PropTypes.string,
+ style: PropTypes.object,
+ children: PropTypes.node
+};
+
+TableHeader.defaultProps = {
+ className: "",
+ style: {},
+ children: []
+};
+
+export default TableHeader;
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/TableMain.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/TableMain.js
new file mode 100644
index 00000000..11ee3022
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/TableMain.js
@@ -0,0 +1,23 @@
+import React from 'react';
+import PropTypes from "prop-types";
+
+const TableMain = ({ children,className,style}) => {
+ return (
+
+ );
+};
+
+TableMain.propTypes = {
+ className: PropTypes.string,
+ style: PropTypes.object,
+ children: PropTypes.node
+};
+
+TableMain.defaultProps = {
+ className: "",
+ style: {},
+ children: []
+};
+export default TableMain;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/TableRow.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/TableRow.js
new file mode 100644
index 00000000..c248977a
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/TableRow.js
@@ -0,0 +1,24 @@
+import React from 'react';
+import PropTypes from "prop-types";
+
+const TableRow = ({ children ,className,onClick}) => {
+ return (
+
+ {children}
+
+ );
+};
+
+TableRow.propTypes = {
+ className: PropTypes.string,
+ style: PropTypes.object,
+ children: PropTypes.node
+};
+
+TableRow.defaultProps = {
+ className: "",
+ style: {},
+ children: []
+};
+
+export default TableRow;
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Tag.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Tag.js
new file mode 100644
index 00000000..019766d9
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Tag.js
@@ -0,0 +1,92 @@
+import React from "react";
+import PropTypes from "prop-types";
+import { SVG } from "./SVG";
+import { Colors } from "../constants/colors/colorconstants";
+import { iconRender } from "../utils/iconRender";
+
+const Tag = ({
+ className,
+ label,
+ style,
+ type,
+ icon,
+ stroke,
+ showIcon,
+ labelStyle,
+ onClick,
+ alignment,
+ iconClassName,
+ iconColor
+}) => {
+ const MonochromeIconColor = Colors.lightTheme.primary[2];
+ const SuccessIconColor = Colors.lightTheme.alert.success;
+ const ErrorIconColor = Colors.lightTheme.alert.error;
+ const WarningIconColor = Colors.lightTheme.alert.warning;
+
+ let iconToShow;
+ if (icon) {
+ iconToShow = iconRender(icon,iconColor || MonochromeIconColor, "1rem", "1rem", `digit-tag-customIcon ${iconClassName}`);;
+ } else {
+ switch (type) {
+ case "error":
+ iconToShow = (
+
+ );
+ break;
+ case "warning":
+ iconToShow = (
+
+ );
+ break;
+ default:
+ iconToShow = (
+
+ );
+ }
+ }
+
+ return (
+
+ {showIcon && iconToShow}
+
+ {label}
+
+
+ );
+};
+
+Tag.propTypes = {
+ className: PropTypes.string,
+ iconClassName:PropTypes.string,
+ iconColor:PropTypes.string,
+ label: PropTypes.string.isRequired,
+ style: PropTypes.object,
+ stroke: PropTypes.bool,
+ type: PropTypes.string,
+};
+
+Tag.defaultProps = {
+ className: "",
+ style: {},
+ type: "monochrome",
+ stroke: false,
+ showIcon: true,
+ labelStyle: {},
+ alignment: "center",
+ iconColor:"",
+ iconClassName:""
+};
+
+export default Tag;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Telephone.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Telephone.js
new file mode 100644
index 00000000..68935072
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Telephone.js
@@ -0,0 +1,26 @@
+import React from "react";
+import PropTypes from "prop-types";
+import { SVG } from "./SVG";
+
+const TelePhone = (props) => (
+
+ {props?.text}
+
+
+);
+
+TelePhone.propTypes = {
+ text: PropTypes.string,
+ mobile: PropTypes.string.isRequired,
+ className: PropTypes.string,
+ style: PropTypes.object,
+};
+
+export default TelePhone;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/TextArea.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/TextArea.js
new file mode 100644
index 00000000..90638b0b
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/TextArea.js
@@ -0,0 +1,89 @@
+import React from "react";
+import PropTypes from "prop-types";
+import { SVG } from "./SVG";
+import StringManipulator from "./StringManipulator";
+import { getUserType } from "../utils/digitUtils";
+
+const TextArea = (props) => {
+ const user_type = getUserType();
+
+ function textAreaAdjust(event) {
+ const element = event.target;
+ const initialHeight = 6.25 * parseFloat(getComputedStyle(element).fontSize);
+
+ element.style.height = "auto"; // Setting height to auto to get the natural height
+ const contentHeight = element.scrollHeight;
+ // Set the height only if the content height exceeds the initial height
+ if (contentHeight > initialHeight) {
+ element.style.height = `${contentHeight}px`;
+ } else {
+ element.style.height = `${initialHeight}px`;
+ }
+ }
+
+ return (
+
+
+
+ );
+};
+
+TextArea.propTypes = {
+ placeholder: PropTypes.string,
+ name: PropTypes.string.isRequired,
+ inputRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
+ style: PropTypes.object,
+ id: PropTypes.string,
+ value: PropTypes.string,
+ onChange: PropTypes.func,
+ className: PropTypes.string,
+ nonEditable: PropTypes.bool,
+ minlength: PropTypes.number,
+ maxlength: PropTypes.number,
+ autoComplete: PropTypes.string,
+ disabled: PropTypes.bool,
+ pattern: PropTypes.string,
+ validation: PropTypes.object,
+ ValidationRequired: PropTypes.bool,
+ hintText: PropTypes.string,
+ charCount: PropTypes.bool,
+ errors: PropTypes.object,
+ error: PropTypes.string,
+ resizeSmart: PropTypes.bool,
+};
+
+TextArea.defaultProps = {
+ inputRef: undefined,
+ onChange: undefined,
+ resizeSmart: false,
+};
+
+export default TextArea;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/TextBlock.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/TextBlock.js
new file mode 100644
index 00000000..55533696
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/TextBlock.js
@@ -0,0 +1,73 @@
+import React from "react";
+import PropTypes from "prop-types";
+
+const TextBlock = ({
+ wrapperClassName,
+ headerContentClassName,
+ caption,
+ captionClassName,
+ header,
+ headerClassName,
+ subHeader,
+ subHeaderClassName,
+ body,
+ bodyClassName,
+ style
+}) => {
+ return (
+
+ {(caption || header || subHeader) && (
+
+ {caption && (
+
+ {caption}
+
+ )}
+ {header && (
+
+ {header}
+
+ )}
+ {subHeader && (
+
+ {subHeader}
+
+ )}
+
+ )}
+ {body && (
+
{body}
+ )}
+
+ );
+};
+
+TextBlock.propTypes = {
+ wrapperClassName: PropTypes.string,
+ headerContentClassName: PropTypes.string,
+ caption: PropTypes.string,
+ captionClassName: PropTypes.string,
+ header: PropTypes.string,
+ headerClassName: PropTypes.string,
+ subHeader: PropTypes.string,
+ subHeaderClassName: PropTypes.string,
+ body: PropTypes.string,
+ bodyClassName: PropTypes.string,
+};
+
+TextBlock.defaultProps = {
+ wrapperClassName: "",
+ headerContentClassName: "",
+ caption: "",
+ captionClassName: "",
+ header: "",
+ headerClassName: "",
+ subHeader: "",
+ subHeaderClassName: "",
+ body: "",
+ bodyClassName: "",
+};
+
+export default TextBlock;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/TextInput.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/TextInput.js
new file mode 100644
index 00000000..27f6d5d6
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/TextInput.js
@@ -0,0 +1,491 @@
+import React, { forwardRef, useEffect, useState } from "react";
+import PropTypes from "prop-types";
+import { SVG } from "./SVG";
+import StringManipulator from "./StringManipulator";
+import { Colors} from "../constants/colors/colorconstants";
+import { getUserType } from "../utils/digitUtils";
+
+
+const TextInput = (props) => {
+ const user_type = getUserType();
+ const [date, setDate] = useState(props?.type === "date" && props?.value);
+ const [visibility, setVisibility] = useState(false);
+ const [inputType, setInputType] = useState(props?.type || "text");
+ const data = props?.watch
+ ? {
+ fromDate: props?.watch("fromDate"),
+ toDate: props?.watch("toDate"),
+ }
+ : {};
+
+ const handleDate = (event) => {
+ const { value } = event?.target;
+ setDate(value);
+ props?.onChange(value);
+ };
+ const incrementCount = () => {
+ const newValue = Number(props.value) + (Number(props?.step) ? Number(props?.step) : 1);
+ props.onChange(newValue);
+ };
+
+ const decrementCount = () => {
+ const newValue = Number(props.value) - (Number(props?.step) ? Number(props?.step) : 1);
+ const finalValue = props?.allowNegativeValues ? newValue : Math.max(newValue, 0);
+ props.onChange(finalValue);
+ };
+
+ const renderPrefix = () => {
+ const prefixValue = props?.populators?.prefix || "";
+ if (props?.type === "numeric") {
+ return (
+ decrementCount()}
+ className="digit-numeric-button-prefix"
+ readOnly={props.nonEditable}
+ >
+ -
+
+ );
+ }
+ if (prefixValue) {
+ return (
+
+ {prefixValue}
+
+ );
+ }
+ return null;
+ };
+
+ const renderSuffix = () => {
+ const suffixValue = props?.populators?.suffix || "";
+ if (props?.type === "numeric") {
+ return (
+ incrementCount()}
+ className="digit-numeric-button-suffix"
+ readOnly={props.nonEditable}
+ >
+ +
+
+ );
+ }
+ if (
+ props?.type === "text" &&
+ !props?.populators?.customIcon &&
+ suffixValue
+ ) {
+ return (
+
+ {suffixValue}
+
+ );
+ }
+ return null;
+ };
+
+ const handleVisibility = () => {
+ setVisibility(!visibility);
+ const newType = !visibility ? "text" : "password";
+ setInputType(newType);
+ props.onChange(props?.value);
+ };
+
+ const handleLocationClick = () => {
+ if (navigator.geolocation) {
+ navigator.geolocation.getCurrentPosition(
+ (position) => {
+ const { latitude, longitude } = position.coords;
+ props.onChange(`${latitude}, ${longitude}`);
+ },
+ (error) => {
+ console.error("Error getting location:", error);
+ }
+ );
+ } else {
+ console.error("Geolocation is not supported");
+ }
+ };
+
+ const disabledColor = Colors.lightTheme.generic.divider;
+ const iconColor = Colors.lightTheme.generic.inputBorder;
+
+ const renderIcon = () => {
+ const reqIcon = props?.type;
+ const iconFill = props?.iconFill ? props?.iconFill : props?.disabled
+ ? disabledColor
+ : props?.nonEditable
+ ? "#b1b4b6"
+ : iconColor;
+ if (reqIcon) {
+ if (reqIcon === "geolocation") {
+ return (
+
+ );
+ } else if (reqIcon === "password" && inputType === "text" && visibility) {
+ return (
+
+ );
+ } else if (reqIcon === "password") {
+ return (
+
+ );
+ } else if (reqIcon === "search") {
+ return (
+
+ );
+ } else {
+ try {
+ const components = require("@egovernments/digit-ui-svg-components");
+ const DynamicIcon =
+ props?.type === "text" &&
+ components?.[props?.populators?.customIcon];
+ if (DynamicIcon) {
+ const svgElement = DynamicIcon({
+ width: "1.5rem",
+ height: "1.5rem",
+ fill: iconFill,
+ className: `digit-text-input-customIcon ${
+ props.disabled ? "disabled" : ""
+ } ${props.nonEditable ? "nonEditable" : ""}`,
+ });
+ return svgElement;
+ } else {
+ console.warn("Icon not found");
+ return null;
+ }
+ } catch (error) {
+ console.warn("Icon not found");
+ return null;
+ }
+ }
+ }
+ return null;
+ };
+
+ const icon = renderIcon();
+
+ const inputClassNameForMandatory = `${
+ user_type ? "digit-employeeCard-inputError" : "digit-card-inputError"
+ } ${props.disabled ? "disabled" : ""} ${props.customClass || ""} ${
+ props.nonEditable ? "noneditable" : ""
+ } ${props.type === "numeric" ? "numeric" : ""}`;
+
+ const inputClassName = `${
+ user_type ? "digit-employeeCard-input" : "digit-citizenCard-input"
+ } ${props.disabled ? "disabled" : ""} focus-visible ${
+ props.errorStyle ? "digit-employeeCard-inputError" : ""
+ } ${props.nonEditable ? "noneditable" : ""} ${
+ props.type === "numeric" ? "numeric" : ""
+ } ${props.customClass || ""}`;
+
+ const defaultType =
+ props.type === "password" && inputType === "text"
+ ? "passwordToText"
+ : props.type;
+
+ const inputContainerClass = `input-container ${
+ defaultType ? defaultType : ""
+ } ${props.populators?.customIcon ? "withIcon" : ""}`;
+
+ return (
+
+
+
+ );
+};
+
+TextInput.propTypes = {
+ required: PropTypes.bool,
+ name: PropTypes.string.isRequired,
+ placeholder: PropTypes.string,
+ onChange: PropTypes.func,
+ inputRef: PropTypes.oneOfType([
+ PropTypes.func,
+ PropTypes.shape({ current: PropTypes.instanceOf(Element) }),
+ ]),
+ value: PropTypes.any,
+ className: PropTypes.string,
+ style: PropTypes.object,
+ maxlength: PropTypes.number,
+ minlength: PropTypes.number,
+ max: PropTypes.number,
+ pattern: PropTypes.string,
+ min: PropTypes.number,
+ disabled: PropTypes.bool,
+ nonEditable: PropTypes.bool,
+ allowNegativeValues:PropTypes.bool,
+ errorStyle: PropTypes.bool,
+ title: PropTypes.string,
+ step: PropTypes.string,
+ autoFocus: PropTypes.bool,
+ onBlur: PropTypes.func,
+ onKeyPress: PropTypes.func,
+ textInputStyle: PropTypes.object,
+ defaultValue: PropTypes.any,
+ customClass: PropTypes.string,
+ signature: PropTypes.bool,
+ signatureImg: PropTypes.node,
+ onIconSelection: PropTypes.func,
+ type: PropTypes.string,
+ watch: PropTypes.func,
+ onFocus: PropTypes.func,
+ errors: PropTypes.object,
+ config: PropTypes.object,
+ error: PropTypes.string,
+};
+
+TextInput.defaultProps = {
+ required: false,
+};
+
+function DatePicker(props) {
+ useEffect(() => {
+ if (props?.shouldUpdate) {
+ props?.setDate(getDDMMYYYY(props?.data[props.name], "yyyymmdd"));
+ }
+ }, [props?.data]);
+
+ useEffect(() => {
+ props.setDate(getDDMMYYYY(props?.defaultValue));
+ }, []);
+
+ return (
+
+ );
+}
+
+function getDDMMYYYY(date) {
+ if (!date) return "";
+
+ return new Date(date).toLocaleString("en-In").split(",")[0];
+}
+
+export default TextInput;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Timeline.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Timeline.js
new file mode 100644
index 00000000..4f5e0cdf
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Timeline.js
@@ -0,0 +1,173 @@
+import React, { useState } from "react";
+import { SVG } from "./SVG";
+import StringManipulator from "./StringManipulator";
+import Button from "./Button";
+import { Colors} from "../constants/colors/colorconstants";
+
+const Timeline = ({
+ label,
+ subElements,
+ variant,
+ viewDetailsLabel,
+ hideDetailsLabel,
+ additionalElements,
+ inline,
+ individualElementStyles,
+ showConnector,
+ className,
+ isLastStep,
+ isNextActiveStep,
+ showDefaultValueForDate,
+ isError,
+ initialVisibleAdditionalElementsCount = 0
+}) => {
+ const [showDetails, setShowDetails] = useState(false);
+
+ const [isMobileView, setIsMobileView] = React.useState(
+ window.innerWidth / window.innerHeight <= 9 / 16
+ );
+ const onResize = () => {
+ if (window.innerWidth / window.innerHeight <= 9 / 16) {
+ if (!isMobileView) {
+ setIsMobileView(true);
+ }
+ } else {
+ if (isMobileView) {
+ setIsMobileView(false);
+ }
+ }
+ };
+ React.useEffect(() => {
+ window.addEventListener("resize", () => {
+ onResize();
+ });
+ return () => {
+ window.addEventListener("resize", () => {
+ onResize();
+ });
+ };
+ });
+
+ const toggleDetails = () => {
+ setShowDetails(!showDetails);
+ };
+
+ const hasAdditionalElements =
+ additionalElements && additionalElements.length > 0;
+
+ const defaultLabel =
+
+ isError ? "Failed!" :
+ variant === "inprogress"
+ ? "Inprogress"
+ : variant === "upcoming"
+ ? "Upcoming"
+ : variant === "completed"
+ ? "Completed"
+ : "";
+
+ const color = Colors.lightTheme.paper.primary;
+
+ return (
+
+
+ {variant === "completed" && !isError && (
+
+
+
+ )}
+ {isError && (
+
+
+
+ )}
+
+ {showConnector && !isLastStep && (
+
+ )}
+
+
+
+ {label
+ ? StringManipulator("CAPITALIZEFIRSTLETTER", label)
+ : defaultLabel}
+
+ {subElements && subElements.length > 0 && (
+
+ {subElements.map((element, index) => (
+
+ {element}
+
+ ))}
+
+ )}
+ {showDefaultValueForDate && (
+
{isError ? "Incomplete": "date"}
+ )}
+
+
+ {hasAdditionalElements && (
+
+ {additionalElements.map((element, index) => (
+
= initialVisibleAdditionalElementsCount && !showDetails
+ ? "hidden"
+ : ""
+ }`}
+ key={index}
+ style={individualElementStyles}
+ >
+ {element}
+
+ ))}
+
+ )}
+ {hasAdditionalElements && additionalElements.length > initialVisibleAdditionalElementsCount && (
+
+
+
+ )}
+
+
+ );
+};
+
+export default Timeline;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Toast.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Toast.js
new file mode 100644
index 00000000..9242b8ad
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Toast.js
@@ -0,0 +1,160 @@
+import React, { useState, useEffect,Fragment } from "react";
+import PropTypes from "prop-types";
+import { SVG } from "./SVG";
+import Button from "./Button";
+import StringManipulator from "./StringManipulator";
+import { Colors} from "../constants/colors/colorconstants";
+
+const Toast = (props) => {
+
+ const [isVisible, setIsVisible] = useState(true);
+ const [isAnimating, setIsAnimating] = useState(false);
+
+ useEffect(() => {
+ const timeout = setTimeout(
+ () => {
+ setIsVisible(false);
+ if (props.onClose) {
+ props.onClose();
+ }
+ },
+ props?.transitionTime ? props.transitionTime : 5000
+ );
+ const animateTimeout = setTimeout(() => {
+ setIsAnimating(true);
+ }, 100);
+
+ return () => {
+ clearTimeout(timeout);
+ clearTimeout(animateTimeout);
+ };
+ }, [props.transitionTime, props.onClose]);
+
+ const handleClose = () => {
+ setIsVisible(false);
+ };
+
+ let variant;
+ switch (props?.type) {
+ case "success":
+ variant = "digit-success";
+ break;
+ case "error":
+ variant = "digit-error";
+ break;
+ case "warning":
+ variant = "digit-warning";
+ break;
+ case "info":
+ variant = "digit-info";
+ break;
+ default:
+ variant = props?.variant || "";
+ break;
+ }
+
+ const isWarningButtons = props?.isWarningButtons
+ ? "digit-warning-buttons"
+ : "";
+
+ const sentenceCaseLabel = StringManipulator("TOSENTENCECASE", props.label);
+ const color = Colors.lightTheme.paper.primary;
+
+ if (!isVisible) {
+ return null;
+ }
+
+ if (props?.type === "warning") {
+ return (
+
+
+ {!props?.isWarningButtons ? (
+ <>
+
+
+ {sentenceCaseLabel}
+
+
+ >
+ ) : (
+
+
+
+ {sentenceCaseLabel}
+
+ {props.isDleteBtn ? (
+
+ ) : null}
+
+ )}
+ {props?.isWarningButtons ? (
+
+
+
+
+ ) : null}
+
+
+ );
+ }
+
+ const icon =
+ props?.type === "error" ? (
+
+ ) : props?.type === "info" ? (
+
+ ) : (
+
+ );
+
+ return (
+
+ {icon}
+
+ {sentenceCaseLabel}
+
+
+
+ );
+};
+
+Toast.propTypes = {
+ label: PropTypes.string,
+ onClose: PropTypes.func,
+ isDleteBtn: PropTypes.bool,
+ transitionTime: PropTypes.number,
+ type: PropTypes.string,
+};
+
+Toast.defaultProps = {
+ label: "",
+ onClose: undefined,
+ isDleteBtn: false,
+};
+
+export default Toast;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Toggle.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Toggle.js
new file mode 100644
index 00000000..3513bdc5
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Toggle.js
@@ -0,0 +1,88 @@
+import React, { useState, useEffect } from "react";
+import PropTypes from "prop-types";
+import { useTranslation } from "react-i18next";
+import StringManipulator from "./StringManipulator";
+
+const Toggle = (props) => {
+ const { t } = useTranslation();
+
+ var selected = props.selectedOption
+ ? props.selectedOption
+ : props.options.length > 0
+ ? props.options[0].code
+ : null;
+
+ // Calculate the maximum label length among all options
+ const maxLabelLength = Math.max(
+ ...props.options.map((option) => t(option[props.optionsKey]).length)
+ );
+ // Set a fixed maximum width of 200px or the calculated maxLabelLength, whichever is smaller
+ const maxWidth = Math.min(200, maxLabelLength * 14.9);
+ // minWidth should be 40px
+ const finalWidth = maxWidth < 40 ? "40" : maxWidth;
+
+ function toggleOption(option) {
+ props?.onSelect(option);
+ }
+ return (
+
+ {props?.options?.map((option, ind) => (
+
+
+ toggleOption(option?.code)}
+ disabled={props?.disabled}
+ ref={props.inputRef}
+ />
+
+ {t(
+ StringManipulator(
+ "CAPITALIZEFIRSTLETTER",
+ option[props?.optionsKey]
+ )
+ )}
+
+
+
+ ))}
+
+ );
+};
+
+Toggle.propTypes = {
+ selectedOption: PropTypes.any,
+ onSelect: PropTypes.func,
+ options: PropTypes.any,
+ optionsKey: PropTypes.string,
+ additionalWrapperClass: PropTypes.string,
+ disabled: PropTypes.bool,
+ inputRef: PropTypes.object,
+};
+
+Toggle.defaultProps = {};
+
+export default Toggle;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/ToggleSwitch.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/ToggleSwitch.js
new file mode 100644
index 00000000..2e1f08fa
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/ToggleSwitch.js
@@ -0,0 +1,40 @@
+import React from "react";
+import PropTypes from "prop-types";
+
+const ToggleSwitch = ({ value, onChange, label, name, ref, style,disabled, ...props }) => {
+
+ return (
+
+
+
+
+
+
+ );
+
+};
+
+ToggleSwitch.propTypes = {
+ value: PropTypes.bool,
+ name: PropTypes.string,
+ onChange: PropTypes.func,
+ ref: PropTypes.func,
+};
+
+ToggleSwitch.defaultProps = {};
+
+export default ToggleSwitch;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Tooltip.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Tooltip.js
new file mode 100644
index 00000000..25adac2f
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/Tooltip.js
@@ -0,0 +1,50 @@
+import React from "react";
+import PropTypes from "prop-types";
+
+const Tooltip = ({ tooltipRef, content, placement, arrow, style, className,header ,description,theme}) => {
+ return (
+
+ {header &&
{header}
}
+ {content &&
{content}
}
+ {description &&
{description}
}
+
+ );
+};
+
+Tooltip.propTypes = {
+ header:PropTypes.string,
+ content: PropTypes.node.isRequired,
+ description:PropTypes.string,
+ placement: PropTypes.oneOf([
+ "bottom",
+ "bottom-end",
+ "bottom-start",
+ "left",
+ "right",
+ "top",
+ "top-end",
+ "top-start",
+ "left-end",
+ "left-start",
+ "right-end",
+ "right-start",
+ ]),
+ arrow: PropTypes.bool,
+ theme: PropTypes.string,
+ style: PropTypes.object,
+ className: PropTypes.string,
+};
+
+Tooltip.defaultProps = {
+ arrow: true,
+ placement: "bottom",
+ theme:"dark"
+};
+
+export default Tooltip;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/TreeSelect.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/TreeSelect.js
new file mode 100644
index 00000000..7e177bbc
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/TreeSelect.js
@@ -0,0 +1,211 @@
+import React, { useState, useEffect } from "react";
+import { SVG } from "./SVG";
+import { useTranslation } from "react-i18next";
+import { Colors} from "../constants/colors/colorconstants";
+
+const TreeSelectOption = ({ option, onSelect, isSelected, renderOptions, level = 0,optionsKey }) => {
+ const [isExpanded, setExpanded] = useState(false);
+ const { t } = useTranslation();
+ const handleToggleDropdown = () => {
+ if (option.options) {
+ setExpanded(!isExpanded);
+ }
+ };
+ const handleSelect = () => {
+ if (!option.options) {
+ onSelect(option);
+ }
+ };
+
+ const primaryFill = Colors.lightTheme.text.primary;
+
+ return (
+
+
+ {option.options && (
+
+ {isExpanded ? (
+
+ ) : (
+
+ )}
+
+ )}
+
{t(option[optionsKey])}
+
+ {isExpanded &&
+ option.options &&
+ option.options.length > 0 &&
+ renderOptions({ options: option.options, onSelect, isSelected, level: level + 1 })}
+
+ );
+};
+const TreeMultiSelect = ({ option, onSelect, isSelected, renderOptions, level = 0, isParentSelected, setParentSelected, optionsKey}) => {
+ const [isExpanded, setExpanded] = useState(false);
+ const { t } = useTranslation();
+ const handleToggleDropdown = () => {
+ if (option.options) {
+ setExpanded(!isExpanded);
+ }
+ };
+
+ useEffect(() => {
+ // Update the parent's selection status when the component is mounted
+ setParentSelected(isSelected(option));
+ }, [isSelected, option, setParentSelected]);
+
+ const handleSelect = () => {
+ if (option.options) {
+ const selectedOptions = getFlattenedOptions(option.options);
+ if (isSelected(option)) {
+ onSelect([option, ...selectedOptions]);
+ } else {
+ // Checking if any child is already selected
+ const anyChildSelected = selectedOptions.some((child) => isSelected(child));
+ // If any child is already selected, selecting only the unselected children
+ if (anyChildSelected) {
+ const unselectedChildren = selectedOptions.filter((child) => !isSelected(child));
+ onSelect([option, ...unselectedChildren]);
+ } else {
+ onSelect([option, ...selectedOptions]);
+ }
+ }
+ } else {
+ onSelect([option]);
+ }
+ };
+
+ const getFlattenedOptions = (options) => {
+ let flattened = [];
+ options.forEach((option) => {
+ if (option.options) {
+ flattened.push(option);
+ flattened = flattened.concat(getFlattenedOptions(option.options));
+ } else {
+ flattened.push(option);
+ }
+ });
+ return flattened;
+ };
+
+ const allChildrenSelected = option.options && option.options.every((child) => isSelected(child));
+
+ const isIntermediate = () => {
+ if (option.options) {
+ const selectedOptions = getFlattenedOptions(option.options);
+ const someChildrenSelected = selectedOptions.some((child) => isSelected(child));
+ return someChildrenSelected && !allChildrenSelected;
+ }
+ return false;
+ };
+
+ useEffect(() => {
+ if (allChildrenSelected && !isSelected(option)) {
+ // If all children are selected and the current option is not selected, select the option.
+ onSelect([option]);
+ } else if (isIntermediate(option) && isSelected(option)) {
+ // If the option is in an intermediate state and is currently selected, deselect the option.
+ onSelect([option]);
+ }
+ }, [allChildrenSelected, isSelected, isIntermediate, option, onSelect]);
+
+ const primaryFill = Colors.lightTheme.text.primary;
+ const primarySelectedColor = Colors.lightTheme.paper.primary;
+ const SelectedColor = Colors.lightTheme.primary[1];
+
+ return (
+
+
+ {option.options && (
+
+ {isExpanded ? (
+
+ ) : (
+
+ )}
+
+ )}
+
+
+
+
{
+ e.stopPropagation();
+ handleSelect();
+ }}
+ style={{ marginRight: `${level == 0 ? 8 : 0}px` }}
+ >
+ {isIntermediate() ? (
+
+ ) : (
+
+ )}
+
+
{t(option[optionsKey])}
+
+ {isExpanded && option.options && option.options.length > 0 && (
+
+ {renderOptions({
+ options: option.options,
+ onSelect,
+ isSelected,
+ level: level + 1,
+ isParentSelected: isSelected(option),
+ setParentSelected,
+ })}
+
+ )}
+
+ );
+};
+const TreeSelect = ({ options, onSelect, selectedOption, variant,optionsKey }) => {
+ const renderOptions = ({ options, onSelect, isSelected, level, isParentSelected, setParentSelected }) => {
+ return options.map((option) => (
+
+ {variant === "treemultiselect" ? (
+
+ ) : (
+
+ )}
+
+ ));
+ };
+ const isSelected = (option) => {
+ if (variant === "treemultiselect") return selectedOption && selectedOption.some((selected) => selected.code === option.code);
+ else return selectedOption && selectedOption.code === option.code;
+ };
+ return {renderOptions({ options, onSelect, isSelected, level: 0, isParentSelected: false, setParentSelected: () => {} })}
;
+};
+export default TreeSelect;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/UploadFile.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/UploadFile.js
new file mode 100644
index 00000000..1ab169e6
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/UploadFile.js
@@ -0,0 +1,126 @@
+import React, { useEffect, useRef, useState, Fragment } from "react";
+import PropTypes from "prop-types";
+import ButtonSelector from "./ButtonSelector";
+import { useTranslation } from "react-i18next";
+import Chip from "./Chip";
+import ErrorMessage from "./ErrorMessage";
+import { getUserType } from "../utils/digitUtils";
+
+const getRandomId = () => {
+ return Math.floor((Math.random() || 1) * 139);
+};
+
+const UploadFile = (props) => {
+ const { t } = useTranslation();
+ const inpRef = useRef();
+ const [hasFile, setHasFile] = useState(false);
+ const [prevSate, setprevSate] = useState(null);
+ const user_type = getUserType();
+ const handleChange = () => {
+ if (inpRef.current.files[0]) {
+ setHasFile(true);
+ setprevSate(inpRef.current.files[0]);
+ } else setHasFile(false);
+ };
+
+ const handleDelete = () => {
+ inpRef.current.value = "";
+ props.onDelete();
+ };
+
+ const handleEmpty = () => {
+ if (inpRef.current.files.length <= 0 && prevSate !== null) {
+ inpRef.current.value = "";
+ props.onDelete();
+ }
+ };
+
+ if (props.uploadMessage && inpRef.current.value) {
+ handleDelete();
+ setHasFile(false);
+ }
+
+ useEffect(() => handleEmpty(), [inpRef?.current?.files]);
+
+ useEffect(() => handleChange(), [props.message]);
+
+ const showHint = props?.showHint || false;
+
+ return (
+
+ {showHint && {t(props?.hintText)}
}
+
+
+
+ {props?.uploadedFiles?.map((file, index) => {
+ const fileDetailsData = file[1];
+ return (
+
+ 64 ? `${file[0].slice(0, 64)} ...` : file[0]}
+ onClick={(e) => props?.removeTargetedFile(fileDetailsData, e)}
+ />
+
+ );
+ })}
+ {props?.uploadedFiles.length === 0 &&
{props.message} }
+
+
props.onUpload(e)}
+ onClick={(event) => {
+ if (!props?.enableButton) {
+ event.preventDefault();
+ } else {
+ const { target = {} } = event || {};
+ target.value = "";
+ }
+ }}
+ />
+
+ {props.iserror && }
+ {props?.showHintBelow && {t(props?.hintText)}
}
+
+ );
+};
+UploadFile.propTypes = {
+ hintText: PropTypes.string,
+ customClass: PropTypes.string,
+ uploadedFiles: PropTypes.arrayOf(PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.object]))),
+ enableButton: PropTypes.bool,
+ showHint: PropTypes.bool,
+ buttonType: PropTypes.string,
+ onUpload: PropTypes.func.isRequired,
+ removeTargetedFile: PropTypes.func.isRequired,
+ onDelete: PropTypes.func,
+ iserror: PropTypes.string,
+ showHintBelow: PropTypes.bool,
+ message: PropTypes.string,
+ disabled: PropTypes.bool,
+ inputStyles: PropTypes.object,
+ multiple: PropTypes.bool,
+ accept: PropTypes.string,
+ id: PropTypes.string,
+};
+
+export default UploadFile;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/UploadImage.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/UploadImage.js
new file mode 100644
index 00000000..b34e0acc
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/UploadImage.js
@@ -0,0 +1,416 @@
+import React, { useState, useEffect, useRef, Fragment } from "react";
+import { SVG } from "./SVG";
+import Webcam from "react-webcam";
+import Button from "./Button";
+import ErrorMessage from "./ErrorMessage";
+import { Colors} from "../constants/colors/colorconstants";
+import { CustomSVG } from "./CustomSVG";
+
+const UploadImage = ({
+ multiple,
+ userType,
+ onSubmit,
+ fileData,
+ onFileDelete,
+ previews,
+ uploadedFilesCount,
+ handleFileClick,
+}) => {
+ const [openUploadSlide, setOpenUploadSlide] = useState(false);
+ const [capturedImages, setCapturedImages] = useState([]);
+ const [isWebcamOpen, setIsWebcamOpen] = useState(false);
+ const webRef = useRef(null);
+ let imgData = "";
+ const [isMobileView, setIsMobileView] = React.useState(
+ window.innerWidth <= 480
+ );
+ const onResize = () => {
+ if (window.innerWidth <= 480) {
+ if (!isMobileView) {
+ setIsMobileView(true);
+ }
+ } else {
+ if (isMobileView) {
+ setIsMobileView(false);
+ }
+ }
+ };
+ useEffect(() => {
+ window.addEventListener("resize", onResize);
+ return () => {
+ window.removeEventListener("resize", onResize);
+ };
+ }, []);
+
+ const selectfile = (e) => {
+ handleChange(e);
+ };
+
+ const closeDrawer = () => {
+ setOpenUploadSlide(false);
+ };
+
+ const toggleWebcam = () => {
+ setIsWebcamOpen(!isWebcamOpen);
+ closeDrawer();
+ };
+
+ const toggleOpenUploadSlide = () => {
+ setOpenUploadSlide(!openUploadSlide);
+ };
+
+ const captureImg = () => {
+ if (webRef.current) {
+ imgData = webRef.current.getScreenshot();
+ const blob = dataURItoBlob(imgData);
+ const fileName = generateFileName();
+ const file = new File([blob], fileName, { type: "image/jpeg" });
+ handleChange(file);
+ }
+ };
+
+ function dataURItoBlob(dataURI) {
+ const byteString = atob(dataURI.split(",")[1]);
+ const mimeString = dataURI.split(",")[0].split(":")[1].split(";")[0];
+ const ab = new ArrayBuffer(byteString.length);
+ const ia = new Uint8Array(ab);
+ for (let i = 0; i < byteString.length; i++) {
+ ia[i] = byteString.charCodeAt(i);
+ }
+ return new Blob([ab], { type: mimeString });
+ }
+
+ function generateFileName() {
+ return `image_${Date.now()}.jpg`;
+ }
+
+ const handleChange = (event) => {
+ closeDrawer();
+ setIsWebcamOpen(false);
+ const files = event.target?.files;
+ const newFiles = files ? [...files] : event;
+
+ let newCapturedImages;
+ if (multiple) {
+ if (Array.isArray(newFiles)) {
+ newCapturedImages = [...capturedImages, ...newFiles];
+ } else {
+ newCapturedImages = [...capturedImages, newFiles];
+ }
+ } else {
+ if (Array.isArray(newFiles)) {
+ newCapturedImages = [newFiles[0]];
+ } else {
+ newCapturedImages = [newFiles];
+ }
+ }
+ setCapturedImages(newCapturedImages);
+ };
+
+ const handleFileDeletion = (fileToRemove) => {
+ const updatedCapturedImages = capturedImages.filter(
+ (file) => file !== fileToRemove
+ );
+ setCapturedImages(updatedCapturedImages);
+ onFileDelete(fileToRemove);
+ };
+
+ const errorColor = Colors.lightTheme.alert.error;
+
+ const getFileUploadIcon = (fileType, isError) => {
+ switch (fileType) {
+ case "application/pdf":
+ return (
+
+ );
+ case "application/vnd.ms-excel":
+ case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":
+ case "application/excel":
+ case "application/x-excel":
+ case "application/x-msexcel":
+ return (
+
+ );
+ case "application/vnd.openxmlformats-officedocument.wordprocessingml.document":
+ case "application/msword":
+ return (
+
+ );
+ default:
+ return (
+
+ );
+ }
+ };
+
+ useEffect(() => {
+ onSubmit(capturedImages);
+ }, [capturedImages, onSubmit]);
+
+ const videoConstraints = {
+ facingMode: "user",
+ };
+
+ const drawerClassName = `digit-upload-image-drawer ${
+ isMobileView ? "mobile-view" : ""
+ } ${openUploadSlide && isMobileView ? "open" : "close"}`;
+
+ return (
+
+ {!(uploadedFilesCount === 1 && !multiple) && (
+
+ {
+
+ }
+
{"Click to add photo"}
+
+ )}
+
+ {previews.map((preview, index) => {
+ return (
+
+ 1 ? " multiple" : "single"
+ } ${"imageFile"} ${preview?.error ? "error" : ""}`}
+ >
+
{
+ handleFileClick(index, preview?.file);
+ }}
+ >
+ {preview?.file?.type.startsWith("image/") ? (
+
+ ) : (
+ getFileUploadIcon(preview?.file?.type, true)
+ )}
+
+
{
+ e.stopPropagation();
+ handleFileDeletion(fileData[index]);
+ }}
+ className={`digit-uploader-close-icon ${
+ preview?.error ? "error" : ""
+ }`}
+ >
+
+
+ {preview?.error && (
+
+ )}
+
+
+ );
+ })}
+
+ {openUploadSlide && (
+ <>
+ {
+ e.stopPropagation();
+ closeDrawer();
+ }
+ : null
+ }
+ >
+
+ {!isMobileView && (
+
+ {"Choose an option to upload"}
+
+ )}
+ {!isMobileView && (
+
+
+
+ )}
+
+
+
+ toggleWebcam()}
+ // style={{ cursor: "pointer" }}
+ className="upload-options-svg-wrap"
+ >
+
+
+ toggleWebcam()}
+ className={"upload-options-label"}
+ >
+ Camera
+
+
+
+
+
+
+
+ My Files
+
+
+
+
+
+ >
+ )}
+ {isWebcamOpen && (
+ <>
+
+
+
+ {"Capture"}
+
+
+
+
+
+
+ {isMobileView ? (
+ <>
+
+
+ >
+ ) : (
+ <>
+
+
+ >
+ )}
+
+
+ >
+ )}
+
+ );
+};
+
+export default UploadImage;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/UploadWidget.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/UploadWidget.js
new file mode 100644
index 00000000..badc53d2
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/UploadWidget.js
@@ -0,0 +1,256 @@
+import React, { useState, useMemo, useEffect, useRef } from "react";
+import { FileUploader } from "react-drag-drop-files";
+import { useTranslation } from "react-i18next";
+import Button from "./Button";
+import { SVG } from "./SVG";
+import { CustomSVG } from "./CustomSVG";
+import ErrorMessage from "./ErrorMessage";
+import AlertCard from "./AlertCard";
+import { Colors} from "../constants/colors/colorconstants";
+
+const UploadWidget = ({
+ onSubmit,
+ fileData,
+ onFileDelete,
+ errors,
+ additionalElements,
+ multiple,
+ handleFileClick,
+ showErrorCard,
+ iserror,
+ showDownloadButton,
+ showReUploadButton,
+ fileTypes,
+}) => {
+ const { t } = useTranslation();
+ const [files, setFiles] = useState([]);
+ const types = fileTypes?.split(",");
+ const [isMobileView, setIsMobileView] = React.useState(
+ window.innerWidth <= 480
+ );
+ const onResize = () => {
+ if (window.innerWidth <= 480) {
+ if (!isMobileView) {
+ setIsMobileView(true);
+ }
+ } else {
+ if (isMobileView) {
+ setIsMobileView(false);
+ }
+ }
+ };
+ useEffect(() => {
+ window.addEventListener("resize", onResize);
+
+ return () => {
+ window.removeEventListener("resize", onResize);
+ };
+ }, []);
+
+ const errorColor = Colors.lightTheme.alert.error;
+ const primaryColor = Colors.lightTheme.paper.primary;
+ const inputBorderColor = Colors.lightTheme.generic.inputBorder;
+ const primaryTwo = Colors.lightTheme.primary[2];
+ const disabledColor = Colors.lightTheme.text.disabled;
+
+
+ const dragDropJSX = (
+
+ {
+
+ }
+
+ {t("Drag and drop your file or ")}
+
{t("Browse in my files")}
+
+
+ );
+
+ const handleFileDelete = (fileToRemove) => {
+ const updatedFiles = files.filter((file) => file !== fileToRemove);
+ setFiles(updatedFiles);
+ onFileDelete(fileToRemove);
+ };
+
+ const handleFileDownload = async (file) => {
+ try {
+ const downloadLink = document.createElement("a");
+ downloadLink.href = window.URL.createObjectURL(file);
+ downloadLink.download = file.name;
+ document.body.appendChild(downloadLink);
+ downloadLink.click();
+ document.body.removeChild(downloadLink);
+ } catch (error) {
+ console.error("Error downloading file:", error);
+ }
+ };
+
+ const handleReUpload = (fileToReupload) => {
+ const filesAfterRemoval = files.filter((file) => file !== fileToReupload);
+ const fileInput = document.createElement("input");
+ fileInput.type = "file";
+ fileInput.accept = fileTypes;
+ fileInput.multiple = multiple;
+ fileInput.style.display = "none";
+ fileInput.addEventListener("change", (event) => {
+ setFiles(filesAfterRemoval);
+ });
+ fileInput.addEventListener("change", (event) => {
+ const newFiles = event?.target?.files;
+ setFiles([...filesAfterRemoval, newFiles[0]]);
+ });
+ document.body.appendChild(fileInput);
+ fileInput.click();
+ };
+
+ const handleChange = async (newFiles) => {
+ const newlyUploadedFiles = multiple ? [...files, ...newFiles] : [newFiles];
+ setFiles(newlyUploadedFiles);
+ };
+
+ useEffect(() => {
+ onSubmit(files);
+ }, [files,onSubmit]);
+
+ const renderFileIcon = (fileType, fileErrors) => {
+ switch (fileType) {
+ case "application/pdf":
+ return ;
+ case "image/png":
+ return ;
+ case "image/jpeg":
+ case "image/pjpeg":
+ return ;
+ case "application/vnd.ms-excel":
+ case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":
+ case "application/excel":
+ case "application/x-excel":
+ case "application/x-msexcel":
+ return ;
+ case "application/vnd.openxmlformats-officedocument.wordprocessingml.document":
+ case "application/msword":
+ return ;
+ default:
+ return (
+
+ );
+ }
+ };
+
+ const renderFileCards = useMemo(() => {
+ return fileData?.map((file, index) => {
+ const fileErrors = errors?.find((error) => error.file === file);
+
+ return (
+
+
{
+ handleFileClick(index, file);
+ }}
+ >
+ {renderFileIcon(file?.type, fileErrors)}
+
+ {file?.name}
+ {fileErrors && !showErrorCard && (
+
+ )}
+
+
+ {fileErrors && showErrorCard && (
+
+ )}
+
+ {showReUploadButton && (
+
handleReUpload(file)}
+ size={isMobileView ? "small" : "medium"}
+ />
+ )}
+
+ {showDownloadButton && (
+ handleFileDownload(file)}
+ size={isMobileView ? "small" : "medium"}
+ />
+ )}
+
+ {additionalElements?.map((element, index) => (
+ {element}
+ ))}
+
+
handleFileDelete(file)}
+ >
+
+
+
+ );
+ });
+ }, [fileData, errors]);
+
+ return (
+
+ {((multiple === false && (!fileData || fileData?.length === 0)) ||
+ multiple === true) && (
+
+ )}
+ {fileData?.length > 0 && renderFileCards}
+
+ );
+};
+
+export default UploadWidget;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/WhatsNewCard.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/WhatsNewCard.js
new file mode 100644
index 00000000..001014d5
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/WhatsNewCard.js
@@ -0,0 +1,20 @@
+import React from "react"
+import { useTranslation } from "react-i18next"
+
+const WhatsNewCard = ({header, actions, eventNotificationText, timePastAfterEventCreation, timeApproxiamationInUnits}) => {
+ const { t } = useTranslation();
+
+ const getTransformedLocale = label => {
+ if (typeof label === "number") return label;
+ return label && label.toUpperCase().replace(/[.:-\s\/]/g, "_");
+ };
+
+ return
+}
+
+export default WhatsNewCard
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/doctories/Intro.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/doctories/Intro.stories.js
new file mode 100644
index 00000000..0f73fc0c
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/doctories/Intro.stories.js
@@ -0,0 +1,15 @@
+import React from "react";
+import Iframe from "../Iframe";
+
+export default {
+ title: "Intro",
+ component: "Iframe",
+};
+
+export const Intro = () => (
+
+);
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/foundationstories/Animations.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/foundationstories/Animations.stories.js
new file mode 100644
index 00000000..cd5ae01f
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/foundationstories/Animations.stories.js
@@ -0,0 +1,97 @@
+import React from "react";
+import { Animation } from "../../atoms";
+import successAnimation from "../../constants/animations/success.json";
+import errorAnimation from "../../constants/animations/error.json";
+import warning2Animation from "../../constants/animations/warningOutline2.json";
+import warningAnimation from "../../constants/animations/warningOutline.json";
+import theLoaderPrimary from '../../constants/animations/theLoaderPrimary.json';
+import theLoaderPrimary2 from '../../constants/animations/theLoaderPrimary2.json';
+import theLoaderWhite from '../../constants/animations/theLoaderWhite.json';
+
+export default {
+ title: "Foundations/Animations",
+ component: Animation,
+ argTypes: {
+ loop: {
+ control: "boolean",
+ },
+ autoplay: {
+ control: "boolean",
+ },
+ animationData: {
+ control: { type: "object" },
+ },
+ width: {
+ control: "number",
+ },
+ height: {
+ control: "number",
+ },
+ },
+};
+
+const Template = (args) => (
+
+);
+
+const commonArgs = {
+ animationData: {},
+ loop: false,
+ autoplay: true,
+ width: 74,
+ height: 74,
+};
+
+export const Success = Template.bind({});
+Success.args = {
+ ...commonArgs,
+ animationData: successAnimation,
+};
+
+export const Error = Template.bind({});
+Error.args = {
+ ...commonArgs,
+ animationData: errorAnimation,
+};
+
+export const Warning = Template.bind({});
+Warning.args = {
+ ...commonArgs,
+ animationData: warningAnimation,
+};
+
+export const Warning2 = Template.bind({});
+Warning2.args = {
+ ...commonArgs,
+ animationData: warning2Animation,
+};
+
+export const LoaderPrimary = Template.bind({});
+LoaderPrimary.args = {
+ ...commonArgs,
+ animationData: theLoaderPrimary,
+};
+
+export const LoaderPrimary2 = Template.bind({});
+LoaderPrimary2.args = {
+ ...commonArgs,
+ animationData: theLoaderPrimary2,
+};
+
+export const LoaderWhite = Template.bind({});
+LoaderWhite.args = {
+ ...commonArgs,
+ animationData: theLoaderWhite,
+};
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/foundationstories/BodyTypography.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/foundationstories/BodyTypography.stories.js
new file mode 100644
index 00000000..c170d6dc
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/foundationstories/BodyTypography.stories.js
@@ -0,0 +1,115 @@
+import React from "react";
+import Divider from "../Divider";
+
+export default {
+ title: "Foundations/Typography/Body",
+ argTypes: {
+ },
+};
+
+const style = {
+ position: "absolute",
+ top: "50%",
+ left: "50%",
+ color: "#363636",
+ display: "flex",
+ justifyContent: "center",
+ transform: "translate(-50%, -50%)",
+ lineHeight: "normal",
+};
+
+export const BodyL = () => (
+
+
+ Body L / 20pts
+
+
+
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
+ tempor incididunt ut labore
+
+
+);
+
+export const BodyS = () => (
+
+
+ Body S / 16pts
+
+
+
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
+ tempor incididunt ut labore
+
+
+);
+
+export const BodyXS = () => (
+
+
+ Body XS / 14pts
+
+
+
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
+ tempor incididunt ut labore
+
+
+);
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/foundationstories/ButtonTypography.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/foundationstories/ButtonTypography.stories.js
new file mode 100644
index 00000000..16ac1846
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/foundationstories/ButtonTypography.stories.js
@@ -0,0 +1,88 @@
+import React from "react";
+import Divider from "../Divider";
+
+export default {
+ title: "Foundations/Typography/Button",
+ argTypes: {
+ },
+};
+
+const style = {
+ position: "absolute",
+ top: "50%",
+ left: "50%",
+ color: "#363636",
+ display: "flex",
+ justifyContent: "center",
+ transform: "translate(-50%, -50%)",
+ lineHeight:"normal"
+};
+
+export const ButtonL = () => (
+
+
+ button large / 20pts
+
+
+
+ ButtonL
+
+
+);
+
+export const ButtonM = () => (
+
+
+ button medium / 16pts
+
+
+
+ ButtonM
+
+
+);
+
+export const ButtonS = () => (
+
+
+ button small / 14pts
+
+
+
+ ButtonS
+
+
+);
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/foundationstories/CaptionTypography.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/foundationstories/CaptionTypography.stories.js
new file mode 100644
index 00000000..57002864
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/foundationstories/CaptionTypography.stories.js
@@ -0,0 +1,88 @@
+import React from "react";
+import Divider from "../Divider";
+
+export default {
+ title: "Foundations/Typography/Caption",
+ argTypes: {
+ },
+};
+
+const style = {
+ position: "absolute",
+ top: "50%",
+ left: "50%",
+ color: "#363636",
+ display: "flex",
+ justifyContent: "center",
+ transform: "translate(-50%, -50%)",
+ lineHeight:"normal"
+};
+
+export const CaptionL = () => (
+
+
+ Caption L / 28pts
+
+
+
+ Lorem ipsum dolor sit amet, consectetur adipiscing
+
+
+);
+
+export const CaptionM = () => (
+
+
+ Caption M / 24pts
+
+
+
+ Lorem ipsum dolor sit amet, consectetur adipiscing
+
+
+);
+
+export const CaptionS = () => (
+
+
+ Caption S / 20pts
+
+
+
+ Lorem ipsum dolor sit amet, consectetur adipiscing
+
+
+);
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/foundationstories/HeadingTypography.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/foundationstories/HeadingTypography.stories.js
new file mode 100644
index 00000000..1c9fa359
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/foundationstories/HeadingTypography.stories.js
@@ -0,0 +1,134 @@
+import React from "react";
+import Divider from "../Divider";
+
+export default {
+ title: "Foundations/Typography/Heading",
+ argTypes: {
+ },
+};
+
+const style = {
+ position: "absolute",
+ top: "50%",
+ left: "50%",
+ color: "#363636",
+ display: "flex",
+ justifyContent: "center",
+ transform: "translate(-50%, -50%)",
+ lineHeight:"normal"
+};
+
+export const HeadingXL = () => (
+
+
+ Heading XL / 40pts
+
+
+
+ Lorem ipsum dolor sit amet, consectetur adipiscing
+
+
+);
+
+export const HeadingL = () => (
+
+
+ Heading L / 32pts
+
+
+
+ Lorem ipsum dolor sit amet, consectetur adipiscing
+
+
+);
+
+export const HeadingM = () => (
+
+
+ Heading M / 24pts
+
+
+
+ Lorem ipsum dolor sit amet, consectetur adipiscing
+
+
+);
+
+export const HeadingS = () => (
+
+
+ Heading S / 16pts
+
+
+
+ Lorem ipsum dolor sit amet, consectetur adipiscing
+
+
+);
+
+export const HeadingXS = () => (
+
+
+ Heading XS / 14pts
+
+
+
+ Lorem ipsum dolor sit amet, consectetur adipiscing
+
+
+);
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/foundationstories/Iconography.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/foundationstories/Iconography.stories.js
new file mode 100644
index 00000000..0676b759
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/foundationstories/Iconography.stories.js
@@ -0,0 +1,57 @@
+import React from "react";
+import * as components from "@egovernments/digit-ui-svg-components";
+import { CustomSVG } from "../CustomSVG";
+
+export default {
+ title: "Foundations/Iconography",
+};
+
+const gridStyle = {
+ display: "grid",
+ gridTemplateColumns: "repeat(auto-fill, minmax(300px, 1fr))",
+ gap: "16px",
+ padding: "16px",
+};
+
+const cardStyle = {
+ display: "flex",
+ flexDirection: "column",
+ alignItems: "center",
+ justifyContent: "center",
+ border: "1px solid #D6D5D4",
+ borderRadius: "8px",
+ padding: "16px",
+ gap: "8px",
+};
+
+const renderIcon = (IconComponent, name) => {
+ if (IconComponent) {
+ return (
+
+
+ {name}
+
+ );
+ } else {
+ return (
+
+ Invalid Icon
+
+ );
+ }
+};
+
+export const Iconography = () => {
+ const customSvgIcons = Object.entries(CustomSVG);
+ const svgIcons = Object.entries(components);
+
+ const allIcons = [...svgIcons, ...customSvgIcons].sort(([a], [b]) =>
+ a.localeCompare(b)
+ );
+
+ return (
+
+ {allIcons.map(([name, IconComponent]) => renderIcon(IconComponent, name))}
+
+ );
+};
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/foundationstories/LabelTypography.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/foundationstories/LabelTypography.stories.js
new file mode 100644
index 00000000..e81df64f
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/foundationstories/LabelTypography.stories.js
@@ -0,0 +1,50 @@
+import React from "react";
+import Divider from "../Divider";
+
+export default {
+ title: "Foundations/Typography/Label",
+ argTypes: {
+ },
+};
+
+const style = {
+ position: "absolute",
+ top: "50%",
+ left: "50%",
+ color: "#363636",
+ display: "flex",
+ justifyContent: "center",
+ transform: "translate(-50%, -50%)",
+ lineHeight: "normal",
+};
+
+export const Label = () => (
+
+
+ Label / 16pts
+
+
+
+ Label
+
+
+);
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/foundationstories/LinkTypography.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/foundationstories/LinkTypography.stories.js
new file mode 100644
index 00000000..f9816986
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/foundationstories/LinkTypography.stories.js
@@ -0,0 +1,88 @@
+import React from "react";
+import Divider from "../Divider";
+
+export default {
+ title: "Foundations/Typography/Link",
+ argTypes: {
+ },
+};
+
+const style = {
+ position: "absolute",
+ top: "50%",
+ left: "50%",
+ color: "#363636",
+ display: "flex",
+ justifyContent: "center",
+ transform: "translate(-50%, -50%)",
+ lineHeight:"normal"
+};
+
+export const LinkL = () => (
+
+
+ Link L / 20pts
+
+
+
+ LinkL
+
+
+);
+
+export const LinkS = () => (
+
+
+ Link S / 16pts
+
+
+
+ LinkS
+
+
+);
+
+export const linkXS = () => (
+
+
+ Link XS / 14pts
+
+
+
+ LinkXS
+
+
+);
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/index.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/index.js
new file mode 100644
index 00000000..a542ed4b
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/index.js
@@ -0,0 +1,205 @@
+import { Accordion } from "./Accordion";
+import {AccordionList} from "./Accordion";
+import HomeFooter from "./HomeFooter";
+import ActionLinks from "./ActionLinks";
+import Amount from "./Amount";
+import AppContainer from "./AppContainer";
+import BackLink from "./BackLink";
+import Banner from "./Banner";
+import BodyContainer from "./BodyContainer";
+import BreadCrumb from "./BreadCrumb";
+import BreakLine from "./BreakLine";
+import Button from "./Button";
+import Card from "./Card";
+import CardBasedOptions from "./CardBasedOptions";
+import CardCaption from "./CardCaption";
+import CardHeader from "./CardHeader";
+import CardLabel from "./CardLabel";
+import CardLabelError from "./CardLabelError";
+import CardText from "./CardText";
+import CheckBox from "./CheckBox";
+import CitizenHomeCard from "./CitizenHomeCard";
+import CitizenInfoLabel from "./CitizenInfoLabel";
+import CollapseAndExpandGroups from "./CollapseAndExpandGroups";
+import { ConnectingCheckPoints } from "./ConnectingCheckPoints";
+import DatePicker from "./DatePicker";
+import DisplayPhotos from "./DisplayPhotos";
+import Dropdown from "./Dropdown";
+import ErrorMessage from "./ErrorMessage";
+import Footer from "./Footer";
+import HeaderComponent from "./HeaderComponent";
+import HeaderBar from "./HeaderBar";
+import HorizontalNav from "./HorizontalNav";
+import Tab from "./Tab";
+import AlertCard from "./AlertCard";
+import InputTextAmount from "./InputTextAmount";
+import KeyNote from "./KeyNote";
+import LabelFieldPair from "./LabelFieldPair";
+import MobileNumber from "./MobileNumber";
+import MultiSelectDropdown from "./MultiSelectDropdown";
+import NoResultsFound from "./NoResultsFound";
+import OTPInput from "./OTPInput";
+import Paragraph from "./Paragraph";
+import PlusMinusInput from "./PlusMinusInput";
+import PopUp from "./PopUp";
+import { PrivateRoute } from "./PrivateRoute";
+import RadioButtons from "./RadioButtons";
+import Rating from "./Rating";
+import Chip from "./Chip";
+import { SVG } from "./SVG";
+// import Table from "./Table";
+import Telephone from "./Telephone";
+import TextArea from "./TextArea";
+import TextInput from "./TextInput";
+import Toast from "./Toast";
+import UploadFile from "./UploadFile";
+import WhatsNewCard from "./WhatsNewCard";
+import PageBasedInput from "./PageBasedInput";
+// import Numeric from "./Numeric";
+import Toggle from "./Toggle";
+import ToggleSwitch from "./ToggleSwitch";
+import TreeSelect from "./TreeSelect";
+import SubmitBar from "./SubmitBar";
+import ButtonSelector from "./ButtonSelector";
+import InboxSearchLinks from "./InboxSearchLinks";
+import SearchComponent from "./SearchComponent";
+import LinkLabel from "./LinkLabel";
+import RoundedLabel from "./RoundedLabel";
+import Stepper from "./Stepper";
+import Timeline from "./Timeline";
+import StringManipulator from "./StringManipulator";
+import InfoButton from "./InfoButton";
+import FileUpload from "./FileUpload";
+import UploadWidget from "./UploadWidget";
+import UploadImage from "./UploadImage";
+import ErrorBoundary from "./ErrorBoundary";
+import TextBlock from "./TextBlock";
+import Panels from "./Panels";
+import Animation from "./Animation";
+import SummaryCardFieldPair from "./SummaryCardFieldPair";
+import ButtonGroup from "./ButtonGroup";
+import Divider from "./Divider";
+import Header from "./Header";
+import HamburgerButton from "./HamburgerButton";
+import Menu from "./Menu";
+import SideNav from "./SideNav";
+import Hamburger from "./Hamburger";
+import SelectionTag from "./SelectionTag";
+import Tag from "./Tag";
+import Tooltip from "./Tooltip";
+import Switch from "./Switch";
+import { CustomSVG } from "./CustomSVG";
+import TableMain from "./TableMain";
+import TableBody from "./TableBody";
+import TableCell from "./TableCell";
+import TableFooter from "./TableFooter";
+import TableHeader from "./TableHeader";
+import TableRow from "./TableRow";
+import SidePanel from "./SidePanel";
+import NestedTable from "./NestedTable";
+import Loader from "./Loader";
+import Iframe from "./Iframe";
+
+export {
+ ErrorBoundary,
+ PageBasedInput,
+ Footer,
+ ActionLinks,
+ Amount,
+ AppContainer,
+ BackLink,
+ SideNav,
+ Hamburger,
+ Switch,
+ Accordion,
+ Iframe,
+ AccordionList,
+ Tooltip,
+ Banner,
+ BodyContainer,
+ BreadCrumb,
+ BreakLine,
+ Button,
+ Card,
+ CardBasedOptions,
+ CardCaption,
+ CardHeader,
+ CardLabel,
+ CardLabelError,
+ CardText,
+ CheckBox,
+ CitizenHomeCard,
+ CitizenInfoLabel,
+ CollapseAndExpandGroups,
+ ConnectingCheckPoints,
+ DatePicker,
+ DisplayPhotos,
+ Dropdown,
+ ErrorMessage,
+ HomeFooter,
+ HeaderComponent,
+ HeaderBar,
+ HorizontalNav,
+ Loader,
+ Tab,
+ AlertCard,
+ InputTextAmount,
+ KeyNote,
+ LabelFieldPair,
+ MobileNumber,
+ MultiSelectDropdown,
+ NoResultsFound,
+ OTPInput,
+ SidePanel,
+ Paragraph,
+ PlusMinusInput,
+ PopUp,
+ SelectionTag,
+ Tag,
+ PrivateRoute,
+ RadioButtons,
+ Rating,
+ Chip,
+ SVG,
+ Header,
+ HamburgerButton,
+ Menu,
+ // Table,
+ Telephone,
+ TextArea,
+ TextInput,
+ Toast,
+ UploadFile,
+ WhatsNewCard,
+ Toggle,
+ ToggleSwitch,
+ TreeSelect,
+ SubmitBar,
+ ButtonSelector,
+ Stepper,
+ Timeline,
+ SummaryCardFieldPair,
+ Divider,
+ ButtonGroup,
+ StringManipulator,
+ InfoButton,
+ FileUpload,
+ UploadWidget,
+ UploadImage,
+ TextBlock,
+ Panels,
+ Animation,
+ InboxSearchLinks,
+ SearchComponent,
+ LinkLabel,
+ RoundedLabel,
+ //Icons
+ CustomSVG,
+ TableMain,
+ TableHeader,
+ TableFooter,
+ TableBody,
+ TableRow,
+ TableCell,
+ NestedTable
+};
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/Accordion.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/Accordion.stories.js
new file mode 100644
index 00000000..7e1e52c8
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/Accordion.stories.js
@@ -0,0 +1,100 @@
+import React from "react";
+import { Accordion } from "../Accordion";
+import Iframe from "../Iframe";
+
+export default {
+ title: "Atoms/Accordion",
+ component: Accordion,
+ argTypes: {
+ title: { control: "text",name:"Title" },
+ children: { control: "text",name:"Content" },
+ isOpenInitially: { control: "boolean" ,table: { disable: true } },
+ customClassName: { control: "text" ,table: { disable: true } },
+ customStyles: { control: "object" ,table: { disable: true } },
+ onToggle: { action: "onToggle",table: { disable: true } },
+ icon: { control: "text" ,name:"Icon"},
+ number: { control: "number",name:"Number" },
+ hideCardBorder: { control: "boolean",name:"Hide Border" },
+ hideDivider: { control: "boolean" ,name:"Hide Divider" },
+ hideCardBg: { control: "boolean",name:"Hide Background" },
+ hideBorderRadius: { control: "boolean" ,name:"Hide Border Radius" },
+ iconFill: { table: { disable: true } },
+ isClosed: { table: { disable: true } },
+ iconWidth: { table: { disable: true } },
+ iconHeight: { table: { disable: true } },
+ },
+};
+
+const Template = (args) => ;
+
+export const Documentation = () => (
+
+);
+
+Documentation.storyName = "Docs";
+Documentation.argTypes = {
+ title: { table: { disable: true } },
+ icon: { table: { disable: true }},
+ number: { table: { disable: true }},
+ hideCardBorder: {table: { disable: true } },
+ hideDivider: { table: { disable: true } },
+ hideCardBg: { table: { disable: true }},
+ hideBorderRadius: { table: { disable: true }},
+ children: { table: { disable: true }},
+ isOpenInitially: { table: { disable: true }},
+};
+
+export const Basic = Template.bind({});
+Basic.args = {
+ title: "Section Header",
+ children: `Dummy text refers to the bits of content that are used to fill a website. This text helps web designers better envision how the website will look as a finished product. It is important to understand that dummy text has no meaning whatsoever. Its sole purpose is to fill out blank spaces with “word-like” content, without making any copyright infringements.
+ Dummy text refers to the bits of content that are used to fill a website. This text helps web designers better envision how the website will look as a finished product. It is important to understand that dummy text has no meaning whatsoever. Its sole purpose is to fill out blank spaces with “word-like” content, without making any copyright infringements.`,
+ isOpenInitially: false,
+ hideCardBorder: true,
+ hideDivider: true,
+ hideCardBg: true,
+ hideBorderRadius: true,
+ icon:"",
+ number:""
+};
+
+export const Nested = Template.bind({});
+Nested.args = {
+ isOpenInitially: false,
+ hideCardBorder: false,
+ hideDivider: false,
+ hideCardBg: false,
+ hideBorderRadius: false,
+ title: "Section Header",
+ children: (
+
+ This is a nested accordion demonstrating component composition. The
+ isChild prop ensures proper styling and behavior.
+
+ ),
+ icon:"",
+ number:""
+};
+
+export const Custom = Template.bind({});
+Custom.args = {
+ title: "Section Header",
+ children: `Dummy text refers to the bits of content that are used to fill a website. This text helps web designers better envision how the website will look as a finished product. It is important to understand that dummy text has no meaning whatsoever. Its sole purpose is to fill out blank spaces with “word-like” content, without making any copyright infringements.
+ Dummy text refers to the bits of content that are used to fill a website. This text helps web designers better envision how the website will look as a finished product. It is important to understand that dummy text has no meaning whatsoever. Its sole purpose is to fill out blank spaces with “word-like” content, without making any copyright infringements.`,
+ customClassName: "custom-accordion",
+ customStyles: {
+ borderColor: "#C84C0E",
+ backgroundColor: "#FFFFFF",
+ },
+ hideCardBorder: false,
+ hideDivider: false,
+ hideCardBg: false,
+ hideBorderRadius: false,
+ icon:"",
+ number:"",
+ isOpenInitially: false,
+};
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/ActionButton.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/ActionButton.stories.js
new file mode 100644
index 00000000..e18943ee
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/ActionButton.stories.js
@@ -0,0 +1,183 @@
+import React from "react";
+import Button from "../Button";
+import Iframe from "../Iframe";
+
+export default {
+ title: "Atoms/Action Button",
+ component: Button,
+ argTypes: {
+ label: {
+ control: "text",
+ name:"Label"
+ },
+ variation: {
+ control: "select",
+ options: ["primary", "secondary", "teritiary", "link"],
+ table: { disable: true },
+ },
+ size: {
+ control: "select",
+ options: ["large", "medium", "small"],
+ table: { disable: true },
+ },
+ className: {
+ control: "text",
+ table: { disable: true },
+ },
+ style: {
+ control: { type: "object" },
+ table: { disable: true },
+ },
+ onClick: {
+ control: "function",
+ table: { disable: true },
+ },
+ title: {
+ control: "text",
+ table: { disable: true },
+ },
+ isSearchable: {
+ control: "boolean",
+ name:"Searchable"
+ },
+ showBottom: {
+ control: "select",
+ options: ["DropUp", "DropDown"],
+ name: "ActionButton",
+ mapping: {
+ DropUp: false,
+ DropDown: true,
+ },
+ },
+ optionsKey: {
+ control: "text",
+ table: { disable: true },
+ },
+ options: {
+ control: {
+ type: "array",
+ separator: ",",
+ },
+ table: { disable: true },
+ },
+ isDisabled: {
+ control: "select",
+ options: ["Default", "Disabled"],
+ name: "State",
+ mapping: {
+ Default: false,
+ Disabled: true,
+ },
+ },
+ textStyles: { table: { disable: true } },
+ iconFill: { table: { disable: true } },
+ icon: { table: { disable: true } },
+ onOptionSelect: { table: { disable: true } },
+ type: { table: { disable: true } },
+ WithIcon: {
+ control: "boolean",
+ table: { disable: true },
+ },
+ isSuffix: {
+ control: "select",
+ options: ["Prefix", "Suffix"],
+ name: "Icon",
+ mapping: {
+ Prefix: false,
+ Suffix: true,
+ },
+ table: { disable: true },
+ if: { arg: "WithIcon", truthy: true },
+ },
+ },
+};
+
+const commonStyles = {
+ position: "absolute",
+ top: "50%",
+ left: "50%",
+ color: "#363636",
+ display: "flex",
+ alignItems: "center",
+ justifyContent: "center",
+ transform: "translate(-50%, -50%)",
+};
+
+const Template = (args) => {
+ const { ...restArgs } = args;
+
+ return (
+
+
+
+ );
+};
+
+const commonArgs = {
+ label: "ActionButton",
+ className: "custom-class",
+ style: {},
+ onClick: () => {
+ console.log("clicked");
+ },
+ isDisabled: "Default",
+ variation: "primary",
+ size: "large",
+ title: "",
+ iconFill: "",
+ showBottom: "DropDown",
+ type: "actionButton",
+ optionsKey: "name",
+ isSearchable: true,
+ options: [
+ { name: "Action A", code: "Actiona" },
+ { name: "Action B", code: "Actionb" },
+ { name: "Action C", code: "Actionc" },
+ ],
+ onOptionSelect: (e) => {
+ console.log(e, "option selected");
+ },
+};
+
+export const Documentation = () => (
+
+);
+
+Documentation.storyName = "Docs";
+Documentation.argTypes = {
+ isDisabled: { table: { disable: true } },
+ label: { table: { disable: true }},
+ isSearchable: { table: { disable: true }},
+ showBottom: {table: { disable: true } },
+};
+
+export const Primary = Template.bind({});
+Primary.args = {
+ ...commonArgs,
+};
+
+export const Secondary = Template.bind({});
+Secondary.args = {
+ ...commonArgs,
+ variation:"secondary"
+};
+
+export const Teritiary = Template.bind({});
+Teritiary.args = {
+ ...commonArgs,
+ variation: "teritiary",
+};
+
+export const Link = Template.bind({});
+Link.args = {
+ ...commonArgs,
+ variation: "link",
+};
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/AlertCard.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/AlertCard.stories.js
new file mode 100644
index 00000000..82cbb503
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/AlertCard.stories.js
@@ -0,0 +1,180 @@
+import React from "react";
+import AlertCard from "../AlertCard";
+import TextArea from "../TextArea";
+import InfoButton from "../InfoButton";
+import Iframe from "../Iframe";
+
+export default {
+ title: "Atoms/Alert Card",
+ component: AlertCard,
+ argTypes: {
+ label: {
+ control: "text",
+ table: { disable: true },
+ },
+ variant: {
+ control: "select",
+ options: ["default", "success", "warning", "error"],
+ table: { disable: true },
+ },
+ text: { control: "text", table: { disable: true } },
+ style: {
+ control: "object",
+ table: { disable: true },
+ },
+ textStyle: {
+ control: "object",
+ table: { disable: true },
+ },
+ additionalElements: {
+ control: "boolean",
+ table: { disable: true },
+ },
+ inline: {
+ control: "select",
+ options: ["Default", "Inline"],
+ name: "Widgets Alignment",
+ mapping: {
+ Default: false,
+ Inline: true,
+ },
+ },
+ WithAction: {
+ control: "boolean",
+ name:"With Action"
+ },
+ WithWidgets: {
+ control: "boolean",
+ name:"With Widgets"
+ }
+ },
+};
+
+const additionalElements = [
+ Additional Element 1
,
+ ,
+ ,
+ ,
+ ,
+ ,
+ ,
+ ,
+ ,
+];
+
+const additionalElementsWithAction = [
+ ...additionalElements,
+ ,
+];
+
+const actionWidget = [
+ ,
+];
+
+const Template = ({ WithWidgets, WithAction, ...args }) => (
+
+);
+
+const commonArgs = {
+ label: "Info",
+ text:
+ "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.",
+ variant: "default",
+ WithWidgets: false,
+ inline: "Default",
+ WithAction:false
+};
+
+export const Documentation = () => (
+
+);
+
+Documentation.storyName = "Docs";
+Documentation.argTypes = {
+ inline: { table: { disable: true } },
+ WithAction: { table: { disable: true }},
+ WithWidgets: {table:{disable:true}}
+};
+
+export const Info = Template.bind({});
+Info.args = {
+ ...commonArgs,
+};
+
+export const Success = Template.bind({});
+Success.args = {
+ ...commonArgs,
+ variant: "success",
+ label: "Success",
+};
+
+export const Warning = Template.bind({});
+Warning.args = {
+ ...commonArgs,
+ label: "Warning",
+ variant: "warning",
+};
+
+export const Error = Template.bind({});
+Error.args = {
+ ...commonArgs,
+ label: "Error",
+ variant: "error",
+};
+
+export const Custom = Template.bind({});
+Custom.args = {
+ ...commonArgs,
+ label: "Custom",
+ style:{
+ border:"3px solid black",
+ backgroundColor:"#ffffff"
+ }
+};
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/BackLink.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/BackLink.stories.js
new file mode 100644
index 00000000..02ded85b
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/BackLink.stories.js
@@ -0,0 +1,71 @@
+import React from "react";
+import BackLink from "../BackLink";
+import Iframe from "../Iframe";
+
+export default {
+ title: "Atoms/BackLink",
+ component: BackLink,
+ argTypes: {
+ variant: { table: { disable: true } },
+ className: { table: { disable: true } },
+ style: { table: { disable: true } },
+ label: { table: { disable: true } },
+ onClick: { table: { disable: true } },
+ hideIcon: { table: { disable: true } },
+ hideLabel: { table: { disable: true } },
+ iconFill: { table: { disable: true } },
+ disabled: {
+ control: "select",
+ options: ["Default", "Disabled"],
+ name:"State",
+ mapping: {
+ Default: false,
+ Disabled: true,
+ },
+ },
+ },
+};
+
+const Template = (args) => ;
+
+const commonArgs = {
+ style: {},
+ onClick: () => console.log("clicked"),
+ disabled: "Default",
+ variant: "",
+ hideIcon: false,
+ hideLabel: false,
+ iconFill: "",
+ label: "Back",
+};
+
+export const Documentation = () => (
+
+);
+
+Documentation.storyName = "Docs";
+Documentation.argTypes = {
+ disabled: { table: { disable: true } },
+};
+
+export const Backlink1 = Template.bind({});
+Backlink1.args = {
+ ...commonArgs,
+ variant: "primary",
+};
+
+export const Backlink2 = Template.bind({});
+Backlink2.args = {
+ ...commonArgs,
+ variant: "secondary",
+};
+
+export const Backlink3 = Template.bind({});
+Backlink3.args = {
+ ...commonArgs,
+ variant: "teritiary",
+};
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/BreadCrumb.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/BreadCrumb.stories.js
new file mode 100644
index 00000000..0159c63e
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/BreadCrumb.stories.js
@@ -0,0 +1,148 @@
+import React from "react";
+import BreadCrumb from "../BreadCrumb";
+import { BrowserRouter as Router } from "react-router-dom";
+import { SVG } from "../SVG";
+import Iframe from "../Iframe";
+
+export default {
+ title: "Atoms/BreadCrumb",
+ component: BreadCrumb,
+ argTypes: {
+ className: { table: { disable: true } },
+ style: { table: { disable: true } },
+ crumbs: { table: { disable: true } },
+ spanStyle: { table: { disable: true } },
+ maxItems: { table: { disable: true } },
+ itemsAfterCollapse: { table: { disable: true } },
+ itemsBeforeCollapse: { table: { disable: true } },
+ expandText: { table: { disable: true } },
+ customSeparator: { table: { disable: true } },
+ WithIcons: {
+ control: "boolean",
+ name:"With Icons"
+ },
+ WithCustomSeparator: {
+ control: "boolean",
+ name:"With Custom Seperator"
+ },
+ },
+};
+
+// Updated crumbs with icons
+const iconCrumbs = [
+ {
+ content: "Home",
+ show: true,
+ internalLink: "/home",
+ icon: ,
+ },
+ {
+ content: "Previous1",
+ show: true,
+ internalLink: "/previous1",
+ icon: ,
+ },
+ {
+ content: "Previous2",
+ show: true,
+ internalLink: "/previous2",
+ icon: ,
+ },
+ {
+ content: "Previous3",
+ show: true,
+ internalLink: "/previous3",
+ icon: ,
+ },
+ {
+ content: "Current",
+ show: true,
+ internalLink: "/current",
+ icon: ,
+ },
+];
+const crumbs = [
+ {
+ content: "Home",
+ show: true,
+ internalLink: "/home",
+ },
+ {
+ content: "Previous1",
+ show: true,
+ internalLink: "/previous1",
+ },
+ {
+ content: "Previous2",
+ show: true,
+ internalLink: "/previous2",
+ },
+ {
+ content: "Previous3",
+ show: true,
+ internalLink: "/previous3",
+ },
+ {
+ content: "Current",
+ show: true,
+ internalLink: "/current",
+ },
+];
+
+
+const commonArgs = {
+ WithCustomSeparator: false,
+ WithIcons:false
+};
+
+const Template = (args) => {
+ const { WithIcons, WithCustomSeparator, ...rest } = args;
+ const customSeparator = WithCustomSeparator ? (
+
+ ) : undefined;
+ const finalCrumbs = WithIcons ? iconCrumbs : crumbs || [];
+ return (
+
+
+
+ );
+};
+
+export const Documentation = () => (
+
+);
+
+Documentation.storyName = "Docs";
+Documentation.argTypes = {
+ WithCustomSeparator: { table: { disable: true } },
+ WithIcons: { table: { disable: true }},
+};
+
+export const Basic = Template.bind({});
+Basic.args = {
+ ...commonArgs
+};
+
+export const Collapsed = Template.bind({});
+Collapsed.args = {
+ ...commonArgs,
+ maxItems: 3,
+};
+
+export const Custom = Template.bind({});
+Custom.args = {
+ ...commonArgs,
+ maxItems: 3,
+ itemsBeforeCollapse: 1,
+ itemsAfterCollapse: 2,
+ spanStyle: {
+ color: "#0B4B66",
+ },
+};
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/ButtonDocs.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/ButtonDocs.stories.js
new file mode 100644
index 00000000..1951a81a
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/ButtonDocs.stories.js
@@ -0,0 +1,105 @@
+import React from "react";
+import Button from "../Button";
+import Iframe from "../Iframe";
+
+export default {
+ title: "Atoms/Button",
+ component: Button,
+ argTypes: {
+ label: {
+ control: "text",
+ table: { disable: true }
+ },
+ variation: {
+ control: "select",
+ options: ["primary", "secondary", "teritiary", "link"],
+ table: { disable: true },
+ },
+ size: { control: "select", options: ["large", "medium", "small"] ,table: { disable: true }},
+ className: {
+ control: "text",
+ table: { disable: true },
+ },
+ style: {
+ control: { type: "object" },
+ table: { disable: true },
+ },
+ onClick: {
+ control: "function",
+ table: { disable: true },
+ },
+ title: {
+ control: "text",
+ table: { disable: true },
+ },
+ isSearchable: {
+ control: "boolean",
+ table: { disable: true }
+ },
+ showBottom: {
+ control: "select",
+ options: ["DropUp", "DropDown"],
+ table: { disable: true },
+ name: "ActionButton",
+ mapping: {
+ DropUp: false,
+ DropDown: true,
+ },
+ },
+ optionsKey: {
+ control: "text",
+ table: { disable: true },
+ },
+ options: {
+ control: {
+ type: "array",
+ separator: ",",
+ },
+ table: { disable: true },
+ },
+ isDisabled: {
+ control: "select",
+ options: ["Default", "Disabled"],
+ name: "state",
+ mapping: {
+ Default: false,
+ Disabled: true,
+ },
+ table: { disable: true }
+ },
+ textStyles: { table: { disable: true } },
+ iconFill: { table: { disable: true } },
+ icon: { table: { disable: true } },
+ onOptionSelect: { table: { disable: true } },
+ type: { table: { disable: true } },
+ WithIcon: {
+ control: "boolean",table: { disable: true }
+ },
+ isSuffix: {
+ control: "select",
+ options: ["Prefix", "Suffix"],
+ name: "Icon",
+ mapping: {
+ Prefix: false,
+ Suffix: true,
+ },
+ if: { arg: "WithIcon", truthy: true },
+ table: { disable: true }
+ },
+ Width: {
+ control: "select",
+ options: ["Hug Content", "Justify"],
+ table: { disable: true }
+ },
+ },
+};
+
+export const Documentation = () => (
+
+);
+
+Documentation.storyName = "Docs";
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/Checkbox.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/Checkbox.stories.js
new file mode 100644
index 00000000..4bc2184c
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/Checkbox.stories.js
@@ -0,0 +1,108 @@
+import React from "react";
+import CheckBox from "../CheckBox";
+import Iframe from "../Iframe";
+
+export default {
+ title: "Atoms/CheckBox",
+ component: CheckBox,
+ argTypes: {
+ onChange: { action: "onChange", table: { disable: true } },
+ value: { control: "text", table: { disable: true } },
+ checked: { control: "boolean", table: { disable: true } },
+ isIntermediate: { control: "boolean", table: { disable: true } },
+ styles: { control: "object", table: { disable: true } },
+ style: { control: "object", table: { disable: true } },
+ ref: { table: { disable: true } },
+ userType: { table: { disable: true } },
+ hideLabel: { table: { disable: true } },
+ disabled: {
+ control: "select",
+ options: ["Default","Disabled"],
+ name:"State",
+ mapping: {
+ Default: false,
+ Disabled: true,
+ },
+ },
+ isLabelFirst: { control: "select" ,name:"Label Alignment", mapping: {
+ Left: true,
+ Right: false,
+ }, options: ["Left","Right"],},
+ label: { control: "text",name:"Label"},
+ },
+};
+
+const commonStyles = {
+ position: "absolute",
+ top: "50%",
+ left: "50%",
+ color: "#363636",
+ display: "flex",
+ alignItems: "center",
+ justifyContent: "center",
+ transform: "translate(-50%, -50%)",
+};
+
+const Template = (args) => {
+ const [isChecked, setIsChecked] = React.useState(args?.checked);
+
+ const handleCheckboxChange = (event) => {
+ setIsChecked(event.target.checked);
+ };
+
+ return (
+
+
+
+ );
+};
+
+const commonArgs = {
+ onChange: () => {},
+ value: "",
+ checked: true,
+ isLabelFirst: "Right",
+ label: "Label",
+ isIntermediate: false,
+ styles: {},
+ style: {},
+ disabled: "Default",
+};
+
+export const Documentation = () => (
+
+);
+
+Documentation.storyName = "Docs";
+Documentation.argTypes = {
+ label: { table: { disable: true } },
+ isLabelFirst: { table: { disable: true }},
+ disabled: { table: { disable: true }},
+};
+
+export const Unchecked = Template.bind({});
+Unchecked.args = {
+ ...commonArgs,
+ checked:false
+};
+
+export const Intermediate = Template.bind({});
+Intermediate.args = {
+ ...commonArgs,
+ checked:false,
+ isIntermediate:true
+};
+
+export const Checked = Template.bind({});
+Checked.args = {
+ ...commonArgs,
+ checked:true
+};
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/Chip.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/Chip.stories.js
new file mode 100644
index 00000000..5884c1c0
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/Chip.stories.js
@@ -0,0 +1,109 @@
+import React from "react";
+import { action } from "@storybook/addon-actions";
+import Chip from "../Chip";
+import Iframe from "../Iframe";
+
+export default {
+ title: "Atoms/Chip",
+ component: Chip,
+ argTypes: {
+ className: {
+ control: "text",
+ table: { disable: true }
+ },
+ text: {
+ control: "text",name:"Text"
+ },
+ onClick: {
+ control: "function",
+ table: { disable: true }
+ },
+ onTagClick: {
+ control: "function",
+ table: { disable: true }
+ },
+ extraStyles: {
+ control: { type: "object" },
+ table: { disable: true }
+ },
+ disabled: {
+ control: "boolean",
+ table: { disable: true }
+ },
+ isErrorTag: {
+ control: "boolean",
+ table: { disable: true }
+ },
+ hideClose: {
+ control: "boolean",
+ name:"With Close",
+ mapping:{
+ true:false,
+ false:true
+ }
+ },
+ error: {
+ control: "text",
+ name:'Error'
+ // table: { disable: true }
+ },
+ WithIcon: {
+ control: "boolean",
+ name:"With Icon"
+ },
+ },
+};
+
+const Template = (args) => {
+ const { WithIcon, ...restArgs } = args;
+
+ return (
+
+
+
+ );
+};
+
+
+const commonArgs = {
+ text: "Chip",
+ className: "",
+ extraStyles: {},
+ onClick: () => console.log("Close icon is clicked"),
+ onTagClick: () => console.log("Tag is clicked"),
+ disabled: false,
+ isErrorTag: false,
+ error: "",
+ hideClose: false,
+ WithIcon:false
+};
+
+export const Documentation = () => (
+
+);
+
+Documentation.storyName = "Docs";
+Documentation.argTypes = {
+ text: { table: { disable: true } },
+ error: { table: { disable: true }},
+ hideClose: { table: { disable: true }},
+ WithIcon: { table: { disable: true }},
+};
+
+export const Basic = Template.bind({});
+Basic.args = {
+ ...commonArgs,
+};
+
+export const Error = Template.bind({});
+Error.args = {
+ ...commonArgs,
+ text: "ErrorChipWithError",
+ isErrorTag: true,
+ error: "ErrorMessage",
+ hideClose: false,
+};
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/ColorLibrary.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/ColorLibrary.stories.js
new file mode 100644
index 00000000..999b711b
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/ColorLibrary.stories.js
@@ -0,0 +1,451 @@
+import React from "react";
+
+export default {
+ title: "Foundations",
+};
+
+const hexCodes = {
+ "primary-1": "#C84C0E",
+ "primary-bg": "#FBEEE8",
+ "primary-2": "#0B4B66",
+ "text-primary": "#363636",
+ "text-secondary": "#787878",
+ "text-disabled": "#C5C5C5",
+ "alert-error": "#B91900",
+ "alert-errorbg": "#FFF5F4",
+ "alert-success": "#00703C",
+ "alert-successbg": "#F1FFF8",
+ "alert-warning": "#9E5F00",
+ "alert-warning-bg": "#FFF9F0",
+ "alert-info": "#0057BD",
+ "alert-infobg": "#DEEFFF",
+ "generic-background": "#EEEEEE",
+ "generic-divider": "#D6D5D4",
+ "generic-inputborder": "#505A5F",
+ "paper-primary": "#FFFFFF",
+ "paper-secondary": "#FAFAFA",
+};
+
+const commonStyles = {
+ display: "flex",
+ flexDirection: "column",
+ color: "#787878",
+ backgroundColor: "#FAFAFA",
+ padding: "16px",
+ gap: "16px",
+ borderRadius: "4px",
+ border: "1px solid #d6d5d4",
+};
+
+const commonStylesForColors = {
+ height: "40px",
+ borderRadius: "4px",
+ margin: "0 auto",
+ width: "100%",
+ border: "1px solid #d6d5d4",
+};
+
+const wrapperStyles = {
+ display: "flex",
+ flexDirection: "column",
+ gap: "4px",
+ alignItems: "center",
+ color: "#787878",
+ width: "50%",
+};
+
+const extrStyles = {
+ display: "flex",
+ flexDirection: "row",
+ gap: "4px",
+ justifyContent: "space-between",
+ color: "#787878",
+};
+
+const ColorDisplay = () => {
+ return (
+
+
+ Colors
+
+
+
+ Primary
+
+
+
+ digitv2.lightTheme.primary-1
+
+
+
+
+
+
+ digitv2.lightTheme.primary-2
+
+
+
+
+
+
+ digitv2.lightTheme.primary-bg
+
+
+
+
+
+
+
+ Text
+
+
+
+
+ digitv2.lightTheme.text-primary
+
+
+
+
+
+
+ digitv2.lightTheme.text-secondary
+
+
+
+
+
+
+ digitv2.lightTheme.text-disabled
+
+
+
+
+
+
+
+ Alert
+
+
+
+
+ digitv2.lightTheme.alert-error
+
+
+
+
+
+
+ digitv2.lightTheme.alert-errorbg
+
+
+
+
+
+
+ digitv2.lightTheme.alert-success
+
+
+
+
+
+
+ digitv2.lightTheme.alert-successbg
+
+
+
+
+
+
+ digitv2.lightTheme.alert-info
+
+
+
+
+
+
+ digitv2.lightTheme.alert-infobg
+
+
+
+
+
+
+ digitv2.lightTheme.alert-warning
+
+
+
+
+
+
+ digitv2.lightTheme.alert-warning-bg
+
+
+
+
+
+
+
+ Generic
+
+
+
+
+ digitv2.lightTheme.generic-background
+
+
+
+
+
+
+ digitv2.lightTheme.generic-divider
+
+
+
+
+
+
+ digitv2.lightTheme.generic-inputborder
+
+
+
+
+
+
+
+ Paper
+
+
+
+
+ digitv2.lightTheme.paper-primary
+
+
+
+
+
+
+ digitv2.lightTheme.paper-secondary
+
+
+
+
+
+ );
+};
+
+export const Colors = () => ;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/Divider.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/Divider.stories.js
new file mode 100644
index 00000000..d70800ff
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/Divider.stories.js
@@ -0,0 +1,69 @@
+import React from "react";
+import Divider from "../Divider";
+import Iframe from "../Iframe";
+
+export default {
+ title: "Atoms/Divider",
+ component: Divider,
+ argTypes: {
+ className: {
+ control: "boolean",table:{disable:true}
+ },
+ style: {
+ control: { type: "object" },table:{disable:true}
+ },
+ variant: {
+ control: "select",
+ options: ["small", "medium", "large"],table:{disable:true}
+ },
+ },
+};
+
+const Template = (args) => (
+
+);
+
+const commonArgs = {
+ variant: "",
+ className: "",
+ style: {},
+};
+
+export const Documentation = () => (
+
+);
+
+Documentation.storyName = "Docs";
+
+export const Small = Template.bind({});
+Small.args = {
+ ...commonArgs,
+ variant: "small",
+};
+
+export const Medium = Template.bind({});
+Medium.args = {
+ ...commonArgs,
+ variant: "medium",
+};
+
+export const Large = Template.bind({});
+Large.args = {
+ ...commonArgs,
+ variant: "large",
+};
+
+export const Custom = Template.bind({});
+Custom.args = {
+ ...commonArgs,
+ variant: "large",
+ style: {
+ border: "10px solid #0B4B66",
+ },
+};
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/Dropdown.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/Dropdown.stories.js
new file mode 100644
index 00000000..30589785
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/Dropdown.stories.js
@@ -0,0 +1,389 @@
+import React from "react";
+import Dropdown from "../Dropdown";
+import Iframe from "../Iframe";
+
+export default {
+ title: "Atoms/Single Select Dropdown",
+ component: Dropdown,
+ argTypes: {
+ t: { control: false, table: { disable: true } },
+ populators: { control: "object", table: { disable: true } },
+ inputRef: { control: false, table: { disable: true } },
+ label: { control: "text", table: { disable: true } },
+ onChange: { action: "onChange", table: { disable: true } },
+ value: { control: "text", table: { disable: true } },
+ errorStyle: { control: "object", table: { disable: true } },
+ disabled:{
+ control: "select",
+ options: ["Default", "Disabled"],
+ name: "State",
+ mapping: {
+ Default: false,
+ Disabled: true,
+ },
+ },
+ isSearchable: { control: "boolean", name: "Searchable" },
+ additionalWrapperClass: { control: "text", table: { disable: true } },
+ props: { control: "object", table: { disable: true } },
+ type: {
+ control: "select",
+ options: ["dropdown", "multiselectdropdown"],
+ table: { disable: true },
+ },
+ variant: {
+ control: "select",
+ options: [
+ "nesteddropdown",
+ "treedropdown",
+ "nestedtextdropdown",
+ "profiledropdown",
+ "profilenestedtext",
+ ],
+ table: { disable: true },
+ },
+ error: { table: { disable: true } },
+ description: { table: { disable: true } },
+ customSelector: { table: { disable: true } },
+ showArrow: { table: { disable: true } },
+ selected: { table: { disable: true } },
+ style: { table: { disable: true } },
+ option: { table: { disable: true } },
+ optionKey: { table: { disable: true } },
+ select: { table: { disable: true } },
+ optionsCustomStyle: { table: { disable: true } },
+ defaultValue: { table: { disable: true } },
+ name: { table: { disable: true } },
+ showIcon:{control:"boolean",name:"Icon"}
+ },
+};
+
+//mock options data
+const commonOptions = [
+ { code: "Option1", name: "Option1" },
+ { code: "Option2", name: "Option2" },
+ { code: "Option3", name: "Option3" },
+];
+//options with icons
+const optionsWithIcons = [
+ { code: "Option1", name: "Option1", icon: "Article" },
+ { code: "Option2", name: "Option2", icon: "Article" },
+ { code: "Option3", name: "Option3", icon: "Article" },
+];
+//options with profileIcon
+const optionsWithProfile = [
+ {
+ code: "Option1",
+ name: "Option1",
+ profileIcon:
+ "https://www.freeiconspng.com/uploads/am-a-19-year-old-multimedia-artist-student-from-manila--21.png",
+ },
+ {
+ code: "Option2",
+ name: "Option2",
+ profileIcon:
+ "https://www.freeiconspng.com/uploads/am-a-19-year-old-multimedia-artist-student-from-manila--21.png",
+ },
+ {
+ code: "Option3",
+ name: "Option3",
+ profileIcon:
+ "https://www.freeiconspng.com/uploads/am-a-19-year-old-multimedia-artist-student-from-manila--21.png",
+ },
+];
+//options with description
+const optionsWithNestedText = [
+ {
+ code: "Option1",
+ name: "Option1",
+ description:
+ "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna",
+ },
+ {
+ code: "Option2",
+ name: "Option2",
+ description:
+ "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna",
+ },
+ {
+ code: "Option3",
+ name: "Option3",
+ description:
+ "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna",
+ },
+];
+//options with description and icon
+const nestedTextOptionWithIcons = [
+ {
+ code: "Option1",
+ name: "Option1",
+ icon: "Article",
+ description:
+ "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna",
+ },
+ {
+ code: "Option2",
+ name: "Option2",
+ icon: "Article",
+ description:
+ "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna",
+ },
+ {
+ code: "Option3",
+ name: "Option3",
+ icon: "Article",
+ description:
+ "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna",
+ },
+];
+//options with description and profileIcon
+const nestedTextProfileOptions = [
+ {
+ code: "Option1",
+ name: "Option1",
+ description:
+ "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna",
+ profileIcon:
+ "https://www.freeiconspng.com/uploads/am-a-19-year-old-multimedia-artist-student-from-manila--21.png",
+ },
+ {
+ code: "Option2",
+ name: "Option2",
+ description:
+ "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna",
+ profileIcon:
+ "https://www.freeiconspng.com/uploads/am-a-19-year-old-multimedia-artist-student-from-manila--21.png",
+ },
+ {
+ code: "Option3",
+ name: "Option3",
+ description:
+ "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna",
+ profileIcon:
+ "https://www.freeiconspng.com/uploads/am-a-19-year-old-multimedia-artist-student-from-manila--21.png",
+ },
+];
+//nested options
+const nestedOptions = [
+ {
+ name: "Category A",
+ options: [
+ { code: "Category A.Option A", name: "Option A" },
+ { code: "Category A.Option B", name: "Option B" },
+ { code: "Category A.Option C", name: "Option C" },
+ ],
+ code: "Category A",
+ },
+ {
+ name: "Category B",
+ options: [
+ { code: "Category B.Option A", name: "Option A" },
+ { code: "Category B.Option 2", name: "Option 2" },
+ { code: "Category B.Option 3", name: "Option 3" },
+ ],
+ code: "Category B",
+ },
+];
+//nested options with icons
+const nestedOptionsWithIcons = [
+ {
+ name: "Category A",
+ options: [
+ { code: "Category A.Option A", name: "Option A", icon: "Article" },
+ { code: "Category A.Option B", name: "Option B", icon: "Article" },
+ { code: "Category A.Option C", name: "Option C", icon: "Article" },
+ ],
+ code: "Category A",
+ },
+ {
+ name: "Category B",
+ options: [
+ { code: "Category B.Option 1", name: "Option 1", icon: "Article" },
+ { code: "Category B.Option 2", name: "Option 2", icon: "Article" },
+ { code: "Category B.Option 3", name: "Option 3", icon: "Article" },
+ ],
+ code: "Category B",
+ },
+];
+//tree select options
+const treeDropdownOptions = [
+ {
+ name: "Category A",
+ options: [
+ {
+ code: "Category A.Option A",
+ name: "Option A",
+ options: [
+ { code: "Category A.Option A.Option 1", name: "Option 1" },
+ { code: "Category A.Option A.Option 2", name: "Option 2" },
+ ],
+ },
+ {
+ code: "Category A.Option B",
+ name: "Option B",
+ options: [
+ { code: "Category A.Option B.Option 1", name: "Option 1" },
+ { code: "Category A.Option B.Option 2", name: "Option 2" },
+ ],
+ },
+ ],
+ code: "Category A",
+ },
+ {
+ name: "Category B",
+ options: [
+ { code: "Category B.Option A", name: "Option A" },
+ {
+ code: "Category B.Option B",
+ name: "Option B",
+ options: [
+ { code: "Category B.Option B.Option 1", name: "Option 1" },
+ { code: "Category B.Option B.Option 2", name: "Option 2" },
+ ],
+ },
+ ],
+ code: "Category B",
+ },
+ {
+ name: "Category C",
+ options: [
+ { code: "Category C.Option A", name: "Option A" },
+ { code: "Category C.Option B", name: "Option B" },
+ ],
+ code: "Category C",
+ },
+];
+
+const getOptions = (variant, showIcon) => {
+ if (showIcon) {
+ switch (variant) {
+ case "nesteddropdown":
+ return nestedOptionsWithIcons;
+ case "treedropdown":
+ return treeDropdownOptions;
+ case "nestedtextdropdown":
+ return nestedTextOptionWithIcons;
+ case "profiledropdown":
+ return optionsWithProfile;
+ case "profilenestedtext":
+ return nestedTextProfileOptions;
+ default:
+ return optionsWithIcons;
+ }
+ } else {
+ switch (variant) {
+ case "nesteddropdown":
+ return nestedOptions;
+ case "treedropdown":
+ return treeDropdownOptions;
+ case "nestedtextdropdown":
+ return optionsWithNestedText;
+ case "profiledropdown":
+ return commonOptions;
+ case "profilenestedtext":
+ return optionsWithNestedText;
+ default:
+ return commonOptions;
+ }
+ }
+};
+
+const Template = (args) => {
+ const { showIcon, variant, ...rest } = args;
+ return (
+ {
+ args.onChange(e, "dropdown");
+ }}
+ />
+ );
+};
+
+const t = (key) => key;
+
+const commonArgs = {
+ t,
+ name: "genders",
+ defaultValue: "FEMALE",
+ optionsCustomStyle: {},
+ optionKey: "name",
+ showIcon: false,
+ isSearchable: true,
+ error: "",
+ inputRef: null,
+ label: "Select Option",
+ onChange: (e, name) => console.log("Selected value:", e, "Name:", name),
+ errorStyle: null,
+ disabled: "Default",
+ type: "dropdown",
+ additionalWrapperClass: "",
+ props: {
+ isLoading: false,
+ data: commonOptions,
+ },
+ description: "",
+};
+
+export const Documentation = () => (
+
+);
+
+Documentation.storyName = "Docs";
+Documentation.argTypes = {
+ disabled: { table: { disable: true } },
+ isSearchable: { table: { disable: true }},
+ showIcon:{table:{disable:true}}
+};
+
+export const Basic = Template.bind({});
+Basic.args = {
+ ...commonArgs,
+ type: "dropdown",
+};
+
+export const Categorical = Template.bind({});
+Categorical.args = {
+ ...commonArgs,
+ type: "dropdown",
+ name: "nestedoptions",
+ variant: "nesteddropdown",
+};
+
+export const NestedText = Template.bind({});
+NestedText.args = {
+ ...commonArgs,
+ type: "dropdown",
+ name: "nestedtextoptions",
+ variant: "nestedtextdropdown",
+};
+
+export const Profile = Template.bind({});
+Profile.args = {
+ ...commonArgs,
+ type: "dropdown",
+ name: "profiledropdown",
+ variant: "profiledropdown",
+};
+
+export const ProfileWithNestedText = Template.bind({});
+ProfileWithNestedText.args = {
+ ...commonArgs,
+ type: "dropdown",
+ name: "profiledropdown",
+ variant: "profilenestedtext",
+};
+
+export const TreeDropdown = Template.bind({});
+TreeDropdown.args = {
+ ...commonArgs,
+ type: "dropdown",
+ name: "treeoptions",
+ variant: "treedropdown",
+};
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/ErrorPanel.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/ErrorPanel.stories.js
new file mode 100644
index 00000000..95877fa1
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/ErrorPanel.stories.js
@@ -0,0 +1,107 @@
+import React from "react";
+import Panels from "../Panels";
+
+export default {
+ title: "Atoms/Panels/Error",
+ component: Panels,
+ argTypes: {
+ type: {
+ control: "select",
+ options: ["success", "error"],
+ table: { disable: true },
+ },
+ className: {
+ control: "text",
+ table: { disable: true },
+ },
+ message: {
+ control: "text",
+ table: { disable: true },
+ },
+ info: {
+ control: "text",
+ table: { disable: true },
+ },
+ response: {
+ control: "text",
+ table: { disable: true },
+ },
+ customIcon: {
+ control: "text",
+ table: { disable: true },
+ },
+ iconFill: {
+ control: "text",
+ table: { disable: true },
+ },
+ style: {
+ control: { type: "object" },
+ table: { disable: true },
+ },
+ multipleResponses: {
+ control: {
+ type: "array",
+ separator: ",",
+ },
+ table: { disable: true },
+ },
+ showAsSvg: {
+ control: "boolean",
+ name: "With Animation",
+ mapping: {
+ true: false,
+ false: true,
+ },
+ },
+ animationProps: {
+ control: { type: "object" },
+ table: { disable: true },
+ },
+ },
+};
+
+const Template = (args) => ;
+
+const commonArgs = {
+ className: "",
+ message: "Message",
+ type: "success",
+ info: "Description ",
+ response: "949749795479",
+ customIcon:"",
+ iconFill:"",
+ style: {},
+ showAsSvg:true,
+ multipleResponses:[],
+ animationProps:{
+ noAutoplay:false,
+ loop :false
+ }
+};
+
+export const Basic = Template.bind({});
+Basic.args = {
+ ...commonArgs,
+ type: "error",
+ message: "Error Message!",
+};
+
+export const WithAnimationProperties = Template.bind({});
+WithAnimationProperties.args = {
+ ...commonArgs,
+ type: "error",
+ message: "Error Message!",
+ animationProps:{
+ loop :true,
+ width:100,
+ height:100
+ }
+};
+
+export const WithMultipleResponses = Template.bind({});
+WithMultipleResponses.args = {
+ ...commonArgs,
+ type: "error",
+ message: "Success Message!",
+ multipleResponses:["949749795469","949749795579","949749795499"]
+};
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/ImageUpload.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/ImageUpload.stories.js
new file mode 100644
index 00000000..6059351b
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/ImageUpload.stories.js
@@ -0,0 +1,115 @@
+import React from "react";
+import FileUpload from "../FileUpload";
+
+export default {
+ title: "Atoms/FileUpload/Image Upload",
+ component: FileUpload,
+ argTypes: {
+ uploadedFiles: {
+ control: {
+ type: "object",
+ },
+ },
+ variant: {
+ control: {
+ type: "select",
+ options: ["uploadField", "uploadWidget", "uploadImage"],
+ },
+ },
+ showLabel: {
+ control: "boolean",
+ },
+ showHint: {
+ control: "boolean",
+ },
+ label: {
+ control: "text",
+ },
+ hintText: {
+ control: "text",
+ },
+ iserror: {
+ control: "text",
+ },
+ customClass: {
+ control: "text",
+ },
+ disabled: {
+ control: "boolean",
+ },
+ disableButton: {
+ control: "boolean",
+ },
+ buttonType: {
+ control: {
+ type: "select",
+ options: ["button", "submit", "reset"],
+ },
+ },
+ inputStyles: {
+ control: "object",
+ },
+ extraStyles: {
+ control: "object",
+ },
+ id: {
+ control: "text",
+ },
+ multiple: {
+ control: "boolean",
+ },
+ accept: {
+ control: "text",
+ },
+ showAsTags: {
+ control: "boolean",
+ },
+ showAsPreview: {
+ control: "boolean",
+ },
+ additionalElements: {
+ control: "array",
+ },
+ validations: {
+ control: "object",
+ },
+ showErrorCard: {
+ control: "boolean",
+ },
+ showReUploadButton: {
+ control: "boolean",
+ },
+ showDownloadButton: {
+ control: "boolean",
+ },
+ onUpload: {
+ control: "function",
+ },
+ },
+};
+
+const Template = (args) => ;
+
+export const SingleUpload = Template.bind({});
+SingleUpload.args = {
+ uploadedFiles: [],
+ variant: "uploadImage",
+};
+
+export const MultipleUpload = Template.bind({});
+MultipleUpload.args = {
+ uploadedFiles: [],
+ variant: "uploadImage",
+ multiple: true,
+};
+
+export const UploadMultipleImagesWithValidations = Template.bind({});
+UploadMultipleImagesWithValidations.args = {
+ uploadedFiles: [],
+ variant: "uploadImage",
+ multiple: true,
+ validations: {
+ maxSizeAllowedInMB: 5,
+ minSizeRequiredInMB: 1,
+ },
+};
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/LinkButton.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/LinkButton.stories.js
new file mode 100644
index 00000000..4674c70b
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/LinkButton.stories.js
@@ -0,0 +1,155 @@
+import React from "react";
+import Button from "../Button";
+
+export default {
+ title: "Atoms/Button/Link",
+ component: Button,
+ argTypes: {
+ label: {
+ control: "text",
+ name:"Label"
+ },
+ variation: {
+ control: "select",
+ options: ["primary", "secondary", "teritiary", "link"],
+ table: { disable: true },
+ },
+ size: { control: "select", options: ["large", "medium", "small"],name:"Size" },
+ className: {
+ control: "text",
+ table: { disable: true },
+ },
+ style: {
+ control: { type: "object" },
+ table: { disable: true },
+ },
+ onClick: {
+ control: "function",
+ table: { disable: true },
+ },
+ title: {
+ control: "text",
+ table: { disable: true },
+ },
+ isSearchable: {
+ control: "boolean",table: { disable: true },
+ },
+ showBottom: {
+ control: "select",
+ options: ["DropUp", "DropDown"],
+ name: "ActionButton",
+ mapping: {
+ DropUp: false,
+ DropDown: true,
+ },
+ table: { disable: true },
+ },
+ optionsKey: {
+ control: "text",
+ table: { disable: true },
+ },
+ options: {
+ control: {
+ type: "array",
+ separator: ",",
+ },
+ table: { disable: true },
+ },
+ isDisabled: {
+ control: "select",
+ options: ["Default", "Disabled"],
+ name: "State",
+ mapping: {
+ Default: false,
+ Disabled: true,
+ },
+ },
+ textStyles: { table: { disable: true } },
+ iconFill: { table: { disable: true } },
+ icon: { table: { disable: true } },
+ onOptionSelect: { table: { disable: true } },
+ type: { table: { disable: true } },
+ WithIcon: {
+ control: "boolean",
+ name:"With Icon"
+ },
+ isSuffix: {
+ control: "select",
+ options: ["Prefix", "Suffix"],
+ name: "Icon",
+ mapping: {
+ Prefix: false,
+ Suffix: true,
+ },
+ if: { arg: "WithIcon", truthy: true},
+ },
+ Width: {
+ control: "select",
+ options: ["Hug Content", "Justify"],
+ },
+ },
+};
+
+const commonStyles = {
+ position: "absolute",
+ top: "50%",
+ left: "50%",
+ color: "#363636",
+ display: "flex",
+ alignItems: "center",
+ justifyContent: "center",
+ transform: "translate(-50%, -50%)",
+};
+
+
+const Template = (args) => {
+ const { WithIcon, isSuffix, Width, ...restArgs } = args;
+
+ const widthStyles =
+ Width === "Hug Content"
+ ? { width: "auto", whiteSpace: "nowrap" }
+ : { width: "100%" };
+
+ return (
+
+
+
+ );
+};
+
+const commonArgs = {
+ label: "Button",
+ className: "custom-class",
+ style: {},
+ onClick: () => {
+ console.log("clicked");
+ },
+ isDisabled: "Default",
+ variation: "",
+ size: "large",
+ title: "",
+ iconFill: "",
+ options: [],
+ optionsKey: "",
+ WithIcon: false,
+ isSuffix: "Prefix",
+ isSearchable: false,
+ Width:"Hug Content",
+ showBottom:"DropDown"
+};
+
+// Button with link variantion
+export const Link = Template.bind({});
+Link.args = {
+ ...commonArgs,
+ variation: "link",
+ label: "Link",
+};
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/Loader.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/Loader.stories.js
new file mode 100644
index 00000000..42f1b79e
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/Loader.stories.js
@@ -0,0 +1,95 @@
+import React from "react";
+import Loader from "../Loader";
+import theLoaderPrimary from "../../constants/animations/theLoaderPrimary.json";
+import Iframe from "../Iframe";
+
+export default {
+ title: "Atoms/Loader",
+ component: Loader,
+ argTypes: {
+ variant: {
+ control: "select",
+ options: ["Basic", "PageLoader", "OverlayLoader"],
+ table:{disable:true}
+ },
+ className: {
+ control: "text",
+ table:{disable:true}
+ },
+ hideEllipsis: {
+ table:{disable:true}
+ },
+ style: {
+ control: { type: "object" },
+ table:{disable:true}
+ },
+ animationStyles: {
+ control: { type: "object" },
+ table:{disable:true}
+ },
+ loaderText: {
+ control: "text",
+ name:"Loader Text"
+ },
+ },
+};
+
+const Template = (args) => ;
+
+const commonArgs = {
+ className: "",
+ style: {},
+ variant: "Basic",
+ animationStyles: {},
+ loaderText:"Loading",
+ hideEllipsis:false
+};
+
+export const Documentation = () => (
+
+);
+
+Documentation.storyName = "Docs";
+Documentation.argTypes = {
+ loaderText: { table: { disable: true } },
+};
+
+export const Basic = Template.bind({});
+Basic.args = {
+ ...commonArgs,
+ variant: "Basic",
+};
+
+export const PageLoader = Template.bind({});
+PageLoader.args = {
+ ...commonArgs,
+ variant: "PageLoader",
+};
+
+export const OverlayLoader = Template.bind({});
+OverlayLoader.args = {
+ ...commonArgs,
+ variant: "OverlayLoader",
+};
+
+export const Custom = Template.bind({});
+Custom.args = {
+ ...commonArgs,
+ variant: "Basic",
+ style: {
+ width: "100%",
+ height: "300px",
+ alignItems: "center",
+ },
+ loaderText: "This page is loading",
+ animationStyles: {
+ width: "50px",
+ height: "50px",
+ animationData: theLoaderPrimary,
+ },
+ className: "custom-loader-example",
+};
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/MultiselectDropdown.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/MultiselectDropdown.stories.js
new file mode 100644
index 00000000..50d169ce
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/MultiselectDropdown.stories.js
@@ -0,0 +1,360 @@
+import React from "react";
+import MultiSelectDropdown from "../MultiSelectDropdown";
+import Iframe from "../Iframe";
+
+export default {
+ title: "Atoms/Multi Select DropDown",
+ component: MultiSelectDropdown,
+ argTypes: {
+ t: { control: false, table: { disable: true } },
+ populators: { control: "object", table: { disable: true } },
+ inputRef: { control: false, table: { disable: true } },
+ label: { control: "text", table: { disable: true } },
+ onSelect: { action: "onChange", table: { disable: true } },
+ onChange: { action: "onChange", table: { disable: true } },
+ value: { control: "text" },
+ errorStyle: { control: "object", table: { disable: true } },
+ disabled: {
+ control: "select",
+ options: ["Default", "Disabled"],
+ name: "State",
+ mapping: {
+ Default: false,
+ Disabled: true,
+ },
+ },
+ isSearchable: { control: "boolean", name: "Searchable" },
+ additionalWrapperClass: { control: "text" },
+ props: { control: "object" },
+ type: {
+ control: "select",
+ options: ["dropdown", "multiselectdropdown"],
+ table: { disable: true },
+ table: { disable: true },
+ },
+ variant: {
+ control: "select",
+ options: [
+ "nestedmultiselect",
+ "treemultiselect",
+ "nestedtextmultiselect",
+ ],
+ table: { disable: true },
+ },
+ value: { table: { disable: true } },
+ ServerStyle: { table: { disable: true } },
+ isPropsNeeded: { table: { disable: true } },
+ isOBPSMultiple: { table: { disable: true } },
+ BlockNumber: { table: { disable: true } },
+ defaultUnit: { table: { disable: true } },
+ defaultLabel: { table: { disable: true } },
+ selected: { table: { disable: true } },
+ options: { table: { disable: true } },
+ config: { table: { disable: true } },
+ description: { table: { disable: true } },
+ props: { table: { disable: true } },
+ additionalWrapperClass: { table: { disable: true } },
+ name: { table: { disable: true } },
+ defaultValue: { table: { disable: true } },
+ optionsKey: { table: { disable: true } },
+ error: { table: { disable: true } },
+ optionsCustomStyle: { table: { disable: true } },
+ addSelectAllCheck: { control: "boolean", name: "Select all" },
+ addCategorySelectAllCheck: {
+ control: "boolean",
+ name: "Category level select all",
+ },
+ selectAllLabel: { table: { disable: true } },
+ categorySelectAllLabel: { table: { disable: true } },
+ showIcon: { control: "boolean", name: "Icon" },
+ isDropdownWithChip: { control: "boolean", name: "With chips" },
+ chipsKey: { table: { disable: true } },
+ clearLabel: { table: { disable: true } },
+ },
+};
+
+//mock options data
+const commonOptions = [
+ { code: "Option1", name: "Option1" },
+ { code: "Option2", name: "Option2" },
+ { code: "Option3", name: "Option3" },
+];
+//options with icons
+const OptionsWithIcons = [
+ { code: "Option1", name: "Option1", icon: "Article" },
+ { code: "Option2", name: "Option2", icon: "Article" },
+ { code: "Option3", name: "Option3", icon: "Article" },
+];
+//options with description
+const OptionsWithNestedText = [
+ {
+ code: "Option1",
+ name: "Option1",
+ description:
+ "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna",
+ },
+ {
+ code: "Option2",
+ name: "Option2",
+ description:
+ "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna",
+ },
+ {
+ code: "Option3",
+ name: "Option3",
+ description:
+ "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna",
+ },
+];
+//options with description and icon
+const NestedTextOptionWithIcons = [
+ {
+ code: "Option1",
+ name: "Option1",
+ icon: "Article",
+ description:
+ "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna",
+ },
+ {
+ code: "Option2",
+ name: "Option2",
+ icon: "Article",
+ description:
+ "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna",
+ },
+ {
+ code: "Option3",
+ name: "Option3",
+ icon: "Article",
+ description:
+ "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna",
+ },
+];
+
+//nested options
+const nestedOptions = [
+ {
+ name: "Category A",
+ options: [
+ { code: "Category A.Option A", name: "Option A" },
+ { code: "Category A.Option B", name: "Option B" },
+ { code: "Category A.Option C", name: "Option C" },
+ ],
+ code: "Category A",
+ },
+ {
+ name: "Category B",
+ options: [
+ { code: "Category B.Option A", name: "Option A" },
+ { code: "Category B.Option 2", name: "Option 2" },
+ { code: "Category B.Option 3", name: "Option 3" },
+ ],
+ code: "Category B",
+ },
+];
+//nested options with icons
+const nestedOptionsWithIcons = [
+ {
+ name: "Category A",
+ options: [
+ { code: "Category A.Option A", name: "Option A", icon: "Article" },
+ { code: "Category A.Option B", name: "Option B", icon: "Article" },
+ { code: "Category A.Option C", name: "Option C", icon: "Article" },
+ ],
+ code: "Category A",
+ },
+ {
+ name: "Category B",
+ options: [
+ { code: "Category B.Option 1", name: "Option 1", icon: "Article" },
+ { code: "Category B.Option 2", name: "Option 2", icon: "Article" },
+ { code: "Category B.Option 3", name: "Option 3", icon: "Article" },
+ ],
+ code: "Category B",
+ },
+];
+//tree select options
+const treeDropdownOptions = [
+ {
+ name: "Category A",
+ options: [
+ {
+ code: "Category A.Option A",
+ name: "Option A",
+ options: [
+ { code: "Category A.Option A.Option 1", name: "Option 1" },
+ { code: "Category A.Option A.Option 2", name: "Option 2" },
+ ],
+ },
+ {
+ code: "Category A.Option B",
+ name: "Option B",
+ options: [
+ { code: "Category A.Option B.Option 1", name: "Option 1" },
+ { code: "Category A.Option B.Option 2", name: "Option 2" },
+ ],
+ },
+ ],
+ code: "Category A",
+ },
+ {
+ name: "Category B",
+ options: [
+ { code: "Category B.Option A", name: "Option A" },
+ {
+ code: "Category B.Option B",
+ name: "Option B",
+ options: [
+ { code: "Category B.Option B.Option 1", name: "Option 1" },
+ { code: "Category B.Option B.Option 2", name: "Option 2" },
+ ],
+ },
+ ],
+ code: "Category B",
+ },
+ {
+ name: "Category C",
+ options: [
+ { code: "Category C.Option A", name: "Option A" },
+ { code: "Category C.Option B", name: "Option B" },
+ ],
+ code: "Category C",
+ },
+];
+
+const getOptions = (variant, showIcon) => {
+ if (showIcon) {
+ switch (variant) {
+ case "nestedmultiselect":
+ return nestedOptionsWithIcons;
+ case "treemultiselect":
+ return treeDropdownOptions;
+ case "nestedtextmultiselect":
+ return NestedTextOptionWithIcons;
+ default:
+ return OptionsWithIcons;
+ }
+ } else {
+ switch (variant) {
+ case "nestedmultiselect":
+ return nestedOptions;
+ case "treemultiselect":
+ return treeDropdownOptions;
+ case "nestedtextmultiselect":
+ return OptionsWithNestedText;
+ default:
+ return commonOptions;
+ }
+ }
+};
+
+const Template = (args) => {
+ const { showIcon, variant, isDropdownWithChip, ...rest } = args;
+ console.log(isDropdownWithChip, "isDropdownWithChip");
+ let config = isDropdownWithChip
+ ? showIcon
+ ? { isDropdownWithChip: true, showIcon: true }
+ : { isDropdownWithChip: true }
+ : showIcon
+ ? { showIcon: true }
+ : {};
+ console.log(config, "config");
+ return (
+ {
+ args.onChange(e, "dropdown");
+ }}
+ config={config}
+ />
+ );
+};
+
+const t = (key) => key;
+
+const commonArgs = {
+ clearLabel: "Clear All",
+ addSelectAllCheck: false,
+ addCategorySelectAllCheck: false,
+ selectAllLabel: "",
+ categorySelectAllLabel: "",
+ chipsKey: "",
+ t,
+ name: "genders",
+ defaultValue: "FEMALE",
+ optionsCustomStyle: {},
+ optionsKey: "name",
+ showIcon: false,
+ isSearchable: true,
+ error: "",
+ inputRef: null,
+ label: "Select Option",
+ onChange: (e, name) => console.log("Selected value:", e, "Name:", name),
+ errorStyle: null,
+ disabled: "Default",
+ type: "multiselectdropdown",
+ additionalWrapperClass: "",
+ props: {
+ isLoading: false,
+ data: commonOptions,
+ },
+ description: "",
+ isDropdownWithChip: true,
+};
+
+export const Documentation = () => (
+
+);
+
+Documentation.storyName = "Docs";
+Documentation.argTypes = {
+ disabled: { table: { disable: true } },
+ isSearchable: { table: { disable: true } },
+ showIcon: { table: { disable: true } },
+ addSelectAllCheck: { table: { disable: true } },
+ addCategorySelectAllCheck: { table: { disable: true } },
+ isDropdownWithChip: { table: { disable: true } },
+};
+
+export const Basic = Template.bind({});
+Basic.args = {
+ ...commonArgs,
+ type: "multiselectdropdown",
+};
+
+export const Categorical = Template.bind({});
+Categorical.args = {
+ ...commonArgs,
+ type: "multiselectdropdown",
+ name: "nestedmultiselectoptions",
+ options: nestedOptions,
+ isDropdownWithChip: true,
+ variant: "nestedmultiselect",
+};
+
+export const NestedText = Template.bind({});
+NestedText.args = {
+ ...commonArgs,
+ type: "multiselectdropdown",
+ name: "nestedtextltiselect",
+ options: OptionsWithNestedText,
+ isDropdownWithChip: true,
+ variant: "nestedtextmultiselect",
+};
+
+export const TreeMultiselect = Template.bind({});
+TreeMultiselect.args = {
+ ...commonArgs,
+ type: "multiselectdropdown",
+ name: "treeoptions",
+ options: treeDropdownOptions,
+ isDropdownWithChip: true,
+ variant: "treemultiselect",
+};
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/OTPInput.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/OTPInput.stories.js
new file mode 100644
index 00000000..2f4096d6
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/OTPInput.stories.js
@@ -0,0 +1,105 @@
+import React, { useState } from "react";
+import OTPInput from "../OTPInput";
+import Iframe from "../Iframe";
+
+export default {
+ title: "Atoms/OTP Input",
+ component: OTPInput,
+ argTypes: {
+ className: {
+ control: "text",
+ table: { disable: true },
+ },
+ style: {
+ control: "object",
+ table: { disable: true },
+ },
+ inline: {
+ control: "select",
+ name:"Label Alignment",
+ options: ["Inline", "Above"],
+ mapping: { Inline: true, Above: false },
+ },
+ label: {
+ control: "text", name:"Label"
+ },
+ Error: {
+ control: "boolean",
+ },
+ type: {
+ control: "select",
+ name:"Type",
+ options: ["Alphanumeric", "Numeric"],
+ mapping: { Alphanumeric: "alphanumeric", Numeric: "numeric" },
+ },
+ length: {
+ control: "number",
+ table: { disable: true },
+ },
+ masking: {
+ control: "boolean",name:"Masking"
+ },
+ },
+};
+
+const Template = (args) => {
+ const {Error,...rest} = args;
+ const [otp, setOtp] = useState("");
+
+ const handleOtpChange = (value) => {
+ console.log(value,"value")
+ setOtp(value);
+ if (value.length === args.length) {
+ if (!Error) {
+ console.log("OTP is correct");
+ return null;
+ } else {
+ console.log("Invalid OTP");
+ return "Invalid OTP";
+ }
+ }
+ return null;
+ };
+
+ return ;
+};
+
+const commonArgs = {
+ length: 4,
+ type: "Alphanumeric",
+ inline: "Above",
+ label: "Enter OTP",
+ style:{},
+ Error:false,
+ masking:false
+};
+
+export const Documentation = () => (
+
+);
+
+Documentation.storyName = "Docs";
+Documentation.argTypes = {
+ inline: { table: { disable: true } },
+ label: { table: { disable: true }},
+ Error: {table:{disable:true}},
+ type: { table: { disable: true } },
+ masking: { table: { disable: true }},
+};
+
+export const SixCharacters = Template.bind({});
+SixCharacters.args = {
+ ...commonArgs,
+ length: 6,
+};
+SixCharacters.storyName = "6 Characters";
+
+export const FourCharacters = Template.bind({});
+FourCharacters.args = {
+ ...commonArgs,
+};
+FourCharacters.storyName = "4 Characters";
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/PanelDocs.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/PanelDocs.stories.js
new file mode 100644
index 00000000..0b060c99
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/PanelDocs.stories.js
@@ -0,0 +1,55 @@
+import React from "react";
+import Panels from "../Panels";
+import Iframe from "../Iframe";
+
+export default {
+ title: "Atoms/Panels",
+ component: Panels,
+ argTypes: {
+ type: { control: "select", options: ["success", "error"], table: { disable: true } },
+ className: {
+ control: "text", table: { disable: true }
+ },
+ message: {
+ control: "text", table: { disable: true }
+ },
+ info: {
+ control: "text", table: { disable: true }
+ },
+ response: {
+ control: "text", table: { disable: true }
+ },
+ customIcon: {
+ control: "text", table: { disable: true }
+ },
+ iconFill: {
+ control: "text", table: { disable: true }
+ },
+ style: {
+ control: { type: "object" }, table: { disable: true }
+ },
+ multipleResponses: {
+ control: {
+ type: "array",
+ separator: ",",
+ },
+ table: { disable: true }
+ },
+ showAsSvg: {
+ control: "boolean", table: { disable: true }
+ },
+ animationProps: {
+ control: { type: "object" }, table: { disable: true }
+ },
+ },
+};
+
+export const Documentation = () => (
+
+);
+
+Documentation.storyName = "Docs";
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/PrimaryButton.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/PrimaryButton.stories.js
new file mode 100644
index 00000000..7c217d5b
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/PrimaryButton.stories.js
@@ -0,0 +1,153 @@
+import React from "react";
+import Button from "../Button";
+
+export default {
+ title: "Atoms/Button/Primary",
+ component: Button,
+ argTypes: {
+ label: {
+ control: "text",
+ name:"Label"
+ },
+ variation: {
+ control: "select",
+ options: ["primary", "secondary", "teritiary", "link"],
+ table: { disable: true },
+ },
+ size: { control: "select", options: ["large", "medium", "small"],name:"Size" },
+ className: {
+ control: "text",
+ table: { disable: true },
+ },
+ style: {
+ control: { type: "object" },
+ table: { disable: true },
+ },
+ onClick: {
+ control: "function",
+ table: { disable: true },
+ },
+ title: {
+ control: "text",
+ table: { disable: true },
+ },
+ isSearchable: {
+ control: "boolean",table: { disable: true },
+ },
+ showBottom: {
+ control: "select",
+ options: ["DropUp", "DropDown"],
+ name: "ActionButton",
+ mapping: {
+ DropUp: false,
+ DropDown: true,
+ },
+ table: { disable: true },
+ },
+ optionsKey: {
+ control: "text",
+ table: { disable: true },
+ },
+ options: {
+ control: {
+ type: "array",
+ separator: ",",
+ },
+ table: { disable: true },
+ },
+ isDisabled: {
+ control: "select",
+ options: ["Default", "Disabled"],
+ name: "State",
+ mapping: {
+ Default: false,
+ Disabled: true,
+ },
+ },
+ textStyles: { table: { disable: true } },
+ iconFill: { table: { disable: true } },
+ icon: { table: { disable: true } },
+ onOptionSelect: { table: { disable: true } },
+ type: { table: { disable: true } },
+ WithIcon: {
+ control: "boolean",
+ name:"With Icon"
+ },
+ isSuffix: {
+ control: "select",
+ options: ["Prefix", "Suffix"],
+ name: "Icon",
+ mapping: {
+ Prefix: false,
+ Suffix: true,
+ },
+ if: { arg: "WithIcon", truthy: true},
+ },
+ Width: {
+ control: "select",
+ options: ["Hug Content", "Justify"],
+ },
+ },
+};
+
+const commonStyles = {
+ position: "absolute",
+ top: "50%",
+ left: "50%",
+ color: "#363636",
+ display: "flex",
+ alignItems: "center",
+ justifyContent: "center",
+ transform: "translate(-50%, -50%)",
+};
+
+const Template = (args) => {
+ const { WithIcon, isSuffix, Width, ...restArgs } = args;
+
+ const widthStyles =
+ Width === "Hug Content"
+ ? { width: "auto", whiteSpace: "nowrap" }
+ : { width: "100%" };
+
+ return (
+
+
+
+ );
+};
+
+const commonArgs = {
+ label: "Button",
+ className: "custom-class",
+ style: {},
+ onClick: () => {
+ console.log("clicked");
+ },
+ isDisabled: "Default",
+ variation: "",
+ size: "large",
+ title: "",
+ iconFill: "",
+ options: [],
+ optionsKey: "",
+ WithIcon: false,
+ isSuffix: "Prefix",
+ isSearchable: false,
+ showBottom: "DropDown",
+ Width: "Hug Content",
+};
+
+// Button with primary variantion
+export const Primary = Template.bind({});
+Primary.args = {
+ ...commonArgs,
+ variation: "primary",
+};
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/RadioButtons.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/RadioButtons.stories.js
new file mode 100644
index 00000000..ced829ef
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/RadioButtons.stories.js
@@ -0,0 +1,114 @@
+import React, { useState } from "react";
+import Iframe from "../Iframe";
+import RadioButtons from "../RadioButtons";
+
+export default {
+ title: "Atoms/Radio Button",
+ component: RadioButtons,
+ argTypes: {
+ optionsKey: {
+ control: "text",
+ table: { disable: true },
+ },
+ options: {
+ table: { disable: true },
+ },
+ inputRef: {
+ table: { disable: true },
+ },
+ errorStyle: {
+ table: { disable: true },
+ },
+ State: {
+ control: "select",
+ options: ["Default", "Disabled", "NonEditable"],
+ },
+ additionalWrapperClass: { control: "text", table: { disable: true } },
+ error: { control: "text", table: { disable: true } },
+ style: { control: "object", table: { disable: true } },
+ innerStyles: { control: "object", table: { disable: true } },
+ selectedOption: { table: { disable: true } },
+ onSelect: { action: "onChange", table: { disable: true } },
+ alignVertical: { table: { disable: true } },
+ isLabelFirst: {
+ control: "select",
+ name:"Alignment",
+ options:[
+ "Right","Left"
+ ],
+ mapping:{
+ Right:false,
+ Left:true
+ }
+ },
+ },
+};
+
+const commonStyles = {
+ position: "absolute",
+ top: "50%",
+ left: "50%",
+ color: "#363636",
+ display: "flex",
+ alignItems: "center",
+ justifyContent: "center",
+ transform: "translate(-50%, -50%)",
+};
+
+const Template = (args) => {
+ const { State, ...rest } = args;
+
+ const [selectedOption, setSelectedOption] = useState(
+ State === "NonEditable" ? "Option" : args.value
+ );
+
+ const handleSelectOption = (e) => {
+ const selectedValue = e.code;
+ if (selectedValue !== undefined) {
+ setSelectedOption(e);
+ }
+ };
+
+ return (
+
+
+
+ );
+};
+
+const commonArgs = {
+ optionsKey: "name",
+ options: [{ code: "Option", name: "Option" }],
+ inputRef: null,
+ errorStyle: null,
+ additionalWrapperClass: "",
+ error: "",
+ alignVertical: false,
+ isLabelFirst:"Right",
+ State: "Default",
+};
+
+export const Documentation = () => (
+
+);
+
+Documentation.storyName = "Docs";
+Documentation.argTypes = {
+ State: { table: { disable: true } },
+ isLabelFirst: { table: { disable: true }},
+};
+
+export const Basic = Template.bind({});
+Basic.args = {
+ ...commonArgs,
+};
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/SecondaryButton.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/SecondaryButton.stories.js
new file mode 100644
index 00000000..9825085d
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/SecondaryButton.stories.js
@@ -0,0 +1,154 @@
+import React from "react";
+import Button from "../Button";
+
+export default {
+ title: "Atoms/Button/Secondary",
+ component: Button,
+ argTypes: {
+ label: {
+ control: "text",
+ name:"Label"
+ },
+ variation: {
+ control: "select",
+ options: ["primary", "secondary", "teritiary", "link"],
+ table: { disable: true },
+ },
+ size: { control: "select", options: ["large", "medium", "small"],name:"Size" },
+ className: {
+ control: "text",
+ table: { disable: true },
+ },
+ style: {
+ control: { type: "object" },
+ table: { disable: true },
+ },
+ onClick: {
+ control: "function",
+ table: { disable: true },
+ },
+ title: {
+ control: "text",
+ table: { disable: true },
+ },
+ isSearchable: {
+ control: "boolean",table: { disable: true },
+ },
+ showBottom: {
+ control: "select",
+ options: ["DropUp", "DropDown"],
+ name: "ActionButton",
+ mapping: {
+ DropUp: false,
+ DropDown: true,
+ },
+ table: { disable: true },
+ },
+ optionsKey: {
+ control: "text",
+ table: { disable: true },
+ },
+ options: {
+ control: {
+ type: "array",
+ separator: ",",
+ },
+ table: { disable: true },
+ },
+ isDisabled: {
+ control: "select",
+ options: ["Default", "Disabled"],
+ name: "State",
+ mapping: {
+ Default: false,
+ Disabled: true,
+ },
+ },
+ textStyles: { table: { disable: true } },
+ iconFill: { table: { disable: true } },
+ icon: { table: { disable: true } },
+ onOptionSelect: { table: { disable: true } },
+ type: { table: { disable: true } },
+ WithIcon: {
+ control: "boolean",
+ name:"With Icon"
+ },
+ isSuffix: {
+ control: "select",
+ options: ["Prefix", "Suffix"],
+ name: "Icon",
+ mapping: {
+ Prefix: false,
+ Suffix: true,
+ },
+ if: { arg: "WithIcon", truthy: true},
+ },
+ Width: {
+ control: "select",
+ options: ["Hug Content", "Justify"],
+ },
+ },
+};
+
+const commonStyles = {
+ position: "absolute",
+ top: "50%",
+ left: "50%",
+ color: "#363636",
+ display: "flex",
+ alignItems: "center",
+ justifyContent: "center",
+ transform: "translate(-50%, -50%)",
+};
+
+const Template = (args) => {
+ const { WithIcon, isSuffix, Width, ...restArgs } = args;
+
+ const widthStyles =
+ Width === "Hug Content"
+ ? { width: "auto", whiteSpace: "nowrap" }
+ : { width: "100%" };
+
+ return (
+
+
+
+ );
+};
+
+const commonArgs = {
+ label: "Button",
+ className: "custom-class",
+ style: {},
+ onClick: () => {
+ console.log("clicked");
+ },
+ isDisabled: "Default",
+ variation: "",
+ size: "large",
+ title: "",
+ iconFill: "",
+ options: [],
+ optionsKey: "",
+ WithIcon: false,
+ isSuffix: "Prefix",
+ isSearchable: false,
+ showBottom:"DropDown",
+ Width:"Hug Content"
+};
+
+
+// Button with secondary variantion
+export const Secondary = Template.bind({});
+Secondary.args = {
+ ...commonArgs,
+ variation: "secondary",
+};
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/SelectionTag.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/SelectionTag.stories.js
new file mode 100644
index 00000000..40afa051
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/SelectionTag.stories.js
@@ -0,0 +1,142 @@
+import React from "react";
+import SelectionTag from "../SelectionTag";
+import Iframe from "../Iframe";
+
+export default {
+ title: "Atoms/Selection Tag",
+ component: SelectionTag,
+ argTypes: {
+ width: {
+ control: "select",
+ options: ["Fixed-Equal", "Custom"],
+ name: "Width",
+ mapping: {
+ "Fixed-Equal": undefined,
+ Custom: 300,
+ },
+ },
+ errorMessage: {
+ control: "check",
+ name: "Error",
+ options: ["Error"],
+ },
+ options: {
+ control: "object",
+ table: { disable: true },
+ },
+ onSelectionChanged: {
+ action: "selectionChanged",
+ table: { disable: true },
+ },
+ selected: {
+ control: {
+ type: "array",
+ separator: ",",
+ },
+ table: { disable: true },
+ },
+ allowMultipleSelection: {
+ control: "boolean",
+ table: { disable: true },
+ },
+ withContainer: {
+ control: "select",
+ options: ["Enable", "Disable"],
+ name: "Container",
+ mapping: {
+ Enable: true,
+ Disable: false,
+ },
+ },
+ WithIcon: {
+ control: "boolean",
+ },
+ isSuffix: {
+ control: "select",
+ options: ["Prefix", "Suffix"],
+ name: "Icon",
+ mapping: {
+ Prefix: false,
+ Suffix: true,
+ },
+ if: { arg: "WithIcon", truthy: true },
+ },
+ },
+};
+
+const commonStyles = {
+ position: "absolute",
+ top: "50%",
+ left: "50%",
+ color: "#363636",
+ display: "flex",
+ alignItems: "center",
+ justifyContent: "center",
+ transform: "translate(-50%, -50%)",
+};
+
+const prefixIconOptions = [
+ { name: "Option 1", code: "option1", prefixIcon: "Edit", suffixIcon: "" },
+ { name: "Option 2", code: "option2", prefixIcon: "Edit", suffixIcon: "" },
+ { name: "Option 3", code: "option3", prefixIcon: "Edit", suffixIcon: "" },
+];
+
+const suffixIconOptions = [
+ { name: "Option 1", code: "option1", prefixIcon: "", suffixIcon: "Edit" },
+ { name: "Option 2", code: "option2", prefixIcon: "", suffixIcon: "Edit" },
+ { name: "Option 3", code: "option3", prefixIcon: "", suffixIcon: "Edit" },
+];
+
+const Template = (args) => {
+ const {errorMessage,WithIcon,isSuffix,...rest} = args;
+ return (
+
+ 0 ? "Error Message" : ''} options={WithIcon ? isSuffix ? suffixIconOptions : prefixIconOptions : args.options}/>
+
+ );
+};
+
+const commonArgs = {
+ width: "Fixed-Equal",
+ errorMessage: "",
+ selected: [],
+ options: [
+ { name: "Option 1", code: "option1", prefixIcon: "", suffixIcon: "" },
+ { name: "Option 2", code: "option2", prefixIcon: "", suffixIcon: "" },
+ { name: "Option 3", code: "option3", prefixIcon: "", suffixIcon: "" },
+ ],
+ allowMultipleSelection: false,
+ onSelectionChanged: (selectedOptions) =>
+ console.log("Selected options:", selectedOptions),
+ withContainer: "Enable",
+ WithIcon:false,
+ isSuffix:"Prefix"
+};
+
+export const Documentation = () => (
+
+);
+
+Documentation.storyName = "Docs";
+Documentation.argTypes = {
+ width: { table: { disable: true } },
+ WithIcon: { table: { disable: true }},
+ errorMessage: { table: { disable: true }},
+ withContainer: {table: { disable: true } },
+ isSuffix: { table: { disable: true } },
+};
+
+export const SingleSelect = Template.bind({});
+SingleSelect.args = {
+ ...commonArgs,
+};
+
+export const MultiSelect = Template.bind({});
+MultiSelect.args = {
+ ...commonArgs,
+ allowMultipleSelection: true,
+};
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/Spacers.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/Spacers.stories.js
new file mode 100644
index 00000000..9745cea8
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/Spacers.stories.js
@@ -0,0 +1,100 @@
+import React from "react";
+import { Spacers as SpacersMain } from "../../constants/spacers/spacers";
+
+export default {
+ title: "Foundations",
+};
+
+const commonStyles = {
+ background: "#d6d5d4",
+ width: "100%",
+};
+
+const SpacersDisplay = () => {
+ const spacerKeys = [
+ "spacer1",
+ "spacer2",
+ "spacer3",
+ "spacer4",
+ "spacer5",
+ "spacer6",
+ "spacer7",
+ "spacer8",
+ "spacer9",
+ "spacer10",
+ "spacer11",
+ "spacer12",
+ ];
+
+ // Updated toTitleCase function
+ const toTitleCase = (str) => {
+ return str
+ .replace(/([a-z])([0-9]+)/i, "$1 $2") // Add space between the name and number
+ .split(/(?=[A-Z])/g) // Split based on capital letters
+ .map((word) => word.charAt(0).toUpperCase() + word.slice(1))
+ .join(" ");
+ };
+
+ return (
+
+
+ Spacers
+
+ {spacerKeys.map((spacerKey) => (
+
+
+
+
{`${toTitleCase(spacerKey)}`}
+
{`${`digitv2.spacers.${spacerKey}`}`}
+
+
{`${SpacersMain?.[spacerKey]}`}
+
+
+
+ ))}
+
+ );
+};
+
+export const Spacers = () => ;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/Stepper.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/Stepper.stories.js
new file mode 100644
index 00000000..95ae0c99
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/Stepper.stories.js
@@ -0,0 +1,101 @@
+import React, { useState } from "react";
+import Stepper from "../Stepper";
+import Iframe from "../Iframe";
+
+export default {
+ title: "Atoms/Stepper",
+ component: Stepper,
+ argTypes: {
+ config: { control: "object" ,table:{disable:true}},
+ inputRef: { control: false,table:{disable:true} },
+ onChange: { action: "onChange",table:{disable:true} },
+ props: { control: "object" ,table:{disable:true}},
+ populators: { control: "object",table:{disable:true} },
+ formData: { control: "object",table:{disable:true} },
+ onStepClick: { action: "onChange" ,table:{disable:true}},
+ totalSteps: { action: "number",name:"Number of steps" },
+ currentStep:{table:{disable:true}},
+ customSteps: { control: "object",table:{disable:true} },
+ direction: {
+ control: {
+ type: "select",
+ options: ["vertical", "horizontal"],
+ },
+ table:{disable:true}
+ },
+ style: { control: "object",table:{disable:true} },
+ activeSteps: { action: "number",name:"Number of active steps" },
+ hideDivider: { control: "boolean" ,name:'With Divider',mapping:{
+ true:false,
+ false:true
+ }},
+ },
+};
+
+const Template = (args) => {
+ const [currentStep, setCurrentStep] = useState(0);
+
+ const onStepClick = (step) => {
+ console.log("step", step);
+ setCurrentStep(step);
+ };
+
+ return (
+
+ );
+};
+
+const t = (key) => key;
+
+const commonArgs = {
+ populators: {
+ name: "stepper",
+ },
+ customSteps: {},
+ totalSteps: 5,
+ direction: "horizontal",
+ onStepClick: () => {},
+ style: {},
+ props: {
+ labelStyles: {},
+ },
+ activeSteps: 0,
+ hideDivider: true,
+};
+
+export const Documentation = () => (
+
+);
+
+Documentation.storyName = "Docs";
+Documentation.argTypes = {
+ totalSteps: { table: { disable: true } },
+ hideDivider: { table: { disable: true }},
+ activeSteps: {table:{disable:true}},
+};
+
+export const Horizontal = Template.bind({});
+Horizontal.args = {
+ ...commonArgs,
+};
+
+export const Vertical = Template.bind({});
+Vertical.args = {
+ ...commonArgs,
+ direction: "vertical",
+};
+
+// //With Active Steps stepper
+// export const WithIsActive = Template.bind({});
+// WithIsActive.args = {
+// ...commonArgs,
+// activeSteps: 3,
+// };
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/SuccessPanel.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/SuccessPanel.stories.js
new file mode 100644
index 00000000..6e816550
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/SuccessPanel.stories.js
@@ -0,0 +1,109 @@
+import React from "react";
+import Panels from "../Panels";
+
+export default {
+ title: "Atoms/Panels/Success",
+ component: Panels,
+ argTypes: {
+ type: {
+ control: "select",
+ options: ["success", "error"],
+ table: { disable: true },
+ },
+ className: {
+ control: "text",
+ table: { disable: true },
+ },
+ message: {
+ control: "text",
+ table: { disable: true },
+ },
+ info: {
+ control: "text",
+ table: { disable: true },
+ },
+ response: {
+ control: "text",
+ table: { disable: true },
+ },
+ customIcon: {
+ control: "text",
+ table: { disable: true },
+ },
+ iconFill: {
+ control: "text",
+ table: { disable: true },
+ },
+ style: {
+ control: { type: "object" },
+ table: { disable: true },
+ },
+ multipleResponses: {
+ control: {
+ type: "array",
+ separator: ",",
+ },
+ table: { disable: true },
+ },
+ showAsSvg: {
+ control: "boolean",
+ name: "With Animation",
+ mapping: {
+ true: false,
+ false: true,
+ },
+ },
+ animationProps: {
+ control: { type: "object" },
+ table: { disable: true },
+ },
+ },
+};
+
+const Template = (args) => {
+ return ;
+};
+const commonArgs = {
+ className: "",
+ message: "Message",
+ type: "success",
+ info: "Description",
+ response: "949749795479",
+ customIcon: "",
+ iconFill: "",
+ style: {},
+ showAsSvg: true,
+ multipleResponses: [],
+ animationProps: {
+ noAutoplay: false,
+ loop: false,
+ },
+};
+
+export const Basic = Template.bind({});
+Basic.args = {
+ ...commonArgs,
+ type: "success",
+ message: "Success Message!",
+};
+
+export const WithAnimationProperties = Template.bind({});
+WithAnimationProperties.args = {
+ ...commonArgs,
+ type: "success",
+ message: "Success Message!",
+ animationProps: {
+ ...commonArgs.animationProps,
+ loop: true,
+ width: 100,
+ height: 100,
+ },
+};
+
+export const WithMultipleResponses = Template.bind({});
+WithMultipleResponses.args = {
+ ...commonArgs,
+ type: "success",
+ message: "Success Message!",
+ multipleResponses: ["949749795469", "949749795579", "949749795499"],
+};
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/Switch.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/Switch.stories.js
new file mode 100644
index 00000000..b86a41f4
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/Switch.stories.js
@@ -0,0 +1,86 @@
+import React from "react";
+import Switch from "../Switch";
+import Iframe from "../Iframe";
+
+export default {
+ title: "Atoms/Switch",
+ component: Switch,
+ argTypes: {
+ isLabelFirst: {
+ control: "select",
+ name: "Label Alignment",
+ options: ["Left", "Right"],
+ mapping: {
+ Left: true,
+ Right: false,
+ },
+ },
+ label: {
+ control: "boolean",
+ name: "Label",
+ mapping: {
+ true: "Label",
+ false: "",
+ },
+ },
+ shapeOnOff: { control: "boolean", table: { disable: true } },
+ isCheckedInitially: { control: "boolean", table: { disable: true } },
+ onToggle: { action: "onToggle", table: { disable: true } },
+ className: { control: "text", table: { disable: true } },
+ style: { control: "object", table: { disable: true } },
+ switchStyle: { control: "object", table: { disable: true } },
+ disable: {
+ control: "select",
+ name: "State",
+ options: ["Default", "Disabled"],
+ },
+ },
+};
+
+const Template = (args) => {
+ const {disable,...rest} = args;
+
+ return ;
+};
+
+export const Documentation = () => (
+
+);
+
+Documentation.storyName = "Docs";
+Documentation.argTypes = {
+ disable: { table: { disable: true } },
+ label: { table: { disable: true }},
+ isLabelFirst: { table: { disable: true }},
+};
+
+const commonArgs = {
+ isLabelFirst: "Right",
+ shapeOnOff: false,
+ label: false,
+ isCheckedInitially: false,
+ disable:"Default"
+};
+
+export const Basic = Template.bind({});
+Basic.args = {
+ ...commonArgs,
+};
+
+export const WithSymbol = Template.bind({});
+WithSymbol.args = {
+ ...commonArgs,
+ shapeOnOff: true,
+};
+
+export const Custom = Template.bind({});
+Custom.args = {
+ ...commonArgs,
+ switchStyle: {
+ backgroundColor: "green",
+ },
+};
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/Tab.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/Tab.stories.js
new file mode 100644
index 00000000..e1229ca0
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/Tab.stories.js
@@ -0,0 +1,126 @@
+import React, { useState } from "react";
+import Tab from "../Tab";
+import Iframe from "../Iframe";
+
+export default {
+ title: "Atoms/Tab",
+ component: Tab,
+ argTypes: {
+ configNavItems: { control: "object", table: { disable: true } },
+ activeLink: { control: "text", table: { disable: true } },
+ configItemKey: { control: "text", table: { disable: true } },
+ setActiveLink: { action: "setActiveLink", table: { disable: true } },
+ showNav: { control: "boolean", table: { disable: true } },
+ style: { control: "object", table: { disable: true } },
+ className: { control: "text", table: { disable: true } },
+ inFormComposer: { control: "boolean", table: { disable: true } },
+ navClassName: { control: "text", table: { disable: true } },
+ navStyles: { control: "object", table: { disable: true } },
+ itemStyle: { control: "object", table: { disable: true } },
+ items: { table: { disable: true } },
+ onTabClick: { action: "onChange", table: { disable: true } },
+ WithIcons: { control: "boolean" },
+ Tab1Label: { control: "text", name: "Tab 1 Label" },
+ Tab2Label: { control: "text", name: "Tab 2 Label" },
+ Tab3Label: { control: "text", name: "Tab 3 Label" },
+ Tab4Label: { control: "text", name: "Tab 4 Label" },
+ },
+};
+
+const commonStyles = {
+ position: "absolute",
+ top: "50%",
+ left: "50%",
+ color: "#363636",
+ display: "flex",
+ alignItems: "center",
+ justifyContent: "center",
+ transform: "translate(-50%, -50%)",
+};
+
+const exampleItems = [
+ { name: "Tab 1", code: "Tab 1" },
+ { name: "Tab 2", code: "Tab 2" },
+ { name: "Tab 3", code: "Tab 3" },
+ { name: "Tab 4", code: "Tab 4" },
+];
+
+const exampleItemsWithIcons = [
+ { name: "Tab 1", code: "Tab 1", icon: "Home" },
+ { name: "Tab 2", code: "Tab 2", icon: "MyLocation" },
+ { name: "Tab 3", code: "Tab 3", icon: "Article" },
+ { name: "Tab 4", code: "Tab 4", icon: "AccountCircle" },
+];
+
+const Template = (args) => {
+ const { WithIcons, ...rest } = args;
+ const [activeLink, setActiveLink] = useState(args.activeLink);
+
+ // Dynamic configNavItems update
+ const configNavItems = WithIcons
+ ? [...exampleItemsWithIcons]
+ : [...exampleItems];
+ configNavItems[0].code = args.Tab1Label && args.Tab1Label !=="" ? args.Tab1Label : configNavItems[0].code;
+ configNavItems[1].code = args.Tab2Label && args.Tab2Label!=="" ? args.Tab2Label : configNavItems[1].code;
+ configNavItems[2].code = args.Tab3Label && args.Tab3Label!=="" ? args.Tab3Label : configNavItems[2].code;
+ configNavItems[3].code = args.Tab4Label && args.Tab4Label!=="" ? args.Tab4Label : configNavItems[3].code;
+
+ return (
+
+
+
+ );
+};
+
+export const Documentation = () => (
+
+);
+
+Documentation.storyName = "Docs";
+Documentation.argTypes = {
+ WithIcons: { table: { disable: true } },
+ Tab1Label: { table: { disable: true }},
+ Tab2Label: { table: { disable: true }},
+ Tab3Label: {table: { disable: true } },
+ Tab4Label: { table: { disable: true } },
+};
+
+const commonArgs = {
+ activeLink: "Tab 2",
+ showNav: true,
+ style: {},
+ className: "",
+ navClassName: "",
+ configItemKey: "code",
+ navStyles: {},
+ onTabClick: (item) => {
+ console.log(item);
+ },
+ itemStyle: {},
+ WithIcons: false,
+ Tab1Label: "",
+ Tab2Label: "",
+ Tab3Label: "",
+ Tab4Label: "",
+};
+
+export const Basic = Template.bind({});
+Basic.args = {
+ ...commonArgs,
+};
+
+export const Custom = Template.bind({});
+Custom.args = {
+ ...Basic.args,
+ style: { backgroundColor: "#FFFFFF" },
+ itemStyle: { backgroundColor: "#FAFAFA", border: "1px solid black" },
+};
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/Tag.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/Tag.stories.js
new file mode 100644
index 00000000..e616942e
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/Tag.stories.js
@@ -0,0 +1,154 @@
+import React from "react";
+import Tag from "../Tag";
+import Iframe from "../Iframe";
+
+export default {
+ title: "Atoms/Tag",
+ component: Tag,
+ argTypes: {
+ className: {
+ control: "text",
+ table: { disable: true },
+ },
+ iconClassName: {
+ control: "text",
+ table: { disable: true },
+ },
+ label: {
+ control: "text",
+ name: "Label",
+ },
+ style: {
+ control: { type: "object" },
+ table: { disable: true },
+ },
+ labelStyle: {
+ control: { type: "object" },
+ table: { disable: true },
+ },
+ stroke: {
+ control: "check",
+ name: "Stroke",
+ options: ["Enable"],
+ },
+ type: {
+ control: "select",
+ options: ["monochrome", "success", "warning", "error"],
+ table: { disable: true },
+ },
+ alignment: {
+ control: "select",
+ options: ["center", "left", "right"],
+ table: { disable: true },
+ },
+ icon: {
+ control: "text",
+ table: { disable: true },
+ },
+ showIcon: {
+ control: "check",
+ name: "Icon",
+ options: ["Enable"],
+ },
+ iconColor: {
+ table: { disable: true },
+ },
+ onClick: {
+ control: "check",
+ name: "Clickable",
+ options: ["Enable"],
+ },
+ },
+};
+
+const commonStyles = {
+ position: "absolute",
+ top: "50%",
+ left: "50%",
+ color: "#363636",
+ display: "flex",
+ alignItems: "center",
+ justifyContent: "center",
+ transform: "translate(-50%, -50%)",
+};
+
+const Template = (args) => {
+ const { stroke, showIcon, onClick, ...rest } = args;
+ return (
+
+ 0 ? true : false}
+ showIcon={showIcon?.length > 0 ? true : false}
+ onClick={
+ onClick?.length > 0
+ ? (e) => {
+ console.log(e);
+ }
+ : undefined
+ }
+ />
+
+ );
+};
+
+const commonArgs = {
+ label: "Tag",
+ className: "",
+ style: {},
+ stroke: "",
+ type: "monochrome",
+ icon: "",
+ showIcon: "",
+ labelStyle: {},
+};
+
+export const Documentation = () => (
+
+);
+
+Documentation.storyName = "Docs";
+Documentation.argTypes = {
+ label: { table: { disable: true } },
+ stroke: { table: { disable: true }},
+ onClick: { table: { disable: true }},
+ showIcon: {table: { disable: true } },
+};
+
+export const Basic = Template.bind({});
+Basic.args = {
+ ...commonArgs,
+ type: "monochrome",
+};
+
+export const Success = Template.bind({});
+Success.args = {
+ ...commonArgs,
+ type: "success",
+};
+
+export const Error = Template.bind({});
+Error.args = {
+ ...commonArgs,
+ type: "error",
+};
+export const Warning = Template.bind({});
+Warning.args = {
+ ...commonArgs,
+ type: "warning",
+};
+export const Custom = Template.bind({});
+Custom.args = {
+ ...commonArgs,
+ style: {
+ width: "600px",
+ },
+ labelStyle: {
+ color: "#0B4B66",
+ },
+ icon: "ArrowLeft",
+};
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/TeritiaryButton.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/TeritiaryButton.stories.js
new file mode 100644
index 00000000..cf3856c8
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/TeritiaryButton.stories.js
@@ -0,0 +1,152 @@
+import React from "react";
+import Button from "../Button";
+
+export default {
+ title: "Atoms/Button/Teritiary",
+ component: Button,
+ argTypes: {
+ label: {
+ control: "text",
+ name:"Label"
+ },
+ variation: {
+ control: "select",
+ options: ["primary", "secondary", "teritiary", "link"],
+ table: { disable: true },
+ },
+ size: { control: "select", options: ["large", "medium", "small"],name:"Size" },
+ className: {
+ control: "text",
+ table: { disable: true },
+ },
+ style: {
+ control: { type: "object" },
+ table: { disable: true },
+ },
+ onClick: {
+ control: "function",
+ table: { disable: true },
+ },
+ title: {
+ control: "text",
+ table: { disable: true },
+ },
+ isSearchable: {
+ control: "boolean",table: { disable: true },
+ },
+ showBottom: {
+ control: "select",
+ options: ["DropUp", "DropDown"],
+ name: "ActionButton",
+ mapping: {
+ DropUp: false,
+ DropDown: true,
+ },
+ table: { disable: true },
+ },
+ optionsKey: {
+ control: "text",
+ table: { disable: true },
+ },
+ options: {
+ control: {
+ type: "array",
+ separator: ",",
+ },
+ table: { disable: true },
+ },
+ isDisabled: {
+ control: "select",
+ options: ["Default", "Disabled"],
+ name: "State",
+ mapping: {
+ Default: false,
+ Disabled: true,
+ },
+ },
+ textStyles: { table: { disable: true } },
+ iconFill: { table: { disable: true } },
+ icon: { table: { disable: true } },
+ onOptionSelect: { table: { disable: true } },
+ type: { table: { disable: true } },
+ WithIcon: {
+ control: "boolean",
+ },
+ isSuffix: {
+ control: "select",
+ options: ["Prefix", "Suffix"],
+ name: "Icon",
+ mapping: {
+ Prefix: false,
+ Suffix: true,
+ },
+ if: { arg: "WithIcon", truthy: true},
+ },
+ Width: {
+ control: "select",
+ options: ["Hug Content", "Justify"],
+ },
+ },
+};
+
+const commonStyles = {
+ position: "absolute",
+ top: "50%",
+ left: "50%",
+ color: "#363636",
+ display: "flex",
+ alignItems: "center",
+ justifyContent: "center",
+ transform: "translate(-50%, -50%)",
+};
+
+const Template = (args) => {
+ const { WithIcon, isSuffix, Width, ...restArgs } = args;
+
+ const widthStyles =
+ Width === "Hug Content"
+ ? { width: "auto", whiteSpace: "nowrap" }
+ : { width: "100%" };
+
+ return (
+
+
+
+ );
+};
+
+const commonArgs = {
+ label: "Button",
+ className: "custom-class",
+ style: {},
+ onClick: () => {
+ console.log("clicked");
+ },
+ isDisabled: "Default",
+ variation: "",
+ size: "large",
+ title: "",
+ iconFill: "",
+ options: [],
+ optionsKey: "",
+ WithIcon: false,
+ isSuffix: "Prefix",
+ isSearchable: false,
+ showBottom:"DropDown",
+ Width:"Hug Content"
+};
+
+// Button with Teritiary variantion
+export const Teritiary = Template.bind({});
+Teritiary.args = {
+ ...commonArgs,
+ variation: "teritiary",
+};
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/TextBlock.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/TextBlock.stories.js
new file mode 100644
index 00000000..4282704b
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/TextBlock.stories.js
@@ -0,0 +1,104 @@
+import React from "react";
+import TextBlock from "../TextBlock";
+import Iframe from "../Iframe";
+
+export default {
+ title: "Atoms/Text Block",
+ component: TextBlock,
+ argTypes: {
+ headerContentClassName: {
+ table: { disable: true },
+ },
+ headerClassName: {
+ table: { disable: true },
+ },
+ captionClassName: {
+ table: { disable: true },
+ },
+ subHeaderClassName: {
+ table: { disable: true },
+ },
+ bodyClassName: {
+ table: { disable: true },
+ },
+ wrapperClassName: {
+ table: { disable: true },
+ },
+ style: {
+ table: { disable: true },
+ },
+ caption: {
+ control: "boolean",name:"Caption"
+ },
+ header: {
+ control: "boolean",name:"Heading"
+ },
+ subHeader: {
+ control: "boolean",name:"Subheading"
+ },
+ body: {
+ control: "boolean",name:"Body"
+ },
+ },
+};
+
+const Template = (args) => {
+ const { caption, body, header, subHeader, ...rest } = args;
+ return (
+
+ );
+};
+
+export const Documentation = () => (
+
+);
+
+Documentation.storyName = "Docs";
+Documentation.argTypes = {
+ caption: { table: { disable: true } },
+ header: { table: { disable: true }},
+ subHeader: {table:{disable:true}},
+ body: {table:{disable:true}},
+};
+
+const commonArgs = {
+ headerContentClassName: "",
+ caption: true,
+ captionClassName: "",
+ header: true,
+ headerClassName: "",
+ subHeader: true,
+ subHeaderClassName: "",
+ body: true,
+ bodyClassName: "",
+};
+
+export const Basic = Template.bind({});
+Basic.args = {
+ ...commonArgs,
+};
+
+export const Custom = Template.bind({});
+Custom.args = {
+ ...commonArgs,
+ style:{
+ border:"1px solid black",
+ padding:"24px",
+ backgroundColor:"#fafafa",
+ textColor:"red"
+ }
+};
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/TextInput.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/TextInput.stories.js
new file mode 100644
index 00000000..c9513cfb
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/TextInput.stories.js
@@ -0,0 +1,231 @@
+import React, { useState, useEffect } from "react";
+import FieldV1 from "../../hoc/FieldV1";
+import Iframe from "../Iframe";
+
+export default {
+ title: "Atoms/Text Input",
+ component: FieldV1,
+ argTypes: {
+ type: {
+ control: {
+ type: "select",
+ options: [
+ "text",
+ "date",
+ "time",
+ "geolocation",
+ "numeric",
+ "password",
+ "search",
+ "textarea",
+ "number",
+ "mobileNumber",
+ ],
+ },
+ table: { disable: true },
+ },
+ config: { table: { disable: true } },
+ populators: { table: { disable: true } },
+ disabled: { control: "boolean", table: { disable: true } },
+ nonEditable: { control: "boolean", table: { disable: true } },
+ charCount: { control: "boolean", name: "Enable Character Count" },
+ onChange: { action: "onChange", table: { disable: true } },
+ placeholder: { control: "text", name: "Inner Label" },
+ description: { control: "text", name: "Help Text" },
+ required: { control: "boolean", name: "Mandatory" },
+ label: { control: "text", name: "Label" },
+ error: { control: "text", name: "Error" },
+ infoMessage: { control: "text", name: "Tooltip" },
+ State: {
+ control: "select",
+ options: ["Default", "Disabled", "NonEditable"],
+ },
+ withoutLabel: { table: { disable: true } },
+ value: { table: { disable: true } },
+ inline: { table: { disable: true } },
+ props: { table: { disable: true } },
+ },
+};
+
+const Template = (args) => {
+ const { State, ...rest } = args;
+ const [value, setValue] = useState(args.value || "");
+ const [type, setType] = useState(args.type || "");
+
+ useEffect(() => {
+ setValue(args.value || "");
+ }, [args.type]);
+
+ useEffect(() => {
+ setType(args.type || "");
+ }, [args.type]);
+
+ const handleInputChange = (event) => {
+ if (event?.target) {
+ const newValue = event?.target?.value;
+ setValue(newValue);
+ args.onChange({ ...event, target: { ...event.target, value: newValue } });
+ } else {
+ const newValue = event;
+ setValue(newValue);
+ }
+ };
+
+ return (
+
+ );
+};
+
+const commonArgs = {
+ type: "text",
+ config: {
+ step: "",
+ },
+ populators: {
+ prefix: "",
+ suffix: "",
+ allowNegativeValues: true,
+ customIcon: "",
+ validation: {
+ maxlength: "",
+ minlength: "",
+ },
+ resizeSmart: false,
+ disableTextField: false,
+ },
+ error: "",
+ label: "Label",
+ disabled: false,
+ nonEditable: false,
+ placeholder: "Inner label",
+ required: true,
+ description: "Help Text",
+ charCount: true,
+ withoutLabel: false,
+ infoMessage: "Tooltip",
+ State: "Default",
+};
+
+export const Documentation = () => (
+
+);
+
+Documentation.storyName = "Docs";
+Documentation.argTypes = {
+ label: { table: { disable: true } },
+ error: { table: { disable: true }},
+ placeholder: {table:{disable:true}},
+ description: {table:{disable:true}},
+ charCount: {table:{disable:true}},
+ required: {table:{disable:true}},
+ infoMessage: {table:{disable:true}},
+ State: {table:{disable:true}},
+};
+
+export const SimpleText = Template.bind({});
+SimpleText.args = {
+ ...commonArgs,
+ populators: {
+ ...commonArgs.populators,
+ },
+};
+
+export const TextWithPrefix = Template.bind({});
+TextWithPrefix.args = {
+ ...commonArgs,
+ populators: {
+ ...commonArgs.populators,
+ prefix: "$",
+ },
+};
+
+export const TextWithSuffix = Template.bind({});
+TextWithSuffix.args = {
+ ...commonArgs,
+ populators: {
+ ...commonArgs.populators,
+ suffix: "Rs",
+ },
+};
+
+export const TextArea = Template.bind({});
+TextArea.args = {
+ ...commonArgs,
+ type: "textarea",
+ populators: {
+ ...commonArgs.populators,
+ },
+};
+
+export const Password = Template.bind({});
+Password.args = {
+ ...commonArgs,
+ type: "password",
+ populators: {
+ ...commonArgs.populators,
+ },
+};
+
+export const NumericCounter = Template.bind({});
+NumericCounter.args = {
+ ...commonArgs,
+ type: "numeric",
+ populators: {
+ ...commonArgs.populators,
+ },
+};
+
+export const Date = Template.bind({});
+Date.args = {
+ ...commonArgs,
+ type: "date",
+ populators: {
+ ...commonArgs.populators,
+ },
+};
+
+export const Time = Template.bind({});
+Time.args = {
+ ...commonArgs,
+ type: "time",
+ populators: {
+ ...commonArgs.populators,
+ },
+};
+
+export const Location = Template.bind({});
+Location.args = {
+ ...commonArgs,
+ type: "geolocation",
+ populators: {
+ ...commonArgs.populators,
+ },
+};
+
+export const Search = Template.bind({});
+Search.args = {
+ ...commonArgs,
+ type: "search",
+ populators: {
+ ...commonArgs.populators,
+ },
+};
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/Timeline.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/Timeline.stories.js
new file mode 100644
index 00000000..92777418
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/Timeline.stories.js
@@ -0,0 +1,179 @@
+import React from "react";
+import Timeline from "../Timeline";
+import Button from "../Button";
+import Iframe from "../Iframe";
+
+export default {
+ title: "Atoms/Timeline",
+ component: Timeline,
+ argTypes: {
+ label: { control: "text", name: "Label" },
+ className: { control: "text", table: { disable: true } },
+ viewDetailsLabel: { control: "text", table: { disable: true } },
+ hideDetailsLabel: { control: "text", table: { disable: true } },
+ subElements: {
+ control: "boolean",
+ name: "With Subelements",
+ },
+ variant: {
+ control: {
+ type: "select",
+ options: ["upcoming", "inprogress", "completed"],
+ },
+ table: { disable: true },
+ },
+ additionalElements: {
+ control: "boolean",
+ name: "With Additional Widgets",
+ },
+ inline: {
+ control: "select",
+ name: "Elements Alignment",
+ options: ["vertical", "inline"],
+ mapping: {
+ inline: true,
+ vertical: false,
+ },
+ },
+ individualElementStyles: {
+ control: { type: "object" },
+ table: { disable: true },
+ },
+ showConnector: {
+ control: "boolean",
+ name: "With Connector",
+ },
+ showDefaultValueForDate: {
+ control: { type: "boolean" },
+ table: { disable: true },
+ },
+ initialVisibleAdditionalElementsCount: {
+ control: { type: "number" },
+ table: { disable: true },
+ },
+ isError:{control:"select",name:"State",options:["Default","Failed"],mapping:{"Default":false,"Failed":true}}
+ },
+};
+
+const additionalElementsToShow = [
+
+ Lorem Ipsum is simply dummy text of the printing and typesetting industry.
+ Lorem Ipsum has been the industry's
+
,
+ ,
+ ,
+ ,
+ ,
+ ,
+ ,
+ ,
+ ,
+ ,
+ ,
+];
+
+const subElementsToShow = [
+ "26 / 03 / 2024",
+ "11:00 PM",
+ "26 / 03 / 2024 11:00 PM",
+ "26 / 03 / 2024 11:00 PM Mon",
+ "+91 **********",
+];
+
+const Template = (args) => {
+ const { subElements, additionalElements, ...rest } = args;
+ return (
+
+ );
+};
+
+export const Documentation = () => (
+
+);
+
+Documentation.storyName = "Docs";
+Documentation.argTypes = {
+ label: { table: { disable: true } },
+ subElements: { table: { disable: true }},
+ inline: {table:{disable:true}},
+ showConnector: {table:{disable:true}},
+ isError: {table:{disable:true}},
+ additionalElements: {table:{disable:true}},
+};
+
+const commonArgs = {
+ label: "Inprogress",
+ subElements: false,
+ variant: "inprogress",
+ inline: "vertical",
+ showConnector: false,
+ additionalElements: false,
+ isError:"Default",
+ initialVisibleAdditionalElementsCount: additionalElementsToShow.length - 3,
+};
+
+export const InProgress = Template.bind({});
+InProgress.args = {
+ ...commonArgs,
+};
+
+export const Completed = Template.bind({});
+Completed.args = {
+ ...commonArgs,
+ label: "Completed",
+ variant: "completed",
+};
+
+export const Upcoming = Template.bind({});
+Upcoming.args = {
+ ...commonArgs,
+ label: "Upcoming",
+ variant: "upcoming",
+};
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/Toast.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/Toast.stories.js
new file mode 100644
index 00000000..a480cbd5
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/Toast.stories.js
@@ -0,0 +1,111 @@
+import React, { useState, Fragment, useEffect } from "react";
+import Toast from "../Toast";
+import Button from "../Button";
+import Iframe from "../Iframe";
+
+export default {
+ title: "Atoms/Toast",
+ component: Toast,
+ argTypes: {
+ populators: { control: "object" },
+ label: { control: "text" },
+ type: {
+ control: "select",
+ options: ["success", "warning", "error", "info"],
+ },
+ },
+};
+
+const Template = (args) => (
+
+
+
+);
+
+const commonArgs = {
+ populators: {
+ name: "toast",
+ },
+ label: "",
+ type: "success",
+ style: { left: "25%" },
+};
+
+export const Documentation = () => (
+
+);
+
+Documentation.storyName = "Docs";
+
+export const SuccessToast = Template.bind({});
+SuccessToast.args = {
+ ...commonArgs,
+ label: "Success Toast Message",
+ type: "success",
+};
+
+export const WarningToast = Template.bind({});
+WarningToast.args = {
+ ...commonArgs,
+ label: "Warning Toast Message",
+ type: "warning",
+};
+
+export const ErrorToast = Template.bind({});
+ErrorToast.args = {
+ ...commonArgs,
+ label: "Error Toast Message",
+ type: "error",
+};
+
+export const InfoToast = Template.bind({});
+InfoToast.args = {
+ ...commonArgs,
+ label: "Info Toast Message",
+ type: "info",
+};
+
+export const SuccessToastWithTransitionTime = Template.bind({});
+SuccessToastWithTransitionTime.args = {
+ ...commonArgs,
+ label: "Success Toast Message",
+ type: "success",
+ transitionTime: 600000,
+};
+
+export const WarningToastWithTransitionTime = Template.bind({});
+WarningToastWithTransitionTime.args = {
+ ...commonArgs,
+ label: "Warning Toast Message",
+ type: "warning",
+ transitionTime: 600000,
+};
+
+export const ErrorToastWithTrnasitionTime = Template.bind({});
+ErrorToastWithTrnasitionTime.args = {
+ ...commonArgs,
+ label: "Error Toast Message",
+ type: "error",
+ transitionTime: 600000,
+};
+
+export const InfoToastWithTrnasitionTime = Template.bind({});
+InfoToastWithTrnasitionTime.args = {
+ ...commonArgs,
+ label: "Info Toast Message",
+ type: "info",
+ transitionTime: 600000,
+};
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/Toggle.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/Toggle.stories.js
new file mode 100644
index 00000000..2807c055
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/Toggle.stories.js
@@ -0,0 +1,127 @@
+import React, { useEffect, useState } from "react";
+import Toggle from "../Toggle";
+import Iframe from "../Iframe";
+
+export default {
+ title: "Atoms/Toggle",
+ component: Toggle,
+ argTypes: {
+ inputRef: { control: false, table: { disable: true } },
+ label: { control: "text", table: { disable: true } },
+ onChange: { action: "onChange", table: { disable: true } },
+ value: { control: "text", table: { disable: true } },
+ errorStyle: { control: "object", table: { disable: true } },
+ disabled: { control: "boolean", table: { disable: true } },
+ type: { control: "radio", options: ["toggle"], table: { disable: true } },
+ additionalWrapperClass: { control: "text", table: { disable: true } },
+ props: { control: "object", table: { disable: true } },
+ Toggle1Label: { control: "text", name: "Toggle 1 Label" },
+ Toggle2Label: { control: "text", name: "Toggle 2 Label" },
+ Toggle3Label: { control: "text", name: "Toggle 3 Label" },
+ t: { table: { disable: true } },
+ options: { table: { disable: true } },
+ name: { table: { disable: true } },
+ onSelect: { table: { disable: true } },
+ selectedOption: { table: { disable: true } },
+ innerStyles: { table: { disable: true } },
+ optionsKey: { table: { disable: true } },
+ style: { table: { disable: true } },
+ numberOfToggleItems: { control: "number", name: "No of Toggle items" },
+ },
+};
+
+const Options = [
+ { code: "Toggle1", name: "Toggle1" },
+ { code: "Toggle2", name: "Toggle2" },
+ { code: "Toggle3", name: "Toggle3" },
+];
+
+const Template = (args) => {
+ const [selectedOption, setSelectedOption] = useState(args.value);
+
+ const handleSelectOption = (selectedValue) => {
+ if (selectedValue !== undefined) {
+ setSelectedOption(selectedValue);
+ }
+ };
+
+ // Generate options dynamically based on numberOfToggleItems
+ const options = Array.from(
+ { length: args.numberOfToggleItems },
+ (_, index) => {
+ const toggleLabel =
+ args[`Toggle${index + 1}Label`] &&
+ args[`Toggle${index + 1}Label`] !== ""
+ ? args[`Toggle${index + 1}Label`]
+ : `Toggle ${index + 1}`;
+ return { code: `Toggle${index + 1}`, name: toggleLabel };
+ }
+ );
+
+ return (
+ handleSelectOption(option)}
+ selectedOption={selectedOption}
+ options={options}
+ />
+ );
+};
+
+const t = (key) => key;
+
+const commonArgs = {
+ t: t,
+ options: Options,
+ name: "toggleOptions",
+ optionsKey: "name",
+ style: {},
+ inputRef: null,
+ label: "",
+ value: "",
+ errorStyle: null,
+ disabled: false,
+ type: "toggle",
+ additionalWrapperClass: "",
+ innerStyles: {},
+ Toggle1Label: "",
+ Toggle2Label: "",
+ Toggle3Label: "",
+ onSelect: () => {},
+ numberOfToggleItems: 3,
+};
+
+export const Documentation = () => (
+
+);
+
+Documentation.storyName = "Docs";
+Documentation.argTypes = {
+ numberOfToggleItems: { table: { disable: true } },
+ Toggle1Label: { table: { disable: true }},
+ Toggle2Label: { table: { disable: true }},
+ Toggle3Label: {table: { disable: true } },
+};
+
+//Default Toggle
+export const Basic = Template.bind({});
+Basic.args = {
+ ...commonArgs,
+};
+
+export const Custom = Template.bind({});
+Custom.args = {
+ ...commonArgs,
+ style: {
+ border: "5px solid #c84c0e",
+ backgroundColor: "#fafafa",
+ display: "flex",
+ alignItems: "center",
+ justifyContent: "center",
+ width: "fit-content",
+ },
+};
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/Tooltip.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/Tooltip.stories.js
new file mode 100644
index 00000000..52364fc5
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/Tooltip.stories.js
@@ -0,0 +1,106 @@
+import React from "react";
+import Tooltip from "../Tooltip";
+import { Colors } from "../../constants/colors/colorconstants";
+import { CustomSVG } from "../CustomSVG";
+
+export default {
+ title: "Atoms/Tooltip",
+ component: Tooltip,
+ argTypes: {
+ content: { control: "text",table:{disable:true} },
+ description: { control: "text" ,name:"Description"},
+ placement: {
+ control: "select",
+ options: [
+ "bottom-start",
+ "bottom",
+ "bottom-end",
+ "top-start",
+ "top",
+ "top-end",
+ "left-start",
+ "left",
+ "left-end",
+ "right-start",
+ "right",
+ "right-end",
+ ],
+ name: "Position",
+ },
+ arrow: { control: "boolean" ,name:'Arrow'},
+ style: { control: "object" ,table:{disable:true}},
+ className: { control: "text",table:{disable:true} },
+ header: { control: "text" ,name:'Header'},
+ theme: {
+ control: "select",
+ options: [
+ "dark",
+ "light",
+ ],
+ table:{disable:true}
+ },
+ },
+};
+
+const commonStyles = {
+ position: "absolute",
+ top: "50%",
+ left: "50%",
+ color: "#363636",
+ display: "flex",
+ alignItems: "center",
+ justifyContent: "center",
+ transform: "translate(-50%, -50%)",
+};
+
+const Color = Colors.lightTheme.primary[2];
+
+const Template = (args) => {
+ const { ...rest } = args;
+ return (
+
+
+
+ );
+};
+
+const htmlTooltip = (
+
+ {
+ "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt "
+ }
+
+
+
+);
+
+const commonArgs = {
+ content: htmlTooltip,
+ arrow: false,
+ placement: "bottom",
+ style: {},
+ header: "Tooltip Header",
+ description:"Tooltip Description"
+};
+
+export const DarkTheme = Template.bind({});
+DarkTheme.args = {
+ ...commonArgs,
+};
+
+export const LightTheme = Template.bind({});
+LightTheme.args = {
+ ...commonArgs,
+ theme:"light"
+};
+
+export const Custom = Template.bind({});
+Custom.args = {
+ ...commonArgs,
+ style: {
+ backgroundColor: Color,
+ border: "3px solid #C84C0E",
+ width: "300px",
+ textAlign: "center",
+ },
+};
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/TooltipDocs.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/TooltipDocs.stories.js
new file mode 100644
index 00000000..d38de368
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/TooltipDocs.stories.js
@@ -0,0 +1,47 @@
+import React from "react";
+import Tooltip from "../Tooltip";
+import Iframe from "../Iframe";
+
+export default {
+ title: "Atoms/Tooltip",
+ component: Tooltip,
+ argTypes: {
+ content: { control: "text" },
+ description: { control: "text" },
+ placement: {
+ control: "select",
+ options: [
+ "bottom-start",
+ "bottom",
+ "bottom-end",
+ "top-start",
+ "top",
+ "top-end",
+ "left-start",
+ "left",
+ "left-end",
+ "right-start",
+ "right",
+ "right-end",
+ ],
+ },
+ arrow: { control: "boolean" },
+ style: { control: "object" },
+ className: { control: "text" },
+ header: { control: "text" },
+ theme: {
+ control: "select",
+ options: ["dark", "light"],
+ },
+ },
+};
+
+export const Documentation = () => (
+
+);
+
+Documentation.storyName = "Docs";
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/UploaderDocs.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/UploaderDocs.stories.js
new file mode 100644
index 00000000..7cdfb2ce
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/UploaderDocs.stories.js
@@ -0,0 +1,100 @@
+import React from "react";
+import FileUpload from "../FileUpload";
+import Iframe from "../Iframe";
+
+export default {
+ title: "Atoms/FileUpload",
+ component: FileUpload,
+ argTypes: {
+ uploadedFiles: {
+ control: {
+ type: "object",
+ },
+ },
+ variant: {
+ control: {
+ type: "select",
+ options: ["uploadField", "uploadWidget", "uploadImage"],
+ },
+ },
+ showLabel: {
+ control: "boolean",
+ },
+ showHint: {
+ control: "boolean",
+ },
+ label: {
+ control: "text",
+ },
+ hintText: {
+ control: "text",
+ },
+ iserror: {
+ control: "text",
+ },
+ customClass: {
+ control: "text",
+ },
+ disabled: {
+ control: "boolean",
+ },
+ disableButton: {
+ control: "boolean",
+ },
+ buttonType: {
+ control: {
+ type: "select",
+ options: ["button", "submit", "reset"],
+ },
+ },
+ inputStyles: {
+ control: "object",
+ },
+ extraStyles: {
+ control: "object",
+ },
+ id: {
+ control: "text",
+ },
+ multiple: {
+ control: "boolean",
+ },
+ accept: {
+ control: "text",
+ },
+ showAsTags: {
+ control: "boolean",
+ },
+ showAsPreview: {
+ control: "boolean",
+ },
+ additionalElements: {
+ control: "array",
+ },
+ validations: {
+ control: "object",
+ },
+ showErrorCard: {
+ control: "boolean",
+ },
+ showReUploadButton: {
+ control: "boolean",
+ },
+ showDownloadButton: {
+ control: "boolean",
+ },
+ onUpload: {
+ control: "function",
+ },
+ },
+};
+
+export const Documentation = () => (
+
+);
+
+Documentation.storyName = "Docs";
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/UploaderField.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/UploaderField.stories.js
new file mode 100644
index 00000000..f2fcd9a3
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/UploaderField.stories.js
@@ -0,0 +1,172 @@
+import React from "react";
+import FileUpload from "../FileUpload";
+
+export default {
+ title: "Atoms/FileUpload/Uploader Field",
+ component: FileUpload,
+ argTypes: {
+ uploadedFiles: {
+ control: {
+ type: "object",
+ },
+ },
+ variant: {
+ control: {
+ type: "select",
+ options: ["uploadField", "uploadWidget", "uploadImage"],
+ },
+ },
+ showLabel: {
+ control: "boolean",
+ },
+ showHint: {
+ control: "boolean",
+ },
+ label: {
+ control: "text",
+ },
+ hintText: {
+ control: "text",
+ },
+ iserror: {
+ control: "text",
+ },
+ customClass: {
+ control: "text",
+ },
+ disabled: {
+ control: "boolean",
+ },
+ disableButton: {
+ control: "boolean",
+ },
+ buttonType: {
+ control: {
+ type: "select",
+ options: ["button", "submit", "reset"],
+ },
+ },
+ inputStyles: {
+ control: "object",
+ },
+ extraStyles: {
+ control: "object",
+ },
+ id: {
+ control: "text",
+ },
+ multiple: {
+ control: "boolean",
+ },
+ accept: {
+ control: "text",
+ },
+ showAsTags: {
+ control: "boolean",
+ },
+ showAsPreview: {
+ control: "boolean",
+ },
+ additionalElements: {
+ control: "array",
+ },
+ validations: {
+ control: "object",
+ },
+ showErrorCard: {
+ control: "boolean",
+ },
+ showReUploadButton: {
+ control: "boolean",
+ },
+ showDownloadButton: {
+ control: "boolean",
+ },
+ onUpload: {
+ control: "function",
+ },
+ },
+};
+
+const Template = (args) => ;
+
+export const SingleUpload = Template.bind({});
+SingleUpload.args = {
+ uploadedFiles: [],
+ variant: "uploadField",
+};
+
+export const UploadFileWithTags = Template.bind({});
+UploadFileWithTags.args = {
+ uploadedFiles: [],
+ variant: "uploadField",
+ showAsTags: true,
+ multiple: true,
+};
+
+export const WithTagsAndOnUploadLogic = Template.bind({});
+WithTagsAndOnUploadLogic.args = {
+ uploadedFiles: [],
+ variant: "uploadField",
+ showAsTags: true,
+ multiple: true,
+ onUpload: (uploadedFiles) => {
+ return uploadedFiles.map((file) => ({
+ file,
+ error: "Error!",
+ }));
+ },
+};
+
+export const WithTagsValidations = Template.bind({});
+WithTagsValidations.args = {
+ uploadedFiles: [],
+ variant: "uploadField",
+ multiple: true,
+ showAsTags: true,
+ validations: {
+ maxSizeAllowedInMB: 5,
+ minSizeRequiredInMB: 1,
+ },
+};
+
+export const WithPreview = Template.bind({});
+WithPreview.args = {
+ uploadedFiles: [],
+ variant: "uploadField",
+ showAsPreview: true,
+ multiple: true,
+};
+
+export const WithPreviewAndOnUploadLogic = Template.bind({});
+WithPreviewAndOnUploadLogic.args = {
+ uploadedFiles: [],
+ variant: "uploadField",
+ showAsPreview: true,
+ multiple: true,
+ onUpload: (uploadedFiles) => {
+ return uploadedFiles.map((file) => ({
+ file,
+ error: "Error!",
+ }));
+ },
+};
+
+export const WithPreviewValidations = Template.bind({});
+WithPreviewValidations.args = {
+ uploadedFiles: [],
+ variant: "uploadField",
+ showAsPreview: true,
+ multiple: true,
+ validations: {
+ maxSizeAllowedInMB: 5,
+ minSizeRequiredInMB: 1,
+ },
+};
+
+export const Error = Template.bind({});
+Error.args = {
+ uploadedFiles: [],
+ variant: "uploadField",
+ iserror: "Component Level Error!",
+};
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/UploaderWidget.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/UploaderWidget.stories.js
new file mode 100644
index 00000000..54873b28
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/atoms/stories/UploaderWidget.stories.js
@@ -0,0 +1,138 @@
+import React from "react";
+import FileUpload from "../FileUpload";
+
+export default {
+ title: "Atoms/FileUpload/Uploader Widget",
+ component: FileUpload,
+ argTypes: {
+ uploadedFiles: {
+ control: {
+ type: "object",
+ },
+ },
+ variant: {
+ control: {
+ type: "select",
+ options: ["uploadField", "uploadWidget", "uploadImage"],
+ },
+ },
+ showLabel: {
+ control: "boolean",
+ },
+ showHint: {
+ control: "boolean",
+ },
+ label: {
+ control: "text",
+ },
+ hintText: {
+ control: "text",
+ },
+ iserror: {
+ control: "text",
+ },
+ customClass: {
+ control: "text",
+ },
+ disabled: {
+ control: "boolean",
+ },
+ disableButton: {
+ control: "boolean",
+ },
+ buttonType: {
+ control: {
+ type: "select",
+ options: ["button", "submit", "reset"],
+ },
+ },
+ inputStyles: {
+ control: "object",
+ },
+ extraStyles: {
+ control: "object",
+ },
+ id: {
+ control: "text",
+ },
+ multiple: {
+ control: "boolean",
+ },
+ accept: {
+ control: "text",
+ },
+ showAsTags: {
+ control: "boolean",
+ },
+ showAsPreview: {
+ control: "boolean",
+ },
+ additionalElements: {
+ control: "array",
+ },
+ validations: {
+ control: "object",
+ },
+ showErrorCard: {
+ control: "boolean",
+ },
+ showReUploadButton: {
+ control: "boolean",
+ },
+ showDownloadButton: {
+ control: "boolean",
+ },
+ onUpload: {
+ control: "function",
+ },
+ },
+};
+
+const Template = (args) => ;
+
+
+export const SingleUpload = Template.bind({});
+SingleUpload.args = {
+ uploadedFiles: [],
+ variant: "uploadWidget",
+ showDownloadButton: true,
+ showReUploadButton: true,
+ multiple: false,
+};
+
+export const WithValidations = Template.bind({});
+WithValidations.args = {
+ uploadedFiles: [],
+ variant: "uploadWidget",
+ multiple: true,
+ validations: {
+ maxSizeAllowedInMB: 5,
+ minSizeRequiredInMB: 1,
+ },
+ showDownloadButton: true,
+ showReUploadButton: true,
+};
+
+export const WithValidationsWithErrorCard = Template.bind({});
+WithValidationsWithErrorCard.args = {
+ uploadedFiles: [],
+ variant: "uploadWidget",
+ multiple: true,
+ validations: {
+ maxSizeAllowedInMB: 5,
+ minSizeRequiredInMB: 1,
+ },
+ showErrorCard: true,
+ showDownloadButton: true,
+ showReUploadButton: true,
+};
+
+export const Error = Template.bind({});
+Error.args = {
+ uploadedFiles: [],
+ variant: "uploadWidget",
+ showDownloadButton: true,
+ showReUploadButton: true,
+ multiple: false,
+ iserror:"Component level error!"
+};
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/constants/animations/error.json b/micro-ui/web/micro-ui-internals/packages/ui-components/src/constants/animations/error.json
new file mode 100644
index 00000000..ac0665f1
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/constants/animations/error.json
@@ -0,0 +1,728 @@
+{
+ "nm": "ckeck",
+ "ddd": 0,
+ "h": 50,
+ "w": 50,
+ "meta": {
+ "g": "@lottiefiles/toolkit-js 0.33.2"
+ },
+ "layers": [
+ {
+ "ty": 4,
+ "nm": "! Outlines",
+ "sr": 1,
+ "st": 0,
+ "op": 213,
+ "ip": 0,
+ "hd": false,
+ "ddd": 0,
+ "bm": 0,
+ "hasMask": false,
+ "ao": 0,
+ "ks": {
+ "a": {
+ "a": 0,
+ "k": [
+ 2,
+ 12,
+ 0
+ ],
+ "ix": 1
+ },
+ "s": {
+ "a": 1,
+ "k": [
+ {
+ "o": {
+ "x": 0.653,
+ "y": -0.834
+ },
+ "i": {
+ "x": 0.667,
+ "y": 1
+ },
+ "s": [
+ 100,
+ 100,
+ 100
+ ],
+ "t": 60
+ },
+ {
+ "o": {
+ "x": 0.167,
+ "y": 0.167
+ },
+ "i": {
+ "x": 0.833,
+ "y": 0.833
+ },
+ "s": [
+ 115,
+ 115,
+ 100
+ ],
+ "t": 73
+ },
+ {
+ "o": {
+ "x": 0.333,
+ "y": 0
+ },
+ "i": {
+ "x": 0.127,
+ "y": 1.695
+ },
+ "s": [
+ 115,
+ 115,
+ 100
+ ],
+ "t": 83
+ },
+ {
+ "s": [
+ 100,
+ 100,
+ 100
+ ],
+ "t": 90
+ }
+ ],
+ "ix": 6
+ },
+ "sk": {
+ "a": 0,
+ "k": 0
+ },
+ "p": {
+ "a": 0,
+ "k": [
+ 25,
+ 25,
+ 0
+ ],
+ "ix": 2
+ },
+ "r": {
+ "a": 0,
+ "k": 0,
+ "ix": 10
+ },
+ "sa": {
+ "a": 0,
+ "k": 0
+ },
+ "o": {
+ "a": 0,
+ "k": 100,
+ "ix": 11
+ }
+ },
+ "ef": [],
+ "shapes": [
+ {
+ "ty": "gr",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Group",
+ "nm": "Group 1",
+ "ix": 1,
+ "cix": 2,
+ "np": 4,
+ "it": [
+ {
+ "ty": "sh",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Shape - Group",
+ "nm": "Path 1",
+ "ix": 1,
+ "d": 1,
+ "ks": {
+ "a": 0,
+ "k": {
+ "c": true,
+ "i": [
+ [
+ 0,
+ 1.104
+ ],
+ [
+ -1.104,
+ 0
+ ],
+ [
+ 0,
+ -1.104
+ ],
+ [
+ 1.104,
+ 0
+ ]
+ ],
+ "o": [
+ [
+ 0,
+ -1.104
+ ],
+ [
+ 1.104,
+ 0
+ ],
+ [
+ 0,
+ 1.104
+ ],
+ [
+ -1.104,
+ 0
+ ]
+ ],
+ "v": [
+ [
+ -2,
+ 10
+ ],
+ [
+ 0,
+ 8
+ ],
+ [
+ 2,
+ 10
+ ],
+ [
+ 0,
+ 12
+ ]
+ ]
+ },
+ "ix": 2
+ }
+ },
+ {
+ "ty": "sh",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Shape - Group",
+ "nm": "Path 2",
+ "ix": 2,
+ "d": 1,
+ "ks": {
+ "a": 0,
+ "k": {
+ "c": true,
+ "i": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 0,
+ 0
+ ],
+ [
+ 0,
+ 0
+ ],
+ [
+ 0,
+ 0
+ ],
+ [
+ 0,
+ 0
+ ],
+ [
+ 0,
+ 0
+ ]
+ ],
+ "o": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 0,
+ 0
+ ],
+ [
+ 0,
+ 0
+ ],
+ [
+ 0,
+ 0
+ ],
+ [
+ 0,
+ 0
+ ],
+ [
+ 0,
+ 0
+ ]
+ ],
+ "v": [
+ [
+ -1.036,
+ 5
+ ],
+ [
+ -2,
+ -6.625
+ ],
+ [
+ -2,
+ -12
+ ],
+ [
+ 2,
+ -12
+ ],
+ [
+ 2,
+ -6.625
+ ],
+ [
+ 1.052,
+ 5
+ ]
+ ]
+ },
+ "ix": 2
+ }
+ },
+ {
+ "ty": "mm",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Filter - Merge",
+ "nm": "Merge Paths 1",
+ "mm": 1
+ },
+ {
+ "ty": "fl",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Graphic - Fill",
+ "nm": "Fill 1",
+ "c": {
+ "a": 0,
+ "k": [
+ 1,
+ 1,
+ 1
+ ],
+ "ix": 4
+ },
+ "r": 1,
+ "o": {
+ "a": 0,
+ "k": 100,
+ "ix": 5
+ }
+ },
+ {
+ "ty": "tr",
+ "a": {
+ "a": 0,
+ "k": [
+ 0.099,
+ 9.982
+ ],
+ "ix": 1
+ },
+ "s": {
+ "a": 0,
+ "k": [
+ 100,
+ 100
+ ],
+ "ix": 3
+ },
+ "sk": {
+ "a": 0,
+ "k": 0,
+ "ix": 4
+ },
+ "p": {
+ "a": 0,
+ "k": [
+ 2.099,
+ 21.982
+ ],
+ "ix": 2
+ },
+ "r": {
+ "a": 1,
+ "k": [
+ {
+ "o": {
+ "x": 0.167,
+ "y": 0.167
+ },
+ "i": {
+ "x": 0.833,
+ "y": 0.833
+ },
+ "s": [
+ 0
+ ],
+ "t": 10
+ },
+ {
+ "o": {
+ "x": 0.167,
+ "y": 0.167
+ },
+ "i": {
+ "x": 0.833,
+ "y": 0.833
+ },
+ "s": [
+ 5
+ ],
+ "t": 12
+ },
+ {
+ "o": {
+ "x": 0.167,
+ "y": 0.167
+ },
+ "i": {
+ "x": 0.833,
+ "y": 0.833
+ },
+ "s": [
+ -5
+ ],
+ "t": 14
+ },
+ {
+ "o": {
+ "x": 0.167,
+ "y": 0.167
+ },
+ "i": {
+ "x": 0.833,
+ "y": 0.833
+ },
+ "s": [
+ 5
+ ],
+ "t": 16
+ },
+ {
+ "o": {
+ "x": 0.167,
+ "y": 0.167
+ },
+ "i": {
+ "x": 0.833,
+ "y": 0.833
+ },
+ "s": [
+ -5
+ ],
+ "t": 18
+ },
+ {
+ "o": {
+ "x": 0.167,
+ "y": 0.167
+ },
+ "i": {
+ "x": 0.833,
+ "y": 0.833
+ },
+ "s": [
+ 5
+ ],
+ "t": 20
+ },
+ {
+ "o": {
+ "x": 0.167,
+ "y": 0.167
+ },
+ "i": {
+ "x": 0.833,
+ "y": 0.833
+ },
+ "s": [
+ -5
+ ],
+ "t": 22
+ },
+ {
+ "s": [
+ 0
+ ],
+ "t": 24
+ }
+ ],
+ "ix": 6
+ },
+ "sa": {
+ "a": 0,
+ "k": 0,
+ "ix": 5
+ },
+ "o": {
+ "a": 0,
+ "k": 100,
+ "ix": 7
+ }
+ }
+ ]
+ }
+ ],
+ "ind": 1
+ },
+ {
+ "ty": 4,
+ "nm": "Shape Layer 1",
+ "sr": 1,
+ "st": 0,
+ "op": 193,
+ "ip": 0,
+ "hd": false,
+ "ddd": 0,
+ "bm": 0,
+ "hasMask": false,
+ "ao": 0,
+ "ks": {
+ "a": {
+ "a": 0,
+ "k": [
+ 0,
+ 10,
+ 0
+ ],
+ "ix": 1
+ },
+ "s": {
+ "a": 1,
+ "k": [
+ {
+ "o": {
+ "x": 0.41,
+ "y": -0.602
+ },
+ "i": {
+ "x": 0.667,
+ "y": 1
+ },
+ "s": [
+ 100,
+ 100,
+ 100
+ ],
+ "t": 60
+ },
+ {
+ "o": {
+ "x": 0.333,
+ "y": 0
+ },
+ "i": {
+ "x": 0.436,
+ "y": 1.492
+ },
+ "s": [
+ 115,
+ 115,
+ 100
+ ],
+ "t": 83
+ },
+ {
+ "s": [
+ 100,
+ 100,
+ 100
+ ],
+ "t": 90
+ }
+ ],
+ "ix": 6
+ },
+ "sk": {
+ "a": 0,
+ "k": 0
+ },
+ "p": {
+ "a": 0,
+ "k": [
+ 25,
+ 35,
+ 0
+ ],
+ "ix": 2
+ },
+ "r": {
+ "a": 0,
+ "k": 0,
+ "ix": 10
+ },
+ "sa": {
+ "a": 0,
+ "k": 0
+ },
+ "o": {
+ "a": 0,
+ "k": 100,
+ "ix": 11
+ }
+ },
+ "ef": [],
+ "shapes": [
+ {
+ "ty": "gr",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Group",
+ "nm": "Ellipse 1",
+ "ix": 1,
+ "cix": 2,
+ "np": 3,
+ "it": [
+ {
+ "ty": "el",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Shape - Ellipse",
+ "nm": "Ellipse Path 1",
+ "d": 1,
+ "p": {
+ "a": 0,
+ "k": [
+ 0,
+ 0
+ ],
+ "ix": 3
+ },
+ "s": {
+ "a": 0,
+ "k": [
+ 40,
+ 40
+ ],
+ "ix": 2
+ }
+ },
+ {
+ "ty": "st",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Graphic - Stroke",
+ "nm": "Stroke 1",
+ "lc": 1,
+ "lj": 1,
+ "ml": 4,
+ "o": {
+ "a": 0,
+ "k": 100,
+ "ix": 4
+ },
+ "w": {
+ "a": 0,
+ "k": 2,
+ "ix": 5
+ },
+ "c": {
+ "a": 0,
+ "k": [
+ 1,
+ 1,
+ 1
+ ],
+ "ix": 3
+ }
+ },
+ {
+ "ty": "tr",
+ "a": {
+ "a": 0,
+ "k": [
+ 0,
+ 0
+ ],
+ "ix": 1
+ },
+ "s": {
+ "a": 0,
+ "k": [
+ 100,
+ 100
+ ],
+ "ix": 3
+ },
+ "sk": {
+ "a": 0,
+ "k": 0,
+ "ix": 4
+ },
+ "p": {
+ "a": 0,
+ "k": [
+ 0,
+ 0
+ ],
+ "ix": 2
+ },
+ "r": {
+ "a": 0,
+ "k": 0,
+ "ix": 6
+ },
+ "sa": {
+ "a": 0,
+ "k": 0,
+ "ix": 5
+ },
+ "o": {
+ "a": 0,
+ "k": 100,
+ "ix": 7
+ }
+ }
+ ]
+ },
+ {
+ "ty": "tm",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Filter - Trim",
+ "nm": "Trim Paths 1",
+ "ix": 2,
+ "e": {
+ "a": 0,
+ "k": 100,
+ "ix": 2
+ },
+ "o": {
+ "a": 0,
+ "k": 0,
+ "ix": 3
+ },
+ "s": {
+ "a": 0,
+ "k": 0,
+ "ix": 1
+ },
+ "m": 1
+ }
+ ],
+ "ind": 2
+ }
+ ],
+ "v": "5.6.5",
+ "fr": 60,
+ "op": 180,
+ "ip": 0,
+ "assets": []
+ }
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/constants/animations/success.json b/micro-ui/web/micro-ui-internals/packages/ui-components/src/constants/animations/success.json
new file mode 100644
index 00000000..43192f70
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/constants/animations/success.json
@@ -0,0 +1,917 @@
+{
+ "nm": "sucess",
+ "ddd": 0,
+ "h": 120,
+ "w": 120,
+ "meta": {
+ "g": "LottieFiles AE 0.1.21"
+ },
+ "layers": [
+ {
+ "ty": 3,
+ "nm": "scale up null",
+ "sr": 1,
+ "st": 0,
+ "op": 300.00001221925,
+ "ip": 0,
+ "hd": false,
+ "ddd": 0,
+ "bm": 0,
+ "hasMask": false,
+ "ao": 0,
+ "ks": {
+ "a": {
+ "a": 0,
+ "k": [
+ 0,
+ 0,
+ 0
+ ],
+ "ix": 1
+ },
+ "s": {
+ "a": 1,
+ "k": [
+ {
+ "o": {
+ "x": 0.167,
+ "y": 0
+ },
+ "i": {
+ "x": 0.833,
+ "y": 1
+ },
+ "s": [
+ 111,
+ 111,
+ 100
+ ],
+ "t": 27
+ },
+ {
+ "o": {
+ "x": 0.167,
+ "y": 0
+ },
+ "i": {
+ "x": 0.833,
+ "y": 1
+ },
+ "s": [
+ 101,
+ 101,
+ 100
+ ],
+ "t": 36
+ },
+ {
+ "s": [
+ 121,
+ 121,
+ 100
+ ],
+ "t": 42.0000017106951
+ }
+ ],
+ "ix": 6
+ },
+ "sk": {
+ "a": 0,
+ "k": 0
+ },
+ "p": {
+ "a": 0,
+ "k": [
+ 60,
+ 60,
+ 0
+ ],
+ "ix": 2
+ },
+ "r": {
+ "a": 0,
+ "k": 0,
+ "ix": 10
+ },
+ "sa": {
+ "a": 0,
+ "k": 0
+ },
+ "o": {
+ "a": 0,
+ "k": 0,
+ "ix": 11
+ }
+ },
+ "ef": [],
+ "ind": 1
+ },
+ {
+ "ty": 4,
+ "nm": "spark",
+ "sr": 1,
+ "st": 35.0000014255792,
+ "op": 335.00001364483,
+ "ip": 35.0000014255792,
+ "hd": false,
+ "ddd": 0,
+ "bm": 0,
+ "hasMask": false,
+ "ao": 0,
+ "ks": {
+ "a": {
+ "a": 0,
+ "k": [
+ 0,
+ 0,
+ 0
+ ],
+ "ix": 1
+ },
+ "s": {
+ "a": 0,
+ "k": [
+ 100,
+ 100,
+ 100
+ ],
+ "ix": 6
+ },
+ "sk": {
+ "a": 0,
+ "k": 0
+ },
+ "p": {
+ "a": 0,
+ "k": [
+ 0,
+ 0.5,
+ 0
+ ],
+ "ix": 2
+ },
+ "r": {
+ "a": 0,
+ "k": 0,
+ "ix": 10
+ },
+ "sa": {
+ "a": 0,
+ "k": 0
+ },
+ "o": {
+ "a": 0,
+ "k": 100,
+ "ix": 11
+ }
+ },
+ "ef": [],
+ "shapes": [
+ {
+ "ty": "gr",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Group",
+ "nm": "Rectangle 1",
+ "ix": 1,
+ "cix": 2,
+ "np": 3,
+ "it": [
+ {
+ "ty": "rc",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Shape - Rect",
+ "nm": "Rectangle Path 1",
+ "d": 1,
+ "p": {
+ "a": 1,
+ "k": [
+ {
+ "o": {
+ "x": 0.333,
+ "y": 0
+ },
+ "i": {
+ "x": 0.667,
+ "y": 1
+ },
+ "s": [
+ 0,
+ -21
+ ],
+ "t": 35,
+ "ti": [
+ 0,
+ 1.5
+ ],
+ "to": [
+ 0,
+ -1.5
+ ]
+ },
+ {
+ "s": [
+ 0,
+ -30
+ ],
+ "t": 53.0000021587343
+ }
+ ],
+ "ix": 3
+ },
+ "r": {
+ "a": 0,
+ "k": 0,
+ "ix": 4
+ },
+ "s": {
+ "a": 1,
+ "k": [
+ {
+ "o": {
+ "x": 0.976,
+ "y": 0
+ },
+ "i": {
+ "x": 0.667,
+ "y": 1
+ },
+ "s": [
+ 2,
+ 0
+ ],
+ "t": 35
+ },
+ {
+ "o": {
+ "x": 0.33299999999999996,
+ "y": 0
+ },
+ "i": {
+ "x": 0.15355432054499818,
+ "y": 0.9999999999999999
+ },
+ "s": [
+ 2,
+ 8
+ ],
+ "t": 42
+ },
+ {
+ "s": [
+ 1.633,
+ 0
+ ],
+ "t": 53.0000021587343
+ }
+ ],
+ "ix": 2
+ }
+ },
+ {
+ "ty": "fl",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Graphic - Fill",
+ "nm": "Fill 1",
+ "c": {
+ "a": 0,
+ "k": [
+ 0.9804,
+ 0.9804,
+ 0.9804
+ ],
+ "ix": 4
+ },
+ "r": 1,
+ "o": {
+ "a": 0,
+ "k": 100,
+ "ix": 5
+ }
+ },
+ {
+ "ty": "tr",
+ "a": {
+ "a": 0,
+ "k": [
+ 0,
+ 0
+ ],
+ "ix": 1
+ },
+ "s": {
+ "a": 0,
+ "k": [
+ 100,
+ 100
+ ],
+ "ix": 3
+ },
+ "sk": {
+ "a": 0,
+ "k": 0,
+ "ix": 4
+ },
+ "p": {
+ "a": 0,
+ "k": [
+ 0,
+ -8
+ ],
+ "ix": 2
+ },
+ "r": {
+ "a": 0,
+ "k": 0,
+ "ix": 6
+ },
+ "sa": {
+ "a": 0,
+ "k": 0,
+ "ix": 5
+ },
+ "o": {
+ "a": 0,
+ "k": 100,
+ "ix": 7
+ }
+ }
+ ]
+ },
+ {
+ "ty": "rp",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Filter - Repeater",
+ "nm": "Repeater 1",
+ "ix": 2,
+ "m": 1,
+ "c": {
+ "a": 0,
+ "k": 8,
+ "ix": 1
+ },
+ "o": {
+ "a": 0,
+ "k": 0,
+ "ix": 2
+ },
+ "tr": {
+ "a": {
+ "a": 0,
+ "k": [
+ 0,
+ 0
+ ],
+ "ix": 1
+ },
+ "s": {
+ "a": 0,
+ "k": [
+ 100,
+ 100
+ ],
+ "ix": 3
+ },
+ "sk": {
+ "a": 0,
+ "k": 0
+ },
+ "p": {
+ "a": 0,
+ "k": [
+ 0,
+ 0
+ ],
+ "ix": 2
+ },
+ "r": {
+ "a": 0,
+ "k": 45,
+ "ix": 4
+ },
+ "sa": {
+ "a": 0,
+ "k": 0
+ },
+ "so": {
+ "a": 0,
+ "k": 100,
+ "ix": 5
+ },
+ "eo": {
+ "a": 0,
+ "k": 100,
+ "ix": 6
+ }
+ }
+ }
+ ],
+ "ind": 2,
+ "parent": 1
+ },
+ {
+ "ty": 4,
+ "nm": "check",
+ "sr": 1,
+ "st": 10.0000004073083,
+ "op": 310.000012626559,
+ "ip": 22.0000008960784,
+ "hd": false,
+ "ddd": 0,
+ "bm": 0,
+ "hasMask": false,
+ "ao": 0,
+ "ks": {
+ "a": {
+ "a": 0,
+ "k": [
+ 0,
+ 0,
+ 0
+ ],
+ "ix": 1
+ },
+ "s": {
+ "a": 0,
+ "k": [
+ 100,
+ 100,
+ 100
+ ],
+ "ix": 6
+ },
+ "sk": {
+ "a": 0,
+ "k": 0
+ },
+ "p": {
+ "a": 0,
+ "k": [
+ 0,
+ 0,
+ 0
+ ],
+ "ix": 2
+ },
+ "r": {
+ "a": 0,
+ "k": 0,
+ "ix": 10
+ },
+ "sa": {
+ "a": 0,
+ "k": 0
+ },
+ "o": {
+ "a": 0,
+ "k": 100,
+ "ix": 11
+ }
+ },
+ "ef": [],
+ "shapes": [
+ {
+ "ty": "sh",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Shape - Group",
+ "nm": "Path 1",
+ "ix": 1,
+ "d": 1,
+ "ks": {
+ "a": 0,
+ "k": {
+ "c": false,
+ "i": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 0,
+ 0
+ ],
+ [
+ 3.5,
+ 3.75
+ ],
+ [
+ -12.973,
+ 5.349
+ ],
+ [
+ -6.124,
+ -9.992
+ ],
+ [
+ 12.125,
+ -7.431
+ ],
+ [
+ 7.431,
+ 12.125
+ ]
+ ],
+ "o": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 0,
+ 0
+ ],
+ [
+ -3.5,
+ -3.75
+ ],
+ [
+ 10.764,
+ -2.941
+ ],
+ [
+ 7.431,
+ 12.125
+ ],
+ [
+ -12.125,
+ 7.431
+ ],
+ [
+ -7.431,
+ -12.125
+ ]
+ ],
+ "v": [
+ [
+ 15.25,
+ -9.688
+ ],
+ [
+ -5.75,
+ 10.062
+ ],
+ [
+ -16,
+ 0.25
+ ],
+ [
+ -6.777,
+ -24.849
+ ],
+ [
+ 21.955,
+ -13.456
+ ],
+ [
+ 13.456,
+ 21.955
+ ],
+ [
+ -21.955,
+ 13.456
+ ]
+ ]
+ },
+ "ix": 2
+ }
+ },
+ {
+ "ty": "tm",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Filter - Trim",
+ "nm": "Trim Paths 1",
+ "ix": 2,
+ "e": {
+ "a": 1,
+ "k": [
+ {
+ "o": {
+ "x": 0.714,
+ "y": 0
+ },
+ "i": {
+ "x": 0.351,
+ "y": 1
+ },
+ "s": [
+ 100
+ ],
+ "t": 10
+ },
+ {
+ "s": [
+ 23
+ ],
+ "t": 40.0000016292334
+ }
+ ],
+ "ix": 2
+ },
+ "o": {
+ "a": 0,
+ "k": 0,
+ "ix": 3
+ },
+ "s": {
+ "a": 1,
+ "k": [
+ {
+ "o": {
+ "x": 0.742,
+ "y": 0
+ },
+ "i": {
+ "x": 0.363,
+ "y": 1
+ },
+ "s": [
+ 100
+ ],
+ "t": 17
+ },
+ {
+ "s": [
+ 0
+ ],
+ "t": 45.0000018328876
+ }
+ ],
+ "ix": 1
+ },
+ "m": 1
+ },
+ {
+ "ty": "st",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Graphic - Stroke",
+ "nm": "Stroke 1",
+ "lc": 1,
+ "lj": 1,
+ "ml": 4,
+ "o": {
+ "a": 0,
+ "k": 100,
+ "ix": 4
+ },
+ "w": {
+ "a": 0,
+ "k": 4,
+ "ix": 5
+ },
+ "c": {
+ "a": 0,
+ "k": [
+ 0.9804,
+ 0.9804,
+ 0.9804
+ ],
+ "ix": 3
+ }
+ }
+ ],
+ "ind": 3,
+ "parent": 1
+ },
+ {
+ "ty": 4,
+ "nm": "circle",
+ "sr": 1,
+ "st": 0,
+ "op": 300.00001221925,
+ "ip": 0,
+ "hd": false,
+ "ddd": 0,
+ "bm": 0,
+ "hasMask": false,
+ "ao": 0,
+ "ks": {
+ "a": {
+ "a": 0,
+ "k": [
+ 0,
+ 0,
+ 0
+ ],
+ "ix": 1
+ },
+ "s": {
+ "a": 0,
+ "k": [
+ 100,
+ 100,
+ 100
+ ],
+ "ix": 6
+ },
+ "sk": {
+ "a": 0,
+ "k": 0
+ },
+ "p": {
+ "a": 0,
+ "k": [
+ 0,
+ 0,
+ 0
+ ],
+ "ix": 2
+ },
+ "r": {
+ "a": 0,
+ "k": 0,
+ "ix": 10
+ },
+ "sa": {
+ "a": 0,
+ "k": 0
+ },
+ "o": {
+ "a": 0,
+ "k": 100,
+ "ix": 11
+ }
+ },
+ "ef": [],
+ "shapes": [
+ {
+ "ty": "sh",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Shape - Group",
+ "nm": "Path 1",
+ "ix": 1,
+ "d": 1,
+ "ks": {
+ "a": 0,
+ "k": {
+ "c": true,
+ "i": [
+ [
+ -14.221,
+ 0
+ ],
+ [
+ 0,
+ -14.221
+ ],
+ [
+ 14.221,
+ 0
+ ],
+ [
+ 0,
+ 14.221
+ ]
+ ],
+ "o": [
+ [
+ 14.221,
+ 0
+ ],
+ [
+ 0,
+ 14.221
+ ],
+ [
+ -14.221,
+ 0
+ ],
+ [
+ 0,
+ -14.221
+ ]
+ ],
+ "v": [
+ [
+ 0,
+ -25.75
+ ],
+ [
+ 25.75,
+ 0
+ ],
+ [
+ 0,
+ 25.75
+ ],
+ [
+ -25.75,
+ 0
+ ]
+ ]
+ },
+ "ix": 2
+ }
+ },
+ {
+ "ty": "st",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Graphic - Stroke",
+ "nm": "Stroke 1",
+ "lc": 1,
+ "lj": 1,
+ "ml": 4,
+ "o": {
+ "a": 0,
+ "k": 100,
+ "ix": 4
+ },
+ "w": {
+ "a": 0,
+ "k": 2,
+ "ix": 5
+ },
+ "c": {
+ "a": 0,
+ "k": [
+ 0.9804,
+ 0.9804,
+ 0.9804
+ ],
+ "ix": 3
+ }
+ },
+ {
+ "ty": "tm",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Filter - Trim",
+ "nm": "Trim Paths 1",
+ "ix": 3,
+ "e": {
+ "a": 1,
+ "k": [
+ {
+ "o": {
+ "x": 0.714,
+ "y": 0
+ },
+ "i": {
+ "x": 0.351,
+ "y": 1
+ },
+ "s": [
+ 100
+ ],
+ "t": 0
+ },
+ {
+ "s": [
+ 100
+ ],
+ "t": 30.0000012219251
+ }
+ ],
+ "ix": 2
+ },
+ "o": {
+ "a": 0,
+ "k": 0,
+ "ix": 3
+ },
+ "s": {
+ "a": 1,
+ "k": [
+ {
+ "o": {
+ "x": 0.742,
+ "y": 0
+ },
+ "i": {
+ "x": 0.363,
+ "y": 1
+ },
+ "s": [
+ 100
+ ],
+ "t": 7
+ },
+ {
+ "s": [
+ 0
+ ],
+ "t": 33.0000013441176
+ }
+ ],
+ "ix": 1
+ },
+ "m": 1
+ }
+ ],
+ "ind": 4,
+ "parent": 1
+ }
+ ],
+ "v": "5.5.7",
+ "fr": 29.9700012207031,
+ "op": 60.0000024438501,
+ "ip": 0,
+ "assets": []
+}
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/constants/animations/theLoaderPrimary.json b/micro-ui/web/micro-ui-internals/packages/ui-components/src/constants/animations/theLoaderPrimary.json
new file mode 100644
index 00000000..d1aa06b5
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/constants/animations/theLoaderPrimary.json
@@ -0,0 +1,486 @@
+{
+ "nm": "Main Scene",
+ "ddd": 0,
+ "h": 500,
+ "w": 500,
+ "meta": { "g": "@lottiefiles/creator 1.37.0" },
+ "layers": [
+ {
+ "ty": 4,
+ "nm": "Shape Layer 5",
+ "sr": 1,
+ "st": 20,
+ "op": 620,
+ "ip": 20,
+ "hd": false,
+ "ddd": 0,
+ "bm": 0,
+ "hasMask": false,
+ "ao": 0,
+ "ks": {
+ "a": { "a": 0, "k": [0, 0, 0] },
+ "s": { "a": 0, "k": [100, 100] },
+ "sk": { "a": 0, "k": 0 },
+ "p": { "a": 0, "k": [251, 250] },
+ "r": {
+ "a": 1,
+ "k": [
+ {
+ "o": { "x": 0.333, "y": 0 },
+ "i": { "x": 0.667, "y": 1 },
+ "s": [0],
+ "t": 20
+ },
+ { "s": [360], "t": 110 }
+ ]
+ },
+ "sa": { "a": 0, "k": 0 },
+ "o": { "a": 0, "k": 100 }
+ },
+ "shapes": [
+ {
+ "ty": "gr",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Group",
+ "nm": "Ellipse 1",
+ "ix": 1,
+ "cix": 2,
+ "np": 3,
+ "it": [
+ {
+ "ty": "el",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Shape - Ellipse",
+ "nm": "Ellipse Path 1",
+ "d": 1,
+ "p": { "a": 0, "k": [0, -100] },
+ "s": { "a": 0, "k": [10, 10] }
+ },
+ {
+ "ty": "st",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Graphic - Stroke",
+ "nm": "Stroke 1",
+ "lc": 1,
+ "lj": 1,
+ "ml": 4,
+ "o": { "a": 0, "k": 100 },
+ "w": { "a": 0, "k": 0 },
+ "c": { "a": 0, "k": [0, 0, 0] }
+ },
+ {
+ "ty": "fl",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Graphic - Fill",
+ "nm": "Fill 1",
+ "c": { "a": 0, "k": [0.7765, 0.2902, 0.051] },
+ "r": 1,
+ "o": { "a": 0, "k": 100 }
+ },
+ {
+ "ty": "tr",
+ "a": { "a": 0, "k": [0, 0], "ix": 1 },
+ "s": { "a": 0, "k": [100, 100], "ix": 3 },
+ "sk": { "a": 0, "k": 0, "ix": 4 },
+ "p": { "a": 0, "k": [0, 0], "ix": 2 },
+ "r": { "a": 0, "k": 0, "ix": 6 },
+ "sa": { "a": 0, "k": 0, "ix": 5 },
+ "o": { "a": 0, "k": 100, "ix": 7 }
+ }
+ ]
+ }
+ ],
+ "ind": 1
+ },
+ {
+ "ty": 4,
+ "nm": "Shape Layer 4",
+ "sr": 1,
+ "st": 15,
+ "op": 615,
+ "ip": 15,
+ "hd": false,
+ "ddd": 0,
+ "bm": 0,
+ "hasMask": false,
+ "ao": 0,
+ "ks": {
+ "a": { "a": 0, "k": [0, 0, 0] },
+ "s": { "a": 0, "k": [100, 100] },
+ "sk": { "a": 0, "k": 0 },
+ "p": { "a": 0, "k": [251, 250] },
+ "r": {
+ "a": 1,
+ "k": [
+ {
+ "o": { "x": 0.333, "y": 0 },
+ "i": { "x": 0.667, "y": 1 },
+ "s": [0],
+ "t": 15
+ },
+ { "s": [360], "t": 105 }
+ ]
+ },
+ "sa": { "a": 0, "k": 0 },
+ "o": { "a": 0, "k": 100 }
+ },
+ "shapes": [
+ {
+ "ty": "gr",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Group",
+ "nm": "Ellipse 1",
+ "ix": 1,
+ "cix": 2,
+ "np": 3,
+ "it": [
+ {
+ "ty": "el",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Shape - Ellipse",
+ "nm": "Ellipse Path 1",
+ "d": 1,
+ "p": { "a": 0, "k": [0, -100] },
+ "s": { "a": 0, "k": [20, 20] }
+ },
+ {
+ "ty": "st",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Graphic - Stroke",
+ "nm": "Stroke 1",
+ "lc": 1,
+ "lj": 1,
+ "ml": 4,
+ "o": { "a": 0, "k": 100 },
+ "w": { "a": 0, "k": 0 },
+ "c": { "a": 0, "k": [0, 0, 0] }
+ },
+ {
+ "ty": "fl",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Graphic - Fill",
+ "nm": "Fill 1",
+ "c": { "a": 0, "k": [0.7765, 0.2902, 0.051] },
+ "r": 1,
+ "o": { "a": 0, "k": 100 }
+ },
+ {
+ "ty": "tr",
+ "a": { "a": 0, "k": [0, 0], "ix": 1 },
+ "s": { "a": 0, "k": [100, 100], "ix": 3 },
+ "sk": { "a": 0, "k": 0, "ix": 4 },
+ "p": { "a": 0, "k": [0, 0], "ix": 2 },
+ "r": { "a": 0, "k": 0, "ix": 6 },
+ "sa": { "a": 0, "k": 0, "ix": 5 },
+ "o": { "a": 0, "k": 100, "ix": 7 }
+ }
+ ]
+ }
+ ],
+ "ind": 2
+ },
+ {
+ "ty": 4,
+ "nm": "Shape Layer 3",
+ "sr": 1,
+ "st": 10,
+ "op": 610,
+ "ip": 10,
+ "hd": false,
+ "ddd": 0,
+ "bm": 0,
+ "hasMask": false,
+ "ao": 0,
+ "ks": {
+ "a": { "a": 0, "k": [0, 0, 0] },
+ "s": { "a": 0, "k": [100, 100] },
+ "sk": { "a": 0, "k": 0 },
+ "p": { "a": 0, "k": [251, 250] },
+ "r": {
+ "a": 1,
+ "k": [
+ {
+ "o": { "x": 0.333, "y": 0 },
+ "i": { "x": 0.667, "y": 1 },
+ "s": [0],
+ "t": 10
+ },
+ { "s": [360], "t": 100 }
+ ]
+ },
+ "sa": { "a": 0, "k": 0 },
+ "o": { "a": 0, "k": 100 }
+ },
+ "shapes": [
+ {
+ "ty": "gr",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Group",
+ "nm": "Ellipse 1",
+ "ix": 1,
+ "cix": 2,
+ "np": 3,
+ "it": [
+ {
+ "ty": "el",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Shape - Ellipse",
+ "nm": "Ellipse Path 1",
+ "d": 1,
+ "p": { "a": 0, "k": [0, -100] },
+ "s": { "a": 0, "k": [30, 30] }
+ },
+ {
+ "ty": "st",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Graphic - Stroke",
+ "nm": "Stroke 1",
+ "lc": 1,
+ "lj": 1,
+ "ml": 4,
+ "o": { "a": 0, "k": 100 },
+ "w": { "a": 0, "k": 0 },
+ "c": { "a": 0, "k": [0, 0, 0] }
+ },
+ {
+ "ty": "fl",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Graphic - Fill",
+ "nm": "Fill 1",
+ "c": { "a": 0, "k": [0.7765, 0.2902, 0.051] },
+ "r": 1,
+ "o": { "a": 0, "k": 100 }
+ },
+ {
+ "ty": "tr",
+ "a": { "a": 0, "k": [0, 0], "ix": 1 },
+ "s": { "a": 0, "k": [100, 100], "ix": 3 },
+ "sk": { "a": 0, "k": 0, "ix": 4 },
+ "p": { "a": 0, "k": [0, 0], "ix": 2 },
+ "r": { "a": 0, "k": 0, "ix": 6 },
+ "sa": { "a": 0, "k": 0, "ix": 5 },
+ "o": { "a": 0, "k": 100, "ix": 7 }
+ }
+ ]
+ }
+ ],
+ "ind": 3
+ },
+ {
+ "ty": 4,
+ "nm": "Shape Layer 2",
+ "sr": 1,
+ "st": 5,
+ "op": 605,
+ "ip": 5,
+ "hd": false,
+ "ddd": 0,
+ "bm": 0,
+ "hasMask": false,
+ "ao": 0,
+ "ks": {
+ "a": { "a": 0, "k": [0, 0, 0] },
+ "s": { "a": 0, "k": [100, 100] },
+ "sk": { "a": 0, "k": 0 },
+ "p": { "a": 0, "k": [251, 250] },
+ "r": {
+ "a": 1,
+ "k": [
+ {
+ "o": { "x": 0.333, "y": 0 },
+ "i": { "x": 0.667, "y": 1 },
+ "s": [0],
+ "t": 5
+ },
+ { "s": [360], "t": 95 }
+ ]
+ },
+ "sa": { "a": 0, "k": 0 },
+ "o": { "a": 0, "k": 100 }
+ },
+ "shapes": [
+ {
+ "ty": "gr",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Group",
+ "nm": "Ellipse 1",
+ "ix": 1,
+ "cix": 2,
+ "np": 3,
+ "it": [
+ {
+ "ty": "el",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Shape - Ellipse",
+ "nm": "Ellipse Path 1",
+ "d": 1,
+ "p": { "a": 0, "k": [0, -100] },
+ "s": { "a": 0, "k": [40, 40] }
+ },
+ {
+ "ty": "st",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Graphic - Stroke",
+ "nm": "Stroke 1",
+ "lc": 1,
+ "lj": 1,
+ "ml": 4,
+ "o": { "a": 0, "k": 100 },
+ "w": { "a": 0, "k": 0 },
+ "c": { "a": 0, "k": [0, 0, 0] }
+ },
+ {
+ "ty": "fl",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Graphic - Fill",
+ "nm": "Fill 1",
+ "c": { "a": 0, "k": [0.7765, 0.2902, 0.051] },
+ "r": 1,
+ "o": { "a": 0, "k": 100 }
+ },
+ {
+ "ty": "tr",
+ "a": { "a": 0, "k": [0, 0], "ix": 1 },
+ "s": { "a": 0, "k": [100, 100], "ix": 3 },
+ "sk": { "a": 0, "k": 0, "ix": 4 },
+ "p": { "a": 0, "k": [0, 0], "ix": 2 },
+ "r": { "a": 0, "k": 0, "ix": 6 },
+ "sa": { "a": 0, "k": 0, "ix": 5 },
+ "o": { "a": 0, "k": 100, "ix": 7 }
+ }
+ ]
+ }
+ ],
+ "ind": 4
+ },
+ {
+ "ty": 4,
+ "nm": "Shape Layer 1",
+ "sr": 1,
+ "st": 0,
+ "op": 600,
+ "ip": 0,
+ "hd": false,
+ "ddd": 0,
+ "bm": 0,
+ "hasMask": false,
+ "ao": 0,
+ "ks": {
+ "a": { "a": 0, "k": [0, 0, 0] },
+ "s": { "a": 0, "k": [100, 100] },
+ "sk": { "a": 0, "k": 0 },
+ "p": { "a": 0, "k": [250, 250] },
+ "r": {
+ "a": 1,
+ "k": [
+ {
+ "o": { "x": 0.333, "y": 0 },
+ "i": { "x": 0.667, "y": 1 },
+ "s": [0],
+ "t": 0
+ },
+ { "s": [360], "t": 90 }
+ ]
+ },
+ "sa": { "a": 0, "k": 0 },
+ "o": { "a": 0, "k": 100 }
+ },
+ "shapes": [
+ {
+ "ty": "gr",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Group",
+ "nm": "Ellipse 1",
+ "ix": 1,
+ "cix": 2,
+ "np": 3,
+ "it": [
+ {
+ "ty": "el",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Shape - Ellipse",
+ "nm": "Ellipse Path 1",
+ "d": 1,
+ "p": { "a": 0, "k": [0, -100] },
+ "s": {
+ "a": 1,
+ "k": [
+ {
+ "o": { "x": 0.333, "y": 0 },
+ "i": { "x": 0.667, "y": 1 },
+ "s": [50, 50],
+ "t": 0
+ },
+ {
+ "o": { "x": 0.333, "y": 0 },
+ "i": { "x": 0.667, "y": 1 },
+ "s": [40, 40],
+ "t": 84
+ },
+ { "s": [50, 50], "t": 100 }
+ ]
+ }
+ },
+ {
+ "ty": "st",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Graphic - Stroke",
+ "nm": "Stroke 1",
+ "lc": 1,
+ "lj": 1,
+ "ml": 4,
+ "o": { "a": 0, "k": 100 },
+ "w": { "a": 0, "k": 0 },
+ "c": { "a": 0, "k": [0, 0, 0] }
+ },
+ {
+ "ty": "fl",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Graphic - Fill",
+ "nm": "Fill 1",
+ "c": { "a": 0, "k": [0.7765, 0.2902, 0.051] },
+ "r": 1,
+ "o": { "a": 0, "k": 100 }
+ },
+ {
+ "ty": "tr",
+ "a": { "a": 0, "k": [0, 0], "ix": 1 },
+ "s": { "a": 0, "k": [100, 100], "ix": 3 },
+ "sk": { "a": 0, "k": 0, "ix": 4 },
+ "p": { "a": 0, "k": [0, 0], "ix": 2 },
+ "r": { "a": 0, "k": 0, "ix": 6 },
+ "sa": { "a": 0, "k": 0, "ix": 5 },
+ "o": { "a": 0, "k": 100, "ix": 7 }
+ }
+ ]
+ }
+ ],
+ "ind": 5
+ }
+ ],
+ "v": "5.7.0",
+ "fr": 60,
+ "op": 106,
+ "ip": 0,
+ "assets": []
+}
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/constants/animations/theLoaderPrimary2.json b/micro-ui/web/micro-ui-internals/packages/ui-components/src/constants/animations/theLoaderPrimary2.json
new file mode 100644
index 00000000..f0b1207e
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/constants/animations/theLoaderPrimary2.json
@@ -0,0 +1,486 @@
+{
+ "nm": "Main Scene",
+ "ddd": 0,
+ "h": 500,
+ "w": 500,
+ "meta": { "g": "@lottiefiles/creator 1.37.1" },
+ "layers": [
+ {
+ "ty": 4,
+ "nm": "Shape Layer 5",
+ "sr": 1,
+ "st": 20,
+ "op": 620,
+ "ip": 20,
+ "hd": false,
+ "ddd": 0,
+ "bm": 0,
+ "hasMask": false,
+ "ao": 0,
+ "ks": {
+ "a": { "a": 0, "k": [0, 0, 0] },
+ "s": { "a": 0, "k": [100, 100] },
+ "sk": { "a": 0, "k": 0 },
+ "p": { "a": 0, "k": [251, 250] },
+ "r": {
+ "a": 1,
+ "k": [
+ {
+ "o": { "x": 0.333, "y": 0 },
+ "i": { "x": 0.667, "y": 1 },
+ "s": [0],
+ "t": 20
+ },
+ { "s": [360], "t": 110 }
+ ]
+ },
+ "sa": { "a": 0, "k": 0 },
+ "o": { "a": 0, "k": 100 }
+ },
+ "shapes": [
+ {
+ "ty": "gr",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Group",
+ "nm": "Ellipse 1",
+ "ix": 1,
+ "cix": 2,
+ "np": 3,
+ "it": [
+ {
+ "ty": "el",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Shape - Ellipse",
+ "nm": "Ellipse Path 1",
+ "d": 1,
+ "p": { "a": 0, "k": [0, -100] },
+ "s": { "a": 0, "k": [10, 10] }
+ },
+ {
+ "ty": "st",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Graphic - Stroke",
+ "nm": "Stroke 1",
+ "lc": 1,
+ "lj": 1,
+ "ml": 4,
+ "o": { "a": 0, "k": 100 },
+ "w": { "a": 0, "k": 0 },
+ "c": { "a": 0, "k": [0, 0, 0] }
+ },
+ {
+ "ty": "fl",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Graphic - Fill",
+ "nm": "Fill 1",
+ "c": { "a": 0, "k": [0.0353, 0.2902, 0.4] },
+ "r": 1,
+ "o": { "a": 0, "k": 100 }
+ },
+ {
+ "ty": "tr",
+ "a": { "a": 0, "k": [0, 0], "ix": 1 },
+ "s": { "a": 0, "k": [100, 100], "ix": 3 },
+ "sk": { "a": 0, "k": 0, "ix": 4 },
+ "p": { "a": 0, "k": [0, 0], "ix": 2 },
+ "r": { "a": 0, "k": 0, "ix": 6 },
+ "sa": { "a": 0, "k": 0, "ix": 5 },
+ "o": { "a": 0, "k": 100, "ix": 7 }
+ }
+ ]
+ }
+ ],
+ "ind": 1
+ },
+ {
+ "ty": 4,
+ "nm": "Shape Layer 4",
+ "sr": 1,
+ "st": 15,
+ "op": 615,
+ "ip": 15,
+ "hd": false,
+ "ddd": 0,
+ "bm": 0,
+ "hasMask": false,
+ "ao": 0,
+ "ks": {
+ "a": { "a": 0, "k": [0, 0, 0] },
+ "s": { "a": 0, "k": [100, 100] },
+ "sk": { "a": 0, "k": 0 },
+ "p": { "a": 0, "k": [251, 250] },
+ "r": {
+ "a": 1,
+ "k": [
+ {
+ "o": { "x": 0.333, "y": 0 },
+ "i": { "x": 0.667, "y": 1 },
+ "s": [0],
+ "t": 15
+ },
+ { "s": [360], "t": 105 }
+ ]
+ },
+ "sa": { "a": 0, "k": 0 },
+ "o": { "a": 0, "k": 100 }
+ },
+ "shapes": [
+ {
+ "ty": "gr",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Group",
+ "nm": "Ellipse 1",
+ "ix": 1,
+ "cix": 2,
+ "np": 3,
+ "it": [
+ {
+ "ty": "el",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Shape - Ellipse",
+ "nm": "Ellipse Path 1",
+ "d": 1,
+ "p": { "a": 0, "k": [0, -100] },
+ "s": { "a": 0, "k": [20, 20] }
+ },
+ {
+ "ty": "st",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Graphic - Stroke",
+ "nm": "Stroke 1",
+ "lc": 1,
+ "lj": 1,
+ "ml": 4,
+ "o": { "a": 0, "k": 100 },
+ "w": { "a": 0, "k": 0 },
+ "c": { "a": 0, "k": [0, 0, 0] }
+ },
+ {
+ "ty": "fl",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Graphic - Fill",
+ "nm": "Fill 1",
+ "c": { "a": 0, "k": [0.0353, 0.2902, 0.4] },
+ "r": 1,
+ "o": { "a": 0, "k": 100 }
+ },
+ {
+ "ty": "tr",
+ "a": { "a": 0, "k": [0, 0], "ix": 1 },
+ "s": { "a": 0, "k": [100, 100], "ix": 3 },
+ "sk": { "a": 0, "k": 0, "ix": 4 },
+ "p": { "a": 0, "k": [0, 0], "ix": 2 },
+ "r": { "a": 0, "k": 0, "ix": 6 },
+ "sa": { "a": 0, "k": 0, "ix": 5 },
+ "o": { "a": 0, "k": 100, "ix": 7 }
+ }
+ ]
+ }
+ ],
+ "ind": 2
+ },
+ {
+ "ty": 4,
+ "nm": "Shape Layer 3",
+ "sr": 1,
+ "st": 10,
+ "op": 610,
+ "ip": 10,
+ "hd": false,
+ "ddd": 0,
+ "bm": 0,
+ "hasMask": false,
+ "ao": 0,
+ "ks": {
+ "a": { "a": 0, "k": [0, 0, 0] },
+ "s": { "a": 0, "k": [100, 100] },
+ "sk": { "a": 0, "k": 0 },
+ "p": { "a": 0, "k": [251, 250] },
+ "r": {
+ "a": 1,
+ "k": [
+ {
+ "o": { "x": 0.333, "y": 0 },
+ "i": { "x": 0.667, "y": 1 },
+ "s": [0],
+ "t": 10
+ },
+ { "s": [360], "t": 100 }
+ ]
+ },
+ "sa": { "a": 0, "k": 0 },
+ "o": { "a": 0, "k": 100 }
+ },
+ "shapes": [
+ {
+ "ty": "gr",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Group",
+ "nm": "Ellipse 1",
+ "ix": 1,
+ "cix": 2,
+ "np": 3,
+ "it": [
+ {
+ "ty": "el",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Shape - Ellipse",
+ "nm": "Ellipse Path 1",
+ "d": 1,
+ "p": { "a": 0, "k": [0, -100] },
+ "s": { "a": 0, "k": [30, 30] }
+ },
+ {
+ "ty": "st",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Graphic - Stroke",
+ "nm": "Stroke 1",
+ "lc": 1,
+ "lj": 1,
+ "ml": 4,
+ "o": { "a": 0, "k": 100 },
+ "w": { "a": 0, "k": 0 },
+ "c": { "a": 0, "k": [0, 0, 0] }
+ },
+ {
+ "ty": "fl",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Graphic - Fill",
+ "nm": "Fill 1",
+ "c": { "a": 0, "k": [0.0353, 0.2902, 0.4] },
+ "r": 1,
+ "o": { "a": 0, "k": 100 }
+ },
+ {
+ "ty": "tr",
+ "a": { "a": 0, "k": [0, 0], "ix": 1 },
+ "s": { "a": 0, "k": [100, 100], "ix": 3 },
+ "sk": { "a": 0, "k": 0, "ix": 4 },
+ "p": { "a": 0, "k": [0, 0], "ix": 2 },
+ "r": { "a": 0, "k": 0, "ix": 6 },
+ "sa": { "a": 0, "k": 0, "ix": 5 },
+ "o": { "a": 0, "k": 100, "ix": 7 }
+ }
+ ]
+ }
+ ],
+ "ind": 3
+ },
+ {
+ "ty": 4,
+ "nm": "Shape Layer 2",
+ "sr": 1,
+ "st": 5,
+ "op": 605,
+ "ip": 5,
+ "hd": false,
+ "ddd": 0,
+ "bm": 0,
+ "hasMask": false,
+ "ao": 0,
+ "ks": {
+ "a": { "a": 0, "k": [0, 0, 0] },
+ "s": { "a": 0, "k": [100, 100] },
+ "sk": { "a": 0, "k": 0 },
+ "p": { "a": 0, "k": [251, 250] },
+ "r": {
+ "a": 1,
+ "k": [
+ {
+ "o": { "x": 0.333, "y": 0 },
+ "i": { "x": 0.667, "y": 1 },
+ "s": [0],
+ "t": 5
+ },
+ { "s": [360], "t": 95 }
+ ]
+ },
+ "sa": { "a": 0, "k": 0 },
+ "o": { "a": 0, "k": 100 }
+ },
+ "shapes": [
+ {
+ "ty": "gr",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Group",
+ "nm": "Ellipse 1",
+ "ix": 1,
+ "cix": 2,
+ "np": 3,
+ "it": [
+ {
+ "ty": "el",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Shape - Ellipse",
+ "nm": "Ellipse Path 1",
+ "d": 1,
+ "p": { "a": 0, "k": [0, -100] },
+ "s": { "a": 0, "k": [40, 40] }
+ },
+ {
+ "ty": "st",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Graphic - Stroke",
+ "nm": "Stroke 1",
+ "lc": 1,
+ "lj": 1,
+ "ml": 4,
+ "o": { "a": 0, "k": 100 },
+ "w": { "a": 0, "k": 0 },
+ "c": { "a": 0, "k": [0, 0, 0] }
+ },
+ {
+ "ty": "fl",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Graphic - Fill",
+ "nm": "Fill 1",
+ "c": { "a": 0, "k": [0.0353, 0.2902, 0.4] },
+ "r": 1,
+ "o": { "a": 0, "k": 100 }
+ },
+ {
+ "ty": "tr",
+ "a": { "a": 0, "k": [0, 0], "ix": 1 },
+ "s": { "a": 0, "k": [100, 100], "ix": 3 },
+ "sk": { "a": 0, "k": 0, "ix": 4 },
+ "p": { "a": 0, "k": [0, 0], "ix": 2 },
+ "r": { "a": 0, "k": 0, "ix": 6 },
+ "sa": { "a": 0, "k": 0, "ix": 5 },
+ "o": { "a": 0, "k": 100, "ix": 7 }
+ }
+ ]
+ }
+ ],
+ "ind": 4
+ },
+ {
+ "ty": 4,
+ "nm": "Shape Layer 1",
+ "sr": 1,
+ "st": 0,
+ "op": 600,
+ "ip": 0,
+ "hd": false,
+ "ddd": 0,
+ "bm": 0,
+ "hasMask": false,
+ "ao": 0,
+ "ks": {
+ "a": { "a": 0, "k": [0, 0, 0] },
+ "s": { "a": 0, "k": [100, 100] },
+ "sk": { "a": 0, "k": 0 },
+ "p": { "a": 0, "k": [250, 250] },
+ "r": {
+ "a": 1,
+ "k": [
+ {
+ "o": { "x": 0.333, "y": 0 },
+ "i": { "x": 0.667, "y": 1 },
+ "s": [0],
+ "t": 0
+ },
+ { "s": [360], "t": 90 }
+ ]
+ },
+ "sa": { "a": 0, "k": 0 },
+ "o": { "a": 0, "k": 100 }
+ },
+ "shapes": [
+ {
+ "ty": "gr",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Group",
+ "nm": "Ellipse 1",
+ "ix": 1,
+ "cix": 2,
+ "np": 3,
+ "it": [
+ {
+ "ty": "el",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Shape - Ellipse",
+ "nm": "Ellipse Path 1",
+ "d": 1,
+ "p": { "a": 0, "k": [0, -100] },
+ "s": {
+ "a": 1,
+ "k": [
+ {
+ "o": { "x": 0.333, "y": 0 },
+ "i": { "x": 0.667, "y": 1 },
+ "s": [50, 50],
+ "t": 0
+ },
+ {
+ "o": { "x": 0.333, "y": 0 },
+ "i": { "x": 0.667, "y": 1 },
+ "s": [40, 40],
+ "t": 84
+ },
+ { "s": [50, 50], "t": 100 }
+ ]
+ }
+ },
+ {
+ "ty": "st",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Graphic - Stroke",
+ "nm": "Stroke 1",
+ "lc": 1,
+ "lj": 1,
+ "ml": 4,
+ "o": { "a": 0, "k": 100 },
+ "w": { "a": 0, "k": 0 },
+ "c": { "a": 0, "k": [0, 0, 0] }
+ },
+ {
+ "ty": "fl",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Graphic - Fill",
+ "nm": "Fill 1",
+ "c": { "a": 0, "k": [0.0353, 0.2902, 0.4] },
+ "r": 1,
+ "o": { "a": 0, "k": 100 }
+ },
+ {
+ "ty": "tr",
+ "a": { "a": 0, "k": [0, 0], "ix": 1 },
+ "s": { "a": 0, "k": [100, 100], "ix": 3 },
+ "sk": { "a": 0, "k": 0, "ix": 4 },
+ "p": { "a": 0, "k": [0, 0], "ix": 2 },
+ "r": { "a": 0, "k": 0, "ix": 6 },
+ "sa": { "a": 0, "k": 0, "ix": 5 },
+ "o": { "a": 0, "k": 100, "ix": 7 }
+ }
+ ]
+ }
+ ],
+ "ind": 5
+ }
+ ],
+ "v": "5.7.0",
+ "fr": 60,
+ "op": 106,
+ "ip": 0,
+ "assets": []
+}
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/constants/animations/theLoaderWhite.json b/micro-ui/web/micro-ui-internals/packages/ui-components/src/constants/animations/theLoaderWhite.json
new file mode 100644
index 00000000..adf3127c
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/constants/animations/theLoaderWhite.json
@@ -0,0 +1,880 @@
+{
+ "nm": "Main Scene",
+ "ddd": 0,
+ "h": 500,
+ "w": 500,
+ "meta": {
+ "g": "@lottiefiles/creator 1.37.1"
+ },
+ "layers": [
+ {
+ "ty": 4,
+ "nm": "Shape Layer 5",
+ "sr": 1,
+ "st": 20,
+ "op": 620,
+ "ip": 20,
+ "hd": false,
+ "ddd": 0,
+ "bm": 0,
+ "hasMask": false,
+ "ao": 0,
+ "ks": {
+ "a": {
+ "a": 0,
+ "k": [0, 0, 0]
+ },
+ "s": {
+ "a": 0,
+ "k": [100, 100]
+ },
+ "sk": {
+ "a": 0,
+ "k": 0
+ },
+ "p": {
+ "a": 0,
+ "k": [251, 250]
+ },
+ "r": {
+ "a": 1,
+ "k": [
+ {
+ "o": {
+ "x": 0.333,
+ "y": 0
+ },
+ "i": {
+ "x": 0.667,
+ "y": 1
+ },
+ "s": [0],
+ "t": 20
+ },
+ {
+ "s": [360],
+ "t": 110
+ }
+ ]
+ },
+ "sa": {
+ "a": 0,
+ "k": 0
+ },
+ "o": {
+ "a": 0,
+ "k": 100
+ }
+ },
+ "shapes": [
+ {
+ "ty": "gr",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Group",
+ "nm": "Ellipse 1",
+ "ix": 1,
+ "cix": 2,
+ "np": 3,
+ "it": [
+ {
+ "ty": "el",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Shape - Ellipse",
+ "nm": "Ellipse Path 1",
+ "d": 1,
+ "p": {
+ "a": 0,
+ "k": [0, -100]
+ },
+ "s": {
+ "a": 0,
+ "k": [10, 10]
+ }
+ },
+ {
+ "ty": "st",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Graphic - Stroke",
+ "nm": "Stroke 1",
+ "lc": 1,
+ "lj": 1,
+ "ml": 4,
+ "o": {
+ "a": 0,
+ "k": 100
+ },
+ "w": {
+ "a": 0,
+ "k": 0
+ },
+ "c": {
+ "a": 0,
+ "k": [0, 0, 0]
+ }
+ },
+ {
+ "ty": "fl",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Graphic - Fill",
+ "nm": "Fill 1",
+ "c": {
+ "a": 0,
+ "k": [1, 1, 1]
+ },
+ "r": 1,
+ "o": {
+ "a": 0,
+ "k": 100
+ }
+ },
+ {
+ "ty": "tr",
+ "a": {
+ "a": 0,
+ "k": [0, 0],
+ "ix": 1
+ },
+ "s": {
+ "a": 0,
+ "k": [100, 100],
+ "ix": 3
+ },
+ "sk": {
+ "a": 0,
+ "k": 0,
+ "ix": 4
+ },
+ "p": {
+ "a": 0,
+ "k": [0, 0],
+ "ix": 2
+ },
+ "r": {
+ "a": 0,
+ "k": 0,
+ "ix": 6
+ },
+ "sa": {
+ "a": 0,
+ "k": 0,
+ "ix": 5
+ },
+ "o": {
+ "a": 0,
+ "k": 100,
+ "ix": 7
+ }
+ }
+ ]
+ }
+ ],
+ "ind": 1
+ },
+ {
+ "ty": 4,
+ "nm": "Shape Layer 4",
+ "sr": 1,
+ "st": 15,
+ "op": 615,
+ "ip": 15,
+ "hd": false,
+ "ddd": 0,
+ "bm": 0,
+ "hasMask": false,
+ "ao": 0,
+ "ks": {
+ "a": {
+ "a": 0,
+ "k": [0, 0, 0]
+ },
+ "s": {
+ "a": 0,
+ "k": [100, 100]
+ },
+ "sk": {
+ "a": 0,
+ "k": 0
+ },
+ "p": {
+ "a": 0,
+ "k": [251, 250]
+ },
+ "r": {
+ "a": 1,
+ "k": [
+ {
+ "o": {
+ "x": 0.333,
+ "y": 0
+ },
+ "i": {
+ "x": 0.667,
+ "y": 1
+ },
+ "s": [0],
+ "t": 15
+ },
+ {
+ "s": [360],
+ "t": 105
+ }
+ ]
+ },
+ "sa": {
+ "a": 0,
+ "k": 0
+ },
+ "o": {
+ "a": 0,
+ "k": 100
+ }
+ },
+ "shapes": [
+ {
+ "ty": "gr",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Group",
+ "nm": "Ellipse 1",
+ "ix": 1,
+ "cix": 2,
+ "np": 3,
+ "it": [
+ {
+ "ty": "el",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Shape - Ellipse",
+ "nm": "Ellipse Path 1",
+ "d": 1,
+ "p": {
+ "a": 0,
+ "k": [0, -100]
+ },
+ "s": {
+ "a": 0,
+ "k": [20, 20]
+ }
+ },
+ {
+ "ty": "st",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Graphic - Stroke",
+ "nm": "Stroke 1",
+ "lc": 1,
+ "lj": 1,
+ "ml": 4,
+ "o": {
+ "a": 0,
+ "k": 100
+ },
+ "w": {
+ "a": 0,
+ "k": 0
+ },
+ "c": {
+ "a": 0,
+ "k": [0, 0, 0]
+ }
+ },
+ {
+ "ty": "fl",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Graphic - Fill",
+ "nm": "Fill 1",
+ "c": {
+ "a": 0,
+ "k": [1, 1, 1]
+ },
+ "r": 1,
+ "o": {
+ "a": 0,
+ "k": 100
+ }
+ },
+ {
+ "ty": "tr",
+ "a": {
+ "a": 0,
+ "k": [0, 0],
+ "ix": 1
+ },
+ "s": {
+ "a": 0,
+ "k": [100, 100],
+ "ix": 3
+ },
+ "sk": {
+ "a": 0,
+ "k": 0,
+ "ix": 4
+ },
+ "p": {
+ "a": 0,
+ "k": [0, 0],
+ "ix": 2
+ },
+ "r": {
+ "a": 0,
+ "k": 0,
+ "ix": 6
+ },
+ "sa": {
+ "a": 0,
+ "k": 0,
+ "ix": 5
+ },
+ "o": {
+ "a": 0,
+ "k": 100,
+ "ix": 7
+ }
+ }
+ ]
+ }
+ ],
+ "ind": 2
+ },
+ {
+ "ty": 4,
+ "nm": "Shape Layer 3",
+ "sr": 1,
+ "st": 10,
+ "op": 610,
+ "ip": 10,
+ "hd": false,
+ "ddd": 0,
+ "bm": 0,
+ "hasMask": false,
+ "ao": 0,
+ "ks": {
+ "a": {
+ "a": 0,
+ "k": [0, 0, 0]
+ },
+ "s": {
+ "a": 0,
+ "k": [100, 100]
+ },
+ "sk": {
+ "a": 0,
+ "k": 0
+ },
+ "p": {
+ "a": 0,
+ "k": [251, 250]
+ },
+ "r": {
+ "a": 1,
+ "k": [
+ {
+ "o": {
+ "x": 0.333,
+ "y": 0
+ },
+ "i": {
+ "x": 0.667,
+ "y": 1
+ },
+ "s": [0],
+ "t": 10
+ },
+ {
+ "s": [360],
+ "t": 100
+ }
+ ]
+ },
+ "sa": {
+ "a": 0,
+ "k": 0
+ },
+ "o": {
+ "a": 0,
+ "k": 100
+ }
+ },
+ "shapes": [
+ {
+ "ty": "gr",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Group",
+ "nm": "Ellipse 1",
+ "ix": 1,
+ "cix": 2,
+ "np": 3,
+ "it": [
+ {
+ "ty": "el",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Shape - Ellipse",
+ "nm": "Ellipse Path 1",
+ "d": 1,
+ "p": {
+ "a": 0,
+ "k": [0, -100]
+ },
+ "s": {
+ "a": 0,
+ "k": [30, 30]
+ }
+ },
+ {
+ "ty": "st",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Graphic - Stroke",
+ "nm": "Stroke 1",
+ "lc": 1,
+ "lj": 1,
+ "ml": 4,
+ "o": {
+ "a": 0,
+ "k": 100
+ },
+ "w": {
+ "a": 0,
+ "k": 0
+ },
+ "c": {
+ "a": 0,
+ "k": [0, 0, 0]
+ }
+ },
+ {
+ "ty": "fl",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Graphic - Fill",
+ "nm": "Fill 1",
+ "c": {
+ "a": 0,
+ "k": [1, 1, 1]
+ },
+ "r": 1,
+ "o": {
+ "a": 0,
+ "k": 100
+ }
+ },
+ {
+ "ty": "tr",
+ "a": {
+ "a": 0,
+ "k": [0, 0],
+ "ix": 1
+ },
+ "s": {
+ "a": 0,
+ "k": [100, 100],
+ "ix": 3
+ },
+ "sk": {
+ "a": 0,
+ "k": 0,
+ "ix": 4
+ },
+ "p": {
+ "a": 0,
+ "k": [0, 0],
+ "ix": 2
+ },
+ "r": {
+ "a": 0,
+ "k": 0,
+ "ix": 6
+ },
+ "sa": {
+ "a": 0,
+ "k": 0,
+ "ix": 5
+ },
+ "o": {
+ "a": 0,
+ "k": 100,
+ "ix": 7
+ }
+ }
+ ]
+ }
+ ],
+ "ind": 3
+ },
+ {
+ "ty": 4,
+ "nm": "Shape Layer 2",
+ "sr": 1,
+ "st": 5,
+ "op": 605,
+ "ip": 5,
+ "hd": false,
+ "ddd": 0,
+ "bm": 0,
+ "hasMask": false,
+ "ao": 0,
+ "ks": {
+ "a": {
+ "a": 0,
+ "k": [0, 0, 0]
+ },
+ "s": {
+ "a": 0,
+ "k": [100, 100]
+ },
+ "sk": {
+ "a": 0,
+ "k": 0
+ },
+ "p": {
+ "a": 0,
+ "k": [251, 250]
+ },
+ "r": {
+ "a": 1,
+ "k": [
+ {
+ "o": {
+ "x": 0.333,
+ "y": 0
+ },
+ "i": {
+ "x": 0.667,
+ "y": 1
+ },
+ "s": [0],
+ "t": 5
+ },
+ {
+ "s": [360],
+ "t": 95
+ }
+ ]
+ },
+ "sa": {
+ "a": 0,
+ "k": 0
+ },
+ "o": {
+ "a": 0,
+ "k": 100
+ }
+ },
+ "shapes": [
+ {
+ "ty": "gr",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Group",
+ "nm": "Ellipse 1",
+ "ix": 1,
+ "cix": 2,
+ "np": 3,
+ "it": [
+ {
+ "ty": "el",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Shape - Ellipse",
+ "nm": "Ellipse Path 1",
+ "d": 1,
+ "p": {
+ "a": 0,
+ "k": [0, -100]
+ },
+ "s": {
+ "a": 0,
+ "k": [40, 40]
+ }
+ },
+ {
+ "ty": "st",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Graphic - Stroke",
+ "nm": "Stroke 1",
+ "lc": 1,
+ "lj": 1,
+ "ml": 4,
+ "o": {
+ "a": 0,
+ "k": 100
+ },
+ "w": {
+ "a": 0,
+ "k": 0
+ },
+ "c": {
+ "a": 0,
+ "k": [0, 0, 0]
+ }
+ },
+ {
+ "ty": "fl",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Graphic - Fill",
+ "nm": "Fill 1",
+ "c": {
+ "a": 0,
+ "k": [1, 1, 1]
+ },
+ "r": 1,
+ "o": {
+ "a": 0,
+ "k": 100
+ }
+ },
+ {
+ "ty": "tr",
+ "a": {
+ "a": 0,
+ "k": [0, 0],
+ "ix": 1
+ },
+ "s": {
+ "a": 0,
+ "k": [100, 100],
+ "ix": 3
+ },
+ "sk": {
+ "a": 0,
+ "k": 0,
+ "ix": 4
+ },
+ "p": {
+ "a": 0,
+ "k": [0, 0],
+ "ix": 2
+ },
+ "r": {
+ "a": 0,
+ "k": 0,
+ "ix": 6
+ },
+ "sa": {
+ "a": 0,
+ "k": 0,
+ "ix": 5
+ },
+ "o": {
+ "a": 0,
+ "k": 100,
+ "ix": 7
+ }
+ }
+ ]
+ }
+ ],
+ "ind": 4
+ },
+ {
+ "ty": 4,
+ "nm": "Shape Layer 1",
+ "sr": 1,
+ "st": 0,
+ "op": 600,
+ "ip": 0,
+ "hd": false,
+ "ddd": 0,
+ "bm": 0,
+ "hasMask": false,
+ "ao": 0,
+ "ks": {
+ "a": {
+ "a": 0,
+ "k": [0, 0, 0]
+ },
+ "s": {
+ "a": 0,
+ "k": [100, 100]
+ },
+ "sk": {
+ "a": 0,
+ "k": 0
+ },
+ "p": {
+ "a": 0,
+ "k": [250, 250]
+ },
+ "r": {
+ "a": 1,
+ "k": [
+ {
+ "o": {
+ "x": 0.333,
+ "y": 0
+ },
+ "i": {
+ "x": 0.667,
+ "y": 1
+ },
+ "s": [0],
+ "t": 0
+ },
+ {
+ "s": [360],
+ "t": 90
+ }
+ ]
+ },
+ "sa": {
+ "a": 0,
+ "k": 0
+ },
+ "o": {
+ "a": 0,
+ "k": 100
+ }
+ },
+ "shapes": [
+ {
+ "ty": "gr",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Group",
+ "nm": "Ellipse 1",
+ "ix": 1,
+ "cix": 2,
+ "np": 3,
+ "it": [
+ {
+ "ty": "el",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Shape - Ellipse",
+ "nm": "Ellipse Path 1",
+ "d": 1,
+ "p": {
+ "a": 0,
+ "k": [0, -100]
+ },
+ "s": {
+ "a": 1,
+ "k": [
+ {
+ "o": {
+ "x": 0.333,
+ "y": 0
+ },
+ "i": {
+ "x": 0.667,
+ "y": 1
+ },
+ "s": [50, 50],
+ "t": 0
+ },
+ {
+ "o": {
+ "x": 0.333,
+ "y": 0
+ },
+ "i": {
+ "x": 0.667,
+ "y": 1
+ },
+ "s": [40, 40],
+ "t": 84
+ },
+ {
+ "s": [50, 50],
+ "t": 100
+ }
+ ]
+ }
+ },
+ {
+ "ty": "st",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Graphic - Stroke",
+ "nm": "Stroke 1",
+ "lc": 1,
+ "lj": 1,
+ "ml": 4,
+ "o": {
+ "a": 0,
+ "k": 100
+ },
+ "w": {
+ "a": 0,
+ "k": 0
+ },
+ "c": {
+ "a": 0,
+ "k": [0, 0, 0]
+ }
+ },
+ {
+ "ty": "fl",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Graphic - Fill",
+ "nm": "Fill 1",
+ "c": {
+ "a": 0,
+ "k": [1, 1, 1]
+ },
+ "r": 1,
+ "o": {
+ "a": 0,
+ "k": 100
+ }
+ },
+ {
+ "ty": "tr",
+ "a": {
+ "a": 0,
+ "k": [0, 0],
+ "ix": 1
+ },
+ "s": {
+ "a": 0,
+ "k": [100, 100],
+ "ix": 3
+ },
+ "sk": {
+ "a": 0,
+ "k": 0,
+ "ix": 4
+ },
+ "p": {
+ "a": 0,
+ "k": [0, 0],
+ "ix": 2
+ },
+ "r": {
+ "a": 0,
+ "k": 0,
+ "ix": 6
+ },
+ "sa": {
+ "a": 0,
+ "k": 0,
+ "ix": 5
+ },
+ "o": {
+ "a": 0,
+ "k": 100,
+ "ix": 7
+ }
+ }
+ ]
+ }
+ ],
+ "ind": 5
+ }
+ ],
+ "v": "5.7.0",
+ "fr": 60,
+ "op": 106,
+ "ip": 0,
+ "assets": []
+}
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/constants/animations/warningOutline.json b/micro-ui/web/micro-ui-internals/packages/ui-components/src/constants/animations/warningOutline.json
new file mode 100644
index 00000000..14489e5e
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/constants/animations/warningOutline.json
@@ -0,0 +1,1127 @@
+{
+ "nm": "48 - Warning",
+ "ddd": 0,
+ "h": 500,
+ "w": 500,
+ "meta": {
+ "g": "LottieFiles AE "
+ },
+ "layers": [
+ {
+ "ty": 3,
+ "nm": "48 - Warning",
+ "sr": 1,
+ "st": 0,
+ "op": 144,
+ "ip": 0,
+ "hd": false,
+ "ddd": 0,
+ "bm": 0,
+ "hasMask": false,
+ "ao": 0,
+ "ks": {
+ "a": {
+ "a": 0,
+ "k": [
+ 60,
+ 60,
+ 0
+ ],
+ "ix": 1
+ },
+ "s": {
+ "a": 0,
+ "k": [
+ 180,
+ 180,
+ 100
+ ],
+ "ix": 6
+ },
+ "sk": {
+ "a": 0,
+ "k": 0
+ },
+ "p": {
+ "a": 0,
+ "k": [
+ 250.045,
+ 290.339,
+ 0
+ ],
+ "ix": 2
+ },
+ "r": {
+ "a": 0,
+ "k": 0,
+ "ix": 10
+ },
+ "sa": {
+ "a": 0,
+ "k": 0
+ },
+ "o": {
+ "a": 0,
+ "k": 0,
+ "ix": 11
+ }
+ },
+ "ef": [],
+ "ind": 1
+ },
+ {
+ "ty": 4,
+ "nm": "Line",
+ "sr": 1,
+ "st": 0,
+ "op": 144,
+ "ip": 12,
+ "hd": false,
+ "ddd": 0,
+ "bm": 0,
+ "hasMask": false,
+ "ao": 0,
+ "ks": {
+ "a": {
+ "a": 0,
+ "k": [
+ -1,
+ 21.25,
+ 0
+ ],
+ "ix": 1
+ },
+ "s": {
+ "a": 1,
+ "k": [
+ {
+ "o": {
+ "x": 0.167,
+ "y": 0.167
+ },
+ "i": {
+ "x": 0,
+ "y": 1
+ },
+ "s": [
+ 0,
+ 0,
+ 100
+ ],
+ "t": 12
+ },
+ {
+ "s": [
+ 55.556,
+ 55.556,
+ 100
+ ],
+ "t": 32
+ }
+ ],
+ "ix": 6
+ },
+ "sk": {
+ "a": 0,
+ "k": 0
+ },
+ "p": {
+ "a": 0,
+ "k": [
+ 85.533,
+ 85.887,
+ 0
+ ],
+ "ix": 2
+ },
+ "r": {
+ "a": 1,
+ "k": [
+ {
+ "o": {
+ "x": 0.167,
+ "y": 0.167
+ },
+ "i": {
+ "x": 0,
+ "y": 1
+ },
+ "s": [
+ 180
+ ],
+ "t": 12
+ },
+ {
+ "s": [
+ 0
+ ],
+ "t": 32
+ }
+ ],
+ "ix": 10
+ },
+ "sa": {
+ "a": 0,
+ "k": 0
+ },
+ "o": {
+ "a": 0,
+ "k": 100,
+ "ix": 11
+ }
+ },
+ "ef": [],
+ "shapes": [
+ {
+ "ty": "gr",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Group",
+ "nm": "Shape 1",
+ "ix": 1,
+ "cix": 2,
+ "np": 3,
+ "it": [
+ {
+ "ty": "sh",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Shape - Group",
+ "nm": "Path 1",
+ "ix": 1,
+ "d": 1,
+ "ks": {
+ "a": 0,
+ "k": {
+ "c": false,
+ "i": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 0,
+ 0
+ ]
+ ],
+ "o": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 0,
+ 0
+ ]
+ ],
+ "v": [
+ [
+ -1,
+ 80
+ ],
+ [
+ -1,
+ -37.5
+ ]
+ ]
+ },
+ "ix": 2
+ }
+ },
+ {
+ "ty": "st",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Graphic - Stroke",
+ "nm": "Stroke 1",
+ "lc": 2,
+ "lj": 1,
+ "ml": 4,
+ "o": {
+ "a": 0,
+ "k": 100,
+ "ix": 4
+ },
+ "w": {
+ "a": 0,
+ "k": 28,
+ "ix": 5
+ },
+ "c": {
+ "a": 0,
+ "k": [
+ 1,
+ 1,
+ 1
+ ],
+ "ix": 3
+ }
+ },
+ {
+ "ty": "tr",
+ "a": {
+ "a": 0,
+ "k": [
+ 0,
+ 0
+ ],
+ "ix": 1
+ },
+ "s": {
+ "a": 0,
+ "k": [
+ 100,
+ 100
+ ],
+ "ix": 3
+ },
+ "sk": {
+ "a": 0,
+ "k": 0,
+ "ix": 4
+ },
+ "p": {
+ "a": 0,
+ "k": [
+ 0,
+ 0
+ ],
+ "ix": 2
+ },
+ "r": {
+ "a": 0,
+ "k": 0,
+ "ix": 6
+ },
+ "sa": {
+ "a": 0,
+ "k": 0,
+ "ix": 5
+ },
+ "o": {
+ "a": 0,
+ "k": 100,
+ "ix": 7
+ }
+ }
+ ]
+ },
+ {
+ "ty": "tm",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Filter - Trim",
+ "nm": "Trim Paths 1",
+ "ix": 2,
+ "e": {
+ "a": 0,
+ "k": 100,
+ "ix": 2
+ },
+ "o": {
+ "a": 0,
+ "k": 0,
+ "ix": 3
+ },
+ "s": {
+ "a": 1,
+ "k": [
+ {
+ "o": {
+ "x": 0.167,
+ "y": 0.167
+ },
+ "i": {
+ "x": 0,
+ "y": 1
+ },
+ "s": [
+ 0
+ ],
+ "t": 22
+ },
+ {
+ "s": [
+ 40
+ ],
+ "t": 42
+ }
+ ],
+ "ix": 1
+ },
+ "m": 1
+ }
+ ],
+ "ind": 2,
+ "parent": 5
+ },
+ {
+ "ty": 4,
+ "nm": "Dot",
+ "sr": 1,
+ "st": 0,
+ "op": 144,
+ "ip": 12,
+ "hd": false,
+ "ddd": 0,
+ "bm": 0,
+ "hasMask": false,
+ "ao": 0,
+ "ks": {
+ "a": {
+ "a": 0,
+ "k": [
+ 0,
+ 0,
+ 0
+ ],
+ "ix": 1
+ },
+ "s": {
+ "a": 0,
+ "k": [
+ 100,
+ 100,
+ 100
+ ],
+ "ix": 6
+ },
+ "sk": {
+ "a": 0,
+ "k": 0
+ },
+ "p": {
+ "a": 0,
+ "k": [
+ 0,
+ 0,
+ 0
+ ],
+ "ix": 2
+ },
+ "r": {
+ "a": 0,
+ "k": 0,
+ "ix": 10
+ },
+ "sa": {
+ "a": 0,
+ "k": 0
+ },
+ "o": {
+ "a": 0,
+ "k": 100,
+ "ix": 11
+ }
+ },
+ "ef": [],
+ "shapes": [
+ {
+ "ty": "gr",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Group",
+ "nm": "Shape 1",
+ "ix": 1,
+ "cix": 2,
+ "np": 4,
+ "it": [
+ {
+ "ty": "sh",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Shape - Group",
+ "nm": "Path 1",
+ "ix": 1,
+ "d": 1,
+ "ks": {
+ "a": 0,
+ "k": {
+ "c": false,
+ "i": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 0,
+ 0
+ ]
+ ],
+ "o": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 0,
+ 0
+ ]
+ ],
+ "v": [
+ [
+ -1,
+ 80
+ ],
+ [
+ -1,
+ -37.5
+ ]
+ ]
+ },
+ "ix": 2
+ }
+ },
+ {
+ "ty": "tm",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Filter - Trim",
+ "nm": "Trim Paths 1",
+ "ix": 2,
+ "e": {
+ "a": 0,
+ "k": 0.1,
+ "ix": 2
+ },
+ "o": {
+ "a": 0,
+ "k": 0,
+ "ix": 3
+ },
+ "s": {
+ "a": 0,
+ "k": 0,
+ "ix": 1
+ },
+ "m": 1
+ },
+ {
+ "ty": "st",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Graphic - Stroke",
+ "nm": "Stroke 1",
+ "lc": 2,
+ "lj": 1,
+ "ml": 4,
+ "o": {
+ "a": 0,
+ "k": 100,
+ "ix": 4
+ },
+ "w": {
+ "a": 0,
+ "k": 33,
+ "ix": 5
+ },
+ "c": {
+ "a": 0,
+ "k": [
+ 1,
+ 1,
+ 1
+ ],
+ "ix": 3
+ }
+ },
+ {
+ "ty": "tr",
+ "a": {
+ "a": 0,
+ "k": [
+ 0,
+ 0
+ ],
+ "ix": 1
+ },
+ "s": {
+ "a": 0,
+ "k": [
+ 100,
+ 100
+ ],
+ "ix": 3
+ },
+ "sk": {
+ "a": 0,
+ "k": 0,
+ "ix": 4
+ },
+ "p": {
+ "a": 0,
+ "k": [
+ 0,
+ 0
+ ],
+ "ix": 2
+ },
+ "r": {
+ "a": 0,
+ "k": 0,
+ "ix": 6
+ },
+ "sa": {
+ "a": 0,
+ "k": 0,
+ "ix": 5
+ },
+ "o": {
+ "a": 0,
+ "k": 100,
+ "ix": 7
+ }
+ }
+ ]
+ }
+ ],
+ "ind": 3,
+ "parent": 2
+ },
+ {
+ "ty": 4,
+ "nm": "Tri Outlines",
+ "sr": 1,
+ "st": 0,
+ "op": 144,
+ "ip": 10,
+ "hd": false,
+ "ddd": 0,
+ "bm": 0,
+ "hasMask": false,
+ "ao": 0,
+ "ks": {
+ "a": {
+ "a": 0,
+ "k": [
+ 85.513,
+ 72.848,
+ 0
+ ],
+ "ix": 1
+ },
+ "s": {
+ "a": 1,
+ "k": [
+ {
+ "o": {
+ "x": 0.167,
+ "y": 0.167
+ },
+ "i": {
+ "x": 0.833,
+ "y": 0.833
+ },
+ "s": [
+ 0,
+ 0,
+ 100
+ ],
+ "t": 10
+ },
+ {
+ "s": [
+ 100,
+ 100,
+ 100
+ ],
+ "t": 15
+ }
+ ],
+ "ix": 6,
+ "x": "var $bm_rt;\nvar amp, freq, decay, n, t, v;\ntry {\n amp = $bm_div(effect('Scale - Overshoot')('ADBE Slider Control-0001'), 2.5), freq = $bm_div(effect('Scale - Bounce')('ADBE Slider Control-0001'), 20), decay = $bm_div(effect('Scale - Friction')('ADBE Slider Control-0001'), 20), n = 0, 0 < numKeys && (n = nearestKey(time).index, key(n).time > time && n--), t = 0 === n ? 0 : $bm_sub(time, key(n).time), $bm_rt = 0 < n ? (v = velocityAtTime($bm_sub(key(n).time, $bm_div(thisComp.frameDuration, 10))), $bm_sum(value, $bm_div($bm_mul($bm_mul($bm_div(v, 100), amp), Math.sin($bm_mul($bm_mul($bm_mul(freq, t), 2), Math.PI))), Math.exp($bm_mul(decay, t))))) : value;\n} catch (e$$4) {\n $bm_rt = value = value;\n}"
+ },
+ "sk": {
+ "a": 0,
+ "k": 0
+ },
+ "p": {
+ "a": 0,
+ "k": [
+ 59.955,
+ 37.467,
+ 0
+ ],
+ "ix": 2
+ },
+ "r": {
+ "a": 0,
+ "k": 0,
+ "ix": 10
+ },
+ "sa": {
+ "a": 0,
+ "k": 0
+ },
+ "o": {
+ "a": 0,
+ "k": 100,
+ "ix": 11
+ }
+ },
+ "ef": [
+ {
+ "ty": 5,
+ "mn": "ADBE Slider Control",
+ "nm": "Scale - Overshoot",
+ "ix": 1,
+ "en": 1,
+ "ef": [
+ {
+ "ty": 0,
+ "mn": "ADBE Slider Control-0001",
+ "nm": "Slider",
+ "ix": 1,
+ "v": {
+ "a": 0,
+ "k": 10,
+ "ix": 1,
+ "x": "var $bm_rt;\n$bm_rt = clamp(value, 0, 100);"
+ }
+ }
+ ]
+ },
+ {
+ "ty": 5,
+ "mn": "ADBE Slider Control",
+ "nm": "Scale - Bounce",
+ "ix": 2,
+ "en": 1,
+ "ef": [
+ {
+ "ty": 0,
+ "mn": "ADBE Slider Control-0001",
+ "nm": "Slider",
+ "ix": 1,
+ "v": {
+ "a": 0,
+ "k": 35,
+ "ix": 1,
+ "x": "var $bm_rt;\n$bm_rt = clamp(value, 0, 100);"
+ }
+ }
+ ]
+ },
+ {
+ "ty": 5,
+ "mn": "ADBE Slider Control",
+ "nm": "Scale - Friction",
+ "ix": 3,
+ "en": 1,
+ "ef": [
+ {
+ "ty": 0,
+ "mn": "ADBE Slider Control-0001",
+ "nm": "Slider",
+ "ix": 1,
+ "v": {
+ "a": 0,
+ "k": 65,
+ "ix": 1,
+ "x": "var $bm_rt;\n$bm_rt = clamp(value, 0, 100);"
+ }
+ }
+ ]
+ }
+ ],
+ "shapes": [
+ {
+ "ty": "gr",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Group",
+ "nm": "Group 1",
+ "ix": 1,
+ "cix": 2,
+ "np": 2,
+ "it": [
+ {
+ "ty": "sh",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Shape - Group",
+ "nm": "Path 1",
+ "ix": 1,
+ "d": 1,
+ "ks": {
+ "a": 0,
+ "k": {
+ "c": true,
+ "i": [
+ [
+ -3.315,
+ 5.634
+ ],
+ [
+ 0,
+ 0
+ ],
+ [
+ -3.267,
+ -5.554
+ ],
+ [
+ 0,
+ 0
+ ],
+ [
+ 6.537,
+ 0
+ ],
+ [
+ 0,
+ 0
+ ]
+ ],
+ "o": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 3.268,
+ -5.554
+ ],
+ [
+ 0,
+ 0
+ ],
+ [
+ 3.315,
+ 5.634
+ ],
+ [
+ 0,
+ 0
+ ],
+ [
+ -6.536,
+ 0
+ ]
+ ],
+ "v": [
+ [
+ -81.948,
+ 59.861
+ ],
+ [
+ -7.284,
+ -67.044
+ ],
+ [
+ 7.284,
+ -67.044
+ ],
+ [
+ 81.948,
+ 59.861
+ ],
+ [
+ 74.664,
+ 72.598
+ ],
+ [
+ -74.664,
+ 72.598
+ ]
+ ]
+ },
+ "ix": 2
+ }
+ },
+ {
+ "ty": "fl",
+ "bm": 0,
+ "hd": false,
+ "mn": "ADBE Vector Graphic - Fill",
+ "nm": "Fill 1",
+ "c": {
+ "a": 0,
+ "k": [
+ 0.7255,
+ 0.098,
+ 0
+ ],
+ "ix": 4
+ },
+ "r": 1,
+ "o": {
+ "a": 0,
+ "k": 100,
+ "ix": 5
+ }
+ },
+ {
+ "ty": "tr",
+ "a": {
+ "a": 0,
+ "k": [
+ 0,
+ 0
+ ],
+ "ix": 1
+ },
+ "s": {
+ "a": 0,
+ "k": [
+ 100,
+ 100
+ ],
+ "ix": 3
+ },
+ "sk": {
+ "a": 0,
+ "k": 0,
+ "ix": 4
+ },
+ "p": {
+ "a": 0,
+ "k": [
+ 85.513,
+ 72.848
+ ],
+ "ix": 2
+ },
+ "r": {
+ "a": 0,
+ "k": 0,
+ "ix": 6
+ },
+ "sa": {
+ "a": 0,
+ "k": 0,
+ "ix": 5
+ },
+ "o": {
+ "a": 0,
+ "k": 100,
+ "ix": 7
+ }
+ }
+ ]
+ }
+ ],
+ "ind": 4,
+ "parent": 1
+ },
+ {
+ "ty": 3,
+ "nm": "Tri",
+ "sr": 1,
+ "st": 0,
+ "op": 144,
+ "ip": 10,
+ "hd": false,
+ "ddd": 0,
+ "bm": 0,
+ "hasMask": false,
+ "ao": 0,
+ "ks": {
+ "a": {
+ "a": 0,
+ "k": [
+ 85.513,
+ 72.848,
+ 0
+ ],
+ "ix": 1
+ },
+ "s": {
+ "a": 1,
+ "k": [
+ {
+ "o": {
+ "x": 0.167,
+ "y": 0.167
+ },
+ "i": {
+ "x": 0.833,
+ "y": 0.833
+ },
+ "s": [
+ 0,
+ 0,
+ 100
+ ],
+ "t": 10
+ },
+ {
+ "s": [
+ 100,
+ 100,
+ 100
+ ],
+ "t": 15
+ }
+ ],
+ "ix": 6,
+ "x": "var $bm_rt;\nvar amp, freq, decay, n, t, v;\ntry {\n amp = $bm_div(effect('Scale - Overshoot')('ADBE Slider Control-0001'), 2.5), freq = $bm_div(effect('Scale - Bounce')('ADBE Slider Control-0001'), 20), decay = $bm_div(effect('Scale - Friction')('ADBE Slider Control-0001'), 20), n = 0, 0 < numKeys && (n = nearestKey(time).index, key(n).time > time && n--), t = 0 === n ? 0 : $bm_sub(time, key(n).time), $bm_rt = 0 < n ? (v = velocityAtTime($bm_sub(key(n).time, $bm_div(thisComp.frameDuration, 10))), $bm_sum(value, $bm_div($bm_mul($bm_mul($bm_div(v, 100), amp), Math.sin($bm_mul($bm_mul($bm_mul(freq, t), 2), Math.PI))), Math.exp($bm_mul(decay, t))))) : value;\n} catch (e$$4) {\n $bm_rt = value = value;\n}"
+ },
+ "sk": {
+ "a": 0,
+ "k": 0
+ },
+ "p": {
+ "a": 0,
+ "k": [
+ 59.955,
+ 37.467,
+ 0
+ ],
+ "ix": 2
+ },
+ "r": {
+ "a": 0,
+ "k": 0,
+ "ix": 10
+ },
+ "sa": {
+ "a": 0,
+ "k": 0
+ },
+ "o": {
+ "a": 0,
+ "k": 100,
+ "ix": 11
+ }
+ },
+ "ef": [
+ {
+ "ty": 5,
+ "mn": "ADBE Slider Control",
+ "nm": "Scale - Overshoot",
+ "ix": 1,
+ "en": 1,
+ "ef": [
+ {
+ "ty": 0,
+ "mn": "ADBE Slider Control-0001",
+ "nm": "Slider",
+ "ix": 1,
+ "v": {
+ "a": 0,
+ "k": 10,
+ "ix": 1,
+ "x": "var $bm_rt;\n$bm_rt = clamp(value, 0, 100);"
+ }
+ }
+ ]
+ },
+ {
+ "ty": 5,
+ "mn": "ADBE Slider Control",
+ "nm": "Scale - Bounce",
+ "ix": 2,
+ "en": 1,
+ "ef": [
+ {
+ "ty": 0,
+ "mn": "ADBE Slider Control-0001",
+ "nm": "Slider",
+ "ix": 1,
+ "v": {
+ "a": 0,
+ "k": 35,
+ "ix": 1,
+ "x": "var $bm_rt;\n$bm_rt = clamp(value, 0, 100);"
+ }
+ }
+ ]
+ },
+ {
+ "ty": 5,
+ "mn": "ADBE Slider Control",
+ "nm": "Scale - Friction",
+ "ix": 3,
+ "en": 1,
+ "ef": [
+ {
+ "ty": 0,
+ "mn": "ADBE Slider Control-0001",
+ "nm": "Slider",
+ "ix": 1,
+ "v": {
+ "a": 0,
+ "k": 65,
+ "ix": 1,
+ "x": "var $bm_rt;\n$bm_rt = clamp(value, 0, 100);"
+ }
+ }
+ ]
+ }
+ ],
+ "ind": 5,
+ "parent": 1
+ },
+ {
+ "ty": 1,
+ "nm": "Plate_white",
+ "sr": 1,
+ "st": 0,
+ "op": 144,
+ "ip": 0,
+ "hd": false,
+ "ddd": 0,
+ "bm": 0,
+ "hasMask": false,
+ "ao": 0,
+ "ks": {
+ "a": {
+ "a": 0,
+ "k": [
+ 250,
+ 250,
+ 0
+ ],
+ "ix": 1
+ },
+ "s": {
+ "a": 0,
+ "k": [
+ 100,
+ 100,
+ 100
+ ],
+ "ix": 6
+ },
+ "sk": {
+ "a": 0,
+ "k": 0
+ },
+ "p": {
+ "a": 0,
+ "k": [
+ 250,
+ 250,
+ 0
+ ],
+ "ix": 2
+ },
+ "r": {
+ "a": 0,
+ "k": 0,
+ "ix": 10
+ },
+ "sa": {
+ "a": 0,
+ "k": 0
+ },
+ "o": {
+ "a": 0,
+ "k": 100,
+ "ix": 11
+ }
+ },
+ "ef": [],
+ "sc": "#ffffff",
+ "sh": 500,
+ "sw": 500,
+ "ind": 6
+ }
+ ],
+ "v": "5.5.7",
+ "fr": 48,
+ "op": 144,
+ "ip": 0,
+ "assets": []
+ }
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/constants/animations/warningOutline2.json b/micro-ui/web/micro-ui-internals/packages/ui-components/src/constants/animations/warningOutline2.json
new file mode 100644
index 00000000..71d60994
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/constants/animations/warningOutline2.json
@@ -0,0 +1,2265 @@
+{
+ "nm": "newScene",
+ "ddd": 0,
+ "h": 300,
+ "w": 300,
+ "meta": {
+ "g": "@lottiefiles/toolkit-js 0.33.2"
+ },
+ "layers": [
+ {
+ "ty": 4,
+ "nm": "Layer 18",
+ "sr": 1,
+ "st": 0,
+ "op": 22,
+ "ip": 0,
+ "hd": false,
+ "ddd": 0,
+ "bm": 0,
+ "hasMask": false,
+ "ao": 0,
+ "ks": {
+ "a": {
+ "a": 0,
+ "k": [
+ 0,
+ 0,
+ 0
+ ]
+ },
+ "s": {
+ "a": 0,
+ "k": [
+ 60,
+ 60,
+ 100
+ ]
+ },
+ "sk": {
+ "a": 0,
+ "k": 0
+ },
+ "p": {
+ "a": 0,
+ "k": [
+ 16.827,
+ 19.071
+ ]
+ },
+ "r": {
+ "a": 0,
+ "k": 0
+ },
+ "sa": {
+ "a": 0,
+ "k": 0
+ },
+ "o": {
+ "a": 0,
+ "k": 100
+ }
+ },
+ "ef": [],
+ "shapes": [],
+ "ind": 1
+ },
+ {
+ "ty": 4,
+ "nm": "Layer 17",
+ "sr": 1,
+ "st": 0,
+ "op": 22,
+ "ip": 0,
+ "hd": false,
+ "ddd": 0,
+ "bm": 0,
+ "hasMask": false,
+ "ao": 0,
+ "ks": {
+ "a": {
+ "a": 0,
+ "k": [
+ 0,
+ 0,
+ 0
+ ]
+ },
+ "s": {
+ "a": 0,
+ "k": [
+ 60,
+ 60,
+ 100
+ ]
+ },
+ "sk": {
+ "a": 0,
+ "k": 0
+ },
+ "p": {
+ "a": 0,
+ "k": [
+ 16.827,
+ 19.071
+ ]
+ },
+ "r": {
+ "a": 0,
+ "k": 0
+ },
+ "sa": {
+ "a": 0,
+ "k": 0
+ },
+ "o": {
+ "a": 0,
+ "k": 100
+ }
+ },
+ "ef": [],
+ "shapes": [],
+ "ind": 2
+ },
+ {
+ "ty": 4,
+ "nm": "Layer 16",
+ "sr": 1,
+ "st": 0,
+ "op": 22,
+ "ip": 0,
+ "hd": false,
+ "ddd": 0,
+ "bm": 0,
+ "hasMask": false,
+ "ao": 0,
+ "ks": {
+ "a": {
+ "a": 0,
+ "k": [
+ 0,
+ 0,
+ 0
+ ]
+ },
+ "s": {
+ "a": 0,
+ "k": [
+ 60,
+ 60,
+ 100
+ ]
+ },
+ "sk": {
+ "a": 0,
+ "k": 0
+ },
+ "p": {
+ "a": 0,
+ "k": [
+ 16.827,
+ 19.071
+ ]
+ },
+ "r": {
+ "a": 0,
+ "k": 0
+ },
+ "sa": {
+ "a": 0,
+ "k": 0
+ },
+ "o": {
+ "a": 0,
+ "k": 100
+ }
+ },
+ "ef": [],
+ "shapes": [],
+ "ind": 3
+ },
+ {
+ "ty": 4,
+ "nm": "Layer 15",
+ "sr": 1,
+ "st": 0,
+ "op": 22,
+ "ip": 0,
+ "hd": false,
+ "ddd": 0,
+ "bm": 0,
+ "hasMask": false,
+ "ao": 0,
+ "ks": {
+ "a": {
+ "a": 0,
+ "k": [
+ 0,
+ 0,
+ 0
+ ]
+ },
+ "s": {
+ "a": 0,
+ "k": [
+ 60,
+ 60,
+ 100
+ ]
+ },
+ "sk": {
+ "a": 0,
+ "k": 0
+ },
+ "p": {
+ "a": 0,
+ "k": [
+ 16.827,
+ 19.071
+ ]
+ },
+ "r": {
+ "a": 0,
+ "k": 0
+ },
+ "sa": {
+ "a": 0,
+ "k": 0
+ },
+ "o": {
+ "a": 0,
+ "k": 100
+ }
+ },
+ "ef": [],
+ "shapes": [],
+ "ind": 4
+ },
+ {
+ "ty": 4,
+ "nm": "Layer 14",
+ "sr": 1,
+ "st": 0,
+ "op": 22,
+ "ip": 0,
+ "hd": false,
+ "ddd": 0,
+ "bm": 0,
+ "hasMask": false,
+ "ao": 0,
+ "ks": {
+ "a": {
+ "a": 0,
+ "k": [
+ 0,
+ 0,
+ 0
+ ]
+ },
+ "s": {
+ "a": 0,
+ "k": [
+ 60,
+ 60,
+ 100
+ ]
+ },
+ "sk": {
+ "a": 0,
+ "k": 0
+ },
+ "p": {
+ "a": 0,
+ "k": [
+ 16.827,
+ 19.071
+ ]
+ },
+ "r": {
+ "a": 0,
+ "k": 0
+ },
+ "sa": {
+ "a": 0,
+ "k": 0
+ },
+ "o": {
+ "a": 0,
+ "k": 100
+ }
+ },
+ "ef": [],
+ "shapes": [],
+ "ind": 5
+ },
+ {
+ "ty": 4,
+ "nm": "Layer 13",
+ "sr": 1,
+ "st": 0,
+ "op": 22,
+ "ip": 0,
+ "hd": false,
+ "ddd": 0,
+ "bm": 0,
+ "hasMask": false,
+ "ao": 0,
+ "ks": {
+ "a": {
+ "a": 0,
+ "k": [
+ 0,
+ 0,
+ 0
+ ]
+ },
+ "s": {
+ "a": 0,
+ "k": [
+ 60,
+ 60,
+ 100
+ ]
+ },
+ "sk": {
+ "a": 0,
+ "k": 0
+ },
+ "p": {
+ "a": 0,
+ "k": [
+ 16.827,
+ 19.071
+ ]
+ },
+ "r": {
+ "a": 0,
+ "k": 0
+ },
+ "sa": {
+ "a": 0,
+ "k": 0
+ },
+ "o": {
+ "a": 0,
+ "k": 100
+ }
+ },
+ "ef": [],
+ "shapes": [],
+ "ind": 6
+ },
+ {
+ "ty": 4,
+ "nm": "Layer 12",
+ "sr": 1,
+ "st": 0,
+ "op": 22,
+ "ip": 0,
+ "hd": false,
+ "ddd": 0,
+ "bm": 0,
+ "hasMask": false,
+ "ao": 0,
+ "ks": {
+ "a": {
+ "a": 0,
+ "k": [
+ 0,
+ 0,
+ 0
+ ]
+ },
+ "s": {
+ "a": 0,
+ "k": [
+ 60,
+ 60,
+ 100
+ ]
+ },
+ "sk": {
+ "a": 0,
+ "k": 0
+ },
+ "p": {
+ "a": 0,
+ "k": [
+ 16.827,
+ 19.071
+ ]
+ },
+ "r": {
+ "a": 0,
+ "k": 0
+ },
+ "sa": {
+ "a": 0,
+ "k": 0
+ },
+ "o": {
+ "a": 0,
+ "k": 100
+ }
+ },
+ "ef": [],
+ "shapes": [],
+ "ind": 7
+ },
+ {
+ "ty": 4,
+ "nm": "Layer 11",
+ "sr": 1,
+ "st": 0,
+ "op": 22,
+ "ip": 0,
+ "hd": false,
+ "ddd": 0,
+ "bm": 0,
+ "hasMask": false,
+ "ao": 0,
+ "ks": {
+ "a": {
+ "a": 0,
+ "k": [
+ 0,
+ 0,
+ 0
+ ]
+ },
+ "s": {
+ "a": 0,
+ "k": [
+ 60,
+ 60,
+ 100
+ ]
+ },
+ "sk": {
+ "a": 0,
+ "k": 0
+ },
+ "p": {
+ "a": 0,
+ "k": [
+ 16.827,
+ 19.071
+ ]
+ },
+ "r": {
+ "a": 0,
+ "k": 0
+ },
+ "sa": {
+ "a": 0,
+ "k": 0
+ },
+ "o": {
+ "a": 0,
+ "k": 100
+ }
+ },
+ "ef": [],
+ "shapes": [],
+ "ind": 8
+ },
+ {
+ "ty": 4,
+ "nm": "Layer 10",
+ "sr": 1,
+ "st": 0,
+ "op": 22,
+ "ip": 0,
+ "hd": false,
+ "ddd": 0,
+ "bm": 0,
+ "hasMask": false,
+ "ao": 0,
+ "ks": {
+ "a": {
+ "a": 0,
+ "k": [
+ 0,
+ 0,
+ 0
+ ]
+ },
+ "s": {
+ "a": 0,
+ "k": [
+ 60,
+ 60,
+ 100
+ ]
+ },
+ "sk": {
+ "a": 0,
+ "k": 0
+ },
+ "p": {
+ "a": 0,
+ "k": [
+ 16.827,
+ 19.071
+ ]
+ },
+ "r": {
+ "a": 0,
+ "k": 0
+ },
+ "sa": {
+ "a": 0,
+ "k": 0
+ },
+ "o": {
+ "a": 0,
+ "k": 100
+ }
+ },
+ "ef": [],
+ "shapes": [],
+ "ind": 9
+ },
+ {
+ "ty": 4,
+ "nm": "Layer 9",
+ "sr": 1,
+ "st": 0,
+ "op": 22,
+ "ip": 0,
+ "hd": false,
+ "ddd": 0,
+ "bm": 0,
+ "hasMask": false,
+ "ao": 0,
+ "ks": {
+ "a": {
+ "a": 0,
+ "k": [
+ 0,
+ 0,
+ 0
+ ]
+ },
+ "s": {
+ "a": 0,
+ "k": [
+ 60,
+ 60,
+ 100
+ ]
+ },
+ "sk": {
+ "a": 0,
+ "k": 0
+ },
+ "p": {
+ "a": 0,
+ "k": [
+ 16.827,
+ 19.071
+ ]
+ },
+ "r": {
+ "a": 0,
+ "k": 0
+ },
+ "sa": {
+ "a": 0,
+ "k": 0
+ },
+ "o": {
+ "a": 0,
+ "k": 100
+ }
+ },
+ "ef": [],
+ "shapes": [],
+ "ind": 10
+ },
+ {
+ "ty": 4,
+ "nm": "Layer 8",
+ "sr": 1,
+ "st": 0,
+ "op": 22,
+ "ip": 0,
+ "hd": false,
+ "ddd": 0,
+ "bm": 0,
+ "hasMask": false,
+ "ao": 0,
+ "ks": {
+ "a": {
+ "a": 0,
+ "k": [
+ 0,
+ 0,
+ 0
+ ]
+ },
+ "s": {
+ "a": 0,
+ "k": [
+ 60,
+ 60,
+ 100
+ ]
+ },
+ "sk": {
+ "a": 0,
+ "k": 0
+ },
+ "p": {
+ "a": 0,
+ "k": [
+ 16.827,
+ 19.071
+ ]
+ },
+ "r": {
+ "a": 0,
+ "k": 0
+ },
+ "sa": {
+ "a": 0,
+ "k": 0
+ },
+ "o": {
+ "a": 0,
+ "k": 100
+ }
+ },
+ "ef": [],
+ "shapes": [],
+ "ind": 11
+ },
+ {
+ "ty": 4,
+ "nm": "Layer 7",
+ "sr": 1,
+ "st": 0,
+ "op": 22,
+ "ip": 0,
+ "hd": false,
+ "ddd": 0,
+ "bm": 0,
+ "hasMask": false,
+ "ao": 0,
+ "ks": {
+ "a": {
+ "a": 0,
+ "k": [
+ 0,
+ 0,
+ 0
+ ]
+ },
+ "s": {
+ "a": 0,
+ "k": [
+ 60,
+ 60,
+ 100
+ ]
+ },
+ "sk": {
+ "a": 0,
+ "k": 0
+ },
+ "p": {
+ "a": 0,
+ "k": [
+ 16.827,
+ 19.071
+ ]
+ },
+ "r": {
+ "a": 0,
+ "k": 0
+ },
+ "sa": {
+ "a": 0,
+ "k": 0
+ },
+ "o": {
+ "a": 0,
+ "k": 100
+ }
+ },
+ "ef": [],
+ "shapes": [],
+ "ind": 12
+ },
+ {
+ "ty": 4,
+ "nm": "Layer 6",
+ "sr": 1,
+ "st": 0,
+ "op": 22,
+ "ip": 0,
+ "hd": false,
+ "ddd": 0,
+ "bm": 0,
+ "hasMask": false,
+ "ao": 0,
+ "ks": {
+ "a": {
+ "a": 0,
+ "k": [
+ 0,
+ 0,
+ 0
+ ]
+ },
+ "s": {
+ "a": 0,
+ "k": [
+ 60,
+ 60,
+ 100
+ ]
+ },
+ "sk": {
+ "a": 0,
+ "k": 0
+ },
+ "p": {
+ "a": 0,
+ "k": [
+ 16.827,
+ 19.071
+ ]
+ },
+ "r": {
+ "a": 0,
+ "k": 0
+ },
+ "sa": {
+ "a": 0,
+ "k": 0
+ },
+ "o": {
+ "a": 0,
+ "k": 100
+ }
+ },
+ "ef": [],
+ "shapes": [],
+ "ind": 13
+ },
+ {
+ "ty": 4,
+ "nm": "Layer 5",
+ "sr": 1,
+ "st": 0,
+ "op": 22,
+ "ip": 0,
+ "hd": false,
+ "ddd": 0,
+ "bm": 0,
+ "hasMask": false,
+ "ao": 0,
+ "ks": {
+ "a": {
+ "a": 0,
+ "k": [
+ 0,
+ 0,
+ 0
+ ]
+ },
+ "s": {
+ "a": 0,
+ "k": [
+ 60,
+ 60,
+ 100
+ ]
+ },
+ "sk": {
+ "a": 0,
+ "k": 0
+ },
+ "p": {
+ "a": 0,
+ "k": [
+ 16.827,
+ 19.071
+ ]
+ },
+ "r": {
+ "a": 0,
+ "k": 0
+ },
+ "sa": {
+ "a": 0,
+ "k": 0
+ },
+ "o": {
+ "a": 0,
+ "k": 100
+ }
+ },
+ "ef": [],
+ "shapes": [],
+ "ind": 14
+ },
+ {
+ "ty": 4,
+ "nm": "Layer 4",
+ "sr": 1,
+ "st": 0,
+ "op": 22,
+ "ip": 0,
+ "hd": false,
+ "ddd": 0,
+ "bm": 0,
+ "hasMask": false,
+ "ao": 0,
+ "ks": {
+ "a": {
+ "a": 0,
+ "k": [
+ 0,
+ 0,
+ 0
+ ]
+ },
+ "s": {
+ "a": 0,
+ "k": [
+ 60,
+ 60,
+ 100
+ ]
+ },
+ "sk": {
+ "a": 0,
+ "k": 0
+ },
+ "p": {
+ "a": 0,
+ "k": [
+ 16.827,
+ 19.071
+ ]
+ },
+ "r": {
+ "a": 0,
+ "k": 0
+ },
+ "sa": {
+ "a": 0,
+ "k": 0
+ },
+ "o": {
+ "a": 0,
+ "k": 100
+ }
+ },
+ "ef": [],
+ "shapes": [],
+ "ind": 15
+ },
+ {
+ "ty": 4,
+ "nm": "exclaim",
+ "sr": 1,
+ "st": 0,
+ "op": 22,
+ "ip": 0,
+ "hd": false,
+ "ln": "exclaim",
+ "ddd": 0,
+ "bm": 0,
+ "hasMask": false,
+ "ao": 0,
+ "ks": {
+ "a": {
+ "a": 1,
+ "k": [
+ {
+ "o": {
+ "x": 0.42,
+ "y": 0
+ },
+ "i": {
+ "x": 0.58,
+ "y": 1
+ },
+ "s": [
+ 0,
+ 0,
+ 0
+ ],
+ "t": 12
+ },
+ {
+ "o": {
+ "x": 0.42,
+ "y": 0
+ },
+ "i": {
+ "x": 0.58,
+ "y": 1
+ },
+ "s": [
+ 0,
+ 0,
+ 0
+ ],
+ "t": 13
+ },
+ {
+ "o": {
+ "x": 0.42,
+ "y": 0
+ },
+ "i": {
+ "x": 0.58,
+ "y": 1
+ },
+ "s": [
+ 0,
+ 0,
+ 0
+ ],
+ "t": 14
+ },
+ {
+ "o": {
+ "x": 0.42,
+ "y": 0
+ },
+ "i": {
+ "x": 0.58,
+ "y": 1
+ },
+ "s": [
+ 0,
+ 0,
+ 0
+ ],
+ "t": 15
+ },
+ {
+ "o": {
+ "x": 0.42,
+ "y": 0
+ },
+ "i": {
+ "x": 0.58,
+ "y": 1
+ },
+ "s": [
+ 0,
+ 0,
+ 0
+ ],
+ "t": 16
+ },
+ {
+ "o": {
+ "x": 0.42,
+ "y": 0
+ },
+ "i": {
+ "x": 0.58,
+ "y": 1
+ },
+ "s": [
+ 0,
+ 0,
+ 0
+ ],
+ "t": 17
+ },
+ {
+ "o": {
+ "x": 0.42,
+ "y": 0
+ },
+ "i": {
+ "x": 0.58,
+ "y": 1
+ },
+ "s": [
+ 0,
+ 0,
+ 0
+ ],
+ "t": 18
+ },
+ {
+ "o": {
+ "x": 0.42,
+ "y": 0
+ },
+ "i": {
+ "x": 0.58,
+ "y": 1
+ },
+ "s": [
+ 0,
+ 0,
+ 0
+ ],
+ "t": 19
+ },
+ {
+ "o": {
+ "x": 0.42,
+ "y": 0
+ },
+ "i": {
+ "x": 0.58,
+ "y": 1
+ },
+ "s": [
+ 0,
+ 0,
+ 0
+ ],
+ "t": 20
+ },
+ {
+ "o": {
+ "x": 0.42,
+ "y": 0
+ },
+ "i": {
+ "x": 0.58,
+ "y": 1
+ },
+ "s": [
+ 0,
+ 0,
+ 0
+ ],
+ "t": 21
+ },
+ {
+ "s": [
+ 0,
+ 0,
+ 0
+ ],
+ "t": 22
+ }
+ ]
+ },
+ "s": {
+ "a": 0,
+ "k": [
+ 60,
+ 60,
+ 100
+ ]
+ },
+ "sk": {
+ "a": 0,
+ "k": 0
+ },
+ "p": {
+ "a": 1,
+ "k": [
+ {
+ "o": {
+ "x": 0.42,
+ "y": 0
+ },
+ "i": {
+ "x": 0.58,
+ "y": 1
+ },
+ "s": [
+ 16.827,
+ 19.071,
+ 0
+ ],
+ "t": 12,
+ "ti": [
+ 0,
+ 0,
+ 0
+ ],
+ "to": [
+ 0,
+ 0,
+ 0
+ ]
+ },
+ {
+ "o": {
+ "x": 0.42,
+ "y": 0
+ },
+ "i": {
+ "x": 0.58,
+ "y": 1
+ },
+ "s": [
+ 16.827,
+ 14.583,
+ 0
+ ],
+ "t": 13,
+ "ti": [
+ 0,
+ 0,
+ 0
+ ],
+ "to": [
+ 0,
+ 0,
+ 0
+ ]
+ },
+ {
+ "o": {
+ "x": 0.42,
+ "y": 0
+ },
+ "i": {
+ "x": 0.58,
+ "y": 1
+ },
+ "s": [
+ 16.827,
+ 19.071,
+ 0
+ ],
+ "t": 14,
+ "ti": [
+ 0,
+ 0,
+ 0
+ ],
+ "to": [
+ 0,
+ 0,
+ 0
+ ]
+ },
+ {
+ "o": {
+ "x": 0.42,
+ "y": 0
+ },
+ "i": {
+ "x": 0.58,
+ "y": 1
+ },
+ "s": [
+ 17.949,
+ 23.558,
+ 0
+ ],
+ "t": 15,
+ "ti": [
+ 0,
+ 0,
+ 0
+ ],
+ "to": [
+ 0,
+ 0,
+ 0
+ ]
+ },
+ {
+ "o": {
+ "x": 0.42,
+ "y": 0
+ },
+ "i": {
+ "x": 0.58,
+ "y": 1
+ },
+ "s": [
+ 16.827,
+ 14.584,
+ 0
+ ],
+ "t": 16,
+ "ti": [
+ 0,
+ 0,
+ 0
+ ],
+ "to": [
+ 0,
+ 0,
+ 0
+ ]
+ },
+ {
+ "o": {
+ "x": 0.42,
+ "y": 0
+ },
+ "i": {
+ "x": 0.58,
+ "y": 1
+ },
+ "s": [
+ 16.827,
+ 19.071,
+ 0
+ ],
+ "t": 17,
+ "ti": [
+ 0,
+ 0,
+ 0
+ ],
+ "to": [
+ 0,
+ 0,
+ 0
+ ]
+ },
+ {
+ "o": {
+ "x": 0.42,
+ "y": 0
+ },
+ "i": {
+ "x": 0.58,
+ "y": 1
+ },
+ "s": [
+ 17.949,
+ 23.558,
+ 0
+ ],
+ "t": 18,
+ "ti": [
+ 0,
+ 0,
+ 0
+ ],
+ "to": [
+ 0,
+ 0,
+ 0
+ ]
+ },
+ {
+ "o": {
+ "x": 0.42,
+ "y": 0
+ },
+ "i": {
+ "x": 0.58,
+ "y": 1
+ },
+ "s": [
+ 16.827,
+ 19.071,
+ 0
+ ],
+ "t": 19,
+ "ti": [
+ 0,
+ 0,
+ 0
+ ],
+ "to": [
+ 0,
+ 0,
+ 0
+ ]
+ },
+ {
+ "o": {
+ "x": 0.42,
+ "y": 0
+ },
+ "i": {
+ "x": 0.58,
+ "y": 1
+ },
+ "s": [
+ 16.827,
+ 14.584,
+ 0
+ ],
+ "t": 20,
+ "ti": [
+ 0,
+ 0,
+ 0
+ ],
+ "to": [
+ 0,
+ 0,
+ 0
+ ]
+ },
+ {
+ "o": {
+ "x": 0.42,
+ "y": 0
+ },
+ "i": {
+ "x": 0.58,
+ "y": 1
+ },
+ "s": [
+ 16.827,
+ 19.071,
+ 0
+ ],
+ "t": 21,
+ "ti": [
+ 0,
+ 0,
+ 0
+ ],
+ "to": [
+ 0,
+ 0,
+ 0
+ ]
+ },
+ {
+ "s": [
+ 17.949,
+ 23.558,
+ 0
+ ],
+ "t": 22
+ }
+ ]
+ },
+ "r": {
+ "a": 1,
+ "k": [
+ {
+ "o": {
+ "x": 0.42,
+ "y": 0
+ },
+ "i": {
+ "x": 0.58,
+ "y": 1
+ },
+ "s": [
+ 0
+ ],
+ "t": 12
+ },
+ {
+ "o": {
+ "x": 0.42,
+ "y": 0
+ },
+ "i": {
+ "x": 0.58,
+ "y": 1
+ },
+ "s": [
+ 2
+ ],
+ "t": 13
+ },
+ {
+ "o": {
+ "x": 0.42,
+ "y": 0
+ },
+ "i": {
+ "x": 0.58,
+ "y": 1
+ },
+ "s": [
+ 0
+ ],
+ "t": 14
+ },
+ {
+ "o": {
+ "x": 0.42,
+ "y": 0
+ },
+ "i": {
+ "x": 0.58,
+ "y": 1
+ },
+ "s": [
+ -2
+ ],
+ "t": 15
+ },
+ {
+ "o": {
+ "x": 0.42,
+ "y": 0
+ },
+ "i": {
+ "x": 0.58,
+ "y": 1
+ },
+ "s": [
+ 2
+ ],
+ "t": 16
+ },
+ {
+ "o": {
+ "x": 0.42,
+ "y": 0
+ },
+ "i": {
+ "x": 0.58,
+ "y": 1
+ },
+ "s": [
+ 0
+ ],
+ "t": 17
+ },
+ {
+ "o": {
+ "x": 0.42,
+ "y": 0
+ },
+ "i": {
+ "x": 0.58,
+ "y": 1
+ },
+ "s": [
+ -2
+ ],
+ "t": 18
+ },
+ {
+ "o": {
+ "x": 0.42,
+ "y": 0
+ },
+ "i": {
+ "x": 0.58,
+ "y": 1
+ },
+ "s": [
+ 0
+ ],
+ "t": 19
+ },
+ {
+ "o": {
+ "x": 0.42,
+ "y": 0
+ },
+ "i": {
+ "x": 0.58,
+ "y": 1
+ },
+ "s": [
+ 2
+ ],
+ "t": 20
+ },
+ {
+ "o": {
+ "x": 0.42,
+ "y": 0
+ },
+ "i": {
+ "x": 0.58,
+ "y": 1
+ },
+ "s": [
+ 0
+ ],
+ "t": 21
+ },
+ {
+ "s": [
+ -2
+ ],
+ "t": 22
+ }
+ ]
+ },
+ "sa": {
+ "a": 0,
+ "k": 0
+ },
+ "o": {
+ "a": 1,
+ "k": [
+ {
+ "o": {
+ "x": 0.167,
+ "y": 0.167
+ },
+ "i": {
+ "x": 0.833,
+ "y": 0.833
+ },
+ "s": [
+ 0
+ ],
+ "t": 9
+ },
+ {
+ "s": [
+ 100
+ ],
+ "t": 11
+ }
+ ]
+ }
+ },
+ "ef": [],
+ "shapes": [
+ {
+ "ty": "gr",
+ "bm": 0,
+ "hd": false,
+ "nm": "Object",
+ "it": [
+ {
+ "ty": "el",
+ "bm": 0,
+ "hd": false,
+ "nm": "",
+ "d": 1,
+ "p": {
+ "a": 0,
+ "k": [
+ 0,
+ 0
+ ]
+ },
+ "s": {
+ "a": 0,
+ "k": [
+ 34.134,
+ 34.134
+ ]
+ }
+ },
+ {
+ "ty": "fl",
+ "bm": 0,
+ "hd": false,
+ "nm": "",
+ "c": {
+ "a": 0,
+ "k": [
+ 0.1216,
+ 0.1216,
+ 0.1216
+ ]
+ },
+ "r": 1,
+ "o": {
+ "a": 0,
+ "k": 100
+ }
+ },
+ {
+ "ty": "tr",
+ "a": {
+ "a": 0,
+ "k": [
+ -225.879,
+ -336.092
+ ]
+ },
+ "s": {
+ "a": 0,
+ "k": [
+ 100,
+ 100
+ ]
+ },
+ "sk": {
+ "a": 0,
+ "k": 0
+ },
+ "p": {
+ "a": 0,
+ "k": [
+ 0,
+ 0
+ ]
+ },
+ "r": {
+ "a": 0,
+ "k": 0
+ },
+ "sa": {
+ "a": 0,
+ "k": 0
+ },
+ "o": {
+ "a": 0,
+ "k": 100
+ }
+ }
+ ]
+ },
+ {
+ "ty": "gr",
+ "bm": 0,
+ "hd": false,
+ "nm": "Object",
+ "it": [
+ {
+ "ty": "sh",
+ "bm": 0,
+ "hd": false,
+ "nm": "",
+ "d": 1,
+ "ks": {
+ "a": 0,
+ "k": {
+ "c": true,
+ "i": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 0,
+ 0
+ ],
+ [
+ -9.956,
+ 0
+ ],
+ [
+ 0,
+ 0
+ ],
+ [
+ -1.422,
+ 8.533
+ ],
+ [
+ 0,
+ 0
+ ],
+ [
+ 18.489,
+ 0
+ ],
+ [
+ 0,
+ 0
+ ],
+ [
+ -1.423,
+ -18.489
+ ]
+ ],
+ "o": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 1.422,
+ 8.533
+ ],
+ [
+ 0,
+ 0
+ ],
+ [
+ 8.533,
+ 0
+ ],
+ [
+ 0,
+ 0
+ ],
+ [
+ 2.844,
+ -18.489
+ ],
+ [
+ 0,
+ 0
+ ],
+ [
+ -18.49,
+ -0.001
+ ],
+ [
+ 0,
+ 0
+ ]
+ ],
+ "v": [
+ [
+ 196.013,
+ 212.359
+ ],
+ [
+ 207.391,
+ 287.737
+ ],
+ [
+ 225.88,
+ 303.381
+ ],
+ [
+ 225.88,
+ 303.381
+ ],
+ [
+ 244.369,
+ 287.737
+ ],
+ [
+ 255.747,
+ 212.359
+ ],
+ [
+ 225.88,
+ 178.226
+ ],
+ [
+ 225.88,
+ 178.226
+ ],
+ [
+ 196.013,
+ 212.359
+ ]
+ ]
+ }
+ }
+ },
+ {
+ "ty": "fl",
+ "bm": 0,
+ "hd": false,
+ "nm": "",
+ "c": {
+ "a": 0,
+ "k": [
+ 0.1216,
+ 0.1216,
+ 0.1216
+ ]
+ },
+ "r": 1,
+ "o": {
+ "a": 0,
+ "k": 100
+ }
+ },
+ {
+ "ty": "tr",
+ "a": {
+ "a": 0,
+ "k": [
+ 0,
+ 0
+ ]
+ },
+ "s": {
+ "a": 0,
+ "k": [
+ 100,
+ 100
+ ]
+ },
+ "sk": {
+ "a": 0,
+ "k": 0
+ },
+ "p": {
+ "a": 0,
+ "k": [
+ 0,
+ 0
+ ]
+ },
+ "r": {
+ "a": 0,
+ "k": 0
+ },
+ "sa": {
+ "a": 0,
+ "k": 0
+ },
+ "o": {
+ "a": 0,
+ "k": 100
+ }
+ }
+ ]
+ }
+ ],
+ "ind": 16
+ },
+ {
+ "ty": 4,
+ "nm": "Layer 2",
+ "sr": 1,
+ "st": 0,
+ "op": 22,
+ "ip": 0,
+ "hd": false,
+ "ddd": 0,
+ "bm": 0,
+ "hasMask": false,
+ "ao": 0,
+ "ks": {
+ "a": {
+ "a": 0,
+ "k": [
+ 0,
+ 0,
+ 0
+ ]
+ },
+ "s": {
+ "a": 0,
+ "k": [
+ 60,
+ 60,
+ 100
+ ]
+ },
+ "sk": {
+ "a": 0,
+ "k": 0
+ },
+ "p": {
+ "a": 0,
+ "k": [
+ 16.827,
+ 19.071
+ ]
+ },
+ "r": {
+ "a": 0,
+ "k": 0
+ },
+ "sa": {
+ "a": 0,
+ "k": 0
+ },
+ "o": {
+ "a": 0,
+ "k": 100
+ }
+ },
+ "ef": [],
+ "shapes": [
+ {
+ "ty": "gr",
+ "bm": 0,
+ "hd": false,
+ "nm": "Object",
+ "it": [
+ {
+ "ty": "sh",
+ "bm": 0,
+ "hd": false,
+ "nm": "",
+ "d": 1,
+ "ks": {
+ "a": 0,
+ "k": {
+ "c": true,
+ "i": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 0,
+ 0
+ ],
+ [
+ 0,
+ 0
+ ],
+ [
+ 0,
+ 0
+ ],
+ [
+ 0,
+ 0
+ ]
+ ],
+ "o": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 0,
+ 0
+ ],
+ [
+ 0,
+ 0
+ ],
+ [
+ 0,
+ 0
+ ],
+ [
+ 0,
+ 0
+ ]
+ ],
+ "v": [
+ [
+ 225.879,
+ 63.025
+ ],
+ [
+ 409.346,
+ 388.714
+ ],
+ [
+ 42.413,
+ 388.714
+ ],
+ [
+ 225.879,
+ 63.025
+ ],
+ [
+ 225.879,
+ 63.025
+ ]
+ ]
+ }
+ }
+ },
+ {
+ "ty": "fl",
+ "bm": 0,
+ "hd": false,
+ "nm": "",
+ "c": {
+ "a": 0,
+ "k": [
+ 1,
+ 1,
+ 1
+ ]
+ },
+ "r": 1,
+ "o": {
+ "a": 0,
+ "k": 100
+ }
+ },
+ {
+ "ty": "tr",
+ "a": {
+ "a": 0,
+ "k": [
+ 0,
+ 0
+ ]
+ },
+ "s": {
+ "a": 0,
+ "k": [
+ 100,
+ 100
+ ]
+ },
+ "sk": {
+ "a": 0,
+ "k": 0
+ },
+ "p": {
+ "a": 0,
+ "k": [
+ 0,
+ 0
+ ]
+ },
+ "r": {
+ "a": 0,
+ "k": 0
+ },
+ "sa": {
+ "a": 0,
+ "k": 0
+ },
+ "o": {
+ "a": 0,
+ "k": 100
+ }
+ }
+ ]
+ }
+ ],
+ "ind": 17
+ },
+ {
+ "ty": 4,
+ "nm": "triangle",
+ "sr": 1,
+ "st": 0,
+ "op": 22,
+ "ip": 0,
+ "hd": false,
+ "ln": "triangle",
+ "ddd": 0,
+ "bm": 0,
+ "hasMask": false,
+ "ao": 0,
+ "ks": {
+ "a": {
+ "a": 0,
+ "k": [
+ 0,
+ 0,
+ 0
+ ]
+ },
+ "s": {
+ "a": 0,
+ "k": [
+ 60,
+ 60,
+ 100
+ ]
+ },
+ "sk": {
+ "a": 0,
+ "k": 0
+ },
+ "p": {
+ "a": 0,
+ "k": [
+ 16.827,
+ 19.071
+ ]
+ },
+ "r": {
+ "a": 0,
+ "k": 0
+ },
+ "sa": {
+ "a": 0,
+ "k": 0
+ },
+ "o": {
+ "a": 1,
+ "k": [
+ {
+ "o": {
+ "x": 0.167,
+ "y": 0.167
+ },
+ "i": {
+ "x": 0.833,
+ "y": 0.833
+ },
+ "s": [
+ 0
+ ],
+ "t": 0
+ },
+ {
+ "s": [
+ 100
+ ],
+ "t": 5
+ }
+ ]
+ }
+ },
+ "ef": [],
+ "shapes": [
+ {
+ "ty": "gr",
+ "bm": 0,
+ "hd": false,
+ "nm": "Object",
+ "it": [
+ {
+ "ty": "sh",
+ "bm": 0,
+ "hd": false,
+ "nm": "",
+ "d": 1,
+ "ks": {
+ "a": 0,
+ "k": {
+ "c": true,
+ "i": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 0,
+ 0
+ ],
+ [
+ 15.645,
+ -28.444
+ ],
+ [
+ 0,
+ 0
+ ],
+ [
+ -32.711,
+ 0
+ ],
+ [
+ 0,
+ 0
+ ],
+ [
+ 15.644,
+ 28.444
+ ]
+ ],
+ "o": [
+ [
+ 0,
+ 0
+ ],
+ [
+ -15.644,
+ -28.444
+ ],
+ [
+ 0,
+ 0
+ ],
+ [
+ -15.644,
+ 28.444
+ ],
+ [
+ 0,
+ 0
+ ],
+ [
+ 34.133,
+ -1.422
+ ],
+ [
+ 0,
+ 0
+ ]
+ ],
+ "v": [
+ [
+ 446.324,
+ 367.381
+ ],
+ [
+ 262.857,
+ 41.692
+ ],
+ [
+ 188.901,
+ 41.692
+ ],
+ [
+ 5.435,
+ 367.381
+ ],
+ [
+ 42.413,
+ 431.381
+ ],
+ [
+ 407.924,
+ 431.381
+ ],
+ [
+ 446.324,
+ 367.381
+ ]
+ ]
+ }
+ }
+ },
+ {
+ "ty": "fl",
+ "bm": 0,
+ "hd": false,
+ "nm": "",
+ "c": {
+ "a": 0,
+ "k": [
+ 0.7255,
+ 0.098,
+ 0
+ ]
+ },
+ "r": 1,
+ "o": {
+ "a": 0,
+ "k": 100
+ }
+ },
+ {
+ "ty": "tr",
+ "a": {
+ "a": 0,
+ "k": [
+ 0,
+ 0
+ ]
+ },
+ "s": {
+ "a": 0,
+ "k": [
+ 100,
+ 100
+ ]
+ },
+ "sk": {
+ "a": 0,
+ "k": 0
+ },
+ "p": {
+ "a": 0,
+ "k": [
+ 0,
+ 0
+ ]
+ },
+ "r": {
+ "a": 0,
+ "k": 0
+ },
+ "sa": {
+ "a": 0,
+ "k": 0
+ },
+ "o": {
+ "a": 0,
+ "k": 100
+ }
+ }
+ ]
+ }
+ ],
+ "ind": 18
+ }
+ ],
+ "v": "5.0.1",
+ "fr": 10,
+ "op": 22,
+ "ip": 12,
+ "assets": []
+ }
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/constants/colors/colorconstants.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/constants/colors/colorconstants.js
new file mode 100644
index 00000000..842c1960
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/constants/colors/colorconstants.js
@@ -0,0 +1,35 @@
+const Colors = {
+ lightTheme: {
+ primary: {
+ 1: "#C84C0E",
+ 2: "#0B4B66",
+ bg: "#FBEEE8",
+ },
+ text: {
+ primary: "#363636",
+ secondary: "#787878",
+ disabled: "#C5C5C5",
+ },
+ alert: {
+ error: "#B91900",
+ errorbg: "#FFF5F4",
+ success: "#00703C",
+ successbg: "#F1FFF8",
+ warning: "#9E5F00",
+ warningbg: "#FFF9F0",
+ info: "#0057BD",
+ infobg: "#DEEFFF",
+ },
+ generic: {
+ background: "#EEEEEE",
+ divider: "#D6D5D4",
+ inputBorder: "#505A5F",
+ },
+ paper: {
+ primary: "#FFFFFF",
+ secondary: "#FAFAFA",
+ },
+ },
+};
+
+export { Colors };
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/constants/images/images.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/constants/images/images.js
new file mode 100644
index 00000000..fa5f2328
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/constants/images/images.js
@@ -0,0 +1,9 @@
+const IMAGES = {
+ DIGIT_DARK: "https://egov-dev-assets.s3.ap-south-1.amazonaws.com/digit.png",
+ DIGIT_LIGHT:
+ "https://egov-uat-assets.s3.ap-south-1.amazonaws.com/hcm/mseva-white-logo.png",
+ DIGIT_FOOTER_DARK:"https://unified-dev.digit.org/egov-dev-assets/digit-footer-bw.png",
+ DIGIT_FOOTER_LIGHT:"https://unified-dev.digit.org/egov-dev-assets/digit-footer.png"
+};
+
+export { IMAGES };
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/constants/spacers/spacers.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/constants/spacers/spacers.js
new file mode 100644
index 00000000..619ffc8c
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/constants/spacers/spacers.js
@@ -0,0 +1,17 @@
+const Spacers = {
+ spacer0: "0rem",
+ spacer1: "0.25rem",
+ spacer2: "0.5rem",
+ spacer3: "0.75rem",
+ spacer4: "1rem",
+ spacer5: "1.25rem",
+ spacer6: "1.5rem",
+ spacer7: "1.75rem",
+ spacer8: "2rem",
+ spacer9: "2.25rem",
+ spacer10: "2.5rem",
+ spacer11: "2.75rem",
+ spacer12: "3rem",
+};
+
+export { Spacers };
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/constants/styles/dataTableCustomStyles.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/constants/styles/dataTableCustomStyles.js
new file mode 100644
index 00000000..b6fb84db
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/constants/styles/dataTableCustomStyles.js
@@ -0,0 +1,212 @@
+export const dataTableCustomStyles = {
+ tableWrapper: {
+ style: {
+ // overflow: "scroll",
+ },
+ },
+ table: {
+ style: {
+ // overflow: "scroll",
+ },
+ },
+ responsiveWrapper: {
+ style: {
+ // overflow: "scroll",
+ },
+ },
+ contextMenu: {
+ style: {
+ // overflow: "scroll",
+ },
+ },
+ header: {
+ style: {
+ minHeight: "56px",
+ },
+ },
+ rows: {
+ style: {
+ backgroundColor: "#FFFFFF",
+ "&:hover": {
+ backgroundColor: "#FBEEE8",
+ },
+ },
+ },
+ headRow: {
+ style: {
+ borderTopStyle: "solid",
+ borderTopWidth: "1px",
+ borderTopColor: "#D6D5D4",
+ backgroundColor: "#EEEEEE",
+ },
+ },
+ headCells: {
+ style: {
+ "&:first-of-type": {
+ borderLeftStyle: "solid",
+ borderLeftWidth: "1px",
+ borderLeftColor: "#D6D5D4",
+ borderTopLeftRadius: "0.25rem",
+ },
+ "&:last-of-type": {
+ borderLeftStyle: "solid",
+ borderLeftWidth: "1px",
+ borderLeftColor: "#D6D5D4",
+ borderTopRightRadius: "0.25rem",
+ },
+ borderRightStyle: "solid",
+ borderRightWidth: "1px",
+ borderRightColor: "#D6D5D4",
+ fontFamily: "Roboto",
+ fontWeight: "700",
+ fontStyle: "normal",
+ fontSize: "16px",
+ color: "#0B4B66",
+ padding: "16px",
+ lineHeight: "1.14rem",
+ zIndex:10
+ },
+ },
+ cells: {
+ style: {
+ "&:first-of-type": {
+ borderLeftStyle: "solid",
+ borderLeftWidth: "1px",
+ borderLeftColor: "#D6D5D4",
+ },
+ borderRightStyle: "solid",
+ borderRightWidth: "1px",
+ borderRightColor: "#D6D5D4",
+ color: "#363636",
+ fontFamily: "Roboto",
+ fontStyle: "normal",
+ fontWeight: 400,
+ lineHeight: "1.37rem",
+ textAlign: "left",
+ fontSize: "16px",
+ padding: "16px",
+ },
+ pagination: {
+ style: {
+ marginTop: "-60px",
+ borderStyle: "solid",
+ borderWidth: "1px",
+ borderColor: "#D6D5D4",
+ borderTopWidth: "0px",
+ },
+ },
+ },
+ };
+
+ export const getTableCustomStyle = (freezeFirstColumn = false) => ({
+ tableWrapper: {
+ style: {
+ // overflow: "scroll",
+ },
+ },
+ table: {
+ style: {
+ // overflow: "scroll",
+ },
+ },
+ responsiveWrapper: {
+ style: {
+ // overflow: "scroll",
+ },
+ },
+ contextMenu: {
+ style: {
+ // overflow: "scroll",
+ },
+ },
+ header: {
+ style: {
+ minHeight: "56px",
+ },
+ },
+ rows: {
+ style: {
+ backgroundColor: "#FFFFFF",
+ "&:hover": {
+ backgroundColor: "#FBEEE8",
+ },
+ },
+ },
+ headRow: {
+ style: {
+ borderTopStyle: "solid",
+ borderTopWidth: "1px",
+ borderTopColor: "#D6D5D4",
+ backgroundColor: "#EEEEEE",
+ },
+ },
+ headCells: {
+ style: {
+ "&:first-of-type": {
+ ...(freezeFirstColumn && {
+ borderLeftStyle: "solid",
+ borderLeftWidth: "1px",
+ borderLeftColor: "#D6D5D4",
+ borderTopLeftRadius: "0.25rem",
+ position: "sticky",
+ left: 0,
+ backgroundColor: "#EEEEEE",
+ zIndex: 2,
+ }),
+ },
+ "&:last-of-type": {
+ borderLeftStyle: "solid",
+ borderLeftWidth: "1px",
+ borderLeftColor: "#D6D5D4",
+ borderTopRightRadius: "0.25rem",
+ },
+ borderRightStyle: "solid",
+ borderRightWidth: "1px",
+ borderRightColor: "#D6D5D4",
+ fontFamily: "Roboto",
+ fontWeight: "700",
+ fontStyle: "normal",
+ fontSize: "16px",
+ color: "#0B4B66",
+ padding: "16px",
+ lineHeight: "1.14rem",
+ },
+ },
+ cells: {
+ style: {
+ "&:first-of-type": {
+ ...(freezeFirstColumn && {
+ borderLeftStyle: "solid",
+ borderLeftWidth: "1px",
+ borderLeftColor: "#D6D5D4",
+ position: "sticky",
+ left: 0,
+ backgroundColor: "#FFFFFF",
+ zIndex: 1,
+ boxShadow: "2px 0 5px rgba(0, 0, 0, 0.1)",
+ }),
+ },
+ borderRightStyle: "solid",
+ borderRightWidth: "1px",
+ borderRightColor: "#D6D5D4",
+ color: "#363636",
+ fontFamily: "Roboto",
+ fontStyle: "normal",
+ fontWeight: 400,
+ lineHeight: "1.37rem",
+ textAlign: "left",
+ fontSize: "16px",
+ padding: "16px",
+ },
+ pagination: {
+ style: {
+ marginTop: "-60px",
+ borderStyle: "solid",
+ borderWidth: "1px",
+ borderColor: "#D6D5D4",
+ borderTopWidth: "0px",
+ },
+ },
+ },
+ });
+
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/hoc/EditablePopup.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/hoc/EditablePopup.js
new file mode 100644
index 00000000..83b0b46e
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/hoc/EditablePopup.js
@@ -0,0 +1,130 @@
+import React,{useMemo,useEffect} from 'react';
+import PopUp from '../atoms/PopUp';
+import { Button } from '../atoms';
+import { FormComposer } from '../hoc/FormComposerV2';
+import { useTranslation } from 'react-i18next';
+import _ from 'lodash';
+
+const EditablePopup = ({
+ setShowEditablePopup,
+ config,
+ editRow,
+ setEditRow,
+ rowData,
+ setRowData,
+ handleRowSubmit
+}) => {
+ const {t} = useTranslation();
+ const transformConfig = (config) => {
+ return useMemo(() => {
+ return [
+ {
+ head: '',
+ body: [
+ ...config.columns
+ .filter((col) => col.editable && col.editableFieldConfig)
+ .map(({ editableFieldConfig }) => ({
+ ...editableFieldConfig,withoutLabel:false
+ })),
+ ...((config.additionalPopupColumns || [])
+ .filter((col) => col.editable && col.editableFieldConfig)
+ .map(({ editableFieldConfig }) => ({
+ ...editableFieldConfig,withoutLabel:false
+ })))
+ ],
+ },
+ ];
+ }, [config]);
+ };
+ const generateDefaultValues = (config, data) => {
+ return useMemo(() => {
+ const defaultValues = {};
+ const processColumns = (columns) => {
+ columns.forEach((col) => {
+ if (col.editable && col.editableFieldConfig && col.editableFieldConfig.populators) {
+ const fieldPath = col.jsonPath;
+ const fieldName = col.editableFieldConfig.populators.name;
+ const fieldType = col.editableFieldConfig.type;
+ const optionsKey = col.editableFieldConfig.populators.optionsKey;
+
+ // Ensure nested structure
+ const keys = fieldName.split(".");
+ let current = defaultValues;
+ for (let i = 0; i < keys.length - 1; i++) {
+ if (!current[keys[i]]) current[keys[i]] = {};
+ current = current[keys[i]];
+ }
+
+ const value = (fieldType === "text" || fieldType === "toggle")
+ ? `${_.get(data, fieldPath, "")}`
+ : { [optionsKey]: `${_.get(data, fieldPath, "")}` };
+
+ current[keys[keys.length - 1]] = value;
+ }
+ });
+ };
+
+ processColumns(config.columns);
+ if (config.additionalPopupColumns) {
+ processColumns(config.additionalPopupColumns);
+ }
+
+ return defaultValues;
+ }, [config, data]);
+ };
+
+ const onSubmit = (data) => {
+ handleRowSubmit(data);
+ }
+ //here form the formComposer config with column config and render inside children prop of Popup
+
+ return (
+ {
+ setShowEditablePopup(false);
+ setEditRow(null);
+ }}
+ children={[
+ ,
+ ]}
+ // footerChildren={[
+ // {
+ // console.log('action clicked');
+ // }}
+ // />,
+ // {
+ // console.log('action clicked');
+ // }}
+ // />,
+ // ]}
+ // sortFooterChildren={true}
+ onClose={() => {
+ setShowEditablePopup(false);
+ setEditRow(null);
+ }}
+ >
+ );
+};
+
+export default EditablePopup;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/hoc/FieldComposer.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/hoc/FieldComposer.js
new file mode 100644
index 00000000..76b06a98
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/hoc/FieldComposer.js
@@ -0,0 +1,405 @@
+import React, { Fragment } from "react";
+import {
+ CardText,
+ CheckBox,
+ ErrorMessage,
+ HeaderComponent,
+ InputTextAmount,
+ MobileNumber,
+ MultiSelectDropdown,
+ Paragraph,
+ TextArea,
+ TextInput
+} from "../atoms";
+import { ApiDropdown, CustomDropdown, LocationDropdownWrapper, MultiUploadWrapper } from "../molecules";
+import UploadFileComposer from "./UploadFileComposer";
+import { useTranslation } from "react-i18next";
+import { useState, useEffect } from "react";
+
+// const FieldComposer = (type, populators, isMandatory, disable = false, component, config, sectionFormCategory, formData, selectedFormCategory) => {
+const FieldComposer = ({
+ type,
+ populators,
+ isMandatory,
+ component,
+ config,
+ sectionFormCategory,
+ formData,
+ selectedFormCategory,
+ onChange,
+ ref,
+ value,
+ props,
+ errors,
+ onBlur,
+ controllerProps,
+ variant,
+ placeholder,
+ disable = false,
+ noneditable = false,
+ focused = false,
+ charCount
+}) => {
+ const { t } = useTranslation();
+ let disableFormValidation = false;
+ if (sectionFormCategory && selectedFormCategory) {
+ disableFormValidation = sectionFormCategory !== selectedFormCategory ? true : false;
+ }
+ const Component = typeof component === "string" ? Digit.ComponentRegistryService.getComponent(component) : component;
+ const customValidation = config?.populators?.validation?.customValidation;
+ const customRules = customValidation ? { validate: customValidation } : {};
+ const customProps = config?.customProps;
+ const [currentCharCount, setCurrentCharCount] = useState(0);
+
+ useEffect(() => {
+ setCurrentCharCount(value.length);
+ }, [value]);
+ const renderField = () => {
+ switch (type) {
+ case "date":
+ case "text":
+ case "number":
+ case "password":
+ case "time":
+ case "search":
+ case "prefix":
+ case "suffix":
+ case "geolocation":
+ return (
+
+ );
+ case "amount":
+ return (
+
+ );
+ case "textarea":
+ return (
+
+
+
+ );
+ case "paragraph":
+ return (
+
+ );
+ case "mobileNumber":
+ return (
+
+
+
+ );
+ case "custom":
+ return populators.component;
+ case "checkbox":
+ return (
+
+ {
+ // const obj = {
+ // ...props.value,
+ // [e.target.value]: e.target.checked
+ // }
+ onChange(e.target.checked);
+ }}
+ value={formData?.[populators.name]}
+ checked={formData?.[populators.name]}
+ label={t(`${populators?.title}`)}
+ styles={populators?.styles}
+ style={populators?.labelStyles}
+ variant={variant ? variant : errors?.[populators.name] ? "digit-field-error" : ""}
+ />
+
+ );
+ case "multiupload":
+ return (
+
+ );
+ case "select":
+ case "radio":
+ case "dropdown":
+ case "radioordropdown":
+ return (
+
+
+
+ );
+ case "component":
+ return (
+
+ );
+ case "documentUpload":
+ return (
+
+ );
+ case "form":
+ return (
+
+ );
+ case "locationdropdown":
+ return (
+
+
+
+ );
+ case "apidropdown":
+ return (
+
+ );
+ case "multiselectdropdown":
+ return (
+
+ {
+ onChange(
+ e
+ ?.map((row) => {
+ return row?.[1] ? row[1] : null;
+ })
+ .filter((e) => e)
+ );
+ }}
+ selected={value || []}
+ defaultLabel={t(populators?.defaultText)}
+ defaultUnit={t(populators?.selectedText)}
+ config={populators}
+ variant={variant ? variant : errors?.[populators.name] ? "digit-field-error" : ""}
+ />
+
+ );
+ default:
+ return null;
+ }
+ };
+
+ const renderCharCount = () => {
+ if (charCount) {
+ const maxCharacters = populators?.validation?.maxlength || 50;
+ return (
+
+ {currentCharCount}/{maxCharacters}
+
+ );
+ }
+ }
+
+ return (
+ <>
+ {!config.withoutLabel && (
+
+ {t(config.label)}
+ {config?.appendColon ? " : " : null}
+ {config.isMandatory ? " * " : null}
+ {config.withoutInfo ? null : ⓘ }
+
+ )}
+
+ {renderField()}
+
+ {config?.description && {t(config?.description)} }
+ {renderCharCount()}
+
+ {errors.errorMessage ? (
+
+ ) : null}
+ {/* {populators?.name && errors && errors[populators?.name] && Object.keys(errors[populators?.name]).length ? (
+
+ ) : // {t(field?.populators?.error)}
+ //
+ null} */}
+
+ >
+ );
+};
+
+export default FieldComposer;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/hoc/FieldController.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/hoc/FieldController.js
new file mode 100644
index 00000000..01f68107
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/hoc/FieldController.js
@@ -0,0 +1,94 @@
+import React from "react";
+// import FieldComposer from "./FieldComposer";
+import FieldV1 from "./FieldV1";
+import { Controller } from "react-hook-form";
+
+function FieldController(args) {
+ const {
+ type,
+ populators,
+ isMandatory,
+ disable,
+ component,
+ config,
+ sectionFormCategory,
+ formData,
+ selectedFormCategory,
+ control,
+ props,
+ errors,
+ controllerProps,
+ } = args;
+ let { apiDetails } = props;
+ let disableFormValidation = false;
+ if (sectionFormCategory && selectedFormCategory) {
+ disableFormValidation = sectionFormCategory !== selectedFormCategory ? true : false;
+ }
+ const customValidation = config?.populators?.validation?.customValidation;
+ let customValidations = config?.additionalValidation
+ ? Digit?.Customizations?.[apiDetails?.masterName]?.[apiDetails?.moduleName]?.additionalValidations(
+ config?.additionalValidation?.type,
+ formData,
+ config?.additionalValidation?.keys
+ )
+ : null;
+ const customRules = customValidation ? { validate: customValidation } : customValidations ? { validate: customValidation } : {};
+ const error = (populators?.name && errors && errors[populators?.name] && Object.keys(errors[populators?.name]).length) ? (populators?.error) : null
+ const customProps = config?.customProps;
+
+ return (
+ {
+ const onChange = contoprops?.onChange;
+ const ref = contoprops?.ref;
+ const value = contoprops?.value;
+ const onBlur = contoprops?.onBlur;
+ console.log(contoprops,"propssst")
+ console.log("FieldController - onChange:", onChange);
+ console.log("FieldController - value:", value);
+ console.log("populators name", populators?.name);
+ console.log("Controller Render - onChange:", onChange);
+ return {
+ console.log("FieldController - New Value:", val);
+ console.log(onChange,"onchange");
+ onChange?.(val); // Ensure it updates form state
+ }}
+ ref={ref}
+ value={value}
+ props={props}
+ errors={errors}
+ onBlur={onBlur}
+ controllerProps={controllerProps}
+ />
+ }}
+ key={populators?.name}
+ name={populators?.name}
+ rules={!disableFormValidation ? { required: isMandatory, ...populators?.validation, ...customRules } : {}}
+ />
+ );
+}
+
+export default FieldController;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/hoc/FieldV1.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/hoc/FieldV1.js
new file mode 100644
index 00000000..85f5c2b3
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/hoc/FieldV1.js
@@ -0,0 +1,610 @@
+import React, { Fragment } from "react";
+import {
+ CardText,
+ ErrorMessage,
+ HeaderComponent,
+ TextArea,
+ TextInput,
+ CheckBox,
+ SVG,
+ MultiSelectDropdown,
+ MobileNumber,
+ InputTextAmount,
+ StringManipulator,
+ LabelFieldPair,
+ Button
+} from "../atoms";
+import { useTranslation } from "react-i18next";
+import { useState, useEffect } from "react";
+import UploadFileComposer from "./UploadFileComposer";
+import { CustomDropdown } from "../molecules";
+import { Controller, useFieldArray } from "react-hook-form";
+import { LocationDropdownWrapper } from "../molecules";
+import { ApiDropdown } from "../molecules";
+import { WorkflowStatusFilter } from "../molecules";
+import { DateRangeNew } from "../molecules";
+import { FormComposer } from "./FormComposerV2";
+import isEqual from 'lodash/isEqual';
+
+const FieldV1 = ({
+ type = "",
+ value = "",
+ onChange = () => {},
+ error = "",
+ label = "",
+ disabled = false,
+ nonEditable = false,
+ placeholder = "",
+ inline = false,
+ required = false,
+ description = "",
+ charCount = false,
+ populators = {},
+ withoutLabel = false,
+ props = {},
+ ref,
+ onBlur,
+ config,
+ errors,
+ infoMessage,
+ component,
+ sectionFormCategory,
+ formData,
+ selectedFormCategory,
+ controllerProps,
+ control,
+ variant,
+}) => {
+ const { t } = useTranslation();
+ let disableFormValidation = false;
+ if (sectionFormCategory && selectedFormCategory) {
+ disableFormValidation =
+ sectionFormCategory !== selectedFormCategory ? true : false;
+ }
+ const Component =
+ typeof component === "string"
+ ? Digit.ComponentRegistryService.getComponent(component)
+ : component;
+ const customValidation = config?.populators?.validation?.customValidation;
+ const customRules = customValidation ? { validate: customValidation } : {};
+ const customProps = config?.customProps;
+ const fieldId=Digit?.Utils.getFieldIdName?.(label)||"NA";
+
+ const [currentCharCount, setCurrentCharCount] = useState(0);
+
+ useEffect(() => {
+ setCurrentCharCount(value?.length);
+ }, [value]);
+
+ const renderCharCount = () => {
+ if (charCount) {
+ const maxCharacters = populators?.validation?.maxlength || 0;
+ return (
+
+ {currentCharCount}/{maxCharacters}
+
+ );
+ }
+ };
+
+ // To render the description or the error message
+ const renderDescriptionOrError = () => {
+ if (error) {
+ return (
+
+ );
+ } else if (description) {
+ return (
+
+ {StringManipulator(
+ "TOSENTENCECASE",
+ StringManipulator("TRUNCATESTRING", t(description), {
+ maxLength: 256,
+ })
+ )}
+
+ );
+ }
+ return null;
+ };
+
+ const renderField = () => {
+ switch (type) {
+ case "text":
+ case "date":
+ case "time":
+ case "geolocation":
+ case "password":
+ case "search":
+ case "number":
+ case "numeric":
+ return (
+
+ );
+ case "textarea":
+ return (
+
+
+
+ );
+ case "radio":
+ case "dropdown":
+ case "select":
+ case "radioordropdown":
+ case "toggle":
+ return (
+
+ );
+ case "checkbox":
+ return (
+
+ {
+ onChange(e.target.checked);
+ }}
+ value={value}
+ checked={formData?.[populators?.name]}
+ isIntermediate={populators?.isIntermediate}
+ label={t(`${populators?.title}`)}
+ styles={populators?.styles}
+ style={populators?.labelStyles}
+ disabled={disabled}
+ isLabelFirst={populators?.isLabelFirst}
+ id={fieldId}
+ />
+
+ );
+ case "multiselectdropdown":
+ return (
+
+ {
+ onChange(
+ e
+ ?.map((row) => {
+ return row?.[1] ? row[1] : null;
+ })
+ .filter((e) => e)
+ );
+ }}
+ selected={value || []}
+ defaultLabel={t(populators?.defaultText)}
+ defaultUnit={t(populators?.selectedText)}
+ config={populators}
+ disabled={disabled}
+ variant={variant}
+ addSelectAllCheck={populators?.addSelectAllCheck}
+ addCategorySelectAllCheck={populators?.addCategorySelectAllCheck}
+ selectAllLabel={populators?.selectAllLabel}
+ categorySelectAllLabel={populators?.categorySelectAllLabel}
+ restrictSelection={populators?.restrictSelection}
+ isSearchable={populators?.isSearchable}
+ />
+
+ );
+ case "mobileNumber":
+ return (
+
+
+
+ );
+ case "component":
+ return (
+
+ );
+ case "documentUpload":
+ return (
+
+ );
+ case "custom":
+ return populators.component;
+ case "amount":
+ return (
+
+ );
+ case "locationdropdown":
+ return (
+ {
+ return (
+
+
+
+ );
+ }}
+ />
+ );
+ case "apidropdown":
+ return (
+ {
+ return (
+
+ );
+ }}
+ />
+ );
+ // case "workflowstatesfilter":
+ // return (
+ // {
+ // return (
+ //
+ //
+ //
+ // );
+ // }}
+ // />
+ // );
+ case "dateRange":
+ return (
+ (
+
+ )}
+ rules={{ required: required, ...populators.validation }}
+ defaultValue={formData?.[populators?.name]}
+ name={populators?.name}
+ control={controllerProps?.control}
+ />
+ );
+ case "childForm":
+ const childConfig = populators?.childform || [];
+ return (
+
+ {
+ return {
+ if(childformData && !isEqual(formData?.[populators?.name],childformData)){
+ controllerProps.setValue(populators?.name, {...childformData});
+ }
+ }}
+ //onChange={props.onChange}
+ parentName={populators?.name}
+ inline={true}
+ hideHeader={true}
+ />
+ }}
+ rules={{ required: required, ...populators.validation }}
+ defaultValue={formData?.[populators?.name]}
+ name={populators?.name}
+ control={controllerProps?.control}
+ />
+
+ );
+
+ case "multiChildForm":
+ const multichildConfig = populators?.childform || [];
+ const entries = formData?.[populators?.name] || [];
+
+ return (
+
+ {entries.filter((ob) => ob != undefined).map((item, index) => (
+
+ {/* Cross Button to Remove */}
+ {
+ const updated = [...(formData?.[populators?.name] || [])];
+ updated.splice(index, 1);
+ controllerProps.setValue(`${populators?.name}[${index}]`, undefined);
+ }}
+ >
+ ×
+
+
+ {
+ //const childformValues = props?.field?.value || [];
+ return( {
+ const updated = [...(formData?.[populators?.name] || [])];
+ updated[index] = childformData;
+
+ if (!isEqual(updated[index], formData?.[populators?.name][index])) {
+ controllerProps.setValue(`${populators?.name}[${index}]`, {...updated[index]});
+ }
+ }}
+ parentName={`${populators?.name}[${index}]`}
+ inline={true}
+ hideHeader={true}
+ />);
+ }}
+ name={`${populators?.name}[${index}]`}
+ control={controllerProps?.control}
+ defaultValue={item}
+ />
+
+
+
+ ))}
+
+ {/* Add Another Button */}
+
{
+ const updated = [...(formData?.[populators?.name] || []), {}];
+ controllerProps.setValue(populators?.name, updated);
+ }}
+ >
+
+
+ );
+
+ default:
+ return null;
+ }
+ };
+
+
+
+ return (
+
+ {!withoutLabel && (
+
+
+
+ {StringManipulator(
+ "TOSENTENCECASE",
+ StringManipulator("TRUNCATESTRING", t(label), {
+ maxLength: 64,
+ })
+ )}
+
+
{required ? " * " : null}
+ {infoMessage ? (
+
+
+ {t(infoMessage)}
+
+ ) : null}
+
+
+ )}
+
+ {renderField()}
+
+ {renderDescriptionOrError()}
+ {renderCharCount()}
+
+
+
+ );
+};
+
+export default FieldV1;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/hoc/Fields.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/hoc/Fields.js
new file mode 100644
index 00000000..24395576
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/hoc/Fields.js
@@ -0,0 +1,439 @@
+import React from "react";
+import { CheckBox, InputTextAmount, MobileNumber, MultiSelectDropdown, Paragraph, TextArea, TextInput } from "../atoms";
+import { ApiDropdown, CustomDropdown, LocationDropdownWrapper, MultiUploadWrapper } from "../molecules";
+import { useForm, Controller } from "react-hook-form";
+import UploadFileComposer from "./UploadFileComposer";
+// import { CustomDropdown } from "../atoms-groups";
+
+const Fields = (
+ t,
+ errors,
+ type,
+ populators,
+ isMandatory,
+ disable = false,
+ component,
+ config,
+ sectionFormCategory,
+ formData,
+ control,
+ selectedFormCategory,
+ setValue,
+ register,
+ setError,
+ clearErrors,
+ formState,
+ getValues,
+ handleSubmit,
+ reset,
+ watch,
+ trigger,
+ unregister
+) => {
+ let disableFormValidation = false;
+ // disable form validation if section category does not matches with the current category
+ // this will avoid validation for the other categories other than the current category.
+ // sectionFormCategory comes as part of section config and selectedFormCategory is a state managed by the FormComposer consumer.
+ if (sectionFormCategory && selectedFormCategory) {
+ disableFormValidation = sectionFormCategory !== selectedFormCategory ? true : false;
+ }
+ const Component = typeof component === "string" ? Digit.ComponentRegistryService.getComponent(component) : component;
+ const customValidation = config?.populators?.validation?.customValidation;
+ const customRules = customValidation ? { validate: customValidation } : {};
+ const customProps = config?.customProps;
+ switch (type) {
+ case "date":
+ case "text":
+ case "number":
+ case "password":
+ case "time":
+ return (
+
+ {populators?.componentInFront ? {populators.componentInFront} : null}
+ (
+
+ )}
+ name={populators.name}
+ rules={!disableFormValidation ? { required: isMandatory, ...populators.validation, ...customRules } : {}}
+ control={control}
+ />
+
+ );
+ case "amount":
+ return (
+
+ {populators?.componentInFront ? {populators.componentInFront} : null}
+ (
+
+ )}
+ name={populators.name}
+ rules={!disableFormValidation ? { required: isMandatory, ...populators.validation, ...customRules } : {}}
+ control={control}
+ />
+
+ );
+ case "textarea":
+ return (
+
+ (
+
+ )}
+ name={populators.name}
+ rules={!disableFormValidation ? { required: isMandatory, ...populators.validation } : {}}
+ control={control}
+ />
+
+ );
+ case "paragraph":
+ return (
+
+
(
+
+ )}
+ name={populators.name}
+ rules={!disableFormValidation ? { required: isMandatory, ...populators.validation } : {}}
+ control={control}
+ />
+
+ );
+ case "mobileNumber":
+ return (
+
+ (
+
+ )}
+ defaultValue={populators.defaultValue}
+ name={populators?.name}
+ rules={!disableFormValidation ? { required: isMandatory, ...populators.validation } : {}}
+ control={control}
+ />
+
+ );
+ case "custom":
+ return (
+ populators.component({ ...props, setValue }, populators.customProps)}
+ defaultValue={populators.defaultValue}
+ name={populators?.name}
+ control={control}
+ />
+ );
+ case "checkbox":
+ return (
+ {
+ return (
+
+ {
+ // const obj = {
+ // ...props.value,
+ // [e.target.value]: e.target.checked
+ // }
+
+ props.onChange(e.target.checked);
+ }}
+ value={formData?.[populators.name]}
+ checked={formData?.[populators.name]}
+ label={t(`${populators?.title}`)}
+ styles={populators?.styles}
+ style={populators?.labelStyles}
+ />
+
+ );
+ }}
+ />
+ );
+ case "multiupload":
+ return (
+ {
+ function getFileStoreData(filesData) {
+ const numberOfFiles = filesData.length;
+ let finalDocumentData = [];
+ if (numberOfFiles > 0) {
+ filesData.forEach((value) => {
+ finalDocumentData.push({
+ fileName: value?.[0],
+ fileStoreId: value?.[1]?.fileStoreId?.fileStoreId,
+ documentType: value?.[1]?.file?.type,
+ });
+ });
+ }
+ //here we need to update the form the same way as the state of the reducer in multiupload, since Upload component within the multiupload wrapper uses that same format of state so we need to set the form data as well in the same way. Previously we were altering it and updating the formData
+ onChange(numberOfFiles > 0 ? filesData : []);
+ }
+ return (
+
+ );
+ }}
+ />
+ );
+ case "select":
+ case "radio":
+ case "dropdown":
+ case "radioordropdown":
+ return (
+
+ (
+
+ )}
+ rules={!disableFormValidation ? { required: isMandatory, ...populators.validation } : {}}
+ defaultValue={formData?.[populators.name]}
+ name={config.key}
+ control={control}
+ />
+
+ );
+ case "component":
+ return (
+ (
+
+ )}
+ name={config.key}
+ control={control}
+ />
+ );
+ case "documentUpload":
+ return (
+
+ );
+ case "form":
+ return (
+
+ );
+ case "locationdropdown":
+ return (
+
+
{
+ return (
+ //
+
+ //
+ );
+ }}
+ />
+
+ );
+ case "apidropdown":
+ return (
+ {
+ return (
+
+ );
+ }}
+ />
+ );
+ case "multiselectdropdown":
+ return (
+ {
+ return (
+
+ {
+ props.onChange(
+ e
+ ?.map((row) => {
+ return row?.[1] ? row[1] : null;
+ })
+ .filter((e) => e)
+ );
+ }}
+ selected={props?.value || []}
+ defaultLabel={t(populators?.defaultText)}
+ defaultUnit={t(populators?.selectedText)}
+ config={populators}
+ />
+
+ );
+ }}
+ />
+ );
+ default:
+ // return populators?.dependency !== false ? populators : null;
+ return null;
+ }
+};
+
+export default Fields;
+
+
+//TODO: This component is currently not in use. We plan to revisit it later for necessary changes and updates.
+//
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/hoc/FormComposerV2.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/hoc/FormComposerV2.js
new file mode 100644
index 00000000..7b0b94cd
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/hoc/FormComposerV2.js
@@ -0,0 +1,427 @@
+import React, { useEffect, useMemo, useState, Fragment, useCallback } from "react";
+import { useForm, Controller } from "react-hook-form";
+import { useTranslation } from "react-i18next";
+import _ from "lodash";
+
+// atoms need for initial setup
+import BreakLine from "../atoms/BreakLine";
+import Card from "../atoms/Card";
+import HeaderComponent from "../atoms/HeaderComponent";
+import ActionLinks from "../atoms/ActionLinks";
+import Footer from "../atoms/Footer";
+import LabelFieldPair from "../atoms/LabelFieldPair";
+import HorizontalNav from "../atoms/HorizontalNav";
+import { SubmitBar, Toast } from "../atoms";
+
+// import Fields from "./Fields"; //This is a field selector pickup from formcomposer
+import FieldController from "./FieldController";
+
+const wrapperStyles = {
+ display: "flex",
+ flexDirection: "column",
+ alignItems: "flex-start",
+ border: "solid",
+ borderRadius: "5px",
+ padding: "10px",
+ paddingTop: "20px",
+ marginTop: "10px",
+ borderColor: "#f3f3f3",
+ background: "#FAFAFA",
+ marginBottom: "20px",
+};
+
+/**
+ * formcomposer used to render forms
+ *
+ * @author jagankumar-egov
+ *
+ * @example
+ *
+ * refer this implementation of sample file
+ * frontend/micro-ui/web/micro-ui-internals/packages/modules/AttendenceMgmt/src/pages/citizen/Sample.js
+ *
+ */
+
+export const FormComposer = (props) => {
+ const {
+ register,
+ handleSubmit,
+ setValue,
+ getValues,
+ reset,
+ watch,
+ trigger,
+ control,
+ formState,
+ errors,
+ setError,
+ clearErrors,
+ unregister,
+ } = useForm({
+ defaultValues: props.defaultValues,
+ });
+ const { t } = useTranslation();
+ const formData = watch();
+ const selectedFormCategory = props?.currentFormCategory;
+ const [showErrorToast, setShowErrorToast] = useState(false);
+ const [customToast, setCustomToast] = useState(false);
+ //clear all errors if user has changed the form category.
+ //This is done in case user first click on submit and have errors in cat 1, switches to cat 2 and hit submit with errors
+ //So, he should not get error prompts from previous cat 1 on cat 2 submit.
+ useEffect(() => {
+ clearErrors();
+ }, [selectedFormCategory]);
+
+ useEffect(() => {
+ if (Object.keys(formState?.errors).length > 0 && formState?.submitCount > 0) {
+ setShowErrorToast(true);
+ }
+ }, [formState?.errors, formState?.submitCount]);
+
+ useEffect(() => {
+ if (
+ props?.appData &&
+ Object.keys(props?.appData)?.length > 0 &&
+ (!_.isEqual(props?.appData, formData) || !_.isEqual(props?.appData?.ConnectionHolderDetails?.[0], formData?.ConnectionHolderDetails?.[0]))
+ ) {
+ reset({ ...props?.appData });
+ }
+ }, [props?.appData, formData, props?.appData?.ConnectionHolderDetails]);
+
+ useEffect(() => {
+ props.getFormAccessors && props.getFormAccessors({ setValue, getValues });
+ }, []);
+
+ useEffect(()=>{
+ setCustomToast(props?.customToast);
+ },[props?.customToast])
+ function onSubmit(data) {
+ props.onSubmit(data);
+ }
+
+ function onSecondayActionClick(data) {
+ props.onSecondayActionClick();
+ }
+
+ useEffect(() => {
+ props.onFormValueChange && props.onFormValueChange(setValue, formData, formState, reset, setError, clearErrors, trigger, getValues);
+ }, [formData]);
+
+ const fieldSelector = (type, populators, isMandatory, disable = false, component, config, sectionFormCategory) =>
+ // Calling field controller to render all label and fields
+ FieldController({
+ type: type,
+ populators: populators,
+ isMandatory: isMandatory,
+ disable: disable,
+ component: component,
+ config: config,
+ sectionFormCategory: sectionFormCategory,
+ formData: formData,
+ selectedFormCategory: selectedFormCategory,
+ control: control,
+ props: props,
+ errors: errors,
+ control:control,
+ controllerProps: {
+ register,
+ handleSubmit,
+ setValue,
+ getValues,
+ reset,
+ watch,
+ trigger,
+ control,
+ formState,
+ errors,
+ setError,
+ clearErrors,
+ unregister,
+ },
+ });
+
+ const getCombinedStyle = (placementinBox) => {
+ switch (placementinBox) {
+ case 0:
+ return {
+ border: "solid",
+ borderRadius: "5px",
+ padding: "10px",
+ paddingTop: "20px",
+ marginTop: "10px",
+ borderColor: "#f3f3f3",
+ background: "#FAFAFA",
+ marginBottom: "20px",
+ };
+ case 1:
+ return {
+ border: "solid",
+ borderRadius: "5px",
+ padding: "10px",
+ paddingTop: "20px",
+ marginTop: "-30px",
+ borderColor: "#f3f3f3",
+ background: "#FAFAFA",
+ borderTop: "0px",
+ borderBottom: "0px",
+ };
+ case 2:
+ return {
+ border: "solid",
+ borderRadius: "5px",
+ padding: "10px",
+ paddingTop: "20px",
+ marginTop: "-30px",
+ borderColor: "#f3f3f3",
+ background: "#FAFAFA",
+ marginBottom: "20px",
+ borderTop: "0px",
+ };
+ }
+ };
+
+ const titleStyle = { color: "#505A5F", fontWeight: "700", fontSize: "16px" };
+
+ const getCombinedComponent = (section) => {
+ if (section.head && section.subHead) {
+ return (
+ <>
+
+ {t(section.head)}
+
+
+ {t(section.subHead)}
+
+ >
+ );
+ } else if (section.head) {
+ return (
+ <>
+
+ {t(section.head)}
+
+ >
+ );
+ } else {
+ return
;
+ }
+ };
+
+ const closeToast = () => {
+ setShowErrorToast(false);
+ setCustomToast(false);
+ props?.updateCustomToast&&props?.updateCustomToast(false);
+ };
+
+
+ const formFields = useCallback(
+ (section, index, array, sectionFormCategory) => (
+
+ {section && getCombinedComponent(section)}
+ {section.body.map((field, index) => {
+ if (field?.populators?.hideInForm) return null;
+ if (props.inline)
+ return (
+
+
+ {/* {!field.withoutLabel && (
+
+ {t(field.label)}
+ {field.isMandatory ? " * " : null}
+ {field.labelChildren && field.labelChildren}
+
+ )} */}
+ {/* {errors && errors[field.populators?.name] && Object.keys(errors[field.populators?.name]).length ? (
+
{t(field.populators.error || errors[field.populators?.name]?.message)}
+ ) : null} */}
+
+ {fieldSelector(field.type, field.populators, field.isMandatory, field?.disable, field?.component, field, sectionFormCategory)}
+ {field?.description && (
+
+ {t(field.description)}
+
+ )}
+
+
+
+ );
+ return (
+
+
+ {fieldSelector(field.type, field.populators, field.isMandatory, field?.disable, field?.component, field, sectionFormCategory)}
+
+ {/* Commenting to initialize & check Field Controller and composer which render label and field Should remove later*/}
+ {/*{!field.withoutLabel && (
+
+ {t(field.label)}
+ {field?.appendColon ? " : " : null}
+ {field.isMandatory ? " * " : null}
+
+ )}
+
+ {fieldSelector(field.type, field.populators, field.isMandatory, field?.disable, field?.component, field, sectionFormCategory)}
+ {field?.description && {t(field?.description)} }
+
*/}
+
+
+ {/* Migrating error message to field container as here it renders outside the field */}
+ {/* {field?.populators?.name && errors && errors[field?.populators?.name] && Object.keys(errors[field?.populators?.name]).length ? (
+
+ ) : // {t(field?.populators?.error)}
+ //
+ null} */}
+
+ );
+ })}
+ {!props.noBreakLine && (array.length - 1 === index ? null : )}
+
+ ),
+ [props.config, formData]
+ );
+
+ const getCardStyles = (shouldDisplay = true) => {
+ let styles = props.cardStyle || {};
+ if (props.noBoxShadow) styles = { ...styles, boxShadow: "none" };
+ if (!shouldDisplay) styles = { ...styles, display: "none" };
+ return styles;
+ };
+
+ const isDisabled = props.isDisabled || false;
+ const checkKeyDown = (e) => {
+ const keyCode = e.keyCode ? e.keyCode : e.key ? e.key : e.which;
+ if (keyCode === 13) {
+ // e.preventDefault();
+ }
+ };
+
+ const setActiveNavByDefault = (configNav) => {
+ let setActiveByDefaultRow = null;
+ configNav?.forEach((row) => {
+ if (row?.activeByDefault) {
+ setActiveByDefaultRow = row;
+ }
+ });
+
+ if (setActiveByDefaultRow) {
+ return setActiveByDefaultRow?.name;
+ }
+
+ return configNav?.[0]?.name;
+ };
+
+ const [activeLink, setActiveLink] = useState(props.horizontalNavConfig ? setActiveNavByDefault(props.horizontalNavConfig) : null);
+
+ useEffect(() => {
+ setActiveLink(setActiveNavByDefault(props.horizontalNavConfig));
+ }, [props.horizontalNavConfig]);
+
+ const renderFormFields = (props, section, index, array, sectionFormCategory) => (
+
+ {!props.childrenAtTheBottom && props.children}
+ {props.heading && {props.heading} }
+ {props.description && {props.description} }
+ {props.text && {props.text} }
+ {formFields(section, index, array, sectionFormCategory)}
+ {props.childrenAtTheBottom && props.children}
+ {props.submitInForm && (
+
+ )}
+ {props.secondaryActionLabel && (
+
+ {props.secondaryActionLabel}
+
+ )}
+
+ );
+
+ return (
+
+ );
+};
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/hoc/InboxSearchComposer.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/hoc/InboxSearchComposer.js
new file mode 100644
index 00000000..cf712d7e
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/hoc/InboxSearchComposer.js
@@ -0,0 +1,455 @@
+import React, { useEffect, useReducer, useState,useMemo,useRef } from "react";
+import Toast from "../atoms/Toast";
+import { useHistory} from "react-router-dom";
+import reducer, { initialInboxState } from "./InboxSearchComposerReducer";
+import InboxSearchLinks from "../atoms/InboxSearchLinks";
+import { InboxContext } from "./InboxSearchComposerContext";
+import SearchComponent from "../atoms/SearchComponent";
+import PopUp from "../atoms/PopUp";
+import SearchAction from "../molecules/SearchAction";
+import FilterAction from "../molecules/FilterAction";
+import SortAction from "../molecules/SortAction";
+import MobileSearchComponent from "./MobileView/MobileSearchComponent";
+import MobileSearchResults from "./MobileView/MobileSearchResults";
+import MediaQuery from 'react-responsive';
+import _ from "lodash";
+import HeaderComponent from "../atoms/HeaderComponent";
+import { useTranslation } from "react-i18next";
+import { Button, Footer } from "../atoms";
+import ResultsDataTableWrapper from "./ResultsDataTableWrapper";
+
+
+const InboxSearchComposer = ({configs,additionalConfig,onFormValueChange=()=>{},showTab,tabData,onTabChange,customizers={}}) => {
+
+ const renderCount = useRef(1); // Initialize render count
+
+ useEffect(() => {
+ console.log(`Render Count:${renderCount.current}`);
+ renderCount.current += 1; // Increment render count after each render
+ });
+
+ const hasRun = useRef(false);
+ const history = useHistory();
+ const { t } = useTranslation();
+
+ const [enable, setEnable] = useState(false);
+ const [state, dispatch] = useReducer(reducer, initialInboxState(configs));
+ const [showToast, setShowToast] = useState(false);
+ //for mobile view
+ const [type, setType] = useState("");
+ const [popup, setPopup] = useState(false);
+
+ const [apiDetails, setApiDetails] = useState(configs?.apiDetails);
+
+ if (!hasRun.current) {
+ hasRun.current = true;
+ // let hasCustomizers = false;
+ // if(Object.keys(customizers).length>0){
+ // hasCustomizers = true;
+ // // dispatch({
+ // // type:"customizers",
+ // // state:customizers
+ // // })
+ // }
+ //if the current moduleName is there in UICustomizations already then don't do anything, otherwise add customizers to it
+ if(!Object.keys({...Digit?.Customizations?.commonUiConfig?.[configs.apiDetails.moduleName]}).length>0 && Object.keys(customizers).length>0){
+ Digit.Customizations.commonUiConfig = {...Digit.Customizations.commonUiConfig,[configs.apiDetails.moduleName]:{...customizers}}
+ }
+ }
+
+ useEffect(()=>{
+ setApiDetails(configs?.apiDetails)
+ },[configs])
+
+ const mobileSearchSession = Digit.Hooks.useSessionStorage("MOBILE_SEARCH_MODAL_FORM",
+ {}
+ );
+ const [sessionFormData, setSessionFormData, clearSessionFormData] = mobileSearchSession;
+
+ //for mobile view
+ useEffect(() => {
+ if (type) setPopup(true);
+ }, [type]);
+
+ useEffect(()=>{
+ clearSessionFormData();
+ },[]);
+
+ useEffect(() => {
+ //here if jsonpaths for search & table are same then searchform gets overridden
+
+ if (Object.keys(state.searchForm)?.length >= 0) {
+ const result = { ..._.get(apiDetails, apiDetails?.searchFormJsonPath, {}), ...state.searchForm }
+ Object.keys(result).forEach(key => {
+ if (!result[key]) delete result[key]
+ });
+ _.set(apiDetails, apiDetails?.searchFormJsonPath, result)
+ }
+ if (Object.keys(state.filterForm)?.length >= 0) {
+ const result = { ..._.get(apiDetails, apiDetails?.filterFormJsonPath, {}), ...state.filterForm }
+ Object.keys(result).forEach(key => {
+ if (!result[key] || result[key]?.length===0) delete result[key]
+ });
+ _.set(apiDetails, apiDetails?.filterFormJsonPath, result)
+ }
+
+ if(Object.keys(state.tableForm)?.length >= 0) {
+ _.set(apiDetails, apiDetails?.tableFormJsonPath, { ..._.get(apiDetails, apiDetails?.tableFormJsonPath, {}),...state.tableForm })
+ }
+ const searchFormParamCount = Object.keys(state.searchForm).reduce((count,key)=>state.searchForm[key]===""?count:count+1,0)
+ const filterFormParamCount = Object.keys(state.filterForm).reduce((count, key) => state.filterForm[key] === "" ? count : count + 1, 0)
+
+ if (Object.keys(state.tableForm)?.length > 0 && (searchFormParamCount >= apiDetails?.minParametersForSearchForm || filterFormParamCount >= apiDetails?.minParametersForFilterForm)){
+ setEnable(true)
+ }
+
+ if(configs?.type === 'inbox' || configs?.type === 'download') setEnable(true)
+
+ },[state])
+
+
+ useEffect(() => {
+ onFormValueChange(state)
+ }, [state])
+
+
+ let requestCriteria = {
+ url:configs?.apiDetails?.serviceName,
+ params:configs?.apiDetails?.requestParam,
+ body:configs?.apiDetails?.requestBody,
+ config: {
+ enabled: enable,
+ },
+ state
+ };
+
+ //clear the reducer state when user moves away from inbox screen(it already resets when component unmounts)(keeping this code here for reference)
+ // useEffect(() => {
+ // return () => {
+ // if (!window.location.href.includes("/inbox")) {
+
+ // dispatch({
+ // type: "clearSearchForm",
+ // state: configs?.sections?.search?.uiConfig?.defaultValues
+ // //need to pass form with empty strings
+ // })
+ // dispatch({
+ // type: "clearFilterForm",
+ // state: configs?.sections?.filter?.uiConfig?.defaultValues
+ // //need to pass form with empty strings
+ // })
+ // }
+ // };
+ // }, [location]);
+
+ const configModule = Digit?.Customizations?.[apiDetails?.masterName]?.[apiDetails?.moduleName]
+ const updatedReqCriteria = configModule?.preProcess ? configModule?.preProcess(requestCriteria,configs.additionalDetails) : requestCriteria
+
+ if(configs?.customHookName){
+ var { isLoading, data, revalidate,isFetching,refetch,error } = eval(`Digit.Hooks.${configs.customHookName}(updatedReqCriteria)`);
+ }
+ else {
+ var { isLoading, data, revalidate,isFetching,error,refetch } = Digit.Hooks.useCustomAPIHook(updatedReqCriteria);
+
+ }
+
+ const closeToast = () => {
+ setTimeout(() => {
+ setShowToast(null);
+ }, 5000);
+ };
+
+ useEffect(() => {
+ if(error){
+ setShowToast({ label:error?.message, type:"error" });
+ closeToast()
+ }
+ }, [error])
+
+
+ useEffect(() => {
+ if(additionalConfig?.search?.callRefetch) {
+ refetch()
+ additionalConfig?.search?.setCallRefetch(false)
+ }
+ }, [additionalConfig?.search?.callRefetch])
+
+
+ useEffect(() => {
+ return () => {
+ revalidate();
+ setEnable(false);
+ };
+ })
+
+ //for mobile view
+ const handlePopupClose = () => {
+ setPopup(false);
+ setType("");
+ }
+
+ return (
+
+
+ {configs?.headerLabel && (
+
+ {t(configs?.headerLabel)}
+
+ )}
+ {Digit.Utils.didEmployeeHasAtleastOneRole(
+ configs?.actions?.actionRoles
+ ) && (
+ {
+ history.push(
+ `/${window?.contextPath}/employee/${configs?.actions?.actionLink}`
+ );
+ }}
+ className={"digit-inbox-search-composer-action"}
+ type="button"
+ />
+ )}
+
+
+
+ {configs?.sections?.links?.show && (
+
+
+
+
+
+ )}
+ {configs?.type === "search" && configs?.sections?.search?.show && (
+
+
+
+ )}
+ {configs?.type === "search" && configs?.sections?.filter?.show && (
+
+
+
+ )}
+ {configs?.type === "inbox" && configs?.sections?.search?.show && (
+
+
+
+
+
+ )}
+ {configs?.type === "inbox" && configs?.sections?.filter?.show && (
+
+
+
+
+
+ )}
+ {configs?.type === "inbox" && (
+
+
+ {configs?.sections?.filter?.show && (
+ {
+ setType("FILTER");
+ setPopup(true);
+ }}
+ />
+ )}
+ {configs?.sections?.search?.show && (
+ {
+ setType("SEARCH");
+ setPopup(true);
+ }}
+ />
+ )}
+ {configs?.sections?.sort?.show && (
+ {
+ setType("SORT");
+ setPopup(true);
+ }}
+ />
+ )}
+
+
+ )}
+ {configs?.sections?.searchResult?.show && (
+
0
+ ? !(isLoading || isFetching)
+ ? { overflowX: "auto" }
+ : {}
+ : {}
+ }
+ >
+
+
+
+
+
+
+
+ )}
+ {popup && (
+
+ {type === "FILTER" && (
+
+
+
+ )}
+ {/* {type === "SORT" && (
+
+ { }
+
+ )} */}
+ {type === "SEARCH" && (
+
+
+
+ )}
+
+ )}
+
+
+ {/* One can use this Parent to add additional sub parents to render more sections */}
+
+
+ {showToast && (
+ setShowToast(null)}
+ >
+ )}
+ {configs?.footerProps?.showFooter &&
+ Digit.Utils.didEmployeeHasAtleastOneRole(
+ configs?.footerProps?.allowedRolesForFooter
+ ) && (
+
+ Digit.Utils.didEmployeeHasAtleastOneRole(
+ btnConfig?.allowedRoles
+ )
+ )
+ ?.map((btnConfig, index) => (
+
+ configModule?.footerActionHandler?.(index, event)
+ }
+ />
+ ))}
+ className={configs?.footerProps?.className || ""}
+ maxActionFieldsAllowed={
+ configs?.footerProps?.maxActionFieldsAllowed
+ }
+ setactionFieldsToLeft={
+ configs?.footerProps?.setactionFieldsToLeft
+ }
+ setactionFieldsToRight={
+ configs?.footerProps?.setactionFieldsToRight
+ }
+ sortActionFields={
+ configs?.footerProps?.sortActionFields
+ ? configs?.footerProps?.sortActionFields
+ : true
+ }
+ style={configs?.footerProps?.style || {}}
+ />
+ )}
+
+ );
+}
+
+export default InboxSearchComposer;
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/hoc/InboxSearchComposerContext.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/hoc/InboxSearchComposerContext.js
new file mode 100644
index 00000000..28e27b4c
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/hoc/InboxSearchComposerContext.js
@@ -0,0 +1,3 @@
+import { createContext } from 'react';
+
+export const InboxContext = createContext(null);
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/hoc/InboxSearchComposerReducer.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/hoc/InboxSearchComposerReducer.js
new file mode 100644
index 00000000..a37a2491
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/hoc/InboxSearchComposerReducer.js
@@ -0,0 +1,107 @@
+import _ from 'lodash';
+
+function removeObjectFromArray(array, key, value) {
+ // Find the index of the object with the specified key and value
+ const indexToRemove = array.findIndex((obj) => obj[key] === value);
+
+ // If the object is found, remove it from the array
+ if (indexToRemove !== -1) {
+ array.splice(indexToRemove, 1);
+ }
+
+ // Return the modified array
+ return array;
+}
+
+export const initialInboxState = (config) => {
+
+ if(config?.sections?.searchResult?.uiConfig?.customDefaultPagination) {
+ return {
+ searchForm: {},
+ filterForm: {},
+ tableForm: {
+ ...config?.sections?.searchResult?.uiConfig?.customDefaultPagination,
+ },
+ };
+ }
+
+ return {
+ searchForm: {},
+ filterForm: {},
+ tableForm: {
+ limit: 10,
+ offset: 0,
+ },
+ hasCustomizers:false,
+ customizers:{}
+ }
+};
+
+const reducer = (state, action) => {
+ switch (action.type) {
+ case 'searchForm':
+ const { state: updatedSearchStateSearchForm } = action;
+ return {
+ ...state,
+ searchForm: { ...state.searchForm, ...updatedSearchStateSearchForm },
+ };
+ case 'filterForm':
+ const { state: updatedSearchStateFilterForm } = action;
+ return {
+ ...state,
+ filterForm: { ...state.filterForm, ...updatedSearchStateFilterForm },
+ };
+ case 'tableForm':
+ const updatedTableState = action.state;
+ return {
+ ...state,
+ tableForm: { ...state.tableForm, ...updatedTableState },
+ };
+ case 'clearSearchForm':
+ return { ...state, searchForm: action.state };
+ case 'clearFilterForm':
+ return { ...state, filterForm: action.state };
+ case 'jsonPath':
+ const {
+ tag: { removableTagConf },
+ } = action;
+ const stateObj = _.cloneDeep(state);
+ switch (removableTagConf?.type) {
+ case 'multi':
+ _.set(
+ stateObj,
+ removableTagConf?.sessionJsonPath,
+ removeObjectFromArray(
+ _.get(state, removableTagConf?.sessionJsonPath),
+ removableTagConf?.deleteRef,
+ removableTagConf?.value?.[removableTagConf?.deleteRef]
+ )
+ );
+ return stateObj;
+
+ case 'single':
+ _.set(stateObj, removableTagConf?.sessionJsonPath, '');
+ return stateObj;
+
+ case 'dateRange':
+ _.set(stateObj, removableTagConf?.sessionJsonPath, '');
+ return stateObj;
+ case 'workflowStatusFilter':
+ //if we are here then we have dynamic ids to delete from state
+ _.set(stateObj,`${removableTagConf?.sessionJsonPath}.${removableTagConf?.dynamicId}`, false)
+ return stateObj
+ default:
+ break;
+ }
+ break;
+ case 'obj':
+ const {updatedState} = action
+ return updatedState
+ case 'customizers':
+ return {...state,hasCustomizers:true,customizers:action.state};
+ default:
+ return state;
+ }
+};
+
+export default reducer;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/hoc/MobileView/MobileSearchComponent.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/hoc/MobileView/MobileSearchComponent.js
new file mode 100644
index 00000000..f789239d
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/hoc/MobileView/MobileSearchComponent.js
@@ -0,0 +1,324 @@
+import React, { useContext, useEffect, useState } from "react";
+import { useForm } from "react-hook-form";
+import { useTranslation } from "react-i18next";
+import { InboxContext } from "../InboxSearchComposerContext";
+import { CustomSVG } from "../../atoms";
+import Footer from "../../atoms/Footer";
+import SubmitBar from "../../atoms/SubmitBar";
+import LinkLabel from "../../atoms/LinkLabel";
+import RenderFormFields from "../../molecules/RenderFormFields";
+import Toast from "../../atoms/Toast";
+import _ from "lodash";
+import Button from "../../atoms/Button";
+
+const MobileSearchComponent = ({
+ uiConfig,
+ modalType,
+ header = "",
+ screenType = "search",
+ fullConfig,
+ data,
+ onClose,
+ defaultValues,
+ browserSession,
+}) => {
+ const { t } = useTranslation();
+ const { state, dispatch } = useContext(InboxContext);
+ const [showToast, setShowToast] = useState(null);
+ let updatedFields = [];
+ const { apiDetails } = fullConfig;
+
+ if (fullConfig?.postProcessResult) {
+ //conditions can be added while calling postprocess function to pass different params
+ Digit?.Customizations?.[apiDetails?.masterName]?.[
+ apiDetails?.moduleName
+ ]?.postProcess(data, uiConfig);
+ }
+
+ //define session for modal form
+ //uiConfig.type === filter || sort
+ //we need to sync browsersession and mobileSearchSession
+ // const mobileSearchSession = Digit.Hooks.useSessionStorage(`MOBILE_SEARCH_MODAL_FORM_${uiConfig?.type}_${fullConfig?.label}`,
+ // {...uiConfig?.defaultValues}
+ // );
+
+ // const [sessionFormData, setSessionFormData, clearSessionFormData] = mobileSearchSession;
+ const [session, setSession, clearSession] = browserSession || [];
+
+ const defValuesFromSession =
+ uiConfig?.typeMobile === "filter"
+ ? session?.searchForm
+ : session?.filterForm;
+
+ const {
+ register,
+ handleSubmit,
+ setValue,
+ getValues,
+ reset,
+ watch,
+ control,
+ formState,
+ errors,
+ setError,
+ clearErrors,
+ } = useForm({
+ // defaultValues: {...uiConfig?.defaultValues,...sessionFormData},
+ defaultValues: { ...uiConfig?.defaultValues, ...defValuesFromSession },
+ // defaultValues:{...uiConfig?.defaultValues}
+ });
+ const formData = watch();
+
+ const checkKeyDown = (e) => {
+ const keyCode = e.keyCode ? e.keyCode : e.key ? e.key : e.which;
+ if (keyCode === 13) {
+ e.preventDefault();
+ }
+ };
+
+ useEffect(() => {
+ updatedFields = Object.values(formState?.dirtyFields);
+ }, [formState]);
+
+ // //on form value change, update session data with form data
+ // useEffect(()=>{
+ // if (!_.isEqual(sessionFormData, formData)) {
+ // // const difference = _.pickBy(sessionFormData, (v, k) => !_.isEqual(formData[k], v));
+ // setSessionFormData({ ...sessionFormData,...formData, });
+ // }
+ // },[formData]);
+
+ // useEffect(()=>{
+ // clearSessionFormData();
+ // },[]);
+
+ const onSubmit = (data) => {
+ onClose?.();
+ if (updatedFields.length >= uiConfig?.minReqFields) {
+ // here based on screenType call respective dispatch fn
+ dispatch({
+ type: modalType === "SEARCH" ? "searchForm" : "filterForm",
+ state: {
+ ...data,
+ },
+ });
+ } else {
+ setShowToast({
+ warning: true,
+ label: t("ES_COMMON_MIN_SEARCH_CRITERIA_MSG"),
+ });
+ setTimeout(closeToast, 3000);
+ }
+ };
+
+ const clearSearch = () => {
+ // clearSessionFormData();
+ reset(uiConfig?.defaultValues);
+ dispatch({
+ type: uiConfig?.type === "filter" ? "clearFilterForm" : "clearSearchForm",
+ state: { ...uiConfig?.defaultValues },
+ //need to pass form with empty strings
+ });
+ };
+
+ const closeToast = () => {
+ setShowToast(null);
+ };
+
+ const renderHeader = () => {
+ switch (uiConfig?.typeMobile) {
+ case "filter": {
+ return (
+
+
+
+
+
+
+ {t(`${uiConfig?.headerLabel || "ES_COMMON_SEARCH_BY"}`)}
+
+
+
+
+
+ {/* */}
+
+
+
+
+ );
+ }
+ case "sort": {
+ return (
+
+
+
+
+
+
+ {t(`${uiConfig?.headerLabel || "ES_COMMON_SEARCH_BY"}`)}
+
+
+
+
+
+
+
+
+
+ );
+ }
+ case "search": {
+ return (
+
+
+
+
+
+
+ {t(`${uiConfig?.headerLabel || "ES_COMMON_SEARCH_BY"}`)}
+
+
+
+
+
+
+ );
+ }
+ default: {
+ return (
+
+
+
+
+
+
+ {t(`${uiConfig?.headerLabel || "ES_COMMON_SEARCH_BY"}`)}
+
+
+
+
+
+
+ );
+ }
+ }
+ };
+
+ return (
+
+
+
+ {showToast && (
+
+ )}
+
+
+ );
+};
+
+export default MobileSearchComponent;
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/hoc/MobileView/MobileSearchResults.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/hoc/MobileView/MobileSearchResults.js
new file mode 100644
index 00000000..3e2ee3d5
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/hoc/MobileView/MobileSearchResults.js
@@ -0,0 +1,193 @@
+import React, { useMemo, useContext, useEffect } from 'react'
+import { useForm } from "react-hook-form";
+import { useTranslation } from 'react-i18next';
+import { Details } from "../../molecules/DetailsCard";
+import { Link } from "react-router-dom";
+import NoResultsFound from "../../atoms/NoResultsFound";
+import { Loader } from "../../atoms";
+import _ from "lodash";
+import { InboxContext } from '../InboxSearchComposerContext';
+import Table from "../../atoms/Table";
+
+const MobileSearchResults = ({ config, data, isLoading, isFetching,fullConfig }) => {
+ const {apiDetails} = fullConfig
+ const { t } = useTranslation();
+ const resultsKey = config.resultsJsonPath
+ //let searchResult = data?.[resultsKey]?.length>0 ? data?.[resultsKey] : []
+ //searchResult = searchResult.reverse()
+ //const tenantId = Digit.ULBService.getCurrentTenantId();
+
+ let searchResult = _.get(data,resultsKey,[])
+ searchResult = searchResult?.length>0 ? searchResult : []
+ searchResult = searchResult.reverse();
+ const tenantId = Digit.ULBService.getCurrentTenantId();
+ const headerLocale = Digit.Utils.locale.getTransformedLocale(tenantId);
+ //reversing reason -> for some reason if we enable sorting on columns results from the api are reversed and shown, for now -> reversing the results(max size 50 so not a performance issue)
+
+ // if (fullConfig?.postProcessResult){
+ // var { isPostProcessFetching,
+ // isPostProcessLoading,
+ // combinedResponse } = Digit?.Customizations?.[apiDetails?.masterName]?.[apiDetails?.moduleName]?.postProcess(searchResult)
+
+ // if(combinedResponse?.length > 0){
+ // searchResult = combinedResponse
+ // }
+ // }
+
+ const {state,dispatch} = useContext(InboxContext)
+
+ const {
+ register,
+ handleSubmit,
+ setValue,
+ getValues,
+ reset,
+ watch,
+ trigger,
+ control,
+ formState,
+ errors,
+ setError,
+ clearErrors,
+ unregister,
+} = useForm({
+ defaultValues: {
+ offset: 0,
+ limit: 10,
+ },
+});
+
+ useEffect(() => {
+ register("offset", 0);
+ register("limit", 10);
+ }, [register]);
+
+ function onPageSizeChange(e) {
+ setValue("limit", Number(e.target.value));
+ handleSubmit(onSubmit)();
+ }
+
+ function nextPage() {
+ setValue("offset", getValues("offset") + getValues("limit"));
+ handleSubmit(onSubmit)();
+ }
+
+ function previousPage() {
+ const offsetValue = getValues("offset") - getValues("limit")
+ setValue("offset", offsetValue>0 ? offsetValue : 0);
+ handleSubmit(onSubmit)();
+ }
+
+ const onSubmit = (data) => {
+ //here update the reducer state
+ //call a dispatch to update table's part of the state and update offset, limit
+ // this will in turn make the api call and give search results and table will be rendered acc to the new data
+ dispatch({
+ type:"tableForm",
+ state:{...data}
+ })
+
+ }
+
+ const columns = [
+ {
+ Header: "",
+ accessor: "_searchResults",
+ id : "_searchResults"
+ }
+ ]
+
+ const propsMobileInboxCards = useMemo(() => {
+ if (isLoading) {
+ return [];
+ }
+ let cardData = searchResult.map((details) => {
+ let mapping = {};
+ let additionalCustomization = {};
+ let cols = config?.columns;
+ for(let columnIndex = 0; columnIndex {
+ return {
+ _searchResults :
+
+ {Object.keys(row.mapping).map(key => {
+ let toRender;
+ if(row.additionalCustomization[key]){
+ toRender = (
+ {}}
+ row={row.mapping} />)
+ }
+ else {
+ toRender = row.mapping[key]? (
+ {}}
+ row={row.mapping} />
+ ) : (
+ {}}
+ row={row.mapping} /> )
+ }
+ return toRender
+ })}
+
+ }
+ })
+
+ function RenderResult() {
+ if (searchResult?.length === 0) {
+ return ( );
+ }
+
+ if (isLoading || isFetching ) return
+ if(!data) return <>>
+ return
+
{
+ return {
+ style: {width : "200vw"},
+ };
+ }}
+ disableSort={config?.enableColumnSort ? false : true}
+ autoSort={config?.enableColumnSort ? true : false}
+ // globalSearch={config?.enableGlobalSearch ? filterValue : undefined}
+ // onSearch={config?.enableGlobalSearch ? searchQuery : undefined}
+ />
+
+ }
+
+ if (isLoading)
+ { return }
+ return (
+
+
+
+ );
+};
+
+export default MobileSearchResults;
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/hoc/Modal.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/hoc/Modal.js
new file mode 100644
index 00000000..9d119f97
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/hoc/Modal.js
@@ -0,0 +1,64 @@
+import React, { useEffect } from "react";
+
+import PopUp from "../atoms/PopUp";
+import Button from "../atoms/Button";
+import Toast from "../atoms/Toast";
+import HeaderBar from "../atoms/HeaderBar";
+
+const Modal = ({
+ headerBarMain,
+ headerBarEnd,
+ popupStyles,
+ children,
+ actionCancelLabel,
+ actionCancelOnSubmit,
+ actionSaveLabel,
+ actionSaveOnSubmit,
+ error,
+ setError,
+ formId,
+ isDisabled,
+ hideSubmit,
+ style = {},
+ popupModuleMianStyles,
+ headerBarMainStyle,
+ // isOBPSFlow = false,
+ variant = "",
+ popupModuleActionBarStyles = {},
+}) => {
+ /**
+ * TODO: It needs to be done from the desgin changes
+ */
+ // const mobileView = Digit.Utils.browser.isMobile() ? true : false;
+ useEffect(() => {
+ document.body.style.overflowY = "hidden";
+ return () => {
+ document.body.style.overflowY = "auto";
+ };
+ }, []);
+ return (
+
+
+
+
+ {children}
+
Instead of mission specific code, we need to pass classnames for addition styling for obps flow i have added classname with -> "digit-variant-obps" .
+ className={`digit-popup-module-action-bar ${variant}`}
+ style={popupModuleActionBarStyles}
+ >
+ {actionCancelLabel ? (
+
+ ) : null}
+ {!hideSubmit ? (
+
+ ) : null}
+
+
+
+ {error && setError(null)} type = {"error"} />}
+
+ );
+};
+
+export default Modal;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/hoc/ResultsDataTableWrapper.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/hoc/ResultsDataTableWrapper.js
new file mode 100644
index 00000000..693a8f44
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/hoc/ResultsDataTableWrapper.js
@@ -0,0 +1,583 @@
+import React, {
+ useMemo,
+ useCallback,
+ useState,
+ useEffect,
+ Fragment,
+ useContext,
+} from "react";
+import { useTranslation } from "react-i18next";
+import TextInput from "../atoms/TextInput";
+import { useForm, Controller } from "react-hook-form";
+import _ from "lodash";
+import { InboxContext } from "./InboxSearchComposerContext";
+import { Card,Loader } from "../atoms";
+import { CustomSVG } from "../atoms";
+import CheckBox from "../atoms/CheckBox";
+import NoResultsFound from "../atoms/NoResultsFound";
+import Button from "../atoms/Button";
+import CardLabel from "../atoms/CardLabel";
+import ResultsDataTable from "../molecules/ResultsDataTable";
+import { useHistory} from "react-router-dom";
+import { SVG } from "../atoms";
+import {Toast} from "../atoms";
+import FieldV1 from "./FieldV1";
+import EditablePopup from "./EditablePopup";
+
+
+const useDebounce = (value, delay) => {
+ const [debouncedValue, setDebouncedValue] = useState(value);
+ useEffect(() => {
+ const handler = setTimeout(() => {
+ setDebouncedValue(value);
+ }, delay);
+
+ return () => {
+ clearTimeout(handler);
+ };
+ }, [value, delay]);
+ return debouncedValue;
+};
+
+const ResultsDataTableWrapper = ({
+ config,
+ data,
+ isLoading,
+ isFetching,
+ fullConfig,
+ revalidate,
+ type,
+ activeLink,
+ browserSession,
+ additionalConfig,
+ TotalCount,
+ refetch
+}) => {
+ const { apiDetails } = fullConfig;
+ const { t } = useTranslation();
+ const history = useHistory();
+ const resultsKey = config.resultsJsonPath;
+ const [showResultsTable, setShowResultsTable] = useState(true);
+ const [session, setSession, clearSession] = browserSession || [];
+ let searchResult = _.get(data, resultsKey, []);
+ searchResult = searchResult?.length > 0 ? searchResult : [];
+ // searchResult = searchResult.reverse();
+ const [selectedRows, setSelectedRows] = useState([]);
+ const { state, dispatch } = useContext(InboxContext);
+ const configModule =
+ Digit?.Customizations?.[apiDetails?.masterName]?.[apiDetails?.moduleName];
+ const [currentPage, setCurrentPage] = useState(1);
+ const [rowsPerPage, setRowsPerPage] = useState(
+ config?.defaultRowsPerPage || 10
+ );
+ const [limitAndOffset, setLimitAndOffset] = useState({
+ limit: rowsPerPage,
+ offset: (currentPage - 1) * rowsPerPage,
+ });
+
+ const [showToast, setShowToast] = useState(null);
+ // Use the custom mutation hook
+ const mutation = Digit.Hooks.useCustomAPIMutationHook({
+ url:apiDetails?.mutationUrl
+ });
+ const [editRow,setEditRow] = useState(null);
+ const [editablePopup,setShowEditablePopup] = useState(null);
+ //edited data should always hold updated payload
+ const [rowData,setRowData] = useState(null);
+
+ //here I am just checking state.searchForm has all empty keys or not(when clicked on clear search)
+ useEffect(() => {
+ if (
+ apiDetails?.minParametersForSearchForm !== 0 &&
+ Object.keys(state.searchForm).length > 0 &&
+ !Object.keys(state.searchForm).some(
+ (key) => state.searchForm[key] !== ""
+ ) &&
+ type === "search" &&
+ activeLink?.minParametersForSearchForm !== 0
+ ) {
+ setShowResultsTable(false);
+ }
+ return () => {
+ setShowResultsTable(true);
+ };
+ }, [state]);
+
+ const handleActionClicked = (row, index, column, id) => {
+ //current row should now be editable, maintain a state called editMode
+ setEditRow(row);
+ setRowData({row,index,column,id});
+ }
+ const handleActionClickedPopupEdit = (row, index, column, id) => {
+ setEditRow(row);
+ setShowEditablePopup(true)
+ setRowData({row,index,column,id});
+ }
+ const handleRowSubmit = (rowFormData) => {
+ setEditRow(null);
+ setShowEditablePopup(false);
+ // make an api call here
+ // generate payload from a customizer
+ mutation.mutate(
+ configModule.getMutationPayload(rowFormData,rowData),
+ {
+ onSuccess: (data) => {
+ setShowToast({ key: "success", label: t("DATA_MODIEFIED_SUCCESS")})
+ setTimeout(() => {
+ refetch()
+ }, 1000);
+
+ },
+ onError: (error) => {
+ setShowToast({type:"error", key: "error", label: t("DATA_MODIEFIED_FAIL")})
+ }
+ }
+ );
+ setEditRow(null);
+ setRowData(null);
+
+ }
+
+
+ const handleLinkColumn = (event) => {
+ const linkColumnHandler = configModule?.linkColumnHandler || {};
+ if (typeof linkColumnHandler === "function") {
+ linkColumnHandler(event);
+ } else {
+ console.error("linkColumnHandler is not defined or is not a function");
+ }
+ };
+
+ const tableColumns = useMemo(() => {
+ //test if accessor can take jsonPath value only and then check sort and global search work properly
+ const mappedColumns = config?.columns?.map((column) => {
+ const commonProps = {
+ id: column?.id,
+ name: t(column?.label) || t("ES_COMMON_NA"),
+ format: column?.format,
+ grow: column?.grow,
+ width: column?.width,
+ minWidth: column?.minWidth,
+ maxWidth: column?.maxWidth,
+ right: column?.right,
+ center: column?.center,
+ ignoreRowClick: column?.ignoreRowClick,
+ wrap: column?.wrap,
+ sortable: !column?.disableSortBy,
+ headerAlign: column?.headerAlign,
+ style: column?.style,
+ conditionalCellStyles: column?.conditionalCellStyles,
+ sortFunction:
+ typeof column?.sortFunction === "function"
+ ? (rowA, rowB) => column.sortFunction(rowA, rowB)
+ : (rowA, rowB) => 0,
+ selector: (row, index) => `${_.get(row, column?.jsonPath)}`,
+ };
+ if (column?.svg) {
+ // const icon = Digit.ComponentRegistryService.getComponent(column.svg);
+ return {
+ ...commonProps,
+ cell: ({ row, index, column, id }) => {
+ return (
+ additionalConfig?.resultsTable?.onClickSvg(row)}
+ >
+
+
+ );
+ },
+ };
+ }
+ if (column.additionalCustomization) {
+ return {
+ ...commonProps,
+ selector: (row, index) => {
+ return configModule?.additionalCustomizations(
+ row,
+ column?.label,
+ column,
+ _.get(row, column?.jsonPath),
+ t,
+ searchResult
+ );
+ },
+ };
+ }
+ if (column?.link) {
+ return {
+ ...commonProps,
+ cell: (row, index, col, id) => {
+ console.log(
+ row,
+ column,
+ column?.jsonPath,
+ _.get(row, column?.jsonPath),
+ "testing"
+ );
+ return (
+ {
+ history.push(
+ `/${window?.contextPath}/employee/${column?.linkTo}`
+ );
+ }
+ : () => handleLinkColumn(row)
+ }
+ />
+ );
+ },
+ };
+ }
+ return {...commonProps,cell: (row, index) => {
+ // TODO: Here integrate with FieldV1 controller to support all field types
+ // if(column.editable && editRow?.id === row?.id){
+ // return handleEdits(e.target.value,column.jsonPath)}
+ // value={_.get(rowData,column.jsonPath)}
+ // />
+ // }
+ if(column.editable && editRow?.id === row?.id){
+ const config = column.editableFieldConfig;
+ return (
+ (
+
+ )}
+ name={config.populators?.name}
+ // rules={!disableFormValidation ? { required: isMandatory, ...populators?.validation, ...customRules } : {}}
+ control={control}
+ />
+ )
+ }
+
+ return `${_.get(row, column?.jsonPath)}`
+ },};
+ });
+
+ if(config?.editableRows || config?.editablePopup){
+ mappedColumns.push({
+ id: crypto.randomUUID(),
+ name: "Action",
+ // format: column?.format,
+ // grow: column?.grow,
+ // width: column?.width,
+ // minWidth: column?.minWidth,
+ // maxWidth: column?.maxWidth,
+ // right: column?.right,
+ // center: column?.center,
+ // ignoreRowClick: column?.ignoreRowClick,
+ // wrap: column?.wrap,
+ // sortable: !column?.disableSortBy,
+ // sortFunction: (rowA, rowB) => column?.sortFunction(rowA, rowB),
+ // cell: (row, index) => _.get(row, column?.jsonPath),
+ // headerAlign: column?.headerAlign,
+ // style: column?.style,
+ // conditionalCellStyles: column?.conditionalCellStyles,
+ cell: ( row, index, column, id ) => {
+ return ({editRow ? handleSaveRow(rowData) : handleActionClicked(row, index, column, id)}}
+ onClick={()=>{config?.editableRows ? editRow ? handleSubmit(handleRowSubmit)() : handleActionClicked(row, index, column, id) : config?.editablePopup ? handleActionClickedPopupEdit(row, index, column, id) : null}}
+ isDisabled={ configModule?.allowEdits(row) ? editRow && row?.id !== editRow?.id ? true : false : true}
+ />)
+ }
+ })
+ }
+
+ return mappedColumns;
+ }, [config, searchResult,editRow,rowData]);
+
+ const defaultValuesFromSession = config?.customDefaultPagination
+ ? config?.customDefaultPagination
+ : session?.tableForm
+ ? { ...session?.tableForm }
+ : { limit: 10, offset: 0 };
+
+ const {
+ register,
+ handleSubmit,
+ setValue,
+ getValues,
+ reset,
+ watch,
+ trigger,
+ control,
+ formState,
+ errors,
+ setError,
+ clearErrors,
+ unregister,
+ } = useForm({
+ defaultValues: defaultValuesFromSession,
+ });
+
+ const formData = watch();
+
+ //call this fn whenever session gets updated
+ const setDefaultValues = () => {
+ reset(defaultValuesFromSession);
+ };
+
+ //adding this effect because simply setting session to default values is not working
+ useEffect(() => {
+ setDefaultValues();
+ }, [session]);
+
+ const [searchQuery, onSearch] = useState("");
+ const debouncedValue = config?.debouncedValue || 1000;
+ const debouncedSearchQuery = useDebounce(searchQuery, debouncedValue);
+
+ const filterValue = useCallback((rows, id, filterValue = "") => {
+ return rows.filter((row) => {
+ if (!row) return false; // Ensure row exists
+
+ return Object.keys(row).some((key) => {
+ let value = row[key];
+
+ // If the value is an object (like `data`), iterate inside it
+ if (typeof value === "object" && value !== null) {
+ return Object.keys(value).some((nestedKey) => {
+ let nestedValue = value[nestedKey];
+
+ if (typeof nestedValue === "string") {
+ return nestedValue
+ .toLowerCase()
+ .includes(filterValue.toLowerCase());
+ } else if (typeof nestedValue === "number") {
+ return String(nestedValue).includes(filterValue);
+ }
+ return false;
+ });
+ }
+
+ // If the value is a string or number at the root level
+ if (typeof value === "string") {
+ return value.toLowerCase().includes(filterValue.toLowerCase());
+ } else if (typeof value === "number") {
+ return String(value).includes(filterValue);
+ }
+
+ return false;
+ });
+ });
+ }, []);
+
+ const filteredData = useMemo(() => {
+ if (!debouncedSearchQuery) return searchResult; // If no query, return all rows
+ return filterValue(searchResult, null, debouncedSearchQuery);
+ }, [debouncedSearchQuery, searchResult, filterValue]);
+
+ useEffect(() => {
+ register(
+ "offset",
+ session?.tableForm?.offset ||
+ state.tableForm.offset ||
+ config?.customDefaultPagination?.offset ||
+ 0
+ );
+ register(
+ "limit",
+ session?.tableForm?.limit ||
+ state.tableForm.limit ||
+ config?.customDefaultPagination?.limit ||
+ 10
+ );
+ });
+
+ const onSubmit = (data) => {
+ //here update the reducer state
+ //call a dispatch to update table's part of the state and update offset, limit
+ // this will in turn make the api call and give search results and table will be rendered acc to the new data
+ dispatch({
+ type: "tableForm",
+ state: { ...data },
+ });
+ };
+
+ const selectProps = {
+ hideLabel: true,
+ mainClassName: "digit-data-table-select-checkbox",
+ };
+
+ const conditionalRowStyles = [
+ {
+ when: (row) =>
+ selectedRows.some(
+ (selectedRow) => JSON.stringify(selectedRow) === JSON.stringify(row)
+ ),
+ style: {
+ backgroundColor: "#FBEEE8",
+ },
+ classNames: ["selectedRow"],
+ },
+ ];
+ const handleRowSelect = (event) => {
+ setSelectedRows(event?.selectedRows);
+ const rowClickHandler = configModule?.selectionHandler || {};
+ if (typeof rowClickHandler === "function") {
+ rowClickHandler(event);
+ } else {
+ console.error("selectionHandler is not defined or is not a function");
+ }
+ };
+
+ const handleActionSelect = (index, label, selectedRows) => {
+ const actionHandler = configModule?.actionSelectHandler || {};
+ if (typeof actionHandler === "function") {
+ actionHandler(index, label, selectedRows);
+ } else {
+ console.error("actionSelectHandler is not defined or is not a function");
+ }
+ };
+
+ const handlePageChange = (page, totalRows) => {
+ setCurrentPage(page);
+ const updatedOffset = (page - 1) * rowsPerPage;
+ setLimitAndOffset({ ...limitAndOffset, offset: updatedOffset });
+ setValue("offset", updatedOffset);
+ handleSubmit(onSubmit)();
+ };
+
+ const handlePerRowsChange = (currentRowsPerPage, currentPage) => {
+ setRowsPerPage(currentRowsPerPage);
+ setCurrentPage(1);
+ const newLimit = currentRowsPerPage;
+ const newOffset = (currentPage - 1) * currentRowsPerPage;
+ setLimitAndOffset({
+ limit: newLimit,
+ offset: newOffset,
+ });
+ setValue("limit", newLimit);
+ setValue("offset", newOffset);
+ handleSubmit(onSubmit)();
+ };
+ useEffect(() => {
+ if (limitAndOffset) {
+ setValue("limit", limitAndOffset.limit);
+ setValue("offset", limitAndOffset.offset);
+ }
+ }, [limitAndOffset]);
+
+ if (isLoading || isFetching) return
;
+ if (!data) return <>>;
+ if (!showResultsTable) return <>>;
+ if (searchResult?.length === 0) return ;
+ return (
+ <>
+
+ config?.handleRowExpand?.(expanded, row)
+ }
+ progressPending={config?.progressPending}
+ conditionalRowStyles={conditionalRowStyles}
+ tableClassName={config?.tableProps?.tableClassName ? config?.tableProps?.tableClassName : ""}
+ defaultSortAsc={config?.defaultSortAsc}
+ pagination={config.isPaginationRequired}
+ paginationTotalRows={
+ TotalCount ||
+ data?.count ||
+ data?.TotalCount ||
+ data?.totalCount ||
+ searchResult?.length
+ }
+ onChangeRowsPerPage={handlePerRowsChange}
+ paginationDefaultPage={currentPage}
+ paginationPerPage={rowsPerPage}
+ onChangePage={handlePageChange}
+ paginationRowsPerPageOptions={config?.paginationRowsPerPageOptions}
+ showTableDescription={config?.tableProps?.showTableDescription}
+ showTableTitle={config?.tableProps?.showTableTitle}
+ enableGlobalSearch={config?.enableGlobalSearch}
+ selectedRows={selectedRows}
+ actions={config?.actionProps?.actions}
+ searchHeader={config.searchHeader}
+ configModule={configModule}
+ onSearch={onSearch}
+ handleActionSelect={handleActionSelect}
+ rowsPerPageText={config?.paginationComponentOptions?.rowsPerPage}
+ paginationComponentOptions={config?.paginationComponentOptions}
+ >
+
+ {showToast && setShowToast(null)} />}
+ {editablePopup && }
+ >
+ );
+};
+
+export default ResultsDataTableWrapper;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/hoc/ResultsTable.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/hoc/ResultsTable.js
new file mode 100644
index 00000000..07817cf1
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/hoc/ResultsTable.js
@@ -0,0 +1,241 @@
+import React, { useMemo, useCallback, useState, useEffect, Fragment,useContext } from 'react'
+import { useTranslation } from 'react-i18next';
+import Table from '../atoms/Table'
+import TextInput from '../atoms/TextInput'
+import { useForm, Controller } from "react-hook-form";
+import _ from "lodash";
+import { InboxContext } from './InboxSearchComposerContext';
+import { Loader } from '../atoms';
+import NoResultsFound from '../atoms/NoResultsFound';
+import { CustomSVG } from '../atoms';
+
+
+const ResultsTable = ({ tableContainerClass, config,data,isLoading,isFetching,fullConfig,revalidate,type,activeLink,browserSession,additionalConfig }) => {
+ const {apiDetails} = fullConfig
+ const { t } = useTranslation();
+ const resultsKey = config.resultsJsonPath
+ const [showResultsTable,setShowResultsTable] = useState(true)
+ const [session,setSession,clearSession] = browserSession || []
+ // let searchResult = data?.[resultsKey]?.length>0 ? data?.[resultsKey] : []
+ let searchResult = _.get(data,resultsKey,[])
+ searchResult = searchResult?.length>0 ? searchResult : []
+ searchResult = searchResult.reverse();
+ const tenantId = Digit.ULBService.getCurrentTenantId();
+ const headerLocale = Digit.Utils.locale.getTransformedLocale(tenantId);
+
+ //reversing reason -> for some reason if we enable sorting on columns results from the api are reversed and shown, for now -> reversing the results(max size 50 so not a performance issue)
+
+ // if (fullConfig?.postProcessResult){
+ // var { isPostProcessFetching,
+ // isPostProcessLoading,
+ // combinedResponse } = Digit?.Customizations?.[apiDetails?.masterName]?.[apiDetails?.moduleName]?.postProcess(searchResult)
+
+ // if(combinedResponse?.length > 0){
+ // searchResult = combinedResponse
+ // }
+ // }
+
+
+
+
+
+ const {state,dispatch} = useContext(InboxContext)
+ //here I am just checking state.searchForm has all empty keys or not(when clicked on clear search)
+ useEffect(() => {
+ if(apiDetails?.minParametersForSearchForm !== 0 && Object.keys(state.searchForm).length > 0 && !Object.keys(state.searchForm).some(key => state.searchForm[key]!=="") && type==="search" && activeLink?.minParametersForSearchForm !== 0){
+ setShowResultsTable(false)
+ }
+ // else{
+ // setShowResultsTable(true)
+ // }
+ return ()=>{
+ setShowResultsTable(true)
+ }
+ }, [state])
+
+
+
+ const tableColumns = useMemo(() => {
+ //test if accessor can take jsonPath value only and then check sort and global search work properly
+ return config?.columns?.map(column => {
+ if(column?.svg) {
+ // const icon = Digit.ComponentRegistryService.getComponent(column.svg);
+ return {
+ Header: t(column?.label) || t("ES_COMMON_NA"),
+ accessor:column.jsonPath,
+ Cell: ({ value, col, row }) => {
+ return additionalConfig?.resultsTable?.onClickSvg(row)}>
+ }
+ }
+ }
+ if (column.additionalCustomization){
+ return {
+ Header: t(column?.label) || t("ES_COMMON_NA"),
+ accessor:column.jsonPath,
+ headerAlign: column?.headerAlign,
+ disableSortBy:column?.disableSortBy ? column?.disableSortBy :false,
+ Cell: ({ value, col, row }) => {
+ return Digit?.Customizations?.[apiDetails?.masterName]?.[apiDetails?.moduleName]?.additionalCustomizations(row.original,column?.label,column, value,t, searchResult);
+ }
+ }
+ }
+ return {
+ Header: t(column?.label) || t("ES_COMMON_NA"),
+ accessor: column.jsonPath,
+ headerAlign: column?.headerAlign,
+ disableSortBy:column?.disableSortBy ? column?.disableSortBy :false,
+ Cell: ({ value, col, row }) => {
+ return String(value ? column.translate? t(Digit.Utils.locale.getTransformedLocale(column.prefix?`${column.prefix}${value}`:value)) : value : t("ES_COMMON_NA"));
+ }
+ }
+ })
+ }, [config, searchResult])
+
+ const defaultValuesFromSession = config?.customDefaultPagination ? config?.customDefaultPagination : (session?.tableForm ? {...session?.tableForm} : {limit:10,offset:0})
+
+ const {
+ register,
+ handleSubmit,
+ setValue,
+ getValues,
+ reset,
+ watch,
+ trigger,
+ control,
+ formState,
+ errors,
+ setError,
+ clearErrors,
+ unregister,
+ } = useForm({
+ defaultValues: defaultValuesFromSession
+ });
+
+ //call this fn whenever session gets updated
+ const setDefaultValues = () => {
+ reset(defaultValuesFromSession)
+ }
+
+ //adding this effect because simply setting session to default values is not working
+ useEffect(() => {
+ setDefaultValues()
+ }, [session])
+
+ const isMobile = window.Digit.Utils.browser.isMobile();
+ const [searchQuery, onSearch] = useState("");
+
+ const filterValue = useCallback((rows, id, filterValue = "") => {
+
+ return rows.filter((row) => {
+ const res = Object.keys(row?.values).find((key) => {
+ if (typeof row?.values?.[key] === "object") {
+ return Object.keys(row?.values?.[key]).find((id) => {
+ if (id === "insight") {
+ return String(Math.abs(row?.values?.[key]?.[id]) + "%")
+ .toLowerCase()
+ .startsWith(filterValue?.toLowerCase());
+ }
+ return String(row?.values?.[key]?.[id])?.toLowerCase().includes(filterValue?.toLowerCase());
+ });
+ }
+ return (
+ String(row?.values?.[key]).toLowerCase()?.includes(filterValue?.toLowerCase()) ||
+ String(t(row?.values?.[key])).toLowerCase()?.includes(filterValue?.toLowerCase())
+ );
+ });
+ return res;
+ });
+ }, []);
+
+ useEffect(() => {
+ register("offset",session?.tableForm?.offset ||state.tableForm.offset|| config?.customDefaultPagination?.offset|| 0);
+ register("limit",session?.tableForm?.limit ||state.tableForm.limit|| config?.customDefaultPagination?.limit || 10);
+ });
+
+ // useEffect(() => {
+ // setValue("offset",state.tableForm.offset)
+ // setValue("limit",state.tableForm.limit)
+ // })
+
+ function onPageSizeChange(e) {
+ setValue("limit", Number(e.target.value));
+ handleSubmit(onSubmit)();
+ }
+
+ function nextPage() {
+ setValue("offset", getValues("offset") + getValues("limit"));
+ handleSubmit(onSubmit)();
+ }
+ function previousPage() {
+ const offsetValue = getValues("offset") - getValues("limit")
+ setValue("offset", offsetValue>0 ? offsetValue : 0);
+ handleSubmit(onSubmit)();
+ }
+
+ const onSubmit = (data) => {
+ //here update the reducer state
+ //call a dispatch to update table's part of the state and update offset, limit
+ // this will in turn make the api call and give search results and table will be rendered acc to the new data
+
+ dispatch({
+ type:"tableForm",
+ state:{...data}
+ })
+
+ }
+
+
+ if (isLoading || isFetching ) return
+ if(!data) return <>>
+ if(!showResultsTable) return <>>
+ if (searchResult?.length === 0) return
+ return (
+
+ {config?.enableGlobalSearch &&
+ onSearch(e.target.value)} style={{ border: "none", borderRadius: "200px" }} />
+
}
+ {
+ config?.showTableInstruction && (
+
+
{t(config?.showTableInstruction)}
+
)
+ }
+ {searchResult?.length > 0 &&
{
+ return {
+ style: {
+ padding: "20px 18px",
+ fontSize: "16px",
+ whiteSpace: "normal",
+ },
+ };
+ }}
+ onClickRow={additionalConfig?.resultsTable?.onClickRow}
+ manualPagination={config.manualPagination}
+ noColumnBorder={config?.noColumnBorder}
+ />}
+
+ )
+}
+
+export default ResultsTable
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/hoc/UploadFileComposer.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/hoc/UploadFileComposer.js
new file mode 100644
index 00000000..cac3345c
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/hoc/UploadFileComposer.js
@@ -0,0 +1,121 @@
+import React from "react";
+import PropTypes from "prop-types";
+import { useTranslation } from "react-i18next";
+import LabelFieldPair from "../atoms/LabelFieldPair";
+import CardLabel from "../atoms/CardLabel";
+import CardLabelError from "../atoms/CardLabelError";
+import CitizenInfoLabel from "../atoms/CitizenInfoLabel";
+import HeaderComponent from "../atoms/HeaderComponent";
+import MultiUploadWrapper from "../molecules/MultiUploadWrapper";
+import TextInput from "../atoms/TextInput";
+import { getRegex } from "../utils/uploadFileComposerUtils";
+import useCustomMDMS from "./techHoc/useCustomMDMS";
+
+const UploadFileComposer = ({ module, config, Controller, control, register, formData, errors, localePrefix, customClass, customErrorMsg,mdmsModuleName='works' }) => {
+ const { t } = useTranslation();
+
+ //fetch mdms config based on module name
+ const tenant = Digit?.ULBService?.getStateId();
+ const { isLoading, data } = useCustomMDMS(tenant, mdmsModuleName, [
+ {
+ name: "DocumentConfig",
+ filter: `[?(@.module=='${module}')]`,
+ },
+ ]);
+
+ const docConfig = data?.works?.DocumentConfig?.[0];
+
+ return (
+
+ {t("WORKS_RELEVANT_DOCUMENTS")}
+
+ {docConfig?.documents?.map((item, index) => {
+ if (!item?.active) return;
+ return (
+
+ {item.code && (
+
+ {t(`${localePrefix}_${item?.code}`)} {item?.isMandatory ? " * " : null}
+
+ )}
+
+
+ {item?.showTextInput ? (
+
+ ) : null}
+
+ {
+ function getFileStoreData(filesData) {
+ const numberOfFiles = filesData.length;
+ let finalDocumentData = [];
+ if (numberOfFiles > 0) {
+ filesData.forEach((value) => {
+ finalDocumentData.push({
+ fileName: value?.[0],
+ fileStoreId: value?.[1]?.fileStoreId?.fileStoreId,
+ documentType: value?.[1]?.file?.type,
+ });
+ });
+ }
+ onChange(numberOfFiles > 0 ? filesData : []);
+ }
+ return (
+
+ );
+ }}
+ rules={{
+ validate: (value) => {
+ return !(item?.isMandatory && value?.length === 0);
+ },
+ }}
+ defaultValue={formData?.[item?.name]}
+ name={`${config?.name}.${item?.name}`}
+ control={control}
+ />
+ {errors && errors[`${config?.name}`]?.[`${item?.name}`] && Object.keys(errors[`${config?.name}`]?.[`${item?.name}`]).length ? (
+ {t(config?.error)}
+ ) : null}
+
+
+
+ );
+ })}
+
+ );
+};
+
+UploadFileComposer.propTypes = {
+ module: PropTypes.string.isRequired,
+ config: PropTypes.object.isRequired,
+ Controller: PropTypes.func.isRequired,
+ control: PropTypes.object.isRequired,
+ register: PropTypes.func.isRequired,
+ formData: PropTypes.object.isRequired,
+ errors: PropTypes.object.isRequired,
+ localePrefix: PropTypes.string.isRequired,
+ customClass: PropTypes.string,
+ customErrorMsg: PropTypes.string,
+ data: PropTypes.object.isRequired,
+ tenant: PropTypes.object.isRequired,
+};
+
+export default UploadFileComposer;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/hoc/index.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/hoc/index.js
new file mode 100644
index 00000000..15875049
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/hoc/index.js
@@ -0,0 +1,15 @@
+import FieldComposer from "./FieldComposer";
+import FieldController from "./FieldController";
+import Fields from "./Fields";
+import { FormComposer as FormComposerV2 } from "./FormComposerV2";
+import Modal from "./Modal";
+import UploadFileComposer from "./UploadFileComposer";
+import FieldV1 from "./FieldV1";
+import ResultsTable from "./ResultsTable";
+import ResultsDataTableWrapper from "./ResultsDataTableWrapper";
+import reducer from "./InboxSearchComposerReducer";
+import { initialInboxState } from "./InboxSearchComposerReducer";
+import { InboxContext } from "./InboxSearchComposerContext";
+import InboxSearchComposer from "./InboxSearchComposer";
+
+export { FieldComposer, FieldController, Fields, FormComposerV2, Modal, UploadFileComposer ,FieldV1, InboxSearchComposer,ResultsTable,reducer,initialInboxState,InboxContext,ResultsDataTableWrapper};
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/hoc/techHoc/useCustomMDMS.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/hoc/techHoc/useCustomMDMS.js
new file mode 100644
index 00000000..3161f948
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/hoc/techHoc/useCustomMDMS.js
@@ -0,0 +1,76 @@
+import { useQuery } from "react-query";
+// import { MdmsService } from "../services/elements/MDMS";
+/**
+ * Custom hook which can be used to
+ * make a single hook a module to get multiple masterdetails with/without filter
+ *
+ * @author jagankumar-egov
+ *
+ * @example
+ * // returns useQuery object
+ * Digit.Hooks.useCustomMDMS(
+ * "stateid",
+ * "modulename",
+ * [
+ * { name:"masterdetail1",filter:"[?(@.active == true)]"},
+ * { name:"masterdetail2" }
+ * ],
+ * { // all configs supported by the usequery
+ * default:(data)=>{
+ * format
+ * return formattedData;
+ * }
+ * })
+ *
+ * @returns {Object} Returns the object of the useQuery from react-query.
+ */
+// const useCustomMDMS = (tenantId, moduleName, masterDetails = [], config = {}) => {
+// return useQuery([tenantId, moduleName, masterDetails], () => window?.Digit?.MdmsService.getMultipleTypesWithFilter(tenantId, moduleName, masterDetails), config);
+// };
+
+// export default useCustomMDMS;
+
+const useCustomMDMS = (tenantId, moduleName, masterDetails = [], config = {}, mdmsv2 ) => {
+ if (mdmsv2) {
+ //here call the mdmsv2 api and return the options array
+ return useCustomAPIHook({
+ url: Urls.mdms_v2.search,
+ params: {},
+ changeQueryName: `mdms-v2-dropdowns${mdmsv2?.schemaCode}`,
+ body: {
+ MdmsCriteria: {
+ // tenantId, //changing here to send user's tenantId always whether stateId or city
+ tenantId: Digit.ULBService.getCurrentTenantId(),
+ schemaCode: mdmsv2?.schemaCode,
+ isActive: true,
+ limit: 1000,
+ },
+ },
+ config: {
+ enabled: mdmsv2 ? true : false,
+ select: (response) => {
+ //mdms will be an array of master data
+ const { mdms } = response;
+ //first filter with isActive
+ //then make a data array with actual data
+ //refer the "code" key in data(for now) and set options array , also set i18nKey in each object to show in UI
+ const options = mdms
+ ?.filter((row) => row?.isActive)
+ ?.map((row) => {
+ return {
+ i18nKey: Digit.Utils.locale.getTransformedLocale(`${row?.schemaCode}_${row?.data?.code}`),
+ ...row.data,
+ };
+ });
+ return options;
+ },
+ },
+ });
+ }
+ return useQuery([tenantId, moduleName, masterDetails], () => MdmsService.getMultipleTypesWithFilter(tenantId, moduleName, masterDetails), {
+ cacheTime: 0,
+ ...config,
+ });
+};
+
+export default useCustomMDMS;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/index.css b/micro-ui/web/micro-ui-internals/packages/ui-components/src/index.css
new file mode 100644
index 00000000..dcfd4102
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/index.css
@@ -0,0 +1,8 @@
+.custom-class path{
+ fill:orange;
+ }
+.custom-class{
+ border: 2px dotted blue;
+ width: 100px;
+ height: 100px;
+}
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/index.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/index.js
new file mode 100644
index 00000000..c22cc2a5
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/index.js
@@ -0,0 +1,282 @@
+import {
+ Accordion,
+ AccordionList,
+ Footer,
+ ActionLinks,
+ Amount,
+ AppContainer,
+ BackLink,
+ SideNav,
+ Hamburger,
+ Switch,
+ Tooltip,
+ Banner,
+ BodyContainer,
+ BreadCrumb,
+ BreakLine,
+ Button,
+ Card,
+ CardBasedOptions,
+ CardCaption,
+ CardHeader,
+ CardLabel,
+ CardLabelError,
+ CardText,
+ CheckBox,
+ CitizenHomeCard,
+ CitizenInfoLabel,
+ CollapseAndExpandGroups,
+ ConnectingCheckPoints,
+ DatePicker,
+ DisplayPhotos,
+ Dropdown,
+ ErrorMessage,
+ HomeFooter,
+ HeaderComponent,
+ HeaderBar,
+ HorizontalNav,
+ Tab,
+ AlertCard,
+ PageBasedInput,
+ InputTextAmount,
+ KeyNote,
+ LabelFieldPair,
+ MobileNumber,
+ MultiSelectDropdown,
+ NoResultsFound,
+ OTPInput,
+ SidePanel,
+ Paragraph,
+ PlusMinusInput,
+ PopUp,
+ PrivateRoute,
+ RadioButtons,
+ Rating,
+ Chip,
+ SVG,
+ // Table,
+ Telephone,
+ TextArea,
+ TextInput,
+ Toast,
+ UploadFile,
+ WhatsNewCard,
+ Toggle,
+ ToggleSwitch,
+ TreeSelect,
+ SubmitBar,
+ ButtonSelector,
+ InboxSearchLinks,
+ SearchComponent,
+ LinkLabel,
+ RoundedLabel,
+ Stepper,
+ Timeline,
+ StringManipulator,
+ InfoButton,
+ FileUpload,
+ UploadWidget,
+ UploadImage,
+ ErrorBoundary,
+ TextBlock,
+ Panels,
+ Animation,
+ SummaryCardFieldPair,
+ Divider,
+ ButtonGroup,
+ Header,
+ HamburgerButton,
+ Menu,
+ SelectionTag,
+ Tag,
+ CustomSVG,
+ TableMain,
+ TableHeader,
+ TableFooter,
+ TableBody,
+ TableRow,
+ TableCell,
+ NestedTable,
+ Loader,
+ Iframe
+} from "./atoms";
+
+import { FieldComposer, FieldController, Fields, FormComposerV2, Modal, UploadFileComposer, FieldV1, InboxSearchComposer, ResultsTable, ResultsDataTableWrapper } from "./hoc";
+
+import {
+ ApiDropdown,
+ CustomDropdown,
+ BottomSheet,
+ DetailsCard,
+ FormStep,
+ InputCard,
+ LocationDropdownWrapper,
+ MultiUploadWrapper,
+ SearchAction,
+ SortAction,
+ SearchForm,
+ SearchField,
+ SearchOnRadioButtons,
+ TextInputCard,
+ PanelCard,
+ TooltipWrapper,
+ TimelineMolecule,
+ LandingPageCard,
+ MenuCard,
+ LandingPageWrapper,
+ MenuCardWrapper,
+ TableMolecule,
+ MetricCard,
+ FormCard,
+ FilterCard,
+ SummaryCard,
+ ResultsDataTable
+} from "./molecules";
+
+// import { initCoreLibraries } from "@egovernments/digit-ui-libraries-core";
+import { initLibraries } from "@egovernments/digit-ui-libraries";
+
+// initLibraries().then(() => {
+// console.info("DIGIT Contants enabled");
+// });
+
+export {
+ Footer,
+ ActionLinks,
+ Amount,
+ AppContainer,
+ BackLink,
+ SideNav,
+ Hamburger,
+ Accordion,
+ Iframe,
+ AccordionList,
+ Switch,
+ Tooltip,
+ Banner,
+ BodyContainer,
+ BreadCrumb,
+ BreakLine,
+ Button,
+ SelectionTag,
+ Tag,
+ Card,
+ CardBasedOptions,
+ CardCaption,
+ CardHeader,
+ CardLabel,
+ CardLabelError,
+ CardText,
+ CheckBox,
+ PageBasedInput,
+ CitizenHomeCard,
+ CitizenInfoLabel,
+ CollapseAndExpandGroups,
+ ConnectingCheckPoints,
+ DatePicker,
+ DisplayPhotos,
+ Dropdown,
+ ErrorMessage,
+ HomeFooter,
+ HeaderComponent,
+ HeaderBar,
+ HorizontalNav,
+ Loader,
+ Tab,
+ AlertCard,
+ InputTextAmount,
+ SearchField,
+ KeyNote,
+ LabelFieldPair,
+ MobileNumber,
+ MultiSelectDropdown,
+ NoResultsFound,
+ OTPInput,
+ SidePanel,
+ Paragraph,
+ PlusMinusInput,
+ PopUp,
+ PrivateRoute,
+ RadioButtons,
+ Rating,
+ Chip,
+ SVG,
+ // Table,
+ Telephone,
+ TextArea,
+ TextInput,
+ Toast,
+ UploadFile,
+ WhatsNewCard,
+ FieldComposer,
+ FieldV1,
+ FieldController,
+ Fields,
+ FormComposerV2,
+ Modal,
+ UploadFileComposer,
+ ApiDropdown,
+ CustomDropdown,
+ BottomSheet,
+ DetailsCard,
+ FormStep,
+ InputCard,
+ LocationDropdownWrapper,
+ MultiUploadWrapper,
+ SearchAction,
+ SortAction,
+ ResultsDataTable,
+ SearchForm,
+ LandingPageCard,
+ MetricCard,
+ FormCard,
+ FilterCard,
+ SummaryCard,
+ TableMolecule,
+ MenuCard,
+ MenuCardWrapper,
+ LandingPageWrapper,
+ SearchOnRadioButtons,
+ TextInputCard,
+ PanelCard,
+ TimelineMolecule,
+ TooltipWrapper,
+ Toggle,
+ ToggleSwitch,
+ TreeSelect,
+ SubmitBar,
+ ButtonSelector,
+ Header,
+ HamburgerButton,
+ Menu,
+ Stepper,
+ Timeline,
+ StringManipulator,
+ InfoButton,
+ FileUpload,
+ UploadWidget,
+ UploadImage,
+ TextBlock,
+ Panels,
+ SummaryCardFieldPair,
+ ButtonGroup,
+ Divider,
+ Animation,
+ InboxSearchLinks,
+ SearchComponent,
+ InboxSearchComposer,
+ ResultsTable,
+ ResultsDataTableWrapper,
+ LinkLabel,
+ RoundedLabel,
+ //Icons
+ CustomSVG,
+ ErrorBoundary,
+ TableMain,
+ TableHeader,
+ TableFooter,
+ TableBody,
+ TableRow,
+ TableCell,
+ NestedTable
+};
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/ApiDropdown.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/ApiDropdown.js
new file mode 100644
index 00000000..3ca3cdf6
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/ApiDropdown.js
@@ -0,0 +1,110 @@
+import React, { Fragment, useState, useEffect } from "react";
+import PropTypes from "prop-types";
+import MultiSelectDropdown from "../atoms/MultiSelectDropdown";
+import Dropdown from "../atoms/Dropdown";
+import { Loader } from "../atoms";
+import { useTranslation } from "react-i18next";
+import _ from "lodash";
+
+const ApiDropdown = ({ populators, formData, props, inputRef, errors ,disabled}) => {
+ const [options, setOptions] = useState([]);
+
+ const { t } = useTranslation();
+
+ const reqCriteria = Digit?.Customizations?.[populators?.masterName]?.[populators?.moduleName]?.[populators?.customfn]();
+
+ const { isLoading: isApiLoading, data: apiData, revalidate, isFetching: isApiFetching } = window?.Digit?.Hooks.useCustomAPIHook(reqCriteria);
+
+ useEffect(() => {
+ setOptions(apiData);
+ }, [apiData]);
+
+ if (isApiLoading) return ;
+
+ return (
+ <>
+ {populators.allowMultiSelect && (
+
+ {
+ props.onChange(
+ e
+ ?.map((row) => {
+ return row?.[1] ? row[1] : null;
+ })
+ .filter((e) => e)
+ );
+ }}
+ selected={props?.value}
+ defaultLabel={t(populators?.defaultText)}
+ defaultUnit={t(populators?.selectedText)}
+ config={populators}
+ chipsKey={populators?.chipsKey}
+ disabled={disabled}
+ variant={populators?.variant}
+ addSelectAllCheck={populators?.addSelectAllCheck}
+ addCategorySelectAllCheck={populators?.addCategorySelectAllCheck}
+ selectAllLabel={populators?.selectAllLabel}
+ categorySelectAllLabel={populators?.categorySelectAllLabel}
+ restrictSelection={populators?.restrictSelection}
+ isSearchable={populators?.isSearchable}
+ />
+
+ )}
+ {!populators.allowMultiSelect && (
+ {
+ props.onChange([e], populators.name);
+ }}
+ selected={props.value?.[0] || populators.defaultValue}
+ defaultValue={props.value?.[0] || populators.defaultValue}
+ t={t}
+ errorStyle={errors?.[populators.name]}
+ optionCardStyles={populators?.optionsCustomStyle}
+ style={{...populators.styles }}
+ disabled={disabled}
+ showIcon={populators?.showIcon}
+ variant={populators?.variant}
+ isSearchable={populators?.isSearchable}
+ />
+ )}
+ >
+ );
+};
+
+ApiDropdown.propTypes = {
+ populators: PropTypes.shape({
+ allowMultiSelect: PropTypes.bool.isRequired,
+ masterName: PropTypes.string,
+ moduleName: PropTypes.string,
+ customfn: PropTypes.string,
+ optionsKey: PropTypes.string,
+ defaultText: PropTypes.string,
+ selectedText: PropTypes.string,
+ name: PropTypes.string,
+ defaultValue: PropTypes.string,
+ optionsCustomStyle: PropTypes.object,
+ }).isRequired,
+ formData: PropTypes.object,
+ props: PropTypes.shape({
+ isApiLoading: PropTypes.bool,
+ options: PropTypes.array,
+ className: PropTypes.string,
+ style: PropTypes.object,
+ value: PropTypes.oneOfType([PropTypes.string, PropTypes.array]),
+ onChange: PropTypes.func,
+ }).isRequired,
+ inputRef: PropTypes.object,
+ errors: PropTypes.object,
+};
+
+export default ApiDropdown;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/BottomSheet.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/BottomSheet.js
new file mode 100644
index 00000000..79e340df
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/BottomSheet.js
@@ -0,0 +1,133 @@
+import React, { useState, useRef, useEffect } from "react";
+
+const BottomSheet = ({
+ children,
+ initialState = "closed",
+ enableActions,
+ actions,
+ equalWidthButtons,
+ className,
+ style,
+}) => {
+ const [isDragging, setIsDragging] = useState(false);
+ const [currentSheetState, setCurrentSheetState] = useState(initialState);
+ const [height, setHeight] = useState(
+ enableActions && actions ? "fit-content" : "40px"
+ );
+ const sheetRef = useRef(null);
+
+ const handleDragStart = (e) => {
+ e.preventDefault();
+ setIsDragging(true);
+ };
+
+ const handleDragEnd = () => {
+ setIsDragging(false);
+ };
+
+ const handleDrag = (e) => {
+ if (isDragging) {
+ const defaultMInHeight = enableActions && actions ? 96 : 40;
+ const newHeight = Math.min(
+ Math.max(window.innerHeight - e.clientY, defaultMInHeight),
+ window.innerHeight
+ );
+ setHeight(newHeight + "px");
+ if (newHeight === window.innerHeight) {
+ setCurrentSheetState("full");
+ setHeight(window.innerHeight);
+ } else if (newHeight >= window.innerHeight * 0.75) {
+ setCurrentSheetState("intermediate");
+ setHeight(window.innerHeight * 0.75);
+ } else if (newHeight >= window.innerHeight * 0.5) {
+ setCurrentSheetState("quarter");
+ setHeight(window.innerHeight * 0.5);
+ } else if (newHeight >= window.innerHeight * 0.3) {
+ setCurrentSheetState("fixed");
+ setHeight(window.innerHeight * 0.3)
+ } else if (
+ (newHeight > 40 && !enableActions) ||
+ (newHeight > 96 && enableActions)
+ ) {
+ setCurrentSheetState("fixed");
+ setHeight(window.innerHeight * 0.3)
+ } else {
+ setCurrentSheetState("closed");
+ }
+ }
+ };
+
+ useEffect(() => {
+ window.addEventListener("mousemove", handleDrag);
+ window.addEventListener("mouseup", handleDragEnd);
+ return () => {
+ window.removeEventListener("mousemove", handleDrag);
+ window.removeEventListener("mouseup", handleDragEnd);
+ };
+ }, [isDragging]);
+
+ const setHeightState = (state) => {
+ switch (state) {
+ case "fixed":
+ setHeight(`${window.innerHeight * 0.3}px`);
+ break;
+ case "quarter":
+ setHeight(`${window.innerHeight * 0.5}px`);
+ break;
+ case "intermediate":
+ setHeight(`${window.innerHeight * 0.75}px`);
+ break;
+ case "full":
+ setHeight(`${window.innerHeight}px`);
+ break;
+ default:
+ setHeight(enableActions && actions ? "fit-content" : "40px");
+ }
+ };
+
+ useEffect(() => {
+ setHeightState(initialState);
+ }, [initialState]);
+
+ return (
+
+
+ {currentSheetState !== "closed" && (
+
+ {children}
+
+ )}
+ {enableActions && actions && (
+
+ {actions}
+
+ )}
+
+ );
+};
+
+export default BottomSheet;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/CustomDropdown.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/CustomDropdown.js
new file mode 100644
index 00000000..3aa0d1e1
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/CustomDropdown.js
@@ -0,0 +1,142 @@
+import _ from "lodash";
+import React from "react";
+import PropTypes from "prop-types";
+import { Loader } from "../atoms";
+import RadioButtons from "../atoms/RadioButtons";
+import Dropdown from "../atoms/Dropdown";
+import Toggle from "../atoms/Toggle";
+import { createFunction } from "./techMolecules/createFunction";
+
+const CustomDropdown = ({ t, config, inputRef, label, onChange,id, value, errorStyle, disabled, type, additionalWrapperClass = "",variant,mdmsv2}) => {
+ const master = { name: config?.mdmsConfig?.masterName };
+ if (config?.mdmsConfig?.filter) {
+ master["filter"] = config?.mdmsConfig?.filter;
+ }
+debugger;
+ const { isLoading, data } = window?.Digit?.Hooks.useCustomMDMS(Digit?.ULBService?.getStateId(), config?.mdmsConfig?.moduleName, [master], {
+ select: config?.mdmsConfig?.select
+ ? createFunction(config?.mdmsConfig?.select)
+ : (data) => {
+ const optionsData = _.get(data, `${config?.mdmsConfig?.moduleName}.${config?.mdmsConfig?.masterName}`, []);
+ return optionsData
+ .filter((opt) => (opt?.hasOwnProperty("active") ? opt.active : true))
+ .map((opt) => ({ ...opt, name: `${config?.mdmsConfig?.localePrefix}_${Digit.Utils.locale.getTransformedLocale(opt.code)}` }));
+ },
+ enabled: (config?.mdmsConfig || config?.mdmsv2) ? true : false,
+ },mdmsv2);
+
+ if (isLoading) {
+ return ;
+ }
+
+ const renderField = () => {
+ switch (type) {
+ case "radio":
+ return (
+ {
+ onChange(e, config.name);
+ }}
+ id={id}
+ disabled={disabled}
+ selectedOption={value}
+ defaultValue={value}
+ t={t}
+ errorStyle={errorStyle}
+ additionalWrapperClass={additionalWrapperClass}
+ innerStyles={config?.innerStyles}
+ alignVertical={config?.alignVertical}
+ isLabelFirst={config?.isLabelFirst}
+ />
+ );
+ case "dropdown":
+ case "radioordropdown":
+ case "select":
+ return (
+ {
+ onChange(e, config.name);
+ }}
+ disabled={disabled}
+ selected={value || config.defaultValue}
+ defaultValue={value || config.defaultValue}
+ t={t}
+ errorStyle={errorStyle}
+ optionCardStyles={config?.optionsCustomStyle}
+ showIcon={config?.showIcon}
+ variant={variant}
+ isSearchable={config?.isSearchable}
+ />
+ );
+ case "toggle":
+ return (
+ {
+ onChange(e, config.name);
+ }}
+ disabled={disabled}
+ selectedOption={value}
+ defaultValue={value}
+ t={t}
+ errorStyle={errorStyle}
+ additionalWrapperClass={additionalWrapperClass}
+ innerStyles={config?.innerStyles}
+ />
+ );
+ default:
+ return null;
+ }
+ };
+ return {renderField()} ;
+};
+
+CustomDropdown.propTypes = {
+ t: PropTypes.func.isRequired,
+ config: PropTypes.shape({
+ mdmsConfig: PropTypes.shape({
+ masterName: PropTypes.string,
+ moduleName: PropTypes.string,
+ filter: PropTypes.object,
+ select: PropTypes.string,
+ localePrefix: PropTypes.string,
+ }),
+ name: PropTypes.string,
+ optionsKey: PropTypes.string,
+ styles: PropTypes.object,
+ innerStyles: PropTypes.object,
+ options: PropTypes.array,
+ defaultValue: PropTypes.string,
+ optionsCustomStyle: PropTypes.object,
+ required: PropTypes.bool,
+ }),
+ inputRef: PropTypes.object,
+ label: PropTypes.string,
+ onChange: PropTypes.func,
+ value: PropTypes.oneOfType([PropTypes.string, PropTypes.array]),
+ errorStyle: PropTypes.object,
+ disabled: PropTypes.bool,
+ type: PropTypes.string,
+ additionalWrapperClass: PropTypes.string,
+};
+
+export default CustomDropdown;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/DateRangeNew.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/DateRangeNew.js
new file mode 100644
index 00000000..a737b614
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/DateRangeNew.js
@@ -0,0 +1,164 @@
+import React, { Fragment, useEffect, useMemo, useRef, useState } from "react";
+import { CustomSVG } from "../atoms/CustomSVG";
+import { DateRange, createStaticRanges } from "react-date-range";
+import { format, addMonths, addHours, startOfToday, endOfToday, endOfYesterday, addMinutes, addSeconds, isEqual, subYears, startOfYesterday, startOfWeek, endOfWeek, startOfYear, endOfYear, startOfMonth, endOfMonth, startOfQuarter, endOfQuarter } from "date-fns";
+
+function isEndDateFocused(focusNumber) {
+ return focusNumber === 1;
+}
+
+function isStartDateFocused(focusNumber) {
+ return focusNumber === 0;
+}
+
+const DateRangeNew = ({ values, onFilterChange, t, labelClass, label, customStyles, inputRef}) => {
+ const [isModalOpen, setIsModalOpen] = useState(false);
+ const [focusedRange, setFocusedRange] = useState([0, 0]);
+ const [selectionRange, setSelectionRange] = useState({
+ ...values,
+ startDate: values?.startDate,
+ endDate: values?.endDate
+ });
+ const wrapperRef = useRef(inputRef);
+
+ useEffect(() => {
+ const handleClickOutside = (event) => {
+ if (wrapperRef.current && !wrapperRef.current.contains(event.target)) {
+ setIsModalOpen(false);
+ }
+ };
+ document.addEventListener("mousedown", handleClickOutside);
+ return () => {
+ document.removeEventListener("mousedown", handleClickOutside);
+ };
+ }, [wrapperRef]);
+
+ useEffect(() => {
+ if (!isModalOpen && selectionRange?.startDate instanceof Date && selectionRange?.endDate instanceof Date) {
+ const startDate = selectionRange?.startDate;
+ const endDate = selectionRange?.endDate;
+ const duration = getDuration(selectionRange?.startDate, selectionRange?.endDate);
+ const title = `${format(selectionRange?.startDate, "MMM d, yy")} - ${format(selectionRange?.endDate, "MMM d, yy")}`;
+ onFilterChange({ range: { startDate, endDate, duration, title }, requestDate: { startDate, endDate, duration, title } });
+ }
+ }, [selectionRange, isModalOpen]);
+
+ const staticRanges = useMemo(() => {
+ return createStaticRanges([
+ {
+ label: t("DSS_TODAY"),
+ range: () => ({
+ startDate: startOfToday(new Date()),
+ endDate: endOfToday(new Date()),
+ })
+ },
+ {
+ label: t("DSS_YESTERDAY"),
+ range: () => ({
+ startDate: startOfYesterday(new Date()),
+ endDate: endOfYesterday(new Date()),
+ })
+ },
+ {
+ label: t("DSS_THIS_WEEK"),
+ range: () => ({
+ startDate: startOfWeek(new Date()),
+ endDate: endOfWeek(new Date()),
+ })
+ },
+ {
+ label: t('DSS_THIS_MONTH'),
+ range: () => ({
+ startDate: startOfMonth(new Date()),
+ endDate: endOfMonth(new Date()),
+ })
+ },
+ {
+ label: t('DSS_THIS_QUARTER'),
+ range: () => ({
+ startDate: startOfQuarter(new Date()),
+ endDate: endOfQuarter(new Date()),
+ })
+ },
+ {
+ label: t('DSS_PREVIOUS_YEAR'),
+ range: () => ({
+ startDate: subYears(addMonths(startOfYear(new Date()), 3), 1),
+ endDate: subYears(addMonths(endOfYear(new Date()), 3), 1)
+ })
+ },
+ {
+ label: t('DSS_THIS_YEAR'),
+ range: () => ({
+ startDate: addMonths(startOfYear(new Date()), 3),
+ endDate: addMonths(endOfYear(new Date()), 3)
+ })
+ }
+ ])
+ }, [])
+
+ const getDuration = (startDate, endDate) => {
+ let noOfDays = (new Date(endDate).getTime() - new Date(startDate).getTime()) / (1000 * 3600 * 24);
+ if (noOfDays > 91) {
+ return "month";
+ }
+ if (noOfDays < 90 && noOfDays >= 14) {
+ return "week";
+ }
+ if (noOfDays <= 14) {
+ return "day";
+ }
+ };
+
+ const handleSelect = (ranges) => {
+ const { range1: selection } = ranges;
+ const { startDate, endDate, title, duration } = selection;
+ if (isStartDateFocused(focusedRange[1])) {
+ setSelectionRange(selection);
+ }
+ if (isEndDateFocused(focusedRange[1])) {
+ setSelectionRange({ title, duration, startDate, endDate: addSeconds(addMinutes(addHours(endDate, 23), 59), 59) });
+ setIsModalOpen(false);
+ }
+ };
+
+ const handleFocusChange = (focusedRange) => {
+ const [rangeIndex, rangeStep] = focusedRange;
+ setFocusedRange(focusedRange);
+ };
+
+ const handleClose = () => {
+ setIsModalOpen(false);
+ };
+
+ return (
+ <>
+ {label}
+
+
+
+ setIsModalOpen((prevState) => !prevState)} />
+
+ {isModalOpen && (
+
+
+
+ )}
+
+ >
+ );
+};
+
+export default DateRangeNew;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/DetailsCard.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/DetailsCard.js
new file mode 100644
index 00000000..153a7bb9
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/DetailsCard.js
@@ -0,0 +1,105 @@
+import React from "react";
+import PropTypes from "prop-types";
+import { Link } from "react-router-dom";
+import CitizenInfoLabel from "../atoms/CitizenInfoLabel";
+import Button from "../atoms/Button";
+import Footer from "../atoms/Footer";
+
+export const Details = ({ label, name, onClick }) => {
+ return (
+
+
+ {label}
+
+ {name}
+
+ );
+};
+
+const DetailsCard = ({
+ data,
+ serviceRequestIdKey,
+ linkPrefix,
+ handleSelect,
+ selectedItems,
+ keyForSelected,
+ handleDetailCardClick,
+ isTwoDynamicPrefix = false,
+ getRedirectionLink,
+ handleClickEnabled = true,
+ t,
+ showActionBar = true,
+ showCitizenInfoLabel = false,
+ submitButtonLabel,
+ styleVariant = "",
+ redirectedLink,
+ subRedirectedLink,
+}) => {
+ if (linkPrefix && serviceRequestIdKey) {
+ return (
+
+ {data.map((object, itemIndex) => {
+ return (
+
+
+ {Object.keys(object).map((name, index) => {
+ if (name === "applicationNo" || name === "Vehicle Log") return null;
+ return ;
+ })}
+
+
+ );
+ })}
+
+ );
+ }
+
+ return (
+
+ {data.map((object, itemIndex) => {
+ return (
+
handleClickEnabled && handleSelect(object)}>
+ {Object.keys(object)
+ .filter((rowEle) => !(typeof object[rowEle] == "object" && object[rowEle]?.hidden == true))
+ .map((name, index) => {
+ return handleClickEnabled && handleDetailCardClick(object)} />;
+ })}
+ {showCitizenInfoLabel ? (
+
+ ) : null}
+ {showActionBar ? (
+
+ handleDetailCardClick(object)} label={submitButtonLabel} />
+
+ ) : null}
+
+ );
+ })}
+
+ );
+};
+
+DetailsCard.propTypes = {
+ data: PropTypes.array,
+};
+
+DetailsCard.defaultProps = {
+ data: [],
+};
+
+export default DetailsCard;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/FilterAction.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/FilterAction.js
new file mode 100644
index 00000000..ffbb1174
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/FilterAction.js
@@ -0,0 +1,15 @@
+import React from "react";
+import { Button } from "../atoms";
+
+const FilterAction = ({ text, handleActionClick, ...props }) => (
+
+);
+
+export default FilterAction;
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/FilterCard.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/FilterCard.js
new file mode 100644
index 00000000..b069b343
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/FilterCard.js
@@ -0,0 +1,251 @@
+import React, { useState, useEffect, useRef, Fragment } from "react";
+import { SVG } from "../atoms/SVG";
+import PropTypes from 'prop-types';
+import Button from "../atoms/Button";
+
+const FilterCard = ({
+ title,
+ titleIcon,
+ children,
+ primaryActionLabel,
+ secondaryActionLabel,
+ onPrimaryPressed,
+ onSecondaryPressed,
+ layoutType = "horizontal",
+ equalWidthButtons,
+ addClose,
+ onClose,
+ className,
+ style,
+ hideIcon,
+ isPopup = false,
+ onOverlayClick,
+ contentClassName
+}) => {
+ const [isOverflowing, setIsOverflowing] = useState(false);
+ const childrenWrapRef = useRef(null);
+ const [isClosing, setIsClosing] = useState(false);
+
+ const [isMobileView, setIsMobileView] = useState(
+ window.innerWidth / window.innerHeight <= 9 / 16
+ );
+
+ const checkOverflow = () => {
+ if (childrenWrapRef.current) {
+ const isOverflow =
+ childrenWrapRef.current.scrollHeight >
+ childrenWrapRef.current.clientHeight;
+ setIsOverflowing(isOverflow);
+ }
+ };
+
+ const onResize = () => {
+ if (window.innerWidth / window.innerHeight <= 9 / 16) {
+ if (!isMobileView) {
+ setIsMobileView(true);
+ }
+ } else {
+ if (isMobileView) {
+ setIsMobileView(false);
+ }
+ }
+ checkOverflow();
+ };
+
+ useEffect(() => {
+ const handleScroll = () => checkOverflow();
+ const childrenWrap = childrenWrapRef.current;
+
+ if (childrenWrap) {
+ childrenWrap.addEventListener("scroll", handleScroll);
+ checkOverflow();
+ }
+
+ return () => {
+ if (childrenWrap) {
+ childrenWrap.removeEventListener("scroll", handleScroll);
+ }
+ };
+ }, [children]);
+
+ useEffect(() => {
+ window.addEventListener("resize", onResize);
+
+ checkOverflow();
+
+ return () => {
+ window.removeEventListener("resize", onResize);
+ };
+ }, []);
+
+ const handleClose = () => {
+ setIsClosing(true);
+ setTimeout(() => {
+ onClose();
+ }, 300);
+ };
+
+ const handleOverlayClick = () => {
+ setIsClosing(true);
+ setTimeout(() => {
+ if(onOverlayClick){
+ onOverlayClick();
+ }
+ }, 300);
+ };
+
+
+ const renderButtons = () =>
+ isMobileView || layoutType === "vertical" ? (
+
+ {primaryActionLabel && onPrimaryPressed && (
+
+ )}
+
+ {secondaryActionLabel && onSecondaryPressed && (
+
+ )}
+
+ ) : (
+
+ {secondaryActionLabel && onSecondaryPressed && (
+
+ )}
+ {primaryActionLabel && onPrimaryPressed && (
+
+ )}
+
+ );
+
+ const renderContent = () => (
+
+ {children}
+ {(secondaryActionLabel || primaryActionLabel) &&
+ layoutType === "horizontal" &&
+ ((isPopup && !isMobileView) || !isPopup) &&
+ renderButtons()}
+
+ );
+
+ const renderHeader = () => (
+
+
+ {!hideIcon ? (
+ titleIcon ? (
+ titleIcon
+ ) : (
+
+ )
+ ) : null}
+
+ {title &&
{title}
}
+ {addClose && (
+
+
+
+ )}
+
+
+ );
+
+ if (isPopup) {
+ return (
+ handleOverlayClick()}
+ >
+
e.stopPropagation()}
+ >
+ {(title || titleIcon || addClose) && renderHeader()}
+
+ {layoutType === "horizontal" && !isMobileView ? (
+
{renderContent()}
+ ) : (
+ <>
+ {renderContent()}
+ {(secondaryActionLabel || primaryActionLabel) && renderButtons()}
+ >
+ )}
+
+
+ );
+ }
+
+ if (layoutType === "vertical") {
+ return (
+
+ {(title || titleIcon || addClose) && renderHeader()}
+ {renderContent()}
+ {(secondaryActionLabel || primaryActionLabel) && renderButtons()}
+
+ );
+ }
+ return (
+
+ {(title || titleIcon || addClose) && renderHeader()}
+
{renderContent()}
+
+ );
+};
+
+FilterCard.propTypes = {
+ title: PropTypes.string,
+ titleIcon: PropTypes.element,
+ children: PropTypes.node.isRequired,
+ primaryActionLabel: PropTypes.string,
+ secondaryActionLabel: PropTypes.string,
+ onPrimaryPressed: PropTypes.func,
+ onSecondaryPressed: PropTypes.func,
+ layoutType: PropTypes.oneOf(['horizontal', 'vertical']),
+ equalWidthButtons: PropTypes.bool,
+ addClose: PropTypes.bool,
+ onClose: PropTypes.func.isRequired,
+ className: PropTypes.string,
+ style: PropTypes.object,
+ hideIcon: PropTypes.bool,
+ isPopup: PropTypes.bool,
+ onOverlayClick: PropTypes.func,
+};
+
+export default FilterCard;
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/FormCard.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/FormCard.js
new file mode 100644
index 00000000..5e557511
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/FormCard.js
@@ -0,0 +1,122 @@
+import React, { Children ,useState,useEffect} from "react";
+import PropTypes from "prop-types";
+import { useLocation } from "react-router-dom";
+
+const FormCard = ({
+ type,
+ style = {},
+ children,
+ className,
+ layout,
+ headerData,
+ equalWidthButtons,
+ withDivider,
+ footerData,
+ ...props
+}) => {
+
+ const [isMobileView, setIsMobileView] = useState(
+ (window.innerWidth / window.innerHeight <= 9/16)
+ );
+ const onResize = () => {
+ if (window.innerWidth / window.innerHeight <= 9/16) {
+ if (!isMobileView) {
+ setIsMobileView(true);
+ }
+ } else {
+ if (isMobileView) {
+ setIsMobileView(false);
+ }
+ }
+ };
+ useEffect(() => {
+ window.addEventListener("resize", () => {
+ onResize();
+ });
+ return () => {
+ window.addEventListener("resize", () => {
+ onResize();
+ });
+ };
+ });
+
+
+ // Parse the layout prop to determine rows and columns
+ const [rows, columns] = layout
+ ? layout.split("*").map(num => {
+ const parsed = Number(num);
+ return isNaN(parsed) || parsed <= 0 ? 1 : parsed;
+ })
+ : [1, 1];
+
+ // Create grid template strings dynamically
+ const gridTemplateColumns = `repeat(${columns}, 1fr)`;
+ const gridTemplateRows = `repeat(${rows}, 1fr)`;
+
+ // Inline styles for the grid layout
+ const gridStyles = {
+ display: "grid",
+ gridTemplateColumns,
+ gridTemplateRows,
+ ...style,
+ };
+
+ const childrenWithDividers = React.Children.map(children, (child, index) => {
+ const isEndOfRow = (index + 1) % columns === 0;
+ return (
+
+ {child}
+ {!isEndOfRow && withDivider && (
+
+ )}
+
+ );
+ });
+
+ return (
+
+ {headerData && (
+
{headerData}
+ )}
+
+ {!isMobileView ? childrenWithDividers : children}
+
+ {footerData && (
+
+ )}
+
+ );
+};
+
+FormCard.propTypes = {
+ type: PropTypes.string,
+ style: PropTypes.object,
+ className: PropTypes.string,
+ children: PropTypes.node,
+ layout: PropTypes.string,
+ headerData: PropTypes.node,
+ equalWidthButtons: PropTypes.bool,
+ withDivider: PropTypes.bool,
+ footerData: PropTypes.node,
+};
+export default FormCard;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/FormStep.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/FormStep.js
new file mode 100644
index 00000000..032aeb5a
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/FormStep.js
@@ -0,0 +1,110 @@
+import React from "react";
+import { useForm } from "react-hook-form";
+import PropTypes from "prop-types";
+import TextArea from "../atoms/TextArea";
+import CardLabel from "../atoms/CardLabel";
+import CardLabelError from "../atoms/CardLabelError";
+import TextInput from "../atoms/TextInput";
+import InputCard from "./InputCard";
+
+const FormStep = ({
+ t,
+ children,
+ config,
+ onSelect,
+ onSkip,
+ value,
+ onChange,
+ isDisabled,
+ _defaultValues = {},
+ forcedError,
+ componentInFront,
+ onAdd,
+ cardStyle = {},
+ isMultipleAllow = false,
+ showErrorBelowChildren = false,
+ childrenAtTheBottom = true,
+ textInputStyle
+}) => {
+ const { register, watch, errors, handleSubmit } = useForm({
+ defaultValues: _defaultValues,
+ });
+
+ const goNext = (data) => {
+ onSelect(data);
+ };
+
+ var isDisable = isDisabled ? true : config.canDisable && Object.keys(errors).filter((i) => errors[i]).length;
+
+ const inputs = config.inputs?.map((input, index) => {
+ if (input.type === "text") {
+ return (
+
+ {t(input.label)}
+ {errors[input.name] && {t(input.error)} }
+
+ {componentInFront ? {componentInFront} : null}
+
+
+
+ );
+ }
+ if (input.type === "textarea")
+ return (
+
+ {t(input.label)}
+
+
+ );
+ });
+
+ return (
+
+ );
+};
+
+FormStep.propTypes = {
+ config: PropTypes.shape({}),
+ onSelect: PropTypes.func,
+ onSkip: PropTypes.func,
+ onAdd: PropTypes.func,
+ t: PropTypes.func,
+};
+
+FormStep.defaultProps = {
+ config: {},
+ onSelect: undefined,
+ onSkip: undefined,
+ onAdd: undefined,
+ t: (value) => value,
+};
+
+export default FormStep;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/InputCard.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/InputCard.js
new file mode 100644
index 00000000..418b6572
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/InputCard.js
@@ -0,0 +1,59 @@
+import React from "react";
+import PropTypes from "prop-types";
+
+import Card from "../atoms/Card";
+import CardHeader from "../atoms/CardHeader";
+import CardText from "../atoms/CardText";
+import Button from "../atoms/Button";
+import CardCaption from "../atoms/CardCaption";
+import TextInput from "../atoms/TextInput";
+import ActionLinks from "../atoms/ActionLinks";
+
+const InputCard = ({
+ t,
+ children,
+ texts = {},
+ submit = false,
+ inputs = [],
+ inputRef,
+ onNext,
+ onSkip,
+ isDisable,
+ onAdd,
+ isMultipleAllow = false,
+ cardStyle = {},
+}) => {
+ // TODO: inputs handle
+ return (
+
+ {texts.headerCaption && {t(texts.headerCaption)} }
+ {texts?.header && {t(texts.header)} }
+ {texts?.cardText && {t(texts.cardText)} }
+ {children}
+ {texts.submitBarLabel ? : null}
+ {texts.skipLabel ? {t(texts.skipLabel)} : null}
+ {texts.skipText ? : null}
+ {isMultipleAllow && texts.addMultipleText ? : null}
+
+ );
+};
+
+InputCard.propTypes = {
+ text: PropTypes.object,
+ submit: PropTypes.bool,
+ onNext: PropTypes.func,
+ onSkip: PropTypes.func,
+ onAdd: PropTypes.func,
+ t: PropTypes.func,
+};
+
+InputCard.defaultProps = {
+ texts: {},
+ submit: false,
+ onNext: undefined,
+ onSkip: undefined,
+ onAdd: undefined,
+ t: (value) => value,
+};
+
+export default InputCard;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/LandingPageCard.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/LandingPageCard.js
new file mode 100644
index 00000000..72a70e41
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/LandingPageCard.js
@@ -0,0 +1,196 @@
+import React from "react";
+import PropTypes from "prop-types";
+import { useHistory } from "react-router-dom";
+import { Card, Divider, Button, StringManipulator } from "../atoms";
+import { iconRender } from "../utils/iconRender";
+import { Colors } from "../constants/colors/colorconstants";
+
+const LandingPageCard = ({
+ icon,
+ moduleName,
+ metrics = [],
+ links = [],
+ className,
+ style,
+ moduleAlignment,
+ hideDivider,
+ metricAlignment,
+ iconBg,
+ buttonSize,
+ onMetricClick,
+ centreChildren,
+ endChildren
+}) => {
+ const history = useHistory();
+
+ const handleMetricClick = (link, count) => {
+ onMetricClick && onMetricClick(link, count);
+ };
+
+ const handleLinkClick = ({ link, label, icon }) => {
+ link?.includes(`${window?.contextPath}/`) ? history?.push(link) : window.location.href = link;
+ };
+ const primaryIconColor = Colors.lightTheme.primary[1];
+ const secondaryIconColor = Colors.lightTheme.paper.primary;
+
+ return (
+
+
+ {icon && moduleAlignment === "right" && (
+
+ {iconRender(
+ icon,
+ iconBg ? secondaryIconColor : primaryIconColor,
+ "56px",
+ "56px",
+ `digit-landingpagecard-icon ${iconBg ? "iconBg" : ""}`
+ )}
+
+ )}
+ {moduleName && (
+
+ {StringManipulator(
+ "TOSENTENCECASE",
+ StringManipulator("TRUNCATESTRING", moduleName, {
+ maxLength: 64,
+ })
+ )}
+
+ )}
+ {icon && moduleAlignment === "left" && (
+
+ {iconRender(
+ icon,
+ iconBg ? secondaryIconColor : primaryIconColor,
+ "56px",
+ "56px",
+ `digit-landingpagecard-icon ${iconBg ? "iconBg" : ""}`
+ )}
+
+ )}
+
+ {!hideDivider && (
+
+ )}
+ {metrics && metrics.length > 0 && (
+
+ {metrics.map((metric, index) => (
+
handleMetricClick(metric?.link, metric?.count)}
+ >
+ {metric?.count && (
+
{metric?.count}
+ )}
+ {metric?.label && (
+
+ {" "}
+ {StringManipulator(
+ "TOSENTENCECASE",
+ StringManipulator("TRUNCATESTRING", metric?.label, {
+ maxLength: 64,
+ })
+ )}
+
+ )}
+
+ ))}
+
+ )}
+ {!hideDivider &&
+ metrics &&
+ metrics.length > 0 &&
+ ((links && links.length > 0) ||
+ (centreChildren && centreChildren.length > 0)) && (
+
+ )}
+ {centreChildren && centreChildren.length > 0 && (
+ {centreChildren}
+ )}
+ {!hideDivider &&
+ links &&
+ links.length > 0 &&
+ centreChildren &&
+ centreChildren.length > 0 && (
+
+ )}
+ {links.map(({ label, link, icon }, index) => (
+ handleLinkClick({ link, label, icon })}
+ style={{ padding: "0px" }}
+ />
+ ))}
+ {!hideDivider &&
+ endChildren &&
+ endChildren.length > 0 &&
+ links &&
+ links.length > 0 && (
+
+ )}
+ {endChildren && endChildren.length > 0 && (
+ {endChildren}
+ )}
+
+ );
+};
+
+LandingPageCard.propTypes = {
+ icon: PropTypes.node.isRequired,
+ moduleName: PropTypes.string.isRequired,
+ moduleAlignment: PropTypes.string,
+ metrics: PropTypes.arrayOf(
+ PropTypes.shape({
+ count: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
+ label: PropTypes.string,
+ link: PropTypes.string,
+ })
+ ),
+ metricAlignment: PropTypes.string,
+ links: PropTypes.arrayOf(
+ PropTypes.shape({
+ count: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
+ label: PropTypes.string,
+ link: PropTypes.string,
+ })
+ ),
+ className: PropTypes.string,
+ style: PropTypes.object,
+ hideDivider: PropTypes.bool,
+ iconBg: PropTypes.bool,
+ onMetricClick: PropTypes.func,
+};
+
+LandingPageCard.defaultProps = {
+ metris: [],
+ links: [],
+ className: "",
+ style: {},
+ moduleAlignment: "right",
+ metricAlignment: "left",
+ moduleName: "",
+ icon: "",
+ iconBg: false,
+ hideDivider: false,
+ onMetricClick: () => {},
+};
+
+export default LandingPageCard;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/LandingPageWrapper.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/LandingPageWrapper.js
new file mode 100644
index 00000000..8e0b3a4d
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/LandingPageWrapper.js
@@ -0,0 +1,93 @@
+import React, { useEffect, useRef, useState ,useLayoutEffect} from "react";
+import PropTypes from "prop-types";
+
+const LandingPageWrapper = ({ children, className, styles }) => {
+ const wrapperRef = useRef(null);
+ const [isMobileView, setIsMobileView] = useState(
+ window.innerWidth / window.innerHeight <= 9 / 16
+ );
+
+ const onResize = () => {
+ if (window.innerWidth / window.innerHeight <= 9 / 16) {
+ if (!isMobileView) {
+ setIsMobileView(true);
+ }
+ } else {
+ if (isMobileView) {
+ setIsMobileView(false);
+ }
+ }
+ };
+
+ useLayoutEffect(() => {
+ const updateCardDimensions = () => {
+ const cards = Array.from(wrapperRef.current.children);
+ if (isMobileView) {
+ // In mobile view, set all cards to 100% width
+ cards.forEach(card => {
+ card.style.width = "100%";
+ card.style.height = "auto"; // Adjust height accordingly
+ });
+ } else {
+ let maxWidth = 0;
+ let maxHeight = 0;
+
+ // Calculating the maximum width and height
+ cards.forEach(card => {
+ const cardWidth = card.offsetWidth;
+ const cardHeight = card.offsetHeight;
+ if (cardWidth > maxWidth) {
+ maxWidth = cardWidth;
+ }
+ if (cardHeight > maxHeight) {
+ maxHeight = cardHeight;
+ }
+ });
+
+ // Applying the maximum width and height for all cards
+ cards.forEach(card => {
+ card.style.width = `${maxWidth}px`;
+ card.style.height = `${maxHeight}px`;
+ });
+ }
+ };
+
+ // Initial call to set card dimensions
+ updateCardDimensions();
+
+ // Set up resize and load listeners
+ window.addEventListener("resize", onResize);
+ window.addEventListener("resize", updateCardDimensions);
+ window.addEventListener("load", updateCardDimensions);
+
+ // Cleanup listeners on unmount
+ return () => {
+ window.removeEventListener("resize", onResize);
+ window.removeEventListener("resize", updateCardDimensions);
+ window.removeEventListener("load", updateCardDimensions);
+ };
+ }, [isMobileView, children]);
+
+ return (
+
+ {children}
+
+ );
+};
+
+LandingPageWrapper.propTypes = {
+ children: PropTypes.node.isRequired,
+ className: PropTypes.string,
+ styles: PropTypes.object,
+};
+
+LandingPageWrapper.defaultProps = {
+ className: "",
+ styles: {},
+};
+
+export default LandingPageWrapper;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/LocationDropdownWrapper.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/LocationDropdownWrapper.js
new file mode 100644
index 00000000..c4a534f6
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/LocationDropdownWrapper.js
@@ -0,0 +1,153 @@
+import React, { Fragment, useState, useEffect } from "react";
+import PropTypes from "prop-types";
+import MultiSelectDropdown from "../atoms/MultiSelectDropdown";
+import Dropdown from "../atoms/Dropdown";
+import { Loader } from "../atoms";
+import { useTranslation } from "react-i18next";
+
+const LocationDropdownWrapper = ({ populators, formData, props, inputRef, errors, setValue, variant,disabled }) => {
+ const [options, setOptions] = useState([]);
+
+ const { t } = useTranslation();
+ const tenantId = window?.Digit?.ULBService?.getCurrentTenantId();
+ const headerLocale = window?.Digit?.Utils?.locale?.getTransformedLocale(tenantId);
+
+ const { isLoading, data: wardsAndLocalities } = window?.Digit?.Hooks.useLocation(tenantId, "Ward", {
+ select: (data) => {
+ const wards = [];
+ const localities = {};
+ data?.TenantBoundary[0]?.boundary.forEach((item) => {
+ localities[item?.code] = item?.children.map((item) => ({
+ code: item.code,
+ name: item.name,
+ i18nKey: `${headerLocale}_ADMIN_${item?.code}`,
+ label: item?.label,
+ }));
+ wards.push({ code: item.code, name: item.name, i18nKey: `${headerLocale}_ADMIN_${item?.code}` });
+ });
+
+ return {
+ wards,
+ localities,
+ };
+ },
+ });
+
+ useEffect(() => {
+ if (wardsAndLocalities) {
+ if (populators.type === "ward") {
+ setOptions(wardsAndLocalities?.wards);
+ } else {
+ //here you need to set the localities based on the selected ward
+ let locs = [];
+ const selectedWardsCodes = formData?.ward?.map((row) => row.code);
+ selectedWardsCodes?.forEach((code) => {
+ locs = [...locs, ...wardsAndLocalities?.localities?.[code]];
+ });
+ setOptions(locs);
+ }
+ }
+ }, [wardsAndLocalities, formData?.ward]);
+
+ if (isLoading) {
+ return ;
+ }
+
+ return (
+ <>
+ {populators.allowMultiSelect && (
+
+ {
+ if (populators.type === "ward") {
+ setValue("locality", []);
+ }
+ props.onChange(
+ e
+ ?.map((row) => {
+ return row?.[1] ? row[1] : null;
+ })
+ .filter((e) => e)
+ );
+ }}
+ selected={props?.value}
+ defaultLabel={t(populators?.defaultText)}
+ defaultUnit={t(populators?.selectedText)}
+ config={populators}
+ variant={variant}
+ chipsKey={populators?.chipsKey}
+ disabled={disabled}
+ addSelectAllCheck={populators?.addSelectAllCheck}
+ addCategorySelectAllCheck={populators?.addCategorySelectAllCheck}
+ selectAllLabel={populators?.selectAllLabel}
+ categorySelectAllLabel={populators?.categorySelectAllLabel}
+ restrictSelection={populators?.restrictSelection}
+ isSearchable={populators?.isSearchable}
+ />
+
+ )}
+ {!populators.allowMultiSelect && (
+ {
+ props.onChange([e], populators.name);
+ }}
+ selected={props?.value?.[0] || populators.defaultValue}
+ defaultValue={props?.value?.[0] || populators.defaultValue}
+ t={t}
+ errorStyle={errors?.[populators.name]}
+ optionCardStyles={populators?.optionsCustomStyle}
+ variant={variant}
+ disabled={disabled}
+ showIcon={populators?.showIcon}
+ isSearchable={populators?.isSearchable}
+ />
+ )}
+ >
+ );
+};
+
+LocationDropdownWrapper.propTypes = {
+ populators: PropTypes.shape({
+ type: PropTypes.string.isRequired,
+ allowMultiSelect: PropTypes.bool.isRequired,
+ optionsKey: PropTypes.string,
+ defaultText: PropTypes.string,
+ selectedText: PropTypes.string,
+ defaultValue: PropTypes.string,
+ optionsCustomStyle: PropTypes.object,
+ }).isRequired,
+ formData: PropTypes.object.isRequired,
+ props: PropTypes.shape({
+ onChange: PropTypes.func.isRequired,
+ value: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.string]),
+ }).isRequired,
+ inputRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),
+ errors: PropTypes.object,
+ setValue: PropTypes.func,
+ showIcon: PropTypes.bool,
+ isSearchable: PropTypes.bool,
+};
+
+LocationDropdownWrapper.defaultProps = {
+ populators: {
+ optionsKey: "options",
+ defaultText: "Select an option",
+ selectedText: "Selected",
+ defaultValue: "",
+ optionsCustomStyle: {},
+ },
+ inputRef: null,
+ errors: null,
+};
+
+export default LocationDropdownWrapper;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/MenuCard.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/MenuCard.js
new file mode 100644
index 00000000..3160c7a4
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/MenuCard.js
@@ -0,0 +1,82 @@
+import React from "react";
+import PropTypes from "prop-types";
+import { Card, StringManipulator } from "../atoms";
+import { iconRender } from "../utils/iconRender";
+import { Colors } from "../constants/colors/colorconstants";
+import { Spacers } from "../constants/spacers/spacers";
+import { useTranslation } from "react-i18next";
+
+const MenuCard = ({
+ icon,
+ menuName,
+ className,
+ styles,
+ description,
+ onClick,
+}) => {
+ const { t } = useTranslation();
+ const primaryIconColor = Colors.lightTheme.primary[1];
+ const iconSize = Spacers.spacer8;
+
+ return (
+
+
+ {icon && (
+
+ {iconRender(
+ icon,
+ primaryIconColor,
+ iconSize,
+ iconSize,
+ `digit-menucard-icon`
+ )}
+
+ )}
+ {menuName && (
+
+ {StringManipulator(
+ "TOSENTENCECASE",
+ StringManipulator("TRUNCATESTRING", t(menuName), {
+ maxLength: 64,
+ })
+ )}
+
+ )}
+
+ {description && (
+
+ {StringManipulator(
+ "TOSENTENCECASE",
+ StringManipulator("TRUNCATESTRING", t(description), {
+ maxLength: 256,
+ })
+ )}
+
+ )}
+
+ );
+};
+
+MenuCard.propTypes = {
+ icon: PropTypes.node.isRequired,
+ menuName: PropTypes.string.isRequired,
+ description: PropTypes.string,
+ className: PropTypes.string,
+ styles: PropTypes.object,
+ onClick: PropTypes.func,
+};
+
+MenuCard.defaultProps = {
+ className: "",
+ styles: {},
+ menuName: "",
+ description: "",
+ icon: "",
+ onClick: () => {},
+};
+
+export default MenuCard;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/MenuCardWrapper.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/MenuCardWrapper.js
new file mode 100644
index 00000000..f95d4cbe
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/MenuCardWrapper.js
@@ -0,0 +1,24 @@
+import React from "react";
+import PropTypes from "prop-types";
+
+const MenuCardWrapper = ({ children, className, styles }) => {
+ return (
+
+ {children}
+
+ );
+};
+
+MenuCardWrapper.propTypes = {
+ children: PropTypes.node.isRequired,
+ className: PropTypes.string,
+ styles: PropTypes.object,
+};
+
+MenuCardWrapper.defaultProps = {
+ className: "",
+ styles: {
+ },
+};
+
+export default MenuCardWrapper;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/MetricCard.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/MetricCard.js
new file mode 100644
index 00000000..8fa00c67
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/MetricCard.js
@@ -0,0 +1,93 @@
+import React, { Fragment } from "react";
+import PropTypes from "prop-types";
+import { Card, Divider, CustomSVG } from "../atoms";
+import { Spacers } from "../constants/spacers/spacers";
+import { useTranslation } from "react-i18next";
+
+const MetricCard = ({ className, styles, layout, withDivider, metrics, withBottomDivider }) => {
+ const { t } = useTranslation();
+
+ // Parse the layout prop to determine rows and columns
+ const [rows, columns] = layout ? layout.split("*").map(Number) : [1, metrics.length];
+
+ // Create grid template strings dynamically
+ const gridTemplateColumns = `repeat(${columns}, 1fr)`;
+
+ // Inline styles for the grid layout
+ const gridStyles = {
+ display: "grid",
+ gridTemplateColumns,
+ gridRowGap: withBottomDivider ? Spacers.spacer4 : "0",
+ ...styles,
+ };
+
+ return (
+
+ {metrics?.map((metric, index) => {
+ const isEndOfRow = (index + 1) % columns === 0;
+ const isInLastRow = index >= (Math.ceil(metrics.length / columns) - 1) * columns;
+
+ return (
+
+
+ {metric?.value &&
{metric.value}
}
+ {metric?.description &&
{t(metric.description)}
}
+
+ {metric?.statusmessage && (
+
+ {metric.status === "Increased" ? (
+
+ ) : metric.status === "Decreased" ? (
+
+ ) : null}
+ {t(metric.statusmessage)}
+
+ )}
+
+ {!isEndOfRow && withDivider && (
+
+ )}
+ {isEndOfRow && !isInLastRow && withBottomDivider && (
+
+ )}
+
+ );
+ })}
+
+ );
+};
+
+MetricCard.propTypes = {
+ metrics: PropTypes.arrayOf(
+ PropTypes.shape({
+ value: PropTypes.string.isRequired,
+ description: PropTypes.string.isRequired,
+ status: PropTypes.string.isRequired,
+ })
+ ).isRequired,
+ withDivider: PropTypes.bool,
+ withBottomDivider: PropTypes.bool,
+ className: PropTypes.string,
+ styles: PropTypes.object,
+ layout: PropTypes.string,
+ statusmessage: PropTypes.string,
+};
+
+MetricCard.defaultProps = {
+ className: "",
+ styles: {},
+ metrics: [],
+ layout: "1*1",
+ withDivider: false,
+ withBottomDivider: false,
+};
+
+export default MetricCard;
+
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/MultiUploadWrapper.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/MultiUploadWrapper.js
new file mode 100644
index 00000000..bcf3a02a
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/MultiUploadWrapper.js
@@ -0,0 +1,178 @@
+import React, { useEffect, useReducer, useState } from "react";
+import PropTypes from "prop-types";
+import UploadFile from "../atoms/UploadFile";
+
+const displayError = ({ t, error, name }, customErrorMsg) => (
+
+ {customErrorMsg ? t(customErrorMsg) : t(error)}
+ {customErrorMsg ? "" : `${t("ES_COMMON_DOC_FILENAME")} : ${name} ...`}
+
+);
+
+const fileValidationStatus = (file, regex, maxSize, t) => {
+ const status = { valid: true, name: file?.name?.substring(0, 15), error: "" };
+ if (!file) return;
+
+ if (!regex.test(file.type) && file.size / 1024 / 1024 > maxSize) {
+ status.valid = false;
+ status.error = t(`NOT_SUPPORTED_FILE_TYPE_AND_FILE_SIZE_EXCEEDED_5MB`);
+ }
+
+ if (!regex.test(file.type)) {
+ status.valid = false;
+ status.error = t(`NOT_SUPPORTED_FILE_TYPE`);
+ }
+
+ if (file.size / 1024 / 1024 > maxSize) {
+ status.valid = false;
+ status.error = t(`FILE_SIZE_EXCEEDED_5MB`);
+ }
+
+ return status;
+};
+const checkIfAllValidFiles = (files, regex, maxSize, t, maxFilesAllowed, state) => {
+ if (!files.length || !regex || !maxSize) return [{}, false];
+
+ const uploadedFiles = state.length + 1;
+ if (maxFilesAllowed && (uploadedFiles > maxFilesAllowed || files.length > maxFilesAllowed))
+ return [[{ valid: false, name: files[0]?.name?.substring(0, 15), error: t(`FILE_LIMIT_EXCEEDED`) }], true];
+
+ const messages = [];
+ let isInValidGroup = false;
+ for (let file of files) {
+ const fileStatus = fileValidationStatus(file, regex, maxSize, t);
+ if (!fileStatus.valid) {
+ isInValidGroup = true;
+ }
+ messages.push(fileStatus);
+ }
+
+ return [messages, isInValidGroup];
+};
+
+const MultiUploadWrapper = ({
+ t,
+ module = "PGR",
+ tenantId = Digit.ULBService.getStateId(),
+ getFormState,
+ requestSpecifcFileRemoval,
+ extraStyleName = "",
+ setuploadedstate = [],
+ showHintBelow,
+ hintText,
+ allowedFileTypesRegex = /(.*?)(jpg|jpeg|webp|aif|png|image|pdf|msword|openxmlformats-officedocument)$/i,
+ allowedMaxSizeInMB = 10,
+ acceptFiles = "image/*, .jpg, .jpeg, .webp, .aif, .png, .image, .pdf, .msword, .openxmlformats-officedocument, .dxf",
+ maxFilesAllowed,
+ customClass = "",
+ customErrorMsg,
+ containerStyles,
+}) => {
+ const FILES_UPLOADED = "FILES_UPLOADED";
+ const TARGET_FILE_REMOVAL = "TARGET_FILE_REMOVAL";
+
+ const [fileErrors, setFileErrors] = useState([]);
+ const [enableButton, setEnableButton] = useState(true);
+
+ const uploadMultipleFiles = (state, payload) => {
+ const { files, fileStoreIds } = payload;
+ const filesData = Array.from(files);
+ const newUploads = filesData?.map((file, index) => [file.name, { file, fileStoreId: fileStoreIds[index] }]);
+ return [...state, ...newUploads];
+ };
+
+ const removeFile = (state, payload) => {
+ const __indexOfItemToDelete = state.findIndex((e) => e[1].fileStoreId.fileStoreId === payload.fileStoreId.fileStoreId);
+ const mutatedState = state.filter((e, index) => index !== __indexOfItemToDelete);
+ setFileErrors([]);
+ return [...mutatedState];
+ };
+
+ const uploadReducer = (state, action) => {
+ switch (action.type) {
+ case FILES_UPLOADED:
+ return uploadMultipleFiles(state, action.payload);
+ case TARGET_FILE_REMOVAL:
+ return removeFile(state, action.payload);
+ default:
+ break;
+ }
+ };
+
+ const [state, dispatch] = useReducer(uploadReducer, [...setuploadedstate]);
+
+ const onUploadMultipleFiles = async (e) => {
+ setEnableButton(false);
+ setFileErrors([]);
+ const files = Array.from(e.target.files);
+
+ if (!files.length) return;
+ const [validationMsg, error] = checkIfAllValidFiles(files, allowedFileTypesRegex, allowedMaxSizeInMB, t, maxFilesAllowed, state);
+
+ if (!error) {
+ try {
+ const { data: { files: fileStoreIds } = {} } = await Digit.UploadServices.MultipleFilesStorage(module, e.target.files, tenantId);
+ setEnableButton(true);
+ return dispatch({ type: FILES_UPLOADED, payload: { files: e.target.files, fileStoreIds } });
+ } catch (err) {
+ setEnableButton(true);
+ }
+ } else {
+ setFileErrors(validationMsg);
+ setEnableButton(true);
+ }
+ };
+
+ useEffect(() => getFormState(state), [state]);
+
+ useEffect(() => {
+ requestSpecifcFileRemoval ? dispatch({ type: TARGET_FILE_REMOVAL, payload: requestSpecifcFileRemoval }) : null;
+ }, [requestSpecifcFileRemoval]);
+
+ return (
+
+ onUploadMultipleFiles(e)}
+ removeTargetedFile={(fileDetailsData) => dispatch({ type: TARGET_FILE_REMOVAL, payload: fileDetailsData })}
+ uploadedFiles={state}
+ multiple={true}
+ showHintBelow={showHintBelow}
+ hintText={hintText}
+ extraStyleName={extraStyleName}
+ onDelete={() => {
+ setFileErrors([]);
+ }}
+ accept={acceptFiles}
+ message={t(`WORKS_NO_FILE_SELECTED`)}
+ customClass={customClass}
+ enableButton={enableButton}
+ />
+
+ {fileErrors.length
+ ? fileErrors.map(({ valid, name, type, size, error }) => (valid ? null : displayError({ t, error, name }, customErrorMsg)))
+ : null}
+
+
+ );
+};
+
+MultiUploadWrapper.propTypes = {
+ t: PropTypes.func.isRequired,
+ module: PropTypes.string,
+ tenantId: PropTypes.string,
+ getFormState: PropTypes.func,
+ requestSpecifcFileRemoval: PropTypes.object,
+ extraStyleName: PropTypes.string,
+ setuploadedstate: PropTypes.array,
+ showHintBelow: PropTypes.bool,
+ hintText: PropTypes.string,
+ allowedFileTypesRegex: PropTypes.instanceOf(RegExp),
+ allowedMaxSizeInMB: PropTypes.number,
+ acceptFiles: PropTypes.string,
+ maxFilesAllowed: PropTypes.number,
+ customClass: PropTypes.string,
+ customErrorMsg: PropTypes.string,
+ containerStyles: PropTypes.object,
+};
+
+export default MultiUploadWrapper;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/PanelCard.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/PanelCard.js
new file mode 100644
index 00000000..b495ab3f
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/PanelCard.js
@@ -0,0 +1,143 @@
+import React, { Fragment, useEffect, useState, useRef } from "react";
+import PropTypes from "prop-types";
+import { Panels } from "../atoms";
+
+const PanelCard = (props) => {
+ const [isOverflowing, setIsOverflowing] = useState(false);
+ const childrenWrapRef = useRef(null);
+
+ const [isMobileView, setIsMobileView] = useState(window.innerWidth <= 480);
+
+ const checkOverflow = () => {
+ if (childrenWrapRef.current) {
+ const isOverflow =
+ childrenWrapRef.current.scrollHeight >
+ childrenWrapRef.current.clientHeight;
+ setIsOverflowing(isOverflow);
+ }
+ };
+
+ const onResize = () => {
+ if (window.innerWidth <= 480) {
+ if (!isMobileView) {
+ setIsMobileView(true);
+ }
+ } else {
+ if (isMobileView) {
+ setIsMobileView(false);
+ }
+ }
+ checkOverflow();
+ };
+
+ useEffect(() => {
+ const handleScroll = () => checkOverflow();
+ const childrenWrap = childrenWrapRef.current;
+
+ if (childrenWrap) {
+ childrenWrap.addEventListener("scroll", handleScroll);
+ checkOverflow();
+ }
+
+ return () => {
+ if (childrenWrap) {
+ childrenWrap.removeEventListener("scroll", handleScroll);
+ }
+ };
+ }, [props.children]);
+
+ useEffect(() => {
+ window.addEventListener("resize", onResize);
+
+ checkOverflow();
+
+ return () => {
+ window.removeEventListener("resize", onResize);
+ };
+ }, []);
+
+ const hasFooterChildren = props?.footerChildren?.length > 0;
+
+ const allowedFooter = hasFooterChildren
+ ? props?.footerChildren.slice(0, props?.maxFooterButtonsAllowed || 5)
+ : [];
+
+ const sortedFooterButtons = [...allowedFooter].sort((a, b) => {
+ const typeOrder = { primary: 3, secondary: 2, tertiary: 1 };
+ const getTypeOrder = (button) =>
+ typeOrder[(button.props.variation || "").toLowerCase()];
+ return getTypeOrder(a) - getTypeOrder(b);
+ });
+
+ const finalFooterArray = props?.sortFooterButtons
+ ? isMobileView
+ ? sortedFooterButtons.reverse()
+ : sortedFooterButtons
+ : allowedFooter;
+
+ return (
+
+ {
+
+ }
+ {(props?.children?.length>0 || props?.description!=="") && (
+
+ {props?.description && (
+
+ {props?.description}
+
+ )}
+ {props?.children}
+
+ )}
+ {hasFooterChildren && (
+
+
+ {finalFooterArray}
+
+
+ )}
+
+ );
+};
+
+PanelCard.propTypes = {
+ className: PropTypes.string,
+ style: PropTypes.object,
+ children: PropTypes.node,
+ footerChildren: PropTypes.node,
+ message: PropTypes.string,
+ type: PropTypes.string,
+ info: PropTypes.string,
+ response: PropTypes.string,
+ customIcon: PropTypes.string,
+ iconFill: PropTypes.string,
+ multipleResponses: PropTypes.array,
+};
+
+export default PanelCard;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/RenderFormFields.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/RenderFormFields.js
new file mode 100644
index 00000000..3c051ad3
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/RenderFormFields.js
@@ -0,0 +1,377 @@
+import React,{Fragment} from "react";
+import { useTranslation } from "react-i18next";
+import { Controller } from "react-hook-form";
+import LabelFieldPair from "../atoms/LabelFieldPair";
+import TextInput from "../atoms/TextInput";
+import TextArea from "../atoms/TextArea";
+import CustomDropdown from "./CustomDropdown";
+import MobileNumber from "../atoms/MobileNumber";
+import DateRangeNew from "./DateRangeNew";
+import MultiSelectDropdown from "../atoms/MultiSelectDropdown";
+import LocationDropdownWrapper from "./LocationDropdownWrapper";
+import WorkflowStatusFilter from "./WorkflowStatusFilter";
+import ApiDropdown from "./ApiDropdown";
+import { ErrorMessage } from "../atoms";
+import { SVG } from "../atoms";
+import HeaderComponent from "../atoms/HeaderComponent";
+import StringManipulator from "../atoms/StringManipulator";
+import Divider from "../atoms/Divider";
+
+const RenderFormFields = ({ data, ...props }) => {
+ const { t } = useTranslation();
+ const { fields, control, formData, errors, register, setValue, getValues, setError, clearErrors, apiDetails } = props;
+
+ const fieldSelector = (type, populators, isMandatory, disable = false, component, config) => {
+ const Component = typeof component === "string" ? Digit.ComponentRegistryService.getComponent(component) : component;
+ let customValidations = config?.additionalValidation
+ ? Digit?.Customizations?.[apiDetails?.masterName]?.[apiDetails?.moduleName]?.additionalValidations(
+ config?.additionalValidation?.type,
+ formData,
+ config?.additionalValidation?.keys
+ )
+ : null;
+ const customRules = customValidations ? { validate: customValidations } : {};
+ const customProps = config?.customProps;
+ switch (type) {
+ case "date":
+ case "text":
+ case "number":
+ case "password":
+ case "time":
+ case "geolocation":
+ case "search":
+ case "numeric":
+ return (
+ (
+
+ )}
+ name={populators?.name}
+ rules={{ required: isMandatory, ...populators.validation, ...customRules }}
+ control={control}
+ />
+ );
+
+ case "textarea":
+ return (
+ (
+
+ )}
+ name={populators?.name}
+ rules={{ required: isMandatory, ...populators.validation }}
+ control={control}
+ />
+ );
+ case "mobileNumber":
+ return (
+ (
+
+ )}
+ defaultValue={populators.defaultValue}
+ name={populators?.name}
+ rules={{ required: isMandatory, ...populators.validation }}
+ control={control}
+ />
+ );
+ case "custom":
+ return (
+ populators.component({ ...props, setValue }, populators.customProps)}
+ defaultValue={populators.defaultValue}
+ name={populators?.name}
+ control={control}
+ />
+ );
+ case "radio":
+ case "dropdown":
+ case "select":
+ case "radioordropdown":
+ case "toggle":
+ return (
+ (
+
+ )}
+ rules={{ required: isMandatory, ...populators.validation }}
+ defaultValue={formData?.[populators?.name]}
+ name={populators?.name}
+ control={control}
+ />
+ );
+
+ case "multiselectdropdown":
+ return (
+ {
+ return (
+
+ {
+ props.onChange(
+ e
+ ?.map((row) => {
+ return row?.[1] ? row[1] : null;
+ })
+ .filter((e) => e)
+ );
+ }}
+ selected={props?.value || []}
+ defaultLabel={t(populators?.defaultText)}
+ defaultUnit={t(populators?.selectedText)}
+ config={populators}
+ disabled={disable}
+ variant={populators?.variant}
+ addSelectAllCheck={populators?.addSelectAllCheck}
+ addCategorySelectAllCheck={populators?.addCategorySelectAllCheck}
+ selectAllLabel={populators?.selectAllLabel}
+ categorySelectAllLabel={populators?.categorySelectAllLabel}
+ restrictSelection={populators?.restrictSelection}
+ isSearchable={populators?.isSearchable}
+ />
+
+ );
+ }}
+ />
+ );
+ case "locationdropdown":
+ return (
+ {
+ return (
+
+
+
+ );
+ }}
+ />
+ );
+ case "apidropdown":
+ return (
+ {
+ return (
+
+ );
+ }}
+ />
+ );
+
+ case "workflowstatesfilter":
+ return (
+ {
+ return (
+
+
+
+ );
+ }}
+ />
+ );
+ case "dateRange":
+ return (
+ (
+
+ )}
+ rules={{ required: isMandatory, ...populators.validation }}
+ defaultValue={formData?.[populators?.name]}
+ name={populators?.name}
+ control={control}
+ />
+ );
+
+ case "component":
+ return (
+ (
+
+ )}
+ name={config?.key}
+ control={control}
+ />
+ );
+ default:
+ return populators?.dependency !== false ? populators : null;
+ }
+ };
+
+ return (
+
+ {fields?.map((item, index) => {
+ return (
+ <>
+
+ {item.label && (
+
+
+
+ {StringManipulator(
+ "TOSENTENCECASE",
+ StringManipulator("TRUNCATESTRING", t(item.label), {
+ maxLength: 64,
+ })
+ )}
+
+
+ {item?.isMandatory ? " * " : null}
+
+ {item?.infoMessage ? (
+
+
+ {t(item?.infoMessage)}
+
+ ) : null}
+
+
+ )}
+ {fieldSelector(
+ item.type,
+ item.populators,
+ item.isMandatory,
+ item?.disable,
+ item?.component,
+ item
+ )}
+ {item?.populators?.name &&
+ errors &&
+ errors[item?.populators?.name] &&
+ Object.keys(errors[item?.populators?.name]).length ? (
+
+ ) : null}
+
+ {item?.addDivider ? : null}
+ >
+ );
+ })}
+
+ );
+};
+
+export default RenderFormFields;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/ResultsDataTable.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/ResultsDataTable.js
new file mode 100644
index 00000000..9b0bc9ca
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/ResultsDataTable.js
@@ -0,0 +1,197 @@
+import React from "react";
+import { useTranslation } from "react-i18next";
+import _ from "lodash";
+import { Card, Loader } from "../atoms";
+import { CustomSVG } from "../atoms";
+import DataTable from "react-data-table-component";
+import CheckBox from "../atoms/CheckBox";
+import { dataTableCustomStyles } from "../constants/styles/dataTableCustomStyles";
+import { SVG } from "../atoms";
+import CardLabel from "../atoms/CardLabel";
+import Button from "../atoms/Button";
+import TextInput from "../atoms/TextInput";
+
+const ResultsDataTable = ({
+ data,
+ columns,
+ showCheckBox,
+ selectProps,
+ onSelectedRowsChange,
+ onRowClicked,
+ selectableRowsNoSelectAll,
+ expandableRows,
+ expandableRowsComponent,
+ progressPending,
+ progressComponent,
+ conditionalRowStyles,
+ paginationRowsPerPageOptions,
+ onChangePage,
+ paginationPerPage,
+ paginationDefaultPage,
+ onChangeRowsPerPage,
+ paginationTotalRows,
+ isPaginationRequired,
+ defaultSortAsc,
+ tableClassName,
+ onRowExpandToggled,
+ showTableDescription,
+ showTableTitle,
+ enableGlobalSearch,
+ showSelectedState,
+ selectedRows,
+ actions,
+ searchHeader,
+ onSearch,
+ handleActionSelect,
+ showSelectedStatePosition = "top",
+ rowsPerPageText,
+ paginationComponentOptions
+}) => {
+ const { t } = useTranslation();
+ const renderTable = () => {
+ return (
+
+ }
+ selectableRows={showCheckBox}
+ selectableRowsHighlight={true}
+ selectableRowsComponent={CheckBox}
+ selectableRowsComponentProps={selectProps}
+ onSelectedRowsChange={onSelectedRowsChange}
+ onRowClicked={onRowClicked}
+ selectableRowsNoSelectAll={selectableRowsNoSelectAll}
+ expandableRows={expandableRows}
+ expandableRowsComponent={expandableRowsComponent}
+ expandableIcon={{
+ expanded: (
+
+ ),
+ collapsed: (
+
+ ),
+ }}
+ onRowExpandToggled={onRowExpandToggled}
+ progressPending={progressPending}
+ progressComponent={progressComponent || }
+ customStyles={dataTableCustomStyles}
+ conditionalRowStyles={conditionalRowStyles}
+ className={
+ tableClassName
+ ? `digit-data-table ${showCheckBox ? "selectable" : "unselectable"} ${tableClassName}`
+ : `digit-data-table ${showCheckBox ? "selectable" : "unselectable"}`
+ }
+ defaultSortAsc={defaultSortAsc}
+ pagination={
+ isPaginationRequired !== undefined ? isPaginationRequired : true
+ }
+ paginationServer
+ paginationTotalRows={paginationTotalRows}
+ onChangeRowsPerPage={onChangeRowsPerPage}
+ paginationDefaultPage={paginationDefaultPage}
+ paginationPerPage={paginationPerPage}
+ onChangePage={onChangePage}
+ paginationRowsPerPageOptions={
+ paginationRowsPerPageOptions || [10, 20, 30, 40, 50]
+ }
+ noContextMenu
+ fixedHeader={true}
+ fixedHeaderScrollHeight={"100vh"}
+ paginationComponentOptions={{
+ ...paginationComponentOptions,
+ rowsPerPageText: rowsPerPageText || t("ROWS_PER_PAGE"),
+ }}
+ />
+ );
+ };
+
+ const renderSelectedState = () => {
+ if (showSelectedState && selectedRows.length > 0) {
+ return (
+
+
+
+
{`${selectedRows.length} ${t(
+ "ROWS_SELECTED"
+ )}`}
+
+ {actions?.length > 0 ? (
+
+ {actions.map((action, index) => (
+
+ handleActionSelect(index, action.label, selectedRows)
+ }
+ {...action}
+ />
+ ))}
+
+ ) : null}
+
+ );
+ } else {
+ return null;
+ }
+ };
+
+ return (
+
+ {(showTableDescription || showTableTitle || enableGlobalSearch) && (
+
+
+ {showTableTitle && (
+
{t(showTableTitle)}
+ )}
+
+ {showTableDescription && (
+
{t(showTableDescription)}
+ )}
+
+ {enableGlobalSearch && (
+
+ {t(searchHeader) || t("Filter Table Records")}
+
+ )}
+ {enableGlobalSearch && (
+
+ onSearch(e.target.value)}
+ placeholder={t("Search")}
+ >
+
+ )}
+
+
+ )}
+ {showSelectedStatePosition === "top" && renderSelectedState()}
+ {renderTable()}
+ {showSelectedStatePosition === "bottom" && renderSelectedState()}
+
+ );
+};
+
+export default ResultsDataTable;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/SearchAction.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/SearchAction.js
new file mode 100644
index 00000000..826ea2c6
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/SearchAction.js
@@ -0,0 +1,15 @@
+import React from "react";
+import { Button } from "../atoms";
+
+const SearchAction = ({ text, handleActionClick }) => (
+
+);
+
+export default SearchAction;
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/SearchForm.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/SearchForm.js
new file mode 100644
index 00000000..36de0a7a
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/SearchForm.js
@@ -0,0 +1,15 @@
+import React from "react";
+
+export const SearchField = ({ children, className }) => {
+ // no mission specific code should be written here. for additional define use variant or classname props.
+ return {children}
;
+};
+
+export const SearchForm = ({ children, onSubmit, handleSubmit, id, className = "", variant = "" }) => {
+ // define variant unset to unset all styles define by classname
+ return (
+
+ );
+};
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/SearchOnRadioButtons.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/SearchOnRadioButtons.js
new file mode 100644
index 00000000..ea28d4a5
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/SearchOnRadioButtons.js
@@ -0,0 +1,27 @@
+import React, { useReducer } from "react"
+import RadioButtons from "../atoms/RadioButtons"
+import TextInput from "../atoms/TextInput"
+import { SVG } from "../atoms/SVG"
+
+const SearchOnRadioButtons = ({options,optionsKey,additionalWrapperClass,onSelect,selectedOption, SignatureImage = () => , onSearchQueryChange, SearchQueryValue, placeholder}) => {
+
+ function optionsReducer(state, action){
+ switch (action.type){
+ case "filter":
+ return action.options.filter(i => i[optionsKey].toUpperCase().includes(action.payload.toUpperCase()))
+ }
+ }
+
+ const [ filteredOptions, optionsDispatch ] = useReducer(optionsReducer, options)
+
+ function defaultSearchQueryChange(e){
+ optionsDispatch({type: "filter", payload: e.target.value, options})
+ }
+
+ return
+ } onChange={onSearchQueryChange || defaultSearchQueryChange} value={SearchQueryValue} placeholder={placeholder} />
+
+
+}
+
+export default SearchOnRadioButtons
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/SortAction.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/SortAction.js
new file mode 100644
index 00000000..cdd8fcd6
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/SortAction.js
@@ -0,0 +1,15 @@
+import React from "react";
+import { Button } from "../atoms";
+
+const SortAction = ({ text, handleActionClick }) => (
+
+);
+
+export default SortAction;
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/SummaryCard.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/SummaryCard.js
new file mode 100644
index 00000000..cf8a3629
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/SummaryCard.js
@@ -0,0 +1,157 @@
+import React, { Fragment } from "react";
+import { Card } from "../atoms";
+import { SummaryCardFieldPair } from "../atoms";
+import { Divider } from "../atoms";
+import { useTranslation } from "react-i18next";
+import PropTypes from "prop-types";
+
+const SummaryCard = ({
+ className,
+ style,
+ type,
+ sections,
+ withDivider,
+ layout,
+ withSectionDivider,
+ showSectionsAsMultipleCards,
+ asSeperateCards,
+}) => {
+ const isTwoColumnLayout = layout === 2;
+ const { t } = useTranslation();
+
+ const renderSectionHeader = (section) => {
+ if (section?.header || section?.subHeader) {
+ return (
+
+ {section?.header && (
+
{section?.header}
+ )}
+ {section?.subHeader && (
+
+ {section?.subHeader}
+
+ )}
+
+ );
+ }
+ return null;
+ };
+
+ const renderFieldPairs = (fieldPairs) => {
+ return fieldPairs?.map((pair, index) => (
+
+
+ {withDivider && layout === 1 && index < fieldPairs.length - 1 && (
+
+ )}
+ {withDivider && layout === 2 && (index + 1) % 2 !== 0 && (
+
+ )}
+
+ ));
+ };
+
+ const renderSectionContent = (section, sectionIndex) => (
+
+ {renderSectionHeader(section)}
+
+ {renderFieldPairs(section?.fieldPairs)}
+
+ {withSectionDivider && sectionIndex < sections.length - 1 && (
+
+ )}
+
+ );
+
+ // When asSeperateCards is true, render each section inside its own Card
+ if (asSeperateCards) {
+ return (
+
+ {sections?.map((section, sectionIndex) => (
+
+ {renderSectionHeader(section)}
+
+ {renderFieldPairs(section.fieldPairs)}
+
+
+ ))}
+
+ );
+ }
+
+ if (showSectionsAsMultipleCards && !asSeperateCards) {
+ // When showSectionsAsMultipleCards is true, render each section inside its own Card
+ return (
+
+ {sections?.map((section, sectionIndex) => (
+
+ {renderSectionHeader(section)}
+
+ {renderFieldPairs(section?.fieldPairs)}
+
+
+ ))}
+
+ );
+ }
+ // When showSectionsAsMultipleCards is false, render sections inside a single Card
+ return (
+
+ {sections?.map((section, sectionIndex) =>
+ renderSectionContent(section, sectionIndex)
+ )}
+
+ );
+};
+
+SummaryCard.propTypes = {
+ className: PropTypes.string,
+ style: PropTypes.object,
+ type: PropTypes.string,
+ sections: PropTypes.array.isRequired,
+ withDivider: PropTypes.bool,
+ layout: PropTypes.number,
+ withSectionDivider: PropTypes.bool,
+ showSectionsAsMultipleCards: PropTypes.bool,
+ asSeperateCards: PropTypes.bool,
+};
+
+export default SummaryCard;
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/TableMolecule.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/TableMolecule.js
new file mode 100644
index 00000000..e000ef21
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/TableMolecule.js
@@ -0,0 +1,876 @@
+import React, {
+ useState,
+ useRef,
+ useEffect,
+ useLayoutEffect,
+ Fragment,
+} from "react";
+import { useTranslation } from "react-i18next";
+import PropTypes from "prop-types";
+import TableMain from "../atoms/TableMain";
+import TableHeader from "../atoms/TableHeader";
+import TableFooter from "../atoms/TableFooter";
+import TableBody from "../atoms/TableBody";
+import TableCell from "../atoms/TableCell";
+import TableRow from "../atoms/TableRow";
+import CheckBox from "../atoms/CheckBox";
+import Card from "../atoms/Card";
+import { SVG } from "../atoms";
+import { CustomSVG } from "../atoms";
+import { StringManipulator } from "../atoms";
+import Button from "../atoms/Button";
+import NestedTable from "../atoms/NestedTable";
+
+const TableMolecule = ({
+ headerData,
+ rows,
+ pagination = {
+ initialRowsPerPage: 5,
+ rowsPerPageOptions: [5, 10, 15, 20],
+ manualPagination : false,
+ onPageSizeChange : () => {},
+ onNextPage : () => {},
+ onPrevPage : () => {},
+ currentPage : 1,
+ totalCount:undefined
+ },
+ styles = {
+ withBorder: false,
+ withAlternateBg: false,
+ withHeaderDivider: true,
+ withColumnDivider: false,
+ withRowDivider: true,
+ extraStyles: {},
+ },
+ tableDetails = {
+ tableTitle: "",
+ tableDescription: "",
+ },
+ sorting = {
+ isTableSortable: true,
+ initialSortOrder: "ascending",
+ customSortFunction:()=>{}
+ },
+ selection = {
+ addCheckbox: false,
+ checkboxLabel: "",
+ initialSelectedRows: [],
+ onSelectedRowsChange: () => {},
+ showSelectedState: false,
+ },
+ footerProps = {
+ scrollableStickyFooterContent: true,
+ footerContent: null,
+ hideFooter: false,
+ stickyFooterContent: null,
+ isStickyFooter: false,
+ addStickyFooter: false,
+ },
+ className,
+ wrapperClassName,
+ onFilter,
+ addFilter,
+ onRowClick,
+ frozenColumns = 0,
+ isStickyHeader = false,
+ actionButtonLabel,
+ actions,
+}) => {
+ const { t } = useTranslation();
+ const [currentPage, setCurrentPage] = useState(pagination?.currentPage || 1);
+ const [expandedRows, setExpandedRows] = useState([]);
+ const [rowsPerPage, setRowsPerPage] = useState(
+ pagination?.initialRowsPerPage
+ );
+ const [selectedRows, setSelectedRows] = useState(
+ selection?.initialSelectedRows
+ );
+ const frozenColumnsRefsForHeaders = useRef([]);
+ const frozenColumnsRefsForRows = useRef({});
+ const [selectedRowsDetails, setSelectedRowsDetails] = useState([]);
+ const [sortOrder, setSortOrder] = useState(
+ sorting?.initialSortOrder || "ascending"
+ );
+ const [sortedColumnIndex, setSortedColumnIndex] = useState(null);
+ const [sortedRows, setSortedRows] = useState([]);
+ const [tableData, setTableData] = useState([]);
+
+
+ // Pagination Logic
+ const indexOfLastRow = currentPage * rowsPerPage;
+ const indexOfFirstRow = indexOfLastRow - rowsPerPage;
+
+ // Handling Select All Rows
+ const allRowsSelected = selectedRows?.length === rows?.length;
+
+ const onSelectAllRows = () => {
+ if (allRowsSelected) {
+ setSelectedRows([]);
+ } else {
+ setSelectedRows(rows.map((_, index) => index));
+ }
+ };
+
+ // Handling Select Individual Row
+ const onSelectRow = (rowIndex) => {
+ setSelectedRows((prevSelected) =>
+ prevSelected?.includes(rowIndex)
+ ? prevSelected?.filter((i) => i !== rowIndex)
+ : [...prevSelected, rowIndex]
+ );
+ };
+
+ //Handling PageChange
+ const handlePageChange = (newPage) => {
+ if (newPage > 0 && newPage <= totalPages) {
+ setCurrentPage(newPage);
+ }
+ };
+
+ // Handling change in rows per page
+ const handleRowsPerPageChange = (event) => {
+ setRowsPerPage(Number(event?.target?.value));
+ setCurrentPage(1);
+ // Reset to first page when changing rows per page
+ };
+
+ const toggleRowExpansion = (rowIndex) => {
+ setExpandedRows((prev) =>
+ prev.includes(rowIndex)
+ ? prev.filter((index) => index !== rowIndex)
+ : [...prev, rowIndex]
+ );
+ };
+
+ const updateTableData = (rowIndex, columnIndex, value) => {
+ setTableData((prevData) => {
+ const updatedData = [...prevData];
+ // Find the row by rowIndex
+ let row = updatedData.find(row => row.rowIndex === rowIndex);
+ if (!row) {
+ // If row doesn't exist, create a new row with this rowIndex
+ row = { rowIndex, values: {} };
+ updatedData.push(row);
+ }
+ // Update the column value in the row
+ row.values[columnIndex] = value;
+ return updatedData;
+ });
+ };
+
+
+ useEffect(() => {
+ setSortedRows([...rows]);
+ }, [rows]);
+
+ useEffect(() => {
+ if (!sortOrder) return;
+ const sortRows = (columnIndex) => {
+ const newSortedRows = [...rows];
+ if (sortOrder === "custom") {
+ setSortedRows(sorting?.customSortFunction(newSortedRows,columnIndex));
+ return;
+ }
+ newSortedRows.sort((a, b) => {
+ const columnA = a[columnIndex];
+ const columnB = b[columnIndex];
+
+ // Sorting based on data type
+ if (typeof columnA === "number" && typeof columnB === "number") {
+ return sortOrder === "ascending"
+ ? columnA - columnB
+ : columnB - columnA;
+ } else if (typeof columnA === "object" && typeof columnB === "object") {
+ return sortOrder === "ascending"
+ ? columnA?.label?.localeCompare(columnB?.label)
+ : columnB?.label?.localeCompare(columnA?.label);
+ } else if (typeof columnA === "string" && typeof columnB === "string") {
+ return sortOrder === "ascending"
+ ? columnA.localeCompare(columnB)
+ : columnB.localeCompare(columnA);
+ }
+ return 0; // Default case if types don't match
+ });
+ setSortedRows(newSortedRows);
+ };
+
+ if (sortedColumnIndex !== null) {
+ sortRows(sortedColumnIndex);
+ } else {
+ const firstSortableColumnIndex = headerData?.findIndex((header) =>
+ ["serialno", "numeric", "description", "text"].includes(header.type)
+ );
+ if (firstSortableColumnIndex !== -1) {
+ sortRows(firstSortableColumnIndex);
+ }
+ }
+ }, [sortedColumnIndex, sortOrder, rows, headerData,sorting]);
+
+ const currentRows = sorting?.isTableSortable
+ ? sortedRows?.slice(indexOfFirstRow, indexOfLastRow)
+ : rows?.slice(indexOfFirstRow, indexOfLastRow);
+
+ const totalPages = Math.ceil(pagination?.totalCount || rows?.length / rowsPerPage);
+
+ const handleSort = (index) => {
+ if (sortedColumnIndex === index) {
+ setSortOrder(sortOrder === "ascending" ? "descending" : "ascending");
+ } else {
+ setSortedColumnIndex(index);
+ setSortOrder(sortOrder === "ascending" ? "descending" : "ascending");
+ }
+ setCurrentPage(1);
+ };
+
+ useLayoutEffect(() => {
+ let leftOffset = 0;
+ frozenColumnsRefsForHeaders.current.forEach((cell, index) => {
+ if (cell) {
+ requestAnimationFrame(() => {
+ cell.style.left = `${leftOffset}px`;
+ leftOffset += cell.offsetWidth;
+ });
+ }
+ });
+
+ Object.entries(frozenColumnsRefsForRows.current).forEach(
+ ([rowIndex, cells]) => {
+ let leftOffsetForBody = 0;
+ cells.forEach((cell, index) => {
+ if (cell) {
+ requestAnimationFrame(() => {
+ cell.style.left = `${leftOffsetForBody}px`;
+ leftOffsetForBody += cell.offsetWidth;
+ });
+ }
+ });
+ }
+ );
+ }, [headerData, frozenColumns, rowsPerPage, currentPage, rows]);
+
+ // Calling the callback whenever selectedRows changes
+ useEffect(() => {
+ const newselectedRowsDetails = selectedRows?.map((index) => rows[index]);
+ setSelectedRowsDetails(newselectedRowsDetails);
+ }, [selectedRows, rows]);
+
+ // Separating the fixed and scrollable headers
+ const fixedHeader = headerData?.slice(0, frozenColumns);
+ const scrollableHeader = headerData?.slice(frozenColumns);
+
+ const hasDescription = headerData?.some((header) => header.description);
+
+ const renderTable = () => {
+ return (
+
+
+
+ {/* Dynamic Table Header */}
+
+
+ {selection?.addCheckbox && (
+
+ 0 &&
+ selectedRows.length !== rows?.length
+ }
+ mainClassName={"table-checkbox"}
+ />
+
+ )}
+ {fixedHeader?.map((header, index) => (
+ {
+ frozenColumnsRefsForHeaders.current[index] = el;
+ }}
+ style={styles?.extraStyles?.headerStyles}
+ >
+
+
+ {StringManipulator(
+ "TOSENTENCECASE",
+ StringManipulator(
+ "TRUNCATESTRING",
+ t(header?.label),
+ {
+ maxLength: header?.maxLength || 64,
+ }
+ )
+ )}
+ {(header.type === "serialno" ||
+ header.type === "numeric" ||
+ header.type === "description" ||
+ header.type === "text") &&
+ sorting?.isTableSortable && (
+ handleSort(index)}
+ >
+ {sortedColumnIndex === index ? (
+ sortOrder === "ascending" ? (
+
+ ) : (
+
+ )
+ ) : sortOrder === "ascending" ? (
+
+ ) : (
+
+ )}
+
+ )}
+
+ {header.description && (
+
+ {StringManipulator(
+ "TOSENTENCECASE",
+ StringManipulator(
+ "TRUNCATESTRING",
+ t(header?.description),
+ {
+ maxLength: header?.maxLength || 64,
+ }
+ )
+ )}
+
+ )}
+
+
+ ))}
+ {scrollableHeader?.map((header, index) => (
+
+
+
+ {StringManipulator(
+ "TOSENTENCECASE",
+ StringManipulator(
+ "TRUNCATESTRING",
+ t(header?.label),
+ {
+ maxLength: header?.maxLength || 64,
+ }
+ )
+ )}
+ {(header.type === "serialno" ||
+ header.type === "numeric" ||
+ header.type === "description" ||
+ header.type === "text") &&
+ sorting?.isTableSortable && (
+ handleSort(index)}
+ >
+ {sortedColumnIndex === index ? (
+ sortOrder === "ascending" ? (
+
+ ) : (
+
+ )
+ ) : sortOrder === "ascending" ? (
+
+ ) : (
+
+ )}
+
+ )}
+
+ {header.description && (
+
+ {StringManipulator(
+ "TOSENTENCECASE",
+ StringManipulator(
+ "TRUNCATESTRING",
+ t(header?.description),
+ {
+ maxLength: header?.maxLength || 64,
+ }
+ )
+ )}
+
+ )}
+
+
+ ))}
+
+
+
+ {/* Dynamic Table Body with Pagination */}
+
+ {currentRows?.map((row, rowIndex) => (
+
+ {
+ if (row?.[headerData?.length]?.nestedData)
+ toggleRowExpansion(rowIndex);
+ if (onRowClick) onRowClick(row, rowIndex);
+ }}
+ >
+ {selection?.addCheckbox && (
+
+ onSelectRow(rowIndex + indexOfFirstRow)
+ }
+ hideLabel={true}
+ mainClassName={"table-checkbox"}
+ />
+ }
+ style={styles?.extraStyles?.bodyStyles}
+ >
+ )}
+ {row?.slice(0, frozenColumns)?.map((cell, cellIndex) => (
+ 0
+ ? headerData[cellIndex]?.type
+ : "custom"
+ }
+ accessor={
+ headerData && headerData.length > 0
+ ? headerData[cellIndex]?.accessor
+ : null
+ }
+ cellref={(el) => {
+ if (!frozenColumnsRefsForRows.current[rowIndex]) {
+ frozenColumnsRefsForRows.current[rowIndex] = [];
+ }
+ frozenColumnsRefsForRows.current[rowIndex][
+ cellIndex
+ ] = el;
+ }}
+ style={styles?.extraStyles?.bodyStyles}
+ updateTableData={updateTableData}
+ tableData={tableData}
+ rowIndex={rowIndex}
+ cellIndex={cellIndex}
+ >
+ ))}
+ {row
+ ?.slice(frozenColumns, headerData.length)
+ ?.map((cell, cellIndex) => (
+ 0
+ ? headerData[cellIndex + frozenColumns]?.accessor
+ : null
+ }
+ updateTableData={updateTableData}
+ tableData={tableData}
+ rowIndex={rowIndex}
+ cellIndex={cellIndex}
+ >
+ ))}
+
+ {expandedRows.includes(rowIndex) && (
+
+
+ }
+ >
+
+ )}
+
+ ))}
+
+ {/* Dynamic Table Footer with Pagination */}
+
+
+ {!footerProps?.hideFooter && (
+
+ {footerProps?.addStickyFooter && footerProps?.stickyFooterContent && (
+
+
+ {footerProps?.stickyFooterContent}
+
+
+ )}
+
+
+
+ {footerProps?.footerContent}
+
+
+
+ {t("CS_COMMON_ROWS_PER_PAGE")}
+ {":"}{" "}
+
+
+ {pagination?.rowsPerPageOptions.map((option) => (
+
+ {option}
+
+ ))}
+
+
+
+
+ {indexOfFirstRow + 1}-
+ {Math.min(indexOfLastRow, pagination?.totalCount || rows?.length)} of{" "}
+ {pagination?.totalCount || rows?.length}
+
+
+
+ pagination?.onPrevPage() : () => handlePageChange(currentPage - 1)}
+ disabled={currentPage === 1}
+ >
+
+
+ pagination?.onNextPage() : () => handlePageChange(currentPage + 1)}
+ disabled={currentPage === totalPages}
+ >
+
+
+
+
+
+
+
+
+ )}
+
+ );
+ };
+
+ // Table Card
+ return tableDetails?.tableTitle ||
+ tableDetails?.tableDescription ||
+ selection?.showSelectedState ||
+ addFilter ? (
+
+ {(tableDetails?.tableDescription ||
+ tableDetails?.tableTitle ||
+ addFilter) && (
+
+
+ {tableDetails?.tableTitle && (
+
{t(tableDetails?.tableTitle)}
+ )}
+ {addFilter && (
+
+ )}
+
+ {tableDetails?.tableDescription && (
+
+ {t(tableDetails?.tableDescription)}
+
+ )}
+
+ )}
+ {selection?.showSelectedState && selectedRows.length > 0 && (
+
+
+
+
{`${selectedRows.length} ${t(
+ "ROWS_SELECTED"
+ )}`}
+
+ {actions && actions.length > 0 ? (
+ actions
+ ) : (
+
+ selection?.onSelectedRowsChange(selectedRowsDetails)
+ }
+ size={"large"}
+ />
+ )}
+
+ )}
+ {renderTable()}
+
+ ) : (
+ renderTable()
+ );
+};
+
+TableMolecule.propTypes = {
+ headerData: PropTypes.array.isRequired,
+ rows: PropTypes.array.isRequired,
+ pagination: PropTypes.shape({
+ initialRowsPerPage: PropTypes.number,
+ rowsPerPageOptions: PropTypes.arrayOf(PropTypes.number),
+ manualPagination: PropTypes.bool,
+ onPageSizeChange : PropTypes.func,
+ onNextPage : PropTypes.func,
+ onPrevPage : PropTypes.func ,
+ totalCount: PropTypes.number,
+ }),
+ styles: PropTypes.shape({
+ withBorder: PropTypes.bool,
+ withAlternateBg: PropTypes.bool,
+ withHeaderDivider: PropTypes.bool,
+ withColumnDivider: PropTypes.bool,
+ withRowDivider: PropTypes.bool,
+ extraStyles: PropTypes.object,
+ }),
+ tableDetails: PropTypes.shape({
+ tableTitle: PropTypes.string,
+ tableDescription: PropTypes.string,
+ }),
+ sorting: PropTypes.shape({
+ isTableSortable: PropTypes.bool,
+ initialSortOrder: PropTypes.string,
+ }),
+ selection: PropTypes.shape({
+ addCheckbox: PropTypes.bool,
+ checkboxLabel: PropTypes.string,
+ initialSelectedRows: PropTypes.array,
+ onSelectedRowsChange: PropTypes.func,
+ showSelectedState: PropTypes.bool,
+ }),
+ footerProps: PropTypes.shape({
+ stickyFooterContent: PropTypes.node,
+ footerContent: PropTypes.node,
+ hideFooter: PropTypes.bool,
+ scrollableStickyFooterContent: PropTypes.bool,
+ isStickyFooter: PropTypes.bool,
+ addStickyFooter: PropTypes.bool,
+ }),
+};
+
+TableMolecule.defaultProps = {
+ pagination: {
+ initialRowsPerPage: 5,
+ rowsPerPageOptions: [5, 10, 15, 20],
+ manualPagination:false,
+ onPageSizeChange: () => {},
+ onNextPage: () => {},
+ onPrevPage: () => {},
+ totalCount:undefined
+ },
+ styles: {
+ withBorder: false,
+ withAlternateBg: false,
+ withHeaderDivider: true,
+ withColumnDivider: false,
+ withRowDivider: true,
+ extraStyles: {},
+ },
+ tableDetails: {
+ tableTitle: "",
+ tableDescription: "",
+ },
+ sorting: {
+ isTableSortable: true,
+ initialSortOrder: "ascending",
+ },
+ selection: {
+ addCheckbox: false,
+ checkboxLabel: "",
+ initialSelectedRows: [],
+ onSelectedRowsChange: () => {},
+ showSelectedState: false,
+ },
+ footerProps: {
+ footerContent: null,
+ hideFooter: false,
+ stickyFooterContent: null,
+ scrollableStickyFooterContent: true,
+ isStickyFooter: false,
+ addStickyFooter: false,
+ },
+ actions: [],
+};
+
+export default TableMolecule;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/TextInputCard.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/TextInputCard.js
new file mode 100644
index 00000000..66b30b68
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/TextInputCard.js
@@ -0,0 +1,56 @@
+import React from "react";
+import { useTranslation } from "react-i18next";
+import PropTypes from "prop-types";
+import Card from "../atoms/Card";
+import CardHeader from "../atoms/CardHeader";
+import CardText from "../atoms/CardText";
+import Button from "../atoms/Button";
+import CardLabel from "../atoms/CardLabel";
+import TextInput from "../atoms/TextInput";
+import ActionLinks from "../atoms/ActionLinks";
+
+const TextInputCard = ({ header, subHeader, cardText, cardLabel, nextText, skipAndContinueText, skip, onSave, onSkip, textInput }) => {
+ return (
+
+ {subHeader}
+ {header}
+
+ {/* If you know the pincode of the complaint address, provide below. It will
+ help us identify complaint location easily or you can skip and continue */}
+ {cardText}
+
+ {cardLabel}
+
+
+ {skip ? : null}
+
+ );
+};
+
+TextInputCard.propTypes = {
+ header: PropTypes.string,
+ subHeader: PropTypes.string,
+ cardText: PropTypes.string,
+ cardLabel: PropTypes.string,
+ nextText: PropTypes.string,
+ skipAndContinueText: PropTypes.string,
+ skip: PropTypes.bool,
+ onSave: PropTypes.func,
+ onSkip: PropTypes.func,
+ textInput: PropTypes.string,
+};
+
+TextInputCard.defaultProps = {
+ header: "",
+ subHeader: "",
+ cardText: "",
+ cardLabel: "",
+ nextText: "",
+ skipAndContinueText: "",
+ skip: true,
+ onSave: undefined,
+ onSkip: undefined,
+ textInput: "",
+};
+
+export default TextInputCard;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/TimelineMolecule.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/TimelineMolecule.js
new file mode 100644
index 00000000..3c6f7a63
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/TimelineMolecule.js
@@ -0,0 +1,155 @@
+import React, { Children, useState, useMemo } from "react";
+import { Timeline, Button, StringManipulator } from "../atoms";
+
+const sortTimelines = (children) => {
+ const variantsOrder = {
+ upcoming: 1,
+ inprogress: 2,
+ completed: 3,
+ };
+
+ return Children.toArray(children).sort((a, b) => {
+ const variantA = variantsOrder[a.props.variant] || 4;
+ const variantB = variantsOrder[b.props.variant] || 4;
+ return variantA - variantB;
+ });
+};
+
+const TimelineMolecule = ({
+ children,
+ initialVisibleCount,
+ viewLessLabelForFuture,
+ viewMoreLabelForFuture,
+ viewLessLabelForPast,
+ viewMoreLabelForPast,
+ pastIcon,
+ FutureIcon,
+ hideFutureLabel,
+ hidePastLabel
+}) => {
+ const sortedChildren = useMemo(() => sortTimelines(children), [children]);
+
+ const [isPastExpanded, setIsPastExpanded] = useState(false);
+ const [isFutureExpanded, setIsFutureExpanded] = useState(false);
+ let currentActiveStep = -1;
+ let totalPastSteps = 0;
+ let totalFutureSteps = 0;
+
+ sortedChildren.forEach((child, index) => {
+ if (child.props.variant === "inprogress") {
+ currentActiveStep = index;
+ }
+ if (child.props.variant === "completed") {
+ totalPastSteps = totalPastSteps +1 ;
+ }
+ if (child.props.variant === "upcoming") {
+ totalFutureSteps = totalFutureSteps +1 ;
+ }
+ });
+
+ let nextActiveStep = -1;
+ let nextStep;
+ sortedChildren.forEach((child, index) => {
+ if (child.props.variant === "upcoming" && index+1 === currentActiveStep) {
+ nextActiveStep = index;
+ nextStep = child;
+ }
+ });
+
+ const toggleViewMoreFutureItems = () => {
+ setIsFutureExpanded(!isFutureExpanded);
+ };
+
+ const toggleViewMorePastItems = () => {
+ setIsPastExpanded(!isPastExpanded);
+ };
+
+ let visibleChildren = sortedChildren;
+
+ if (initialVisibleCount) {
+ visibleChildren = [];
+
+ if (currentActiveStep !== -1) {
+ visibleChildren.push(sortedChildren[currentActiveStep]);
+ if (currentActiveStep > 0) {
+ visibleChildren.unshift(sortedChildren[currentActiveStep - 1]);
+ }
+ }
+
+ const remainingPastCount = Math.max(0, initialVisibleCount - visibleChildren.length);
+ const pastSteps = sortedChildren.slice(currentActiveStep + 1);
+ visibleChildren.push(...pastSteps.slice(0, remainingPastCount));
+ }
+
+ if (isFutureExpanded) {
+ visibleChildren.unshift(...sortedChildren.slice(0, currentActiveStep - 1));
+ }
+
+
+ if (isPastExpanded) {
+ const pastStepsToAdd = sortedChildren.slice(currentActiveStep + 1);
+ visibleChildren.push(...pastStepsToAdd.filter((step) => !visibleChildren.includes(step)));
+ }
+
+
+ const
+ hasFutureSteps = currentActiveStep > 0;
+
+ return (
+
+ {initialVisibleCount && hasFutureSteps && !hideFutureLabel && (
+
+
+
+ )}
+ {Children.map(visibleChildren, (child, index) => (
+
+ ))}
+ {initialVisibleCount && !hidePastLabel && (
+
+
+
+ )}
+
+ );
+};
+
+export default TimelineMolecule;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/TooltipWrapper.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/TooltipWrapper.js
new file mode 100644
index 00000000..2d2ae38b
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/TooltipWrapper.js
@@ -0,0 +1,174 @@
+import React, { useState, useRef, useEffect } from "react";
+import PropTypes from "prop-types";
+import Tooltip from "../atoms/Tooltip";
+
+const TooltipWrapper = ({
+ children,
+ arrow = false,
+ content,
+ placement = "bottom",
+ enterDelay = 100,
+ leaveDelay = 0,
+ followCursor = false,
+ open: openProp,
+ disableFocusListener = false,
+ disableHoverListener = false,
+ disableInteractive = false,
+ disableTouchListener = false,
+ onOpen,
+ onClose,
+ style,
+ wrapperClassName,
+ ClassName,
+ header,
+ description,
+ theme,
+ ...props
+}) => {
+ const [open, setOpen] = useState(openProp || false);
+ const [tooltipStyle, setTooltipStyle] = useState({});
+ const timeout = useRef(null);
+ const tooltipRef = useRef(null);
+
+ const showTooltip = () => {
+ clearTimeout(timeout.current);
+ timeout.current = setTimeout(() => {
+ setOpen(true);
+ if (onOpen) onOpen();
+ }, enterDelay);
+ };
+
+ const hideTooltip = () => {
+ clearTimeout(timeout.current);
+ timeout.current = setTimeout(() => {
+ setOpen(false);
+ if (onClose) onClose();
+ }, leaveDelay);
+ };
+
+ const handleMouseEnter = (event) => {
+ if (!disableHoverListener) {
+ showTooltip();
+ if (followCursor) {
+ setTooltipStyle({
+ top: event.clientY,
+ left: event.clientX,
+ });
+ }
+ }
+ };
+
+ const handleMouseLeave = () => {
+ if (!disableHoverListener) {
+ hideTooltip();
+ }
+ };
+
+ const handleFocus = () => {
+ if (!disableFocusListener) {
+ showTooltip();
+ }
+ };
+
+ const handleBlur = () => {
+ if (!disableFocusListener) {
+ hideTooltip();
+ }
+ };
+
+ const handleTouchStart = () => {
+ if (!disableTouchListener) {
+ showTooltip();
+ }
+ };
+
+ const handleTouchEnd = () => {
+ if (!disableTouchListener) {
+ hideTooltip();
+ }
+ };
+
+ useEffect(() => {
+ if (followCursor) {
+ const handleMouseMove = (event) => {
+ setTooltipStyle({
+ top: event.clientY,
+ left: event.clientX,
+ });
+ };
+ document.addEventListener("mousemove", handleMouseMove);
+ return () => {
+ document.removeEventListener("mousemove", handleMouseMove);
+ };
+ }
+ }, [followCursor]);
+
+ useEffect(() => {
+ setOpen(openProp);
+ }, [openProp]);
+
+ return (
+
+ {children}
+ {open && (
+
+ )}
+
+ );
+};
+
+TooltipWrapper.propTypes = {
+ children: PropTypes.element.isRequired,
+ arrow: PropTypes.bool,
+ title: PropTypes.node.isRequired,
+ placement: PropTypes.oneOf([
+ "bottom",
+ "bottom-end",
+ "bottom-start",
+ "left",
+ "right",
+ "top",
+ "top-end",
+ "top-start",
+ "left-end",
+ "left-start",
+ "right-end",
+ "right-start",
+ ]),
+ enterDelay: PropTypes.number,
+ leaveDelay: PropTypes.number,
+ followCursor: PropTypes.bool,
+ open: PropTypes.bool,
+ disableFocusListener: PropTypes.bool,
+ disableHoverListener: PropTypes.bool,
+ disableInteractive: PropTypes.bool,
+ disableTouchListener: PropTypes.bool,
+ onOpen: PropTypes.func,
+ style: PropTypes.object,
+ onClose: PropTypes.func,
+};
+
+TooltipWrapper.defaultProps = {
+ arrow: true,
+};
+
+export default TooltipWrapper;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/WorkflowStatusFilter.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/WorkflowStatusFilter.js
new file mode 100644
index 00000000..aba4898b
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/WorkflowStatusFilter.js
@@ -0,0 +1,65 @@
+import React, { Fragment,useEffect,useState } from "react";
+import CheckBox from "../atoms/CheckBox";
+import { Loader } from "../atoms";
+import CardLabel from "../atoms/CardLabel";
+
+const WorkflowStatusFilter = ({ props, t, populators, formData,inboxResponse,disabled }) => {
+ //from inbox response get the statusMap and show the relevant statuses
+ //here need to filter these options based on logged in user(and test based on single roles in every inbox)(new requirement from vasanth)
+
+
+ const [statusMap,setStatusMap] = useState(null)
+
+ useEffect(() => {
+ if(inboxResponse) {
+ setStatusMap(inboxResponse.statusMap?.map(row => {
+ return {
+ uuid:row.statusid,
+ state: row.state || row.applicationstatus,
+ businessService:row?.businessservice
+ }
+ }))
+ }
+ }, [inboxResponse])
+
+
+ if (!statusMap && !inboxResponse) return ;
+
+ return (
+ <>
+ {statusMap && statusMap.length > 0 && populators?.componentLabel && (
+
+ {t(populators?.componentLabel)}
+ {populators?.isMandatory ? " * " : null}
+
+ )}
+ {statusMap?.map((row) => {
+ return (
+ {
+ const obj = {
+ ...props.value,
+ [e.target.value]: e.target.checked,
+ };
+ props.onChange(obj);
+ }}
+ value={row.uuid}
+ checked={formData?.[populators.name]?.[row.uuid]}
+ label={t(
+ Digit.Utils.locale.getTransformedLocale(
+ `${populators.labelPrefix}${row?.businessService}_STATE_${row?.state}`
+ )
+ )}
+ isIntermediate={populators?.isIntermediate}
+ styles={populators?.styles}
+ style={populators?.labelStyles}
+ disabled={disabled}
+ isLabelFirst={populators?.isLabelFirst}
+ />
+ );
+ })}
+ >
+ );
+};
+
+export default WorkflowStatusFilter;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/index.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/index.js
new file mode 100644
index 00000000..2faa7db3
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/index.js
@@ -0,0 +1,65 @@
+import ApiDropdown from "./ApiDropdown";
+import CustomDropdown from "./CustomDropdown";
+import DetailsCard from "./DetailsCard";
+import FormStep from "./FormStep";
+import InputCard from "./InputCard";
+import LocationDropdownWrapper from "./LocationDropdownWrapper";
+import MultiUploadWrapper from "./MultiUploadWrapper";
+import SearchAction from "./SearchAction";
+import { SearchForm } from "./SearchForm";
+import { SearchField } from "./SearchForm";
+import SearchOnRadioButtons from "./SearchOnRadioButtons";
+import TextInputCard from "./TextInputCard";
+import FilterAction from "./FilterAction";
+import RenderFormFields from "./RenderFormFields";
+import DateRangeNew from "./DateRangeNew";
+import WorkflowStatusFilter from "./WorkflowStatusFilter";
+import PanelCard from "./PanelCard";
+import TimelineMolecule from "./TimelineMolecule";
+import TooltipWrapper from "./TooltipWrapper";
+import LandingPageCard from "./LandingPageCard";
+import LandingPageWrapper from "./LandingPageWrapper";
+import MenuCard from "./MenuCard";
+import MenuCardWrapper from "./MenuCardWrapper";
+import TableMolecule from "./TableMolecule";
+import MetricCard from "./MetricCard";
+import FormCard from "./FormCard";
+import FilterCard from "./FilterCard";
+import SummaryCard from "./SummaryCard";
+import BottomSheet from "./BottomSheet";
+import SortAction from "./SortAction";
+import ResultsDataTable from "./ResultsDataTable";
+
+export {
+ ApiDropdown,
+ CustomDropdown,
+ BottomSheet,
+ DetailsCard,
+ FormStep,
+ InputCard,
+ LocationDropdownWrapper,
+ MultiUploadWrapper,
+ SearchAction,
+ SortAction,
+ ResultsDataTable,
+ SearchForm,
+ SearchField,
+ SearchOnRadioButtons,
+ TextInputCard,
+ FilterAction,
+ RenderFormFields,
+ DateRangeNew,
+ WorkflowStatusFilter,
+ PanelCard,
+ TimelineMolecule,
+ TooltipWrapper,
+ LandingPageCard,
+ MenuCard,
+ LandingPageWrapper,
+ MenuCardWrapper,
+ TableMolecule,
+ MetricCard,
+ FormCard,
+ FilterCard,
+ SummaryCard
+};
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/AccordionList.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/AccordionList.stories.js
new file mode 100644
index 00000000..dc671a0f
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/AccordionList.stories.js
@@ -0,0 +1,91 @@
+import React from "react";
+import { Accordion } from "../../atoms";
+import { AccordionList } from "../../atoms";
+import {Iframe} from "../../atoms";
+
+export default {
+ title: "Molecules/Accordion List",
+ component: AccordionList,
+ argTypes: {
+ allowMultipleOpen: { control: "boolean" },
+ addDivider: { control: "boolean" ,name:"With Divider"},
+ children: { table: { disable: true } },
+ customClassName: { table: { disable: true } },
+ customStyles: { table: { disable: true } },
+ styles:{table:{disable:true}}
+ },
+};
+
+const Template = (args) => ;
+
+const children = [
+ ,
+ ,
+ ,
+ ,
+];
+
+const commonArgs = {
+ allowMultipleOpen: true,
+ addDivider: false,
+};
+
+export const Documentation = () => (
+
+);
+
+Documentation.storyName = "Docs";
+Documentation.argTypes = {
+ allowMultipleOpen: { table: { disable: true } },
+ addDivider: { table: { disable: true }},
+};
+
+export const Default = Template.bind({});
+Default.args = {
+ ...commonArgs,
+ children: children,
+};
+
+export const Custom = Template.bind({});
+Custom.args = {
+ ...commonArgs,
+ children: children,
+ styles: {
+ backgroundColor: "#FFFFFF",
+ border: "1px solid #d6d5d4",
+ borderRadius: "4px",
+ padding: "24px",
+ },
+};
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/AlertPopup.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/AlertPopup.stories.js
new file mode 100644
index 00000000..6a29d6c3
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/AlertPopup.stories.js
@@ -0,0 +1,237 @@
+import React, { useState,Fragment } from "react";
+import PopUp from "../../atoms/PopUp";
+import AlertCard from "../../atoms/AlertCard";
+import Button from "../../atoms/Button";
+
+export default {
+ title: "Molecules/PopUp/Alert",
+ component: PopUp,
+ argTypes: {
+ className: {
+ control: "text",
+ table: { disable: true },
+ },
+ type: {
+ control: "select",
+ options: ["default", "alert"],
+ table: { disable: true },
+ },
+ overlayClassName: {
+ control: "text",
+ table: { disable: true },
+ },
+ onOverlayClick: {
+ control: "function",
+ table: { disable: true },
+ },
+ headerclassName: {
+ control: "text",
+ table: { disable: true },
+ },
+ footerclassName: {
+ control: "text",
+ table: { disable: true },
+ },
+ style: {
+ control: "boolean",
+ name: "Custom Width And Height",
+ },
+ children: {
+ control: "object",
+ table: { disable: true },
+ },
+ footerChildren: {
+ control: "object",
+ table: { disable: true },
+ },
+ onClose: {
+ control: "function",
+ table: { disable: true },
+ },
+ props: {
+ control: "object",
+ table: { disable: true },
+ },
+ showIcon: {
+ control: "boolean",
+ table: { disable: true },
+ },
+ heading: {
+ control: "text",
+ table: { disable: true },
+ },
+ subheading: {
+ control: "text",
+ table: { disable: true },
+ },
+ description: {
+ control: "text",
+ table: { disable: true },
+ },
+ alertHeading: {
+ control: "text",
+ name: "Heading",
+ },
+ alertMessage: {
+ control: "text",
+ name: "Subheading",
+ },
+ iconFill: {
+ control: "text",
+ table: { disable: true },
+ },
+ customIcon: {
+ control: "text",
+ table: { disable: true },
+ },
+ showChildrenInline: {
+ control: "boolean",
+ table: { disable: true },
+ },
+ headerMaxLength: {
+ control: "text",
+ table: { disable: true },
+ },
+ subHeaderMaxLength: {
+ control: "text",
+ table: { disable: true },
+ },
+ sortFooterButtons: {
+ control: "boolean",
+ table: { disable: true },
+ },
+ maxFooterButtonsAllowed: {
+ control: "text",
+ table: { disable: true },
+ },
+ footerStyles: {
+ control: "object",
+ table: { disable: true },
+ },
+ showAlertAsSvg: {
+ control: "boolean",
+ table: { disable: true },
+ },
+ equalWidthButtons: {
+ control: "boolean",
+ table: { disable: true },
+ },
+ headerChildren: { table: { disable: true } },
+ Actions: { control: "boolean" },
+ },
+};
+
+const footerChildrenWithTwoButtons = [
+ console.log("Clicked Button 1")}
+ />,
+ console.log("Clicked Button 2")}
+ />,
+];
+const lessChildren = [
+ This is the content of the Popup
,
+ ,
+];
+
+const moreChildren = [
+ This is the content of the Popup
,
+ ,
+ ,
+ ,
+ ,
+ ,
+ ,
+ ,
+ ,
+ ,
+];
+
+const Template = (args) => {
+ const { Actions, style, ...rest } = args;
+ const [showPopup, setShowPopup] = useState(false);
+
+ const onClose = () => {
+ setShowPopup(false);
+ };
+
+ const onOverlayClick = () => {
+ setShowPopup(false);
+ };
+
+ const commonStyles = {
+ position: "absolute",
+ top: "50%",
+ left: "50%",
+ color: "#363636",
+ display: "flex",
+ alignItems: "center",
+ justifyContent: "center",
+ transform: "translate(-50%, -50%)",
+ };
+
+ return (
+ <>
+
+ {
+ setShowPopup(true)}
+ />
+ }
+
+ {showPopup && (
+
+ )}
+ >
+ );
+};
+
+const commonArgs = {
+ type: "alert",
+ className: "",
+ overlayClassName: "",
+ headerclassName: "",
+ footerclassName: "",
+ style: false,
+ props: {},
+ showIcon: true,
+ heading: "",
+ subheading: "",
+ description: "",
+ alertHeading: "Alert!",
+ alertMessage:
+ "Please contact the administrator if you have forgotten your password.",
+ iconFill: "",
+ customIcon: "",
+ showChildrenInline: false,
+ headerMaxLength: "",
+ subHeaderMaxLength: "",
+ sortFooterButtons: true,
+ maxFooterButtonsAllowed: 5,
+ footerStyles: {},
+ showAlertAsSvg: false,
+ equalWidthButtons: false,
+ Actions: true,
+};
+
+export const Alert = Template.bind({});
+Alert.args = {
+ ...commonArgs,
+};
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/BasicCard.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/BasicCard.stories.js
new file mode 100644
index 00000000..c3aa7500
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/BasicCard.stories.js
@@ -0,0 +1,115 @@
+import React from "react";
+import AlertCard from "../../atoms/AlertCard";
+import Button from "../../atoms/Button";
+import TextArea from "../../atoms/TextArea";
+import MultiSelectDropdown from "../../atoms/MultiSelectDropdown";
+import Dropdown from "../../atoms/Dropdown";
+import { Card } from "../../atoms";
+
+export default {
+ title: "Molecules/Card/Basic",
+ component: Card,
+ argTypes: {
+ className: {
+ control: "text",table:{disable:true}
+ },
+ style: {
+ control: { type: "object" },table:{disable:true}
+ },
+ children: {
+ control: "object",table:{disable:true}
+ },
+ type: { control: "select", mapping:{"Primary":"primary","Secondary":"secondary"} ,options: ["Primary", "Secondary"],name:"Card Style" },
+ variant: {
+ control: "select",
+ options: [
+ "empty",
+ "form",
+ "viewform",
+ "filter1",
+ "filter2",
+ "menu",
+ "kpi",
+ "action",
+ "search",
+ ],
+ table:{disable:true}
+ },
+ onClick: {
+ control: "function",table:{disable:true}
+ },
+ props: {
+ control: "object",table:{disable:true}
+ },
+ },
+};
+// Mock options data
+const options = [
+ { code: "MALE", name: "MALE" },
+ { code: "FEMALE", name: "FEMALE" },
+ { code: "TRANSGENDER", name: "TRANSGENDER" },
+];
+
+const Template = (args) => (
+
+
+ {
+ console.log(value, "value");
+ }}
+ addSelectAllCheck={true}
+ selected={options}
+ />
+ {
+ console.log(value);
+ }}
+ />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+);
+
+export const Basic = Template.bind({});
+Basic.args = {
+ type: "Primary",
+};
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/BasicPopup.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/BasicPopup.stories.js
new file mode 100644
index 00000000..10af12d1
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/BasicPopup.stories.js
@@ -0,0 +1,239 @@
+import React, { useState ,Fragment} from "react";
+import PopUp from "../../atoms/PopUp";
+import AlertCard from "../../atoms/AlertCard";
+import Button from "../../atoms/Button";
+
+export default {
+ title: "Molecules/PopUp/Basic",
+ component: PopUp,
+ argTypes: {
+ className: {
+ control: "text",
+ table: { disable: true },
+ },
+ type: {
+ control: "select",
+ options: ["default", "alert"],
+ table: { disable: true },
+ },
+ overlayClassName: {
+ control: "text",
+ table: { disable: true },
+ },
+ onOverlayClick: {
+ control: "function",
+ table: { disable: true },
+ },
+ headerclassName: {
+ control: "text",
+ table: { disable: true },
+ },
+ footerclassName: {
+ control: "text",
+ table: { disable: true },
+ },
+ style: {
+ control: "boolean",
+ name: "Custom Width And Height",
+ },
+ children: {
+ control: "object",
+ table: { disable: true },
+ },
+ footerChildren: {
+ control: "object",
+ table: { disable: true },
+ },
+ onClose: {
+ control: "function",
+ table: { disable: true },
+ },
+ props: {
+ control: "object",
+ table: { disable: true },
+ },
+ showIcon: {
+ control: "boolean",
+ name: "Icon For Heading",
+ },
+ heading: {
+ control: "text",
+ name: "Heading",
+ },
+ subheading: {
+ control: "text",
+ name: "Subheading",
+ },
+ description: {
+ control: "text",
+ name: "Description",
+ },
+ alertHeading: {
+ control: "text",
+ table: { disable: true },
+ },
+ alertMessage: {
+ control: "text",
+ table: { disable: true },
+ },
+ iconFill: {
+ control: "text",
+ table: { disable: true },
+ },
+ customIcon: {
+ control: "text",
+ table: { disable: true },
+ },
+ showChildrenInline: {
+ control: "boolean",
+ table: { disable: true },
+ },
+ headerMaxLength: {
+ control: "text",
+ table: { disable: true },
+ },
+ subHeaderMaxLength: {
+ control: "text",
+ table: { disable: true },
+ },
+ sortFooterButtons: {
+ control: "boolean",
+ table: { disable: true },
+ },
+ maxFooterButtonsAllowed: {
+ control: "text",
+ table: { disable: true },
+ },
+ footerStyles: {
+ control: "object",
+ table: { disable: true },
+ },
+ showAlertAsSvg: {
+ control: "boolean",
+ table: { disable: true },
+ },
+ equalWidthButtons: {
+ control: "boolean",
+ table: { disable: true },
+ },
+ headerChildren: { table: { disable: true } },
+ Actions: { control: "boolean" },
+ },
+};
+
+const commonArgs = {
+ type: "default",
+ heading: "Heading",
+ subheading: "Subheading",
+ description:
+ "Please contact the administrator if you have forgotten your password.",
+ className: "",
+ overlayClassName: "",
+ headerclassName: "cdhvchdvchd",
+ footerclassName: "",
+ style: false,
+ props: {},
+ showIcon: false,
+ alertHeading: "",
+ alertMessage: "",
+ iconFill: "",
+ customIcon: "",
+ showChildrenInline: false,
+ headerMaxLength: "",
+ subHeaderMaxLength: "",
+ sortFooterButtons: true,
+ maxFooterButtonsAllowed: 5,
+ footerStyles: {},
+ showAlertAsSvg: false,
+ equalWidthButtons: false,
+ Actions: true,
+};
+
+const footerChildrenWithTwoButtons = [
+ console.log("Clicked Button 1")}
+ />,
+ console.log("Clicked Button 2")}
+ />,
+];
+
+const lessChildren = [
+ This is the content of the Popup
,
+ ,
+];
+
+const moreChildren = [
+ This is the content of the Popup
,
+ ,
+ ,
+ ,
+ ,
+ ,
+ ,
+ ,
+ ,
+ ,
+];
+
+const Template = (args) => {
+ const { Actions, style, ...rest } = args;
+ const [showPopup, setShowPopup] = useState(false);
+
+ const onClose = () => {
+ setShowPopup(false);
+ };
+
+ const onOverlayClick = () => {
+ setShowPopup(false);
+ };
+
+ const commonStyles = {
+ position: "absolute",
+ top: "50%",
+ left: "50%",
+ color: "#363636",
+ display: "flex",
+ alignItems: "center",
+ justifyContent: "center",
+ transform: "translate(-50%, -50%)",
+ };
+
+ return (
+ <>
+
+ {
+ setShowPopup(true)}
+ />
+ }
+
+ {showPopup && (
+
+ )}
+ >
+ );
+};
+
+export const Basic = Template.bind({});
+Basic.args = {
+ ...commonArgs,
+ children: lessChildren,
+};
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/BottomSheet.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/BottomSheet.stories.js
new file mode 100644
index 00000000..2437f56a
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/BottomSheet.stories.js
@@ -0,0 +1,108 @@
+import React from "react";
+import BottomSheet from "../BottomSheet";
+import { Button } from "../../atoms";
+import { IMAGES } from "../../constants/images/images";
+import { Iframe } from "../../atoms";
+
+export default {
+ title: "Molecules/Bottom Sheet",
+ component: BottomSheet,
+ argTypes: {
+ initialState: {
+ control: "select",
+ options: ["closed", "fixed", "quarter", "intermediate", "full"],
+ table: { disable: true },
+ },
+ enableActions: {
+ control: "boolean",
+ table: { disable: true },
+ },
+ equalWidthButtons: {
+ control: "boolean",
+ table: { disable: true },
+ },
+ className: {
+ control: "text",
+ table: { disable: true },
+ },
+ style: {
+ control: { type: "object" },
+ table: { disable: true },
+ },
+ children: { table: { disable: true } },
+ actions: { table: { disable: true } },
+ },
+};
+
+const Template = (args) => {
+ return {args.children} ;
+};
+
+const commonArgs = {
+ initialState: "closed",
+ enableActions: false,
+ className: "",
+ style: {},
+ equalWidthButtons: false,
+};
+
+const getImageUrl = (imageKey) => {
+ return IMAGES[imageKey];
+};
+
+const digitImg = getImageUrl("DIGIT_LIGHT");
+
+const additionalElements = [
+
+ BottomSheet
+
,
+
+ Lorem Ipsum is simply dummy text of the printing and typesetting industry.
+ Lorem Ipsum has been the industry's standard dummy text ever since the
+ 1500s, when an unknown printer took a galley of type and scrambled it to
+ make a type specimen book. It has survived not only five centuries, but also
+ the leap into electronic typesetting, remaining essentially unchanged.
+
,
+ ,
+];
+
+const actions = [
+ ,
+];
+
+export const Documentation = () => (
+
+);
+
+Documentation.storyName = "Docs";
+
+export const Basic = Template.bind({});
+Basic.args = {
+ ...commonArgs,
+ children: additionalElements,
+};
+
+export const WithActions = Template.bind({});
+WithActions.args = {
+ ...commonArgs,
+ enableActions: true,
+ actions: actions,
+};
+
+export const Custom = Template.bind({});
+Custom.args = {
+ ...commonArgs,
+ enableActions: true,
+ actions: actions,
+ equalWidthButtons: true,
+};
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/ButtonGroup.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/ButtonGroup.stories.js
new file mode 100644
index 00000000..65103b82
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/ButtonGroup.stories.js
@@ -0,0 +1,137 @@
+import React from "react";
+import { Button } from "../../atoms";
+import { ButtonGroup } from "../../atoms";
+import { Iframe } from "../../atoms";
+
+export default {
+ title: "Molecules/Button Group",
+ component: ButtonGroup,
+ argTypes: {
+ size: {
+ control: "select",
+ options: ["large", "medium", "small"],
+ },
+ buttonsArray: { table: { disable: true } },
+ sortButtons: {
+ control: "boolean",
+ name: "Auto Sort",
+ },
+ equalButtons: {
+ control: "boolean",
+ name: "Equal Buttons",
+ },
+ },
+};
+
+const commonArgs = {
+ sortButtons:false,
+ size:"large",
+ equalButtons:true
+}
+
+const largebuttons = [
+ console.log("Clicked Button 1")}
+ />,
+ console.log("Clicked Button 1")}
+ />,
+ console.log("Clicked Button 2")}
+ />,
+];
+
+const mediumbuttons = [
+ console.log("Clicked Button 1")}
+ />,
+ console.log("Clicked Button 1")}
+ />,
+ console.log("Clicked Button 2")}
+ />,
+];
+const smallbuttons = [
+ console.log("Clicked Button 1")}
+ />,
+ console.log("Clicked Button 1")}
+ />,
+ console.log("Clicked Button 2")}
+ />,
+];
+
+const Template = (args) => {
+ const { size, ...rest } = args;
+ return (
+
+ );
+};
+
+export const Documentation = () => (
+
+);
+
+Documentation.storyName = "Docs";
+Documentation.argTypes = {
+ size: { table: { disable: true } },
+ sortButtons: { table: { disable: true }},
+ equalButtons: { table: { disable: true }},
+};
+
+export const Basic = Template.bind({});
+Basic.args = {
+ ...commonArgs
+};
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/CardDocs.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/CardDocs.stories.js
new file mode 100644
index 00000000..d8351611
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/CardDocs.stories.js
@@ -0,0 +1,27 @@
+import React from "react";
+import { Card } from "../../atoms";
+import {Iframe} from "../../atoms";
+
+export default {
+ title: "Molecules/Card",
+ component: Card,
+ argTypes: {},
+};
+
+export const Documentation = () => (
+
+ );
+
+ Documentation.storyName = "Docs";
+ Documentation.argTypes = {
+ type: { table: { disable: true } },
+ variant: { table: { disable: true } },
+ onClick: { table: { disable: true } },
+ style: { table: { disable: true } },
+ className: { table: { disable: true } },
+ children: { table: { disable: true } },
+ };
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/DarkThemeHeader.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/DarkThemeHeader.stories.js
new file mode 100644
index 00000000..c15d266e
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/DarkThemeHeader.stories.js
@@ -0,0 +1,331 @@
+import React from "react";
+import { Header } from "../../atoms";
+import { SVG } from "../../atoms";
+import { Dropdown } from "../../atoms";
+
+export default {
+ title: "Molecules/Header/Dark",
+ component: Header,
+ argTypes: {
+ className: {
+ control: "text",
+ },
+ theme: {
+ control: "select",
+ options: ["light", "dark"],
+ },
+ style: {
+ control: { type: "object" },
+ },
+ onImageClick: {
+ control: "function",
+ },
+ onHamburgerClick: {
+ control: "function",
+ },
+ onLogoClick: {
+ control: "function",
+ },
+ props: {
+ control: "object",
+ },
+ setImageToLeft: {
+ control: "boolean",
+ },
+ img: {
+ control: "text",
+ },
+ logo: {
+ control: "text",
+ },
+ ulb: {
+ control: "text",
+ },
+ actionFields: {
+ control: {
+ type: "array",
+ separator: ",",
+ },
+ },
+ },
+};
+
+const darkthemefields = [
+ console.log(option, "Option selected")}
+ customSelector={"City"}
+ theme={"dark"}
+ />,
+];
+
+const DarkThemeFields = [
+ console.log(option, "Option selected")}
+ customSelector={"City"}
+ theme={"dark"}
+ />,
+ console.log(option, "Option selected")}
+ selected={{ name: "English", code: "English" }}
+ customSelector={"Language"}
+ theme={"dark"}
+ />,
+ console.log(option, "Option selected")}
+ showArrow={false}
+ profilePic={"P"}
+ theme={"dark"}
+ />,
+];
+
+const DarkThemeFieldsWithProfileAsImg = [
+ console.log(option, "Option selected")}
+ customSelector={"City"}
+ theme={"dark"}
+ />,
+ console.log(option, "Option selected")}
+ selected={{ name: "English", code: "English" }}
+ customSelector={"Language"}
+ theme={"dark"}
+ />,
+ console.log(option, "Option selected")}
+ showArrow={false}
+ profilePic={
+
+ }
+ theme={"dark"}
+ />,
+];
+
+const DarkThemeFieldsWithProfileAsSvg = [
+ console.log(option, "Option selected")}
+ customSelector={"City"}
+ theme={"dark"}
+ />,
+ console.log(option, "Option selected")}
+ selected={{ name: "English", code: "English" }}
+ customSelector={"Language"}
+ theme={"dark"}
+ />,
+ console.log(option, "Option selected")}
+ showArrow={false}
+ profilePic={ }
+ theme={"dark"}
+ />,
+];
+
+const Template = (args) => ;
+const commonArgs = {
+ img: "",
+ className: "",
+ style: {},
+ theme: "light",
+ setImageToLeft: false,
+ props: {},
+ ulb: "",
+ showDeafultImg: true,
+ logo:
+ "",
+};
+
+export const HeaderExample = Template.bind({});
+HeaderExample.args = {
+ ...commonArgs,
+ theme: "dark",
+ ulb: "Logo Placeholder",
+ language: "English",
+ onImageClick: () => {
+ console.log("image is clicked");
+ },
+ onLogoClick: () => {
+ console.log("logo is clicked");
+ },
+ onHamburgerClick: () => {
+ console.log("hamburger clicked");
+ },
+};
+HeaderExample.storyName="Header";
+
+export const HeaderWithImageOnLeft = Template.bind({});
+HeaderWithImageOnLeft.args = {
+ ...commonArgs,
+ ulb: "Logo Placeholder",
+ language: "English",
+ onImageClick: () => {
+ console.log("image is clicked");
+ },
+ onLogoClick: () => {
+ console.log("logo is clicked");
+ },
+ onHamburgerClick: () => {
+ console.log("hamburger clicked");
+ },
+ setImageToLeft: true,
+ theme: "dark",
+};
+
+export const WithActionFields = Template.bind({});
+WithActionFields.args = {
+ ...commonArgs,
+ ulb: "Logo Placeholder",
+ language: "English",
+ onImageClick: () => {
+ console.log("image is clicked");
+ },
+ onLogoClick: () => {
+ console.log("logo is clicked");
+ },
+ onHamburgerClick: () => {
+ console.log("hamburger clicked");
+ },
+ actionFields: DarkThemeFields,
+ theme: "dark",
+};
+
+export const ActionFieldsWithProfileAsImg = Template.bind({});
+ActionFieldsWithProfileAsImg.args = {
+ ...commonArgs,
+ ulb: "Logo Placeholder",
+ language: "English",
+ onImageClick: () => {
+ console.log("image is clicked");
+ },
+ onLogoClick: () => {
+ console.log("logo is clicked");
+ },
+ onHamburgerClick: () => {
+ console.log("hamburger clicked");
+ },
+ actionFields: DarkThemeFieldsWithProfileAsImg,
+ theme: "dark",
+};
+
+export const WithActionFieldsWithProfileAsSvg = Template.bind({});
+WithActionFieldsWithProfileAsSvg.args = {
+ ...commonArgs,
+ ulb: "Logo Placeholder",
+ language: "English",
+ onImageClick: () => {
+ console.log("image is clicked");
+ },
+ onLogoClick: () => {
+ console.log("logo is clicked");
+ },
+ onHamburgerClick: () => {
+ console.log("hamburger clicked");
+ },
+ actionFields: DarkThemeFieldsWithProfileAsSvg,
+ theme: "dark",
+};
+
+export const WithDropdownMoreOptions = Template.bind({});
+WithDropdownMoreOptions.args = {
+ ...commonArgs,
+ ulb: "Logo Placeholder",
+ language: "English",
+ onImageClick: () => {
+ console.log("image is clicked");
+ },
+ onLogoClick: () => {
+ console.log("logo is clicked");
+ },
+ onHamburgerClick: () => {
+ console.log("hamburger clicked");
+ },
+ actionFields: darkthemefields,
+ theme:"dark"
+};
+
+export const WithActionFieldsAndImageOnLeft = Template.bind({});
+WithActionFieldsAndImageOnLeft.args = {
+ ...commonArgs,
+ ulb: "Logo Placeholder",
+ language: "English",
+ onImageClick: () => {
+ console.log("image is clicked");
+ },
+ onLogoClick: () => {
+ console.log("logo is clicked");
+ },
+ onHamburgerClick: () => {
+ console.log("hamburger clicked");
+ },
+ actionFields: DarkThemeFields,
+ setImageToLeft: true,
+ theme: "dark",
+};
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/DynamicSidePanel.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/DynamicSidePanel.stories.js
new file mode 100644
index 00000000..56b4afff
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/DynamicSidePanel.stories.js
@@ -0,0 +1,412 @@
+import React from "react";
+import SidePanel from "../../atoms/SidePanel";
+import Button from "../../atoms/Button";
+import { SVG } from "../../atoms/SVG";
+
+export default {
+ title: "Molecules/Side Panel/Dynamic",
+ component: SidePanel,
+ argTypes: {
+ className: { control: "text" ,table:{disable:true}},
+ styles: { control: "object",table:{disable:true} },
+ type: { control: "select", options: ["static", "dynamic"] ,table:{disable:true}},
+ position: { control: "select", options: ["left", "right"] ,name:"Position"},
+ children: {
+ control: "object",table:{disable:true}
+ },
+ header: {
+ control: "object",table:{disable:true}
+ },
+ footer: {
+ control: "object",table:{disable:true}
+ },
+ bgActive: { control: "boolean" ,name:'Background Active'},
+ isOverlay: { control: "boolean",table:{disable:true} },
+ hideArrow: { control: "boolean" ,name:'With Nudge',mapping:{
+ true:false,
+ false:true
+ }},
+ hideScrollIcon: { control: "boolean",table:{disable:true} },
+ isDraggable: { control: "boolean" ,name:"Draggable"},
+ defaultClosedWidth: { control: "text" ,table:{disable:true}},
+ defaultOpenWidth: { control: "text" ,table:{disable:true}},
+ addClose: { control: "boolean",name:"With Close" },
+ closedHeader: { control: "object" ,table:{disable:true}},
+ closedFooter: { control: "object",table:{disable:true} },
+ closedContents: { control: "object",table:{disable:true} },
+ sections: {control:'boolean',name:"With Sections" },
+ closedSections:{table:{disable:true}},
+ transitionDuration:{table:{disable:true}}
+ },
+};
+
+const sectionsToShow = [
+ [
+ ,
+
+ Lorem Ipsum is simply dummy text of the printing and typesetting industry.
+ Lorem Ipsum has been the industry's standard dummy text ever since the
+ 1500s, when an unknown printer took a galley of type and scrambled it to
+ make a type specimen book.
+
,
+ {
+ console.log("clicked");
+ }}
+ size={"medium"}
+ style={{ width: "100%" }}
+ label={"Dynamic SidePanel"}
+ icon={"Edit"}
+ variation={"secondary"}
+ />,
+ ],
+ [
+ ,
+
+ Lorem Ipsum is simply dummy text of the printing and typesetting industry.
+ Lorem Ipsum has been the industry's standard dummy text ever since the
+ 1500s, when an unknown printer took a galley of type and scrambled it to
+ make a type specimen book.
+
,
+ {
+ console.log("clicked");
+ }}
+ size={"medium"}
+ style={{ width: "100%" }}
+ label={"Dynamic SidePanel"}
+ icon={"Edit"}
+ variation={"secondary"}
+ />,
+ ],
+ [
+ ,
+
+ Lorem Ipsum is simply dummy text of the printing and typesetting industry.
+ Lorem Ipsum has been the industry's standard dummy text ever since the
+ 1500s, when an unknown printer took a galley of type and scrambled it to
+ make a type specimen book.
+
,
+ {
+ console.log("clicked");
+ }}
+ size={"medium"}
+ style={{ width: "100%" }}
+ label={"Dynamic SidePanel"}
+ icon={"Edit"}
+ variation={"secondary"}
+ />,
+ ],
+];
+
+const Template = (args) => {
+ const {sections,...rest} = args;
+ return ( )
+};
+
+const commonArgs = {
+ className: "",
+ styles: {},
+ type: "dynamic",
+ position: "right",
+ children: [],
+ header: [],
+ footer: [],
+ bgActive: true,
+ isOverlay: false,
+ isDraggable: true,
+ hideScrollIcon: true,
+ sections: [],
+ defaultClosedWidth: "",
+ defaultOpenWidth: "",
+ addClose:false,
+ closedContents:[],
+ closedSections:[],
+ closedHeader:[],
+ closedFooter:[],
+ hideArrow:true
+};
+
+const children = [
+ Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
+];
+
+const closedSections = [
+
+
+ R1
+
+
+ R2
+
+
+ R3
+
+
,
+
+
+ R1
+
+
+ R2
+
+
+ R3
+
+
,
+
+
+ R1
+
+
+ R2
+
+
+ R3
+
+
,
+];
+
+const closedContents = [
+ ,
+ ,
+
+];
+
+
+
+const header = [
+
+ Header
+
,
+];
+
+const footer = [
+ {
+ console.log("clicked");
+ }}
+ size={"medium"}
+ style={{ width: "100%" }}
+ label={"Dynamic SidePanel"}
+ icon={"Edit"}
+ variation={"primary"}
+ />,
+];
+
+const closedFooter = [
+
+];
+
+const closedHeader = [
+
+ H
+
+]
+
+export const Basic = Template.bind({});
+Basic.args = {
+ ...commonArgs,
+ type: "dynamic",
+ position: "right",
+ children: children,
+ header: header,
+ footer: footer,
+ closedContents:closedContents,
+ closedHeader:closedHeader,
+ closedFooter:closedFooter
+};
+
+export const Custom = Template.bind({});
+Custom.args = {
+ ...commonArgs,
+ type: "dynamic",
+ position: "right",
+ children: children,
+ header: header,
+ footer: footer,
+ defaultClosedWidth: 100,
+ defaultOpenWidth: 600,
+ closedSections:closedSections,
+ closedContents:closedContents,
+ closedHeader:closedHeader,
+ closedFooter:closedFooter
+};
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/ErrorPanelCard.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/ErrorPanelCard.stories.js
new file mode 100644
index 00000000..02a5fba0
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/ErrorPanelCard.stories.js
@@ -0,0 +1,172 @@
+import React from "react";
+import { AlertCard } from "../../atoms";
+import { Button } from "../../atoms";
+import PanelCard from "../PanelCard";
+
+export default {
+ title: "Molecules/Panel Card/Error",
+ component: PanelCard,
+ argTypes: {
+ cardClassName: {
+ control: "text",
+ table: { disable: true },
+ },
+ cardStyles: {
+ control: { type: "object" },
+ table: { disable: true },
+ },
+ children: {
+ control: "object",
+ table: { disable: true },
+ },
+ props: {
+ control: "object",
+ table: { disable: true },
+ },
+ description: {
+ control: "text",
+ name: "Description",
+ },
+ showChildrenInline: {
+ control: "boolean",
+ table: { disable: true },
+ },
+ sortFooterButtons: {
+ control: "boolean",
+ table: { disable: true },
+ },
+ maxFooterButtonsAllowed: {
+ control: "text",
+ table: { disable: true },
+ },
+ type: {
+ control: "select",
+ options: ["success", "error"],
+ table: { disable: true },
+ },
+ message: {
+ control: "text",
+ name: "Heading",
+ },
+ info: {
+ control: "text",
+ table: { disable: true },
+ },
+ response: {
+ control: "text",
+ table: { disable: true },
+ },
+ customIcon: {
+ control: "text",
+ table: { disable: true },
+ },
+ iconFill: {
+ control: "text",
+ table: { disable: true },
+ },
+ multipleResponses: {
+ control: {
+ type: "array",
+ separator: ",",
+ },
+ table: { disable: true },
+ },
+ className: {
+ control: "text",
+ table: { disable: true },
+ },
+ style: {
+ control: "object",
+ table: { disable: true },
+ },
+ animationProps: {
+ control: "object",
+ table: { disable: true },
+ },
+ footerStyles: {
+ control: "object",
+ table: { disable: true },
+ },
+ footerChildren: {
+ table: { disable: true },
+ },
+ additionlWidgets: { control: "boolean", name: "Additional Widgets" },
+ Actions: { control: "boolean" },
+ showAsSvg:{table:{disable:true}}
+ },
+};
+
+const footerChildrenWithTwoButtons = [
+ console.log("Clicked Button 1")}
+ />,
+ console.log("Clicked Button 2")}
+ />,
+];
+
+const errorchildren = [
+ ,
+];
+
+const Template = (args) => {
+ const { additionlWidgets, Actions, ...rest } = args;
+ return (
+
+ );
+};
+
+const commonArgs = {
+ cardClassName: "",
+ cardStyles: {},
+ className: "",
+ style: {},
+ props: {},
+ description:
+ "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
+ showChildrenInline: false,
+ sortFooterButtons: true,
+ maxFooterButtonsAllowed: 5,
+ message: "Error Message",
+ type: "error",
+ info: "Description",
+ response: "949749795479",
+ customIcon: "",
+ iconFill: "",
+ multipleResponses: [],
+ animationProps: {
+ loop: false,
+ noAutoplay: false,
+ },
+ footerStyles: {},
+ Actions: false,
+ additionlWidgets:false
+};
+
+export const Basic = Template.bind({});
+Basic.args = {
+ ...commonArgs,
+};
+
+export const Custom = Template.bind({});
+Custom.args = {
+ ...commonArgs,
+ showAsSvg: true,
+ cardStyles: { width: "620px", height: "590px" },
+};
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/FilterCardDocs.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/FilterCardDocs.stories.js
new file mode 100644
index 00000000..b0b42b51
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/FilterCardDocs.stories.js
@@ -0,0 +1,27 @@
+import React from "react";
+import { Card } from "../../atoms";
+import { Iframe } from "../../atoms";
+
+export default {
+ title: "Molecules/Filter Card",
+ component: Card,
+ argTypes: {},
+};
+
+export const Documentation = () => (
+
+);
+
+Documentation.storyName = "Docs";
+Documentation.argTypes = {
+ type: { table: { disable: true } },
+ variant: { table: { disable: true } },
+ onClick: { table: { disable: true } },
+ style: { table: { disable: true } },
+ className: { table: { disable: true } },
+ children: { table: { disable: true } },
+};
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/Footer.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/Footer.stories.js
new file mode 100644
index 00000000..8a2b6d79
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/Footer.stories.js
@@ -0,0 +1,148 @@
+import React from "react";
+import { Button } from "../../atoms";
+import { Footer } from "../../atoms";
+import { Iframe } from "../../atoms";
+
+export default {
+ title: "Molecules/Footer",
+ component: Footer,
+ argTypes: {
+ className: {
+ control: "text",
+ table: { disable: true },
+ },
+ style: {
+ control: { type: "object" },
+ table: { disable: true },
+ },
+ actionFields: {
+ control: { type: "object" },
+ table: { disable: true },
+ },
+ setactionFieldsToRight: {
+ control: { type: "boolean" },
+ table: { disable: true },
+ },
+ setactionFieldsToLeft: {
+ control: { type: "boolean" },
+ table: { disable: true },
+ },
+ maxActionFieldsAllowed: {
+ control: { type: "number" },
+ table: { disable: true },
+ },
+ sortActionFields: {
+ control: { type: "boolean" },
+ table: { disable: true },
+ },
+ setChildrenLeft: {
+ control: { type: "boolean" },
+ table: { disable: true },
+ },
+ alignment: {
+ control: "select",
+ options: ["Left", "Right"],
+ name:"Alignment"
+ },
+ },
+};
+
+const Template = (args) => {
+ const { alignment, ...rest } = args;
+ return (
+
+ );
+};
+
+const commonArgs = {
+ className: "",
+ style: {},
+ actionFields: [],
+ maxActionFieldsAllowed: 5,
+ sortActionFields: true,
+ setChildrenLeft: false,
+};
+
+const footeractionFields = [
+ console.log("Moving to previous page")}
+ />,
+ console.log("Moving To next page")}
+ />,
+];
+
+const footeractionFieldsWithSearchableDropdown = [
+ console.log("Moving to previous page")}
+ />,
+ {
+ console.log(option);
+ }}
+ > ,
+];
+
+export const Documentation = () => (
+
+);
+
+Documentation.storyName = "Docs";
+Documentation.argTypes = {
+ flex: { table: { disable: true } },
+};
+
+export const Basic = Template.bind({});
+Basic.args = {
+ ...commonArgs,
+ actionFields: footeractionFields,
+ alignment:"Right"
+};
+
+export const Flex = () => (
+
+);
+Flex.argTypes = {
+ alignment: { table: { disable: true } },
+};
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/FormCard.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/FormCard.stories.js
new file mode 100644
index 00000000..5c693e38
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/FormCard.stories.js
@@ -0,0 +1,239 @@
+import React, { useState } from "react";
+import Button from "../../atoms/Button";
+import TextInput from "../../atoms/TextInput";
+import {
+ CheckBox,
+ Dropdown,
+ LabelFieldPair,
+ RadioButtons,
+ TextBlock,
+} from "../../atoms";
+import FormCard from "../FormCard";
+
+export default {
+ title: "Molecules/Card/Form Card",
+ component: FormCard,
+ argTypes: {
+ className: {
+ control: "text",
+ table: { disable: true },
+ },
+ variant: {
+ table: { disable: true },
+ },
+ headerData: {
+ table: { disable: true },
+ },
+ equalWidthButtons: {
+ table: { disable: true },
+ },
+ footerData: {
+ table: { disable: true },
+ },
+ style: {
+ control: { type: "object", table: { disable: true } },
+ },
+ children: {
+ control: "object",
+ table: { disable: true },
+ },
+ type: { control: "select", table: { disable: true } },
+ layout: {
+ control: "select",
+ name: "Columns",
+ options: [1, 2],
+ mapping: { 1: "", 2: "2*2" },
+ },
+ props: {
+ control: "object",
+ table: { disable: true },
+ },
+ withDivider: {
+ control: "boolean",
+ name: "Divider",
+ },
+ },
+};
+
+const FormCardWrapper = (args) => {
+ const [selectedGender, setSelectedGender] = useState(null);
+ const [isSameAsPropertyAddress, setIsSameAsPropertyAddress] = useState(false);
+
+ const [isMobileView, setIsMobileView] = React.useState(
+ window.innerWidth / window.innerHeight <= 9 / 16
+ );
+ const onResize = () => {
+ if (window.innerWidth / window.innerHeight <= 9 / 16) {
+ if (!isMobileView) {
+ setIsMobileView(true);
+ }
+ } else {
+ if (isMobileView) {
+ setIsMobileView(false);
+ }
+ }
+ };
+ React.useEffect(() => {
+ window.addEventListener("resize", () => {
+ onResize();
+ });
+ return () => {
+ window.addEventListener("resize", () => {
+ onResize();
+ });
+ };
+ });
+
+ const handleGenderSelect = (option) => {
+ setSelectedGender(option.code);
+ };
+
+ const handleCheckboxChange = (event) => {
+ setIsSameAsPropertyAddress(event.target.checked);
+ };
+
+ const textBlockStyle = {
+ width: isMobileView ? "100%" : "30%",
+ };
+
+ const updatedChildren = [
+
+
+
+ ,
+
+
+
+ ,
+
+
+
+ ,
+
+
+
+ ,
+
+
+
+ ,
+
+
+
+
+
+ ,
+
+
+
+ ,
+
+
+
+
+
+ ,
+
+
+
+ ,
+
+
+
+ ,
+ ,
+ ];
+
+ return ;
+};
+
+const Template = (args) => ;
+
+const headerData = [ ];
+const FooterChild = [
+ console.log("Clicked cancel")}
+ />,
+ console.log("Clicked submit")}
+ />,
+];
+
+const commonArgs = {
+ layout: 1,
+ type: "primary",
+ variant: "form",
+ headerData: headerData,
+ footerData: FooterChild,
+ equalWidthButtons: true,
+ withDivider: true,
+};
+
+export const Basic = Template.bind({});
+Basic.args = {
+ ...commonArgs,
+};
+Basic.storyName = `Form Card`;
+Basic.argTypes = {
+ style: { table: { disable: true } },
+};
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/Hamburger.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/Hamburger.stories.js
new file mode 100644
index 00000000..093bab17
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/Hamburger.stories.js
@@ -0,0 +1,234 @@
+import React from "react";
+import { BrowserRouter as Router } from "react-router-dom";
+import Hamburger from "../../atoms/Hamburger";
+import { Iframe } from "../../atoms";
+
+export default {
+ title: "Molecules/Hamburger",
+ component: Hamburger,
+ argTypes: {
+ items: { control: "object", table: { disable: true } },
+ usermanuals: { control: "object", table: { disable: true } },
+ theme: {
+ control: "select",
+ options: ["dark", "light"],
+ table: { disable: true },
+ },
+ transitionDuration: { control: "number", table: { disable: true } },
+ isSearchable: { control: "boolean", name: "Enable Search" },
+ hideUserManuals: {
+ control: "boolean",
+ name: "Universal actions",
+ mapping: { true: false, false: true },
+ },
+ userManualLabel: { control: "text", table: { disable: true } },
+ profile: { control: "boolean", name: "Profile" },
+ onSelect: { action: "onChange", table: { disable: true } },
+ onLogout: { action: "onChange", table: { disable: true } },
+ reopenOnLogout: { control: "boolean", table: { disable: true } },
+ closeOnClickOutside: { control: "boolean", table: { disable: true } },
+ onOutsideClick: { action: "onChange", table: { disable: true } },
+ profileNumber: { table: { disable: true } },
+ profileName: { table: { disable: true } },
+ },
+};
+
+const Items = [
+ {
+ label: "City",
+ isSearchable: false,
+ icon: "Home",
+ children: [
+ {
+ path: "/",
+ label: "City 1",
+ icon: "",
+ },
+ {
+ path: "/",
+ label: "City 2",
+ icon: "",
+ },
+ ],
+ },
+ {
+ label: "Language",
+ isSearchable: false,
+ icon: "DriveFileMove",
+ children: [
+ {
+ path: "/",
+ label: "Language 1",
+ icon: "",
+ },
+ {
+ path: "/",
+ label: "Language 2",
+ icon: "",
+ },
+ ],
+ },
+ {
+ label: "SideNav",
+ isSearchable: false,
+ icon: "Accessibility",
+ children: [
+ {
+ path: "/",
+ label: "SubModule 1",
+ icon: "",
+ children: [
+ {
+ path: "/",
+ label: "InnerModule 1",
+ icon: "",
+ },
+ {
+ path: "/",
+ label: "InnerModule 2",
+ icon: "",
+ },
+ ],
+ },
+ {
+ path: "/",
+ label: "SubModule 2",
+ icon: "",
+ },
+ ],
+ },
+];
+
+const ItemsWithSearch = [
+ {
+ label: "City",
+ isSearchable: true,
+ icon: "Home",
+ children: [
+ {
+ path: "/",
+ label: "City 1",
+ icon: "",
+ },
+ {
+ path: "/",
+ label: "City 2",
+ icon: "",
+ },
+ ],
+ },
+ {
+ label: "Language",
+ isSearchable: true,
+ icon: "DriveFileMove",
+ children: [
+ {
+ path: "/",
+ label: "Language 1",
+ icon: "",
+ },
+ {
+ path: "/",
+ label: "Language 2",
+ icon: "",
+ },
+ ],
+ },
+ {
+ label: "SideNav",
+ isSearchable: true,
+ icon: "Accessibility",
+ children: [
+ {
+ path: "/",
+ label: "SubModule 1",
+ icon: "",
+ children: [
+ {
+ path: "/",
+ label: "InnerModule 1",
+ icon: "",
+ },
+ {
+ path: "/",
+ label: "InnerModule 2",
+ icon: "",
+ },
+ ],
+ },
+ {
+ path: "/",
+ label: "SubModule 2",
+ icon: "",
+ },
+ ],
+ },
+];
+
+const Template = (args) => {
+ const { isSearchable, profile, ...rest } = args;
+ return (
+
+
+
+ );
+};
+
+const onSelect = (e) => {
+ console.log(e, "event");
+};
+
+const onLogout = () => {
+ console.log("clicked on Logout");
+};
+
+const commonArgs = {
+ transitionDuration: 0.3,
+ theme: "dark",
+ profileName: "ProfileName",
+ profileNumber: "+258 6387387",
+ isSearchable: true,
+ hideUserManuals: true,
+ userManualLabel: "UserManual",
+ profile: false,
+ usermanuals: [],
+ onSelect: onSelect,
+ onLogout: onLogout,
+ reopenOnLogout: false,
+ closeOnClickOutside: false,
+};
+
+export const Documentation = () => (
+
+);
+
+Documentation.storyName = "Docs";
+Documentation.argTypes = {
+ isSearchable: { table: { disable: true } },
+ hideUserManuals: { table: { disable: true } },
+ profile: { table: { disable: true } },
+};
+
+export const Dark = Template.bind({});
+Dark.args = {
+ ...commonArgs,
+ theme: "dark",
+};
+
+export const Light = Template.bind({});
+Light.args = {
+ ...commonArgs,
+ theme: "light",
+};
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/HeaderDocs.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/HeaderDocs.stories.js
new file mode 100644
index 00000000..ca9e8fb8
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/HeaderDocs.stories.js
@@ -0,0 +1,62 @@
+import React from "react";
+import { Header } from "../../atoms";
+import { SVG } from "../../atoms";
+import { Dropdown } from "../../atoms";
+import {Iframe} from "../../atoms";
+
+export default {
+ title: "Molecules/Header",
+ component: Header,
+ argTypes: {
+ className: {
+ control: "text",
+ },
+ theme: {
+ control: "select",
+ options: ["light", "dark"],
+ },
+ style: {
+ control: { type: "object" },
+ },
+ onImageClick: {
+ control: "function",
+ },
+ onHamburgerClick: {
+ control: "function",
+ },
+ onLogoClick: {
+ control: "function",
+ },
+ props: {
+ control: "object",
+ },
+ setImageToLeft: {
+ control: "boolean",
+ },
+ img: {
+ control: "text",
+ },
+ logo: {
+ control: "text",
+ },
+ ulb: {
+ control: "text",
+ },
+ actionFields: {
+ control: {
+ type: "array",
+ separator: ",",
+ },
+ },
+ },
+};
+
+export const Documentation = () => (
+
+);
+
+Documentation.storyName = "Docs";
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/HorizontalFilterCard.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/HorizontalFilterCard.stories.js
new file mode 100644
index 00000000..88ad66b3
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/HorizontalFilterCard.stories.js
@@ -0,0 +1,344 @@
+import React, { useState,Fragment } from "react";
+import FilterCard from "../FilterCard";
+import { LabelFieldPair } from "../../atoms";
+import { RadioButtons } from "../../atoms";
+import { TextBlock } from "../../atoms";
+import { TextInput } from "../../atoms";
+import { Button } from "../../atoms";
+
+// Story metadata
+export default {
+ title: "Molecules/Filter Card/Horizontal",
+ component: FilterCard,
+ argTypes: {
+ title: { control: "boolean" ,name:"Heading"},
+ titleIcon: { table:{disable:true} },
+ primaryActionLabel: { control: "text" },
+ secondaryActionLabel: { control: "text" },
+ layoutType: {
+ control: {
+ type: "select",
+ options: ["horizontal", "vertical"],
+ },
+ },
+ equalWidthButtons: { control: "boolean" ,table:{disable:true}},
+ addClose: { control: "boolean",name:"With Close" },
+ className: { control: "text",table:{disable:true} },
+ style: { control: "object" ,table:{disable:true}},
+ hideIcon: { control: "boolean" ,name:"Header Icon"},
+ isPopup: { control: "boolean" ,table:{disable:true}},
+ onClose: { action: "onChange" ,table:{disable:true}},
+ onOverlayClick: {
+ control: "function",table:{disable:true}
+ },
+ children:{table:{disable:true}},
+ primaryActionLabel:{table:{disable:true}},
+ secondaryActionLabel:{table:{disable:true}},
+ onPrimaryPressed:{table:{disable:true}},
+ onSecondaryPressed:{table:{disable:true}},
+ layoutType:{table:{disable:true}}
+ },
+};
+
+// Template for the story
+const Template = (args) => {
+ const {title,...rest} = args;
+ return ( );};
+
+const genderOptions = [
+ { code: "M", name: "Male" },
+ { code: "F", name: "Female" },
+ { code: "O", name: "Others" },
+];
+
+const children = [
+
+
+
+ ,
+
+
+
+ ,
+
+
+ {
+ console.log(e);
+ }}
+ style={{
+ width: "100%",
+ }}
+ />
+ ,
+];
+
+const horizontalChildren = [
+
+
+
+ ,
+
+
+
+
+];
+
+export const Basic = Template.bind({});
+Basic.args = {
+ title: true,
+ addClose: false,
+ children: horizontalChildren,
+ primaryActionLabel: "ApplyFilters",
+ secondaryActionLabel: "Clear Filters",
+ onPrimaryPressed: () => alert("Primary action clicked!"),
+ onSecondaryPressed: () => alert("Secondary action clicked!"),
+ layoutType: "horizontal",
+ equalWidthButtons: false,
+ hideIcon: false,
+};
+
+export const Custom = Template.bind({});
+Custom.args = {
+ title: true,
+ addClose: true,
+ children: horizontalChildren,
+ primaryActionLabel: "ApplyFilters",
+ secondaryActionLabel: "Clear Filters",
+ onPrimaryPressed: () => alert("Primary action clicked!"),
+ onSecondaryPressed: () => alert("Secondary action clicked!"),
+ layoutType: "horizontal",
+ equalWidthButtons: false,
+ hideIcon: false,
+ style: {
+ width: "1000px",
+ backgroundColor:"#fafafa",
+ border:"1px solid black"
+ },
+};
+
+export const AsPopup = () => {
+ const [showPopup, setShowPopup] = useState(false);
+
+ const onClose = () => {
+ setShowPopup(false);
+ };
+
+ const onOverlayClick = () => {
+ setShowPopup(false);
+ };
+
+ const commonStyles = {
+ position: "absolute",
+ top: "50%",
+ left: "50%",
+ color: "#363636",
+ display: "flex",
+ alignItems: "center",
+ justifyContent: "center",
+ transform: "translate(-50%, -50%)",
+ };
+
+ return (
+ <>
+
+ {
+ setShowPopup(true)}
+ />
+ }
+
+ {showPopup && (
+ alert("Primary action clicked!")}
+ onSecondaryPressed={() => alert("Secondary action clicked!")}
+ layoutType={"horizontal"}
+ equalWidthButtons={true}
+ hideIcon={false}
+ isPopup={true}
+ onClose={onClose}
+ onOverlayClick={onOverlayClick}
+ >
+
+
+
+
+
+
+
+
+
+
+ {
+ console.log(e);
+ }}
+ style={{
+ width: "100%",
+ }}
+ />
+
+
+ )}
+ >
+ );
+};
+AsPopup.argTypes= {
+ title: { table:{disable:true}},
+ hideIcon: { table:{disable:true} },
+ addClose: { table:{disable:true} },
+}
+
+
+export const AsPopupWithMoreChildren = () => {
+ const [showPopup, setShowPopup] = useState(false);
+
+ const onClose = () => {
+ setShowPopup(false);
+ };
+
+ const onOverlayClick = () => {
+ setShowPopup(false);
+ };
+
+ const commonStyles = {
+ position: "absolute",
+ top: "50%",
+ left: "50%",
+ color: "#363636",
+ display: "flex",
+ alignItems: "center",
+ justifyContent: "center",
+ transform: "translate(-50%, -50%)",
+ };
+
+ return (
+ <>
+
+ {
+ setShowPopup(true)}
+ />
+ }
+
+ {showPopup && (
+ alert("Primary action clicked!")}
+ onSecondaryPressed={() => alert("Secondary action clicked!")}
+ layoutType={"horizontal"}
+ equalWidthButtons={true}
+ hideIcon={false}
+ isPopup={true}
+ onClose={onClose}
+ onOverlayClick={onOverlayClick}
+ >
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ )}
+ >
+ );
+};
+
+AsPopupWithMoreChildren.argTypes= {
+ title: { table:{disable:true}},
+ hideIcon: { table:{disable:true} },
+ addClose: { table:{disable:true} },
+}
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/LandingPageCard.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/LandingPageCard.stories.js
new file mode 100644
index 00000000..f70b5408
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/LandingPageCard.stories.js
@@ -0,0 +1,163 @@
+import React from "react";
+import LandingPageCard from "../../molecules/LandingPageCard";
+import { Iframe } from "../../atoms";
+
+export default {
+ title: "Molecules/Landing Page Card",
+ component: LandingPageCard,
+ argTypes: {
+ icon: { control: "object", table: { disable: true } },
+ moduleName: { control: "text", name: "Heading" },
+ metrics: { control: "boolean", name: "Show Metrics" },
+ children: { control: "boolean", name: "Custom Content" },
+ links: { control: "boolean", name: "Show Links" },
+ className: { control: "text", table: { disable: true } },
+ style: { control: "object", table: { disable: true } },
+ moduleAlignment: {
+ control: "select",
+ options: ["Left", "Right"],
+ name: "Icon Alignement",
+ mapping: {
+ Left: "right",
+ Right: "left",
+ },
+ },
+ metricAlignment: {
+ control: "select",
+ options: ["left", "centre"],
+ name: "Metric Alignment",
+ },
+ iconBg: {
+ control: "select",
+ name: "Icon",
+ mapping: {
+ Default: false,
+ Filled: true,
+ },
+ options: ["Default", "Filled"],
+ },
+ onMetricClick: { control: "action", table: { disable: true } },
+ hideDivider: { table: { disable: true } },
+ buttonSize: {
+ control: "select",
+ options: ["large", "medium", "small"],
+ table: { disable: true },
+ },
+ },
+};
+
+const centreChildrenToShow = [
+ {"Here you can add any text content between metrics and links"}
,
+];
+
+const endChildrenToShow = [
+ {"Here you can add any text content below links"}
,
+];
+
+const metricsToShow = [
+ {
+ count: 40,
+ label: "Lorem Ipsum",
+ link:
+ "https://unified-dev.digit.org/storybook/?path=/story/atoms-backlink--primary",
+ },
+ {
+ count: 40,
+ label: "Lorem Ipsum",
+ link:
+ "https://unified-dev.digit.org/storybook/?path=/story/atoms-backlink--primary",
+ },
+];
+
+const linksToShow = [
+ {
+ label: "Create User",
+ link:
+ "https://unified-dev.digit.org/storybook/?path=/story/atoms-backlink--primary",
+ icon: "Person",
+ },
+ {
+ label: "Edit User",
+ link:
+ "https://unified-dev.digit.org/storybook/?path=/story/atoms-backlink--primary",
+ icon: "Edit",
+ },
+ {
+ label: "View User",
+ link:
+ "https://unified-dev.digit.org/storybook/?path=/story/atoms-backlink--primary",
+ icon: "Preview",
+ },
+ {
+ label: "Delete User",
+ link:
+ "https://unified-dev.digit.org/storybook/?path=/story/atoms-backlink--primary",
+ icon: "Delete",
+ },
+];
+
+const Template = (args) => {
+ const { metrics, links, children, ...rest } = args;
+ return (
+
+ );
+};
+
+const commonArgs = {
+ icon: "SupervisorAccount",
+ moduleName: "Heading",
+ moduleAlignment: "Left",
+ buttonSize: "medium",
+ metrics: true,
+ links: true,
+ className: "",
+ metricAlignment: "left",
+ style: {},
+ iconBg: "Default",
+ onMetricClick: (metric, count) => {
+ console.log(metric, count);
+ },
+ children: false,
+};
+
+export const Documentation = () => (
+
+);
+
+Documentation.storyName = "Docs";
+Documentation.argTypes = {
+ moduleName: { table: { disable: true } },
+ metrics: { table: { disable: true } },
+ links: { table: { disable: true } },
+ metricAlignment: { table: { disable: true } },
+ iconBg: { table: { disable: true } },
+ children: { table: { disable: true } },
+ moduleAlignment: { table: { disable: true } },
+};
+
+
+export const Basic = Template.bind({});
+Basic.args = {
+ ...commonArgs,
+};
+
+export const Custom = Template.bind({});
+Custom.args = {
+ ...commonArgs,
+ style: {
+ backgroundColor: "#fafafa",
+ padding: "20px",
+ borderRadius: "8px",
+ border: "2px solid black",
+ },
+};
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/LandingPageWrapper.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/LandingPageWrapper.stories.js
new file mode 100644
index 00000000..82c5f1fd
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/LandingPageWrapper.stories.js
@@ -0,0 +1,74 @@
+import React from "react";
+import LandingPageCard from "../LandingPageCard";
+import LandingPageWrapper from "../LandingPageWrapper";
+import { Iframe } from "../../atoms";
+
+export default {
+ title: "MoleculeGroup/Landing Page Wrapper",
+ component: LandingPageWrapper,
+ argTypes: {
+ numberOfCards: {
+ control: { type: "number", min: 1 },
+ defaultValue: 3,
+ name: "No of Cards",
+ description: "Number of LandingPageCards to display",
+ },
+ children: { table: { disable: true } },
+ className: { table: { disable: true } },
+ styles: { table: { disable: true } },
+ },
+};
+
+const Template = (args) => {
+ const { numberOfCards } = args;
+
+ const generateCards = (count) => {
+ return Array.from({ length: count }, (_, index) => (
+
+ ));
+ };
+
+ return (
+ {generateCards(numberOfCards)}
+ );
+};
+
+export const Documentation = () => (
+
+);
+
+Documentation.storyName = "Docs";
+Documentation.argTypes = {
+ numberOfCards: {
+ table: { disable: true },
+ },
+};
+
+export const Basic = Template.bind({});
+Basic.args = {
+ numberOfCards: 3,
+};
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/LightThemeHeader.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/LightThemeHeader.stories.js
new file mode 100644
index 00000000..e599534b
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/LightThemeHeader.stories.js
@@ -0,0 +1,358 @@
+import React from "react";
+import { Header } from "../../atoms";
+import { SVG } from "../../atoms";
+import { Dropdown } from "../../atoms";
+
+export default {
+ title: "Molecules/Header/Light",
+ component: Header,
+ argTypes: {
+ className: {
+ control: "text",
+ },
+ theme: {
+ control: "select",
+ options: ["light", "dark"],
+ },
+ style: {
+ control: { type: "object" },
+ },
+ onImageClick: {
+ control: "function",
+ },
+ onHamburgerClick: {
+ control: "function",
+ },
+ onLogoClick: {
+ control: "function",
+ },
+ props: {
+ control: "object",
+ },
+ setImageToLeft: {
+ control: "boolean",
+ },
+ img: {
+ control: "text",
+ },
+ logo: {
+ control: "text",
+ },
+ ulb: {
+ control: "text",
+ },
+ actionFields: {
+ control: {
+ type: "array",
+ separator: ",",
+ },
+ },
+ },
+};
+
+const fields = [
+ console.log(option, "Option selected")}
+ customSelector={"City"}
+ theme={"light"}
+ />,
+ console.log(option, "Option selected")}
+ customSelector={"City"}
+ theme={"light"}
+/>,
+ console.log(option, "Option selected")}
+ showArrow={false}
+ profilePic={"P"}
+ theme={"light"}
+/>,
+];
+
+const LightThemeFields = [
+ console.log(option, "Option selected")}
+ customSelector={"City"}
+ theme={"light"}
+ />,
+ console.log(option, "Option selected")}
+ selected={{ name: "English", code: "English" }}
+ customSelector={"Language"}
+ theme={"light"}
+ />,
+ console.log(option, "Option selected")}
+ showArrow={false}
+ profilePic={"P"}
+ theme={"light"}
+ />,
+];
+
+const LightThemeFieldsWithProfileAsImg = [
+ console.log(option, "Option selected")}
+ customSelector={"City"}
+ theme={"light"}
+ />,
+ console.log(option, "Option selected")}
+ selected={{ name: "English", code: "English" }}
+ customSelector={"Language"}
+ theme={"light"}
+ />,
+ console.log(option, "Option selected")}
+ showArrow={false}
+ profilePic={
+
+ }
+ theme={"light"}
+ />,
+];
+
+const LightThemeFieldsWithProfileAsSvg = [
+ console.log(option, "Option selected")}
+ customSelector={"City"}
+ theme={"light"}
+ />,
+ console.log(option, "Option selected")}
+ selected={{ name: "English", code: "English" }}
+ customSelector={"Language"}
+ theme={"light"}
+ />,
+ console.log(option, "Option selected")}
+ showArrow={false}
+ profilePic={ }
+ theme={"light"}
+ />,
+];
+
+const Template = (args) => ;
+const commonArgs = {
+ img: "",
+ className: "",
+ style: {},
+ theme: "light",
+ setImageToLeft: false,
+ props: {},
+ ulb: "",
+ showDeafultImg: true,
+ logo:
+ "",
+};
+
+export const LightThemeHeader = Template.bind({});
+LightThemeHeader.args = {
+ ...commonArgs,
+ ulb: "Logo Placeholder",
+ language: "English",
+ onImageClick: () => {
+ console.log("image is clicked");
+ },
+ onLogoClick: () => {
+ console.log("logo is clicked");
+ },
+ onHamburgerClick: () => {
+ console.log("hamburger clicked");
+ },
+};
+
+export const LightThemeHeaderWithImageOnLeft = Template.bind({});
+LightThemeHeaderWithImageOnLeft.args = {
+ ...commonArgs,
+ ulb: "Logo Placeholder",
+ language: "English",
+ onImageClick: () => {
+ console.log("image is clicked");
+ },
+ onLogoClick: () => {
+ console.log("logo is clicked");
+ },
+ onHamburgerClick: () => {
+ console.log("hamburger clicked");
+ },
+ setImageToLeft: true,
+};
+
+export const WithActionFields = Template.bind({});
+WithActionFields.args = {
+ ...commonArgs,
+ ulb: "Logo Placeholder",
+ onImageClick: () => {
+ console.log("image is clicked");
+ },
+ onLogoClick: () => {
+ console.log("logo is clicked");
+ },
+ onHamburgerClick: () => {
+ console.log("hamburger clicked");
+ },
+ actionFields: LightThemeFields,
+};
+
+export const WithProfileAsImage = Template.bind({});
+WithProfileAsImage.args = {
+ ...commonArgs,
+ ulb: "Logo Placeholder",
+ language: "English",
+ onImageClick: () => {
+ console.log("image is clicked");
+ },
+ onLogoClick: () => {
+ console.log("logo is clicked");
+ },
+ onHamburgerClick: () => {
+ console.log("hamburger clicked");
+ },
+ actionFields: LightThemeFieldsWithProfileAsImg,
+};
+
+export const WithProfileAsSvg = Template.bind({});
+WithProfileAsSvg.args = {
+ ...commonArgs,
+ ulb: "Logo Placeholder",
+ language: "English",
+ onImageClick: () => {
+ console.log("image is clicked");
+ },
+ onLogoClick: () => {
+ console.log("logo is clicked");
+ },
+ onHamburgerClick: () => {
+ console.log("hamburger clicked");
+ },
+ actionFields: LightThemeFieldsWithProfileAsSvg,
+};
+
+export const WithDropdownMoreOptions = Template.bind({});
+WithDropdownMoreOptions.args = {
+ ...commonArgs,
+ ulb: "Logo Placeholder",
+ language: "English",
+ onImageClick: () => {
+ console.log("image is clicked");
+ },
+ onLogoClick: () => {
+ console.log("logo is clicked");
+ },
+ onHamburgerClick: () => {
+ console.log("hamburger clicked");
+ },
+ actionFields: fields,
+};
+
+export const WithActionFieldsAndImageOnLeft = Template.bind({});
+WithActionFieldsAndImageOnLeft.args = {
+ ...commonArgs,
+ ulb: "Logo Placeholder",
+ language: "English",
+ onImageClick: () => {
+ console.log("image is clicked");
+ },
+ onLogoClick: () => {
+ console.log("logo is clicked");
+ },
+ onHamburgerClick: () => {
+ console.log("hamburger clicked");
+ },
+ actionFields: LightThemeFields,
+ setImageToLeft: true,
+};
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/MenuCard.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/MenuCard.stories.js
new file mode 100644
index 00000000..5ec600cc
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/MenuCard.stories.js
@@ -0,0 +1,58 @@
+import React from "react";
+import MenuCard from "../MenuCard";
+import {Iframe} from "../../atoms";
+
+export default {
+ title: "Molecules/Menu Card",
+ component: MenuCard,
+ argTypes: {
+ icon: { control: "boolean" ,name:"Show Icon",mapping:{true:"Article",false:""}},
+ menuName: { control: "text" ,name:'Heading'},
+ description: { control: "text",name:"Description" },
+ className: { control: "text" ,table:{disable:true}},
+ styles: { control: "object" ,table:{disable:true}},
+ onClick: { action: "clicked",table:{disable:true} },
+ },
+};
+
+const Template = (args) => ;
+
+export const Documentation = () => (
+
+);
+
+Documentation.storyName = "Docs";
+Documentation.argTypes = {
+ icon: { table: { disable: true } },
+ menuName: { table: { disable: true } },
+ description: { table: { disable: true } },
+};
+
+const commonArgs = {
+ icon: true,
+ menuName: "Menu Header",
+ description:"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.", className: "",
+ styles: {},
+ onClick:(e)=>{console.log(e)}
+}
+// Default story for MenuCard
+export const Menu1 = Template.bind({});
+Menu1.args = {
+...commonArgs,
+};
+
+// MenuCard with custom styles
+export const Custom = Template.bind({});
+Custom.args = {
+...commonArgs,
+ styles: {
+ backgroundColor: "#f9f9f9",
+ padding: "30px",
+ borderRadius: "12px",
+ border: "2px solid #333",
+ },
+};
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/MenuCardWrapper.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/MenuCardWrapper.stories.js
new file mode 100644
index 00000000..2a9b9c96
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/MenuCardWrapper.stories.js
@@ -0,0 +1,75 @@
+import React from "react";
+import MenuCardWrapper from "../MenuCardWrapper";
+import MenuCard from "../MenuCard";
+import { Iframe } from "../../atoms";
+
+export default {
+ title: "MoleculeGroup/Menu Card Wrapper",
+ component: MenuCardWrapper,
+ argTypes: {
+ numberOfCards: {
+ control: { type: "number", min: 1 },
+ defaultValue: 3,
+ name: "No of Cards",
+ description: "Number of LandingPageCards to display",
+ },
+ className: { table: { disable: true } },
+ styles: { table: { disable: true } },
+ children: { table: { disable: true } },
+ },
+};
+
+const Template = (args) => {
+ const { numberOfCards, ...rest } = args;
+
+ const generateCards = (count) => {
+ return Array.from({ length: count }, (_, index) => (
+ {
+ console.log(e);
+ }}
+ key={index}
+ />
+ ));
+ };
+
+ return (
+ {generateCards(numberOfCards)}
+ );
+};
+
+export const Documentation = () => (
+
+);
+
+Documentation.storyName = "Docs";
+Documentation.argTypes = {
+ numberOfCards: { table: { disable: true } },
+};
+
+// Default story showing a group of MenuCards
+export const Basic = Template.bind({});
+Basic.args = {};
+
+// MenuCardWrapper with custom styles
+export const Custom = Template.bind({});
+Custom.args = {
+ styles: {
+ display: "flex",
+ flexDirection: "column",
+ gap: "32px",
+ padding: "16px",
+ backgroundColor: "#f4f4f4",
+ },
+};
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/MetricCard.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/MetricCard.stories.js
new file mode 100644
index 00000000..a730ca61
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/MetricCard.stories.js
@@ -0,0 +1,184 @@
+import React from "react";
+import MetricCard from "../MetricCard";
+import { Iframe } from "../../atoms";
+
+export default {
+ title: "Molecules/Metric Card",
+ component: MetricCard,
+ argTypes: {
+ metrics: { control: "array", table: { disable: true } },
+ layout: { control: "text", table: { disable: true } },
+ withDivider: { control: "boolean", table: { disable: true } },
+ className: { control: "text", table: { disable: true } },
+ styles: { control: "object", table: { disable: true } },
+ statusmessage: { control: "text", table: { disable: true } },
+ withBottomDivider: { control: "boolean", table: { disable: true } },
+ Dividers: {
+ control: "select",
+ options: ["Vertical", "Horizontal", "Both"],
+ },
+ },
+};
+
+const Template = (args) => {
+ const { Dividers, ...rest } = args;
+ return (
+
+ );
+};
+
+const commonArgs = {
+ metrics: [],
+ className: "",
+ styles: {},
+};
+
+export const Documentation = () => (
+
+);
+
+Documentation.storyName = "Docs";
+Documentation.argTypes = {
+ Dividers: { table: { disable: true } },
+};
+
+export const HorizontallyStacked = Template.bind({});
+HorizontallyStacked.args = {
+ ...commonArgs,
+ layout: "",
+ metrics: [
+ {
+ value: "3%",
+ description: "Test Compilance",
+ statusmessage: "10% than state average",
+ status: "Decreased",
+ },
+ {
+ value: "60%",
+ description: "Quality Tests Passed",
+ statusmessage: "80% than state average",
+ status: "Increased",
+ },
+ {
+ value: "90%",
+ description: "description",
+ statusmessage: "15% than state average",
+ status: "Nochange",
+ },
+ {
+ value: "26%",
+ description: "description",
+ statusmessage: "6% than state average",
+ status: "Increased",
+ },
+ ],
+};
+
+export const VerticallyStacked = Template.bind({});
+VerticallyStacked.args = {
+ ...commonArgs,
+ metrics: [
+ {
+ value: "3%",
+ description: "Test Compilance",
+ statusmessage: "10% than state average",
+ status: "Decreased",
+ },
+ {
+ value: "60%",
+ description: "Quality Tests Passed",
+ statusmessage: "80% than state average",
+ status: "Increased",
+ },
+ {
+ value: "90%",
+ description: "description",
+ statusmessage: "15% than state average",
+ status: "Nochange",
+ },
+ {
+ value: "26%",
+ description: "description",
+ statusmessage: "6% than state average",
+ status: "Increased",
+ },
+ ],
+};
+
+export const Mixed = Template.bind({});
+Mixed.args = {
+ ...commonArgs,
+ layout: "2*2",
+ metrics: [
+ {
+ value: "3%",
+ description: "Test Compilance",
+ statusmessage: "10% than state average",
+ status: "Decreased",
+ },
+ {
+ value: "60%",
+ description: "Quality Tests Passed",
+ statusmessage: "80% than state average",
+ status: "Increased",
+ },
+ {
+ value: "90%",
+ description: "description",
+ statusmessage: "15% than state average",
+ status: "Nochange",
+ },
+ {
+ value: "26%",
+ description: "description",
+ statusmessage: "6% than state average",
+ status: "Increased",
+ },
+ ],
+};
+
+// MetricCard with custom styles
+export const Custom = Template.bind({});
+Custom.args = {
+ className: "",
+ layout: "2*2",
+ metrics: [
+ {
+ value: "3%",
+ description: "Test Compilance",
+ statusmessage: "10% than state average",
+ status: "Decreased",
+ },
+ {
+ value: "60%",
+ description: "Quality Tests Passed",
+ statusmessage: "80% than state average",
+ status: "Increased",
+ },
+ {
+ value: "90%",
+ description: "description",
+ statusmessage: "15% than state average",
+ status: "Nochange",
+ },
+ {
+ value: "26%",
+ description: "description",
+ statusmessage: "6% than state average",
+ status: "Increased",
+ },
+ ],
+ styles: {
+ backgroundColor: "#f9f9f9",
+ borderRadius: "12px",
+ border: "2px solid #333",
+ },
+};
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/PanelCardDocs.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/PanelCardDocs.stories.js
new file mode 100644
index 00000000..eb7132a0
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/PanelCardDocs.stories.js
@@ -0,0 +1,110 @@
+import React from "react";
+import PanelCard from "../PanelCard";
+import { Iframe } from "../../atoms";
+
+export default {
+ title: "Molecules/Panel Card",
+ component: PanelCard,
+ argTypes: {
+ cardClassName: {
+ control: "text",
+ table: { disable: true },
+ },
+ footerChildren: { table: { disable: true } },
+ cardStyles: {
+ control: { type: "object" },
+ table: { disable: true },
+ },
+ children: {
+ control: "object",
+ table: { disable: true },
+ },
+ props: {
+ control: "object",
+ table: { disable: true },
+ },
+ description: {
+ control: "text",
+ name: "Description",
+ table: { disable: true },
+ },
+ showChildrenInline: {
+ control: "boolean",
+ table: { disable: true },
+ },
+ sortFooterButtons: {
+ control: "boolean",
+ table: { disable: true },
+ },
+ maxFooterButtonsAllowed: {
+ control: "text",
+ table: { disable: true },
+ },
+ type: {
+ control: "select",
+ options: ["success", "error"],
+ table: { disable: true },
+ },
+ message: {
+ control: "text",
+ name: "Heading",
+ table: { disable: true },
+ },
+ info: {
+ control: "text",
+ table: { disable: true },
+ },
+ response: {
+ control: "text",
+ table: { disable: true },
+ },
+ customIcon: {
+ control: "text",
+ table: { disable: true },
+ },
+ iconFill: {
+ control: "text",
+ table: { disable: true },
+ },
+ multipleResponses: {
+ control: {
+ type: "array",
+ separator: ",",
+ },
+ table: { disable: true },
+ },
+ className: {
+ control: "text",
+ table: { disable: true },
+ },
+ style: {
+ control: "object",
+ table: { disable: true },
+ },
+ animationProps: {
+ control: "object",
+ table: { disable: true },
+ },
+ footerStyles: {
+ control: "object",
+ table: { disable: true },
+ },
+ additionlWidgets: {
+ control: "boolean",
+ name: "Additional Widgets",
+ table: { disable: true },
+ },
+ Actions: { control: "boolean", table: { disable: true } },
+ showAsSvg: { table: { disable: true } },
+ },
+};
+
+export const Documentation = () => (
+
+);
+
+Documentation.storyName = "Docs";
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/PopupDocs.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/PopupDocs.stories.js
new file mode 100644
index 00000000..152a5c19
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/PopupDocs.stories.js
@@ -0,0 +1,143 @@
+import React, { useState } from "react";
+import PopUp from "../../atoms/PopUp";
+import Iframe from "../../atoms/Iframe";
+
+export default {
+ title: "Molecules/PopUp",
+ component: PopUp,
+ argTypes: {
+ className: {
+ control: "text",
+ table: { disable: true },
+ },
+ type: {
+ control: "select",
+ options: ["default", "alert"],
+ table: { disable: true },
+ },
+ overlayClassName: {
+ control: "text",
+ table: { disable: true },
+ },
+ onOverlayClick: {
+ control: "function",
+ table: { disable: true },
+ },
+ headerclassName: {
+ control: "text",
+ table: { disable: true },
+ },
+ footerclassName: {
+ control: "text",
+ table: { disable: true },
+ },
+ style: {
+ control: "boolean",
+ name: "Custom Width And Height",
+ table: { disable: true },
+ },
+ children: {
+ control: "object",
+ table: { disable: true },
+ },
+ footerChildren: {
+ control: "object",
+ table: { disable: true },
+ },
+ onClose: {
+ control: "function",
+ table: { disable: true },
+ },
+ props: {
+ control: "object",
+ table: { disable: true },
+ },
+ showIcon: {
+ control: "boolean",
+ table: { disable: true },
+ },
+ heading: {
+ control: "text",
+ table: { disable: true },
+ table: { disable: true },
+ },
+ subheading: {
+ control: "text",
+ table: { disable: true },
+ table: { disable: true },
+ },
+ description: {
+ control: "text",
+ table: { disable: true },
+ },
+ alertHeading: {
+ control: "text",
+ name: "Heading",
+ table: { disable: true },
+ },
+ alertMessage: {
+ control: "text",
+ name: "Subheading",
+ table: { disable: true },
+ },
+ iconFill: {
+ control: "text",
+ table: { disable: true },
+ },
+ customIcon: {
+ control: "text",
+ table: { disable: true },
+ },
+ showChildrenInline: {
+ control: "boolean",
+ table: { disable: true },
+ },
+ headerMaxLength: {
+ control: "text",
+ table: { disable: true },
+ },
+ subHeaderMaxLength: {
+ control: "text",
+ table: { disable: true },
+ },
+ sortFooterButtons: {
+ control: "boolean",
+ table: { disable: true },
+ },
+ maxFooterButtonsAllowed: {
+ control: "text",
+ table: { disable: true },
+ },
+ footerStyles: {
+ control: "object",
+ table: { disable: true },
+ },
+ showAlertAsSvg: {
+ control: "boolean",
+ table: { disable: true },
+ },
+ equalWidthButtons: {
+ control: "boolean",
+ table: { disable: true },
+ },
+ headerChildren: { table: { disable: true } },
+ Actions: { control: "boolean", table: { disable: true } },
+ },
+ parameters: {
+ options: {
+ storySort: {
+ order: ["Docs", "Basic", "Alert"],
+ },
+ },
+ },
+};
+
+export const Documentation = () => (
+
+);
+
+Documentation.storyName = "Docs";
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/SideNav.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/SideNav.stories.js
new file mode 100644
index 00000000..bcca5068
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/SideNav.stories.js
@@ -0,0 +1,172 @@
+import React, { Children } from "react";
+import { BrowserRouter as Router } from "react-router-dom";
+import { SideNav } from "../../atoms";
+import {Iframe} from "../../atoms";
+
+export default {
+ title: "Molecules/Side Nav",
+ component: SideNav,
+ argTypes: {
+ items: { control: "object" ,table:{disable:true}},
+ collapsedWidth: { control: "text",table:{disable:true} },
+ expandedWidth: { control: "text" ,table:{disable:true}},
+ transitionDuration: { control: "number" ,table:{disable:true}},
+ theme: { control: "select", options: ["dark", "light"],table:{disable:true} },
+ variant: { control: "select", options: ["Complementary", "Analogous"],mapping:{"Complementary":"primary","Analogous":"secondary"},name:"Selection color"},
+ hideAccessbilityTools: { control: "boolean",name:"Universal actions",mapping:{true:false,false:true} },
+ onSelect:{ action: "onChange",table:{disable:true} },
+ onBottomItemClick:{action:"onChange",table:{disable:true}},
+ enableSearch:{control:"boolean",name:"Enable Search"},
+ styles:{table:{disable:true}}
+ },
+};
+
+const Template = (args) => (
+
+
+
+);
+
+const darkThemeitems = [
+ {
+ label: "Home",
+ icon: {
+ icon: "Home",
+ },
+ },
+ {
+ label: "Module 1",
+ icon: {
+ icon: "ChatBubble",
+ },
+ children: [
+ {
+ path: "/",
+ label: "SubModule 1",
+ icon: {
+ icon: "Work",
+ },
+ },
+ {
+ path: "/",
+ label: "SubModule 2",
+ icon: {
+ icon: "Person",
+ },
+ },
+ ],
+ },
+ {
+ label: "Module 2",
+ icon: {
+ icon: "CheckCircle",
+ },
+ children: [
+ {
+ path: "/",
+ label: "SubModule 1",
+ icon: {
+ icon: "Info",
+ },
+ children: [
+ {
+ path: "/",
+ label: "InnerModule 1",
+ icon: {
+ icon: "LabelImportant",
+ },
+ },
+ {
+ path: "/",
+ label: "InnerModule 2",
+ icon: {
+ icon: "Lock",
+ },
+ },
+ ],
+ },
+ {
+ path: "/",
+ label: "SubModule 2",
+ icon: {
+ icon: "Accessibility",
+ },
+ },
+ ],
+ },
+ {
+ label: "Module 3",
+ icon: {
+ icon: "Delete",
+ },
+ },
+ {
+ label: "Module 4",
+ icon: {
+ icon: "DriveFileMove",
+ },
+ },
+ {
+ label: "Module 5",
+ icon: {
+ icon: "Label",
+ },
+ },
+ {
+ label: "Module 6",
+ icon: {
+ icon: "Lightbulb",
+ },
+ },
+];
+
+const onSelect = (e) =>{
+ console.log(e,"selected")
+}
+const onBottomItemClick =(e) => {
+ console.log(e,"onAccessibilityClick")
+}
+
+const commonArgs = {
+ items: darkThemeitems,
+ transitionDuration: 0.5,
+ onSelect:onSelect,
+ onBottomItemClick:onBottomItemClick,
+ hideAccessbilityTools:true,
+ variant: "Complementary",
+ enableSearch:true
+};
+
+export const Documentation = () => (
+
+);
+
+Documentation.storyName = "Docs";
+Documentation.argTypes = {
+ variant:{table:{disable:true}},
+ hideAccessbilityTools:{table:{disable:true}},
+ enableSearch:{table:{disable:true}},
+}
+
+export const Dark = Template.bind({});
+Dark.args = {
+ ...commonArgs,
+ theme: "dark",
+};
+
+export const Light = Template.bind({});
+Light.args = {
+ ...commonArgs,
+ theme: "light",
+};
+
+export const Custom = Template.bind({});
+Custom.args = {
+ ...commonArgs,
+ collapsedWidth: "80px",
+ expandedWidth: "250px",
+};
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/SidePanelDocs.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/SidePanelDocs.stories.js
new file mode 100644
index 00000000..f9f5db82
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/SidePanelDocs.stories.js
@@ -0,0 +1,50 @@
+import React from "react";
+import SidePanel from "../../atoms/SidePanel";
+import Iframe from "../../atoms/Iframe";
+
+export default {
+ title: "Molecules/Side Panel",
+ component: SidePanel,
+ argTypes: {
+ className: { control: "text" ,table:{disable:true}},
+ styles: { control: "object",table:{disable:true} },
+ type: { control: "select", options: ["static", "dynamic"] ,table:{disable:true}},
+ position: { control: "select", options: ["left", "right"] ,name:"Position",table:{disable:true}},
+ children: {
+ control: "object",table:{disable:true}
+ },
+ header: {
+ control: "object",table:{disable:true}
+ },
+ footer: {
+ control: "object",table:{disable:true}
+ },
+ bgActive: { control: "boolean" ,name:'Background Active',table:{disable:true}},
+ isOverlay: { control: "boolean",table:{disable:true} },
+ hideArrow: { control: "boolean" ,name:'With Nudge',mapping:{
+ true:false,
+ false:true
+ },table:{disable:true}},
+ hideScrollIcon: { control: "boolean",table:{disable:true} },
+ isDraggable: { control: "boolean" ,name:"Draggable",table:{disable:true}},
+ defaultClosedWidth: { control: "text" ,table:{disable:true}},
+ defaultOpenWidth: { control: "text" ,table:{disable:true}},
+ addClose: { control: "boolean",name:"With Close" ,table:{disable:true}},
+ closedHeader: { control: "object" ,table:{disable:true}},
+ closedFooter: { control: "object",table:{disable:true} },
+ closedContents: { control: "object",table:{disable:true} },
+ sections: {control:'boolean',name:"With Sections",table:{disable:true} },
+ closedSections:{table:{disable:true}},
+ transitionDuration:{table:{disable:true}}
+ },
+};
+
+export const Documentation = () => (
+
+);
+
+Documentation.storyName = "Docs";
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/StaticSidePanel.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/StaticSidePanel.stories.js
new file mode 100644
index 00000000..95bcda6e
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/StaticSidePanel.stories.js
@@ -0,0 +1,220 @@
+import React from "react";
+import SidePanel from "../../atoms/SidePanel";
+import Button from "../../atoms/Button";
+
+export default {
+ title: "Molecules/Side Panel/Static",
+ component: SidePanel,
+ argTypes: {
+ className: { control: "text", table: { disable: true } },
+ styles: { control: "object", table: { disable: true } },
+ type: {
+ control: "select",
+ options: ["static", "dynamic"],
+ table: { disable: true },
+ },
+ position: {
+ control: "select",
+ options: ["left", "right"],
+ name: "Position",
+ },
+ children: {
+ control: "object",
+ table: { disable: true },
+ },
+ header: {
+ control: "object",
+ table: { disable: true },
+ },
+ footer: {
+ control: "object",
+ table: { disable: true },
+ },
+ bgActive: { control: "boolean", name: "Background Active" },
+ isOverlay: { control: "boolean", table: { disable: true } },
+ hideArrow: { control: "boolean", table: { disable: true } },
+ hideScrollIcon: { control: "boolean", table: { disable: true } },
+ isDraggable: { control: "boolean", table: { disable: true } },
+ defaultClosedWidth: { control: "text", table: { disable: true } },
+ defaultOpenWidth: { control: "text", table: { disable: true } },
+ addClose: { control: "boolean", name: "With Close" },
+ closedContents: { control: "object", table: { disable: true } },
+ closedHeader: { control: "object", table: { disable: true } },
+ closedFooter: { control: "object", table: { disable: true } },
+ sections: { control: "boolean", name: "With Sections" },
+ closedSections: { table: { disable: true } },
+ transitionDuration: { table: { disable: true } },
+ },
+};
+
+const sectionsToShow = [
+ [
+ ,
+
+ Lorem Ipsum is simply dummy text of the printing and typesetting industry.
+ Lorem Ipsum has been the industry's standard dummy text ever since the
+ 1500s, when an unknown printer took a galley of type and scrambled it to
+ make a type specimen book.
+
,
+ {
+ console.log("clicked");
+ }}
+ size={"medium"}
+ style={{ width: "100%" }}
+ label={"Static SidePanel"}
+ icon={"Edit"}
+ variation={"secondary"}
+ />,
+ ],
+ [
+ ,
+
+ Lorem Ipsum is simply dummy text of the printing and typesetting industry.
+ Lorem Ipsum has been the industry's standard dummy text ever since the
+ 1500s, when an unknown printer took a galley of type and scrambled it to
+ make a type specimen book.
+
,
+ {
+ console.log("clicked");
+ }}
+ size={"medium"}
+ style={{ width: "100%" }}
+ label={"Static SidePanel"}
+ icon={"Edit"}
+ variation={"secondary"}
+ />,
+ ],
+ [
+ ,
+
+ Lorem Ipsum is simply dummy text of the printing and typesetting industry.
+ Lorem Ipsum has been the industry's standard dummy text ever since the
+ 1500s, when an unknown printer took a galley of type and scrambled it to
+ make a type specimen book.
+
,
+ {
+ console.log("clicked");
+ }}
+ size={"medium"}
+ style={{ width: "100%" }}
+ label={"Static SidePanel"}
+ icon={"Edit"}
+ variation={"secondary"}
+ />,
+ ],
+];
+
+const Template = (args) => {
+ const { sections, ...rest } = args;
+ return ;
+};
+
+const commonArgs = {
+ className: "",
+ styles: {},
+ type: "static",
+ position: "right",
+ children: [],
+ header: [],
+ footer: [],
+ bgActive: true,
+ isOverlay: false,
+ isDraggable: false,
+ hideScrollIcon: true,
+ sections: [],
+ defaultClosedWidth: "",
+ defaultOpenWidth: "",
+ addClose: false,
+ closedContents: [],
+ closedSections: [],
+ closedHeader: [],
+ closedFooter: [],
+ hideArrow: false,
+};
+
+const children = [
+ This is static content on the right!
,
+
+ Lorem Ipsum is simply dummy text of the printing and typesetting industry.
+ Lorem Ipsum has been the industry's standard dummy text ever since the
+ 1500s, when an unknown printer took a galley of type and scrambled it to
+ make a type specimen book. It has survived not only five centuries, but also
+ the leap into electronic typesetting, remaining essentially unchanged. It
+ was popularised in the 1960s with the release of Letraset sheets containing
+ Lorem Ipsum passages, and more recently with desktop publishing software
+ like Aldus PageMaker including versions of Lorem Ipsum.
+
,
+];
+
+const header = [
+
+ Header
+
,
+];
+
+const footer = [
+ {
+ console.log("clicked");
+ }}
+ size={"medium"}
+ style={{ width: "100%" }}
+ label={"Static Sidepanel"}
+ icon={"Edit"}
+ variation={"primary"}
+ />,
+];
+
+export const Basic = Template.bind({});
+Basic.args = {
+ ...commonArgs,
+ type: "static",
+ position: "right",
+ children: children,
+ header: header,
+ footer: footer,
+};
+
+export const Custom = Template.bind({});
+Custom.args = {
+ ...commonArgs,
+ type: "static",
+ position: "right",
+ children: children,
+ header: header,
+ footer: footer,
+ defaultOpenWidth: 600,
+};
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/SuccessPanelCard.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/SuccessPanelCard.stories.js
new file mode 100644
index 00000000..53ad41c7
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/SuccessPanelCard.stories.js
@@ -0,0 +1,170 @@
+import React from "react";
+import { AlertCard } from "../../atoms";
+import { Button } from "../../atoms";
+import PanelCard from "../PanelCard";
+
+export default {
+ title: "Molecules/Panel Card/Success",
+ component: PanelCard,
+ argTypes: {
+ cardClassName: {
+ control: "text",
+ table: { disable: true },
+ },
+ footerChildren: { table: { disable: true } },
+ cardStyles: {
+ control: { type: "object" },
+ table: { disable: true },
+ },
+ children: {
+ control: "object",
+ table: { disable: true },
+ },
+ props: {
+ control: "object",
+ table: { disable: true },
+ },
+ description: {
+ control: "text",
+ name: "Description",
+ },
+ showChildrenInline: {
+ control: "boolean",
+ table: { disable: true },
+ },
+ sortFooterButtons: {
+ control: "boolean",
+ table: { disable: true },
+ },
+ maxFooterButtonsAllowed: {
+ control: "text",
+ table: { disable: true },
+ },
+ type: {
+ control: "select",
+ options: ["success", "error"],
+ table: { disable: true },
+ },
+ message: {
+ control: "text",
+ name: "Heading",
+ },
+ info: {
+ control: "text",
+ table: { disable: true },
+ },
+ response: {
+ control: "text",
+ table: { disable: true },
+ },
+ customIcon: {
+ control: "text",
+ table: { disable: true },
+ },
+ iconFill: {
+ control: "text",
+ table: { disable: true },
+ },
+ multipleResponses: {
+ control: {
+ type: "array",
+ separator: ",",
+ },
+ table: { disable: true },
+ },
+ className: {
+ control: "text",
+ table: { disable: true },
+ },
+ style: {
+ control: "object",
+ table: { disable: true },
+ },
+ animationProps: {
+ control: "object",
+ table: { disable: true },
+ },
+ footerStyles: {
+ control: "object",
+ table: { disable: true },
+ },
+ additionlWidgets: { control: "boolean", name: "Additional Widgets" },
+ Actions: { control: "boolean" },
+ showAsSvg:{table:{disable:true}}
+ },
+};
+
+const footerChildrenWithTwoButtons = [
+ console.log("Clicked Button 1")}
+ />,
+ console.log("Clicked Button 2")}
+ />,
+];
+
+const children = [
+ ,
+];
+
+const Template = (args) => {
+ const { additionlWidgets, Actions, ...rest } = args;
+ return (
+
+ );
+};
+
+const commonArgs = {
+ cardClassName: "",
+ cardStyles: {},
+ className: "",
+ style: {},
+ props: {},
+ description:
+ "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
+ showChildrenInline: false,
+ sortFooterButtons: true,
+ maxFooterButtonsAllowed: 5,
+ message: "Success Message",
+ type: "success",
+ info: "Description",
+ response: "949749795479",
+ customIcon: "",
+ iconFill: "",
+ multipleResponses: [],
+ animationProps: {
+ loop: false,
+ noAutoplay: false,
+ },
+ footerStyles: {},
+ Actions: false,
+ additionlWidgets:false
+};
+
+export const Basic = Template.bind({});
+Basic.args = {
+ ...commonArgs,
+};
+
+export const Custom = Template.bind({});
+Custom.args = {
+ ...commonArgs,
+ showAsSvg: true,
+ cardStyles: { width: "620px", height: "590px" },
+};
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/SummaryCard.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/SummaryCard.stories.js
new file mode 100644
index 00000000..161176dd
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/SummaryCard.stories.js
@@ -0,0 +1,234 @@
+import React from "react";
+import SummaryCard from "../SummaryCard";
+import { Tag } from "../../atoms";
+
+export default {
+ title: "Molecules/Card/Summary Card",
+ component: SummaryCard,
+ argTypes: {
+ className: {
+ control: "text",
+ table: { disable: true },
+ },
+ style: {
+ control: { type: "object" },
+ table: { disable: true },
+ },
+ type: {
+ control: "select",
+ options: ["Primary", "Secondary"],
+ name: "Card Style",
+ mapping: { Primary: "primary", Secondary: "secondary" },
+ },
+ header: { control: "text", table: { disable: true } },
+ subHeader: { control: "text", table: { disable: true } },
+ sections: {
+ control: "array",
+ table: { disable: true },
+ },
+ layout: {
+ control: { type: "number", min: 1, max: 2 },
+ name: "Columns",
+ },
+ inline: {
+ control: { type: "select", options: ["Horizontal", "Vertical"] },
+ name: "Layout",
+ },
+ withDivider: { control: "boolean", name: "Divider" },
+ withSectionDivider: { control: "boolean", name: "Section Divider" },
+ showSectionsAsMultipleCards: {
+ control: "boolean",
+ name: "Show Sections As Seperate Cards",
+ },
+ asSeperateCards: { control: "boolean", name: "Show As Seperate Cards" },
+ },
+};
+
+const VerticalSections = [
+ {
+ header: "Personal Information",
+ subHeader: "Basic details",
+ fieldPairs: [
+ { label: "Name", value: "John Doe", inline: false, type: "text" },
+ { label: "Age", value: "28", inline: false },
+ {
+ label: "Profile Picture",
+ value: {
+ src:
+ "https://cdn.pixabay.com/photo/2015/10/05/22/37/blank-profile-picture-973460_1280.png",
+ alt: "Profile",
+ width: "50px",
+ height: "50px",
+ },
+ type: "image",
+ inline: false,
+ },
+ ],
+ cardType: "primary",
+ },
+ {
+ header: "Contact Information",
+ subHeader: "How to reach me",
+ fieldPairs: [
+ { label: "Email", value: "john.doe@example.com", inline: false },
+ {
+ label: "Phone",
+ value: {
+ label: "+1 123-456-7890",
+ onClick: () => alert("Action Clicked..."),
+ variation: "link",
+ size: "medium",
+ style: {},
+ icon: "Call",
+ },
+ type: "action",
+ inline: false,
+ },
+ ],
+ cardType: "primary",
+ },
+ {
+ header: "Address",
+ subHeader: "Where I live",
+ fieldPairs: [
+ { label: "Street", value: "123 Main St", inline: false },
+ { label: "City", value: "Los Angeles", inline: false },
+ { label: "State", value: "CA", inline: false },
+ { label: "Zip Code", value: "90001", inline: false },
+ ],
+ cardType: "primary",
+ },
+ {
+ header: "Other Details",
+ fieldPairs: [
+ {
+ label: "Resume",
+ value: {
+ onClick: (e) => {
+ console.log(e);
+ },
+ },
+ type: "document",
+ inline: false,
+ },
+ {
+ label: "Custom",
+ value: ,
+ type: "custom",
+ inline: false,
+ renderCustomContent: (value) => value,
+ },
+ ],
+ cardType: "primary",
+ },
+];
+
+const sections = [
+ {
+ header: "Personal Information",
+ subHeader: "Basic details",
+ fieldPairs: [
+ { label: "Name", value: "John Doe", inline: true, type: "text" },
+ { label: "Age", value: "28", inline: true },
+ {
+ label: "Profile Picture",
+ value: {
+ src:
+ "https://cdn.pixabay.com/photo/2015/10/05/22/37/blank-profile-picture-973460_1280.png",
+ alt: "Profile",
+ width: "50px",
+ height: "50px",
+ },
+ type: "image",
+ inline: true,
+ },
+ ],
+ cardType: "primary",
+ },
+ {
+ header: "Contact Information",
+ subHeader: "How to reach me",
+ fieldPairs: [
+ { label: "Email", value: "john.doe@example.com", inline: true },
+ {
+ label: "Phone",
+ value: {
+ label: "+1 123-456-7890",
+ onClick: () => alert("Action Clicked..."),
+ variation: "link",
+ size: "medium",
+ style: {},
+ icon: "Call",
+ },
+ type: "action",
+ inline: true,
+ },
+ ],
+ cardType: "primary",
+ },
+ {
+ header: "Address",
+ subHeader: "Where I live",
+ fieldPairs: [
+ { label: "Street", value: "123 Main St", inline: true },
+ { label: "City", value: "Los Angeles", inline: true },
+ { label: "State", value: "CA", inline: true },
+ { label: "Zip Code", value: "90001", inline: true },
+ ],
+ cardType: "primary",
+ },
+ {
+ header: "Other Details",
+ fieldPairs: [
+ {
+ label: "Resume",
+ value: {
+ onClick: (e) => {
+ console.log(e);
+ },
+ },
+ type: "document",
+ inline: true,
+ },
+ {
+ label: "Custom",
+ value: ,
+ type: "custom",
+ inline: true,
+ renderCustomContent: (value) => value,
+ },
+ ],
+ cardType: "primary",
+ },
+];
+
+const Template = (args) => {
+ const { inline, sections, ...rest } = args;
+ return (
+
+ );
+};
+
+const commonArgs = {
+ className: "",
+ style: {},
+ type: "Primary",
+ header: "Heading",
+ subHeader: "Subheading",
+ withDivider: false,
+ layout: 1,
+ sections: sections,
+ withSectionDivider: false,
+ showSectionsAsMultipleCards: false,
+ asSeperateCards: true,
+ inline: "Horizontal",
+};
+
+export const Basic = Template.bind({});
+Basic.args = {
+ ...commonArgs,
+};
+Basic.storyName = "Summary Card";
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/TableMolecule.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/TableMolecule.stories.js
new file mode 100644
index 00000000..6c6c86ad
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/TableMolecule.stories.js
@@ -0,0 +1,2703 @@
+import React from "react";
+import TableMolecule from "../TableMolecule";
+import { Button } from "../../atoms";
+import { Chip } from "../../atoms";
+import {Iframe} from "../../atoms";
+
+export default {
+ title: "Molecules/Table Molecule",
+ component: TableMolecule,
+ argTypes: {
+ headerData: { control: "array" },
+ rows: { control: "array" },
+ pagination: { control: "object" },
+ styles:{control:"object"},
+ tableDetails:{
+ control:"object"
+ },
+ sorting:{
+ control:"object"
+ },
+ selection:{
+ control:"object"
+ },
+ footerProps:{control:"object"},
+ frozenColumns: { control: "number" },
+ isStickyHeader: { control: "boolean" },
+ className:{control:"text"},
+ onFilter:{control:"onchange"},
+ addFilter:{control:"boolean"},
+ onRowClick: { control: "onchange" },
+ actionButtonLabel: { control: "text" },
+ actions: { control: "array" },
+ },
+};
+
+const Template = (args) => ;
+
+const headerData = [
+ { label: "S.No", type: "serialno" },
+ { label: "Text", type: "text"},
+ { label: "Numeric", type: "numeric" },
+ { label: "Description", type: "description" },
+ { label: "Tag", type: "tag" },
+ { label: "Switch", type: "switch" },
+ { label: "Button", type: "button" },
+ { label: "Checkbox", type: "checkbox" },
+ { label: "TextInput", type: "textinput" },
+ { label: "Dropdown", type: "dropdown" },
+ { label: "Multiselectdropdown", type: "multiselectdropdown" },
+ { label: "Custom", type: "custom" },
+];
+
+const headerDataWithDescription = [
+ { label: "S.No", description: "Serialno column", type: "serialno" },
+ { label: "Text", description: "Text column", type: "text" },
+ { label: "Numeric", description: "Numeric column", type: "numeric" },
+ {
+ label: "Description",
+ description: "Description column",
+ type: "description",
+ },
+ { label: "Tag", description: "Tag column", type: "tag" },
+ { label: "Switch", description: "Switch column", type: "switch" },
+ { label: "Button", description: "Button column", type: "button" },
+ { label: "Checkbox", description: "Checkbox column", type: "checkbox" },
+ { label: "TextInput", description: "Textinput column", type: "textinput" },
+ { label: "Dropdown", description: "Dropdown column", type: "dropdown" },
+ {
+ label: "Multiselectdropdown",
+ description: "Multiselectdropdown column",
+ type: "multiselectdropdown",
+ },
+ { label: "Custom", description: "Custom component column", type: "custom" },
+];
+
+const options = [
+ { name: "English", code: "English1" },
+ { name: "Hindi", code: "Hindi2" },
+];
+
+const headerDataForCustomStyles = [
+ { label: "S.No", type: "serialno" },
+ { label: "Text", type: "text" },
+ { label: "Text", type: "text" },
+ { label: "Text", type: "text" },
+ { label: "Numeric", type: "numeric" },
+]
+const samplerows = [
+ [1, "Row1", "Description1", "Example1", 455666],
+ [2, "Row2", "Description2", "Example2", 4553232666],
+ [3, "Row3", "Description3", "Example3", 6666],
+ [4, "Row4", "Description4", "Example4", 32323],
+ [5, "Row5", "Description5", "Example5", 4556266],
+ [6, "Row6", "Description6", "Example6", 455333666],
+ [7, "Row7", "Description7", "Example7", 455666],
+ [8, "Row8", "Description8", "Example8", 343434],
+ [9, "Row9", "Description9", "Example9", 400],
+ [10, "Row10", "Description10", "Example10", 455666],
+];
+
+const headerDataWithAccessors = [
+ { label: "S.No", type: "serialno",accessor:"data?.sno"},
+ { label: "Text", type: "text",accessor:"data?.text"},
+ { label: "Numeric", type: "numeric",accessor:"data?.numeric"},
+ { label: "Description", type: "description",accessor:"data?.description"},
+];
+
+const rowsWithAccessor = [
+ [
+ {
+ data:{
+ sno:1
+ }
+ },
+ {
+ data:{
+ text:"Label"
+ },
+ label:
+ "BLorem ipsum dolor sit amet, consectetuer adipiscing elit. Aeneanp",
+ maxLength: 64,
+ },
+ {
+ data:{
+ numeric:20000
+ },
+ },
+ {
+ data:{
+ description:"description"
+ },
+ label:
+ "BLorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quisppp",
+ maxLength: 256,
+ },
+ ],
+ [
+ {
+ data:{
+ sno:2
+ }
+ },
+ {
+ data:{
+ text:"Label2"
+ },
+ label:
+ "BLorem ipsum dolor sit amet, consectetuer adipiscing elit. Aeneanp",
+ maxLength: 64,
+ },
+ {
+ data:{
+ numeric:20000
+ },
+ },
+ {
+ data:{
+ description:"description2"
+ },
+ label:
+ "BLorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quisppp",
+ maxLength: 256,
+ },
+ ],
+]
+const rows = [
+ [
+ 1,
+ {
+ label:
+ "ALorem ipsum dolor sit amet, consectetuer adipiscing elit. Aeneanp",
+ maxLength: 64,
+ },
+ 10000,
+ {
+ label:
+ "ALorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quisppp",
+ maxLength: 256,
+ },
+ {
+ icon: "",
+ label: "Tag1",
+ labelStyle: {},
+ showIcon: false,
+ style: {},
+ type: "success",
+ className: "",
+ stroke: true,
+ onClick: () => {},
+ alignment: "",
+ iconClassName: "",
+ iconColor: "",
+ },
+ {
+ isLabelFirst: false,
+ label: "Switch1",
+ labelStyle: {},
+ shapeOnOff: true,
+ style: {},
+ disable: false,
+ className: "",
+ isCheckedInitially: false,
+ onToggle: () => {},
+ },
+ {
+ variation: "primary",
+ type: "button",
+ isDisabled: false,
+ showBottom: true,
+ icon: "",
+ size: "medium",
+ label: "Button1",
+ onClick: () => {},
+ style: {},
+ isSuffix: false,
+ textStyles: {},
+ hideDefaultActionIcon: false,
+ options: [],
+ isSearchable: true,
+ optionsKey: "name",
+ onSelect: () => {},
+ menuStyles: {},
+ },
+ {
+ onChange: () => {},
+ label: "Checkbox1",
+ disabled: false,
+ checked: false,
+ style: {},
+ isLabelFirst: false,
+ hideLabel: false,
+ mainClassName: "table-checkbox",
+ props: {},
+ },
+ {
+ type: "text",
+ },
+ {
+ optionKey: "name",
+ option: options,
+ select: (option) => {
+ console.log(option, "selected");
+ },
+ },
+ {
+ optionsKey: "name",
+ options: options,
+ onSelect: (option) => {
+ console.log(option, "selected");
+ },
+ },
+ ,
+ ],
+ [
+ 2,
+ {
+ label:
+ "BLorem ipsum dolor sit amet, consectetuer adipiscing elit. Aeneanp",
+ maxLength: 64,
+ },
+ 20000,
+ {
+ label:
+ "BLorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quisppp",
+ maxLength: 256,
+ },
+ {
+ icon: "",
+ label: "Tag2",
+ labelStyle: {},
+ showIcon: false,
+ style: {},
+ type: "monochrome",
+ className: "",
+ stroke: true,
+ onClick: () => {},
+ alignment: "",
+ iconClassName: "",
+ iconColor: "",
+ },
+ {
+ isLabelFirst: false,
+ label: "Switch2",
+ labelStyle: {},
+ shapeOnOff: true,
+ style: {},
+ disable: false,
+ className: "",
+ isCheckedInitially: false,
+ onToggle: () => {},
+ },
+ {
+ variation: "primary",
+ type: "button",
+ isDisabled: false,
+ showBottom: true,
+ icon: "",
+ size: "medium",
+ label: "Button2",
+ onClick: () => {},
+ style: {},
+ isSuffix: false,
+ textStyles: {},
+ hideDefaultActionIcon: false,
+ options: [],
+ isSearchable: true,
+ optionsKey: "name",
+ onSelect: () => {},
+ menuStyles: {},
+ },
+ {
+ onChange: () => {},
+ label: "Checkbox2",
+ disabled: false,
+ checked: false,
+ style: {},
+ isLabelFirst: false,
+ hideLabel: false,
+ mainClassName: "table-checkbox",
+ props: {},
+ },
+ {
+ type: "text",
+ },
+ {
+ optionKey: "name",
+ option: options,
+ select: (option) => {
+ console.log(option, "selected");
+ },
+ },
+ {
+ optionsKey: "name",
+ options: options,
+ onSelect: (option) => {
+ console.log(option, "selected");
+ },
+ },
+ ,
+ ],
+ [
+ 3,
+ {
+ label:
+ "CLorem ipsum dolor sit amet, consectetuer adipiscing elit. Aeneanp",
+ maxLength: 64,
+ },
+ 30000,
+ {
+ label:
+ "CLorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quisppp",
+ maxLength: 256,
+ },
+ {
+ icon: "",
+ label: "Tag3",
+ labelStyle: {},
+ showIcon: false,
+ style: {},
+ type: "error",
+ className: "",
+ stroke: true,
+ onClick: () => {},
+ alignment: "",
+ iconClassName: "",
+ iconColor: "",
+ },
+ {
+ isLabelFirst: false,
+ label: "Switch3",
+ labelStyle: {},
+ shapeOnOff: true,
+ style: {},
+ disable: false,
+ className: "",
+ isCheckedInitially: false,
+ onToggle: () => {},
+ },
+ {
+ variation: "primary",
+ type: "button",
+ isDisabled: false,
+ showBottom: true,
+ icon: "",
+ size: "medium",
+ label: "Button3",
+ onClick: () => {},
+ style: {},
+ isSuffix: false,
+ textStyles: {},
+ hideDefaultActionIcon: false,
+ options: [],
+ isSearchable: true,
+ optionsKey: "name",
+ onSelect: () => {},
+ menuStyles: {},
+ },
+ {
+ onChange: () => {},
+ label: "Checkbox3",
+ disabled: false,
+ checked: false,
+ style: {},
+ isLabelFirst: false,
+ hideLabel: false,
+ mainClassName: "table-checkbox",
+ props: {},
+ },
+ {
+ type: "text",
+ },
+ {
+ optionKey: "name",
+ option: options,
+ select: (option) => {
+ console.log(option, "selected");
+ },
+ },
+ {
+ optionsKey: "name",
+ options: options,
+ onSelect: (option) => {
+ console.log(option, "selected");
+ },
+ },
+ ,
+ ],
+ [
+ 4,
+ {
+ label:
+ "DLorem ipsum dolor sit amet, consectetuer adipiscing elit. Aeneanp",
+ maxLength: 64,
+ },
+ 40000,
+ {
+ label:
+ "DLorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quisppp",
+ maxLength: 256,
+ },
+ {
+ icon: "",
+ label: "Tag4",
+ labelStyle: {},
+ showIcon: false,
+ style: {},
+ type: "warning",
+ className: "",
+ stroke: true,
+ onClick: () => {},
+ alignment: "",
+ iconClassName: "",
+ iconColor: "",
+ },
+ {
+ isLabelFirst: false,
+ label: "Switch4",
+ labelStyle: {},
+ shapeOnOff: true,
+ style: {},
+ disable: false,
+ className: "",
+ isCheckedInitially: false,
+ onToggle: () => {},
+ },
+ {
+ variation: "primary",
+ type: "button",
+ isDisabled: false,
+ showBottom: true,
+ icon: "",
+ size: "medium",
+ label: "Button4",
+ onClick: () => {},
+ style: {},
+ isSuffix: false,
+ textStyles: {},
+ hideDefaultActionIcon: false,
+ options: [],
+ isSearchable: true,
+ optionsKey: "name",
+ onSelect: () => {},
+ menuStyles: {},
+ },
+ {
+ onChange: () => {},
+ label: "Checkbox4",
+ disabled: false,
+ checked: false,
+ style: {},
+ isLabelFirst: false,
+ hideLabel: false,
+ mainClassName: "table-checkbox",
+ props: {},
+ },
+ {
+ type: "text",
+ },
+ {
+ optionKey: "name",
+ option: options,
+ select: (option) => {
+ console.log(option, "selected");
+ },
+ },
+ {
+ optionsKey: "name",
+ options: options,
+ onSelect: (option) => {
+ console.log(option, "selected");
+ },
+ },
+ ,
+ ],
+ [
+ 5,
+ {
+ label:
+ "ELorem ipsum dolor sit amet, consectetuer adipiscing elit. Aeneanp",
+ maxLength: 64,
+ },
+ 50000,
+ {
+ label:
+ "ELorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quisppp",
+ maxLength: 256,
+ },
+ {
+ icon: "",
+ label: "Tag5",
+ labelStyle: {},
+ showIcon: false,
+ style: {},
+ type: "monochrome",
+ className: "",
+ stroke: true,
+ onClick: () => {},
+ alignment: "",
+ iconClassName: "",
+ iconColor: "",
+ },
+ {
+ isLabelFirst: false,
+ label: "Switch5",
+ labelStyle: {},
+ shapeOnOff: true,
+ style: {},
+ disable: false,
+ className: "",
+ isCheckedInitially: false,
+ onToggle: () => {},
+ },
+ {
+ variation: "primary",
+ type: "button",
+ isDisabled: false,
+ showBottom: true,
+ icon: "",
+ size: "medium",
+ label: "Button5",
+ onClick: () => {},
+ style: {},
+ isSuffix: false,
+ textStyles: {},
+ hideDefaultActionIcon: false,
+ options: [],
+ isSearchable: true,
+ optionsKey: "name",
+ onSelect: () => {},
+ menuStyles: {},
+ },
+ {
+ onChange: () => {},
+ label: "Checkbox5",
+ disabled: false,
+ checked: false,
+ style: {},
+ isLabelFirst: false,
+ hideLabel: false,
+ mainClassName: "table-checkbox",
+ props: {},
+ },
+ {
+ type: "text",
+ },
+ {
+ optionKey: "name",
+ option: options,
+ select: (option) => {
+ console.log(option, "selected");
+ },
+ },
+ {
+ optionsKey: "name",
+ options: options,
+ onSelect: (option) => {
+ console.log(option, "selected");
+ },
+ },
+ ,
+ ],
+ [
+ 6,
+ {
+ label:
+ "FLorem ipsum dolor sit amet, consectetuer adipiscing elit. Aeneanp",
+ maxLength: 64,
+ },
+ 60000,
+ {
+ label:
+ "FLorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quisppp",
+ maxLength: 256,
+ },
+ {
+ icon: "",
+ label: "Tag6",
+ labelStyle: {},
+ showIcon: false,
+ style: {},
+ type: "success",
+ className: "",
+ stroke: true,
+ onClick: () => {},
+ alignment: "",
+ iconClassName: "",
+ iconColor: "",
+ },
+ {
+ isLabelFirst: false,
+ label: "Switch6",
+ labelStyle: {},
+ shapeOnOff: true,
+ style: {},
+ disable: false,
+ className: "",
+ isCheckedInitially: false,
+ onToggle: () => {},
+ },
+ {
+ variation: "primary",
+ type: "button",
+ isDisabled: false,
+ showBottom: true,
+ icon: "",
+ size: "medium",
+ label: "Button6",
+ onClick: () => {},
+ style: {},
+ isSuffix: false,
+ textStyles: {},
+ hideDefaultActionIcon: false,
+ options: [],
+ isSearchable: true,
+ optionsKey: "name",
+ onSelect: () => {},
+ menuStyles: {},
+ },
+ {
+ onChange: () => {},
+ label: "Checkbox",
+ disabled: false,
+ checked: false,
+ style: {},
+ isLabelFirst: false,
+ hideLabel: false,
+ mainClassName: "table-checkbox",
+ props: {},
+ },
+ {
+ type: "text",
+ },
+ {
+ optionKey: "name",
+ option: options,
+ select: (option) => {
+ console.log(option, "selected");
+ },
+ },
+ {
+ optionsKey: "name",
+ options: options,
+ onSelect: (option) => {
+ console.log(option, "selected");
+ },
+ },
+ ,
+ ],
+ [
+ 7,
+ {
+ label:
+ "GLorem ipsum dolor sit amet, consectetuer adipiscing elit. Aeneanp",
+ maxLength: 64,
+ },
+ 70000,
+ {
+ label:
+ "GLorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quisppp",
+ maxLength: 256,
+ },
+ {
+ icon: "",
+ label: "Tag7",
+ labelStyle: {},
+ showIcon: false,
+ style: {},
+ type: "success",
+ className: "",
+ stroke: true,
+ onClick: () => {},
+ alignment: "",
+ iconClassName: "",
+ iconColor: "",
+ },
+ {
+ isLabelFirst: false,
+ label: "Switch7",
+ labelStyle: {},
+ shapeOnOff: true,
+ style: {},
+ disable: false,
+ className: "",
+ isCheckedInitially: false,
+ onToggle: () => {},
+ },
+ {
+ variation: "primary",
+ type: "button",
+ isDisabled: false,
+ showBottom: true,
+ icon: "",
+ size: "medium",
+ label: "Button7",
+ onClick: () => {},
+ style: {},
+ isSuffix: false,
+ textStyles: {},
+ hideDefaultActionIcon: false,
+ options: [],
+ isSearchable: true,
+ optionsKey: "name",
+ onSelect: () => {},
+ menuStyles: {},
+ },
+ {
+ onChange: () => {},
+ label: "Checkbox7",
+ disabled: false,
+ checked: false,
+ style: {},
+ isLabelFirst: false,
+ hideLabel: false,
+ mainClassName: "table-checkbox",
+ props: {},
+ },
+ {
+ type: "text",
+ },
+ {
+ optionKey: "name",
+ option: options,
+ select: (option) => {
+ console.log(option, "selected");
+ },
+ },
+ {
+ optionsKey: "name",
+ options: options,
+ onSelect: (option) => {
+ console.log(option, "selected");
+ },
+ },
+ ,
+ ],
+ [
+ 8,
+ {
+ label:
+ "HLorem ipsum dolor sit amet, consectetuer adipiscing elit. Aeneanp",
+ maxLength: 64,
+ },
+ 80000,
+ {
+ label:
+ "HLorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quisppp",
+ maxLength: 256,
+ },
+ {
+ icon: "",
+ label: "Tag8",
+ labelStyle: {},
+ showIcon: false,
+ style: {},
+ type: "success",
+ className: "",
+ stroke: true,
+ onClick: () => {},
+ alignment: "",
+ iconClassName: "",
+ iconColor: "",
+ },
+ {
+ isLabelFirst: false,
+ label: "Switch8",
+ labelStyle: {},
+ shapeOnOff: true,
+ style: {},
+ disable: false,
+ className: "",
+ isCheckedInitially: false,
+ onToggle: () => {},
+ },
+ {
+ variation: "primary",
+ type: "button",
+ isDisabled: false,
+ showBottom: true,
+ icon: "",
+ size: "medium",
+ label: "Button8",
+ onClick: () => {},
+ style: {},
+ isSuffix: false,
+ textStyles: {},
+ hideDefaultActionIcon: false,
+ options: [],
+ isSearchable: true,
+ optionsKey: "name",
+ onSelect: () => {},
+ menuStyles: {},
+ },
+ {
+ onChange: () => {},
+ label: "Checkbox8",
+ disabled: false,
+ checked: false,
+ style: {},
+ isLabelFirst: false,
+ hideLabel: false,
+ mainClassName: "table-checkbox",
+ props: {},
+ },
+ {
+ type: "text",
+ },
+ {
+ optionKey: "name",
+ option: options,
+ select: (option) => {
+ console.log(option, "selected");
+ },
+ },
+ {
+ optionsKey: "name",
+ options: options,
+ onSelect: (option) => {
+ console.log(option, "selected");
+ },
+ },
+ ,
+ ],
+ [
+ 9,
+ {
+ label:
+ "ILorem ipsum dolor sit amet, consectetuer adipiscing elit. Aeneanp",
+ maxLength: 64,
+ },
+ 90000,
+ {
+ label:
+ "ILorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quisppp",
+ maxLength: 256,
+ },
+ {
+ icon: "",
+ label: "Tag9",
+ labelStyle: {},
+ showIcon: false,
+ style: {},
+ type: "error",
+ className: "",
+ stroke: true,
+ onClick: () => {},
+ alignment: "",
+ iconClassName: "",
+ iconColor: "",
+ },
+ {
+ isLabelFirst: false,
+ label: "Switch9",
+ labelStyle: {},
+ shapeOnOff: true,
+ style: {},
+ disable: false,
+ className: "",
+ isCheckedInitially: false,
+ onToggle: () => {},
+ },
+ {
+ variation: "primary",
+ type: "button",
+ isDisabled: false,
+ showBottom: true,
+ icon: "",
+ size: "medium",
+ label: "Button9",
+ onClick: () => {},
+ style: {},
+ isSuffix: false,
+ textStyles: {},
+ hideDefaultActionIcon: false,
+ options: [],
+ isSearchable: true,
+ optionsKey: "name",
+ onSelect: () => {},
+ menuStyles: {},
+ },
+ {
+ onChange: () => {},
+ label: "Checkbox9",
+ disabled: false,
+ checked: false,
+ style: {},
+ isLabelFirst: false,
+ hideLabel: false,
+ mainClassName: "table-checkbox",
+ props: {},
+ },
+ {
+ type: "text",
+ },
+ {
+ optionKey: "name",
+ option: options,
+ select: (option) => {
+ console.log(option, "selected");
+ },
+ },
+ {
+ optionsKey: "name",
+ options: options,
+ onSelect: (option) => {
+ console.log(option, "selected");
+ },
+ },
+ ,
+ ],
+ [
+ 10,
+ {
+ label:
+ "JLorem ipsum dolor sit amet, consectetuer adipiscing elit. Aeneanp",
+ maxLength: 64,
+ },
+ 100000,
+ {
+ label:
+ "JLorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quisppp",
+ maxLength: 256,
+ },
+ {
+ icon: "",
+ label: "Tag10",
+ labelStyle: {},
+ showIcon: false,
+ style: {},
+ type: "warning",
+ className: "",
+ stroke: true,
+ onClick: () => {},
+ alignment: "",
+ iconClassName: "",
+ iconColor: "",
+ },
+ {
+ isLabelFirst: false,
+ label: "Switch10",
+ labelStyle: {},
+ shapeOnOff: true,
+ style: {},
+ disable: false,
+ className: "",
+ isCheckedInitially: false,
+ onToggle: () => {},
+ },
+ {
+ variation: "primary",
+ type: "button",
+ isDisabled: false,
+ showBottom: true,
+ icon: "",
+ size: "medium",
+ label: "Button10",
+ onClick: () => {},
+ style: {},
+ isSuffix: false,
+ textStyles: {},
+ hideDefaultActionIcon: false,
+ options: [],
+ isSearchable: true,
+ optionsKey: "name",
+ onSelect: () => {},
+ menuStyles: {},
+ },
+ {
+ onChange: () => {},
+ label: "Checkbox10",
+ disabled: false,
+ checked: false,
+ style: {},
+ isLabelFirst: false,
+ hideLabel: false,
+ mainClassName: "table-checkbox",
+ props: {},
+ },
+ {
+ type: "text",
+ },
+ {
+ optionKey: "name",
+ option: options,
+ select: (option) => {
+ console.log(option, "selected");
+ },
+ },
+ {
+ optionsKey: "name",
+ options: options,
+ onSelect: (option) => {
+ console.log(option, "selected");
+ },
+ },
+ ,
+ ],
+];
+
+const actions = [
+
+
+
+
+
+
console.log("clicked")}
+ size={"medium"}
+ />
+ console.log("clicked")}
+ size={"medium"}
+ />
+ ,
+];
+
+const rowsWithNestedTable = [
+ [
+ {
+ data:{
+ sno:1
+ }
+ },
+ {
+ data:{
+ text:"Label"
+ },
+ label:
+ "BLorem ipsum dolor sit amet, consectetuer adipiscing elit. Aeneanp",
+ maxLength: 64,
+ },
+ {
+ data:{
+ numeric:20000
+ },
+ },
+ {
+ data:{
+ description:"description"
+ },
+ label:
+ "BLorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quisppp",
+ maxLength: 256,
+ },
+ {
+ nestedData:{
+ headerData:headerDataForCustomStyles,
+ rows:samplerows,
+ tableDetails:{
+ tableTitle: "Nested Table Title",
+ tableDescription: "Nested Table Description",
+ addClose:true
+ },
+ }
+ }
+ ],
+ [
+ {
+ data:{
+ sno:2
+ }
+ },
+ {
+ data:{
+ text:"Label2"
+ },
+ label:
+ "BLorem ipsum dolor sit amet, consectetuer adipiscing elit. Aeneanp",
+ maxLength: 64,
+ },
+ {
+ data:{
+ numeric:20000
+ },
+ },
+ {
+ data:{
+ description:"description2"
+ },
+ label:
+ "BLorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quisppp",
+ maxLength: 256,
+ },
+ {
+ nestedData:{
+ headerData:headerDataForCustomStyles,
+ rows:samplerows,
+ tableDetails:{
+ tableTitle: "Nested Table Title",
+ tableDescription: "Nested Table Description",
+ addClose:true
+ },
+ }
+ }
+ ],
+]
+
+const singlerowWithNestedTable = [
+ [
+ {
+ data:{
+ sno:1
+ }
+ },
+ {
+ data:{
+ text:"Label"
+ },
+ label:
+ "BLorem ipsum dolor sit amet, consectetuer adipiscing elit. Aeneanp",
+ maxLength: 64,
+ },
+ {
+ data:{
+ numeric:20000
+ },
+ },
+ {
+ data:{
+ description:"description"
+ },
+ label:
+ "BLorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quisppp",
+ maxLength: 256,
+ },
+ ],
+ [
+ {
+ data:{
+ sno:2
+ }
+ },
+ {
+ data:{
+ text:"Label2"
+ },
+ label:
+ "BLorem ipsum dolor sit amet, consectetuer adipiscing elit. Aeneanp",
+ maxLength: 64,
+ },
+ {
+ data:{
+ numeric:20000
+ },
+ },
+ {
+ data:{
+ description:"description2"
+ },
+ label:
+ "BLorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quisppp",
+ maxLength: 256,
+ },
+ {
+ nestedData:{
+ headerData:headerDataForCustomStyles,
+ rows:samplerows
+ }
+ }
+ ],
+]
+
+const commonArgs = {
+ headerData: [],
+ rows: [],
+ styles:{
+ withBorder: false,
+ withAlternateBg: false,
+ withHeaderDivider: true,
+ withColumnDivider: false,
+ withRowDivider: true,
+ extraStyles: {},
+ },
+ pagination:{
+ initialRowsPerPage:5,
+ rowsPerPageOptions:[5,10,15,20],
+ manualPagination:false,
+ onNextPage:()=>{},
+ onPrevPage:()=>{},
+ onPageSizeChange:()=>{}
+ },
+ tableDetails:{
+ tableTitle: "",
+ tableDescription: "",
+ },
+ sorting:{
+ isTableSortable:false,
+ initialSortOrder:"",
+ customSortFunction:()=>{}
+ },
+ selection: {
+ addCheckbox: false,
+ checkboxLabel: '',
+ initialSelectedRows: [],
+ onSelectedRowsChange: () => {},
+ showSelectedState: false,
+ },
+ footerProps: {
+ footerContent: null,
+ hideFooter: false,
+ stickyFooterContent: null,
+ scrollableStickyFooterContent: true,
+ isStickyFooter: false,
+ addStickyFooter: false,
+ },
+ frozenColumns: 0,
+ isStickyHeader: false,
+ onRowClick:()=>{},
+ actionButtonLabel: "",
+ actions:[],
+ className:"",
+ addFilter:false,
+ onFilter:()=>{},
+}
+
+export const Documentation = () => (
+
+);
+
+Documentation.storyName = "Docs";
+
+
+export const Default = Template.bind({});
+Default.args = {
+ ...commonArgs,
+ headerData: headerData,
+ rows:rows,
+ pagination:{
+ initialRowsPerPage: 2,
+ rowsPerPageOptions: [2, 4, 6, 8, 10],
+ },
+ styles:{
+ withAlternateBg: false,
+ withColumnDivider: false,
+ extraStyles: {},
+ withHeaderDivider:true,
+ withRowDivider:true,
+ withBorder:true,
+ },
+ selection: {
+ addCheckbox: false,
+ checkboxLabel: '',
+ initialSelectedRows: [],
+ onSelectedRowsChange: (e) => {
+ console.log("These are the selected rows", e);
+ },
+ showSelectedState: false,
+ },
+ onRowClick:undefined,
+};
+
+export const HeadersWithDescription = Template.bind({});
+HeadersWithDescription.args = {
+ ...commonArgs,
+ headerData: headerDataWithDescription,
+ rows:rows,
+ pagination:{
+ initialRowsPerPage: 2,
+ rowsPerPageOptions: [2, 4, 6, 8, 10],
+ },
+ styles:{
+ withAlternateBg: false,
+ withColumnDivider: false,
+ extraStyles: {},
+ withHeaderDivider:true,
+ withRowDivider:true,
+ withBorder:true,
+ },
+ selection: {
+ addCheckbox: false,
+ checkboxLabel: '',
+ initialSelectedRows: [],
+ onSelectedRowsChange: (e) => {
+ console.log("These are the selected rows", e);
+ },
+ showSelectedState: false,
+ },
+ onRowClick:undefined
+};
+
+export const WithBorder = Template.bind({});
+WithBorder.args = {
+ headerData: headerData,
+ rows: rows,
+ pagination:{
+ initialRowsPerPage: 2,
+ rowsPerPageOptions: [2, 4, 6, 8, 10],
+ },
+ styles:{
+ withAlternateBg: false,
+ withColumnDivider: false,
+ extraStyles: {},
+ withHeaderDivider:false,
+ withRowDivider:false,
+ withBorder:true,
+ },
+ selection: {
+ addCheckbox: false,
+ checkboxLabel: '',
+ initialSelectedRows: [],
+ onSelectedRowsChange: (e) => {
+ console.log("These are the selected rows", e);
+ },
+ showSelectedState: false,
+ },
+ footerProps: {
+ footerContent: "Footer Content",
+ hideFooter: false,
+ stickyFooterContent: "Sticky Footer Content",
+ scrollableStickyFooterContent: true,
+ isStickyFooter: false,
+ addStickyFooter: false,
+ },
+ frozenColumns: 0,
+ isStickyHeader: false,
+};
+
+export const WithHeaderDivider = Template.bind({});
+WithHeaderDivider.args = {
+ headerData: headerData,
+ rows:rows,
+ pagination:{
+ initialRowsPerPage: 2,
+ rowsPerPageOptions: [2, 4, 6, 8, 10],
+ },
+ styles:{
+ withAlternateBg: false,
+ withColumnDivider: false,
+ extraStyles: {},
+ withHeaderDivider:true,
+ withRowDivider:false,
+ withBorder:true,
+ },
+ selection: {
+ addCheckbox: false,
+ checkboxLabel: '',
+ initialSelectedRows: [],
+ onSelectedRowsChange: (e) => {
+ console.log("These are the selected rows", e);
+ },
+ showSelectedState: false,
+ },
+ onRowClick: undefined,
+ footerProps: {
+ footerContent: "Footer Content",
+ hideFooter: false,
+ stickyFooterContent: "Sticky Footer Content",
+ scrollableStickyFooterContent: true,
+ isStickyFooter: false,
+ addStickyFooter: false,
+ },
+ frozenColumns: 0,
+ isStickyHeader: false,
+};
+
+export const WithOnlyColumnDivider = Template.bind({});
+WithOnlyColumnDivider.args = {
+ headerData: headerData,
+ rows:rows,
+ pagination:{
+ initialRowsPerPage: 2,
+ rowsPerPageOptions: [2, 4, 6, 8, 10],
+ },
+ styles:{
+ withAlternateBg: false,
+ withColumnDivider: true,
+ extraStyles: {},
+ withHeaderDivider:false,
+ withRowDivider:false,
+ withBorder:true,
+ },
+ selection: {
+ addCheckbox: false,
+ checkboxLabel: 'Select All',
+ initialSelectedRows: [],
+ onSelectedRowsChange: (e) => {
+ console.log("These are the selected rows", e);
+ },
+ showSelectedState: false,
+ },
+ footerProps: {
+ footerContent: "Footer Content",
+ hideFooter: false,
+ stickyFooterContent: "Sticky Footer Content",
+ scrollableStickyFooterContent: true,
+ isStickyFooter: false,
+ addStickyFooter: false,
+ },
+ frozenColumns: 0,
+ isStickyHeader: false,
+};
+
+export const WithColumnDividerAndHeaderDivider = Template.bind({});
+WithColumnDividerAndHeaderDivider.args = {
+ headerData: headerData,
+ rows:rows,
+ pagination:{
+ initialRowsPerPage: 2,
+ rowsPerPageOptions: [2, 4, 6, 8, 10],
+ },
+ styles:{
+ withAlternateBg: false,
+ withColumnDivider: true,
+ extraStyles: {},
+ withHeaderDivider:true,
+ withRowDivider:false,
+ withBorder:true,
+ },
+ selection: {
+ addCheckbox: false,
+ checkboxLabel: '',
+ initialSelectedRows: [],
+ onSelectedRowsChange: (e) => {
+ console.log("These are the selected rows", e);
+ },
+ showSelectedState: false,
+ },
+ footerProps: {
+ footerContent: "Footer Content",
+ hideFooter: false,
+ stickyFooterContent: "Sticky Footer Content",
+ scrollableStickyFooterContent: true,
+ isStickyFooter: false,
+ addStickyFooter: false,
+ },
+ frozenColumns: 0,
+ isStickyHeader: false,
+};
+
+export const WithRowDivider = Template.bind({});
+WithRowDivider.args = {
+ headerData: headerData,
+ rows:rows,
+ pagination:{
+ initialRowsPerPage: 2,
+ rowsPerPageOptions: [2, 4, 6, 8, 10],
+ },
+ styles:{
+ withAlternateBg: false,
+ withColumnDivider: false,
+ extraStyles: {},
+ withHeaderDivider:false,
+ withRowDivider:true,
+ withBorder:true,
+ },
+ selection: {
+ addCheckbox: false,
+ checkboxLabel: '',
+ initialSelectedRows: [],
+ onSelectedRowsChange: (e) => {
+ console.log("These are the selected rows", e);
+ },
+ showSelectedState: false,
+ },
+ footerProps: {
+ footerContent: "Footer Content",
+ hideFooter: false,
+ stickyFooterContent: "Sticky Footer Content",
+ scrollableStickyFooterContent: true,
+ isStickyFooter: false,
+ addStickyFooter: false,
+ },
+ frozenColumns: 0,
+ isStickyHeader: false,
+};
+
+export const WithAlternateBg = Template.bind({});
+WithAlternateBg.args = {
+ headerData: headerData,
+ rows:rows,
+ pagination:{
+ initialRowsPerPage: 2,
+ rowsPerPageOptions: [2, 4, 6, 8, 10],
+ },
+ styles:{
+ withAlternateBg: true,
+ withColumnDivider: false,
+ extraStyles: {},
+ withHeaderDivider:false,
+ withRowDivider:false,
+ withBorder:true,
+ },
+ selection: {
+ addCheckbox: false,
+ checkboxLabel: '',
+ initialSelectedRows: [],
+ onSelectedRowsChange: (e) => {
+ console.log("These are the selected rows", e);
+ },
+ showSelectedState: false,
+ },
+ footerProps: {
+ footerContent: "Footer Content",
+ hideFooter: false,
+ stickyFooterContent: "Sticky Footer Content",
+ scrollableStickyFooterContent: true,
+ isStickyFooter: false,
+ addStickyFooter: false,
+ },
+ frozenColumns: 0,
+ isStickyHeader: false,
+};
+
+export const WithAll = Template.bind({});
+WithAll.args = {
+ headerData: headerData,
+ rows:rows,
+ pagination:{
+ initialRowsPerPage: 2,
+ rowsPerPageOptions: [2, 4, 6, 8, 10],
+ },
+ styles:{
+ extraStyles: {},
+ withBorder:true,
+ withHeaderDivider: true,
+ withColumnDivider: true,
+ withRowDivider: true,
+ withAlternateBg:true
+ },
+ selection: {
+ addCheckbox: false,
+ checkboxLabel: '',
+ initialSelectedRows: [],
+ onSelectedRowsChange: (e) => {
+ console.log("These are the selected rows", e);
+ },
+ showSelectedState: false,
+ },
+ footerProps: {
+ footerContent: "Footer Content",
+ hideFooter: false,
+ stickyFooterContent: "Sticky Footer Content",
+ scrollableStickyFooterContent: true,
+ isStickyFooter: false,
+ addStickyFooter: false,
+ },
+ frozenColumns: 0,
+ isStickyHeader: false,
+};
+
+export const WithStickyHeader = Template.bind({});
+WithStickyHeader.args = {
+ headerData: headerData,
+ rows:rows,
+ pagination:{
+ initialRowsPerPage: 2,
+ rowsPerPageOptions: [2, 4, 6, 8, 10],
+ },
+ styles:{
+ withAlternateBg: false,
+ withColumnDivider: false,
+ extraStyles: {},
+ withHeaderDivider:true,
+ withRowDivider:true,
+ withBorder:true,
+ },
+ selection: {
+ addCheckbox: false,
+ checkboxLabel: '',
+ initialSelectedRows: [],
+ onSelectedRowsChange: (e) => {
+ console.log("These are the selected rows", e);
+ },
+ showSelectedState: false,
+ },
+ footerProps: {
+ footerContent: "Footer Content",
+ hideFooter: false,
+ stickyFooterContent: "Sticky Footer Content",
+ scrollableStickyFooterContent: true,
+ isStickyFooter: false,
+ addStickyFooter: false,
+ },
+ onRowClick: undefined,
+ frozenColumns: 0,
+ isStickyHeader: true,
+};
+
+export const WithStickyFooter = Template.bind({});
+WithStickyFooter.args = {
+ headerData: headerData,
+ rows:rows,
+ pagination:{
+ initialRowsPerPage: 2,
+ rowsPerPageOptions: [2, 4, 6, 8, 10],
+ },
+ styles:{
+ withAlternateBg: false,
+ withColumnDivider: false,
+ extraStyles: {},
+ withHeaderDivider:true,
+ withRowDivider:true,
+ withBorder:true,
+ },
+ selection: {
+ addCheckbox: false,
+ checkboxLabel: '',
+ initialSelectedRows: [],
+ onSelectedRowsChange: (e) => {
+ console.log("These are the selected rows", e);
+ },
+ showSelectedState: false,
+ },
+ footerProps: {
+ footerContent: "Footer Content",
+ hideFooter: false,
+ stickyFooterContent: "Sticky Footer Content",
+ scrollableStickyFooterContent: true,
+ isStickyFooter: true,
+ addStickyFooter: false,
+ },
+ frozenColumns: 0,
+ isStickyHeader: false,
+};
+
+export const WithStickyFooterAndHeader = Template.bind({});
+WithStickyFooterAndHeader.args = {
+ headerData: headerData,
+ rows:rows,
+ pagination:{
+ initialRowsPerPage: 2,
+ rowsPerPageOptions: [2, 4, 6, 8, 10],
+ },
+ styles:{
+ withAlternateBg: false,
+ withColumnDivider: false,
+ extraStyles: {},
+ withHeaderDivider:true,
+ withRowDivider:true,
+ withBorder:true,
+ },
+ selection: {
+ addCheckbox: false,
+ checkboxLabel: '',
+ initialSelectedRows: [],
+ onSelectedRowsChange: (e) => {
+ console.log("These are the selected rows", e);
+ },
+ showSelectedState: false,
+ },
+ footerProps: {
+ footerContent: "Footer Content",
+ hideFooter: false,
+ stickyFooterContent: "Sticky Footer Content",
+ scrollableStickyFooterContent: true,
+ isStickyFooter: true,
+ addStickyFooter: false,
+ },
+ frozenColumns: 0,
+ isStickyHeader: true,
+};
+
+export const WithFrozenColumns = Template.bind({});
+WithFrozenColumns.args = {
+ ...commonArgs,
+ headerData: headerData,
+ rows:rows,
+ pagination:{
+ initialRowsPerPage: 2,
+ rowsPerPageOptions: [2, 4, 6, 8, 10],
+ },
+ styles:{
+ withAlternateBg: false,
+ withColumnDivider: true,
+ extraStyles: {},
+ withHeaderDivider:false,
+ withRowDivider:true,
+ withBorder:true,
+ },
+ selection: {
+ addCheckbox: false,
+ checkboxLabel: '',
+ initialSelectedRows: [],
+ onSelectedRowsChange: (e) => {
+ console.log("These are the selected rows", e);
+ },
+ showSelectedState: false,
+ },
+ onRowClick:undefined,
+ frozenColumns:2
+};
+
+export const WithTitle = Template.bind({});
+WithTitle.args = {
+ headerData: headerData,
+ rows:rows,
+ pagination:{
+ initialRowsPerPage: 2,
+ rowsPerPageOptions: [2, 4, 6, 8, 10],
+ },
+ styles:{
+ withAlternateBg: false,
+ withColumnDivider: false,
+ extraStyles: {},
+ withHeaderDivider:true,
+ withRowDivider:true,
+ withBorder:true,
+ },
+ tableDetails:{
+ tableTitle: "Table Title",
+ tableDescription: "",
+ },
+ selection: {
+ addCheckbox: false,
+ checkboxLabel: '',
+ initialSelectedRows: [],
+ onSelectedRowsChange: (e) => {
+ console.log("These are the selected rows", e);
+ },
+ showSelectedState: false,
+ },
+ footerProps: {
+ footerContent: "Footer Content",
+ hideFooter: false,
+ stickyFooterContent: "Sticky Footer Content",
+ scrollableStickyFooterContent: true,
+ isStickyFooter: false,
+ addStickyFooter: false,
+ },
+ frozenColumns: 0,
+ isStickyHeader: false,
+};
+
+export const WithTableDescription = Template.bind({});
+WithTableDescription.args = {
+ headerData: headerData,
+ rows:rows,
+ pagination:{
+ initialRowsPerPage: 2,
+ rowsPerPageOptions: [2, 4, 6, 8, 10],
+ },
+ styles:{
+ withAlternateBg: false,
+ withColumnDivider: false,
+ extraStyles: {},
+ withHeaderDivider:true,
+ withRowDivider:true,
+ withBorder:true,
+ },
+ tableDetails:{
+ tableTitle: "Table Title",
+ tableDescription: "Table Description",
+ },
+ selection: {
+ addCheckbox: false,
+ checkboxLabel: '',
+ initialSelectedRows: [],
+ onSelectedRowsChange: (e) => {
+ console.log("These are the selected rows", e);
+ },
+ showSelectedState: false,
+ },
+ footerProps: {
+ footerContent: "Footer Content",
+ hideFooter: false,
+ stickyFooterContent: "Sticky Footer Content",
+ scrollableStickyFooterContent: true,
+ isStickyFooter: false,
+ addStickyFooter: false,
+ },
+ frozenColumns: 0,
+ isStickyHeader: false,
+};
+
+export const WithAddCheckbox = Template.bind({});
+WithAddCheckbox.args = {
+ headerData: headerData,
+ rows:rows,
+ pagination:{
+ initialRowsPerPage: 2,
+ rowsPerPageOptions: [2, 4, 6, 8, 10],
+ },
+ styles:{
+ withAlternateBg: false,
+ withColumnDivider: false,
+ extraStyles: {},
+ withHeaderDivider:true,
+ withRowDivider:true,
+ withBorder:true,
+ },
+ selection: {
+ addCheckbox: true,
+ checkboxLabel: 'Select All',
+ initialSelectedRows: [],
+ onSelectedRowsChange: (e) => {
+ console.log("These are the selected rows", e);
+ },
+ showSelectedState: false,
+ },
+ footerProps: {
+ footerContent: "Footer Content",
+ hideFooter: false,
+ stickyFooterContent: "Sticky Footer Content",
+ scrollableStickyFooterContent: true,
+ isStickyFooter: false,
+ addStickyFooter: false,
+ },
+ frozenColumns: 0,
+ isStickyHeader: false,
+};
+
+export const WithAddCheckboxAndSelectionState = Template.bind({});
+WithAddCheckboxAndSelectionState.args = {
+ headerData: headerData,
+ rows:rows,
+ pagination:{
+ initialRowsPerPage: 2,
+ rowsPerPageOptions: [2, 4, 6, 8, 10],
+ },
+ styles:{
+ withAlternateBg: false,
+ withColumnDivider: false,
+ extraStyles: {},
+ withHeaderDivider:true,
+ withRowDivider:true,
+ withBorder:true,
+ },
+ selection: {
+ addCheckbox: true,
+ checkboxLabel: 'Select All',
+ initialSelectedRows: [],
+ onSelectedRowsChange: (e) => {
+ console.log("These are the selected rows", e);
+ },
+ showSelectedState: true,
+ },
+ footerProps: {
+ footerContent: "Footer Content",
+ hideFooter: false,
+ stickyFooterContent: "Sticky Footer Content",
+ scrollableStickyFooterContent: true,
+ isStickyFooter: false,
+ addStickyFooter: false,
+ },
+ frozenColumns: 0,
+ isStickyHeader: false,
+ actionButtonLabel: "",
+};
+
+export const WithAddCheckboxAndSelectionStateAndInitialSelectedRows = Template.bind(
+ {}
+);
+WithAddCheckboxAndSelectionStateAndInitialSelectedRows.args = {
+ headerData: headerData,
+ rows:rows,
+ pagination:{
+ initialRowsPerPage: 2,
+ rowsPerPageOptions: [2, 4, 6, 8, 10],
+ },
+ styles:{
+ withAlternateBg: false,
+ withColumnDivider: false,
+ extraStyles: {},
+ withHeaderDivider:true,
+ withRowDivider:true,
+ withBorder:true,
+ },
+ selection: {
+ addCheckbox: true,
+ checkboxLabel: 'Select All',
+ initialSelectedRows: [0,1],
+ onSelectedRowsChange: (e) => {
+ console.log("These are the selected rows", e);
+ },
+ showSelectedState: true,
+ },
+ footerProps: {
+ footerContent: "Footer Content",
+ hideFooter: false,
+ stickyFooterContent: "Sticky Footer Content",
+ scrollableStickyFooterContent: true,
+ isStickyFooter: false,
+ addStickyFooter: false,
+ },
+ frozenColumns: 0,
+ isStickyHeader: false,
+ actionButtonLabel: "",
+};
+
+export const WithAddCheckboxAndSelectionStateAndInitialSelectedRowsWithActions = Template.bind(
+ {}
+);
+WithAddCheckboxAndSelectionStateAndInitialSelectedRowsWithActions.args = {
+ headerData: headerData,
+ rows:rows,
+ pagination:{
+ initialRowsPerPage: 2,
+ rowsPerPageOptions: [2, 4, 6, 8, 10],
+ },
+ styles:{
+ withAlternateBg: false,
+ withColumnDivider: false,
+ extraStyles: {},
+ withHeaderDivider:true,
+ withRowDivider:true,
+ withBorder:true,
+ },
+ tableDetails:{
+ tableTitle: "Table Title",
+ tableDescription: "Description",
+ },
+ selection: {
+ addCheckbox: true,
+ checkboxLabel: 'Select All',
+ initialSelectedRows: [0,1],
+ onSelectedRowsChange: (e) => {
+ console.log("These are the selected rows", e);
+ },
+ showSelectedState: true,
+ },
+ footerProps: {
+ footerContent: "Footer Content",
+ hideFooter: false,
+ stickyFooterContent: "Sticky Footer Content",
+ scrollableStickyFooterContent: true,
+ isStickyFooter: false,
+ addStickyFooter: false,
+ },
+ frozenColumns: 0,
+ isStickyHeader: false,
+ actionButtonLabel: "",
+};
+
+export const WithAddCheckboxAndSelectionStateAndCustomActions = Template.bind(
+ {}
+);
+WithAddCheckboxAndSelectionStateAndCustomActions.args = {
+ headerData: headerData,
+ rows:rows,
+ pagination:{
+ initialRowsPerPage: 2,
+ rowsPerPageOptions: [2, 4, 6, 8, 10],
+ },
+ styles:{
+ withAlternateBg: false,
+ withColumnDivider: false,
+ extraStyles: {},
+ withHeaderDivider:true,
+ withRowDivider:true,
+ withBorder:true,
+ },
+ tableDetails:{
+ tableTitle: "Table Title",
+ tableDescription: "Description",
+ },
+ selection: {
+ addCheckbox: true,
+ checkboxLabel: 'Select All',
+ initialSelectedRows: [],
+ onSelectedRowsChange: (e) => {
+ console.log("These are the selected rows", e);
+ },
+ showSelectedState: true,
+ },
+ footerProps: {
+ footerContent: "Footer Content",
+ hideFooter: false,
+ stickyFooterContent: "Sticky Footer Content",
+ scrollableStickyFooterContent: true,
+ isStickyFooter: false,
+ addStickyFooter: false,
+ },
+ frozenColumns: 0,
+ isStickyHeader: false,
+ actionButtonLabel: "",
+ actions:actions
+};
+
+export const WithoutFooter = Template.bind({});
+WithoutFooter.args = {
+ headerData: headerData,
+ rows:rows,
+ pagination:{
+ initialRowsPerPage: 2,
+ rowsPerPageOptions: [2, 4, 6, 8, 10],
+ },
+
+ selection: {
+ addCheckbox: false,
+ checkboxLabel: 'Select All',
+ initialSelectedRows: [],
+ onSelectedRowsChange: (e) => {
+ console.log("These are the selected rows", e);
+ },
+ showSelectedState: false,
+ },
+ footerProps: {
+ footerContent: "Footer Content",
+ hideFooter: true,
+ stickyFooterContent: "Sticky Footer Content",
+ scrollableStickyFooterContent: true,
+ isStickyFooter: false,
+ addStickyFooter: false,
+ },
+ frozenColumns: 0,
+ isStickyHeader: false,
+};
+
+export const WithDefaultRowsPerPage = Template.bind({});
+WithDefaultRowsPerPage.args = {
+ headerData: headerData,
+ selection: {
+ addCheckbox: false,
+ checkboxLabel: 'Select All',
+ initialSelectedRows: [],
+ onSelectedRowsChange: (e) => {
+ console.log("These are the selected rows", e);
+ },
+ showSelectedState: false,
+ },
+ footerProps: {
+ footerContent: "Footer Content",
+ hideFooter: false,
+ stickyFooterContent: "Sticky Footer Content",
+ scrollableStickyFooterContent: true,
+ isStickyFooter: false,
+ addStickyFooter: false,
+ },
+ rows: rows,
+ frozenColumns: 0,
+ isStickyHeader: false,
+};
+
+export const WithCustomRowsPerPage = Template.bind({});
+WithCustomRowsPerPage.args = {
+ headerData: headerData,
+ rows:rows,
+ pagination:{
+ initialRowsPerPage: 2,
+ rowsPerPageOptions: [2, 4, 6, 8, 10],
+ },
+ selection: {
+ addCheckbox: false,
+ checkboxLabel: 'Select All',
+ initialSelectedRows: [],
+ onSelectedRowsChange: (e) => {
+ console.log("These are the selected rows", e);
+ },
+ showSelectedState: false,
+ },
+ footerProps: {
+ footerContent: null,
+ hideFooter: false,
+ stickyFooterContent: "Sticky Footer Content",
+ scrollableStickyFooterContent: true,
+ isStickyFooter: false,
+ addStickyFooter: false,
+ },
+ frozenColumns: 0,
+ isStickyHeader: false,
+};
+
+export const WithCustomFooterContent = Template.bind({});
+WithCustomFooterContent.args = {
+ headerData: headerData,
+ rows:rows,
+ pagination:{
+ initialRowsPerPage: 2,
+ rowsPerPageOptions: [2, 4, 6, 8, 10],
+ },
+ selection: {
+ addCheckbox: false,
+ checkboxLabel: 'Select All',
+ initialSelectedRows: [],
+ onSelectedRowsChange: (e) => {
+ console.log("These are the selected rows", e);
+ },
+ showSelectedState: false,
+ },
+ footerProps: {
+ footerContent: {"Here you can add any content"}
,
+ hideFooter: false,
+ stickyFooterContent: "Sticky Footer Content",
+ scrollableStickyFooterContent: true,
+ isStickyFooter: false,
+ addStickyFooter: false,
+ },
+ frozenColumns: 0,
+ isStickyHeader: false,
+};
+
+export const WithStickyFooterContent = Template.bind({});
+WithStickyFooterContent.args = {
+ headerData: headerData,
+ rows:rows,
+ pagination:{
+ initialRowsPerPage: 2,
+ rowsPerPageOptions: [2, 4, 6, 8, 10],
+ },
+ selection: {
+ addCheckbox: false,
+ checkboxLabel: 'Select All',
+ initialSelectedRows: [],
+ onSelectedRowsChange: (e) => {
+ console.log("These are the selected rows", e);
+ },
+ showSelectedState: false,
+ },
+ footerProps: {
+ footerContent: "Footer Content",
+ hideFooter: false,
+ stickyFooterContent: "Sticky Footer Content",
+ scrollableStickyFooterContent: false,
+ isStickyFooter: true,
+ addStickyFooter: true,
+ },
+};
+
+
+export const WithScrollableStickyFooterContent = Template.bind({});
+WithScrollableStickyFooterContent.args = {
+ headerData: headerData,
+ rows:rows,
+ pagination:{
+ initialRowsPerPage: 2,
+ rowsPerPageOptions: [2, 4, 6, 8, 10],
+ },
+ selection: {
+ addCheckbox: false,
+ checkboxLabel: 'Select All',
+ initialSelectedRows: [],
+ onSelectedRowsChange: (e) => {
+ console.log("These are the selected rows", e);
+ },
+ showSelectedState: false,
+ },
+ footerProps: {
+ footerContent: "Footer Content",
+ hideFooter: false,
+ stickyFooterContent:
+
+ GrandTotal
+ ₹34,000.00
+ ₹34,000.00
+ ₹34,000.00
+ ₹34,000.00
+ ₹34,000.00
+ ₹34,000.00
+ ₹34,000.00
+ ₹34,000.00
+ ₹34,000.00
+ ₹34,000.00
+ ₹34,000.00
+ ₹34,000.00
+ ₹34,000.00
+ ₹34,000.00
+ ₹34,000.00
+ ₹34,000.00
+ ₹34,000.00
+ ₹34,000.00
+ ₹34,000.00
+ ₹34,000.00
+ ₹34,000.00
+ ₹34,000.00
+ ₹34,000.00
+ ₹34,000.00
+ ₹34,000.00
+ ₹34,000.00
+ ,
+ scrollableStickyFooterContent: true,
+ isStickyFooter: true,
+ addStickyFooter: true,
+ },
+ frozenColumns: 0,
+ isStickyHeader: false,
+};
+
+export const WithOnRowClick = Template.bind({});
+WithOnRowClick.args = {
+ headerData: headerData,
+ rows:rows,
+ pagination:{
+ initialRowsPerPage: 2,
+ rowsPerPageOptions: [2, 4, 6, 8, 10],
+ },
+ selection: {
+ addCheckbox: false,
+ checkboxLabel: 'Select All',
+ initialSelectedRows: [],
+ onSelectedRowsChange: (e) => {
+ console.log("These are the selected rows", e);
+ },
+ showSelectedState: false,
+ },
+ footerProps: {
+ footerContent: "Footer Content",
+ hideFooter: false,
+ stickyFooterContent: "Sticky Footer Content",
+ scrollableStickyFooterContent: false,
+ isStickyFooter: false,
+ addStickyFooter: true,
+ },
+ onRowClick: (row, index) => {
+ console.log(row, index, "this row is clicked");
+ },
+ frozenColumns: 0,
+ isStickyHeader: false,
+};
+
+export const WithFilter = Template.bind({});
+WithFilter.args = {
+ headerData: headerData,
+ rows:rows,
+ pagination:{
+ initialRowsPerPage: 2,
+ rowsPerPageOptions: [2, 4, 6, 8, 10],
+ },
+ selection: {
+ addCheckbox: false,
+ checkboxLabel: 'Select All',
+ initialSelectedRows: [],
+ onSelectedRowsChange: (e) => {
+ console.log("These are the selected rows", e);
+ },
+ showSelectedState: false,
+ },
+ footerProps: {
+ footerContent: null,
+ hideFooter: false,
+ stickyFooterContent: "Sticky Footer Content",
+ scrollableStickyFooterContent: false,
+ isStickyFooter: false,
+ addStickyFooter: true,
+ },
+ frozenColumns: 0,
+ isStickyHeader: false,
+ onFilter:(e)=>{console.log(e,"filter clicked")},
+ addFilter:true
+};
+
+export const WithCustomStyles = Template.bind({});
+WithCustomStyles.args = {
+ headerData:headerDataForCustomStyles,
+ pagination:{
+ initialRowsPerPage: 2,
+ rowsPerPageOptions: [2, 4, 6, 8, 10],
+ },
+ selection: {
+ addCheckbox: false,
+ checkboxLabel: 'Select All',
+ initialSelectedRows: [],
+ onSelectedRowsChange: (e) => {
+ console.log("These are the selected rows", e);
+ },
+ showSelectedState: false,
+ },
+ styles:{
+ withAlternateBg: false,
+ withHeaderDivider:true,
+ withBorder:true,
+ withColumnDivider: false,
+ extraStyles:{
+ headerStyles:{
+ backgroundColor:"#0B4B66",
+ color:"#FFFFFF"
+ },
+ bodyStyles:{
+ backgroundColor:"#FFFFFF",
+ color:"#0B4B66"
+ },
+ footerStyles:{
+ color:"#363636"
+ }
+ },
+ withRowDivider:true,
+ },
+ onRowClick: (row, index) => {
+ console.log(row, index, "this row is clicked");
+ },
+ footerProps: {
+ footerContent: "Footer Content",
+ hideFooter: false,
+ stickyFooterContent: "Sticky Footer Content",
+ scrollableStickyFooterContent: false,
+ isStickyFooter: false,
+ addStickyFooter: true,
+ },
+ rows: samplerows,
+ frozenColumns: 0,
+ isStickyHeader: false,
+};
+
+
+export const WithAscendingAsInitialSortOrder = Template.bind({});
+WithAscendingAsInitialSortOrder.args = {
+ ...commonArgs,
+ headerData: headerData,
+ rows:rows,
+ pagination:{
+ initialRowsPerPage: 2,
+ rowsPerPageOptions: [2, 4, 6, 8, 10],
+ },
+ sorting:{
+ initialSortOrder: "ascending",
+ isTableSortable:true,
+ },
+ selection: {
+ addCheckbox: false,
+ checkboxLabel: 'Select All',
+ initialSelectedRows: [],
+ onSelectedRowsChange: (e) => {
+ console.log("These are the selected rows", e);
+ },
+ showSelectedState: false,
+ },
+ onRowClick:undefined,
+};
+
+export const WithDescendingAsInitialSortOrder = Template.bind({});
+WithDescendingAsInitialSortOrder.args = {
+ ...commonArgs,
+ headerData: headerData,
+ rows:rows,
+ pagination:{
+ initialRowsPerPage: 2,
+ rowsPerPageOptions: [2, 4, 6, 8, 10],
+ },
+ selection: {
+ addCheckbox: false,
+ checkboxLabel: 'Select All',
+ initialSelectedRows: [],
+ onSelectedRowsChange: (e) => {
+ console.log("These are the selected rows", e);
+ },
+ showSelectedState: false,
+ },
+ sorting:{
+ initialSortOrder: "descending",
+ isTableSortable:true,
+ },
+ onRowClick:undefined,
+};
+
+export const WithAccessor = Template.bind({});
+WithAccessor.args = {
+ ...commonArgs,
+ sorting: {
+ isTableSortable: false,
+ },
+ headerData: headerDataWithAccessors,
+ rows: rowsWithAccessor,
+ pagination: {
+ initialRowsPerPage: 2,
+ rowsPerPageOptions: [2, 4, 6, 8, 10],
+ },
+ styles: {
+ withAlternateBg: false,
+ withColumnDivider: false,
+ extraStyles: {},
+ withHeaderDivider: true,
+ withRowDivider: true,
+ withBorder: true,
+ },
+ selection: {
+ addCheckbox: false,
+ checkboxLabel: "",
+ initialSelectedRows: [],
+ onSelectedRowsChange: (e) => {
+ console.log("These are the selected rows", e);
+ },
+ showSelectedState: false,
+ },
+ onRowClick: undefined,
+};
+
+
+export const WithNestedTable = Template.bind({});
+WithNestedTable.args = {
+ ...commonArgs,
+ sorting: {
+ isTableSortable: false,
+ },
+ headerData: headerDataWithAccessors,
+ rows: rowsWithNestedTable,
+ pagination: {
+ initialRowsPerPage: 2,
+ rowsPerPageOptions: [2, 4, 6, 8, 10],
+ },
+ styles: {
+ withAlternateBg: false,
+ withColumnDivider: false,
+ extraStyles: {},
+ withHeaderDivider: true,
+ withRowDivider: true,
+ withBorder: true,
+ },
+ selection: {
+ addCheckbox: false,
+ checkboxLabel: "",
+ initialSelectedRows: [],
+ onSelectedRowsChange: (e) => {
+ console.log("These are the selected rows", e);
+ },
+ showSelectedState: false,
+ },
+ onRowClick: undefined
+};
+
+
+export const WithOnlyOneRowNestedTable = Template.bind({});
+WithOnlyOneRowNestedTable.args = {
+ ...commonArgs,
+ sorting: {
+ isTableSortable: false,
+ },
+ headerData: headerDataWithAccessors,
+ rows: singlerowWithNestedTable,
+ pagination: {
+ initialRowsPerPage: 2,
+ rowsPerPageOptions: [2, 4, 6, 8, 10],
+ },
+ styles: {
+ withAlternateBg: false,
+ withColumnDivider: false,
+ extraStyles: {},
+ withHeaderDivider: true,
+ withRowDivider: true,
+ withBorder: true,
+ },
+ selection: {
+ addCheckbox: false,
+ checkboxLabel: "",
+ initialSelectedRows: [],
+ onSelectedRowsChange: (e) => {
+ console.log("These are the selected rows", e);
+ },
+ showSelectedState: false,
+ },
+ onRowClick: undefined
+};
+
+export const ManualPagination = Template.bind({});
+ManualPagination.args = {
+ ...commonArgs,
+ headerData: headerData,
+ rows:rows,
+ pagination:{
+ initialRowsPerPage: 2,
+ rowsPerPageOptions: [2, 4, 6, 8, 10],
+ manualPagination: true,
+ onPageSizeChange:(event)=> { console.log(event)},
+ onNextPage:()=>{console.log("onNextPage")},
+ onPrevPage:()=>{console.log("onPrevPage")}
+ },
+ styles:{
+ withAlternateBg: false,
+ withColumnDivider: false,
+ extraStyles: {},
+ withHeaderDivider:true,
+ withRowDivider:true,
+ withBorder:true,
+ },
+ selection: {
+ addCheckbox: false,
+ checkboxLabel: '',
+ initialSelectedRows: [],
+ onSelectedRowsChange: (e) => {
+ console.log("These are the selected rows", e);
+ },
+ showSelectedState: false,
+ },
+ onRowClick:undefined,
+};
+
+const myCustomSort = (rows, columnIndex) => {
+ const middleIndex = Math.floor(rows.length / 2);
+ const firstHalfReversed = [...rows.slice(0, middleIndex)].reverse();
+ const secondHalf = rows.slice(middleIndex);
+ return [...firstHalfReversed, ...secondHalf];
+};
+
+
+export const WithCustomSortOrder = Template.bind({});
+WithCustomSortOrder.args = {
+ ...commonArgs,
+ headerData: headerData,
+ rows:rows,
+ pagination:{
+ initialRowsPerPage: 2,
+ rowsPerPageOptions: [2, 4, 6, 8, 10],
+ },
+ selection: {
+ addCheckbox: false,
+ checkboxLabel: 'Select All',
+ initialSelectedRows: [],
+ onSelectedRowsChange: (e) => {
+ console.log("These are the selected rows", e);
+ },
+ showSelectedState: false,
+ },
+ sorting:{
+ initialSortOrder: "custom",
+ isTableSortable:true,
+ customSortFunction:myCustomSort
+ },
+ onRowClick:undefined,
+};
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/TimelineMolecule.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/TimelineMolecule.stories.js
new file mode 100644
index 00000000..55582b34
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/TimelineMolecule.stories.js
@@ -0,0 +1,183 @@
+import React from "react";
+import TimelineMolecule from "../TimelineMolecule";
+import { Button } from "../../atoms";
+import Timeline from "../../atoms";
+import { Iframe } from "../../atoms";
+
+export default {
+ title: "Molecules/Timeline Molecule",
+ component: TimelineMolecule,
+ argTypes: {
+ initialVisibleCount: { table: { disable: true } },
+ additionalWidgets: {
+ control: "boolean",
+ name: "Additional Widgets",
+ defaultValue: false,
+ },
+ },
+};
+
+const subElements = [
+ "26 / 03 / 2024",
+ "11:00 PM",
+ "26 / 03 / 2024 11:00 PM",
+ "26 / 03 / 2024 11:00 PM Mon",
+ "+91 **********",
+];
+
+const additionalElements = [
+
+ Lorem Ipsum is simply dummy text of the printing and typesetting industry.
+ Lorem Ipsum has been the industry's
+
,
+ ,
+ ,
+ ,
+ ,
+ ,
+ ,
+ ,
+ ,
+ ,
+ ,
+];
+
+export const Documentation = () => (
+
+);
+
+Documentation.storyName = "Docs";
+Documentation.argTypes = {
+ additionalWidgets:{table:{disable:true}}
+}
+
+const Wrapper = (args) => {
+ const { additionalWidgets, ...rest } = args;
+ const updatedChildren = additionalWidgets
+ ? [
+ ,
+ ,
+ ,
+ ,
+ ,
+ ]
+ : [
+ ,
+ ,
+ ,
+ ,
+ ,
+ ];
+
+ return ;
+};
+
+const Template = (args) => {
+ return ;
+};
+
+export const Basic = Template.bind({});
+Basic.args = {};
+
+export const Collapsible = Template.bind({});
+Collapsible.args = {
+ initialVisibleCount: 3,
+};
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/TooltipWrapper.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/TooltipWrapper.stories.js
new file mode 100644
index 00000000..7b611532
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/TooltipWrapper.stories.js
@@ -0,0 +1,130 @@
+import React from "react";
+import { Colors } from "../../constants/colors/colorconstants";
+import { Button } from "../../atoms";
+import TooltipWrapper from "../TooltipWrapper";
+import { Iframe } from "../../atoms";
+import { CustomSVG } from "../../atoms";
+
+export default {
+ title: "Molecules/Tooltip Wrapper",
+ component: TooltipWrapper,
+ argTypes: {
+ content: { control: "text", name: "Content" },
+ header: { control: "text" ,name:'Header'},
+ wrapperClassName: { control: "text",table:{disable:true} },
+ ClassName: { control: "text" ,table:{disable:true}},
+ arrow: { control: "boolean", name: "Arrow" },
+ placement: {
+ control: "select",
+ options: [
+ "bottom-start",
+ "bottom",
+ "bottom-end",
+ "top-start",
+ "top",
+ "top-end",
+ "left-start",
+ "left",
+ "left-end",
+ "right-start",
+ "right",
+ "right-end",
+ ],
+ name: "Position",
+ },
+ enterDelay: { control: "number",table:{disable:true} },
+ leaveDelay: { control: "number",table:{disable:true} },
+ followCursor: { control: "boolean",table:{disable:true} },
+ open: { control: "boolean",table:{disable:true} },
+ disableFocusListener: { control: "boolean" ,table:{disable:true}},
+ disableHoverListener: { control: "boolean",table:{disable:true} },
+ disableInteractive: { control: "boolean" ,table:{disable:true}},
+ disableTouchListener: { control: "boolean",table:{disable:true} },
+ style: { control: "object",table:{disable:true} },
+ children:{table:{disable:true}},
+ title:{table:{disable:true}},
+ onOpen:{table:{disable:true}},
+ onClose:{table:{disable:true}}
+ },
+};
+
+const commonStyles = {
+ position: "absolute",
+ top: "50%",
+ left: "50%",
+ color: "#363636",
+ display: "flex",
+ alignItems: "center",
+ justifyContent: "center",
+ transform: "translate(-50%, -50%)",
+};
+
+const Color = Colors.lightTheme.primary[2];
+
+const Template = (args) => {
+ const { ...rest } = args;
+ return (
+
+
+
+ );
+};
+
+export const Documentation = () => (
+
+);
+
+Documentation.storyName = "Docs";
+Documentation.argTypes = {
+ header:{table:{disable:true}},
+ content:{table:{disable:true}},
+ arrow:{table:{disable:true}},
+ placement:{table:{disable:true}}
+}
+
+const htmlTooltip = (
+
+ {
+ "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt "
+ }
+
+
+
+);
+
+const commonArgs = {
+ content: htmlTooltip,
+ arrow: false,
+ placement: "bottom",
+ enterDelay: 100,
+ leaveDelay: 0,
+ followCursor: false,
+ open: false,
+ disableFocusListener: false,
+ disableHoverListener: false,
+ disableInteractive: false,
+ disableTouchListener: false,
+ children: ,
+ style: {},
+ header: "Tooltip Header",
+};
+
+export const Basic = Template.bind({});
+Basic.args = {
+ ...commonArgs,
+};
+
+export const Custom = Template.bind({});
+Custom.args = {
+ ...commonArgs,
+ style: {
+ backgroundColor: Color,
+ border: "3px solid #C84C0E",
+ width: "300px",
+ textAlign: "center",
+ },
+};
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/VerticalFilterCard.stories.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/VerticalFilterCard.stories.js
new file mode 100644
index 00000000..57b17679
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/stories/VerticalFilterCard.stories.js
@@ -0,0 +1,308 @@
+import React, { useState ,Fragment} from "react";
+import FilterCard from "../FilterCard";
+import { LabelFieldPair } from "../../atoms";
+import { RadioButtons } from "../../atoms";
+import { TextBlock } from "../../atoms";
+import { TextInput } from "../../atoms";
+import { Button } from "../../atoms";
+
+// Story metadata
+export default {
+ title: "Molecules/Filter Card/Vertical",
+ component: FilterCard,
+ argTypes: {
+ title: { control: "boolean" ,name:"Heading"},
+ titleIcon: { table:{disable:true} },
+ primaryActionLabel: { control: "text" },
+ secondaryActionLabel: { control: "text" },
+ layoutType: {
+ control: {
+ type: "select",
+ options: ["horizontal", "vertical"],
+ },
+ },
+ equalWidthButtons: { control: "boolean" ,table:{disable:true}},
+ addClose: { control: "boolean",name:"With Close" },
+ className: { control: "text",table:{disable:true} },
+ style: { control: "object" ,table:{disable:true}},
+ hideIcon: { control: "boolean" ,name:"Header Icon"},
+ isPopup: { control: "boolean" ,table:{disable:true}},
+ onClose: { action: "onChange" ,table:{disable:true}},
+ onOverlayClick: {
+ control: "function",table:{disable:true}
+ },
+ children:{table:{disable:true}},
+ primaryActionLabel:{table:{disable:true}},
+ secondaryActionLabel:{table:{disable:true}},
+ onPrimaryPressed:{table:{disable:true}},
+ onSecondaryPressed:{table:{disable:true}},
+ layoutType:{table:{disable:true}}
+ },
+};
+
+// Template for the story
+const Template = (args) => {
+ const {title,...rest} = args;
+ return ( );};
+
+const genderOptions = [
+ { code: "M", name: "Male" },
+ { code: "F", name: "Female" },
+ { code: "O", name: "Others" },
+];
+
+const children = [
+
+
+
+ ,
+
+
+
+ ,
+
+
+ {
+ console.log(e);
+ }}
+ style={{
+ width: "100%",
+ }}
+ />
+ ,
+];
+
+export const Basic = Template.bind({});
+Basic.args = {
+ title: true,
+ addClose: false,
+ children: children,
+ primaryActionLabel: "ApplyFilters",
+ secondaryActionLabel: "Clear Filters",
+ onPrimaryPressed: () => alert("Primary action clicked!"),
+ onSecondaryPressed: () => alert("Secondary action clicked!"),
+ layoutType: "vertical",
+ equalWidthButtons: true,
+ hideIcon: false,
+};
+
+export const Custom = Template.bind({});
+Custom.args = {
+ title: true,
+ addClose: true,
+ children: children,
+ primaryActionLabel: "ApplyFilters",
+ secondaryActionLabel: "Clear Filters",
+ onPrimaryPressed: () => alert("Primary action clicked!"),
+ onSecondaryPressed: () => alert("Secondary action clicked!"),
+ layoutType: "vertical",
+ equalWidthButtons: true,
+ hideIcon: false,
+ style: {
+ width: "500px",
+ backgroundColor:"#fafafa",
+ border:"1px solid black"
+ },
+};
+
+export const AsPopup = () => {
+ const [showPopup, setShowPopup] = useState(false);
+
+ const onClose = () => {
+ setShowPopup(false);
+ };
+
+ const onOverlayClick = () => {
+ setShowPopup(false);
+ };
+
+ const commonStyles = {
+ position: "absolute",
+ top: "50%",
+ left: "50%",
+ color: "#363636",
+ display: "flex",
+ alignItems: "center",
+ justifyContent: "center",
+ transform: "translate(-50%, -50%)",
+ };
+
+ return (
+ <>
+
+ {
+ setShowPopup(true)}
+ />
+ }
+
+ {showPopup && (
+ alert("Primary action clicked!")}
+ onSecondaryPressed={() => alert("Secondary action clicked!")}
+ layoutType={"vertical"}
+ equalWidthButtons={true}
+ hideIcon={false}
+ isPopup={true}
+ onClose={onClose}
+ onOverlayClick={onOverlayClick}
+ >
+
+
+
+
+
+
+
+
+
+
+ {
+ console.log(e);
+ }}
+ style={{
+ width: "100%",
+ }}
+ />
+
+
+ )}
+ >
+ );
+};
+AsPopup.argTypes= {
+ title: { table:{disable:true}},
+ hideIcon: { table:{disable:true} },
+ addClose: { table:{disable:true} },
+}
+
+
+export const AsPopupWithMoreChildren = () => {
+ const [showPopup, setShowPopup] = useState(false);
+
+ const onClose = () => {
+ setShowPopup(false);
+ };
+
+ const onOverlayClick = () => {
+ setShowPopup(false);
+ };
+
+ const commonStyles = {
+ position: "absolute",
+ top: "50%",
+ left: "50%",
+ color: "#363636",
+ display: "flex",
+ alignItems: "center",
+ justifyContent: "center",
+ transform: "translate(-50%, -50%)",
+ };
+
+ return (
+ <>
+
+ {
+ setShowPopup(true)}
+ />
+ }
+
+ {showPopup && (
+ alert("Primary action clicked!")}
+ onSecondaryPressed={() => alert("Secondary action clicked!")}
+ layoutType={"vertical"}
+ equalWidthButtons={true}
+ hideIcon={false}
+ isPopup={true}
+ onClose={onClose}
+ onOverlayClick={onOverlayClick}
+ >
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ )}
+ >
+ );
+};
+AsPopupWithMoreChildren.argTypes= {
+ title: { table:{disable:true}},
+ hideIcon: { table:{disable:true} },
+ addClose: { table:{disable:true} },
+}
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/techMolecules/createFunction.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/techMolecules/createFunction.js
new file mode 100644
index 00000000..bd147894
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/molecules/techMolecules/createFunction.js
@@ -0,0 +1,3 @@
+export const createFunction = (functionAsString) => {
+ return Function("return " + functionAsString)();
+};
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/utils/amountFormatter.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/utils/amountFormatter.js
new file mode 100644
index 00000000..38ef1bb5
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/utils/amountFormatter.js
@@ -0,0 +1,414 @@
+/**
+ * Add group separator to value eg. 1000 > 1,000
+ */
+export const addSeparators = (value, separator = ",") => {
+ return value.replace(/\B(?=(\d{3})+(?!\d))/g, separator);
+};
+
+/**
+ * Remove prefix, separators and extra decimals from value
+ */
+export const cleanValue = ({
+ value,
+ groupSeparator = ",",
+ decimalSeparator = ".",
+ allowDecimals = true,
+ decimalsLimit = 2,
+ allowNegativeValue = true,
+ disableAbbreviations = false,
+ prefix = "",
+ transformRawValue = (rawValue) => rawValue,
+}) => {
+ const transformedValue = transformRawValue(value);
+
+ if (transformedValue === "-") {
+ return transformedValue;
+ }
+
+ const abbreviations = disableAbbreviations ? [] : ["k", "m", "b"];
+ const reg = new RegExp(`((^|\\D)-\\d)|(-${escapeRegExp(prefix)})`);
+ const isNegative = reg.test(transformedValue);
+
+ // Is there a digit before the prefix? eg. 1$
+ const [prefixWithValue, preValue] = RegExp(`(\\d+)-?${escapeRegExp(prefix)}`).exec(value) || [];
+ const withoutPrefix = prefix
+ ? prefixWithValue
+ ? transformedValue.replace(prefixWithValue, "").concat(preValue)
+ : transformedValue.replace(prefix, "")
+ : transformedValue;
+ const withoutSeparators = removeSeparators(withoutPrefix, groupSeparator);
+ const withoutInvalidChars = removeInvalidChars(withoutSeparators, [groupSeparator, decimalSeparator, ...abbreviations]);
+
+ let valueOnly = withoutInvalidChars;
+
+ if (!disableAbbreviations) {
+ // disallow letter without number
+ if (abbreviations.some((letter) => letter === withoutInvalidChars.toLowerCase())) {
+ return "";
+ }
+ const parsed = parseAbbrValue(withoutInvalidChars, decimalSeparator);
+ if (parsed) {
+ valueOnly = String(parsed);
+ }
+ }
+
+ const includeNegative = isNegative && allowNegativeValue ? "-" : "";
+
+ if (decimalSeparator && valueOnly.includes(decimalSeparator)) {
+ const [int, decimals] = withoutInvalidChars.split(decimalSeparator);
+ const trimmedDecimals = decimalsLimit && decimals ? decimals.slice(0, decimalsLimit) : decimals;
+ const includeDecimals = allowDecimals ? `${decimalSeparator}${trimmedDecimals}` : "";
+
+ return `${includeNegative}${int}${includeDecimals}`;
+ }
+
+ return `${includeNegative}${valueOnly}`;
+};
+
+/**
+ * Escape regex char
+ *
+ * See: https://stackoverflow.com/questions/17885855/use-dynamic-variable-string-as-regex-pattern-in-javascript
+ */
+export const escapeRegExp = (stringToGoIntoTheRegex) => {
+ return stringToGoIntoTheRegex.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&");
+};
+
+export const fixedDecimalValue = (value, decimalSeparator, fixedDecimalLength) => {
+ if (fixedDecimalLength && value.length > 1) {
+ if (value.includes(decimalSeparator)) {
+ const [int, decimals] = value.split(decimalSeparator);
+ if (decimals.length > fixedDecimalLength) {
+ return `${int}${decimalSeparator}${decimals.slice(0, fixedDecimalLength)}`;
+ }
+ }
+
+ const reg = value.length > fixedDecimalLength ? new RegExp(`(\\d+)(\\d{${fixedDecimalLength}})`) : new RegExp(`(\\d)(\\d+)`);
+
+ const match = value.match(reg);
+ if (match) {
+ const [, int, decimals] = match;
+ return `${int}${decimalSeparator}${decimals}`;
+ }
+ }
+
+ return value;
+};
+
+/**
+ * Format value with decimal separator, group separator and prefix
+ */
+export const formatValue = (options) => {
+ const { value: _value, decimalSeparator, intlConfig, decimalScale, prefix = "", suffix = "" } = options;
+
+ if (_value === "" || _value === undefined) {
+ return "";
+ }
+
+ if (_value === "-") {
+ return "-";
+ }
+
+ const isNegative = new RegExp(`^\\d?-${prefix ? `${escapeRegExp(prefix)}?` : ""}\\d`).test(_value);
+
+ const value = decimalSeparator !== "." ? replaceDecimalSeparator(_value, decimalSeparator, isNegative) : _value;
+
+ const defaultNumberFormatOptions = {
+ minimumFractionDigits: decimalScale || 0,
+ maximumFractionDigits: 20,
+ };
+
+ const numberFormatter = intlConfig
+ ? new Intl.NumberFormat(
+ intlConfig.locale,
+ intlConfig.currency
+ ? {
+ ...defaultNumberFormatOptions,
+ style: "currency",
+ currency: intlConfig.currency,
+ }
+ : defaultNumberFormatOptions
+ )
+ : new Intl.NumberFormat(undefined, defaultNumberFormatOptions);
+
+ const parts = numberFormatter.formatToParts(Number(value));
+
+ let formatted = replaceParts(parts, options);
+
+ // Does intl formatting add a suffix?
+ const intlSuffix = getSuffix(formatted, { ...options });
+
+ // Include decimal separator if user input ends with decimal separator
+ const includeDecimalSeparator = _value.slice(-1) === decimalSeparator ? decimalSeparator : "";
+
+ const [, decimals] = value.match(RegExp("\\d+\\.(\\d+)")) || [];
+
+ // Keep original decimal padding if no decimalScale
+ if (decimalScale === undefined && decimals && decimalSeparator) {
+ if (formatted.includes(decimalSeparator)) {
+ formatted = formatted.replace(RegExp(`(\\d+)(${escapeRegExp(decimalSeparator)})(\\d+)`, "g"), `$1$2${decimals}`);
+ } else {
+ if (intlSuffix && !suffix) {
+ formatted = formatted.replace(intlSuffix, `${decimalSeparator}${decimals}${intlSuffix}`);
+ } else {
+ formatted = `${formatted}${decimalSeparator}${decimals}`;
+ }
+ }
+ }
+
+ if (suffix && includeDecimalSeparator) {
+ return `${formatted}${includeDecimalSeparator}${suffix}`;
+ }
+
+ if (intlSuffix && includeDecimalSeparator) {
+ return formatted.replace(intlSuffix, `${includeDecimalSeparator}${intlSuffix}`);
+ }
+
+ if (intlSuffix && suffix) {
+ return formatted.replace(intlSuffix, `${includeDecimalSeparator}${suffix}`);
+ }
+
+ return [formatted, includeDecimalSeparator, suffix].join("");
+};
+
+/**
+ * Before converting to Number, decimal separator has to be .
+ */
+const replaceDecimalSeparator = (value, decimalSeparator, isNegative) => {
+ let newValue = value;
+ if (decimalSeparator && decimalSeparator !== ".") {
+ newValue = newValue.replace(RegExp(escapeRegExp(decimalSeparator), "g"), ".");
+ if (isNegative && decimalSeparator === "-") {
+ newValue = `-${newValue.slice(1)}`;
+ }
+ }
+ return newValue;
+};
+
+const replaceParts = (parts, { prefix, groupSeparator, decimalSeparator, decimalScale, disableGroupSeparators = false }) => {
+ return parts
+ .reduce(
+ (prev, { type, value }, i) => {
+ if (i === 0 && prefix) {
+ if (type === "minusSign") {
+ return [value, prefix];
+ }
+
+ if (type === "currency") {
+ return [...prev, prefix];
+ }
+
+ return [prefix, value];
+ }
+
+ if (type === "currency") {
+ return prefix ? prev : [...prev, value];
+ }
+
+ if (type === "group") {
+ return !disableGroupSeparators ? [...prev, groupSeparator !== undefined ? groupSeparator : value] : prev;
+ }
+
+ if (type === "decimal") {
+ if (decimalScale !== undefined && decimalScale === 0) {
+ return prev;
+ }
+
+ return [...prev, decimalSeparator !== undefined ? decimalSeparator : value];
+ }
+
+ if (type === "fraction") {
+ return [...prev, decimalScale !== undefined ? value.slice(0, decimalScale) : value];
+ }
+
+ return [...prev, value];
+ },
+ [""]
+ )
+ .join("");
+};
+
+const defaultConfig = {
+ currencySymbol: "",
+ groupSeparator: "",
+ decimalSeparator: "",
+ prefix: "",
+ suffix: "",
+};
+
+/**
+ * Get locale config from input or default
+ */
+//tried locale hardcoded
+export const getLocaleConfig = (intlConfig) => {
+ const { locale, currency } = intlConfig || {};
+
+ const numberFormatter = locale ? new Intl.NumberFormat(locale, currency ? { currency, style: "currency" } : undefined) : new Intl.NumberFormat();
+
+ return numberFormatter.formatToParts(1000.1).reduce((prev, curr, i) => {
+ if (curr.type === "currency") {
+ if (i === 0) {
+ return { ...prev, currencySymbol: curr.value, prefix: curr.value };
+ } else {
+ return { ...prev, currencySymbol: curr.value, suffix: curr.value };
+ }
+ }
+ if (curr.type === "group") {
+ return { ...prev, groupSeparator: curr.value };
+ }
+ if (curr.type === "decimal") {
+ return { ...prev, decimalSeparator: curr.value };
+ }
+
+ return prev;
+ }, defaultConfig);
+};
+
+export const getSuffix = (value, { groupSeparator = ",", decimalSeparator = "." }) => {
+ const suffixReg = new RegExp(`\\d([^${escapeRegExp(groupSeparator)}${escapeRegExp(decimalSeparator)}0-9]+)`);
+ const suffixMatch = value.match(suffixReg);
+ return suffixMatch ? suffixMatch[1] : undefined;
+};
+
+export const isNumber = (input) => RegExp(/\d/, "gi").test(input);
+
+export const padTrimValue = (value, decimalSeparator = ".", decimalScale) => {
+ if (decimalScale === undefined || value === "" || value === undefined) {
+ return value;
+ }
+
+ if (!value.match(/\d/g)) {
+ return "";
+ }
+
+ const [int, decimals] = value.split(decimalSeparator);
+
+ if (decimalScale === 0) {
+ return int;
+ }
+
+ let newValue = decimals || "";
+
+ if (newValue.length < decimalScale) {
+ while (newValue.length < decimalScale) {
+ newValue += "0";
+ }
+ } else {
+ newValue = newValue.slice(0, decimalScale);
+ }
+
+ return `${int}${decimalSeparator}${newValue}`;
+};
+
+/**
+ * Abbreviate number eg. 1000 = 1k
+ *
+ * Source: https://stackoverflow.com/a/9345181
+ */
+export const abbrValue = (value, decimalSeparator = ".", _decimalPlaces = 10) => {
+ if (value > 999) {
+ let valueLength = ("" + value).length;
+ const p = Math.pow;
+ const d = p(10, _decimalPlaces);
+ valueLength -= valueLength % 3;
+
+ const abbrValue = Math.round((value * d) / p(10, valueLength)) / d + " kMGTPE"[valueLength / 3];
+ return abbrValue.replace(".", decimalSeparator);
+ }
+
+ return String(value);
+};
+
+const abbrMap = { k: 1000, m: 1000000, b: 1000000000 };
+
+/**
+ * Parse a value with abbreviation e.g 1k = 1000
+ */
+export const parseAbbrValue = (value, decimalSeparator = ".") => {
+ const reg = new RegExp(`(\\d+(${escapeRegExp(decimalSeparator)}\\d*)?)([kmb])$`, "i");
+ const match = value.match(reg);
+
+ if (match) {
+ const [, digits, , abbr] = match;
+ const multiplier = abbrMap[abbr.toLowerCase()];
+
+ return Number(digits.replace(decimalSeparator, ".")) * multiplier;
+ }
+
+ return undefined;
+};
+
+/**
+ * Remove invalid characters
+ */
+export const removeInvalidChars = (value, validChars) => {
+ const chars = escapeRegExp(validChars.join(""));
+ const reg = new RegExp(`[^\\d${chars}]`, "gi");
+ return value.replace(reg, "");
+};
+
+/**
+ * Remove group separator from value eg. 1,000 > 1000
+ */
+export const removeSeparators = (value, separator = ",") => {
+ const reg = new RegExp(escapeRegExp(separator), "g");
+ return value.replace(reg, "");
+};
+
+/**
+ * Based on the last key stroke and the cursor position, update the value
+ * and reposition the cursor to the right place
+ */
+export const repositionCursor = ({ selectionStart, value, lastKeyStroke, stateValue, groupSeparator }) => {
+ let cursorPosition = selectionStart;
+ let modifiedValue = value;
+ if (stateValue && cursorPosition) {
+ const splitValue = value.split("");
+ // if cursor is to right of groupSeparator and backspace pressed, delete the character to the left of the separator and reposition the cursor
+ if (lastKeyStroke === "Backspace" && stateValue[cursorPosition] === groupSeparator) {
+ splitValue.splice(cursorPosition - 1, 1);
+ cursorPosition -= 1;
+ }
+ // if cursor is to left of groupSeparator and delete pressed, delete the character to the right of the separator and reposition the cursor
+ if (lastKeyStroke === "Delete" && stateValue[cursorPosition] === groupSeparator) {
+ splitValue.splice(cursorPosition, 1);
+ cursorPosition += 1;
+ }
+ modifiedValue = splitValue.join("");
+ return { modifiedValue, cursorPosition };
+ }
+
+ return { modifiedValue, cursorPosition: selectionStart };
+};
+
+export const getIntlConfig = (prefix = "") => {
+ const currencyMatch = Object.keys(CURRENCY_MAP).filter((e) => prefix.includes(e));
+ if (currencyMatch && currencyMatch?.length > 0) {
+ return CURRENCY_MAP[currencyMatch[0]];
+ } else {
+ CURRENCY_MAP["₹"];
+ }
+};
+
+const CURRENCY_MAP = {
+ "¥": {
+ locale: "ja-JP",
+ currency: "JPY",
+ },
+ "₹": {
+ locale: "en-IN",
+ currency: "INR",
+ },
+ "£": {
+ locale: "en-GB",
+ currency: "GBP",
+ },
+ "€": {
+ locale: "de-DE",
+ currency: "EUR",
+ },
+ $: {
+ locale: "en-US",
+ currency: "USD",
+ },
+};
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/utils/currencyInput.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/utils/currencyInput.js
new file mode 100644
index 00000000..f86faeb7
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/utils/currencyInput.js
@@ -0,0 +1,366 @@
+import React, { forwardRef, useImperativeHandle, useMemo, useRef, useEffect, useState } from "react";
+import { cleanValue, fixedDecimalValue, formatValue, getLocaleConfig, getSuffix, isNumber, padTrimValue, repositionCursor } from "./amountFormatter";
+import PropTypes from "prop-types";
+
+export const CurrencyInput = forwardRef(
+ (
+ {
+ allowDecimals = true,
+ allowNegativeValue = true,
+ id,
+ name,
+ className,
+ customInput,
+ decimalsLimit,
+ defaultValue,
+ disabled = false,
+ maxLength: userMaxLength,
+ value: userValue,
+ onValueChange,
+ fixedDecimalLength,
+ placeholder,
+ decimalScale,
+ prefix,
+ suffix,
+ intlConfig,
+ step,
+ min,
+ max,
+ disableGroupSeparators = false,
+ disableAbbreviations = false,
+ decimalSeparator: _decimalSeparator,
+ groupSeparator: _groupSeparator,
+ onChange,
+ onFocus,
+ onBlur,
+ onKeyDown,
+ onKeyUp,
+ transformRawValue,
+ otherProps,
+ inputRef: inputRefFrom,
+ ...props
+ },
+ ref
+ ) => {
+ if (_decimalSeparator && isNumber(_decimalSeparator)) {
+ throw new Error("decimalSeparator cannot be a number");
+ }
+
+ if (_groupSeparator && isNumber(_groupSeparator)) {
+ throw new Error("groupSeparator cannot be a number");
+ }
+
+ const localeConfig = useMemo(() => getLocaleConfig(intlConfig), [intlConfig]);
+ const decimalSeparator = _decimalSeparator || localeConfig.decimalSeparator || "";
+ const groupSeparator = _groupSeparator || localeConfig.groupSeparator || "";
+
+ if (decimalSeparator && groupSeparator && decimalSeparator === groupSeparator && disableGroupSeparators === false) {
+ throw new Error("decimalSeparator cannot be the same as groupSeparator");
+ }
+
+ const formatValueOptions = {
+ decimalSeparator,
+ groupSeparator,
+ disableGroupSeparators,
+ intlConfig,
+ prefix: prefix || localeConfig.prefix,
+ suffix: suffix,
+ };
+
+ const cleanValueOptions = {
+ decimalSeparator,
+ groupSeparator,
+ allowDecimals,
+ decimalsLimit: decimalsLimit || fixedDecimalLength || 2,
+ allowNegativeValue,
+ disableAbbreviations,
+ prefix: prefix || localeConfig.prefix,
+ transformRawValue,
+ };
+
+ const formattedStateValue =
+ defaultValue !== undefined && defaultValue !== null
+ ? formatValue({ ...formatValueOptions, decimalScale, value: String(defaultValue) })
+ : userValue !== undefined && userValue !== null
+ ? formatValue({ ...formatValueOptions, decimalScale, value: String(userValue) })
+ : "";
+
+ const [stateValue, setStateValue] = useState(formattedStateValue);
+ const [dirty, setDirty] = useState(false);
+ const [cursor, setCursor] = useState(0);
+ const [changeCount, setChangeCount] = useState(0);
+ const [lastKeyStroke, setLastKeyStroke] = useState(null);
+ const inputRef = useRef(inputRefFrom);
+ useImperativeHandle(ref, () => inputRef.current);
+
+ /**
+ * Process change in value
+ */
+ const processChange = (value, selectionStart) => {
+ setDirty(true);
+
+ const { modifiedValue, cursorPosition } = repositionCursor({
+ selectionStart,
+ value,
+ lastKeyStroke,
+ stateValue,
+ groupSeparator,
+ });
+
+ const stringValue = cleanValue({ value: modifiedValue, ...cleanValueOptions });
+
+ if (userMaxLength && stringValue.replace(/-/g, "").length > userMaxLength) {
+ return;
+ }
+
+ if (stringValue === "" || stringValue === "-" || stringValue === decimalSeparator) {
+ onValueChange && onValueChange(undefined, name, { float: null, formatted: "", value: "" });
+ setStateValue(stringValue);
+ return;
+ }
+
+ const stringValueWithoutSeparator = decimalSeparator ? stringValue.replace(decimalSeparator, ".") : stringValue;
+
+ const numberValue = parseFloat(stringValueWithoutSeparator);
+
+ const formattedValue = formatValue({
+ value: stringValue,
+ ...formatValueOptions,
+ });
+
+ if (cursorPosition !== undefined && cursorPosition !== null) {
+ // Prevent cursor jumping
+ let newCursor = cursorPosition + (formattedValue.length - value.length);
+ newCursor = newCursor <= 0 ? (prefix ? prefix.length : 0) : newCursor;
+
+ setCursor(newCursor);
+ setChangeCount(changeCount + 1);
+ }
+
+ setStateValue(formattedValue);
+
+ if (onValueChange) {
+ const values = {
+ float: numberValue,
+ formatted: formattedValue,
+ value: stringValue,
+ };
+ onValueChange(stringValue, name, values);
+ }
+ };
+
+ /**
+ * Handle change event
+ */
+ const handleOnChange = (event) => {
+ const {
+ target: { value, selectionStart },
+ } = event;
+
+ processChange(value, selectionStart);
+
+ onChange && onChange(event);
+ };
+
+ /**
+ * Handle focus event
+ */
+ const handleOnFocus = (event) => {
+ onFocus && onFocus(event);
+ return stateValue ? stateValue.length : 0;
+ };
+
+ /**
+ * Handle blur event
+ *
+ * Format value by padding/trimming decimals if required by
+ */
+ const handleOnBlur = (event) => {
+ const {
+ target: { value },
+ } = event;
+
+ const valueOnly = cleanValue({ value, ...cleanValueOptions });
+
+ if (valueOnly === "-" || !valueOnly) {
+ setStateValue("");
+ onBlur && onBlur(event);
+ return;
+ }
+
+ const fixedDecimals = fixedDecimalValue(valueOnly, decimalSeparator, fixedDecimalLength);
+
+ const newValue = padTrimValue(fixedDecimals, decimalSeparator, decimalScale !== undefined ? decimalScale : fixedDecimalLength);
+
+ const numberValue = parseFloat(newValue.replace(decimalSeparator, "."));
+
+ const formattedValue = formatValue({
+ ...formatValueOptions,
+ value: newValue,
+ });
+
+ if (onValueChange) {
+ onValueChange(newValue, name, {
+ float: numberValue,
+ formatted: formattedValue,
+ value: newValue,
+ });
+ }
+
+ setStateValue(formattedValue);
+
+ onBlur && onBlur(event);
+ };
+
+ /**
+ * Handle key down event
+ *
+ * Increase or decrease value by step
+ */
+ const handleOnKeyDown = (event) => {
+ const { key } = event;
+
+ setLastKeyStroke(key);
+
+ if (step && (key === "ArrowUp" || key === "ArrowDown")) {
+ event.preventDefault();
+ setCursor(stateValue.length);
+
+ const currentValue =
+ parseFloat(
+ userValue !== undefined && userValue !== null
+ ? String(userValue).replace(decimalSeparator, ".")
+ : cleanValue({ value: stateValue, ...cleanValueOptions })
+ ) || 0;
+ const newValue = key === "ArrowUp" ? currentValue + step : currentValue - step;
+
+ if (min !== undefined && newValue < min) {
+ return;
+ }
+
+ if (max !== undefined && newValue > max) {
+ return;
+ }
+
+ const fixedLength = String(step).includes(".") ? Number(String(step).split(".")[1].length) : undefined;
+
+ processChange(String(fixedLength ? newValue.toFixed(fixedLength) : newValue).replace(".", decimalSeparator));
+ }
+
+ onKeyDown && onKeyDown(event);
+ };
+
+ /**
+ * Handle key up event
+ *
+ * Move cursor if there is a suffix to prevent user typing past suffix
+ */
+ const handleOnKeyUp = (event) => {
+ const {
+ key,
+ currentTarget: { selectionStart },
+ } = event;
+ if (key !== "ArrowUp" && key !== "ArrowDown" && stateValue !== "-") {
+ const suffix = getSuffix(stateValue, { groupSeparator, decimalSeparator });
+
+ if (suffix && selectionStart && selectionStart > stateValue.length - suffix.length) {
+ /* istanbul ignore else */
+ if (inputRef.current) {
+ const newCursor = stateValue.length - suffix.length;
+ inputRef.current.setSelectionRange(newCursor, newCursor);
+ }
+ }
+ }
+
+ onKeyUp && onKeyUp(event);
+ };
+
+ useEffect(() => {
+ // prevent cursor jumping if editing value
+ if (dirty && stateValue !== "-" && inputRef.current && document.activeElement === inputRef.current) {
+ inputRef.current.setSelectionRange(cursor, cursor);
+ }
+ }, [stateValue, cursor, inputRef, dirty, changeCount]);
+
+ /**
+ * If user has only entered "-" or decimal separator,
+ * keep the char to allow them to enter next value
+ */
+ const getRenderValue = () => {
+ if (userValue !== undefined && userValue !== null && stateValue !== "-" && (!decimalSeparator || stateValue !== decimalSeparator)) {
+ return formatValue({
+ ...formatValueOptions,
+ decimalScale: dirty ? undefined : decimalScale,
+ value: String(userValue),
+ });
+ }
+
+ return stateValue;
+ };
+
+ const inputProps = {
+ type: "text",
+ inputMode: "decimal",
+ id,
+ name,
+ className,
+ onChange: handleOnChange,
+ onBlur: handleOnBlur,
+ onFocus: handleOnFocus,
+ onKeyDown: handleOnKeyDown,
+ onKeyUp: handleOnKeyUp,
+ placeholder,
+ disabled,
+ value: getRenderValue(),
+ ref: inputRef,
+ ...props,
+ };
+
+ if (customInput) {
+ const CustomInput = customInput;
+ return ;
+ }
+
+ return ;
+ }
+);
+
+CurrencyInput.displayName = "CurrencyInput";
+
+CurrencyInput.propTypes = {
+ allowDecimals: PropTypes.bool,
+ allowNegativeValue: PropTypes.bool,
+ id: PropTypes.string,
+ name: PropTypes.string,
+ className: PropTypes.string,
+ customInput: PropTypes.elementType,
+ decimalsLimit: PropTypes.number,
+ defaultValue: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
+ disabled: PropTypes.bool,
+ maxLength: PropTypes.number,
+ value: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
+ onValueChange: PropTypes.func,
+ fixedDecimalLength: PropTypes.number,
+ placeholder: PropTypes.string,
+ decimalScale: PropTypes.number,
+ prefix: PropTypes.string,
+ suffix: PropTypes.string,
+ intlConfig: PropTypes.object,
+ step: PropTypes.number,
+ min: PropTypes.number,
+ max: PropTypes.number,
+ disableGroupSeparators: PropTypes.bool,
+ disableAbbreviations: PropTypes.bool,
+ decimalSeparator: PropTypes.string,
+ groupSeparator: PropTypes.string,
+ onChange: PropTypes.func,
+ onFocus: PropTypes.func,
+ onBlur: PropTypes.func,
+ onKeyDown: PropTypes.func,
+ onKeyUp: PropTypes.func,
+ transformRawValue: PropTypes.func,
+ otherProps: PropTypes.object,
+ inputRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({ current: PropTypes.instanceOf(Element) })]),
+};
+
+export default CurrencyInput;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/utils/digitUtils.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/utils/digitUtils.js
new file mode 100644
index 00000000..2d58095c
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/utils/digitUtils.js
@@ -0,0 +1,6 @@
+
+
+
+export const getUserType=()=>{
+ return window?.Digit?.SessionStorage?.get("userType")||"employee";
+}
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/utils/formatter.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/utils/formatter.js
new file mode 100644
index 00000000..706ef774
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/utils/formatter.js
@@ -0,0 +1,36 @@
+const amountFormatter = (value, denomination, t) => {
+ const currencyFormatter = new Intl.NumberFormat("en-IN", { currency: "INR" });
+
+ switch (denomination) {
+ case "Lac":
+ return `₹ ${currencyFormatter.format((value / 100000).toFixed(2) || 0)} ${t("ES_DSS_LAC")}`;
+ case "Cr":
+ return `₹ ${currencyFormatter.format((value / 10000000).toFixed(2) || 0)} ${t("ES_DSS_CR")}`;
+ case "Unit":
+ return `₹ ${currencyFormatter.format(value?.toFixed(2) || 0)}`;
+ default:
+ return "";
+ }
+};
+
+export const formatter = (value, symbol, unit, commaSeparated = true, t) => {
+ if (!value && value !== 0) return "";
+ switch (symbol) {
+ case "amount":
+ return amountFormatter(value, unit, t);
+ //this case needs to be removed as backend should handle case sensitiviy from their end
+ case "Amount":
+ return amountFormatter(value, unit, t);
+ case "number":
+ if (!commaSeparated) {
+ return parseInt(value);
+ }
+ const Nformatter = new Intl.NumberFormat("en-IN");
+ return Nformatter.format(value);
+ case "percentage":
+ const Pformatter = new Intl.NumberFormat("en-IN", { maximumSignificantDigits: 3 });
+ return `${Pformatter.format(value.toFixed(2))} %`;
+ default:
+ return "";
+ }
+};
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/utils/getFileTypeFromFileStoreURL.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/utils/getFileTypeFromFileStoreURL.js
new file mode 100644
index 00000000..729a2b03
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/utils/getFileTypeFromFileStoreURL.js
@@ -0,0 +1,8 @@
+const getFileTypeFromFileStoreURL = (filestoreURL) => {
+ if (filestoreURL.includes(".pdf")) return "pdf";
+ if (filestoreURL.includes(".jpg") || filestoreURL.includes(".jpeg") || filestoreURL.includes(".png") || filestoreURL.includes(".webp"))
+ return "image";
+ else return "image";
+};
+
+export default getFileTypeFromFileStoreURL;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/utils/iconRender.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/utils/iconRender.js
new file mode 100644
index 00000000..629ccb01
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/utils/iconRender.js
@@ -0,0 +1,33 @@
+import { CustomSVG } from "../atoms/CustomSVG";
+
+export const iconRender = (iconReq, iconFill, width, height, className) => {
+ try {
+ const components = require("@egovernments/digit-ui-svg-components");
+ const DynamicIcon = components?.[iconReq];
+ const svgIcon = CustomSVG?.[iconReq];
+
+ if (DynamicIcon) {
+ const svgElement = DynamicIcon({
+ width: width,
+ height: height,
+ fill: iconFill,
+ className: className,
+ });
+ return svgElement;
+ } else if (svgIcon) {
+ const svgElement = svgIcon({
+ width: width,
+ height: height,
+ fill: iconFill,
+ className: className,
+ });
+ return svgElement;
+ } else {
+ console.error("Icon not found");
+ return null;
+ }
+ } catch (error) {
+ console.error("Icon not found");
+ return null;
+ }
+};
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/utils/index.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/utils/index.js
new file mode 100644
index 00000000..e69de29b
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/utils/inputAmountWrapper.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/utils/inputAmountWrapper.js
new file mode 100644
index 00000000..9d70f656
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/utils/inputAmountWrapper.js
@@ -0,0 +1,68 @@
+import React, { useEffect, useState } from "react";
+import TextInput from "../atoms/TextInput";
+import { CurrencyInput } from "./currencyInput";
+
+const DEFAULT_PREFIX = "₹ ";
+const LIMIT = 500;
+
+export const InputAmountWrapper = ({ ref, ...props }) => {
+ const prefix = props?.prefix || DEFAULT_PREFIX;
+
+ const [errorMessage, setErrorMessage] = useState("");
+ const [className, setClassName] = useState("");
+ const [value, setValue] = useState(props?.defaultValue);
+ const [values, setValues] = useState();
+ const [rawValue, setRawValue] = useState(" ");
+
+ useEffect(() => {
+ props.onValueChange ? props.onValueChange(value) : null;
+ }, [value]);
+
+ /**
+ * Handle validation
+ */
+ const handleOnValueChange = (value, _, values) => {
+ setValues(values);
+ setRawValue(value === undefined ? "undefined" : value || " ");
+
+ if (!value) {
+ setClassName("");
+ setValue("");
+ return;
+ }
+
+ if (Number.isNaN(Number(value))) {
+ // setErrorMessage('Please enter a valid number');
+ // setClassName('is-invalid');
+ return;
+ }
+
+ if (Number(value) > LIMIT) {
+ // setErrorMessage(`Max: ${prefix}${LIMIT}`);
+ // setClassName('is-invalid');
+ setValue(value);
+ return;
+ }
+
+ // setClassName('is-valid');
+ setValue(value);
+ };
+
+ return (
+
+ );
+};
+
+export default InputAmountWrapper;
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/utils/transformedLocal.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/utils/transformedLocal.js
new file mode 100644
index 00000000..dc7e5b71
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/utils/transformedLocal.js
@@ -0,0 +1,5 @@
+export const getTransformedLocale = (label) => {
+ if (typeof label === "number") return label;
+ label = label?.trim();
+ return label && label.toUpperCase().replace(/[.:-\s\/]/g, "_");
+};
diff --git a/micro-ui/web/micro-ui-internals/packages/ui-components/src/utils/uploadFileComposerUtils.js b/micro-ui/web/micro-ui-internals/packages/ui-components/src/utils/uploadFileComposerUtils.js
new file mode 100644
index 00000000..d8fb2dd5
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/packages/ui-components/src/utils/uploadFileComposerUtils.js
@@ -0,0 +1,38 @@
+let documentFileTypeMappings = {
+ docx: "vnd.openxmlformats-officedocument.wordprocessingml.document",
+ doc: "application/msword",
+ png: "png",
+ pdf: "pdf",
+ jpeg: "jpeg",
+ jpg: "jpeg",
+ xls: "vnd.ms-excel",
+ xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
+ csv: "csv",
+};
+
+export const getRegex = (allowedFormats) => {
+ // console.log(allowedFormats);
+ // if(allowedFormats?.length) {
+ // const obj = { "expression" : `/(.*?)(${allowedFormats?.join('|')})$/`}
+ // const stringified = JSON.stringify(obj);
+ // console.log(new RegExp(JSON.parse(stringified).expression.slice(1, -1)));
+ // return new RegExp(JSON.parse(stringified).expression.slice(1, -1));
+ // } else if(docConfig?.allowedFileTypes?.length) {
+ // const obj = { "expression" : `/(.*?)(${docConfig?.allowedFileTypes?.join('|')})$/`}
+ // const stringified = JSON.stringify(obj);
+ // console.log(new RegExp(JSON.parse(stringified).expression.slice(1, -1)))
+ // return new RegExp(JSON.parse(stringified).expression.slice(1, -1));
+ // }
+ // return /(.*?)(pdf|docx|jpeg|jpg|png|msword|openxmlformats-officedocument|wordprocessingml|document|spreadsheetml|sheet)$/
+ if (allowedFormats?.length) {
+ let exceptedFileTypes = [];
+ allowedFormats?.forEach((allowedFormat) => {
+ exceptedFileTypes.push(documentFileTypeMappings[allowedFormat]);
+ });
+ exceptedFileTypes = exceptedFileTypes.join("|");
+ return new RegExp(`(.*?)(${exceptedFileTypes})$`);
+ }
+ return /(.*?)(pdf|docx|jpeg|jpg|png|msword|openxmlformats-officedocument|wordprocessingml|document|spreadsheetml|sheet)$/;
+};
+
+// export { documentFileTypeMappings, getRegex };
diff --git a/micro-ui/web/micro-ui-internals/publish-develop.sh b/micro-ui/web/micro-ui-internals/publish-develop.sh
new file mode 100644
index 00000000..4909658c
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/publish-develop.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+BASEDIR="$(cd "$(dirname "$0")" && pwd)"
+
+msg() {
+ echo -e "\n\n\033[32;32m$1\033[0m"
+}
+
+
+# msg "Pre-building all packages"
+# yarn build
+# sleep 5
+
+msg "Building and publishing css"
+cd "$BASEDIR/packages/css" && rm -rf dist && yarn && npm publish --tag campaign-1.0
+
+
+# msg "Building and publishing libraries"
+# cd "$BASEDIR/packages/modules/workbench-hcm" && rm -rf dist && yarn&& npm publish --tag workbench-1.0
+
diff --git a/micro-ui/web/micro-ui-internals/publish.sh b/micro-ui/web/micro-ui-internals/publish.sh
new file mode 100644
index 00000000..4909658c
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/publish.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+BASEDIR="$(cd "$(dirname "$0")" && pwd)"
+
+msg() {
+ echo -e "\n\n\033[32;32m$1\033[0m"
+}
+
+
+# msg "Pre-building all packages"
+# yarn build
+# sleep 5
+
+msg "Building and publishing css"
+cd "$BASEDIR/packages/css" && rm -rf dist && yarn && npm publish --tag campaign-1.0
+
+
+# msg "Building and publishing libraries"
+# cd "$BASEDIR/packages/modules/workbench-hcm" && rm -rf dist && yarn&& npm publish --tag workbench-1.0
+
diff --git a/micro-ui/web/micro-ui-internals/scripts/create.sh b/micro-ui/web/micro-ui-internals/scripts/create.sh
new file mode 100755
index 00000000..9de72331
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/scripts/create.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+./scripts/run.sh core utilities
diff --git a/micro-ui/web/micro-ui-internals/scripts/deploy.sh b/micro-ui/web/micro-ui-internals/scripts/deploy.sh
new file mode 100755
index 00000000..5b0c7b83
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/scripts/deploy.sh
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+curl -v -X POST https://builds.digit.org/job/builds/job/digit-ui/buildWithParameters \
+ --user saurabh-egov:114cbf3df675835931688b2d3f0014a1f7 \
+ --data-urlencode json='{"parameter": [{"name":"BRANCH", "value":"origin/'$1'"}]}'
+
+# curl https://builds.digit.org/job/builds/job/digit-ui/lastBuild/api/json | grep --color result\":null
+
diff --git a/micro-ui/web/micro-ui-internals/scripts/jenkins.sh b/micro-ui/web/micro-ui-internals/scripts/jenkins.sh
new file mode 100755
index 00000000..a1711fec
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/scripts/jenkins.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+./scripts/deploy.sh dev
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/scripts/run.sh b/micro-ui/web/micro-ui-internals/scripts/run.sh
new file mode 100755
index 00000000..f00c59f1
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/scripts/run.sh
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+MODULES=( "components" "core" "libraries" "example" )
+
+RUNARGS=()
+BUILDARGS=()
+
+for var in "$@"
+do
+ BUILDARGS=( ${BUILDARGS[@]} build:"$var" )
+ RUNARGS=( ${RUNARGS[@]} dev:"$var" )
+done
+
+a=0
+while [ "$a" -lt 3 ]
+do
+ BUILD[$a]=build:${MODULES[$a]}
+ a=` expr $a + 1 `
+done
+
+echo "BUILDING MODULES:-" ${BUILD[*]} ${BUILDARGS[*]}
+yarn run-p ${BUILD[*]} ${BUILDARGS[*]}
+
+b=0
+while [ "$b" -lt 4 ]
+do
+ RUN[$b]=dev:${MODULES[$b]}
+ b=` expr $b + 1 `
+done
+
+echo "SERVING MODULES:-" ${RUN[*]} ${RUNARGS[*]}
+yarn run-p ${RUN[*]} ${RUNARGS[*]}
\ No newline at end of file
diff --git a/micro-ui/web/micro-ui-internals/test.js b/micro-ui/web/micro-ui-internals/test.js
new file mode 100644
index 00000000..60c958d0
--- /dev/null
+++ b/micro-ui/web/micro-ui-internals/test.js
@@ -0,0 +1,31 @@
+const middleWare_1 = (data, _break, _next) => {
+ data.a = "a";
+ _next(data);
+};
+
+
+const middleWare_2 = (data, _break, _next) => {
+ data.b = "b";
+ // _break();
+ _next(data);
+};
+
+const middleWare_3 = (data, _break, _next) => {
+ data.c = "c";
+ _next(data);
+};
+
+let middleWares = [middleWare_1, middleWare_2, middleWare_3];
+
+const callMiddlewares = () => {
+ let applyBreak = false;
+ let itr = -1;
+ let _break = () => (applyBreak = true);
+ let _next = (data) => {
+ if (!applyBreak && ++itr < middleWares.length) middleWares[itr](data, _break, _next);
+ else return;
+ };
+ _next({});
+};
+
+callMiddlewares();
diff --git a/micro-ui/web/package.json b/micro-ui/web/package.json
new file mode 100644
index 00000000..410d51a4
--- /dev/null
+++ b/micro-ui/web/package.json
@@ -0,0 +1,83 @@
+{
+ "name": "micro-ui",
+ "version": "1.0.0",
+ "author": "Jagankumar ",
+ "license": "MIT",
+ "private": true,
+ "engines": {
+ "node": ">=14"
+ },
+ "workspaces": [
+ "micro-ui-internals/packages/modules/*",
+ "micro-ui-internals/packages/libraries",
+ "micro-ui-internals/packages/ui-components"
+ ],
+ "homepage": "/digit-ui",
+ "dependencies": {
+ "@egovernments/digit-ui-libraries": "1.8.11",
+ "@egovernments/digit-ui-module-core": "1.8.33",
+ "@egovernments/digit-ui-module-utilities": "1.0.15",
+ "@egovernments/digit-ui-react-components": "1.8.19",
+ "@egovernments/digit-ui-components": "0.2.0-studio.1",
+ "@egovernments/digit-ui-module-workbench": "1.0.1-beta.1",
+ "@egovernments/digit-ui-module-hcmworkbench":"0.0.38",
+ "@egovernments/digit-ui-module-public-services": "0.0.1",
+ "babel-loader": "8.1.0",
+ "clean-webpack-plugin": "4.0.0",
+ "react": "17.0.2",
+ "react-dom": "17.0.2",
+ "jsonpath": "^1.1.1",
+ "react-router-dom": "5.3.0",
+ "react-scripts": "4.0.1",
+ "web-vitals": "1.1.2",
+ "terser-brunch": "^4.1.0",
+ "react-hook-form": "6.15.8",
+ "react-i18next": "11.16.2",
+ "react-query": "3.6.1",
+ "css-loader": "5.2.6",
+ "style-loader": "2.0.0",
+ "webpack-cli": "4.10.0"
+ },
+ "devDependencies": {
+ "@babel/plugin-proposal-private-property-in-object": "7.21.0",
+ "http-proxy-middleware": "1.3.1",
+ "lodash": "4.17.21",
+ "microbundle-crl": "0.13.11",
+ "react": "17.0.2",
+ "react-dom": "17.0.2",
+ "react-hook-form": "6.15.8",
+ "react-i18next": "11.16.2",
+ "react-query": "3.6.1",
+ "react-router-dom": "5.3.0",
+ "husky": "7.0.4",
+ "lint-staged": "12.3.7",
+ "npm-run-all": "4.1.5",
+ "prettier": "2.1.2"
+ },
+ "scripts": {
+ "start": "react-scripts start",
+ "build": "GENERATE_SOURCEMAP=false SKIP_PREFLIGHT_CHECK=true react-scripts build",
+ "build:prepare": "./build.sh",
+ "build:libraries": "cd micro-ui-internals && yarn build",
+ "build:prod": "webpack --mode production",
+ "build:webpack": "yarn build:libraries &&cd .. && ls && cd ./web && ls && yarn build:prod",
+ "clean": "rm -rf node_modules"
+ },
+ "eslintConfig": {
+ "extends": [
+ "react-app"
+ ]
+ },
+ "browserslist": {
+ "production": [
+ ">0.2%",
+ "not dead",
+ "not op_mini all"
+ ],
+ "development": [
+ "last 1 chrome version",
+ "last 1 firefox version",
+ "last 1 safari version"
+ ]
+ }
+}
\ No newline at end of file
diff --git a/micro-ui/web/public/index.html b/micro-ui/web/public/index.html
new file mode 100644
index 00000000..bf866712
--- /dev/null
+++ b/micro-ui/web/public/index.html
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
+ DIGIT
+
+
+
+
+
+ You need to enable JavaScript to run this app.
+
+
+
+
+
\ No newline at end of file
diff --git a/micro-ui/web/public/robots.txt b/micro-ui/web/public/robots.txt
new file mode 100644
index 00000000..e9e57dc4
--- /dev/null
+++ b/micro-ui/web/public/robots.txt
@@ -0,0 +1,3 @@
+# https://www.robotstxt.org/robotstxt.html
+User-agent: *
+Disallow:
diff --git a/micro-ui/web/src/App.js b/micro-ui/web/src/App.js
new file mode 100644
index 00000000..ab164581
--- /dev/null
+++ b/micro-ui/web/src/App.js
@@ -0,0 +1,64 @@
+import React from "react";
+import { initLibraries } from "@egovernments/digit-ui-libraries";
+import { DigitUI } from "@egovernments/digit-ui-module-core";
+// import { initHRMSComponents } from "@egovernments/digit-ui-module-hrms";
+import { UICustomizations } from "./Customisations/UICustomizations";
+import { initWorkbenchComponents } from "@egovernments/digit-ui-module-workbench";
+import { initUtilitiesComponents } from "@egovernments/digit-ui-module-utilities";
+import { initWorkbenchHCMComponents } from "@egovernments/digit-ui-module-hcmworkbench";
+//import {initSampleComponents} from "@egovernments/digit-ui-module-sample";
+import { initPublicServiceComponents } from "@egovernments/digit-ui-module-public-services";
+window.contextPath = window?.globalConfigs?.getConfig("CONTEXT_PATH");
+
+const enabledModules = [
+ "DSS",
+ "NDSS",
+ "Utilities",
+ // "HRMS",
+ "Engagement",
+ "Workbench",
+ "HCMWORKBENCH",
+ "sample"
+];
+
+const moduleReducers = (initData) => ({
+ initData,
+});
+
+const initDigitUI = () => {
+ window.Digit.ComponentRegistryService.setupRegistry({});
+ window.Digit.Customizations = {
+ PGR: {},
+ commonUiConfig: UICustomizations,
+ };
+ // initHRMSComponents();
+ initUtilitiesComponents();
+ initWorkbenchComponents();
+ initWorkbenchHCMComponents();
+ initPublicServiceComponents();
+
+};
+
+initLibraries().then(() => {
+ initDigitUI();
+});
+
+function App() {
+ window.contextPath = window?.globalConfigs?.getConfig("CONTEXT_PATH");
+ const stateCode =
+ window.globalConfigs?.getConfig("STATE_LEVEL_TENANT_ID") ||
+ process.env.REACT_APP_STATE_LEVEL_TENANT_ID;
+ if (!stateCode) {
+ return stateCode is not defined ;
+ }
+ return (
+
+ );
+}
+
+export default App;
diff --git a/micro-ui/web/src/ComponentRegistry.js b/micro-ui/web/src/ComponentRegistry.js
new file mode 100644
index 00000000..9bafce3d
--- /dev/null
+++ b/micro-ui/web/src/ComponentRegistry.js
@@ -0,0 +1,11 @@
+class Registry {
+ constructor(registry = {}) {
+ this._registry = registry;
+ }
+
+ getComponent(id) {
+ return this._registry[id];
+ }
+}
+
+export default Registry;
diff --git a/micro-ui/web/src/Customisations/UICustomizations.js b/micro-ui/web/src/Customisations/UICustomizations.js
new file mode 100644
index 00000000..6d17ab0d
--- /dev/null
+++ b/micro-ui/web/src/Customisations/UICustomizations.js
@@ -0,0 +1,428 @@
+import { Link } from "react-router-dom";
+import _ from "lodash";
+
+//create functions here based on module name set in mdms(eg->SearchProjectConfig)
+//how to call these -> Digit?.Customizations?.[masterName]?.[moduleName]
+// these functions will act as middlewares
+var Digit = window.Digit || {};
+
+
+
+const businessServiceMap = {
+
+ "muster roll": "MR"
+};
+
+const inboxModuleNameMap = {
+ "muster-roll-approval": "muster-roll-service",
+};
+
+export const UICustomizations = {
+ businessServiceMap,
+ updatePayload: (applicationDetails, data, action, businessService) => {
+
+ if (businessService === businessServiceMap.estimate) {
+ const workflow = {
+ comment: data.comments,
+ documents: data?.documents?.map((document) => {
+ return {
+ documentType: action?.action + " DOC",
+ fileName: document?.[1]?.file?.name,
+ fileStoreId: document?.[1]?.fileStoreId?.fileStoreId,
+ documentUid: document?.[1]?.fileStoreId?.fileStoreId,
+ tenantId: document?.[1]?.fileStoreId?.tenantId,
+ };
+ }),
+ assignees: data?.assignees?.uuid ? [data?.assignees?.uuid] : null,
+ action: action.action,
+ };
+ //filtering out the data
+ Object.keys(workflow).forEach((key, index) => {
+ if (!workflow[key] || workflow[key]?.length === 0) delete workflow[key];
+ });
+
+ return {
+ estimate: applicationDetails,
+ workflow,
+ };
+ }
+ if (businessService === businessServiceMap.contract) {
+ const workflow = {
+ comment: data?.comments,
+ documents: data?.documents?.map((document) => {
+ return {
+ documentType: action?.action + " DOC",
+ fileName: document?.[1]?.file?.name,
+ fileStoreId: document?.[1]?.fileStoreId?.fileStoreId,
+ documentUid: document?.[1]?.fileStoreId?.fileStoreId,
+ tenantId: document?.[1]?.fileStoreId?.tenantId,
+ };
+ }),
+ assignees: data?.assignees?.uuid ? [data?.assignees?.uuid] : null,
+ action: action.action,
+ };
+ //filtering out the data
+ Object.keys(workflow).forEach((key, index) => {
+ if (!workflow[key] || workflow[key]?.length === 0) delete workflow[key];
+ });
+
+ return {
+ contract: applicationDetails,
+ workflow,
+ };
+ }
+ if (businessService === businessServiceMap?.["muster roll"]) {
+ const workflow = {
+ comment: data?.comments,
+ documents: data?.documents?.map((document) => {
+ return {
+ documentType: action?.action + " DOC",
+ fileName: document?.[1]?.file?.name,
+ fileStoreId: document?.[1]?.fileStoreId?.fileStoreId,
+ documentUid: document?.[1]?.fileStoreId?.fileStoreId,
+ tenantId: document?.[1]?.fileStoreId?.tenantId,
+ };
+ }),
+ assignees: data?.assignees?.uuid ? [data?.assignees?.uuid] : null,
+ action: action.action,
+ };
+ //filtering out the data
+ Object.keys(workflow).forEach((key, index) => {
+ if (!workflow[key] || workflow[key]?.length === 0) delete workflow[key];
+ });
+
+ return {
+ musterRoll: applicationDetails,
+ workflow,
+ };
+ }
+ if(businessService === businessServiceMap?.["works.purchase"]){
+ const workflow = {
+ comment: data.comments,
+ documents: data?.documents?.map((document) => {
+ return {
+ documentType: action?.action + " DOC",
+ fileName: document?.[1]?.file?.name,
+ fileStoreId: document?.[1]?.fileStoreId?.fileStoreId,
+ documentUid: document?.[1]?.fileStoreId?.fileStoreId,
+ tenantId: document?.[1]?.fileStoreId?.tenantId,
+ };
+ }),
+ assignees: data?.assignees?.uuid ? [data?.assignees?.uuid] : null,
+ action: action.action,
+ };
+ //filtering out the data
+ Object.keys(workflow).forEach((key, index) => {
+ if (!workflow[key] || workflow[key]?.length === 0) delete workflow[key];
+ });
+
+ const additionalFieldsToSet = {
+ projectId:applicationDetails.additionalDetails.projectId,
+ invoiceDate:applicationDetails.billDate,
+ invoiceNumber:applicationDetails.referenceId.split('_')?.[1],
+ contractNumber:applicationDetails.referenceId.split('_')?.[0],
+ documents:applicationDetails.additionalDetails.documents
+ }
+ return {
+ bill: {...applicationDetails,...additionalFieldsToSet},
+ workflow,
+ };
+ }
+ },
+ enableModalSubmit:(businessService,action,setModalSubmit,data)=>{
+ if(businessService === businessServiceMap?.["muster roll"] && action.action==="APPROVE"){
+ setModalSubmit(data?.acceptTerms)
+ }
+ },
+ enableHrmsSearch: (businessService, action) => {
+ if (businessService === businessServiceMap.estimate) {
+ return action.action.includes("TECHNICALSANCTION") || action.action.includes("VERIFYANDFORWARD");
+ }
+ if (businessService === businessServiceMap.contract) {
+ return action.action.includes("VERIFY_AND_FORWARD");
+ }
+ if (businessService === businessServiceMap?.["muster roll"]) {
+ return action.action.includes("VERIFY");
+ }
+ if(businessService === businessServiceMap?.["works.purchase"]){
+ return action.action.includes("VERIFY_AND_FORWARD")
+ }
+ return false;
+ },
+ getBusinessService: (moduleCode) => {
+ if (moduleCode?.includes("estimate")) {
+ return businessServiceMap?.estimate;
+ } else if (moduleCode?.includes("contract")) {
+ return businessServiceMap?.contract;
+ } else if (moduleCode?.includes("muster roll")) {
+ return businessServiceMap?.["muster roll"];
+ }
+ else if (moduleCode?.includes("works.purchase")) {
+ return businessServiceMap?.["works.purchase"];
+ }
+ else if (moduleCode?.includes("works.wages")) {
+ return businessServiceMap?.["works.wages"];
+ }
+ else if (moduleCode?.includes("works.supervision")) {
+ return businessServiceMap?.["works.supervision"];
+ }
+ else {
+ return businessServiceMap;
+ }
+ },
+ getInboxModuleName: (moduleCode) => {
+ if (moduleCode?.includes("estimate")) {
+ return inboxModuleNameMap?.estimate;
+ } else if (moduleCode?.includes("contract")) {
+ return inboxModuleNameMap?.contracts;
+ } else if (moduleCode?.includes("attendence")) {
+ return inboxModuleNameMap?.attendencemgmt;
+ } else {
+ return inboxModuleNameMap;
+ }
+ },
+
+ AttendanceInboxConfig: {
+ preProcess: (data) => {
+
+ //set tenantId
+ data.body.inbox.tenantId = Digit.ULBService.getCurrentTenantId();
+ data.body.inbox.processSearchCriteria.tenantId = Digit.ULBService.getCurrentTenantId();
+
+ const musterRollNumber = data?.body?.inbox?.moduleSearchCriteria?.musterRollNumber?.trim();
+ if(musterRollNumber) data.body.inbox.moduleSearchCriteria.musterRollNumber = musterRollNumber
+
+ const attendanceRegisterName = data?.body?.inbox?.moduleSearchCriteria?.attendanceRegisterName?.trim();
+ if(attendanceRegisterName) data.body.inbox.moduleSearchCriteria.attendanceRegisterName = attendanceRegisterName
+
+ // deleting them for now(assignee-> need clarity from pintu,ward-> static for now,not implemented BE side)
+ const assignee = _.clone(data.body.inbox.moduleSearchCriteria.assignee);
+ delete data.body.inbox.moduleSearchCriteria.assignee;
+ if (assignee?.code === "ASSIGNED_TO_ME") {
+ data.body.inbox.moduleSearchCriteria.assignee = Digit.UserService.getUser().info.uuid;
+ }
+
+ //cloning locality and workflow states to format them
+ // let locality = _.clone(data.body.inbox.moduleSearchCriteria.locality ? data.body.inbox.moduleSearchCriteria.locality : []);
+
+ let selectedOrg = _.clone(data.body.inbox.moduleSearchCriteria.orgId ? data.body.inbox.moduleSearchCriteria.orgId : null);
+ delete data.body.inbox.moduleSearchCriteria.orgId;
+ if(selectedOrg) {
+ data.body.inbox.moduleSearchCriteria.orgId = selectedOrg?.[0]?.applicationNumber;
+ }
+
+ // let selectedWard = _.clone(data.body.inbox.moduleSearchCriteria.ward ? data.body.inbox.moduleSearchCriteria.ward : null);
+ // delete data.body.inbox.moduleSearchCriteria.ward;
+ // if(selectedWard) {
+ // data.body.inbox.moduleSearchCriteria.ward = selectedWard?.[0]?.code;
+ // }
+
+ let states = _.clone(data.body.inbox.moduleSearchCriteria.state ? data.body.inbox.moduleSearchCriteria.state : []);
+ let ward = _.clone(data.body.inbox.moduleSearchCriteria.ward ? data.body.inbox.moduleSearchCriteria.ward : []);
+ // delete data.body.inbox.moduleSearchCriteria.locality;
+ delete data.body.inbox.moduleSearchCriteria.state;
+ delete data.body.inbox.moduleSearchCriteria.ward;
+
+ // locality = locality?.map((row) => row?.code);
+ states = Object.keys(states)?.filter((key) => states[key]);
+ ward = ward?.map((row) => row?.code);
+
+
+ // //adding formatted data to these keys
+ // if (locality.length > 0) data.body.inbox.moduleSearchCriteria.locality = locality;
+ if (states.length > 0) data.body.inbox.moduleSearchCriteria.status = states;
+ if (ward.length > 0) data.body.inbox.moduleSearchCriteria.ward = ward;
+ const projectType = _.clone(data.body.inbox.moduleSearchCriteria.projectType ? data.body.inbox.moduleSearchCriteria.projectType : {});
+ if (projectType?.code) data.body.inbox.moduleSearchCriteria.projectType = projectType.code;
+
+ //adding tenantId to moduleSearchCriteria
+ data.body.inbox.moduleSearchCriteria.tenantId = Digit.ULBService.getCurrentTenantId();
+
+ //setting limit and offset becoz somehow they are not getting set in muster inbox
+ data.body.inbox .limit = data.state.tableForm.limit
+ data.body.inbox.offset = data.state.tableForm.offset
+ delete data.state
+ return data;
+ },
+ postProcess: (responseArray, uiConfig) => {
+ const statusOptions = responseArray?.statusMap
+ ?.filter((item) => item.applicationstatus)
+ ?.map((item) => ({ code: item.applicationstatus, i18nKey: `COMMON_MASTERS_${item.applicationstatus}` }));
+ if (uiConfig?.type === "filter") {
+ let fieldConfig = uiConfig?.fields?.filter((item) => item.type === "dropdown" && item.populators.name === "musterRollStatus");
+ if (fieldConfig.length) {
+ fieldConfig[0].populators.options = statusOptions;
+ }
+ }
+ },
+ additionalCustomizations: (row, key, column, value, t, searchResult) => {
+ if (key === "ATM_MUSTER_ROLL_ID") {
+ return (
+
+
+ {String(value ? (column.translate ? t(column.prefix ? `${column.prefix}${value}` : value) : value) : t("ES_COMMON_NA"))}
+
+
+ );
+ }
+ if (key === "ATM_ATTENDANCE_WEEK") {
+ const week = `${Digit.DateUtils.ConvertTimestampToDate(value?.startDate, "dd/MM/yyyy")}-${Digit.DateUtils.ConvertTimestampToDate(
+ value?.endDate,
+ "dd/MM/yyyy"
+ )}`;
+ return {week}
;
+ }
+ if (key === "ATM_NO_OF_INDIVIDUALS") {
+ return {value?.length}
;
+ }
+ if(key === "ATM_AMOUNT_IN_RS"){
+ return {value ? Digit.Utils.dss.formatterWithoutRound(value, "number") : t("ES_COMMON_NA")} ;
+ }
+ if (key === "ATM_SLA") {
+ return parseInt(value) > 0 ? (
+ {t(value) || ""}
+ ) : (
+ {t(value) || ""}
+ );
+ }
+ if (key === "COMMON_WORKFLOW_STATES") {
+ return {t(`WF_MUSTOR_${value}`)}
+ }
+ //added this in case we change the key and not updated here , it'll throw that nothing was returned from cell error if that case is not handled here. To prevent that error putting this default
+ return {t(`CASE_NOT_HANDLED`)}
+ },
+ MobileDetailsOnClick: (row, tenantId) => {
+ let link;
+ Object.keys(row).map((key) => {
+ if (key === "ATM_MUSTER_ROLL_ID")
+ link = `/${window.contextPath}/employee/attendencemgmt/view-attendance?tenantId=${tenantId}&musterRollNumber=${row[key]}`;
+ });
+ return link;
+ },
+ populateReqCriteria: () => {
+ const tenantId = Digit.ULBService.getCurrentTenantId();
+ return {
+ url: "/org-services/organisation/v1/_search",
+ params: { limit: 50, offset: 0 },
+ body: {
+ SearchCriteria: {
+ tenantId: tenantId,
+ functions : {
+ type : "CBO"
+ }
+ },
+ },
+ config: {
+ enabled: true,
+ select: (data) => {
+ return data?.organisations;
+ },
+ },
+ };
+ },
+ },
+ SearchWageSeekerConfig: {
+ customValidationCheck: (data) => {
+ //checking both to and from date are present
+ const { createdFrom, createdTo } = data;
+ if ((createdFrom === "" && createdTo !== "") || (createdFrom !== "" && createdTo === ""))
+ return { warning: true, label: "ES_COMMON_ENTER_DATE_RANGE" };
+
+ return false;
+ },
+ preProcess: (data) => {
+ data.params = { ...data.params, tenantId: Digit.ULBService.getCurrentTenantId() };
+
+ let requestBody = { ...data.body.Individual };
+ const pathConfig = {
+ name: "name.givenName",
+ };
+ const dateConfig = {
+ createdFrom: "daystart",
+ createdTo: "dayend",
+ };
+ const selectConfig = {
+ wardCode: "wardCode[0].code",
+ socialCategory: "socialCategory.code",
+ };
+ const textConfig = ["name", "individualId"]
+ let Individual = Object.keys(requestBody)
+ .map((key) => {
+ if (selectConfig[key]) {
+ requestBody[key] = _.get(requestBody, selectConfig[key], null);
+ } else if (typeof requestBody[key] == "object") {
+ requestBody[key] = requestBody[key]?.code;
+ } else if (textConfig?.includes(key)) {
+ requestBody[key] = requestBody[key]?.trim()
+ }
+ return key;
+ })
+ .filter((key) => requestBody[key])
+ .reduce((acc, curr) => {
+ if (pathConfig[curr]) {
+ _.set(acc, pathConfig[curr], requestBody[curr]);
+ } else if (dateConfig[curr] && dateConfig[curr]?.includes("day")) {
+ _.set(acc, curr, Digit.Utils.date.convertDateToEpoch(requestBody[curr], dateConfig[curr]));
+ } else {
+ _.set(acc, curr, requestBody[curr]);
+ }
+ return acc;
+ }, {});
+
+ data.body.Individual = { ...Individual };
+ return data;
+ },
+ additionalCustomizations: (row, key, column, value, t, searchResult) => {
+ //here we can add multiple conditions
+ //like if a cell is link then we return link
+ //first we can identify which column it belongs to then we can return relevant result
+ switch (key) {
+ case "MASTERS_WAGESEEKER_ID":
+ return (
+
+
+ {String(value ? (column.translate ? t(column.prefix ? `${column.prefix}${value}` : value) : value) : t("ES_COMMON_NA"))}
+
+
+ );
+
+ case "MASTERS_SOCIAL_CATEGORY":
+ return value ? {String(t(`MASTERS_${value}`))} : t("ES_COMMON_NA");
+
+ case "CORE_COMMON_PROFILE_CITY":
+ return value ? {String(t(Digit.Utils.locale.getCityLocale(value)))} : t("ES_COMMON_NA");
+
+ case "MASTERS_WARD":
+ return value ? (
+ {String(t(Digit.Utils.locale.getMohallaLocale(value, row?.tenantId)))}
+ ) : (
+ t("ES_COMMON_NA")
+ );
+
+ case "MASTERS_LOCALITY":
+ return value ? (
+ {String(t(Digit.Utils.locale.getMohallaLocale(value, row?.tenantId)))}
+ ) : (
+ t("ES_COMMON_NA")
+ );
+ default:
+ return t("ES_COMMON_NA");
+ }
+ },
+ MobileDetailsOnClick: (row, tenantId) => {
+ let link;
+ Object.keys(row).map((key) => {
+ if (key === "MASTERS_WAGESEEKER_ID")
+ link = `/${window.contextPath}/employee/masters/view-wageseeker?tenantId=${tenantId}&wageseekerId=${row[key]}`;
+ });
+ return link;
+ },
+ additionalValidations: (type, data, keys) => {
+ if (type === "date") {
+ return data[keys.start] && data[keys.end] ? () => new Date(data[keys.start]).getTime() <= new Date(data[keys.end]).getTime() : true;
+ }
+ }
+ },
+};
diff --git a/micro-ui/web/src/Customisations/index.js b/micro-ui/web/src/Customisations/index.js
new file mode 100644
index 00000000..803b1e87
--- /dev/null
+++ b/micro-ui/web/src/Customisations/index.js
@@ -0,0 +1,19 @@
+import { ptComponents } from "./pt";
+import { tlComponents } from "./tl";
+
+var Digit = window.Digit || {};
+
+const customisedComponent = {
+ ...ptComponents,
+ ...tlComponents
+}
+
+
+
+export const initCustomisationComponents = () => {
+ Object.entries(customisedComponent).forEach(([key, value]) => {
+ Digit.ComponentRegistryService.setComponent(key, value);
+ });
+};
+
+
diff --git a/micro-ui/web/src/Customisations/pt/index.js b/micro-ui/web/src/Customisations/pt/index.js
new file mode 100644
index 00000000..0063fcd4
--- /dev/null
+++ b/micro-ui/web/src/Customisations/pt/index.js
@@ -0,0 +1,13 @@
+import PropertyUsageType from "./pageComponents/PropertyUsageType";
+import PTVasikaDetails from "./pageComponents/PTVasikaDetails";
+import PTAllotmentDetails from "./pageComponents/PTAllotmentDetails";
+import PTBusinessDetails from "./pageComponents/PTBusinessDetails";
+
+
+
+export const ptComponents = {
+ PropertyUsageType: PropertyUsageType,
+ PTVasikaDetail:PTVasikaDetails,
+ PTAllotmentDetails:PTAllotmentDetails,
+ PTBusinessDetails:PTBusinessDetails
+};
diff --git a/micro-ui/web/src/Customisations/pt/pageComponents/PTAllotmentDetails.js b/micro-ui/web/src/Customisations/pt/pageComponents/PTAllotmentDetails.js
new file mode 100644
index 00000000..569aa45e
--- /dev/null
+++ b/micro-ui/web/src/Customisations/pt/pageComponents/PTAllotmentDetails.js
@@ -0,0 +1,64 @@
+import { CardLabel, CitizenInfoLabel, FormStep, LabelFieldPair, TextInput,CardLabelError } from "@egovernments/digit-ui-react-components";
+import React, { useState } from "react";
+var validation ={};
+const PTAllotmentDetails = ({ t, config, onSelect, value, userType, formData }) => {
+
+ const [
+ val, setValue
+ ] = useState(formData?.[config.key]?.alotmentDetails||"");
+
+ const goNext = () => {
+ onSelect(config.key, {alotmentDetails:val});
+ };
+
+
+ if (userType === "employee") {
+ return (
+
+
+ {t("PT_VASIKA_NO_LABEL") }
+
+ setValue(e?.target?.value)}
+ // autoFocus={presentInModifyApplication}
+ />
+
+
+
+ );
+ }
+ return (
+
+
+
+ {`${t("PT_VASIKA_ALLOTMENT_LABEL")}`}
+ setValue(e?.target?.value)}
+
+ />
+
+
+ { }
+
+ );
+};
+
+export default PTAllotmentDetails;
diff --git a/micro-ui/web/src/Customisations/pt/pageComponents/PTBusinessDetails.js b/micro-ui/web/src/Customisations/pt/pageComponents/PTBusinessDetails.js
new file mode 100644
index 00000000..3d28785e
--- /dev/null
+++ b/micro-ui/web/src/Customisations/pt/pageComponents/PTBusinessDetails.js
@@ -0,0 +1,68 @@
+import { CardLabel, CitizenInfoLabel, FormStep, LabelFieldPair, TextInput,CardLabelError } from "@egovernments/digit-ui-react-components";
+import React, { useState } from "react";
+var validation ={};
+const PTBusinessDetails = ({ t, config, onSelect, value, userType, formData }) => {
+
+
+ const [
+ val, setValue
+ ] = useState(formData?.[config.key]?.businessDetails||"");
+
+ const goNext = () => {
+ onSelect(config.key, {businessDetails:val});
+ };
+
+
+ if (userType === "employee") {
+ return (
+
+
+ {t("PT_VASIKA_NO_LABEL") }
+
+ setValue(e?.target?.value)}
+ // autoFocus={presentInModifyApplication}
+ />
+
+
+
+
+ );
+ }
+ return (
+
+
+
+
+ {`${t("PT_VASIKA_BUS_DETAILS_LABEL")}`}
+ setValue(e?.target?.value)}
+
+ />
+
+
+
+ { }
+
+ );
+};
+
+export default PTBusinessDetails;
diff --git a/micro-ui/web/src/Customisations/pt/pageComponents/PTVasikaDetails.js b/micro-ui/web/src/Customisations/pt/pageComponents/PTVasikaDetails.js
new file mode 100644
index 00000000..0e4b6895
--- /dev/null
+++ b/micro-ui/web/src/Customisations/pt/pageComponents/PTVasikaDetails.js
@@ -0,0 +1,79 @@
+import { CardLabel, CitizenInfoLabel, FormStep, LabelFieldPair, TextInput,CardLabelError } from "@egovernments/digit-ui-react-components";
+import React, { useState } from "react";
+var validation ={};
+const PTVasikaDetails = ({ t, config, onSelect, value, userType, formData }) => {
+
+
+ const [
+ val, setValue
+ ] = useState(formData?.[config.key]?.vasikaNo||"");
+ const [
+ other, setOther
+ ] = useState(formData?.[config.key]?.vasikaArea||"");
+ const goNext = () => {
+ onSelect(config.key, {vasikaNo:val,vasikaArea:other});
+ };
+
+
+ if (userType === "employee") {
+ return (
+
+
+ {t("PT_VASIKA_NO_LABEL") }
+
+ setValue(e?.target?.value)}
+ // autoFocus={presentInModifyApplication}
+ />
+
+
+
+
+ );
+ }
+ return (
+
+
+
+
+ {`${t("PT_VASIKA_NO_LABEL")}`}
+ setValue(e?.target?.value)}
+
+ />
+
+ {`${t("PT_VASIKA_AREA_LABEL")}`}
+ setOther(e?.target?.value)}
+ />
+
+ { }
+
+ );
+};
+
+export default PTVasikaDetails;
diff --git a/micro-ui/web/src/Customisations/pt/pageComponents/PropertyUsageType.js b/micro-ui/web/src/Customisations/pt/pageComponents/PropertyUsageType.js
new file mode 100644
index 00000000..deade4fc
--- /dev/null
+++ b/micro-ui/web/src/Customisations/pt/pageComponents/PropertyUsageType.js
@@ -0,0 +1,134 @@
+import {
+ CardLabel, CardLabelError, CitizenInfoLabel, Dropdown, FormStep, LabelFieldPair, RadioButtons
+} from "@egovernments/digit-ui-react-components";
+import React, { useEffect, useState } from "react";
+import { useLocation } from "react-router-dom";
+
+var Digit = window.Digit || {};
+
+const PropertyUsageType = ({ t, config, onSelect, userType, formData, formState, setError, clearErrors, onBlur }) => {
+ const [usageCategoryMajor, setPropertyPurpose] = useState(
+ formData?.usageCategoryMajor && formData?.usageCategoryMajor?.code === "NONRESIDENTIAL.OTHERS"
+ ? { code: `${formData?.usageCategoryMajor?.code}`, i18nKey: `PROPERTYTAX_BILLING_SLAB_OTHERS` }
+ : formData?.usageCategoryMajor
+ );
+
+ const tenantId = Digit.ULBService.getCurrentTenantId();
+ const stateId = tenantId.split(".")[0];
+ const { data: Menu = { }, isLoading: menuLoading } = Digit.Hooks.pt.usePropertyMDMS(stateId, "PropertyTax", "UsageCategory") || { };
+ let usagecat = [];
+ usagecat = Menu?.PropertyTax?.UsageCategory || [];
+ let i;
+ let menu = [];
+
+ const { pathname } = useLocation();
+ const presentInModifyApplication = pathname.includes("modify");
+
+ function usageCategoryMajorMenu(usagecat) {
+ if (userType === "employee") {
+ const catMenu = usagecat
+ ?.filter((e) => e?.code.split(".").length <= 2 && e.code !== "NONRESIDENTIAL")
+ ?.map((item) => {
+ const arr = item?.code.split(".");
+ if (arr.length == 2) return { i18nKey: "PROPERTYTAX_BILLING_SLAB_" + arr[1], code: item?.code };
+ else return { i18nKey: "PROPERTYTAX_BILLING_SLAB_" + item?.code, code: item?.code };
+ });
+ return catMenu;
+ } else {
+ for (i = 0; i < 10; i++) {
+ if (
+ Array.isArray(usagecat) &&
+ usagecat.length > 0 &&
+ usagecat[i].code.split(".")[0] == "NONRESIDENTIAL" &&
+ usagecat[i].code.split(".").length == 2
+ ) {
+ menu.push({ i18nKey: "PROPERTYTAX_BILLING_SLAB_" + usagecat[i].code.split(".")[1], code: usagecat[i].code });
+ }
+ }
+ return menu;
+ }
+ }
+
+ useEffect(() => {
+ if (!menuLoading && presentInModifyApplication && userType === "employee") {
+ const original = formData?.originalData?.usageCategory;
+ const selectedOption = usageCategoryMajorMenu(usagecat).filter((e) => e.code === original)[0];
+ setPropertyPurpose(selectedOption);
+ }
+ }, [menuLoading]);
+
+ const onSkip = () => onSelect();
+
+
+ function selectPropertyPurpose(value) {
+ setPropertyPurpose(value);
+ }
+
+ function goNext() {
+ if (usageCategoryMajor?.i18nKey === "PROPERTYTAX_BILLING_SLAB_OTHERS") {
+ usageCategoryMajor.i18nKey = "PROPERTYTAX_BILLING_SLAB_NONRESIDENTIAL";
+ onSelect(config.key, usageCategoryMajor);
+ } else {
+ onSelect(config.key, usageCategoryMajor);
+ }
+ }
+
+ useEffect(() => {
+ if (userType === "employee") {
+ if (!usageCategoryMajor) {
+ setError(config.key, { type: "required", message: t(`CORE_COMMON_REQUIRED_ERRMSG`) });
+ } else {
+ clearErrors(config.key);
+ }
+ goNext();
+ }
+ }, [usageCategoryMajor]);
+
+ if (userType === "employee") {
+ return (
+
+
+ {t("PT_ASSESMENT_INFO_USAGE_TYPE") + " *"}
+ {
+ selectPropertyPurpose(e);
+ }}
+ optionKey="i18nKey"
+ onBlur={onBlur}
+ t={t}
+ />
+
+ {formState.touched[config.key] ? (
+
+ {formState.errors?.[config.key]?.message}
+
+ ) : null}
+
+ );
+ }
+
+ return (
+
+
+
+
+
+
+ { }
+
+ );
+};
+
+export default PropertyUsageType;
diff --git a/micro-ui/web/src/Customisations/tl/TLCustomisation.js b/micro-ui/web/src/Customisations/tl/TLCustomisation.js
new file mode 100644
index 00000000..642acc52
--- /dev/null
+++ b/micro-ui/web/src/Customisations/tl/TLCustomisation.js
@@ -0,0 +1,5 @@
+export const TLCustomisations = {
+ customiseCreateFormData: (formData, licenceObject) => licenceObject,
+ customiseRenewalCreateFormData: (formData, licenceObject) => licenceObject,
+ customiseSendbackFormData: (formData, licenceObject) => licenceObject
+}
\ No newline at end of file
diff --git a/micro-ui/web/src/Customisations/tl/index.js b/micro-ui/web/src/Customisations/tl/index.js
new file mode 100644
index 00000000..fe2ae4f4
--- /dev/null
+++ b/micro-ui/web/src/Customisations/tl/index.js
@@ -0,0 +1,7 @@
+import TLUsageType from "./pageComponents/PropertyUsageType";
+
+
+
+export const tlComponents = {
+ TLPropertyUsageType: TLUsageType,
+};
diff --git a/micro-ui/web/src/Customisations/tl/pageComponents/PropertyUsageType.js b/micro-ui/web/src/Customisations/tl/pageComponents/PropertyUsageType.js
new file mode 100644
index 00000000..5520a66f
--- /dev/null
+++ b/micro-ui/web/src/Customisations/tl/pageComponents/PropertyUsageType.js
@@ -0,0 +1,136 @@
+import {
+ CardLabel, CardLabelError, CitizenInfoLabel, Dropdown, FormStep, LabelFieldPair, RadioButtons
+} from "@egovernments/digit-ui-react-components";
+import React, { useEffect, useState } from "react";
+import { useLocation } from "react-router-dom";
+
+var Digit = window.Digit || {};
+
+const TLUsageType = ({ t, config, onSelect, userType, formData, formState, setError, clearErrors, onBlur }) => {
+ const [usageCategoryMajor, setPropertyPurpose] = useState(
+ formData?.usageCategoryMajor && formData?.usageCategoryMajor?.code === "NONRESIDENTIAL.OTHERS"
+ ? { code: `${formData?.usageCategoryMajor?.code}`, i18nKey: `PROPERTYTAX_BILLING_SLAB_OTHERS` }
+ : formData?.usageCategoryMajor
+ );
+
+ const tenantId = Digit.ULBService.getCurrentTenantId();
+ const stateId = tenantId.split(".")[0];
+ const { data: Menu = { }, isLoading: menuLoading } = Digit.Hooks.pt.usePropertyMDMS(stateId, "PropertyTax", "UsageCategory") || { };
+ let usagecat = [];
+ usagecat = Menu?.PropertyTax?.UsageCategory || [];
+ let i;
+ let menu = [];
+
+ const { pathname } = useLocation();
+ const presentInModifyApplication = pathname.includes("modify");
+
+ function usageCategoryMajorMenu(usagecat) {
+ if (userType === "employee") {
+ const catMenu = usagecat
+ ?.filter((e) => e?.code.split(".").length <= 2 && e.code !== "NONRESIDENTIAL")
+ ?.map((item) => {
+ const arr = item?.code.split(".");
+ if (arr.length == 2) return { i18nKey: "PROPERTYTAX_BILLING_SLAB_" + arr[1], code: item?.code };
+ else return { i18nKey: "PROPERTYTAX_BILLING_SLAB_" + item?.code, code: item?.code };
+ });
+ return catMenu;
+ } else {
+ for (i = 0; i < 10; i++) {
+ if (
+ Array.isArray(usagecat) &&
+ usagecat.length > 0 &&
+ usagecat[i].code.split(".")[0] == "NONRESIDENTIAL" &&
+ usagecat[i].code.split(".").length == 2
+ ) {
+ menu.push({ i18nKey: "PROPERTYTAX_BILLING_SLAB_" + usagecat[i].code.split(".")[1], code: usagecat[i].code });
+ }
+ }
+ return menu;
+ }
+ }
+
+ useEffect(() => {
+ if (!menuLoading && presentInModifyApplication && userType === "employee") {
+ const original = formData?.originalData?.usageCategory;
+ const selectedOption = usageCategoryMajorMenu(usagecat).filter((e) => e.code === original)[0];
+ setPropertyPurpose(selectedOption);
+ }
+ }, [menuLoading]);
+
+ const onSkip = () => onSelect();
+
+
+ function selectPropertyPurpose(value) {
+ setPropertyPurpose(value);
+ }
+
+ function goNext() {
+ if (usageCategoryMajor?.i18nKey === "PROPERTYTAX_BILLING_SLAB_OTHERS") {
+ usageCategoryMajor.i18nKey = "PROPERTYTAX_BILLING_SLAB_NONRESIDENTIAL";
+ onSelect(config.key, usageCategoryMajor);
+ } else {
+ onSelect(config.key, usageCategoryMajor);
+ }
+ }
+
+ useEffect(() => {
+ if (userType === "employee") {
+ if (!usageCategoryMajor) {
+ setError(config.key, { type: "required", message: t(`CORE_COMMON_REQUIRED_ERRMSG`) });
+ } else {
+ clearErrors(config.key);
+ }
+ goNext();
+ }
+ }, [usageCategoryMajor]);
+
+ if (userType === "employee") {
+ return (
+
+
+ {t("PT_ASSESMENT_INFO_USAGE_TYPE") + " *"}
+ {
+ selectPropertyPurpose(e);
+ }}
+ optionKey="i18nKey"
+ onBlur={onBlur}
+ t={t}
+ />
+
+ {formState.touched[config.key] ? (
+
+ {formState.errors?.[config.key]?.message}
+
+ ) : null}
+
+ );
+ }
+
+ return (
+
+
+
+
+
+ to say this is different element
+
+
+ { }
+
+ );
+};
+
+export default TLUsageType;
diff --git a/micro-ui/web/src/index.css b/micro-ui/web/src/index.css
new file mode 100644
index 00000000..e69de29b
diff --git a/micro-ui/web/src/index.js b/micro-ui/web/src/index.js
new file mode 100644
index 00000000..9f20bf1b
--- /dev/null
+++ b/micro-ui/web/src/index.js
@@ -0,0 +1,62 @@
+import React from 'react';
+import ReactDOM from 'react-dom';
+import { initLibraries } from "@egovernments/digit-ui-libraries";
+import "./index.css";
+import App from './App';
+import { TLCustomisations } from './Customisations/tl/TLCustomisation';
+
+
+initLibraries();
+
+
+window.Digit.Customizations = { PGR: {} ,TL:TLCustomisations};
+
+const user = window.Digit.SessionStorage.get("User");
+
+if (!user || !user.access_token || !user.info) {
+ // login detection
+
+ const parseValue = (value) => {
+ try {
+ return JSON.parse(value)
+ } catch (e) {
+ return value
+ }
+ }
+
+ const getFromStorage = (key) => {
+ const value = window.localStorage.getItem(key);
+ return value && value !== "undefined" ? parseValue(value) : null;
+ }
+
+ const token = getFromStorage("token")
+
+ const citizenToken = getFromStorage("Citizen.token")
+ const citizenInfo = getFromStorage("Citizen.user-info")
+ const citizenTenantId = getFromStorage("Citizen.tenant-id")
+
+ const employeeToken = getFromStorage("Employee.token")
+ const employeeInfo = getFromStorage("Employee.user-info")
+ const employeeTenantId = getFromStorage("Employee.tenant-id")
+ const userType = token === citizenToken ? "citizen" : "employee";
+
+ window.Digit.SessionStorage.set("user_type", userType);
+ window.Digit.SessionStorage.set("userType", userType);
+
+ const getUserDetails = (access_token, info) => ({ token: access_token, access_token, info })
+
+ const userDetails = userType === "citizen" ? getUserDetails(citizenToken, citizenInfo) : getUserDetails(employeeToken, employeeInfo)
+
+ window.Digit.SessionStorage.set("User", userDetails);
+ window.Digit.SessionStorage.set("Citizen.tenantId", citizenTenantId);
+ window.Digit.SessionStorage.set("Employee.tenantId", employeeTenantId);
+ // end
+}
+
+ReactDOM.render(
+
+
+ ,
+ document.getElementById('root')
+);
+
diff --git a/micro-ui/web/src/setupProxy.js b/micro-ui/web/src/setupProxy.js
new file mode 100644
index 00000000..1b8eda94
--- /dev/null
+++ b/micro-ui/web/src/setupProxy.js
@@ -0,0 +1,30 @@
+const { createProxyMiddleware } = require("http-proxy-middleware");
+const createProxy = createProxyMiddleware({
+ target: process.env.REACT_APP_PROXY_URL,
+ changeOrigin: true,
+});
+module.exports = function (app) {
+ [
+ "/egov-mdms-service",
+ "/egov-location",
+ "/localization",
+ "/egov-workflow-v2",
+ "/pgr-services",
+ "/filestore",
+ "/egov-hrms",
+ "/user-otp",
+ "/user",
+ "/fsm",
+ "/billing-service",
+ "/collection-services",
+ "/pdf-service",
+ "/pg-service",
+ "/vehicle",
+ "/vendor",
+ "/property-services",
+ "/fsm-calculator/v1/billingSlab/_search",
+ "/muster-roll"
+ ].forEach((location) =>
+ app.use(location, createProxy)
+ );
+};
diff --git a/micro-ui/web/webpack.config.js b/micro-ui/web/webpack.config.js
new file mode 100644
index 00000000..5f3dc469
--- /dev/null
+++ b/micro-ui/web/webpack.config.js
@@ -0,0 +1,43 @@
+const path = require("path");
+const HtmlWebpackPlugin = require("html-webpack-plugin");
+const { CleanWebpackPlugin } = require("clean-webpack-plugin");
+// const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
+
+module.exports = {
+ // mode: 'development',
+ entry: "./src/index.js",
+ devtool: "none",
+ module: {
+ rules: [
+ {
+ test: /\.(js)$/,
+ use: ["babel-loader"],
+ },
+ {
+ test: /\.css$/i,
+ use: ["style-loader", "css-loader"],
+ }
+ ],
+ },
+ output: {
+ filename: "[name].bundle.js",
+ path: path.resolve(__dirname, "build"),
+ publicPath: "/digit-ui/",
+ },
+ optimization: {
+ splitChunks: {
+ chunks: 'all',
+ minSize:20000,
+ maxSize:50000,
+ enforceSizeThreshold:50000,
+ minChunks:1,
+ maxAsyncRequests:30,
+ maxInitialRequests:30
+ },
+ },
+ plugins: [
+ new CleanWebpackPlugin(),
+ // new BundleAnalyzerPlugin(),
+ new HtmlWebpackPlugin({ inject: true, template: "public/index.html" }),
+ ],
+};
\ No newline at end of file