Skip to content
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
- `<Switch />`
- `noDrag` parameter: Add the `nodrag` class to the Switch element. Default: `true`

### Fixed

- `<PropertyValuePair />`
- fix description and story to point out that `PropertyValueList` need always to be used as wrapper

### Deprecated

- `preventReactFlowActionsClasses`: use `ClassNames.ReactFlow.preventAllActions`
Expand Down
3 changes: 3 additions & 0 deletions src/components/PropertyValuePair/PropertyValueList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ export interface PropertyValueListProps extends React.HTMLAttributes<HTMLDListEl
singleColumn?: boolean;
}

/**
* Need to be used to wrap one or more `PropertyValuePair` elements.
*/
export const PropertyValueList = ({
className = "",
children,
Expand Down
4 changes: 4 additions & 0 deletions src/components/PropertyValuePair/PropertyValuePair.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ export interface PropertyValuePairProps extends React.HTMLAttributes<HTMLDivElem
singleColumn?: boolean;
}

/**
* Parent container to group one `PropertyName` and one or more `PropertyValues`.
* Even if only one `PropertyValuePair` is used it need to be wrapped into an `PropertyValueList` container.
*/
export const PropertyValuePair = ({
children,
className = "",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import { Meta, StoryFn } from "@storybook/react";

import { PropertyName, PropertyValue, PropertyValuePair } from "../../../index";
import { PropertyName, PropertyValue, PropertyValueList, PropertyValuePair } from "../../../index";

import { Default as NameExample } from "./PropertyName.stories";
import { Default as ValueExample } from "./PropertyValue.stories";
Expand All @@ -21,7 +21,11 @@ export default {
},
} as Meta<typeof PropertyValuePair>;

const Template: StoryFn<typeof PropertyValuePair> = (args) => <PropertyValuePair {...args} />;
const Template: StoryFn<typeof PropertyValuePair> = (args) => (
<PropertyValueList>
<PropertyValuePair {...args} />
</PropertyValueList>
);

export const Default = Template.bind({});
Default.args = {
Expand Down
Loading