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
2 changes: 1 addition & 1 deletion apps/www/src/components/preview/preview.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
justify-content: center;
align-items: center;
overflow: auto;
}
}
8 changes: 8 additions & 0 deletions apps/www/src/content/docs/components/input-field/demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export const playground = {
optional: { type: 'checkbox', defaultValue: false },
prefix: { type: 'text', initialValue: '' },
suffix: { type: 'text', initialValue: '' },
width: { type: 'text', initialValue: '560px' },
size: {
type: 'select',
options: ['small', 'large'],
Expand All @@ -33,6 +34,7 @@ export const basicDemo = {
<InputField
label="Default"
placeholder="Enter text"
width="560px"
/>`
};
export const helperTextDemo = {
Expand All @@ -42,6 +44,7 @@ export const helperTextDemo = {
label="With label"
placeholder="Enter text"
helperText="This is a helper text"
width="560px"
/>`
};
export const errorDemo = {
Expand All @@ -51,6 +54,7 @@ export const errorDemo = {
label="With Error"
placeholder="Enter text"
error="This field is required"
width="560px"
/>`
};
export const prefixDemo = {
Expand All @@ -61,6 +65,7 @@ export const prefixDemo = {
placeholder="0.00"
prefix="$"
suffix="USD"
width="560px"
/>`
};
export const iconDemo = {
Expand All @@ -71,6 +76,7 @@ export const iconDemo = {
placeholder="Enter text"
leadingIcon={<Home size={16}/>}
trailingIcon={<Info size={16}/>}
width="560px"
/>`
};
export const optionalDemo = {
Expand All @@ -80,6 +86,7 @@ export const optionalDemo = {
label="Optional Field"
placeholder="Enter text"
optional
width="560px"
/>`
};
export const disabledDemo = {
Expand All @@ -89,6 +96,7 @@ export const disabledDemo = {
label="Disabled"
placeholder="Enter text"
disabled
width="560px"
/>`
};
export const widthDemo = {
Expand Down
13 changes: 9 additions & 4 deletions packages/raystack/components/input-field/input-field.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,15 @@ export const InputField = forwardRef<HTMLInputElement, InputFieldProps>(
{optional && <span className={styles.optional}>(optional)</span>}
</label>
{infoTooltip && (
<Tooltip message={infoTooltip} side='right'>
<span className={styles.helpIcon}>
<InfoCircledIcon />
</span>
<Tooltip>
<Tooltip.Trigger
render={
<span className={styles.helpIcon}>
<InfoCircledIcon />
</span>
}
/>
<Tooltip.Content side='right'>{infoTooltip}</Tooltip.Content>
</Tooltip>
)}
</div>
Expand Down
Loading