Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: remove unnecessary CodeGen files #5497

Merged
merged 3 commits into from
Feb 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -21,7 +21,6 @@ packages/cypress-commands/dist

scripts
shared
CodeGen.tsx
examples
templates

3 changes: 0 additions & 3 deletions packages/main/src/components/DynamicPage/CodeGen.tsx

This file was deleted.

Original file line number Diff line number Diff line change
@@ -33,7 +33,6 @@ import {
VariantItem,
VariantManagement
} from '../..';
import { SpacingSpan } from './CodeGen';
import { DynamicPage } from './index.js';

const meta = {
@@ -106,7 +105,7 @@ const meta = {
<Label>Halway: 23L</Label>
<Label>Rack: 34</Label>
</FlexBox>
{SpacingSpan}
<span style={{ width: '1rem' }} />
<FlexBox direction={FlexBoxDirection.Column}>
<Label>Availability:</Label>
<ObjectStatus state={ValueState.Success}>In Stock</ObjectStatus>
11 changes: 0 additions & 11 deletions packages/main/src/components/MessageBox/CodeGen.tsx

This file was deleted.

12 changes: 10 additions & 2 deletions packages/main/src/components/MessageBox/MessageBox.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
import { isChromatic } from '@sb/utils';
import type { Meta, StoryObj } from '@storybook/react';
import { useEffect, useState } from 'react';
import { forwardRef, useEffect, useState } from 'react';
import { createPortal } from 'react-dom';
import { MessageBoxActions } from '../../enums/MessageBoxActions';
import { MessageBoxTypes } from '../../enums/MessageBoxTypes';
import type { DialogDomRef } from '../../webComponents';
import { Button } from '../../webComponents/Button/index';
import { MessageBox } from './CodeGen';
import type { MessageBoxPropTypes } from './index.js';
import { MessageBox as OriginalMessageBox } from './index.js';

// todo remove once portals are supported inline, or popovers are supported w/o having to mount them to the body
const MessageBox = forwardRef<DialogDomRef, MessageBoxPropTypes>((args, ref) =>
createPortal(<OriginalMessageBox {...args} ref={ref} />, document.body)
);
MessageBox.displayName = 'MessageBox';

const meta = {
title: 'Modals & Popovers / MessageBox',
component: OriginalMessageBox,
Original file line number Diff line number Diff line change
@@ -1,21 +1,38 @@
import { generateMessageItems } from '@sb/mockData/generateMessageItems';
import type { Meta, StoryObj } from '@storybook/react';
import arrowLeftIcon from '@ui5/webcomponents-icons/dist/slim-arrow-left.js';
import { useRef, useState } from 'react';
import { forwardRef, useRef, useState } from 'react';
import { createPortal } from 'react-dom';
import { ButtonDesign, FlexBoxAlignItems, FlexBoxJustifyContent, TitleLevel, ValueState } from '../../enums/index.js';
import type {
DialogDomRef,
DialogPropTypes,
ResponsivePopoverDomRef,
ResponsivePopoverPropTypes
} from '../../webComponents';
import { Bar } from '../../webComponents/Bar/index.js';
import { Button } from '../../webComponents/Button/index.js';
// todo replace once `createPortal` is supported
import { Dialog } from '../../webComponents/Dialog/CodeGen.js';
import { Dialog as OriginalDialog } from '../../webComponents/Dialog';
import { Link } from '../../webComponents/Link/index.js';
// todo replace once `createPortal` is supported
import { ResponsivePopover } from '../../webComponents/ResponsivePopover/CodeGen.js';
import { ResponsivePopover as OriginalResponsivePopover } from '../../webComponents/ResponsivePopover';
import { Title } from '../../webComponents/Title/index.js';
import { FlexBox } from '../FlexBox/index.js';
import { MessageViewButton } from '../MessageViewButton/index.js';
import { MessageItem } from './MessageItem.js';
import { MessageView } from './index.js';

// todo remove once portals are supported inline, or popovers are supported w/o having to mount them to the body
const Dialog = forwardRef<DialogDomRef, DialogPropTypes>((args, ref) =>
createPortal(<OriginalDialog {...args} ref={ref} />, document.body)
);
Dialog.displayName = 'Dialog';

// todo remove once portals are supported inline, or popovers are supported w/o having to mount them to the body
const ResponsivePopover = forwardRef<ResponsivePopoverDomRef, ResponsivePopoverPropTypes>((args, ref) =>
createPortal(<OriginalResponsivePopover {...args} ref={ref} />, document.body)
);
ResponsivePopover.displayName = 'ResponsivePopover';

const meta = {
title: 'User Feedback / MessageView',
component: MessageView,
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type { Meta, StoryObj } from '@storybook/react';
import { AvatarGroupType } from '../../enums/AvatarGroupType';
import { Avatar } from '../Avatar/index.js';
import { Avatar1, Avatar2 } from './CodeGen.js';
import { AvatarGroup } from './index.js';

const meta = {
@@ -26,8 +25,12 @@ export const Default: Story = {
<AvatarGroup {...args}>
<Avatar icon="employee" />
<Avatar initials="JD" />
<Avatar>{Avatar1}</Avatar>
<Avatar>{Avatar2}</Avatar>
<Avatar>
<img src="https://sap.github.io/ui5-webcomponents/assets/images/avatars/woman_avatar_5.png" alt="Avatar1" />
</Avatar>
<Avatar>
<img src="https://sap.github.io/ui5-webcomponents/assets/images/avatars/man_avatar_3.png" alt="Avatar2" />
</Avatar>
</AvatarGroup>
);
}
8 changes: 0 additions & 8 deletions packages/main/src/webComponents/AvatarGroup/CodeGen.tsx

This file was deleted.

13 changes: 8 additions & 5 deletions packages/main/src/webComponents/Bar/Bar.stories.tsx
Original file line number Diff line number Diff line change
@@ -7,7 +7,6 @@ import { Button } from '../Button';
import { Input } from '../Input';
import { Link } from '../Link';
import { Title } from '../Title';
import { CenterContent, EndContent, Img, StartContent } from './CodeGen';
import { Bar } from './index.js';

const meta = {
@@ -20,9 +19,9 @@ const meta = {
},
args: {
design: BarDesign.Header,
startContent: StartContent,
children: CenterContent,
endContent: EndContent
startContent: <span>Start Content</span>,
children: <span>Center Content</span>,
endContent: <span>End Content</span>
},
tags: ['package:@ui5/webcomponents-fiori']
} satisfies Meta<typeof Bar>;
@@ -40,7 +39,11 @@ export const WithCustomElements: Story = {
startContent={
<>
<Button icon={navBackIcon} design={ButtonDesign.Transparent} />
{Img}
<img
src="https://raw.githubusercontent.com/SAP/ui5-webcomponents-react/main/assets/Logo.png"
alt="logo"
style={{ marginLeft: '6px', width: '120px' }}
/>
</>
}
endContent={
12 changes: 0 additions & 12 deletions packages/main/src/webComponents/Bar/CodeGen.tsx

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { Meta, StoryObj } from '@storybook/react';
import { CarouselArrowsPlacement } from '../../enums/CarouselArrowsPlacement';
import { Img1, Img2, Img3 } from './CodeGen';
import { Carousel } from './index';

const meta = {
@@ -21,9 +20,9 @@ export const Default: Story = {
render(args) {
return (
<Carousel {...args}>
{Img1}
{Img2}
{Img3}
<img src="https://sap.github.io/ui5-webcomponents/assets/images/sample1.jpg" alt="img-sample 1" />
<img src="https://sap.github.io/ui5-webcomponents/assets/images/sample2.jpg" alt="img-sample 2" />
<img src="https://sap.github.io/ui5-webcomponents/assets/images/sample3.jpg" alt="img-sample 3" />
</Carousel>
);
}
5 changes: 0 additions & 5 deletions packages/main/src/webComponents/Carousel/CodeGen.tsx

This file was deleted.

10 changes: 0 additions & 10 deletions packages/main/src/webComponents/Dialog/CodeGen.tsx

This file was deleted.

11 changes: 9 additions & 2 deletions packages/main/src/webComponents/Dialog/Dialog.stories.tsx
Original file line number Diff line number Diff line change
@@ -2,12 +2,19 @@ import { isChromatic } from '@sb/utils';
import type { Meta, StoryObj } from '@storybook/react';
import settingsIcon from '@ui5/webcomponents-icons/dist/settings.js';
import { clsx } from 'clsx';
import React, { useEffect, useState } from 'react';
import { forwardRef, useEffect, useState } from 'react';
import { createPortal } from 'react-dom';
import { BarDesign } from '../../enums';
import type { DialogDomRef, DialogPropTypes } from '../index.js';
import { Bar, Button, Icon, List, StandardListItem, Title } from '../index.js';
import { Dialog } from './CodeGen';
import { Dialog as OriginalDialog } from './index';

// todo remove once portals are supported inline, or popovers are supported w/o having to mount them to the body
const Dialog = forwardRef<DialogDomRef, DialogPropTypes>((args, ref) =>
createPortal(<OriginalDialog {...args} ref={ref} />, document.body)
);
Dialog.displayName = 'Dialog';

const meta = {
title: 'Modals & Popovers / Dialog',
component: OriginalDialog,
28 changes: 0 additions & 28 deletions packages/main/src/webComponents/DynamicSideContent/CodeGen.tsx

This file was deleted.

Original file line number Diff line number Diff line change
@@ -2,7 +2,6 @@ import type { Meta, StoryObj } from '@storybook/react';
import { SideContentFallDown } from '../../enums/SideContentFallDown';
import { SideContentPosition } from '../../enums/SideContentPosition';
import { SideContentVisibility } from '../../enums/SideContentVisibility';
import { MainContent, SideContent } from './CodeGen';
import { DynamicSideContent } from './index.js';

const meta = {
@@ -26,8 +25,32 @@ type Story = StoryObj<typeof meta>;
export const Default: Story = {
render(args) {
return (
<DynamicSideContent {...args} sideContent={SideContent}>
{MainContent}
<DynamicSideContent
{...args}
sideContent={
<>
<h1>Side Content</h1>
<p>
Morbi lorem libero, imperdiet id condimentum ac, tempor ut velit. Integer a laoreet sem. Nunc at sagittis
nisi. Sed placerat diam eu porttitor dignissim. Maecenas nec fringilla tortor. Pellentesque ut elit est.
Curabitur quis elit at mauris ullamcorper fringilla. Nullam diam mi, porttitor dictum orci nec, molestie
luctus metus. Nunc ut ex blandit, elementum erat eget, pulvinar sapien. Donec nec lorem eu nunc eleifend
tempor at non tortor. In quam velit, ornare at rutrum ac, porta ac augue. Suspendisse venenatis semper
lacus at venenatis. Praesent vestibulum ligula nulla, at tempus lorem consequat suscipit. Aenean consequat
dapibus dui, at bibendum mauris porta a.
</p>
</>
}
>
<h1>Main Content</h1>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc ex mi, elementum et ante commodo, semper
sollicitudin magna. Sed dapibus ut tortor quis varius. Sed luctus sem at nunc porta vulputate. Suspendisse
lobortis arcu est, quis ultrices ipsum fermentum a. Vestibulum a ipsum placerat ligula gravida fringilla at id
ex. Etiam pellentesque lorem sed sagittis aliquam. Quisque semper orci risus, vel efficitur dui euismod
aliquet. Morbi sapien sapien, rhoncus et rutrum nec, rhoncus id nisl. Cras non tincidunt enim, id eleifend
neque.
</p>
</DynamicSideContent>
);
}
9 changes: 0 additions & 9 deletions packages/main/src/webComponents/Popover/CodeGen.tsx

This file was deleted.

10 changes: 8 additions & 2 deletions packages/main/src/webComponents/Popover/Popover.stories.tsx
Original file line number Diff line number Diff line change
@@ -2,7 +2,8 @@ import '@ui5/webcomponents-icons/dist/settings.js';
import { isChromatic } from '@sb/utils';
import type { Meta, StoryObj } from '@storybook/react';
import { clsx } from 'clsx';
import { useState } from 'react';
import { forwardRef, useState } from 'react';
import { createPortal } from 'react-dom';
import { BarDesign } from '../../enums/BarDesign';
import { PopoverHorizontalAlign } from '../../enums/PopoverHorizontalAlign';
import { PopoverPlacementType } from '../../enums/PopoverPlacementType';
@@ -14,9 +15,14 @@ import { Label } from '../Label';
import { List } from '../List';
import { StandardListItem } from '../StandardListItem';
import { Title } from '../Title';
import { Popover } from './CodeGen';
import type { PopoverDomRef, PopoverPropTypes } from './index';
import { Popover as OriginalPopover } from './index';

const Popover = forwardRef<PopoverDomRef, PopoverPropTypes>((args, ref) =>
createPortal(<OriginalPopover {...args} ref={ref} />, document.body)
);
Popover.displayName = 'Popover';

const meta = {
title: 'Modals & Popovers / Popover',
component: OriginalPopover,
13 changes: 0 additions & 13 deletions packages/main/src/webComponents/ResponsivePopover/CodeGen.tsx

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { isChromatic } from '@sb/utils';
import type { Meta, StoryObj } from '@storybook/react';
import { clsx } from 'clsx';
import { useState } from 'react';
import { forwardRef, useState } from 'react';
import { createPortal } from 'react-dom';
import { PopoverHorizontalAlign } from '../../enums/PopoverHorizontalAlign';
import { PopoverPlacementType } from '../../enums/PopoverPlacementType';
import { PopoverVerticalAlign } from '../../enums/PopoverVerticalAlign';
@@ -12,10 +13,16 @@ import { Label } from '../Label';
import { List } from '../List';
import { StandardListItem } from '../StandardListItem';
import { Title } from '../Title';
import { ResponsivePopover } from './CodeGen.js';
import type { ResponsivePopoverDomRef, ResponsivePopoverPropTypes } from './index';
import { ResponsivePopover as OriginalResponsivePopover } from './index';
import '@ui5/webcomponents-icons/dist/settings.js';

// todo remove once portals are supported inline, or popovers are supported w/o having to mount them to the body
const ResponsivePopover = forwardRef<ResponsivePopoverDomRef, ResponsivePopoverPropTypes>((args, ref) =>
createPortal(<OriginalResponsivePopover {...args} ref={ref} />, document.body)
);
ResponsivePopover.displayName = 'ResponsivePopover';

const meta = {
title: 'Modals & Popovers / ResponsivePopover',
component: OriginalResponsivePopover,
10 changes: 0 additions & 10 deletions packages/main/src/webComponents/Select/CodeGen.tsx

This file was deleted.

13 changes: 10 additions & 3 deletions packages/main/src/webComponents/Select/Select.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
import type { Meta, StoryObj } from '@storybook/react';
import employeeIcon from '@ui5/webcomponents-icons/dist/employee.js';
import soccerIcon from '@ui5/webcomponents-icons/dist/soccer.js';
import { useState } from 'react';
import { forwardRef, useState } from 'react';
import { createPortal } from 'react-dom';
import { FlexBox } from '../../components/FlexBox';
import { Text } from '../../components/Text';
import { FlexBoxAlignItems, FlexBoxJustifyContent, ValueState } from '../../enums/index.js';
import { Icon } from '../Icon';
import { Option } from '../Option/index.js';
import type { SelectMenuDomRef, SelectMenuPropTypes } from '../SelectMenu';
import { SelectMenu as OriginalSelectMenu } from '../SelectMenu';
import { SelectMenuOption } from '../SelectMenuOption';
import { SelectMenu } from './CodeGen';
import { Select } from './index.js';

// todo remove once portals are supported inline, or popovers are supported w/o having to mount them to the body
const SelectMenu = forwardRef<SelectMenuDomRef, SelectMenuPropTypes>((args, ref) =>
createPortal(<OriginalSelectMenu {...args} ref={ref} />, document.body)
);
SelectMenu.displayName = 'SelectMenu';

const meta = {
title: 'Inputs / Select',
component: Select,
@@ -45,7 +53,6 @@ export const WithSelectMenu: Story = {
name: 'with SelectMenu',
args: { menu: 'selectMenu' },
render: (args) => {
const [open, setOpen] = useState(false);
return (
<>
<Select {...args} />
3 changes: 0 additions & 3 deletions packages/main/src/webComponents/Timeline/CodeGen.tsx

This file was deleted.

9 changes: 0 additions & 9 deletions packages/main/src/webComponents/Toast/CodeGen.tsx

This file was deleted.

11 changes: 9 additions & 2 deletions packages/main/src/webComponents/Toast/Toast.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
import { isChromatic } from '@sb/utils';
import type { Meta } from '@storybook/react';
import { useRef, useEffect } from 'react';
import { useRef, useEffect, forwardRef } from 'react';
import { createPortal } from 'react-dom';
import { ToastPlacement } from '../../enums/index.js';
import { Button } from '../Button/index.js';
import { Toast } from './CodeGen.js';
import type { ToastDomRef, ToastPropTypes } from './index.js';
import { Toast as OriginalToast } from './index.js';

// todo remove once portals are supported inline, or popovers are supported w/o having to mount them to the body
const Toast = forwardRef<ToastDomRef, ToastPropTypes>((args, ref) =>
createPortal(<OriginalToast {...args} ref={ref} />, document.body)
);
Toast.displayName = 'Toast';

const meta = {
title: 'Modals & Popovers / Toast',
component: OriginalToast,
3 changes: 0 additions & 3 deletions packages/main/src/webComponents/Wizard/CodeGen.tsx

This file was deleted.

5 changes: 2 additions & 3 deletions packages/main/src/webComponents/Wizard/Wizard.stories.tsx
Original file line number Diff line number Diff line change
@@ -13,7 +13,6 @@ import { Label } from '../Label/index.js';
import { MessageStrip } from '../MessageStrip/index.js';
import { Title } from '../Title/index.js';
import { WizardStep } from '../WizardStep/index.js';
import { Br } from './CodeGen.js';
import { Wizard } from './index.js';

const meta = {
@@ -114,7 +113,7 @@ export const Default: Story = {
turpis a, molestie aliquet dui. Donec pulvinar, sapien
</Label>
<CheckBox onChange={handleStep2Completed} text="Step Completed" />
{Br}
<br />
{!hidden['step3Btn'] && (
<Button design={ButtonDesign.Emphasized} onClick={goToStep3}>
Step 3
@@ -138,7 +137,7 @@ export const Default: Story = {
turpis a, molestie aliquet dui. Donec pulvinar, sapien
</Label>
<Input placeholder="Item Price" onInput={handlePriceInput} />
{Br}
<br />
{!hidden['finalizeBtn'] && (
<Button design={ButtonDesign.Emphasized} onClick={finalizeWizard}>
Finalize
2 changes: 1 addition & 1 deletion packages/main/tsconfig.json
Original file line number Diff line number Diff line change
@@ -19,5 +19,5 @@
}
],
"include": ["src/**/*"],
"exclude": ["node_modules", "**/*.cy.ts", "**/*.cy.tsx", "**/CodeGen.tsx", "**/*.stories.tsx"]
"exclude": ["node_modules", "**/*.cy.ts", "**/*.cy.tsx", "**/*.stories.tsx"]
}
1 change: 0 additions & 1 deletion tsconfig.node.json
Original file line number Diff line number Diff line change
@@ -11,7 +11,6 @@
"vite.config.ts",
".storybook",
"packages/**/*.stories.tsx",
"packages/**/CodeGen.tsx",
"packages/cypress-commands/CommandsAndQueries.tsx"
]
}