diff --git a/Features to port to new Armory:.yml b/Features to port to new Armory:.yml deleted file mode 100644 index 5b7d8dc..0000000 --- a/Features to port to new Armory:.yml +++ /dev/null @@ -1,23 +0,0 @@ -Features to port to new Armory: - -- PWA -- Dashboard -- Compare Tool -- Server with sockets (another repository) -- Live preview of page being created -- Project, Page, Component -- React table -- Drag n drop with preview of component being dragged -- Rich Tooltips -- Logger view showing user activity -- Live code being generated for dropped component -- Component properties viewer -- Undo/redo functionality -- Login/signup page -- Landing page with login/signup prompt - -New: - -- Chat/conversations -- Notifications -- Modal \ No newline at end of file diff --git a/License only features.txt b/License only features.txt deleted file mode 100644 index 45fa828..0000000 --- a/License only features.txt +++ /dev/null @@ -1,4 +0,0 @@ -License only feaures: - -- Document versions -- Infinite number of API calls diff --git a/ProgressiveBarChartD3.tsx b/ProgressiveBarChartD3.tsx deleted file mode 100644 index 4d8dcd4..0000000 --- a/ProgressiveBarChartD3.tsx +++ /dev/null @@ -1,100 +0,0 @@ -import React, { useRef, useEffect, useState } from "react" -import * as d3 from "d3" -import { GDP_DATA as data } from "./__mocks__/gdpData" - -interface GDPData { - [year: string]: Array<[string, number]> -} - -interface BarChartProps { - data: GDPData - currentYear: string - width: number - height: number -} - -const width = 1400 -const height = 400 -const BarChart: React.FC = () => { - const ref = useRef(null) - const [currentView, setCurrentView] = useState(0) - - useEffect(() => { - if (!data[Object.keys(data)[currentView]]) return - - const svg = d3.select(ref.current) - const margin = { top: 20, right: 20, bottom: 30, left: 40 } - const x = d3 - .scaleBand() - .rangeRound([0, width - margin.left - margin.right]) - .padding(0.1) - const y = d3 - .scaleLinear() - .rangeRound([height - margin.top - margin.bottom, 0]) - - const currentData = data[Object.keys(data)[currentView]].map( - ([country, gdp]) => ({ - country, - gdp, - }), - ) - - x.domain(currentData?.map((d) => d.country) as Array) - y.domain([0, d3.max(currentData, (d) => d.gdp) || 0]) - - const g = svg - .append("g") - .attr("transform", `translate(${margin.left},${margin.top})`) - - g.append("g") - .attr("class", "axis axis--x") - .attr("transform", `translate(0,${height - margin.top - margin.bottom})`) - .call(d3.axisBottom(x)) - - g.append("g") - .attr("class", "axis axis--y") - .call(d3.axisLeft(y).ticks(10, "%")) - - g.selectAll(".bar") - .data(currentData) - .enter() - .append("rect") - .attr("class", "bar") - .attr("x", (d) => x(d.country as string) || 0) - .attr("y", (d) => y(d.gdp)) - .attr("width", x.bandwidth()) - .attr( - "height", - (d) => height - margin.top - margin.bottom - (y(d.gdp) || 0), - ) - - return () => { - svg.selectAll("*").remove() - } - }, [data, currentView, width, height]) - - useEffect(() => { - let interval: NodeJS.Timeout - const dataLength = Object.keys(data).length - interval = setInterval(() => { - setCurrentView((prevView) => { - const nextView = (prevView + 1) % dataLength - if (nextView < dataLength) { - return nextView - } else { - clearInterval(interval) - return prevView - } - }) - }, 1000) - return () => clearInterval(interval) - }, [data]) - - return ( -
- -
- ) -} - -export default BarChart diff --git a/README.md b/README.md index c0eba4a..4f15e4c 100644 --- a/README.md +++ b/README.md @@ -10,11 +10,9 @@ ### Published at npm and publicly available -### PLACEHOLDER PACKAGE, IN DEV +### !! [PLACEHOLDER PACKAGE][BETA] !! ### Version with implementations: 1.0.0 -###### IN BETA - -[npm-url]: https://www.npmjs.com/package/@armco/armory-react-components -[github-license-url]: https://github.com/ReStruct-Corporate-Advantage/armory-react-components/blob/main/LICENSE +[npm-url]: https://www.npmjs.com/package/@armco/components +[github-license-url]: https://github.com/ReStruct-Corporate-Advantage/components/blob/main/LICENSE diff --git a/Renderer workflow.txt b/Renderer workflow.txt deleted file mode 100644 index d5ee3b2..0000000 --- a/Renderer workflow.txt +++ /dev/null @@ -1,40 +0,0 @@ -Renderer workflow - -- Drag n drop components/Click add on slot and add component -- Generate config for the component - - props - - slot -- Process the config -> Parent -> props and handlers -> children - - - -Guidelines - -- Try to keep the config as flat as possible with hierarchy information -- Try minimizing entier tree render, only render what's changed -- Entire tree renders when main configuration changes -- This is majorly with form components, buttons that either need to save and update state or perform actions like API calls, or modify layout like show modals hide show drawer etc. -- To manage this rely on redux selectors as much as possible so that state change is delegated to lowest possible levels -- For eg. When a button to expand drawer is clicked and the drawer contains a form, entire form should not re-render -- Config should be decentralized with multiple middle level controllers to isolate state changes between these middle level items. Examples include: - - Any form - - Drawer - - Header - - Footer - - Main - - Card - - Widget -- At form level too, cross element communication should prevent changes at parent form level, communicate via redux -- Redux design becomes important here wherein it should be as flat as possible and might end up containing large number of fields - one for each field with qualifiers -- Create dynamic reducers and selectors for low level form fields - - - -Features needed in renderer - -- Visualize - Just display content of components (good enough for a static website) -- Perform actions: - - Show Modal - - Fetch Data - - Subscribe to data - - Publish (dispatch) actions9 \ No newline at end of file diff --git a/Untitled-3.md b/Untitled-3.md deleted file mode 100644 index 7c4072f..0000000 --- a/Untitled-3.md +++ /dev/null @@ -1,3 +0,0 @@ -Features/Landing Page CTA - -Share a live URL with your team and users \ No newline at end of file diff --git a/Website builder.yml b/Website builder.yml deleted file mode 100644 index 0817d0a..0000000 --- a/Website builder.yml +++ /dev/null @@ -1,8 +0,0 @@ -Website builder - -- Form - Name, category, optional description, target audience -- Select page layout - - Header, drawer, main, footer - - Multi row - - Custom - specify rows and columns hierarchy - - Grid layout - specify height and width of grids (to be studied) \ No newline at end of file diff --git a/index.html b/index.html deleted file mode 100644 index 1a73c80..0000000 --- a/index.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - Armory React Repository - - - -
- - - diff --git a/package.json b/package.json index 48cec0d..51e8cc9 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "@armco/armory-react-components", + "name": "@armco/components", "description": "React Component Library for Armco's stack of products and services", "version": "0.0.47", "type": "module", @@ -11,23 +11,17 @@ "build:publish": "./scripts/build.sh", "build:publish:compile": "tsc --p ./tsconfig-build.json && vite build --config vite-publish.config.ts", "generate": "plop", - "atom": "plop atom", - "molecule": "plop molecule", "component": "plop component", - "page": "plop page", - "preview": "vite preview", "test": "NODE_ENV=development vitest", "format": "prettier --write .", "lint": "eslint .", "type-check": "tsc", "publish:dry": "npm publish --dry-run", "publish:local": "./scripts/publish-local.sh", - "publish:public": "./scripts/publish.sh", - "storybook": "storybook dev -p 6006", - "build-storybook": "storybook build" + "publish:public": "./scripts/publish.sh" }, "dependencies": { - "@armco/analytics": "^0.2.8", + "@armco/utils": "^0.0.0", "@lottiefiles/react-lottie-player": "^3.5.3", "@popperjs/core": "^2.11.8", "@reduxjs/toolkit": "^1.8.1", diff --git a/src/app/ErrorBoundary.tsx b/src/app/ErrorBoundary.tsx deleted file mode 100644 index bece97e..0000000 --- a/src/app/ErrorBoundary.tsx +++ /dev/null @@ -1,33 +0,0 @@ -import { Component, ErrorInfo, ReactNode } from "react" - -interface Props { - children?: ReactNode -} - -interface State { - hasError: boolean -} - -class ErrorBoundary extends Component { - public state: State = { - hasError: false, - } - - public static getDerivedStateFromError(_: Error): State { - return { hasError: true } - } - - public componentDidCatch(error: Error, errorInfo: ErrorInfo) { - console.error("Uncaught error:", error, errorInfo) - } - - public render() { - if (this.state.hasError) { - return

Sorry.. there was an error

- } - - return this.props.children - } -} - -export default ErrorBoundary diff --git a/src/app/Router.tsx b/src/app/Router.tsx deleted file mode 100644 index e417e5a..0000000 --- a/src/app/Router.tsx +++ /dev/null @@ -1,81 +0,0 @@ -import { Suspense, useEffect } from "react" -import { useRoutes } from "react-router-dom" -import { v4 as uuid } from "uuid" -import { AlertProps, ArAlertType, ArThemes } from "@armco/types" -import Header from "./components/Header" -import { useAppDispatch, useAppSelector } from "./hooks" -import { - notification, - notify, - setLoggedIn, - setRightPanelContent, - setUser, -} from "./store" -import { Alert } from "./components" -import Helper from "./utils/helper" -import { Network } from "./utils" -import ROUTES from "./routes" -import { ENDPOINTS } from "./config/constants" -import API_CONFIG from "./config/api-config" - -Helper.populatePagesInRoutes(ROUTES) - -interface RouterProps {} - -const Router = (props: RouterProps) => { - const alertInfo = useAppSelector(notification) - const dispatch = useAppDispatch() - - useEffect(() => { - document - .getElementsByTagName("html")[0] - .setAttribute("ar-theme", ArThemes.DARK1) - Network.get( - API_CONFIG.IAM[process.env.NODE_ENV] + - ENDPOINTS.USERS.ROOT + - ENDPOINTS.USERS.CHECK, - ) - .then((response) => { - if (response && response.status === 200) { - dispatch(setLoggedIn(true)) - if (response.body) { - dispatch(setUser(response.body)) - } - } else { - dispatch(setLoggedIn(false)) - } - }) - .catch((error) => { - if (error.status === 403) { - dispatch(setLoggedIn(false)) - } - }) - window.onmessage = (e) => { - if (e.data && e.data.event === "LOGGED_IN") { - dispatch(setLoggedIn(true)) - dispatch( - notify({ - show: true, - message: "Logged in successfully!", - type: ArAlertType.SUCCESS, - uid: uuid(), - }), - ) - dispatch(setRightPanelContent({ name: "" })) - dispatch(setUser(e.data.data.body.user)) - } - } - }, []) - - const matchedRouteElement = useRoutes(ROUTES) - - return ( - Loading...}> -
- {matchedRouteElement} - {alertInfo && } - - ) -} - -export default Router diff --git a/src/app/components/AssetSelector/AssetSelector.component.scss b/src/app/components/AssetSelector/AssetSelector.component.scss deleted file mode 100755 index 3f3a1df..0000000 --- a/src/app/components/AssetSelector/AssetSelector.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -.ar-AssetSelector { - -} diff --git a/src/app/components/AssetSelector/AssetSelector.test.ts b/src/app/components/AssetSelector/AssetSelector.test.ts deleted file mode 100755 index 3d864f4..0000000 --- a/src/app/components/AssetSelector/AssetSelector.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import AssetSelector from "./AssetSelector" - -describe("AssetSelector", () => { - it("renders without error", () => { - - }) -}) diff --git a/src/app/components/AssetSelector/AssetSelector.tsx b/src/app/components/AssetSelector/AssetSelector.tsx deleted file mode 100755 index 3c0f3e4..0000000 --- a/src/app/components/AssetSelector/AssetSelector.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import { AssetSelectorProps, ArIconTileTypes } from "@armco/types" -import { ArIconsViewer } from ".." -import "./AssetSelector.component.scss" - -const AssetSelector = (props: AssetSelectorProps): JSX.Element => { - const { classes } = props - return ( -
- -
- ) -} - -export default AssetSelector diff --git a/src/app/components/AssetSelector/index.ts b/src/app/components/AssetSelector/index.ts deleted file mode 100755 index 5e994b7..0000000 --- a/src/app/components/AssetSelector/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import AssetSelector from "./AssetSelector" - -export default AssetSelector diff --git a/src/app/components/ComponentList/ComponentList.component.scss b/src/app/components/ComponentList/ComponentList.component.scss deleted file mode 100755 index e2d6434..0000000 --- a/src/app/components/ComponentList/ComponentList.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -.ar-ComponentList { - -} diff --git a/src/app/components/ComponentList/ComponentList.test.ts b/src/app/components/ComponentList/ComponentList.test.ts deleted file mode 100755 index 3c9ba4a..0000000 --- a/src/app/components/ComponentList/ComponentList.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import ComponentList from "./ComponentList" - -describe("ComponentList", () => { - it("renders without error", () => { - - }) -}) diff --git a/src/app/components/ComponentList/ComponentList.tsx b/src/app/components/ComponentList/ComponentList.tsx deleted file mode 100755 index 1bbca23..0000000 --- a/src/app/components/ComponentList/ComponentList.tsx +++ /dev/null @@ -1,60 +0,0 @@ -import { useNavigate } from "react-router-dom" -import { ArThemes, ComponentRepository, TreeListData } from "@armco/types" -import { - Adapter, - COMPONENTS, - ErrorBoundary, - getCurrentTheme, - Network, - TreeList, - useAppSelector, -} from ".." -import * as atoms from "../atoms" -import * as molecules from "../molecules" -import "./ComponentList.component.scss" - -const Components: ComponentRepository = { ...atoms, ...molecules } - -interface ComponentListProps {} - -const formattedTreeData = Adapter.adaptToTreeFromComponentConfig(COMPONENTS) - -const ComponentList = (props: ComponentListProps): JSX.Element => { - const navigate = useNavigate() - const theme = useAppSelector(getCurrentTheme) - - const handleComponentSelect = (treeNode: TreeListData) => { - const params = treeNode.data?.props - treeNode.data?.component && - navigate( - Network.stringifyUrl(`/components/${treeNode.data?.component}`, params), - ) - } - - return ( -
- { - const Component = - typeof item.label === "string" && Components[item.label] - return Component ? ( - - - - ) : ( - item.label - ) - }} - isDraggable - showTooltip - /> -
- ) -} - -export default ComponentList diff --git a/src/app/components/ComponentList/index.ts b/src/app/components/ComponentList/index.ts deleted file mode 100755 index db020d2..0000000 --- a/src/app/components/ComponentList/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import ComponentList from "./ComponentList" - -export default ComponentList diff --git a/src/app/components/ConfigRowItem/ConfigRowItem.component.scss b/src/app/components/ConfigRowItem/ConfigRowItem.component.scss deleted file mode 100755 index e44dd7e..0000000 --- a/src/app/components/ConfigRowItem/ConfigRowItem.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -.ar-ConfigRowItem { - -} diff --git a/src/app/components/ConfigRowItem/ConfigRowItem.test.ts b/src/app/components/ConfigRowItem/ConfigRowItem.test.ts deleted file mode 100755 index 7a68779..0000000 --- a/src/app/components/ConfigRowItem/ConfigRowItem.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import ConfigRowItem from "./ConfigRowItem" - -describe("ConfigRowItem", () => { - it("renders without error", () => { - - }) -}) diff --git a/src/app/components/ConfigRowItem/ConfigRowItem.tsx b/src/app/components/ConfigRowItem/ConfigRowItem.tsx deleted file mode 100755 index 166a3b5..0000000 --- a/src/app/components/ConfigRowItem/ConfigRowItem.tsx +++ /dev/null @@ -1,97 +0,0 @@ -import { ChangeEvent, useState } from "react" -import { ArButtonVariants, ConfigRowItemProps } from "@armco/types" -import { Button, LoadableIcon, TextInput } from ".." -import "./ConfigRowItem.component.scss" - -const ConfigRowItem = (props: ConfigRowItemProps): JSX.Element => { - const { config, disabled, isNew, onAdd, onUpdate, onDelete } = props - const [key, setKey] = useState(config?.key || "") - const [value, setValue] = useState(config?.value || "") - const [edited, setEdited] = useState() - - const configIsSubmittable = (isNew || edited) && key && value - return ( -
-
- ) => - setKey(e.target.value) - } - placeholder="Config key" - /> -
-
- ) => - setValue(e.target.value) - } - value={value} - /> -
- {isNew ? ( -
-
- ) : ( -
- - { - config?._id && - configIsSubmittable && - onUpdate && - onUpdate(config?._id, key, value) - setKey("") - setValue("") - }} - hoverShadow - /> - - - (edited ? setEdited(false) : setEdited(true))} - /> - - - onAdd && onAdd(key, value)} - /> - - - onDelete && onDelete(config?._id)} - /> - -
- )} -
- ) -} - -export default ConfigRowItem diff --git a/src/app/components/ConfigRowItem/index.ts b/src/app/components/ConfigRowItem/index.ts deleted file mode 100755 index 65b15c7..0000000 --- a/src/app/components/ConfigRowItem/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import ConfigRowItem from "./ConfigRowItem" - -export default ConfigRowItem diff --git a/src/app/components/ConfigurationList/ConfigurationList.component.scss b/src/app/components/ConfigurationList/ConfigurationList.component.scss deleted file mode 100755 index 29d14c2..0000000 --- a/src/app/components/ConfigurationList/ConfigurationList.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -.ar-ConfigurationList { - -} diff --git a/src/app/components/ConfigurationList/ConfigurationList.test.ts b/src/app/components/ConfigurationList/ConfigurationList.test.ts deleted file mode 100755 index b93cfd8..0000000 --- a/src/app/components/ConfigurationList/ConfigurationList.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import ConfigurationList from "./ConfigurationList" - -describe("ConfigurationList", () => { - it("renders without error", () => { - - }) -}) diff --git a/src/app/components/ConfigurationList/ConfigurationList.tsx b/src/app/components/ConfigurationList/ConfigurationList.tsx deleted file mode 100755 index a66696c..0000000 --- a/src/app/components/ConfigurationList/ConfigurationList.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import { useNavigate } from "react-router-dom" -import { ConfigurationListProps, TreeListData } from "@armco/types" -import { Network, TreeList } from ".." -import "./ConfigurationList.component.scss" - -const ConfigurationList = (props: ConfigurationListProps): JSX.Element => { - const { list } = props - const navigate = useNavigate() - const handleComponentSelect = (treeNode: TreeListData) => { - const params = treeNode.data?.props - treeNode.data?.component && - navigate( - Network.stringifyUrl(`/components/${treeNode.data?.component}`, params), - ) - } - return ( -
- -
- ) -} - -export default ConfigurationList diff --git a/src/app/components/ConfigurationList/index.ts b/src/app/components/ConfigurationList/index.ts deleted file mode 100755 index 916bcb0..0000000 --- a/src/app/components/ConfigurationList/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import ConfigurationList from "./ConfigurationList" - -export default ConfigurationList diff --git a/src/app/components/ConfigurationLoginPrompt/ConfigurationLoginPrompt.component.scss b/src/app/components/ConfigurationLoginPrompt/ConfigurationLoginPrompt.component.scss deleted file mode 100755 index 9433e39..0000000 --- a/src/app/components/ConfigurationLoginPrompt/ConfigurationLoginPrompt.component.scss +++ /dev/null @@ -1,10 +0,0 @@ -.ar-ConfigurationLoginPrompt { - width: 50vw; - background-color: var(--ar-bg); - border-radius: 0.25rem; - - small { - color: var(--ar-color-secondary); - line-height: 1rem; - } -} diff --git a/src/app/components/ConfigurationLoginPrompt/ConfigurationLoginPrompt.test.ts b/src/app/components/ConfigurationLoginPrompt/ConfigurationLoginPrompt.test.ts deleted file mode 100755 index 8c7db1a..0000000 --- a/src/app/components/ConfigurationLoginPrompt/ConfigurationLoginPrompt.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import ConfigurationLoginPrompt from "./ConfigurationLoginPrompt" - -describe("ConfigurationLoginPrompt", () => { - it("renders without error", () => { - - }) -}) diff --git a/src/app/components/ConfigurationLoginPrompt/ConfigurationLoginPrompt.tsx b/src/app/components/ConfigurationLoginPrompt/ConfigurationLoginPrompt.tsx deleted file mode 100755 index 0ea25de..0000000 --- a/src/app/components/ConfigurationLoginPrompt/ConfigurationLoginPrompt.tsx +++ /dev/null @@ -1,48 +0,0 @@ -import { ArButtonVariants, ConfigurationLoginPromptProps } from "@armco/types" -import { Button, LoadableIcon, setRightPanelContent, useAppDispatch } from ".." -import "./ConfigurationLoginPrompt.component.scss" - -const ConfigurationLoginPrompt = ( - props: ConfigurationLoginPromptProps, -): JSX.Element => { - const dispatch = useAppDispatch() - return ( -
-
-
- - Please login to continue -
- - This is the configurations feature where you can create and save - configurations as key-value pairs. - - - These key-value pairs can then be accessed using an endpoint inside - your application. - - - - In order to be able to save and secure these configurations, you - need to create an account, if one doesn't exist already and login - using the same. Please use the button below to continue. - - -
-
- ) -} - -export default ConfigurationLoginPrompt diff --git a/src/app/components/ConfigurationLoginPrompt/index.ts b/src/app/components/ConfigurationLoginPrompt/index.ts deleted file mode 100755 index 284ee9e..0000000 --- a/src/app/components/ConfigurationLoginPrompt/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import ConfigurationLoginPrompt from "./ConfigurationLoginPrompt" - -export default ConfigurationLoginPrompt diff --git a/src/app/components/ConfigurationNoConfigPrompt/ConfigurationNoConfigPrompt.component.scss b/src/app/components/ConfigurationNoConfigPrompt/ConfigurationNoConfigPrompt.component.scss deleted file mode 100755 index 8182efa..0000000 --- a/src/app/components/ConfigurationNoConfigPrompt/ConfigurationNoConfigPrompt.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -.ar-ConfigurationNoConfigPrompt { - -} diff --git a/src/app/components/ConfigurationNoConfigPrompt/ConfigurationNoConfigPrompt.test.ts b/src/app/components/ConfigurationNoConfigPrompt/ConfigurationNoConfigPrompt.test.ts deleted file mode 100755 index 00819a1..0000000 --- a/src/app/components/ConfigurationNoConfigPrompt/ConfigurationNoConfigPrompt.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import ConfigurationNoConfigPrompt from "./ConfigurationNoConfigPrompt" - -describe("ConfigurationNoConfigPrompt", () => { - it("renders without error", () => { - - }) -}) diff --git a/src/app/components/ConfigurationNoConfigPrompt/ConfigurationNoConfigPrompt.tsx b/src/app/components/ConfigurationNoConfigPrompt/ConfigurationNoConfigPrompt.tsx deleted file mode 100755 index ba8622b..0000000 --- a/src/app/components/ConfigurationNoConfigPrompt/ConfigurationNoConfigPrompt.tsx +++ /dev/null @@ -1,102 +0,0 @@ -import { ReactNode } from "react" -import { - ArButtonVariants, - ArPopoverSlots, - ArPopoverTriggers, - ConfigurationNoConfigPromptProps, -} from "@armco/types" -import { - Button, - LoadableIcon, - NamespaceOrgForm, - Popover, - setModalState, - useAppDispatch, -} from ".." -import "./ConfigurationNoConfigPrompt.component.scss" - -const ConfigurationNoConfigPrompt = ( - props: ConfigurationNoConfigPromptProps, -): ReactNode => { - const dispatch = useAppDispatch() - - return ( -
- -

- You don't have any configurations created yet, you can start by - selecting one of the options below -

-
- -
-
- ) -} - -export default ConfigurationNoConfigPrompt diff --git a/src/app/components/ConfigurationNoConfigPrompt/index.ts b/src/app/components/ConfigurationNoConfigPrompt/index.ts deleted file mode 100755 index 0191b87..0000000 --- a/src/app/components/ConfigurationNoConfigPrompt/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import ConfigurationNoConfigPrompt from "./ConfigurationNoConfigPrompt" - -export default ConfigurationNoConfigPrompt diff --git a/src/app/components/ConfigurationViewer/ConfigurationViewer.component.scss b/src/app/components/ConfigurationViewer/ConfigurationViewer.component.scss deleted file mode 100755 index b6632cf..0000000 --- a/src/app/components/ConfigurationViewer/ConfigurationViewer.component.scss +++ /dev/null @@ -1,13 +0,0 @@ -.ar-ConfigurationViewer { - background-color: var(--ar-bg); - .ar-ConfigurationViewer__header { - background-color: var(--ar-bg-base); - border-bottom: 1px solid var(--ar-color-layout-border); - } - - input:disabled { - border: none; - background: transparent; - font-weight: bold; - } -} \ No newline at end of file diff --git a/src/app/components/ConfigurationViewer/ConfigurationViewer.test.ts b/src/app/components/ConfigurationViewer/ConfigurationViewer.test.ts deleted file mode 100755 index a580626..0000000 --- a/src/app/components/ConfigurationViewer/ConfigurationViewer.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import ConfigurationViewer from "./ConfigurationViewer" - -describe("ConfigurationViewer", () => { - it("renders without error", () => { - - }) -}) diff --git a/src/app/components/ConfigurationViewer/ConfigurationViewer.tsx b/src/app/components/ConfigurationViewer/ConfigurationViewer.tsx deleted file mode 100755 index ecb172f..0000000 --- a/src/app/components/ConfigurationViewer/ConfigurationViewer.tsx +++ /dev/null @@ -1,210 +0,0 @@ -import { v4 as uuid } from "uuid" -import { - ArAlertType, - ArButtonVariants, - ArPopoverPositions, - ArPopoverSlots, - ArSizes, - ConfigurationViewerProps, - ObjectType, -} from "@armco/types" -import { - API_CONFIG, - Breadcrumb, - Button, - ConfigRowItem, - ENDPOINTS, - InlineMenu, - LoadableIcon, - NamespaceInfoBox, - NamespaceOrgForm, - Network, - notify, - Popover, - setModalState, - useAppDispatch, -} from ".." -import "./ConfigurationViewer.component.scss" - -const ConfigurationViewer = (props: ConfigurationViewerProps): JSX.Element => { - const { namespace, fetchNamespaces } = props - const configurations = namespace?.configs - const dispatch = useAppDispatch() - - const addConfig = (key: string, value: string, _id?: string) => { - const payload: ObjectType = { - key, - value, - namespace: namespace._id, - version: "v1", - } - _id && (payload._id = _id) - Network.post( - API_CONFIG.CONFIG[process.env.NODE_ENV] + - ENDPOINTS.CONFIG.ROOT + - ENDPOINTS.CONFIG.SAVE + - namespace._id, - payload, - ) - .then((res) => { - if (res.status === 200) { - fetchNamespaces() - dispatch( - notify({ - show: true, - message: "Added a new config successfully", - type: ArAlertType.SUCCESS, - uid: uuid(), - }), - ) - } - }) - .catch((e) => { - dispatch( - notify({ - show: true, - message: "Failed to add new config", - type: ArAlertType.ERROR, - uid: uuid(), - }), - ) - }) - } - - const deleteConfig = (_id?: string) => { - Network.get( - API_CONFIG.CONFIG[process.env.NODE_ENV] + - ENDPOINTS.CONFIG.ROOT + - ENDPOINTS.CONFIG.DELETE + - "/" + - namespace._id + - "/" + - _id, - ) - .then((res) => { - if (res.status === 200) { - fetchNamespaces() - dispatch( - notify({ - show: true, - message: "Removed config successfully", - type: ArAlertType.SUCCESS, - uid: uuid(), - }), - ) - } - }) - .catch((e) => { - dispatch( - notify({ - show: true, - message: "Failed to delete config", - type: ArAlertType.ERROR, - uid: uuid(), - }), - ) - }) - } - return ( -
-
- -
-
-
- -
- {configurations && configurations.length > 0 ? ( - configurations.map((configuration) => { - return ( - - addConfig(key, value, _id) - } - onDelete={deleteConfig} - config={configuration} - disabled - /> - ) - }) - ) : ( -
-
- Nothing here, start by adding configurations above -
-
- )} -
-
-
-
-
- ) -} - -export default ConfigurationViewer diff --git a/src/app/components/ConfigurationViewer/index.ts b/src/app/components/ConfigurationViewer/index.ts deleted file mode 100755 index 087e3eb..0000000 --- a/src/app/components/ConfigurationViewer/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import ConfigurationViewer from "./ConfigurationViewer" - -export default ConfigurationViewer diff --git a/src/app/components/Editor/Editor.component.scss b/src/app/components/Editor/Editor.component.scss deleted file mode 100755 index d13cc79..0000000 --- a/src/app/components/Editor/Editor.component.scss +++ /dev/null @@ -1,41 +0,0 @@ -.ar-Editor { - border: 1px solid var(--ar-color-layout-border); - .ar-Editor__tools { - background-color: var(--ar-bg-base); - border-bottom: 1px solid var(--ar-color-layout-border); - } - - .ar-Editor__prop-selector { - min-height: 2.5rem; - &::-webkit-scrollbar { - height: 2px; - background-color: #fefefe; - } - - /* Track */ - &::-webkit-scrollbar-track { - background: #cdcdcd; - width: 10px; - height: 10px; - } - - /* Handle */ - &::-webkit-scrollbar-thumb { - background: #ababab; - border-radius: 2px; - width: 3rem; - height: 10px; - &:hover { - background: #888; - } - } - } -} - -#root.ar-Editor__frame__main { - background-color: var(--ar-bg-tertiary); - &.background { - background-repeat: no-repeat; - background-size: 100%; - } -} \ No newline at end of file diff --git a/src/app/components/Editor/Editor.test.ts b/src/app/components/Editor/Editor.test.ts deleted file mode 100755 index b328e72..0000000 --- a/src/app/components/Editor/Editor.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import Editor from "./Editor" - -describe("Editor", () => { - it("renders without error", () => { - - }) -}) diff --git a/src/app/components/Editor/Editor.tsx b/src/app/components/Editor/Editor.tsx deleted file mode 100755 index 1220c44..0000000 --- a/src/app/components/Editor/Editor.tsx +++ /dev/null @@ -1,359 +0,0 @@ -import { ReactNode, useEffect, useState } from "react" -import { useLocation, useNavigate } from "react-router-dom" -import { createPortal } from "react-dom" -import { - ArDropdownVariants, - ArSizes, - ArThemes, - ComponentDescription, - FrameContentDefinition, - FrameContentProps, - PRIMITIVES, -} from "@armco/types" -import { - Alert, - Button, - COMPONENTS, - Toggle, - Helper, - Network, - Dropdown, -} from ".." -import StyleHelper from "./StyleHelper" -import * as images from "../../static/images" -import "./Editor.component.scss" - -const children = { - bg: ( -
- ), - content: ( - - Popover Content - - ), - popover: ( -
- Popover Content -
- ), - list: ( -
- {Array.from({ length: 40 }, (_, i) => ( -
- ))} -
- ), - anchor:
- ) -} - -export default FavoritesList diff --git a/src/app/components/FavoritesList/index.ts b/src/app/components/FavoritesList/index.ts deleted file mode 100755 index 0bed57d..0000000 --- a/src/app/components/FavoritesList/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import FavoritesList from "./FavoritesList" - -export default FavoritesList diff --git a/src/app/components/FontsList/FontsList.component.scss b/src/app/components/FontsList/FontsList.component.scss deleted file mode 100755 index fbe4d38..0000000 --- a/src/app/components/FontsList/FontsList.component.scss +++ /dev/null @@ -1,12 +0,0 @@ -.ar-FontsList { - .ar-FontsList__header-search-upload { - background-color: var(--ar-bg); - color: var(--ar-colora); - background-color: var(--ar-bg-base); - } - - .ar-FontsList__font-tile-container { - background-color: var(--ar-bg); - color: var(--ar-color); - } -} diff --git a/src/app/components/FontsList/FontsList.test.ts b/src/app/components/FontsList/FontsList.test.ts deleted file mode 100755 index d93be71..0000000 --- a/src/app/components/FontsList/FontsList.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import FontsList from "./FontsList" - -describe("FontsList", () => { - it("renders without error", () => { - - }) -}) diff --git a/src/app/components/FontsList/FontsList.tsx b/src/app/components/FontsList/FontsList.tsx deleted file mode 100755 index d665da4..0000000 --- a/src/app/components/FontsList/FontsList.tsx +++ /dev/null @@ -1,154 +0,0 @@ -import { ChangeEvent, useEffect, useState } from "react" -import { - ArButtonVariants, - ArLoaderTypes, - ArSizes, - ArrayType, - FontsListProps, - FunctionType, - ObjectType, -} from "@armco/types" -import { - API_CONFIG, - Button, - ENDPOINTS, - FontTile, - Helper, - Loader, - Network, - Pagination, - SearchField, - Toggle, -} from ".." -import "./FontsList.component.scss" - -const fetchFontsPage = ( - limit: number, - from: number, - filters: ObjectType, - dataSetter: FunctionType, - pageSetter: FunctionType, - setLoading: FunctionType, -) => { - const pageApi = - API_CONFIG.STATIC_HOST[process.env.NODE_ENV] + - ENDPOINTS.STATIC.FONT.ROOT + - ENDPOINTS.STATIC.FONT.PAGE - const queryParams: ObjectType = { pageSize: limit, from, ...filters } - Network.get(pageApi, queryParams) - .then((response) => { - if (response && response.status === 200) { - if (response.body && dataSetter) { - const content = JSON.parse(response.body) - const styleElement = document.createElement("style") - styleElement.type = "text/css" - styleElement.appendChild( - document.createTextNode(content.returnFontGroups), - ) - document.head.appendChild(styleElement) - - dataSetter(content.fontNames) - pageSetter(content.fontNames.slice(0, 30)) - } - } - setLoading(false) - }) - .catch((error) => { - console.error(error) - setLoading(false) - }) -} - -const FontsList = (props: FontsListProps): JSX.Element => { - const [searchText, setSearchText] = useState() - const [fonts, setFonts] = useState() - const [page, setPage] = useState() - const [loading, setLoading] = useState() - - // TODO: Fetch Fonts - useEffect(() => { - const filters: ObjectType = {} - setLoading(true) - fetchFontsPage(30, 0, filters, setFonts, setPage, setLoading) - }, []) - - useEffect(() => { - const filters: ObjectType = {} - if (searchText) { - filters.search = searchText - } - setLoading(true) - fetchFontsPage(200, 0, filters, setFonts, setPage, setLoading) - }, [searchText]) - - return ( -
- {!fonts && ( - - )} -
-
- -
-
- {page && ( -
- {loading && ( - - )} - {(page as Array).map((font) => ( - - ))} -
- )} - - // fetchIconsPage(load, count, {}, setIcons, setPage, setLoading) - // } - /> -
- ) -} - -export default FontsList diff --git a/src/app/components/FontsList/index.ts b/src/app/components/FontsList/index.ts deleted file mode 100755 index eb23e5b..0000000 --- a/src/app/components/FontsList/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import FontsList from "./FontsList" - -export default FontsList diff --git a/src/app/components/Header/Header.component.scss b/src/app/components/Header/Header.component.scss deleted file mode 100755 index fc5d6ec..0000000 --- a/src/app/components/Header/Header.component.scss +++ /dev/null @@ -1,39 +0,0 @@ -.ar-Header { - background-color: var(--ar-bg-base); - border-bottom: 1px solid var(--ar-color-layout-border); - - .ar-Header__app-logo { - cursor: pointer; - .ar-Header__brand { - border-radius: 50%; - } - .ar-Header__app-name { - font-family: "Allerta Stencil"; - font-weight: 700; - font-size: 1.5rem; - - .ar-Header__app-name-i { - color: red; - } - .ar-Header__app-name-o { - color: green; - } - } - } - - .ar-Header__app-search { - transition: width 0.3s; - @media screen and (max-width: 576px) { - flex: 1; - - .ar-SearchField .ar-TextInput { - border-top-left-radius: 0.5rem; - border-bottom-left-radius: 0.5rem; - } - .ar-SearchField .ar-Button { - border-top-right-radius: 0.5rem; - border-bottom-right-radius: 0.5rem; - } - } - } -} diff --git a/src/app/components/Header/Header.test.ts b/src/app/components/Header/Header.test.ts deleted file mode 100755 index 63b60c8..0000000 --- a/src/app/components/Header/Header.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import Header from "./Header" - -describe("Header", () => { - it("renders without error", () => { - - }) -}) \ No newline at end of file diff --git a/src/app/components/Header/Header.tsx b/src/app/components/Header/Header.tsx deleted file mode 100755 index 2309191..0000000 --- a/src/app/components/Header/Header.tsx +++ /dev/null @@ -1,104 +0,0 @@ -import { useState } from "react" -import { useLocation, useNavigate } from "react-router-dom" -import { ArThemes, DrawerProps, HeaderProps, ObjectType } from "@armco/types" -import { - getCurrentTheme, - getDrawerState, - FlexTools, - LoadableIcon, - SearchField, - setDrawerState, - setTheme, - useAppDispatch, - useAppSelector, -} from ".." -import "./Header.component.scss" - -const Header = (props: HeaderProps): JSX.Element => { - const { routeDetails } = props - const navigate = useNavigate() - const location = useLocation() - const [searchFocussed, setSearchFocussed] = useState() - const drawerState = useAppSelector(getDrawerState) - const dispatch = useAppDispatch() - const theme = useAppSelector(getCurrentTheme) - const route = (routeDetails?.route as ObjectType)?.class - const isLanding = - !routeDetails || - ["landing", "assets", "playground", "tools-and-services"].indexOf( - route as string, - ) > -1 - - const showExpander = - location.pathname.startsWith("/components") || - location.pathname.startsWith("/icons") - - return ( -
-
navigate("/")} - > - - Stuffle. - i - o - -
- {showExpander && ( - - dispatch(setDrawerState({ collapsed: !drawerState?.collapsed })) - } - color={theme === ArThemes.DARK1 ? "lightgrey" : "black"} - /> - )} - {!isLanding && ( -
setSearchFocussed(true)} - onBlur={() => setSearchFocussed(false)} - className={`ar-Header__app-search h-100 flex-v-center me-3 ${ - searchFocussed ? "w-50" : "w-25" - }`} - > - {}} - placeholder="Search icons, components, fonts..." - /> -
- )} - { - const nextTheme = - theme === ArThemes.LIGHT1 ? ArThemes.DARK1 : ArThemes.LIGHT1 - dispatch(setTheme(nextTheme)) - document - .getElementsByTagName("html")[0] - .setAttribute("ar-theme", nextTheme) - }} - color={theme === ArThemes.DARK1 ? "lightgrey" : "black"} - /> -
- -
-
- ) -} - -export default Header diff --git a/src/app/components/Header/index.ts b/src/app/components/Header/index.ts deleted file mode 100755 index 696cfbc..0000000 --- a/src/app/components/Header/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import Header from "./Header" - -export default Header diff --git a/src/app/components/IconController/IconController.component.scss b/src/app/components/IconController/IconController.component.scss deleted file mode 100755 index 227cef7..0000000 --- a/src/app/components/IconController/IconController.component.scss +++ /dev/null @@ -1,48 +0,0 @@ -.ar-IconController { - .ar-IconController__main, .ar-IconController__header { - background-color: var(--ar-bg-base); - } - - .ar-IconController__color-palette { - border-radius: 50%; - } - - .ar-IconController__download-button, .ar-IconController__animate-button { - background-color: orange; - border-color: orange; - } - - .ar-IconController__main { - border-radius: 0.3rem; - } - - .ar-IconController__controls-form { - background-color: var(--ar-bg); - } - - .hover-show { - cursor: pointer; - .ar-IconController__download-icon { - opacity: 0; - pointer-events: none; - transition: opacity 0.3s; - } - - &:hover { - .ar-IconController__download-icon { - opacity: 1; - pointer-events: auto; - transition: box-shadow 0.3s; - - &:hover { - box-shadow: 0 4px 8px var(--ar-shadow); - border-radius: 3px - } - } - } - } - - .ar-IconController__meta-item { - color: var(--ar-color-secondary); - } -} diff --git a/src/app/components/IconController/IconController.test.ts b/src/app/components/IconController/IconController.test.ts deleted file mode 100755 index ca6efb7..0000000 --- a/src/app/components/IconController/IconController.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import IconController from "./IconController" - -describe("IconController", () => { - it("renders without error", () => { - - }) -}) diff --git a/src/app/components/IconController/IconController.tsx b/src/app/components/IconController/IconController.tsx deleted file mode 100755 index a442750..0000000 --- a/src/app/components/IconController/IconController.tsx +++ /dev/null @@ -1,378 +0,0 @@ -import { useNavigate } from "react-router-dom" -import { useEffect, useState } from "react" -import { - ArButtonVariants, - ArPopoverSlots, - IconControllerProps, - ObjectType, -} from "@armco/types" -import { getIconStyles } from "../../pages/IconPage/IconPage.slice" -import { - API_CONFIG, - Breadcrumb, - Button, - DomHelper, - LoadableIcon, - Network, - Select, - Suggestions, - setRightPanelContent, - Tags, - TextInput, - useAppDispatch, - useAppSelector, -} from ".." -import "./IconController.component.scss" - -const complement = (hex?: string) => { - if (hex) { - const hexParts = hex.substring(1).toLowerCase().split("") - const hexMap = { a: 10, b: 11, c: 12, d: 13, e: 14, f: 15 } - const reverseMap = { 10: "a", 11: "b", 12: "c", 13: "d", 14: "e", 15: "f" } - let complementValue = "#" - hexParts.forEach((part: string) => { - let num = +part - if (isNaN(num)) { - num = hexMap[part as keyof object] - } - const complementNumeric = 15 - num - complementValue += - complementNumeric > 9 - ? reverseMap[complementNumeric as keyof object] - : complementNumeric - }) - return complementValue - } - return "#fff" -} - -const STATIC_ROOT = API_CONFIG.STATIC_HOST[process.env.NODE_ENV] - -const IconController = (props: IconControllerProps): JSX.Element => { - const { group, icon, name } = props - const [size, setSize] = useState() - const [unit, setUnit] = useState("rem") - const [similarIcons, setSimilarIcons] = useState>() - - const dispatch = useAppDispatch() - const iconStyles = useAppSelector(getIconStyles) - const fontColor = complement(iconStyles?.bgColor || "white") - - const navigate = useNavigate() - - // const suggestions = getSuggestions(group, name) - - useEffect(() => { - const filename = `${group}_${name}-black.png` - Network.getStatic(`/static/${filename}`).then((res) => { - const imgBlob = res.body - const formData = new FormData() - const file = new File([imgBlob], filename, { type: imgBlob.type }) - formData.append("file", file) - formData.append("count", "20") - Network.post( - "http://localhost:5002/api/similar-icon-paths", - formData, - undefined, - { headers: { "Content-Type": "multipart/form-data" } }, - true, - true, - ).then((res) => { - if (res.status === 200) { - const iconPaths = res.body.map((str: string) => - str.replace( - "../images", - `${API_CONFIG.STATIC_HOST[process.env.NODE_ENV]}/static`, - ), - ) - // setSimilarIcons(iconPaths) - Network.post(STATIC_ROOT + "/icon/png-to-svg", { - urls: iconPaths, - }).then((res) => { - setSimilarIcons(res.body) - }) - } - }) - }) - }, [name, group]) - - return ( -
- {group && name && ( - - )} -
-
- {group}.{name} -
-
-
-
-
- {group && name && ( -
-
-
- - DomHelper.downloadSvg( - (icon as ObjectType).icon as string, - name, - { - size: "3rem", - ...iconStyles, - color: iconStyles?.strokeColor || "royalblue", - }, - ) - } - /> - - - 3rem - -
-
- - DomHelper.downloadSvg( - (icon as ObjectType).icon as string, - name, - { - size: "7rem", - ...iconStyles, - color: iconStyles?.strokeColor || "royalblue", - }, - ) - } - /> - - - 7rem - -
-
-
- - DomHelper.downloadSvg( - (icon as ObjectType).icon as string, - name, - { - size: size && unit ? size + unit : "20rem", - ...iconStyles, - color: iconStyles?.strokeColor || "royalblue", - }, - ) - } - /> - - - {size && unit ? size + unit : "20rem"} - -
-
- )} -
-
-
- {icon && ( -
-
Icon Details
-
-
- Created By: - {icon.createdby as string} -
-
-
-
- Description: - {icon.description as string} -
-
-
-
- Downloaded: - {((icon.meta as ObjectType)?.downloadedTimes as number) || - 0} -
-
-
-
- Liked: - {((icon.meta as ObjectType)?.downloadedTimes as number) || - 0} -
-
-
-
- Size: - {(icon.meta as ObjectType)?.size as number} -
-
-
- )} -
-
-
-
-
- - setSize((e.target as HTMLInputElement).value) - } - /> -
-
- -
- ) -} - -export default TextArea diff --git a/src/app/components/atoms/TextArea/index.ts b/src/app/components/atoms/TextArea/index.ts deleted file mode 100755 index 877b263..0000000 --- a/src/app/components/atoms/TextArea/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import TextArea from "./TextArea" - -export default TextArea \ No newline at end of file diff --git a/src/app/components/atoms/TextInput/TextInput.component.scss b/src/app/components/atoms/TextInput/TextInput.component.scss deleted file mode 100755 index 9cf1564..0000000 --- a/src/app/components/atoms/TextInput/TextInput.component.scss +++ /dev/null @@ -1,46 +0,0 @@ -.ar-TextInput { - border-top-left-radius: 0.125rem; - border-bottom-left-radius: 0.125rem; - - input.ar-TextInput__input { - outline: none; - max-height: 2rem; - &::-webkit-input-placeholder { - font-style: italic; - } - &:-moz-placeholder { - font-style: italic; - } - &::-moz-placeholder { - font-style: italic; - } - &:-ms-input-placeholder { - font-style: italic; - } - &.ar-Search__input { - &:focus-visible { - border-bottom: none; - } - } - } - - .ar-TextInput__label { - max-height: 2rem; - } - - .ar-TextInput__clear-button { - visibility: hidden; - - &.has-value { - visibility: visible; - } - } - - &.small input { - height: 1.5rem !important; - } - - .ar-TextInput__label-container__subtitle { - color: var(--ar-color-obscure-4); - } -} diff --git a/src/app/components/atoms/TextInput/TextInput.test.ts b/src/app/components/atoms/TextInput/TextInput.test.ts deleted file mode 100755 index fae4a2b..0000000 --- a/src/app/components/atoms/TextInput/TextInput.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import TextInput from "./TextInput" - -describe("TextInput", () => { - it("renders without error", () => { - - }) -}) diff --git a/src/app/components/atoms/TextInput/TextInput.tsx b/src/app/components/atoms/TextInput/TextInput.tsx deleted file mode 100755 index 8c56763..0000000 --- a/src/app/components/atoms/TextInput/TextInput.tsx +++ /dev/null @@ -1,234 +0,0 @@ -import { ChangeEvent, FocusEvent, useEffect, useState } from "react" -import { - ArButtonVariants, - ArPlacement, - ArSizes, - ArThemes, - FunctionType, - TextInputProps, -} from "@armco/types" -import { Button, Icon, LoadableIcon, Slider } from "../.." -import "./TextInput.component.scss" - -const TextInput = (props: TextInputProps): JSX.Element => { - const { - action, - actionIcon, - assistiveContent, - classes, - containerClasses, - isDisabled, - id, - label, - labelClasses, - labelPlacement = ArPlacement.TOP, - name, - size, - onBlur, - onChange, - onFocus, - placeholder, - required, - subtitle, - theme, - type, - value, - ...rest - } = props - const [localValue, setLocalValue] = useState() - const [focussed, setFocussed] = useState(false) - const [passwordViewed, setPasswordViewed] = useState() - - const onLocalChange = ( - event: ChangeEvent | { target: { value: string } }, - ): void => { - "persist" in event && event.persist() - setLocalValue(event.target.value) - onChange && (onChange as FunctionType)(event, id) - } - - useEffect(() => { - setLocalValue(value) - }, [value]) - - const assistiveContentRender = assistiveContent ? ( - "content" in assistiveContent && "onClick" in assistiveContent ? ( -
- {message && ( - - {message} - - )} -
-
- {variant !== "compact" && - localResults && - Object.keys(localResults).length > 0 && ( -
- - )} - -
- ) - - const errorRender = errorMessage && ( - {errorMessage} - ) - - const resultsRender = localResults && variant !== "compact" && ( -
- {Object.entries(localResults).map(([fileName, result]) => - uploadEntryRenderer ? ( - uploadEntryRenderer(result, () => clear(fileName)) - ) : ( - clear(fileName)} - demo={!!demo} - disabled={!!disabled} - key={fileName} - result={result} - /> - ), - )} -
- ) - - const uploaderRender = ( -
) => e.preventDefault()} - onDragLeave={(e: MouseEvent) => e.preventDefault()} - > - {variant !== "compact" ? ( - { - if (inputRef.current && !disabled) { - inputRef.current.files = e.dataTransfer.files - inputRef.current.dispatchEvent( - new Event("change", { bubbles: true, cancelable: true }), - ) - } - }} - acceptTypes={[NativeTypes.FILE]} - hideHoverEffect={isAvatar || disabled} - > - {inputRender} - - ) : ( - inputRender - )} - {!isAvatar && errorRender} - {!isAvatar && resultsRender} -
- ) - - return uploaderRender - }, - (prevProps, props) => { - return ( - prevProps.acceptedFileTypes === props.acceptedFileTypes && - prevProps.acceptedFileCount === props.acceptedFileCount && - prevProps.allowMultiple === props.allowMultiple && - prevProps.disabled === props.disabled && - prevProps.errorMessage === props.errorMessage && - prevProps.endpoint === props.endpoint && - prevProps.fileSizeLimit === props.fileSizeLimit && - JSON.stringify(prevProps.files) === JSON.stringify(props.files) && - prevProps.message === props.message && - prevProps.avatarSize === props.avatarSize && - prevProps.variant === props.variant && - prevProps.theme === props.theme && - prevProps.uploadSequential === props.uploadSequential && - prevProps.uploadButtonText === props.uploadButtonText && - prevProps.uploadingButtonText === props.uploadingButtonText - ) - }, -) - -export default Uploader diff --git a/src/app/components/atoms/Uploader/index.ts b/src/app/components/atoms/Uploader/index.ts deleted file mode 100755 index ad089f3..0000000 --- a/src/app/components/atoms/Uploader/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import Uploader from "./Uploader" - -export default Uploader diff --git a/src/app/components/atoms/Widget/Widget.component.scss b/src/app/components/atoms/Widget/Widget.component.scss deleted file mode 100755 index 9eea465..0000000 --- a/src/app/components/atoms/Widget/Widget.component.scss +++ /dev/null @@ -1,6 +0,0 @@ -.ar-Widget { - color: var(--ar-color-obscure-4); - .c-Widget__header { - height: 2rem; - } -} diff --git a/src/app/components/atoms/Widget/Widget.test.ts b/src/app/components/atoms/Widget/Widget.test.ts deleted file mode 100755 index e8e07e4..0000000 --- a/src/app/components/atoms/Widget/Widget.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import Widget from "./Widget" - -describe("Widget", () => { - it("renders without error", () => { - - }) -}) \ No newline at end of file diff --git a/src/app/components/atoms/Widget/Widget.tsx b/src/app/components/atoms/Widget/Widget.tsx deleted file mode 100755 index 0087943..0000000 --- a/src/app/components/atoms/Widget/Widget.tsx +++ /dev/null @@ -1,65 +0,0 @@ -import { useNavigate } from "react-router-dom" -import { ArButtonVariants, ArSizes, WidgetProps } from "@armco/types" -import { Button, LoadableIcon, useSlotted } from "../.." -import "./Widget.component.scss" - -const Widget = (props: WidgetProps): JSX.Element => { - const { actions, classes, header, content, noPadContent } = props - const navigate = useNavigate() - useSlotted("Widget") - - const actionRenders = - actions && - actions.map((action) => { - const { color, icon, label, onClick, route } = action - const onLocalClick = () => { - onClick && typeof onClick === "function" - ? onClick(action) - : route && navigate(route) - } - return ( -
- {label ? ( -
- ) - }) - - return ( -
-
- {header || "Widget"} - {actionRenders} -
-
- {content} -
-
- ) -} - -export default Widget diff --git a/src/app/components/atoms/Widget/index.ts b/src/app/components/atoms/Widget/index.ts deleted file mode 100755 index 555e8b8..0000000 --- a/src/app/components/atoms/Widget/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import Widget from "./Widget" - -export default Widget diff --git a/src/app/components/atoms/Wizard/Wizard.component.scss b/src/app/components/atoms/Wizard/Wizard.component.scss deleted file mode 100755 index 3a8d851..0000000 --- a/src/app/components/atoms/Wizard/Wizard.component.scss +++ /dev/null @@ -1,91 +0,0 @@ -.ar-Wizard { - --ar-wizard-footer-height: 3.5rem; - --ar-wizard-header-height: 3.5rem; - --ar-wizard-selection-bar-height: 1rem; - - .ar-Wizard__header { - height: var(--ar-wizard-header-height); - } - - .ar-Wizard__footer { - height: var(--ar-wizard-footer-height); - } - - .ar-Wizard__stage-container { - height: 100%; - - .ar-Wizard__stage { - transition: left 0.3s ease-in-out; - } - - .ar-Wizard__stage-container__stage-selection-bar { - height: var(--ar-wizard-selection-bar-height); - max-width: 30%; - .ar-Wizard__stage-selection-item { - height: 7px; - width: 5rem; - border-radius: 4px; - background-color: var(--ar-color-obscure); - cursor: pointer; - &.active { - background-color: var(--ar-color-obscure-3); - } - } - } - } - - .ar-Wizard__stage-container__stages { - height: 100%; - } - - &.show-status-bar .ar-Wizard__stage-container__stages { - height: calc(100% - var(--ar-wizard-selection-bar-height)); - } - - &.has-footer.has-header { - .ar-Wizard__stage-container { - height: calc(100% - var(--ar-wizard-footer-height) - var(--ar-wizard-header-height)); - } - } - - &.has-footer { - .ar-Wizard__stage-container { - height: calc(100% - var(--ar-wizard-footer-height)); - } - } - - &.has-header { - .ar-Wizard__stage-container { - height: calc(100% - var(--ar-wizard-header-height)); - } - } - - .ar-NavButton__previous, .ar-NavButton__next { - top: calc(50% - 1.5rem - 0.5rem - 1px); // minus half of height, padding, and border each - transition: all 0.2s ease-in-out; - border-color: var(--ar-color-border); - box-shadow: 0px 2px 4px var(--ar-shadow); - - &.overlay { - background-color: var(--ar-bg-mild); - - &:hover { - background-color: var(--ar-bg-hover-2); - } - } - } - - .ar-NavButton__previous { - left: 1rem; - &.overlay:hover { - border-right: var(--ar-border); - } - } - - .ar-NavButton__next { - right: 1rem; - &.overlay:hover { - border-left: var(--ar-border); - } - } -} diff --git a/src/app/components/atoms/Wizard/Wizard.test.ts b/src/app/components/atoms/Wizard/Wizard.test.ts deleted file mode 100755 index ae3c33f..0000000 --- a/src/app/components/atoms/Wizard/Wizard.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import Wizard from "./Wizard" - -describe("Wizard", () => { - it("renders without error", () => { - - }) -}) diff --git a/src/app/components/atoms/Wizard/Wizard.tsx b/src/app/components/atoms/Wizard/Wizard.tsx deleted file mode 100755 index 3e0cc4a..0000000 --- a/src/app/components/atoms/Wizard/Wizard.tsx +++ /dev/null @@ -1,290 +0,0 @@ -import { useEffect, useState } from "react" -import { - ArButtonVariants, - ArWizardNavigationTypes, - FunctionType, - WizardProps, - WizardStage, -} from "@armco/types" -import { Button, LoadableIcon, useSlotted } from "../.." -import "./Wizard.component.scss" - -const dummyStages = [ - { - id: "1", - title: "Stage 1", - content:
Stage 1 Content
, - }, - { - id: "2", - title: "Stage 2", - content: "Stage 2 Content", - }, - { - id: "3", - title: "Stage 3", - content: "Stage 3 Content", - }, -] - -const NavButton = ({ - context, - disabled, - isLast, - navigationType, - onClick, -}: { - context: string - disabled?: boolean - isLast?: boolean - navigationType: ArWizardNavigationTypes - onClick: FunctionType -}) => { - const [hovered, setHovered] = useState() - - return ( - setHovered(true)} - onMouseLeave={() => setHovered(false)} - > - onClick(context)} - icon={ - context === "prev" - ? "fa.FaChevronLeft" - : isLast - ? "fa.FaCheck" - : "fa.FaChevronRight" - } - color={ - disabled - ? "#d1d5db" - : isLast - ? "green" - : hovered - ? "#9b9b9b" - : "#c0c4ca" - } - size={ - navigationType === ArWizardNavigationTypes.OVERLAYPROMINENT - ? "2rem" - : "1rem" - } - /> - - ) -} -const Wizard = (props: WizardProps): JSX.Element => { - const { - activeStage, - classes, - demo, - hideStatusBar, - navigationType = ArWizardNavigationTypes.STANDARD, - onComplete, - onCancel, - onStageChange, - stages, - title, - } = props - const [active, setActive] = useState() - const [localStages, setLocalStages] = useState>([]) - useSlotted("Wizard") - const useStages = demo ? stages || dummyStages : stages - - useEffect(() => { - const stagesClone = [...(useStages || [])] - stagesClone.map((stage, index) => (stage.index = index)) - setLocalStages(stagesClone) - }, [useStages]) - - useEffect(() => { - setActive(activeStage || 0) - }, [activeStage]) - - const onLocalStageChange = (navTo: number) => { - if (localStages) { - const nextStage = localStages[navTo] - setActive(navTo) - onStageChange && onStageChange(nextStage, localStages[active || 0]) - } - } - - const stageRenders = localStages?.map((stage, index) => { - const childStage = (hidden?: boolean) => { - return ( -
- {navigationType !== ArWizardNavigationTypes.EXTERNAL && - stage.title && ( -
-
{stage.title}
-
- )} -
- {stage.content} -
-
- ) - } - return ( - <> - {childStage()} - {childStage(true)} - - ) - }) - - const prevButton = ( - onLocalStageChange((active || 1) - 1)} - context="prev" - disabled={active === 0} - navigationType={navigationType} - /> - ) - - const nextButton = ( - onLocalStageChange((active || 0) + 1) - } - context="next" - isLast={active === localStages?.length - 1} - navigationType={navigationType} - /> - ) - - return ( -
- {navigationType !== ArWizardNavigationTypes.EXTERNAL && title && ( -
-
{title}
-
- )} -
-
- {navigationType === ArWizardNavigationTypes.OVERLAYPROMINENT && ( - <> - {prevButton} - {nextButton} - - )} - {navigationType === ArWizardNavigationTypes.OVERLAY && ( - - {prevButton} - {nextButton} - - )} - {stageRenders} -
- {!hideStatusBar && ( -
- {localStages?.map((stage, index) => ( -
onLocalStageChange(index)} - /> - ))} -
- )} -
- {navigationType === ArWizardNavigationTypes.STANDARD && ( -
-
-
-
- )} -
- ) -} - -export default Wizard diff --git a/src/app/components/atoms/Wizard/index.ts b/src/app/components/atoms/Wizard/index.ts deleted file mode 100755 index 4ea21b1..0000000 --- a/src/app/components/atoms/Wizard/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import Wizard from "./Wizard" - -export default Wizard diff --git a/src/app/components/atoms/WizardModal/WizardModal.component.scss b/src/app/components/atoms/WizardModal/WizardModal.component.scss deleted file mode 100755 index 334406d..0000000 --- a/src/app/components/atoms/WizardModal/WizardModal.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -.ar-WizardModal { - -} diff --git a/src/app/components/atoms/WizardModal/WizardModal.test.ts b/src/app/components/atoms/WizardModal/WizardModal.test.ts deleted file mode 100755 index f4a1600..0000000 --- a/src/app/components/atoms/WizardModal/WizardModal.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import WizardModal from "./WizardModal" - -describe("WizardModal", () => { - it("renders without error", () => { - - }) -}) diff --git a/src/app/components/atoms/WizardModal/WizardModal.tsx b/src/app/components/atoms/WizardModal/WizardModal.tsx deleted file mode 100755 index 06bcdea..0000000 --- a/src/app/components/atoms/WizardModal/WizardModal.tsx +++ /dev/null @@ -1,161 +0,0 @@ -import { useEffect, useState } from "react" -import { - ArButtonVariants, - ArWizardNavigationTypes, - WizardModalProps, - WizardStage, -} from "@armco/types" -import { Button, Modal, Wizard } from "../.." -import "./WizardModal.component.scss" - -const dummyStages = [ - { - id: "1", - title: "Stage 1", - content: ( -
- Stage 1 Content -
- ), - }, - { - id: "2", - title: "Stage 2", - content: "Stage 2 Content", - }, - { - id: "3", - title: "Stage 3", - content: "Stage 3 Content", - }, -] - -const WizardModal = (props: WizardModalProps): JSX.Element => { - const { - activeStage, - classes, - demo, - hideStatusBar, - navigationType, - onComplete, - onCancel, - onStageChange, - stages, - title, - ...rest - } = props - - const wizardProps = { - activeStage, - classes, - demo, - hideStatusBar, - navigationType, - onComplete, - onCancel, - onStageChange, - stages, - title, - } - - const [localStages, setLocalStages] = useState>([]) - const [active, setActive] = useState() - const useStages = demo ? stages || dummyStages : stages - const [modalDisplayed, toggleModalDisplay] = useState() - - useEffect(() => { - toggleModalDisplay(rest.show) - }, [rest.show]) - - useEffect(() => { - if (useStages) { - const stagesClone = [...useStages] - stagesClone.map((stage, index) => (stage.index = index)) - setLocalStages(stagesClone) - if (activeStage) { - const foundActiveStage = stagesClone?.find( - (stage) => stage.index === activeStage, - ) - foundActiveStage && setActive(foundActiveStage.index) - } else { - setActive(0) - } - } - }, [activeStage, useStages]) - - const onLocalStageChange = (navTo: number | WizardStage) => { - if (localStages) { - navTo = typeof navTo === "number" ? navTo : (navTo.index as number) - const nextStage = localStages[navTo] - setActive(navTo) - onStageChange && onStageChange(nextStage, localStages[active || 0]) - } - } - - const onLocalCancel = () => { - setActive(undefined) - toggleModalDisplay(false) - onCancel && onCancel() - } - - const footer = ( -
-
-
-
- ) - - return ( -
- - } - footer={footer} - /> -
- ) -} - -export default WizardModal diff --git a/src/app/components/atoms/WizardModal/index.ts b/src/app/components/atoms/WizardModal/index.ts deleted file mode 100755 index d1608b3..0000000 --- a/src/app/components/atoms/WizardModal/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import WizardModal from "./WizardModal" - -export default WizardModal diff --git a/src/app/components/atoms/index.ts b/src/app/components/atoms/index.ts deleted file mode 100644 index ff38fe1..0000000 --- a/src/app/components/atoms/index.ts +++ /dev/null @@ -1,207 +0,0 @@ -/* PLOP_INJECT_IMPORT */ -import Chunk from "./Chunk" -import Avatar from "./Avatar" -import DroppableContainer from "./DroppableContainer" -import RepeatRenderer from "./RepeatRenderer" -import Anchor from "./Anchor" -import ListItem from "./ListItem" -import ListContainer from "./ListContainer" -import Label from "./Label" -import Input from "./Input" -import Text from "./Text" -import ReleaseSlot from "./ReleaseSlot" -import BuilderSlot from "./BuilderSlot" -import SlotTools from "./SlotTools" -import ReleaseLayout from "./ReleaseLayout" -import BuilderLayout from "./BuilderLayout" -import LayoutControlPanel from "./LayoutControlPanel" -import Resizable from "./Resizable" -import Layout from "./Layout" -import Slot from "./Slot" -import LayoutCreator from "./LayoutCreator" -import ScrollPagination from "./ScrollPagination" -import ProgressiveBarChart from "./ProgressiveBarChart" -import Droppable from "./Droppable" -import Draggable from "./Draggable" -import Image from "./Image" -import PopoverV2 from "./PopoverV2" -import PopoverV1 from "./PopoverV1" -import LayoutGenerator from "./LayoutGenerator" -import WizardModal from "./WizardModal" -import Wizard from "./Wizard" -import Accordion from "./Accordion" -import AdvancedColorPicker from "./AdvancedColorPicker" -import Alert from "./Alert" -import ArViz from "./ArViz" -import Badge from "./Badge" -import Breadcrumb from "./Breadcrumb" -import BrowserIncompatibility from "./BrowserIncompatibility" -import BubbleChart from "./BubbleChart" -import BubbleViz from "./BubbleViz" -import Button from "./Button" -import Calendar from "./Calendar" -import Checkbox from "./Checkbox" -import ColorPicker from "./ColorPicker" -import ColorSelector from "./ColorSelector" -import ContextMenu from "./ContextMenu" -import CronTab from "./CronTab" -import DateInput from "./DateInput" -import DatePicker from "./DatePicker" -import DateRangePicker from "./DateRangePicker" -import DetailsPanel from "./DetailsPanel" -import Dialog from "./Dialog" -import Dropdown from "./Dropdown" -import FacetedFilter from "./FacetedFilter" -import FontTile from "./FontTile" -import Icon from "./Icon" -import IconTile from "./IconTile" -import InlineMenu from "./InlineMenu" -import LabelValue from "./LabelValue" -import LearnLink from "./LearnLink" -import Link from "./Link" -import List from "./List" -import LoadableIcon from "./LoadableIcon" -import Loader from "./Loader" -import LottieTile from "./LottieTile" -import Mask from "./Mask" -import Modal from "./Modal" -import Notification from "./Notification" -import NumericStepper from "./NumericStepper" -import Pagination from "./Pagination" -import Password from "./Password" -import PickerRange from "./PickerRange" -import Picklist from "./Picklist" -import Pill from "./Pill" -import Pillbox from "./Pillbox" -import Popover from "./Popover" -import ProgressIndicator from "./ProgressIndicator" -import ProgressStepper from "./ProgressStepper" -import Radio from "./Radio" -import SearchField from "./SearchField" -import SecondaryNavigation from "./SecondaryNavigation" -import SegmentedControl from "./SegmentedControl" -import Segment from "./SegmentedControl/Segment" -import Select from "./Select" -import SelectionPill from "./SelectionPill" -import Slider from "./Slider" -import Splitter from "./Splitter" -import Tab from "./Tab" -import TabBar from "./TabBar" -import Table from "./Table" -import Tag from "./Tag" -import Tags from "./Tags" -import TextArea from "./TextArea" -import TextInput from "./TextInput" -import TimeEntry from "./TimeEntry" -import Toggle from "./Toggle" -import Toolbar from "./Toolbar" -import Tooltip from "./Tooltip" -import TreeList from "./TreeList" -import TypeAhead from "./TypeAhead" -import Uploader from "./Uploader" -import Widget from "./Widget" - -export { - /* PLOP_INJECT_EXPORT */ - Chunk, - Avatar, - DroppableContainer, - RepeatRenderer, - Anchor, - ListItem, - ListContainer, - Label, - Input, - Text, - ReleaseSlot, - BuilderSlot, - SlotTools, - ReleaseLayout, - BuilderLayout, - LayoutControlPanel, - Resizable, - Layout, - Slot, - LayoutCreator, - ScrollPagination, - ProgressiveBarChart, - Droppable, - Draggable, - Image, - PopoverV2, - PopoverV1, - LayoutGenerator, - WizardModal, - Wizard, - Accordion, - AdvancedColorPicker, - Alert, - ArViz, - Badge, - Breadcrumb, - BrowserIncompatibility, - BubbleChart, - BubbleViz, - Button, - Calendar, - Checkbox, - ColorPicker, - ColorSelector, - ContextMenu, - CronTab, - DateInput, - DatePicker, - DateRangePicker, - DetailsPanel, - Dialog, - Dropdown, - FacetedFilter, - FontTile, - Icon, - IconTile, - InlineMenu, - LabelValue, - LearnLink, - Link, - List, - LoadableIcon, - Loader, - LottieTile, - Mask, - Modal, - Notification, - NumericStepper, - Pagination, - Password, - PickerRange, - Picklist, - Pill, - Pillbox, - Popover, - ProgressIndicator, - ProgressStepper, - Radio, - SearchField, - SecondaryNavigation, - SegmentedControl, - Segment, - Select, - SelectionPill, - Slider, - Splitter, - Tab, - TabBar, - Table, - Tag, - Tags, - TextArea, - TextInput, - TimeEntry, - Toggle, - Toolbar, - Tooltip, - TreeList, - TypeAhead, - Uploader, - Widget, -} diff --git a/src/app/components/components.ts b/src/app/components/components.ts deleted file mode 100644 index 8d33684..0000000 --- a/src/app/components/components.ts +++ /dev/null @@ -1,3 +0,0 @@ -import "../static/styles/index.scss" - -export * from "./dependencies" diff --git a/src/app/components/dependencies.ts b/src/app/components/dependencies.ts deleted file mode 100644 index eb0dd17..0000000 --- a/src/app/components/dependencies.ts +++ /dev/null @@ -1,8 +0,0 @@ -export * from "../contexts" -export * from "../hooks" -export * from "../store" -export * from "../static" -export * from "../config" -export * from "../utils" -export * from "./atoms" -export * from "./molecules" diff --git a/src/app/components/index.ts b/src/app/components/index.ts deleted file mode 100755 index 770589e..0000000 --- a/src/app/components/index.ts +++ /dev/null @@ -1,23 +0,0 @@ -export * from "./dependencies" - -/* PLOP_INJECT_IMPORT */ -export { default as AssetSelector } from "./AssetSelector" -export { default as LottieLayers } from "./LottieLayers" -export { default as LottieEditorTools } from "./LottieEditorTools" -export { default as LottieEditor } from "./LottieEditor" -export { default as IconMergeContainer } from "./IconMergeContainer" -export { default as IconEditor } from "./IconEditor" -export { default as IconStyleSelector } from "./IconStyleSelector" -export { default as LandingContent } from "./LandingContent" -export { default as TaskList } from "./TaskList" -export { default as TaskLoginPrompt } from "./TaskLoginPrompt" -export { default as TaskViewer } from "./TaskViewer" -export { default as NamespaceInfoBox } from "./NamespaceInfoBox" -export { default as ConfigRowItem } from "./ConfigRowItem" -export { default as NamespaceOrgForm } from "./NamespaceOrgForm" -export { default as ConfigurationLoginPrompt } from "./ConfigurationLoginPrompt" -export { default as ConfigurationNoConfigPrompt } from "./ConfigurationNoConfigPrompt" -export { default as ConfigurationViewer } from "./ConfigurationViewer" -export { default as ConfigurationList } from "./ConfigurationList" -export { default as IconController } from "./IconController" -export { default as FavoritesList } from "./FavoritesList" diff --git a/src/app/components/molecules/AboutUs/AboutUs.component.scss b/src/app/components/molecules/AboutUs/AboutUs.component.scss deleted file mode 100755 index c883e87..0000000 --- a/src/app/components/molecules/AboutUs/AboutUs.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -.ar-AboutUs { - -} diff --git a/src/app/components/molecules/AboutUs/AboutUs.test.ts b/src/app/components/molecules/AboutUs/AboutUs.test.ts deleted file mode 100755 index 8ed5475..0000000 --- a/src/app/components/molecules/AboutUs/AboutUs.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import AboutUs from "./AboutUs" - -describe("AboutUs", () => { - it("renders without error", () => { - - }) -}) \ No newline at end of file diff --git a/src/app/components/molecules/AboutUs/AboutUs.tsx b/src/app/components/molecules/AboutUs/AboutUs.tsx deleted file mode 100755 index 516fe73..0000000 --- a/src/app/components/molecules/AboutUs/AboutUs.tsx +++ /dev/null @@ -1,8 +0,0 @@ -import { AboutUsProps } from "@armco/types" -import "./AboutUs.component.scss" - -const AboutUs = (props: AboutUsProps): JSX.Element => { - return
In Component AboutUs
-} - -export default AboutUs diff --git a/src/app/components/molecules/AboutUs/index.ts b/src/app/components/molecules/AboutUs/index.ts deleted file mode 100755 index d4bd779..0000000 --- a/src/app/components/molecules/AboutUs/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import AboutUs from "./AboutUs" - -export default AboutUs \ No newline at end of file diff --git a/src/app/components/molecules/AlertStackManager/AlertStackManager.component.scss b/src/app/components/molecules/AlertStackManager/AlertStackManager.component.scss deleted file mode 100755 index 4c79836..0000000 --- a/src/app/components/molecules/AlertStackManager/AlertStackManager.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -.ar-AlertStackManager { - -} diff --git a/src/app/components/molecules/AlertStackManager/AlertStackManager.test.ts b/src/app/components/molecules/AlertStackManager/AlertStackManager.test.ts deleted file mode 100755 index 11133a0..0000000 --- a/src/app/components/molecules/AlertStackManager/AlertStackManager.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import AlertStackManager from "./AlertStackManager" - -describe("AlertStackManager", () => { - it("renders without error", () => { - - }) -}) diff --git a/src/app/components/molecules/AlertStackManager/AlertStackManager.tsx b/src/app/components/molecules/AlertStackManager/AlertStackManager.tsx deleted file mode 100755 index fc69a35..0000000 --- a/src/app/components/molecules/AlertStackManager/AlertStackManager.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import "./AlertStackManager.component.scss" - -interface AlertStackManagerProps { - max?: number -} - -const AlertStackManager = (props: AlertStackManagerProps): JSX.Element => { - return ( -
In Component AlertStackManager
- ) -} - -export default AlertStackManager diff --git a/src/app/components/molecules/AlertStackManager/index.ts b/src/app/components/molecules/AlertStackManager/index.ts deleted file mode 100755 index 90d87b8..0000000 --- a/src/app/components/molecules/AlertStackManager/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import AlertStackManager from "./AlertStackManager" - -export default AlertStackManager diff --git a/src/app/components/molecules/AlphabetFilter/AlphabetFilter.component.scss b/src/app/components/molecules/AlphabetFilter/AlphabetFilter.component.scss deleted file mode 100755 index cae1c75..0000000 --- a/src/app/components/molecules/AlphabetFilter/AlphabetFilter.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -.ar-AlphabetFilter { - -} diff --git a/src/app/components/molecules/AlphabetFilter/AlphabetFilter.test.ts b/src/app/components/molecules/AlphabetFilter/AlphabetFilter.test.ts deleted file mode 100755 index 4746738..0000000 --- a/src/app/components/molecules/AlphabetFilter/AlphabetFilter.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import AlphabetFilter from "./AlphabetFilter" - -describe("AlphabetFilter", () => { - it("renders without error", () => { - - }) -}) diff --git a/src/app/components/molecules/AlphabetFilter/AlphabetFilter.tsx b/src/app/components/molecules/AlphabetFilter/AlphabetFilter.tsx deleted file mode 100755 index 3ea3ce2..0000000 --- a/src/app/components/molecules/AlphabetFilter/AlphabetFilter.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import { ArPillSizes, BasicFilterConfig } from "@armco/types" -import { SelectionPill } from "../.." -import "./AlphabetFilter.component.scss" - -interface AlphabetFilterProps { - onSelectionChanged: Function -} - -const AlphabetFilter = (props: AlphabetFilterProps): JSX.Element => { - const { onSelectionChanged } = props - const alpha = Array.from(Array(26)).map((e, i) => i + 65) - const alphabet = alpha.map((x) => String.fromCharCode(x)) - - return ( -
- -
- {alphabet.map((char) => ( - - onSelectionChanged(data, "alphabet") - } - /> - ))} -
-
- ) -} - -export default AlphabetFilter diff --git a/src/app/components/molecules/AlphabetFilter/index.ts b/src/app/components/molecules/AlphabetFilter/index.ts deleted file mode 100755 index 3e171ad..0000000 --- a/src/app/components/molecules/AlphabetFilter/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import AlphabetFilter from "./AlphabetFilter" - -export default AlphabetFilter diff --git a/src/app/components/molecules/AppAndToolsSelector/AppAndToolsSelector.component.scss b/src/app/components/molecules/AppAndToolsSelector/AppAndToolsSelector.component.scss deleted file mode 100755 index 3b8a9ff..0000000 --- a/src/app/components/molecules/AppAndToolsSelector/AppAndToolsSelector.component.scss +++ /dev/null @@ -1,24 +0,0 @@ -.ar-AppAndToolsSelector { - width: 21rem; - max-height: 70vh; - overflow: auto; - .ar-AppTile { - height: 5rem; - padding: 0.6rem; - - &:hover { - .ar-AppTile__content { - background-color: var(--ar-bg-hover); - border-radius: 0.3rem; - overflow: hidden; - - } - } - .ar-AppTile__name { - max-width: 100%; - text-overflow: ellipsis; - white-space: nowrap; - overflow: hidden; - } - } -} diff --git a/src/app/components/molecules/AppAndToolsSelector/AppAndToolsSelector.test.ts b/src/app/components/molecules/AppAndToolsSelector/AppAndToolsSelector.test.ts deleted file mode 100755 index 74a7d11..0000000 --- a/src/app/components/molecules/AppAndToolsSelector/AppAndToolsSelector.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import AppAndToolsSelector from "./AppAndToolsSelector" - -describe("AppAndToolsSelector", () => { - it("renders without error", () => { - - }) -}) diff --git a/src/app/components/molecules/AppAndToolsSelector/AppAndToolsSelector.tsx b/src/app/components/molecules/AppAndToolsSelector/AppAndToolsSelector.tsx deleted file mode 100755 index 52b6c44..0000000 --- a/src/app/components/molecules/AppAndToolsSelector/AppAndToolsSelector.tsx +++ /dev/null @@ -1,73 +0,0 @@ -import { useNavigate } from "react-router-dom" -import { - ArThemes, - ArButtonVariants, - ArSizes, - AppAndToolsSelectorProps, - AppTileProps, -} from "@armco/types" -import { Button, getCurrentTheme, LoadableIcon, useAppSelector } from "../.." -import "./AppAndToolsSelector.component.scss" - -const AppTile = (props: AppTileProps) => { - const { classes, label, icon, url, theme } = props - const navigate = useNavigate() - return ( -
navigate(url || "/")} - > -
- - {label} -
-
- ) -} - -const AppAndToolsSelector = (props: AppAndToolsSelectorProps): JSX.Element => { - const { data } = props - const theme = useAppSelector(getCurrentTheme) - return ( -
-
- {data.map((category, index) => { - const items = category.items - return ( -
- - {category.label as string} - -
- {items?.map((item, indexInner) => ( - - ))} -
-
- ) - })} -
-
- ) -} - -export default AppAndToolsSelector diff --git a/src/app/components/molecules/AppAndToolsSelector/index.ts b/src/app/components/molecules/AppAndToolsSelector/index.ts deleted file mode 100755 index 1438656..0000000 --- a/src/app/components/molecules/AppAndToolsSelector/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import AppAndToolsSelector from "./AppAndToolsSelector" - -export default AppAndToolsSelector diff --git a/src/app/components/molecules/Application/Application.component.scss b/src/app/components/molecules/Application/Application.component.scss deleted file mode 100755 index f49f755..0000000 --- a/src/app/components/molecules/Application/Application.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -.ar-Application { - -} diff --git a/src/app/components/molecules/Application/Application.test.ts b/src/app/components/molecules/Application/Application.test.ts deleted file mode 100755 index 8f58cfa..0000000 --- a/src/app/components/molecules/Application/Application.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import Application from "./Application" - -describe("Application", () => { - it("renders without error", () => { - - }) -}) \ No newline at end of file diff --git a/src/app/components/molecules/Application/Application.tsx b/src/app/components/molecules/Application/Application.tsx deleted file mode 100755 index 4f5aed0..0000000 --- a/src/app/components/molecules/Application/Application.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import React from "react" -import "./Application.component.scss" - -interface ApplicationProps {} - -const Application = (props: any): JSX.Element => { - return ( -
- In Component Application -
- ) -} - -export default Application \ No newline at end of file diff --git a/src/app/components/molecules/Application/index.ts b/src/app/components/molecules/Application/index.ts deleted file mode 100755 index 65984f1..0000000 --- a/src/app/components/molecules/Application/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import Application from "./Application" - -export default Application diff --git a/src/app/components/molecules/ArIconsViewer/ArIconsViewer.component.scss b/src/app/components/molecules/ArIconsViewer/ArIconsViewer.component.scss deleted file mode 100755 index 34c825f..0000000 --- a/src/app/components/molecules/ArIconsViewer/ArIconsViewer.component.scss +++ /dev/null @@ -1,25 +0,0 @@ -.ar-ArIconsViewer { - grid-template-columns: minmax(10rem, 1fr); - - .ar-ScrollPagination__items-container.compact, .ar-ScrollPagination__items-container.comfy { - .ar-ArIconsViewer__icon-container:hover { - background-color: var(--ar-bg-hover); - } - } - .ar-ScrollPagination__items-container.compact { - grid-template-columns: repeat(auto-fill, minmax(3rem, 1fr)) !important; - gap: 1rem !important; - grid-auto-rows: minmax(3rem, auto) !important; - } - - .ar-ScrollPagination__items-container.list { - grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)) !important; - grid-auto-rows: 2.5rem !important; - gap: 1rem !important; - .ar-ArIconsViewer__label { - text-overflow: ellipsis; - white-space: nowrap; - overflow: hidden; - } - } -} diff --git a/src/app/components/molecules/ArIconsViewer/ArIconsViewer.test.ts b/src/app/components/molecules/ArIconsViewer/ArIconsViewer.test.ts deleted file mode 100755 index e3866ff..0000000 --- a/src/app/components/molecules/ArIconsViewer/ArIconsViewer.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import ArIconsViewer from "./ArIconsViewer" - -describe("ArIconsViewer", () => { - it("renders without error", () => { - - }) -}) diff --git a/src/app/components/molecules/ArIconsViewer/ArIconsViewer.tsx b/src/app/components/molecules/ArIconsViewer/ArIconsViewer.tsx deleted file mode 100755 index e71f361..0000000 --- a/src/app/components/molecules/ArIconsViewer/ArIconsViewer.tsx +++ /dev/null @@ -1,164 +0,0 @@ -import { ChangeEvent, useEffect, useState } from "react" -import { - ArDndItemTypes, - ArIconTileTypes, - ArIconsViewerProps, - ArPopoverSlots, - ArThemes, - SegmentData, - IconResponse, -} from "@armco/types" -import { - API_CONFIG, - ENDPOINTS, - getCurrentTheme, - LoadableIcon, - ScrollPagination, - SearchField, - SegmentedControl, - useAppSelector, - Helper, - Draggable, - Tooltip, -} from "../.." -import "./ArIconsViewer.component.scss" - -const pageApi = - API_CONFIG.STATIC_HOST[process.env.NODE_ENV] + - ENDPOINTS.STATIC.ICON.ROOT + - ENDPOINTS.STATIC.ICON.PAGE - -const compactionStyles = [ - { - name: "comfy", - icon: "md/MdViewComfy", - tooltip: "View Comfortable", - }, - { - name: "compact", - icon: "md/MdViewCompact", - tooltip: "View Compact", - }, - { - name: "list", - icon: "io5/IoList", - tooltip: "Quick Peak", - }, -] - -const ArIconsViewer = (props: ArIconsViewerProps): JSX.Element => { - const { - demo, - view: externalView, - hasSearch, - hasViewSelector, - isDraggable, - } = props - const [view, setView] = useState(compactionStyles[0]) - const [searchText, setSearchText] = useState() - const theme = useAppSelector(getCurrentTheme) - - useEffect(() => { - if (externalView) { - const foundView = compactionStyles.find( - (v) => v.name === externalView.name, - ) - foundView && setView(foundView) - } - }, [externalView]) - - const getItem = (icon: IconResponse) => ( - - - {view.name === ArIconTileTypes.LIST && ( - - {icon.name} - - )} - - ) - - return ( -
- {(hasSearch || hasViewSelector) && ( -
- {hasSearch && ( - ) => - setSearchText(event.target.value), - 1000, - )} - items={[]} - hidePopup - /> - )} - {hasViewSelector && ( - setView(view as SegmentData)} - demo={demo} - /> - )} -
- )} -
- { - const { icon } = props - let item = getItem(icon) - item = isDraggable ? ( - - {item} - - ) : ( - item - ) - item = - view.name !== ArIconTileTypes.LIST ? ( - - {item} - {icon.name} - - ) : ( - item - ) - return item - }} - filters={searchText !== undefined ? { search: searchText } : {}} - demo={demo} - gridClasses={view.name} - /> -
-
- ) -} - -export default ArIconsViewer diff --git a/src/app/components/molecules/ArIconsViewer/index.ts b/src/app/components/molecules/ArIconsViewer/index.ts deleted file mode 100755 index d31879f..0000000 --- a/src/app/components/molecules/ArIconsViewer/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import ArIconsViewer from "./ArIconsViewer" - -export default ArIconsViewer diff --git a/src/app/components/molecules/ArmcoIamProvider/ArmcoIamProvider.component.scss b/src/app/components/molecules/ArmcoIamProvider/ArmcoIamProvider.component.scss deleted file mode 100755 index 9f28dab..0000000 --- a/src/app/components/molecules/ArmcoIamProvider/ArmcoIamProvider.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -.ar-ArmcoIamProvider { - -} diff --git a/src/app/components/molecules/ArmcoIamProvider/ArmcoIamProvider.test.ts b/src/app/components/molecules/ArmcoIamProvider/ArmcoIamProvider.test.ts deleted file mode 100755 index ae3994b..0000000 --- a/src/app/components/molecules/ArmcoIamProvider/ArmcoIamProvider.test.ts +++ /dev/null @@ -1,6 +0,0 @@ -import React from "react" -import ArmcoIamProvider from "./ArmcoIamProvider" - -describe("ArmcoIamProvider", () => { - it("renders without error", () => {}) -}) diff --git a/src/app/components/molecules/ArmcoIamProvider/ArmcoIamProvider.tsx b/src/app/components/molecules/ArmcoIamProvider/ArmcoIamProvider.tsx deleted file mode 100755 index 93c71b4..0000000 --- a/src/app/components/molecules/ArmcoIamProvider/ArmcoIamProvider.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import { ArmcoIamProviderProps, ArDefaultLoginPage } from "@armco/types" -import { WEB_CONFIG, LoginProvider } from "../.." -import "./ArmcoIamProvider.component.scss" - -const ArmcoIamProvider = (props: ArmcoIamProviderProps): JSX.Element => { - const { defaultPage } = props - return ( - - ) -} - -export default ArmcoIamProvider diff --git a/src/app/components/molecules/ArmcoIamProvider/index.ts b/src/app/components/molecules/ArmcoIamProvider/index.ts deleted file mode 100755 index 18d9572..0000000 --- a/src/app/components/molecules/ArmcoIamProvider/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import ArmcoIamProvider from "./ArmcoIamProvider" - -export default ArmcoIamProvider diff --git a/src/app/components/molecules/Banner/Banner.component.scss b/src/app/components/molecules/Banner/Banner.component.scss deleted file mode 100755 index 3c4a4f7..0000000 --- a/src/app/components/molecules/Banner/Banner.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -.ar-Banner { - -} diff --git a/src/app/components/molecules/Banner/Banner.test.ts b/src/app/components/molecules/Banner/Banner.test.ts deleted file mode 100755 index 579cbae..0000000 --- a/src/app/components/molecules/Banner/Banner.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import Banner from "./Banner" - -describe("Banner", () => { - it("renders without error", () => { - - }) -}) \ No newline at end of file diff --git a/src/app/components/molecules/Banner/Banner.tsx b/src/app/components/molecules/Banner/Banner.tsx deleted file mode 100755 index cdb352f..0000000 --- a/src/app/components/molecules/Banner/Banner.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import React from "react" -import "./Banner.component.scss" - -interface BannerProps {} - -const Banner = (props: any): JSX.Element => { - return ( -
- In Component Banner -
- ) -} - -export default Banner \ No newline at end of file diff --git a/src/app/components/molecules/Banner/index.ts b/src/app/components/molecules/Banner/index.ts deleted file mode 100755 index 21080f3..0000000 --- a/src/app/components/molecules/Banner/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import Banner from "./Banner" - -export default Banner diff --git a/src/app/components/molecules/Benefits/Benefits.component.scss b/src/app/components/molecules/Benefits/Benefits.component.scss deleted file mode 100755 index e152922..0000000 --- a/src/app/components/molecules/Benefits/Benefits.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -.ar-Benefits { - -} diff --git a/src/app/components/molecules/Benefits/Benefits.test.ts b/src/app/components/molecules/Benefits/Benefits.test.ts deleted file mode 100755 index b16debc..0000000 --- a/src/app/components/molecules/Benefits/Benefits.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import Benefits from "./Benefits" - -describe("Benefits", () => { - it("renders without error", () => { - - }) -}) \ No newline at end of file diff --git a/src/app/components/molecules/Benefits/Benefits.tsx b/src/app/components/molecules/Benefits/Benefits.tsx deleted file mode 100755 index 3ba5494..0000000 --- a/src/app/components/molecules/Benefits/Benefits.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import React from "react" -import "./Benefits.component.scss" - -interface BenefitsProps {} - -const Benefits = (props: any): JSX.Element => { - return ( -
- In Component Benefits -
- ) -} - -export default Benefits \ No newline at end of file diff --git a/src/app/components/molecules/Benefits/index.ts b/src/app/components/molecules/Benefits/index.ts deleted file mode 100755 index 8e1346c..0000000 --- a/src/app/components/molecules/Benefits/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import Benefits from "./Benefits" - -export default Benefits \ No newline at end of file diff --git a/src/app/components/molecules/Blog/Blog.component.scss b/src/app/components/molecules/Blog/Blog.component.scss deleted file mode 100755 index cda0603..0000000 --- a/src/app/components/molecules/Blog/Blog.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -.ar-Blog { - -} diff --git a/src/app/components/molecules/Blog/Blog.test.ts b/src/app/components/molecules/Blog/Blog.test.ts deleted file mode 100755 index e8f0df2..0000000 --- a/src/app/components/molecules/Blog/Blog.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import Blog from "./Blog" - -describe("Blog", () => { - it("renders without error", () => { - - }) -}) \ No newline at end of file diff --git a/src/app/components/molecules/Blog/Blog.tsx b/src/app/components/molecules/Blog/Blog.tsx deleted file mode 100755 index c220b21..0000000 --- a/src/app/components/molecules/Blog/Blog.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import React from "react" -import "./Blog.component.scss" - -interface BlogProps {} - -const Blog = (props: any): JSX.Element => { - return ( -
- In Component Blog -
- ) -} - -export default Blog \ No newline at end of file diff --git a/src/app/components/molecules/Blog/index.ts b/src/app/components/molecules/Blog/index.ts deleted file mode 100755 index 1426661..0000000 --- a/src/app/components/molecules/Blog/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import Blog from "./Blog" - -export default Blog diff --git a/src/app/components/molecules/Brands/Brands.component.scss b/src/app/components/molecules/Brands/Brands.component.scss deleted file mode 100755 index fb5b004..0000000 --- a/src/app/components/molecules/Brands/Brands.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -.ar-Brands { - -} diff --git a/src/app/components/molecules/Brands/Brands.test.ts b/src/app/components/molecules/Brands/Brands.test.ts deleted file mode 100755 index f739c70..0000000 --- a/src/app/components/molecules/Brands/Brands.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import Brands from "./Brands" - -describe("Brands", () => { - it("renders without error", () => { - - }) -}) \ No newline at end of file diff --git a/src/app/components/molecules/Brands/Brands.tsx b/src/app/components/molecules/Brands/Brands.tsx deleted file mode 100755 index 3fb3ec9..0000000 --- a/src/app/components/molecules/Brands/Brands.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import React from "react" -import "./Brands.component.scss" - -interface BrandsProps {} - -const Brands = (props: any): JSX.Element => { - return ( -
- In Component Brands -
- ) -} - -export default Brands \ No newline at end of file diff --git a/src/app/components/molecules/Brands/index.ts b/src/app/components/molecules/Brands/index.ts deleted file mode 100755 index f9036fe..0000000 --- a/src/app/components/molecules/Brands/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import Brands from "./Brands" - -export default Brands diff --git a/src/app/components/molecules/Breadcrumbs/Breadcrumbs.component.scss b/src/app/components/molecules/Breadcrumbs/Breadcrumbs.component.scss deleted file mode 100755 index d68b991..0000000 --- a/src/app/components/molecules/Breadcrumbs/Breadcrumbs.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -.ar-Breadcrumbs { - -} diff --git a/src/app/components/molecules/Breadcrumbs/Breadcrumbs.test.ts b/src/app/components/molecules/Breadcrumbs/Breadcrumbs.test.ts deleted file mode 100755 index 419fe56..0000000 --- a/src/app/components/molecules/Breadcrumbs/Breadcrumbs.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import Breadcrumbs from "./Breadcrumbs" - -describe("Breadcrumbs", () => { - it("renders without error", () => { - - }) -}) \ No newline at end of file diff --git a/src/app/components/molecules/Breadcrumbs/Breadcrumbs.tsx b/src/app/components/molecules/Breadcrumbs/Breadcrumbs.tsx deleted file mode 100755 index 4eab533..0000000 --- a/src/app/components/molecules/Breadcrumbs/Breadcrumbs.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import React from "react" -import "./Breadcrumbs.component.scss" - -interface BreadcrumbsProps {} - -const Breadcrumbs = (props: any): JSX.Element => { - return ( -
- In Component Breadcrumbs -
- ) -} - -export default Breadcrumbs \ No newline at end of file diff --git a/src/app/components/molecules/Breadcrumbs/index.ts b/src/app/components/molecules/Breadcrumbs/index.ts deleted file mode 100755 index 51d135e..0000000 --- a/src/app/components/molecules/Breadcrumbs/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import Breadcrumbs from "./Breadcrumbs" - -export default Breadcrumbs diff --git a/src/app/components/molecules/Card/Card.component.scss b/src/app/components/molecules/Card/Card.component.scss deleted file mode 100755 index 5d23f46..0000000 --- a/src/app/components/molecules/Card/Card.component.scss +++ /dev/null @@ -1,4 +0,0 @@ -.ar-Card { - background-color: var(--ar-bg); - border-radius: 3px; -} diff --git a/src/app/components/molecules/Card/Card.test.ts b/src/app/components/molecules/Card/Card.test.ts deleted file mode 100755 index 3dad5a5..0000000 --- a/src/app/components/molecules/Card/Card.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import Card from "./Card" - -describe("Card", () => { - it("renders without error", () => { - - }) -}) \ No newline at end of file diff --git a/src/app/components/molecules/Card/Card.tsx b/src/app/components/molecules/Card/Card.tsx deleted file mode 100755 index 9633dee..0000000 --- a/src/app/components/molecules/Card/Card.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import { CardProps } from "@armco/types" -import "./Card.component.scss" - -const Card = (props: CardProps): JSX.Element => { - const { children, classes, header } = props - return ( -
- {header && ( -
{header}
- )} -
{children}
-
- ) -} - -export default Card diff --git a/src/app/components/molecules/Card/index.ts b/src/app/components/molecules/Card/index.ts deleted file mode 100755 index c15bb2c..0000000 --- a/src/app/components/molecules/Card/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import Card from "./Card" - -export default Card \ No newline at end of file diff --git a/src/app/components/molecules/Careers/Careers.component.scss b/src/app/components/molecules/Careers/Careers.component.scss deleted file mode 100755 index 9f425e9..0000000 --- a/src/app/components/molecules/Careers/Careers.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -.ar-Careers { - -} diff --git a/src/app/components/molecules/Careers/Careers.test.ts b/src/app/components/molecules/Careers/Careers.test.ts deleted file mode 100755 index c483cf5..0000000 --- a/src/app/components/molecules/Careers/Careers.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import Careers from "./Careers" - -describe("Careers", () => { - it("renders without error", () => { - - }) -}) \ No newline at end of file diff --git a/src/app/components/molecules/Careers/Careers.tsx b/src/app/components/molecules/Careers/Careers.tsx deleted file mode 100755 index 04bc05d..0000000 --- a/src/app/components/molecules/Careers/Careers.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import React from "react" -import "./Careers.component.scss" - -interface CareersProps {} - -const Careers = (props: any): JSX.Element => { - return ( -
- In Component Careers -
- ) -} - -export default Careers \ No newline at end of file diff --git a/src/app/components/molecules/Careers/index.ts b/src/app/components/molecules/Careers/index.ts deleted file mode 100755 index 6f55a9e..0000000 --- a/src/app/components/molecules/Careers/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import Careers from "./Careers" - -export default Careers diff --git a/src/app/components/molecules/Carousel/Carousel.component.scss b/src/app/components/molecules/Carousel/Carousel.component.scss deleted file mode 100755 index 3c02c91..0000000 --- a/src/app/components/molecules/Carousel/Carousel.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -.ar-Carousel { - -} diff --git a/src/app/components/molecules/Carousel/Carousel.test.ts b/src/app/components/molecules/Carousel/Carousel.test.ts deleted file mode 100755 index a2e327d..0000000 --- a/src/app/components/molecules/Carousel/Carousel.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import Carousel from "./Carousel" - -describe("Carousel", () => { - it("renders without error", () => { - - }) -}) diff --git a/src/app/components/molecules/Carousel/Carousel.tsx b/src/app/components/molecules/Carousel/Carousel.tsx deleted file mode 100755 index 6c59940..0000000 --- a/src/app/components/molecules/Carousel/Carousel.tsx +++ /dev/null @@ -1,906 +0,0 @@ -import { Children, Component, ReactNode } from "react" -import { AnimationHandler, CarouselProps, SwiperProps } from "@armco/types" -import klass from "./cssClasses" -import Thumbs from "./Thumbs" -import { - slideAnimationHandler, - slideSwipeAnimationHandler, - slideStopSwipingHandler, - fadeAnimationHandler, -} from "./animations" -import { DomHelper, Swiper } from "../.." -import "./Carousel.component.scss" - -export interface CarouselState { - autoPlay?: boolean - cancelClick: boolean - hasMount: boolean - initialized: boolean - isMouseEntered: boolean - itemSize: number - previousItem: number - selectedItem: number - swiping?: boolean - swipeMovementStarted: boolean - itemListStyle?: React.CSSProperties - slideStyle?: React.CSSProperties - selectedStyle?: React.CSSProperties - prevStyle?: React.CSSProperties -} - -export const noop = () => {} - -export const defaultStatusFormatter = (current: number, total: number) => - `${current} of ${total}` - -export default class Carousel extends Component { - private thumbsRef?: Thumbs - private carouselWrapperRef?: HTMLDivElement - // @ts-ignore - private listRef?: HTMLElement | HTMLUListElement - private itemsRef?: HTMLElement[] - private timer?: ReturnType - private animationHandler: AnimationHandler - - static displayName = "Carousel" - - static defaultProps: CarouselProps = { - ariaLabel: undefined, - axis: "horizontal", - centerSlidePercentage: 80, - interval: 3000, - labels: { - leftArrow: "previous slide / item", - rightArrow: "next slide / item", - item: "slide item", - }, - onClickItem: noop, - onClickThumb: noop, - onChange: noop, - onSwipeStart: () => {}, - onSwipeEnd: () => {}, - onSwipeMove: () => false, - preventMovementUntilSwipeScrollTolerance: false, - renderArrowPrev: ( - onClickHandler: () => void, - hasPrev: boolean, - label: string, - ) => ( -
-
- ) - } -} diff --git a/src/app/components/molecules/Carousel/animations.ts b/src/app/components/molecules/Carousel/animations.ts deleted file mode 100644 index 6dbb007..0000000 --- a/src/app/components/molecules/Carousel/animations.ts +++ /dev/null @@ -1,216 +0,0 @@ -import { Children } from "react" -import { - AnimationHandler, - StopSwipingHandler, - SwipeAnimationHandler, - AnimationHandlerResponse, -} from "@armco/types" -import { DomHelper } from "../.." - -/** - * Main animation handler for the default 'sliding' style animation - * @param props - * @param state - */ -export const slideAnimationHandler: AnimationHandler = ( - props, - state, -): AnimationHandlerResponse => { - const returnStyles: AnimationHandlerResponse = {} - const { selectedItem } = state - const previousItem = selectedItem - const lastPosition = Children.count(props.children) - 1 - const needClonedSlide = - props.infiniteLoop && (selectedItem < 0 || selectedItem > lastPosition) - - // Handle list position if it needs a clone - if (needClonedSlide) { - if (previousItem < 0) { - if ( - props.centerMode && - props.centerSlidePercentage && - props.axis === "horizontal" - ) { - returnStyles.itemListStyle = DomHelper.setPosition( - -(lastPosition + 2) * props.centerSlidePercentage - - (100 - props.centerSlidePercentage) / 2, - props.axis, - ) - } else { - returnStyles.itemListStyle = DomHelper.setPosition( - -(lastPosition + 2) * 100, - props.axis, - ) - } - } else if (previousItem > lastPosition) { - returnStyles.itemListStyle = DomHelper.setPosition(0, props.axis) - } - - return returnStyles - } - - const currentPosition = DomHelper.getPosition(selectedItem, props) - - // if 3d is available, let's take advantage of the performance of transform - const transformProp = DomHelper.translate(currentPosition, "%", props.axis) - - const transitionTime = props.transitionTime + "ms" - - returnStyles.itemListStyle = { - WebkitTransform: transformProp, - msTransform: transformProp, - OTransform: transformProp, - transform: transformProp, - } - - if (!state.swiping) { - returnStyles.itemListStyle = { - ...returnStyles.itemListStyle, - WebkitTransitionDuration: transitionTime, - MozTransitionDuration: transitionTime, - OTransitionDuration: transitionTime, - transitionDuration: transitionTime, - msTransitionDuration: transitionTime, - } - } - - return returnStyles -} - -/** - * Swiping animation handler for the default 'sliding' style animation - * @param delta - * @param props - * @param state - * @param setState - */ -export const slideSwipeAnimationHandler: SwipeAnimationHandler = ( - delta, - props, - state, - setState, -): AnimationHandlerResponse => { - const returnStyles: AnimationHandlerResponse = {} - const isHorizontal = props.axis === "horizontal" - const childrenLength = Children.count(props.children) - - const initialBoundry = 0 - - const currentPosition = DomHelper.getPosition(state.selectedItem, props) - const finalBoundry = props.infiniteLoop - ? DomHelper.getPosition(childrenLength - 1, props) - 100 - : DomHelper.getPosition(childrenLength - 1, props) - - const axisDelta = isHorizontal ? delta.x : delta.y - let handledDelta = axisDelta - - // prevent user from swiping left out of boundaries - if (currentPosition === initialBoundry && axisDelta > 0) { - handledDelta = 0 - } - - // prevent user from swiping right out of boundaries - if (currentPosition === finalBoundry && axisDelta < 0) { - handledDelta = 0 - } - - let position = currentPosition + 100 / (state.itemSize / handledDelta) - const hasMoved = Math.abs(axisDelta) > props.swipeScrollTolerance - - if (props.infiniteLoop && hasMoved) { - // When allowing infinite loop, if we slide left from position 0 we reveal the cloned last slide that appears before it - // if we slide even further we need to jump to other side so it can continue - and vice versa for the last slide - if (state.selectedItem === 0 && position > -100) { - position -= childrenLength * 100 - } else if ( - state.selectedItem === childrenLength - 1 && - position < -childrenLength * 100 - ) { - position += childrenLength * 100 - } - } - - if ( - !props.preventMovementUntilSwipeScrollTolerance || - hasMoved || - state.swipeMovementStarted - ) { - if (!state.swipeMovementStarted) { - setState({ swipeMovementStarted: true }) - } - - returnStyles.itemListStyle = DomHelper.setPosition(position, props.axis) - } - - //allows scroll if the swipe was within the tolerance - if (hasMoved && !state.cancelClick) { - setState({ - cancelClick: true, - }) - } - return returnStyles -} - -/** - * Default 'sliding' style animination handler for when a swipe action stops. - * @param props - * @param state - */ -export const slideStopSwipingHandler: StopSwipingHandler = ( - props, - state, -): AnimationHandlerResponse => { - const currentPosition = DomHelper.getPosition(state.selectedItem, props) - const itemListStyle = DomHelper.setPosition(currentPosition, props.axis) - - return { - itemListStyle, - } -} - -/** - * Main animation handler for the default 'fade' style animation - * @param props - * @param state - */ -export const fadeAnimationHandler: AnimationHandler = ( - props, - state, -): AnimationHandlerResponse => { - const transitionTime = props.transitionTime + "ms" - const transitionTimingFunction = "ease-in-out" - - let slideStyle: React.CSSProperties = { - position: "absolute", - display: "block", - zIndex: -2, - minHeight: "100%", - opacity: 0, - top: 0, - right: 0, - left: 0, - bottom: 0, - transitionTimingFunction: transitionTimingFunction, - msTransitionTimingFunction: transitionTimingFunction, - MozTransitionTimingFunction: transitionTimingFunction, - WebkitTransitionTimingFunction: transitionTimingFunction, - OTransitionTimingFunction: transitionTimingFunction, - } - - if (!state.swiping) { - slideStyle = { - ...slideStyle, - WebkitTransitionDuration: transitionTime, - MozTransitionDuration: transitionTime, - OTransitionDuration: transitionTime, - transitionDuration: transitionTime, - msTransitionDuration: transitionTime, - } - } - - return { - slideStyle, - selectedStyle: { ...slideStyle, opacity: 1, position: "relative" }, - prevStyle: { ...slideStyle }, - } -} diff --git a/src/app/components/molecules/Carousel/cssClasses.ts b/src/app/components/molecules/Carousel/cssClasses.ts deleted file mode 100644 index f45cc66..0000000 --- a/src/app/components/molecules/Carousel/cssClasses.ts +++ /dev/null @@ -1,58 +0,0 @@ -import classNames from "classnames" - -const klass = { - ROOT: (customClassName?: string) => - classNames({ - "carousel-root": true, - [customClassName || ""]: !!customClassName, - }), - - CAROUSEL: (isSlider?: boolean) => - classNames({ - carousel: true, - "carousel-slider": isSlider, - }), - - WRAPPER: (isSlider: boolean, axis?: "horizontal" | "vertical") => - classNames({ - "thumbs-wrapper": !isSlider, - "slider-wrapper": isSlider, - "axis-horizontal": axis === "horizontal", - "axis-vertical": axis !== "horizontal", - }), - - SLIDER: (isSlider: boolean, isSwiping?: boolean) => - classNames({ - thumbs: !isSlider, - slider: isSlider, - animated: !isSwiping, - }), - - ITEM: (isSlider: boolean, selected: boolean, previous?: boolean) => - classNames({ - thumb: !isSlider, - slide: isSlider, - selected: selected, - previous: previous, - }), - - ARROW_PREV: (disabled?: boolean) => - classNames({ - "control-arrow control-prev": true, - "control-disabled": disabled, - }), - - ARROW_NEXT: (disabled?: boolean) => - classNames({ - "control-arrow control-next": true, - "control-disabled": disabled, - }), - - DOT: (selected?: boolean) => - classNames({ - dot: true, - selected: selected, - }), -} - -export default klass diff --git a/src/app/components/molecules/Carousel/index.ts b/src/app/components/molecules/Carousel/index.ts deleted file mode 100755 index 0c1a8f7..0000000 --- a/src/app/components/molecules/Carousel/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import Carousel from "./Carousel" - -export default Carousel diff --git a/src/app/components/molecules/CategoryFilter/CategoryFilter.component.scss b/src/app/components/molecules/CategoryFilter/CategoryFilter.component.scss deleted file mode 100755 index 074293d..0000000 --- a/src/app/components/molecules/CategoryFilter/CategoryFilter.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -.ar-CategoryFilter { - -} diff --git a/src/app/components/molecules/CategoryFilter/CategoryFilter.test.ts b/src/app/components/molecules/CategoryFilter/CategoryFilter.test.ts deleted file mode 100755 index f56398a..0000000 --- a/src/app/components/molecules/CategoryFilter/CategoryFilter.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import CategoryFilter from "./CategoryFilter" - -describe("CategoryFilter", () => { - it("renders without error", () => { - - }) -}) diff --git a/src/app/components/molecules/CategoryFilter/CategoryFilter.tsx b/src/app/components/molecules/CategoryFilter/CategoryFilter.tsx deleted file mode 100755 index 4995526..0000000 --- a/src/app/components/molecules/CategoryFilter/CategoryFilter.tsx +++ /dev/null @@ -1,79 +0,0 @@ -import { ArPillSizes, BasicFilterConfig, BasicFilterType } from "@armco/types" -import { Helper, SelectionPill } from "../.." -import "./CategoryFilter.component.scss" - -interface CategoryFilterProps { - categoryGroups: { [key: string]: { [key: string]: Array } } - currentCategoryFilters?: { [key: string]: Array } - onFilterChange: Function -} - -const CategoryFilter = (props: CategoryFilterProps): JSX.Element => { - const { categoryGroups, currentCategoryFilters, onFilterChange } = props - - const onCategorySelection = ( - data: BasicFilterConfig, - categoryType: string, - ) => { - let filters = currentCategoryFilters - if (!filters) { - filters = {} - } - let groupCategories = filters[ - categoryType as keyof BasicFilterType - ] as BasicFilterConfig[] - let selectedItemIndex = -1 - if (!groupCategories) { - groupCategories = [] - filters[categoryType as keyof BasicFilterType] = groupCategories - } else { - selectedItemIndex = groupCategories?.findIndex( - (category) => category.value === data.value, - ) - } - if (selectedItemIndex === -1) { - groupCategories.push(data) - } else { - groupCategories.splice(selectedItemIndex, 1) - } - onFilterChange(filters, "categories") - } - - const categoryRenders = ( - categories: { [key: string]: Array } | undefined, - group: string, - ) => { - return ( - categories && ( -
- {Object.keys(categories).map((category) => ( - - onCategorySelection(data, group) - } - /> - ))} -
- ) - ) - } - const groupRenders = Object.keys(categoryGroups).map((group: string) => { - return ( -
- -
- {categoryRenders(categoryGroups[group], group)} -
-
- ) - }) - - return
{groupRenders}
-} - -export default CategoryFilter diff --git a/src/app/components/molecules/CategoryFilter/index.ts b/src/app/components/molecules/CategoryFilter/index.ts deleted file mode 100755 index 3766d24..0000000 --- a/src/app/components/molecules/CategoryFilter/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import CategoryFilter from "./CategoryFilter" - -export default CategoryFilter diff --git a/src/app/components/molecules/Component_404/Component_404.component.scss b/src/app/components/molecules/Component_404/Component_404.component.scss deleted file mode 100755 index 8997e16..0000000 --- a/src/app/components/molecules/Component_404/Component_404.component.scss +++ /dev/null @@ -1,13 +0,0 @@ -.ar-Component_404 { - .ar-Component_404-content { - height: 30rem; - min-width: 30rem; - font-size: 0.8rem; - border: var(--ar-border); - background-color: var(--ar-bg-base); - transition: box-shadow 0.3s; - &:hover { - box-shadow: 0px 4px 8px var(--ar-shadow); - } - } -} diff --git a/src/app/components/molecules/Component_404/Component_404.test.ts b/src/app/components/molecules/Component_404/Component_404.test.ts deleted file mode 100755 index e2279db..0000000 --- a/src/app/components/molecules/Component_404/Component_404.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import Component_404 from "./Component_404" - -describe("Component_404", () => { - it("renders without error", () => { - - }) -}) diff --git a/src/app/components/molecules/Component_404/Component_404.tsx b/src/app/components/molecules/Component_404/Component_404.tsx deleted file mode 100755 index a00ff16..0000000 --- a/src/app/components/molecules/Component_404/Component_404.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import { Component_404Props } from "@armco/types" -import { Icon } from "../.." -import "./Component_404.component.scss" - -const Component_404 = (props: Component_404Props): JSX.Element => { - const { iconSize } = props - return ( -
-
- -
Could not dig what you asked for
-

Please check the URL and try again.

-

- You may also use the tabs (right-top) to navigate if you're not sure - about the URL -

-
-
- ) -} - -export default Component_404 diff --git a/src/app/components/molecules/Component_404/index.ts b/src/app/components/molecules/Component_404/index.ts deleted file mode 100755 index 6648eae..0000000 --- a/src/app/components/molecules/Component_404/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import Component_404 from "./Component_404" - -export default Component_404 diff --git a/src/app/components/molecules/Contact/Contact.component.scss b/src/app/components/molecules/Contact/Contact.component.scss deleted file mode 100755 index 6db1f2d..0000000 --- a/src/app/components/molecules/Contact/Contact.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -.ar-Contact { - -} diff --git a/src/app/components/molecules/Contact/Contact.test.ts b/src/app/components/molecules/Contact/Contact.test.ts deleted file mode 100755 index 8adb96a..0000000 --- a/src/app/components/molecules/Contact/Contact.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import Contact from "./Contact" - -describe("Contact", () => { - it("renders without error", () => { - - }) -}) \ No newline at end of file diff --git a/src/app/components/molecules/Contact/Contact.tsx b/src/app/components/molecules/Contact/Contact.tsx deleted file mode 100755 index ce83b62..0000000 --- a/src/app/components/molecules/Contact/Contact.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import React from "react" -import "./Contact.component.scss" - -interface ContactProps {} - -const Contact = (props: any): JSX.Element => { - return ( -
- In Component Contact -
- ) -} - -export default Contact \ No newline at end of file diff --git a/src/app/components/molecules/Contact/index.ts b/src/app/components/molecules/Contact/index.ts deleted file mode 100755 index 61f8508..0000000 --- a/src/app/components/molecules/Contact/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import Contact from "./Contact" - -export default Contact \ No newline at end of file diff --git a/src/app/components/molecules/Content/Content.component.scss b/src/app/components/molecules/Content/Content.component.scss deleted file mode 100755 index 49fc008..0000000 --- a/src/app/components/molecules/Content/Content.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -.ar-Content { - background-color: var(--ar-bg-secondary); -} diff --git a/src/app/components/molecules/Content/Content.test.ts b/src/app/components/molecules/Content/Content.test.ts deleted file mode 100755 index 23ead5c..0000000 --- a/src/app/components/molecules/Content/Content.test.ts +++ /dev/null @@ -1,6 +0,0 @@ -import React from "react" -import Content from "./Content" - -describe("Content", () => { - it("renders without error", () => {}) -}) diff --git a/src/app/components/molecules/Content/Content.tsx b/src/app/components/molecules/Content/Content.tsx deleted file mode 100755 index e18524d..0000000 --- a/src/app/components/molecules/Content/Content.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import { ReactNode } from "react" -import "./Content.component.scss" - -interface ContentProps { - children?: ReactNode - classes?: string -} - -const Content = (props: ContentProps): JSX.Element => { - const { children, classes } = props - return ( -
- {children} -
- ) -} - -export default Content diff --git a/src/app/components/molecules/Content/index.ts b/src/app/components/molecules/Content/index.ts deleted file mode 100755 index 6fc6e12..0000000 --- a/src/app/components/molecules/Content/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import Content from "./Content" - -export default Content diff --git a/src/app/components/molecules/Cookies/Cookies.component.scss b/src/app/components/molecules/Cookies/Cookies.component.scss deleted file mode 100755 index 9e88a02..0000000 --- a/src/app/components/molecules/Cookies/Cookies.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -.ar-Cookies { - -} diff --git a/src/app/components/molecules/Cookies/Cookies.test.ts b/src/app/components/molecules/Cookies/Cookies.test.ts deleted file mode 100755 index 540977e..0000000 --- a/src/app/components/molecules/Cookies/Cookies.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import Cookies from "./Cookies" - -describe("Cookies", () => { - it("renders without error", () => { - - }) -}) \ No newline at end of file diff --git a/src/app/components/molecules/Cookies/Cookies.tsx b/src/app/components/molecules/Cookies/Cookies.tsx deleted file mode 100755 index 6a1cf9d..0000000 --- a/src/app/components/molecules/Cookies/Cookies.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import React from "react" -import "./Cookies.component.scss" - -interface CookiesProps {} - -const Cookies = (props: any): JSX.Element => { - return ( -
- In Component Cookies -
- ) -} - -export default Cookies \ No newline at end of file diff --git a/src/app/components/molecules/Cookies/index.ts b/src/app/components/molecules/Cookies/index.ts deleted file mode 100755 index 5fe8722..0000000 --- a/src/app/components/molecules/Cookies/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import Cookies from "./Cookies" - -export default Cookies diff --git a/src/app/components/molecules/Cta/Cta.component.scss b/src/app/components/molecules/Cta/Cta.component.scss deleted file mode 100755 index af4b580..0000000 --- a/src/app/components/molecules/Cta/Cta.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -.ar-Cta { - -} diff --git a/src/app/components/molecules/Cta/Cta.test.ts b/src/app/components/molecules/Cta/Cta.test.ts deleted file mode 100755 index c58457b..0000000 --- a/src/app/components/molecules/Cta/Cta.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import Cta from "./Cta" - -describe("Cta", () => { - it("renders without error", () => { - - }) -}) \ No newline at end of file diff --git a/src/app/components/molecules/Cta/Cta.tsx b/src/app/components/molecules/Cta/Cta.tsx deleted file mode 100755 index 0c42c81..0000000 --- a/src/app/components/molecules/Cta/Cta.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import React from "react" -import "./Cta.component.scss" - -interface CtaProps {} - -const Cta = (props: any): JSX.Element => { - return ( -
- In Component Cta -
- ) -} - -export default Cta \ No newline at end of file diff --git a/src/app/components/molecules/Cta/index.ts b/src/app/components/molecules/Cta/index.ts deleted file mode 100755 index a50c3f1..0000000 --- a/src/app/components/molecules/Cta/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import Cta from "./Cta" - -export default Cta diff --git a/src/app/components/molecules/Dashboard/Dashboard.component.scss b/src/app/components/molecules/Dashboard/Dashboard.component.scss deleted file mode 100755 index 9828c6e..0000000 --- a/src/app/components/molecules/Dashboard/Dashboard.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -.ar-Dashboard { - -} diff --git a/src/app/components/molecules/Dashboard/Dashboard.test.ts b/src/app/components/molecules/Dashboard/Dashboard.test.ts deleted file mode 100755 index 3c2ff26..0000000 --- a/src/app/components/molecules/Dashboard/Dashboard.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import Dashboard from "./Dashboard" - -describe("Dashboard", () => { - it("renders without error", () => { - - }) -}) \ No newline at end of file diff --git a/src/app/components/molecules/Dashboard/Dashboard.tsx b/src/app/components/molecules/Dashboard/Dashboard.tsx deleted file mode 100755 index 4f81b1c..0000000 --- a/src/app/components/molecules/Dashboard/Dashboard.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import React from "react" -import "./Dashboard.component.scss" - -interface DashboardProps {} - -const Dashboard = (props: any): JSX.Element => { - return ( -
- In Component Dashboard -
- ) -} - -export default Dashboard \ No newline at end of file diff --git a/src/app/components/molecules/Dashboard/index.ts b/src/app/components/molecules/Dashboard/index.ts deleted file mode 100755 index dd89cf3..0000000 --- a/src/app/components/molecules/Dashboard/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import Dashboard from "./Dashboard" - -export default Dashboard diff --git a/src/app/components/molecules/Download/Download.component.scss b/src/app/components/molecules/Download/Download.component.scss deleted file mode 100755 index e772d25..0000000 --- a/src/app/components/molecules/Download/Download.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -.ar-Download { - -} diff --git a/src/app/components/molecules/Download/Download.test.ts b/src/app/components/molecules/Download/Download.test.ts deleted file mode 100755 index ccf1a0d..0000000 --- a/src/app/components/molecules/Download/Download.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import Download from "./Download" - -describe("Download", () => { - it("renders without error", () => { - - }) -}) \ No newline at end of file diff --git a/src/app/components/molecules/Download/Download.tsx b/src/app/components/molecules/Download/Download.tsx deleted file mode 100755 index 20990f8..0000000 --- a/src/app/components/molecules/Download/Download.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import React from "react" -import "./Download.component.scss" - -interface DownloadProps {} - -const Download = (props: any): JSX.Element => { - return ( -
- In Component Download -
- ) -} - -export default Download \ No newline at end of file diff --git a/src/app/components/molecules/Download/index.ts b/src/app/components/molecules/Download/index.ts deleted file mode 100755 index b33067c..0000000 --- a/src/app/components/molecules/Download/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import Download from "./Download" - -export default Download diff --git a/src/app/components/molecules/Drawer/Drawer.component.scss b/src/app/components/molecules/Drawer/Drawer.component.scss deleted file mode 100755 index 81aa012..0000000 --- a/src/app/components/molecules/Drawer/Drawer.component.scss +++ /dev/null @@ -1,38 +0,0 @@ -.ar-Drawer { - border-right: 1px solid var(--ar-color-layout-border); - &.collapsed { - .ar-Drawer__expander { - right: 1rem; - } - } - .ar-Drawer__expander { - top: 4px; - right: 6px; - } - /* width */ - &::-webkit-scrollbar { - width: 4px; - } - - /* Track */ - &::-webkit-scrollbar-track { - background: #f1f1f1; - } - - /* Handle */ - &::-webkit-scrollbar-thumb { - background: #bbb; - border-radius: 2px; - &:hover { - background: #888; - } - } - - & + .ar-Content { - width: 85%; - } - - &:focus-visible { - outline: none; - } -} diff --git a/src/app/components/molecules/Drawer/Drawer.test.ts b/src/app/components/molecules/Drawer/Drawer.test.ts deleted file mode 100755 index 2e59a9f..0000000 --- a/src/app/components/molecules/Drawer/Drawer.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import Drawer from "./Drawer" - -describe("Drawer", () => { - it("renders without error", () => { - - }) -}) \ No newline at end of file diff --git a/src/app/components/molecules/Drawer/Drawer.tsx b/src/app/components/molecules/Drawer/Drawer.tsx deleted file mode 100755 index a0304f1..0000000 --- a/src/app/components/molecules/Drawer/Drawer.tsx +++ /dev/null @@ -1,73 +0,0 @@ -import { useEffect, useRef } from "react" -import { ArThemes, DrawerProps } from "@armco/types" -import { - getCurrentTheme, - getDrawerState, - setDrawerState, - Helper, - LoadableIcon, - useAppDispatch, - useAppSelector, -} from "../.." -import useSlotted from "../../../hooks/useSlotted" -import "./Drawer.component.scss" - -const isMobile = Helper.isMobile() -let clickedSelf: boolean - -const Drawer = (props: DrawerProps): JSX.Element => { - const { children, classes, isCollapsible } = props - const drawerRef = useRef(null) - const dispatch = useAppDispatch() - const drawerState = useAppSelector(getDrawerState) - const theme = useAppSelector(getCurrentTheme) - useSlotted("Drawer") - - useEffect(() => { - if (isMobile) { - if (!drawerState?.collapsed) { - drawerRef.current?.focus() - } - } - }, [drawerState]) - - return ( - - ) -} - -export default Drawer diff --git a/src/app/components/molecules/Drawer/index.ts b/src/app/components/molecules/Drawer/index.ts deleted file mode 100755 index 5b051e9..0000000 --- a/src/app/components/molecules/Drawer/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import Drawer from "./Drawer" - -export default Drawer diff --git a/src/app/components/molecules/EcommOrders/EcommOrders.component.scss b/src/app/components/molecules/EcommOrders/EcommOrders.component.scss deleted file mode 100755 index bdf81d1..0000000 --- a/src/app/components/molecules/EcommOrders/EcommOrders.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -.ar-EcommOrders { - -} diff --git a/src/app/components/molecules/EcommOrders/EcommOrders.test.ts b/src/app/components/molecules/EcommOrders/EcommOrders.test.ts deleted file mode 100755 index b63410a..0000000 --- a/src/app/components/molecules/EcommOrders/EcommOrders.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import EcommOrders from "./EcommOrders" - -describe("EcommOrders", () => { - it("renders without error", () => { - - }) -}) \ No newline at end of file diff --git a/src/app/components/molecules/EcommOrders/EcommOrders.tsx b/src/app/components/molecules/EcommOrders/EcommOrders.tsx deleted file mode 100755 index 45bc2ce..0000000 --- a/src/app/components/molecules/EcommOrders/EcommOrders.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import React from "react" -import "./EcommOrders.component.scss" - -interface EcommOrdersProps {} - -const EcommOrders = (props: any): JSX.Element => { - return ( -
- In Component EcommOrders -
- ) -} - -export default EcommOrders \ No newline at end of file diff --git a/src/app/components/molecules/EcommOrders/index.ts b/src/app/components/molecules/EcommOrders/index.ts deleted file mode 100755 index 3cf6e39..0000000 --- a/src/app/components/molecules/EcommOrders/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import EcommOrders from "./EcommOrders" - -export default EcommOrders diff --git a/src/app/components/molecules/EcommProducts/EcommProducts.component.scss b/src/app/components/molecules/EcommProducts/EcommProducts.component.scss deleted file mode 100755 index 6bb9922..0000000 --- a/src/app/components/molecules/EcommProducts/EcommProducts.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -.ar-EcommProducts { - -} diff --git a/src/app/components/molecules/EcommProducts/EcommProducts.test.ts b/src/app/components/molecules/EcommProducts/EcommProducts.test.ts deleted file mode 100755 index 5d1747b..0000000 --- a/src/app/components/molecules/EcommProducts/EcommProducts.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import EcommProducts from "./EcommProducts" - -describe("EcommProducts", () => { - it("renders without error", () => { - - }) -}) \ No newline at end of file diff --git a/src/app/components/molecules/EcommProducts/EcommProducts.tsx b/src/app/components/molecules/EcommProducts/EcommProducts.tsx deleted file mode 100755 index 38aac30..0000000 --- a/src/app/components/molecules/EcommProducts/EcommProducts.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import React from "react" -import "./EcommProducts.component.scss" - -interface EcommProductsProps {} - -const EcommProducts = (props: any): JSX.Element => { - return ( -
- In Component EcommProducts -
- ) -} - -export default EcommProducts \ No newline at end of file diff --git a/src/app/components/molecules/EcommProducts/index.ts b/src/app/components/molecules/EcommProducts/index.ts deleted file mode 100755 index 772ac96..0000000 --- a/src/app/components/molecules/EcommProducts/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import EcommProducts from "./EcommProducts" - -export default EcommProducts \ No newline at end of file diff --git a/src/app/components/molecules/Empty/Empty.component.scss b/src/app/components/molecules/Empty/Empty.component.scss deleted file mode 100755 index 25cd189..0000000 --- a/src/app/components/molecules/Empty/Empty.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -.ar-Empty { - -} diff --git a/src/app/components/molecules/Empty/Empty.test.ts b/src/app/components/molecules/Empty/Empty.test.ts deleted file mode 100755 index 5fe1a6a..0000000 --- a/src/app/components/molecules/Empty/Empty.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import Empty from "./Empty" - -describe("Empty", () => { - it("renders without error", () => { - - }) -}) \ No newline at end of file diff --git a/src/app/components/molecules/Empty/Empty.tsx b/src/app/components/molecules/Empty/Empty.tsx deleted file mode 100755 index fbac165..0000000 --- a/src/app/components/molecules/Empty/Empty.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import React from "react" -import "./Empty.component.scss" - -interface EmptyProps {} - -const Empty = (props: any): JSX.Element => { - return ( -
- In Component Empty -
- ) -} - -export default Empty \ No newline at end of file diff --git a/src/app/components/molecules/Empty/index.ts b/src/app/components/molecules/Empty/index.ts deleted file mode 100755 index 597745e..0000000 --- a/src/app/components/molecules/Empty/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import Empty from "./Empty" - -export default Empty diff --git a/src/app/components/molecules/ErrorBoundary/ErrorBoundary.component.scss b/src/app/components/molecules/ErrorBoundary/ErrorBoundary.component.scss deleted file mode 100755 index 470e2cf..0000000 --- a/src/app/components/molecules/ErrorBoundary/ErrorBoundary.component.scss +++ /dev/null @@ -1,18 +0,0 @@ -.ar-ErrorBoundary { - .ar-ErrorBoundary__container { - border: var(--ar-border); - background-color: var(--ar-bg-base); - transition: box-shadow 0.3s; - font-size: 0.85rem; - &:hover { - box-shadow: 0px 4px 8px var(--ar-shadow); - } - .ar-ErrorBoundary__help-link { - border: var(--ar-border); - background-color: var(--ar-bg-hover); - border-radius: 3px; - font-size: 0.75rem; - cursor: pointer; - } - } -} diff --git a/src/app/components/molecules/ErrorBoundary/ErrorBoundary.test.ts b/src/app/components/molecules/ErrorBoundary/ErrorBoundary.test.ts deleted file mode 100755 index 489de8f..0000000 --- a/src/app/components/molecules/ErrorBoundary/ErrorBoundary.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import ErrorBoundary from "./ErrorBoundary" - -describe("ErrorBoundary", () => { - it("renders without error", () => { - - }) -}) diff --git a/src/app/components/molecules/ErrorBoundary/ErrorBoundary.tsx b/src/app/components/molecules/ErrorBoundary/ErrorBoundary.tsx deleted file mode 100755 index 40bbe18..0000000 --- a/src/app/components/molecules/ErrorBoundary/ErrorBoundary.tsx +++ /dev/null @@ -1,52 +0,0 @@ -import { Component, ErrorInfo, ReactNode } from "react" -import { Icon } from "../.." -import "./ErrorBoundary.component.scss" - -interface ErrorBoundaryProps { - children?: ReactNode -} - -interface State { - hasError: boolean -} - -class ErrorBoundary extends Component { - public state: State = { - hasError: false, - } - - public static getDerivedStateFromError(_: Error): State { - return { hasError: true } - } - - public componentDidCatch(error: Error, errorInfo: ErrorInfo) { - console.error("Uncaught error:", error, errorInfo) - } - - public render() { - if (this.state.hasError) { - return ( -
-
- -
Oops, seems we've hit a roadblock
-
We're trying our best to get back soon!
- - If the issue persists please reach out to{" "} - Armco support - -
-
- ) - } - - return this.props.children - } -} - -export default ErrorBoundary diff --git a/src/app/components/molecules/ErrorBoundary/index.ts b/src/app/components/molecules/ErrorBoundary/index.ts deleted file mode 100755 index 0d54972..0000000 --- a/src/app/components/molecules/ErrorBoundary/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import ErrorBoundary from "./ErrorBoundary" - -export default ErrorBoundary diff --git a/src/app/components/molecules/Faq/Faq.component.scss b/src/app/components/molecules/Faq/Faq.component.scss deleted file mode 100755 index 88abaf4..0000000 --- a/src/app/components/molecules/Faq/Faq.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -.ar-Faq { - -} diff --git a/src/app/components/molecules/Faq/Faq.test.ts b/src/app/components/molecules/Faq/Faq.test.ts deleted file mode 100755 index ed82a09..0000000 --- a/src/app/components/molecules/Faq/Faq.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import Faq from "./Faq" - -describe("Faq", () => { - it("renders without error", () => { - - }) -}) \ No newline at end of file diff --git a/src/app/components/molecules/Faq/Faq.tsx b/src/app/components/molecules/Faq/Faq.tsx deleted file mode 100755 index 98598a9..0000000 --- a/src/app/components/molecules/Faq/Faq.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import React from "react" -import "./Faq.component.scss" - -interface FaqProps {} - -const Faq = (props: any): JSX.Element => { - return ( -
- In Component Faq -
- ) -} - -export default Faq \ No newline at end of file diff --git a/src/app/components/molecules/Faq/index.ts b/src/app/components/molecules/Faq/index.ts deleted file mode 100755 index a239a7b..0000000 --- a/src/app/components/molecules/Faq/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import Faq from "./Faq" - -export default Faq diff --git a/src/app/components/molecules/Features/Features.component.scss b/src/app/components/molecules/Features/Features.component.scss deleted file mode 100755 index f66e157..0000000 --- a/src/app/components/molecules/Features/Features.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -.ar-Features { - -} diff --git a/src/app/components/molecules/Features/Features.test.ts b/src/app/components/molecules/Features/Features.test.ts deleted file mode 100755 index 16a712c..0000000 --- a/src/app/components/molecules/Features/Features.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import Features from "./Features" - -describe("Features", () => { - it("renders without error", () => { - - }) -}) \ No newline at end of file diff --git a/src/app/components/molecules/Features/Features.tsx b/src/app/components/molecules/Features/Features.tsx deleted file mode 100755 index 5ac1f34..0000000 --- a/src/app/components/molecules/Features/Features.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import React from "react" -import "./Features.component.scss" - -interface FeaturesProps {} - -const Features = (props: any): JSX.Element => { - return ( -
- In Component Features -
- ) -} - -export default Features \ No newline at end of file diff --git a/src/app/components/molecules/Features/index.ts b/src/app/components/molecules/Features/index.ts deleted file mode 100755 index 014c49a..0000000 --- a/src/app/components/molecules/Features/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import Features from "./Features" - -export default Features diff --git a/src/app/components/molecules/Filters/Filters.component.scss b/src/app/components/molecules/Filters/Filters.component.scss deleted file mode 100755 index 052018f..0000000 --- a/src/app/components/molecules/Filters/Filters.component.scss +++ /dev/null @@ -1,2 +0,0 @@ -.ar-Filters { -} diff --git a/src/app/components/molecules/Filters/Filters.test.ts b/src/app/components/molecules/Filters/Filters.test.ts deleted file mode 100755 index 1470d3e..0000000 --- a/src/app/components/molecules/Filters/Filters.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import Filters from "./Filters" - -describe("Filters", () => { - it("renders without error", () => { - - }) -}) diff --git a/src/app/components/molecules/Filters/Filters.tsx b/src/app/components/molecules/Filters/Filters.tsx deleted file mode 100755 index de27efd..0000000 --- a/src/app/components/molecules/Filters/Filters.tsx +++ /dev/null @@ -1,190 +0,0 @@ -import { useState } from "react" -import { - BasicFilterConfig, - BasicFilterType, - FilterState, - FiltersProps, - PillProps, -} from "@armco/types" -import { - AlphabetFilter, - CategoryFilter, - Dropdown, - Pillbox, - Tags, - Helper, -} from "../.." -import "./Filters.component.scss" - -const Filters = (props: FiltersProps): JSX.Element => { - const { - config, - clickHandler, - data, - filteredData, - initialFilters, - onFilterChange, - } = props - const [filters, setFilters] = useState( - initialFilters, - ) - const useData = filteredData || data - const total = useData && useData.length - - const countOptions = - config.count !== undefined && - Helper.generateSlices(total || 0, config.count || 0, "range") - - const onLocalFilterChange = ( - data: BasicFilterType | undefined, - type: string, - ): void => { - const filterClone = filters ? { ...filters } : {} - switch (type) { - case "alphabet": - let alphabetFilters = filterClone[type as keyof FilterState] - if (!alphabetFilters) { - alphabetFilters = [] - filterClone[type as keyof FilterState] = alphabetFilters - } - alphabetFilters = alphabetFilters as Array - const existingIndex = alphabetFilters.findIndex( - (bfc) => bfc.value === (data as BasicFilterConfig)?.value, - ) - existingIndex > -1 - ? alphabetFilters.splice(existingIndex, 1) - : alphabetFilters.push(data as BasicFilterConfig) - break - case "all": - const filterType = (data as BasicFilterConfig)?.data?.type - if (filterType) { - if (filterType === "alphabet") { - filterClone[filterType] = [] - } else if (filterType === "categories") { - const catFilter: - | { - [key: string]: Array - } - | undefined = - filters && - (filters[filterType] as { - [key: string]: Array - }) - const subType: string | number | undefined = ( - data as BasicFilterConfig - )?.data?.subType - if (catFilter && subType) { - catFilter[subType] = [] - } - } - } - break - case "categories": - case "count": - default: - filterClone[type as keyof FilterState] = data - } - setFilters(filterClone) - onFilterChange && onFilterChange(filterClone) - } - - const flatFilters: Array = [] - filters && - Object.keys(filters).forEach((key) => { - if (key === "count") { - flatFilters.push({ - label: ( - <> - count:{" "} - - {(filters[key] as BasicFilterConfig)?.value as string} - - - ), - data: { filterData: filters[key], type: key }, - }) - } - if ( - key === "alphabet" && - filters[key] && - (filters[key] as Array).length > 0 - ) { - const alphaFilters = (filters[key] as Array) - .map((bfc) => bfc.value) - .join(" OR ") - flatFilters.push({ - label: `starts:${alphaFilters}`, - data: { filterData: filters[key], type: key }, - deletable: true, - }) - } - if (key === "categories") { - const categories: BasicFilterType | undefined = filters[key] - categories && - Object.keys(categories).forEach((catKey) => { - const categoryValue: Array = - categories[catKey as keyof BasicFilterType] - if (categoryValue && categoryValue.length > 0) { - const groupFilters = categoryValue - .map((bfc) => bfc.value) - .join(" OR ") - flatFilters.push({ - label: `${catKey}:${groupFilters}`, - data: { filterData: categoryValue, type: key, subType: catKey }, - deletable: true, - }) - } - }) - } - }) - - return ( -
-
Filters
- {"count" in config && ( - <> - { - onLocalFilterChange(data, "count") - }} - /> - - - )} - {config.alphabet && ( - - )} - {"categories" in config && ( - - }) - : {} - } - /> - )} - -
- ) -} - -export default Filters diff --git a/src/app/components/molecules/Filters/index.ts b/src/app/components/molecules/Filters/index.ts deleted file mode 100755 index 8049210..0000000 --- a/src/app/components/molecules/Filters/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import Filters from "./Filters" - -export default Filters diff --git a/src/app/components/molecules/FlexContent/FlexContent.component.scss b/src/app/components/molecules/FlexContent/FlexContent.component.scss deleted file mode 100755 index 4773767..0000000 --- a/src/app/components/molecules/FlexContent/FlexContent.component.scss +++ /dev/null @@ -1,8 +0,0 @@ -.ar-FlexContent { - min-height: 2.5rem; - line-height: 1.2rem; - font-family: "Noto Sans Chakma", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; - &:focus-visible { - outline: none; - } -} diff --git a/src/app/components/molecules/FlexContent/FlexContent.test.ts b/src/app/components/molecules/FlexContent/FlexContent.test.ts deleted file mode 100755 index c17bdaf..0000000 --- a/src/app/components/molecules/FlexContent/FlexContent.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import FlexContent from "./FlexContent" - -describe("FlexContent", () => { - it("renders without error", () => { - - }) -}) diff --git a/src/app/components/molecules/FlexContent/FlexContent.tsx b/src/app/components/molecules/FlexContent/FlexContent.tsx deleted file mode 100755 index 4998163..0000000 --- a/src/app/components/molecules/FlexContent/FlexContent.tsx +++ /dev/null @@ -1,385 +0,0 @@ -/** - * Document component, that wraps and manages Text components - * - on enter add a new Text component - * - */ -import { - FormEvent, - memo, - useCallback, - useEffect, - useMemo, - useRef, - useState, -} from "react" -import { v4 as uuid } from "uuid" -import { - ArPopoverPositions, - ArPopoverSlots, - ChunkInfo, - CompInfo, - FlexContentProps, - FlexContentType, - LibRepoType, - SelectionInfo, - TextInfo, - TextProps, -} from "@armco/types" -import { - applyTool, // Formatting - DomHelper, - PopoverV2, - selectionHandler, // Selection - splitChunkAtCursor, // Formatting - TextFormatter, -} from "../.." -import * as atoms from "../../atoms" -import * as molecules from "../../molecules" -import "./FlexContent.component.scss" - -const demoDummyState: { - entireSelectionFormatted?: boolean - contentRegistry: FlexContentType -} = { - contentRegistry: {}, -} - -Array.from({ length: 4 }, (i: number) => { - const id = uuid() - demoDummyState.contentRegistry[id] = { - id, - name: "Text", - text: `lorem ipsum${i}`, - order: i, - chunks: {}, - length: -1, - } - return null -}) - -const MemoWrapper = memo( - (props: { componentName: string; props: TextProps; repo: LibRepoType }) => { - const { componentName, props: componentProps, repo } = props - const Component = repo[componentName] - return Component ? ( - - ) : null - }, - (prevProps, props) => { - return ( - JSON.stringify(prevProps.props.descriptor.chunks) !== - JSON.stringify(props.props.descriptor.chunks) - ) - }, -) - -const initId = uuid() -const initText = { - [initId]: { - id: initId, - name: "Text", - text: "", - order: 0, - chunks: {}, - length: -1, - }, -} -const DEFAULT_PREVENTERS = ["Enter", "Backspace", "Delete"] -const isMac = navigator.platform.toUpperCase().indexOf("MAC") >= 0 -const isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) -const isAndroid = /Android/.test(navigator.userAgent) - -const FlexContent = (props: FlexContentProps): JSX.Element => { - const { - allowFormatting, - isEditable = true, - hasFloatingFormatter, - content = initText, - demo, - onCommit, - theme, - } = props - const [contentState, updateContentState] = useState<{ - entireSelectionFormatted?: boolean - contentRegistry: FlexContentType - }>() - const [formatterDisplayed, displayFormatter] = useState(false) - const activeChunkRef = useRef() - const flexContentRef = useRef(null) - const selectionInfoRef = useRef() - const keyRef = useRef() - const repo: LibRepoType = useMemo(() => ({ ...atoms, ...molecules }), []) - const winObj = useMemo(() => DomHelper.getWindowElement(demo), [demo]) - const docObj = useMemo(() => DomHelper.getDocumentElement(demo), [demo]) - const memoizedSelectionHandler = useCallback( - () => - selectionHandler( - activeChunkRef, - docObj, - winObj, - selectionInfoRef, - contentState, - ), - [contentState, docObj, winObj], - ) - - useEffect(() => { - const handleKeyDown = (event: KeyboardEvent) => { - if ((event.ctrlKey || event.metaKey) && event.key === "b") { - event.preventDefault() - selectionInfoRef.current && - contentState && - applyTool( - "bold", - true, - selectionInfoRef.current, - contentState, - (state) => { - updateContentState(state) - selectionInfoRef.current = null - }, - ) - // undoSlots() - } - } - - docObj?.addEventListener("keydown", handleKeyDown) - - return () => { - docObj?.removeEventListener("keydown", handleKeyDown) - } - }, [contentState, docObj]) - - useEffect(() => { - const useContent = content - ? { contentRegistry: content } - : demo - ? demoDummyState - : { contentRegistry: content || {} } - useContent?.contentRegistry && - Object.values(useContent.contentRegistry).forEach( - (obj: TextInfo | CompInfo) => { - obj.length = (obj.text as string)?.length - if (Object.keys(obj.chunks).length === 0) { - const id = uuid() - const end = obj.text ? (obj.text as string).length - 1 : 0 - obj.chunks[id] = { - id, - start: 0, - end, - text: obj.text.substring(0, end), - formats: {}, - parent: obj.id, - } - } - }, - ) - updateContentState(useContent) - }, [content, demo]) - - useEffect(() => { - const flexContentDom = flexContentRef.current - const displayFormatterHandler = () => - winObj?.getSelection()?.toString().length && displayFormatter(true) - // flexContentDom?.addEventListener("focus", memoizedSelectionHandler) - docObj?.addEventListener("selectionchange", memoizedSelectionHandler) - flexContentDom?.addEventListener("mouseup", displayFormatterHandler) - return () => { - // flexContentDom?.removeEventListener("focus", memoizedSelectionHandler) - docObj?.removeEventListener("selectionchange", memoizedSelectionHandler) - flexContentDom?.removeEventListener("mouseup", displayFormatterHandler) - } - }, [winObj, docObj, memoizedSelectionHandler, flexContentRef]) - - useEffect(() => { - if (flexContentRef.current) { - setTimeout(() => flexContentRef.current?.focus(), 10) - } - }, [flexContentRef]) - - const textConfigs = - contentState && - Object.entries(contentState.contentRegistry as FlexContentType) - textConfigs?.sort((t1, t2) => t1[1].order - t2[1].order) - - const handleInput = (e: FormEvent) => { - e.preventDefault() - const input = (e as unknown as InputEvent).data - const selection = winObj?.getSelection() - if (selection) { - const range = selection.getRangeAt(0) - const anchorText = - (selection.anchorNode as HTMLElement).textContent + (input || "") - const cursorPosition = selection.anchorOffset - const startContainer = range.startContainer - if (flexContentRef.current) { - const childNodes = Array.from(flexContentRef.current.childNodes) - childNodes.forEach((node) => { - node.nodeType === Node.TEXT_NODE && node.remove() - }) - } - - if (contentState && activeChunkRef.current) { - const content = contentState.contentRegistry - const textConfig = content[activeChunkRef.current.parent] - textConfig.text = input // TODO: Fix this value, might only capture chunk's text - textConfig.cursorPosition = cursorPosition - if ( - startContainer?.parentNode && - !(startContainer.parentNode as HTMLElement).classList.contains( - "ar-FlexContent", - ) - ) { - textConfig.startContainer = startContainer - } - const activeText = - contentState.contentRegistry[activeChunkRef.current.parent] - const activeChunk = activeText?.chunks[activeChunkRef.current.id] - activeChunk.text = anchorText - activeChunk.end = activeChunk.start + activeChunk.text.length - updateContentState({ ...contentState }) - } - onCommit && onCommit() - keyRef.current = undefined - } - } - - const contentRenders = ( -
{ - const selection = winObj?.getSelection() - if (selection && contentState) { - const range = selection.getRangeAt(0) - if (e.key === "Enter") { - e.preventDefault() - splitChunkAtCursor( - selection, - contentState, - activeChunkRef, - updateContentState, - ) - } else if (e.key === "Backspace") { - if (range && range.startOffset > 0) { - range.setStart(range.startContainer, range.startOffset - 1) - range.deleteContents() - } - } else if (e.key === "Delete") { - if (isMac || isIOS || isAndroid) { - if (range.startOffset > 0) { - range.setStart(range.startContainer, range.startOffset - 1) - range.deleteContents() - } - } else { - // On Windows, "Delete" key deletes character after the cursor - if ( - range.startContainer.textContent && - range.startOffset < range.startContainer.textContent.length - ) { - range.setEnd(range.startContainer, range.startOffset + 1) - range.deleteContents() - } - } - } - } - }} - onBeforeInput={handleInput} - contentEditable={isEditable} - suppressContentEditableWarning={true} - > - {textConfigs?.map((entry) => { - const props: TextProps = { - descriptor: entry[1] as TextInfo, - allowFormatting, - isEditable, - demo, - } - return ( - - ) - })} -
- ) - - return ( - <> - {isEditable && allowFormatting && hasFloatingFormatter ? ( - displayFormatter(false)} - position={ArPopoverPositions.TOP} - demo={demo} - topOffset={16} - popAtPointer - hideMarker - > - {contentRenders} - { - updateContentState(state) - selectionInfoRef.current = null - }} - selectionInfo={selectionInfoRef.current} - theme={theme} - isFloating - /> - - ) : ( - contentRenders - )} -
-
-
-
Content Registry
-
-            {JSON.stringify(
-              contentState?.contentRegistry,
-              (key, value) => {
-                if (key.startsWith("__reactFiber")) {
-                  if (value.stateNode?.data) {
-                    return value.stateNode.data
-                  } else {
-                    return value.toString()
-                  }
-                }
-                if (key === "id" || key === "length") {
-                  return undefined
-                }
-                return value
-              },
-              2,
-            )}
-          
-
-
-
Active Chunk (ref - no live update)
-
-            {JSON.stringify(activeChunkRef.current, null, 2)}
-          
-
-
-
Selection Info (ref - no live update)
-
-            {JSON.stringify(selectionInfoRef.current, null, 2)}
-          
-
-
- - ) -} - -export default FlexContent diff --git a/src/app/components/molecules/FlexContent/index.ts b/src/app/components/molecules/FlexContent/index.ts deleted file mode 100755 index 9bb8299..0000000 --- a/src/app/components/molecules/FlexContent/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import FlexContent from "./FlexContent" - -export default FlexContent diff --git a/src/app/components/molecules/FlexTools/FlexTools.component.scss b/src/app/components/molecules/FlexTools/FlexTools.component.scss deleted file mode 100755 index 9103237..0000000 --- a/src/app/components/molecules/FlexTools/FlexTools.component.scss +++ /dev/null @@ -1,12 +0,0 @@ -.ar-FlexTools { - .col { - border-right: var(--ar-border); - } - .ar-FlexTools__separator { - border-right: var(--ar-border); - } - - .ar-FlexTools__brand { - border-radius: 50%; - } -} diff --git a/src/app/components/molecules/FlexTools/FlexTools.test.ts b/src/app/components/molecules/FlexTools/FlexTools.test.ts deleted file mode 100755 index fc46be9..0000000 --- a/src/app/components/molecules/FlexTools/FlexTools.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import FlexTools from "./FlexTools" - -describe("FlexTools", () => { - it("renders without error", () => { - - }) -}) diff --git a/src/app/components/molecules/FlexTools/FlexTools.tsx b/src/app/components/molecules/FlexTools/FlexTools.tsx deleted file mode 100755 index ca9a38a..0000000 --- a/src/app/components/molecules/FlexTools/FlexTools.tsx +++ /dev/null @@ -1,117 +0,0 @@ -import { useEffect } from "react" -import { useNavigate } from "react-router-dom" -import { - ArAnimations, - ArLoginProviders, - ArPopoverSlots, - ArTabType, - ArThemes, - FlexToolsProps, - TabBarProps, - TabProps, -} from "@armco/types" -import { - AppAndToolsSelector, - getCurrentTheme, - Helper, - LoadableIcon, - NAVIGATOR, - Popover, - TabBar, - UserOptions, - useAppSelector, -} from "../.." -import "./FlexTools.component.scss" - -const userOptions = [ - [{ name: "Profile" }, { name: "Settings" }, { name: "My Stuff" }], - [{ name: "+ Organization" }, { name: "+ Upload Icon" }], -] - -const isMobile = Helper.isMobile() - -const FlexTools = (props: FlexToolsProps): JSX.Element => { - const { isLanding, route } = props - const theme = useAppSelector(getCurrentTheme) - const navigate = useNavigate() - - useEffect(() => { - NAVIGATOR.forEach((item) => { - navigator && - item.items?.forEach( - (subItem) => - (subItem.onClick = () => subItem.url && navigate(subItem.url)), - ) - }) - }, [navigate]) - - const onTabSelected = (id: string, tab: TabProps) => { - tab?.data?.url && navigate(tab.data.url as string) - } - - const separator = - const tabBarProps: TabBarProps = { - data: NAVIGATOR, - variant: ArTabType.MODERN, - onTabSelected, - } - if (route === "landing") { - tabBarProps.activeId = "" - } - const appSelector = isLanding ? ( - - ) : ( - - - - - ) - - const userOps = ( - - ) - return ( -
- {!isMobile ? ( - <> - {appSelector} - {!isLanding && separator} - {userOps} - - ) : ( -
-
navigate("/")}> - - Stuffle. - i - o - -
-
- {appSelector} -
-
{userOps}
-
- )} -
- ) -} - -export default FlexTools diff --git a/src/app/components/molecules/FlexTools/index.ts b/src/app/components/molecules/FlexTools/index.ts deleted file mode 100755 index 720a7d8..0000000 --- a/src/app/components/molecules/FlexTools/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import FlexTools from "./FlexTools" - -export default FlexTools diff --git a/src/app/components/molecules/Footer/Footer.component.scss b/src/app/components/molecules/Footer/Footer.component.scss deleted file mode 100755 index 3e26a6a..0000000 --- a/src/app/components/molecules/Footer/Footer.component.scss +++ /dev/null @@ -1,4 +0,0 @@ -.ar-Footer { - background-color: var(--ar-bg-base); - border-top: 1px solid #eee; -} diff --git a/src/app/components/molecules/Footer/Footer.test.ts b/src/app/components/molecules/Footer/Footer.test.ts deleted file mode 100755 index c4611a0..0000000 --- a/src/app/components/molecules/Footer/Footer.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import Footer from "./Footer" - -describe("Footer", () => { - it("renders without error", () => { - - }) -}) \ No newline at end of file diff --git a/src/app/components/molecules/Footer/Footer.tsx b/src/app/components/molecules/Footer/Footer.tsx deleted file mode 100755 index 8ad5ad8..0000000 --- a/src/app/components/molecules/Footer/Footer.tsx +++ /dev/null @@ -1,46 +0,0 @@ -import { ArThemes } from "@armco/types" -import { - FlexTools, - getCurrentTheme, - Helper, - setTheme, - Toggle, - useAppDispatch, - useAppSelector, -} from "../.." -import useSlotted from "../../../hooks/useSlotted" -import "./Footer.component.scss" - -interface FooterProps {} - -const isMobile = Helper.isMobile() - -const Footer = (props: FooterProps): JSX.Element => { - const theme = useAppSelector(getCurrentTheme) - const dispatch = useAppDispatch() - useSlotted("Footer") - - return ( -
- {!isMobile ? ( - { - const nextTheme = isChecked ? ArThemes.DARK1 : ArThemes.LIGHT1 - dispatch(setTheme(nextTheme)) - document - .getElementsByTagName("html")[0] - .setAttribute("ar-theme", nextTheme) - }} - /> - ) : ( - - )} -
- ) -} - -export default Footer diff --git a/src/app/components/molecules/Footer/index.ts b/src/app/components/molecules/Footer/index.ts deleted file mode 100755 index 79ae818..0000000 --- a/src/app/components/molecules/Footer/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import Footer from "./Footer" - -export default Footer diff --git a/src/app/components/molecules/Form/Form.component.scss b/src/app/components/molecules/Form/Form.component.scss deleted file mode 100755 index d2857bc..0000000 --- a/src/app/components/molecules/Form/Form.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -.ar-Form { - -} diff --git a/src/app/components/molecules/Form/Form.test.ts b/src/app/components/molecules/Form/Form.test.ts deleted file mode 100755 index d7d79ec..0000000 --- a/src/app/components/molecules/Form/Form.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import Form from "./Form" - -describe("Form", () => { - it("renders without error", () => { - - }) -}) \ No newline at end of file diff --git a/src/app/components/molecules/Form/Form.tsx b/src/app/components/molecules/Form/Form.tsx deleted file mode 100755 index b734aa9..0000000 --- a/src/app/components/molecules/Form/Form.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import React from "react" -import "./Form.component.scss" - -interface FormProps {} - -const Form = (props: any): JSX.Element => { - return ( -
- In Component Form -
- ) -} - -export default Form \ No newline at end of file diff --git a/src/app/components/molecules/Form/index.ts b/src/app/components/molecules/Form/index.ts deleted file mode 100755 index 2b777f4..0000000 --- a/src/app/components/molecules/Form/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import Form from "./Form" - -export default Form \ No newline at end of file diff --git a/src/app/components/molecules/Gallery/Gallery.component.scss b/src/app/components/molecules/Gallery/Gallery.component.scss deleted file mode 100755 index 061228c..0000000 --- a/src/app/components/molecules/Gallery/Gallery.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -.ar-Gallery { - -} diff --git a/src/app/components/molecules/Gallery/Gallery.test.ts b/src/app/components/molecules/Gallery/Gallery.test.ts deleted file mode 100755 index bcbbaa5..0000000 --- a/src/app/components/molecules/Gallery/Gallery.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import Gallery from "./Gallery" - -describe("Gallery", () => { - it("renders without error", () => { - - }) -}) \ No newline at end of file diff --git a/src/app/components/molecules/Gallery/Gallery.tsx b/src/app/components/molecules/Gallery/Gallery.tsx deleted file mode 100755 index daa9403..0000000 --- a/src/app/components/molecules/Gallery/Gallery.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import React from "react" -import "./Gallery.component.scss" - -interface GalleryProps {} - -const Gallery = (props: any): JSX.Element => { - return ( -
- In Component Gallery -
- ) -} - -export default Gallery \ No newline at end of file diff --git a/src/app/components/molecules/Gallery/index.ts b/src/app/components/molecules/Gallery/index.ts deleted file mode 100755 index 6de5a9c..0000000 --- a/src/app/components/molecules/Gallery/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import Gallery from "./Gallery" - -export default Gallery diff --git a/src/app/components/molecules/Graph/Graph.component.scss b/src/app/components/molecules/Graph/Graph.component.scss deleted file mode 100755 index 17c0593..0000000 --- a/src/app/components/molecules/Graph/Graph.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -.ar-Graph { - -} diff --git a/src/app/components/molecules/Graph/Graph.test.ts b/src/app/components/molecules/Graph/Graph.test.ts deleted file mode 100755 index 6fe1215..0000000 --- a/src/app/components/molecules/Graph/Graph.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import Graph from "./Graph" - -describe("Graph", () => { - it("renders without error", () => { - - }) -}) \ No newline at end of file diff --git a/src/app/components/molecules/Graph/Graph.tsx b/src/app/components/molecules/Graph/Graph.tsx deleted file mode 100755 index 80ebeb4..0000000 --- a/src/app/components/molecules/Graph/Graph.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import React from "react" -import "./Graph.component.scss" - -interface GraphProps {} - -const Graph = (props: any): JSX.Element => { - return ( -
- In Component Graph -
- ) -} - -export default Graph \ No newline at end of file diff --git a/src/app/components/molecules/Graph/index.ts b/src/app/components/molecules/Graph/index.ts deleted file mode 100755 index b96e39f..0000000 --- a/src/app/components/molecules/Graph/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import Graph from "./Graph" - -export default Graph \ No newline at end of file diff --git a/src/app/components/molecules/GraphTiles/GraphTiles.component.scss b/src/app/components/molecules/GraphTiles/GraphTiles.component.scss deleted file mode 100755 index 516d209..0000000 --- a/src/app/components/molecules/GraphTiles/GraphTiles.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -.ar-GraphTiles { - -} diff --git a/src/app/components/molecules/GraphTiles/GraphTiles.test.ts b/src/app/components/molecules/GraphTiles/GraphTiles.test.ts deleted file mode 100755 index 5d3c309..0000000 --- a/src/app/components/molecules/GraphTiles/GraphTiles.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import GraphTiles from "./GraphTiles" - -describe("GraphTiles", () => { - it("renders without error", () => { - - }) -}) \ No newline at end of file diff --git a/src/app/components/molecules/GraphTiles/GraphTiles.tsx b/src/app/components/molecules/GraphTiles/GraphTiles.tsx deleted file mode 100755 index 59d4a37..0000000 --- a/src/app/components/molecules/GraphTiles/GraphTiles.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import React from "react" -import "./GraphTiles.component.scss" - -interface GraphTilesProps {} - -const GraphTiles = (props: any): JSX.Element => { - return ( -
- In Component GraphTiles -
- ) -} - -export default GraphTiles \ No newline at end of file diff --git a/src/app/components/molecules/GraphTiles/index.ts b/src/app/components/molecules/GraphTiles/index.ts deleted file mode 100755 index 24bd7b5..0000000 --- a/src/app/components/molecules/GraphTiles/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import GraphTiles from "./GraphTiles" - -export default GraphTiles diff --git a/src/app/components/molecules/Header/Header.component.scss b/src/app/components/molecules/Header/Header.component.scss deleted file mode 100755 index 5bb8e41..0000000 --- a/src/app/components/molecules/Header/Header.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -.ar-Header { - max-height: 4rem; -} diff --git a/src/app/components/molecules/Header/Header.test.ts b/src/app/components/molecules/Header/Header.test.ts deleted file mode 100755 index eccb06b..0000000 --- a/src/app/components/molecules/Header/Header.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import Header from "./Header" - -describe("Header", () => { - it("renders without error", () => { - - }) -}) diff --git a/src/app/components/molecules/Header/Header.tsx b/src/app/components/molecules/Header/Header.tsx deleted file mode 100755 index 967a4a3..0000000 --- a/src/app/components/molecules/Header/Header.tsx +++ /dev/null @@ -1,50 +0,0 @@ -import { Children } from "react" -import { ArHeaderSlots, HeaderProps } from "@armco/types" -import "./Header.component.scss" -import useSlotted from "../../../hooks/useSlotted" - -const Header = (props: HeaderProps): JSX.Element => { - const { classes, isSticky, isFluid, children, order } = props - const childItems: { [key: string]: JSX.Element } = {} - const shuffledItems: Array = [] - useSlotted("Header") - - children && - Children.forEach(children, (child: JSX.Element | null) => { - if (child?.props?.slot) { - childItems[child.props.slot as keyof object] = child - } - }) - if (order) { - order.forEach((slot) => shuffledItems.push(childItems[slot])) - } - return ( -
- {isFluid ? ( - children - ) : ( -
- {order ? ( - shuffledItems - ) : ( -
-
- {childItems[ArHeaderSlots.LOGO]} - {childItems[ArHeaderSlots.SEARCH]} - {childItems[ArHeaderSlots.NAVBAR]} -
-
- {childItems[ArHeaderSlots.ACTIONS]} - {childItems[ArHeaderSlots.NOTIFICATIONS]} - {childItems[ArHeaderSlots.SETTINGS]} - {childItems[ArHeaderSlots.USER]} -
-
- )} -
- )} -
- ) -} - -export default Header diff --git a/src/app/components/molecules/Header/index.ts b/src/app/components/molecules/Header/index.ts deleted file mode 100755 index 696cfbc..0000000 --- a/src/app/components/molecules/Header/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import Header from "./Header" - -export default Header diff --git a/src/app/components/molecules/Hero/Hero.component.scss b/src/app/components/molecules/Hero/Hero.component.scss deleted file mode 100755 index d62fe19..0000000 --- a/src/app/components/molecules/Hero/Hero.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -.ar-Hero { - -} diff --git a/src/app/components/molecules/Hero/Hero.test.ts b/src/app/components/molecules/Hero/Hero.test.ts deleted file mode 100755 index a6239dd..0000000 --- a/src/app/components/molecules/Hero/Hero.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import Hero from "./Hero" - -describe("Hero", () => { - it("renders without error", () => { - - }) -}) \ No newline at end of file diff --git a/src/app/components/molecules/Hero/Hero.tsx b/src/app/components/molecules/Hero/Hero.tsx deleted file mode 100755 index a139b3f..0000000 --- a/src/app/components/molecules/Hero/Hero.tsx +++ /dev/null @@ -1,40 +0,0 @@ -import { ArButtonVariants, ArThemes, HeroProps } from "@armco/types" -import { ComponentImage } from "../.." -import { Button } from "../.." -import useSlotted from "../../../hooks/useSlotted" -import "./Hero.component.scss" - -const Hero = (props: HeroProps): JSX.Element => { - const { classes, theme } = props - useSlotted("Hero") - - return ( -
-
-
-

- Unleash Your Creative Power with Our All-in-One Development Hub for - Effortless Web Mastery -

-
- Simplify your workflow and power up your projects with our - comprehensive suite of development tools. -
-
-
-
-
- Component Lib -
-
-
- ) -} - -export default Hero diff --git a/src/app/components/molecules/Hero/index.ts b/src/app/components/molecules/Hero/index.ts deleted file mode 100755 index 32fb5e5..0000000 --- a/src/app/components/molecules/Hero/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import Hero from "./Hero" - -export default Hero diff --git a/src/app/components/molecules/HowItWorks/HowItWorks.component.scss b/src/app/components/molecules/HowItWorks/HowItWorks.component.scss deleted file mode 100755 index 3a53b77..0000000 --- a/src/app/components/molecules/HowItWorks/HowItWorks.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -.ar-HowItWorks { - -} diff --git a/src/app/components/molecules/HowItWorks/HowItWorks.test.ts b/src/app/components/molecules/HowItWorks/HowItWorks.test.ts deleted file mode 100755 index c56c349..0000000 --- a/src/app/components/molecules/HowItWorks/HowItWorks.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import HowItWorks from "./HowItWorks" - -describe("HowItWorks", () => { - it("renders without error", () => { - - }) -}) \ No newline at end of file diff --git a/src/app/components/molecules/HowItWorks/HowItWorks.tsx b/src/app/components/molecules/HowItWorks/HowItWorks.tsx deleted file mode 100755 index 69fa372..0000000 --- a/src/app/components/molecules/HowItWorks/HowItWorks.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import React from "react" -import "./HowItWorks.component.scss" - -interface HowItWorksProps {} - -const HowItWorks = (props: any): JSX.Element => { - return ( -
- In Component HowItWorks -
- ) -} - -export default HowItWorks \ No newline at end of file diff --git a/src/app/components/molecules/HowItWorks/index.ts b/src/app/components/molecules/HowItWorks/index.ts deleted file mode 100755 index 55c83e7..0000000 --- a/src/app/components/molecules/HowItWorks/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import HowItWorks from "./HowItWorks" - -export default HowItWorks \ No newline at end of file diff --git a/src/app/components/molecules/HttpCode/HttpCode.component.scss b/src/app/components/molecules/HttpCode/HttpCode.component.scss deleted file mode 100755 index a4fa626..0000000 --- a/src/app/components/molecules/HttpCode/HttpCode.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -.ar-HttpCode { - -} diff --git a/src/app/components/molecules/HttpCode/HttpCode.test.ts b/src/app/components/molecules/HttpCode/HttpCode.test.ts deleted file mode 100755 index 186ec06..0000000 --- a/src/app/components/molecules/HttpCode/HttpCode.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import HttpCode from "./HttpCode" - -describe("HttpCode", () => { - it("renders without error", () => { - - }) -}) \ No newline at end of file diff --git a/src/app/components/molecules/HttpCode/HttpCode.tsx b/src/app/components/molecules/HttpCode/HttpCode.tsx deleted file mode 100755 index f88c6f3..0000000 --- a/src/app/components/molecules/HttpCode/HttpCode.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import React from "react" -import "./HttpCode.component.scss" - -interface HttpCodeProps {} - -const HttpCode = (props: any): JSX.Element => { - return ( -
- In Component HttpCode -
- ) -} - -export default HttpCode \ No newline at end of file diff --git a/src/app/components/molecules/HttpCode/index.ts b/src/app/components/molecules/HttpCode/index.ts deleted file mode 100755 index ed1b049..0000000 --- a/src/app/components/molecules/HttpCode/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import HttpCode from "./HttpCode" - -export default HttpCode diff --git a/src/app/components/molecules/ImageEditor/ImageEditor.component.scss b/src/app/components/molecules/ImageEditor/ImageEditor.component.scss deleted file mode 100755 index 6f63fa3..0000000 --- a/src/app/components/molecules/ImageEditor/ImageEditor.component.scss +++ /dev/null @@ -1,45 +0,0 @@ -.ar-ImageEditor { - .ar-ImageEditor__image-container { - max-width: 60vw; - max-height: 75vh; - } - .ar-ImageEditor__editor-controls { - transition: background-color 0.5s, box-shadow 0.5s ease-in-out; - background-color: var(--ar-bg-tertiary-faded-2); - border-radius: 2rem; - &:hover { - background-color: var(--ar-bg-tertiary-faded); - } - .ar-ImageEditor__download-button { - width: 2rem; - height: 2rem; - display: inline-block; - &:hover { - background-color: var(--ar-bg-tertiary-faded-2); - } - } - .ar-ImageEditor__commit-button { - width: 2rem; - height: 2rem; - display: inline-block; - &.is-dirty:hover { - background-color: var(--ar-bg-tertiary-faded-2); - } - } - } - .ar-ImageEditor__controls { - bottom: 0; - .ar-ImageEditor__controls-container { - transition: background-color 0.5s, box-shadow 0.5s, max-height 0.5s ease-in-out; - background-color: var(--ar-bg-tertiary-faded-2); - max-height: 3.2rem; - overflow: hidden; - &:hover { - background-color: var(--ar-bg-tertiary-faded); - } - &.expanded { - max-height: 20rem; - } - } - } -} diff --git a/src/app/components/molecules/ImageEditor/ImageEditor.test.ts b/src/app/components/molecules/ImageEditor/ImageEditor.test.ts deleted file mode 100755 index 06953f9..0000000 --- a/src/app/components/molecules/ImageEditor/ImageEditor.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import ImageEditor from "./ImageEditor" - -describe("ImageEditor", () => { - it("renders without error", () => { - - }) -}) diff --git a/src/app/components/molecules/ImageEditor/ImageEditor.tsx b/src/app/components/molecules/ImageEditor/ImageEditor.tsx deleted file mode 100644 index 6f59e40..0000000 --- a/src/app/components/molecules/ImageEditor/ImageEditor.tsx +++ /dev/null @@ -1,311 +0,0 @@ -import { ChangeEvent, useRef, useState } from "react" -import { - ArPopoverSlots, - FunctionType, - ImageEditorProps, - ImageProps, -} from "@armco/types" -import { Image, LoadableIcon, Tooltip, Slider, DomHelper } from "../.." -import "./ImageEditor.component.scss" - -const Control = ({ - icon, - handler, - tooltip, -}: { - icon: string - handler: FunctionType - tooltip: string -}) => { - return ( - - - - - {tooltip} - - ) -} - -let initialState: Partial = { - rotateBy: 0, - brightness: 1, - contrast: 1, - saturate: 1, - grayscale: 0, - blur: 0, - sepia: 0, - opacity: 1, - scale: 1, -} - -const normalizeRotation = (rotation: number) => ((rotation % 360) + 360) % 360 -const rotationStep = 22.5 - -const ImageEditor = (props: ImageEditorProps): JSX.Element => { - const { image, imageState, onChange, onCommit, viewOnly } = props - initialState = { - ...initialState, - ...imageState, - } - const imageRef = useRef(null) - const [edits, setEdits] = useState>({ ...initialState }) - - const [expandControls, setExpandControls] = useState() - const [isDirty, setDirty] = useState() - - const localOnChange = (key: string, value: boolean | number) => { - const updatedEdits = { ...edits, [key]: value } - const { rotateBy, ...rest } = updatedEdits - const { rotateBy: initialRotateBy, ...initialRest } = initialState - rotateBy !== undefined && - initialRotateBy !== undefined && - setDirty( - JSON.stringify(rest) !== JSON.stringify(initialRest) || - normalizeRotation(rotateBy) !== normalizeRotation(initialRotateBy), - ) - setEdits(updatedEdits) - onChange && onChange(updatedEdits) - } - - const controls = [ - { - icon: "tb.TbFlipHorizontal", - handler: () => localOnChange("flipHorizontal", !edits.flipHorizontal), - tooltip: "Flip Horizontal", - }, - { - icon: "tb.TbFlipVertical", - handler: () => localOnChange("flipVertical", !edits.flipVertical), - tooltip: "Flip Vertical", - }, - { - icon: "ai.AiOutlineRotateLeft", - handler: () => - localOnChange("rotateBy", (edits.rotateBy as number) - rotationStep), - tooltip: "Rotate Left", - }, - { - icon: "ai.AiOutlineRotateRight", - handler: () => - localOnChange("rotateBy", (edits.rotateBy as number) + rotationStep), - tooltip: "Rotate Right", - }, - { - icon: "fi.FiZoomIn", - handler: () => localOnChange("scale", ((edits.scale as number) + 1) % 10), - tooltip: "Zoom In", - }, - { - icon: "fi.FiZoomOut", - handler: () => - localOnChange( - "scale", - ((edits.scale as number) - 1 < 0 ? 0 : (edits.scale as number) - 1) % - 10, - ), - tooltip: "Zoom Out", - }, - { - icon: expandControls - ? "md.MdOutlineExpandLess" - : "md.MdOutlineExpandMore", - handler: () => setExpandControls(!expandControls), - tooltip: expandControls - ? "Hide Advanced Controls" - : "Show Advanced Controls", - }, - ] - - const viewOnlyControls = [ - { - icon: "fi.FiZoomIn", - handler: () => - setEdits({ ...edits, scale: ((edits.scale as number) + 1) % 10 }), - tooltip: "Zoom In", - }, - { - icon: "fi.FiZoomOut", - handler: () => - setEdits({ - ...edits, - scale: - ((edits.scale as number) - 1 < 0 - ? 0 - : (edits.scale as number) - 1) % 10, - }), - tooltip: "Zoom Out", - }, - ] - - const advancedControls = [ - [ - { - label: "Brightness", - min: 0, - max: 5, - precision: 0.1, - handler: (e: ChangeEvent) => - localOnChange("brightness", +e.target.value), - }, - { - label: "Contrast", - min: 0, - max: 5, - precision: 0.1, - handler: (e: ChangeEvent) => - localOnChange("contrast", +e.target.value), - }, - ], - [ - { - label: "Saturation", - min: 0, - max: 10, - precision: 0.2, - handler: (e: ChangeEvent) => - localOnChange("saturate", +e.target.value), - }, - { - label: "Grayscale", - min: 0, - max: 1, - precision: 0.05, - handler: (e: ChangeEvent) => - localOnChange("grayscale", +e.target.value), - }, - ], - [ - { - label: "Blur", - min: 0, - max: 20, - handler: (e: ChangeEvent) => - localOnChange("blur", +e.target.value), - }, - { - label: "Sepia", - min: 0, - max: 1, - precision: 0.05, - handler: (e: ChangeEvent) => - localOnChange("sepia", +e.target.value), - }, - ], - [ - { - label: "Opacity", - min: 0, - max: 1, - precision: 0.05, - handler: (e: ChangeEvent) => - localOnChange("opacity", +e.target.value), - }, - { - label: "Scale", - min: 0, - max: 10, - precision: 0.2, - handler: (e: ChangeEvent) => - localOnChange("scale", +e.target.value), - }, - ], - ] - - return ( -
- {!viewOnly && ( -
- - - DomHelper.downloadEditedImage(imageRef.current)} - /> - - Download - - - - isDirty && onCommit && onCommit(edits)} - /> - - - {isDirty ? "Save" : "Edit image to save"} - - -
- )} -
- -
-
-
-
- {(viewOnly ? viewOnlyControls : controls).map((control) => ( - - ))} -
- {!viewOnly && ( -
- {advancedControls.map((controlGroup) => { - return ( -
- {controlGroup.map((control) => ( -
- -
- ))} -
- ) - })} -
- )} -
-
-
- ) -} - -export default ImageEditor diff --git a/src/app/components/molecules/ImageEditor/index.ts b/src/app/components/molecules/ImageEditor/index.ts deleted file mode 100755 index 118d2d7..0000000 --- a/src/app/components/molecules/ImageEditor/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import ImageEditor from "./ImageEditor" - -export default ImageEditor diff --git a/src/app/components/molecules/InstaPhotos/InstaPhotos.component.scss b/src/app/components/molecules/InstaPhotos/InstaPhotos.component.scss deleted file mode 100755 index 31ea969..0000000 --- a/src/app/components/molecules/InstaPhotos/InstaPhotos.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -.ar-InstaPhotos { - -} diff --git a/src/app/components/molecules/InstaPhotos/InstaPhotos.test.ts b/src/app/components/molecules/InstaPhotos/InstaPhotos.test.ts deleted file mode 100755 index 15711fd..0000000 --- a/src/app/components/molecules/InstaPhotos/InstaPhotos.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import InstaPhotos from "./InstaPhotos" - -describe("InstaPhotos", () => { - it("renders without error", () => { - - }) -}) \ No newline at end of file diff --git a/src/app/components/molecules/InstaPhotos/InstaPhotos.tsx b/src/app/components/molecules/InstaPhotos/InstaPhotos.tsx deleted file mode 100755 index 956f659..0000000 --- a/src/app/components/molecules/InstaPhotos/InstaPhotos.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import React from "react" -import "./InstaPhotos.component.scss" - -interface InstaPhotosProps {} - -const InstaPhotos = (props: any): JSX.Element => { - return ( -
- In Component InstaPhotos -
- ) -} - -export default InstaPhotos \ No newline at end of file diff --git a/src/app/components/molecules/InstaPhotos/index.ts b/src/app/components/molecules/InstaPhotos/index.ts deleted file mode 100755 index b6b0587..0000000 --- a/src/app/components/molecules/InstaPhotos/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import InstaPhotos from "./InstaPhotos" - -export default InstaPhotos \ No newline at end of file diff --git a/src/app/components/molecules/Integrations/Integrations.component.scss b/src/app/components/molecules/Integrations/Integrations.component.scss deleted file mode 100755 index 4001e73..0000000 --- a/src/app/components/molecules/Integrations/Integrations.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -.ar-Integrations { - -} diff --git a/src/app/components/molecules/Integrations/Integrations.test.ts b/src/app/components/molecules/Integrations/Integrations.test.ts deleted file mode 100755 index e7126b2..0000000 --- a/src/app/components/molecules/Integrations/Integrations.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import Integrations from "./Integrations" - -describe("Integrations", () => { - it("renders without error", () => { - - }) -}) \ No newline at end of file diff --git a/src/app/components/molecules/Integrations/Integrations.tsx b/src/app/components/molecules/Integrations/Integrations.tsx deleted file mode 100755 index e451a0b..0000000 --- a/src/app/components/molecules/Integrations/Integrations.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import React from "react" -import "./Integrations.component.scss" - -interface IntegrationsProps {} - -const Integrations = (props: any): JSX.Element => { - return ( -
- In Component Integrations -
- ) -} - -export default Integrations \ No newline at end of file diff --git a/src/app/components/molecules/Integrations/index.ts b/src/app/components/molecules/Integrations/index.ts deleted file mode 100755 index 99898f4..0000000 --- a/src/app/components/molecules/Integrations/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import Integrations from "./Integrations" - -export default Integrations diff --git a/src/app/components/molecules/LoginProvider/LoginProvider.component.scss b/src/app/components/molecules/LoginProvider/LoginProvider.component.scss deleted file mode 100755 index eb08be3..0000000 --- a/src/app/components/molecules/LoginProvider/LoginProvider.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -.ar-LoginProvider { - width: 30rem; -} diff --git a/src/app/components/molecules/LoginProvider/LoginProvider.test.ts b/src/app/components/molecules/LoginProvider/LoginProvider.test.ts deleted file mode 100755 index 4e21d5e..0000000 --- a/src/app/components/molecules/LoginProvider/LoginProvider.test.ts +++ /dev/null @@ -1,6 +0,0 @@ -import React from "react" -import LoginProvider from "./LoginProvider" - -describe("LoginProvider", () => { - it("renders without error", () => {}) -}) diff --git a/src/app/components/molecules/LoginProvider/LoginProvider.tsx b/src/app/components/molecules/LoginProvider/LoginProvider.tsx deleted file mode 100755 index ad3e394..0000000 --- a/src/app/components/molecules/LoginProvider/LoginProvider.tsx +++ /dev/null @@ -1,26 +0,0 @@ -import { ArButtonVariants, ArSizes, LoginProviderProps } from "@armco/types" -import { Button, setRightPanelContent, useAppDispatch, WEB_CONFIG } from "../.." -import "./LoginProvider.component.scss" - -const LoginProvider = (props: LoginProviderProps): JSX.Element => { - const { url } = props - const dispatch = useAppDispatch() - return ( -
-