Skip to content

An open source design system that's fully customizable and agent ready

TypeScript

feat(Field): add WithLabelIcon story (#2475)

Andrey Goderbf8e85f16072
diff --git a/apps/storybook/stories/Field.stories.tsx b/apps/storybook/stories/Field.stories.tsx
index 15a8dc03b6..9d8d921d20 100644
--- a/apps/storybook/stories/Field.stories.tsx
+++ b/apps/storybook/stories/Field.stories.tsx
@@ -5,6 +5,7 @@ import type {Meta, StoryObj} from '@storybook/react';
import * as stylex from '@stylexjs/stylex';
import {XDSField} from '@xds/core/Field';
import {XDSTextInput} from '@xds/core/TextInput';
+import {EnvelopeIcon} from '@heroicons/react/24/outline';
import {
colorVars,
spacingVars,
@@ -181,6 +182,23 @@ export const WithTooltip: Story = {
},
};
+export const WithLabelIcon: Story = {
+ args: {label: 'Email', labelIcon: EnvelopeIcon},
+ render: args => {
+ const [value, setValue] = useState('');
+ return (
+ <XDSField {...args} inputID="email-icon-input">
+ <NativeInput
+ id="email-icon-input"
+ placeholder="[email protected]"
+ value={value}
+ onChange={setValue}
+ />
+ </XDSField>
+ );
+ },
+};
+
export const AllVariations: Story = {
render: () => {
const [vals, setVals] = useState({a: '', b: '', c: '', d: '', e: ''});