forked from NangoHQ/nango
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(connect): support for domain suffix, hidden fields, default value (
NangoHQ#2797) ## Describe your changes Fixes https://linear.app/nango/issue/NAN-1834/support-for-domain-suffix-hidden-fields-default-value - Support for domain suffix - Support for hidden fields For fields that are going to be shown in the UI (because they have a default value). Will be useful when I get session token values - Support for default value It's useful for some providers with static values (e.g: Freshdesk has a static password because they choose to use basic auth with an api key 🤦🏻 ). Will also be useful when I get session token values - Backfill domain suffix - Add some warnings in `validate.ts` so I can track progress -- <img width="518" alt="Screenshot 2024-10-01 at 15 06 11" src="https://github.com/user-attachments/assets/f27fa01e-bc86-4936-85ae-fa00f39ac0b2">
- Loading branch information
1 parent
535c879
commit 560b80a
Showing
7 changed files
with
201 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import * as React from 'react'; | ||
|
||
import { cn } from '@/lib/utils'; | ||
|
||
export type InputProps = React.InputHTMLAttributes<HTMLInputElement> & { | ||
prefix?: React.ReactNode; | ||
suffix?: React.ReactNode; | ||
fluid?: boolean; | ||
}; | ||
|
||
// until shadcn provide before/after it's going to be custom | ||
const CustomInput = React.forwardRef<HTMLInputElement, InputProps>(({ className, type, prefix, suffix, fluid, ...props }, ref) => { | ||
return ( | ||
<div className={cn('relative flex items-center bg-transparent w-full rounded border text-sm h-10 overflow-hidden')}> | ||
{prefix && <div className="h-10 px-2 leading-10 italic text-dark-500">{prefix}</div>} | ||
<input | ||
ref={ref} | ||
className={cn( | ||
'bg-transparent border-0 h-full w-full rounded focus-visible:ring-ring focus-visible:outline-none focus-visible:ring-1 file:border-0 file:bg-transparent file:text-sm file:font-medium outline-none disabled:text-text-light-gray disabled:cursor-not-allowed', | ||
'text-sm px-3 py-[10px] placeholder-gray-400', | ||
(fluid || suffix) && 'grow-0 [field-sizing:content] w-auto', | ||
className | ||
)} | ||
type={type} | ||
{...props} | ||
/> | ||
{suffix && <div className="h-10 px-2 leading-10 italic text-dark-500">{suffix}</div>} | ||
</div> | ||
); | ||
}); | ||
CustomInput.displayName = 'Input'; | ||
|
||
export { CustomInput }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.