-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: added raio input to fix styles & ui bump
- Loading branch information
1 parent
e0d1cad
commit 5dfc0b2
Showing
11 changed files
with
85 additions
and
20 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
42 changes: 42 additions & 0 deletions
42
...rc/components/organisms/UIRenderer/elements/JSONForm/components/RadioInput/RadioInput.tsx
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,42 @@ | ||
import { Label, RadioGroup, RadioGroupItem, RJSFInputAdapter, TOneOfItem } from '@ballerine/ui'; | ||
import { useMemo } from 'react'; | ||
|
||
export const RadioInputAdapter: RJSFInputAdapter<string> = ({ | ||
id, | ||
schema, | ||
formData, | ||
disabled, | ||
testId, | ||
onBlur, | ||
onChange, | ||
}) => { | ||
const options = useMemo( | ||
() => (schema?.oneOf as TOneOfItem[])?.map(item => ({ label: item.title, value: item.const })), | ||
[schema], | ||
); | ||
|
||
return options?.length ? ( | ||
<RadioGroup | ||
value={formData} | ||
onValueChange={onChange} | ||
onBlur={() => onBlur(id as string, formData)} | ||
disabled={disabled} | ||
data-testid={testId ? `${testId}-radio-group` : undefined} | ||
> | ||
{options.map(({ value, label }) => ( | ||
<div | ||
className="flex items-center space-x-2" | ||
key={`radio-group-item-${value}`} | ||
data-testid={testId ? `${testId}-radio-group-item` : undefined} | ||
> | ||
<RadioGroupItem | ||
className="border-secondary text-black" | ||
value={value} | ||
id={`radio-group-item-${value}`} | ||
></RadioGroupItem> | ||
<Label htmlFor={`radio-group-item-${value}`}>{label}</Label> | ||
</div> | ||
))} | ||
</RadioGroup> | ||
) : null; | ||
}; |
1 change: 1 addition & 0 deletions
1
...-app/src/components/organisms/UIRenderer/elements/JSONForm/components/RadioInput/index.ts
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 @@ | ||
export * from './RadioInput'; |
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
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 |
---|---|---|
@@ -1,5 +1,11 @@ | ||
# @ballerine/ui | ||
|
||
## 0.5.19 | ||
|
||
### Patch Changes | ||
|
||
- Updated exports | ||
|
||
## 0.5.18 | ||
|
||
### Patch Changes | ||
|
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 |
---|---|---|
@@ -1,25 +1,26 @@ | ||
export * from './AnchorIfUrl'; | ||
export * from './Badge'; | ||
export * from './BallerineLink'; | ||
export * from './Button'; | ||
export * from './Card'; | ||
export * from './CheckCircle'; | ||
export * from './Collapsible'; | ||
export * from './Command'; | ||
export * from './DefaultTableCell'; | ||
export * from './Dialog'; | ||
export * from './Dropdown'; | ||
export * from './ErrorMessage'; | ||
export * from './HealthIndicator'; | ||
export * from './HoverCard'; | ||
export * from './IconContainer'; | ||
export * from './Image'; | ||
export * from './inputs'; | ||
export * from './Label'; | ||
export * from './Paper'; | ||
export * from './Popover'; | ||
export * from './RadioGroup'; | ||
export * from './ScrollArea'; | ||
export * from './Skeleton'; | ||
export * from './Table'; | ||
export * from './ErrorMessage'; | ||
export * from './HoverCard'; | ||
export * from './WarningFilledSvg'; | ||
export * from './BallerineLink'; | ||
export * from './AnchorIfUrl'; | ||
export * from './TextWithNAFallback'; | ||
export * from './Image'; | ||
export * from './Collapsible'; | ||
export * from './Skeleton'; | ||
export * from './IconContainer'; | ||
export * from './CheckCircle'; | ||
export * from './DefaultTableCell'; | ||
export * from './WarningFilledSvg'; |
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 |
---|---|---|
@@ -1,10 +1,11 @@ | ||
import { ArrayFieldTemplateProps } from '@rjsf/utils'; | ||
|
||
export * from './DynamicForm'; | ||
export * from './components/RSJVInputAdaters'; | ||
export * from './components/layouts'; | ||
export * from './components/custom-inputs'; | ||
export * from './components/layouts'; | ||
export * from './components/RSJVInputAdaters'; | ||
export * from './DynamicForm'; | ||
export { fields as baseFields } from './fields'; | ||
export { layouts as baseLayouts } from './layouts'; | ||
export * from './types/one-of'; | ||
|
||
export type FieldLayoutProps = ArrayFieldTemplateProps; |