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
46 changes: 46 additions & 0 deletions shared/aries-core/src/stories/components/TextInput.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import React from 'react';
import type { Meta, StoryObj } from '@storybook/react';
import { TextInput } from 'grommet';
import { Search } from '@hpe-design/icons-grommet';
import {
iconArg,
placeholderArg,
reverseArg,
heightArg,
textAlignArg,
} from '../utils/commonArgs';

const meta = {
title: 'Components/TextInput',
component: TextInput,
argTypes: {
defaultSuggestion: {
control: { type: 'number' },
},
dropHeight: heightArg,
icon: iconArg,
placeholder: placeholderArg,
reverse: reverseArg,
suggestions: {
control: { type: 'object' },
},
textAlign: textAlignArg,
},
} satisfies Meta<typeof TextInput>;

export default meta;
type Story = StoryObj<typeof meta>;

export const SearchExample = {
name: 'Search',
render: args => <TextInput {...args} />,
args: {
defaultSuggestion: undefined,
dropHeight: undefined,
icon: <Search />,
placeholder: 'Search',
reverse: true,
suggestions: ['Suggestion 1', 'Suggestion 2', 'Suggestion 3'],
textAlign: undefined,
},
} satisfies Story;
9 changes: 9 additions & 0 deletions shared/aries-core/src/stories/utils/commonArgs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ export const disabledArg: ArgType = {
control: { type: 'boolean' },
};

export const dropAlignArg: ArgType = {
control: { type: 'object' },
};

export const elevationArg: ArgType = {
control: { type: 'select' },
options: tShirtSizes,
Expand Down Expand Up @@ -153,6 +157,11 @@ export const skeletonArg: ArgType = {
control: { type: 'boolean' },
};

export const textAlignArg: ArgType = {
control: { type: 'select' },
options: ['start', 'center', 'end'],
};

export const textSizesArg: ArgType = {
control: { type: 'select' },
options: textSizes,
Expand Down