Skip to content

Commit

Permalink
fix: added raio input to fix styles & ui bump
Browse files Browse the repository at this point in the history
  • Loading branch information
chesterkmr committed Aug 29, 2024
1 parent e0d1cad commit 5dfc0b2
Show file tree
Hide file tree
Showing 11 changed files with 85 additions and 20 deletions.
7 changes: 7 additions & 0 deletions apps/kyb-app/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# kyb-app

## 0.3.40

### Patch Changes

- Updated dependencies
- @ballerine/ui@0.5.19

## 0.3.39

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions apps/kyb-app/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@ballerine/kyb-app",
"private": true,
"version": "0.3.39",
"version": "0.3.40",
"type": "module",
"scripts": {
"dev": "vite",
Expand All @@ -16,7 +16,7 @@
"dependencies": {
"@ballerine/blocks": "0.2.12",
"@ballerine/common": "^0.9.23",
"@ballerine/ui": "0.5.18",
"@ballerine/ui": "0.5.19",
"@ballerine/workflow-browser-sdk": "0.6.35",
"@lukemorales/query-key-factory": "^1.0.3",
"@radix-ui/react-icons": "^1.3.0",
Expand Down
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;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './RadioInput';
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { LocalePicker } from '@/components/organisms/UIRenderer/elements/JSONFor
import { MCCPicker } from '@/components/organisms/UIRenderer/elements/JSONForm/components/MCCPicker';
import { Multiselect } from '@/components/organisms/UIRenderer/elements/JSONForm/components/Multiselect/Multiselect';
import { NationalityPicker } from '@/components/organisms/UIRenderer/elements/JSONForm/components/NationalityPicker';
import { RadioInputAdapter } from '@/components/organisms/UIRenderer/elements/JSONForm/components/RadioInput';
import { RelationshipDropdown } from '@/components/organisms/UIRenderer/elements/JSONForm/components/RelationshipDropdown';
import { StatePicker } from '@/components/organisms/UIRenderer/elements/JSONForm/components/StatePicker';
import { TagsInput } from '@/components/organisms/UIRenderer/elements/JSONForm/components/TagsInput';
Expand All @@ -19,7 +20,6 @@ import {
DateInputAdapter,
FileInputAdapter,
PhoneInputAdapter,
RadioInputAdapter,
TextInputAdapter,
} from '@ballerine/ui';

Expand Down
7 changes: 7 additions & 0 deletions packages/react-pdf-toolkit/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @ballerine/react-pdf-toolkit

## 1.2.19

### Patch Changes

- Updated dependencies
- @ballerine/ui@0.5.19

## 1.2.18

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/react-pdf-toolkit/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@ballerine/react-pdf-toolkit",
"private": false,
"version": "1.2.18",
"version": "1.2.19",
"types": "./dist/build.d.ts",
"main": "./dist/react-pdf-toolkit.js",
"module": "./dist/react-pdf-toolkit.mjs",
Expand All @@ -27,7 +27,7 @@
},
"dependencies": {
"@ballerine/config": "^1.1.11",
"@ballerine/ui": "0.5.18",
"@ballerine/ui": "0.5.19",
"@react-pdf/renderer": "^3.1.14",
"@sinclair/typebox": "^0.31.7",
"ajv": "^8.12.0",
Expand Down
6 changes: 6 additions & 0 deletions packages/ui/CHANGELOG.md
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
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@ballerine/ui",
"private": false,
"version": "0.5.18",
"version": "0.5.19",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
23 changes: 12 additions & 11 deletions packages/ui/src/components/atoms/index.ts
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';
7 changes: 4 additions & 3 deletions packages/ui/src/components/organisms/DynamicForm/index.ts
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;

0 comments on commit 5dfc0b2

Please sign in to comment.