Skip to content

Commit

Permalink
feat(filters stories): clean up story code a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
ByronDWall committed Oct 30, 2024
1 parent d12822a commit 205b1d4
Showing 1 changed file with 27 additions and 13 deletions.
40 changes: 27 additions & 13 deletions packages/components/filters/src/filters.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,30 @@ type TFiltersPropsWithCustomArgs = TFiltersProps & {
isDisabled?: boolean;
isPersistent?: boolean;
};

const CustomSearchExample = () => <div>im an example</div>;

const SelectedValueWithOperator = ({
operator,
value,
}: {
operator: string;
value: string;
}) => (
<div>
<span
css={{
fontStyle: 'italic',
marginRight: '4px',
fontWeight: '600',
}}
>
{operator}
</span>
{value}
</div>
);

const meta: Meta<TFiltersPropsWithCustomArgs> = {
title: 'components/Filters',
component: Filters,
Expand All @@ -55,7 +77,7 @@ const meta: Meta<TFiltersPropsWithCustomArgs> = {
control: false,
table: {
type: {
detail: 'see "PRIMARY COLORS SECTION" for controls',
detail: 'see "PRIMARY COLORS FILTER" section below for controls',
},
},
},
Expand Down Expand Up @@ -183,18 +205,10 @@ export const BasicExample: Story = (props: TFiltersPropsWithCustomArgs) => {
value: value,
// display selected operator in selected value if an operators input is rendered
label: props.renderOperatorsInput ? (
<div>
<span
css={{
fontStyle: 'italic',
marginRight: '4px',
fontWeight: '600',
}}
>
{primaryColorOperator}
</span>
{value}
</div>
<SelectedValueWithOperator
operator={primaryColorOperator}
value={value}
/>
) : (
value
),
Expand Down

0 comments on commit 205b1d4

Please sign in to comment.