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

chore: remove enumPropNamesArray #2348

Merged
merged 4 commits into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
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 packages/core/plop/general/component-stories-js.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import styles from "./{{properCase componentName}}.stories.module.scss";

const metaSettings = createStoryMetaSettingsDecorator({
component: {{properCase componentName}},
enumPropNamesArray: [], // List enum props here
iconPropNamesArray: [], // List props that are typed as icons here
actionPropsArray: [] // List the component's actions here
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import "./Avatar.stories.scss";

const metaSettings = createStoryMetaSettingsDecorator({
component: Avatar,
enumPropNamesArray: ["type", "size"],
iconPropNamesArray: ["icon"]
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ import { createComponentTemplate, StoryDescription } from "vibe-storybook-compon

const metaSettings = createStoryMetaSettingsDecorator({
component: Badge,
enumPropNamesArray: ["anchor", "alignment", "type"],
iconPropNamesArray: [],
actionPropsArray: [],
ignoreControlsPropNamesArray: ["children"]
});

Expand Down
28 changes: 1 addition & 27 deletions packages/core/src/components/Box/__stories__/Box.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,7 @@ import { createStoryMetaSettingsDecorator } from "../../../storybook";
import styles from "./Box.stories.module.scss";

const metaSettings = createStoryMetaSettingsDecorator({
component: Box,
enumPropNamesArray: [
"className",
"id",
"children",
"disabled",
"border",
"borderColor",
"rounded",
"shadow",
"margin",
"marginX",
"marginY",
"marginTop",
"marginEnd",
"marginBottom",
"marginStart",
"padding",
"paddingX",
"paddingY",
"paddingTop",
"paddingEnd",
"paddingBottom",
"paddingStart",
"backgroundColor",
"textColor"
]
component: Box
});

export default {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import { createStoryMetaSettingsDecorator } from "../../../storybook/functions/c
import "./BreadcrumbsBar.stories.scss";

const metaSettings = createStoryMetaSettingsDecorator({
component: BreadcrumbsBar,
enumPropNamesArray: ["type"]
component: BreadcrumbsBar
});

const breadcrumbsBarTemplate = (args: BreadcrumbBarProps) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ type Story = StoryObj<typeof Button>;

const metaSettings = createStoryMetaSettingsDecorator({
component: Button,
enumPropNamesArray: ["kind", "size", "color", "type"],
iconPropNamesArray: ["leftIcon", "rightIcon", "successIcon"],
actionPropsArray: ["onClick"]
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ type Story = StoryObj<typeof ButtonGroup>;

const metaSettings = createStoryMetaSettingsDecorator({
component: ButtonGroup,
enumPropNamesArray: ["kind", "size"],
actionPropsArray: ["onSelect"]
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import styles from "./Chips.stories.module.scss";

const metaSettings = createStoryMetaSettingsDecorator({
component: Chips,
enumPropNamesArray: ["color"],
iconPropNamesArray: ["rightIcon", "leftIcon"],
actionPropsArray: ["onDelete", "onMouseDown", "onClick"]
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { createComponentTemplate } from "vibe-storybook-components";

const metaSettings = createStoryMetaSettingsDecorator({
component: ColorPicker,
enumPropNamesArray: ["colorStyle", "colorSize", "colorShape"],
iconPropNamesArray: ["ColorIndicatorIcon", "SelectedIndicatorIcon", "NoColorIcon"],
actionPropsArray: [{ name: "onSave", linkedToPropValue: "value" }]
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import "./Combobox.stories.scss";

const metaSettings = createStoryMetaSettingsDecorator({
component: Combobox,
enumPropNamesArray: ["size"],
iconPropNamesArray: ["searchIcon"],
actionPropsArray: ["onOptionHover", "onOptionLeave", "onFilterChanged"]
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ import Avatar from "../../Avatar/Avatar";
import "./Counter.stories.scss";

const metaSettings = createStoryMetaSettingsDecorator({
component: Counter,
enumPropNamesArray: ["size", "color", "kind"]
component: Counter
});

const counterTemplate = createComponentTemplate(Counter);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ import { HideShowEvent } from "../DialogConstants";
import { DialogProps } from "../Dialog";

const metaSettings = createStoryMetaSettingsDecorator({
component: Dialog,
enumPropNamesArray: [], // List enum props here
iconPropNamesArray: [], // List props that are typed as icons here
actionPropsArray: [] // List the component's actions here
component: Dialog
});

const showHideArgTypes = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import DialogContentContainerExample from "./DialogContentContainerExample";

const metaSettings = createStoryMetaSettingsDecorator({
component: DialogContentContainer,
enumPropNamesArray: ["type", "size"],
ignoreControlsPropNamesArray: ["children"]
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import { createStoryMetaSettingsDecorator } from "../../../storybook";
import styles from "./Divider.stories.module.scss";

const metaSettings = createStoryMetaSettingsDecorator({
component: Divider,
enumPropNamesArray: ["direction"]
component: Divider
});

const dividerTemplate = (args: DividerProps) => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { fakeFetchUsers } from "./Dropdown.stories.helpers";

const metaSettings = createStoryMetaSettingsDecorator({
component: Dropdown,
enumPropNamesArray: ["size", "menuPosition", "menuPlacement"],
actionPropsArray: [
"onMenuOpen",
"onMenuClose",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@ import EditableTypography, { EditableTypographyImplementationProps } from "../Ed
export interface EditableHeadingProps extends VibeComponentProps, EditableTypographyImplementationProps {
/**
* Sets the Heading type
* @type {HeadingType}
* */
type?: HeadingType;
/** Sets the Heading weight
* @type {HeadingWeight}
*/
weight?: HeadingWeight;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import styles from "./EditableHeading.stories.module.scss";

const metaSettings = createStoryMetaSettingsDecorator({
component: EditableHeading,
enumPropNamesArray: ["weight", "type"],
actionPropsArray: ["onChange"]
});

Expand Down
2 changes: 0 additions & 2 deletions packages/core/src/components/EditableText/EditableText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@ import cx from "classnames";
export interface EditableTextProps extends VibeComponentProps, EditableTypographyImplementationProps {
/**
* Sets the Text type
* @type {TextType}
* */
type?: TextType;
/** Sets the Text weight
* @type {TextWeight}
*/
weight?: TextWeight;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import styles from "./EditableText.stories.module.scss";

const metaSettings = createStoryMetaSettingsDecorator({
component: EditableText,
enumPropNamesArray: ["weight", "type"],
actionPropsArray: ["onChange"]
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ import styles from "./ExpandCollapse.stories.module.scss";

const metaSettings = createStoryMetaSettingsDecorator({
component: ExpandCollapse,
enumPropNamesArray: [],
iconPropNamesArray: [],
actionPropsArray: [],
ignoreControlsPropNamesArray: ["headerComponentRenderer"]
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import styles from "./Flex.stories.module.scss";

const metaSettings = createStoryMetaSettingsDecorator({
component: Flex,
enumPropNamesArray: ["justify", "align"],
actionPropsArray: ["onClick"]
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ import { Custom } from "../../Icon/Icons";
import styles from "./Heading.stories.module.scss";

const metaSettings = createStoryMetaSettingsDecorator({
component: Heading,
iconPropNamesArray: [], // List props that are typed as icons here
actionPropsArray: [] // List the component's actions here
component: Heading
});

const textTemplate = createComponentTemplate(Heading);
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/components/IconButton/IconButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export interface IconButtonProps extends VibeComponentProps {
*/
tooltipContent?: string;
/**
* Kind of button - like <Button />
* Kind of button - like Button
*/
kind?: ButtonType;
active?: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ type Story = StoryObj<typeof IconButton>;

const metaSettings = createStoryMetaSettingsDecorator({
component: IconButton,
enumPropNamesArray: ["kind", "size", "color"],
iconPropNamesArray: ["icon"],
actionPropsArray: ["onClick"]
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ import { Decorator, StoryObj } from "@storybook/react";
type Story = StoryObj<typeof Label>;

const metaSettings = createStoryMetaSettingsDecorator({
component: Label,
enumPropNamesArray: ["kind", "color"]
component: Label
});

export default {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import "./Link.stories.scss";

const metaSettings = createStoryMetaSettingsDecorator({
component: Link,
enumPropNamesArray: ["iconPosition", "target"],
iconPropNamesArray: ["icon"]
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import { useCallback, useState } from "react";
import "./Loader.stories.scss";

const metaSettings = createStoryMetaSettingsDecorator({
component: Loader,
enumPropNamesArray: ["size", "color"]
component: Loader
});

export default {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ import MenuGridItem, { MenuGridItemProps } from "../MenuGridItem";
import "./MenuGridItem.stories.scss";

const metaSettings = createStoryMetaSettingsDecorator({
component: MenuGridItem,
enumPropNamesArray: [], // List enum props here
iconPropNamesArray: [], // List props that are typed as icons here
actionPropsArray: [] // List the component's actions here
component: MenuGridItem
});

export default {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ type Story = StoryObj<MenuItemProps>;

const metaSettings = createStoryMetaSettingsDecorator({
component: MenuItem,
enumPropNamesArray: ["tooltipPosition"],
iconPropNamesArray: ["icon"]
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { Invite } from "../../../Icon/Icons";

const metaSettings = createStoryMetaSettingsDecorator({
component: MenuItemButton,
enumPropNamesArray: ["kind", "tooltipPosition"],
iconPropNamesArray: ["leftIcon", "rightIcon"]
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import Menu from "../../Menu/Menu";
import MenuItem from "../../MenuItem/MenuItem";

const metaSettings = createStoryMetaSettingsDecorator({
component: MenuTitle,
enumPropNamesArray: ["captionPosition"]
component: MenuTitle
});

export default {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ import ModalFooterButtons from "../ModalFooter/ModalFooterButtons/ModalFooterBut
import { Upgrade } from "../../Icon/Icons";
const metaSettings = createStoryMetaSettingsDecorator({
component: Modal,
enumPropNamesArray: ["width"], // List enum props here
actionPropsArray: ["onClose"] // List the component's actions here
actionPropsArray: ["onClose"]
});

// eslint-disable-next-line @typescript-eslint/no-unused-vars
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ import BreadcrumbsBar from "../../../BreadcrumbsBar/BreadcrumbsBar";
import "./LinearProgressBar.stories.scss";

const metaSettings = createStoryMetaSettingsDecorator({
component: LinearProgressBar,
enumPropNamesArray: ["size", "barStyle"]
component: LinearProgressBar
});

export default {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import { Sound, Video } from "../../Icon/Icons";
import "./Slider.stories.scss";

const argTypes = createStoryMetaSettingsDecorator({
component: Slider,
enumPropNamesArray: ["color", "size"]
component: Slider
});

export default {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,7 @@ import "./SplitButton.stories.scss";

const metaSettings = createStoryMetaSettingsDecorator({
component: SplitButton,
enumPropNamesArray: [
"kind",
"dialogPaddingSize",
{
propName: "secondaryDialogPosition",
enumName: "secondaryPositions"
}
],

iconPropNamesArray: ["leftIcon", "rightIcon"],
actionPropsArray: ["secondaryDialogContent", "onSecondaryDialogDidShow", "onSecondaryDialogDidHide", "onClick"]
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import "./Steps.stories.scss";

const metaSettings = createStoryMetaSettingsDecorator({
component: Steps,
enumPropNamesArray: ["type"],
actionPropsArray: ["onChangeActiveStep"]
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import TabPanel, { TabPanelProps } from "../../TabPanel/TabPanel";
import TabPanels from "../TabPanels";

const metaSettings = createStoryMetaSettingsDecorator({
component: TabPanels,
enumPropNamesArray: ["animationDirection"]
component: TabPanels
});

export default {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ import { textOverflowSuite } from "../__tests__/Text.interactions";
import styles from "./Text.stories.module.scss";

const metaSettings = createStoryMetaSettingsDecorator({
component: Text,
enumPropNamesArray: ["types", "weights", "colors", { propName: "align", enumName: "align" }], // List enum props here
iconPropNamesArray: [], // List props that are typed as icons here
actionPropsArray: [] // List the component's actions here
component: Text
});

export default {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ type Story = StoryObj<typeof TextField>;

const metaSettings = createStoryMetaSettingsDecorator({
component: TextField,
enumPropNamesArray: ["type", "size"],
iconPropNamesArray: ["secondaryIconName", "iconName", "labelIconName"]
});

Expand Down
Loading