-
-
-
-
-
- >
- ),
- },
- },
-}
-
-const Template: ComponentStory = (args: any) => (
-
-)
-
-export const Chip = Template.bind({})
-Chip.args = {
- color: 'secondary',
- variant: 'filled',
- label: 'decline',
- type: 'decline',
- onClick: () => console.log('Decline clicked'),
- withIcon: true,
- handleDelete: () => console.log('onDelete clicked'),
-}
diff --git a/cx-portal-shared-components/src/components/basic/Chip/index.tsx b/cx-portal-shared-components/src/components/basic/Chip/index.tsx
deleted file mode 100644
index 4e8cf90c0..000000000
--- a/cx-portal-shared-components/src/components/basic/Chip/index.tsx
+++ /dev/null
@@ -1,79 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import MuiChip, { ChipProps } from '@mui/material/Chip'
-import CheckCircleOutlineIcon from '@mui/icons-material/CheckCircleOutline'
-import HighlightOffIcon from '@mui/icons-material/HighlightOff'
-import { theme } from '../../../theme'
-import AutorenewIcon from '@mui/icons-material/Autorenew'
-
-interface ChipCustomProps extends ChipProps {
- type?: 'decline' | 'confirm' | 'plain' | 'delete' | 'progress'
- withIcon?: true | false
- onDelete?: () => void
- handleDelete?: any
-}
-
-export const Chip = ({
- variant = 'filled',
- color = 'label',
- type = 'decline',
- withIcon = true,
- onDelete,
- handleDelete,
- ...props
-}: ChipCustomProps) => {
- let icon, hoverBgColor, hoverTextColor
-
- switch (type) {
- case 'decline':
- icon =
- hoverBgColor = theme.palette.declined.main
- hoverTextColor = theme.palette.declined.contrastText
- break
- case 'confirm':
- icon =
- hoverBgColor = theme.palette.confirmed.main
- hoverTextColor = theme.palette.confirmed.contrastText
- break
- case 'progress':
- icon =
- hoverBgColor = theme.palette.info.main
- hoverTextColor = theme.palette.info.contrastText
- }
-
- return (
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/CircularProgress/CircularProgress.scss b/cx-portal-shared-components/src/components/basic/CircularProgress/CircularProgress.scss
deleted file mode 100644
index cc811343b..000000000
--- a/cx-portal-shared-components/src/components/basic/CircularProgress/CircularProgress.scss
+++ /dev/null
@@ -1,266 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-@import 'src/scss/global';
-
-$loader-color: #ffa600 !default;
-$loader-size: 16px !default;
-$loader-animation-duration: 1s !default;
-
-@function circle-normal($size) {
- @return round($size * 0.70710678118) + $size;
-}
-
-@mixin circularProgress(
- $size: $loader-size,
- $color: $loader-color,
- $duration: $loader-animation-duration,
- $align: null
-) {
- $unique-name: unique-id();
- $dot-color: rgba($color, 0.05), rgba($color, 0.1), rgba($color, 0.2),
- rgba($color, 0.3), rgba($color, 0.4), rgba($color, 0.6), rgba($color, 0.8),
- rgba($color, 1);
- width: $size;
- height: $size;
- border-radius: 50%;
- position: relative;
- animation: #{'circularProgress-'}#{$unique-name} $duration linear infinite;
-
- @if ($align == null) {
- margin: $size;
- }
-
- @if ($align == center) {
- margin: 0 auto;
- }
-
- @if ($align == middle) {
- top: 50%;
- margin: 20px auto 0;
- }
-
- @keyframes #{'circularProgress-'}#{$unique-name} {
- 0% {
- box-shadow: // Top
- 0 (-circle-normal($size)) 0 0 nth($dot-color, 1),
- // Top Right
- circle-angle($size) (-circle-angle($size)) 0 0 nth($dot-color, 2),
- // Right
- circle-normal($size) 0 0 0 nth($dot-color, 3),
- // Bottom right
- circle-angle($size) circle-angle($size) 0 0 nth($dot-color, 4),
- // Bottom
- 0 circle-normal($size) 0 0 nth($dot-color, 5),
- // Bottom Left
- (-circle-angle($size)) circle-angle($size) 0 0 nth($dot-color, 6),
- // Left
- (-circle-normal($size)) 0 0 0 nth($dot-color, 7),
- // Top left
- (-circle-angle($size)) (-circle-angle($size)) 0 0 nth($dot-color, 8);
- }
-
- 12.5% {
- box-shadow: // Top
- 0 (-circle-normal($size)) 0 0 nth($dot-color, 8),
- // Top Right
- circle-angle($size) (-circle-angle($size)) 0 0 nth($dot-color, 1),
- // Right
- circle-normal($size) 0 0 0 nth($dot-color, 2),
- // Bottom right
- circle-angle($size) circle-angle($size) 0 0 nth($dot-color, 3),
- // Bottom
- 0 circle-normal($size) 0 0 nth($dot-color, 4),
- // Bottom Left
- (-circle-angle($size)) circle-angle($size) 0 0 nth($dot-color, 5),
- // Left
- (-circle-normal($size)) 0 0 0 nth($dot-color, 6),
- // Top left
- (-circle-angle($size)) (-circle-angle($size)) 0 0 nth($dot-color, 7);
- }
-
- 25% {
- box-shadow: // Top
- 0 (-circle-normal($size)) 0 0 nth($dot-color, 7),
- // Top Right
- circle-angle($size) (-circle-angle($size)) 0 0 nth($dot-color, 8),
- // Right
- circle-normal($size) 0 0 0 nth($dot-color, 1),
- // Bottom right
- circle-angle($size) circle-angle($size) 0 0 nth($dot-color, 2),
- // Bottom
- 0 circle-normal($size) 0 0 nth($dot-color, 3),
- // Bottom Left
- (-circle-angle($size)) circle-angle($size) 0 0 nth($dot-color, 4),
- // Left
- (-circle-normal($size)) 0 0 0 nth($dot-color, 5),
- // Top left
- (-circle-angle($size)) (-circle-angle($size)) 0 0 nth($dot-color, 6);
- }
-
- 37.5% {
- box-shadow: // Top
- 0 (-circle-normal($size)) 0 0 nth($dot-color, 6),
- // Top Right
- circle-angle($size) (-circle-angle($size)) 0 0 nth($dot-color, 7),
- // Right
- circle-normal($size) 0 0 0 nth($dot-color, 8),
- // Bottom right
- circle-angle($size) circle-angle($size) 0 0 nth($dot-color, 1),
- // Bottom
- 0 circle-normal($size) 0 0 nth($dot-color, 2),
- // Bottom Left
- (-circle-angle($size)) circle-angle($size) 0 0 nth($dot-color, 3),
- // Left
- (-circle-normal($size)) 0 0 0 nth($dot-color, 4),
- // Top left
- (-circle-angle($size)) (-circle-angle($size)) 0 0 nth($dot-color, 5);
- }
-
- 50% {
- box-shadow: // Top
- 0 (-circle-normal($size)) 0 0 nth($dot-color, 5),
- // Top Right
- circle-angle($size) (-circle-angle($size)) 0 0 nth($dot-color, 6),
- // Right
- circle-normal($size) 0 0 0 nth($dot-color, 7),
- // Bottom right
- circle-angle($size) circle-angle($size) 0 0 nth($dot-color, 8),
- // Bottom
- 0 circle-normal($size) 0 0 nth($dot-color, 1),
- // Bottom Left
- (-circle-angle($size)) circle-angle($size) 0 0 nth($dot-color, 2),
- // Left
- (-circle-normal($size)) 0 0 0 nth($dot-color, 3),
- // Top left
- (-circle-angle($size)) (-circle-angle($size)) 0 0 nth($dot-color, 4);
- }
-
- 62.5% {
- box-shadow: // Top
- 0 (-circle-normal($size)) 0 0 nth($dot-color, 4),
- // Top Right
- circle-angle($size) (-circle-angle($size)) 0 0 nth($dot-color, 5),
- // Right
- circle-normal($size) 0 0 0 nth($dot-color, 6),
- // Bottom right
- circle-angle($size) circle-angle($size) 0 0 nth($dot-color, 7),
- // Bottom
- 0 circle-normal($size) 0 0 nth($dot-color, 8),
- // Bottom Left
- (-circle-angle($size)) circle-angle($size) 0 0 nth($dot-color, 1),
- // Left
- (-circle-normal($size)) 0 0 0 nth($dot-color, 2),
- // Top left
- (-circle-angle($size)) (-circle-angle($size)) 0 0 nth($dot-color, 3);
- }
-
- 75% {
- box-shadow: // Top
- 0 (-circle-normal($size)) 0 0 nth($dot-color, 3),
- // Top Right
- circle-angle($size) (-circle-angle($size)) 0 0 nth($dot-color, 4),
- // Right
- circle-normal($size) 0 0 0 nth($dot-color, 5),
- // Bottom right
- circle-angle($size) circle-angle($size) 0 0 nth($dot-color, 6),
- // Bottom
- 0 circle-normal($size) 0 0 nth($dot-color, 7),
- // Bottom Lefts
- (-circle-angle($size)) circle-angle($size) 0 0 nth($dot-color, 8),
- // Left
- (-circle-normal($size)) 0 0 0 nth($dot-color, 1),
- // Top left
- (-circle-angle($size)) (-circle-angle($size)) 0 0 nth($dot-color, 2);
- }
-
- 87.5% {
- box-shadow: // Top
- 0 (-circle-normal($size)) 0 0 nth($dot-color, 2),
- // Top Right
- circle-angle($size) (-circle-angle($size)) 0 0 nth($dot-color, 3),
- // Right
- circle-normal($size) 0 0 0 nth($dot-color, 4),
- // Bottom right
- circle-angle($size) circle-angle($size) 0 0 nth($dot-color, 5),
- // Bottom
- 0 circle-normal($size) 0 0 nth($dot-color, 6),
- // Bottom Left
- (-circle-angle($size)) circle-angle($size) 0 0 nth($dot-color, 7),
- // Left
- (-circle-normal($size)) 0 0 0 nth($dot-color, 8),
- // Top left
- (-circle-angle($size)) (-circle-angle($size)) 0 0 nth($dot-color, 1);
- }
-
- 100% {
- box-shadow: // Top
- 0 (-circle-normal($size)) 0 0 nth($dot-color, 1),
- // Top Right
- circle-angle($size) (-circle-angle($size)) 0 0 nth($dot-color, 2),
- // Right
- circle-normal($size) 0 0 0 nth($dot-color, 3),
- // Bottom right
- circle-angle($size) circle-angle($size) 0 0 nth($dot-color, 4),
- // Bottom
- 0 circle-normal($size) 0 0 nth($dot-color, 5),
- // Bottom Left
- (-circle-angle($size)) circle-angle($size) 0 0 nth($dot-color, 6),
- // Left
- (-circle-normal($size)) 0 0 0 nth($dot-color, 7),
- // Top left
- (-circle-angle($size)) (-circle-angle($size)) 0 0 nth($dot-color, 8);
- }
- }
-}
-
-@mixin loader-rotate {
- @keyframes loader-rotate {
- 0% {
- transform: rotate(0);
- }
-
- 100% {
- transform: rotate(360deg);
- }
- }
-}
-
-@mixin loader-scale {
- @keyframes loader-scale {
- 0% {
- transform: scale(0);
- opacity: 0;
- }
-
- 50% {
- opacity: 1;
- }
-
- 100% {
- transform: scale(1);
- opacity: 0;
- }
- }
-}
-
-.circularProgress {
- @include circularProgress($size: 12px);
-}
diff --git a/cx-portal-shared-components/src/components/basic/CircularProgress/circularProgress.stories.tsx b/cx-portal-shared-components/src/components/basic/CircularProgress/circularProgress.stories.tsx
deleted file mode 100644
index 8387780f6..000000000
--- a/cx-portal-shared-components/src/components/basic/CircularProgress/circularProgress.stories.tsx
+++ /dev/null
@@ -1,34 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { ComponentStory } from '@storybook/react'
-
-import { CircularProgress as Component } from '.'
-
-export default {
- title: 'Loading',
- component: Component,
-}
-
-const Template: ComponentStory = (args: any) => (
-
-)
-
-export const Loading = Template.bind({})
diff --git a/cx-portal-shared-components/src/components/basic/CircularProgress/index.tsx b/cx-portal-shared-components/src/components/basic/CircularProgress/index.tsx
deleted file mode 100644
index cdef5a1c1..000000000
--- a/cx-portal-shared-components/src/components/basic/CircularProgress/index.tsx
+++ /dev/null
@@ -1,25 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import './CircularProgress.scss'
-
-export const CircularProgress = () => {
- return
-}
diff --git a/cx-portal-shared-components/src/components/basic/CustomAccordion/CustomAccordion.stories.tsx b/cx-portal-shared-components/src/components/basic/CustomAccordion/CustomAccordion.stories.tsx
deleted file mode 100644
index d51843c5a..000000000
--- a/cx-portal-shared-components/src/components/basic/CustomAccordion/CustomAccordion.stories.tsx
+++ /dev/null
@@ -1,98 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { Box, Divider, Typography } from '@mui/material'
-import { ComponentStory } from '@storybook/react'
-import { CustomAccordion as Component } from '.'
-import { Table } from '../StaticTable/StaticTable.stories'
-import { CustomAccordionProps } from './Item'
-import HomeOutlinedIcon from '@mui/icons-material/HomeOutlined'
-import SettingsOutlinedIcon from '@mui/icons-material/SettingsOutlined'
-
-export default {
- title: 'CustomAccordion',
- component: Component,
- argTypes: {
- children: {},
- },
-}
-
-const Template: ComponentStory = (args: any) => (
-
-)
-
-const item_1_open: CustomAccordionProps = {
- expanded: true,
- id: 'panel-1',
- title: 'First Item',
- icon: ,
- children: Content of the first item,
-}
-
-const item_1_open_colored: CustomAccordionProps = {
- expanded: false,
- id: 'panel-1',
- title: 'First Item',
- icon: ,
- color: 'background.background09',
- children: (
-
- Content of the first item
-
-
- You can add any complex content into the accordion item. For example a
- table:
-
-
-
- ),
-}
-const item_2_closed: CustomAccordionProps = {
- expanded: false,
- id: 'panel-2',
- icon: ,
- title: 'Second Item',
- children: Content of the second item,
-}
-const item_3_closed: CustomAccordionProps = {
- expanded: false,
- id: 'panel-3',
- title: 'Third Item',
- children: Content of the third item,
-}
-
-export const BasicAccordion = Template.bind({})
-BasicAccordion.args = {
- items: [item_1_open, item_2_closed, item_3_closed],
-}
-
-export const ColoredAccordion = Template.bind({})
-ColoredAccordion.args = {
- items: [item_1_open_colored, item_2_closed, item_3_closed],
-}
diff --git a/cx-portal-shared-components/src/components/basic/CustomAccordion/Item.tsx b/cx-portal-shared-components/src/components/basic/CustomAccordion/Item.tsx
deleted file mode 100644
index 815d5d8a8..000000000
--- a/cx-portal-shared-components/src/components/basic/CustomAccordion/Item.tsx
+++ /dev/null
@@ -1,86 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import React from 'react'
-import Accordion, { AccordionProps } from '@mui/material/Accordion'
-import AccordionSummary from '@mui/material/AccordionSummary'
-import AccordionDetails from '@mui/material/AccordionDetails'
-import { Box, Typography } from '@mui/material'
-import ExpandMoreIcon from '@mui/icons-material/ExpandMore'
-
-export interface CustomAccordionProps extends AccordionProps {
- expanded: boolean | undefined
- id: string
- title: string
- children: React.ReactElement
- color?: string
- icon?: React.ReactElement
- titleElement?: React.ReactElement
-}
-
-export const CustomAccordionItem = ({
- expanded,
- id,
- title,
- children,
- color,
- icon,
- titleElement,
- ...props
-}: CustomAccordionProps) => {
- return (
-
- }
- sx={{
- bgcolor: color,
- ':hover': {
- bgcolor: 'background.background12',
- },
- ':focus': {
- boxShadow: 'none !important',
- bgcolor: 'background.background12',
- },
- }}
- >
- {icon && (
- {icon}
- )}
- {titleElement}
- {title}
-
-
- {children}
-
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/CustomAccordion/index.tsx b/cx-portal-shared-components/src/components/basic/CustomAccordion/index.tsx
deleted file mode 100644
index a8d45ad30..000000000
--- a/cx-portal-shared-components/src/components/basic/CustomAccordion/index.tsx
+++ /dev/null
@@ -1,46 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { useState } from 'react'
-import { CustomAccordionItem, CustomAccordionProps } from './Item'
-
-export const CustomAccordion = ({
- items,
-}: {
- items: CustomAccordionProps[]
-}) => {
- const defaultExpanded = items.map((item) => (item.expanded ? item.id : ''))[0]
- const [expanded, setExpanded] = useState(defaultExpanded)
-
- const handleChange =
- (panel: string) => (_event: React.SyntheticEvent, newExpanded: boolean) => {
- setExpanded(newExpanded ? panel : false)
- }
-
- return (
- <>
- {items.map((item) => {
- item.expanded = expanded === item.id
- item.onChange = handleChange(item.id)
- return
- })}
- >
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/CustomIcons/FileErrorIcon.tsx b/cx-portal-shared-components/src/components/basic/CustomIcons/FileErrorIcon.tsx
deleted file mode 100644
index 854047efc..000000000
--- a/cx-portal-shared-components/src/components/basic/CustomIcons/FileErrorIcon.tsx
+++ /dev/null
@@ -1,41 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-interface FileIconProps {
- fillColor?: string
- size?: number
-}
-
-export const FileErrorIcon = ({ fillColor, size }: FileIconProps) => {
- return (
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/CustomIcons/FileIcon.tsx b/cx-portal-shared-components/src/components/basic/CustomIcons/FileIcon.tsx
deleted file mode 100644
index 71e646289..000000000
--- a/cx-portal-shared-components/src/components/basic/CustomIcons/FileIcon.tsx
+++ /dev/null
@@ -1,53 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-interface FileIconProps {
- fillColor?: string
- strokeColor?: string
- size?: number
-}
-
-export const FileIcon = ({ fillColor, strokeColor, size }: FileIconProps) => {
- return (
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/Datepicker/Datepicker.stories.tsx b/cx-portal-shared-components/src/components/basic/Datepicker/Datepicker.stories.tsx
deleted file mode 100644
index 5667d7e6b..000000000
--- a/cx-portal-shared-components/src/components/basic/Datepicker/Datepicker.stories.tsx
+++ /dev/null
@@ -1,53 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { ComponentStory } from '@storybook/react'
-import { Box } from '@mui/material'
-
-import { Datepicker as Component } from '.'
-
-export default {
- title: 'Datepicker',
- component: Component,
- argTypes: {},
-}
-
-const Template: ComponentStory = (args: any) => (
-
-
-
-)
-
-export const DatePicker = Template.bind({})
-DatePicker.args = {
- label: 'Date label',
- placeholder: 'Enter a date',
- helperText: 'Helper',
- disabled: false,
- error: false,
- margin: 'dense',
- variant: 'filled',
- locale: 'en',
- defaultValue: new Date(),
- readOnly: false,
- daySelectedColor: '#0F71CB',
- todayColor: '#939393',
- onChangeItem: (date: any) => console.log('date:', date),
-}
diff --git a/cx-portal-shared-components/src/components/basic/Datepicker/index.tsx b/cx-portal-shared-components/src/components/basic/Datepicker/index.tsx
deleted file mode 100644
index 9647d79fb..000000000
--- a/cx-portal-shared-components/src/components/basic/Datepicker/index.tsx
+++ /dev/null
@@ -1,188 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { useEffect, useState } from 'react'
-import { Box, Button } from '@mui/material'
-import { TextFieldProps } from '@mui/material/TextField'
-import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFns'
-import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider'
-import { DatePicker } from '@mui/x-date-pickers/DatePicker'
-import { PickersDayProps } from '@mui/x-date-pickers/PickersDay'
-import { Input } from '../Input'
-import deLocale from 'date-fns/locale/de'
-import enLocale from 'date-fns/locale/en-US'
-import uniqueId from 'lodash/uniqueId'
-
-export type DateType = Date | null
-export interface DatepickerProps extends Omit {
- label: string
- placeholder: string
- variant?: 'filled'
- locale: 'en' | 'de'
- defaultValue?: DateType
- readOnly: boolean
- daySelectedColor?: string
- todayColor?: string
- onChangeItem: (items: DateType) => void
-}
-
-const localeMap = {
- en: enLocale,
- de: deLocale,
-}
-
-export const Datepicker = ({
- label,
- placeholder,
- variant,
- margin,
- helperText,
- error = false,
- disabled,
- locale = 'en',
- defaultValue,
- readOnly,
- daySelectedColor = '#0F71CB',
- todayColor = '#939393',
- onChangeItem,
-}: DatepickerProps) => {
- const [value, setValue] = useState(null)
- const [open, setOpen] = useState(false)
-
- useEffect(() => {
- if (defaultValue) {
- setValue(new Date(defaultValue))
- }
- }, [defaultValue])
-
- const handleChange = (newValue: DateType) => {
- if (newValue) {
- setValue(new Date(newValue))
- }
- onChangeItem(newValue)
- handleClose()
- }
-
- const handleOpen = () => {
- if (!readOnly && !disabled) {
- setOpen(true)
- }
- }
-
- const handleClose = () => {
- setOpen(false)
- }
-
- const iconColor = open ? daySelectedColor : '#939393'
- return (
-
-
- handleChange(newValue)}
- onClose={() => handleClose()}
- inputFormat={'yyyy-MM-dd'}
- renderInput={(params) => (
-
-
-
- )}
- renderDay={(
- day: Date,
- _selectedDays: Date[],
- pickersDayProps: PickersDayProps
- ) => {
- const bgColor = pickersDayProps.today ? todayColor : '#fff'
- const bgSelected = pickersDayProps.selected
- ? daySelectedColor
- : bgColor
- const colorSelected = pickersDayProps.selected ? '#fff' : '#202020'
- const isBold = pickersDayProps.today ? '500' : '400'
-
- return (
-
- {day ? (
-
- ) : (
-
- )}
-
- )
- }}
- PaperProps={{
- sx: { marginLeft: '16px' },
- }}
- />
-
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/Dialog/Dialog.stories.tsx b/cx-portal-shared-components/src/components/basic/Dialog/Dialog.stories.tsx
deleted file mode 100644
index 4b6a97273..000000000
--- a/cx-portal-shared-components/src/components/basic/Dialog/Dialog.stories.tsx
+++ /dev/null
@@ -1,65 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { ComponentStory } from '@storybook/react'
-
-import { Dialog as Component } from '.'
-import { Button } from '../Button'
-import { DialogActions } from './DialogActions'
-import { DialogContent } from './DialogContent'
-import { DialogHeader } from './DialogHeader'
-
-export default {
- title: 'Modal',
- component: Component,
- argTypes: {
- maxWidth: {
- control: 'inline-radio',
- options: [undefined, 'sm', 'md', 'lg', 'xl'],
- },
- },
- args: {
- open: true,
- maxWidth: undefined,
- fullWidth: false,
- title: 'Title',
- intro:
- 'Optional intro. Lorem ipsum dolor sit amet consectetur adipisicing elit.',
- content: 'Content goes here.',
- helperText: 'Lorem ipsum dolor sit amet consectetur adipisicing elit.',
- },
-}
-
-const DialogTemplate: ComponentStory = (args: any) => {
- const { title, intro, content, helperText, ...componentArgs } = args
-
- return (
-
-
- {content}
-
-
-
-
-
- )
-}
-
-export const Dialog = DialogTemplate.bind({})
diff --git a/cx-portal-shared-components/src/components/basic/Dialog/DialogActions.stories.tsx b/cx-portal-shared-components/src/components/basic/Dialog/DialogActions.stories.tsx
deleted file mode 100644
index 1ee5b5ce6..000000000
--- a/cx-portal-shared-components/src/components/basic/Dialog/DialogActions.stories.tsx
+++ /dev/null
@@ -1,41 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { ComponentStory } from '@storybook/react'
-
-import { DialogActions as Component } from './DialogActions'
-import { Button } from '../Button'
-
-export default {
- title: 'Modal',
- component: Component,
-}
-
-const Template: ComponentStory = (args: any) => (
-
-
-
-
-)
-
-export const DialogActions = Template.bind({})
-DialogActions.args = {
- helperText: 'Lorem ipsum dolor sit amet consectetur adipisicing elit.',
-}
diff --git a/cx-portal-shared-components/src/components/basic/Dialog/DialogActions.tsx b/cx-portal-shared-components/src/components/basic/Dialog/DialogActions.tsx
deleted file mode 100644
index e04dcdfc5..000000000
--- a/cx-portal-shared-components/src/components/basic/Dialog/DialogActions.tsx
+++ /dev/null
@@ -1,55 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { Box, useTheme } from '@mui/material'
-import MuiDialogActions, {
- DialogActionsProps as MuiDialogActionsProps,
-} from '@mui/material/DialogActions'
-import { CONTENT_SPACING_RIGHT_LEFT } from './index'
-
-export interface DialogActionProps extends MuiDialogActionsProps {
- helperText?: string
-}
-
-export const DialogActions = ({
- children,
- helperText,
- ...props
-}: DialogActionProps) => {
- const { spacing } = useTheme()
-
- return (
-
- {helperText && (
-
- {helperText}
-
- )}
- {children}
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/Dialog/DialogContent.tsx b/cx-portal-shared-components/src/components/basic/Dialog/DialogContent.tsx
deleted file mode 100644
index 4da7f0f1f..000000000
--- a/cx-portal-shared-components/src/components/basic/Dialog/DialogContent.tsx
+++ /dev/null
@@ -1,47 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { useTheme } from '@mui/material'
-import MuiDialogContent, {
- DialogContentProps as MuiDialogContentProps,
-} from '@mui/material/DialogContent'
-import { CONTENT_SPACING_RIGHT_LEFT } from './index'
-
-export type DialogContentProps = MuiDialogContentProps
-
-export const DialogContent = (props: DialogContentProps) => {
- const { spacing } = useTheme()
-
- return (
- *': {
- textAlign: 'left',
- },
- }}
- {...props}
- >
- {props.children}
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/Dialog/DialogHeader.stories.tsx b/cx-portal-shared-components/src/components/basic/Dialog/DialogHeader.stories.tsx
deleted file mode 100644
index 8575627e2..000000000
--- a/cx-portal-shared-components/src/components/basic/Dialog/DialogHeader.stories.tsx
+++ /dev/null
@@ -1,40 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { ComponentStory } from '@storybook/react'
-
-import { DialogHeader as Component } from './DialogHeader'
-
-export default {
- title: 'Modal',
- component: Component,
-}
-
-const Template: ComponentStory = (args: any) => (
-
-)
-
-export const DialogHeader = Template.bind({})
-DialogHeader.args = {
- title: 'Title',
- intro:
- 'Optional intro. Lorem ipsum dolor sit amet consectetur adipisicing elit.',
- closeWithIcon: false,
-}
diff --git a/cx-portal-shared-components/src/components/basic/Dialog/DialogHeader.tsx b/cx-portal-shared-components/src/components/basic/Dialog/DialogHeader.tsx
deleted file mode 100644
index ed82ad6d9..000000000
--- a/cx-portal-shared-components/src/components/basic/Dialog/DialogHeader.tsx
+++ /dev/null
@@ -1,92 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import React from 'react'
-import { Box, useTheme } from '@mui/material'
-import MuiDialogTitle from '@mui/material/DialogTitle'
-import { Typography } from '../Typography'
-import { IconButton } from '../IconButton'
-import CloseIcon from '@mui/icons-material/Close'
-import CheckCircleOutlineOutlinedIcon from '@mui/icons-material/CheckCircleOutlineOutlined'
-import { CONTENT_SPACING_RIGHT_LEFT } from './index'
-
-export interface DialogHeaderProps {
- title?: string | JSX.Element
- intro?: string | JSX.Element
- icon?: boolean
- closeWithIcon?: boolean
- onCloseWithIcon?: (event: React.MouseEvent) => void
- iconComponent?: JSX.Element
- children?: JSX.Element
-}
-
-export const DialogHeader = ({
- title,
- intro,
- icon,
- closeWithIcon,
- iconComponent = (
-
- ),
- children,
- onCloseWithIcon,
-}: DialogHeaderProps) => {
- const { spacing, palette } = useTheme()
-
- return (
-
- {title && (
-
- {icon && {iconComponent}}
- {title}
- {closeWithIcon && (
-
-
-
- )}
-
- )}
- {intro && (
-
- {intro}
-
- )}
- {children}
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/Dialog/index.tsx b/cx-portal-shared-components/src/components/basic/Dialog/index.tsx
deleted file mode 100644
index 0ce1c8f00..000000000
--- a/cx-portal-shared-components/src/components/basic/Dialog/index.tsx
+++ /dev/null
@@ -1,71 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { useTheme } from '@mui/material'
-import MuiDialog, { DialogProps as MuiDialogProps } from '@mui/material/Dialog'
-
-export const CONTENT_SPACING_RIGHT_LEFT = 10
-const MODAL_DEFAULT_WIDTH = '1000px'
-
-interface AddtionalDialogProps {
- modalBorderRadius?: number
- additionalModalRootStyles?: any
-}
-
-export type DialogProps = Pick<
- MuiDialogProps,
- 'children' | 'open' | 'scroll' | 'sx' | 'fullWidth' | 'maxWidth'
->
-
-export const Dialog = ({
- scroll = 'body',
- modalBorderRadius,
- additionalModalRootStyles = {},
- fullWidth,
- maxWidth,
- ...props
-}: DialogProps & AddtionalDialogProps) => {
- const theme = useTheme()
-
- const radius =
- modalBorderRadius && modalBorderRadius !== 0 ? modalBorderRadius : 20
-
- const fullScreenWidth = `calc(100vw - ${theme.spacing(8)})`
-
- const defaultWidth = maxWidth ? 'auto' : MODAL_DEFAULT_WIDTH
- const width = fullWidth ? fullScreenWidth : defaultWidth
-
- return (
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/DropdownMenu/DropdownMenu.stories.tsx b/cx-portal-shared-components/src/components/basic/DropdownMenu/DropdownMenu.stories.tsx
deleted file mode 100644
index f400432e1..000000000
--- a/cx-portal-shared-components/src/components/basic/DropdownMenu/DropdownMenu.stories.tsx
+++ /dev/null
@@ -1,51 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import EditIcon from '@mui/icons-material/Edit'
-import FileCopyIcon from '@mui/icons-material/FileCopy'
-import MenuItem from '@mui/material/MenuItem'
-import { ComponentStory } from '@storybook/react'
-
-import { DropdownMenu as Component } from '.'
-
-export default {
- title: 'Dropdown Menu',
- component: Component,
- args: {
- buttonText: 'Admin',
- },
-}
-
-const Template: ComponentStory = (args: any) => (
-
-
-
-
-
-
-)
-
-export const DropdownMenu = Template.bind({})
diff --git a/cx-portal-shared-components/src/components/basic/DropdownMenu/index.tsx b/cx-portal-shared-components/src/components/basic/DropdownMenu/index.tsx
deleted file mode 100644
index a46b09666..000000000
--- a/cx-portal-shared-components/src/components/basic/DropdownMenu/index.tsx
+++ /dev/null
@@ -1,112 +0,0 @@
-import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown'
-import KeyboardArrowUpIcon from '@mui/icons-material/KeyboardArrowUp'
-import { useTheme } from '@mui/material'
-import Button from '@mui/material/Button'
-import Menu from '@mui/material/Menu'
-import { Theme } from '@mui/material/styles'
-import { SxProps } from '@mui/system'
-import * as React from 'react'
-import { PropsWithChildren, useRef, useState } from 'react'
-
-export interface DropdownMenuProps {
- buttonText: string | JSX.Element
- buttonSx?: SxProps
- menuSx?: SxProps
-}
-
-export const DropdownMenu = ({
- buttonText,
- children,
- buttonSx,
- menuSx,
-}: PropsWithChildren) => {
- const theme = useTheme()
-
- const [open, setOpen] = useState(false)
-
- const anchorElRef = useRef(null)
-
- const handleOpen = () => {
- setOpen(true)
- }
-
- const handleClose = () => {
- setOpen(false)
- }
-
- return (
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/Dropzone/DropArea.stories.tsx b/cx-portal-shared-components/src/components/basic/Dropzone/DropArea.stories.tsx
deleted file mode 100644
index 909a74aef..000000000
--- a/cx-portal-shared-components/src/components/basic/Dropzone/DropArea.stories.tsx
+++ /dev/null
@@ -1,44 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { ComponentStory } from '@storybook/react'
-
-import { DropArea as Component } from './components/DropArea'
-
-export default {
- title: 'Dropzone',
- component: Component,
- args: {
- size: 'normal',
- disabled: false,
- error: '',
- translations: {
- title: 'Drag & drop your files here',
- subTitle: 'or %browse files% on your computer.',
- errorTitle: 'Sorry',
- },
- },
-}
-
-const Template: ComponentStory = (args: any) => (
-
-)
-
-export const DropArea = Template.bind({})
diff --git a/cx-portal-shared-components/src/components/basic/Dropzone/DropPreview.stories.tsx b/cx-portal-shared-components/src/components/basic/Dropzone/DropPreview.stories.tsx
deleted file mode 100644
index 2ef78b1ea..000000000
--- a/cx-portal-shared-components/src/components/basic/Dropzone/DropPreview.stories.tsx
+++ /dev/null
@@ -1,68 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { ComponentStory } from '@storybook/react'
-
-import { DropPreview as Component } from './components/DropPreview'
-import { UploadStatus } from './types'
-
-export default {
- title: 'Dropzone',
- component: Component,
- args: {
- uploadFiles: [
- { name: 'Test123.pdf', size: 44345000, status: UploadStatus.NEW },
- {
- name: 'Document.pdf',
- size: 65402,
- status: UploadStatus.UPLOADING,
- progressPercent: 45,
- },
- {
- name: 'Das ist ein sehr langer Name von einer Datei - der Name ist wirklich äußerst, äußerst lang...!.pdf',
- size: 32003,
- status: UploadStatus.NEW,
- },
- {
- name: 'My pretty PDF.pdf',
- size: 54676543,
- status: UploadStatus.UPLOAD_SUCCESS,
- },
- {
- name: 'Nix wars.xls',
- size: 543545,
- status: UploadStatus.UPLOAD_ERROR,
- },
- ],
- translations: {
- placeholder: 'Lorem Ipsum: Wieviele sachen willst du hochladen',
- uploadProgess: 'Uploaded % of % files',
- uploadSuccess: 'Uploaded',
- uploadError: 'Not Uploaded',
- },
- placeholder: false,
- },
-}
-
-const Template: ComponentStory = (args: any) => (
-
-)
-
-export const DropPreview = Template.bind({})
diff --git a/cx-portal-shared-components/src/components/basic/Dropzone/DropPreviewFile.stories.tsx b/cx-portal-shared-components/src/components/basic/Dropzone/DropPreviewFile.stories.tsx
deleted file mode 100644
index 7f9505c9e..000000000
--- a/cx-portal-shared-components/src/components/basic/Dropzone/DropPreviewFile.stories.tsx
+++ /dev/null
@@ -1,65 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { ComponentStory } from '@storybook/react'
-
-import { DropPreviewFile as Component } from './components/DropPreviewFile'
-import { UploadStatus } from './types'
-
-export default {
- title: 'Dropzone',
- component: Component,
- args: {
- name: 'Document.pdf',
- size: 65402,
- status: UploadStatus.NEW,
- progressPercent: 0,
- translations: {
- placeholder: 'Lorem Ipsum: Wieviele sachen willst du hochladen',
- uploadProgess: 'Uploaded % of % files',
- uploadSuccess: 'Uploaded',
- uploadError: 'Not Uploaded',
- },
- placeholder: false,
- },
- argTypes: {
- status: {
- control: 'radio',
- options: [
- UploadStatus.NEW,
- UploadStatus.UPLOADING,
- UploadStatus.UPLOAD_SUCCESS,
- UploadStatus.UPLOAD_ERROR,
- ],
- },
- },
-}
-
-const Template: ComponentStory = (args: any) => {
- const { name, size, status, progressPercent, ...props } = args
- return (
-
- )
-}
-
-export const DropPreviewFile = Template.bind({})
diff --git a/cx-portal-shared-components/src/components/basic/Dropzone/Dropzone.stories.tsx b/cx-portal-shared-components/src/components/basic/Dropzone/Dropzone.stories.tsx
deleted file mode 100644
index a22859696..000000000
--- a/cx-portal-shared-components/src/components/basic/Dropzone/Dropzone.stories.tsx
+++ /dev/null
@@ -1,72 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { ComponentStory } from '@storybook/react'
-
-import { DropzoneOldDEPRECATED as Component } from './old_deprecated'
-
-export default {
- title: 'Dropzone',
- component: Component,
- argTypes: {
- onClick: {
- action: 'onClick',
- },
- },
-}
-
-const Template: ComponentStory = (args: any) => (
-
-)
-
-export const DropzoneOldDEPRECATED = Template.bind({})
-DropzoneOldDEPRECATED.args = {
- inputContentTitle: 'Drag & drop your files here',
- inputContentSubTitle: 'or %browse files% on your computer.',
- size: 'normal',
- accept: 'image/*,audio/*,video/*',
- getUploadParams: () => ({ url: 'https://httpbin.org/post' }),
- statusText: {
- rejected_file_type: 'Rejected file type',
- rejected_max_files: 'Rejected max files',
- preparing: 'Preparing',
- error_file_size: 'Error file size',
- error_validation: 'Error validation',
- ready: 'Ready',
- started: 'Started',
- getting_upload_params: 'Getting upload_params',
- error_upload_params: 'Error_upload_params',
- uploading: 'Uploading',
- exception_upload: 'Exception_upload',
- aborted: 'Aborted',
- restarted: 'Restarted',
- removed: 'Removed',
- error_upload: 'Error_upload',
- headers_received: 'Headers_received',
- done: 'Done',
- },
- errorStatus: [
- 'error_upload_params',
- 'exception_upload',
- 'error_upload',
- 'aborted',
- 'ready',
- ],
-}
diff --git a/cx-portal-shared-components/src/components/basic/Dropzone/components/DeleteConfirmOverlay.tsx b/cx-portal-shared-components/src/components/basic/Dropzone/components/DeleteConfirmOverlay.tsx
deleted file mode 100644
index 3afc4c900..000000000
--- a/cx-portal-shared-components/src/components/basic/Dropzone/components/DeleteConfirmOverlay.tsx
+++ /dev/null
@@ -1,81 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { FunctionComponent } from 'react'
-import { Button } from '../../Button'
-import { Dialog } from '../../Dialog'
-import { DialogActions } from '../../Dialog/DialogActions'
-import { DialogContent } from '../../Dialog/DialogContent'
-import { DialogHeader } from '../../Dialog/DialogHeader'
-import { deleteConfirmOverlayTranslation } from '../types'
-
-export interface DeleteConfirmOverlayProps {
- deleteOverlay: boolean
- onCallback: (closeOverlay: boolean) => void
- deleteOverlayTranslation?: deleteConfirmOverlayTranslation
-}
-
-export const DeleteConfirmOverlay: FunctionComponent<
- DeleteConfirmOverlayProps
-> = ({ onCallback, deleteOverlay = false, deleteOverlayTranslation }) => {
- return (
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/Dropzone/components/DropArea.tsx b/cx-portal-shared-components/src/components/basic/Dropzone/components/DropArea.tsx
deleted file mode 100644
index 82ddcf81b..000000000
--- a/cx-portal-shared-components/src/components/basic/Dropzone/components/DropArea.tsx
+++ /dev/null
@@ -1,172 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { Box, Link, useTheme } from '@mui/material'
-import { Fragment, FunctionComponent, useState } from 'react'
-import { FileErrorIcon } from '../../CustomIcons/FileErrorIcon'
-import { Typography } from '../../Typography'
-import UploadFileIcon from '@mui/icons-material/UploadFile'
-import { DropZoneDropAreaTranslations } from '../types'
-import { Alert } from '../../Alert'
-
-export interface DropAreaProps {
- translations: DropZoneDropAreaTranslations
- children?: JSX.Element | JSX.Element[]
- disabled?: boolean
- error?: boolean | string
- size?: 'normal' | 'small'
-}
-
-export const DropArea: FunctionComponent = ({
- translations,
- children,
- error,
- disabled = false,
- size = 'normal',
-}) => {
- const theme = useTheme()
-
- const { title, subTitle } = translations
-
- const [isDragging, setDragging] = useState(false)
-
- let formattedSubtitle = subTitle
- if (typeof subTitle === 'string') {
- const subTitleParts = subTitle.split('%')
- if (subTitleParts.length === 3) {
- formattedSubtitle = (
-
- {subTitleParts[0]}
- {subTitleParts[1]}
- {subTitleParts[2]}
-
- )
- }
- }
-
- const hasGenericError = error === true
- const hasErrorMessage = error && typeof error === 'string'
-
- const errorBackground = hasGenericError && 'declined.main'
- const disabledBackground = disabled && 'action.disabledBackground'
- const draggingBackground = isDragging && 'selected.active'
-
- const borderRadius = 24
- const borderColor = hasGenericError
- ? encodeURIComponent(theme.palette.danger.danger)
- : 'rgb(7, 73, 133)'
- const dashedBorder = `"data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='${borderRadius}' ry='${borderRadius}' stroke='${borderColor}' stroke-width='2' stroke-dasharray='2%2c 6' stroke-dashoffset='0' stroke-linecap='square'/%3e%3c/svg%3e"`
-
- return (
-
- !disabled && setDragging(true)}
- onDragLeave={() => setDragging(false)}
- onDrop={() => setDragging(false)}
- sx={{
- position: 'relative',
- transition: theme.transitions.create('background-color'),
- borderRadius: `${borderRadius}px`,
- border: 'none',
- backgroundImage: disabled ? 'none' : `url(${dashedBorder})`,
- textAlign: 'center',
- backgroundColor:
- disabledBackground ||
- errorBackground ||
- draggingBackground ||
- 'selected.hover',
- '&:hover': {
- backgroundColor:
- disabledBackground ||
- errorBackground ||
- draggingBackground ||
- 'selected.focus',
- },
- cursor: disabled ? 'not-allowed' : 'pointer',
- }}
- >
-
-
-
- {hasGenericError ? (
-
- ) : (
-
- )}
-
-
-
- {title}
-
-
- {formattedSubtitle}
-
-
-
-
- {children}
-
-
-
- {hasErrorMessage && (
-
-
- {error}
-
-
- )}
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/Dropzone/components/DropPreview.tsx b/cx-portal-shared-components/src/components/basic/Dropzone/components/DropPreview.tsx
deleted file mode 100644
index 66ff20db6..000000000
--- a/cx-portal-shared-components/src/components/basic/Dropzone/components/DropPreview.tsx
+++ /dev/null
@@ -1,168 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { Box } from '@mui/material'
-import { FunctionComponent, useState } from 'react'
-import {
- DropZonePreviewTranslations,
- UploadFile,
- deleteConfirmOverlayTranslation,
- UploadStatus,
-} from '../types'
-import { DeleteConfirmOverlay } from './DeleteConfirmOverlay'
-import {
- DropPreviewFile as DefaultDropPreviewFile,
- DropPreviewFileProps,
-} from './DropPreviewFile'
-
-export interface DropPreviewProps {
- uploadFiles: UploadFile[]
- onDelete?: (deleteIndex: number, documentId: string) => void
- onDownload?: (name: string, id: string) => void
- translations: DropZonePreviewTranslations
-
- DropStatusHeader?: FunctionComponent | false
- DropPreviewFile?: FunctionComponent | false
- enableDeleteIcon?: boolean
- enableDeleteOverlay?: boolean
- deleteOverlayTranslation?: deleteConfirmOverlayTranslation
-}
-
-export interface DropStatusHeaderProps {
- numUploaded: number
- numTotal: number
-}
-
-export const DropPreview: FunctionComponent = ({
- uploadFiles,
- translations,
- onDelete,
- onDownload,
- DropStatusHeader,
- DropPreviewFile,
- enableDeleteIcon = true,
- enableDeleteOverlay = false,
- deleteOverlayTranslation,
-}) => {
- const [deletestatus, setDeleteStatus] = useState({ index: 0, state: false })
-
- const isFinished = (file: UploadFile) =>
- file.status === UploadStatus.UPLOAD_SUCCESS ||
- file.status === UploadStatus.UPLOAD_ERROR
-
- const filesCount = uploadFiles.length
-
- const finishedFilesCount = uploadFiles.filter(isFinished).length
- const uploadedFilesCount = uploadFiles.filter(
- (file) =>
- file.status === UploadStatus.UPLOAD_SUCCESS ||
- file.status === UploadStatus.NEW
- ).length
-
- const DefaultDropStatusHeader: typeof DropStatusHeader = ({
- numUploaded,
- numTotal,
- }) => {
- const uploadProgress = translations.uploadProgess
- .replace('%', numUploaded.toString())
- .replace('%', numTotal.toString())
-
- return (
-
- {filesCount ? uploadProgress : translations.placeholder}
-
- )
- }
-
- let DropStatusHeaderComponent = DefaultDropStatusHeader
- if (DropStatusHeader) {
- DropStatusHeaderComponent = DropStatusHeader
- } else if (DropStatusHeader === false) {
- DropStatusHeaderComponent = () => null
- }
-
- let DropPreviewFileComponent = DefaultDropPreviewFile
- if (DropPreviewFile) {
- DropPreviewFileComponent = DropPreviewFile
- } else if (DropPreviewFile === false) {
- DropPreviewFileComponent = () => null
- }
-
- const onCallback = (closeOverlay: boolean) => {
- if (closeOverlay) {
- onDelete?.(deletestatus.index, '')
- }
- setDeleteStatus({ index: 0, state: false })
- }
-
- return (
- <>
- onCallback(closeOverlay)}
- deleteOverlay={deletestatus.state}
- deleteOverlayTranslation={deleteOverlayTranslation}
- />
-
-
- {finishedFilesCount > 0 && (
-
- {uploadFiles
- .filter((file) => isFinished(file))
- .map((file, index) => (
-
- enableDeleteOverlay
- ? setDeleteStatus({ index: index, state: true })
- : file.id && onDelete?.(index, file.id)
- }
- enableDeleteIcon={enableDeleteIcon}
- onDownload={() => file.id && onDownload?.(file.name, file.id)}
- />
- ))}
-
- )}
- {filesCount - finishedFilesCount > 0 && (
-
- {uploadFiles
- .filter((file) => !isFinished(file))
- .map((file, index) => (
-
- enableDeleteOverlay
- ? setDeleteStatus({ index: index, state: true })
- : onDelete?.(index, '')
- }
- />
- ))}
-
- )}
-
- >
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/Dropzone/components/DropPreviewFile.tsx b/cx-portal-shared-components/src/components/basic/Dropzone/components/DropPreviewFile.tsx
deleted file mode 100644
index c7e664201..000000000
--- a/cx-portal-shared-components/src/components/basic/Dropzone/components/DropPreviewFile.tsx
+++ /dev/null
@@ -1,221 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { Box, IconButton, useTheme } from '@mui/material'
-import React, { FunctionComponent, useEffect, useRef, useState } from 'react'
-import { DropZonePreviewTranslations, UploadFile, UploadStatus } from '../types'
-import { FileIcon } from '../../CustomIcons/FileIcon'
-import DeleteOutlineIcon from '@mui/icons-material/DeleteOutline'
-
-const FAKE_UPLOAD_DURATION = 6000
-
-const formatBytes = (b: number) => {
- const units = ['bytes', 'KB', 'MB']
- let l = 0
- let n = b
-
- while (n >= 1024) {
- n /= 1024
- l += 1
- }
-
- return `${n?.toFixed?.(n >= 10 || l < 1 ? 0 : 1)} ${units[l]}`
-}
-
-export interface DropPreviewFileProps {
- uploadFile: UploadFile
- onDelete?: () => void
- translations: DropZonePreviewTranslations
- enableDeleteIcon?: boolean
- onDownload?: () => void
-}
-
-export const DropPreviewFile: FunctionComponent = ({
- uploadFile,
- translations,
- onDelete,
- enableDeleteIcon = true,
- onDownload,
-}) => {
- const theme = useTheme()
-
- const [fakeProgressPercent, setFakeProgressPercent] = useState(0)
- const fakeProgressTimeRef = useRef(0)
-
- const progressPercent = uploadFile.progressPercent || fakeProgressPercent
-
- useEffect(() => {
- if (
- uploadFile.status === UploadStatus.UPLOADING &&
- fakeProgressTimeRef.current === 0
- ) {
- const intervalFrequency = 50
-
- const updateProgress = () => {
- fakeProgressTimeRef.current += intervalFrequency
-
- setFakeProgressPercent(
- Math.log2(
- 1 + (fakeProgressTimeRef.current / FAKE_UPLOAD_DURATION) * 5
- ) * 33
- )
-
- if (fakeProgressTimeRef.current < FAKE_UPLOAD_DURATION) {
- setTimeout(updateProgress, intervalFrequency)
- } else {
- fakeProgressTimeRef.current = 0
- }
- }
-
- updateProgress()
- }
- }, [uploadFile.status])
-
- const isUploading = uploadFile.status === UploadStatus.UPLOADING
-
- let tagLabel
-
- switch (uploadFile.status) {
- case UploadStatus.UPLOAD_SUCCESS:
- tagLabel = translations.uploadSuccess
- break
- case UploadStatus.UPLOAD_ERROR:
- tagLabel = translations.uploadError
- break
- }
-
- const showDeleteButton =
- enableDeleteIcon &&
- uploadFile.status !== UploadStatus.UPLOADING &&
- uploadFile.status !== UploadStatus.UPLOAD_ERROR
-
- return (
-
-
-
-
-
- onDownload?.()}
- >
- {uploadFile.name}
-
-
- {uploadFile?.size && formatBytes(uploadFile.size)}
-
-
- {tagLabel && (
-
-
- {tagLabel}
-
-
- )}
-
- onDelete?.()}>
-
-
-
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/Dropzone/index.tsx b/cx-portal-shared-components/src/components/basic/Dropzone/index.tsx
deleted file mode 100644
index bfd37321b..000000000
--- a/cx-portal-shared-components/src/components/basic/Dropzone/index.tsx
+++ /dev/null
@@ -1,4 +0,0 @@
-export * from './types'
-export * from './components/DropArea'
-export * from './components/DropPreview'
-export * from './components/DropPreviewFile'
diff --git a/cx-portal-shared-components/src/components/basic/Dropzone/old_deprecated/DropzoneTypes.tsx b/cx-portal-shared-components/src/components/basic/Dropzone/old_deprecated/DropzoneTypes.tsx
deleted file mode 100644
index b916c1c61..000000000
--- a/cx-portal-shared-components/src/components/basic/Dropzone/old_deprecated/DropzoneTypes.tsx
+++ /dev/null
@@ -1,232 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-export type StatusValue =
- | 'rejected_file_type'
- | 'rejected_max_files'
- | 'preparing'
- | 'error_file_size'
- | 'error_validation'
- | 'ready'
- | 'started'
- | 'getting_upload_params'
- | 'error_upload_params'
- | 'uploading'
- | 'exception_upload'
- | 'aborted'
- | 'restarted'
- | 'removed'
- | 'error_upload'
- | 'headers_received'
- | 'done'
-
-export type MethodValue =
- | 'delete'
- | 'get'
- | 'head'
- | 'options'
- | 'patch'
- | 'post'
- | 'put'
- | 'DELETE'
- | 'GET'
- | 'HEAD'
- | 'OPTIONS'
- | 'PATCH'
- | 'POST'
- | 'PUT'
-
-export interface IMeta {
- id: string
- status: StatusValue
- type: string // MIME type, example: `image/*`
- name: string
- uploadedDate: string // ISO string
- percent: number
- size: number // bytes
- lastModifiedDate: string // ISO string
- previewUrl?: string // from URL.createObjectURL
- duration?: number // seconds
- width?: number
- height?: number
- validationError?: any
-}
-
-export interface IFileWithMeta {
- file: File
- meta: IMeta
- cancel: () => void
- restart: () => void
- remove: () => void
- xhr?: XMLHttpRequest
-}
-
-export interface IExtra {
- active: boolean
- reject: boolean
- dragged: DataTransferItem[]
- accept: string
- multiple: boolean
- minSizeBytes: number
- maxSizeBytes: number
- maxFiles: number
-}
-
-export interface IUploadParams {
- url: string
- method?: MethodValue
- body?: string | FormData | ArrayBuffer | Blob | File | URLSearchParams
- fields?: { [name: string]: string | Blob }
- headers?: { [name: string]: string }
- meta?: { [name: string]: any }
-}
-
-export type CustomizationFunction = (
- allFiles: IFileWithMeta[],
- extra: IExtra
-) => T
-
-export interface IStyleCustomization {
- dropzone?: T | CustomizationFunction
- dropzoneActive?: T | CustomizationFunction
- dropzoneReject?: T | CustomizationFunction
- dropzoneDisabled?: T | CustomizationFunction
- input?: T | CustomizationFunction
- inputLabel?: T | CustomizationFunction
- inputLabelWithFiles?: T | CustomizationFunction
- preview?: T | CustomizationFunction
-}
-
-export interface IExtraLayout extends IExtra {
- onFiles(files: File[]): void
- onCancelFile(file: IFileWithMeta): void
- onRemoveFile(file: IFileWithMeta): void
- onRestartFile(file: IFileWithMeta): void
-}
-
-export interface ILayoutProps {
- files: IFileWithMeta[]
- extra: IExtraLayout
- input: React.ReactNode
- previews: React.ReactNode[] | null
- dropzoneProps: {
- ref: React.RefObject
- className: string
- style?: React.CSSProperties
- onDragEnter(event: React.DragEvent): void
- onDragOver(event: React.DragEvent): void
- onDragLeave(event: React.DragEvent): void
- onDrop(event: React.DragEvent): void
- }
-}
-
-interface ICommonProps {
- files: IFileWithMeta[]
- extra: IExtra
-}
-
-export interface IPreviewProps extends ICommonProps {
- meta: IMeta
- className?: string
- imageClassName?: string
- style?: React.CSSProperties
- imageStyle?: React.CSSProperties
- fileWithMeta: IFileWithMeta
- isUpload: boolean
- errorStatus: String[]
- statusText: Partial
-}
-
-export interface IInputProps extends ICommonProps {
- inputClassName?: string
- labelClassName?: string
- labelWithFilesClassName?: string
- style?: React.CSSProperties
- labelStyle?: React.CSSProperties
- labelWithFilesStyle?: React.CSSProperties
- getFilesFromEvent: (
- event: React.ChangeEvent
- ) => Promise
- accept: string
- multiple: boolean
- disabled: boolean
- content?: React.ReactNode
- withFilesContent?: React.ReactNode
- onFiles: (files: File[]) => void
- inputContentSubTitle: string
- inputContentTitle: string
- size?: 'normal' | 'small'
-}
-
-type ReactComponent = (
- props: Props
-) => React.ReactNode | React.Component
-
-type statusText = {
- [k in StatusValue]: string
-}
-
-export interface IDropzoneProps {
- onChangeStatus?(
- file: IFileWithMeta,
- status: StatusValue,
- allFiles: IFileWithMeta[]
- ): { meta: { [name: string]: any } } | void
- getUploadParams?(file: IFileWithMeta): IUploadParams | Promise
-
- getFilesFromEvent?: (
- event: React.DragEvent | React.ChangeEvent
- ) => Promise | File[]
- getDataTransferItemsFromEvent?: (
- event: React.DragEvent
- ) => Promise | DataTransferItem[]
-
- accept: string
- multiple: boolean
- minSizeBytes: number
- maxSizeBytes: number
- maxFiles: number
-
- inputContentSubTitle: string
- inputContentTitle: string
-
- errorStatus: String[]
- statusText: Partial
-
- validate?(file: IFileWithMeta): any // usually a string, but can be anything
-
- autoUpload: boolean
- timeout?: number
-
- initialFiles?: File[]
-
- /* component customization */
- disabled: boolean | CustomizationFunction
-
- classNames: IStyleCustomization
- styles: IStyleCustomization
- addClassNames: IStyleCustomization
-
- /* component injection */
- PreviewComponent?: ReactComponent
- InputComponent?: ReactComponent
-
- size?: 'normal' | 'small'
-}
diff --git a/cx-portal-shared-components/src/components/basic/Dropzone/old_deprecated/Input.tsx b/cx-portal-shared-components/src/components/basic/Dropzone/old_deprecated/Input.tsx
deleted file mode 100644
index 9bed9af4e..000000000
--- a/cx-portal-shared-components/src/components/basic/Dropzone/old_deprecated/Input.tsx
+++ /dev/null
@@ -1,68 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import React from 'react'
-import { IInputProps } from './DropzoneTypes'
-import { DropArea } from '../components/DropArea'
-
-class Input extends React.PureComponent {
- render() {
- const {
- inputClassName,
- style,
- accept,
- inputContentTitle,
- inputContentSubTitle,
- multiple,
- disabled,
- getFilesFromEvent,
- onFiles,
- size,
- } = this.props
-
- return (
-
- {
- const target = e.target
- const chosenFiles = await getFilesFromEvent(e)
- onFiles(chosenFiles)
- target.value = ''
- }}
- />
-
- )
- }
-}
-export default Input
diff --git a/cx-portal-shared-components/src/components/basic/Dropzone/old_deprecated/Preview.tsx b/cx-portal-shared-components/src/components/basic/Dropzone/old_deprecated/Preview.tsx
deleted file mode 100644
index bffa26970..000000000
--- a/cx-portal-shared-components/src/components/basic/Dropzone/old_deprecated/Preview.tsx
+++ /dev/null
@@ -1,116 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import React from 'react'
-import { IPreviewProps } from './DropzoneTypes'
-import { Box } from '@mui/material'
-import { Typography } from '../../Typography'
-import { FileIcon } from '../../CustomIcons/FileIcon'
-import DeleteOutlineIcon from '@mui/icons-material/DeleteOutline'
-import RestartAltOutlinedIcon from '@mui/icons-material/RestartAltOutlined'
-class Preview extends React.PureComponent {
- render() {
- const {
- fileWithMeta: { cancel, remove, restart },
- meta,
- errorStatus,
- statusText,
- } = this.props
-
- const newStatusValue = statusText[meta.status] ?? meta.status
-
- return (
-
-
-
-
-
- {meta.name}
-
-
- {newStatusValue}
-
-
-
-
- {meta.status === 'uploading' && (
-
-
-
- )}
- {meta.status !== 'preparing' &&
- meta.status !== 'getting_upload_params' &&
- meta.status !== 'uploading' && (
-
-
-
- )}
- {errorStatus.includes(meta.status) && (
-
-
-
- )}
-
- )
- }
-}
-export default Preview
diff --git a/cx-portal-shared-components/src/components/basic/Dropzone/old_deprecated/index.tsx b/cx-portal-shared-components/src/components/basic/Dropzone/old_deprecated/index.tsx
deleted file mode 100644
index 766a6bdb2..000000000
--- a/cx-portal-shared-components/src/components/basic/Dropzone/old_deprecated/index.tsx
+++ /dev/null
@@ -1,534 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import React from 'react'
-import Layout from './Layout'
-import Preview from './Preview'
-import Input from './Input'
-
-import {
- formatBytes,
- formatDuration,
- accepts,
- resolveValue,
- mergeStyles,
- defaultClassNames,
- getFilesFromEvent as defaultGetFilesFromEvent,
-} from './utils'
-
-import {
- IDropzoneProps,
- IExtra,
- IExtraLayout,
- IFileWithMeta,
- IInputProps,
- IUploadParams,
-} from './DropzoneTypes'
-
-class DropzoneOldDEPRECATED extends React.Component<
- IDropzoneProps,
- { active: boolean; dragged: (File | DataTransferItem)[] }
-> {
- static defaultProps: IDropzoneProps
- protected files: IFileWithMeta[]
- protected mounted: boolean
- protected dropzone: React.RefObject
- protected dragTimeoutId?: number
-
- constructor(props: IDropzoneProps) {
- super(props)
- this.state = {
- active: false,
- dragged: [],
- }
- this.files = []
- this.mounted = true
- this.dropzone = React.createRef()
- }
-
- componentDidMount() {
- if (this.props.initialFiles) this.handleFiles(this.props.initialFiles)
- }
-
- componentDidUpdate(prevProps: IDropzoneProps) {
- const { initialFiles } = this.props
- if (prevProps.initialFiles !== initialFiles && initialFiles)
- this.handleFiles(initialFiles)
- }
-
- componentWillUnmount() {
- this.mounted = false
- for (const fileWithMeta of this.files) this.handleCancel(fileWithMeta)
- }
-
- forceUpdate = () => {
- if (this.mounted) super.forceUpdate()
- }
-
- getFilesFromEvent = () => {
- return this.props.getFilesFromEvent || defaultGetFilesFromEvent
- }
-
- getDataTransferItemsFromEvent = () => {
- return this.props.getDataTransferItemsFromEvent || defaultGetFilesFromEvent
- }
-
- handleDragEnter = async (e: React.DragEvent) => {
- e.preventDefault()
- e.stopPropagation()
- const dragged = (await this.getDataTransferItemsFromEvent()(
- e
- )) as DataTransferItem[]
- this.setState({ active: true, dragged })
- }
-
- handleDragOver = async (e: React.DragEvent) => {
- e.preventDefault()
- e.stopPropagation()
- clearTimeout(this.dragTimeoutId)
- const dragged = await this.getDataTransferItemsFromEvent()(e)
- this.setState({ active: true, dragged })
- }
-
- handleDragLeave = (e: React.DragEvent) => {
- e.preventDefault()
- e.stopPropagation()
- this.dragTimeoutId = window.setTimeout(
- () => this.setState({ active: false, dragged: [] }),
- 150
- )
- }
-
- handleDrop = async (e: React.DragEvent) => {
- e.preventDefault()
- e.stopPropagation()
- this.setState({ active: false, dragged: [] })
- const files = (await this.getFilesFromEvent()(e)) as File[]
- this.handleFiles(files)
- }
-
- handleDropDisabled = (e: React.DragEvent) => {
- e.preventDefault()
- e.stopPropagation()
- this.setState({ active: false, dragged: [] })
- }
-
- handleChangeStatus = (fileWithMeta: IFileWithMeta) => {
- if (!this.props.onChangeStatus) return
- const { meta = {} } =
- this.props.onChangeStatus(
- fileWithMeta,
- fileWithMeta.meta.status,
- this.files
- ) || {}
- if (meta) {
- delete meta.status
- fileWithMeta.meta = { ...fileWithMeta.meta, ...meta }
- this.forceUpdate()
- }
- }
-
- handleCancel = (fileWithMeta: IFileWithMeta) => {
- if (fileWithMeta.meta.status !== 'uploading') return
- fileWithMeta.meta.status = 'aborted'
- if (fileWithMeta.xhr) fileWithMeta.xhr.abort()
- this.handleChangeStatus(fileWithMeta)
- this.forceUpdate()
- }
-
- handleRemove = (fileWithMeta: IFileWithMeta) => {
- const index = this.files.findIndex((f) => f === fileWithMeta)
- if (index !== -1) {
- URL.revokeObjectURL(fileWithMeta.meta.previewUrl || '')
- fileWithMeta.meta.status = 'removed'
- this.handleChangeStatus(fileWithMeta)
- this.files.splice(index, 1)
- this.forceUpdate()
- }
- }
-
- handleRestart = (fileWithMeta: IFileWithMeta) => {
- if (!this.props.getUploadParams) return
-
- if (fileWithMeta.meta.status === 'ready')
- fileWithMeta.meta.status = 'started'
- else fileWithMeta.meta.status = 'restarted'
- this.handleChangeStatus(fileWithMeta)
-
- fileWithMeta.meta.status = 'getting_upload_params'
- fileWithMeta.meta.percent = 0
- this.handleChangeStatus(fileWithMeta)
- this.forceUpdate()
- this.uploadFile(fileWithMeta)
- }
-
- // expects an array of File objects
- handleFiles = (files: File[]) => {
- files.forEach((f, i) => this.handleFile(f, `${new Date().getTime()}-${i}`))
- const { current } = this.dropzone
- if (current)
- setTimeout(
- () => current.scroll({ top: current.scrollHeight, behavior: 'smooth' }),
- 150
- )
- }
-
- handleFile = async (file: File, id: string) => {
- const { name, size, type, lastModified } = file
- const {
- minSizeBytes,
- maxSizeBytes,
- maxFiles,
- accept,
- getUploadParams,
- autoUpload,
- validate,
- } = this.props
-
- const uploadedDate = new Date().toISOString()
- const lastModifiedDate =
- lastModified && new Date(lastModified).toISOString()
- const fileWithMeta = {
- file,
- meta: {
- name,
- size,
- type,
- lastModifiedDate,
- uploadedDate,
- percent: 0,
- id,
- },
- } as IFileWithMeta
-
- if (file.type !== 'application/x-moz-file' && !accepts(file, accept)) {
- fileWithMeta.meta.status = 'rejected_file_type'
- this.handleChangeStatus(fileWithMeta)
- return
- }
- if (this.files.length >= maxFiles) {
- fileWithMeta.meta.status = 'rejected_max_files'
- this.handleChangeStatus(fileWithMeta)
- return
- }
-
- fileWithMeta.cancel = () => this.handleCancel(fileWithMeta)
- fileWithMeta.remove = () => this.handleRemove(fileWithMeta)
- fileWithMeta.restart = () => this.handleRestart(fileWithMeta)
-
- fileWithMeta.meta.status = 'preparing'
- this.files.push(fileWithMeta)
- this.handleChangeStatus(fileWithMeta)
- this.forceUpdate()
-
- if (size < minSizeBytes || size > maxSizeBytes) {
- fileWithMeta.meta.status = 'error_file_size'
- this.handleChangeStatus(fileWithMeta)
- this.forceUpdate()
- return
- }
-
- if (validate) {
- const error = validate(fileWithMeta)
- if (error) {
- fileWithMeta.meta.status = 'error_validation'
- fileWithMeta.meta.validationError = error
- this.handleChangeStatus(fileWithMeta)
- this.forceUpdate()
- return
- }
- }
-
- if (getUploadParams) {
- if (autoUpload) {
- this.uploadFile(fileWithMeta)
- fileWithMeta.meta.status = 'getting_upload_params'
- } else {
- fileWithMeta.meta.status = 'ready'
- }
- } else {
- fileWithMeta.meta.status = 'done'
- }
- this.handleChangeStatus(fileWithMeta)
- this.forceUpdate()
- }
-
- uploadFile = async (fileWithMeta: IFileWithMeta) => {
- const { getUploadParams } = this.props
- if (!getUploadParams) return
- let params: IUploadParams | null = null
- try {
- params = await getUploadParams(fileWithMeta)
- } catch (e) {
- console.error('Error Upload Params', e)
- }
- if (params === null) return
- const {
- url,
- method = 'POST',
- body,
- fields = {},
- headers = {},
- meta: extraMeta = {},
- } = params
- delete extraMeta.status
-
- if (!url) {
- fileWithMeta.meta.status = 'error_upload_params'
- this.handleChangeStatus(fileWithMeta)
- this.forceUpdate()
- return
- }
-
- const xhr = new XMLHttpRequest()
- const formData = new FormData()
- xhr.open(method, url, true)
-
- for (const field of Object.keys(fields))
- formData.append(field, fields[field])
- xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest')
- for (const header of Object.keys(headers))
- xhr.setRequestHeader(header, headers[header])
- fileWithMeta.meta = { ...fileWithMeta.meta, ...extraMeta }
-
- // update progress (can be used to show progress indicator)
- xhr.upload.addEventListener('progress', (e) => {
- fileWithMeta.meta.percent = (e.loaded * 100.0) / e.total || 100
- this.forceUpdate()
- })
-
- xhr.addEventListener('readystatechange', () => {
- if (xhr.readyState !== 2 && xhr.readyState !== 4) return
-
- if (xhr.status === 0 && fileWithMeta.meta.status !== 'aborted') {
- fileWithMeta.meta.status = 'exception_upload'
- this.handleChangeStatus(fileWithMeta)
- this.forceUpdate()
- }
-
- if (xhr.status > 0 && xhr.status < 400) {
- fileWithMeta.meta.percent = 100
- if (xhr.readyState === 2) fileWithMeta.meta.status = 'headers_received'
- if (xhr.readyState === 4) fileWithMeta.meta.status = 'done'
- this.handleChangeStatus(fileWithMeta)
- this.forceUpdate()
- }
-
- if (xhr.status >= 400 && fileWithMeta.meta.status !== 'error_upload') {
- fileWithMeta.meta.status = 'error_upload'
- this.handleChangeStatus(fileWithMeta)
- this.forceUpdate()
- }
- })
-
- formData.append('file', fileWithMeta.file)
- if (this.props.timeout) xhr.timeout = this.props.timeout
- xhr.send(body || formData)
- fileWithMeta.xhr = xhr
- fileWithMeta.meta.status = 'uploading'
- this.handleChangeStatus(fileWithMeta)
- this.forceUpdate()
- }
-
- render() {
- const {
- accept,
- multiple,
- maxFiles,
- minSizeBytes,
- maxSizeBytes,
- getUploadParams,
- disabled,
- classNames,
- styles,
- addClassNames,
- PreviewComponent,
- inputContentSubTitle,
- inputContentTitle,
- errorStatus,
- statusText,
- size,
- } = this.props
-
- const { active, dragged } = this.state
-
- const reject = dragged.some(
- (file) =>
- file.type !== 'application/x-moz-file' && !accepts(file as File, accept)
- )
- const extra = {
- active,
- reject,
- dragged,
- accept,
- multiple,
- minSizeBytes,
- maxSizeBytes,
- maxFiles,
- } as IExtra
- const files = [...this.files]
- const dropzoneDisabled = resolveValue(disabled, files, extra)
-
- const {
- classNames: {
- dropzone: dropzoneClassName,
- dropzoneActive: dropzoneActiveClassName,
- dropzoneReject: dropzoneRejectClassName,
- dropzoneDisabled: dropzoneDisabledClassName,
- input: inputClassName,
- },
- styles: {
- dropzone: dropzoneStyle,
- dropzoneActive: dropzoneActiveStyle,
- dropzoneReject: dropzoneRejectStyle,
- dropzoneDisabled: dropzoneDisabledStyle,
- input: inputStyle,
- },
- } = mergeStyles(classNames, styles, addClassNames, files, extra)
-
- let previews = null
-
- if (PreviewComponent !== null) {
- previews = files.map((f) => {
- return (
-
- )
- })
- }
-
- const input = (
-
- )
-
- let className = dropzoneClassName
- let style = dropzoneStyle
-
- if (dropzoneDisabled) {
- className = `${className} ${dropzoneDisabledClassName}`
- style = { ...(style || {}), ...(dropzoneDisabledStyle || {}) }
- } else if (reject) {
- className = `${className} ${dropzoneRejectClassName}`
- style = { ...(style || {}), ...(dropzoneRejectStyle || {}) }
- } else if (active) {
- className = `${className} ${dropzoneActiveClassName}`
- style = { ...(style || {}), ...(dropzoneActiveStyle || {}) }
- }
-
- return (
-
- )
- }
-}
-
-DropzoneOldDEPRECATED.defaultProps = {
- accept: '*',
- multiple: true,
- minSizeBytes: 0,
- maxSizeBytes: Number.MAX_SAFE_INTEGER,
- maxFiles: Number.MAX_SAFE_INTEGER,
- autoUpload: true,
- disabled: false,
- classNames: {},
- styles: {},
- addClassNames: {},
- inputContentTitle: 'Drag & drop your files here',
- inputContentSubTitle: 'or browse files on your computer.',
- errorStatus: [
- 'error_upload_params',
- 'exception_upload',
- 'error_upload',
- 'aborted',
- 'ready',
- ],
- statusText: {
- rejected_file_type: 'new rejected_file_type',
- rejected_max_files: 'new rejected_max_files',
- preparing: 'new preparing',
- error_file_size: 'new error_file_size',
- error_validation: 'new error_validation',
- ready: 'new ready',
- started: 'new started',
- getting_upload_params: 'new getting_upload_params',
- error_upload_params: 'new error_upload_params',
- uploading: 'new uploading',
- exception_upload: 'new exception_upload',
- aborted: 'new aborted',
- restarted: 'new restarted',
- removed: 'new removed',
- error_upload: 'new error_upload',
- headers_received: 'new headers_received',
- done: 'new done',
- },
-}
-
-export {
- DropzoneOldDEPRECATED,
- formatBytes,
- formatDuration,
- accepts,
- defaultClassNames,
- defaultGetFilesFromEvent as getFilesFromEvent,
-}
diff --git a/cx-portal-shared-components/src/components/basic/Dropzone/old_deprecated/utils.ts b/cx-portal-shared-components/src/components/basic/Dropzone/old_deprecated/utils.ts
deleted file mode 100644
index 5002deb06..000000000
--- a/cx-portal-shared-components/src/components/basic/Dropzone/old_deprecated/utils.ts
+++ /dev/null
@@ -1,144 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import React from 'react'
-import { IStyleCustomization } from './DropzoneTypes'
-
-export const formatBytes = (b: number) => {
- const units = ['bytes', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']
- let l = 0
- let n = b
-
- while (n >= 1024) {
- n /= 1024
- l += 1
- }
-
- return `${n.toFixed(n >= 10 || l < 1 ? 0 : 1)}${units[l]}`
-}
-
-export const formatDuration = (seconds: number) => {
- const date = new Date(0)
- date.setSeconds(seconds)
- const dateString = date.toISOString().slice(11, 19)
- if (seconds < 3600) return dateString.slice(3)
- return dateString
-}
-
-// returns true if file.name is empty and accept string is something like ".csv",
-// because file comes from dataTransferItem for drag events, and
-// dataTransferItem.name is always empty
-export const accepts = (file: File, accept: string) => {
- if (!accept || accept === '*') return true
-
- const mimeType = file.type || ''
- const baseMimeType = mimeType.split('/').shift()
-
- return accept
- .split(',')
- .map((t) => t.trim())
- .some((type) => {
- if (type.charAt(0) === '.') {
- return (
- file.name === undefined ||
- file.name.toLowerCase().endsWith(type.toLowerCase())
- )
- } else if (type.endsWith('/*')) {
- // this is something like an image/* mime type
- return baseMimeType === type.split('/').shift()
- }
- return mimeType === type
- })
-}
-
-type ResolveFn = (...args: any[]) => T
-
-export const resolveValue = (
- value: ResolveFn | T,
- ...args: any[]
-) => {
- if (typeof value === 'function') return (value as ResolveFn)(...args)
- return value
-}
-
-export const defaultClassNames = {
- dropzone: 'dropzone',
- dropzoneActive: 'dropzoneActive',
- dropzoneReject: 'dropzoneActive',
- dropzoneDisabled: 'dropzoneDisabled',
- input: 'input',
- inputLabel: 'inputLabel',
- inputLabelWithFiles: 'inputLabelWithFiles',
- preview: 'previewContainer',
- previewImage: 'previewImage',
-}
-
-export const mergeStyles = (
- classNames: IStyleCustomization,
- styles: IStyleCustomization,
- addClassNames: IStyleCustomization,
- ...args: any[]
-) => {
- const resolvedClassNames: { [property: string]: string } = {
- ...defaultClassNames,
- }
- const resolvedStyles = { ...styles } as { [property: string]: string }
-
- for (const [key, value] of Object.entries(classNames)) {
- resolvedClassNames[key] = resolveValue(value, ...args)
- }
-
- for (const [key, value] of Object.entries(addClassNames)) {
- resolvedClassNames[key] = `${resolvedClassNames[key]} ${resolveValue(
- value,
- ...args
- )}`
- }
-
- for (const [key, value] of Object.entries(styles)) {
- resolvedStyles[key] = resolveValue(value, ...args)
- }
-
- return {
- classNames: resolvedClassNames,
- styles: resolvedStyles as IStyleCustomization,
- }
-}
-
-export const getFilesFromEvent = (
- event: React.DragEvent | React.ChangeEvent
-): Array => {
- let items = null
-
- if ('dataTransfer' in event) {
- const dt = event.dataTransfer
-
- // NOTE: Only the 'drop' event has access to DataTransfer.files, otherwise it will always be empty
- if ('files' in dt && dt.files.length) {
- items = dt.files
- } else if (dt.items && dt.items.length) {
- items = dt.items
- }
- } else if (event.target && event.target.files) {
- items = event.target.files
- }
-
- return Array.prototype.slice.call(items)
-}
diff --git a/cx-portal-shared-components/src/components/basic/Dropzone/types.ts b/cx-portal-shared-components/src/components/basic/Dropzone/types.ts
deleted file mode 100644
index 7b23a2bd9..000000000
--- a/cx-portal-shared-components/src/components/basic/Dropzone/types.ts
+++ /dev/null
@@ -1,40 +0,0 @@
-export enum UploadStatus {
- NEW = 'new',
- UPLOADING = 'uploading',
- UPLOAD_SUCCESS = 'upload_success',
- UPLOAD_ERROR = 'upload_error',
-}
-
-export type UploadFileStatus =
- | UploadStatus.NEW
- | UploadStatus.UPLOADING
- | UploadStatus.UPLOAD_SUCCESS
- | UploadStatus.UPLOAD_ERROR
-
-export type UploadFile = {
- id?: string
- name: string
- size?: number
- status: UploadFileStatus
- progressPercent?: number
-}
-
-export type DropZoneDropAreaTranslations = {
- title: string | JSX.Element
- subTitle: string | JSX.Element
- errorTitle: string | JSX.Element
-}
-
-export type DropZonePreviewTranslations = {
- placeholder: string | JSX.Element
- uploadProgess: string
- uploadSuccess: string | JSX.Element
- uploadError: string | JSX.Element
-}
-
-export type deleteConfirmOverlayTranslation = {
- title: string
- content: string
- action_no: string
- action_yes: string
-}
diff --git a/cx-portal-shared-components/src/components/basic/ErrorPage/ErrorPage.stories.tsx b/cx-portal-shared-components/src/components/basic/ErrorPage/ErrorPage.stories.tsx
deleted file mode 100644
index 4928aad69..000000000
--- a/cx-portal-shared-components/src/components/basic/ErrorPage/ErrorPage.stories.tsx
+++ /dev/null
@@ -1,48 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { ComponentStory } from '@storybook/react'
-
-import { ErrorPage as Component } from '.'
-
-export default {
- title: 'ErrorPage',
- component: Component,
- argTypes: {},
-}
-
-const Template: ComponentStory = (args: any) => (
-
-)
-
-export const ErrorPage = Template.bind({})
-ErrorPage.args = {
- hasNavigation: false,
- header: '500 Internal Server Error',
- title: 'Oops, Something went wrong.',
- description:
- 'The server encountered an internal error or misconfiguration and was unable to complete your request.',
- additionalDescription: 'Please contact your admin.',
- reloadButtonTitle: 'Reload Page',
- homeButtonTitle: 'Homepage',
- onReloadClick: () => console.log('reload'),
- onHomeClick: () => console.log('home page'),
- color: 'gray',
-}
diff --git a/cx-portal-shared-components/src/components/basic/ErrorPage/components/ErrorActions.tsx b/cx-portal-shared-components/src/components/basic/ErrorPage/components/ErrorActions.tsx
deleted file mode 100644
index be8aa0e5e..000000000
--- a/cx-portal-shared-components/src/components/basic/ErrorPage/components/ErrorActions.tsx
+++ /dev/null
@@ -1,62 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { Box } from '@mui/material'
-import { Button } from '../../Button'
-import { ErrorPageProps } from '../index'
-
-export const ErrorActions = ({
- reloadButtonTitle,
- homeButtonTitle,
- onReloadClick,
- onHomeClick,
-}: ErrorPageProps) => {
- return (
-
- {reloadButtonTitle && (
-
- )}
- {homeButtonTitle && (
-
- )}
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/ErrorPage/components/ErrorDescription.tsx b/cx-portal-shared-components/src/components/basic/ErrorPage/components/ErrorDescription.tsx
deleted file mode 100644
index d66873c53..000000000
--- a/cx-portal-shared-components/src/components/basic/ErrorPage/components/ErrorDescription.tsx
+++ /dev/null
@@ -1,78 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { Box, Typography } from '@mui/material'
-import { ErrorPageProps } from '../index'
-
-export const ErrorDescription = ({
- header,
- title,
- description,
- additionalDescription,
-}: ErrorPageProps) => {
- return (
-
- {header && (
-
- {header}
-
- )}
-
- {title && (
-
- {title}
-
- )}
-
- {title && description && (
-
- {description}{' '}
-
- {additionalDescription}
-
-
- )}
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/ErrorPage/components/ErrorImage.tsx b/cx-portal-shared-components/src/components/basic/ErrorPage/components/ErrorImage.tsx
deleted file mode 100644
index b7704649a..000000000
--- a/cx-portal-shared-components/src/components/basic/ErrorPage/components/ErrorImage.tsx
+++ /dev/null
@@ -1,40 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import RobotColor from '../../../../assets/errorImage/robot-color.svg'
-import RobotGray from '../../../../assets/errorImage/robot-sw.svg'
-import { BaseImage } from '../../BaseImage'
-
-interface ErrorImageProps {
- variant?: 'color' | 'gray'
- altText?: string
-}
-
-export const ErrorImage = ({
- variant = 'color',
- altText = 'Catena-X Error',
- ...props
-}: ErrorImageProps) => (
-
-)
diff --git a/cx-portal-shared-components/src/components/basic/ErrorPage/components/Footer.tsx b/cx-portal-shared-components/src/components/basic/ErrorPage/components/Footer.tsx
deleted file mode 100644
index 44ae5a3d3..000000000
--- a/cx-portal-shared-components/src/components/basic/ErrorPage/components/Footer.tsx
+++ /dev/null
@@ -1,60 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-export const Footer = () => {
- return (
- <>
-
- >
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/ErrorPage/index.tsx b/cx-portal-shared-components/src/components/basic/ErrorPage/index.tsx
deleted file mode 100644
index f556456ec..000000000
--- a/cx-portal-shared-components/src/components/basic/ErrorPage/index.tsx
+++ /dev/null
@@ -1,96 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { Box } from '@mui/material'
-import { ErrorDescription } from './components/ErrorDescription'
-import { ErrorActions } from './components/ErrorActions'
-import { ErrorImage } from './components/ErrorImage'
-
-export interface ErrorPageProps {
- hasNavigation?: boolean
- header?: string
- title?: string
- description?: string
- additionalDescription?: string
- reloadButtonTitle?: string
- homeButtonTitle?: string
- onReloadClick?: React.MouseEventHandler
- onHomeClick?: React.MouseEventHandler
- color?: 'color' | 'gray'
-}
-
-export const ErrorPage = ({
- hasNavigation,
- header,
- title,
- description,
- additionalDescription,
- reloadButtonTitle,
- homeButtonTitle,
- onReloadClick,
- onHomeClick,
- color = 'gray',
-}: ErrorPageProps) => {
- const height = hasNavigation ? 'calc(100vh - 85px)' : '100vh'
- return (
-
-
-
-
-
-
-
-
-
-
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/Expand/Expand.stories.tsx b/cx-portal-shared-components/src/components/basic/Expand/Expand.stories.tsx
deleted file mode 100644
index 95451ff0f..000000000
--- a/cx-portal-shared-components/src/components/basic/Expand/Expand.stories.tsx
+++ /dev/null
@@ -1,44 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { ComponentStory } from '@storybook/react'
-
-import { Expand as Component } from '.'
-
-export default {
- title: 'Expand',
- component: Component,
- argTypes: {
- onClick: {
- action: 'onClick',
- },
- },
-}
-
-const Template: ComponentStory = (args: any) => (
-
-)
-
-export const Expand = Template.bind({})
-Expand.args = {
- label: 'Full role description',
- expandedLabel: 'Close role description',
- text: 'The App Provider is a company which is providing application software via the CX marketplace. As app provider you can participate and use the developer hub, release and offer applications to the network and manage your applications.',
-}
diff --git a/cx-portal-shared-components/src/components/basic/Expand/index.tsx b/cx-portal-shared-components/src/components/basic/Expand/index.tsx
deleted file mode 100644
index 5b4aa7e88..000000000
--- a/cx-portal-shared-components/src/components/basic/Expand/index.tsx
+++ /dev/null
@@ -1,64 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { useState } from 'react'
-import { Collapse } from '@mui/material'
-import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown'
-import KeyboardArrowUpIcon from '@mui/icons-material/KeyboardArrowUp'
-import { Typography } from '../Typography'
-
-export const Expand = ({
- label,
- expandedLabel,
- text,
-}: {
- label: string
- expandedLabel: string
- text: string
-}) => {
- const [open, setOpen] = useState(false)
-
- return (
- <>
-
- {open ? (
- setOpen(!open)}
- sx={{ height: '21px', cursor: 'pointer' }}
- />
- ) : (
- setOpen(!open)}
- sx={{ height: '21px', cursor: 'pointer' }}
- />
- )}
- {open ? expandedLabel : label}
-
-
-
- {text}
-
-
- >
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/Headers/MainHeader/Components/MainHeaderTitle.tsx b/cx-portal-shared-components/src/components/basic/Headers/MainHeader/Components/MainHeaderTitle.tsx
deleted file mode 100644
index 8651f3da6..000000000
--- a/cx-portal-shared-components/src/components/basic/Headers/MainHeader/Components/MainHeaderTitle.tsx
+++ /dev/null
@@ -1,59 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { MainHeaderProps } from '../MainHeader'
-import { Typography } from '../../../Typography'
-
-export const MainHeaderTitle = ({
- title,
- subTitle,
- subTitleWidth,
- titleTextVariant = 'h1',
- subTitleTextVariant = 'h2',
-}: MainHeaderProps) => {
- return (
- <>
- {title && (
-
- {title}
-
- )}
-
- {subTitle && (
-
- {subTitle}
-
- )}
- >
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/Headers/MainHeader/MainHeader.stories.tsx b/cx-portal-shared-components/src/components/basic/Headers/MainHeader/MainHeader.stories.tsx
deleted file mode 100644
index 47f3a7a71..000000000
--- a/cx-portal-shared-components/src/components/basic/Headers/MainHeader/MainHeader.stories.tsx
+++ /dev/null
@@ -1,42 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { ComponentStory } from '@storybook/react'
-
-import { MainHeader as Component } from './MainHeader'
-
-export default {
- title: 'Headers',
- component: Component,
- argTypes: {},
-}
-
-const Template: ComponentStory = (args: any) => (
-
-)
-
-export const MainHeader = Template.bind({})
-MainHeader.args = {
- title: 'Catena-X',
- subTitle: 'the gateway to the automotive digital network',
- subTitleWidth: 787,
- headerHeight: 645,
- background: 'LinearGradient1',
-}
diff --git a/cx-portal-shared-components/src/components/basic/Headers/MainHeader/MainHeader.tsx b/cx-portal-shared-components/src/components/basic/Headers/MainHeader/MainHeader.tsx
deleted file mode 100644
index 8f2c1d87c..000000000
--- a/cx-portal-shared-components/src/components/basic/Headers/MainHeader/MainHeader.tsx
+++ /dev/null
@@ -1,178 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { Box } from '@mui/material'
-import { Image } from '../../Image'
-import { mainNavigationHeight } from '../../MainNavigation'
-import { MainHeaderTitle } from './Components/MainHeaderTitle'
-
-export interface MainHeaderProps {
- children?: React.ReactNode
- title?: string
- subTitle?: string
- subTitleWidth?: number
- headerHeight?: number
- background?:
- | 'LinearGradient1'
- | 'LinearGradient2'
- | 'LinearGradient3'
- | 'LinearGradient4'
- imagePath?: string
- titleTextVariant?:
- | 'h1'
- | 'h2'
- | 'h3'
- | 'h4'
- | 'h5'
- | 'h6'
- | 'subtitle1'
- | 'subtitle2'
- | 'body1'
- | 'body2'
- | 'button'
- | 'overline'
- | 'inherit'
- | 'body3'
- | 'caption1'
- | 'caption2'
- | 'caption3'
- | 'label1'
- subTitleTextVariant?:
- | 'h1'
- | 'h2'
- | 'h3'
- | 'h4'
- | 'h5'
- | 'h6'
- | 'subtitle1'
- | 'subtitle2'
- | 'body1'
- | 'body2'
- | 'button'
- | 'overline'
- | 'inherit'
- | 'body3'
- | 'caption1'
- | 'caption2'
- | 'caption3'
- | 'label1'
-}
-
-export const MainHeader = ({
- children,
- title,
- subTitle,
- subTitleWidth,
- headerHeight = 645,
- background = 'LinearGradient1',
- imagePath,
- titleTextVariant,
- subTitleTextVariant,
-}: MainHeaderProps) => {
- const backgroundstyle = () => {
- if (background === 'LinearGradient1') {
- return {
- direction: 152.33,
- colorFrom: '#adb9c7 4.24%',
- colorTo: '#e4ebf3 72.17%',
- }
- } else if (background === 'LinearGradient3') {
- return {
- direction: 292.62,
- colorFrom: '#FF782C -16.38%',
- colorTo: '#FFB326 82.22%',
- }
- } else if (background === 'LinearGradient4') {
- return {
- direction: 111.81,
- colorFrom: '#9EABA9 41.97%',
- colorTo: '#B6A763 72.9%',
- }
- } else {
- return {
- direction: 145.91,
- colorFrom: '#F0F2F5 18.42%',
- colorTo: '#B4BBC3 79.14%',
- }
- }
- }
-
- return (
-
- {imagePath && (
-
-
-
- )}
-
-
-
-
-
{children}
-
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/Headers/PageHeader/Components/HeaderSubtractOption1.tsx b/cx-portal-shared-components/src/components/basic/Headers/PageHeader/Components/HeaderSubtractOption1.tsx
deleted file mode 100644
index 504637e28..000000000
--- a/cx-portal-shared-components/src/components/basic/Headers/PageHeader/Components/HeaderSubtractOption1.tsx
+++ /dev/null
@@ -1,48 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { PageHeaderProps } from '../PageHeader'
-
-export const HeaderSubtractOption1 = ({ hasSubtract }: PageHeaderProps) => {
- return (
- <>
- {hasSubtract && (
-
- )}
- >
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/Headers/PageHeader/Components/HeaderSubtractOption2.tsx b/cx-portal-shared-components/src/components/basic/Headers/PageHeader/Components/HeaderSubtractOption2.tsx
deleted file mode 100644
index eb8bc3bde..000000000
--- a/cx-portal-shared-components/src/components/basic/Headers/PageHeader/Components/HeaderSubtractOption2.tsx
+++ /dev/null
@@ -1,48 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { PageHeaderProps } from '../PageHeader'
-
-export const HeaderSubtractOption2 = ({ hasSubtract }: PageHeaderProps) => {
- return (
- <>
- {hasSubtract && (
-
- )}
- >
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/Headers/PageHeader/Components/HeaderSubtractOption3.tsx b/cx-portal-shared-components/src/components/basic/Headers/PageHeader/Components/HeaderSubtractOption3.tsx
deleted file mode 100644
index 8834c664f..000000000
--- a/cx-portal-shared-components/src/components/basic/Headers/PageHeader/Components/HeaderSubtractOption3.tsx
+++ /dev/null
@@ -1,50 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { PageHeaderProps } from '../PageHeader'
-
-export const HeaderSubtractOption3 = ({ hasSubtract }: PageHeaderProps) => {
- return (
- <>
- {hasSubtract && (
-
- )}
- >
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/Headers/PageHeader/Components/HeaderTitle.tsx b/cx-portal-shared-components/src/components/basic/Headers/PageHeader/Components/HeaderTitle.tsx
deleted file mode 100644
index 5e8257a68..000000000
--- a/cx-portal-shared-components/src/components/basic/Headers/PageHeader/Components/HeaderTitle.tsx
+++ /dev/null
@@ -1,40 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { Typography } from '@mui/material'
-import { PageHeaderProps } from '../PageHeader'
-
-export const HeaderTitle = ({ title }: PageHeaderProps) => {
- return (
- <>
- {title && (
-
- {title}
-
- )}
- >
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/Headers/PageHeader/PageHeader.stories.tsx b/cx-portal-shared-components/src/components/basic/Headers/PageHeader/PageHeader.stories.tsx
deleted file mode 100644
index 274682045..000000000
--- a/cx-portal-shared-components/src/components/basic/Headers/PageHeader/PageHeader.stories.tsx
+++ /dev/null
@@ -1,43 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { ComponentStory } from '@storybook/react'
-
-import { PageHeader as Component } from './PageHeader'
-
-export default {
- title: 'Headers',
- component: Component,
- argTypes: {},
-}
-
-const Template: ComponentStory = (args: any) => (
-
-)
-
-export const PageHeader = Template.bind({})
-PageHeader.args = {
- title: 'Page title',
- hasSubtract: true,
- topPage: false,
- headerHeight: 200,
- subtractOption: 'Option1',
- background: 'LinearGradient1',
-}
diff --git a/cx-portal-shared-components/src/components/basic/Headers/PageHeader/PageHeader.tsx b/cx-portal-shared-components/src/components/basic/Headers/PageHeader/PageHeader.tsx
deleted file mode 100644
index 28c5b8868..000000000
--- a/cx-portal-shared-components/src/components/basic/Headers/PageHeader/PageHeader.tsx
+++ /dev/null
@@ -1,144 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { Box, useTheme } from '@mui/material'
-import { HeaderTitle } from './Components/HeaderTitle'
-import { HeaderSubtractOption1 } from './Components/HeaderSubtractOption1'
-import { HeaderSubtractOption2 } from './Components/HeaderSubtractOption2'
-import { HeaderSubtractOption3 } from './Components/HeaderSubtractOption3'
-import { mainNavigationHeight } from '../../MainNavigation'
-
-export interface PageHeaderProps {
- children?: React.ReactNode
- title?: string
- topPage?: boolean
- headerHeight?: number
- hasSubtract?: boolean
- subtractOption?: 'Option1' | 'Option2' | 'Option3'
- background?:
- | 'LinearGradient1'
- | 'LinearGradient2'
- | 'LinearGradient3'
- | 'LinearGradient4'
-}
-
-export const PageHeader = ({
- children,
- title,
- topPage = false,
- headerHeight = 314,
- hasSubtract = true,
- subtractOption = 'Option1',
- background = 'LinearGradient1',
-}: PageHeaderProps) => {
- const { palette } = useTheme()
- const hasChildren = !!children
- // TODO: to many magic numbers and the overall composition of this header needs to be thought through again
- // ternary operator hell: topPage/hasChildren : topPage/!hasChildren : !topPage/hasChildren : !topPage/!hasChildren
- const top = topPage ? (hasChildren ? 73 : 153) : hasChildren ? 0 : 68
- const height = topPage ? headerHeight + mainNavigationHeight : headerHeight
- const spacingTop = topPage ? -mainNavigationHeight : hasChildren ? 0 : 12
-
- const backgroundStyle = () => {
- if (background === 'LinearGradient1') {
- return {
- direction: 152.33,
- colorFrom: '#adb9c7 4.24%',
- colorTo: '#e4ebf3 72.17%',
- }
- } else if (background === 'LinearGradient3') {
- return {
- direction: 292.62,
- colorFrom: '#FF782C -16.38%',
- colorTo: '#FFB326 82.22%',
- }
- } else if (background === 'LinearGradient4') {
- return {
- direction: 111.81,
- colorFrom: '#9EABA9 41.97%',
- colorTo: '#B6A763 72.9%',
- }
- } else {
- return {
- direction: 145.91,
- colorFrom: '#F0F2F5 18.42%',
- colorTo: '#B4BBC3 79.14%',
- }
- }
- }
-
- return (
-
- {children && (
-
-
- {children}
-
-
- )}
-
-
-
- {subtractOption === 'Option1' && (
-
- )}
- {subtractOption === 'Option2' && (
-
- )}
- {subtractOption === 'Option3' && (
-
- )}
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/IconButton/IconButton.stories.tsx b/cx-portal-shared-components/src/components/basic/IconButton/IconButton.stories.tsx
deleted file mode 100644
index 1c00ee1b2..000000000
--- a/cx-portal-shared-components/src/components/basic/IconButton/IconButton.stories.tsx
+++ /dev/null
@@ -1,55 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { ComponentStory } from '@storybook/react'
-
-import { IconButton as Component } from '.'
-import AddIcon from '@mui/icons-material/Add'
-import ArrowForwardIcon from '@mui/icons-material/ArrowForward'
-
-export default {
- title: 'Buttons',
- component: Component,
- argTypes: {
- onClick: {
- action: 'onClick',
- },
- },
-}
-
-const Template: ComponentStory = (args: any) => (
-
-)
-
-export const IconButton = Template.bind({})
-IconButton.args = {
- color: 'primary',
- size: 'medium',
- disabled: false,
- children: ,
-}
-
-export const ArrowButton = Template.bind({})
-ArrowButton.args = {
- color: 'secondary',
- size: 'medium',
- disabled: false,
- children: ,
-}
diff --git a/cx-portal-shared-components/src/components/basic/IconButton/index.tsx b/cx-portal-shared-components/src/components/basic/IconButton/index.tsx
deleted file mode 100644
index 52e266c3c..000000000
--- a/cx-portal-shared-components/src/components/basic/IconButton/index.tsx
+++ /dev/null
@@ -1,39 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import MuiIconButton, {
- IconButtonProps as MuiIconButtonProps,
-} from '@mui/material/IconButton'
-
-interface IconButtonProps extends Omit {
- color?: 'primary' | 'secondary'
- size?: 'medium' | 'small'
- variant?: 'outlined'
-}
-
-export const IconButton = ({
- size = 'medium',
- variant,
- ...props
-}: IconButtonProps) => {
- const outlinedStyle = variant === 'outlined' ? { border: '2px solid' } : {}
-
- return
-}
diff --git a/cx-portal-shared-components/src/components/basic/Image/Image.stories.tsx b/cx-portal-shared-components/src/components/basic/Image/Image.stories.tsx
deleted file mode 100644
index 506896bfe..000000000
--- a/cx-portal-shared-components/src/components/basic/Image/Image.stories.tsx
+++ /dev/null
@@ -1,44 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { ComponentStory } from '@storybook/react'
-
-import { Image as Component } from '.'
-
-export default {
- title: 'Image',
- component: Component,
- argTypes: {
- children: {},
- },
-}
-const Template: ComponentStory = (args: any) => (
-
-)
-
-export const Image = Template.bind({})
-Image.args = {
- src: 'https://raw.githubusercontent.com/catenax-ng/tx-portal-assets/main/public/assets/images/logos/cx-short.svg',
- style: {
- width: '240px',
- height: '254px',
- borderRadius: '15px',
- },
-}
diff --git a/cx-portal-shared-components/src/components/basic/Image/index.tsx b/cx-portal-shared-components/src/components/basic/Image/index.tsx
deleted file mode 100644
index ffbac4a77..000000000
--- a/cx-portal-shared-components/src/components/basic/Image/index.tsx
+++ /dev/null
@@ -1,94 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { useEffect, useState, useCallback } from 'react'
-import { LogoGrayData } from '../Logo'
-
-export const TransparentPixel =
- 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7'
-
-const IMAGE_TYPES: any = {
- '3c': 'image/svg+xml',
- ffd8ff: 'image/jpeg',
- '89504e': 'image/png',
- '474946': 'image/gif',
-}
-
-const buf2hex = (buffer: ArrayBuffer) =>
- [...new Uint8Array(buffer)]
- .map((x) => x.toString(16).padStart(2, '0'))
- .join('')
-
-const defaultFetchImage = async (url: string): Promise => {
- const response = await fetch(url)
- return await response.arrayBuffer()
-}
-
-interface ImageProps {
- src: string
- alt?: string
- style?: any
- loader?: (src: string) => Promise
-}
-
-export const Image = ({ src, alt, style, loader }: ImageProps) => {
- const [data, setData] = useState(src)
- const [load, setLoad] = useState(false)
- const [error, setError] = useState(false)
-
- const getData = useCallback(async () => {
- try {
- const buffer = loader ? await loader(src) : await defaultFetchImage(src)
- const firstByte = buf2hex(buffer.slice(0, 1))
- const first3Bytes = buf2hex(buffer.slice(0, 3))
- const imageType =
- IMAGE_TYPES[firstByte] || IMAGE_TYPES[first3Bytes] || 'image/*'
- setData(URL.createObjectURL(new Blob([buffer], { type: imageType })))
- } catch (e) {
- setError(true)
- }
- }, [src, loader])
-
- useEffect(() => {
- setError(false)
- setLoad(false)
- setData(src)
- }, [src])
-
- return (
- {
- setData(LogoGrayData)
- if (load) {
- setError(true)
- } else {
- setLoad(true)
- getData()
- }
- }}
- style={{
- objectFit: 'cover',
- ...style,
- }}
- />
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/ImageGallery/ImageGallery.stories.tsx b/cx-portal-shared-components/src/components/basic/ImageGallery/ImageGallery.stories.tsx
deleted file mode 100644
index 4829b943f..000000000
--- a/cx-portal-shared-components/src/components/basic/ImageGallery/ImageGallery.stories.tsx
+++ /dev/null
@@ -1,108 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { ComponentStory } from '@storybook/react'
-
-import { ImageGallery as Component } from '.'
-
-export default {
- title: 'ImageGallery',
- component: Component,
-}
-
-const Template: ComponentStory = (args) => (
-
-)
-
-export const GridMediumSquareGallery = Template.bind({})
-GridMediumSquareGallery.args = {
- gallery: [
- {
- url: 'https://cdn.pixabay.com/photo/2017/09/05/10/20/business-2717066_1280.jpg',
- text: 'Lorem Image Caption1',
- size: 'medium-square',
- hover: false,
- borderRadius: true,
- shadow: true,
- },
- {
- url: 'https://cdn.pixabay.com/photo/2017/09/05/10/20/business-2717066_1280.jpg',
- text: 'Lorem Image Caption2',
- size: 'medium-square',
- hover: false,
- borderRadius: true,
- shadow: true,
- },
- {
- url: 'https://cdn.pixabay.com/photo/2017/09/05/10/20/business-2717066_1280.jpg',
- text: 'Lorem Image Caption3',
- size: 'medium-square',
- hover: false,
- borderRadius: true,
- shadow: true,
- },
- ],
-}
-
-export const FlexGallery = Template.bind({})
-FlexGallery.args = {
- gallery: [
- {
- url: 'https://cdn.pixabay.com/photo/2017/09/05/10/20/business-2717066_1280.jpg',
- text: 'Lorem Image Caption',
- size: 'small-square',
- hover: false,
- borderRadius: true,
- shadow: true,
- },
- {
- url: 'https://cdn.pixabay.com/photo/2017/09/05/10/20/business-2717066_1280.jpg',
- text: 'Lorem Image Caption',
- size: 'small-rectangle',
- hover: false,
- borderRadius: true,
- shadow: false,
- },
- {
- url: 'https://cdn.pixabay.com/photo/2017/09/05/10/20/business-2717066_1280.jpg',
- text: 'Lorem Image Caption',
- size: 'small-square',
- hover: false,
- borderRadius: false,
- shadow: true,
- },
- {
- url: 'https://cdn.pixabay.com/photo/2017/09/05/10/20/business-2717066_1280.jpg',
- text: 'Lorem Image Caption',
- size: 'small-square',
- hover: false,
- borderRadius: false,
- shadow: true,
- },
- {
- url: 'https://cdn.pixabay.com/photo/2017/09/05/10/20/business-2717066_1280.jpg',
- text: 'Lorem Image Caption',
- size: 'small-square',
- hover: false,
- borderRadius: false,
- shadow: true,
- },
- ],
-}
diff --git a/cx-portal-shared-components/src/components/basic/ImageGallery/ImageGalleryItem.stories.tsx b/cx-portal-shared-components/src/components/basic/ImageGallery/ImageGalleryItem.stories.tsx
deleted file mode 100644
index fa83ecb14..000000000
--- a/cx-portal-shared-components/src/components/basic/ImageGallery/ImageGalleryItem.stories.tsx
+++ /dev/null
@@ -1,21 +0,0 @@
-import { ComponentStory } from '@storybook/react'
-import { ImageItem } from './ImageItem'
-
-export default {
- title: 'ImageGalleryItem',
- component: ImageItem,
-}
-
-const Template: ComponentStory = (args) => (
-
-)
-
-export const ImageGalleryItem = Template.bind({})
-ImageGalleryItem.args = {
- url: 'https://cdn.pixabay.com/photo/2017/09/05/10/20/business-2717066_1280.jpg',
- text: 'Lorem Image Caption',
- size: 'small-square',
- hover: true,
- borderRadius: true,
- shadow: true,
-}
diff --git a/cx-portal-shared-components/src/components/basic/ImageGallery/ImageItem.tsx b/cx-portal-shared-components/src/components/basic/ImageGallery/ImageItem.tsx
deleted file mode 100644
index 48dd3a780..000000000
--- a/cx-portal-shared-components/src/components/basic/ImageGallery/ImageItem.tsx
+++ /dev/null
@@ -1,128 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 Mercedes-Benz Group AG and BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { useState } from 'react'
-import { Image } from '../Image'
-import { Typography } from '../Typography'
-import ImageItemOverlay from './ImageItemOverlay'
-import { ImageType } from './types'
-
-export const ImageItem = ({
- url,
- text,
- size = 'large-square',
- hover = true,
- borderRadius = true,
- shadow = true,
- width,
- height,
- modalWidth,
- additionalStyles = {},
-}: ImageType) => {
- const [hovered, setHovered] = useState(false)
- const getWidth = () => {
- switch (size) {
- case 'small-rectangle':
- return {
- width: '284px',
- height: '160px',
- }
- case 'small-square':
- return {
- width: '160px',
- height: '160px',
- }
- case 'medium-rectangle':
- return {
- width: '456px',
- height: '256px',
- }
- case 'medium-square':
- return {
- width: '256px',
- height: '256px',
- }
- case 'large-rectangle':
- return {
- width: '625px',
- height: '352px',
- }
- case 'custom':
- return {
- width: width,
- height: height,
- }
- default:
- return {
- width: '352px',
- height: '352px',
- }
- }
- }
- return (
- <>
- {hovered && (
- setHovered(false)}
- url={url}
- text={text}
- size={size}
- hover={hover}
- borderRadius={borderRadius}
- shadow={shadow}
- modalWidth={modalWidth}
- />
- )}
-
- >
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/ImageGallery/ImageItemOverlay.tsx b/cx-portal-shared-components/src/components/basic/ImageGallery/ImageItemOverlay.tsx
deleted file mode 100644
index c7dc4a1ad..000000000
--- a/cx-portal-shared-components/src/components/basic/ImageGallery/ImageItemOverlay.tsx
+++ /dev/null
@@ -1,106 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 Mercedes-Benz Group AG and BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import MuiDialog from '@mui/material/Dialog'
-import { ImageType } from './types'
-import { IconButton } from '../IconButton'
-import CloseIcon from '@mui/icons-material/Close'
-import { useTheme } from '@mui/material'
-import MuiDialogContent from '@mui/material/DialogContent'
-import { Typography } from '../Typography'
-import { Image } from '../Image'
-
-type ImageItemOverlayProps = {
- onClose: () => void
-}
-
-export default function ImageItemOverlay({
- url,
- text,
- modalWidth = '600',
- onClose,
-}: ImageType & ImageItemOverlayProps) {
- const { palette } = useTheme()
- return (
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/ImageGallery/index.tsx b/cx-portal-shared-components/src/components/basic/ImageGallery/index.tsx
deleted file mode 100644
index 90b9ae5e3..000000000
--- a/cx-portal-shared-components/src/components/basic/ImageGallery/index.tsx
+++ /dev/null
@@ -1,78 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { useState } from 'react'
-import { Carousel } from '../Carousel'
-import { ImageType } from './types'
-import ImageItemOverlay from './ImageItemOverlay'
-
-export const ImageGallery = ({
- gallery,
- modalWidth,
-}: {
- gallery: ImageType[]
- modalWidth?: string
-}) => {
- const [hovered, setHovered] = useState(false)
- const [hoveredImage, setHoveredImage] = useState()
-
- const hoverImageFn = (image: ImageType) => {
- setHovered(true)
- setHoveredImage(image)
- }
-
- return (
- <>
- {hovered && hoveredImage && hoveredImage.url && (
- setHovered(false)}
- url={hoveredImage.url}
- text={hoveredImage.text}
- modalWidth={modalWidth}
- />
- )}
-
- {gallery.map((image) => (
-
- hoverImageFn(image)}
- />
-
- ))}
-
- >
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/ImageGallery/types.ts b/cx-portal-shared-components/src/components/basic/ImageGallery/types.ts
deleted file mode 100644
index 9509b28e7..000000000
--- a/cx-portal-shared-components/src/components/basic/ImageGallery/types.ts
+++ /dev/null
@@ -1,39 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-export type ImageType = {
- url: string
- text: string
- size?:
- | 'small-rectangle'
- | 'small-square'
- | 'medium-rectangle'
- | 'medium-square'
- | 'large-rectangle'
- | 'large-square'
- | 'custom'
- hover?: boolean
- borderRadius?: boolean
- shadow?: boolean
- modalWidth?: string
- width?: string
- height?: string
- additionalStyles?: any
-}
diff --git a/cx-portal-shared-components/src/components/basic/Input/Input.stories.tsx b/cx-portal-shared-components/src/components/basic/Input/Input.stories.tsx
deleted file mode 100644
index 1863c3c73..000000000
--- a/cx-portal-shared-components/src/components/basic/Input/Input.stories.tsx
+++ /dev/null
@@ -1,46 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { ComponentStory } from '@storybook/react'
-
-import { Input as Component } from '.'
-
-export default {
- title: 'Form',
- component: Component,
- argTypes: {
- onClick: {
- action: 'onClick',
- },
- },
-}
-
-const Template: ComponentStory = (args: any) => (
-
-)
-
-export const Input = Template.bind({})
-Input.args = {
- label: 'Label',
- placeholder: 'Placeholder',
- helperText: 'Helper',
- disabled: false,
- error: false,
-}
diff --git a/cx-portal-shared-components/src/components/basic/Input/index.tsx b/cx-portal-shared-components/src/components/basic/Input/index.tsx
deleted file mode 100644
index 215dbe751..000000000
--- a/cx-portal-shared-components/src/components/basic/Input/index.tsx
+++ /dev/null
@@ -1,114 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import {
- TextField,
- TextFieldProps,
- FormHelperText,
- InputLabel,
- InputAdornment,
- Box,
- FormControl,
-} from '@mui/material'
-import ErrorOutline from '@mui/icons-material/ErrorOutline'
-import HelpOutlineIcon from '@mui/icons-material/HelpOutline'
-import { Tooltips } from '../ToolTips'
-
-interface InputProps extends Omit {
- variant?: 'filled'
- tooltipMessage?: string
-}
-
-export const Input = ({
- variant = 'filled',
- label,
- placeholder,
- helperText,
- error = false,
- tooltipMessage,
- ...props
-}: InputProps) => {
- return (
-
-
-
-
- {label}
-
- {tooltipMessage && (
-
-
-
- }
- />
- )}
-
-
-
-
- ),
- }
- : {}
- }
- {...props}
- />
- {error && helperText && (
-
- {helperText}
-
- )}
-
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/LanguageSwitch/LanguageSwitch.stories.tsx b/cx-portal-shared-components/src/components/basic/LanguageSwitch/LanguageSwitch.stories.tsx
deleted file mode 100644
index 9a5bb89d5..000000000
--- a/cx-portal-shared-components/src/components/basic/LanguageSwitch/LanguageSwitch.stories.tsx
+++ /dev/null
@@ -1,43 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { ComponentStory } from '@storybook/react'
-
-import { LanguageSwitch as Component } from '.'
-
-export default {
- title: 'UserMenu',
- component: Component,
- argTypes: {
- onChange: {
- action: 'onChange',
- },
- },
-}
-
-const Template: ComponentStory = (args: any) => (
-
-)
-
-export const LanguageSwitch = Template.bind({})
-LanguageSwitch.args = {
- current: 'de',
- languages: [{ key: 'de' }, { key: 'en', name: 'ENG' }],
-}
diff --git a/cx-portal-shared-components/src/components/basic/LanguageSwitch/index.tsx b/cx-portal-shared-components/src/components/basic/LanguageSwitch/index.tsx
deleted file mode 100644
index 419afa9fc..000000000
--- a/cx-portal-shared-components/src/components/basic/LanguageSwitch/index.tsx
+++ /dev/null
@@ -1,70 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { Box, Link, useTheme } from '@mui/material'
-
-interface Language {
- key: string
- name?: string
-}
-
-interface LanguageSwitchProps {
- current: Language['key']
- languages: Language[]
- onChange: (key: string) => void
-}
-
-export const LanguageSwitch = ({
- current,
- languages,
- onChange,
-}: LanguageSwitchProps) => {
- const { spacing } = useTheme()
-
- const onClick = (e: React.SyntheticEvent, key: string) => {
- e.preventDefault()
- onChange(key)
- }
-
- return (
-
- {languages?.map(({ key, name }) => (
- onClick(e, key)}
- sx={{
- typography: 'label3',
- marginRight: 2,
- ':last-child': {
- marginRight: 0,
- },
- ...(key === current && {
- color: 'text.primary',
- borderBottom: '2px solid',
- }),
- }}
- key={key}
- >
- {name ? name : key.toUpperCase()}
-
- ))}
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/LoadingButton/LoadingButton.stories.tsx b/cx-portal-shared-components/src/components/basic/LoadingButton/LoadingButton.stories.tsx
deleted file mode 100644
index 15158e1e8..000000000
--- a/cx-portal-shared-components/src/components/basic/LoadingButton/LoadingButton.stories.tsx
+++ /dev/null
@@ -1,44 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { ComponentStory } from '@storybook/react'
-
-import { LoadingButton as Component } from '.'
-
-export default {
- title: 'Buttons',
- component: Component,
- argTypes: {},
-}
-
-const Template: ComponentStory = (args: any) => (
-
-)
-
-export const LoadingButton = Template.bind({})
-LoadingButton.args = {
- label: 'Load Data',
- loadIndicator: 'Loading ...',
- loading: true,
- size: 'medium',
- color: 'primary',
- helperTextColor: 'success',
- helperText: 'helperText',
-}
diff --git a/cx-portal-shared-components/src/components/basic/LoadingButton/index.tsx b/cx-portal-shared-components/src/components/basic/LoadingButton/index.tsx
deleted file mode 100644
index 801bc8e17..000000000
--- a/cx-portal-shared-components/src/components/basic/LoadingButton/index.tsx
+++ /dev/null
@@ -1,118 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { Box, useTheme } from '@mui/material'
-import { useEffect, useState } from 'react'
-import { Button, ButtonProps } from '../Button'
-import { CircleProgress } from '../Progress/CircleProgress'
-import { Typography } from '../Typography'
-
-interface LoadingButtonProps extends ButtonProps {
- label: string
- loadIndicator: string
- loading: boolean
- helperText?: string
- helperTextColor?: 'success' | 'error'
- onButtonClick: React.MouseEventHandler
-}
-
-export const LoadingButton = ({
- label,
- loadIndicator,
- loading,
- onButtonClick,
- helperText,
- size,
- color,
- helperTextColor,
- ...props
-}: LoadingButtonProps) => {
- const theme = useTheme()
- const [tagStyle, setTagStyle] = useState({
- padding: '10px 24px',
- fontSize: '18px',
- })
-
- function handleClick(e: any) {
- onButtonClick(e)
- }
-
- useEffect(() => {
- switch (size) {
- case 'small':
- setTagStyle({ padding: '10px 18px', fontSize: '14px' })
- break
- case 'medium':
- setTagStyle({ padding: '10px 24px', fontSize: '18px' })
- break
- case 'large':
- setTagStyle({ padding: '10px 28px', fontSize: '18px' })
- }
- }, [size])
-
- return (
-
- {!loading ? (
-
-
- {helperText && (
-
- {helperText}
-
- )}
-
- ) : (
-
- }
- {...props}
- >
- {loadIndicator}
-
- )}
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/Logo/Logo.stories.tsx b/cx-portal-shared-components/src/components/basic/Logo/Logo.stories.tsx
deleted file mode 100644
index ff00c8cce..000000000
--- a/cx-portal-shared-components/src/components/basic/Logo/Logo.stories.tsx
+++ /dev/null
@@ -1,38 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { ComponentStory } from '@storybook/react'
-
-import { Logo as Component } from '.'
-
-export default {
- title: 'Logo',
- component: Component,
-}
-
-const Template: ComponentStory = (args: any) => (
-
-)
-
-export const Logo = Template.bind({})
-Logo.args = {
- variant: 'short',
- altText: 'Logo CatenaX',
-}
diff --git a/cx-portal-shared-components/src/components/basic/Logo/index.tsx b/cx-portal-shared-components/src/components/basic/Logo/index.tsx
deleted file mode 100644
index 7ef0dedfc..000000000
--- a/cx-portal-shared-components/src/components/basic/Logo/index.tsx
+++ /dev/null
@@ -1,56 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import CXLogo from '../../../assets/logo/cx-logo.svg'
-import CXLogoShort from '../../../assets/logo/cx-logo-short.svg'
-import CXLogoText from '../../../assets/logo/cx-logo-text.svg'
-import { BaseImage } from '../BaseImage'
-
-interface LogoProps {
- variant?: 'standard' | 'short' | 'text' | 'gray'
- altText?: string
-}
-
-export const LogoGrayData =
- 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9Ii04IC04IDY4LjUgNzEuNiI+PHBhdGggZD0iTTQwIDI4LjY5di02YTEgMSAwIDAwLTEuNTUtLjgyTDE0LjY5IDM4LjMxYTQuMTEgNC4xMSAwIDAxLTYuNDUtMy4zOFYyN2E4LjIzIDguMjMgMCAwMTMuNTUtNi43Nmw3LjA4LTQuODlBNC4wNyA0LjA3IDAgMDAyMC42MyAxMlYuOTlBMSAxIDAgMDAxOS4xLjE4bC01IDMuNDJBNC4wOCA0LjA4IDAgMDAxMi4zOCA3djIuODRMNi4zIDE0QTE0LjU3IDE0LjU3IDAgMDAwIDI2djguODlhMTIuMzYgMTIuMzYgMCAwMDE5LjM4IDEwLjJsMTguOS0xM2E0LjA5IDQuMDkgMCAwMDEuNzItMy40eiIgZmlsbD0iI2I0YjRiNCIvPjxwYXRoIGQ9Ik0zMyAxMC42M2wtMTguOSAxM0E0LjA5IDQuMDkgMCAwMDEyLjM1IDI3djZhMSAxIDAgMDAxLjU1LjgxbDIzLjgxLTE2LjRhNC4xMSA0LjExIDAgMDE2LjQ0IDMuMzh2Ny45YTguMjUgOC4yNSAwIDAxLTMuNTUgNi43N2wtNi4zMyA0LjM2LS43Mi41YTQuMDYgNC4wNiAwIDAwLTEuNzUgMy4zNHYxMS4wMmExIDEgMCAwMDEuNTUuODFsNS0zLjQzQTQuMDUgNC4wNSAwIDAwNDAgNDguNzJ2LTIuODVsNi4wNi00LjE4YTE0LjU4IDE0LjU4IDAgMDA2LjI5LTEyVjIwLjhBMTIuMzUgMTIuMzUgMCAwMDMzIDEwLjYzeiIgZmlsbD0iI2ExYTFhMSIvPjwvc3ZnPg=='
-
-export const Logo = ({
- variant = 'standard',
- altText = 'Catena-X',
- ...props
-}: LogoProps) => {
- let image
-
- switch (variant) {
- case 'short':
- image = CXLogoShort
- break
- case 'text':
- image = CXLogoText
- break
- case 'gray':
- image = LogoGrayData
- break
- default:
- image = CXLogo
- }
-
- return
-}
diff --git a/cx-portal-shared-components/src/components/basic/MainNavigation/MainNavigation.stories.tsx b/cx-portal-shared-components/src/components/basic/MainNavigation/MainNavigation.stories.tsx
deleted file mode 100644
index 9c2642de4..000000000
--- a/cx-portal-shared-components/src/components/basic/MainNavigation/MainNavigation.stories.tsx
+++ /dev/null
@@ -1,73 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { ComponentStory } from '@storybook/react'
-import { Box } from '@mui/material'
-import CXLogoText from '../../../assets/logo/cx-logo-text.svg'
-
-import { MainNavigation as Component } from '.'
-import { Button } from '../Button'
-import { IconButton } from '../IconButton'
-import PersonOutlineIcon from '@mui/icons-material/PersonOutline'
-
-export default {
- title: 'Navigation',
- component: Component,
- argTypes: {},
-}
-
-const items = [
- { href: '/home', title: 'Home' },
- { href: '/appmarktplace', title: 'App Marktplace' },
- { href: '/datamanagement', title: 'Data Management' },
- { href: '/partnernetwork', title: 'Partner Network' },
-]
-
-const Template: ComponentStory = (args: any) => (
-
-
-
-
-
-
-
-
-
-)
-
-export const MainNavigation = Template.bind({})
-MainNavigation.args = {
- items: items,
-}
diff --git a/cx-portal-shared-components/src/components/basic/MainNavigation/index.tsx b/cx-portal-shared-components/src/components/basic/MainNavigation/index.tsx
deleted file mode 100644
index e9012609b..000000000
--- a/cx-portal-shared-components/src/components/basic/MainNavigation/index.tsx
+++ /dev/null
@@ -1,87 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { Children } from 'react'
-import { Box } from '@mui/material'
-import { MenuProps } from '../../basic/Menu'
-import { Navigation } from '../../content/Navigation'
-
-export interface MainNavigationProps extends MenuProps {
- children?: React.ReactNode
-}
-
-export const mainNavigationHeight = 85
-
-export const MainNavigation = ({
- children,
- items,
- component,
-}: MainNavigationProps) => {
- const arrayChildren = Children.toArray(children)
-
- return (
-
- {arrayChildren.length && (
-
- {arrayChildren[0]}
-
- )}
-
-
-
-
-
- {arrayChildren.length && (
-
- {arrayChildren[1]}
-
- )}
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/Menu/Menu.stories.tsx b/cx-portal-shared-components/src/components/basic/Menu/Menu.stories.tsx
deleted file mode 100644
index bb640223e..000000000
--- a/cx-portal-shared-components/src/components/basic/Menu/Menu.stories.tsx
+++ /dev/null
@@ -1,54 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { ComponentStory } from '@storybook/react'
-
-import { Menu as Component } from '.'
-
-export default {
- title: 'Menus',
- component: Component,
-}
-
-const Template: ComponentStory = (args: any) => (
-
-)
-
-export const Menu = Template.bind({})
-Menu.args = {
- items: [
- {
- href: '/1',
- title: 'Menu Item 1',
- children: [
- { href: '/1/1', title: 'Submenu Item 1' },
- { href: '/1/2', title: 'Submenu Item 2' },
- {
- href: '/1/3',
- title: 'Submenu Item 3',
- hint: 'coming soon',
- disable: true,
- },
- ],
- },
- { href: '/2', title: 'Menu Item 2' },
- { href: '/3', title: 'Menu Item 3' },
- ],
-}
diff --git a/cx-portal-shared-components/src/components/basic/Menu/MenuItem.tsx b/cx-portal-shared-components/src/components/basic/Menu/MenuItem.tsx
deleted file mode 100644
index 434185422..000000000
--- a/cx-portal-shared-components/src/components/basic/Menu/MenuItem.tsx
+++ /dev/null
@@ -1,155 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { ArrowForward } from '@mui/icons-material'
-import { Box, BoxProps, Divider, Link, ListItem, useTheme } from '@mui/material'
-import { useState } from 'react'
-import { MenuType, NotificationBadgeType } from '.'
-import { Typography } from '../Typography'
-
-type LinkItem = Partial>
-
-export interface MenuItemProps extends LinkItem {
- title: string
- hint?: string
- children?: MenuItemProps[]
- component?: React.ElementType
- divider?: boolean
- menuProps?: BoxProps
- onClick?: React.MouseEventHandler
- Menu?: MenuType
- disable?: boolean
- notificationInfo?: NotificationBadgeType
- showNotificationCount?: boolean
-}
-
-export const MenuItem = ({
- title,
- hint,
- disable,
- children,
- divider,
- component = Link,
- menuProps,
- onClick,
- Menu,
- notificationInfo,
- showNotificationCount,
- ...props
-}: MenuItemProps) => {
- const theme = useTheme()
- const { spacing } = useTheme()
- const [open, setOpen] = useState(false)
- const notificationColor = notificationInfo?.isNotificationAlert
- ? theme.palette.danger.dangerBadge
- : theme.palette.brand.brand02
- const onMouseEnter = () => setOpen(true)
-
- const onMouseLeave = () => setOpen(false)
-
- return (
- !onClick || disable || onClick(e)}
- >
-
- {title}
- {hint && (
-
-
- {hint}
-
-
- )}
- {children && (
-
- )}
- {showNotificationCount &&
- notificationInfo &&
- notificationInfo.notificationCount > 0 && (
-
- {notificationInfo?.notificationCount}
-
- )}
-
- {Menu && children && open && }
- {divider && }
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/Menu/index.tsx b/cx-portal-shared-components/src/components/basic/Menu/index.tsx
deleted file mode 100644
index 808f3a330..000000000
--- a/cx-portal-shared-components/src/components/basic/Menu/index.tsx
+++ /dev/null
@@ -1,68 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { Box, BoxProps, Divider, List, useTheme } from '@mui/material'
-import uniqueId from 'lodash/uniqueId'
-import { MenuItem, MenuItemProps } from './MenuItem'
-
-export type NotificationBadgeType = {
- notificationCount: number
- isNotificationAlert: boolean
-}
-
-export interface MenuProps extends BoxProps {
- items: MenuItemProps[]
- component?: React.ElementType
- divider?: boolean
- notificationInfo?: NotificationBadgeType
-}
-
-export const Menu = ({
- items,
- divider,
- component,
- onClick,
- notificationInfo,
- ...props
-}: MenuProps) => {
- const { spacing } = useTheme()
-
- return (
-
-
- {items?.map((item) => (
-
- ))}
-
- {divider && }
-
- )
-}
-
-export type MenuType = typeof Menu
diff --git a/cx-portal-shared-components/src/components/basic/MultiSelectList/Components/SelectAddMore.tsx b/cx-portal-shared-components/src/components/basic/MultiSelectList/Components/SelectAddMore.tsx
deleted file mode 100644
index 6b5cb40e0..000000000
--- a/cx-portal-shared-components/src/components/basic/MultiSelectList/Components/SelectAddMore.tsx
+++ /dev/null
@@ -1,112 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { Box } from '@mui/material'
-import uniqueId from 'lodash/uniqueId'
-import { Button } from '../../Button'
-import { Typography } from '../../Typography'
-import { SelectedTag } from './SelectedTag'
-import { TagSizeType } from '..'
-
-interface SelectAddMoreProps {
- selected: any[]
- buttonAddMore: string
- notItemsText: string
- label: string
- keyTitle: string
- margin?: 'normal' | 'none' | 'dense'
- tagSize?: TagSizeType
- handleShowItems: () => void
-}
-
-export const SelectAddMore = ({
- selected,
- buttonAddMore,
- notItemsText,
- label,
- keyTitle,
- margin,
- tagSize,
- handleShowItems,
-}: SelectAddMoreProps) => {
- const marginTop = margin === 'normal' ? '16px' : '8px'
- return (
-
-
- {label}
-
-
-
- {selected.length > 0 ? (
- selected.map((item: any) => (
-
- ))
- ) : (
-
- {notItemsText}
-
- )}
-
-
-
-
-
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/MultiSelectList/Components/SelectInput.tsx b/cx-portal-shared-components/src/components/basic/MultiSelectList/Components/SelectInput.tsx
deleted file mode 100644
index e0b0ef336..000000000
--- a/cx-portal-shared-components/src/components/basic/MultiSelectList/Components/SelectInput.tsx
+++ /dev/null
@@ -1,71 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { AutocompleteRenderInputParams, Box } from '@mui/material'
-import { MultiSelectListProps } from '..'
-import { Input } from '../../Input'
-
-interface SelectInputProps
- extends Omit<
- MultiSelectListProps,
- | 'items'
- | 'onAddItem'
- | 'buttonAddMore'
- | 'notItemsText'
- | 'filterOptionsArgs'
- > {
- params: AutocompleteRenderInputParams
- autoFocus?: boolean
-}
-
-export const SelectInput = ({
- params,
- label,
- placeholder,
- variant,
- margin,
- focused,
- helperText,
- error = false,
- disabled,
- autoFocus,
-}: SelectInputProps) => (
-
-
-
-)
diff --git a/cx-portal-shared-components/src/components/basic/MultiSelectList/Components/SelectOptions.tsx b/cx-portal-shared-components/src/components/basic/MultiSelectList/Components/SelectOptions.tsx
deleted file mode 100644
index 813087d4f..000000000
--- a/cx-portal-shared-components/src/components/basic/MultiSelectList/Components/SelectOptions.tsx
+++ /dev/null
@@ -1,60 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { Box } from '@mui/material'
-import { HTMLAttributes } from 'react'
-import { PartsType } from '..'
-
-interface SelectOptionsProps {
- props: HTMLAttributes
- parts: PartsType[]
-}
-
-export const SelectOptions = ({ props, parts }: SelectOptionsProps) => (
-
-)
diff --git a/cx-portal-shared-components/src/components/basic/MultiSelectList/Components/SelectedTag.tsx b/cx-portal-shared-components/src/components/basic/MultiSelectList/Components/SelectedTag.tsx
deleted file mode 100644
index d0c0addff..000000000
--- a/cx-portal-shared-components/src/components/basic/MultiSelectList/Components/SelectedTag.tsx
+++ /dev/null
@@ -1,70 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { Box, useTheme } from '@mui/material'
-import { Typography } from '../../Typography'
-import { TagSizeType } from '..'
-import { useEffect, useState } from 'react'
-
-interface SelectedTagProps {
- title: string
- size?: TagSizeType
-}
-
-export const SelectedTag = ({ title, size }: SelectedTagProps) => {
- const theme = useTheme()
- const [tagStyle, setTagStyle] = useState({
- padding: '10px 18px',
- fontSize: '14px',
- })
-
- useEffect(() => {
- switch (size) {
- case 'small':
- setTagStyle({ padding: '10px 18px', fontSize: '14px' })
- break
- case 'medium':
- setTagStyle({ padding: '14px', fontSize: '18px' })
- break
- case 'large':
- setTagStyle({ padding: '16px 28px', fontSize: '18px' })
- }
- }, [size])
-
- return (
-
-
- {title}
-
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/MultiSelectList/MultiSelectList.stories.tsx b/cx-portal-shared-components/src/components/basic/MultiSelectList/MultiSelectList.stories.tsx
deleted file mode 100644
index 5b65caa77..000000000
--- a/cx-portal-shared-components/src/components/basic/MultiSelectList/MultiSelectList.stories.tsx
+++ /dev/null
@@ -1,103 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { ComponentStory } from '@storybook/react'
-
-import { MultiSelectList as Component } from '.'
-
-export default {
- title: 'Form',
- component: Component,
- argTypes: {},
-}
-
-const items: any[] = [
- {
- id: 1,
- title: 'Dismantler App',
- value: 'App1',
- },
- {
- id: 2,
- title: 'Application name',
- value: 'App2',
- },
- {
- id: 3,
- title: 'Title Application',
- value: 'App3',
- },
- {
- id: 4,
- title: 'CX Design lunched',
- value: 'App4',
- },
- {
- id: 5,
- title: 'Fleet Manager',
- value: 'App5',
- },
- {
- id: 6,
- title: 'Fraud Daschboard',
- value: 'App6',
- },
- {
- id: 7,
- title: 'App Manage Customers',
- value: 'App7',
- },
- {
- id: 8,
- title: 'Smart Application',
- value: 'App8',
- },
- {
- id: 9,
- title: 'Material Traceability',
- value: 'App9',
- },
-]
-
-const Template: ComponentStory = (args: any) => (
-
-)
-
-export const MultiSelectList = Template.bind({})
-MultiSelectList.args = {
- items: items,
- label: 'Label Name',
- placeholder: 'Enter label name (type min 2 character)',
- helperText: 'Helper',
- disabled: false,
- error: false,
- margin: 'dense',
- variant: 'filled',
- focused: false,
- popperHeight: 0, // 0 = auto size
- clearText: 'clear',
- noOptionsText: 'No Options',
- buttonAddMore: 'Add More',
- notItemsText: 'not items selected',
- keyTitle: 'title',
- tagSize: 'medium',
- onAddItem: (item: any) => console.log('items:', item),
- filterOptionsArgs: {},
-}
diff --git a/cx-portal-shared-components/src/components/basic/MultiSelectList/index.tsx b/cx-portal-shared-components/src/components/basic/MultiSelectList/index.tsx
deleted file mode 100644
index 80415cb5c..000000000
--- a/cx-portal-shared-components/src/components/basic/MultiSelectList/index.tsx
+++ /dev/null
@@ -1,216 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { Box, Chip, Popper, TextFieldProps, useTheme } from '@mui/material'
-import Autocomplete, {
- AutocompleteRenderInputParams,
- createFilterOptions,
-} from '@mui/material/Autocomplete'
-import parse from 'autosuggest-highlight/parse'
-import match from 'autosuggest-highlight/match'
-import { SelectInput } from './Components/SelectInput'
-import { SelectOptions } from './Components/SelectOptions'
-import { SelectAddMore } from './Components/SelectAddMore'
-import uniqueId from 'lodash/uniqueId'
-import { useEffect, useState } from 'react'
-
-export type TagSizeType = 'small' | 'medium' | 'large'
-export type PartsType = {
- text: string
- highlight: boolean
-}
-
-export interface MultiSelectListProps
- extends Omit {
- items: any[]
- label: string
- placeholder: string
- keyTitle: string
- popperHeight?: number
- variant?: 'filled'
- clearText?: string
- noOptionsText?: string
- buttonAddMore: string
- notItemsText: string
- tagSize?: TagSizeType
- filterOptionsArgs?: {}
- defaultValues?: any
- onAddItem: (items: any[]) => void
-}
-
-export const MultiSelectList = ({
- items,
- label,
- placeholder,
- keyTitle,
- variant,
- margin,
- focused,
- helperText,
- error = false,
- disabled,
- popperHeight = 0,
- clearText = 'Clear',
- noOptionsText = 'No Options',
- buttonAddMore,
- notItemsText,
- tagSize,
- filterOptionsArgs = {},
- defaultValues = [],
- onAddItem,
-}: MultiSelectListProps) => {
- const selectHeight = popperHeight ? `${popperHeight}px` : 'auto'
- const theme = useTheme()
- const [selected, setSelected] = useState([])
- const [showItems, setShowItems] = useState(false)
- const handleChange = (selectedItems: any[]) => {
- onAddItem(selectedItems)
- setSelected(selectedItems)
- }
- const handleViewAddMore = () => {
- setShowItems(false)
- }
-
- const filterOptions = createFilterOptions(
- Object.keys(filterOptionsArgs).length > 0
- ? filterOptionsArgs
- : {
- matchFrom: 'any',
- stringify: (option: any) => option[keyTitle],
- }
- )
-
- useEffect(() => {
- if (defaultValues.length > 0) {
- setSelected(defaultValues)
- onAddItem(defaultValues)
- }
- // eslint-disable-next-line react-hooks/exhaustive-deps
- }, [defaultValues])
-
- useEffect(() => {
- if (items.length > 0) {
- if (defaultValues.length > 0) {
- onAddItem(defaultValues)
- setSelected(defaultValues)
- }
- }
- // eslint-disable-next-line react-hooks/exhaustive-deps
- }, [items])
-
- useEffect(() => {
- if (error) {
- setShowItems(false)
- }
- }, [error])
-
- return (
-
- {!showItems ? (
- (
-
- )}
- ListboxProps={{ style: { maxHeight: selectHeight } }}
- multiple
- disabled={disabled}
- options={items.map((item) => item)}
- getOptionLabel={(option) => option[keyTitle]}
- value={selected}
- filterOptions={filterOptions}
- renderTags={(selectedItems: any[], getTagProps) =>
- selectedItems.map((option: any, index: number) => (
-
- ))
- }
- renderInput={(param: AutocompleteRenderInputParams) => (
-
- )}
- renderOption={(props, option, { inputValue }) => {
- const matches = match(option[keyTitle], inputValue)
- const parts: PartsType[] = parse(option[keyTitle], matches)
- return (
-
- )
- }}
- onChange={(_, selectedItems: any[]) => handleChange(selectedItems)}
- onBlur={() => (error ? setShowItems(false) : setShowItems(true))}
- defaultValue={defaultValues}
- />
- ) : (
- handleViewAddMore()}
- />
- )}
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/Notifications/PageNotification/NotificationContent.tsx b/cx-portal-shared-components/src/components/basic/Notifications/PageNotification/NotificationContent.tsx
deleted file mode 100644
index cb036c993..000000000
--- a/cx-portal-shared-components/src/components/basic/Notifications/PageNotification/NotificationContent.tsx
+++ /dev/null
@@ -1,68 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { Box } from '@mui/material'
-import { PageNotificationsProps } from '.'
-
-interface NotificationContentProps
- extends Omit {
- titleColor?: string
-}
-
-export const NotificationContent = ({
- title,
- description,
- contactText,
- contactLinks,
- contactNewTab,
- titleColor,
-}: NotificationContentProps) => {
- return (
-
- {title && (
-
- {title}
-
- )}
- {description && (
-
- {description}
- {contactText && (
-
- {contactText}
-
- )}
-
- )}
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/Notifications/PageNotification/PageNotification.stories.tsx b/cx-portal-shared-components/src/components/basic/Notifications/PageNotification/PageNotification.stories.tsx
deleted file mode 100644
index 1d6e6713f..000000000
--- a/cx-portal-shared-components/src/components/basic/Notifications/PageNotification/PageNotification.stories.tsx
+++ /dev/null
@@ -1,45 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { ComponentStory } from '@storybook/react'
-
-import { PageNotifications as Component } from '.'
-
-export default {
- title: 'Notifications',
- component: Component,
- argTypes: {},
-}
-const Template: ComponentStory = (args: any) => (
- {args.children}
-)
-
-export const PageNotifications = Template.bind({})
-PageNotifications.args = {
- severity: 'success',
- open: true,
- onCloseNotification: () => console.log('close alert'),
- title: 'Notification title',
- description: 'This is some notification text and can be replaced later.',
- contactText: 'Contact',
- contactLinks: 'https://portal.dev.demo.catena-x.net/',
- showIcon: true,
- contactNewTab: false,
-}
diff --git a/cx-portal-shared-components/src/components/basic/Notifications/PageNotification/index.tsx b/cx-portal-shared-components/src/components/basic/Notifications/PageNotification/index.tsx
deleted file mode 100644
index 1890bcf8d..000000000
--- a/cx-portal-shared-components/src/components/basic/Notifications/PageNotification/index.tsx
+++ /dev/null
@@ -1,126 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { Alert, IconButton, Collapse } from '@mui/material'
-import {
- CheckCircleOutline,
- WarningAmber,
- InfoOutlined,
- Close,
-} from '@mui/icons-material'
-import { NotificationContent } from './NotificationContent'
-import { theme } from '../../../../theme'
-
-export interface PageNotificationsProps {
- severity?: 'error' | 'warning' | 'info' | 'success'
- open: boolean
- onCloseNotification?: () => void
- title?: string
- description?: string
- contactText?: string
- contactLinks?: string
- contactNewTab?: boolean
- showIcon?: boolean
-}
-
-export function color(severity: string) {
- switch (severity) {
- case 'info':
- return theme.palette.support.info
- case 'error':
- return theme.palette.support.error
- case 'warning':
- return theme.palette.support.warning
- case 'success':
- return theme.palette.support.success
- default:
- return ''
- }
-}
-
-export function titleIcon(severity: string) {
- switch (severity) {
- case 'info':
- return
- case 'error':
- return
- case 'warning':
- return
- case 'success':
- return (
-
- )
- default:
- return ''
- }
-}
-
-export const PageNotifications = ({
- severity = 'info',
- open,
- onCloseNotification,
- title,
- description,
- contactText,
- contactLinks,
- contactNewTab,
- showIcon,
-}: PageNotificationsProps) => {
- return (
-
-
-
-
- }
- >
-
-
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/Notifications/Snackbar/PageSnackbar.stories.tsx b/cx-portal-shared-components/src/components/basic/Notifications/Snackbar/PageSnackbar.stories.tsx
deleted file mode 100644
index d6a2a0809..000000000
--- a/cx-portal-shared-components/src/components/basic/Notifications/Snackbar/PageSnackbar.stories.tsx
+++ /dev/null
@@ -1,43 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { ComponentStory } from '@storybook/react'
-
-import { PageSnackbar as Component } from '.'
-
-export default {
- title: 'Notifications',
- component: Component,
- argTypes: {},
-}
-
-const Template: ComponentStory = (args: any) => (
-
-)
-
-export const PageSnackbar = Template.bind({})
-PageSnackbar.args = {
- severity: 'success',
- open: true,
- autoClose: false,
- title: 'Lorem Ipsum',
- description: 'Notification sentence comes here',
- showIcon: true,
-}
diff --git a/cx-portal-shared-components/src/components/basic/Notifications/Snackbar/PageSnackbarStack.stories.tsx b/cx-portal-shared-components/src/components/basic/Notifications/Snackbar/PageSnackbarStack.stories.tsx
deleted file mode 100644
index 3f2f00a20..000000000
--- a/cx-portal-shared-components/src/components/basic/Notifications/Snackbar/PageSnackbarStack.stories.tsx
+++ /dev/null
@@ -1,47 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { ComponentStory } from '@storybook/react'
-import { PageSnackbar } from './index'
-
-import { PageSnackbarStack as Component } from './PageSnackbarStack'
-
-export default {
- title: 'Notifications',
- component: Component,
- argTypes: {},
- args: {
- open: true,
- autoClose: false,
- title: 'Lorem Ipsum',
- description: 'Notification sentence comes here',
- },
-}
-
-const Template: ComponentStory = (args: any) => {
- return (
-
-
-
-
- )
-}
-
-export const PageSnackbarStack = Template.bind({})
diff --git a/cx-portal-shared-components/src/components/basic/Notifications/Snackbar/PageSnackbarStack.tsx b/cx-portal-shared-components/src/components/basic/Notifications/Snackbar/PageSnackbarStack.tsx
deleted file mode 100644
index e8c338b99..000000000
--- a/cx-portal-shared-components/src/components/basic/Notifications/Snackbar/PageSnackbarStack.tsx
+++ /dev/null
@@ -1,44 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { Box } from '@mui/material'
-import { PropsWithChildren } from 'react'
-import * as React from 'react'
-
-export const PageSnackbarStack = ({ children }: PropsWithChildren<{}>) => {
- return (
- *': {
- marginTop: 2,
- position: 'relative !important',
- top: 'auto !important',
- bottom: 'auto !important',
- },
- }}
- >
- {children}
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/Notifications/Snackbar/index.tsx b/cx-portal-shared-components/src/components/basic/Notifications/Snackbar/index.tsx
deleted file mode 100644
index 0baf1b3ef..000000000
--- a/cx-portal-shared-components/src/components/basic/Notifications/Snackbar/index.tsx
+++ /dev/null
@@ -1,158 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { Box, IconButton, Slide } from '@mui/material'
-import { Close } from '@mui/icons-material'
-import { SlideProps } from '@mui/material/Slide/Slide'
-import { useCallback, useEffect, useRef, useState } from 'react'
-import Snackbar from '@mui/material/Snackbar'
-import CheckIcon from '@mui/icons-material/Check'
-import ErrorOutlineIcon from '@mui/icons-material/ErrorOutline'
-
-const AUTO_CLOSE_DELAY_MS = 3000
-
-const SlideTransition = (props: SlideProps) => (
-
-)
-
-export interface PageSnackbarProps {
- severity?: 'error' | 'success'
- open: boolean
- onCloseNotification?: () => void
- title?: string | JSX.Element
- description?: string | JSX.Element
- showIcon?: boolean
- autoClose?: boolean
-}
-
-export const PageSnackbar = ({
- severity = 'success',
- onCloseNotification,
- open,
- autoClose,
- title,
- description,
- showIcon = true,
- ...props
-}: PageSnackbarProps) => {
- const [isOpen, setOpen] = useState(open)
-
- const autoCloseTimeoutRef = useRef>()
-
- useEffect(() => setOpen(open), [open])
-
- const cancelAutoClose = useCallback(
- () => clearTimeout(autoCloseTimeoutRef.current!),
- []
- )
-
- const doClose = useCallback(() => {
- cancelAutoClose()
- setOpen(false)
-
- onCloseNotification?.()
- }, [cancelAutoClose, onCloseNotification])
-
- const handleAutoClose = useCallback(() => {
- cancelAutoClose()
-
- if (autoClose) {
- autoCloseTimeoutRef.current = setTimeout(doClose, AUTO_CLOSE_DELAY_MS)
- }
- }, [autoClose, cancelAutoClose, doClose])
-
- useEffect(handleAutoClose, [autoClose, handleAutoClose])
-
- const renderIcon = () => {
- switch (severity) {
- case 'success':
- return
- case 'error':
- return
- }
- }
-
- return (
-
- {showIcon && (
-
- {renderIcon()}
-
- )}
-
- {title && (
-
- {title}
-
- )}
- {description}
-
-
-
-
-
-
-
- }
- sx={{
- '.MuiSnackbarContent-root': {
- width: '390px',
- typography: 'body3',
- backgroundColor: 'common.white',
- color: 'text.primary',
- borderWidth: '1px',
- borderStyle: 'solid',
- borderColor: 'action.disabledBackground',
- borderRadius: '8px',
- boxShadow: '0px 10px 20px 0px rgba(80, 80, 80, 0.3)',
- },
- '.MuiSnackbarContent-message': {
- width: '100%',
- },
- }}
- />
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/OrderStatusButton/OrderStatusButton.stories.tsx b/cx-portal-shared-components/src/components/basic/OrderStatusButton/OrderStatusButton.stories.tsx
deleted file mode 100644
index 16619ce11..000000000
--- a/cx-portal-shared-components/src/components/basic/OrderStatusButton/OrderStatusButton.stories.tsx
+++ /dev/null
@@ -1,60 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { ComponentStory } from '@storybook/react'
-
-import { OrderStatusButton as Component } from '.'
-
-export default {
- title: 'Buttons',
- component: Component,
- argTypes: {},
-}
-
-const Template: ComponentStory = (args: any) => (
-
-)
-
-export const OrderStatusButton = Template.bind({})
-OrderStatusButton.args = {
- label: 'Subscribe',
- color: 'primary',
- selectable: false,
- buttonData: [
- {
- isIcon: false,
- buttonLabel: 'Subscribtion initiated',
- zIndex: 4,
- backgroundColor: '#e1e1e1',
- },
- {
- isIcon: true,
- buttonLabel: 'App Instance deployed',
- zIndex: 3,
- backgroundColor: '#f3f3f3',
- },
- {
- isIcon: true,
- buttonLabel: 'Activation, Notifications & credentials',
- zIndex: 2,
- backgroundColor: '#f9f9f9',
- },
- ],
-}
diff --git a/cx-portal-shared-components/src/components/basic/OrderStatusButton/index.tsx b/cx-portal-shared-components/src/components/basic/OrderStatusButton/index.tsx
deleted file mode 100644
index a642422e0..000000000
--- a/cx-portal-shared-components/src/components/basic/OrderStatusButton/index.tsx
+++ /dev/null
@@ -1,153 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { Box, useTheme } from '@mui/material'
-import CheckCircleOutlinedIcon from '@mui/icons-material/CheckCircleOutlined'
-import { Button, ButtonProps } from '../Button'
-import { Typography } from '../Typography'
-
-interface ButtonInputData {
- isIcon: boolean
- buttonLabel: string
- zIndex: number
- backgroundColor: string
-}
-
-interface OrderStatusButtonProps extends ButtonProps {
- label: string
- buttonData: ButtonInputData[]
- selectable?: boolean
- onButtonClick?: React.MouseEventHandler
-}
-
-export const OrderStatusButton = ({
- label,
- color,
- buttonData,
- selectable,
- onButtonClick,
- ...props
-}: OrderStatusButtonProps) => {
- const theme = useTheme()
-
- const handleClick = (e: any) => {
- onButtonClick && onButtonClick(e)
- }
-
- const fetchButton = (
- zIndex: number,
- numberLabel: number,
- isIcon: boolean,
- buttonLabel: string,
- background: string
- ) => {
- return (
-
- )
- }
-
- return (
-
-
- {buttonData.map((data: ButtonInputData, index: number) => {
- return fetchButton(
- data.zIndex,
- index + 1,
- data.isIcon,
- data.buttonLabel,
- data.backgroundColor
- )
- })}
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/ProcessList/ListItem.tsx b/cx-portal-shared-components/src/components/basic/ProcessList/ListItem.tsx
deleted file mode 100644
index 63b553578..000000000
--- a/cx-portal-shared-components/src/components/basic/ProcessList/ListItem.tsx
+++ /dev/null
@@ -1,122 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { Box } from '@mui/material'
-import { Typography } from '../Typography'
-import { theme } from '../../../theme'
-
-interface ListItemProps {
- step: number
- headline: string
- description: string
- stepsColor: string
- stepsFontColor: string
- lastItem: boolean
-}
-
-export const ListItem = ({
- step,
- headline,
- description,
- stepsColor,
- stepsFontColor,
- lastItem,
-}: ListItemProps) => {
- const borderToNextStep = !lastItem ? `2px solid ${stepsColor}` : 'none'
- return (
-
-
-
-
- {step}
-
-
-
-
-
-
- {headline}
-
-
-
- {description}
-
-
-
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/ProcessList/ProcessList.stories.tsx b/cx-portal-shared-components/src/components/basic/ProcessList/ProcessList.stories.tsx
deleted file mode 100644
index eca93f541..000000000
--- a/cx-portal-shared-components/src/components/basic/ProcessList/ProcessList.stories.tsx
+++ /dev/null
@@ -1,80 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { ComponentStory } from '@storybook/react'
-
-import { ProcessList as Component } from '.'
-
-export default {
- title: 'ProcessList',
- component: Component,
- argTypes: {},
-}
-
-const processListElements = [
- {
- step: 1,
- headline: 'App Market Card',
- description:
- 'descsription Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.',
- },
- {
- step: 2,
- headline: 'App Page',
- description:
- 'App Page descsription sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua Lorem ipsum dolor sit amet, consetetur sadipscing elitr.',
- },
- {
- step: 3,
- headline: 'Contrac & Consent',
- description:
- 'Contrac & Consent descsription Lorem ipsum dolor sit amet, consetetur sadipscing elitr.',
- },
- {
- step: 4,
- headline: 'Technical Integration',
- description:
- 'Technical Integration descsription consetetur sadipscing elitr Lorem ipsum dolor sit amet, consetetur sadipscing elitr.',
- },
- {
- step: 5,
- headline: 'Beta Test',
- description:
- 'Beta Test descsription Lorem ipsum dolor sit amet, consetetur sadipscing elitr.',
- },
- {
- step: 6,
- headline: 'Validate & Publish',
- description:
- 'Validate & Publish descsription sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.',
- },
-]
-
-const Template: ComponentStory = (args: any) => (
-
-)
-
-export const ProcessList = Template.bind({})
-ProcessList.args = {
- list: processListElements,
- stepsColor: '#FFA600',
- stepsFontColor: '#fff',
- elementNumbers: 6,
-}
diff --git a/cx-portal-shared-components/src/components/basic/ProcessList/index.tsx b/cx-portal-shared-components/src/components/basic/ProcessList/index.tsx
deleted file mode 100644
index 09dc65f13..000000000
--- a/cx-portal-shared-components/src/components/basic/ProcessList/index.tsx
+++ /dev/null
@@ -1,57 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { Box } from '@mui/material'
-import { ListItem } from './ListItem'
-
-export interface ProcessListProps {
- list: any[]
- stepsColor: string
- stepsFontColor: string
- elementNumbers: number
-}
-
-export const ProcessList = ({
- list,
- stepsColor,
- stepsFontColor,
- elementNumbers,
-}: ProcessListProps) => {
- return (
-
- {list &&
- list
- .filter(
- (item) => item.step <= elementNumbers && item.step <= list.length
- )
- .map((item, i) => (
-
- ))}
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/Progress/CircleProgress/CircleProgress.stories.tsx b/cx-portal-shared-components/src/components/basic/Progress/CircleProgress/CircleProgress.stories.tsx
deleted file mode 100644
index d57e89cdc..000000000
--- a/cx-portal-shared-components/src/components/basic/Progress/CircleProgress/CircleProgress.stories.tsx
+++ /dev/null
@@ -1,44 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { ComponentStory } from '@storybook/react'
-
-import { CircleProgress as Component } from '.'
-
-export default {
- title: 'Progress',
- component: Component,
- argTypes: {},
-}
-
-const Template: ComponentStory = (args: any) => (
-
-)
-
-export const CircleProgress = Template.bind({})
-CircleProgress.args = {
- step: 25,
- interval: 800,
- iteration: true,
- thickness: 8,
- size: 80,
- colorVariant: 'primary',
- variant: 'determinate',
-}
diff --git a/cx-portal-shared-components/src/components/basic/Progress/CircleProgress/index.tsx b/cx-portal-shared-components/src/components/basic/Progress/CircleProgress/index.tsx
deleted file mode 100644
index d849e06a5..000000000
--- a/cx-portal-shared-components/src/components/basic/Progress/CircleProgress/index.tsx
+++ /dev/null
@@ -1,73 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import CircularProgress, {
- CircularProgressProps,
-} from '@mui/material/CircularProgress'
-import { useState, useEffect } from 'react'
-
-interface CircleProgressProps extends Omit {
- step?: number
- interval?: number
- iteration?: boolean
- variant: 'determinate' | 'indeterminate'
- colorVariant:
- | 'primary'
- | 'secondary'
- | 'error'
- | 'info'
- | 'success'
- | 'warning'
-}
-
-export const CircleProgress = ({
- step = 25,
- interval = 800,
- iteration = true,
- thickness = 8,
- size = 80,
- colorVariant,
- variant,
-}: CircleProgressProps) => {
- const [progress, setProgress] = useState(0)
-
- useEffect(() => {
- const timer = setInterval(() => {
- const rerun = iteration ? 0 : 100
- setProgress((prevProgress: number) =>
- prevProgress >= 100 ? rerun : prevProgress + step
- )
- }, interval)
-
- return () => {
- clearInterval(timer)
- }
- }, [interval, step, iteration])
-
- return (
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/Radio/Radio.stories.tsx b/cx-portal-shared-components/src/components/basic/Radio/Radio.stories.tsx
deleted file mode 100644
index d523ffc7e..000000000
--- a/cx-portal-shared-components/src/components/basic/Radio/Radio.stories.tsx
+++ /dev/null
@@ -1,43 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { ComponentStory } from '@storybook/react'
-
-import { Radio as Component } from '.'
-
-export default {
- title: 'Form',
- component: Component,
- argTypes: {
- onClick: {
- action: 'onClick',
- },
- },
-}
-
-const Template: ComponentStory = (args: any) => (
-
-)
-
-export const Radio = Template.bind({})
-Radio.args = {
- disabled: false,
- label: 'Some Radio label',
-}
diff --git a/cx-portal-shared-components/src/components/basic/Radio/index.tsx b/cx-portal-shared-components/src/components/basic/Radio/index.tsx
deleted file mode 100644
index f42e71610..000000000
--- a/cx-portal-shared-components/src/components/basic/Radio/index.tsx
+++ /dev/null
@@ -1,40 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import MuiRadio, { RadioProps as MuiRadioProps } from '@mui/material/Radio'
-import FormControlLabel from '@mui/material/FormControlLabel'
-
-const ariaLabel = { inputProps: { 'aria-label': 'Radio demo' } }
-
-interface RadioProps extends Omit {
- size?: 'medium' | 'small'
- label?: string | number
-}
-
-export const Radio = ({ size = 'medium', label, ...props }: RadioProps) => {
- return label ? (
- }
- label={label}
- />
- ) : (
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/Rating/Rating.stories.tsx b/cx-portal-shared-components/src/components/basic/Rating/Rating.stories.tsx
deleted file mode 100644
index 7c19f9df9..000000000
--- a/cx-portal-shared-components/src/components/basic/Rating/Rating.stories.tsx
+++ /dev/null
@@ -1,37 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { ComponentStory } from '@storybook/react'
-
-import { Rating as Component } from '.'
-
-export default {
- title: 'Rating',
- component: Component,
-}
-
-const Template: ComponentStory = (args: any) => (
-
-)
-
-export const Rating = Template.bind({})
-Rating.args = {
- defaultRating: 0,
-}
diff --git a/cx-portal-shared-components/src/components/basic/Rating/index.tsx b/cx-portal-shared-components/src/components/basic/Rating/index.tsx
deleted file mode 100644
index 1b1737312..000000000
--- a/cx-portal-shared-components/src/components/basic/Rating/index.tsx
+++ /dev/null
@@ -1,47 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import * as React from 'react'
-import Box from '@mui/material/Box'
-import RatingUI from '@mui/material/Rating'
-
-interface RatingContentProps {
- defaultRating: number
-}
-
-export const Rating = ({ defaultRating }: RatingContentProps) => {
- const [value, setValue] = React.useState(defaultRating)
- return (
- legend': { mt: defaultRating },
- }}
- >
- {
- setValue(newValue)
- }}
- />
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/SearchInput/SearchInput.stories.tsx b/cx-portal-shared-components/src/components/basic/SearchInput/SearchInput.stories.tsx
deleted file mode 100644
index cbf80be41..000000000
--- a/cx-portal-shared-components/src/components/basic/SearchInput/SearchInput.stories.tsx
+++ /dev/null
@@ -1,36 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { ComponentStory } from '@storybook/react'
-
-import { SearchInput as Component } from '.'
-
-export default {
- title: 'Form',
- component: Component,
- argTypes: {},
-}
-
-const Template: ComponentStory = (args: any) => (
-
-)
-
-export const SearchInput = Template.bind({})
-SearchInput.args = {}
diff --git a/cx-portal-shared-components/src/components/basic/SearchInput/index.tsx b/cx-portal-shared-components/src/components/basic/SearchInput/index.tsx
deleted file mode 100644
index 08353dc66..000000000
--- a/cx-portal-shared-components/src/components/basic/SearchInput/index.tsx
+++ /dev/null
@@ -1,60 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import SearchIcon from '@mui/icons-material/Search'
-import {
- Box,
- IconProps,
- TextField,
- TextFieldProps,
- useTheme,
-} from '@mui/material'
-
-interface SearchProps extends Omit {
- variant?: 'outlined'
- endAdornment?: IconProps
-}
-
-export const SearchInput = ({
- variant,
- endAdornment,
- ...props
-}: SearchProps) => {
- const theme = useTheme()
- const { icon01 } = theme.palette.icon
-
- return (
-
- ,
- endAdornment: endAdornment || null,
- }}
- {...props}
- />
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/SelectList/SelectList.stories.tsx b/cx-portal-shared-components/src/components/basic/SelectList/SelectList.stories.tsx
deleted file mode 100644
index 345bb97a8..000000000
--- a/cx-portal-shared-components/src/components/basic/SelectList/SelectList.stories.tsx
+++ /dev/null
@@ -1,84 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { ComponentStory } from '@storybook/react'
-
-import { SelectList as Component } from '.'
-
-export default {
- title: 'Form',
- component: Component,
- argTypes: {},
-}
-
-const countries = [
- {
- id: 1,
- title: 'Germany',
- value: 'DE',
- },
- {
- id: 2,
- title: 'France',
- value: 'FR',
- },
- {
- id: 3,
- title: 'Sweden',
- value: 'SW',
- },
- {
- id: 4,
- title: 'Swaziland',
- value: 'SZ',
- },
- {
- id: 5,
- title: 'Argentina',
- value: 'AR',
- },
- {
- id: 6,
- title: 'Brazil',
- value: 'BR',
- },
-]
-
-const Template: ComponentStory = (args: any) => (
-
-)
-
-export const SelectList = Template.bind({})
-SelectList.args = {
- items: countries,
- label: 'Select country',
- placeholder: 'Enter country name (type min 2 character)',
- helperText: 'Helper',
- disabled: false,
- error: false,
- margin: 'dense',
- variant: 'filled',
- focused: false,
- clearText: 'clear',
- noOptionsText: 'No Options',
- popperHeight: 0, // 0 = auto size
- onChangeItem: (item: any) => console.log('selected:', item),
- keyTitle: 'title',
-}
diff --git a/cx-portal-shared-components/src/components/basic/SelectList/index.tsx b/cx-portal-shared-components/src/components/basic/SelectList/index.tsx
deleted file mode 100644
index dae52c16c..000000000
--- a/cx-portal-shared-components/src/components/basic/SelectList/index.tsx
+++ /dev/null
@@ -1,103 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { TextFieldProps } from '@mui/material'
-import Autocomplete from '@mui/material/Autocomplete'
-import parse from 'autosuggest-highlight/parse'
-import match from 'autosuggest-highlight/match'
-import { SelectInput } from '../MultiSelectList/Components/SelectInput'
-import { SelectOptions } from '../MultiSelectList/Components/SelectOptions'
-import uniqueId from 'lodash/uniqueId'
-import isEqual from 'lodash/isEqual'
-
-interface SelectListProps extends Omit {
- items: any[]
- label: string
- placeholder: string
- keyTitle: string
- popperHeight?: number
- variant?: 'filled'
- clearText?: string
- noOptionsText?: string
- defaultValue?: {}
- disableClearable?: boolean
- onChangeItem: (items: any) => void
-}
-
-export const SelectList = ({
- items,
- label,
- placeholder,
- defaultValue = {},
- disableClearable = false,
- keyTitle,
- variant,
- margin,
- focused,
- helperText,
- error = false,
- disabled,
- popperHeight = 0,
- clearText = 'Clear',
- noOptionsText = 'No Options',
- onChangeItem,
-}: SelectListProps) => {
- const selectHeight = popperHeight ? `${popperHeight}px` : 'auto'
- return (
- item)}
- getOptionLabel={(option) => option[keyTitle] || ''}
- onChange={(_, reason: any) => onChangeItem(reason)}
- isOptionEqualToValue={(option, value) => isEqual(option, value)}
- renderOption={(props, option, { inputValue }) => (
-
- )}
- value={defaultValue}
- renderInput={(params) => {
- return (
-
- )
- }}
- />
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/SharedCssBaseline/index.tsx b/cx-portal-shared-components/src/components/basic/SharedCssBaseline/index.tsx
deleted file mode 100644
index 863b3e8f2..000000000
--- a/cx-portal-shared-components/src/components/basic/SharedCssBaseline/index.tsx
+++ /dev/null
@@ -1,23 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import CssBaseline from '@mui/material/CssBaseline'
-
-export const SharedCssBaseline = () =>
diff --git a/cx-portal-shared-components/src/components/basic/SharedThemeProvider/index.tsx b/cx-portal-shared-components/src/components/basic/SharedThemeProvider/index.tsx
deleted file mode 100644
index ff794fea5..000000000
--- a/cx-portal-shared-components/src/components/basic/SharedThemeProvider/index.tsx
+++ /dev/null
@@ -1,33 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-// Note: The global.scss import must be the first in this file for the library to be build correctly!
-import '../../../scss/global.scss'
-import { ThemeProvider } from '@mui/material/styles'
-import { theme } from '../../../theme'
-import '../../../scss/fonts.scss'
-
-interface SharedThemeProviderProps {
- children: React.ReactNode
-}
-
-export const SharedThemeProvider = ({ children }: SharedThemeProviderProps) => (
- {children}
-)
diff --git a/cx-portal-shared-components/src/components/basic/SideMenu/SideMenu.stories.tsx b/cx-portal-shared-components/src/components/basic/SideMenu/SideMenu.stories.tsx
deleted file mode 100644
index 075df927e..000000000
--- a/cx-portal-shared-components/src/components/basic/SideMenu/SideMenu.stories.tsx
+++ /dev/null
@@ -1,57 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { Box } from '@mui/material'
-import { ComponentStory } from '@storybook/react'
-
-import { SideMenu as Component } from '.'
-import { DraggableChip } from '../Chip/DraggableChip'
-
-export default {
- title: 'Menus',
- component: Component,
- args: {
- header: 'Filter Semantic Models by assigned Use Cases',
- subHeader: 'Assign a Use Case by dragging it to a Semantic Model',
- buttonTextCollapsed: 'Show Filter',
- buttonTextExpanded: 'Close Filter',
- isExpanded: false,
- },
-}
-
-const Template: ComponentStory = (args: any) => (
-
-)
-
-export const SideMenu = Template.bind({})
-SideMenu.args = {
- children: (
- * + *': { marginTop: 2 } }}>
- name_use_case_4
- name_use_case_4
- name_use_case_4
- name_use_case_7
- name_use_case_7
- name_use_case_7
- name_use_case_8
- name_use_case_8
-
- ),
-}
diff --git a/cx-portal-shared-components/src/components/basic/SideMenu/index.tsx b/cx-portal-shared-components/src/components/basic/SideMenu/index.tsx
deleted file mode 100644
index 21eec150c..000000000
--- a/cx-portal-shared-components/src/components/basic/SideMenu/index.tsx
+++ /dev/null
@@ -1,120 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { Box, BoxProps, Collapse, Fade } from '@mui/material'
-import { useCallback, useEffect, useState } from 'react'
-import { Button } from '../Button'
-import ArrowDownwardIcon from '@mui/icons-material/ArrowDownward'
-import ArrowUpwardIcon from '@mui/icons-material/ArrowUpward'
-
-export interface SideMenuProps extends Omit {
- header?: string | JSX.Element
- subHeader?: string | JSX.Element
- buttonTextCollapsed: string
- buttonTextExpanded: string
- isExpanded?: boolean
- onChange?: (isExpanded: boolean) => void
- children: React.ReactElement
-}
-
-export const SideMenu = ({
- header,
- subHeader,
- buttonTextCollapsed,
- buttonTextExpanded,
- isExpanded,
- onChange,
- children,
- ...props
-}: SideMenuProps) => {
- const [expanded, setExpanded] = useState(isExpanded)
-
- useEffect(() => setExpanded(isExpanded), [isExpanded])
-
- const toggleExpanded = useCallback(() => {
- setExpanded(!expanded)
- onChange?.(!expanded)
- }, [expanded, onChange])
-
- return (
-
- {header && (
-
- {header}
-
- )}
- {subHeader && (
-
- {subHeader}
-
- )}
-
-
-
-
-
- {children}
-
-
-
-
-
-
- : }
- sx={{
- '&:focus': {
- boxShadow: 'none',
- },
- }}
- >
- {expanded ? buttonTextExpanded : buttonTextCollapsed}
-
-
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/SortOption/SortOption.stories.tsx b/cx-portal-shared-components/src/components/basic/SortOption/SortOption.stories.tsx
deleted file mode 100644
index 68e1bf3bc..000000000
--- a/cx-portal-shared-components/src/components/basic/SortOption/SortOption.stories.tsx
+++ /dev/null
@@ -1,62 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 Mercedes-Benz Group AG and BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { ComponentStory } from '@storybook/react'
-import { SortOption as Component } from '.'
-
-export default {
- title: 'SortOption',
- component: Component,
-}
-
-const Template: ComponentStory = (args: any) => (
-
- {}} />
-
-)
-
-export const SortOption = Template.bind({})
-
-SortOption.args = {
- sortOptions: [
- {
- label: 'New',
- value: 'new',
- },
- {
- label: 'Priority',
- value: 'priority',
- },
- {
- label: 'Unread',
- value: 'unread',
- },
- ],
- selectedOption: 'new',
- show: true,
-}
diff --git a/cx-portal-shared-components/src/components/basic/SortOption/index.tsx b/cx-portal-shared-components/src/components/basic/SortOption/index.tsx
deleted file mode 100644
index 5038e1dee..000000000
--- a/cx-portal-shared-components/src/components/basic/SortOption/index.tsx
+++ /dev/null
@@ -1,96 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 Mercedes-Benz Group AG and BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { useState } from 'react'
-import { Typography } from '../Typography'
-import { Box } from '@mui/material'
-
-export const SortOption = ({
- sortOptions,
- setSortOption,
- selectedOption,
- show,
- singleMenu,
-}: {
- sortOptions: any
- setSortOption?: any
- selectedOption: any
- show: boolean
- singleMenu?: boolean
-}) => {
- const handleSortSelection = (e: any, value: string) => {
- e.stopPropagation()
- setSortOption(value)
- }
-
- const [submenuHover, setSubmenuHover] = useState(false)
-
- return (
- <>
- {show && (
-
- {sortOptions.map((entry: any) => (
- handleSortSelection(e, entry.value)}
- sx={{
- padding: '17px',
- width: '152px',
- borderRadius: '10px',
- cursor: 'pointer',
- listStyleType: 'none',
- '&:hover': {
- backgroundColor: 'rgba(15, 113, 203, 0.05)',
- },
- ...(singleMenu && submenuHover
- ? { backgroundColor: 'rgb(176 206 235 / 40%)' }
- : null),
- }}
- onMouseOver={() => setSubmenuHover(true)}
- onMouseLeave={() => setSubmenuHover(false)}
- >
-
- {entry.label}
-
-
- ))}
-
- )}
- >
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/StaticTable/HorizontalTable.tsx b/cx-portal-shared-components/src/components/basic/StaticTable/HorizontalTable.tsx
deleted file mode 100644
index 68521c553..000000000
--- a/cx-portal-shared-components/src/components/basic/StaticTable/HorizontalTable.tsx
+++ /dev/null
@@ -1,61 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { Typography } from '@mui/material'
-import { TableType } from './types'
-
-export const HorizontalTable = ({ data }: { data: TableType }) => (
-
-
- {data.head.map((col, c) => (
-
-
- {col}
-
- {data.body[c].map((row, r) => (
-
- {row}
-
- ))}
-
- ))}
-
-
-)
diff --git a/cx-portal-shared-components/src/components/basic/StaticTable/StaticTable.stories.tsx b/cx-portal-shared-components/src/components/basic/StaticTable/StaticTable.stories.tsx
deleted file mode 100644
index e1637c1c5..000000000
--- a/cx-portal-shared-components/src/components/basic/StaticTable/StaticTable.stories.tsx
+++ /dev/null
@@ -1,46 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { ComponentStory } from '@storybook/react'
-
-import { StaticTable as Component } from '.'
-
-export default {
- title: 'StaticTable',
- component: Component,
-}
-
-const Template: ComponentStory = (args) => (
-
-)
-
-export const Table = Template.bind({})
-Table.args = {
- horizontal: false,
- data: {
- head: ['heading 1', 'heading 2'],
- body: [
- ['row1 col1', 'row1 col2'],
- ['row2 col1', 'row2 col2'],
- ['row3 col1', 'row3 col2'],
- ['row4 col1', 'row4 col2'],
- ],
- },
-}
diff --git a/cx-portal-shared-components/src/components/basic/StaticTable/VerticalTable.tsx b/cx-portal-shared-components/src/components/basic/StaticTable/VerticalTable.tsx
deleted file mode 100644
index d20723b5b..000000000
--- a/cx-portal-shared-components/src/components/basic/StaticTable/VerticalTable.tsx
+++ /dev/null
@@ -1,65 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { Typography } from '@mui/material'
-import { TableType } from './types'
-
-export const VerticalTable = ({ data }: { data: TableType }) => (
-
-)
diff --git a/cx-portal-shared-components/src/components/basic/StaticTable/index.tsx b/cx-portal-shared-components/src/components/basic/StaticTable/index.tsx
deleted file mode 100644
index 141f86259..000000000
--- a/cx-portal-shared-components/src/components/basic/StaticTable/index.tsx
+++ /dev/null
@@ -1,32 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { HorizontalTable } from './HorizontalTable'
-import { VerticalTable } from './VerticalTable'
-import { TableType } from './types'
-
-export const StaticTable = ({
- data,
- horizontal,
-}: {
- data: TableType
- horizontal?: boolean
-}) =>
- horizontal ? :
diff --git a/cx-portal-shared-components/src/components/basic/StaticTable/types.ts b/cx-portal-shared-components/src/components/basic/StaticTable/types.ts
deleted file mode 100644
index 8174cde0d..000000000
--- a/cx-portal-shared-components/src/components/basic/StaticTable/types.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import React from 'react'
-export type TableType = {
- head: string[]
- body: string[][] | React.FC[][]
-}
diff --git a/cx-portal-shared-components/src/components/basic/Stepper/Stepper.stories.tsx b/cx-portal-shared-components/src/components/basic/Stepper/Stepper.stories.tsx
deleted file mode 100644
index 18eed5856..000000000
--- a/cx-portal-shared-components/src/components/basic/Stepper/Stepper.stories.tsx
+++ /dev/null
@@ -1,67 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { ComponentStory } from '@storybook/react'
-
-import { Stepper as Component } from '.'
-
-export default {
- title: 'Steppers',
- component: Component,
- argTypes: {},
-}
-
-const stepperElements = [
- {
- step: 1,
- headline: 'App Market Card',
- },
- {
- step: 2,
- headline: 'Contract & Consent',
- },
- {
- step: 3,
- headline: 'Technical Integration',
- },
- {
- step: 4,
- headline: 'Beta Test',
- },
- {
- step: 5,
- headline: 'Validate & Publish',
- },
- {
- step: 6,
- headline: 'Verify your company data',
- },
-]
-
-const Template: ComponentStory = (args: any) => (
-
-)
-
-export const Stepper = Template.bind({})
-Stepper.args = {
- list: stepperElements,
- showSteps: 6,
- activeStep: 2,
-}
diff --git a/cx-portal-shared-components/src/components/basic/Stepper/StepperItem.tsx b/cx-portal-shared-components/src/components/basic/Stepper/StepperItem.tsx
deleted file mode 100644
index e76446f1e..000000000
--- a/cx-portal-shared-components/src/components/basic/Stepper/StepperItem.tsx
+++ /dev/null
@@ -1,129 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { Box } from '@mui/material'
-import { Typography } from '../Typography'
-import { theme } from '../../../theme'
-import { useEffect, useState } from 'react'
-
-interface StepperItemProps {
- step: number
- headline: string
- activeStep: number
- index: number
- totalSteps?: number
-}
-
-export const StepperItem = ({
- step,
- headline,
- activeStep,
- index,
- totalSteps = 6,
-}: StepperItemProps) => {
- const [backgroundColor, setBackgroundColor] = useState(
- theme.palette.stepper.stepUpcoming
- )
- const [done, setDone] = useState(false)
-
- useEffect(() => {
- if (index === activeStep) {
- setBackgroundColor(theme.palette.stepper.stepCurrent)
- setDone(false)
- } else if (index < activeStep) {
- setBackgroundColor(theme.palette.stepper.stepDone)
- setDone(true)
- } else {
- setBackgroundColor(theme.palette.stepper.stepUpcoming)
- setDone(false)
- }
- }, [index, activeStep])
- const width = 100 / totalSteps
- return (
-
-
-
- {done && (
-
- )}
- {!done && step}
-
-
-
-
- {headline}
-
-
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/Stepper/index.tsx b/cx-portal-shared-components/src/components/basic/Stepper/index.tsx
deleted file mode 100644
index 3f2eac648..000000000
--- a/cx-portal-shared-components/src/components/basic/Stepper/index.tsx
+++ /dev/null
@@ -1,53 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { Box } from '@mui/material'
-import { StepperItem } from './StepperItem'
-
-export interface StepperProps {
- list: any[]
- showSteps: number
- activeStep: number
-}
-
-export const Stepper = ({ list, showSteps, activeStep }: StepperProps) => {
- return (
-
- {list &&
- list
- .filter((item) => item.step <= showSteps && item.step <= list.length)
- .map((item, i) => (
-
- ))}
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/SubNavigation/ParentSubNavigation.tsx b/cx-portal-shared-components/src/components/basic/SubNavigation/ParentSubNavigation.tsx
deleted file mode 100644
index 6c1830e74..000000000
--- a/cx-portal-shared-components/src/components/basic/SubNavigation/ParentSubNavigation.tsx
+++ /dev/null
@@ -1,54 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 Mercedes-Benz Group AG and BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { Button } from '../Button'
-import EastIcon from '@mui/icons-material/East'
-
-export const ParentSubNavigation = ({
- navigationArray,
- onClick,
-}: {
- navigationArray: any
- onClick: any
-}) => {
- return (
- <>
- {navigationArray.map(
- (link: { index: number; title: string; navigation: string }) => {
- return (
-
- )
- }
- )}
- >
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/SubNavigation/SubNavigation.stories.tsx b/cx-portal-shared-components/src/components/basic/SubNavigation/SubNavigation.stories.tsx
deleted file mode 100644
index b350c688e..000000000
--- a/cx-portal-shared-components/src/components/basic/SubNavigation/SubNavigation.stories.tsx
+++ /dev/null
@@ -1,42 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { ComponentStory } from '@storybook/react'
-import { SubNavigation as Component } from '.'
-
-export default {
- title: 'Navigation',
- component: Component,
- argTypes: {},
-}
-
-const Template: ComponentStory = (args: any) => (
-
-)
-
-export const SubNavigation = Template.bind({})
-SubNavigation.args = {
- buttonLabel: 'Technical User Management',
- onButtonClick: () => console.log('on button click'),
- link1Label: 'Access Management',
- onLink1Click: () => console.log('on link1 click'),
- link2Label: 'Identity User Management',
- onLink2Click: () => console.log('on link2 click'),
-}
diff --git a/cx-portal-shared-components/src/components/basic/SubNavigation/SubNavigationButton.tsx b/cx-portal-shared-components/src/components/basic/SubNavigation/SubNavigationButton.tsx
deleted file mode 100644
index 25dd85181..000000000
--- a/cx-portal-shared-components/src/components/basic/SubNavigation/SubNavigationButton.tsx
+++ /dev/null
@@ -1,50 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { Box } from '@mui/material'
-import { SubNavigationProps } from '.'
-import { Button } from '../Button'
-
-export const SubNavigationButton = ({
- buttonLabel,
- onButtonClick,
-}: SubNavigationProps) => {
- return (
-
- {buttonLabel && onButtonClick && (
-
- )}
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/SubNavigation/SubNavigationLink.tsx b/cx-portal-shared-components/src/components/basic/SubNavigation/SubNavigationLink.tsx
deleted file mode 100644
index 67e1e798d..000000000
--- a/cx-portal-shared-components/src/components/basic/SubNavigation/SubNavigationLink.tsx
+++ /dev/null
@@ -1,78 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { Box } from '@mui/material'
-import { SubNavigationProps } from '.'
-import { Button } from '../Button'
-import EastIcon from '@mui/icons-material/East'
-
-export const SubNavigationLink = ({
- link1Label,
- onLink1Click,
- link2Label,
- onLink2Click,
-}: SubNavigationProps) => {
- return (
-
-
- {link1Label && onLink1Click && (
- <>
-
- >
- )}
-
-
-
- {link2Label && onLink2Click && (
-
- )}
-
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/SubNavigation/index.tsx b/cx-portal-shared-components/src/components/basic/SubNavigation/index.tsx
deleted file mode 100644
index 8b639d29c..000000000
--- a/cx-portal-shared-components/src/components/basic/SubNavigation/index.tsx
+++ /dev/null
@@ -1,72 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { Box } from '@mui/material'
-import { theme } from '../../../theme'
-import { SubNavigationLink } from './SubNavigationLink'
-import { SubNavigationButton } from './SubNavigationButton'
-
-export interface SubNavigationProps {
- buttonLabel?: string
- onButtonClick?: React.MouseEventHandler
- link1Label?: string
- onLink1Click?: React.MouseEventHandler
- link2Label?: string
- onLink2Click?: React.MouseEventHandler
-}
-export const SubNavigation = ({
- buttonLabel,
- onButtonClick,
- link1Label,
- onLink1Click,
- link2Label,
- onLink2Click,
-}: SubNavigationProps) => {
- return (
-
-
-
-
-
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/Table/PageLoadingTable.tsx b/cx-portal-shared-components/src/components/basic/Table/PageLoadingTable.tsx
deleted file mode 100644
index 618e2a6c6..000000000
--- a/cx-portal-shared-components/src/components/basic/Table/PageLoadingTable.tsx
+++ /dev/null
@@ -1,151 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-import { Box } from '@mui/material'
-import { useState, useEffect } from 'react'
-import { Table, TableProps } from '.'
-import { LoadMoreButton } from '../Button/LoadMoreButton'
-import { hasMorePages, getMaxRows } from './components/Helper/helper'
-
-export type PaginFetchArgs = {
- page: number
- args?: any
-}
-
-export type PaginMeta = {
- totalElements: number
- totalPages: number
- page: number
- contentSize: number
-}
-
-export type PaginResult = {
- meta: PaginMeta
- content: T[]
-}
-
-export interface PageLoadingTableProps extends Omit {
- loadLabel: string
- fetchHook: (paginArgs: PaginFetchArgs) => any
- fetchHookArgs?: any
- fetchHookRefresh?: number
- allItems?: any
- callbackToPage?: any
-}
-
-export const PageLoadingTable = function ({
- loadLabel,
- fetchHook,
- fetchHookArgs,
- fetchHookRefresh = 0,
- allItems,
- callbackToPage,
- ...props
-}: PageLoadingTableProps) {
- const [page, setPage] = useState(0)
- const [clear, setClear] = useState(true)
- const [loaded, setLoaded] = useState(0)
- const [items, setItems] = useState([])
- const { data, isFetching, isSuccess, error, refetch } = fetchHook({
- page: page,
- args: {
- ...fetchHookArgs,
- v: loaded,
- },
- })
- const [loading, setLoading] = useState(true)
-
- function nextPage() {
- setPage(page + 1)
- }
- const hasMore = hasMorePages(data)
- const maxRows = getMaxRows(data)
-
- useEffect(() => {
- if (allItems?.length > 0) {
- setLoading(false)
- setItems((i) => i.concat(allItems))
- } else if (allItems?.length === 0) {
- setLoading(false)
- setItems([])
- }
- }, [allItems])
-
- useEffect(() => {
- if (loaded !== fetchHookRefresh) {
- setLoaded(fetchHookRefresh)
- setPage(0)
- setClear(true)
- }
- }, [fetchHookRefresh, loaded])
-
- /* eslint react-hooks/exhaustive-deps: "off" */
- useEffect(() => {
- //reset loading
- if (isFetching && !loading) {
- setLoading(true)
- }
- if (isSuccess && !isFetching && data && (data.content || data.bpn)) {
- if (clear) {
- setItems([])
- setClear(false)
- } else {
- if (callbackToPage) {
- callbackToPage(data)
- } else {
- setLoading(false)
- data.content
- ? setItems((i) => i.concat(data.content))
- : setItems([data]) // Search for legal entity based on BPN responses with an object. No content or meta properties available
- }
- }
- }
- if (error) {
- setLoading(false)
- }
- }, [isSuccess, isFetching, data, clear, loaded])
-
- return (
- <>
-
- {items.length > 0 && hasMore && (
-
-
-
- )}
- >
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/Table/components/Error/Error400Overlay.tsx b/cx-portal-shared-components/src/components/basic/Table/components/Error/Error400Overlay.tsx
deleted file mode 100644
index 76a96c219..000000000
--- a/cx-portal-shared-components/src/components/basic/Table/components/Error/Error400Overlay.tsx
+++ /dev/null
@@ -1,61 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 Mercedes-Benz Group AG and BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import ReportProblemIcon from '@mui/icons-material/ReportProblem'
-import { Box } from '@mui/material'
-import { Typography } from '../../../Typography'
-
-const flexRow = {
- display: 'flex',
- justifyContent: 'flex-start',
- alignItems: 'center',
- paddingBottom: '20px',
-}
-
-const flexColumn = {
- display: 'flex',
- justifyContent: 'center',
- flexDirection: 'column',
- alignItems: 'center',
-}
-
-export const Error400Overlay = () => (
-
-
-
-
- Something went wrong. Please contact
-
- your administrator
-
-
-)
diff --git a/cx-portal-shared-components/src/components/basic/Table/components/Error/Error500Overlay.tsx b/cx-portal-shared-components/src/components/basic/Table/components/Error/Error500Overlay.tsx
deleted file mode 100644
index 6a15e353f..000000000
--- a/cx-portal-shared-components/src/components/basic/Table/components/Error/Error500Overlay.tsx
+++ /dev/null
@@ -1,57 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 Mercedes-Benz Group AG and BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { Box } from '@mui/material'
-import { Typography } from '../../../Typography'
-import RefreshIcon from '@mui/icons-material/Refresh'
-
-const flexColumn = {
- display: 'flex',
- justifyContent: 'center',
- flexDirection: 'column',
- alignItems: 'center',
-}
-
-export const Error500Overlay = ({ reload }: { reload: () => void }) => (
-
-
- Load Failed. Reload
-
-
-
-
-
-)
diff --git a/cx-portal-shared-components/src/components/basic/Table/components/Helper/helper.ts b/cx-portal-shared-components/src/components/basic/Table/components/Helper/helper.ts
deleted file mode 100644
index 35139cb01..000000000
--- a/cx-portal-shared-components/src/components/basic/Table/components/Helper/helper.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 Mercedes-Benz Group AG and BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-export const hasMorePages = (data: any) => {
- return (
- data?.page < data?.totalPages - 1 ||
- (data?.meta && data.meta.page < data.meta.totalPages - 1)
- )
-}
-
-export const getMaxRows = (data: any) => {
- return data?.totalElements ?? data?.meta?.totalElements ?? 0
-}
diff --git a/cx-portal-shared-components/src/components/basic/Table/components/RoleChip.scss b/cx-portal-shared-components/src/components/basic/Table/components/RoleChip.scss
deleted file mode 100644
index accb30d03..000000000
--- a/cx-portal-shared-components/src/components/basic/Table/components/RoleChip.scss
+++ /dev/null
@@ -1,29 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-.role-chip-wrapper {
- background-color: #f2f3fb;
- padding: 8px 12px;
- border-radius: 8px;
- width: 60%;
- text-align: center;
- color: #676bc6;
- font-family: LibreFranklin-Medium, sans-serif;
-}
diff --git a/cx-portal-shared-components/src/components/basic/Table/components/RoleChip.tsx b/cx-portal-shared-components/src/components/basic/Table/components/RoleChip.tsx
deleted file mode 100644
index 0a75bd4e2..000000000
--- a/cx-portal-shared-components/src/components/basic/Table/components/RoleChip.tsx
+++ /dev/null
@@ -1,26 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import './RoleChip.scss'
-// Temporary component to visualise different table cell
-const RoleChip = ({ role }: any) => {
- return
{role}
-}
-export default RoleChip
diff --git a/cx-portal-shared-components/src/components/basic/Table/components/StatusTag/index.tsx b/cx-portal-shared-components/src/components/basic/Table/components/StatusTag/index.tsx
deleted file mode 100644
index e452633f7..000000000
--- a/cx-portal-shared-components/src/components/basic/Table/components/StatusTag/index.tsx
+++ /dev/null
@@ -1,34 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import MuiChip, { ChipProps as MuiStatusChipProps } from '@mui/material/Chip'
-
-interface StatusChipProps extends Omit {
- color?: 'pending' | 'confirmed' | 'declined' | 'label'
-}
-
-export const StatusTag = ({
- variant = 'filled',
- color = 'pending',
- onDelete = () => null, // To avoid default delete icon appear
- ...props
-}: StatusChipProps) => {
- return
-}
diff --git a/cx-portal-shared-components/src/components/basic/Table/components/StatusTag/statusTag.stories.tsx b/cx-portal-shared-components/src/components/basic/Table/components/StatusTag/statusTag.stories.tsx
deleted file mode 100644
index 6ac7549b6..000000000
--- a/cx-portal-shared-components/src/components/basic/Table/components/StatusTag/statusTag.stories.tsx
+++ /dev/null
@@ -1,39 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { ComponentStory } from '@storybook/react'
-import { StatusTag as Component } from '.'
-
-export default {
- title: 'StatusTag',
- component: Component,
- argTypes: {},
-}
-
-const Template: ComponentStory = (args: any) => (
-
-)
-
-export const StatusTag = Template.bind({})
-StatusTag.args = {
- color: 'label',
- variant: 'filled',
- label: 'label',
-}
diff --git a/cx-portal-shared-components/src/components/basic/Table/components/Toolbar/SearchAndFilterButtonToolbar.tsx b/cx-portal-shared-components/src/components/basic/Table/components/Toolbar/SearchAndFilterButtonToolbar.tsx
deleted file mode 100644
index c6337762f..000000000
--- a/cx-portal-shared-components/src/components/basic/Table/components/Toolbar/SearchAndFilterButtonToolbar.tsx
+++ /dev/null
@@ -1,149 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-import ClearIcon from '@mui/icons-material/Clear'
-import React, { useState, useMemo, useCallback } from 'react'
-import { Box, useTheme, debounce } from '@mui/material'
-import { SearchInput } from '../../../SearchInput'
-import { IconButton } from '../../../IconButton'
-import { ToolbarProps } from '.'
-import { ViewSelector } from '../../../ViewSelector'
-import { Typography } from '../../../Typography'
-
-export interface SearchAndFilterButtonToolbarProps extends ToolbarProps {
- placeholder?: string
- searchDebounce?: number
- searchExpr?: string
- filterViews?: any
- defaultFilter?: string
- onFilter?: any
- descriptionText?: string
-}
-
-export const SearchAndFilterButtonToolbar = ({
- onSearch,
- onFilter,
- searchPlaceholder,
- searchExpr,
- searchInputData,
- onClearSearch,
- searchDebounce = 500,
- filterViews,
- defaultFilter = '',
- descriptionText,
-}: SearchAndFilterButtonToolbarProps) => {
- const [searchInputText, setSearchInputText] = useState(
- searchExpr ?? (searchInputData ? searchInputData.text : '')
- )
-
- const { spacing } = useTheme()
-
- const searchDeBounced = useMemo(
- () =>
- debounce((expr: string) => {
- onSearch && onSearch(expr)
- }, searchDebounce),
- [onSearch, searchDebounce]
- )
-
- const onSearchDo = useCallback(
- (expr: string) => {
- searchDeBounced(expr)
- },
- [searchDeBounced]
- )
-
- const onSearchChange = (e: React.ChangeEvent) => {
- setSearchInputText(e.target.value)
- const inputLen = e.target.value.length
- if (inputLen === 0 || inputLen > 2) {
- onSearch && onSearchDo(e.target.value)
- }
- }
-
- const onSearchInputKeyPress = (e: React.KeyboardEvent) => {
- if (e.key === 'Enter' && onSearch) {
- onSearch(searchInputText)
- }
- }
-
- const handleSearchClear = () => {
- onClearSearch && onClearSearch()
- setSearchInputText('')
- }
-
- const headerHeight = () => (onSearch || onFilter ? 100 : 0)
-
- const endAdornment =
- onClearSearch && searchInputText ? (
-
-
-
- ) : (
- <>>
- )
-
- const styles = {
- minHeight: { headerHeight },
- padding: spacing(2, 0, 6, 0),
- display: 'flex',
- alignItems: 'center',
- justifyContent: 'space-between',
- flexDirection: 'column',
- marginTop: '40px',
- }
-
- return (
-
-
-
-
-
-
-
-
-
- {descriptionText}
-
-
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/Table/components/Toolbar/UltimateToolbar.tsx b/cx-portal-shared-components/src/components/basic/Table/components/Toolbar/UltimateToolbar.tsx
deleted file mode 100644
index 5ff484c3b..000000000
--- a/cx-portal-shared-components/src/components/basic/Table/components/Toolbar/UltimateToolbar.tsx
+++ /dev/null
@@ -1,167 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-import ClearIcon from '@mui/icons-material/Clear'
-import React, { useState, useMemo, useCallback } from 'react'
-import { Box, useTheme, debounce } from '@mui/material'
-import { Button } from '../../../Button'
-import { SearchInput } from '../../../SearchInput'
-import { IconButton } from '../../../IconButton'
-import { ToolbarProps } from '.'
-
-export type SelectedFilter = {
- [name: string]: string[]
-}
-export interface UltimateToolbarProps extends ToolbarProps {
- placeholder?: string
- onFilter?: (selectedFilter: SelectedFilter) => void
- selectedFilter?: SelectedFilter
- searchDebounce?: number
- searchExpr?: string
-}
-
-export const UltimateToolbar = ({
- onSearch,
- filter,
- onFilter,
- searchPlaceholder,
- selectedFilter,
- searchExpr,
- searchInputData,
- onClearSearch,
- searchDebounce = 500,
-}: UltimateToolbarProps) => {
- const { spacing } = useTheme()
- const [searchInput, setSearchInput] = useState(
- searchExpr ?? (searchInputData ? searchInputData.text : '')
- )
-
- const debounceSearch = useMemo(
- () =>
- debounce((expr: string) => {
- onSearch && onSearch(expr)
- }, searchDebounce),
- [onSearch, searchDebounce]
- )
-
- const doOnSearch = useCallback(
- (expr: string) => {
- debounceSearch(expr)
- },
- [debounceSearch]
- )
-
- const onSearchChange = (e: React.ChangeEvent) => {
- setSearchInput(e.target.value)
- const inputLen = e.target.value.length
- if (inputLen === 0 || inputLen > 2) {
- onSearch && doOnSearch(e.target.value)
- }
- }
-
- const onSearchInputKeyPress = (e: React.KeyboardEvent) => {
- if (e.key === 'Enter' && onSearch) {
- onSearch(searchInput)
- }
- }
-
- const onFilterChange = (value: string, name: string) => {
- if (onFilter) {
- onFilter({ [name]: [value] })
- }
- }
-
- const handleSearchClear = () => {
- onClearSearch && onClearSearch()
- setSearchInput('')
- }
-
- const headerHeight = () => (onSearch || onFilter ? 100 : 0)
-
- const endAdornment =
- onClearSearch && searchInput ? (
-
-
-
- ) : (
- <>>
- )
-
- return (
-
- {onSearch && (
-
-
-
- )}
-
- {onFilter &&
- filter?.map(({ name, values }) => (
-
- {values?.map(({ value, label }) => (
-
-
-
- ))}
-
- ))}
-
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/Table/components/Toolbar/helper.test.ts b/cx-portal-shared-components/src/components/basic/Table/components/Toolbar/helper.test.ts
deleted file mode 100644
index 67d4d1660..000000000
--- a/cx-portal-shared-components/src/components/basic/Table/components/Toolbar/helper.test.ts
+++ /dev/null
@@ -1,67 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { describe, expect, it } from '@jest/globals'
-import { SelectedFilter, ToolbarProps } from '.'
-import { initSelectedFilter, getSelectedFilterUpdate } from './helper'
-
-const filter: ToolbarProps['filter'] = [
- {
- name: 'role',
- values: [
- { value: 'admin', label: 'Admin' },
- { value: 'editor', label: 'Editor' },
- ],
- },
- {
- name: 'status',
- values: [{ value: 'confirmed' }],
- },
-]
-
-const selected: SelectedFilter = {
- role: ['admin', 'editor'],
- status: ['confirmed'],
-}
-
-describe('TableToolbarTest', () => {
- it('converts Filter input into initial SelectedFilter object', () => {
- expect(initSelectedFilter(filter)).toEqual({
- role: ['admin', 'editor'],
- status: ['confirmed'],
- })
-
- expect(initSelectedFilter(undefined)).toEqual({})
- })
-
- it('removes values from SelectedFilter object', () => {
- expect(getSelectedFilterUpdate(selected, 'role', 'admin', false)).toEqual({
- role: ['editor'],
- status: ['confirmed'],
- })
- })
-
- it('adds values to SelectedFilter object', () => {
- expect(getSelectedFilterUpdate(selected, 'role', 'manager', true)).toEqual({
- role: ['admin', 'editor', 'manager'],
- status: ['confirmed'],
- })
- })
-})
diff --git a/cx-portal-shared-components/src/components/basic/Table/components/Toolbar/index.tsx b/cx-portal-shared-components/src/components/basic/Table/components/Toolbar/index.tsx
deleted file mode 100644
index bfea79bca..000000000
--- a/cx-portal-shared-components/src/components/basic/Table/components/Toolbar/index.tsx
+++ /dev/null
@@ -1,275 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import React, { useCallback, useEffect, useMemo, useState } from 'react'
-import { Box, debounce, useTheme } from '@mui/material'
-import { Button } from '../../../Button'
-import { IconButton } from '../../../IconButton'
-import { SearchInput } from '../../../SearchInput'
-import { Typography } from '../../../Typography'
-import SearchIcon from '@mui/icons-material/Search'
-import FilterIcon from '@mui/icons-material/FilterAltOutlined'
-import ClearIcon from '@mui/icons-material/Clear'
-import { Checkbox } from '../../../Checkbox'
-import { getSelectedFilterUpdate } from './helper'
-import AddCircleOutlineIcon from '@mui/icons-material/AddCircleOutline'
-
-interface FilterValue {
- value: string
- label?: string
-}
-
-interface Filter {
- name: string
- values: FilterValue[]
-}
-
-export type SelectedFilter = {
- [name: string]: string[]
-}
-
-interface SearchInputState {
- open: boolean
- text: string
-}
-
-export interface ToolbarProps {
- title?: string
- rowsCount?: number
- rowsCountMax?: number
- buttonLabel?: string
- onButtonClick?: React.MouseEventHandler
- onSearch?: (value: string) => void
- searchExpr?: string
- searchPlaceholder?: string
- searchDebounce?: number
- searchInputData?: SearchInputState
- filter?: Filter[]
- onFilter?: (selectedFilter: SelectedFilter) => void
- openFilterSection?: boolean
- onOpenFilterSection?: (value: boolean) => void
- selectedFilter?: SelectedFilter
- onClearSearch?: () => void
-}
-
-const getIconColor = (openFilter: boolean) => {
- return openFilter ? 'primary' : 'text.tertiary'
-}
-
-export const Toolbar = ({
- title,
- rowsCount = 0,
- rowsCountMax = 0,
- buttonLabel,
- onButtonClick,
- onSearch,
- searchExpr,
- searchPlaceholder,
- searchDebounce = 500,
- searchInputData,
- filter,
- onFilter,
- openFilterSection,
- onOpenFilterSection,
- selectedFilter,
- onClearSearch,
-}: ToolbarProps) => {
- const { spacing } = useTheme()
- const isSearchText = searchExpr && searchExpr !== ''
- const isSearchData = searchInputData ? searchInputData.open : false
- const [openSearch, setOpenSearch] = useState(
- isSearchText ? isSearchText : isSearchData
- )
- const [openFilter, setOpenFilter] = useState(false)
- const [searchInput, setSearchInput] = useState(
- searchExpr ?? (searchInputData ? searchInputData.text : '')
- )
- const showMaxRows = rowsCountMax > 0 && rowsCount < rowsCountMax
-
- const debouncedSearch = useMemo(
- () =>
- debounce((expr: string) => {
- onSearch && onSearch(expr)
- }, searchDebounce),
- [onSearch, searchDebounce]
- )
-
- const doSearch = useCallback(
- (expr: string) => {
- debouncedSearch(expr)
- },
- [debouncedSearch]
- )
-
- const onSearchInputChange = (e: React.ChangeEvent) => {
- setSearchInput(e.target.value)
- const inputLen = e.target.value.length
- if (inputLen === 0 || inputLen > 2) {
- onSearch && doSearch(e.target.value)
- }
- }
-
- const onSearchInputKeyPress = (_e: React.KeyboardEvent) => {
- //console.log(e.key)
- }
-
- const handleSearchClear = () => {
- onClearSearch && onClearSearch()
- }
-
- const onFilterChange = ({ target }: React.ChangeEvent) => {
- const { name, value, checked } = target
- onFilter &&
- onFilter(
- getSelectedFilterUpdate(
- selectedFilter as SelectedFilter,
- name,
- value,
- checked
- )
- )
- }
-
- useEffect(() => {
- openFilterSection && setOpenFilter(openFilterSection)
- }, [openFilterSection])
-
- const getEndAdornment = () => {
- if (onClearSearch && searchInput) {
- return (
-
-
-
- )
- }
- }
-
- return (
-
-
-
-
- {title}
-
- ({rowsCount || 0}
- {showMaxRows && `/${rowsCountMax}`})
-
-
- {buttonLabel && onButtonClick && (
- }
- size="small"
- onClick={onButtonClick}
- sx={{ marginLeft: 15 }}
- >
- {buttonLabel}
-
- )}
-
-
- {openSearch ? (
- {}}
- placeholder={searchPlaceholder}
- sx={{
- '.MuiInputBase-input': {
- padding: '10px',
- width: '250px',
- },
- }}
- />
- ) : (
- onSearch && (
- setOpenSearch(true)}
- >
-
-
- )
- )}
- {onFilter && (
-
- onOpenFilterSection && onOpenFilterSection(!openFilter)
- }
- >
-
-
- )}
-
-
- {openFilter &&
- filter?.map(({ name, values }) => (
-
- {values?.map(({ value, label }) => (
-
-
-
- ))}
-
- ))}
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/Table/index.tsx b/cx-portal-shared-components/src/components/basic/Table/index.tsx
deleted file mode 100644
index f7da80f93..000000000
--- a/cx-portal-shared-components/src/components/basic/Table/index.tsx
+++ /dev/null
@@ -1,206 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { useCallback } from 'react'
-import { DataGrid, DataGridProps, GridRowId } from '@mui/x-data-grid'
-import { Box, Stack } from '@mui/material'
-import { StatusTag } from './components/StatusTag'
-import { Toolbar, ToolbarProps } from './components/Toolbar'
-import { UltimateToolbar } from './components/Toolbar/UltimateToolbar'
-import { theme } from '../../../theme'
-import { SearchAndFilterButtonToolbar } from './components/Toolbar/SearchAndFilterButtonToolbar'
-import { Typography } from '../Typography'
-import { Error500Overlay } from './components/Error/Error500Overlay'
-import { Error400Overlay } from './components/Error/Error400Overlay'
-
-export { StatusTag }
-export type toolbarType = 'basic' | 'premium' | 'ultimate' | 'searchAndFilter'
-export type SearchInputState = {
- open: boolean
- text: string
-}
-
-export interface TableProps extends DataGridProps {
- title: string
- rowsCount?: number
- rowsCountMax?: number
- toolbarVariant?: toolbarType
- toolbar?: ToolbarProps
- columnHeadersBackgroundColor?: string
- onSearch?: (value: string) => void
- searchExpr?: string
- searchPlaceholder?: string
- searchDebounce?: number
- searchInputData?: SearchInputState
- noRowsMsg?: string
- hasBorder?: boolean
- buttonLabel?: string
- onButtonClick?: React.MouseEventHandler
- onSelection?: (value: GridRowId[]) => void
- descriptionText?: string
- defaultFilter?: string
- filterViews?: any
- alignCell?: string
- error?: {
- status: number
- }
- reload?: () => void
-}
-
-export const Table = ({
- columns,
- rows,
- autoHeight = true,
- headerHeight = 57, // Default header height from base design
- rowHeight = 57, // Default row height from base design
- rowsCount = 0,
- rowsCountMax = 0,
- title,
- toolbarVariant = 'basic',
- toolbar,
- checkboxSelection,
- columnHeadersBackgroundColor = '#E9E9E9',
- onSearch,
- searchExpr,
- searchPlaceholder,
- searchDebounce,
- searchInputData,
- noRowsMsg,
- hasBorder = true,
- buttonLabel,
- onButtonClick,
- onSelection,
- descriptionText,
- defaultFilter,
- filterViews,
- alignCell = 'center',
- error,
- reload,
- ...props
-}: TableProps) => {
- const toolbarProps = {
- rowsCount,
- rowsCountMax,
- onSearch,
- searchDebounce,
- searchInputData,
- searchPlaceholder,
- noRowsMsg,
- buttonLabel,
- onButtonClick,
- onSelection,
- searchExpr,
- descriptionText,
- defaultFilter,
- filterViews,
- }
-
- const handleOnCellClick = useCallback(
- (selectedIds) => {
- const idsArr: Array = []
- rows.map((row) => {
- return selectedIds.map(
- (selectedId: string) =>
- selectedId.indexOf(row.companyUserId) > -1 &&
- idsArr.push(row.companyUserId)
- )
- })
- onSelection && onSelection(idsArr)
- },
- [rows, onSelection]
- )
-
- const toolbarView = () => {
- switch (toolbarVariant) {
- case 'basic':
- return
- case 'premium':
- return
- case 'ultimate':
- return
- case 'searchAndFilter':
- return
- }
- }
-
- const NoRowsOverlay = () => {
- return (
-
- {error && error.status === 500 && (
- reload && reload()} />
- )}
- {error &&
- (error.status === 400 ||
- error.status === 404 ||
- error.status === 401) && }
- {!error && (
- {noRowsMsg ?? 'No rows'}
- )}
-
- )
- }
-
- return (
-
- row.id}
- components={{
- Toolbar: () => toolbarView(),
- NoRowsOverlay,
- }}
- onSelectionModelChange={handleOnCellClick}
- {...{
- rows,
- columns,
- autoHeight,
- headerHeight,
- rowHeight,
- checkboxSelection,
- }}
- {...props}
- />
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/Table/table.stories.tsx b/cx-portal-shared-components/src/components/basic/Table/table.stories.tsx
deleted file mode 100644
index c75fd5b6d..000000000
--- a/cx-portal-shared-components/src/components/basic/Table/table.stories.tsx
+++ /dev/null
@@ -1,120 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { ComponentStory } from '@storybook/react'
-
-import { Table as Component } from '.'
-import {
- GridColDef,
- GridRowsProp,
- GridRenderCellParams,
-} from '@mui/x-data-grid'
-import Link from '@mui/material/Link'
-import TestRows from '../../../assets/data/TableRows.json'
-
-const rows: GridRowsProp = TestRows
-
-const columns: GridColDef[] = [
- { field: 'id', hide: true },
- {
- field: 'name',
- headerName: 'Name',
- description: 'Name of the user',
- flex: 2,
- },
- { field: 'company', headerName: 'Company', flex: 2 },
- {
- field: 'email',
- headerName: 'Email address',
- renderCell: (params: GridRenderCellParams) => (
-
- {params.value}
-
- ),
- flex: 4,
- },
- { field: 'note', headerName: 'Note', flex: 5 },
- {
- field: 'role',
- headerName: 'Role',
- flex: 1,
- renderCell: (params: GridRenderCellParams) => <>{params.value}>,
- },
-]
-
-export default {
- title: 'Table',
- component: Component,
- argTypes: {},
-}
-
-const Template: ComponentStory = (args: any) => (
-
-)
-
-const basicArgs = {
- autoHeight: true,
- headerHeight: 76,
- rowHeight: 76,
- hideFooter: true,
- disableColumnFilter: true,
- disableColumnMenu: true,
- disableColumnSelector: true,
- disableDensitySelector: true,
- disableSelectionOnClick: true,
- checkboxSelection: true,
- loading: false,
- columnHeadersBackgroundColor: '#fff',
- searchPlaceholder: 'Search by username',
- noRowsMsg: 'No rows',
- rows,
- columns,
- hasBorder: true,
-}
-
-export const Table = Template.bind({})
-Table.args = {
- ...basicArgs,
- title: 'Basic table',
- toolbarVariant: 'basic',
-}
-
-export const TableToolbar = Template.bind({})
-TableToolbar.args = {
- ...basicArgs,
- title: 'Table with toolbar',
- toolbarVariant: 'premium',
- toolbar: {
- buttonLabel: 'Add user',
- onButtonClick: () => console.log('on button click'),
- onSearch: (value) => console.log(`search: "${value}"`),
- onFilter: (selectedFilter) => console.log('filter:', selectedFilter),
- filter: [
- {
- name: 'role',
- values: [
- { value: 'admin', label: 'Admin' },
- { value: 'editor', label: 'Editor' },
- { value: 'manager', label: 'Manager' },
- ],
- },
- ],
- },
-}
diff --git a/cx-portal-shared-components/src/components/basic/Tabs/Tab.tsx b/cx-portal-shared-components/src/components/basic/Tabs/Tab.tsx
deleted file mode 100644
index 9cc567f2c..000000000
--- a/cx-portal-shared-components/src/components/basic/Tabs/Tab.tsx
+++ /dev/null
@@ -1,25 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import MuiTab, { TabProps as MuiTabProps } from '@mui/material/Tab'
-
-export const Tab = ({ ...props }: MuiTabProps) => {
- return
-}
diff --git a/cx-portal-shared-components/src/components/basic/Tabs/TabPanel.stories.tsx b/cx-portal-shared-components/src/components/basic/Tabs/TabPanel.stories.tsx
deleted file mode 100644
index bb1d3f3aa..000000000
--- a/cx-portal-shared-components/src/components/basic/Tabs/TabPanel.stories.tsx
+++ /dev/null
@@ -1,45 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { ComponentStory } from '@storybook/react'
-import { TabPanel as Component } from './TabPanel'
-
-export default {
- title: 'Tabs',
- component: Component,
- parameters: {
- docs: {
- description: {
- component:
- 'TabPanel uses the __value__ parameter for visibility. Value is passed via value-prop in the final implementation (value={value}).',
- },
- },
- },
-}
-
-const Template: ComponentStory = (args: any) => (
- TabPanel Content
-)
-
-export const TabPanel = Template.bind({})
-TabPanel.args = {
- value: 0,
- index: 0,
-}
diff --git a/cx-portal-shared-components/src/components/basic/Tabs/TabPanel.tsx b/cx-portal-shared-components/src/components/basic/Tabs/TabPanel.tsx
deleted file mode 100644
index 9b2f0782e..000000000
--- a/cx-portal-shared-components/src/components/basic/Tabs/TabPanel.tsx
+++ /dev/null
@@ -1,44 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import React from 'react'
-import { Box } from '@mui/material'
-
-interface TabPanelProps {
- children?: React.ReactNode
- index: number
- value: number
-}
-
-export const TabPanel = (props: TabPanelProps) => {
- const { children, value, index, ...other } = props
-
- return (
-
- {value === index && {children}}
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/Tabs/Tabs.stories.tsx b/cx-portal-shared-components/src/components/basic/Tabs/Tabs.stories.tsx
deleted file mode 100644
index aac0e201a..000000000
--- a/cx-portal-shared-components/src/components/basic/Tabs/Tabs.stories.tsx
+++ /dev/null
@@ -1,83 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { ComponentStory } from '@storybook/react'
-
-import GroupOutlinedIcon from '@mui/icons-material/GroupOutlined'
-import PersonOutlinedIcon from '@mui/icons-material/PersonOutlined'
-import React from 'react'
-import { Box } from '@mui/material'
-import { ReactComponent } from '*.svg'
-import { Tab } from './Tab'
-import { TabPanel } from './TabPanel'
-import { Tabs } from './Tabs'
-
-export default {
- title: 'Tabs',
- parameters: {
- docs: {
- description: {
- component:
- 'Tabs are used the same way as described in the [MUI Tabs](https://mui.com/components/tabs/) documentation with [MUI Tabs](https://mui.com/api/tabs/), [MUI Tab](https://mui.com/api/tab/) and TabPanel components. Implementation for handleChange-method needs to be done yourself (see code).',
- },
- },
- },
-}
-
-const Template: ComponentStory = () => {
- const [activeTab, setActiveTab] = React.useState(0)
-
- const handleChange = (event: any, newValue: number) => {
- setActiveTab(newValue)
- }
-
- return (
-
-
-
- }
- iconPosition="start"
- />
- }
- iconPosition="start"
- />
-
-
-
- Content Single User
-
-
- Content Multiple User
-
-
- )
-}
-
-export const Base = Template.bind({})
diff --git a/cx-portal-shared-components/src/components/basic/Tabs/Tabs.tsx b/cx-portal-shared-components/src/components/basic/Tabs/Tabs.tsx
deleted file mode 100644
index f6fd268c5..000000000
--- a/cx-portal-shared-components/src/components/basic/Tabs/Tabs.tsx
+++ /dev/null
@@ -1,30 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import MuiTabs, { TabsProps as MuiTabsProps } from '@mui/material/Tabs'
-import React from 'react'
-
-interface TabsProps extends MuiTabsProps {
- children?: React.ReactElement[]
-}
-
-export const Tabs = ({ children, ...props }: TabsProps) => {
- return {children}
-}
diff --git a/cx-portal-shared-components/src/components/basic/Textarea/Input.stories.tsx b/cx-portal-shared-components/src/components/basic/Textarea/Input.stories.tsx
deleted file mode 100644
index 9772eb710..000000000
--- a/cx-portal-shared-components/src/components/basic/Textarea/Input.stories.tsx
+++ /dev/null
@@ -1,46 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { ComponentStory } from '@storybook/react'
-
-import { Textarea as Component } from '.'
-
-export default {
- title: 'Form',
- component: Component,
- argTypes: {
- onClick: {
- action: 'onClick',
- },
- },
-}
-
-const Template: ComponentStory = (args: any) => (
-
-)
-
-export const Input = Template.bind({})
-Input.args = {
- label: 'Label',
- placeholder: 'Placeholder',
- helperText: 'Helper',
- disabled: false,
- error: false,
-}
diff --git a/cx-portal-shared-components/src/components/basic/Textarea/index.tsx b/cx-portal-shared-components/src/components/basic/Textarea/index.tsx
deleted file mode 100644
index 1a9c60f67..000000000
--- a/cx-portal-shared-components/src/components/basic/Textarea/index.tsx
+++ /dev/null
@@ -1,62 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import {
- TextareaAutosize,
- TextareaAutosizeProps,
- FormHelperText,
- InputLabel,
- Box,
- FormControl,
-} from '@mui/material'
-
-interface TextareaProps extends TextareaAutosizeProps {
- label?: string
- helperText?: string
- error?: boolean
-}
-
-export const Textarea = ({
- label,
- placeholder,
- helperText,
- error = false,
- ...props
-}: TextareaProps) => {
- return (
-
-
- {label}
-
- {error && helperText && (
-
- {helperText}
-
- )}
-
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/ToolTips/ToolTips.stories.tsx b/cx-portal-shared-components/src/components/basic/ToolTips/ToolTips.stories.tsx
deleted file mode 100644
index e7f937fe5..000000000
--- a/cx-portal-shared-components/src/components/basic/ToolTips/ToolTips.stories.tsx
+++ /dev/null
@@ -1,51 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 Mercedes-Benz Group AG and BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { Box } from '@mui/material'
-import { ComponentStory } from '@storybook/react'
-import { Tooltips as Component } from '.'
-import { Button } from '../Button'
-
-export default {
- title: 'Tooltips',
- component: Component,
-}
-
-const Template: ComponentStory = (args: any) => (
-
-
-
-)
-
-export const Tooltips = Template.bind({})
-Tooltips.args = {
- tooltipPlacement: 'bottom-start',
- tooltipText: 'Action is pending',
- color: 'dark',
- children: (
-
-
-
- ),
-}
diff --git a/cx-portal-shared-components/src/components/basic/ToolTips/index.tsx b/cx-portal-shared-components/src/components/basic/ToolTips/index.tsx
deleted file mode 100644
index fe35fe727..000000000
--- a/cx-portal-shared-components/src/components/basic/ToolTips/index.tsx
+++ /dev/null
@@ -1,82 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 Mercedes-Benz Group AG and BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import Tooltip from '@mui/material/Tooltip'
-
-interface TooltipsProps {
- children: any
- tooltipText: string
- color?: 'light' | 'dark'
- tooltipPlacement?:
- | 'top'
- | 'right'
- | 'bottom'
- | 'left'
- | 'bottom-end'
- | 'bottom-start'
- | 'left-end'
- | 'left-start'
- | 'right-end'
- | 'right-start'
- | 'top-end'
- | 'top-start'
- tooltipArrow?: boolean
- additionalStyles?: any
-}
-
-export const Tooltips = ({
- children, // Element to hover
- tooltipPlacement = 'bottom', // TooltipPosition & ArrowPostion ex -
- tooltipArrow = true, // Show/Hide arrow
- tooltipText, // Tooltip text
- color = 'dark',
- additionalStyles, //additionalStyles to the tooltip container. ex - height, width, align
-}: TooltipsProps) => {
- const backgroundColor =
- color === 'dark' ? 'background.background14' : 'grey.100'
-
- return (
-
- {children}
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/Typography/Typography.stories.tsx b/cx-portal-shared-components/src/components/basic/Typography/Typography.stories.tsx
deleted file mode 100644
index 863f411d0..000000000
--- a/cx-portal-shared-components/src/components/basic/Typography/Typography.stories.tsx
+++ /dev/null
@@ -1,81 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { Typography } from '.'
-
-export default {
- title: 'Typography',
- argTypes: {},
-}
-
-export const Base = () => (
- <>
- Headline 1
- Headline 2
- Headline 3
- Headline 4
- Headline 5
-
- Body 1 Lorem ipsum dolor sit, amet consectetur adipisicing elit. Veritatis
- maiores quod saepe quos officiis. Fugiat mollitia sunt, praesentium
- possimus iusto soluta error placeat veniam nisi cum itaque voluptas sequi
- reprehenderit?
-
-
- Body 2 Lorem ipsum dolor sit, amet consectetur adipisicing elit. Veritatis
- maiores quod saepe quos officiis. Fugiat mollitia sunt, praesentium
- possimus iusto soluta error placeat veniam nisi cum itaque voluptas sequi
- reprehenderit?
-
-
- Body 3 Lorem ipsum dolor sit amet, consectetur adipisicing elit. Illum ut
- laborum non labore iure harum minus velit, necessitatibus sunt vero,
- dolore aut maiores repudiandae! Quibusdam, nihil? Ab molestiae sint
- labore!
-
-
- Label 1
-
-
- Label 2
-
-
- Label 3
-
-
- Label 4
-
-
- Label 5
-
-
- Caption 1
-
-
- Caption 2
-
-
- Caption 3
-
-
- Helper
-
- >
-)
diff --git a/cx-portal-shared-components/src/components/basic/Typography/index.tsx b/cx-portal-shared-components/src/components/basic/Typography/index.tsx
deleted file mode 100644
index 71f3518ff..000000000
--- a/cx-portal-shared-components/src/components/basic/Typography/index.tsx
+++ /dev/null
@@ -1,29 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import MuiTypography, { TypographyProps } from '@mui/material/Typography'
-
-const variantMapping = {
- body3: 'p',
-}
-
-export const Typography = (props: TypographyProps) => (
-
-)
diff --git a/cx-portal-shared-components/src/components/basic/UserAvatar/UserAvatar.stories.tsx b/cx-portal-shared-components/src/components/basic/UserAvatar/UserAvatar.stories.tsx
deleted file mode 100644
index 480fad017..000000000
--- a/cx-portal-shared-components/src/components/basic/UserAvatar/UserAvatar.stories.tsx
+++ /dev/null
@@ -1,39 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { ComponentStory } from '@storybook/react'
-
-import { UserAvatar as Component } from '.'
-
-export default {
- title: 'UserMenu',
- component: Component,
- argTypes: {},
-}
-
-const Template: ComponentStory = (args: any) => (
-
-)
-
-export const userAvatar = Template.bind({})
-userAvatar.args = {
- notificationCount: 0,
- isNotificationAlert: false,
-}
diff --git a/cx-portal-shared-components/src/components/basic/UserAvatar/index.tsx b/cx-portal-shared-components/src/components/basic/UserAvatar/index.tsx
deleted file mode 100644
index 76406bcb5..000000000
--- a/cx-portal-shared-components/src/components/basic/UserAvatar/index.tsx
+++ /dev/null
@@ -1,88 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { Badge, Avatar, AvatarProps, useTheme } from '@mui/material'
-import PersonOutlineIcon from '@mui/icons-material/PersonOutline'
-
-interface AllAvatarProps extends Omit {
- altText?: string
- userImage?: string
- notificationCount?: number
- isNotificationAlert?: boolean
- size?: 'small' | 'large'
-}
-
-export const UserAvatar = ({
- userImage = '',
- altText = 'User avatar',
- notificationCount = 0,
- isNotificationAlert = false,
- size = 'small',
- ...props
-}: AllAvatarProps) => {
- const theme = useTheme()
- const userAvatarSize = size === 'large' ? '80px' : '40px'
-
- const notificationColor = isNotificationAlert
- ? theme.palette.danger.dangerBadge
- : theme.palette.brand.brand02
- const userAvatarImage = userImage ? (
-
- ) : (
-
-
-
- )
-
- return (
-
- {userAvatarImage}
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/VerticalTabs/VerticalTabs.stories.tsx b/cx-portal-shared-components/src/components/basic/VerticalTabs/VerticalTabs.stories.tsx
deleted file mode 100644
index 21de693fa..000000000
--- a/cx-portal-shared-components/src/components/basic/VerticalTabs/VerticalTabs.stories.tsx
+++ /dev/null
@@ -1,93 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { ComponentStory } from '@storybook/react'
-import { Box, Typography } from '@mui/material'
-
-import { TabPanelType, VerticalTabs as Component } from '.'
-
-export default {
- title: 'Tabs',
- component: Component,
- argTypes: {},
-}
-
-const items: TabPanelType[] = [
- {
- id: 1,
- label: 'General',
- description: (
-
-
- General
-
-
- Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
- nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,
- sed diam voluptua.
-
-
-
- Sub title
-
-
- At vero eos et accusam et justo duo dolores et ea rebum. Stet clita
- kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit
- amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed
- diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
- erat, sed diam voluptua. At vero eos et accusam et justo duo dolores
- et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est
- Lorem ipsum dolor sit amet.
-
-
- ),
- },
- {
- id: 2,
- label: 'Invite Peope',
- description: Invite Peope,
- },
- {
- id: 3,
- label: 'Upload Documents',
- description: Upload Documents,
- },
- {
- id: 4,
- label: 'Registration Workflow',
- description: Registration Workflow,
- },
- {
- id: 5,
- label: 'User Account',
- description: User Account,
- },
-]
-const Template: ComponentStory = (args: any) => (
-
-)
-
-export const VerticalTab = Template.bind({})
-VerticalTab.args = {
- items: items,
-}
diff --git a/cx-portal-shared-components/src/components/basic/VerticalTabs/index.tsx b/cx-portal-shared-components/src/components/basic/VerticalTabs/index.tsx
deleted file mode 100644
index b2b67954c..000000000
--- a/cx-portal-shared-components/src/components/basic/VerticalTabs/index.tsx
+++ /dev/null
@@ -1,117 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { Box, useTheme } from '@mui/material'
-import Tabs from '@mui/material/Tabs'
-import Tab from '@mui/material/Tab'
-import { useState } from 'react'
-import uniqueId from 'lodash/uniqueId'
-import ArrowForwardIos from '@mui/icons-material/ArrowForwardIos'
-
-export type TabPanelType = {
- id: number
- label: string
- description: React.ReactElement
-}
-
-interface VerticalTabsProps {
- items: TabPanelType[]
-}
-
-interface TabPanelProps {
- children?: React.ReactNode
- index: number
- value: number
-}
-
-function a11yProps(index: number) {
- return {
- id: `vertical-tab-${index}`,
- 'aria-controls': `vertical-tabpanel-${index}`,
- }
-}
-
-function TabPanel(props: TabPanelProps) {
- const { children, value, index, ...other } = props
-
- return (
-
- {value === index && {children}}
-
- )
-}
-
-export const VerticalTabs = ({ items }: VerticalTabsProps) => {
- const [value, setValue] = useState(0)
- const theme = useTheme()
- const handleChange = (_event: React.SyntheticEvent, newValue: number) => {
- setValue(newValue)
- }
-
- return (
-
-
- {items.map((item: TabPanelType) => (
- }
- iconPosition="start"
- />
- ))}
-
- {items.map((item: TabPanelType) => (
-
- {item.description}
-
- ))}
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/basic/ViewSelector/ViewSelector.stories.tsx b/cx-portal-shared-components/src/components/basic/ViewSelector/ViewSelector.stories.tsx
deleted file mode 100644
index 4b918171c..000000000
--- a/cx-portal-shared-components/src/components/basic/ViewSelector/ViewSelector.stories.tsx
+++ /dev/null
@@ -1,57 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { ComponentStory } from '@storybook/react'
-import { ViewSelector as Component, view } from '.'
-
-export default {
- title: 'ViewSelector',
- component: Component,
- argTypes: {},
-}
-
-const Template: ComponentStory = (args: any) => (
- <>
-
- >
-)
-
-const views: view[] = [
- {
- buttonText: 'All',
- buttonValue: '',
- onButtonClick: () => {
- console.log('Switch view')
- },
- },
- {
- buttonText: 'Use Cases',
- buttonValue: 'usecases',
- onButtonClick: () => {
- console.log('Switch view')
- },
- },
-]
-
-export const ViewSelector = Template.bind({})
-ViewSelector.args = {
- views: views,
- activeView: 'usecases',
-}
diff --git a/cx-portal-shared-components/src/components/basic/ViewSelector/index.tsx b/cx-portal-shared-components/src/components/basic/ViewSelector/index.tsx
deleted file mode 100644
index dd19b3bb7..000000000
--- a/cx-portal-shared-components/src/components/basic/ViewSelector/index.tsx
+++ /dev/null
@@ -1,65 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { Box } from '@mui/material'
-import { Button } from '../Button'
-import React from 'react'
-
-export interface view {
- buttonText: string
- buttonValue: string
- onButtonClick?: React.MouseEventHandler
-}
-
-export interface ViewSelectorProps {
- views: view[]
- activeView: string
- align?: string
-}
-
-export const ViewSelector = ({
- views,
- activeView,
- align = 'right',
-}: ViewSelectorProps) => {
- return (
-
- {views?.map(({ buttonText, buttonValue, onButtonClick }) => (
-
- ))}
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/content/Cards/AboutCard.stories.tsx b/cx-portal-shared-components/src/components/content/Cards/AboutCard.stories.tsx
deleted file mode 100644
index 62235a883..000000000
--- a/cx-portal-shared-components/src/components/content/Cards/AboutCard.stories.tsx
+++ /dev/null
@@ -1,45 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { ComponentStory } from '@storybook/react'
-
-import { AboutCard as Component } from './AboutCard'
-
-export default {
- title: 'Cards',
- component: Component,
-}
-
-const Template: ComponentStory = (args: any) => (
-
-)
-
-export const AboutCards = Template.bind({})
-AboutCards.args = {
- name: 'Example product name',
- repositoryPath: 'https://github.com/eclipse-tractusx/example-product',
- license: 'Example license',
- licensePath:
- 'https://github.com/eclipse-tractusx/example-product/blob/v1.0.0-example/LICENSE',
- noticePath:
- 'https://github.com/eclipse-tractusx/example-product/blob/v1.0.0-example/NOTICE.md',
- sourcePath:
- 'https://github.com/eclipse-tractusx/example-product/tree/v1.0.0-example',
- commitId: '67e82n0637d585239c72eda374a17b8cb24046ec',
-}
diff --git a/cx-portal-shared-components/src/components/content/Cards/AboutCard.tsx b/cx-portal-shared-components/src/components/content/Cards/AboutCard.tsx
deleted file mode 100644
index 296751146..000000000
--- a/cx-portal-shared-components/src/components/content/Cards/AboutCard.tsx
+++ /dev/null
@@ -1,127 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import OpenInNewIcon from '@mui/icons-material/OpenInNew'
-import { Box } from '@mui/material'
-import { Typography } from '../../basic/Typography'
-
-function LinkText(props: LinkType) {
- return (
- window.open(props.url, '_blank')}
- >
- {props.text}
-
-
- )
-}
-
-function TitleText(props: LinkType) {
- return (
- window.open(props.url, '_blank')}
- >
-
- {props.text}
-
-
-
- )
-}
-
-type LinkType = {
- text: string
- url: string
-}
-
-export const AboutCard = (props: {
- name: string
- repositoryPath: string
- license: string
- licensePath: string
- noticePath: string
- sourcePath: string
- commitId: string
-}) => {
- return (
-
-
-
-
- {props.license && props.licensePath && (
-
- )}
- {props.noticePath && (
-
- )}
- {props.sourcePath && (
-
- )}
- {props.commitId && (
-
-
- Commit ID: {props.commitId}
-
-
- )}
-
-
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/content/Cards/AppCards.stories.tsx b/cx-portal-shared-components/src/components/content/Cards/AppCards.stories.tsx
deleted file mode 100644
index 37e0c27fa..000000000
--- a/cx-portal-shared-components/src/components/content/Cards/AppCards.stories.tsx
+++ /dev/null
@@ -1,59 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { ComponentStory } from '@storybook/react'
-
-import { Cards as Component } from '.'
-
-export default {
- title: 'Cards',
- component: Component,
- argTypes: {},
-}
-
-const Template: ComponentStory = (args: any) => (
- <>
-
- >
-)
-
-const item = {
- title: 'Digital Twin Aspect Debugger',
- subtitle: 'Catena-X',
- image: {
- src: 'https://images.unsplash.com/photo-1517153295259-74eb0b416cee?auto=format&fit=crop&w=640&q=420',
- alt: 'Catena-X Card',
- },
- rating: 4.5,
- price: 'free to use',
- description: 'Lorem Ipsum is simply dummy text of the printing.',
- onButtonClick: () => {},
- onSecondaryButtonClick: () => {},
-}
-
-export const AppCards = Template.bind({})
-AppCards.args = {
- items: [item, item],
- variant: 'minimal',
- expandOnHover: false,
- buttonText: 'Details',
- columns: 6,
- filledBackground: false,
-}
diff --git a/cx-portal-shared-components/src/components/content/Cards/Card.tsx b/cx-portal-shared-components/src/components/content/Cards/Card.tsx
deleted file mode 100644
index 03178a78d..000000000
--- a/cx-portal-shared-components/src/components/content/Cards/Card.tsx
+++ /dev/null
@@ -1,344 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { Box, Link, Typography, useTheme } from '@mui/material'
-import MoreVertIcon from '@mui/icons-material/MoreVert'
-import { useEffect, useRef, useState } from 'react'
-import { CardButtons, CardButtonsProps } from './CardButtons'
-import { CardChip, CardChipProps } from './CardChip'
-import { CardContent, CardContentProps } from './CardContent'
-import { CardImage, CardImageProps } from './CardImage'
-import { SortOption } from '../../basic/SortOption'
-import { SubItems } from '.'
-import { Tooltips } from '../../basic/ToolTips'
-
-type Variants =
- | 'minimal'
- | 'compact'
- | 'expanded'
- | 'preview'
- | 'text-only'
- | 'text-details'
-
-export interface CardProps
- extends CardContentProps,
- CardButtonsProps,
- CardImageProps,
- CardChipProps {
- variant?: Exclude
- filledBackground?: boolean
- backgroundColor?: string
- expandOnHover?: boolean
- readMoreText?: string
- readMoreLink?: string
- onClick?: React.MouseEventHandler
- addButtonClicked?: boolean
- positionValue?: string
- topValue?: number
- subMenu?: boolean
- submenuOptions?: SubItems[]
- submenuClick?: any
- tooltipText?: string
- showStatus?: boolean
-}
-
-export const Card = ({
- variant: variantProp = 'minimal',
- expandOnHover = false,
- filledBackground,
- backgroundColor,
- id,
- title,
- subtitle,
- subscriptionStatus,
- rating,
- price,
- description,
- image,
- imageSize,
- imageShape,
- imageLoader,
- buttonText,
- onClick,
- onButtonClick,
- onSecondaryButtonClick,
- readMoreText,
- readMoreLink,
- addButtonClicked,
- status,
- statusText,
- positionValue = '',
- topValue = 0,
- subMenu,
- submenuOptions,
- submenuClick,
- tooltipText = '',
- showStatus = true,
-}: CardProps) => {
- const { shape, shadows } = useTheme()
- const [variant, setVariant] = useState(variantProp as Variants)
- const [content, setContent] = useState({
- title,
- subtitle,
- } as CardContentProps)
- const boxRef = useRef(null)
- const [showButton, setShowButton] = useState(false)
- const [boxHeight, setBoxHeight] = useState()
- const [sortOption, setSortOption] = useState('')
- const [showModal, setShowModal] = useState(false)
-
- useEffect(() => {
- setVariant(variantProp)
- }, [variantProp])
-
- useEffect(() => {
- sortOption && submenuClick(sortOption, id)
- }, [sortOption, submenuClick, id])
-
- useEffect(() => {
- switch (variant) {
- case 'compact':
- setContent({ title, subtitle, rating, price })
- break
- case 'text-only':
- setContent({ title, description })
- break
- case 'expanded':
- case 'preview':
- setContent({ title, subtitle, rating, price, description })
- break
- case 'text-details':
- setContent({ title, subtitle, description })
- break
- default:
- setContent({ title, subtitle })
- }
- }, [variant, description, price, rating, subtitle, title])
-
- useEffect(() => {
- setShowButton(['expanded', 'preview'].includes(variant))
- }, [variant])
-
- useEffect(() => {
- // Set initial box height to prevent flicker on hover
- // TODO: Had to add 37px in height to fit inner content, investigation required
- setBoxHeight(boxRef.current?.getBoundingClientRect().height)
- }, [])
-
- const onMouseEnter = () => {
- if (expandOnHover) setVariant('preview')
- }
- const onMouseLeave = () => setVariant(variantProp)
-
- const customBackgroundColor = () => {
- return backgroundColor ? backgroundColor : 'background.background02'
- }
-
- const styles = {
- position: positionValue !== '' ? positionValue : 'relative',
- height: boxHeight ? `${boxHeight + 37}px` : '',
- top: `${topValue}px`,
- left: '0px',
- paddingRight: '10px',
- paddingLeft: '10px',
- width: '290px',
- minWidth: '290px',
- marginBottom: '64px',
- } as React.CSSProperties
-
- const handleSubmenuFn = (e: any) => {
- e.stopPropagation()
- if (status === 'active') {
- setShowModal(true)
- }
- }
-
- return (
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/content/Cards/CardAddService.stories.tsx b/cx-portal-shared-components/src/components/content/Cards/CardAddService.stories.tsx
deleted file mode 100644
index d55931572..000000000
--- a/cx-portal-shared-components/src/components/content/Cards/CardAddService.stories.tsx
+++ /dev/null
@@ -1,41 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { ComponentStory } from '@storybook/react'
-
-import { CardAddService as Component } from './CardAddService'
-
-export default {
- title: 'Cards',
- component: Component,
- argTypes: {},
-}
-
-const Template: ComponentStory = (args: any) => (
-
-)
-
-export const AddServiceCard = Template.bind({})
-AddServiceCard.args = {
- title: 'Create new App',
- onButtonClick: () => {
- console.log('Add new app')
- },
-}
diff --git a/cx-portal-shared-components/src/components/content/Cards/CardAddService.tsx b/cx-portal-shared-components/src/components/content/Cards/CardAddService.tsx
deleted file mode 100644
index 65b3e9d79..000000000
--- a/cx-portal-shared-components/src/components/content/Cards/CardAddService.tsx
+++ /dev/null
@@ -1,113 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { Box, useTheme } from '@mui/material'
-import { Typography } from '../../basic/Typography'
-import { useState, useEffect, useRef } from 'react'
-
-interface CardAddServiceProps {
- title?: string
- backgroundColor?: string
- onButtonClick: React.MouseEventHandler
-}
-
-export const CardAddService = ({
- title,
- backgroundColor,
- onButtonClick,
-}: CardAddServiceProps) => {
- const theme = useTheme()
- const { shape, shadows } = theme
- const [boxHeight, setBoxHeight] = useState()
- const boxRef = useRef(null)
-
- useEffect(() => {
- setBoxHeight(boxRef.current?.getBoundingClientRect().height)
- }, [])
-
- return (
-
-
-
-
-
-
-
-
- {title}
-
-
-
-
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/content/Cards/CardButtons.tsx b/cx-portal-shared-components/src/components/content/Cards/CardButtons.tsx
deleted file mode 100644
index 1d3b430ab..000000000
--- a/cx-portal-shared-components/src/components/content/Cards/CardButtons.tsx
+++ /dev/null
@@ -1,59 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { Box } from '@mui/material'
-import { Button } from '../../basic/Button'
-import { IconButton } from '../../basic/IconButton'
-import AddIcon from '@mui/icons-material/Add'
-import CheckIcon from '@mui/icons-material/Check'
-
-export interface CardButtonsProps {
- buttonText: string
- onButtonClick?: React.MouseEventHandler
- onSecondaryButtonClick?: React.MouseEventHandler
- addButtonClicked?: boolean
-}
-
-export const CardButtons = ({
- buttonText,
- onButtonClick = () => {},
- onSecondaryButtonClick,
- addButtonClicked,
-}: CardButtonsProps) => {
- return (
-
-
- {onSecondaryButtonClick && (
-
- {addButtonClicked ? : }
-
- )}
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/content/Cards/CardChip.tsx b/cx-portal-shared-components/src/components/content/Cards/CardChip.tsx
deleted file mode 100644
index f3d75bb7a..000000000
--- a/cx-portal-shared-components/src/components/content/Cards/CardChip.tsx
+++ /dev/null
@@ -1,91 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { useTheme } from '@mui/material'
-import MuiChip from '@mui/material/Chip'
-import { useEffect, useState } from 'react'
-
-export enum StatusVariants {
- release = 'release',
- active = 'active',
- inactive = 'inactive',
- created = 'created',
- inReview = 'in_review',
-}
-
-export type Variants =
- | StatusVariants.release
- | StatusVariants.active
- | StatusVariants.inactive
- | StatusVariants.created
- | StatusVariants.inReview
-
-export interface CardChipProps {
- status?: Variants
- statusText?: string
-}
-
-export const CardChip = ({ status, statusText }: CardChipProps) => {
- const theme = useTheme()
- const [chipColor, setChipColor] = useState('')
- const [chipBackground, setChipBackground] = useState('')
-
- useEffect(() => {
- switch (status?.toLowerCase()) {
- case StatusVariants.release:
- setChipColor(theme.palette.chip.release)
- setChipBackground(theme.palette.chip.bgRelease)
- break
- case StatusVariants.active:
- setChipColor(theme.palette.chip.active)
- setChipBackground(theme.palette.chip.bgActive)
- break
- case StatusVariants.inactive:
- setChipColor(theme.palette.chip.inactive)
- setChipBackground(theme.palette.chip.bgInactive)
- break
- case StatusVariants.created:
- setChipColor(theme.palette.chip.created)
- setChipBackground(theme.palette.chip.bgCreated)
- break
- case StatusVariants.inReview:
- setChipColor(theme.palette.chip.inReview)
- setChipBackground(theme.palette.chip.bgInReview)
- break
- default:
- setChipColor(theme.palette.chip.default)
- setChipBackground(theme.palette.chip.bgDefault)
- }
- }, [status, theme])
-
- return (
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/content/Cards/CardContent.tsx b/cx-portal-shared-components/src/components/content/Cards/CardContent.tsx
deleted file mode 100644
index 58cc20b43..000000000
--- a/cx-portal-shared-components/src/components/content/Cards/CardContent.tsx
+++ /dev/null
@@ -1,86 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { Box } from '@mui/material'
-import { Typography } from '../../basic/Typography'
-import { CardRating, CardRatingProps } from './CardRating'
-
-export interface CardContentProps extends Partial {
- id?: string
- title: string
- subtitle?: string
- subscriptionStatus?: string
- price?: string
- description?: string
-}
-
-export const CardContent = ({
- title,
- subtitle,
- rating,
- price,
- description,
-}: CardContentProps) => {
- return (
-
-
- {subtitle && (
-
- {subtitle}
-
- )}
-
-
-
- {title}
-
-
- {rating && price && (
-
-
- {price}
-
- )}
- {description && (
-
- {description}
-
- )}
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/content/Cards/CardDecision.stories.tsx b/cx-portal-shared-components/src/components/content/Cards/CardDecision.stories.tsx
deleted file mode 100644
index 2a9b17727..000000000
--- a/cx-portal-shared-components/src/components/content/Cards/CardDecision.stories.tsx
+++ /dev/null
@@ -1,54 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { ComponentStory } from '@storybook/react'
-import { StatusVariants } from './CardChip'
-
-import { CardDecision as Component } from './CardDecision'
-
-export default {
- title: 'Cards',
- component: Component,
- argTypes: {},
-}
-
-const Template: ComponentStory = (args: any) => (
-
-)
-
-const items = [
- {
- appId: '12',
- provider: 'Bayerische Motorenwerke AG',
- name: 'Logistics Network, Material Traceability (LBN-MT)',
- status: StatusVariants.release,
- },
- {
- appId: '123',
- provider: 'Catena-X',
- name: 'DTC-Translator',
- status: StatusVariants.active,
- },
-]
-
-export const CardDecision = Template.bind({})
-CardDecision.args = {
- items: items,
-}
diff --git a/cx-portal-shared-components/src/components/content/Cards/CardDecision.tsx b/cx-portal-shared-components/src/components/content/Cards/CardDecision.tsx
deleted file mode 100644
index 4dc9be71c..000000000
--- a/cx-portal-shared-components/src/components/content/Cards/CardDecision.tsx
+++ /dev/null
@@ -1,173 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { Box, Typography, IconButton, useTheme } from '@mui/material'
-import { CardChip, StatusVariants, Variants } from './CardChip'
-import DeleteOutlineIcon from '@mui/icons-material/DeleteOutline'
-import ApprovalIcon from '@mui/icons-material/Approval'
-
-export interface AppContent {
- appId?: string
- name?: string
- provider: string
- status: Variants
- id?: string
- title?: string
-}
-
-export interface CardDecisionProps {
- items: AppContent[]
- onApprove: (e: string) => void
- onDelete: (e: string) => void
- onClick: (e: string) => void
-}
-
-export const CardDecision = ({
- items,
- onApprove,
- onDelete,
- onClick,
-}: CardDecisionProps) => {
- const theme = useTheme()
-
- const handleDecision = (
- e: React.SyntheticEvent,
- id: string,
- type: string
- ) => {
- e.stopPropagation()
- type === 'approve' ? onApprove(id) : onDelete(id)
- }
-
- return (
-
- {items.map((item) => {
- const id = item.appId || item.id || ''
- const name = item.title || item.name || ''
- return (
-
- onClick(id)}
- >
-
- {name}
-
-
- {item.provider}
-
-
-
-
- {item.status?.toLowerCase() !== StatusVariants.active && (
-
- handleDecision(e, id, 'approve')}
- >
-
-
- handleDecision(e, id, 'delete')}
- >
-
-
-
- )}
-
-
- )
- })}
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/content/Cards/CardHorizontal.stories.tsx b/cx-portal-shared-components/src/components/content/Cards/CardHorizontal.stories.tsx
deleted file mode 100644
index ed10c7a9a..000000000
--- a/cx-portal-shared-components/src/components/content/Cards/CardHorizontal.stories.tsx
+++ /dev/null
@@ -1,50 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { ComponentStory } from '@storybook/react'
-import { StatusVariants } from './CardChip'
-
-import { CardHorizontal as Component } from './CardHorizontal'
-
-export default {
- title: 'Cards',
- component: Component,
- argTypes: {},
-}
-
-const Template: ComponentStory = (args: any) => (
-
-)
-
-export const CardHorizontal = Template.bind({})
-CardHorizontal.args = {
- label: 'Catena-X',
- title: 'Digital Twin Debugger',
- subTitle: 'Service Category',
- description:
- 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.',
- borderRadius: 20,
- imagePath: '',
- imageAlt: 'App Card ',
- status: StatusVariants.release,
- statusText: 'In Release',
- buttonText: 'Details',
- onBtnClick: () => {},
-}
diff --git a/cx-portal-shared-components/src/components/content/Cards/CardHorizontal.tsx b/cx-portal-shared-components/src/components/content/Cards/CardHorizontal.tsx
deleted file mode 100644
index a23af4b42..000000000
--- a/cx-portal-shared-components/src/components/content/Cards/CardHorizontal.tsx
+++ /dev/null
@@ -1,181 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { useRef } from 'react'
-import { Box, useTheme } from '@mui/material'
-import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown'
-import { LogoGrayData } from '../../basic/Logo'
-import { Typography } from '../../basic/Typography'
-import { CardChipProps } from './CardChip'
-
-interface CardHorizontalProps extends CardChipProps {
- label: string
- title: string
- subTitle?: string
- borderRadius: number
- imagePath: string
- imageAlt: string
- description?: string
- backgroundColor?: string
- buttonText?: string
- onBtnClick?: React.MouseEventHandler
- expandOnHover?: boolean
-}
-
-export const CardHorizontal = ({
- label,
- title,
- subTitle,
- borderRadius = 0,
- imagePath,
- imageAlt,
- description,
- status,
- statusText,
- buttonText,
- onBtnClick,
- backgroundColor,
- expandOnHover = false,
-}: CardHorizontalProps) => {
- const theme = useTheme()
- const boxRef = useRef(null)
-
- return (
-
-
-
-
- {label}
-
-
-
- {title}
-
-
- {subTitle}
-
- {description && (
-
- {description}
-
- )}
-
- {buttonText && (
-
-
-
- {buttonText}
-
-
- )}
-
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/content/Cards/CardImage.tsx b/cx-portal-shared-components/src/components/content/Cards/CardImage.tsx
deleted file mode 100644
index ea35ba6c5..000000000
--- a/cx-portal-shared-components/src/components/content/Cards/CardImage.tsx
+++ /dev/null
@@ -1,85 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { Box, useTheme } from '@mui/material'
-import { Image } from '../../basic/Image'
-import { LogoGrayData } from '../../basic/Logo'
-
-export type CardImageSize = 'normal' | 'medium' | 'small'
-
-export type CardImageShape = 'round' | 'square'
-
-export interface ICardImage {
- src: string
- alt?: string
-}
-
-export interface CardImageProps {
- image?: ICardImage
- imageSize?: CardImageSize
- imageShape?: CardImageShape
- imageLoader?: (src: string) => Promise
- preview?: boolean
-}
-
-export const CardImage = ({
- image,
- imageSize = 'normal',
- imageShape = 'round',
- imageLoader,
- preview = false,
-}: CardImageProps) => {
- const { transitions } = useTheme()
- const withPreview = (size: number) => (preview ? size + 18 : size)
-
- const sx = {
- container: {
- normal: {},
- medium: { paddingTop: 3, textAlign: 'center' },
- small: { paddingTop: 3, textAlign: 'center' },
- },
- image: {
- normal: { width: '100%', height: withPreview(144) },
- medium: { width: withPreview(156), height: withPreview(156) },
- small: { width: withPreview(80), height: withPreview(80) },
- round: { borderRadius: '50%' },
- square: { borderRadius: 6 },
- },
- }
-
- return (
-
-
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/content/Cards/CardRating.tsx b/cx-portal-shared-components/src/components/content/Cards/CardRating.tsx
deleted file mode 100644
index a6d04f492..000000000
--- a/cx-portal-shared-components/src/components/content/Cards/CardRating.tsx
+++ /dev/null
@@ -1,43 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { Box, useTheme } from '@mui/material'
-import { Typography } from '../../basic/Typography'
-import StarRateIcon from '@mui/icons-material/StarRate'
-
-export interface CardRatingProps {
- rating: number
-}
-
-export const CardRating = ({ rating }: CardRatingProps) => {
- const { palette } = useTheme()
-
- return (
-
-
-
-
- {rating}
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/content/Cards/ContentCards.stories.tsx b/cx-portal-shared-components/src/components/content/Cards/ContentCards.stories.tsx
deleted file mode 100644
index f9b50cee5..000000000
--- a/cx-portal-shared-components/src/components/content/Cards/ContentCards.stories.tsx
+++ /dev/null
@@ -1,125 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { ComponentStory } from '@storybook/react'
-
-import { Cards as Component } from '.'
-
-export default {
- title: 'Cards',
- component: Component,
- argTypes: {},
-}
-
-const Template: ComponentStory = (args: any) => (
-
-)
-
-const items = [
- {
- title: 'Catena-X News',
- subtitle: 'Catena-X',
- subscriptionStatus: 'Pending',
- image: {
- src: 'https://images.unsplash.com/photo-1517153295259-74eb0b416cee?auto=format&fit=crop&w=640&q=420',
- alt: 'Catena-X Card',
- },
- description: 'Lorem Ipsum is simply dummy text of the printing.',
- onButtonClick: () => {
- console.log('Catena-X News')
- },
- readMoreText: 'Read more',
- readMoreLink: '#',
- status: 'release',
- statusText: 'In Release',
- },
- {
- title: 'Samrt MOM',
- subtitle: 'German Edge Cloud GmbH & Co. KG',
- subscriptionStatus: 'Purchased',
- image: {
- src: 'https://images.unsplash.com/photo-1517153295259-74eb0b416cee?auto=format&fit=crop&w=640&q=420',
- alt: 'Catena-X Card',
- },
- description:
- 'Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.',
- onButtonClick: () => {
- console.log('Samrt MOM')
- },
- readMoreText: 'Read more',
- readMoreLink: '#',
- status: 'active',
- statusText: 'Active',
- },
- {
- title: 'Project Implementation: Earth Commerce',
- subtitle: 'Catena-X',
- subscriptionStatus: 'Purchased',
- image: {
- src: 'https://images.unsplash.com/photo-1517153295259-74eb0b416cee?auto=format&fit=crop&w=640&q=420',
- alt: 'Catena-X Card',
- },
- description: 'sea takimata sanctus est Lorem ipsum dolor sit amet.',
- onButtonClick: () => {
- console.log('Fraud Reporter')
- },
- readMoreText: 'Read more',
- readMoreLink: '#',
- status: 'inactive',
- statusText: 'inactive',
- },
- {
- title: 'Fraud Dashboard',
- subtitle: 'Catena-X',
- subscriptionStatus: 'Pending',
- image: {
- src: 'https://images.unsplash.com/photo-1517153295259-74eb0b416cee?auto=format&fit=crop&w=640&q=420',
- alt: 'Catena-X Card',
- },
- description: 'At vero eos et accusam et justo duo dolores et ea rebum.',
- onButtonClick: () => {
- console.log('Fraud Dashboard')
- },
- readMoreText: 'Read more',
- readMoreLink: '#',
- },
-]
-
-const submenuOptions = [
- {
- label: 'Tab 1',
- value: 'tab1',
- url: '/tab1',
- },
-]
-
-export const ContentCards = Template.bind({})
-ContentCards.args = {
- columns: 6,
- items: items,
- variant: 'compact',
- buttonText: 'Details',
- imageSize: 'medium',
- imageShape: 'round',
- addButtonClicked: false,
- subMenu: true,
- submenuOptions: submenuOptions,
- tooltipText: 'Action is pending',
-}
diff --git a/cx-portal-shared-components/src/components/content/Cards/index.tsx b/cx-portal-shared-components/src/components/content/Cards/index.tsx
deleted file mode 100644
index 1e83a2a3e..000000000
--- a/cx-portal-shared-components/src/components/content/Cards/index.tsx
+++ /dev/null
@@ -1,130 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { Box } from '@mui/material'
-import { Card, CardProps } from './Card'
-import uniqueId from 'lodash/uniqueId'
-import { CardAddService } from './CardAddService'
-
-export type CardItems = Omit<
- CardProps,
- 'variant' | 'imageSize' | 'imageShape' | 'buttonText' | 'status'
->
-
-export type SubItems = {
- label: string
- value: string
-}
-
-interface CardsProps {
- items: CardItems[]
- buttonText: CardProps['buttonText']
- variant?: CardProps['variant']
- expandOnHover?: CardProps['expandOnHover']
- filledBackground?: CardProps['filledBackground']
- imageSize?: CardProps['imageSize']
- imageShape?: CardProps['imageShape']
- imageLoader?: CardProps['imageLoader']
- columns?: number
- readMoreText?: CardProps['readMoreText']
- readMoreLink?: CardProps['readMoreLink']
- addButtonClicked?: boolean
- showAddNewCard?: boolean
- newButtonText?: string
- onNewCardButton?: any
- onCardClick?: any
- subMenu?: boolean
- submenuOptions?: SubItems[]
- submenuClick?: any
- tooltipText?: string
- showStatus?: boolean
-}
-
-export const Cards = ({
- items,
- buttonText,
- readMoreText,
- readMoreLink,
- variant,
- imageSize,
- imageShape,
- imageLoader,
- columns = 6,
- expandOnHover,
- filledBackground,
- addButtonClicked = false,
- showAddNewCard = false,
- newButtonText,
- onNewCardButton,
- onCardClick = () => {},
- subMenu = false,
- submenuOptions = [],
- submenuClick = () => {},
- tooltipText,
- showStatus = true,
-}: CardsProps) => {
- const settings = {
- variant,
- buttonText,
- readMoreText,
- readMoreLink,
- imageSize,
- imageShape,
- imageLoader,
- expandOnHover,
- filledBackground,
- addButtonClicked,
- subMenu,
- submenuOptions,
- submenuClick,
- tooltipText,
- showStatus,
- }
-
- return (
-
- {showAddNewCard && (
-
- )}
- {items?.map((item) => (
- {
- onCardClick(item)
- }}
- />
- ))}
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/content/Navigation/NavItem.tsx b/cx-portal-shared-components/src/components/content/Navigation/NavItem.tsx
deleted file mode 100644
index 091915153..000000000
--- a/cx-portal-shared-components/src/components/content/Navigation/NavItem.tsx
+++ /dev/null
@@ -1,101 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { Box, Link, useTheme } from '@mui/material'
-import { useState } from 'react'
-import classNames from 'classnames'
-import { Menu } from '../../basic/Menu'
-import { MenuItemProps } from '../../basic/Menu/MenuItem'
-
-interface NavItemProps extends MenuItemProps {
- isActive?: boolean
- unstyled?: boolean
-}
-
-export const NavItem = ({
- title,
- children,
- component = Link,
- isActive = false,
- unstyled = false,
- ...props
-}: NavItemProps) => {
- const { spacing, shadows } = useTheme()
- const [open, setOpen] = useState(false)
-
- const onMouseEnter = () => setOpen(true)
-
- const onMouseLeave = () => setOpen(false)
-
- return (
-
-
- {title}
-
- {children && open && (
-
- )}
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/content/Navigation/Navigation.stories.tsx b/cx-portal-shared-components/src/components/content/Navigation/Navigation.stories.tsx
deleted file mode 100644
index 5cef04781..000000000
--- a/cx-portal-shared-components/src/components/content/Navigation/Navigation.stories.tsx
+++ /dev/null
@@ -1,78 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { ComponentStory } from '@storybook/react'
-
-import { Navigation as Component } from '.'
-
-export default {
- title: 'Navigation',
- component: Component,
- argTypes: {},
-}
-
-const Template: ComponentStory = (args: any) => (
-
-)
-
-const items = [
- {
- href: '/home',
- title: 'home',
- children: [
- { href: '/home-1', title: 'home 1' },
- {
- href: '/home-2',
- title: 'home 2',
- children: [
- {
- href: '/home-2/1',
- title: 'Submenu 1 ',
- children: [{ href: '/', title: 'Sub-Submenu' }],
- },
- { href: '/home-2/2', title: 'Submenu 2 ' },
- ],
- },
- ],
- },
- { href: '/appstore', title: 'App Store' },
- { href: '/data-catalog', title: 'Data Catalog' },
-]
-
-const itemsFirstLevel = items.map(({ href, title }) => ({ href, title }))
-
-export const Unstyled = Template.bind({})
-Unstyled.args = {
- items: itemsFirstLevel,
- active: '/home',
- unstyled: true,
-}
-
-export const Simple = Template.bind({})
-Simple.args = {
- items: itemsFirstLevel,
- active: '/home',
-}
-
-export const WithDropdown = Template.bind({})
-WithDropdown.args = {
- items,
- active: '/home',
-}
diff --git a/cx-portal-shared-components/src/components/content/Navigation/index.tsx b/cx-portal-shared-components/src/components/content/Navigation/index.tsx
deleted file mode 100644
index f4fabf74c..000000000
--- a/cx-portal-shared-components/src/components/content/Navigation/index.tsx
+++ /dev/null
@@ -1,57 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { Box } from '@mui/material'
-import uniqueId from 'lodash/uniqueId'
-import { MenuProps } from '../../basic/Menu'
-import { NavItem } from './NavItem'
-
-export interface NavigationProps extends MenuProps {
- active?: string
- unstyled?: boolean
- selectedItem?: (item: string) => void
-}
-
-export const Navigation = ({
- items,
- component,
- active = '',
- unstyled = false,
- selectedItem,
-}: NavigationProps) => {
- return (
-
- {items?.map((link) => {
- const isActive = link.href === active || link.to === active
-
- return (
- (selectedItem ? selectedItem(link.href ?? '') : '')}
- />
- )
- })}
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/content/UserMenu/UserMenu.stories.tsx b/cx-portal-shared-components/src/components/content/UserMenu/UserMenu.stories.tsx
deleted file mode 100644
index 1157e0384..000000000
--- a/cx-portal-shared-components/src/components/content/UserMenu/UserMenu.stories.tsx
+++ /dev/null
@@ -1,56 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { ComponentStory } from '@storybook/react'
-
-import { UserMenu as Component } from '.'
-import { LanguageSwitch } from '../../basic/LanguageSwitch'
-import { UserNav } from '../UserNav'
-
-export default {
- title: 'UserMenu',
- component: Component,
-}
-
-const Template: ComponentStory = (args: any) => (
-
-
- {}}
- />
-
-)
-
-export const UserMenu = Template.bind({})
-UserMenu.args = {
- open: true,
- userName: 'Max Mustermann',
- userRole: 'Admin',
-}
diff --git a/cx-portal-shared-components/src/components/content/UserMenu/index.tsx b/cx-portal-shared-components/src/components/content/UserMenu/index.tsx
deleted file mode 100644
index 9e5d8a4d2..000000000
--- a/cx-portal-shared-components/src/components/content/UserMenu/index.tsx
+++ /dev/null
@@ -1,82 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { Box, ClickAwayListener, useTheme } from '@mui/material'
-import { Typography } from '../../basic/Typography'
-
-interface UserMenuProps {
- open: boolean
- userName: string
- userRole: string
- top?: number
- children?: React.ReactElement[]
- onClickAway?: (event: MouseEvent | TouchEvent) => void
-}
-
-export const UserMenu = ({
- open,
- userName,
- userRole,
- children,
- top = 0,
- onClickAway = () => {},
- ...props
-}: UserMenuProps) => {
- const { spacing, shadows } = useTheme()
-
- return (
-
-
-
-
- {userName}
-
-
- {userRole}
-
-
- {children}
-
-
- )
-}
diff --git a/cx-portal-shared-components/src/components/content/UserNav/UserNav.stories.tsx b/cx-portal-shared-components/src/components/content/UserNav/UserNav.stories.tsx
deleted file mode 100644
index 8e648c3a0..000000000
--- a/cx-portal-shared-components/src/components/content/UserNav/UserNav.stories.tsx
+++ /dev/null
@@ -1,42 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { ComponentStory } from '@storybook/react'
-
-import { UserNav as Component } from '.'
-
-export default {
- title: 'UserMenu',
- component: Component,
-}
-
-const Template: ComponentStory = (args: any) => (
-
-)
-
-export const UserNav = Template.bind({})
-UserNav.args = {
- items: [
- { href: '/account', title: 'My Account' },
- { href: '/notification', title: 'Notification Center' },
- { href: '/organisation', title: 'Organisation' },
- { href: '/logout', title: 'Logout' },
- ],
-}
diff --git a/cx-portal-shared-components/src/components/content/UserNav/index.tsx b/cx-portal-shared-components/src/components/content/UserNav/index.tsx
deleted file mode 100644
index dfb923aa5..000000000
--- a/cx-portal-shared-components/src/components/content/UserNav/index.tsx
+++ /dev/null
@@ -1,27 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { Menu, MenuProps } from '../../basic/Menu'
-
-export type UserNavProps = MenuProps
-
-export const UserNav = (props: UserNavProps) => {
- return
-}
diff --git a/cx-portal-shared-components/src/components/index.tsx b/cx-portal-shared-components/src/components/index.tsx
deleted file mode 100644
index 06e8e7445..000000000
--- a/cx-portal-shared-components/src/components/index.tsx
+++ /dev/null
@@ -1,115 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-export { Alert } from './basic/Alert'
-export { BaseImage } from './basic/BaseImage'
-export { Button } from './basic/Button'
-export { Checkbox } from './basic/Checkbox'
-export { CategoryDivider } from './basic/CategoryDivider'
-export { Dialog } from './basic/Dialog'
-export { DialogActions } from './basic/Dialog/DialogActions'
-export { DialogContent } from './basic/Dialog/DialogContent'
-export { DialogHeader } from './basic/Dialog/DialogHeader'
-export { FileIcon } from './basic/CustomIcons/FileIcon'
-export { Image, TransparentPixel } from './basic/Image'
-export { ImageGallery } from './basic/ImageGallery'
-export { ImageItem } from './basic/ImageGallery/ImageItem'
-export { IconButton } from './basic/IconButton'
-export { Input } from './basic/Input'
-export { LanguageSwitch } from './basic/LanguageSwitch'
-export { Logo, LogoGrayData } from './basic/Logo'
-export { Menu } from './basic/Menu'
-export { MenuItem } from './basic/Menu/MenuItem'
-export { Radio } from './basic/Radio'
-export { Rating } from './basic/Rating'
-export { SearchInput } from './basic/SearchInput'
-export { SharedCssBaseline } from './basic/SharedCssBaseline'
-export { SharedThemeProvider } from './basic/SharedThemeProvider'
-export { Tab } from './basic/Tabs/Tab'
-export { TabPanel } from './basic/Tabs/TabPanel'
-export { StaticTable } from './basic/StaticTable'
-export { Table, StatusTag } from './basic/Table'
-export { PageLoadingTable } from './basic/Table/PageLoadingTable'
-export { Tabs } from './basic/Tabs/Tabs'
-export { Typography } from './basic/Typography'
-export { UserAvatar } from './basic/UserAvatar'
-export { DropdownMenu } from './basic/DropdownMenu'
-export * from './basic/Dropzone'
-export { DropzoneOldDEPRECATED } from './basic/Dropzone/old_deprecated'
-export { Chip } from './basic/Chip'
-export { ViewSelector } from './basic/ViewSelector'
-export { Carousel } from './basic/Carousel'
-export { CarouselBox } from './basic/Carousel/CarouselBox'
-export { CustomAccordion } from './basic/CustomAccordion'
-export { CustomAccordionItem } from './basic/CustomAccordion/Item'
-export { SubNavigation } from './basic/SubNavigation'
-export { MainNavigation } from './basic/MainNavigation'
-export { Breadcrumb } from './basic/Breadcrumb'
-export { PageHeader } from './basic/Headers/PageHeader/PageHeader'
-export { MainHeader } from './basic/Headers/MainHeader/MainHeader'
-export { BackButton } from './basic/Button/BackButton'
-export { LoadMoreButton } from './basic/Button/LoadMoreButton'
-export { PageNotifications } from './basic/Notifications/PageNotification'
-export { PageSnackbar } from './basic/Notifications/Snackbar'
-export { PageSnackbarStack } from './basic/Notifications/Snackbar/PageSnackbarStack'
-export { ErrorPage } from './basic/ErrorPage'
-export { MultiSelectList } from './basic/MultiSelectList'
-export { ProcessList } from './basic/ProcessList'
-export { CircleProgress } from './basic/Progress/CircleProgress'
-export { Stepper } from './basic/Stepper'
-export { SelectList } from './basic/SelectList'
-export { Textarea } from './basic/Textarea'
-export { VerticalTabs } from './basic/VerticalTabs'
-export { OrderStatusButton } from './basic/OrderStatusButton'
-export { LoadingButton } from './basic/LoadingButton'
-export { Cards } from './content/Cards'
-export { Card } from './content/Cards/Card'
-export { CardAddService } from './content/Cards/CardAddService'
-export { CardHorizontal } from './content/Cards/CardHorizontal'
-export { CardDecision } from './content/Cards/CardDecision'
-export { Navigation } from './content/Navigation'
-export { UserMenu } from './content/UserMenu'
-export { UserNav } from './content/UserNav'
-export { CircularProgress } from './basic/CircularProgress'
-export { Datepicker } from './basic/Datepicker'
-export { TransitionChip } from './basic/Chip/TransitionChip'
-export { Tooltips } from './basic/ToolTips'
-export { SortOption } from './basic/SortOption'
-export { ParentSubNavigation } from './basic/SubNavigation/ParentSubNavigation'
-export { Expand } from './basic/Expand'
-export { AboutCard } from './content/Cards/AboutCard'
-
-export type { TableProps } from './basic/Table'
-export type {
- PageLoadingTableProps,
- PaginMeta,
- PaginResult,
- PaginFetchArgs,
-} from './basic/Table/PageLoadingTable'
-export type { CardItems } from './content/Cards'
-export type { NavigationProps } from './content/Navigation'
-export type { PageNotificationsProps } from './basic/Notifications/PageNotification'
-export type { TableType } from './basic/StaticTable/types'
-export type { ImageType } from './basic/ImageGallery/types'
-export type { DateType } from './basic/Datepicker'
-export { StatusVariants } from './content/Cards/CardChip'
-export type { TabPanelType } from './basic/VerticalTabs'
-export type { LoadMoreButtonProps } from './basic/Button/LoadMoreButton'
-export type { NotificationBadgeType } from './basic/Menu'
diff --git a/cx-portal-shared-components/src/index.ts b/cx-portal-shared-components/src/index.ts
deleted file mode 100644
index 331160345..000000000
--- a/cx-portal-shared-components/src/index.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-export * from './@types'
-export * from './components'
-export { theme } from './theme'
diff --git a/cx-portal-shared-components/src/scss/fonts.scss b/cx-portal-shared-components/src/scss/fonts.scss
deleted file mode 100644
index 3919eed5f..000000000
--- a/cx-portal-shared-components/src/scss/fonts.scss
+++ /dev/null
@@ -1,62 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-@mixin use-font(
- $font-family,
- $filename,
- $font-weight: normal,
- $font-display: block
-) {
- @font-face {
- font-family: '#{$font-family}';
- font-display: $font-display;
- src:
- // url('#{$filename}.eot') format('eot'),
- // url('#{$filename}.woff2') format('woff2'),
- // url('#{$filename}.woff') format('woff'),
- // url('#{$filename}.svg') format('svg'),
- url('#{$filename}.ttf') format('truetype');
- font-weight: $font-weight;
- }
-}
-
-@include use-font(
- 'LibreFranklin-SemiBold',
- '../assets/fonts/LibreFranklin-VariableFont_wght',
- 600
-);
-
-@include use-font(
- 'LibreFranklin-Medium',
- '../assets/fonts/LibreFranklin-VariableFont_wght',
- 500
-);
-
-@include use-font(
- 'LibreFranklin',
- '../assets/fonts/LibreFranklin-VariableFont_wght',
- 400
-);
-
-@include use-font(
- 'LibreFranklin-Light',
- '../assets/fonts/LibreFranklin-VariableFont_wght',
- 300
-);
diff --git a/cx-portal-shared-components/src/scss/global.scss b/cx-portal-shared-components/src/scss/global.scss
deleted file mode 100644
index ee8142781..000000000
--- a/cx-portal-shared-components/src/scss/global.scss
+++ /dev/null
@@ -1,35 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-//TODO:
-//deactivated because of build error
-//Error:
-// @use rules must be written before any other rules.
-// ╷
-//43 │ @use 'sass:math';
-// │ ^^^^^^^^^^^^^^^^
-// ╵
-// stdin 43:1 root stylesheet
-//
-//@use 'sass:math';
-
-@function circle-angle($size) {
- @return 1; //round($size * 0.70710678118) + math.div($size, 2);
-}
diff --git a/cx-portal-shared-components/src/setupTests.ts b/cx-portal-shared-components/src/setupTests.ts
deleted file mode 100644
index 7c0e93d4a..000000000
--- a/cx-portal-shared-components/src/setupTests.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-// jest-dom adds custom jest matchers for asserting on DOM nodes.
-// allows you to do things like:
-// expect(element).toHaveTextContent(/react/i)
-// learn more: https://github.com/testing-library/jest-dom
-import '@testing-library/jest-dom/extend-expect'
diff --git a/cx-portal-shared-components/src/theme.ts b/cx-portal-shared-components/src/theme.ts
deleted file mode 100644
index 12bd31750..000000000
--- a/cx-portal-shared-components/src/theme.ts
+++ /dev/null
@@ -1,722 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { createTheme } from '@mui/material/styles'
-// Needs to use like this to overwrite data grid styles
-// https://mui.com/components/data-grid/getting-started/#typescript
-// eslint-disable-next-line
-import type {} from '@mui/x-data-grid/themeAugmentation'
-import createPalette from '@mui/material/styles/createPalette'
-import createTypography from '@mui/material/styles/createTypography'
-
-const getFontFamily = (name: string): string =>
- [
- `"${name}"`,
- '-apple-system',
- 'BlinkMacSystemFont',
- '"Segoe UI"',
- 'Roboto',
- '"Helvetica Neue"',
- 'Arial',
- 'sans-serif',
- '"Apple Color Emoji"',
- '"Segoe UI Emoji"',
- '"Segoe UI Symbol"',
- ].join(',')
-
-const breakpoints = {
- xs: 0,
- sm: 375,
- md: 627,
- lg: 1056,
- xl: 1312,
-}
-
-const palette = createPalette({
- common: {
- white: '#fff',
- black: '#000',
- },
- primary: {
- main: '#0f71cb',
- dark: '#0d55af',
- contrastText: '#fff',
- shadow: 'rgba(15, 113, 203, 0.4)',
- },
- secondary: {
- main: '#eaf1fe',
- dark: '#d4e3fe',
- contrastText: '#0f71cb',
- },
- brand: {
- brand01: '#FFA600',
- brand02: '#B3CB2D',
- },
- action: {
- active: '#939393',
- disabled: '#ADADAD',
- disabledBackground: '#EAEAEA',
- },
- danger: {
- danger: '#D91E18',
- dangerHover: '#E5231D',
- dangerBadge: '#FB6540',
- },
- support: {
- success: '#00AA55',
- error: '#D91E18',
- info: '#676BC6',
- warning: '#FFA600',
- },
- success: {
- main: '#00aa55',
- },
- icon: {
- icon01: '#939393',
- icon02: '#B6B6B6',
- icon03: '#333333',
- },
- border: {
- border01: '#DCDCDC',
- border02: '#B6B6B6',
- border03: '#989898',
- border04: '#0F71CB',
- },
- chip: {
- release: '#0D61AE',
- active: '#88982D',
- inactive: '#D91E18',
- created: '#8f8013',
- inReview: '#8f8013',
- default: '#888888',
- bgRelease: '#EAF1FE',
- bgActive: '#F0F5D5',
- bgInactive: '#FFF7FF',
- bgCreated: '#f5efd5',
- bgInReview: '#f5efd5',
- bgDefault: '#c7c5c5',
- },
- stepper: {
- stepDone: '#B3CB2D',
- stepCurrent: '#FFA600',
- stepUpcoming: '#EAEAEA',
- },
- background: {
- background01: '#F9F9F9',
- background02: '#F3F3F3',
- background03: '#E9E9E9',
- background04: '#F4FBFD',
- background05: '#F5F9EE',
- background06: '#FFF7EC',
- background07: '#F5F5F5',
- background08: '#FFF6FF',
- background09: '#EDF0F4',
- background10: '#303030F2',
- background11: '#EDEFF2',
- background12: '#8E8E8E1A',
- background13: '#DFE4EA',
- background14: '#303030',
- },
- textField: {
- placeholderText: '#8D8D8D',
- helperText: '#717171',
- background: '#F7F7F7',
- backgroundHover: '#ECECEC',
- },
- text: {
- primary: '#111111',
- secondary: '#252525',
- tertiary: '#888888',
- quaternary: '#A2A2A2',
- },
- accent: {
- accent01: '#4D73D5',
- accent02: '#F2F3FB',
- accent03: '#676BC6',
- accent04: '#E1F1FF',
- accent05: '#FFEBCC',
- accent06: '#5E3416',
- accent07: '#88982D',
- accent08: '#F0F5D5',
- accent09: '#FDB943',
- accent10: '#428C5B',
- accent11: '#337B89',
- accent12: '#2B4078',
- },
- selected: {
- hover: 'rgba(15, 113, 203, 0.05)',
- focus: 'rgba(15, 113, 203, 0.15)',
- active: 'rgba(15, 113, 203, 0.2)',
- },
- pending: {
- main: '#FFECBD',
- contrastText: '#975B27',
- },
- confirmed: {
- main: '#E2F6C7',
- contrastText: '#5C8D45',
- },
- declined: {
- main: '#FEE7E2',
- contrastText: '#FF532F',
- },
- label: {
- main: '#F2F3FB',
- contrastText: '#676BC6',
- },
- info: {
- main: '#F2F3FB',
- contrastText: '#676BC6',
- },
- warning: {
- main: '#ffa602',
- contrastText: '#ffff',
- },
- buttons: {
- darkGrey: '#e1e1e1',
- lightGrey: '#f3f3f3',
- white: '#f9f9f9',
- yellow: '#f5f9ee',
- },
-})
-
-const typography = createTypography(palette, {
- fontFamily: getFontFamily('LibreFranklin'),
- htmlFontSize: 16,
- allVariants: {
- color: palette.text.primary,
- },
- h1: {
- fontFamily: getFontFamily('LibreFranklin-Medium'),
- fontSize: 56,
- lineHeight: 68 / 56,
- letterSpacing: 0,
- },
- h2: {
- fontFamily: getFontFamily('LibreFranklin-Medium'),
- fontSize: 36,
- lineHeight: 44 / 36,
- letterSpacing: 0,
- },
- h3: {
- fontFamily: getFontFamily('LibreFranklin-SemiBold'),
- fontSize: 24,
- lineHeight: 36 / 24,
- letterSpacing: 0,
- },
- h4: {
- fontFamily: getFontFamily('LibreFranklin-SemiBold'),
- fontSize: 18,
- lineHeight: 28 / 18,
- letterSpacing: 0,
- },
- h5: {
- fontFamily: getFontFamily('LibreFranklin-SemiBold'),
- fontSize: 16,
- lineHeight: 24 / 16,
- letterSpacing: 0,
- },
- body1: {
- fontFamily: getFontFamily('LibreFranklin-Light'),
- fontSize: 18,
- lineHeight: 28 / 18,
- letterSpacing: 0,
- },
- body2: {
- fontFamily: getFontFamily('LibreFranklin-Light'),
- fontSize: 16,
- lineHeight: 24 / 16,
- letterSpacing: 0,
- },
- body3: {
- fontFamily: getFontFamily('LibreFranklin-Light'),
- fontSize: 14,
- lineHeight: 20 / 14,
- letterSpacing: 0,
- },
- label1: {
- fontFamily: getFontFamily('LibreFranklin-Medium'),
- fontSize: 18,
- lineHeight: 28 / 18,
- letterSpacing: 0,
- },
- label2: {
- fontFamily: getFontFamily('LibreFranklin-Medium'),
- fontSize: 16,
- lineHeight: 24 / 16,
- letterSpacing: 0,
- },
- label3: {
- fontFamily: getFontFamily('LibreFranklin-Medium'),
- fontSize: 14,
- lineHeight: 20 / 14,
- letterSpacing: 0,
- },
- label4: {
- fontFamily: getFontFamily('LibreFranklin-Medium'),
- fontSize: 12,
- lineHeight: 16 / 12,
- letterSpacing: 0,
- },
- label5: {
- fontFamily: getFontFamily('LibreFranklin-SemiBold'),
- fontSize: 11,
- lineHeight: 16 / 11,
- letterSpacing: 0,
- color: palette.text.secondary,
- },
- caption1: {
- fontFamily: getFontFamily('LibreFranklin'),
- fontSize: 18,
- lineHeight: 28 / 18,
- letterSpacing: 0,
- color: palette.text.tertiary,
- },
- caption2: {
- fontFamily: getFontFamily('LibreFranklin'),
- fontSize: 16,
- lineHeight: 24 / 16,
- letterSpacing: 0,
- color: palette.text.tertiary,
- },
- caption3: {
- fontFamily: getFontFamily('LibreFranklin'),
- fontSize: 14,
- lineHeight: 20 / 14,
- letterSpacing: 0,
- color: palette.text.tertiary,
- },
- helper: {
- fontFamily: getFontFamily('LibreFranklin'),
- fontSize: 12,
- lineHeight: 16 / 12,
- letterSpacing: 0,
- color: palette.text.tertiary,
- },
- button: {
- fontSize: 16,
- lineHeight: 24 / 16,
- textTransform: 'none',
- },
-})
-
-export const theme = createTheme({
- breakpoints: {
- values: breakpoints,
- },
- palette,
- typography,
- shape: {
- borderRadius: 4,
- },
- components: {
- MuiButtonBase: {
- defaultProps: {
- disableRipple: true,
- },
- styleOverrides: {
- root: {
- ':focus': {
- boxShadow: `0px 0px 0px 3px ${palette.primary.shadow}`,
- },
- ':active': {
- boxShadow: `0px 0px 0px 3px ${palette.primary.shadow}`,
- },
- },
- },
- },
- MuiButton: {
- styleOverrides: {
- root: {
- borderRadius: 50,
- boxShadow: 'none',
- fontSize: typography.body1.fontSize,
- padding: '16px 28px',
- ':hover': {
- boxShadow: 'none',
- },
- ':active, :focus': {
- boxShadow: `0px 0px 0px 3px ${palette.primary.shadow}`,
- },
- },
- sizeMedium: {
- padding: '14px 24px',
- },
- sizeSmall: {
- fontSize: typography.body3.fontSize,
- padding: '10px 18px',
- },
- outlined: {
- borderColor: palette.primary.main,
- borderWidth: 2,
- padding: '14px 26px',
- ':hover': {
- color: palette.primary.dark,
- borderColor: palette.primary.dark,
- borderWidth: 2,
- backgroundColor: 'transparent',
- },
- ':disabled': {
- borderColor: palette.action.disabled,
- borderWidth: 2,
- },
- },
- outlinedSizeMedium: {
- padding: '12px 22px',
- },
- outlinedSizeSmall: {
- padding: '8px 16px',
- },
- text: {
- ':hover': {
- backgroundColor: palette.secondary.dark,
- },
- },
- },
- variants: [
- {
- props: {
- color: 'secondary',
- },
- style: {
- ':hover': {
- color: palette.primary.dark,
- },
- },
- },
- ],
- },
- MuiIconButton: {
- styleOverrides: {
- root: {
- color: palette.primary.main,
- padding: 6,
- ':hover': {
- backgroundColor: palette.secondary.dark,
- color: palette.primary.dark,
- },
- },
- },
- variants: [
- {
- props: {
- color: 'primary',
- },
- style: {
- backgroundColor: palette.primary.main,
- color: palette.common.white,
- ':hover': {
- backgroundColor: palette.primary.dark,
- color: palette.common.white,
- },
- },
- },
- {
- props: {
- color: 'secondary',
- },
- style: {
- backgroundColor: palette.secondary.main,
- },
- },
- {
- props: {
- size: 'small',
- },
- style: {
- padding: 2,
- },
- },
- ],
- },
- MuiOutlinedInput: {
- styleOverrides: {
- root: {
- borderRadius: 16,
- backgroundColor: palette.background.background01,
- padding: '4px 24px',
- '.MuiOutlinedInput-notchedOutline': {
- borderColor: palette.border.border01,
- },
- ':hover': {
- '.MuiOutlinedInput-notchedOutline': {
- borderColor: palette.primary.shadow,
- },
- },
- '&.Mui-focused': {
- '.MuiOutlinedInput-notchedOutline': {
- borderColor: palette.primary.shadow,
- },
- },
- },
- },
- },
- MuiFilledInput: {
- styleOverrides: {
- root: {
- backgroundColor: palette.textField.background,
- borderRadius: '6px 6px 0 0',
- fontSize: typography.body2.fontSize,
- '.MuiFilledInput-input': {
- padding: '16px',
- },
- '&.Mui-focused': {
- backgroundColor: palette.textField.backgroundHover,
- },
- '&.Mui-disabled': {
- backgroundColor: palette.textField.background,
- },
- },
- },
- },
- MuiInputLabel: {
- styleOverrides: {
- root: {
- fontFamily: typography.label3.fontFamily,
- fontSize: typography.label3.fontSize,
- },
- },
- variants: [
- {
- props: {
- variant: 'filled',
- },
- style: {
- transform: 'none',
- position: 'relative',
- },
- },
- ],
- },
- MuiBadge: {
- styleOverrides: {
- root: {
- color: palette.common.white,
- },
- },
- },
- MuiDataGrid: {
- styleOverrides: {
- root: {
- border: `1px solid ${palette.border.border01}`,
- borderRadius: 24,
- overflow: 'hidden',
- },
- columnHeaders: {
- fontFamily: getFontFamily('LibreFranklin-SemiBold'),
- backgroundColor: palette.background.background03,
- },
- columnHeader: {
- padding: '0 32px',
- },
- columnSeparator: {
- display: 'none',
- },
- row: {
- '&.MuiDataGrid-row--lastVisible .MuiDataGrid-cell': {
- borderColor: palette.border.border01,
- },
- },
- cell: {
- padding: '16px 32px',
- borderColor: palette.border.border01,
- },
- columnHeaderCheckbox: {
- width: '64px !important',
- minWidth: '64px !important',
- maxWidth: '64px !important',
- paddingLeft: '10px !important',
- paddingRight: '10px !important',
- height: '76px !important',
- },
- },
- },
- MuiChip: {
- styleOverrides: {
- root: {
- borderRadius: 6,
- },
- },
- variants: [
- {
- props: {
- color: 'pending',
- },
- style: {
- backgroundColor: palette.pending.main,
- color: palette.pending.contrastText,
- },
- },
- {
- props: {
- color: 'confirmed',
- },
- style: {
- backgroundColor: palette.confirmed.main,
- color: palette.confirmed.contrastText,
- },
- },
- {
- props: {
- color: 'declined',
- },
- style: {
- backgroundColor: palette.declined.main,
- color: palette.declined.contrastText,
- },
- },
- {
- props: {
- color: 'info',
- },
- style: {
- backgroundColor: palette.info.main,
- color: palette.info.contrastText,
- },
- },
- {
- props: {
- color: 'label',
- },
- style: {
- backgroundColor: palette.label.main,
- color: palette.label.contrastText,
- },
- },
- ],
- },
- MuiLink: {
- styleOverrides: {
- root: {
- fontFamily: typography.body1.fontFamily,
- textDecoration: 'none',
- ':hover': {
- color: palette.primary.dark,
- },
- },
- },
- },
- MuiList: {
- styleOverrides: {
- root: {
- fontFamily: typography.label3.fontFamily,
- fontSize: typography.label3.fontSize,
- },
- },
- },
- MuiDialog: {
- styleOverrides: {
- paper: {
- borderRadius: 40,
- },
- },
- },
- MuiDialogTitle: {
- styleOverrides: {
- root: {
- fontFamily: typography.h4.fontFamily,
- fontSize: typography.h4.fontSize,
- padding: 0,
- },
- },
- },
- MuiDialogActions: {
- styleOverrides: {
- root: {
- padding: 0,
- justifyContent: 'center',
- '& .MuiButton-root:not(:first-of-type)': {
- marginLeft: 24,
- },
- },
- },
- },
- MuiTab: {
- styleOverrides: {
- root: {
- justifyContent: 'start',
- color: 'text.primary',
- '&:active, &:focus': {
- boxShadow: 'none',
- },
- },
- },
- },
- MuiFormControlLabel: {
- styleOverrides: {
- root: {
- '.MuiFormControlLabel-label': {
- fontFamily: typography.label2.fontFamily,
- fontSize: typography.label2.fontSize,
- },
- },
- },
- },
- MuiCircularProgress: {
- styleOverrides: {
- circle: {
- strokeLinecap: 'butt',
- },
- },
- },
- MuiPaper: {
- styleOverrides: {
- root: {
- borderRadius: '6px',
- '.MuiCalendarPicker-viewTransitionContainer': {
- borderTop: `1px solid ${palette.border.border01}`,
- '.MuiTypography-root': {
- fontWeight: 'bold',
- fontSize: '14px',
- },
- },
- '.MuiIconButton-root': {
- color: '#939393',
- },
- '.PrivatePickersFadeTransitionGroup-root': {
- fontWeight: 'bold',
- fontSize: '16px',
- },
- '.MuiFilledInput-root': {
- paddingTop: '0px !important',
- minHeight: '55px',
- },
- },
- },
- },
- MuiTabs: {
- styleOverrides: {
- root: {
- paddingTop: '50px',
- minWidth: 'fit-content',
- '.MuiTab-textColorPrimary': {
- minHeight: '50px',
- alignItems: 'flex-start',
- color: palette.text.tertiary,
- paddingRight: '50px',
- },
- '.MuiTabs-indicator': {
- backgroundColor: palette.common.white,
- },
- },
- },
- },
- },
-})
diff --git a/cx-portal-shared-components/tsconfig.build.json b/cx-portal-shared-components/tsconfig.build.json
deleted file mode 100644
index c58be2fb4..000000000
--- a/cx-portal-shared-components/tsconfig.build.json
+++ /dev/null
@@ -1,35 +0,0 @@
-{
- "compilerOptions": {
- "target": "es2021",
- "lib": ["dom", "dom.iterable", "esnext"],
- "allowJs": true,
- "skipLibCheck": true,
- "esModuleInterop": true,
- "allowSyntheticDefaultImports": true,
- "strict": true,
- "forceConsistentCasingInFileNames": true,
- "noFallthroughCasesInSwitch": true,
- "module": "esnext",
- "moduleResolution": "node",
- "resolveJsonModule": true,
- "isolatedModules": true,
- "jsx": "react-jsx",
- "typeRoots": ["node_modules/@types", "src/@types"],
- "baseUrl": "src",
- "sourceMap": true,
- "outDir": "dist",
- "declaration": true,
- "declarationDir": "types",
- "emitDeclarationOnly": true,
- "types": ["node", "jest"]
- },
- "include": ["src"],
- "exclude": [
- "node_modules",
- "build",
- "dist",
- "storybook-static",
- "src/**/*.stories.tsx",
- "src/**/*.test.tsx"
- ]
-}
diff --git a/cx-portal/.nvmrc b/cx-portal/.nvmrc
deleted file mode 100644
index 4ec320b21..000000000
--- a/cx-portal/.nvmrc
+++ /dev/null
@@ -1 +0,0 @@
-v14.17.6
diff --git a/cx-portal/.storybook/main.js b/cx-portal/.storybook/main.js
deleted file mode 100644
index f4326d16c..000000000
--- a/cx-portal/.storybook/main.js
+++ /dev/null
@@ -1,36 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-module.exports = {
- stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
- addons: [
- '@storybook/addon-links',
- '@storybook/addon-essentials',
- '@storybook/addon-interactions',
- '@storybook/preset-create-react-app',
- ],
- framework: '@storybook/react',
- core: {
- builder: 'webpack5',
- },
- features: {
- emotionAlias: false,
- },
-}
diff --git a/cx-portal/.storybook/preview.js b/cx-portal/.storybook/preview.js
deleted file mode 100644
index 3f22fbf8f..000000000
--- a/cx-portal/.storybook/preview.js
+++ /dev/null
@@ -1,42 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { SharedThemeProvider } from 'cx-portal-shared-components'
-import React from 'react'
-import { GlobalStyle } from '../src/components/Global'
-
-export const decorators = [
- (Story) => (
-
-
-
-
- ),
-]
-
-export const parameters = {
- actions: { argTypesRegex: '^on[A-Z].*' },
- controls: {
- matchers: {
- color: /(background|color)$/i,
- date: /Date$/,
- },
- },
-}
diff --git a/cx-portal/README.md b/cx-portal/README.md
deleted file mode 100644
index a05943874..000000000
--- a/cx-portal/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Catena-X Portal
-
-Frontend web application for Catena-X. Check README.md on repository root to build.
-
-steps
-
- yarn start
diff --git a/cx-portal/package.json b/cx-portal/package.json
deleted file mode 100644
index cb259e052..000000000
--- a/cx-portal/package.json
+++ /dev/null
@@ -1,110 +0,0 @@
-{
- "name": "cx-portal",
- "version": "1.5.0",
- "license": "Apache-2.0",
- "scripts": {
- "start": "react-scripts start",
- "start:portal": "PORT=3001 BROWSER=none react-scripts start",
- "build:portal": "react-scripts build",
- "test": "react-scripts test",
- "test:watch": "react-scripts test --watch",
- "test:ci": "CI=true react-scripts test --watchAll=false --runInBand",
- "eject": "react-scripts eject",
- "clean": "rimraf ./build ./dist ./storybook-static ./public/_storybook",
- "start:storybook": "start-storybook -p 6006 -s public",
- "build:storybook": "build-storybook -s public",
- "build:dist": "yarn run build && mkdirp dist && cd build && 7z u ../dist/build.zip .",
- "deploy": "export CX_ENV=${CX_ENV:-dev003} && az webapp deployment source config-zip --resource-group catenax-${CX_ENV}-rg --name catenax-${CX_ENV}-app-portal-2 --src ./dist/build.zip"
- },
- "dependencies": {
- "@hookform/error-message": "^2.0.1",
- "@mui/icons-material": "^5.5.1",
- "@react-hook/cache": "^1.1.1",
- "@reduxjs/toolkit": "^1.7.2",
- "@types/node": "^12.20.46",
- "@types/react": "^16.14.23",
- "@types/react-dom": "^16.9.14",
- "@types/react-redux": "^7.1.22",
- "axios": "^0.26.0",
- "cross-env": "5.0.5",
- "cx-portal-shared-components": "1.5.0",
- "dayjs": "^1.11.4",
- "i18next": "^21.6.12",
- "i18next-browser-languagedetector": "^6.1.3",
- "keycloak-js": "^17.0.0",
- "lodash.debounce": "^4.0.8",
- "lodash.uniq": "^4.5.0",
- "nanoid": "^4.0.0",
- "qs": "^6.10.3",
- "react": "^17.0.2",
- "react-dom": "^17.0.2",
- "react-dropzone": "^14.2.2",
- "react-hook-form": "^7.39.1",
- "react-i18next": "^11.15.5",
- "react-player": "^2.12.0",
- "react-redux": "^7.2.6",
- "react-router-dom": "^6.2.1",
- "sass": "^1.49.9"
- },
- "devDependencies": {
- "@babel/plugin-proposal-private-property-in-object": "^7.16.7",
- "@storybook/addon-actions": "^6.4.19",
- "@storybook/addon-essentials": "^6.4.19",
- "@storybook/addon-interactions": "^6.4.19",
- "@storybook/addon-links": "^6.4.19",
- "@storybook/builder-webpack5": "^6.4.19",
- "@storybook/manager-webpack5": "^6.4.19",
- "@storybook/node-logger": "^6.4.19",
- "@storybook/preset-create-react-app": "^4.0.1",
- "@storybook/react": "^6.4.19",
- "@storybook/testing-library": "^0.0.9",
- "@testing-library/jest-dom": "^5.16.3",
- "@testing-library/react": "12.1.2",
- "@testing-library/user-event": "^14.0.4",
- "@types/jest": "^24.9.1",
- "@types/lodash.debounce": "^4.0.6",
- "@types/lodash.uniq": "^4.5.7",
- "@typescript-eslint/eslint-plugin": "^5.13.0",
- "@typescript-eslint/parser": "^5.13.0",
- "eslint": "^8.10.0",
- "eslint-config-prettier": "^8.4.0",
- "eslint-plugin-prettier": "^4.0.0",
- "eslint-plugin-react": "^7.29.2",
- "prettier": "^2.5.1",
- "react-scripts": "5.0.1",
- "styled-components": "^5.3.3",
- "typescript": "^4.1.6",
- "webpack": "^5.69.1",
- "webpack-cli": "^4.9.2"
- },
- "eslintConfig": {
- "extends": "react-app",
- "overrides": [
- {
- "files": [
- "**/*.stories.*"
- ],
- "rules": {
- "import/no-anonymous-default-export": "off"
- }
- }
- ]
- },
- "browserslist": {
- "production": [
- ">0.2%",
- "not dead",
- "not op_mini all"
- ],
- "development": [
- "last 1 chrome version",
- "last 1 firefox version",
- "last 1 safari version"
- ]
- },
- "jest": {
- "transformIgnorePatterns": [
- "node_modules/(?!cx-portal-shared-components)/"
- ]
- }
-}
diff --git a/cx-portal/public/cx-logo-text.svg.license b/cx-portal/public/cx-logo-text.svg.license
deleted file mode 100644
index d19d7f534..000000000
--- a/cx-portal/public/cx-logo-text.svg.license
+++ /dev/null
@@ -1,3 +0,0 @@
-Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
-
-SPDX-License-Identifier: CC-BY-4.0
\ No newline at end of file
diff --git a/cx-portal/public/cx-logo.svg.license b/cx-portal/public/cx-logo.svg.license
deleted file mode 100644
index d19d7f534..000000000
--- a/cx-portal/public/cx-logo.svg.license
+++ /dev/null
@@ -1,3 +0,0 @@
-Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
-
-SPDX-License-Identifier: CC-BY-4.0
\ No newline at end of file
diff --git a/cx-portal/src/assets/fonts/LibreFranklin-Italic-VariableFont_wght.ttf b/cx-portal/src/assets/fonts/LibreFranklin-Italic-VariableFont_wght.ttf
deleted file mode 100644
index 9058abc37..000000000
Binary files a/cx-portal/src/assets/fonts/LibreFranklin-Italic-VariableFont_wght.ttf and /dev/null differ
diff --git a/cx-portal/src/assets/fonts/LibreFranklin-VariableFont_wght.ttf b/cx-portal/src/assets/fonts/LibreFranklin-VariableFont_wght.ttf
deleted file mode 100644
index c1d1e31c5..000000000
Binary files a/cx-portal/src/assets/fonts/LibreFranklin-VariableFont_wght.ttf and /dev/null differ
diff --git a/cx-portal/src/assets/fonts/static/LibreFranklin-Black.ttf b/cx-portal/src/assets/fonts/static/LibreFranklin-Black.ttf
deleted file mode 100644
index ee1f7a30b..000000000
Binary files a/cx-portal/src/assets/fonts/static/LibreFranklin-Black.ttf and /dev/null differ
diff --git a/cx-portal/src/assets/fonts/static/LibreFranklin-BlackItalic.ttf b/cx-portal/src/assets/fonts/static/LibreFranklin-BlackItalic.ttf
deleted file mode 100644
index 86c715873..000000000
Binary files a/cx-portal/src/assets/fonts/static/LibreFranklin-BlackItalic.ttf and /dev/null differ
diff --git a/cx-portal/src/assets/fonts/static/LibreFranklin-Bold.ttf b/cx-portal/src/assets/fonts/static/LibreFranklin-Bold.ttf
deleted file mode 100644
index 453d1f84c..000000000
Binary files a/cx-portal/src/assets/fonts/static/LibreFranklin-Bold.ttf and /dev/null differ
diff --git a/cx-portal/src/assets/fonts/static/LibreFranklin-BoldItalic.ttf b/cx-portal/src/assets/fonts/static/LibreFranklin-BoldItalic.ttf
deleted file mode 100644
index c4ff4a310..000000000
Binary files a/cx-portal/src/assets/fonts/static/LibreFranklin-BoldItalic.ttf and /dev/null differ
diff --git a/cx-portal/src/assets/fonts/static/LibreFranklin-ExtraBold.ttf b/cx-portal/src/assets/fonts/static/LibreFranklin-ExtraBold.ttf
deleted file mode 100644
index db56f2be7..000000000
Binary files a/cx-portal/src/assets/fonts/static/LibreFranklin-ExtraBold.ttf and /dev/null differ
diff --git a/cx-portal/src/assets/fonts/static/LibreFranklin-ExtraBoldItalic.ttf b/cx-portal/src/assets/fonts/static/LibreFranklin-ExtraBoldItalic.ttf
deleted file mode 100644
index fa36881d2..000000000
Binary files a/cx-portal/src/assets/fonts/static/LibreFranklin-ExtraBoldItalic.ttf and /dev/null differ
diff --git a/cx-portal/src/assets/fonts/static/LibreFranklin-ExtraLight.ttf b/cx-portal/src/assets/fonts/static/LibreFranklin-ExtraLight.ttf
deleted file mode 100644
index 19cad5919..000000000
Binary files a/cx-portal/src/assets/fonts/static/LibreFranklin-ExtraLight.ttf and /dev/null differ
diff --git a/cx-portal/src/assets/fonts/static/LibreFranklin-ExtraLightItalic.ttf b/cx-portal/src/assets/fonts/static/LibreFranklin-ExtraLightItalic.ttf
deleted file mode 100644
index 828ddda42..000000000
Binary files a/cx-portal/src/assets/fonts/static/LibreFranklin-ExtraLightItalic.ttf and /dev/null differ
diff --git a/cx-portal/src/assets/fonts/static/LibreFranklin-Italic.ttf b/cx-portal/src/assets/fonts/static/LibreFranklin-Italic.ttf
deleted file mode 100644
index 630e4fd07..000000000
Binary files a/cx-portal/src/assets/fonts/static/LibreFranklin-Italic.ttf and /dev/null differ
diff --git a/cx-portal/src/assets/fonts/static/LibreFranklin-Light.ttf b/cx-portal/src/assets/fonts/static/LibreFranklin-Light.ttf
deleted file mode 100644
index efb6cea9a..000000000
Binary files a/cx-portal/src/assets/fonts/static/LibreFranklin-Light.ttf and /dev/null differ
diff --git a/cx-portal/src/assets/fonts/static/LibreFranklin-LightItalic.ttf b/cx-portal/src/assets/fonts/static/LibreFranklin-LightItalic.ttf
deleted file mode 100644
index cd0d852d8..000000000
Binary files a/cx-portal/src/assets/fonts/static/LibreFranklin-LightItalic.ttf and /dev/null differ
diff --git a/cx-portal/src/assets/fonts/static/LibreFranklin-Medium.ttf b/cx-portal/src/assets/fonts/static/LibreFranklin-Medium.ttf
deleted file mode 100644
index 86ff32db7..000000000
Binary files a/cx-portal/src/assets/fonts/static/LibreFranklin-Medium.ttf and /dev/null differ
diff --git a/cx-portal/src/assets/fonts/static/LibreFranklin-MediumItalic.ttf b/cx-portal/src/assets/fonts/static/LibreFranklin-MediumItalic.ttf
deleted file mode 100644
index 401d44f30..000000000
Binary files a/cx-portal/src/assets/fonts/static/LibreFranklin-MediumItalic.ttf and /dev/null differ
diff --git a/cx-portal/src/assets/fonts/static/LibreFranklin-Regular.ttf b/cx-portal/src/assets/fonts/static/LibreFranklin-Regular.ttf
deleted file mode 100644
index 0eca7b61e..000000000
Binary files a/cx-portal/src/assets/fonts/static/LibreFranklin-Regular.ttf and /dev/null differ
diff --git a/cx-portal/src/assets/fonts/static/LibreFranklin-SemiBold.ttf b/cx-portal/src/assets/fonts/static/LibreFranklin-SemiBold.ttf
deleted file mode 100644
index eb98baad3..000000000
Binary files a/cx-portal/src/assets/fonts/static/LibreFranklin-SemiBold.ttf and /dev/null differ
diff --git a/cx-portal/src/assets/fonts/static/LibreFranklin-SemiBoldItalic.ttf b/cx-portal/src/assets/fonts/static/LibreFranklin-SemiBoldItalic.ttf
deleted file mode 100644
index ceaaf053e..000000000
Binary files a/cx-portal/src/assets/fonts/static/LibreFranklin-SemiBoldItalic.ttf and /dev/null differ
diff --git a/cx-portal/src/assets/fonts/static/LibreFranklin-Thin.ttf b/cx-portal/src/assets/fonts/static/LibreFranklin-Thin.ttf
deleted file mode 100644
index 55beb2eba..000000000
Binary files a/cx-portal/src/assets/fonts/static/LibreFranklin-Thin.ttf and /dev/null differ
diff --git a/cx-portal/src/assets/fonts/static/LibreFranklin-ThinItalic.ttf b/cx-portal/src/assets/fonts/static/LibreFranklin-ThinItalic.ttf
deleted file mode 100644
index d165efaea..000000000
Binary files a/cx-portal/src/assets/fonts/static/LibreFranklin-ThinItalic.ttf and /dev/null differ
diff --git a/cx-portal/src/assets/logo/cx-logo-short.svg b/cx-portal/src/assets/logo/cx-logo-short.svg
deleted file mode 100644
index f99bac665..000000000
--- a/cx-portal/src/assets/logo/cx-logo-short.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/cx-portal/src/assets/logo/cx-logo-short.svg.license b/cx-portal/src/assets/logo/cx-logo-short.svg.license
deleted file mode 100644
index d19d7f534..000000000
--- a/cx-portal/src/assets/logo/cx-logo-short.svg.license
+++ /dev/null
@@ -1,3 +0,0 @@
-Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
-
-SPDX-License-Identifier: CC-BY-4.0
\ No newline at end of file
diff --git a/cx-portal/src/assets/notice/legal-notice.json b/cx-portal/src/assets/notice/legal-notice.json
deleted file mode 100644
index bb0a3ead8..000000000
--- a/cx-portal/src/assets/notice/legal-notice.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "name": "NAME_PLACEHOLDER",
- "repositoryPath": "SERVER_URL_PLACEHOLDER/REPOSITORY_PLACEHOLDER",
- "license": "LICENSE_PLACEHOLDER",
- "licensePath": "SERVER_URL_PLACEHOLDER/REPOSITORY_PLACEHOLDER/blob/REF_PLACEHOLDER/LICENSE",
- "noticePath": "SERVER_URL_PLACEHOLDER/REPOSITORY_PLACEHOLDER/blob/REF_PLACEHOLDER/NOTICE.md",
- "sourcePath": "SERVER_URL_PLACEHOLDER/REPOSITORY_PLACEHOLDER/tree/REF_PLACEHOLDER",
- "commitId": "COMMIT_ID_PLACEHOLDER"
-}
diff --git a/cx-portal/src/components/pages/Admin/components/ProvisionIdentityProviderForm/ProvisionIdentityProviderForm.scss b/cx-portal/src/components/pages/Admin/components/ProvisionIdentityProviderForm/ProvisionIdentityProviderForm.scss
deleted file mode 100644
index 9afee0ee8..000000000
--- a/cx-portal/src/components/pages/Admin/components/ProvisionIdentityProviderForm/ProvisionIdentityProviderForm.scss
+++ /dev/null
@@ -1,108 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-.ProvisionIdentityProviderForm,
-.ProvisionIdentityProviderFormOverlay {
- background-color: white;
- width: 440px;
- height: 540px;
- padding: 40px;
- font-size: 12px;
- line-height: 26px;
- text-align: center;
- position: absolute;
- left: 50%;
- top: 46%;
- transform: translate(-50%) translateY(-30%);
- border: 0px solid gray;
- box-shadow: 0 0 1em gray;
- display: flex;
- flex-direction: column;
- justify-content: space-between;
-}
-
-.ProvisionIdentityProviderForm {
- z-index: 2;
-}
-
-.ProvisionIdentityProviderForm > * {
- margin: 8px 0;
-}
-
-.ProvisionIdentityProviderForm > h4 {
- margin-bottom: 12px;
-}
-
-.ProvisionIdentityProviderForm > button {
- margin-top: 12px;
-}
-
-.ProvisionIdentityProviderFormOverlay {
- opacity: 0.95;
- font-size: 32px;
- line-height: 42px;
-}
-
-.ProvisionIdentityProviderForm > .input {
- visibility: hidden;
-}
-
-.busy,
-.success,
-.failure {
- z-index: 3;
-}
-
-.failure {
- color: red;
-}
-
-.success {
- color: green;
-}
-
-.loader {
- position: absolute;
- left: 50%;
- top: 50%;
- transform: translate(-50%) translateY(-50%);
- display: inline-block;
- width: 120px;
- height: 120px;
- border: 24px solid #b3cb2d;
-}
-.loader:after {
- content: ' ';
- display: block;
- width: 72px;
- height: 72px;
- margin: 0;
- border-radius: 0;
- border: 24px solid #ffa600;
- animation: loader 3s linear infinite;
-}
-@keyframes loader {
- 0% {
- transform: rotate(0deg);
- }
- 100% {
- transform: rotate(360deg);
- }
-}
diff --git a/cx-portal/src/components/pages/Admin/components/ProvisionIdentityProviderForm/ProvisionIdentityProviderForm.stories.tsx b/cx-portal/src/components/pages/Admin/components/ProvisionIdentityProviderForm/ProvisionIdentityProviderForm.stories.tsx
deleted file mode 100644
index 91bbec2a2..000000000
--- a/cx-portal/src/components/pages/Admin/components/ProvisionIdentityProviderForm/ProvisionIdentityProviderForm.stories.tsx
+++ /dev/null
@@ -1,45 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { ComponentStory, ComponentMeta } from '@storybook/react'
-import { ProvisionIdentityProviderForm } from '.'
-import { MemoryRouter } from 'react-router-dom'
-
-export default {
- title: 'frame/ProvisionIdentityProviderForm',
- component: ProvisionIdentityProviderForm,
- parameters: {
- layout: 'fullscreen',
- },
- decorators: [
- (Story) => (
-
-
-
- ),
- ],
- styles: ['./components/App.css'],
-} as ComponentMeta
-
-const Template: ComponentStory = (
- args
-) =>
-
-export const Standard = Template.bind({})
diff --git a/cx-portal/src/components/pages/Admin/components/ProvisionIdentityProviderForm/index.tsx b/cx-portal/src/components/pages/Admin/components/ProvisionIdentityProviderForm/index.tsx
deleted file mode 100644
index 62c99b8bd..000000000
--- a/cx-portal/src/components/pages/Admin/components/ProvisionIdentityProviderForm/index.tsx
+++ /dev/null
@@ -1,120 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { Button, Input, Typography } from 'cx-portal-shared-components'
-import debounce from 'lodash.debounce'
-import { useCallback, useMemo, useState } from 'react'
-import { useTranslation } from 'react-i18next'
-import { ProvisionIdentityProviderData } from 'features/provisioning/types'
-import './ProvisionIdentityProviderForm.scss'
-
-export const ProvisionIdentityProviderForm = ({
- state,
- onSubmit,
-}: {
- state: string
- onSubmit: (data: ProvisionIdentityProviderData) => void
-}) => {
- const { t } = useTranslation()
- const [inpExpr, setInpExpr] = useState(['', '', '', '', ''])
- const [inpValid, setInpValid] = useState([
- false,
- false,
- false,
- false,
- false,
- true,
- ])
-
- const debouncedValidation = useMemo(
- () =>
- debounce((expr: string[]) => {
- const check = [
- /^.{2,60}$/,
- /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/,
- /^.{2,60}$/,
- /^.{2,60}$/,
- /^[a-z_]{4,20}$/,
- ].map((p, i) => !p.test(expr[i]))
- check.push(
- check.reduce((all, valid) => all || valid),
- false
- )
- setInpValid(check)
- }, 300),
- [setInpValid]
- )
-
- const doValidate = useCallback(
- (index: number, value: string) => {
- const data = inpExpr
- data[index] = value
- setInpExpr(data.slice())
- debouncedValidation(data)
- },
- [debouncedValidation, inpExpr]
- )
-
- const doSubmit = () =>
- onSubmit({
- organisationName: inpExpr[0].trim(),
- metadataUrl: inpExpr[1].trim(),
- clientId: inpExpr[2].trim(),
- clientSecret: inpExpr[3].trim(),
- clientAuthMethod: inpExpr[4].trim(),
- })
-
- return (
- <>
-
-
- >
- )
-}
diff --git a/cx-portal/src/components/pages/Admin/index.tsx b/cx-portal/src/components/pages/Admin/index.tsx
deleted file mode 100644
index b23e48140..000000000
--- a/cx-portal/src/components/pages/Admin/index.tsx
+++ /dev/null
@@ -1,57 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { ProvisionIdentityProviderForm } from 'components/pages/Admin/components/ProvisionIdentityProviderForm'
-import { useState } from 'react'
-import { info } from 'services/LogService'
-import { ProvisioningApi } from 'features/provisioning/api'
-import { ProvisionIdentityProviderData } from 'features/provisioning/types'
-import { SuccessErrorType } from 'features/admin/appuserApiSlice'
-
-export default function Admin() {
- const [processing, setProcessing] = useState('input')
-
- const doSubmit = (data: ProvisionIdentityProviderData) => {
- setProcessing('busy')
-
- new ProvisioningApi()
- .provisionIdp(data)
- .then(() => {
- setProcessing(SuccessErrorType.SUCCESS)
- info(`provisioning for company ${data.organisationName} started`)
- })
- .catch((error: unknown) => {
- setProcessing('failure')
- info(`provisioning for company ${data.organisationName} failed`)
- info(JSON.stringify(error))
- })
- .finally(() => {
- setTimeout(() => {
- setProcessing('input')
- }, 5000)
- })
- }
-
- return (
-
-
-
- )
-}
diff --git a/cx-portal/src/components/pages/AppOverview/components/AppConsent.tsx b/cx-portal/src/components/pages/AppOverview/components/AppConsent.tsx
deleted file mode 100644
index 5a7a06a04..000000000
--- a/cx-portal/src/components/pages/AppOverview/components/AppConsent.tsx
+++ /dev/null
@@ -1,57 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 Mercedes-Benz Group AG and BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { Typography } from 'cx-portal-shared-components'
-import CheckCircleIcon from '@mui/icons-material/CheckCircle'
-import ErrorIcon from '@mui/icons-material/Error'
-
-export default function AppConsent({ agreements }: { agreements: any }) {
- return (
- <>
- {agreements &&
- agreements.map((agreement: any) => {
- return (
-
- )
- })}
- >
- )
-}
diff --git a/cx-portal/src/components/pages/AppOverview/components/AppInfo.tsx b/cx-portal/src/components/pages/AppOverview/components/AppInfo.tsx
deleted file mode 100644
index e281f7d05..000000000
--- a/cx-portal/src/components/pages/AppOverview/components/AppInfo.tsx
+++ /dev/null
@@ -1,73 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 Mercedes-Benz Group AG and BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { useTranslation } from 'react-i18next'
-import { Typography } from 'cx-portal-shared-components'
-import AppProviderInfo from './AppProviderInfo'
-import AppDetailImageGallery from 'components/pages/AppDetail/components/AppDetailImageGallery'
-import { getAppImage } from 'features/apps/mapper'
-import { AppStatusDataState } from 'features/appManagement/types'
-
-export default function AppInfo({
- item,
- id,
-}: {
- item: AppStatusDataState
- id: string
-}) {
- const { t } = useTranslation()
- return (
-
- )
-}
diff --git a/cx-portal/src/components/pages/AppOverview/components/AppProviderInfo.tsx b/cx-portal/src/components/pages/AppOverview/components/AppProviderInfo.tsx
deleted file mode 100644
index 8df7118a4..000000000
--- a/cx-portal/src/components/pages/AppOverview/components/AppProviderInfo.tsx
+++ /dev/null
@@ -1,60 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 Mercedes-Benz Group AG and BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { useTranslation } from 'react-i18next'
-import { Typography, StaticTable, TableType } from 'cx-portal-shared-components'
-import { AppStatusDataState } from 'features/appManagement/types'
-
-export default function AppProviderInfo({
- item,
-}: {
- item: AppStatusDataState
-}) {
- const { t } = useTranslation('', {
- keyPrefix: 'content.appdetail.providerInformation',
- })
-
- const tableData: TableType = {
- head: [t('appProvider'), t('email'), t('phone')],
- body: [
- [item.provider || ''],
- [item.contactEmail],
- [item.contactNumber || ''],
- ],
- }
-
- return (
-
-
-
- {t('heading')}
-
-
- {t('message')}
-
-
- {item && }
-
- )
-}
diff --git a/cx-portal/src/components/pages/DataCatalog/index.tsx b/cx-portal/src/components/pages/DataCatalog/index.tsx
deleted file mode 100644
index d3fae8f61..000000000
--- a/cx-portal/src/components/pages/DataCatalog/index.tsx
+++ /dev/null
@@ -1,31 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { useTranslation } from 'react-i18next'
-
-export default function DataCatalog() {
- const { t } = useTranslation()
- return (
-
-
{t('pages.datacatalog')}
-
{t('content.datacatalog.message')}
-
- )
-}
diff --git a/cx-portal/src/components/pages/DeveloperHub/index.tsx b/cx-portal/src/components/pages/DeveloperHub/index.tsx
deleted file mode 100644
index 4a72110b4..000000000
--- a/cx-portal/src/components/pages/DeveloperHub/index.tsx
+++ /dev/null
@@ -1,31 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { useTranslation } from 'react-i18next'
-
-export default function DeveloperHub() {
- const { t } = useTranslation()
- return (
-
-
{t('pages.developerhub')}
-
{t('content.developerhub.message')}
-
- )
-}
diff --git a/cx-portal/src/components/pages/Home/components/StageSection/index.tsx b/cx-portal/src/components/pages/Home/components/StageSection/index.tsx
deleted file mode 100644
index 423352ab7..000000000
--- a/cx-portal/src/components/pages/Home/components/StageSection/index.tsx
+++ /dev/null
@@ -1,49 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { Button, MainHeader } from 'cx-portal-shared-components'
-import { useTranslation } from 'react-i18next'
-import PageService from 'services/PageService'
-import { label as BusinessApplications } from '../BusinessApplicationsSection'
-import { getAssetBase } from 'services/EnvironmentService'
-
-export default function SearchSection() {
- const { t } = useTranslation()
-
- return (
-
-
-
-
-
- )
-}
diff --git a/cx-portal/src/components/pages/Test/index.newdropzone.tsx b/cx-portal/src/components/pages/Test/index.newdropzone.tsx
deleted file mode 100644
index fd5062437..000000000
--- a/cx-portal/src/components/pages/Test/index.newdropzone.tsx
+++ /dev/null
@@ -1,104 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import Box from '@mui/material/Box'
-import { Dropzone, DropzoneFile } from 'components/shared/basic/Dropzone'
-import {
- Button,
- DropArea,
- UploadFileStatus,
- UploadStatus,
-} from 'cx-portal-shared-components'
-import React from 'react'
-import { Controller, useForm } from 'react-hook-form'
-
-export default function NewDropzoneTest() {
- const { handleSubmit, control, setValue, getValues } = useForm({
- defaultValues: {
- myUploadFiles: [],
- },
- mode: 'onChange',
- })
-
- const onSubmit = async (values: any) => {
- const { myUploadFiles } = values
-
- console.log('Uploading', myUploadFiles)
-
- const setFileStatus = (fileIndex: number, status: UploadFileStatus) => {
- const nextFiles = [...getValues().myUploadFiles] as any[]
- nextFiles[fileIndex] = {
- name: myUploadFiles[fileIndex].name,
- size: myUploadFiles[fileIndex].size,
- status,
- }
- setValue('myUploadFiles', nextFiles as any)
- }
-
- for (let fileIndex = 0; fileIndex < myUploadFiles.length; fileIndex++) {
- setFileStatus(fileIndex, UploadStatus.UPLOADING)
-
- try {
- await fetch('https://httpbin.org/post', { method: 'POST' })
- setFileStatus(fileIndex, UploadStatus.UPLOAD_SUCCESS)
- } catch (e) {
- // TODO: it should display an error notification snackbar
- setFileStatus(fileIndex, UploadStatus.UPLOAD_ERROR)
- }
- }
- }
-
- return (
-
- )
-}
diff --git a/cx-portal/src/components/pages/Translator/Dropzone.tsx b/cx-portal/src/components/pages/Translator/Dropzone.tsx
deleted file mode 100644
index 65cadc1cb..000000000
--- a/cx-portal/src/components/pages/Translator/Dropzone.tsx
+++ /dev/null
@@ -1,45 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { useCallback } from 'react'
-import { useDropzone } from 'react-dropzone'
-
-export default function Dropzone() {
- const onDrop = useCallback((acceptedFiles) => {
- acceptedFiles.forEach((file: File) => {
- const reader = new FileReader()
- reader.onabort = () => console.log('file reading was aborted')
- reader.onerror = () => console.log('file reading has failed')
- reader.onload = () => {
- const text = reader.result
- console.log(text)
- }
- reader.readAsText(file, 'utf-8')
- })
- }, [])
- const { getRootProps, getInputProps } = useDropzone({ onDrop })
-
- return (
-
-
-
Drop some files here, or click to select files
-
- )
-}
diff --git a/cx-portal/src/components/pages/Translator/Translator.css b/cx-portal/src/components/pages/Translator/Translator.css
deleted file mode 100644
index 193a4879e..000000000
--- a/cx-portal/src/components/pages/Translator/Translator.css
+++ /dev/null
@@ -1,27 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-main.Translator textarea {
- width: 48%;
- height: 600px;
- white-space: pre;
- overflow-wrap: normal;
- overflow-x: scroll;
-}
diff --git a/cx-portal/src/components/pages/Translator/index.tsx b/cx-portal/src/components/pages/Translator/index.tsx
deleted file mode 100644
index b56a3ac4e..000000000
--- a/cx-portal/src/components/pages/Translator/index.tsx
+++ /dev/null
@@ -1,71 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-// TODO:
-// for developer convenience - remove in prod
-
-import axios from 'axios'
-import { useState } from 'react'
-import Dropzone from './Dropzone'
-import './Translator.css'
-
-export default function Translator() {
- const [input, setInput] = useState('{"message":"good morning!"}')
- const [output, setOutput] = useState('')
- const [langFrom, setLangFrom] = useState('en')
- const [langTo, setLangTo] = useState('de')
-
- function doTranslate() {
- const url = `https://catenax-dev003-util.azurewebsites.net/v1/translate/${langFrom}/${langTo}`
- axios
- .post(url, input)
- .then(function (response) {
- console.log(response)
- console.log(response.data.result)
- setOutput(JSON.stringify(response.data.result, null, 4))
- })
- .catch(function (error) {
- console.log(error)
- setOutput(error)
- })
- }
-
- return (
-
-
Translator
-
-
- )
-}
diff --git a/cx-portal/src/components/shared/frame/Footer/Footer.stories.tsx b/cx-portal/src/components/shared/frame/Footer/Footer.stories.tsx
deleted file mode 100644
index 13c148fb6..000000000
--- a/cx-portal/src/components/shared/frame/Footer/Footer.stories.tsx
+++ /dev/null
@@ -1,54 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import React from 'react'
-import { ComponentStory, ComponentMeta } from '@storybook/react'
-import { Footer } from '.'
-import { MemoryRouter } from 'react-router-dom'
-
-export default {
- title: 'frame/Footer',
- component: Footer,
- parameters: {
- layout: 'fullscreen',
- },
- decorators: [
- (Story) => (
-
-
-
- ),
- ],
- styles: ['./components/App.css'],
-} as ComponentMeta
-
-const Template: ComponentStory = (args) =>
-
-export const Standard = Template.bind({})
-Standard.args = {
- pages: [
- 'home',
- 'appstore',
- 'datacatalog',
- 'digitaltwins',
- 'semantichub',
- 'developerhub',
- ],
-}
diff --git a/cx-portal/src/components/shared/frame/Header/Header.stories.tsx b/cx-portal/src/components/shared/frame/Header/Header.stories.tsx
deleted file mode 100644
index 95036b8df..000000000
--- a/cx-portal/src/components/shared/frame/Header/Header.stories.tsx
+++ /dev/null
@@ -1,67 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import React from 'react'
-import { ComponentStory, ComponentMeta } from '@storybook/react'
-import { Header } from '.'
-import { MemoryRouter } from 'react-router-dom'
-
-export default {
- title: 'frame/Header',
- component: Header,
- parameters: {
- layout: 'fullscreen',
- },
- decorators: [
- (Story) => (
-
-
-
- ),
- ],
- styles: ['./components/App.css'],
-} as ComponentMeta
-
-const Template: ComponentStory = (args) =>
-
-export const Standard = Template.bind({})
-Standard.args = {
- main: [
- { name: 'home' },
- { name: 'appstore' },
- {
- name: 'datamanagement',
- children: [
- { name: 'datacatalog' },
- { name: 'digitaltwins' },
- { name: 'semantichub' },
- ],
- },
- { name: 'developerhub' },
- ],
- user: [
- 'account',
- 'notifications',
- 'organization',
- 'partner_network',
- 'user_management',
- 'logout',
- ],
-}
diff --git a/cx-portal/src/components/shared/templates/Subscription/SubscriptionElements.tsx b/cx-portal/src/components/shared/templates/Subscription/SubscriptionElements.tsx
deleted file mode 100644
index 6595543e3..000000000
--- a/cx-portal/src/components/shared/templates/Subscription/SubscriptionElements.tsx
+++ /dev/null
@@ -1,198 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2021, 2023 BMW Group AG
- * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Apache License, Version 2.0 which is available at
- * https://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- ********************************************************************************/
-
-import { Button, Typography } from 'cx-portal-shared-components'
-import { useTheme, CircularProgress } from '@mui/material'
-import { useTranslation } from 'react-i18next'
-import { useDispatch } from 'react-redux'
-import { show } from 'features/control/overlay'
-import { OVERLAYS } from 'types/Constants'
-import {
- CompanySubscriptionData,
- SubscriptionContent,
-} from 'features/appSubscription/appSubscriptionApiSlice'
-import './Subscription.scss'
-import NoItems from 'components/pages/NoItems'
-import { SubscriptionTypes } from '.'
-import { useReducer } from 'react'
-import ActivateServiceSubscription from 'components/overlays/ActivateServiceSubscription'
-
-enum ActionKind {
- SET_OVERLAY = 'SET_OVERLAY',
- SET_ID = 'SET_ID',
- SET_TECH_USER = 'SET_TECH_USER',
- SET_ID_OFFER_ID_TECH_USER_OVERLEY = 'SET_ID_OFFER_ID_TECH_USER_OVERLEY',
- SET_OFFER_ID = 'SET_OFFER_ID',
-}
-
-type State = {
- id: string
- isTechUser: boolean
- overlay: boolean
- offerId: string
- companyName: string
-}
-
-const initialState: State = {
- id: '',
- isTechUser: false,
- overlay: false,
- offerId: '',
- companyName: '',
-}
-
-type Action = {
- type: string
- payload: any
-}
-
-function reducer(state: State, { type, payload }: Action) {
- switch (type) {
- case ActionKind.SET_ID:
- return { ...state, id: payload }
- case ActionKind.SET_OFFER_ID:
- return { ...state, offerId: payload }
- case ActionKind.SET_TECH_USER:
- return { ...state, isTechUser: payload }
- case ActionKind.SET_OVERLAY:
- return { ...state, overlay: payload }
- case ActionKind.SET_ID_OFFER_ID_TECH_USER_OVERLEY:
- return {
- ...state,
- id: payload.id,
- isTechUser: payload.isTechUser,
- overlay: payload.overlay,
- offerId: payload.offerId,
- companyName: payload.companyName,
- }
- default:
- return state
- }
-}
-
-export default function SubscriptionElements({
- subscriptions,
- type,
- refetch,
-}: {
- subscriptions?: SubscriptionContent[]
- type: string
- refetch: () => void
-}) {
- const theme = useTheme()
- const { t } = useTranslation()
- const dispatch = useDispatch()
- const [{ id, isTechUser, overlay, offerId, companyName }, setState] =
- useReducer(reducer, initialState)
-
- if (subscriptions && subscriptions.length === 0) {
- return
- }
-
- const showOverlay = (
- subscription: CompanySubscriptionData,
- offerId: string
- ) => {
- if (type === SubscriptionTypes.APP_SUBSCRIPTION) {
- dispatch(show(OVERLAYS.ADD_SUBSCRIPTION, subscription.subscriptionId))
- } else {
- setState({
- type: ActionKind.SET_ID_OFFER_ID_TECH_USER_OVERLEY,
- payload: {
- id: subscription.subscriptionId,
- offerId: offerId,
- isTechUser: subscription.technicalUser,
- overlay: true,
- companyName: subscription.companyName,
- },
- })
- }
- }
-
- return (
- <>
-